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>
This commit is contained in:
Tomaz Canabrava 2013-12-06 14:29:38 -02:00 committed by Dirk Hohndel
parent bfe5ccda1c
commit 4e263bae98
5 changed files with 118 additions and 18 deletions

View file

@ -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