Ejemplo n.º 1
0
	    private void CheckGroupResults()
        {
            if (Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.GroupResults)))
            {
                _groupResults = true;
            }
            else
            {
                _groupResults = false;
            }
        }
Ejemplo n.º 2
0
 private void CheckNewGroupSub()
 {
     if (Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.SubdirGroup)))
     {
         _newGroupSub = true;
     }
     else
     {
         _newGroupSub = false;
     }
 }
Ejemplo n.º 3
0
 private void LoadExtendedInfo()
 {
     if (Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.AutoFetchGooglePlay)))
     {
         var packageNames = SqliteConnector.GetNewPackageNamesFromHashes(_hashes);
         RefreshPackages(packageNames);
     }
     else
     {
         FinishSearch();
     }
 }
Ejemplo n.º 4
0
        private void LoadGeneralSettings()
        {
            //Download Latest Version Info
            chkFetchGooglePlay.Checked = Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.AutoFetchGooglePlay));

            //Refresh on Startup
            chkStartupSearch.Checked = Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.StartupRefresh));;

            //Group Results
            chkGroupResults.Checked = Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.GroupResults));;

            //New group for every subfolder
            chkNewGroupSub.Checked = Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.SubdirGroup));;
        }
Ejemplo n.º 5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            var outputString = new StringBuilder();
            var delimiter    = txtDelimiter.Text;

            foreach (var apkFile in _apkFiles)
            {
                outputString.Append(apkFile.ShortFileName);                      //ShortFileName
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.DirectoryName);                      //DirectoryName
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.LongFileName);                       //LongFileName
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.PackageName);                        //PackageName
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.InternalName);                       //InternalName
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.GooglePlayName);                     //GooglePlayName
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.Category);                           //Category
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.LocalVersion);                       //LocalVersion
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.LatestVersion);                      //LatestVersion
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.Append(apkFile.Price);                              //Price
                outputString.Append(delimiter.Equals("\\t") ? "\t" : delimiter); //Delimiter
                outputString.AppendLine();                                       //New line
            }

            var longFilename  = SqliteConnector.GetSettingValue(SettingEnum.ExportFilename);
            var shortFilename = Path.GetFileName(longFilename);
            var directory     = Path.GetDirectoryName(longFilename);

            if (!string.IsNullOrWhiteSpace(longFilename))
            {
                sfdMain.FileName = shortFilename;
                if (Directory.Exists(directory))
                {
                    sfdMain.InitialDirectory = directory;
                }
            }
            if (sfdMain.ShowDialog() == DialogResult.OK)
            {
                File.WriteAllText(sfdMain.FileName, outputString.ToString());
                SqliteConnector.SetSettingValue(SettingEnum.ExportDelimiter, txtDelimiter.Text);
                SqliteConnector.SetSettingValue(SettingEnum.ExportFilename, sfdMain.FileName);
                Close();
            }
        }
Ejemplo n.º 6
0
        public frmExport(List <ApkFile> apkFiles)
        {
            InitializeComponent();

            _apkFiles = apkFiles;

            var delimiter = SqliteConnector.GetSettingValue(SettingEnum.ExportDelimiter);

            if (!string.IsNullOrWhiteSpace(delimiter))
            {
                txtDelimiter.Text = delimiter;
            }
            else
            {
                txtDelimiter.Text = "\\t";
            }
        }
Ejemplo n.º 7
0
 private void frmMassRename_Load(object sender, EventArgs e)
 {
     txtFormat.Text = SqliteConnector.GetSettingValue(SettingEnum.MassRenameString);
 }
Ejemplo n.º 8
0
 private void frmRefreshOlderThan_Load(object sender, EventArgs e)
 {
     tbMain.Value = Convert.ToInt32(SqliteConnector.GetSettingValue(SettingEnum.RefreshDays));
     SetMainLabel();
 }
Ejemplo n.º 9
0
        private void ShowInfo()
        {
            var apkFile = new ApkFile {
                LongFileName = _fileName
            };

            //Filename
            lblFilenameValue.Text = apkFile.ShortFileName;

            Text = string.Format("Properties of {0}", apkFile.ShortFileName);

            //Read APK File
            apkFile = SqliteConnector.ReadApkFile(apkFile);

            //Package
            lblPackageNameValue.Text = apkFile.PackageName;

            //Internal name
            lblInternalNameValue.Text = apkFile.InternalName;

            //Google Play name
            lblGooglePlayNameValue.Text = apkFile.GooglePlayName;

            //Local Version
            lblLocalVersionValue.Text = apkFile.LocalVersion;

            //Latest Version
            lblLatestVersionValue.Text = apkFile.LatestVersion;

            //Category
            lblCategoryValue.Text = apkFile.Category;

            //Price
            lblPriceValue.Text = apkFile.Price;

            //Version code
            lblVersionCodeValue.Text = apkFile.VersionCode;

            //Minium SDK Version
            lblMinSDKVersionValue.Text = clsUtils.TranslateSdkVersion(apkFile.MinimumSdkVersion);

            //Target SDK Version
            lblTargetSDKVersionValue.Text = clsUtils.TranslateSdkVersion(apkFile.TargetSdkVersion);

            //Permissions
            if (apkFile.Permissions.Count > 0)
            {
                txtPermissionsValue.Text = string.Empty;
                foreach (var permission in apkFile.Permissions)
                {
                    txtPermissionsValue.Text += string.Format("{0}\r\n", permission);
                }
                txtPermissionsValue.Text = txtPermissionsValue.Text.Remove(txtPermissionsValue.Text.Length - 2, 2);
            }

            //Features
            if (apkFile.Features.Count > 0)
            {
                txtFeaturesValue.Text = string.Empty;
                foreach (var feature in apkFile.Features)
                {
                    txtFeaturesValue.Text += string.Format("{0}\r\n", feature);
                }
                txtFeaturesValue.Text = txtFeaturesValue.Text.Remove(txtFeaturesValue.Text.Length - 2, 2);
            }

            //Screen sizes
            if (apkFile.ScreenSizes.Count > 0)
            {
                lblScreenSizesValue.Text = string.Empty;
                foreach (var screenSize in apkFile.ScreenSizes)
                {
                    lblScreenSizesValue.Text += string.Format("{0}, ", screenSize);
                }
                lblScreenSizesValue.Text = lblScreenSizesValue.Text.Remove(lblScreenSizesValue.Text.Length - 2, 2);
            }

            //Screen densities
            if (apkFile.ScreenDensities.Count > 0)
            {
                lblScreenDensitiesValue.Text = string.Empty;
                foreach (var screenDensity in apkFile.ScreenDensities)
                {
                    lblScreenDensitiesValue.Text += string.Format("{0}, ", screenDensity);
                }
                lblScreenDensitiesValue.Text = lblScreenDensitiesValue.Text.Remove(lblScreenDensitiesValue.Text.Length - 2, 2);
            }

            //Icon
            Task.Factory.StartNew(() => SqliteConnector.ReadIcon(apkFile)).ContinueWith(t => SetApkIcon(t.Result));

            //Fetch details
            if (!apkFile.LastGooglePlayFetch.HasValue && (!apkFile.GooglePlayFetchFail.HasValue || !apkFile.GooglePlayFetchFail.Value) && Convert.ToBoolean(SqliteConnector.GetSettingValue(SettingEnum.AutoFetchGooglePlay)))
            {
                btnRefreshDetails.Enabled = false;
                var wc = new WebClient {
                    Encoding = Encoding.UTF8
                };
                wc.DownloadStringCompleted += Wc_DownloadStringCompleted;
                wc.DownloadStringAsync(new Uri(GooglePlayHelper.GetUrlForPackageName(apkFile.PackageName, true)), apkFile.PackageName);
            }
            else
            {
                btnRefreshDetails.Enabled = true;
            }
        }
Ejemplo n.º 10
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();
            }
        }