summaryrefslogtreecommitdiffstats
path: root/kcron/ktprintopt.cpp
blob: a6a12c6252abe74ba5181bb64a85c6ae2c1a131b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

/***************************************************************************
 *   --------------------------------------------------------------------  *
 *   Print Options Dialog                                                  *
 *   --------------------------------------------------------------------  *
 *   Copyright (C) 1999, Robert Berry <[email protected]>                *
 *   --------------------------------------------------------------------  *
 *   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 <tqlayout.h>

#include <kdialog.h>
#include <tdeaccel.h>
#include <tdelocale.h>
#include <tdeapplication.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"