diff options
-rw-r--r-- | icons/subsurface/32x32/actions/go-down.png | bin | 0 -> 649 bytes | |||
-rw-r--r-- | icons/subsurface/32x32/actions/go-up.png | bin | 0 -> 622 bytes | |||
-rw-r--r-- | icons/subsurface/32x32/actions/window-close.png | bin | 0 -> 338 bytes | |||
-rw-r--r-- | icons/subsurface/index.theme | 7 | ||||
-rw-r--r-- | qt-gui.cpp | 8 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 3 | ||||
-rw-r--r-- | qt-ui/preferences.cpp | 4 | ||||
-rw-r--r-- | qt-ui/preferences.h | 2 | ||||
-rw-r--r-- | qt-ui/usermanual.ui | 4 | ||||
-rw-r--r-- | subsurface.qrc | 6 |
10 files changed, 25 insertions, 9 deletions
diff --git a/icons/subsurface/32x32/actions/go-down.png b/icons/subsurface/32x32/actions/go-down.png Binary files differnew file mode 100644 index 000000000..0d08df9cb --- /dev/null +++ b/icons/subsurface/32x32/actions/go-down.png diff --git a/icons/subsurface/32x32/actions/go-up.png b/icons/subsurface/32x32/actions/go-up.png Binary files differnew file mode 100644 index 000000000..397511707 --- /dev/null +++ b/icons/subsurface/32x32/actions/go-up.png diff --git a/icons/subsurface/32x32/actions/window-close.png b/icons/subsurface/32x32/actions/window-close.png Binary files differnew file mode 100644 index 000000000..2d02aaf3e --- /dev/null +++ b/icons/subsurface/32x32/actions/window-close.png diff --git a/icons/subsurface/index.theme b/icons/subsurface/index.theme new file mode 100644 index 000000000..e7835db51 --- /dev/null +++ b/icons/subsurface/index.theme @@ -0,0 +1,7 @@ +[Icon Theme] +Name=Subsurface +Comment=Subsurface fallback theme +Directories=32x32/actions + +[32x32/actions] +Size=32 diff --git a/qt-gui.cpp b/qt-gui.cpp index eeb43b899..23dc8b75f 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -50,6 +50,7 @@ const char *existing_filename; static QString shortDateFormat; static QString dateFormat; static QString timeFormat; +static QLocale loc; #if defined(Q_OS_WIN) && QT_VERSION < 0x050000 static QByteArray encodeUtf8(const QString &fname) @@ -72,10 +73,11 @@ QString uiLanguage(QLocale *callerLoc) { QSettings s; s.beginGroup("Language"); - QLocale loc; if (!s.value("UseSystemLanguage", true).toBool()) { loc = QLocale(s.value("UiLanguage", QLocale().uiLanguages().first()).toString()); + } else { + loc = QLocale(QLocale().uiLanguages().first()); } QString uiLang = loc.uiLanguages().first(); @@ -392,14 +394,14 @@ QString get_dive_date_string(timestamp_t when) { QDateTime ts; ts.setMSecsSinceEpoch(when * 1000); - return ts.toUTC().toString(dateFormat + " " + timeFormat); + return loc.toString(ts.toUTC(), dateFormat + " " + timeFormat); } QString get_short_dive_date_string(timestamp_t when) { QDateTime ts; ts.setMSecsSinceEpoch(when * 1000); - return ts.toUTC().toString(shortDateFormat + " " + timeFormat); + return loc.toString(ts.toUTC(), shortDateFormat + " " + timeFormat); } QString get_trip_date_string(timestamp_t when, int nr) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 1e21f4a59..2cde8d992 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -70,6 +70,9 @@ MainWindow::MainWindow() : QMainWindow(), m_Instance = this; ui.setupUi(this); setWindowIcon(QIcon(":subsurface-icon")); + if (!QIcon::hasThemeIcon("window-close")) { + QIcon::setThemeName("subsurface"); + } connect(ui.ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int))); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ListWidget, SLOT(update())); diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 6d16b810a..ef37c10c1 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -25,7 +25,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDial ui.proxyType->addItem(tr("HTTP proxy"), QNetworkProxy::HttpProxy); ui.proxyType->addItem(tr("SOCKS proxy"), QNetworkProxy::Socks5Proxy); ui.proxyType->setCurrentIndex(-1); - connect(ui.proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(on_proxyType_changed(int))); + connect(ui.proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyType_changed(int))); connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *))); connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int))); connect(ui.gfhigh, SIGNAL(valueChanged(int)), this, SLOT(gfhighChanged(int))); @@ -413,7 +413,7 @@ void PreferencesDialog::emitSettingsChanged() emit settingsChanged(); } -void PreferencesDialog::on_proxyType_changed(int idx) +void PreferencesDialog::proxyType_changed(int idx) { if (idx == -1) { return; diff --git a/qt-ui/preferences.h b/qt-ui/preferences.h index eb7066b54..ac54cc027 100644 --- a/qt-ui/preferences.h +++ b/qt-ui/preferences.h @@ -27,7 +27,7 @@ slots: void rememberPrefs(); void gflowChanged(int gf); void gfhighChanged(int gf); - void on_proxyType_changed(int idx); + void proxyType_changed(int idx); private: explicit PreferencesDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); diff --git a/qt-ui/usermanual.ui b/qt-ui/usermanual.ui index 506b5c2ca..e8f0095f5 100644 --- a/qt-ui/usermanual.ui +++ b/qt-ui/usermanual.ui @@ -74,7 +74,7 @@ <string/> </property> <property name="icon"> - <iconset theme="go-previous"> + <iconset theme="go-up"> <normaloff/> </iconset> </property> @@ -98,7 +98,7 @@ <string/> </property> <property name="icon"> - <iconset theme="go-next"> + <iconset theme="go-down"> <normaloff/> </iconset> </property> diff --git a/subsurface.qrc b/subsurface.qrc index 47a8ce414..48dce73dd 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -53,6 +53,10 @@ <file alias="icon_ceiling_dc">icons/pc.png</file> <file alias="icon_ead">icons/ead.png</file> <file alias="icon_HR">icons/icon-HR.png</file> - <file alias="calendar">icons/calendarbg.png</file> + <file alias="calendar">icons/calendarbg.png</file> + <file>icons/subsurface/index.theme</file> + <file>icons/subsurface/32x32/actions/go-down.png</file> + <file>icons/subsurface/32x32/actions/go-up.png</file> + <file>icons/subsurface/32x32/actions/window-close.png</file> </qresource> </RCC> |