# HG changeset patch # User Torsten # Date 1452196594 -3600 # Node ID 43b498b8c38cee239fce988ea67bf31f36e1d5ad # Parent e2fdbdd00ef9ffcb2fb2644853b7c65e574063ef always restore breakpoints of an editor file after saving * file-editor-tab.cc (save_file): always restore the breakpoints without checking preferences or asking the user; (notice_settings): no more preferences for restoring the breakpoints * file-editor-tab.h: removed obsolete class varaibale * settings-dialog.cc (settings_dialog, write_changed_settings): no more references for restoring breakpoints * settings-dialog.ui: removed tab for debugger settings diff -r e2fdbdd00ef9 -r 43b498b8c38c libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Thu Jan 07 20:17:14 2016 +0100 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Jan 07 20:56:34 2016 +0100 @@ -1633,66 +1633,8 @@ } // Attempt to restore the breakpoints if that is desired. - if (! list.isEmpty ()) - { - bool restore_breakpoints; - if (_breakpoint_filesave_behavior == "RESTORE") - restore_breakpoints = true; - else if (_breakpoint_filesave_behavior == "DISCARD") - restore_breakpoints = false; - else - { - // ask user - QMessageBox *dlgBox = new QMessageBox (QMessageBox::Question, - tr ("Octave Editor"), - tr ("Would you like to restore adjusted breakpoints?"), - QMessageBox::Yes | QMessageBox::No, this); - - // add checkbox whether to store the result in the settings - QCheckBox *checkBox = new QCheckBox ("Don't ask again."); - checkBox->setCheckState (Qt::Unchecked); - QVBoxLayout *extra = new QVBoxLayout (dlgBox); - extra->addWidget (checkBox); - QGridLayout *dialog_layout = dynamic_cast (dlgBox->layout ()); - dialog_layout->addLayout (extra,dialog_layout->rowCount (),0, - 1,dialog_layout->columnCount ()); - - // shoe the dialog - dlgBox->exec (); - - // evaluate result - QMessageBox::StandardButton clicked = dlgBox->standardButton (dlgBox->clickedButton ()); - restore_breakpoints = (clicked == QMessageBox::Yes); - - if (checkBox->checkState () == Qt::Checked) - { - // User no longer wants to be asked so save the setting for - // this object... - if (restore_breakpoints) - _breakpoint_filesave_behavior = "RESTORE"; - else - _breakpoint_filesave_behavior = "DISCARD"; - - // ...and on disc (and Preferences...) - QSettings *settings = resource_manager::get_settings (); - if (settings) - { - settings->setValue ("debugger/breakpoint_filesave_behavior", - _breakpoint_filesave_behavior); - settings->sync (); - } - } - - delete dlgBox; - - } - - if (restore_breakpoints) - { - for (int i = 0; i < list.length (); i++) - handle_request_add_breakpoint (list.value (i) + 1); - } - } + for (int i = 0; i < list.length (); i++) + handle_request_add_breakpoint (list.value (i) + 1); } void @@ -2103,9 +2045,6 @@ _long_title = settings->value ("editor/longWindowTitle", false).toBool (); update_window_title (_edit_area->isModified ()); - _breakpoint_filesave_behavior = settings->value ("debugger/breakpoint_filesave_behavior", "ASK"). - toString (); - _edit_area->setEdgeColumn ( settings->value ("editor/long_line_column",80).toInt ()); if (settings->value ("editor/long_line_marker",true).toBool ()) diff -r e2fdbdd00ef9 -r 43b498b8c38c libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Thu Jan 07 20:17:14 2016 +0100 +++ b/libgui/src/m-editor/file-editor-tab.h Thu Jan 07 20:56:34 2016 +0100 @@ -272,8 +272,6 @@ bool _always_reload_changed_files; bool _smart_indent; - QString _breakpoint_filesave_behavior; - QFileSystemWatcher _file_system_watcher; find_dialog *_find_dialog; diff -r e2fdbdd00ef9 -r 43b498b8c38c libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Thu Jan 07 20:17:14 2016 +0100 +++ b/libgui/src/settings-dialog.cc Thu Jan 07 20:56:34 2016 +0100 @@ -308,14 +308,6 @@ ui->general_icon_graphic-> setChecked (widget_icon_set == "GRAPHIC"); ui->general_icon_letter-> setChecked (widget_icon_set == "LETTER"); - // how breakpoints should behave when file is saved - QString breakpoint_filesave_behavior = - settings->value ("debugger/breakpoint_filesave_behavior", "ASK").toString (); - ui->debugger_filesave_ask->setChecked (true); // the default (if invalid set) - ui->debugger_filesave_ask->setChecked (breakpoint_filesave_behavior == "ASK"); - ui->debugger_filesave_restore->setChecked (breakpoint_filesave_behavior == "RESTORE"); - ui->debugger_filesave_discard->setChecked (breakpoint_filesave_behavior == "DISCARD"); - // custom title bar of dock widget QVariant default_var = QColor (255,255,255); QColor bg_color = settings->value ("Dockwidgets/title_bg_color", @@ -720,15 +712,6 @@ settings_dialog::write_changed_settings (bool closing) { QSettings *settings = resource_manager::get_settings (); - // FIXME: what should happen if settings is 0? - - // how breakpoints should be treated when file is saved - QString breakpoint_filesave_behavior = "ASK"; - if (ui->debugger_filesave_restore->isChecked ()) - breakpoint_filesave_behavior = "RESTORE"; - else if (ui->debugger_filesave_discard->isChecked ()) - breakpoint_filesave_behavior = "DISCARD"; - settings->setValue ("debugger/breakpoint_filesave_behavior", breakpoint_filesave_behavior); // the icon set QString widget_icon_set = "NONE"; diff -r e2fdbdd00ef9 -r 43b498b8c38c libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Thu Jan 07 20:17:14 2016 +0100 +++ b/libgui/src/settings-dialog.ui Thu Jan 07 20:56:34 2016 +0100 @@ -1499,111 +1499,6 @@ - - - Debugger - - - - - - - 16777215 - 16777215 - - - - true - - - - - 0 - 0 - 658 - 571 - - - - - - - - - - - - 0 - 0 - - - - Breakpoint Retention Upon Saving File - - - - - 10 - 20 - 273 - 21 - - - - Ask whether breakpoints should be restored - - - - - - 10 - 40 - 231 - 21 - - - - Automatically restore breakpoints - - - - - - 10 - 60 - 231 - 21 - - - - Discard breakpoints - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Terminal