made start session working

remotes/origin/HEAD
Tobias Weiss 9 years ago
parent 6bd69f1f7e
commit 072bca9c2c

@ -8,7 +8,6 @@ SOURCES += src/localzleafstarter.cpp \
src/main.cpp \ src/main.cpp \
src/mainwindow.cpp \ src/mainwindow.cpp \
src/manualprintingsetup.cpp \ src/manualprintingsetup.cpp \
src/sessionstarter.cpp \
src/Lib/client.cpp \ src/Lib/client.cpp \
src/Lib/clienthelpnotificationserver.cpp \ src/Lib/clienthelpnotificationserver.cpp \
src/Lib/clientpinger.cpp \ src/Lib/clientpinger.cpp \
@ -24,7 +23,6 @@ SOURCES += src/localzleafstarter.cpp \
HEADERS += src/localzleafstarter.h \ HEADERS += src/localzleafstarter.h \
src/mainwindow.h \ src/mainwindow.h \
src/manualprintingsetup.h \ src/manualprintingsetup.h \
src/sessionstarter.h \
src/Lib/client.h \ src/Lib/client.h \
src/Lib/clienthelpnotificationserver.h \ src/Lib/clienthelpnotificationserver.h \
src/Lib/clientpinger.h \ src/Lib/clientpinger.h \
@ -40,8 +38,7 @@ HEADERS += src/localzleafstarter.h \
FORMS += src/localzleafstarter.ui \ FORMS += src/localzleafstarter.ui \
src/mainwindow.ui \ src/mainwindow.ui \
src/manualprintingsetup.ui \ src/manualprintingsetup.ui
src/sessionstarter.ui
QMAKE_CXXFLAGS += -std=c++11 QMAKE_CXXFLAGS += -std=c++11

@ -166,6 +166,10 @@ void lc::Client::OpenTerminal( const QString &argCommand, const bool &argOpenAsR
+ " " + "root@" + ip + "'"}; + " " + "root@" + ip + "'"};
} }
if ( !argCommand.isEmpty() ) {
arguments->last().append( " '" + argCommand + "'" );
}
QProcess openTerminalProcess; QProcess openTerminalProcess;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
openTerminalProcess.setProcessEnvironment( env ); openTerminalProcess.setProcessEnvironment( env );

@ -88,13 +88,13 @@ public:
void SetLocalZLeafDefaultName( const QString &argName ); void SetLocalZLeafDefaultName( const QString &argName );
void ShowOrsee(); void ShowOrsee();
void ShowPreprints(); void ShowPreprints();
public slots:
void StartNewSession( QVector< Client* > argAssocCl, QString argParticipNameReplacement, void StartNewSession( QVector< Client* > argAssocCl, QString argParticipNameReplacement,
bool argPrintLocalReceipts, QString argReceiptsHeader, bool argPrintLocalReceipts, QString argReceiptsHeader,
QString argzTreeDataTargetPath, quint16 argzTreePort, QString argzTreeDataTargetPath, quint16 argzTreePort,
QString argzTreeVersion ); QString argzTreeVersion );
public slots:
signals: signals:
void ZLEAF_RUNNING( QString argClientIP ); void ZLEAF_RUNNING( QString argClientIP );

@ -47,7 +47,7 @@ lc::Settings::Settings( const QSettings &argSettings, QObject *argParent ) :
"Receipts creation will not work.", "Receipts creation will not work.",
argSettings, true ) }, argSettings, true ) },
lcInstDir{ ReadSettingsItem( "labcontrol_installation_directory", lcInstDir{ ReadSettingsItem( "labcontrol_installation_directory",
"Labcontrol will missbehave with high propability.", "Datapath not set. Labcontrol will missbehave with high propability.",
argSettings, true ) }, argSettings, true ) },
localUserName{ GetLocalUserName() }, localUserName{ GetLocalUserName() },
localzLeafSize{ ReadSettingsItem( "local_zLeaf_size", localzLeafSize{ ReadSettingsItem( "local_zLeaf_size",

@ -818,6 +818,7 @@ void lc::MainWindow::GetNewDataTargetPath() {
// Start session button actions // Start session button actions
void lc::MainWindow::on_PBStartSession_clicked() { void lc::MainWindow::on_PBStartSession_clicked() {
if ( ui->CBzTreeVersion->currentIndex() == 0 ) { if ( ui->CBzTreeVersion->currentIndex() == 0 ) {
QMessageBox::information( this, tr( "No z-Tree version chosen" ), QMessageBox::information( this, tr( "No z-Tree version chosen" ),
tr( "A z-Tree version was not chosen, yet. This setting is" tr( "A z-Tree version was not chosen, yet. This setting is"
@ -829,10 +830,10 @@ void lc::MainWindow::on_PBStartSession_clicked() {
if( !ui->ChBSessionWithoutAttachedClients->isChecked() ) { if( !ui->ChBSessionWithoutAttachedClients->isChecked() ) {
if ( !activatedItems.length() ) { if ( !activatedItems.length() ) {
QMessageBox::information( this, tr( "Canceled, no clients were chosen" ), QMessageBox::information( this, tr( "Canceled, no clients were chosen" ),
tr( "The start of a new session was canceled." tr( "The start of a new session was canceled.\n"
" Some clients have to be selected first or the" " Some clients have to be selected first or the"
" creation of sessions without clients must be" " creation of sessions without clients must be"
" allowed with the checkbox close to the bottom" ) ); " allowed with the checkbox." ) );
return; return;
} }
} }
@ -852,7 +853,7 @@ void lc::MainWindow::on_PBStartSession_clicked() {
} }
} }
emit RequestNewSession( associatedClients, anonymousReceiptsPlaceholder, this->lablib->StartNewSession ( associatedClients, anonymousReceiptsPlaceholder,
ui->ChBReceiptsForLocalClients->isChecked(), ui->ChBReceiptsForLocalClients->isChecked(),
ui->CBReceiptsHeader->currentText(), ui->CBReceiptsHeader->currentText(),
ui->CBDataTargetPath->currentText(), ui->CBDataTargetPath->currentText(),
@ -868,6 +869,10 @@ void lc::MainWindow::on_PBStartSession_clicked() {
} }
} }
} }
//Set port to +1
int newPort = ui->SBPort->text().toInt() + 1;
ui->SBPort->setValue(newPort);
} }
// Anonymous receipients header check box // Anonymous receipients header check box

@ -24,7 +24,6 @@ enum class icons_t : unsigned short int { UNKNOWN, OFF, DOWN, BOOT, ON, ZLEAF, I
#include "Lib/client.h" #include "Lib/client.h"
#include "Lib/lablib.h" #include "Lib/lablib.h"
#include "sessionstarter.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include <cmath> #include <cmath>

@ -406,7 +406,7 @@
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>691</width> <width>691</width>
<height>103</height> <height>71</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="VLcleanupRecoverLastSession"> <layout class="QVBoxLayout" name="VLcleanupRecoverLastSession">
@ -432,6 +432,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="PBKillzLeaf">
<property name="toolTip">
<string>Stops zLeaf on all selected clients</string>
</property>
<property name="text">
<string>Stop z-Leaf on selected clients</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="PBRecoverCrashedSession"> <widget class="QPushButton" name="PBRecoverCrashedSession">
<property name="text"> <property name="text">
@ -441,16 +458,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QPushButton" name="PBKillzLeaf">
<property name="toolTip">
<string>Stops zLeaf on all selected clients</string>
</property>
<property name="text">
<string>Stop z-Leaf on selected clients</string>
</property>
</widget>
</item>
<item> <item>
<widget class="Line" name="line_cleanupRecoverLastSession"> <widget class="Line" name="line_cleanupRecoverLastSession">
<property name="orientation"> <property name="orientation">
@ -464,9 +471,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>120</y> <y>88</y>
<width>691</width> <width>691</width>
<height>469</height> <height>461</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="VLNewSession"> <layout class="QVBoxLayout" name="VLNewSession">
@ -1049,6 +1056,15 @@
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="autoScroll"> <property name="autoScroll">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -1056,7 +1072,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="cornerButtonEnabled"> <property name="cornerButtonEnabled">
<bool>true</bool> <bool>false</bool>
</property> </property>
<attribute name="horizontalHeaderVisible"> <attribute name="horizontalHeaderVisible">
<bool>true</bool> <bool>true</bool>
@ -1071,7 +1087,7 @@
<number>30</number> <number>30</number>
</attribute> </attribute>
<attribute name="horizontalHeaderStretchLastSection"> <attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool> <bool>false</bool>
</attribute> </attribute>
<attribute name="verticalHeaderVisible"> <attribute name="verticalHeaderVisible">
<bool>true</bool> <bool>true</bool>
@ -1083,7 +1099,7 @@
<number>25</number> <number>25</number>
</attribute> </attribute>
<attribute name="verticalHeaderStretchLastSection"> <attribute name="verticalHeaderStretchLastSection">
<bool>true</bool> <bool>false</bool>
</attribute> </attribute>
</widget> </widget>
</item> </item>

Loading…
Cancel
Save