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

blogilo

  • sources
  • kde-4.14
  • kdepim
  • blogilo
  • src
configuredialog.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2014-2015 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "configuredialog.h"
19 
20 #include "ui_advancedsettingsbase.h"
21 #include "ui_settingsbase.h"
22 #include "ui_editorsettingsbase.h"
23 
24 #include "configurestorageservicewidget.h"
25 
26 #include "settings.h"
27 
28 #include "blogsettings.h"
29 
30 
31 #include <KLocalizedString>
32 
33 ConfigureDialog::ConfigureDialog(PimCommon::StorageServiceManager *storageManager, QWidget *parent, const QString& name, KConfigSkeleton *config)
34  : KConfigDialog(parent, name, config),
35  mHasChanged(false)
36 {
37  QWidget *generalSettingsDlg = new QWidget;
38  generalSettingsDlg->setAttribute( Qt::WA_DeleteOnClose );
39  Ui::SettingsBase ui_prefs_base;
40  Ui::EditorSettingsBase ui_editorsettings_base;
41  ui_prefs_base.setupUi( generalSettingsDlg );
42 
43  BlogSettings *blogSettingsDlg = new BlogSettings;
44  blogSettingsDlg->setAttribute( Qt::WA_DeleteOnClose );
45  connect( blogSettingsDlg, SIGNAL(blogAdded(BilboBlog)),
46  this, SIGNAL(blogAdded(BilboBlog)) );
47  connect( blogSettingsDlg, SIGNAL(blogEdited(BilboBlog)),
48  this, SIGNAL(blogEdited(BilboBlog)) );
49  connect( blogSettingsDlg, SIGNAL(blogRemoved(int)), this, SIGNAL(blogRemoved(int)) );
50 
51  QWidget *editorSettingsDlg = new QWidget;
52  editorSettingsDlg->setAttribute( Qt::WA_DeleteOnClose );
53  ui_editorsettings_base.setupUi( editorSettingsDlg );
54  QWidget *advancedSettingsDlg = new QWidget;
55  advancedSettingsDlg->setAttribute( Qt::WA_DeleteOnClose );
56  Ui::AdvancedSettingsBase ui_advancedsettings_base;
57  ui_advancedsettings_base.setupUi( advancedSettingsDlg );
58 
59  mConfigStorageService = new ConfigureStorageServiceWidget(storageManager);
60  mConfigStorageService->setAttribute( Qt::WA_DeleteOnClose );
61  connect(mConfigStorageService, SIGNAL(changed()), this, SLOT(slotStorageServiceChanged()));
62 
63  addPage( generalSettingsDlg, i18nc( "Configure Page", "General" ), QLatin1String("configure") );
64  addPage( blogSettingsDlg, i18nc( "Configure Page", "Blogs" ), QLatin1String("document-properties"));
65  addPage( editorSettingsDlg, i18nc( "Configure Page", "Editor" ), QLatin1String("accessories-text-editor"));
66  addPage( advancedSettingsDlg, i18nc( "Configure Page", "Advanced" ), QLatin1String("applications-utilities"));
67  addPage( mConfigStorageService, i18nc( "Configure Page", "Storage Service" ), QLatin1String("applications-utilities"));
68 
69  connect( this, SIGNAL(settingsChanged(QString)), this, SIGNAL(settingsChanged()) );
70  connect( this, SIGNAL(destroyed(QObject*)), this, SIGNAL(dialogDestroyed(QObject*)));
71  connect( this, SIGNAL(okClicked()), this, SLOT(slotApplySettingsClicked()));
72  connect( this, SIGNAL(defaultClicked()), this, SLOT(slotDefaultClicked()));
73  connect( this, SIGNAL(applyClicked()), this, SLOT(slotApplySettingsClicked()));
74  setAttribute( Qt::WA_DeleteOnClose );
75  resize( Settings::configWindowSize() );
76  show();
77 }
78 
79 ConfigureDialog::~ConfigureDialog()
80 {
81 
82 }
83 
84 bool ConfigureDialog::hasChanged()
85 {
86  return (KConfigDialog::hasChanged() || mHasChanged);
87 }
88 
89 void ConfigureDialog::slotStorageServiceChanged()
90 {
91  qDebug()<<" void ConfigureDialog::slotStorageServiceChanged()";
92  mHasChanged = true;
93  Q_EMIT settingsChanged();
94  updateButtons();
95 }
96 
97 void ConfigureDialog::slotDefaultClicked()
98 {
99  mConfigStorageService->doLoadFromGlobalSettings();
100 }
101 
102 void ConfigureDialog::slotApplySettingsClicked()
103 {
104  mConfigStorageService->save();
105  mHasChanged = false;
106  updateButtons();
107  Q_EMIT settingsChanged();
108 }
QWidget
blogsettings.h
ConfigureDialog::blogAdded
void blogAdded(const BilboBlog &)
ConfigureDialog::blogRemoved
void blogRemoved(int)
QWidget::setAttribute
void setAttribute(Qt::WidgetAttribute attribute, bool on)
configuredialog.h
BilboBlog
Blog definition class!
Definition: bilboblog.h:40
KConfigDialog
QObject
QString
ConfigureStorageServiceWidget::doLoadFromGlobalSettings
void doLoadFromGlobalSettings()
Definition: configurestorageservicewidget.cpp:104
ConfigureDialog::dialogDestroyed
void dialogDestroyed(QObject *)
ConfigureDialog::hasChanged
bool hasChanged()
Definition: configuredialog.cpp:84
ConfigureStorageServiceWidget::save
void save()
Definition: configurestorageservicewidget.cpp:98
QLatin1String
ConfigureDialog::blogEdited
void blogEdited(const BilboBlog &)
ConfigureDialog::ConfigureDialog
ConfigureDialog(PimCommon::StorageServiceManager *storageManager, QWidget *parent, const QString &name, KConfigSkeleton *config)
Definition: configuredialog.cpp:33
ConfigureDialog::~ConfigureDialog
~ConfigureDialog()
Definition: configuredialog.cpp:79
configurestorageservicewidget.h
BlogSettings
Definition: blogsettings.h:32
ConfigureStorageServiceWidget
Definition: configurestorageservicewidget.h:38
ConfigureDialog::settingsChanged
void settingsChanged()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

blogilo

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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