aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-09-30 17:31:51 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-09-30 17:31:51 +0000
commit80c81ecad4ac2c3dda28806bd1d1b751798222f0 (patch)
tree73879ab620a144a9336c84ea39ada453c3a2f67d /src
parent6ff488db79f0973466b67ca3bd53f81bb6357043 (diff)
downloadqmmp-80c81ecad4ac2c3dda28806bd1d1b751798222f0.tar.gz
qmmp-80c81ecad4ac2c3dda28806bd1d1b751798222f0.tar.bz2
qmmp-80c81ecad4ac2c3dda28806bd1d1b751798222f0.zip
added lxde icons support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1924 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/ui/CMakeLists.txt2
-rw-r--r--src/ui/lxdesupport.cpp40
-rw-r--r--src/ui/lxdesupport.h33
-rw-r--r--src/ui/ui.pro6
4 files changed, 79 insertions, 2 deletions
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index 2a1eb1915..5275ad98f 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -85,6 +85,7 @@ SET(ui_SRCS
popupsettings.cpp
windowsystem.cpp
viewmenu.cpp
+ lxdesupport.cpp
)
SET(ui_MOC_HDRS
@@ -140,6 +141,7 @@ SET(ui_MOC_HDRS
popupsettings.h
windowsystem.h
viewmenu.h
+ lxdesupport.h
)
SET(ui_RCCS images/images.qrc stuff.qrc translations/qmmp_locales.qrc)
diff --git a/src/ui/lxdesupport.cpp b/src/ui/lxdesupport.cpp
new file mode 100644
index 000000000..827cbd60c
--- /dev/null
+++ b/src/ui/lxdesupport.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <QIcon>
+#include <QSettings>
+#include <QDir>
+#include "lxdesupport.h"
+
+void LXDESupport::load()
+{
+ if(qgetenv("XDG_CURRENT_DESKTOP") != "LXDE")
+ return;
+
+ QString conf_path = qgetenv("XDG_CONFIG_HOME");
+ if(conf_path.isEmpty())
+ conf_path = QDir::homePath() + "/.config";
+ conf_path.append("/lxsession/LXDE/desktop.conf");
+
+ QSettings lxde_settings(conf_path, QSettings::IniFormat);
+ QString themeName = lxde_settings.value("GTK/sNet/IconThemeName").toString();
+ if(!themeName.isEmpty())
+ QIcon::setThemeName(themeName);
+}
diff --git a/src/ui/lxdesupport.h b/src/ui/lxdesupport.h
new file mode 100644
index 000000000..99f0aac62
--- /dev/null
+++ b/src/ui/lxdesupport.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef LXDESUPPORT_H
+#define LXDESUPPORT_H
+
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
+class LXDESupport
+{
+public:
+ static void load();
+};
+
+#endif // LXDESUPPORT_H
diff --git a/src/ui/ui.pro b/src/ui/ui.pro
index 2d570c4d6..c4c0ee861 100644
--- a/src/ui/ui.pro
+++ b/src/ui/ui.pro
@@ -57,7 +57,8 @@ HEADERS += mainwindow.h \
popupwidget.h \
popupsettings.h \
windowsystem.h \
- viewmenu.h
+ viewmenu.h \
+ lxdesupport.h
SOURCES += mainwindow.cpp \
mp3player.cpp \
button.cpp \
@@ -109,7 +110,8 @@ SOURCES += mainwindow.cpp \
popupwidget.cpp \
popupsettings.cpp \
windowsystem.cpp \
- viewmenu.cpp
+ viewmenu.cpp \
+ lxdesupport.cpp
win32:HEADERS += ../qmmp/visual.h
unix {
HEADERS +=