aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-06 14:29:38 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-06 09:49:05 -0800
commit4e263bae987bcc343497496bcdc962c292977b6a (patch)
tree9cf584fe5c83493356e64a0b17faae4bbb31ad55 /qt-ui/models.h
parentbfe5ccda1ca50221828255e8f017a5f0180a020a (diff)
downloadsubsurface-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.h14
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