diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-12-06 14:29:38 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-06 09:49:05 -0800 |
commit | 4e263bae987bcc343497496bcdc962c292977b6a (patch) | |
tree | 9cf584fe5c83493356e64a0b17faae4bbb31ad55 /qt-ui/models.h | |
parent | bfe5ccda1ca50221828255e8f017a5f0180a020a (diff) | |
download | subsurface-4e263bae987bcc343497496bcdc962c292977b6a.tar.gz |
Added a language preference to the Settings.
When the user first opens the application the default language is
selected; this can be changed to a hardcoded one by going to system
preferences and choosing the one you want.
Restart required.
Fixes #136
[Dirk Hohndel: whitespace fixes, removed qDebug() call, rephrased the
message displayed prompting the user to restart.]
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r-- | qt-ui/models.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h index 9dd7b2bf6..baa7b32c4 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -234,7 +234,7 @@ private: class YearlyStatisticsModel : public TreeModel { Q_OBJECT public: - enum { YEAR,DIVES,TOTAL_TIME,AVERAGE_TIME,SHORTEST_TIME,LONGEST_TIME,AVG_DEPTH,MIN_DEPTH, + enum { YEAR,DIVES,TOTAL_TIME,AVERAGE_TIME,SHORTEST_TIME,LONGEST_TIME,AVG_DEPTH,MIN_DEPTH, MAX_DEPTH,AVG_SAC,MIN_SAC,MAX_SAC,AVG_TEMP,MIN_TEMP,MAX_TEMP,COLUMNS}; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; @@ -312,4 +312,16 @@ public slots: void repopulate(); }; + +class LanguageModel : public QAbstractListModel { + Q_OBJECT +public: + static LanguageModel* instance(); + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; +private: + LanguageModel(QObject* parent = 0); + + QStringList languages; +}; #endif |