Opening of a window for a database is now done by the MasterController.

The ConnectionManager just passes on the action now.
This commit is contained in:
Eelke Klein 2017-02-01 19:59:07 +01:00
parent 6370050204
commit 343390ff38
4 changed files with 24 additions and 17 deletions

View file

@ -1,6 +1,7 @@
#include "MasterController.h"
#include "connectionmanagerwindow.h"
#include "connectionlistmodel.h"
#include "mainwindow.h"
MasterController::MasterController(QObject *parent) : QObject(parent)
@ -25,3 +26,16 @@ void MasterController::showConnectionManager()
{
m_connectionManagerWindow->show();
}
void MasterController::openWindowForConnection(int connection_index)
{
auto cc = m_connectionListModel->get(connection_index);
m_connectionListModel->save(connection_index);
if (cc.valid()) {
auto w = new MainWindow(this, nullptr);
w->setAttribute( Qt::WA_DeleteOnClose );
w->setConfig(cc.get());
w->show();
}
}