~ubuntu-branches/ubuntu/maverick/universalindentgui/maverick-proposed

« back to all changes in this revision

Viewing changes to src/uiguisettings.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2009-04-29 10:50:58 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090429105058-7xj26rwxxnir1tr7
Tags: 1.0.2-1
* New upstream release:
  - The default editor font type is now Monospace instead of Courier.
    (Closes: #483873)
* Add 01_disable_check_for_update.diff patch:
  Automatic check for update is disabled by default. (Closes: #514999)
* Bump debian/compat to 7.
* Update debian/control:
  - Set Thomas Schweitzer as maintainer and myself as uploader.
    (Closes: #483068)
  - Bump debhelper build-dependency to 7.
  - Bump Standards-Version to 3.8.1. No changes needed.
  - Update recommended beautifier list.
  - Update description to list all supported beautifiers.
* Update debian/copyright:
  - Add PerlTidy.pm and JsDecoder.js missing copyrights.
* Cleanup debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
3
 
*   thomas-schweitzer(at)arcor.de                                         *
4
 
*                                                                         *
5
 
*   This program is free software; you can redistribute it and/or modify  *
6
 
*   it under the terms of the GNU General Public License version 2.0 as   *
7
 
*   published by the Free Software Foundation.                            *
8
 
*                                                                         *
9
 
*   This program is distributed in the hope that it will be useful,       *
10
 
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 
*   GNU General Public License for more details.                          *
13
 
*                                                                         *
14
 
*   You should have received a copy of the GNU General Public License     *
15
 
*   along with this program in the file LICENSE.GPL; if not, write to the *
16
 
*   Free Software Foundation, Inc.,                                       *
17
 
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 
***************************************************************************/
19
 
 
20
 
#ifndef UIGUISETTINGS_H
21
 
#define UIGUISETTINGS_H
22
 
 
23
 
#include <QObject>
24
 
#include <QString>
25
 
#include <QSettings>
26
 
#include <QPoint>
27
 
#include <QSize>
28
 
#include <QDir>
29
 
#include <QDate>
30
 
#include <QStringList>
31
 
#include <QCoreApplication>
32
 
 
33
 
class UiGuiSettings : public QObject
34
 
{
35
 
        Q_OBJECT
36
 
 
37
 
public:
38
 
        UiGuiSettings(bool portableMode, QString globalFilesDirectoryStr);
39
 
    virtual ~UiGuiSettings();
40
 
    bool loadSettings();
41
 
    bool saveSettings();
42
 
    bool setValueByName(QString settingName, QVariant value);
43
 
        QVariant getValueByName(QString settingName);
44
 
    void updateAllDependend();
45
 
        QStringList getAvailableTranslations();
46
 
 
47
 
// Only one slot per possible value type needed, because wanted setting
48
 
// is recognized by the sender objects name.
49
 
public slots:
50
 
        void handleValueChangeFromExtern(int value);
51
 
    void handleValueChangeFromExtern(bool value);
52
 
    void handleValueChangeFromExtern(QDate value);
53
 
    void handleValueChangeFromExtern(QByteArray value);
54
 
 
55
 
// Each possible setting needs an own signal.
56
 
signals:
57
 
    void versionInSettingsFile(QString value);
58
 
    void windowIsMaximized(bool value);
59
 
    void windowPosition(QPoint value);
60
 
    void windowSize(QSize value);
61
 
    void fileEncoding(QString value);
62
 
    void recentlyOpenedListSize(int value);
63
 
    void loadLastOpenedFileOnStartup(bool value);
64
 
    void lastOpenedFiles(QString value);
65
 
    void lastSelectedIndenterID(int value);
66
 
    void syntaxHighlightningEnabled(bool value);
67
 
    void whiteSpaceIsVisible(bool value);
68
 
    void indenterParameterTooltipsEnabled(bool value);
69
 
    void tabWidth(int value);
70
 
    void language(int value);
71
 
    void checkForUpdate(bool value);
72
 
    void lastUpdateCheck(QDate value);
73
 
    void mainWindowState(QByteArray value);
74
 
 
75
 
private:
76
 
    void emitSignalForSetting(QString settingName);
77
 
        void readAvailableTranslations();
78
 
 
79
 
        //! Stores the mnemonics of the available translations.
80
 
        QStringList availableTranslations;
81
 
 
82
 
    //! The settings file.
83
 
    QSettings *qsettings;
84
 
 
85
 
        //! This map holds all possible settings defined by their name as QString. The value is of the type QVariant.
86
 
        QMap<QString, QVariant> settings;
87
 
 
88
 
    QString globalFilesDirectoryStr;
89
 
    QString indenterDirctoryStr;
90
 
    bool portableMode;
91
 
};
92
 
 
93
 
#endif // UIGUISETTINGS_H