00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifdef ENABLE_SSH
00018
00019
00021
00022 #include <globalsearch/queueinterfaces/lsfdialog.h>
00023
00024 #include <globalsearch/queueinterfaces/lsf.h>
00025
00026 #include <globalsearch/ui/abstractdialog.h>
00027 #include <globalsearch/optbase.h>
00028
00029 #include "ui_lsfdialog.h"
00030
00031 namespace GlobalSearch {
00032
00033 LsfConfigDialog::LsfConfigDialog(AbstractDialog *parent,
00034 OptBase *o,
00035 LsfQueueInterface *p)
00036 : QDialog(parent),
00037 ui(new Ui::LsfConfigDialog),
00038 m_opt(o),
00039 m_lsf(p)
00040 {
00041 ui->setupUi(this);
00042 }
00043
00044 LsfConfigDialog::~LsfConfigDialog()
00045 {
00046 delete ui;
00047 }
00048
00049 void LsfConfigDialog::updateGUI()
00050 {
00051 ui->edit_description->blockSignals(true);
00052 ui->edit_host->blockSignals(true);
00053 ui->edit_bkill->blockSignals(true);
00054 ui->edit_bjobs->blockSignals(true);
00055 ui->edit_bsub->blockSignals(true);
00056 ui->edit_rempath->blockSignals(true);
00057 ui->edit_locpath->blockSignals(true);
00058 ui->edit_username->blockSignals(true);
00059 ui->spin_port->blockSignals(true);
00060 ui->cb_cleanRemoteOnStop->blockSignals(true);
00061
00062 ui->edit_description->setText(m_opt->description);
00063 ui->edit_host->setText(m_opt->host);
00064 ui->edit_bkill->setText(m_lsf->m_bkill);
00065 ui->edit_bjobs->setText(m_lsf->m_bjobs);
00066 ui->edit_bsub->setText(m_lsf->m_bsub);
00067 ui->edit_rempath->setText(m_opt->rempath);
00068 ui->edit_locpath->setText(m_opt->filePath);
00069 ui->edit_username->setText(m_opt->username);
00070 ui->spin_port->setValue(m_opt->port);
00071 ui->cb_cleanRemoteOnStop->setChecked(m_lsf->m_cleanRemoteOnStop);
00072
00073 ui->edit_description->blockSignals(false);
00074 ui->edit_host->blockSignals(false);
00075 ui->edit_bkill->blockSignals(false);
00076 ui->edit_bjobs->blockSignals(false);
00077 ui->edit_bsub->blockSignals(false);
00078 ui->edit_rempath->blockSignals(false);
00079 ui->edit_locpath->blockSignals(false);
00080 ui->edit_username->blockSignals(false);
00081 ui->spin_port->blockSignals(false);
00082 ui->cb_cleanRemoteOnStop->blockSignals(false);
00083 }
00084
00085 void LsfConfigDialog::accept()
00086 {
00087 m_opt->description = ui->edit_description->text().trimmed();
00088 m_opt->host = ui->edit_host->text().trimmed();
00089 m_lsf->m_bkill = ui->edit_bkill->text().trimmed();
00090 m_lsf->m_bjobs = ui->edit_bjobs->text().trimmed();
00091 m_lsf->m_bsub = ui->edit_bsub->text().trimmed();
00092 m_opt->rempath = ui->edit_rempath->text().trimmed();
00093 m_opt->filePath = ui->edit_locpath->text().trimmed();
00094 m_opt->username = ui->edit_username->text().trimmed();
00095 m_opt->port = ui->spin_port->value();
00096 m_lsf->m_cleanRemoteOnStop = ui->cb_cleanRemoteOnStop->isChecked();
00097 QDialog::accepted();
00098 close();
00099 }
00100
00101 void LsfConfigDialog::reject()
00102 {
00103 updateGUI();
00104 QDialog::reject();
00105 close();
00106 }
00107
00108 }
00109
00111 #endif // ENABLE_SSH