@@ -180,7 +180,8 @@ private void updateUiFromSettings() {
180180 chkContinuousMode . Checked = Settings . Default . continuousMode ;
181181 chkAutoSave . Checked = Settings . Default . autoSave ;
182182 chkEnableLiveClipboardUpdate . Checked = Settings . Default . enableLiveClipboardUpdate ;
183- updateSavebutton ( ) ;
183+ updateEnabledStates ( ) ;
184+ updateSaveButtonText ( ) ;
184185 _disableUiEvents = false ;
185186 }
186187
@@ -373,11 +374,14 @@ private void updateContentPreview() {
373374 }
374375
375376
376- private void updateSavebutton ( ) {
377+ private void updateEnabledStates ( ) {
377378 txtFilename . Enabled = ! chkContinuousMode . Checked || chkAppend . Checked ;
379+ chkEnableLiveClipboardUpdate . Enabled = ! chkContinuousMode . Checked ;
378380 btnSave . Enabled = ! chkContinuousMode . Checked ;
381+ }
382+
383+ private void updateSaveButtonText ( ) {
379384 btnSave . Text = chkContinuousMode . Checked ? string . Format ( Resources . str_n_saved , saveCount ) : Resources . str_save ;
380- chkEnableLiveClipboardUpdate . Enabled = ! chkContinuousMode . Checked ;
381385 }
382386
383387 private void btnSave_Click ( object sender , EventArgs e ) {
@@ -468,6 +472,7 @@ string save(bool overwriteIfExists = false, bool? clearClipboardOverwrite = fals
468472
469473 rememberExtension ( content , comExt . Text ) ;
470474 saveCount ++ ;
475+ updateSaveButtonText ( ) ;
471476 return file ;
472477
473478 } catch ( UnauthorizedAccessException ex ) {
@@ -512,13 +517,14 @@ private void Main_KeyPress(object sender, KeyPressEventArgs e) {
512517
513518 private void chkAppend_CheckedChanged ( object sender , EventArgs e ) {
514519 if ( _disableUiEvents ) return ;
515- updateSavebutton ( ) ;
520+ updateEnabledStates ( ) ;
516521 }
517522
518523 private void chkEnableLiveClipboardUpdate_CheckedChanged ( object sender , EventArgs e ) {
519524 if ( _disableUiEvents ) return ;
520525 Settings . Default . enableLiveClipboardUpdate = chkEnableLiveClipboardUpdate . Checked ;
521526 Settings . Default . Save ( ) ;
527+ updateEnabledStates ( ) ;
522528 }
523529
524530 private void chkContinuousMode_CheckedChanged ( object sender , EventArgs e ) {
@@ -528,6 +534,7 @@ private void chkContinuousMode_CheckedChanged(object sender, EventArgs e) {
528534
529535 if ( chkContinuousMode . Checked ) {
530536 saveCount = 0 ;
537+ updateSaveButtonText ( ) ;
531538
532539 // ask weather save current clipboard now
533540 var saveNow = MessageBox . Show ( Resources . str_continuous_mode_enabled_ask_savenow , Resources . str_continuous_mode , MessageBoxButtons . YesNoCancel , MessageBoxIcon . Question ) ;
@@ -537,7 +544,6 @@ private void chkContinuousMode_CheckedChanged(object sender, EventArgs e) {
537544 return ;
538545 } else if ( saveNow == DialogResult . Yes ) {
539546 save ( ) ;
540- updateSavebutton ( ) ;
541547 }
542548
543549 // save always on top state and enforce it
0 commit comments