Working on #93.
This commit is contained in:
parent
91f9dd7a9c
commit
9fef53f812
4 changed files with 59 additions and 11 deletions
|
@ -9,7 +9,7 @@ Fixed:
|
||||||
Added:
|
Added:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Settings/database can now experimentally be exported/imported.</li>
|
<li>Settings/database can now experimentally be exported/imported.</li>
|
||||||
<li>Added Swedish localization (thanks to Åke Engelbrektson).</li>
|
<li>Added Swedish localization (thanks to Åke Engelbrektson).</li>
|
||||||
<li>Parent item is now selected when adding new category/feed with that parent pre-selected in feed view.</li>
|
<li>Parent item is now selected when adding new category/feed with that parent pre-selected in feed view.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QStackedWidget" name="m_stackedSettings">
|
<widget class="QStackedWidget" name="m_stackedSettings">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="m_pageGeneral">
|
<widget class="QWidget" name="m_pageGeneral">
|
||||||
<layout class="QFormLayout" name="formLayout_5">
|
<layout class="QFormLayout" name="formLayout_5">
|
||||||
|
@ -400,8 +400,8 @@ Authors of this application are NOT responsible for lost data.</string>
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>100</width>
|
<width>684</width>
|
||||||
<height>30</height>
|
<height>451</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
@ -478,8 +478,8 @@ Authors of this application are NOT responsible for lost data.</string>
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>167</width>
|
<width>678</width>
|
||||||
<height>219</height>
|
<height>425</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
@ -1163,7 +1163,7 @@ Authors of this application are NOT responsible for lost data.</string>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="m_tabFeedsMessages">
|
<widget class="QTabWidget" name="m_tabFeedsMessages">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="m_tabFeeds">
|
<widget class="QWidget" name="m_tabFeeds">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -1286,6 +1286,49 @@ Authors of this application are NOT responsible for lost data.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QGroupBox" name="m_grpMessagesDateTimeFormat">
|
||||||
|
<property name="title">
|
||||||
|
<string>Use custom date/time format (overrides format loaded from active localization)</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QFormLayout" name="formLayout_19">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="text">
|
||||||
|
<string>Format code</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="m_cmbMessagesDateTimeFormat">
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_12">
|
||||||
|
<property name="text">
|
||||||
|
<string>Example</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="m_lblMessagesDateTimeFormat">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -55,9 +55,7 @@ void Localization::loadActiveLanguage() {
|
||||||
desired_localization = DEFAULT_LOCALE;
|
desired_localization = DEFAULT_LOCALE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qt_translator->load(QString("qt-%1.qm").arg(desired_localization),
|
if (qt_translator->load(QString("qt-%1.qm").arg(desired_localization), APP_LANG_PATH, "-")) {
|
||||||
APP_LANG_PATH,
|
|
||||||
"-")) {
|
|
||||||
Application::installTranslator(qt_translator);
|
Application::installTranslator(qt_translator);
|
||||||
qDebug("Qt localization '%s' loaded successfully.", qPrintable(desired_localization));
|
qDebug("Qt localization '%s' loaded successfully.", qPrintable(desired_localization));
|
||||||
}
|
}
|
||||||
|
@ -66,7 +64,8 @@ void Localization::loadActiveLanguage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_loadedLanguage = desired_localization;
|
m_loadedLanguage = desired_localization;
|
||||||
QLocale::setDefault(QLocale(desired_localization));
|
m_loadedLocale = QLocale(desired_localization);
|
||||||
|
QLocale::setDefault(m_loadedLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Language> Localization::installedLanguages() {
|
QList<Language> Localization::installedLanguages() {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
|
|
||||||
struct Language {
|
struct Language {
|
||||||
|
@ -58,9 +59,14 @@ class Localization : public QObject {
|
||||||
return m_loadedLanguage;
|
return m_loadedLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QLocale loadedLocale() const {
|
||||||
|
return m_loadedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Code of loaded language.
|
// Code of loaded language.
|
||||||
QString m_loadedLanguage;
|
QString m_loadedLanguage;
|
||||||
|
QLocale m_loadedLocale;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LOCALIZATION_H
|
#endif // LOCALIZATION_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue