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. More... | |
void | enableSaveToFile (bool enabled) |
Control if the config service changes are persisted to the user file. More... | |
ManageUserDirectories (QWidget *parent=nullptr) | |
Constructor. More... | |
Static Public Member Functions | |
static ManageUserDirectories * | openManageUserDirectories () |
Show the default dialog or raise the existing one if it exists. More... | |
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. More... | |
void | browseToDirectory () |
Browse to find a new directory. More... | |
void | cancelClicked () |
Close the dialog without saving the configuration. More... | |
void | confirmClicked () |
Persist the properties to the config store and close the dialog. More... | |
void | helpClicked () |
Show the help for ManageUserDirectories. More... | |
void | moveDown () |
Lower an item down in the list based on the sender of the signal. More... | |
void | moveUp () |
Raise an item up in the list based on the sender of the signal. More... | |
void | remDir () |
Remove a directory from the list based on the sender. More... | |
void | selectSaveDir () |
Find an existing directory to be used for the save directory path. More... | |
Private Member Functions | |
virtual void | initLayout () |
Create the UI layout, fill the widgets and connect the relevant signals. More... | |
QListWidget * | listWidget (QObject *object) |
Return the QListWidget related to the given sender. More... | |
void | loadProperties () |
Load config properties into the form widgets. More... | |
void | saveProperties () |
Save the current contents of the widgets back to the main config. More... | |
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 65 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 233 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 251 of file ManageUserDirectories.cpp.
References listWidget().
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 221 of file ManageUserDirectories.cpp.
Referenced by initLayout().
|
privateslot |
Persist the properties to the config store and close the dialog.
Definition at line 224 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 77 of file ManageUserDirectories.cpp.
References m_saveToFile.
|
privateslot |
Show the help for ManageUserDirectories.
Definition at line 218 of file ManageUserDirectories.cpp.
References MantidQt::API::HelpWindow::showCustomInterface().
Referenced by initLayout().
|
privatevirtual |
Create the UI layout, fill the widgets and connect the relevant signals.
Definition at line 82 of file ManageUserDirectories.cpp.
References addDirectory(), browseToDirectory(), cancelClicked(), confirmClicked(), helpClicked(), loadProperties(), m_uiForm, moveDown(), 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 204 of file ManageUserDirectories.cpp.
References m_uiForm.
Referenced by addDirectory(), browseToDirectory(), moveDown(), moveUp(), and remDir().
|
private |
Load config properties into the form widgets.
Definition at line 111 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 287 of file ManageUserDirectories.cpp.
References count, index, and listWidget().
Referenced by initLayout().
|
privateslot |
Raise an item up in the list based on the sender of the signal.
Definition at line 273 of file ManageUserDirectories.cpp.
References index, and listWidget().
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 51 of file ManageUserDirectories.cpp.
|
privateslot |
Remove a directory from the list based on the sender.
Definition at line 265 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 150 of file ManageUserDirectories.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_saveToFile, and m_uiForm.
Referenced by confirmClicked().
|
privateslot |
Find an existing directory to be used for the save directory path.
Definition at line 302 of file ManageUserDirectories.cpp.
References m_uiForm.
Referenced by initLayout().
|
private |
Definition at line 57 of file ManageUserDirectories.h.
Referenced by enableSaveToFile(), and saveProperties().
|
private |
Definition at line 56 of file ManageUserDirectories.h.
Referenced by addDirectory(), initLayout(), listWidget(), loadProperties(), ManageUserDirectories(), saveProperties(), and selectSaveDir().