diff libgui/src/set-path-dialog.cc @ 27305:d20c31be3160

add a reload button to the gui path dialog * set-path-dialog.cc (set_path_dialog): add new button for reloading path * set-path-dialog.h: new reload button * set-path-model.cc (set_path_model): initialize new flag whether last change is revertible or not, rename method for loading path; (construct): rename into path_to_model, set new revertible flag to false; (update_data): update backup string list if revertible flag is false and set this flag to true again * set-path-model.h: renamed private method contruct into public slot path_to_model, new flag whehter last change is revertible or not
author Torsten Lilge <ttl-octave@mailbox.org>
date Wed, 31 Jul 2019 16:45:56 +0200
parents 1805f8586179
children 82ace1225a9c
line wrap: on
line diff
--- a/libgui/src/set-path-dialog.cc	Mon Jul 29 23:41:07 2019 -0400
+++ b/libgui/src/set-path-dialog.cc	Wed Jul 31 16:45:56 2019 +0200
@@ -65,6 +65,7 @@
     m_move_down_button = new QPushButton (tr ("Move Down"));
     m_remove_button = new QPushButton (tr ("Remove"));
 
+    m_reload_button = new QPushButton (tr ("Reload"));
     m_save_button = new QPushButton (tr ("Save"));
     m_revert_button = new QPushButton (tr ("Revert"));
     m_revert_last_button = new QPushButton (tr ("Revert Last"));
@@ -91,6 +92,9 @@
 
     set_path_model *model = new set_path_model (this);
 
+    connect (m_reload_button, SIGNAL (clicked (void)),
+             model, SLOT (path_to_model (void)));
+
     connect (m_save_button, SIGNAL (clicked (void)),
              model, SLOT (save (void)));
 
@@ -106,10 +110,12 @@
     m_path_list->setSelectionBehavior (QAbstractItemView::SelectRows);
     m_path_list->setSelectionMode (QAbstractItemView::ExtendedSelection);
     m_path_list->setAlternatingRowColors (true);
+    m_path_list->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 
     // layout everything
     QDialogButtonBox *button_box = new QDialogButtonBox (Qt::Horizontal);
     button_box->addButton (m_save_button, QDialogButtonBox::ActionRole);
+    button_box->addButton (m_reload_button, QDialogButtonBox::ActionRole);
 
     // add dialog close button
     m_close_button = button_box->addButton (QDialogButtonBox::Close);