root/trunk/qt4-gui/src/settings/settingsdlg.h

Revision 5837, 2.9 kB (checked in by eugene, 12 months ago)

P.S. Happy recompiling ;-)

Line 
1/*
2 * This file is part of Licq, an instant messaging client for UNIX.
3 * Copyright (C) 2007 Licq developers
4 *
5 * Licq is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * Licq is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with Licq; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20#ifndef SETTINGSDLG_H
21#define SETTINGSDLG_H
22
23#include <config.h>
24
25#include <QDialog>
26#include <QMap>
27
28namespace LicqQtGui
29{
30class TreePager;
31
32namespace Settings
33{
34  class Chat;
35  class ContactList;
36  class Events;
37  class General;
38  class Network;
39  class Status;
40}
41
42/**
43 * Dialog for holding configuration settings that can be changed by the user.
44 */
45class SettingsDlg : public QDialog
46{
47  Q_OBJECT
48
49public:
50  enum SettingsPage
51  {
52    UnknownPage = -1,
53    ContactListPage,
54    ColumnsPage,
55    DockingPage,
56    FontsPage,
57    ContactInfoPage,
58    ChatPage,
59    ChatDispPage,
60    HistDispPage,
61    OnEventPage,
62    SoundsPage,
63    NetworkPage,
64    IcqPage,
65    StatusPage,
66    RespMsgPage
67  };
68
69  /**
70   * Create and show the settings dialog.
71   * If dialog is already showing it just sets the current page to startPage.
72   *
73   * @param page Initial page to show
74   */
75  static void show(SettingsPage page = ContactListPage);
76
77  /**
78   * Select page to show
79   *
80   * @param page Page to show
81   */
82  void showPage(SettingsPage page);
83
84  /**
85   * Add page to settings dialog
86   *
87   * @param page Page id
88   * @param widget Widget containg the actual page
89   * @param title Page title
90   * @param parent Parent page if not a top level page
91   */
92  void addPage(SettingsPage page, QWidget* widget, QString title, SettingsPage parent = UnknownPage);
93
94private slots:
95  /**
96   * Apply settings to running gui.
97   * Does not save settings to disk or close dialog
98   */
99  void apply();
100
101  /**
102   * Apply and save settings and close dialog.
103   */
104  void ok();
105
106private:
107  // Only allow one instance at a time so keep track if we have one open
108  static SettingsDlg* myInstance;
109
110  /**
111   * Constructor
112   *
113   * @param parent Parent widget
114   */
115  SettingsDlg(QWidget* parent = 0);
116
117  /**
118   * Destructor
119   */
120  virtual ~SettingsDlg();
121
122
123  TreePager* myPager;
124  QMap<SettingsPage, QWidget*> myPages;
125
126  Settings::Chat* myChatSettings;
127  Settings::ContactList* myContactListSettings;
128  Settings::Events* myEventsSettings;
129  Settings::General* myGeneralSettings;
130  Settings::Network* myNetworkSettings;
131  Settings::Status* myStatusSettings;
132};
133
134} // namespace LicqQtGui
135
136#endif
Note: See TracBrowser for help on using the browser.