diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-02-17 16:57:01 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-02-21 14:34:55 (GMT) |
commit | 3605b6622bc8b4abb810fac6b53f7f71be0fa7de (patch) | |
tree | 638a8fd6449dd235931fe307e50119adf9c9fe22 /Swift/QtUI/QtUIFactory.cpp | |
parent | b05f8fcb285d2d13d2be50a3eb1062048fbe30f5 (diff) | |
download | swift-contrib-3605b6622bc8b4abb810fac6b53f7f71be0fa7de.zip swift-contrib-3605b6622bc8b4abb810fac6b53f7f71be0fa7de.tar.bz2 |
Introduce system settings policies.
Release-Notes: It is now possible for sysadmins to deploy files with policies for configuration options, such as making it impossible for users to save passwords or to force sound notifications off, or to set defaults.
Also allow changing an option so that Swift disconnects on idle timeout, instead of going away.
Diffstat (limited to 'Swift/QtUI/QtUIFactory.cpp')
-rw-r--r-- | Swift/QtUI/QtUIFactory.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp index 88da781..c686442 100644 --- a/Swift/QtUI/QtUIFactory.cpp +++ b/Swift/QtUI/QtUIFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2012 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -25,13 +25,13 @@ #include "QtContactEditWindow.h" #include "QtAdHocCommandWindow.h" #include "QtFileTransferListWidget.h" - -#define CHATWINDOW_FONT_SIZE "chatWindowFontSize" +#include <Swift/Controllers/Settings/SettingsProviderHierachy.h> +#include <Swift/QtUI/QtUISettingConstants.h> namespace Swift { -QtUIFactory::QtUIFactory(QtSettingsProvider* settings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, bool startMinimized, bool eagleMode, QtUIPreferences* uiPreferences) : settings(settings), tabs(tabs), netbookSplitter(netbookSplitter), systemTray(systemTray), chatWindowFactory(chatWindowFactory), lastMainWindow(NULL), loginWindow(NULL), startMinimized(startMinimized), eagleMode(eagleMode), uiPreferences(uiPreferences) { - chatFontSize = settings->getIntSetting(CHATWINDOW_FONT_SIZE, 0); +QtUIFactory::QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* qtOnlySettings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, bool startMinimized) : settings(settings), qtOnlySettings(qtOnlySettings), tabs(tabs), netbookSplitter(netbookSplitter), systemTray(systemTray), chatWindowFactory(chatWindowFactory), lastMainWindow(NULL), loginWindow(NULL), startMinimized(startMinimized) { + chatFontSize = settings->getSetting(QtUISettingConstants::CHATWINDOW_FONT_SIZE); } XMLConsoleWidget* QtUIFactory::createXMLConsoleWidget() { @@ -55,19 +55,19 @@ FileTransferListWidget* QtUIFactory::createFileTransferListWidget() { } MainWindow* QtUIFactory::createMainWindow(UIEventStream* eventStream) { - lastMainWindow = new QtMainWindow(settings, eventStream, uiPreferences, loginWindow->getMenus()); + lastMainWindow = new QtMainWindow(settings, eventStream, loginWindow->getMenus()); return lastMainWindow; } LoginWindow* QtUIFactory::createLoginWindow(UIEventStream* eventStream) { - loginWindow = new QtLoginWindow(eventStream, eagleMode); + loginWindow = new QtLoginWindow(eventStream, settings); if (netbookSplitter) { netbookSplitter->insertWidget(0, loginWindow); } connect(systemTray, SIGNAL(clicked()), loginWindow, SLOT(bringToFront())); #ifndef SWIFT_MOBILE - QVariant loginWindowGeometryVariant = settings->getQSettings()->value("loginWindowGeometry"); + QVariant loginWindowGeometryVariant = qtOnlySettings->getQSettings()->value("loginWindowGeometry"); if (loginWindowGeometryVariant.isValid()) { loginWindow->restoreGeometry(loginWindowGeometryVariant.toByteArray()); } @@ -78,7 +78,7 @@ LoginWindow* QtUIFactory::createLoginWindow(UIEventStream* eventStream) { } void QtUIFactory::handleLoginWindowGeometryChanged() { - settings->getQSettings()->setValue("loginWindowGeometry", loginWindow->saveGeometry()); + qtOnlySettings->getQSettings()->setValue("loginWindowGeometry", loginWindow->saveGeometry()); } EventWindow* QtUIFactory::createEventWindow() { @@ -115,7 +115,7 @@ ChatWindow* QtUIFactory::createChatWindow(const JID& contact, UIEventStream* eve void QtUIFactory::handleChatWindowFontResized(int size) { chatFontSize = size; - settings->storeInt(CHATWINDOW_FONT_SIZE, size); + settings->storeSetting(QtUISettingConstants::CHATWINDOW_FONT_SIZE, size); } UserSearchWindow* QtUIFactory::createUserSearchWindow(UserSearchWindow::Type type, UIEventStream* eventStream, const std::set<std::string>& groups) { |