More build system tweaking, plus making icons work
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 25 Sep 2008 23:27:44 +0000 (01:27 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 26 Sep 2008 23:32:23 +0000 (01:32 +0200)
53 files changed:
CMakeLists.txt
cmake/modules/QuasselMacros.cmake
icons/CMakeLists.txt
icons/hicolor.qrc
icons/oxygen.qrc
icons/oxygen/16x16/devices/audio-card.png [new file with mode: 0644]
icons/oxygen/16x16/devices/audio-headset.png [new file with mode: 0644]
icons/oxygen/16x16/devices/audio-input-line.png [new file with mode: 0644]
icons/oxygen/16x16/devices/audio-input-microphone.png [new file with mode: 0644]
icons/oxygen/16x16/devices/battery.png [new file with mode: 0644]
icons/oxygen/16x16/devices/camera-photo.png [new file with mode: 0644]
icons/oxygen/16x16/devices/camera-web.png [new file with mode: 0644]
icons/oxygen/16x16/devices/computer-laptop.png [new file with mode: 0644]
icons/oxygen/16x16/devices/computer.png [new file with mode: 0644]
icons/oxygen/16x16/devices/cpu.png [new file with mode: 0644]
icons/oxygen/16x16/devices/drive-harddisk.png [new file with mode: 0644]
icons/oxygen/16x16/devices/drive-optical.png [new file with mode: 0644]
icons/oxygen/16x16/devices/drive-removable-media-usb-pendrive.png [new file with mode: 0644]
icons/oxygen/16x16/devices/drive-removable-media-usb.png [new file with mode: 0644]
icons/oxygen/16x16/devices/drive-removable-media.png [new file with mode: 0644]
icons/oxygen/16x16/devices/input-gaming.png [new file with mode: 0644]
icons/oxygen/16x16/devices/input-keyboard.png [new file with mode: 0644]
icons/oxygen/16x16/devices/input-mouse.png [new file with mode: 0644]
icons/oxygen/16x16/devices/input-tablet.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-flash-memory-stick.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-flash-sd-mmc.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-flash-smart-media.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-flash.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-floppy.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-optical-audio.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-optical-recordable.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-optical.png [new file with mode: 0644]
icons/oxygen/16x16/devices/media-tape.png [new file with mode: 0644]
icons/oxygen/16x16/devices/modem.png [new file with mode: 0644]
icons/oxygen/16x16/devices/multimedia-player-apple-ipod.png [new file with mode: 0644]
icons/oxygen/16x16/devices/multimedia-player.png [new file with mode: 0644]
icons/oxygen/16x16/devices/network-wired.png [new file with mode: 0644]
icons/oxygen/16x16/devices/network-wireless.png [new file with mode: 0644]
icons/oxygen/16x16/devices/pda.png [new file with mode: 0644]
icons/oxygen/16x16/devices/phone-openmoko-freerunner.png [new file with mode: 0644]
icons/oxygen/16x16/devices/phone.png [new file with mode: 0644]
icons/oxygen/16x16/devices/printer.png [new file with mode: 0644]
icons/oxygen/16x16/devices/scanner.png [new file with mode: 0644]
icons/oxygen/16x16/devices/video-display.png [new file with mode: 0644]
icons/oxygen/16x16/devices/video-projector.png [new file with mode: 0644]
icons/oxygen/16x16/devices/video-television.png [new file with mode: 0644]
src/CMakeLists.txt
src/common/quassel.cpp
src/qtui/mainwin.cpp
src/qtui/mainwin.h
src/qtui/qtuiapplication.cpp
src/uisupport/iconloader.cpp
src/uisupport/iconloader.h

index 8b7e3db..041e2d7 100644 (file)
@@ -86,23 +86,6 @@ if(EXECINFO_FOUND)
   link_libraries(${EXECINFO_LIBRARIES})
 endif(EXECINFO_FOUND)
 
-# Decide what to do with icons
-if(WANT_QTCLIENT OR WANT_MONO)
-  if(QUASSEL_ICONS MATCHES "External")
-    message(STATUS "Install Quassel icons to ${CMAKE_INSTALL_PREFIX}/share/apps/quassel")
-  else(QUASSEL_ICONS MATCHES "External")
-    set(QUASSEL_ICONS "Builtin")
-    message(STATUS "Compile Quassel icons into the binary")
-  endif(QUASSEL_ICONS MATCHES "External")
-
-  if(OXYGEN_ICONS MATCHES "External")
-    message(STATUS "Use system-installed Oxygen icon theme")
-  else(OXYGEN_ICONS MATCHES "External")
-    set(OXYGEN_ICONS "Builtin")
-    message(STATUS "Compile Oxygen icon theme subset into the binary")
-  endif(OXYGEN_ICONS MATCHES "External")
-endif(WANT_QTCLIENT OR WANT_MONO)
-
 # Select a Qt installation here, if you don't want to use system Qt
 if(QT)
   # FindQt4 will look for the qmake binary in $PATH, so we just prepend the Qt dir
@@ -188,6 +171,22 @@ add_custom_target(genversion_run ALL ${GENVERSION_EXECUTABLE}
                   ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/common/version.gen)
 add_dependencies(genversion_run genversion)
 
+# Decide what to do with icons
+if(WANT_QTCLIENT OR WANT_MONO)
+  if(QUASSEL_ICONS MATCHES "External")
+    message(STATUS "Install Quassel icons to ${CMAKE_INSTALL_PREFIX}/share/apps/quassel")
+  else(QUASSEL_ICONS MATCHES "External")
+    set(QUASSEL_ICONS "Builtin")
+    message(STATUS "Compile Quassel icons into the binary")
+  endif(QUASSEL_ICONS MATCHES "External")
+
+  if(OXYGEN_ICONS MATCHES "External")
+    message(STATUS "Use system-installed Oxygen icon theme")
+  else(OXYGEN_ICONS MATCHES "External")
+    set(OXYGEN_ICONS "Builtin")
+    message(STATUS "Compile Oxygen icon theme subset into the binary")
+  endif(OXYGEN_ICONS MATCHES "External")
+endif(WANT_QTCLIENT OR WANT_MONO)
 
 # These variables will be added to the main targets (CORE, QTCLIENT, MONO)
 
index d16dcd4..6b2f82d 100644 (file)
@@ -25,4 +25,4 @@ macro(generate_qm outvar basename)
                -silent -compress
           DEPENDS ${basename}.ts)
   set(${outvar} ${output})
-endmacro(generate_qm outvar basename)
\ No newline at end of file
+endmacro(generate_qm outvar basename)
index c28de2e..129bc88 100644 (file)
@@ -3,9 +3,9 @@
 if(QUASSEL_ICONS MATCHES "External")
   install(DIRECTORY hicolor DESTINATION ${ICON_INSTALL_DIR})
 else(QUASSEL_ICONS MATCHES "External")
-  set(CLIENT_DEPS ${CLIENT_DEPS} hicolor.qrc)
+#  set(CLIENT_DEPS ${CLIENT_DEPS} hicolor.qrc)
 endif(QUASSEL_ICONS MATCHES "External")
 
 if(OXYGEN_ICONS MATCHES "Builtin")
-  set(CLIENT_DEPS ${CLIENT_DEPS} oxygen.qrc)
+#  set(CLIENT_DEPS ${CLIENT_DEPS} oxygen.qrc)
 endif(OXYGEN_ICONS MATCHES "Builtin")
index d813d14..88e5c51 100644 (file)
@@ -1,5 +1,5 @@
 <RCC>
-  <qresource prefix="icons" >
+  <qresource prefix="/icons" >
     <file>hicolor/16x16/apps/quassel_disconnected.png</file>
     <file>hicolor/16x16/apps/quassel_newmessage.png</file>
     <file>hicolor/16x16/apps/quassel.png</file>
index 9d080fd..3fbfea5 100644 (file)
@@ -1,5 +1,46 @@
 <RCC>
-  <qresource prefix="icons" >
+  <qresource prefix="/icons" >
+    <file>oxygen/16x16/devices/audio-card.png</file>
+    <file>oxygen/16x16/devices/audio-headset.png</file>
+    <file>oxygen/16x16/devices/audio-input-line.png</file>
+    <file>oxygen/16x16/devices/audio-input-microphone.png</file>
+    <file>oxygen/16x16/devices/battery.png</file>
+    <file>oxygen/16x16/devices/camera-photo.png</file>
+    <file>oxygen/16x16/devices/camera-web.png</file>
+    <file>oxygen/16x16/devices/computer-laptop.png</file>
+    <file>oxygen/16x16/devices/computer.png</file>
+    <file>oxygen/16x16/devices/cpu.png</file>
+    <file>oxygen/16x16/devices/drive-harddisk.png</file>
+    <file>oxygen/16x16/devices/drive-optical.png</file>
+    <file>oxygen/16x16/devices/drive-removable-media.png</file>
+    <file>oxygen/16x16/devices/drive-removable-media-usb-pendrive.png</file>
+    <file>oxygen/16x16/devices/drive-removable-media-usb.png</file>
+    <file>oxygen/16x16/devices/input-gaming.png</file>
+    <file>oxygen/16x16/devices/input-keyboard.png</file>
+    <file>oxygen/16x16/devices/input-mouse.png</file>
+    <file>oxygen/16x16/devices/input-tablet.png</file>
+    <file>oxygen/16x16/devices/media-flash-memory-stick.png</file>
+    <file>oxygen/16x16/devices/media-flash.png</file>
+    <file>oxygen/16x16/devices/media-flash-sd-mmc.png</file>
+    <file>oxygen/16x16/devices/media-flash-smart-media.png</file>
+    <file>oxygen/16x16/devices/media-floppy.png</file>
+    <file>oxygen/16x16/devices/media-optical-audio.png</file>
+    <file>oxygen/16x16/devices/media-optical.png</file>
+    <file>oxygen/16x16/devices/media-optical-recordable.png</file>
+    <file>oxygen/16x16/devices/media-tape.png</file>
+    <file>oxygen/16x16/devices/modem.png</file>
+    <file>oxygen/16x16/devices/multimedia-player-apple-ipod.png</file>
+    <file>oxygen/16x16/devices/multimedia-player.png</file>
+    <file>oxygen/16x16/devices/network-wired.png</file>
+    <file>oxygen/16x16/devices/network-wireless.png</file>
+    <file>oxygen/16x16/devices/pda.png</file>
+    <file>oxygen/16x16/devices/phone-openmoko-freerunner.png</file>
+    <file>oxygen/16x16/devices/phone.png</file>
+    <file>oxygen/16x16/devices/printer.png</file>
+    <file>oxygen/16x16/devices/scanner.png</file>
+    <file>oxygen/16x16/devices/video-display.png</file>
+    <file>oxygen/16x16/devices/video-projector.png</file>
+    <file>oxygen/16x16/devices/video-television.png</file>
     <file>oxygen/16x16/emotes/face-angel.png</file>
     <file>oxygen/16x16/emotes/face-embarrassed.png</file>
     <file>oxygen/16x16/emotes/face-kiss.png</file>
diff --git a/icons/oxygen/16x16/devices/audio-card.png b/icons/oxygen/16x16/devices/audio-card.png
new file mode 100644 (file)
index 0000000..b2a9d8a
Binary files /dev/null and b/icons/oxygen/16x16/devices/audio-card.png differ
diff --git a/icons/oxygen/16x16/devices/audio-headset.png b/icons/oxygen/16x16/devices/audio-headset.png
new file mode 100644 (file)
index 0000000..fc8e068
Binary files /dev/null and b/icons/oxygen/16x16/devices/audio-headset.png differ
diff --git a/icons/oxygen/16x16/devices/audio-input-line.png b/icons/oxygen/16x16/devices/audio-input-line.png
new file mode 100644 (file)
index 0000000..8e8e194
Binary files /dev/null and b/icons/oxygen/16x16/devices/audio-input-line.png differ
diff --git a/icons/oxygen/16x16/devices/audio-input-microphone.png b/icons/oxygen/16x16/devices/audio-input-microphone.png
new file mode 100644 (file)
index 0000000..f44eb0a
Binary files /dev/null and b/icons/oxygen/16x16/devices/audio-input-microphone.png differ
diff --git a/icons/oxygen/16x16/devices/battery.png b/icons/oxygen/16x16/devices/battery.png
new file mode 100644 (file)
index 0000000..8b6e964
Binary files /dev/null and b/icons/oxygen/16x16/devices/battery.png differ
diff --git a/icons/oxygen/16x16/devices/camera-photo.png b/icons/oxygen/16x16/devices/camera-photo.png
new file mode 100644 (file)
index 0000000..c8f6334
Binary files /dev/null and b/icons/oxygen/16x16/devices/camera-photo.png differ
diff --git a/icons/oxygen/16x16/devices/camera-web.png b/icons/oxygen/16x16/devices/camera-web.png
new file mode 100644 (file)
index 0000000..db115cd
Binary files /dev/null and b/icons/oxygen/16x16/devices/camera-web.png differ
diff --git a/icons/oxygen/16x16/devices/computer-laptop.png b/icons/oxygen/16x16/devices/computer-laptop.png
new file mode 100644 (file)
index 0000000..bf8a989
Binary files /dev/null and b/icons/oxygen/16x16/devices/computer-laptop.png differ
diff --git a/icons/oxygen/16x16/devices/computer.png b/icons/oxygen/16x16/devices/computer.png
new file mode 100644 (file)
index 0000000..aa62891
Binary files /dev/null and b/icons/oxygen/16x16/devices/computer.png differ
diff --git a/icons/oxygen/16x16/devices/cpu.png b/icons/oxygen/16x16/devices/cpu.png
new file mode 100644 (file)
index 0000000..30050eb
Binary files /dev/null and b/icons/oxygen/16x16/devices/cpu.png differ
diff --git a/icons/oxygen/16x16/devices/drive-harddisk.png b/icons/oxygen/16x16/devices/drive-harddisk.png
new file mode 100644 (file)
index 0000000..bae21a8
Binary files /dev/null and b/icons/oxygen/16x16/devices/drive-harddisk.png differ
diff --git a/icons/oxygen/16x16/devices/drive-optical.png b/icons/oxygen/16x16/devices/drive-optical.png
new file mode 100644 (file)
index 0000000..e3d929b
Binary files /dev/null and b/icons/oxygen/16x16/devices/drive-optical.png differ
diff --git a/icons/oxygen/16x16/devices/drive-removable-media-usb-pendrive.png b/icons/oxygen/16x16/devices/drive-removable-media-usb-pendrive.png
new file mode 100644 (file)
index 0000000..807edf5
Binary files /dev/null and b/icons/oxygen/16x16/devices/drive-removable-media-usb-pendrive.png differ
diff --git a/icons/oxygen/16x16/devices/drive-removable-media-usb.png b/icons/oxygen/16x16/devices/drive-removable-media-usb.png
new file mode 100644 (file)
index 0000000..c0e31d2
Binary files /dev/null and b/icons/oxygen/16x16/devices/drive-removable-media-usb.png differ
diff --git a/icons/oxygen/16x16/devices/drive-removable-media.png b/icons/oxygen/16x16/devices/drive-removable-media.png
new file mode 100644 (file)
index 0000000..8c22993
Binary files /dev/null and b/icons/oxygen/16x16/devices/drive-removable-media.png differ
diff --git a/icons/oxygen/16x16/devices/input-gaming.png b/icons/oxygen/16x16/devices/input-gaming.png
new file mode 100644 (file)
index 0000000..11979dd
Binary files /dev/null and b/icons/oxygen/16x16/devices/input-gaming.png differ
diff --git a/icons/oxygen/16x16/devices/input-keyboard.png b/icons/oxygen/16x16/devices/input-keyboard.png
new file mode 100644 (file)
index 0000000..5aa1a22
Binary files /dev/null and b/icons/oxygen/16x16/devices/input-keyboard.png differ
diff --git a/icons/oxygen/16x16/devices/input-mouse.png b/icons/oxygen/16x16/devices/input-mouse.png
new file mode 100644 (file)
index 0000000..0696376
Binary files /dev/null and b/icons/oxygen/16x16/devices/input-mouse.png differ
diff --git a/icons/oxygen/16x16/devices/input-tablet.png b/icons/oxygen/16x16/devices/input-tablet.png
new file mode 100644 (file)
index 0000000..6468305
Binary files /dev/null and b/icons/oxygen/16x16/devices/input-tablet.png differ
diff --git a/icons/oxygen/16x16/devices/media-flash-memory-stick.png b/icons/oxygen/16x16/devices/media-flash-memory-stick.png
new file mode 100644 (file)
index 0000000..2448bae
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-flash-memory-stick.png differ
diff --git a/icons/oxygen/16x16/devices/media-flash-sd-mmc.png b/icons/oxygen/16x16/devices/media-flash-sd-mmc.png
new file mode 100644 (file)
index 0000000..e61f5bf
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-flash-sd-mmc.png differ
diff --git a/icons/oxygen/16x16/devices/media-flash-smart-media.png b/icons/oxygen/16x16/devices/media-flash-smart-media.png
new file mode 100644 (file)
index 0000000..85cab3f
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-flash-smart-media.png differ
diff --git a/icons/oxygen/16x16/devices/media-flash.png b/icons/oxygen/16x16/devices/media-flash.png
new file mode 100644 (file)
index 0000000..04c4598
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-flash.png differ
diff --git a/icons/oxygen/16x16/devices/media-floppy.png b/icons/oxygen/16x16/devices/media-floppy.png
new file mode 100644 (file)
index 0000000..fc40ea3
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-floppy.png differ
diff --git a/icons/oxygen/16x16/devices/media-optical-audio.png b/icons/oxygen/16x16/devices/media-optical-audio.png
new file mode 100644 (file)
index 0000000..975508a
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-optical-audio.png differ
diff --git a/icons/oxygen/16x16/devices/media-optical-recordable.png b/icons/oxygen/16x16/devices/media-optical-recordable.png
new file mode 100644 (file)
index 0000000..de714f6
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-optical-recordable.png differ
diff --git a/icons/oxygen/16x16/devices/media-optical.png b/icons/oxygen/16x16/devices/media-optical.png
new file mode 100644 (file)
index 0000000..42dda21
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-optical.png differ
diff --git a/icons/oxygen/16x16/devices/media-tape.png b/icons/oxygen/16x16/devices/media-tape.png
new file mode 100644 (file)
index 0000000..5808be1
Binary files /dev/null and b/icons/oxygen/16x16/devices/media-tape.png differ
diff --git a/icons/oxygen/16x16/devices/modem.png b/icons/oxygen/16x16/devices/modem.png
new file mode 100644 (file)
index 0000000..fc7957e
Binary files /dev/null and b/icons/oxygen/16x16/devices/modem.png differ
diff --git a/icons/oxygen/16x16/devices/multimedia-player-apple-ipod.png b/icons/oxygen/16x16/devices/multimedia-player-apple-ipod.png
new file mode 100644 (file)
index 0000000..ee0b154
Binary files /dev/null and b/icons/oxygen/16x16/devices/multimedia-player-apple-ipod.png differ
diff --git a/icons/oxygen/16x16/devices/multimedia-player.png b/icons/oxygen/16x16/devices/multimedia-player.png
new file mode 100644 (file)
index 0000000..d3444e1
Binary files /dev/null and b/icons/oxygen/16x16/devices/multimedia-player.png differ
diff --git a/icons/oxygen/16x16/devices/network-wired.png b/icons/oxygen/16x16/devices/network-wired.png
new file mode 100644 (file)
index 0000000..1f256a8
Binary files /dev/null and b/icons/oxygen/16x16/devices/network-wired.png differ
diff --git a/icons/oxygen/16x16/devices/network-wireless.png b/icons/oxygen/16x16/devices/network-wireless.png
new file mode 100644 (file)
index 0000000..d70f0f6
Binary files /dev/null and b/icons/oxygen/16x16/devices/network-wireless.png differ
diff --git a/icons/oxygen/16x16/devices/pda.png b/icons/oxygen/16x16/devices/pda.png
new file mode 100644 (file)
index 0000000..37129f2
Binary files /dev/null and b/icons/oxygen/16x16/devices/pda.png differ
diff --git a/icons/oxygen/16x16/devices/phone-openmoko-freerunner.png b/icons/oxygen/16x16/devices/phone-openmoko-freerunner.png
new file mode 100644 (file)
index 0000000..a75085e
Binary files /dev/null and b/icons/oxygen/16x16/devices/phone-openmoko-freerunner.png differ
diff --git a/icons/oxygen/16x16/devices/phone.png b/icons/oxygen/16x16/devices/phone.png
new file mode 100644 (file)
index 0000000..6fb8572
Binary files /dev/null and b/icons/oxygen/16x16/devices/phone.png differ
diff --git a/icons/oxygen/16x16/devices/printer.png b/icons/oxygen/16x16/devices/printer.png
new file mode 100644 (file)
index 0000000..305072b
Binary files /dev/null and b/icons/oxygen/16x16/devices/printer.png differ
diff --git a/icons/oxygen/16x16/devices/scanner.png b/icons/oxygen/16x16/devices/scanner.png
new file mode 100644 (file)
index 0000000..085cd41
Binary files /dev/null and b/icons/oxygen/16x16/devices/scanner.png differ
diff --git a/icons/oxygen/16x16/devices/video-display.png b/icons/oxygen/16x16/devices/video-display.png
new file mode 100644 (file)
index 0000000..10cd322
Binary files /dev/null and b/icons/oxygen/16x16/devices/video-display.png differ
diff --git a/icons/oxygen/16x16/devices/video-projector.png b/icons/oxygen/16x16/devices/video-projector.png
new file mode 100644 (file)
index 0000000..cb2be22
Binary files /dev/null and b/icons/oxygen/16x16/devices/video-projector.png differ
diff --git a/icons/oxygen/16x16/devices/video-television.png b/icons/oxygen/16x16/devices/video-television.png
new file mode 100644 (file)
index 0000000..930c21c
Binary files /dev/null and b/icons/oxygen/16x16/devices/video-television.png differ
index 50819f5..fc41ec1 100644 (file)
@@ -15,6 +15,16 @@ if(WANT_QTCLIENT OR WANT_MONO)
   include_directories(qtui)
 endif(WANT_QTCLIENT OR WANT_MONO)
 
+if(QUASSEL_ICONS MATCHES "Builtin")
+  qt4_add_resources(RC_ICONS ../icons/hicolor.qrc)
+endif(QUASSEL_ICONS MATCHES "Builtin")
+
+if(OXYGEN_ICONS MATCHES "Builtin")
+  qt4_add_resources(RC_ICONS ../icons/oxygen.qrc)
+endif(OXYGEN_ICONS MATCHES "Builtin")
+
+set(CLIENT_DEPS ${CLIENT_DEPS} ${RC_ICONS})
+
 if(WANT_CORE)
   setup_qt4_variables(NETWORK SCRIPT SQL)
   add_executable(quasselcore common/main.cpp ${COMMON_DEPS} ${CORE_DEPS})
index 1ecc896..2584a94 100644 (file)
@@ -48,6 +48,8 @@ bool Quassel::_initialized = false;
 bool Quassel::DEBUG = false;
 
 Quassel::Quassel() {
+  Q_INIT_RESOURCE(i18n);
+
   // We catch SIGTERM and SIGINT (caused by Ctrl+C) to graceful shutdown Quassel.
   signal(SIGTERM, handleSignal);
   signal(SIGINT, handleSignal);
index d2363e6..a862858 100644 (file)
@@ -36,7 +36,7 @@
 #include "clientbacklogmanager.h"
 #include "coreinfodlg.h"
 #include "coreconnectdlg.h"
-#include "icon.h"
+#include "iconloader.h"
 #include "msgprocessorstatuswidget.h"
 #include "qtuimessageprocessor.h"
 #include "qtuiapplication.h"
@@ -80,9 +80,9 @@ MainWin::MainWin(QWidget *parent)
     _titleSetter(this),
     systray(new QSystemTrayIcon(this)),
 
-    activeTrayIcon(":/icons/quassel-icon-active.png"),
-    onlineTrayIcon(":/icons/quassel-icon.png"),
-    offlineTrayIcon(":/icons/quassel-icon-offline.png"),
+    activeTrayIcon("quassel_newmessage"),
+    onlineTrayIcon("quassel"),
+    offlineTrayIcon("quassel_disconnected"),
     trayIconActive(false),
 
     timer(new QTimer(this)),
@@ -422,7 +422,7 @@ void MainWin::setConnectedState() {
   qApp->setWindowIcon(onlineTrayIcon);
   systray->setIcon(onlineTrayIcon);
   if(sslLabel->width() == 0)
-    sslLabel->setPixmap(QPixmap::fromImage(QImage(":/16x16/status/no-ssl")));
+    sslLabel->setPixmap(SmallIcon("security-low"));
 }
 
 void MainWin::loadLayout() {
@@ -444,7 +444,7 @@ void MainWin::updateLagIndicator(int lag) {
 
 void MainWin::securedConnection() {
   // todo: make status bar entry
-  sslLabel->setPixmap(QPixmap::fromImage(QImage(":/16x16/status/ssl")));
+  sslLabel->setPixmap(SmallIcon("security-high"));
 }
 
 void MainWin::disconnectedFromCore() {
@@ -736,13 +736,13 @@ void MainWin::clientNetworkUpdated() {
 
   switch(net->connectionState()) {
   case Network::Initialized:
-    action->setIcon(QIcon(":/16x16/actions/network-connect"));
+    action->setIcon(SmallIcon("network-connect"));
     break;
   case Network::Disconnected:
-    action->setIcon(QIcon(":/16x16/actions/network-disconnect"));
+    action->setIcon(SmallIcon("network-disconnect"));
     break;
   default:
-    action->setIcon(QIcon(":/16x16/actions/gear"));
+    action->setIcon(SmallIcon("network-wired"));
   }
 }
 
index ffa2ade..a562647 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "ui_mainwin.h"
 
+#include "icon.h"
 #include "qtui.h"
 #include "titlesetter.h"
 #include "sessionsettings.h"
@@ -137,9 +138,9 @@ class MainWin : public QMainWindow {
     void enableMenus();
 
     QSystemTrayIcon *systray;
-    QIcon activeTrayIcon;
-    QIcon onlineTrayIcon;
-    QIcon offlineTrayIcon;
+    Icon activeTrayIcon;
+    Icon onlineTrayIcon;
+    Icon offlineTrayIcon;
     bool trayIconActive;
     QTimer *timer;
 
index 80cc4d4..6ae09c9 100644 (file)
@@ -27,8 +27,6 @@
 #include "qtui.h"
 #include "sessionsettings.h"
 
-#include "iconloader.h"
-
 QtUiApplication::QtUiApplication(int &argc, char **argv) : QApplication(argc, argv), Quassel() {
   setRunMode(Quassel::ClientOnly);
 
@@ -48,9 +46,6 @@ bool QtUiApplication::init() {
     gui->init();
     resumeSessionIfPossible();
 
-    // DEBUG
-    QPixmap pix = IconLoader::global()->loadIcon("network-connect", IconLoader::Small);
-    qDebug() << pix;
     return true;
   }
   return false;
index 0fff1e8..688d0b1 100644 (file)
@@ -28,12 +28,16 @@ IconLoader IconLoader::_iconLoader;
 int IconLoader::_groupSize[] = { 48, 22, 22, 16, 32, 22 };  // default sizes taken from Oxygen
 
 IconLoader *IconLoader::global() {
+  // Workaround: the static _iconLoader might be initialized before the resources it needs
+  // This way, first call to global() will init it by setting the theme
+  if(_iconLoader.theme().isEmpty())
+    _iconLoader.setTheme("oxygen");
   return &_iconLoader;
 }
 
 IconLoader::IconLoader(QObject *parent) : QObject(parent) {
 
-  setTheme("oxygen");
+  // setTheme("oxygen");
 }
 
 IconLoader::~IconLoader() {
@@ -59,17 +63,25 @@ void IconLoader::setTheme(const QString &theme) {
   if(QFile::exists(path))
     _themedIconDirNames.append(path);
 
-  // Own icons in $data/apps/quassel/icons/hicolor and :/icons/hicolor
-  // Also, plain icon dirs $data/apps/quassel/pics and :/pics
-  dataDirNames.append(":");
+  // Own icons in $data/apps/quassel/icons/hicolor
+  // Also, plain icon dirs $data/apps/quassel/pics
   foreach(QString dir, dataDirNames) {
-    path = QString("%1/apps/quassel/icons/hicolor");
+    path = QString("%1/apps/quassel/icons/hicolor").arg(dir);
     if(QFile::exists(path))
       _themedIconDirNames.append(path);
-    path = QString("%1/apps/quassel/pics");
+    path = QString("%1/apps/quassel/pics").arg(dir);
     if(QFile::exists(path))
       _plainIconDirNames.append(path);
   }
+
+  // Same for :/icons/hicolor and :/pics
+  path = QString(":/icons/hicolor");
+  if(QFile::exists(path))
+    _themedIconDirNames.append(path);
+
+  path = QString(":/pics");
+  if(QFile::exists(path))
+    _plainIconDirNames.append(path);
 }
 
 // TODO: optionally implement cache (speed/memory tradeoff?)
@@ -110,3 +122,25 @@ QString IconLoader::findIconPath(const QString &name, int size) {
 
   return QString();
 }
+
+// Convenience constructors
+
+QPixmap DesktopIcon(const QString& name, int force_size) {
+  IconLoader *loader = IconLoader::global();
+  return loader->loadIcon(name, IconLoader::Desktop, force_size);
+}
+
+QPixmap BarIcon(const QString& name, int force_size) {
+  IconLoader *loader = IconLoader::global();
+  return loader->loadIcon(name, IconLoader::Toolbar, force_size);
+}
+
+QPixmap MainBarIcon(const QString& name, int force_size) {
+  IconLoader *loader = IconLoader::global();
+  return loader->loadIcon(name, IconLoader::MainToolbar, force_size);
+}
+
+QPixmap SmallIcon(const QString& name, int force_size) {
+  IconLoader *loader = IconLoader::global();
+  return loader->loadIcon(name, IconLoader::Small, force_size);
+}
index 165aa9b..c40dc57 100644 (file)
@@ -96,7 +96,7 @@ private:
 // convenience
 QPixmap DesktopIcon(const QString& name, int size = 0);
 QPixmap BarIcon(const QString& name, int size = 0);
-QPixmap MainbarIcon(const QString& name, int size = 0);
+QPixmap MainBarIcon(const QString& name, int size = 0);
 QPixmap SmallIcon(const QString& name, int size = 0);
 //QPixmap SmallMediumIcon(const QString &name, int size = 0);  // not part of KIconLoader