Split all connection related controller functionality off into seperate ConnectionController.
This commit is contained in:
parent
8c13bdc2ef
commit
35d1e75d35
8 changed files with 103 additions and 61 deletions
|
|
@ -18,6 +18,7 @@ class ConnectionListModel;
|
|||
class ConnectionManagerWindow;
|
||||
class PasswordManager;
|
||||
|
||||
class ConnectionController;
|
||||
/** \brief Controller class responsible for all things global.
|
||||
*/
|
||||
class MasterController : public QObject {
|
||||
|
|
@ -30,6 +31,26 @@ public:
|
|||
|
||||
void init();
|
||||
|
||||
ConnectionController* connectionController();
|
||||
QSqlDatabase& userConfigDatabase();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
QSqlDatabase m_userConfigDatabase;
|
||||
ConnectionController* m_connectionController = nullptr;
|
||||
};
|
||||
|
||||
class ConnectionController : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ConnectionController(MasterController *parent = nullptr);
|
||||
~ConnectionController();
|
||||
|
||||
void init();
|
||||
|
||||
ConnectionListModel *getConnectionListModel()
|
||||
{
|
||||
return m_connectionListModel;
|
||||
|
|
@ -40,18 +61,12 @@ public:
|
|||
void openServerWindowForConnection(size_t connection_index);
|
||||
void openBackupDlgForConnection(size_t connection_index);
|
||||
|
||||
// std::shared_ptr<Botan::Sqlite3_Database> getUserConfigDatabase();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
MasterController *m_masterController;
|
||||
ConnectionList *m_connectionList = nullptr;
|
||||
ConnectionListModel *m_connectionListModel = nullptr;
|
||||
ConnectionManagerWindow *m_connectionManagerWindow = nullptr;
|
||||
//std::shared_ptr<Botan::Sqlite3_Database> m_userConfigDatabase;
|
||||
QSqlDatabase m_userConfigDatabase;
|
||||
|
||||
/** Using long lived object so it can remember its master password for sometime
|
||||
* if the user wishes it.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue