Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes | List of all members
MantidQt::API::ManageUserDirectories Class Reference

Access and update the user directory settings within the Mantid config service. More...

#include <ManageUserDirectories.h>

Inheritance diagram for MantidQt::API::ManageUserDirectories:

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 ManageUserDirectoriesopenManageUserDirectories ()
 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
 

Detailed Description

Access and update the user directory settings within the Mantid config service.

Definition at line 22 of file ManageUserDirectories.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 23 of file ManageUserDirectories.h.

Constructor & Destructor Documentation

◆ ManageUserDirectories()

ManageUserDirectories::ManageUserDirectories ( QWidget *  parent = nullptr)

Constructor.

Parameters
parentA parent QWidget for the dialog

Definition at line 65 of file ManageUserDirectories.cpp.

References initLayout(), and m_uiForm.

Member Function Documentation

◆ addDirectory

void ManageUserDirectories::addDirectory ( )
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().

◆ browseToDirectory

void ManageUserDirectories::browseToDirectory ( )
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().

◆ cancelButton()

QPushButton * MantidQt::API::ManageUserDirectories::cancelButton ( ) const
inline

Testing accessors.

Definition at line 36 of file ManageUserDirectories.h.

◆ cancelClicked

void ManageUserDirectories::cancelClicked ( )
privateslot

Close the dialog without saving the configuration.

Definition at line 221 of file ManageUserDirectories.cpp.

Referenced by initLayout().

◆ confirmClicked

void ManageUserDirectories::confirmClicked ( )
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().

◆ enableSaveToFile()

void ManageUserDirectories::enableSaveToFile ( bool  enabled)

Control if the config service changes are persisted to the user file.

Parameters
enabledIf 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.

◆ helpClicked

void ManageUserDirectories::helpClicked ( )
privateslot

Show the help for ManageUserDirectories.

Definition at line 218 of file ManageUserDirectories.cpp.

References MantidQt::API::HelpWindow::showCustomInterface().

Referenced by initLayout().

◆ initLayout()

void ManageUserDirectories::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().

◆ listWidget()

QListWidget * ManageUserDirectories::listWidget ( QObject *  sender)
private

Return the QListWidget related to the given sender.

Parameters
senderA pointer to the QObject that caused this slot to be called
Returns
QListWidget if sender is a known button else nullptr

Definition at line 204 of file ManageUserDirectories.cpp.

References m_uiForm.

Referenced by addDirectory(), browseToDirectory(), moveDown(), moveUp(), and remDir().

◆ loadProperties()

void ManageUserDirectories::loadProperties ( )
private

Load config properties into the form widgets.

Definition at line 111 of file ManageUserDirectories.cpp.

References m_uiForm.

Referenced by initLayout().

◆ moveDown

void ManageUserDirectories::moveDown ( )
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().

◆ moveUp

void ManageUserDirectories::moveUp ( )
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().

◆ openManageUserDirectories()

ManageUserDirectories * ManageUserDirectories::openManageUserDirectories ( )
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.

◆ remDir

void ManageUserDirectories::remDir ( )
privateslot

Remove a directory from the list based on the sender.

Definition at line 265 of file ManageUserDirectories.cpp.

References listWidget().

Referenced by initLayout().

◆ saveProperties()

void ManageUserDirectories::saveProperties ( )
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().

◆ selectSaveDir

void ManageUserDirectories::selectSaveDir ( )
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().

Member Data Documentation

◆ m_saveToFile

bool MantidQt::API::ManageUserDirectories::m_saveToFile
private

Definition at line 57 of file ManageUserDirectories.h.

Referenced by enableSaveToFile(), and saveProperties().

◆ m_uiForm

Ui::ManageUserDirectories MantidQt::API::ManageUserDirectories::m_uiForm
private

The documentation for this class was generated from the following files: