Reworked ORSEE display in a browser

remotes/origin/HEAD
markuspg 10 years ago
parent 8180c03c45
commit 3959f20237

@ -1,6 +1,8 @@
[General]
# The user names of all users which shall be able to conduct administrative tasks with Labcontrol
admin_users="UserA|UserB|UserC"
# The browser in which ORSEE shall be displayed
browser_command=/usr/bin/firefox
# The port the client help server shall listen on
client_help_server_port=XXXX
# Client settings
@ -31,7 +33,7 @@ lpr_command=/usr/bin/lpr
netstat_command=/bin/netstat
network_broadcast_address=192.168.1.255
# A combination of an installed browser and the address of your lab's ORSEE
orsee_command=firefox http://yourORSEEserver.tld
orsee_url=http://yourORSEEserver.tld
ping_command=/bin/ping
postscript_viewer=/usr/bin/okular
ps2pdf_command=/usr/bin/ps2pdf

@ -22,9 +22,9 @@
#include <QMetaType>
enum class settItms_t : unsigned short int { DVIPS_CMD, FILE_MANAGER, LC_INST_DIR,
enum class settItms_t : unsigned short int { BROWSER_CMD, DVIPS_CMD, FILE_MANAGER, LC_INST_DIR,
LATEX_CMD, LOCAL_ZLEAF_NAME, LPR_CMD, NETSTAT_CMD, NETW_BRDCAST_ADDR,
ORSEE_COMMAND, PING_COMMAND, POSTSCRIPT_VIEWER, PS2PDF_COMMAND,
ORSEE_URL, PING_COMMAND, POSTSCRIPT_VIEWER, PS2PDF_COMMAND,
SSH_KEY_ROOT, SSH_KEY_USER, RCP_CMD, RM_CMD, SERVER_IP, SSH_CMD,
TERM_EMUL_CMD, USER_NAME_ON_CLIENTS, VNC_VIEWER, WAKEONLAN_CMD,
WMCTRL_CMD, XSET_CMD, ZTREE_INST_DIR, SETT_ITMS_QUANT };

@ -144,6 +144,7 @@ void lc::Lablib::GotNetstatQueryResult( QStringList *argActiveZLeafConnections )
void lc::Lablib::ReadSettings() {
QStringList simpleLoadableItems = { QStringList{}
<< "browser_command"
<< "dvips_command"
<< "file_manager"
<< "labcontrol_installation_directory"
@ -171,6 +172,7 @@ void lc::Lablib::ReadSettings() {
<< "ztree_installation_directory" };
QStringList theItemsErrorComplaints = { QStringList{}
<< "Opening ORSEE in a browser will not work."
<< "Receipts creation will not work."
<< "The display of preprints will not work."
<< "Labcontrol will missbehave with high propability."
@ -197,8 +199,9 @@ void lc::Lablib::ReadSettings() {
<< "Deactivating the screen saver on the clients will not be possible."
<< "zTree will not be available" };
bool is_file[] = { true, true, true, true, false, true, true, false, false, true, true, true, true,
true, true, true, false, true, true, false, true, true, true, false, true };
bool is_file[] = { true, true, true, true, true, false, true, true, false, false,
true, true, true, true, true, true, true, false, true, true,
false, true, true, true, false, true };
QString *tempItemStorage = nullptr;
for ( int i = 0; i < ( int )settItms_t::SETT_ITMS_QUANT; i++ ) {
@ -409,14 +412,15 @@ void lc::Lablib::SetUserNameOnServer( const QString &argUserName ) {
}
void lc::Lablib::ShowOrsee() {
// Start the process
QProcess showOrseeProcess;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
showOrseeProcess.setProcessEnvironment( env );
showOrseeProcess.startDetached( *( *settingsItems )[ ( int )settItms_t::ORSEE_COMMAND ] );
QString program{ *( *settingsItems )[ ( int )settItms_t::BROWSER_CMD ] };
QStringList arguments{ QStringList{} << *( *settingsItems )[ ( int )settItms_t::ORSEE_URL ] };
showOrseeProcess.startDetached( program, arguments );
// Output message via the debug messages tab
debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] %1" ).arg( *( *settingsItems )[ ( int )settItms_t::ORSEE_COMMAND ] ) );
debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] %1 %2" ).arg( program ).arg( arguments.join( " " ) ) );
}
void lc::Lablib::ShowPreprints() {

@ -115,7 +115,8 @@ void lc::MainWindow::DisableDisfunctionalWidgets() {
}
// Disable 'PBShowORSEE', if 'orsee_command' was not set
if ( !lablib->GetSettingsItem( settItms_t::ORSEE_COMMAND ) ) {
if ( !lablib->GetSettingsItem( settItms_t::BROWSER_CMD )
|| !lablib->GetSettingsItem( settItms_t::ORSEE_URL ) ) {
ui->PBShowORSEE->setEnabled( false );
}

Loading…
Cancel
Save