~ubuntu-branches/ubuntu/raring/konversation/raring-proposed

« back to all changes in this revision

Viewing changes to .pc/debian-changes-1.3.1-1ubuntu2/src/config/settingsdialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-08-11 17:53:27 UTC
  • Revision ID: james.westby@ubuntu.com-20100811175327-vj8gal6554f0cdck
Tags: 1.3.1-1ubuntu2
* Add back correct debian/patches/series file, adds back in
  kubuntu_01_default_channels.diff message-indicator/0001-Adds-
  support-for-Message-Indicator.diff LP: #616422
* Remove obsolete debian/patches/kubuntu/ directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This program is free software; you can redistribute it and/or modify
 
3
    it under the terms of the GNU General Public License as published by
 
4
    the Free Software Foundation; either version 2 of the License, or
 
5
    (at your option) any later version.
 
6
*/
 
7
 
 
8
/*
 
9
  Copyright (C) 2006 John Tapsell <johnflux@gmail.com>
 
10
  Copyright (C) 2006 Eike Hein <hein@kde.org>
 
11
*/
 
12
 
 
13
#include "config-konversation.h"
 
14
#include "settingsdialog.h"
 
15
#include "configdialog.h"
 
16
#include "preferences.h"
 
17
#include "ui_chatwindowappearance_config.h"
 
18
#include "connectionbehavior_config.h"
 
19
#include "highlight_config.h"
 
20
#include "warnings_config.h"
 
21
#include "ui_log_config.h"
 
22
#include "quickbuttons_config.h"
 
23
#include "autoreplace_config.h"
 
24
#include "ui_chatwindowbehaviour_config.h"
 
25
#include "ui_fontappearance_config.h"
 
26
#include "nicklistbehavior_config.h"
 
27
#include "tabs_config.h"
 
28
#include "ui_colorsappearance_config.h"
 
29
#include "ui_generalbehavior_configui.h"
 
30
#include "dcc_config.h"
 
31
#include "osd_config.h"
 
32
#include "theme_config.h"
 
33
#include "alias_config.h"
 
34
#include "ignore_config.h"
 
35
#include "watchednicknames_config.h"
 
36
#include "ui_tabnotifications_config.h"
 
37
 
 
38
#include <config-konversation.h>
 
39
 
 
40
#ifdef HAVE_INDICATEQT
 
41
#include "ui_messageindicator_config.h"
 
42
#endif
 
43
 
 
44
 
 
45
KonviSettingsDialog::KonviSettingsDialog( QWidget *parent) :
 
46
    KonviConfigDialog( parent, "settings", Preferences::self(), KPageDialog::Tree)
 
47
{
 
48
  m_modified = false;
 
49
  QWidget *w = 0;
 
50
 
 
51
  KPageWidgetItem *interfaceGroup = new KPageWidgetItem(new QWidget(this), i18n("Interface"));
 
52
  interfaceGroup->setIcon(KIcon("preferences-desktop-theme"));
 
53
  KPageDialog::addPage(interfaceGroup);
 
54
 
 
55
  KPageWidgetItem *behaviorGroup = new KPageWidgetItem(new QWidget(this), i18n("Behavior"));
 
56
  behaviorGroup->setIcon(KIcon("configure"));
 
57
  KPageDialog::addPage(behaviorGroup);
 
58
 
 
59
  KPageWidgetItem *notificationGroup = new KPageWidgetItem(new QWidget(this), i18n("Notifications"));
 
60
  notificationGroup->setIcon(KIcon("preferences-desktop-notification"));
 
61
  KPageDialog::addPage(notificationGroup);
 
62
 
 
63
  //Interface/Chat Window
 
64
  Ui::ChatWindowAppearance_Config confChatWindowAppearance;
 
65
  w = new QWidget();
 
66
  confChatWindowAppearance.setupUi(w);
 
67
  confChatWindowAppearance.kcfg_TimestampFormat->addItem("hh:mm");
 
68
  confChatWindowAppearance.kcfg_TimestampFormat->addItem("hh:mm:ss");
 
69
  confChatWindowAppearance.kcfg_TimestampFormat->addItem("h:m ap");
 
70
  addPage(w, interfaceGroup, "view-list-text", i18n("Chat Window"));
 
71
 
 
72
  //Interface/Themes
 
73
  m_confThemeWdg = new Theme_Config( this, "Theme" );
 
74
  addPage ( m_confThemeWdg, interfaceGroup, "preferences-desktop-icons", i18n("Nicklist Themes") );
 
75
  m_pages.append(m_confThemeWdg);
 
76
  connect(m_confThemeWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
77
 
 
78
  //Interface/Colors
 
79
  Ui::ColorsAppearance_Config confColorsAppearance;
 
80
  w = new QWidget();
 
81
  confColorsAppearance.setupUi(w);
 
82
  addPage(w, interfaceGroup, "preferences-desktop-color", i18n("Colors"));
 
83
 
 
84
  //Interface/Fonts
 
85
  Ui::FontAppearance_Config confFontAppearance;
 
86
  w = new QWidget();
 
87
  confFontAppearance.setupUi(w);
 
88
  addPage(w, interfaceGroup, "preferences-desktop-font", i18n("Fonts"));
 
89
 
 
90
  //Interface/Quick Buttons
 
91
  m_confQuickButtonsWdg = new QuickButtons_Config( this, "QuickButtons" );
 
92
  addPage ( m_confQuickButtonsWdg, interfaceGroup, "preferences-desktop-keyboard", i18n("Quick Buttons") );
 
93
  m_pages.append(m_confQuickButtonsWdg);
 
94
  connect(m_confQuickButtonsWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
95
 
 
96
  //Interface/Tabs
 
97
  m_confTabBarWdg = new Tabs_Config( this, "TabBar" );
 
98
  addPage ( m_confTabBarWdg, interfaceGroup, "tab-new", i18n("Tabs") );
 
99
 
 
100
  //Behavior/General
 
101
  Ui::GeneralBehavior_ConfigUI confGeneralBehavior;
 
102
  w = new QWidget();
 
103
  confGeneralBehavior.setupUi(w);
 
104
  #ifdef HAVE_KSTATUSNOTIFIERITEM
 
105
  confGeneralBehavior.kcfg_TrayNotifyBlink->setVisible(false);
 
106
  confGeneralBehavior.horizontalLayout_2->removeItem(confGeneralBehavior.spacer51_2);
 
107
  confGeneralBehavior.horizontalLayout_2->setEnabled(false);
 
108
  #endif
 
109
  addPage( w, behaviorGroup, "configure", i18n("General") );
 
110
 
 
111
  //Behavior/Connection
 
112
  ConnectionBehavior_Config* confConnectionBehavior = new ConnectionBehavior_Config(this);
 
113
  confConnectionBehavior->setObjectName("ConnectionBehavior");
 
114
  addPage(confConnectionBehavior, behaviorGroup, "network-connect", i18n("Connection"));
 
115
  m_pages.append(confConnectionBehavior);
 
116
 
 
117
  //Behaviour/Chat Window
 
118
  Ui::ChatwindowBehaviour_Config confChatwindowBehaviour;
 
119
  w = new QWidget();
 
120
  confChatwindowBehaviour.setupUi(w);
 
121
  confChatwindowBehaviour.kcfg_ScrollbackMax->setToolTip(i18np("Maximum scrollback limit: 1 line.",
 
122
      "Maximum scrollback limit: %1 lines.", confChatwindowBehaviour.kcfg_ScrollbackMax->maximum()));
 
123
  confChatwindowBehaviour.kcfg_ScrollbackMax->setSuffix(ki18np(" line", " lines"));
 
124
  confChatwindowBehaviour.kcfg_AutoWhoNicksLimit->setSuffix(ki18np(" nick", " nicks"));
 
125
  confChatwindowBehaviour.kcfg_AutoWhoContinuousInterval->setSuffix(ki18np(" second", " seconds"));
 
126
  addPage(w, behaviorGroup, "view-list-text", i18n("Chat Window"));
 
127
 
 
128
  //Behaviour/Nickname List
 
129
  m_confNicklistBehaviorWdg = new NicklistBehavior_Config( this, "NicklistBehavior" );
 
130
  addPage ( m_confNicklistBehaviorWdg, behaviorGroup, "preferences-contact-list", i18n("Nickname List") );
 
131
  connect(m_confNicklistBehaviorWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
132
  m_pages.append(m_confNicklistBehaviorWdg);
 
133
 
 
134
  //Behaviour/Command Aliases
 
135
  m_confAliasWdg = new Alias_Config( this, "Alias" );
 
136
  addPage ( m_confAliasWdg, behaviorGroup, "edit-rename", i18n("Command Aliases") );
 
137
  m_pages.append(m_confAliasWdg);
 
138
  connect(m_confAliasWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
139
 
 
140
  //Behaviour/Auto Replace
 
141
  m_confAutoreplaceWdg = new Autoreplace_Config( this, "Autoreplace" );
 
142
  addPage ( m_confAutoreplaceWdg, behaviorGroup, "edit-rename", i18n("Auto Replace") );
 
143
  m_pages.append(m_confAutoreplaceWdg);
 
144
  connect(m_confAutoreplaceWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
145
 
 
146
  //Behaviour/Ignore
 
147
  m_confIgnoreWdg = new Ignore_Config(this, "Ignore");
 
148
  addPage ( m_confIgnoreWdg, behaviorGroup, "process-stop", i18n("Ignore") );
 
149
  connect(m_confIgnoreWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
150
  m_pages.append(m_confIgnoreWdg);
 
151
 
 
152
  //Behaviour/Logging
 
153
  Ui::Log_Config confLog;
 
154
  w = new QWidget();
 
155
  confLog.setupUi(w);
 
156
  confLog.kcfg_LogfilePath->setMode(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly);
 
157
  addPage(w, behaviorGroup, "text-plain", i18n("Logging"));
 
158
 
 
159
  m_confDCCWdg = new DCC_Config( this, "DCC" );
 
160
  addPage ( m_confDCCWdg, behaviorGroup, "arrow-right-double", i18n("DCC") );
 
161
 
 
162
  //Notifications/Tab Bar
 
163
  Ui::TabNotifications_Config confTabNotifications;
 
164
  w = new QWidget();
 
165
  confTabNotifications.setupUi(w);
 
166
  addPage(w, notificationGroup, "tab-new", i18n("Tabs"));
 
167
 
 
168
  //Notification/Highlighting
 
169
  m_confHighlightWdg = new Highlight_Config( this, "Highlight" );
 
170
  addPage ( m_confHighlightWdg, notificationGroup, "flag-red", i18n("Highlight") );
 
171
  connect(m_confHighlightWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
172
  m_pages.append(m_confHighlightWdg);
 
173
 
 
174
  //Notification/Watched Nicknames
 
175
  m_confWatchedNicknamesWdg = new WatchedNicknames_Config( this, "WatchedNicknames" );
 
176
  // remember index so we can open this page later from outside
 
177
  m_watchedNicknamesPage = addPage ( m_confWatchedNicknamesWdg, notificationGroup, "edit-find-user", i18n("Watched Nicknames") );
 
178
  connect(m_confWatchedNicknamesWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
179
  m_pages.append(m_confWatchedNicknamesWdg);
 
180
 
 
181
  //Notification/On Screen Display
 
182
  m_confOSDWdg = new OSD_Config( this, "OSD" );
 
183
  addPage ( m_confOSDWdg, notificationGroup, "video-display", i18n("On Screen Display") );
 
184
  //no modified connection needed - it's all kcfg widgets
 
185
  m_pages.append(m_confOSDWdg);
 
186
 
 
187
  #ifdef HAVE_INDICATEQT
 
188
  //Notification/Message Indicator
 
189
  Ui::MessageIndicator_Config confMessageIndicator;
 
190
  w = new QWidget();
 
191
  confMessageIndicator.setupUi(w);
 
192
  addPage(w, notificationGroup, "mail-unread-new", i18n("Message Indicator"));
 
193
  #endif
 
194
 
 
195
  //Notification/Warning Dialogs
 
196
  m_confWarningsWdg = new Warnings_Config( this, "Warnings" );
 
197
  addPage ( m_confWarningsWdg, notificationGroup, "dialog-warning", i18n("Warning Dialogs") );
 
198
  m_pages.append(m_confWarningsWdg);
 
199
  connect(m_confWarningsWdg, SIGNAL(modified()), this, SLOT(modifiedSlot()));
 
200
}
 
201
 
 
202
void KonviSettingsDialog::modifiedSlot()
 
203
{
 
204
  // this is for the non KConfigXT parts to tell us, if the user actually changed
 
205
  // something or went back to the old settings
 
206
// kDebug();
 
207
  m_modified = false;
 
208
  foreach (KonviSettingsPage *page, m_pages)
 
209
  {
 
210
    if (page->hasChanged())
 
211
    {
 
212
      m_modified = true;
 
213
//      kDebug() << "modified!";
 
214
      break;
 
215
    }
 
216
  }
 
217
  updateButtons();
 
218
}
 
219
 
 
220
KonviSettingsDialog::~KonviSettingsDialog()
 
221
{
 
222
}
 
223
 
 
224
void KonviSettingsDialog::updateSettings()
 
225
{
 
226
  foreach (KonviSettingsPage *page, m_pages)
 
227
  {
 
228
    // this is for the non KConfigXT parts to update the UI (like quick buttons)
 
229
    page->saveSettings();
 
230
  }
 
231
  m_modified = false;
 
232
  emit settingsChanged();
 
233
}
 
234
 
 
235
void KonviSettingsDialog::updateWidgets()
 
236
{
 
237
  foreach (KonviSettingsPage *page, m_pages)
 
238
  {
 
239
    page->loadSettings();
 
240
  }
 
241
  m_modified = false;
 
242
}
 
243
 
 
244
void KonviSettingsDialog::updateWidgetsDefault()
 
245
{
 
246
  foreach (KonviSettingsPage *page, m_pages)
 
247
  {
 
248
    page->restorePageToDefaults();
 
249
  }
 
250
  m_modified = true;
 
251
}
 
252
 
 
253
void KonviSettingsDialog::openWatchedNicknamesPage()
 
254
{
 
255
  // page index has been calculated in the constructor
 
256
  setCurrentPage(m_watchedNicknamesPage);
 
257
}
 
258
 
 
259
// accessor method - will be used by KonviConfigDialog::updateButtons()
 
260
bool KonviSettingsDialog::hasChanged()
 
261
{
 
262
  return m_modified;
 
263
}
 
264
 
 
265
// accessor method - will be used by KonviConfigDialog::updateButtons()
 
266
bool KonviSettingsDialog::isDefault()
 
267
{
 
268
  return true;
 
269
}
 
270
 
 
271
#include "settingsdialog.moc"
 
272