using System.Diagnostics;\r
using System.Globalization;\r
using System.Windows.Forms;\r
- using Functions;\r
\r
+ using HandBrake.ApplicationServices;\r
+\r
+ using Handbrake.Functions;\r
+ using Handbrake.Model;\r
+ using Handbrake.Properties;\r
+\r
+ /// <summary>\r
+ /// The Options Window\r
+ /// </summary>\r
public partial class frmOptions : Form\r
{\r
private frmMain mainWindow;\r
+ private bool optionsWindowLoading = true;\r
\r
public frmOptions(frmMain mw)\r
{\r
\r
drop_preferredLang.SelectedItem = Properties.Settings.Default.NativeLanguage;\r
\r
- if (Properties.Settings.Default.DubAudio)\r
- radio_dub.Checked = true;\r
- else\r
- radio_foreignAndSubs.Checked = true;\r
+ switch (Settings.Default.DubMode)\r
+ {\r
+ case 1:\r
+ radio_dub.Checked = true;\r
+ break;\r
+ case 2:\r
+ radio_foreignAndSubs.Checked = true;\r
+ break;\r
+ case 3:\r
+ radio_preferredAudioAndSubs.Checked = true;\r
+ break;\r
+ }\r
\r
+ check_AddCCTracks.Checked = Properties.Settings.Default.useClosedCaption;\r
\r
// #############################\r
// CLI\r
// #############################\r
\r
- // Enable Start CLI minimized\r
- if (Properties.Settings.Default.cli_minimized)\r
- check_cli_minimized.CheckState = CheckState.Checked;\r
-\r
// Priority level for encodes\r
drp_Priority.Text = Properties.Settings.Default.processPriority;\r
\r
+ check_preventSleep.Checked = Properties.Settings.Default.preventSleep;\r
+\r
// Log Verbosity Level\r
cb_logVerboseLvl.SelectedIndex = Properties.Settings.Default.verboseLevel;\r
\r
if (Properties.Settings.Default.presetNotification)\r
check_disablePresetNotification.CheckState = CheckState.Checked;\r
\r
- // Experimental In-GUI encode status indicator.\r
- if (Properties.Settings.Default.enocdeStatusInGui)\r
- check_inGuiStatus.CheckState = CheckState.Checked;\r
-\r
+ // Show CLI Window\r
check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;\r
- check_showCliForInGUIEncode.Enabled = check_inGuiStatus.Checked;\r
\r
// Set the preview count\r
drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();\r
if (Properties.Settings.Default.noDvdNav)\r
check_dvdnav.CheckState = CheckState.Checked;\r
\r
- // #############################\r
- // Debug\r
- // #############################\r
- if (Properties.Settings.Default.disableResCalc)\r
- check_disableResCalc.Checked = true;\r
+ optionsWindowLoading = false;\r
}\r
\r
#region General\r
}\r
else\r
Properties.Settings.Default.autoNamePath = text_an_path.Text;\r
+\r
+ if (text_an_path.Text == "{source}" && !optionsWindowLoading)\r
+ {\r
+ MessageBox.Show(\r
+ "Be careful with this feature. Make sure you can write to the same folder as the source! \n\n If you are encoding from a DVD, do not use this feature as HandBrake will not be able to write to the DVD!",\r
+ "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
}\r
\r
private void check_m4v_CheckedChanged(object sender, EventArgs e)\r
private void radio_dub_CheckedChanged(object sender, EventArgs e)\r
{\r
if (radio_dub.Checked)\r
- Properties.Settings.Default.DubAudio = true;\r
+ Properties.Settings.Default.DubMode = 1;\r
}\r
\r
private void radio_foreignAndSubs_CheckedChanged(object sender, EventArgs e)\r
{\r
if (radio_foreignAndSubs.Checked)\r
- Properties.Settings.Default.DubAudio = false;\r
+ Properties.Settings.Default.DubMode = 2;\r
+ }\r
+\r
+ private void radio_preferredAudioAndSubs_CheckedChanged(object sender, EventArgs e)\r
+ {\r
+ if (radio_preferredAudioAndSubs.Checked)\r
+ Properties.Settings.Default.DubMode = 3;\r
+ }\r
+\r
+ private void check_AddCCTracks_CheckedChanged(object sender, EventArgs e)\r
+ {\r
+ Settings.Default.useClosedCaption = check_AddCCTracks.Checked;\r
}\r
\r
#endregion\r
\r
#region CLI\r
\r
- private void check_cli_minimized_CheckedChanged(object sender, EventArgs e)\r
+ private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)\r
{\r
- Properties.Settings.Default.cli_minimized = check_cli_minimized.Checked;\r
+ Properties.Settings.Default.processPriority = drp_Priority.Text;\r
}\r
\r
- private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)\r
+ private void check_preventSleep_CheckedChanged(object sender, EventArgs e)\r
{\r
- Properties.Settings.Default.processPriority = drp_Priority.Text;\r
+ Properties.Settings.Default.preventSleep = check_preventSleep.Checked;\r
}\r
\r
private void cb_logVerboseLvl_SelectedIndexChanged(object sender, EventArgs e)\r
\r
private void btn_clearLogs_Click(object sender, EventArgs e)\r
{\r
- DialogResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs", \r
+ DialogResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs",\r
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);\r
if (result == DialogResult.Yes)\r
{\r
Main.ClearLogs();\r
- MessageBox.Show(this, "HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButtons.OK, \r
+ MessageBox.Show(this, "HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButtons.OK,\r
MessageBoxIcon.Information);\r
}\r
}\r
Properties.Settings.Default.presetNotification = check_disablePresetNotification.Checked;\r
}\r
\r
- private void check_inGuiStatus_CheckedChanged(object sender, EventArgs e)\r
- {\r
- Properties.Settings.Default.enocdeStatusInGui = check_inGuiStatus.Checked;\r
-\r
- check_showCliForInGUIEncode.Enabled = check_inGuiStatus.Checked;\r
-\r
- if (this.IsHandleCreated)\r
- if (check_inGuiStatus.Checked)\r
- {\r
- MessageBox.Show(\r
- "This feature is experimental!\n\n You will not be able to \91Stop\92 an encode mid-process.\n"\r
- + "Doing so will render the file unplayable.\n" +\r
- "If you enable 'Show CLI Window', you'll be ablt to hit ctrl-c in the encode window to cleanly exit the CLI. This will give you a playable file.\n\n" +\r
- "You are also limited to 1 instance of HandBrakeCLI on your system.", \r
- "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
- }\r
- }\r
-\r
private void check_showCliForInGUIEncode_CheckedChanged(object sender, EventArgs e)\r
{\r
Properties.Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;\r
\r
#endregion\r
\r
- #region Debug\r
-\r
- private void check_disableResCalc_CheckedChanged(object sender, EventArgs e)\r
- {\r
- Properties.Settings.Default.disableResCalc = check_disableResCalc.Checked;\r
- }\r
-\r
- #endregion\r
-\r
private void btn_close_Click(object sender, EventArgs e)\r
{\r
Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this\r
+ UpdateApplicationServicesSettings();\r
+\r
this.Close();\r
}\r
\r
+ /// <summary>\r
+ /// Initialize App Services\r
+ /// </summary>\r
+ private static void UpdateApplicationServicesSettings()\r
+ {\r
+ string versionId = String.Format(\r
+ "Windows GUI {1} {0}", Settings.Default.hb_build, Settings.Default.hb_version);\r
+ Init.SetupSettings(\r
+ versionId,\r
+ Program.InstanceId,\r
+ Settings.Default.CompletionOption,\r
+ Settings.Default.noDvdNav,\r
+ Settings.Default.growlEncode,\r
+ Settings.Default.growlQueue,\r
+ Settings.Default.processPriority,\r
+ Settings.Default.saveLogPath,\r
+ Settings.Default.saveLogToSpecifiedPath,\r
+ Settings.Default.saveLogWithVideo,\r
+ Settings.Default.showCliForInGuiEncodeStatus,\r
+ Settings.Default.preventSleep);\r
+ }\r
}\r
}
\ No newline at end of file