|
Mantid
|
Access and update the user directory settings within the Mantid config service. More...
#include <ManageUserDirectories.h>
Public Member Functions | |
| QPushButton * | cancelButton () const |
| Testing accessors. | |
| void | enableSaveToFile (bool enabled) |
| Control if the config service changes are persisted to the user file. | |
| ManageUserDirectories (QWidget *parent=nullptr) | |
| Constructor. | |
Static Public Member Functions | |
| static ManageUserDirectories * | openManageUserDirectories () |
| Show the default dialog or raise the existing one if it exists. | |
Private Types | |
| using | BaseClass = QDialog |
Private Slots | |
| void | addDirectory () |
| Handle the add directory button to take the text from a text box based on the signal sender to the correct list. | |
| void | browseToDirectory () |
| Browse to find a new directory. | |
| void | cancelClicked () |
| Close the dialog without saving the configuration. | |
| void | confirmClicked () |
| Persist the properties to the config store and close the dialog. | |
| void | helpClicked () |
| Show the help for ManageUserDirectories. | |
| void | moveDown () |
| Lower an item down in the list based on the sender of the signal. | |
| void | moveToTop () |
| Raise an item to the top in the list based on the sender of the signal. | |
| void | moveUp () |
| Raise an item up in the list based on the sender of the signal. | |
| void | remDir () |
| Remove a directory from the list based on the sender. | |
| void | selectSaveDir () |
| Find an existing directory to be used for the save directory path. | |
Private Member Functions | |
| virtual void | initLayout () final |
| Create the UI layout, fill the widgets and connect the relevant signals. | |
| QListWidget * | listWidget (QObject *object) |
| Return the QListWidget related to the given sender. | |
| void | loadProperties () |
| Load config properties into the form widgets. | |
| void | moveItem (bool toTop, int offset) |
| Move an item in the list based on the sender of the signal and a specified direction. | |
| void | saveProperties () |
| Save the current contents of the widgets back to the main config. | |
Private Attributes | |
| bool | m_saveToFile |
| Ui::ManageUserDirectories | m_uiForm |
Access and update the user directory settings within the Mantid config service.
Definition at line 22 of file ManageUserDirectories.h.
|
private |
Definition at line 23 of file ManageUserDirectories.h.
| ManageUserDirectories::ManageUserDirectories | ( | QWidget * | parent = nullptr | ) |
Constructor.
| parent | A parent QWidget for the dialog |
Definition at line 66 of file ManageUserDirectories.cpp.
References initLayout(), and m_uiForm.
|
privateslot |
Handle the add directory button to take the text from a text box based on the signal sender to the correct list.
Definition at line 235 of file ManageUserDirectories.cpp.
References listWidget(), and m_uiForm.
Referenced by initLayout().
|
privateslot |
Browse to find a new directory.
The start directory is the last directory accessed by the application. The directory is added to the list based on the object sender
Definition at line 253 of file ManageUserDirectories.cpp.
References listWidget(), and MantidQt::MantidWidgets::QSettingsChangeAware::setValue().
Referenced by initLayout().
|
inline |
Testing accessors.
Definition at line 36 of file ManageUserDirectories.h.
|
privateslot |
Close the dialog without saving the configuration.
Definition at line 223 of file ManageUserDirectories.cpp.
Referenced by initLayout().
|
privateslot |
Persist the properties to the config store and close the dialog.
Definition at line 226 of file ManageUserDirectories.cpp.
References saveProperties().
Referenced by initLayout().
| void ManageUserDirectories::enableSaveToFile | ( | bool | enabled | ) |
Control if the config service changes are persisted to the user file.
| enabled | If true the config is persisted to the user file after updating the service otherwise only the in-memory store is affected. |
Definition at line 78 of file ManageUserDirectories.cpp.
References m_saveToFile.
|
privateslot |
Show the help for ManageUserDirectories.
Definition at line 220 of file ManageUserDirectories.cpp.
References MantidQt::API::HelpWindow::showCustomInterface().
Referenced by initLayout().
|
finalprivatevirtual |
Create the UI layout, fill the widgets and connect the relevant signals.
Definition at line 83 of file ManageUserDirectories.cpp.
References addDirectory(), browseToDirectory(), cancelClicked(), confirmClicked(), helpClicked(), loadProperties(), m_uiForm, moveDown(), moveToTop(), moveUp(), remDir(), and selectSaveDir().
Referenced by ManageUserDirectories().
|
private |
Return the QListWidget related to the given sender.
| sender | A pointer to the QObject that caused this slot to be called |
Definition at line 206 of file ManageUserDirectories.cpp.
References m_uiForm.
Referenced by addDirectory(), browseToDirectory(), moveItem(), and remDir().
|
private |
Load config properties into the form widgets.
Definition at line 113 of file ManageUserDirectories.cpp.
References m_uiForm.
Referenced by initLayout().
|
privateslot |
Lower an item down in the list based on the sender of the signal.
Definition at line 302 of file ManageUserDirectories.cpp.
References moveItem().
Referenced by initLayout().
|
private |
Move an item in the list based on the sender of the signal and a specified direction.
Definition at line 275 of file ManageUserDirectories.cpp.
References count, index, and listWidget().
Referenced by moveDown(), moveToTop(), and moveUp().
|
privateslot |
Raise an item to the top in the list based on the sender of the signal.
Definition at line 296 of file ManageUserDirectories.cpp.
References moveItem().
Referenced by initLayout().
|
privateslot |
Raise an item up in the list based on the sender of the signal.
Definition at line 299 of file ManageUserDirectories.cpp.
References moveItem().
Referenced by initLayout().
|
static |
Show the default dialog or raise the existing one if it exists.
It wraps the Mantid::Kernel::ConfigService by default.
Definition at line 52 of file ManageUserDirectories.cpp.
|
privateslot |
Remove a directory from the list based on the sender.
Definition at line 267 of file ManageUserDirectories.cpp.
References listWidget().
Referenced by initLayout().
|
private |
Save the current contents of the widgets back to the main config.
Definition at line 152 of file ManageUserDirectories.cpp.
References m_saveToFile, and m_uiForm.
Referenced by confirmClicked().
|
privateslot |
Find an existing directory to be used for the save directory path.
Definition at line 305 of file ManageUserDirectories.cpp.
References m_uiForm, and MantidQt::MantidWidgets::QSettingsChangeAware::setValue().
Referenced by initLayout().
|
private |
Definition at line 59 of file ManageUserDirectories.h.
Referenced by enableSaveToFile(), and saveProperties().
|
private |
Definition at line 58 of file ManageUserDirectories.h.
Referenced by addDirectory(), initLayout(), listWidget(), loadProperties(), ManageUserDirectories(), saveProperties(), and selectSaveDir().