summaryrefslogtreecommitdiffstats
path: root/kvoctrain/kvoctrain/common-dialogs/queryoptions.cpp
blob: b1677e3fb7e8f1677875d9b47a0459acf326d482 (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
69
70
71
72
/***************************************************************************

                      query options for kvoctrain

    -----------------------------------------------------------------------

    begin                : Tue Apr 5 2005

    copyright            :(C) 2005 Peter Hedlund

    email                : peter.hedlund@kdemail.net

    -----------------------------------------------------------------------

 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 <qgroupbox.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qlabel.h>
#include <qbuttongroup.h>

#include <knuminput.h>

#include "queryoptions.h"
#include "prefs.h"

QueryOptions::QueryOptions(QWidget* parent, const char* name, WFlags fl)
: QueryOptionsBase(parent,name,fl)
{
  kcfg_MaxTimePer->setDisabled(r_no_limit->isChecked());
  kcfg_ShowCounter->setDisabled(r_no_limit->isChecked());
  label_mqtime->setDisabled(r_no_limit->isChecked());
  kcfg_Periods->setEnabled(kcfg_Split->isChecked());
  kcfg_Colons->setEnabled(kcfg_Split->isChecked());
  kcfg_Semicolons->setEnabled(kcfg_Split->isChecked());
  kcfg_Commas->setEnabled(kcfg_Split->isChecked());
  kcfg_Fields->setEnabled(kcfg_Split->isChecked());
  label_at->setEnabled(kcfg_Split->isChecked());
  label_split_max_fields->setEnabled(kcfg_Split->isChecked());
}

void QueryOptions::updateWidgets()
{
  //This is required for loading profiles properly
  kcfg_QueryTimeout->setButton((int) Prefs::queryTimeout());
  kcfg_MaxTimePer->setValue(Prefs::maxTimePer());
  kcfg_ShowCounter->setChecked(Prefs::showCounter());
  kcfg_SwapDirection->setChecked(Prefs::swapDirection());
  kcfg_AltLearn->setChecked(Prefs::altLearn());
  kcfg_Suggestions->setChecked(Prefs::suggestions());
  kcfg_Split->setChecked(Prefs::split());
  kcfg_Periods->setChecked(Prefs::periods());
  kcfg_Colons->setChecked(Prefs::colons());
  kcfg_Semicolons->setChecked(Prefs::semicolons());
  kcfg_Commas->setChecked(Prefs::commas());
  kcfg_Fields->setValue(Prefs::fields());
  kcfg_ShowMore->setChecked(Prefs::showMore());
  kcfg_IKnow->setChecked(Prefs::iKnow());
}

#include "queryoptions.moc"