Auto-backup

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@163 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2010-11-27 10:34:19 +00:00
parent 5f9f5007a7
commit 80292b4863
8 changed files with 375 additions and 110 deletions

View File

@ -69,6 +69,10 @@ namespace Nikse.SubtitleEdit.Forms
string _timerAddHistoryWhenDoneText;
double? _audioWaveFormRightClickSeconds = null;
System.Windows.Forms.Timer _timerAutoSave = new Timer();
string _textAutoSave;
private bool AutoRepeatContinueOn
{
get
@ -190,15 +194,18 @@ namespace Nikse.SubtitleEdit.Forms
}
else if (Configuration.Settings.General.StartLoadLastFile)
{
if (Configuration.Settings.RecentFiles.FileNames.Count > 0)
if (Configuration.Settings.RecentFiles.Files.Count > 0)
{
fileName = Configuration.Settings.RecentFiles.FileNames[0];
fileName = Configuration.Settings.RecentFiles.Files[0].FileName;
if (File.Exists(fileName))
{
OpenSubtitle(fileName, null);
SetRecentIndecies(fileName);
}
}
}
timeUpDownStartTime.MaskedTextBox.TextChanged += MaskedTextBox_TextChanged;
//timeUpDownStartTime.MaskedTextBox.TextChanged += MaskedTextBox_TextChanged;
labelAutoDuration.Visible = false;
labelSubtitle.Text = string.Empty;
comboBoxAutoRepeat.SelectedIndex = 2;
@ -665,6 +672,26 @@ namespace Nikse.SubtitleEdit.Forms
comboBoxSubtitleFormats.SelectedIndexChanged += ComboBoxSubtitleFormatsSelectedIndexChanged;
}
private int FirstSelectedIndex
{
get
{
if (SubtitleListview1.SelectedItems.Count == 0)
return -1;
return SubtitleListview1.SelectedItems[0].Index;
}
}
private int FirstVisibleIndex
{
get
{
if (SubtitleListview1.Items.Count == 0)
return -1;
return SubtitleListview1.TopItem.Index;
}
}
private bool ContinueNewOrExit()
{
if (_change)
@ -688,7 +715,7 @@ namespace Nikse.SubtitleEdit.Forms
{
_fileName = saveFileDialog1.FileName;
Text = Title + " - " + _fileName;
Configuration.Settings.RecentFiles.Add(_fileName);
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex);
Configuration.Settings.Save();
if (SaveSubtitle(GetCurrentSubtitleFormat()) == DialogResult.OK)
@ -834,6 +861,10 @@ namespace Nikse.SubtitleEdit.Forms
{
if (File.Exists(fileName))
{
// save last first visible index + first selected index from listview
if (!string.IsNullOrEmpty(_fileName))
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex);
openFileDialog1.InitialDirectory = Path.GetDirectoryName(fileName);
if (Path.GetExtension(fileName).ToLower() == ".sub" && IsVobSubFile(fileName, false))
@ -906,8 +937,8 @@ namespace Nikse.SubtitleEdit.Forms
AudioWaveForm.WavePeaks = null;
AudioWaveForm.Invalidate();
if (Configuration.Settings.RecentFiles.FileNames.Count > 0 &&
Configuration.Settings.RecentFiles.FileNames[0] == fileName)
if (Configuration.Settings.RecentFiles.Files.Count > 0 &&
Configuration.Settings.RecentFiles.Files[0].FileName == fileName)
{
}
else
@ -955,7 +986,7 @@ namespace Nikse.SubtitleEdit.Forms
AudioWaveForm.WavePeaks = null;
AudioWaveForm.Invalidate();
Configuration.Settings.RecentFiles.Add(fileName);
Configuration.Settings.RecentFiles.Add(fileName, FirstVisibleIndex, FirstSelectedIndex);
Configuration.Settings.Save();
UpdateRecentFilesUI();
_fileName = fileName;
@ -1001,18 +1032,18 @@ namespace Nikse.SubtitleEdit.Forms
{
reopenToolStripMenuItem.DropDownItems.Clear();
if (Configuration.Settings.General.ShowRecentFiles &&
Configuration.Settings.RecentFiles.FileNames.Count > 0)
Configuration.Settings.RecentFiles.Files.Count > 0)
{
reopenToolStripMenuItem.Visible = true;
foreach (string fileName in Configuration.Settings.RecentFiles.FileNames)
foreach (var file in Configuration.Settings.RecentFiles.Files)
{
if (File.Exists(fileName))
reopenToolStripMenuItem.DropDownItems.Add(fileName, null, ReopenSubtitleToolStripMenuItemClick);
if (File.Exists(file.FileName))
reopenToolStripMenuItem.DropDownItems.Add(file.FileName, null, ReopenSubtitleToolStripMenuItemClick);
}
}
else
{
Configuration.Settings.RecentFiles.FileNames.Clear();
Configuration.Settings.RecentFiles.Files.Clear();
reopenToolStripMenuItem.Visible = false;
}
}
@ -1023,7 +1054,44 @@ namespace Nikse.SubtitleEdit.Forms
var item = sender as ToolStripItem;
if (ContinueNewOrExit())
{
OpenSubtitle(item.Text, null);
SetRecentIndecies(item.Text);
}
}
private void SetRecentIndecies(string fileName)
{
if (!Configuration.Settings.General.RememberSelectedLine)
return;
foreach (var x in Configuration.Settings.RecentFiles.Files)
{
if (string.Compare(fileName, x.FileName, true) == 0)
{
int sIndex = x.FirstSelectedIndex;
if (sIndex >= 0 && sIndex < SubtitleListview1.Items.Count)
{
SubtitleListview1.SelectedIndexChanged -= SubtitleListview1_SelectedIndexChanged;
for (int i = 0; i < SubtitleListview1.Items.Count; i++)
SubtitleListview1.Items[i].Selected = i == sIndex;
_subtitleListViewIndex = -1;
SubtitleListview1.EnsureVisible(sIndex);
SubtitleListview1.SelectedIndexChanged += SubtitleListview1_SelectedIndexChanged;
}
int topIndex = x.FirstVisibleIndex;
if (topIndex >= 0 && topIndex < SubtitleListview1.Items.Count)
{
// to fix bug in .net framework we have to set topitem 3 times... wtf!?
SubtitleListview1.TopItem = SubtitleListview1.Items[topIndex];
SubtitleListview1.TopItem = SubtitleListview1.Items[topIndex];
SubtitleListview1.TopItem = SubtitleListview1.Items[topIndex];
}
break;
}
}
}
private void SaveToolStripMenuItemClick(object sender, EventArgs e)
@ -1078,7 +1146,7 @@ namespace Nikse.SubtitleEdit.Forms
_fileDateTime = File.GetLastWriteTime(_fileName);
Text = Title + " - " + _fileName;
Configuration.Settings.RecentFiles.Add(_fileName);
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex);
Configuration.Settings.Save();
int index = 0;
@ -1364,6 +1432,14 @@ namespace Nikse.SubtitleEdit.Forms
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
RestoreSubtitleListviewIndexes();
}
_timerAutoSave.Stop();
if (Configuration.Settings.General.AutoBackupSeconds > 0)
{
_timerAutoSave.Interval = 1000 * Configuration.Settings.General.AutoBackupSeconds; // take backup every x second if changes were made
_timerAutoSave.Start();
}
}
private void InitializeSubtitleFont()
@ -3477,6 +3553,9 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.General.AutoRepeatOn = checkBoxAutoRepeatOn.Checked;
Configuration.Settings.General.AutoContinueOn = checkBoxAutoContinue.Checked;
if (!string.IsNullOrEmpty(_fileName))
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex);
Configuration.Settings.Save();
}
}
@ -6040,6 +6119,41 @@ namespace Nikse.SubtitleEdit.Forms
{
toolStripButtonToogleVideo.Checked = !Configuration.Settings.General.ShowVideoPlayer;
toolStripButtonToogleVideo_Click(null, null);
_timerAutoSave.Tick += TimerAutoSaveTick;
if (Configuration.Settings.General.AutoBackupSeconds > 0)
{
_timerAutoSave.Interval = 1000 * Configuration.Settings.General.AutoBackupSeconds; // take backup every x second if changes were made
_timerAutoSave.Start();
}
}
void TimerAutoSaveTick(object sender, EventArgs e)
{
string currentText = _subtitle.ToText(GetCurrentSubtitleFormat());
if (_textAutoSave != null && _subtitle.Paragraphs.Count > 0)
{
if (currentText != _textAutoSave && currentText.Trim().Length > 0)
{
if (!Directory.Exists(Configuration.AutoBackupFolder))
{
try
{
Directory.CreateDirectory(Configuration.AutoBackupFolder);
}
catch (Exception exception)
{
MessageBox.Show("Unable to create backup directory " + Configuration.AutoBackupFolder + ": " + exception.Message);
}
}
string title = string.Empty;
if (!string.IsNullOrEmpty(_fileName))
title = "_" + Path.GetFileNameWithoutExtension(_fileName);
string fileName = string.Format("{0}{1:0000}-{2:00}-{3:00}_{4:00}-{5:00}-{6:00}{7}{8}", Configuration.AutoBackupFolder, DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, title, GetCurrentSubtitleFormat().Extension);
File.WriteAllText(fileName, currentText);
}
}
_textAutoSave = currentText;
}
private void mediaPlayer_DragDrop(object sender, DragEventArgs e)

View File

@ -291,47 +291,47 @@
<data name="toolStripButtonReplace.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAlySURBVFhH1VcJVJNXGo1TrTtWIGHTCYIiBBCQRTYJIiII
EYVggIQQEoIRBATUKqIBC60IthW1iDgitlpRKMqI4tKCWlkkCigDyogMVOrYVqyWKpTl9j3r1lar9vTM
OfOfc8+/5Hvv3u9+33v5fwbj//FwXPHl2P+Z7snRLcMnR5SGsUNLtmiHFLeYyYphJCmEaVgRRi8sus4U
Ht5hIClZ7Lhi518vyiD8sNs0aRG84pSDqzMasC2vExVH7uNSOVBX0YfS0jv4ILcNoaFVfcZhh8EWlSz4
S5yxtlYNM5YUHDAPLUTaB804trcLn2y9ioQVxZBKt4I7SwF/PyW2bDmPM4e+QUc90Fh1HzMWl8BMVHBc
J6Jk1J8Xwi0fairef9ddVno/f+tXyNt2FXzfFOhOcAbTRtjLZi/qYzsIoePo85OODoGuE1ycZfhXRSdu
XQfWKat7TLh7BuyER9X+lAhjYd5eh8VF3fu2diAxMh8WFgJMceIOcNwWf2Ppxi+zdXJ5396es9TexXW9
lat/MWeO7MYUewHMLPjY+E4prhE3lESEYdDuM88KgLX1sNtsQ88uT0/eC4Xp83O4xoKdyHqvARtXHwWb
Le4z8FnePd3Zu8h/3qw4kWhhWGpqanhtbW3a2YqKrPr6+m15OzYum+nuu9nAQdxtzOH0J71diNpzAEes
7NfzzfGnZCoGY1j3DF18Z2OFLhsb3LKyuv07EdbWEcOmBuQgZmU5UtOq4egWC85s2X03V9fEsFCBbOXK
5cFr1yZ6X2qsj//t4MrKyg2+PE+ZKVd819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j+kcY+IKakR
gRnBTAI7AqfXX3vNT0tL4wsWi9VtN8seVubG8PWcjfilAkyZrAuWhkYciRv1XBc2hDrOjwywwv2OM2iq
VA58d1yBmlCG9FHm1EK6w9GsH5PbUGICd4IFBP4EiVpqak1MpkafrZU5rC2Mwee5w9zEANoszROP3Hu2
Blfrv1ObcDRjwb87PgjYejXHR/+RZdR6KmAiAW0oAwJTAmsCBwI3gvkECwlEVMT48aMa9bSZMGAyb02e
pH1Xn1yT5xwCWoZnH7NYjBnP+elv5PlwgtGPMqD1p2WYQjCdwILAioA6QpcdLYn9mDFjfCfrMCs0WZpF
rLFjaQwd/+JGfK7CnwdTUEdoT9B6UmfoRyr9KqKg17RX6Cs4/Z3G0QSeHD8B3yPoNbgEKswAAAAASUVO
RK5CYII=
</value>
</data>

View File

@ -33,6 +33,9 @@
this.tabControlSettings = new System.Windows.Forms.TabControl();
this.tabPageGenerel = new System.Windows.Forms.TabPage();
this.groupBoxMiscellaneous = new System.Windows.Forms.GroupBox();
this.comboBoxAutoBackup = new System.Windows.Forms.ComboBox();
this.labelAutoBackup = new System.Windows.Forms.Label();
this.checkBoxRememberSelectedLine = new System.Windows.Forms.CheckBox();
this.checkBoxRemoveBlankLinesWhenOpening = new System.Windows.Forms.CheckBox();
this.checkBoxShowFrameRate = new System.Windows.Forms.CheckBox();
this.checkBoxAutoDetectAnsiEncoding = new System.Windows.Forms.CheckBox();
@ -224,7 +227,7 @@
// buttonOK
//
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Location = new System.Drawing.Point(661, 421);
this.buttonOK.Location = new System.Drawing.Point(661, 434);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 0;
@ -235,7 +238,7 @@
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(740, 421);
this.buttonCancel.Location = new System.Drawing.Point(740, 434);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 1;
@ -254,7 +257,7 @@
this.tabControlSettings.Location = new System.Drawing.Point(13, 13);
this.tabControlSettings.Name = "tabControlSettings";
this.tabControlSettings.SelectedIndex = 0;
this.tabControlSettings.Size = new System.Drawing.Size(806, 402);
this.tabControlSettings.Size = new System.Drawing.Size(806, 415);
this.tabControlSettings.TabIndex = 2;
this.tabControlSettings.SelectedIndexChanged += new System.EventHandler(this.TabControlSettingsSelectedIndexChanged);
//
@ -265,13 +268,16 @@
this.tabPageGenerel.Location = new System.Drawing.Point(4, 22);
this.tabPageGenerel.Name = "tabPageGenerel";
this.tabPageGenerel.Padding = new System.Windows.Forms.Padding(3);
this.tabPageGenerel.Size = new System.Drawing.Size(798, 376);
this.tabPageGenerel.Size = new System.Drawing.Size(798, 389);
this.tabPageGenerel.TabIndex = 0;
this.tabPageGenerel.Text = "Generel";
this.tabPageGenerel.UseVisualStyleBackColor = true;
//
// groupBoxMiscellaneous
//
this.groupBoxMiscellaneous.Controls.Add(this.comboBoxAutoBackup);
this.groupBoxMiscellaneous.Controls.Add(this.labelAutoBackup);
this.groupBoxMiscellaneous.Controls.Add(this.checkBoxRememberSelectedLine);
this.groupBoxMiscellaneous.Controls.Add(this.checkBoxRemoveBlankLinesWhenOpening);
this.groupBoxMiscellaneous.Controls.Add(this.checkBoxShowFrameRate);
this.groupBoxMiscellaneous.Controls.Add(this.checkBoxAutoDetectAnsiEncoding);
@ -297,18 +303,51 @@
this.groupBoxMiscellaneous.Controls.Add(this.labelDefaultFrameRate);
this.groupBoxMiscellaneous.Location = new System.Drawing.Point(6, 121);
this.groupBoxMiscellaneous.Name = "groupBoxMiscellaneous";
this.groupBoxMiscellaneous.Size = new System.Drawing.Size(786, 249);
this.groupBoxMiscellaneous.TabIndex = 1;
this.groupBoxMiscellaneous.Size = new System.Drawing.Size(786, 262);
this.groupBoxMiscellaneous.TabIndex = 0;
this.groupBoxMiscellaneous.TabStop = false;
this.groupBoxMiscellaneous.Text = "Miscellaneous";
//
// comboBoxAutoBackup
//
this.comboBoxAutoBackup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxAutoBackup.FormattingEnabled = true;
this.comboBoxAutoBackup.Items.AddRange(new object[] {
"None",
"Every minute",
"Every 5 minutes",
"Evert 15 minutes"});
this.comboBoxAutoBackup.Location = new System.Drawing.Point(538, 235);
this.comboBoxAutoBackup.Name = "comboBoxAutoBackup";
this.comboBoxAutoBackup.Size = new System.Drawing.Size(121, 21);
this.comboBoxAutoBackup.TabIndex = 31;
//
// labelAutoBackup
//
this.labelAutoBackup.AutoSize = true;
this.labelAutoBackup.Location = new System.Drawing.Point(432, 237);
this.labelAutoBackup.Name = "labelAutoBackup";
this.labelAutoBackup.Size = new System.Drawing.Size(68, 13);
this.labelAutoBackup.TabIndex = 30;
this.labelAutoBackup.Text = "Auto-backup";
//
// checkBoxRememberSelectedLine
//
this.checkBoxRememberSelectedLine.AutoSize = true;
this.checkBoxRememberSelectedLine.Location = new System.Drawing.Point(443, 67);
this.checkBoxRememberSelectedLine.Name = "checkBoxRememberSelectedLine";
this.checkBoxRememberSelectedLine.Size = new System.Drawing.Size(139, 17);
this.checkBoxRememberSelectedLine.TabIndex = 12;
this.checkBoxRememberSelectedLine.Text = "Remember selected line";
this.checkBoxRememberSelectedLine.UseVisualStyleBackColor = true;
//
// checkBoxRemoveBlankLinesWhenOpening
//
this.checkBoxRemoveBlankLinesWhenOpening.AutoSize = true;
this.checkBoxRemoveBlankLinesWhenOpening.Location = new System.Drawing.Point(435, 117);
this.checkBoxRemoveBlankLinesWhenOpening.Location = new System.Drawing.Point(435, 139);
this.checkBoxRemoveBlankLinesWhenOpening.Name = "checkBoxRemoveBlankLinesWhenOpening";
this.checkBoxRemoveBlankLinesWhenOpening.Size = new System.Drawing.Size(225, 17);
this.checkBoxRemoveBlankLinesWhenOpening.TabIndex = 30;
this.checkBoxRemoveBlankLinesWhenOpening.TabIndex = 16;
this.checkBoxRemoveBlankLinesWhenOpening.Text = "Remove blank lines when opening subtitle";
this.checkBoxRemoveBlankLinesWhenOpening.UseVisualStyleBackColor = true;
//
@ -328,7 +367,7 @@
this.checkBoxAutoDetectAnsiEncoding.Location = new System.Drawing.Point(180, 104);
this.checkBoxAutoDetectAnsiEncoding.Name = "checkBoxAutoDetectAnsiEncoding";
this.checkBoxAutoDetectAnsiEncoding.Size = new System.Drawing.Size(15, 14);
this.checkBoxAutoDetectAnsiEncoding.TabIndex = 4;
this.checkBoxAutoDetectAnsiEncoding.TabIndex = 6;
this.checkBoxAutoDetectAnsiEncoding.UseVisualStyleBackColor = true;
//
// labelAutoDetectAnsiEncoding
@ -349,44 +388,44 @@
"UTF-7",
"UTF-8",
"Unicode"});
this.comboBoxListViewDoubleClickEvent.Location = new System.Drawing.Point(435, 198);
this.comboBoxListViewDoubleClickEvent.Location = new System.Drawing.Point(435, 206);
this.comboBoxListViewDoubleClickEvent.Name = "comboBoxListViewDoubleClickEvent";
this.comboBoxListViewDoubleClickEvent.Size = new System.Drawing.Size(222, 21);
this.comboBoxListViewDoubleClickEvent.TabIndex = 28;
this.comboBoxListViewDoubleClickEvent.TabIndex = 20;
//
// labelListViewDoubleClickEvent
//
this.labelListViewDoubleClickEvent.AutoSize = true;
this.labelListViewDoubleClickEvent.Location = new System.Drawing.Point(432, 183);
this.labelListViewDoubleClickEvent.Location = new System.Drawing.Point(432, 191);
this.labelListViewDoubleClickEvent.Name = "labelListViewDoubleClickEvent";
this.labelListViewDoubleClickEvent.Size = new System.Drawing.Size(227, 13);
this.labelListViewDoubleClickEvent.TabIndex = 14;
this.labelListViewDoubleClickEvent.TabIndex = 19;
this.labelListViewDoubleClickEvent.Text = "Double-click on line in main window listview will";
//
// textBoxShowLineBreaksAs
//
this.textBoxShowLineBreaksAs.Location = new System.Drawing.Point(588, 151);
this.textBoxShowLineBreaksAs.Location = new System.Drawing.Point(588, 164);
this.textBoxShowLineBreaksAs.MaxLength = 10;
this.textBoxShowLineBreaksAs.Name = "textBoxShowLineBreaksAs";
this.textBoxShowLineBreaksAs.Size = new System.Drawing.Size(69, 21);
this.textBoxShowLineBreaksAs.TabIndex = 24;
this.textBoxShowLineBreaksAs.TabIndex = 18;
//
// labelShowLineBreaksAs
//
this.labelShowLineBreaksAs.AutoSize = true;
this.labelShowLineBreaksAs.Location = new System.Drawing.Point(432, 154);
this.labelShowLineBreaksAs.Location = new System.Drawing.Point(432, 167);
this.labelShowLineBreaksAs.Name = "labelShowLineBreaksAs";
this.labelShowLineBreaksAs.Size = new System.Drawing.Size(150, 13);
this.labelShowLineBreaksAs.TabIndex = 12;
this.labelShowLineBreaksAs.TabIndex = 17;
this.labelShowLineBreaksAs.Text = "Show line breaks in listview as";
//
// checkBoxRememberWindowPosition
//
this.checkBoxRememberWindowPosition.AutoSize = true;
this.checkBoxRememberWindowPosition.Location = new System.Drawing.Point(435, 71);
this.checkBoxRememberWindowPosition.Location = new System.Drawing.Point(435, 93);
this.checkBoxRememberWindowPosition.Name = "checkBoxRememberWindowPosition";
this.checkBoxRememberWindowPosition.Size = new System.Drawing.Size(222, 17);
this.checkBoxRememberWindowPosition.TabIndex = 18;
this.checkBoxRememberWindowPosition.TabIndex = 14;
this.checkBoxRememberWindowPosition.Text = "Remember main window position and size";
this.checkBoxRememberWindowPosition.UseVisualStyleBackColor = true;
//
@ -396,7 +435,7 @@
this.textBoxSubtitleLineMaximumLength.MaxLength = 3;
this.textBoxSubtitleLineMaximumLength.Name = "textBoxSubtitleLineMaximumLength";
this.textBoxSubtitleLineMaximumLength.Size = new System.Drawing.Size(121, 21);
this.textBoxSubtitleLineMaximumLength.TabIndex = 6;
this.textBoxSubtitleLineMaximumLength.TabIndex = 7;
this.textBoxSubtitleLineMaximumLength.Text = "68";
this.textBoxSubtitleLineMaximumLength.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxAjustSecondsKeyDown);
//
@ -430,32 +469,33 @@
// checkBoxStartInSourceView
//
this.checkBoxStartInSourceView.AutoSize = true;
this.checkBoxStartInSourceView.Location = new System.Drawing.Point(435, 94);
this.checkBoxStartInSourceView.Location = new System.Drawing.Point(435, 116);
this.checkBoxStartInSourceView.Name = "checkBoxStartInSourceView";
this.checkBoxStartInSourceView.Size = new System.Drawing.Size(119, 17);
this.checkBoxStartInSourceView.TabIndex = 20;
this.checkBoxStartInSourceView.TabIndex = 15;
this.checkBoxStartInSourceView.Text = "Start in source view";
this.checkBoxStartInSourceView.UseVisualStyleBackColor = true;
//
// checkBoxReopenLastOpened
//
this.checkBoxReopenLastOpened.AutoSize = true;
this.checkBoxReopenLastOpened.Location = new System.Drawing.Point(435, 48);
this.checkBoxReopenLastOpened.Location = new System.Drawing.Point(443, 44);
this.checkBoxReopenLastOpened.Name = "checkBoxReopenLastOpened";
this.checkBoxReopenLastOpened.Size = new System.Drawing.Size(140, 17);
this.checkBoxReopenLastOpened.TabIndex = 16;
this.checkBoxReopenLastOpened.TabIndex = 13;
this.checkBoxReopenLastOpened.Text = "Start with last file loaded";
this.checkBoxReopenLastOpened.UseVisualStyleBackColor = true;
//
// checkBoxRememberRecentFiles
//
this.checkBoxRememberRecentFiles.AutoSize = true;
this.checkBoxRememberRecentFiles.Location = new System.Drawing.Point(435, 25);
this.checkBoxRememberRecentFiles.Location = new System.Drawing.Point(435, 20);
this.checkBoxRememberRecentFiles.Name = "checkBoxRememberRecentFiles";
this.checkBoxRememberRecentFiles.Size = new System.Drawing.Size(188, 17);
this.checkBoxRememberRecentFiles.TabIndex = 14;
this.checkBoxRememberRecentFiles.TabIndex = 11;
this.checkBoxRememberRecentFiles.Text = "Remember recent files (for reopen)";
this.checkBoxRememberRecentFiles.UseVisualStyleBackColor = true;
this.checkBoxRememberRecentFiles.CheckedChanged += new System.EventHandler(this.checkBoxRememberRecentFiles_CheckedChanged);
//
// checkBoxSubtitleFontBold
//
@ -463,7 +503,7 @@
this.checkBoxSubtitleFontBold.Location = new System.Drawing.Point(180, 222);
this.checkBoxSubtitleFontBold.Name = "checkBoxSubtitleFontBold";
this.checkBoxSubtitleFontBold.Size = new System.Drawing.Size(47, 17);
this.checkBoxSubtitleFontBold.TabIndex = 12;
this.checkBoxSubtitleFontBold.TabIndex = 10;
this.checkBoxSubtitleFontBold.Text = "Bold";
this.checkBoxSubtitleFontBold.UseVisualStyleBackColor = true;
//
@ -489,7 +529,7 @@
this.comboBoxSubtitleFontSize.Location = new System.Drawing.Point(180, 194);
this.comboBoxSubtitleFontSize.Name = "comboBoxSubtitleFontSize";
this.comboBoxSubtitleFontSize.Size = new System.Drawing.Size(121, 21);
this.comboBoxSubtitleFontSize.TabIndex = 10;
this.comboBoxSubtitleFontSize.TabIndex = 9;
//
// labelSubtitleFont
//
@ -512,7 +552,7 @@
this.comboBoxEncoding.Location = new System.Drawing.Point(180, 75);
this.comboBoxEncoding.Name = "comboBoxEncoding";
this.comboBoxEncoding.Size = new System.Drawing.Size(121, 21);
this.comboBoxEncoding.TabIndex = 2;
this.comboBoxEncoding.TabIndex = 5;
//
// labelDefaultFileEncoding
//
@ -529,7 +569,7 @@
this.comboBoxFramerate.Location = new System.Drawing.Point(180, 40);
this.comboBoxFramerate.Name = "comboBoxFramerate";
this.comboBoxFramerate.Size = new System.Drawing.Size(121, 21);
this.comboBoxFramerate.TabIndex = 1;
this.comboBoxFramerate.TabIndex = 4;
//
// labelDefaultFrameRate
//
@ -537,7 +577,7 @@
this.labelDefaultFrameRate.Location = new System.Drawing.Point(14, 44);
this.labelDefaultFrameRate.Name = "labelDefaultFrameRate";
this.labelDefaultFrameRate.Size = new System.Drawing.Size(93, 13);
this.labelDefaultFrameRate.TabIndex = 0;
this.labelDefaultFrameRate.TabIndex = 1;
this.labelDefaultFrameRate.Text = "Default framerate";
//
// groupBoxShowToolBarButtons
@ -857,7 +897,7 @@
this.tabPageVideoPlayer.Location = new System.Drawing.Point(4, 22);
this.tabPageVideoPlayer.Name = "tabPageVideoPlayer";
this.tabPageVideoPlayer.Padding = new System.Windows.Forms.Padding(3);
this.tabPageVideoPlayer.Size = new System.Drawing.Size(798, 376);
this.tabPageVideoPlayer.Size = new System.Drawing.Size(798, 389);
this.tabPageVideoPlayer.TabIndex = 2;
this.tabPageVideoPlayer.Text = "Video player";
this.tabPageVideoPlayer.UseVisualStyleBackColor = true;
@ -869,7 +909,7 @@
this.groupBoxMainWindowVideoControls.Controls.Add(this.comboBoxCustomSearch);
this.groupBoxMainWindowVideoControls.Location = new System.Drawing.Point(7, 241);
this.groupBoxMainWindowVideoControls.Name = "groupBoxMainWindowVideoControls";
this.groupBoxMainWindowVideoControls.Size = new System.Drawing.Size(785, 129);
this.groupBoxMainWindowVideoControls.Size = new System.Drawing.Size(785, 142);
this.groupBoxMainWindowVideoControls.TabIndex = 15;
this.groupBoxMainWindowVideoControls.TabStop = false;
this.groupBoxMainWindowVideoControls.Text = "Main window video controls";
@ -1068,7 +1108,7 @@
this.tabPageWaveForm.Controls.Add(this.groupBoxWaveFormAppearence);
this.tabPageWaveForm.Location = new System.Drawing.Point(4, 22);
this.tabPageWaveForm.Name = "tabPageWaveForm";
this.tabPageWaveForm.Size = new System.Drawing.Size(798, 376);
this.tabPageWaveForm.Size = new System.Drawing.Size(798, 389);
this.tabPageWaveForm.TabIndex = 6;
this.tabPageWaveForm.Text = "Wave form";
this.tabPageWaveForm.UseVisualStyleBackColor = true;
@ -1079,7 +1119,7 @@
this.groupBox1.Controls.Add(this.labelWaveFormsFolderInfo);
this.groupBox1.Location = new System.Drawing.Point(6, 216);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(786, 157);
this.groupBox1.Size = new System.Drawing.Size(786, 170);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
//
@ -1230,7 +1270,7 @@
this.tabPageTools.Location = new System.Drawing.Point(4, 22);
this.tabPageTools.Name = "tabPageTools";
this.tabPageTools.Padding = new System.Windows.Forms.Padding(3);
this.tabPageTools.Size = new System.Drawing.Size(798, 376);
this.tabPageTools.Size = new System.Drawing.Size(798, 389);
this.tabPageTools.TabIndex = 5;
this.tabPageTools.Text = "Tools";
this.tabPageTools.UseVisualStyleBackColor = true;
@ -1240,7 +1280,7 @@
this.groupBoxSpellCheck.Controls.Add(this.checkBoxSpellCheckAutoChangeNames);
this.groupBoxSpellCheck.Location = new System.Drawing.Point(7, 257);
this.groupBoxSpellCheck.Name = "groupBoxSpellCheck";
this.groupBoxSpellCheck.Size = new System.Drawing.Size(785, 113);
this.groupBoxSpellCheck.Size = new System.Drawing.Size(785, 126);
this.groupBoxSpellCheck.TabIndex = 4;
this.groupBoxSpellCheck.TabStop = false;
this.groupBoxSpellCheck.Text = "Spell check";
@ -1418,7 +1458,7 @@
this.tabPageWordLists.Location = new System.Drawing.Point(4, 22);
this.tabPageWordLists.Name = "tabPageWordLists";
this.tabPageWordLists.Padding = new System.Windows.Forms.Padding(3);
this.tabPageWordLists.Size = new System.Drawing.Size(798, 376);
this.tabPageWordLists.Size = new System.Drawing.Size(798, 389);
this.tabPageWordLists.TabIndex = 3;
this.tabPageWordLists.Text = "Word lists";
this.tabPageWordLists.UseVisualStyleBackColor = true;
@ -1433,7 +1473,7 @@
this.groupBoxWordLists.Controls.Add(this.comboBoxWordListLanguage);
this.groupBoxWordLists.Location = new System.Drawing.Point(6, 6);
this.groupBoxWordLists.Name = "groupBoxWordLists";
this.groupBoxWordLists.Size = new System.Drawing.Size(786, 364);
this.groupBoxWordLists.Size = new System.Drawing.Size(786, 377);
this.groupBoxWordLists.TabIndex = 2;
this.groupBoxWordLists.TabStop = false;
this.groupBoxWordLists.Text = "Word lists";
@ -1556,7 +1596,7 @@
this.groupBoxWordListLocation.Controls.Add(this.textBoxNamesEtcOnline);
this.groupBoxWordListLocation.Location = new System.Drawing.Point(6, 287);
this.groupBoxWordListLocation.Name = "groupBoxWordListLocation";
this.groupBoxWordListLocation.Size = new System.Drawing.Size(774, 71);
this.groupBoxWordListLocation.Size = new System.Drawing.Size(774, 77);
this.groupBoxWordListLocation.TabIndex = 8;
this.groupBoxWordListLocation.TabStop = false;
this.groupBoxWordListLocation.Text = "Location";
@ -1655,7 +1695,7 @@
this.tabPageSsaStyle.Location = new System.Drawing.Point(4, 22);
this.tabPageSsaStyle.Name = "tabPageSsaStyle";
this.tabPageSsaStyle.Padding = new System.Windows.Forms.Padding(3);
this.tabPageSsaStyle.Size = new System.Drawing.Size(798, 376);
this.tabPageSsaStyle.Size = new System.Drawing.Size(798, 389);
this.tabPageSsaStyle.TabIndex = 1;
this.tabPageSsaStyle.Text = "SSA style";
this.tabPageSsaStyle.UseVisualStyleBackColor = true;
@ -1669,7 +1709,7 @@
this.groupBoxSsaStyle.Controls.Add(this.buttonSSAChooseFont);
this.groupBoxSsaStyle.Location = new System.Drawing.Point(6, 6);
this.groupBoxSsaStyle.Name = "groupBoxSsaStyle";
this.groupBoxSsaStyle.Size = new System.Drawing.Size(786, 364);
this.groupBoxSsaStyle.Size = new System.Drawing.Size(786, 377);
this.groupBoxSsaStyle.TabIndex = 0;
this.groupBoxSsaStyle.TabStop = false;
this.groupBoxSsaStyle.Text = "Sub Station Alpha style";
@ -1730,7 +1770,7 @@
this.tabPageProxy.Location = new System.Drawing.Point(4, 22);
this.tabPageProxy.Name = "tabPageProxy";
this.tabPageProxy.Padding = new System.Windows.Forms.Padding(3);
this.tabPageProxy.Size = new System.Drawing.Size(798, 376);
this.tabPageProxy.Size = new System.Drawing.Size(798, 389);
this.tabPageProxy.TabIndex = 4;
this.tabPageProxy.Text = "Proxy";
this.tabPageProxy.UseVisualStyleBackColor = true;
@ -1742,7 +1782,7 @@
this.groupBoxProxySettings.Controls.Add(this.labelProxyAddress);
this.groupBoxProxySettings.Location = new System.Drawing.Point(6, 6);
this.groupBoxProxySettings.Name = "groupBoxProxySettings";
this.groupBoxProxySettings.Size = new System.Drawing.Size(786, 364);
this.groupBoxProxySettings.Size = new System.Drawing.Size(786, 377);
this.groupBoxProxySettings.TabIndex = 1;
this.groupBoxProxySettings.TabStop = false;
this.groupBoxProxySettings.Text = "Proxy server settings";
@ -1840,7 +1880,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(831, 454);
this.ClientSize = new System.Drawing.Size(831, 464);
this.Controls.Add(this.labelStatus);
this.Controls.Add(this.tabControlSettings);
this.Controls.Add(this.buttonCancel);
@ -2069,5 +2109,8 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button buttonWaveFormsFolderEmpty;
private System.Windows.Forms.Label labelWaveFormsFolderInfo;
private System.Windows.Forms.CheckBox checkBoxRememberSelectedLine;
private System.Windows.Forms.ComboBox comboBoxAutoBackup;
private System.Windows.Forms.Label labelAutoBackup;
}
}

View File

@ -64,6 +64,8 @@ namespace Nikse.SubtitleEdit.Forms
comboBoxSubtitleFontSize.Text = gs.SubtitleFontSize.ToString();
checkBoxSubtitleFontBold.Checked = gs.SubtitleFontBold;
checkBoxRememberRecentFiles.Checked = gs.ShowRecentFiles;
checkBoxRememberRecentFiles_CheckedChanged(null, null);
checkBoxRememberSelectedLine.Checked = gs.RememberSelectedLine;
checkBoxReopenLastOpened.Checked = gs.StartLoadLastFile;
checkBoxStartInSourceView.Checked = gs.StartInSourceView;
checkBoxRemoveBlankLinesWhenOpening.Checked = gs.RemoveBlankLinesWhenOpening;
@ -179,6 +181,7 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxSubtitleFontBold.Text = Configuration.Settings.Language.General.Bold;
checkBoxRememberRecentFiles.Text = language.RememberRecentFiles;
checkBoxReopenLastOpened.Text = language.StartWithLastFileLoaded;
checkBoxRememberSelectedLine.Text = language.RememberSelectedLine;
checkBoxStartInSourceView.Text = language.StartInSourceView;
checkBoxRemoveBlankLinesWhenOpening.Text = language.RemoveBlankLinesWhenOpening;
checkBoxRememberWindowPosition.Text = language.RememberPositionAndSize;
@ -186,6 +189,12 @@ namespace Nikse.SubtitleEdit.Forms
labelShowLineBreaksAs.Text = language.ShowLineBreaksAs;
textBoxShowLineBreaksAs.Left = labelShowLineBreaksAs.Left + labelShowLineBreaksAs.Width;
labelListViewDoubleClickEvent.Text = language.MainListViewDoubleClickAction;
labelAutoBackup.Text = language.AutoBackup;
comboBoxAutoBackup.Items[0] = Configuration.Settings.Language.General.None;
comboBoxAutoBackup.Items[1] = language.AutoBackupEveryMinute;
comboBoxAutoBackup.Items[2] = language.AutoBackupEveryFiveMinutes;
comboBoxAutoBackup.Items[3] = language.AutoBackupEveryFifteenMinutes;
groupBoxVideoEngine.Text = language.VideoEngine;
radioButtonVideoPlayerDirectShow.Text = language.DirectShow;
@ -276,6 +285,15 @@ namespace Nikse.SubtitleEdit.Forms
comboBoxListViewDoubleClickEvent.SelectedIndex =
Configuration.Settings.General.ListViewDoubleClickAction;
if (gs.AutoBackupSeconds == 60)
comboBoxAutoBackup.SelectedIndex = 1;
else if (gs.AutoBackupSeconds == 60 * 5)
comboBoxAutoBackup.SelectedIndex = 2;
else if (gs.AutoBackupSeconds == 60 * 15)
comboBoxAutoBackup.SelectedIndex = 3;
else
comboBoxAutoBackup.SelectedIndex = 0;
ToolsSettings toolsSettings = Configuration.Settings.Tools;
if (toolsSettings.VerifyPlaySeconds - 2 >= 0 && toolsSettings.VerifyPlaySeconds - 2 < comboBoxToolsVerifySeconds.Items.Count)
comboBoxToolsVerifySeconds.SelectedIndex = toolsSettings.VerifyPlaySeconds - 2;
@ -502,6 +520,7 @@ namespace Nikse.SubtitleEdit.Forms
gs.SubtitleFontSize = int.Parse(comboBoxSubtitleFontSize.Text);
gs.SubtitleFontBold = checkBoxSubtitleFontBold.Checked;
gs.ShowRecentFiles = checkBoxRememberRecentFiles.Checked;
gs.RememberSelectedLine = checkBoxRememberSelectedLine.Checked;
gs.StartLoadLastFile = checkBoxReopenLastOpened.Checked;
gs.StartRememberPositionAndSize = checkBoxRememberWindowPosition.Checked;
gs.StartInSourceView = checkBoxStartInSourceView.Checked;
@ -511,6 +530,15 @@ namespace Nikse.SubtitleEdit.Forms
gs.ListViewLineSeparatorString = Environment.NewLine;
gs.ListViewDoubleClickAction = comboBoxListViewDoubleClickEvent.SelectedIndex;
if (comboBoxAutoBackup.SelectedIndex == 1)
gs.AutoBackupSeconds = 60;
else if (comboBoxAutoBackup.SelectedIndex == 2)
gs.AutoBackupSeconds = 60 * 5;
else if (comboBoxAutoBackup.SelectedIndex == 3)
gs.AutoBackupSeconds = 60 * 15;
else
gs.AutoBackupSeconds = 0;
if (radioButtonVideoPlayerWmp.Checked)
gs.VideoPlayer = "WindowsMediaPlayer";
//else if (radioButtonVideoPlayerManagedDirectX.Checked)
@ -1268,5 +1296,11 @@ namespace Nikse.SubtitleEdit.Forms
InitializeWaveFormsFolderEmpty(Configuration.Settings.Language.Settings);
}
private void checkBoxRememberRecentFiles_CheckedChanged(object sender, EventArgs e)
{
checkBoxReopenLastOpened.Enabled = checkBoxRememberRecentFiles.Checked;
checkBoxRememberSelectedLine.Enabled = checkBoxRememberRecentFiles.Checked;
}
}
}

View File

@ -58,6 +58,14 @@ namespace Nikse.SubtitleEdit.Logic
}
}
public static string AutoBackupFolder
{
get
{
return DataDirectory + "AutoBackup" + Path.DirectorySeparatorChar;
}
}
public static string DataDirectory
{
get

View File

@ -963,6 +963,7 @@ namespace Nikse.SubtitleEdit.Logic
SubtitleFontSize = "Subtitle font size",
RememberRecentFiles = "Remember recent files (for reopen)",
StartWithLastFileLoaded = "Start with last file loaded",
RememberSelectedLine = "Remember selected line",
RememberPositionAndSize = "Remember main window position and size",
StartInSourceView = "Start in source view",
RemoveBlankLinesWhenOpening = "Remove blank lines when opening a subtitle",
@ -972,6 +973,10 @@ namespace Nikse.SubtitleEdit.Logic
MainListViewVideoGoToPositionAndPause= "Go to video pos and pause",
MainListViewVideoGoToPositionAndPlay = "Go to video pos and play",
MainListViewEditText = "Go to edit text box",
AutoBackup = "Auto-backup",
AutoBackupEveryMinute = "Every minute",
AutoBackupEveryFiveMinutes = "Every 5th minute",
AutoBackupEveryFifteenMinutes = "Every 15th minute",
VideoEngine = "Video engine",
DirectShow = "DirectShow",
DirectShowDescription = "quartz.dll in system32 folder",

View File

@ -903,6 +903,7 @@
public string SubtitleFontSize { get; set; }
public string RememberRecentFiles { get; set; }
public string StartWithLastFileLoaded { get; set; }
public string RememberSelectedLine { get; set; }
public string RememberPositionAndSize { get; set; }
public string StartInSourceView { get; set; }
public string RemoveBlankLinesWhenOpening { get; set; }
@ -912,6 +913,10 @@
public string MainListViewVideoGoToPositionAndPause { get; set; }
public string MainListViewVideoGoToPositionAndPlay { get; set; }
public string MainListViewEditText { get; set; }
public string AutoBackup { get; set; }
public string AutoBackupEveryMinute { get; set; }
public string AutoBackupEveryFiveMinutes { get; set; }
public string AutoBackupEveryFifteenMinutes { get; set; }
public string VideoEngine { get; set; }
public string DirectShow { get; set; }
public string DirectShowDescription { get; set; }

View File

@ -11,30 +11,59 @@ namespace Nikse.SubtitleEdit.Logic
// The settings classes are build for easy xml-serilization (makes save/load code simple)
// ...but the built-in serialization is too slow - so a custom (de-)serialization has been used!
public class RecentFileEntry
{
public string FileName { get; set; }
public int FirstVisibleIndex { get; set; }
public int FirstSelectedIndex { get; set; }
}
public class RecentFilesSettings
{
private const int MaxRecentFiles = 25;
[XmlArrayItem("FileName")]
public List<string> FileNames { get; set; }
public List<RecentFileEntry> Files { get; set; }
public RecentFilesSettings()
{
FileNames = new List<string>();
Files = new List<RecentFileEntry>();
}
public void Add(string fileName, int firstVisibleIndex, int firstSelectedIndex)
{
var newList = new List<RecentFileEntry> { new RecentFileEntry() { FileName = fileName, FirstVisibleIndex = firstVisibleIndex, FirstSelectedIndex = firstSelectedIndex } };
int index = 0;
foreach (var oldRecentFile in Files)
{
if (string.Compare(fileName, oldRecentFile.FileName, true) != 0 && index < MaxRecentFiles)
newList.Add(new RecentFileEntry() { FileName = oldRecentFile.FileName, FirstVisibleIndex = oldRecentFile.FirstVisibleIndex, FirstSelectedIndex = oldRecentFile.FirstSelectedIndex });
index++;
}
Files = newList;
}
public void Add(string fileName)
{
var newList = new List<string> {fileName};
int index = 0;
foreach (string oldFileName in FileNames)
var newList = new List<RecentFileEntry>();
foreach (var oldRecentFile in Files)
{
if (string.Compare(fileName, oldFileName, true) != 0 && index < MaxRecentFiles)
newList.Add(oldFileName);
if (string.Compare(fileName, oldRecentFile.FileName, true) == 0)
newList.Add(new RecentFileEntry() { FileName = oldRecentFile.FileName, FirstVisibleIndex = oldRecentFile.FirstVisibleIndex, FirstSelectedIndex = oldRecentFile.FirstSelectedIndex });
}
if (newList.Count == 0)
newList.Add(new RecentFileEntry() { FileName = fileName, FirstVisibleIndex = -1, FirstSelectedIndex = -1 });
int index = 0;
foreach (var oldRecentFile in Files)
{
if (string.Compare(fileName, oldRecentFile.FileName, true) != 0 && index < MaxRecentFiles)
newList.Add(new RecentFileEntry() { FileName = oldRecentFile.FileName, FirstVisibleIndex = oldRecentFile.FirstVisibleIndex, FirstSelectedIndex = oldRecentFile.FirstSelectedIndex });
index++;
}
FileNames = newList;
Files = newList;
}
}
public class ToolsSettings
@ -183,6 +212,7 @@ namespace Nikse.SubtitleEdit.Logic
public int SubtitleFontSize { get; set; }
public bool SubtitleFontBold { get; set; }
public bool ShowRecentFiles { get; set; }
public bool RememberSelectedLine { get; set; }
public bool StartLoadLastFile { get; set; }
public bool StartRememberPositionAndSize { get; set; }
public string StartPosition { get; set; }
@ -201,6 +231,7 @@ namespace Nikse.SubtitleEdit.Logic
public int DefaultAdjustMilliseconds { get; set; }
public bool AutoRepeatOn { get; set; }
public bool AutoContinueOn { get; set; }
public int AutoBackupSeconds { get; set; }
public GeneralSettings()
{
@ -228,6 +259,7 @@ namespace Nikse.SubtitleEdit.Logic
DefaultEncoding = "UTF-8";
AutoGuessAnsiEncoding = false;
ShowRecentFiles = true;
RememberSelectedLine = false;
StartLoadLastFile = true;
StartRememberPositionAndSize = true;
SubtitleLineMaximumLength = 65;
@ -241,6 +273,7 @@ namespace Nikse.SubtitleEdit.Logic
DefaultAdjustMilliseconds = 1000;
AutoRepeatOn = true;
AutoContinueOn = false;
AutoBackupSeconds = 0;
}
}
@ -415,7 +448,18 @@ namespace Nikse.SubtitleEdit.Logic
settings.RecentFiles = new Nikse.SubtitleEdit.Logic.RecentFilesSettings();
XmlNode node = doc.DocumentElement.SelectSingleNode("RecentFiles");
foreach (XmlNode listNode in node.SelectNodes("FileNames/FileName"))
settings.RecentFiles.FileNames.Add(listNode.InnerText);
{
string firstVisibleIndex = "-1";
if (listNode.Attributes["FirstVisibleIndex"] != null)
firstVisibleIndex = listNode.Attributes["FirstVisibleIndex"].Value;
string firstSelectedIndex = "-1";
if (listNode.Attributes["FirstSelectedIndex"] != null)
firstSelectedIndex = listNode.Attributes["FirstSelectedIndex"].Value;
settings.RecentFiles.Files.Add(new RecentFileEntry() { FileName = listNode.InnerText, FirstVisibleIndex = int.Parse(firstVisibleIndex), FirstSelectedIndex = int.Parse(firstSelectedIndex) });
}
settings.General = new Nikse.SubtitleEdit.Logic.GeneralSettings();
node = doc.DocumentElement.SelectSingleNode("General");
@ -479,6 +523,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("ShowRecentFiles");
if (subNode != null)
settings.General.ShowRecentFiles = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("RememberSelectedLine");
if (subNode != null)
settings.General.RememberSelectedLine = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("StartLoadLastFile");
if (subNode != null)
settings.General.StartLoadLastFile = Convert.ToBoolean(subNode.InnerText);
@ -533,6 +580,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("AutoContinueOn");
if (subNode != null)
settings.General.AutoContinueOn = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("AutoBackupSeconds");
if (subNode != null)
settings.General.AutoBackupSeconds = Convert.ToInt32(subNode.InnerText);
settings.Tools = new Nikse.SubtitleEdit.Logic.ToolsSettings();
node = doc.DocumentElement.SelectSingleNode("Tools");
@ -763,9 +813,13 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteStartElement("RecentFiles", "");
textWriter.WriteStartElement("FileNames", "");
foreach (var item in settings.RecentFiles.FileNames)
foreach (var item in settings.RecentFiles.Files)
{
textWriter.WriteElementString("FileName", item);
textWriter.WriteStartElement("FileName");
textWriter.WriteAttributeString("FirstVisibleIndex", item.FirstVisibleIndex.ToString());
textWriter.WriteAttributeString("FirstSelectedIndex", item.FirstSelectedIndex.ToString());
textWriter.WriteString(item.FileName);
textWriter.WriteEndElement();
}
textWriter.WriteEndElement();
textWriter.WriteEndElement();
@ -791,6 +845,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("SubtitleFontSize", settings.General.SubtitleFontSize.ToString());
textWriter.WriteElementString("SubtitleFontBold", settings.General.SubtitleFontBold.ToString());
textWriter.WriteElementString("ShowRecentFiles", settings.General.ShowRecentFiles.ToString());
textWriter.WriteElementString("RememberSelectedLine", settings.General.RememberSelectedLine.ToString());
textWriter.WriteElementString("StartLoadLastFile", settings.General.StartLoadLastFile.ToString());
textWriter.WriteElementString("StartRememberPositionAndSize", settings.General.StartRememberPositionAndSize.ToString());
textWriter.WriteElementString("StartPosition", settings.General.StartPosition);
@ -809,6 +864,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("DefaultAdjustMilliseconds", settings.General.DefaultAdjustMilliseconds.ToString());
textWriter.WriteElementString("AutoRepeatOn", settings.General.AutoRepeatOn.ToString());
textWriter.WriteElementString("AutoContinueOn", settings.General.AutoContinueOn.ToString());
textWriter.WriteElementString("AutoBackupSeconds", settings.General.AutoBackupSeconds.ToString());
textWriter.WriteEndElement();
textWriter.WriteStartElement("Tools", "");