Ejemplo n.º 1
0
 private void LoadCommands()
 {
     lvwCommands.Items.Clear();
     foreach (var cd in SqliteConnector.GetCommands())
     {
         var ci = new ListViewItem(cd.Title);
         ci.Tag = cd;
         ci.SubItems.Add(cd.Command);
         lvwCommands.Items.Add(ci);
     }
 }
Ejemplo n.º 2
0
        private void btnCommands_Click(object sender, EventArgs e)
        {
            var cms = new ContextMenuStrip();

            foreach (var cd in SqliteConnector.GetCommands())
            {
                var cdItem = new ToolStripMenuItem();
                cdItem.Tag    = cd;
                cdItem.Text   = cd.Title;
                cdItem.Click += new EventHandler(cdItem_Click);
                cms.Items.Add(cdItem);
            }

            var pButtonPosition = PointToScreen(btnCommands.Location);
            var pMenuPosition   = new Point(pButtonPosition.X + 10, pButtonPosition.Y + 50);

            cms.Show(pMenuPosition);
        }
Ejemplo n.º 3
0
		private void btnSettings_Click(object sender, EventArgs e)
		{
			var oSettings = new frmSettings();
			oSettings.ShowDialog();

			//Reload Search providers
			_apkCommands = SqliteConnector.GetCommands();
			InsertCommandsInContextMenu();

			//Check again if grouping is enabled
			CheckGroupResults();

			//Check if grouping for subfolder is enabled
			CheckNewGroupSub();

			//Search again if needed
			if (oSettings.SettingsChanged)
			{
				if (MessageBox.Show("It appears the settings have been changed. Do you want to refresh results?", "Settings Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
				{
                    StartSearch();
				}
			}
		}
Ejemplo n.º 4
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            //Check directories & files
            clsUtils.CheckDirectories();

            //Restore window position/size
            var windowInfo = clsSettings.GetMainWindowInfo();
	        if (windowInfo != null)
	        {
				if (windowInfo.Maximized)
				{
					Location = windowInfo.Location;
					Size = windowInfo.Size;
					WindowState = FormWindowState.Maximized;
				}
				else if (windowInfo.Minimized)
				{
					Location = windowInfo.Location;
					Size = windowInfo.Size;
					WindowState = FormWindowState.Minimized;
				}
				else
				{
					Location = windowInfo.Location;
					Size = windowInfo.Size;
				}
	        }

            //Restore bottom panel height
            var bottomPanelHeight = SqliteConnector.GetSettingValue(SettingEnum.BottomPanelHeight);
            if (!string.IsNullOrWhiteSpace(bottomPanelHeight))
            {
                scMain.SplitterDistance = scMain.Height - Convert.ToInt32(bottomPanelHeight);
            }

            //Restore column widths
            var columnWidthFilename = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthFilename);
            if (!string.IsNullOrWhiteSpace(columnWidthFilename))
            {
                lvMain.Columns[(int) ApkColumn.FileName].Width = Convert.ToInt32(columnWidthFilename);
            }
            var columnWidthPackage = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthPackage);
            if (!string.IsNullOrWhiteSpace(columnWidthPackage))
            {
                lvMain.Columns[(int) ApkColumn.PackageName].Width = Convert.ToInt32(columnWidthPackage);
            }
            var columnWidthInternalname = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthInternalname);
            if (!string.IsNullOrWhiteSpace(columnWidthInternalname))
            {
                lvMain.Columns[(int) ApkColumn.InternalName].Width = Convert.ToInt32(columnWidthInternalname);
            }
            var columnWidthGoogleplayname = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthGoogleplayname);
            if (!string.IsNullOrWhiteSpace(columnWidthGoogleplayname))
            {
                lvMain.Columns[(int) ApkColumn.GooglePlayName].Width = Convert.ToInt32(columnWidthGoogleplayname);
            }
            var columnWidthCategory = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthCategory);
            if (!string.IsNullOrWhiteSpace(columnWidthCategory))
            {
                lvMain.Columns[(int) ApkColumn.Category].Width = Convert.ToInt32(columnWidthCategory);
            }
            var columnWidthLocalversion = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthLocalversion);
            if (!string.IsNullOrWhiteSpace(columnWidthLocalversion))
            {
                lvMain.Columns[(int) ApkColumn.LocalVersion].Width = Convert.ToInt32(columnWidthLocalversion);
            }
            var columnWidthLatestversion = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthLatestversion);
            if (!string.IsNullOrWhiteSpace(columnWidthLatestversion))
            {
                lvMain.Columns[(int) ApkColumn.LatestVersion].Width = Convert.ToInt32(columnWidthLatestversion);
            }
            var columnWidthPrice = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthPrice);
            if (!string.IsNullOrWhiteSpace(columnWidthPrice))
            {
                lvMain.Columns[(int) ApkColumn.Price].Width = Convert.ToInt32(columnWidthPrice);
            }
            var columnWidthGoogleplayfetch = SqliteConnector.GetSettingValue(SettingEnum.ColumnWidthGoogleplayfetch);
            if (!string.IsNullOrWhiteSpace(columnWidthGoogleplayfetch))
            {
                lvMain.Columns[(int) ApkColumn.RefreshDate].Width = Convert.ToInt32(columnWidthGoogleplayfetch);
            }

            //Sort column
            var columnSortIndex = SqliteConnector.GetSettingValue(SettingEnum.ColumnSortIndex);
            if (!string.IsNullOrWhiteSpace(columnSortIndex))
            {
                lvMain.EmulateColumnClick(Convert.ToInt32(columnSortIndex));
            }
            else
            {
                lvMain.EmulateColumnClick(0);
            }

            //Change permissions/features backcolors
            txtFeaturesValue.BackColor = SystemColors.Window;
			txtPermissionsValue.BackColor = SystemColors.Window;
            
            //Load Commands
			_apkCommands = SqliteConnector.GetCommands();
            InsertCommandsInContextMenu();

            //Group Results
            CheckGroupResults();

            //New group for each subfolder
            CheckNewGroupSub();

            //Search in background
            if (Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.StartupRefresh)))
            {
                StartSearch();
            }
        }