Exemple #1
0
 private void mLanguage_Click(object sender, EventArgs e)
 {
     using (frmLanguage language = new frmLanguage()) {
         switch (language.ShowDialog())
         {
         case System.Windows.Forms.DialogResult.Yes:
             if (language.LanguageFile == null)
             {
                 Settings.Default.LanguageFile = string.Empty;
             }
             else
             {
                 Settings.Default.LanguageFile = language.LanguageFile;
             }
             if (!Program.IsPortable)
             {
                 Settings.Default.Save();
             }
             else
             {
                 Ini.WriteString("LanguageFile", language.LanguageFile, "Settings");
             }
             LoadLanguage(true);
             CalculateLocations();
             break;
         }
     }
 }
 public static void CreatePortableSettings()
 {
     Ini.WriteBool("FirstTime", true, "youtube-dl-gui");
     Ini.WriteString("downloadPath", Downloads.Default.downloadPath, "Downloads");
 }
 public static void SavePortableSettings()
 {
     #region Batch
     Ini.WriteInt("SelectedType", Batch.Default.SelectedType, "Batch");
     Ini.WriteInt("SelectedVideoQuality", Batch.Default.SelectedVideoQuality, "Batch");
     Ini.WriteInt("SelectedVideoFormat", Batch.Default.SelectedVideoFormat, "Batch");
     Ini.WriteInt("SelectedAudioQuality", Batch.Default.SelectedAudioQuality, "Batch");
     Ini.WriteInt("SelectedAudioFormat", Batch.Default.SelectedAudioFormat, "Batch");
     Ini.WriteBool("DownloadVideoSound", Batch.Default.DownloadVideoSound, "Batch");
     Ini.WriteBool("DownloadAudioVBR", Batch.Default.DownloadAudioVBR, "Batch");
     Ini.WriteInt("SelectedAudioQualityVBR", Batch.Default.SelectedAudioQualityVBR, "Batch");
     Ini.WriteString("CustomArguments", Batch.Default.CustomArguments, "Batch");
     #endregion
     #region Converts
     Ini.WriteBool("detectFiletype", Converts.Default.detectFiletype, "Converts");
     Ini.WriteBool("clearOutput", Converts.Default.clearOutput, "Converts");
     Ini.WriteBool("clearInput", Converts.Default.clearInput, "Converts");
     Ini.WriteInt("videoBitrate", Converts.Default.videoBitrate, "Converts");
     Ini.WriteInt("videoPreset", Converts.Default.videoPreset, "Converts");
     Ini.WriteInt("videoProfile", Converts.Default.videoProfile, "Converts");
     Ini.WriteInt("videoCRF", Converts.Default.videoCRF, "Converts");
     Ini.WriteBool("videoFastStart", Converts.Default.videoFastStart, "Converts");
     Ini.WriteBool("hideFFmpegCompile", Converts.Default.hideFFmpegCompile, "Converts");
     Ini.WriteInt("audioBitrate", Converts.Default.audioBitrate, "Converts");
     Ini.WriteBool("videoUseBitrate", Converts.Default.videoUseBitrate, "Converts");
     Ini.WriteBool("videoUsePreset", Converts.Default.videoUsePreset, "Converts");
     Ini.WriteBool("videoUseProfile", Converts.Default.videoUseProfile, "Converts");
     Ini.WriteBool("videoUseCRF", Converts.Default.videoUseCRF, "Converts");
     Ini.WriteBool("audioUseBitrate", Converts.Default.audioUseBitrate, "Converts");
     #endregion
     #region Downloads
     Ini.WriteString("downloadPath", Downloads.Default.downloadPath, "Downloads");
     Ini.WriteBool("separateDownloads", Downloads.Default.separateDownloads, "Downloads");
     Ini.WriteBool("SaveFormatQuality", Downloads.Default.SaveFormatQuality, "Downloads");
     Ini.WriteBool("deleteYtdlOnClose", Downloads.Default.deleteYtdlOnClose, "Downloads");
     Ini.WriteBool("useYtdlUpdater", Downloads.Default.useYtdlUpdater, "Downloads");
     Ini.WriteString("fileNameSchema", Downloads.Default.fileNameSchema, "Downloads");
     Ini.WriteBool("fixReddit", Downloads.Default.fixReddit, "Downloads");
     Ini.WriteBool("separateIntoWebsiteURL", Downloads.Default.separateIntoWebsiteURL, "Downloads");
     Ini.WriteBool("SaveSubtitles", Downloads.Default.SaveSubtitles, "Downloads");
     Ini.WriteString("subtitlesLanguages", Downloads.Default.subtitlesLanguages, "Downloads");
     Ini.WriteBool("CloseDownloaderAfterFinish", Downloads.Default.CloseDownloaderAfterFinish, "Downloads");
     Ini.WriteBool("UseProxy", Downloads.Default.UseProxy, "Downloads");
     Ini.WriteInt("ProxyType", Downloads.Default.ProxyType, "Downloads");
     Ini.WriteString("ProxyIP", Downloads.Default.ProxyIP, "Downloads");
     Ini.WriteString("ProxyPort", Downloads.Default.ProxyPort, "Downloads");
     Ini.WriteBool("SaveThumbnail", Downloads.Default.SaveThumbnail, "Downloads");
     Ini.WriteBool("SaveDescription", Downloads.Default.SaveDescription, "Downloads");
     Ini.WriteBool("SaveVideoInfo", Downloads.Default.SaveVideoInfo, "Downloads");
     Ini.WriteBool("SaveAnnotations", Downloads.Default.SaveAnnotations, "Downloads");
     Ini.WriteString("SubtitleFormat", Downloads.Default.SubtitleFormat, "Downloads");
     Ini.WriteInt("DownloadLimit", Downloads.Default.DownloadLimit, "Downloads");
     Ini.WriteInt("RetryAttempts", Downloads.Default.RetryAttempts, "Downloads");
     Ini.WriteInt("DownloadLimitType", Downloads.Default.DownloadLimitType, "Downloads");
     Ini.WriteBool("ForceIPv4", Downloads.Default.ForceIPv4, "Downloads");
     Ini.WriteBool("ForceIPv6", Downloads.Default.ForceIPv6, "Downloads");
     Ini.WriteBool("LimitDownloads", Downloads.Default.LimitDownloads, "Downloads");
     Ini.WriteBool("EmbedSubtitles", Downloads.Default.EmbedSubtitles, "Downloads");
     Ini.WriteBool("EmbedThumbnails", Downloads.Default.EmbedThumbnails, "Downloads");
     Ini.WriteBool("VideoDownloadSound", Downloads.Default.VideoDownloadSound, "Downloads");
     Ini.WriteBool("AudioDownloadAsVBR", Downloads.Default.AudioDownloadAsVBR, "Downloads");
     Ini.WriteBool("KeepOriginalFiles", Downloads.Default.KeepOriginalFiles, "Downloads");
     Ini.WriteBool("WriteMetadata", Downloads.Default.WriteMetadata, "Downloads");
     #endregion
     #region Errors
     Ini.WriteBool("detailedErrors", Errors.Default.detailedErrors, "Errors");
     Ini.WriteBool("logErrors", Errors.Default.logErrors, "Errors");
     Ini.WriteBool("suppressErrors", Errors.Default.suppressErrors, "Errors");
     #endregion
     #region General
     Ini.WriteBool("UseStaticYtdl", General.Default.UseStaticYtdl, "General");
     Ini.WriteString("ytdlPath", General.Default.ytdlPath, "General");
     Ini.WriteBool("UseStaticFFmpeg", General.Default.UseStaticFFmpeg, "General");
     Ini.WriteString("ffmpegPath", General.Default.ffmpegPath, "General");
     Ini.WriteBool("CheckForUpdatesOnLaunch", General.Default.CheckForUpdatesOnLaunch, "General");
     Ini.WriteBool("HoverOverURLTextBoxToPaste", General.Default.HoverOverURLTextBoxToPaste, "General");
     Ini.WriteBool("ClearURLOnDownload", General.Default.ClearURLOnDownload, "General");
     Ini.WriteInt("SaveCustomArgs", General.Default.SaveCustomArgs, "General");
     Ini.WriteBool("ClearClipboardOnDownload", General.Default.ClearClipboardOnDownload, "General");
     #endregion
     #region Saved
     Ini.WriteInt("downloadType", Saved.Default.downloadType, "Saved");
     Ini.WriteString("downloadArgs", Saved.Default.downloadArgs, "Saved");
     Ini.WriteBool("formTrue0", Saved.Default.formTrue0, "Saved");
     Ini.WriteInt("convertSaveVideoIndex", Saved.Default.convertSaveVideoIndex, "Saved");
     Ini.WriteInt("convertSaveAudioIndex", Saved.Default.convertSaveAudioIndex, "Saved");
     Ini.WriteInt("convertType", Saved.Default.convertType, "Saved");
     Ini.WriteString("convertCustom", Saved.Default.convertCustom, "Saved");
     Ini.WriteInt("videoQuality", Saved.Default.videoQuality, "Saved");
     Ini.WriteInt("audioQuality", Saved.Default.audioQuality, "Saved");
     Ini.WriteInt("VideoFormat", Saved.Default.VideoFormat, "Saved");
     Ini.WriteInt("AudioFormat", Saved.Default.AudioFormat, "Saved");
     Ini.WriteInt("AudioVBRQuality", Saved.Default.AudioVBRQuality, "Saved");
     Ini.WriteInt("BatchFormX", Saved.Default.BatchFormX, "Saved");
     Ini.WriteInt("BatchFormY", Saved.Default.BatchFormY, "Saved");
     Ini.WriteSize("MainFormSize", Saved.Default.MainFormSize, "Saved");
     Ini.WriteSize("SettingsFormSize", Saved.Default.SettingsFormSize, "Saved");
     #endregion
     #region Settings
     Ini.WriteString("extensionsName", Settings.Default.extensionsName, "Settings");
     Ini.WriteString("extensionsShort", Settings.Default.extensionsShort, "Settings");
     Ini.WriteString("LanguageFile", Settings.Default.LanguageFile, "Settings");
     #endregion
 }