Reformat LocalzLeafStarter

remotes/origin/HEAD
markuspg 8 years ago
parent a506443ed7
commit 42d7e76435

@ -1,5 +1,5 @@
/* /*
* Copyright 2014-2016 Markus Prasser * Copyright 2014-2018 Markus Prasser, Tobias Weiss
* *
* This file is part of Labcontrol. * This file is part of Labcontrol.
* *
@ -17,14 +17,14 @@
* along with Labcontrol. If not, see <http://www.gnu.org/licenses/>. * along with Labcontrol. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <memory>
#include <QMessageBox>
#include "localzleafstarter.h" #include "localzleafstarter.h"
#include "ui_localzleafstarter.h" #include "ui_localzleafstarter.h"
#include "Lib/settings.h" #include "Lib/settings.h"
#include <QMessageBox>
#include <memory>
extern std::unique_ptr<lc::Settings> settings; extern std::unique_ptr<lc::Settings> settings;
lc::LocalzLeafStarter::LocalzLeafStarter(QWidget *argParent) : lc::LocalzLeafStarter::LocalzLeafStarter(QWidget *argParent) :
@ -48,15 +48,18 @@ lc::LocalzLeafStarter::LocalzLeafStarter( QWidget *argParent ) :
} }
} }
lc::LocalzLeafStarter::~LocalzLeafStarter() { lc::LocalzLeafStarter::~LocalzLeafStarter()
{
delete ui; delete ui;
} }
void lc::LocalzLeafStarter::on_PBStartLocalzLeaf_clicked() { void lc::LocalzLeafStarter::on_PBStartLocalzLeaf_clicked()
{
if (ui->CBzLeafVersion->currentIndex() == 0) { if (ui->CBzLeafVersion->currentIndex() == 0) {
QMessageBox::information(this, tr("No z-Tree version chosen"), QMessageBox::information(this, tr("No z-Tree version chosen"),
tr( "The was not chosen a z-Tree version, yet. This is" tr("The was not chosen a z-Tree version, yet."
" mandatory, so please set one" ) , QMessageBox::Ok ); " This is mandatory, so please set one"),
QMessageBox::Ok);
return; return;
} }
@ -64,6 +67,7 @@ void lc::LocalzLeafStarter::on_PBStartLocalzLeaf_clicked() {
settings->SetLocalzLeafSize(ui->LELocalzLeafSize->text()); settings->SetLocalzLeafSize(ui->LELocalzLeafSize->text());
//Emit start local z-Leaf request to main window //Emit start local z-Leaf request to main window
emit LocalzLeafRequested( ui->LEzLeafName->text(), ui->CBzLeafVersion->currentText(), emit LocalzLeafRequested(ui->LEzLeafName->text(),
ui->CBzLeafVersion->currentText(),
ui->SBzLeafPort->value()); ui->SBzLeafPort->value());
} }

@ -1,5 +1,5 @@
/* /*
* Copyright 2014-2016 Markus Prasser * Copyright 2014-2018 Markus Prasser, Tobias Weiss
* *
* This file is part of Labcontrol. * This file is part of Labcontrol.
* *
@ -26,20 +26,22 @@ namespace lc {
namespace Ui { namespace Ui {
class LocalzLeafStarter; class LocalzLeafStarter;
} } // namespace Ui
class LocalzLeafStarter : public QWidget { class LocalzLeafStarter : public QWidget
{
Q_OBJECT Q_OBJECT
public: public:
explicit LocalzLeafStarter(QWidget *argParent = nullptr); explicit LocalzLeafStarter(QWidget *argParent = nullptr);
~LocalzLeafStarter(); ~LocalzLeafStarter() override;
signals: signals:
void LocalzLeafRequested( QString argzLeafName, QString argzLeafVersion, int argzTreePort ); void LocalzLeafRequested(QString argzLeafName, QString argzLeafVersion,
int argzTreePort);
private: private:
Ui::LocalzLeafStarter *ui = nullptr; Ui::LocalzLeafStarter *const ui = nullptr;
private slots: private slots:
void on_PBStartLocalzLeaf_clicked(); void on_PBStartLocalzLeaf_clicked();

Loading…
Cancel
Save