Ksetiwatch API Documentation


addsetilocdlg.cpp

Go to the documentation of this file.
00001 /***************************************************************************/
00018 #include <kapp.h>
00019 #include <klocale.h>
00020 #include <kfiledialog.h>
00021 #include <kmessagebox.h>
00022 #include <kcolorbutton.h>
00023 #include <kiconloader.h>
00024 
00025 #include <qcheckbox.h>
00026 #include <qtooltip.h>
00027 #include <qlayout.h>
00028 #include <qlabel.h>
00029 #include <qslider.h>
00030 
00031 #include "addsetilocdlg.h"
00032 
00033 /*------------------------------------------------------------------------ */
00034 AddSetiLocDlg::AddSetiLocDlg(QWidget *parent, const char *name)
00035              : KDialogBase(IconList, QString::null, Ok|Cancel, Ok, parent, name)
00036 {
00037 resize(400, 300);
00038 enableButtonOK(false);
00039 
00040 setupLocationPage();
00041 setupClientPage();
00042 setupLoggingPage();
00043 
00044 QToolTip::add(StopAfterProcChkBox, i18n("Process the work unit and stop after \n"
00045                                    "processing is complete, do not return \n"
00046                                    "the result."));
00047 
00048 QToolTip::add(StopAfterSendChkBox, i18n("Finish the current work unit, and \n"
00049                                    "return the result without downloading\n"
00050                                    "a new work unit."));
00051 
00052 QToolTip::add(EmailChkBox, i18n("Send email (to login email address) on\n"
00053                            "errors. This option is not available\n"
00054                            "for all clients."));
00055 
00056 QToolTip::add(GraphicsChkBox, i18n("Generate a data stream for the xsetiathome\n"
00057                               "graphical interface (see README.xsetiathome).\n"
00058                               "This option is not available for all clients."));
00059 
00060 
00061 DirecButton->setPixmap(SmallIcon("fileopen"));
00062 StartExeButton->setPixmap(SmallIcon("fileopen"));
00063 StopExeButton->setPixmap(SmallIcon("fileopen"));
00064 RedirButton->setPixmap(SmallIcon("fileopen"));
00065 ColorButton->setColor(Qt::red);
00066 }
00067 
00068 /*------------------------------------------------------------------------ */
00069 AddSetiLocDlg::~AddSetiLocDlg()
00070 {
00071 }
00072 
00073 /*------------------------------------------------------------------------ */
00074 void AddSetiLocDlg::setupLocationPage()
00075 {
00076 QFrame* page = addPage(i18n("Location"), i18n("General location settings"),
00077                        DesktopIcon("ksetiwatch", KIcon::SizeMedium));
00078 
00079 LocationLayout = new QGridLayout( page );
00080 LocationLayout->setSpacing( 6 );
00081 LocationLayout->setMargin( 0 );
00082 
00083 DescrEdit = new QLineEdit( page, "DescrEdit" );
00084 DescrEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DescrEdit->sizePolicy().hasHeightForWidth() ) );
00085 DescrEdit->setMinimumSize( QSize( 210, 0 ) );
00086 QToolTip::add(  DescrEdit, i18n( "A descriptive name for the location." ) );
00087 
00088 LocationLayout->addWidget( DescrEdit, 1, 0 );
00089 
00090 ColorButton = new KColorButton( page, "ColorButton" );
00091 ColorButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, ColorButton->sizePolicy().hasHeightForWidth() ) );
00092 ColorButton->setMinimumSize( QSize( 60, 25 ) );
00093 QToolTip::add(  ColorButton, i18n( "This color will be used for the markers on the skymap." ) );
00094 
00095 LocationLayout->addWidget( ColorButton, 1, 1 );
00096 
00097 DescrLabel = new QLabel( page, "DescrLabel" );
00098 DescrLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DescrLabel->sizePolicy().hasHeightForWidth() ) );
00099 DescrLabel->setText( i18n( "Description:" ) );
00100 
00101 LocationLayout->addWidget( DescrLabel, 0, 0 );
00102 
00103 ColorLabel = new QLabel( page, "ColorLabel" );
00104 ColorLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, ColorLabel->sizePolicy().hasHeightForWidth() ) );
00105 ColorLabel->setText( i18n( "Color:" ) );
00106 
00107 LocationLayout->addWidget( ColorLabel, 0, 1 );
00108 
00109 LocationSubLayout1 = new QGridLayout;
00110 LocationSubLayout1->setSpacing( 6 );
00111 LocationSubLayout1->setMargin( 0 );
00112 
00113 DirecLabel = new QLabel( page, "DirecLabel" );
00114 DirecLabel->setText( i18n( "SETI@home directory:" ) );
00115 
00116 LocationSubLayout1->addWidget( DirecLabel, 0, 0 );
00117 
00118 DirecButton = new QPushButton( page, "DirecButton" );
00119 DirecButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, DirecButton->sizePolicy().hasHeightForWidth() ) );
00120 DirecButton->setMaximumSize( QSize( 40, 30 ) );
00121 
00122 LocationSubLayout1->addWidget( DirecButton, 1, 1 );
00123 
00124 DirecEdit = new QLineEdit( page, "DirecEdit" );
00125 QToolTip::add(  DirecEdit, i18n( "The directory where the S@h files reside." ) );
00126 
00127 LocationSubLayout1->addWidget( DirecEdit, 1, 0 );
00128 
00129 LocationLayout->addMultiCellLayout( LocationSubLayout1, 2, 2, 0, 1 );
00130 
00131 LocationSubLayout2 = new QGridLayout;
00132 LocationSubLayout2->setSpacing( 6 );
00133 LocationSubLayout2->setMargin( 0 );
00134 
00135 StartExeEdit = new QLineEdit( page, "StartExeEdit" );
00136 StartExeEdit->setEnabled( FALSE );
00137 StartExeEdit->setText( i18n( "./setiathome" ) );
00138 QToolTip::add(  StartExeEdit, i18n( "Enter here path and file name of the executable." ) );
00139 
00140 LocationSubLayout2->addWidget( StartExeEdit, 1, 0 );
00141 
00142 StartExeChkBox = new QCheckBox( page, "StartExeChkBox" );
00143 StartExeChkBox->setText( i18n( "Start-up executable:" ) );
00144 QToolTip::add(  StartExeChkBox, i18n( "Enable to run a customized executable at start-up." ) );
00145 
00146 LocationSubLayout2->addWidget( StartExeChkBox, 0, 0 );
00147 
00148 StartExeButton = new QPushButton( page, "StartExeButton" );
00149 StartExeButton->setEnabled( FALSE );
00150 StartExeButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, StartExeButton->sizePolicy().hasHeightForWidth() ) );
00151 StartExeButton->setMaximumSize( QSize( 40, 30 ) );
00152 
00153 LocationSubLayout2->addWidget( StartExeButton, 1, 1 );
00154 
00155 LocationLayout->addMultiCellLayout( LocationSubLayout2, 3, 3, 0, 1 );
00156 
00157 LocationSubLayout3 = new QGridLayout;
00158 LocationSubLayout3->setSpacing( 6 );
00159 LocationSubLayout3->setMargin( 0 );
00160 
00161 StopExeEdit = new QLineEdit( page, "StopExeEdit" );
00162 StopExeEdit->setEnabled( FALSE );
00163 QToolTip::add(  StopExeEdit, i18n( "Enter here path and file name of the executable." ) );
00164 
00165 LocationSubLayout3->addWidget( StopExeEdit, 1, 0 );
00166 
00167 StopExeChkBox = new QCheckBox( page, "StopExeChkBox" );
00168 StopExeChkBox->setText( i18n( "Shut-down executable:" ) );
00169 QToolTip::add(  StopExeChkBox, i18n( "Enable to run a customized executable at shut-down." ) );
00170 
00171 LocationSubLayout3->addWidget( StopExeChkBox, 0, 0 );
00172 
00173 StopExeButton = new QPushButton( page, "StopExeButton" );
00174 StopExeButton->setEnabled( FALSE );
00175 StopExeButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, StopExeButton->sizePolicy().hasHeightForWidth() ) );
00176 StopExeButton->setMaximumSize( QSize( 40, 30 ) );
00177 
00178 LocationSubLayout3->addWidget( StopExeButton, 1, 1 );
00179 
00180 LocationLayout->addMultiCellLayout( LocationSubLayout3, 4, 4, 0, 1 );
00181 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00182 LocationLayout->addItem( spacer, 5, 0 );
00183 
00184 // signals and slots connections
00185 connect( DirecButton, SIGNAL( clicked() ), this, SLOT( slotGetSetiDirectory() ) );
00186 connect( DescrEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotHandleText(const QString&) ) );
00187 connect( DirecEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotHandleText(const QString&) ) );
00188 connect( StartExeChkBox, SIGNAL( toggled(bool) ), StartExeEdit, SLOT( setEnabled(bool) ) );
00189 connect( StartExeChkBox, SIGNAL( toggled(bool) ), StartExeButton, SLOT( setEnabled(bool) ) );
00190 connect( StopExeChkBox, SIGNAL( toggled(bool) ), StopExeEdit, SLOT( setEnabled(bool) ) );
00191 connect( StopExeChkBox, SIGNAL( toggled(bool) ), StopExeButton, SLOT( setEnabled(bool) ) );
00192 connect( StopExeButton, SIGNAL( clicked() ), this, SLOT( slotGetStopExe() ) );
00193 connect( StartExeButton, SIGNAL( clicked() ), this, SLOT( slotGetStartExe() ) );
00194 
00195 // tab order
00196 setTabOrder( DescrEdit, DirecEdit );
00197 setTabOrder( DirecEdit, DirecButton );
00198 setTabOrder( DirecButton, StartExeChkBox );
00199 setTabOrder( StartExeChkBox, StartExeEdit );
00200 setTabOrder( StartExeEdit, StartExeButton );
00201 setTabOrder( StartExeButton, StopExeChkBox );
00202 setTabOrder( StopExeChkBox, StopExeEdit );
00203 setTabOrder( StopExeEdit, StopExeButton );
00204 }
00205 
00206 /*------------------------------------------------------------------------ */
00207 void AddSetiLocDlg::setupLoggingPage()
00208 {
00209 QFrame* page = addPage(i18n("WU Logging"), i18n("Logging of completed work units"),
00210                        DesktopIcon("document", KIcon::SizeMedium));
00211 
00212 LoggingLayout = new QGridLayout( page );
00213 LoggingLayout->setSpacing( 6 );
00214 LoggingLayout->setMargin( 0 );
00215 
00216 RedirEdit = new QLineEdit( page, "RedirEdit" );
00217 QToolTip::add(  RedirEdit, i18n( "Log files will be stored in this folder." ) );
00218 
00219 LoggingLayout->addWidget( RedirEdit, 2, 0 );
00220 
00221 RedirButton = new QPushButton( page, "RedirButton" );
00222 RedirButton->setMaximumSize( QSize( 40, 30 ) );
00223 
00224 LoggingLayout->addWidget( RedirButton, 2, 1 );
00225 
00226 RedirChkBox = new QCheckBox( page, "RedirChkBox" );
00227 RedirChkBox->setText( i18n( "Redirect Log Files to:" ) );
00228 
00229 LoggingLayout->addMultiCellWidget( RedirChkBox, 1, 1, 0, 1 );
00230 
00231 LogChkBox = new QCheckBox( page, "LogChkBox" );
00232 LogChkBox->setText( i18n( "Enable Logging of Work Units" ) );
00233 LogChkBox->setChecked( TRUE );
00234 
00235 LoggingLayout->addMultiCellWidget( LogChkBox, 0, 0, 0, 1 );
00236 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00237 LoggingLayout->addItem( spacer, 3, 0 );
00238 
00239 // signals and slots connections
00240 connect( LogChkBox, SIGNAL( toggled(bool) ), RedirChkBox, SLOT( setEnabled(bool) ) );
00241 connect( LogChkBox, SIGNAL( toggled(bool) ), RedirEdit, SLOT( setEnabled(bool) ) );
00242 connect( LogChkBox, SIGNAL( toggled(bool) ), RedirButton, SLOT( setEnabled(bool) ) );
00243 connect( RedirButton, SIGNAL( clicked() ), this, SLOT( slotGetLogDirectory() ) );
00244 
00245 // tab order
00246 setTabOrder( LogChkBox, RedirChkBox );
00247 setTabOrder( RedirChkBox, RedirEdit );
00248 setTabOrder( RedirEdit, RedirButton );
00249 }
00250 
00251 /*------------------------------------------------------------------------ */
00252 void AddSetiLocDlg::setupClientPage()
00253 {
00254 QFrame* page = addPage(i18n("SETI@home Client"), i18n("Settings of the SETI@home client"),
00255                        DesktopIcon("exec", KIcon::SizeMedium));
00256 
00257 ClientLayout = new QVBoxLayout( page );
00258 ClientLayout->setSpacing( 6 );
00259 ClientLayout->setMargin( 0 );
00260 
00261 StartSetiChkBox = new QCheckBox( page, "StartSetiChkBox" );
00262 StartSetiChkBox->setText( i18n( "Invoke SETI@home Client on Startup" ) );
00263 QToolTip::add( StartSetiChkBox, i18n( "Enable this option if you want to start\nthe client together with Ksetiwatch." ) );
00264 ClientLayout->addWidget( StartSetiChkBox );
00265 
00266 StopSetiChkBox = new QCheckBox( page, "StopSetiChkBox" );
00267 StopSetiChkBox->setText( i18n( "Stop SETI@home Client on Exit" ) );
00268 QToolTip::add( StopSetiChkBox, i18n( "Enable this option if you want to stop\nthe client together with Ksetiwatch." ) );
00269 ClientLayout->addWidget( StopSetiChkBox );
00270 
00271 KeepAliveCheckBox = new QCheckBox( page, "KeepAliveCheckBox" );
00272 KeepAliveCheckBox->setText( i18n( "Keep Client Alive" ) );
00273 QToolTip::add( KeepAliveCheckBox, i18n( "Restart the client if it crashes or stops\nfor unknown reasons." ) );
00274 ClientLayout->addWidget( KeepAliveCheckBox );
00275 
00276 ClientSubLayout2 = new QGridLayout( 0, 1, 1, 0, 2, "ClientSubLayout2");
00277 
00278 HighLabel = new QLabel( page, "HighLabel" );
00279 HighLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, HighLabel->sizePolicy().hasHeightForWidth() ) );
00280 HighLabel->setText( i18n( "High" ) );
00281 HighLabel->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00282 
00283 ClientSubLayout2->addWidget( HighLabel, 2, 2 );
00284 
00285 LowLabel = new QLabel( page, "LowLabel" );
00286 LowLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, LowLabel->sizePolicy().hasHeightForWidth() ) );
00287 LowLabel->setText( i18n( "Low" ) );
00288 
00289 ClientSubLayout2->addWidget( LowLabel, 2, 0 );
00290 
00291 PrioritySlider = new QSlider( page, "PrioritySlider" );
00292 PrioritySlider->setMinValue( 1 );
00293 PrioritySlider->setMaxValue( 19 );
00294 PrioritySlider->setLineStep( 1 );
00295 PrioritySlider->setPageStep( 5 );
00296 PrioritySlider->setValue( 1 );
00297 PrioritySlider->setOrientation( QSlider::Horizontal );
00298 PrioritySlider->setTickmarks( QSlider::Right );
00299 PrioritySlider->setTickInterval( 1 );
00300 
00301 ClientSubLayout2->addMultiCellWidget( PrioritySlider, 1, 1, 0, 2 );
00302 
00303 PriorityLabel = new QLabel( page, "PriorityLabel" );
00304 PriorityLabel->setText( i18n( "Priority:" ) );
00305 
00306 ClientSubLayout2->addWidget( PriorityLabel, 0, 0 );
00307 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00308 ClientSubLayout2->addItem( spacer, 2, 1 );
00309 ClientLayout->addLayout( ClientSubLayout2 );
00310 
00311 ClientSubLayout3 = new QGridLayout( 0, 1, 1, 0, 2, "ClientSubLayout3");
00312 
00313 ProxyServerChkBox = new QCheckBox( page, "ProxyServerChkBox" );
00314 ProxyServerChkBox->setText( i18n( "Proxy Server:" ) );
00315 
00316 ClientSubLayout3->addWidget( ProxyServerChkBox, 0, 0 );
00317 
00318 ProxyServerEdit = new QLineEdit( page, "ProxyServerEdit" );
00319 ProxyServerEdit->setEnabled( FALSE );
00320 ProxyServerEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, ProxyServerEdit->sizePolicy().hasHeightForWidth() ) );
00321 
00322 ClientSubLayout3->addWidget( ProxyServerEdit, 1, 0 );
00323 
00324 ProxyPortEdit = new QLineEdit( page, "ProxyPortEdit" );
00325 ProxyPortEdit->setEnabled( FALSE );
00326 ProxyPortEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, ProxyPortEdit->sizePolicy().hasHeightForWidth() ) );
00327 
00328 ClientSubLayout3->addWidget( ProxyPortEdit, 1, 1 );
00329 
00330 ProxyPortLabel = new QLabel( page, "ProxyPortLabel" );
00331 ProxyPortLabel->setEnabled( FALSE );
00332 ProxyPortLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, ProxyPortLabel->sizePolicy().hasHeightForWidth() ) );
00333 ProxyPortLabel->setText( i18n( "Port:" ) );
00334 
00335 ClientSubLayout3->addWidget( ProxyPortLabel, 0, 1 );
00336 ClientLayout->addLayout( ClientSubLayout3 );
00337 
00338 ClientSubLayout1 = new QGridLayout( 0, 1, 1, 0, 6, "ClientSubLayout1");
00339 
00340 ArgEdit = new QLineEdit( page, "ArgEdit" );
00341 QToolTip::add( ArgEdit, i18n( "See the README of the S@h client for details." ) );
00342 
00343 ClientSubLayout1->addMultiCellWidget( ArgEdit, 1, 1, 0, 1 );
00344 
00345 StopAfterProcChkBox = new QCheckBox( page, "StopAfterProcChkBox" );
00346 StopAfterProcChkBox->setText( i18n( "-stop_after_process" ) );
00347 
00348 ClientSubLayout1->addWidget( StopAfterProcChkBox, 2, 0 );
00349 
00350 ArgLabel = new QLabel( page, "ArgLabel" );
00351 ArgLabel->setText( i18n( "Command Line Arguments:" ) );
00352 
00353 ClientSubLayout1->addMultiCellWidget( ArgLabel, 0, 0, 0, 1 );
00354 
00355 GraphicsChkBox = new QCheckBox( page, "GraphicsChkBox" );
00356 GraphicsChkBox->setText( i18n( "-graphics" ) );
00357 
00358 ClientSubLayout1->addWidget( GraphicsChkBox, 3, 1 );
00359 
00360 StopAfterSendChkBox = new QCheckBox( page, "StopAfterSendChkBox" );
00361 StopAfterSendChkBox->setText( i18n( "-stop_after_send" ) );
00362 
00363 ClientSubLayout1->addWidget( StopAfterSendChkBox, 3, 0 );
00364 
00365 EmailChkBox = new QCheckBox( page, "EmailChkBox" );
00366 EmailChkBox->setText( i18n( "-email" ) );
00367 
00368 ClientSubLayout1->addWidget( EmailChkBox, 2, 1 );
00369 ClientLayout->addLayout( ClientSubLayout1 );
00370 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00371 ClientLayout->addItem( spacer_2 );
00372 
00373 // signals and slots connections
00374 connect( ProxyServerChkBox, SIGNAL( toggled(bool) ), ProxyServerEdit, SLOT( setEnabled(bool) ) );
00375 connect( ProxyServerChkBox, SIGNAL( toggled(bool) ), ProxyPortLabel, SLOT( setEnabled(bool) ) );
00376 connect( ProxyServerChkBox, SIGNAL( toggled(bool) ), ProxyPortEdit, SLOT( setEnabled(bool) ) );
00377 
00378 // tab order
00379 setTabOrder( StartSetiChkBox, StopSetiChkBox );
00380 setTabOrder( StopSetiChkBox, KeepAliveCheckBox );
00381 setTabOrder( KeepAliveCheckBox, PrioritySlider );
00382 setTabOrder( PrioritySlider, ProxyServerChkBox );
00383 setTabOrder( ProxyServerChkBox, ProxyServerEdit );
00384 setTabOrder( ProxyServerEdit, ProxyPortEdit );
00385 setTabOrder( ProxyPortEdit, ArgEdit );
00386 setTabOrder( ArgEdit, StopAfterProcChkBox );
00387 setTabOrder( StopAfterProcChkBox, StopAfterSendChkBox );
00388 setTabOrder( StopAfterSendChkBox, EmailChkBox );
00389 setTabOrder( EmailChkBox, GraphicsChkBox );
00390 }
00391 
00392 /*------------------------------------------------------------------------ */
00393 void AddSetiLocDlg::slotGetSetiDirectory()
00394 {
00395 QString d = KFileDialog::getExistingDirectory();
00396 if(!d.isNull())
00397   setSetiDirectory(d);
00398 }
00399 
00400 /*------------------------------------------------------------------------ */
00401 void AddSetiLocDlg::slotGetLogDirectory()
00402 {
00403 QString d = KFileDialog::getExistingDirectory();
00404 if(!d.isNull())
00405   setLogDirectory(d);
00406 }
00407 
00408 /*------------------------------------------------------------------------ */
00409 void AddSetiLocDlg::slotGetStartExe()
00410 {
00411 QString d = KFileDialog::getOpenFileName();
00412 if(!d.isNull())
00413   setStartExeFilePath(d);
00414 }
00415 
00416 /*------------------------------------------------------------------------ */
00417 void AddSetiLocDlg::slotGetStopExe()
00418 {
00419 QString d = KFileDialog::getOpenFileName();
00420 if(!d.isNull())
00421   setStopExeFilePath(d);
00422 }
00423 
00424 /*------------------------------------------------------------------------ */
00425 void AddSetiLocDlg::slotHandleText(const QString&)
00426 {
00427 QString l1 = DescrEdit->text();
00428 QString l2 = DirecEdit->text();
00429 if(l1.isEmpty() || l2.isEmpty())
00430   enableButtonOK(false);
00431 else
00432   enableButtonOK(true);
00433 }
00434 
00435 /*------------------------------------------------------------------------ */
00436 void AddSetiLocDlg::slotOk()
00437 {
00438 QDir d(DirecEdit->text());
00439 if(d.exists())
00440   accept();
00441 else
00442   KMessageBox::error(this, i18n("Directory not found.\n"
00443                                 "Make sure to enter a valid\n"
00444                                 "SETI@Home directory."));
00445 }
00446 
00447 /*------------------------------------------------------------------------ */
00448 void AddSetiLocDlg::setOptions(const LocSettings& setloc)
00449 {
00450 // location page
00451 DescrEdit->setText(setloc.description);
00452 ColorButton->setColor(setloc.color);
00453 DirecEdit->setText(setloc.directory);
00454 StartExeChkBox->setChecked(setloc.useCustomStartExe);
00455 StartExeEdit->setText(setloc.customStartExe);
00456 StopExeChkBox->setChecked(setloc.useCustomStopExe);
00457 StopExeEdit->setText(setloc.customStopExe);
00458 // client page
00459 StartSetiChkBox->setChecked(setloc.startSeti);
00460 StopSetiChkBox->setChecked(setloc.stopSeti);
00461 KeepAliveCheckBox->setChecked(setloc.keepClientAlive);
00462 ArgEdit->setText(setloc.arguments);
00463 StopAfterProcChkBox->setChecked(setloc.stopAfterProcess);
00464 StopAfterSendChkBox->setChecked(setloc.stopAfterSend);
00465 EmailChkBox->setChecked(setloc.email);
00466 GraphicsChkBox->setChecked(setloc.graphics);
00467 PrioritySlider->setValue(setloc.priority);
00468 ProxyServerChkBox->setChecked(setloc.useProxy);
00469 ProxyServerEdit->setText(setloc.proxyServer);
00470 ProxyPortEdit->setText(QString::number(setloc.proxyPort));
00471 // logging page
00472 LogChkBox->setChecked(setloc.log);
00473 RedirChkBox->setChecked(setloc.redirectLog);
00474 RedirEdit->setText(setloc.logDirectory);
00475 }
00476 
00477 /*------------------------------------------------------------------------ */
00478 LocSettings AddSetiLocDlg::options() const
00479 {
00480 LocSettings setloc;
00481 
00482 // location
00483 setloc.description       = DescrEdit->text();
00484 setloc.color             = ColorButton->color();
00485 setloc.directory         = DirecEdit->text();
00486 setloc.useCustomStartExe = StartExeChkBox->isChecked();
00487 setloc.customStartExe    = StartExeEdit->text().stripWhiteSpace();
00488 setloc.useCustomStopExe  = StopExeChkBox->isChecked();
00489 setloc.customStopExe     = StopExeEdit->text().stripWhiteSpace();
00490 // client
00491 setloc.startSeti         = StartSetiChkBox->isChecked();
00492 setloc.stopSeti          = StopSetiChkBox->isChecked();
00493 setloc.keepClientAlive   = KeepAliveCheckBox->isChecked();
00494 setloc.arguments         = ArgEdit->text();
00495 setloc.stopAfterProcess  = StopAfterProcChkBox->isChecked();
00496 setloc.stopAfterSend     = StopAfterSendChkBox->isChecked();
00497 setloc.email             = EmailChkBox->isChecked();
00498 setloc.graphics          = GraphicsChkBox->isChecked();
00499 setloc.priority          = PrioritySlider->value();
00500 setloc.useProxy          = ProxyServerChkBox->isChecked();
00501 setloc.proxyServer       = ProxyServerEdit->text();
00502 setloc.proxyPort         = ProxyPortEdit->text().toInt();
00503 // logging
00504 setloc.log               = LogChkBox->isChecked();
00505 setloc.redirectLog       = RedirChkBox->isChecked();
00506 setloc.logDirectory      = RedirEdit->text().stripWhiteSpace();
00507 
00508 return(setloc);
00509 }
00510 
00511 #include "addsetilocdlg.moc"
00512 
KDE Logo
This file is part of the documentation for Ksetiwatch API Version 2.6.1.
Documentation copyright © 2000-2003 Gordon Machel.
Generated on Fri Jun 6 00:28:13 2003 by doxygen 1.2.18, written by Dimitri van Heesch, © 1997-2002