FloatingToolBar inherits now from QToolBar instead of QWidget:
[kdenetwork.git] / kget / conf / preferencesdialog.cpp
blob545cb7848f28e106ad00be847989720cec677d7b
1 /* This file is part of the KDE project
2 Copyright (C) 2004 - 2007 KGet Developers <kget@kde.org>
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 */
10 #include "preferencesdialog.h"
12 #include "ui_dlgappearance.h"
13 #include "ui_dlgnetwork.h"
14 #include "dlgdirectories.h"
15 #include "dlgwebinterface.h"
16 #include "ui_dlgadvanced.h"
17 #include "transfersgroupwidget.h"
19 #include <klocale.h>
20 #include <ktabwidget.h>
22 PreferencesDialog::PreferencesDialog(QWidget * parent, KConfigSkeleton * skeleton)
23 : KConfigDialog(parent, "preferences", skeleton)
25 QWidget *appearance = new QWidget(this);
26 QWidget *groups = new QWidget(this);
27 DlgDirectories *directories = new DlgDirectories(this);
28 DlgWebinterface *webinterface = new DlgWebinterface(this);
29 QWidget *network = new QWidget(this);
30 QWidget *advanced = new QWidget(this);
31 plugins = new KTabWidget(this);
33 groups->setLayout(new TransfersGroupWidget());
35 Ui::DlgAppearance dlgApp;
36 Ui::DlgNetwork dlgNet;
37 Ui::DlgAdvanced dlgAdv;
39 dlgApp.setupUi(appearance);
40 dlgNet.setupUi(network);
41 dlgAdv.setupUi(advanced);
43 // TODO: remove the following lines as soon as these features are ready
44 // dlgNet.kcfg_SpeedLimit->setVisible(false);
45 dlgNet.groupBoxCompleted->setVisible(false);
46 dlgNet.lbl_maxnum_2->setVisible(false);
47 dlgNet.kcfg_MaxConnectionsServer->setVisible(false);
49 addPage(appearance, i18n("Appearance"), "preferences-desktop-theme", i18n("Change appearance settings"));
50 addPage(groups, i18n("Groups"), "bookmarks", i18n("Manage the groups"));
51 addPage(directories, i18n("Folders"), "folder", i18n("Default Download Folders"));
52 addPage(network, i18n("Network"), "network-workgroup", i18n("Network and Downloads"));
53 addPage(webinterface, i18n("Webinterface"), "network-workgroup", i18n("Control KGet over Network or Internet"));
54 addPage(advanced, i18nc("Advanced Options", "Advanced"), "preferences-other", i18n("Advanced Options"));
55 addPage(plugins, i18n("Plugins"), "preferences-plugin", i18n("Transfer Plugin Options"));
57 connect(this, SIGNAL(accepted()), SLOT(disableButtonApply()));
58 connect(this, SIGNAL(rejected()), SLOT(disableButtonApply()));
61 void PreferencesDialog::disableButtonApply()
63 enableButtonApply(false);