• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • conf
preferencesdialog.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2004 - 2007 KGet Developers <kget@kde.org>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 */
9 
10 #include "preferencesdialog.h"
11 #include "core/kget.h"
12 #include "core/transferhistorystore.h"
13 
14 #include "ui_dlgappearance.h"
15 #include "ui_dlgnetwork.h"
16 #include "dlgwebinterface.h"
17 
18 #include "integrationpreferences.h"
19 #include "transfersgroupwidget.h"
20 #include "pluginselector.h"
21 #include "verificationpreferences.h"
22 
23 #include <klocale.h>
24 #include <ktabwidget.h>
25 
26 PreferencesDialog::PreferencesDialog(QWidget * parent, KConfigSkeleton * skeleton)
27  : KConfigDialog(parent, "preferences", skeleton)
28 {
29  QWidget *appearance = new QWidget(this);
30  TransfersGroupWidget *groups = new TransfersGroupWidget(this);
31  DlgWebinterface *webinterface = new DlgWebinterface(this);
32  connect(webinterface, SIGNAL(changed()), SLOT(enableApplyButton()));
33  connect(webinterface, SIGNAL(saved()), SLOT(settingsChangedSlot()));
34  QWidget *network = new QWidget(this);
35  QWidget *advanced = new QWidget(this);
36  IntegrationPreferences *integration = new IntegrationPreferences(this);
37  connect(integration, SIGNAL(changed()), SLOT(enableApplyButton()));
38  VerificationPreferences *verification = new VerificationPreferences(this);
39  connect(verification, SIGNAL(changed()), SLOT(enableApplyButton()));
40  PluginSelector * pluginSelector = new PluginSelector(this);
41  connect(pluginSelector, SIGNAL(changed(bool)), SLOT(enableApplyButton()));
42 
43  Ui::DlgAppearance dlgApp;
44  Ui::DlgNetwork dlgNet;
45 
46  dlgApp.setupUi(appearance);
47  dlgNet.setupUi(network);
48  dlgAdv.setupUi(advanced);
49 
50  // history backend entries
51  dlgAdv.kcfg_HistoryBackend->addItem(i18n("Xml"), QVariant(TransferHistoryStore::Xml));
52 #ifdef HAVE_SQLITE
53  dlgAdv.kcfg_HistoryBackend->addItem(i18n("Sqlite"), QVariant(TransferHistoryStore::SQLite));
54 #endif
55 #ifdef HAVE_NEPOMUK
56  dlgAdv.kcfg_HistoryBackend->addItem(i18n("Nepomuk"), QVariant(TransferHistoryStore::Nepomuk));
57 #endif
58 
59 #ifdef HAVE_KWORKSPACE
60  dlgAdv.kcfg_AfterFinishAction->addItem(i18n("Turn Off Computer"), QVariant(KGet::Shutdown));
61  dlgAdv.kcfg_AfterFinishAction->addItem(i18n("Hibernate Computer"), QVariant(KGet::Hibernate));
62  dlgAdv.kcfg_AfterFinishAction->addItem(i18n("Suspend Computer"), QVariant(KGet::Suspend));
63 #endif
64 
65  // enable or disable the AfterFinishAction depends on the AfterFinishActionEnabled checkbox state
66  dlgAdv.kcfg_AfterFinishAction->setEnabled(dlgAdv.kcfg_AfterFinishActionEnabled->checkState () == Qt::Checked);
67  connect(dlgAdv.kcfg_AfterFinishActionEnabled, SIGNAL(stateChanged(int)),
68  SLOT(slotToggleAfterFinishAction(int)));
69 
70  // TODO: remove the following lines as soon as these features are ready
71  dlgNet.lb_per_transfer->setVisible(false);
72  dlgNet.kcfg_TransferSpeedLimit->setVisible(false);
73 
74  addPage(appearance, i18n("Appearance"), "preferences-desktop-theme", i18n("Change appearance settings"));
75  addPage(groups, i18n("Groups"), "bookmarks", i18n("Manage the groups"));
76  addPage(network, i18n("Network"), "network-workgroup", i18n("Network and Downloads"));
77  addPage(webinterface, i18n("Web Interface"), "network-workgroup", i18n("Control KGet over a Network or the Internet"));
78  addPage(verification, i18n("Verification"), "document-encrypt", i18n("Verification"));
79  addPage(integration, i18nc("integration of KGet with other applications", "Integration"), "konqueror", i18nc("integration of KGet with other applications", "Integration"));
80  addPage(advanced, i18nc("Advanced Options", "Advanced"), "preferences-other", i18n("Advanced Options"));
81  addPage(pluginSelector, i18n("Plugins"), "preferences-plugin", i18n("Transfer Plugins"));
82 
83  connect(this, SIGNAL(accepted()), SLOT(disableApplyButton()));
84  connect(this, SIGNAL(rejected()), SLOT(disableApplyButton()));
85 }
86 
87 void PreferencesDialog::disableApplyButton()
88 {
89  enableButtonApply(false);
90 }
91 
92 void PreferencesDialog::enableApplyButton()
93 {
94  enableButtonApply(true);
95 }
96 
97 void PreferencesDialog::slotToggleAfterFinishAction(int state)
98 {
99  dlgAdv.kcfg_AfterFinishAction->setEnabled(state == Qt::Checked);
100 }
dlgwebinterface.h
TransferHistoryStore::SQLite
Definition: transferhistorystore.h:59
transfersgroupwidget.h
transferhistorystore.h
QWidget
KConfigSkeleton
DlgWebinterface
Definition: dlgwebinterface.h:22
TransfersGroupWidget
Definition: transfersgroupwidget.h:19
TransferHistoryStore::Xml
Definition: transferhistorystore.h:58
KConfigDialog
preferencesdialog.h
VerificationPreferences
Definition: verificationpreferences.h:29
verificationpreferences.h
PreferencesDialog::PreferencesDialog
PreferencesDialog(QWidget *parent, KConfigSkeleton *config)
Definition: preferencesdialog.cpp:26
integrationpreferences.h
TransferHistoryStore::Nepomuk
Definition: transferhistorystore.h:60
IntegrationPreferences
Definition: integrationpreferences.h:30
kget.h
KGet::Hibernate
Definition: kget.h:78
KGet::Suspend
Definition: kget.h:79
PluginSelector
Definition: pluginselector.h:17
KGet::Shutdown
Definition: kget.h:77
pluginselector.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal