1414namespace PasteIntoFile {
1515 public partial class Dialog : MasterForm {
1616 private ClipboardContents clipData = new ClipboardContents ( ) ;
17- private bool continuousMode = false ;
1817 private int saveCount = 0 ;
1918
2019 private SharpClipboard _clipMonitor ;
@@ -33,6 +32,10 @@ protected override void OnFormClosed(FormClosedEventArgs e) {
3332
3433
3534 public Dialog ( string location = null , string filename = null , bool ? showDialogOverwrite = null , bool ? clearClipboardOverwrite = null , bool overwriteIfExists = false ) {
35+ Settings . Default . Reload ( ) ; // load modifications made from other instance
36+ Settings . Default . continuousMode = false ; // always start in normal mode
37+ Settings . Default . Save ( ) ;
38+
3639 // Fallback to default path
3740 location = ( location ?? ExplorerUtil . GetActiveExplorerPath ( ) ??
3841 Environment . GetFolderPath ( Environment . SpecialFolder . Desktop ) )
@@ -92,7 +95,7 @@ public Dialog(string location = null, string filename = null, bool? showDialogOv
9295 if ( saveIntoSubdir ) location += @"\" + formatFilenameTemplate ( Settings . Default . subdirTemplate ) ;
9396 txtCurrentLocation . Text = location ;
9497 chkClrClipboard . Checked = clearClipboardOverwrite ?? Settings . Default . clrClipboard ;
95- chkContinuousMode . Checked = continuousMode ;
98+ chkContinuousMode . Checked = Settings . Default . continuousMode ;
9699 updateSavebutton ( ) ;
97100 chkAutoSave . Checked = Settings . Default . autoSave ;
98101
@@ -217,7 +220,7 @@ private void ClipboardChanged(Object sender, SharpClipboard.ClipboardChangedEven
217220 readClipboard ( ) ;
218221
219222 // continuous batch mode
220- if ( continuousMode ) {
223+ if ( Settings . Default . continuousMode ) {
221224 var ignore = false ;
222225 // ignore duplicate updates within 100ms
223226 ignore |= ( clipData . Timestamp - previousClipboardTimestamp ) . TotalMilliseconds <= 100 ;
@@ -308,8 +311,8 @@ private void updateContentPreview() {
308311
309312
310313 private void updateSavebutton ( ) {
311- btnSave . Enabled = txtFilename . Enabled = ! continuousMode ;
312- btnSave . Text = continuousMode ? string . Format ( Resources . str_n_saved , saveCount ) : Resources . str_save ;
314+ btnSave . Enabled = txtFilename . Enabled = ! Settings . Default . continuousMode ;
315+ btnSave . Text = Settings . Default . continuousMode ? string . Format ( Resources . str_n_saved , saveCount ) : Resources . str_save ;
313316 }
314317
315318 private void btnSave_Click ( object sender , EventArgs e ) {
@@ -425,7 +428,8 @@ private void chkContinuousMode_CheckedChanged(object sender, EventArgs e) {
425428 chkContinuousMode . Checked = false ;
426429 }
427430
428- continuousMode = chkContinuousMode . Checked ;
431+ Settings . Default . continuousMode = chkContinuousMode . Checked ;
432+ Settings . Default . Save ( ) ;
429433 updateSavebutton ( ) ;
430434
431435 }
0 commit comments