You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdeadmin/kcron/ktprintopt.cpp

69 lines
2.1 KiB

/***************************************************************************
* -------------------------------------------------------------------- *
* Print Options Dialog *
* -------------------------------------------------------------------- *
* Copyright (C) 1999, Robert Berry <rjmber@ntlwolrd.com> *
* -------------------------------------------------------------------- *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include <tqcheckbox.h>
#include <layout.h>
#include <kdialog.h>
#include <kaccel.h>
#include <klocale.h>
#include <kapplication.h>
#include "ktprintopt.h"
KTPrintOpt::KTPrintOpt(bool root) :
KPrintDialogPage(0, "ktprintopt")
{
m_title = i18n("Cron Options");
TQVBoxLayout *main_ = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
chkPrintCrontab = new TQCheckBox(i18n("Print cron&tab"), this, "chkPrintCrontab");
main_->addWidget(chkPrintCrontab);
chkPrintAllUsers = new TQCheckBox(i18n("Print &all users"), this, "chkPrintAllUsers");
main_->addWidget(chkPrintAllUsers);
if (!root) {
chkPrintAllUsers->setChecked(false);
chkPrintAllUsers->setEnabled(false);
}
}
KTPrintOpt::~KTPrintOpt()
{
}
void
KTPrintOpt::setOptions(const TQMap<TQString,TQString>& opts)
{
TQString value;
value = opts["crontab"];
chkPrintCrontab->setChecked(value == "true");
if (chkPrintAllUsers->isEnabled())
{
value = opts["allusers"];
chkPrintAllUsers->setChecked(value == "true");
}
}
void KTPrintOpt::getOptions(TQMap<TQString,TQString>& opts, bool)
{
opts["crontab"] = chkPrintCrontab->isChecked() ? "true" : "false";
opts["allusers"] = chkPrintAllUsers->isChecked() ? "true" : "false";
}
#include "ktprintopt.moc"