megamove
This commit is contained in:
parent
c2e201f813
commit
f51105bde0
114 changed files with 92 additions and 0 deletions
41
src/MasterController.cpp
Normal file
41
src/MasterController.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include "MasterController.h"
|
||||
#include "connectionmanagerwindow.h"
|
||||
#include "connectionlistmodel.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
MasterController::MasterController(QObject *parent) : QObject(parent)
|
||||
{}
|
||||
|
||||
MasterController::~MasterController()
|
||||
{
|
||||
delete m_connectionManagerWindow;
|
||||
delete m_connectionListModel;
|
||||
}
|
||||
|
||||
void MasterController::init()
|
||||
{
|
||||
m_connectionListModel = new ConnectionListModel(this);
|
||||
|
||||
m_connectionManagerWindow = new ConnectionManagerWindow(this, nullptr);
|
||||
m_connectionManagerWindow->show();
|
||||
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue