@ -106,7 +106,7 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
if ( zTreeEntries . isEmpty ( ) ) {
if ( zTreeEntries . isEmpty ( ) ) {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
//ui->GBzTree->setEnabled( false );
//ui->GBzTree->setEnabled( false );
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
ui - > PBStartzLeaf - > setEnabled ( false ) ;
ui - > PBStartzLeaf - > setEnabled ( false ) ;
@ -123,8 +123,8 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
ui - > CBWebcamChooser - > setEnabled ( false ) ;
ui - > CBWebcamChooser - > setEnabled ( false ) ;
ui - > GBClientActions - > setEnabled ( false ) ;
ui - > GBClientActions - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > L WebcamChooser- > setEnabled ( false ) ;
ui - > L _ WebcamChooser- > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBKillLocalzLeaf - > setEnabled ( false ) ;
ui - > PBKillLocalzLeaf - > setEnabled ( false ) ;
@ -154,7 +154,7 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
| | settings - > userNameOnClients . isEmpty ( ) ) {
| | settings - > userNameOnClients . isEmpty ( ) ) {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBKillzLeaf - > setEnabled ( false ) ;
ui - > PBKillzLeaf - > setEnabled ( false ) ;
@ -195,7 +195,7 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
if ( settings - > sshCmd . isEmpty ( ) ) {
if ( settings - > sshCmd . isEmpty ( ) ) {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > GBClientActions - > setEnabled ( false ) ;
ui - > GBClientActions - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
@ -208,7 +208,7 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
if ( settings - > tasksetCmd . isEmpty ( ) ) {
if ( settings - > tasksetCmd . isEmpty ( ) ) {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBStartSession - > setEnabled ( false ) ;
ui - > PBStartSession - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
@ -236,12 +236,12 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
if ( settings - > webcamDisplayCmd . isEmpty ( )
if ( settings - > webcamDisplayCmd . isEmpty ( )
| | settings - > webcams . isEmpty ( ) ) {
| | settings - > webcams . isEmpty ( ) ) {
ui - > CBWebcamChooser - > setEnabled ( false ) ;
ui - > CBWebcamChooser - > setEnabled ( false ) ;
ui - > L WebcamChooser- > setEnabled ( false ) ;
ui - > L _ WebcamChooser- > setEnabled ( false ) ;
}
}
if ( settings - > wineCmd . isEmpty ( ) ) {
if ( settings - > wineCmd . isEmpty ( ) ) {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
//ui->PBStartSession->setEnabled( false );
//ui->PBStartSession->setEnabled( false );
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
@ -250,7 +250,7 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
if ( settings - > zTreeInstDir . isEmpty ( ) ) {
if ( settings - > zTreeInstDir . isEmpty ( ) ) {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBStartSession - > setEnabled ( false ) ;
ui - > PBStartSession - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
ui - > PBStartLocalzLeaf - > setEnabled ( false ) ;
@ -375,7 +375,7 @@ void lc::MainWindow::SetupWidgets() {
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > CBClientNames - > setEnabled ( false ) ;
ui - > GBClientActions - > setEnabled ( false ) ;
ui - > GBClientActions - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > LEFilePath - > setEnabled ( false ) ;
ui - > L FakeName- > setEnabled ( false ) ;
ui - > L _ FakeName- > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBBeamFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBChooseFile - > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
ui - > PBRunzLeaf - > setEnabled ( false ) ;
@ -385,18 +385,18 @@ void lc::MainWindow::SetupWidgets() {
// Fill the 'CBWebcamChooser' with all available network webcams
// Fill the 'CBWebcamChooser' with all available network webcams
if ( ! settings - > webcams . isEmpty ( ) ) {
if ( ! settings - > webcams . isEmpty ( ) ) {
for ( const auto & s : settings - > webcams )
for ( const auto & s : settings - > webcams _names )
ui - > CBWebcamChooser - > addItem ( s ) ;
ui - > CBWebcamChooser - > addItem ( s ) ;
}
}
// Disable the admin tab if the user has no administrative rights and set it up
// Disable the admin tab if the user has no administrative rights and set it up
if ( CheckIfUserIsAdmin ( ) ) {
if ( CheckIfUserIsAdmin ( ) ) {
ui - > TAdminActions - > setEnabled ( true ) ;
ui - > TAdminActions - > setEnabled ( true ) ;
ui - > L AdministrativeRights- > setText ( tr ( " You have administrative rights. " ) ) ;
ui - > L _ AdministrativeRights- > setText ( tr ( " You have administrative rights. " ) ) ;
} else {
} else {
ui - > L AdministrativeRights- > setText ( tr ( " You don't have administrative rights. " ) ) ;
ui - > L _ AdministrativeRights- > setText ( tr ( " You don't have administrative rights. " ) ) ;
}
}
ui - > L UserName- > setText ( tr ( " You are user %1 " ) . arg ( settings - > localUserName ) ) ;
ui - > L _ UserName- > setText ( tr ( " You are user %1 " ) . arg ( settings - > localUserName ) ) ;
if ( ! settings - > userNameOnClients . isEmpty ( ) ) {
if ( ! settings - > userNameOnClients . isEmpty ( ) ) {
ui - > RBUseLocalUser - > setText ( settings - > userNameOnClients ) ;
ui - > RBUseLocalUser - > setText ( settings - > userNameOnClients ) ;
} else {
} else {
@ -569,7 +569,10 @@ void lc::MainWindow::on_CBWebcamChooser_activated( int argIndex ) {
if ( argIndex ! = 0 ) {
if ( argIndex ! = 0 ) {
QString program { settings - > webcamDisplayCmd } ;
QString program { settings - > webcamDisplayCmd } ;
QStringList arguments ;
QStringList arguments ;
arguments < < ui - > CBWebcamChooser - > currentText ( ) ;
// Attention argIndex is NOT 0-based
arguments < < settings - > webcams [ argIndex - 1 ] ;
qDebug ( ) < < " Webcam " < < arguments < < " will be opened " ;
QProcess showWebcamProcess ;
QProcess showWebcamProcess ;
QProcessEnvironment env = QProcessEnvironment : : systemEnvironment ( ) ;
QProcessEnvironment env = QProcessEnvironment : : systemEnvironment ( ) ;
@ -674,6 +677,7 @@ void lc::MainWindow::StartLocalzLeaf( QString argzLeafName, QString argzLeafVers
arguments < < " /size " < < QString { settings - > localzLeafSize } ;
arguments < < " /size " < < QString { settings - > localzLeafSize } ;
}
}
qDebug ( ) < < " Start local zLeaf: " < < arguments ;
startProc . startDetached ( settings - > tasksetCmd , arguments ) ;
startProc . startDetached ( settings - > tasksetCmd , arguments ) ;
}
}
@ -789,19 +793,24 @@ void lc::MainWindow::on_PBStartSession_clicked() {
static_cast < quint16 > ( ui - > SBPort - > value ( ) ) ,
static_cast < quint16 > ( ui - > SBPort - > value ( ) ) ,
ui - > CBzTreeVersion - > currentText ( ) ) ;
ui - > CBzTreeVersion - > currentText ( ) ) ;
//Display the command line
QString cmd = this - > lablib - > getzLeafArgs ( ui - > SBPort - > value ( ) , ui - > CBzTreeVersion - > currentText ( ) ) . join ( " " ) ;
ui - > LEzLeafCommandline - > setText ( cmd ) ;
//Start z-Leaf on selected clients if checkbox is activated
//Start z-Leaf on selected clients if checkbox is activated
if ( ui - > ChBautoStartClientZleaf - > isChecked ( ) ) {
if ( ui - > ChBautoStartClientZleaf - > isChecked ( ) ) {
for ( auto cit = activatedItems . cbegin ( ) ; cit ! = activatedItems . cend ( ) ; + + cit ) {
for ( auto cit = activatedItems . cbegin ( ) ; cit ! = activatedItems . cend ( ) ; + + cit ) {
if ( ( * cit ) . data ( Qt : : DisplayRole ) . type ( ) ! = 0 ) {
if ( ( * cit ) . data ( Qt : : DisplayRole ) . type ( ) ! = 0 ) {
Client * client = static_cast < Client * > ( ( * cit ) . data ( Qt : : UserRole ) . value < void * > ( ) ) ;
Client * client = static_cast < Client * > ( ( * cit ) . data ( Qt : : UserRole ) . value < void * > ( ) ) ;
client - > StartZLeaf ( nullptr ) ;
client - > StartZLeaf ( nullptr , cmd ) ;
}
}
}
}
}
}
//Set port to +1
//Set chosen Port
settings - > SetChosenZTreePort ( ui - > SBPort - > text ( ) . toInt ( ) ) ;
// Increment port number
int newPort = ui - > SBPort - > text ( ) . toInt ( ) + 1 ;
int newPort = ui - > SBPort - > text ( ) . toInt ( ) + 1 ;
settings - > SetChosenZTreePort ( newPort ) ;
ui - > SBPort - > setValue ( newPort ) ;
ui - > SBPort - > setValue ( newPort ) ;
}
}