Adjusted the handling of to be displayed webcams

remotes/origin/HEAD
Markus Prasser 10 years ago committed by markuspg
parent c73e1a6db6
commit 7660a47003

@ -49,6 +49,8 @@ terminal_emulator_command=/usr/bin/gnome-terminal
user_name_on_clients=user
vnc_viewer=/usr/bin/vinagre
wakeonlan_command=/usr/bin/wakeonlan
# The program used to view the laboratory's webcams
webcam_command=/usr/local/bin/WebcamDisplay
# URLs to available webcams
webcams="webcam_left|webcam_right"
wine_command=/usr/bin/wine

@ -77,6 +77,9 @@ lc::Settings::Settings( const QSettings &argSettings, QObject *argParent ) :
wakeonlanCmd{ ReadSettingsItem( "wakeonlan_command",
"Booting the clients will not work.",
argSettings, true ) },
webcamDisplayCmd{ ReadSettingsItem( "webcam_command",
"Displaying the laboratory's webcams will not work.",
argSettings, true ) },
webcams{ argSettings.value( "webcams", "" ).toString().split( '|', QString::SkipEmptyParts,
Qt::CaseInsensitive ) },
wineCmd{ ReadSettingsItem( "wine_command",

@ -44,6 +44,7 @@ public:
const QString userNameOnClients;
const QString vncViewer;
const QString wakeonlanCmd;
const QString webcamDisplayCmd;
const QStringList webcams;
const QString wineCmd;
const QString wmctrlCmd;

@ -176,6 +176,13 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
ui->PBBoot->setEnabled( false );
}
// Deactivate the webcam choosing interface if no webcams are available or the viewer is missing
if ( settings->webcamDisplayCmd.isEmpty()
|| settings->webcams.isEmpty() ) {
ui->CBWebcamChooser->setEnabled( false );
ui->LWebcamChooser->setEnabled( false );
}
// Disable the disable screensaver function if the 'xset_command' was not set
if ( settings->xsetCmd.isEmpty() ) {
ui->PBDeactivateScreensaver->setEnabled( false );
@ -206,7 +213,7 @@ void lc::MainWindow::LoadIconPixmaps() {
void lc::MainWindow::on_CBWebcamChooser_activated( int argIndex ) {
if ( argIndex != 0 ) {
QString program{ settings->lcInstDir + "/webcam_display" };
QString program{ settings->webcamDisplayCmd };
QStringList arguments;
arguments << ui->CBWebcamChooser->currentText();
@ -646,12 +653,6 @@ void lc::MainWindow::SetupWidgets() {
for ( const auto &s : settings->webcams )
ui->CBWebcamChooser->addItem( s );
}
// Deactivate the webcam choosing interface, if no webcams are available
if ( ui->CBWebcamChooser->count() == 0 ) {
ui->LWebcamChooser->setEnabled( false );
ui->CBWebcamChooser->setEnabled( false );
}
clients = nullptr;
const QStringList &zTreeEntries = settings->installedZTreeVersions;

Loading…
Cancel
Save