gui: Adding a draft implementation for platform-dependent tray icon
Change-Id: Ib2b7eb7287f470a84e23301dbfc0b0399775cc56
diff --git a/gui/chronosharegui.cpp b/gui/chronosharegui.cpp
index 2901cdd..2ec6770 100644
--- a/gui/chronosharegui.cpp
+++ b/gui/chronosharegui.cpp
@@ -22,6 +22,7 @@
*/
#include "chronosharegui.h"
+#include "config.h"
#include "logging.h"
#include "ccnx-wrapper.h"
@@ -42,7 +43,8 @@
#else
static const string DOC_ROOT = ":/html";
#endif
-static const QString ICON_PICTURE_QSTRING(":/images/friends-group-icon.png");
+static const QString ICON_BIG_FILE(":/images/chronoshare-big.png");
+static const QString ICON_TRAY_FILE(":/images/" TRAY_ICON);
INIT_LOGGER ("Gui");
@@ -250,7 +252,7 @@
messageBox.setWindowTitle(title);
messageBox.setText(text);
- messageBox.setIconPixmap(QPixmap(ICON_PICTURE_QSTRING));
+ messageBox.setIconPixmap(QPixmap(ICON_BIG_FILE));
messageBox.exec();
}
@@ -262,7 +264,7 @@
messageBox.setText(text);
messageBox.setInformativeText(infotext);
- messageBox.setIconPixmap(QPixmap(ICON_PICTURE_QSTRING));
+ messageBox.setIconPixmap(QPixmap(ICON_BIG_FILE));
messageBox.exec();
}
@@ -402,7 +404,7 @@
void ChronoShareGui::setIcon()
{
// set the icon image
- m_trayIcon->setIcon(QIcon(ICON_PICTURE_QSTRING));
+ m_trayIcon->setIcon(QIcon(ICON_TRAY_FILE));
}
void ChronoShareGui::openSharedFolder()
diff --git a/gui/images.qrc b/gui/images.qrc
index 29a8104..0c4f852 100644
--- a/gui/images.qrc
+++ b/gui/images.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
- <file>images/friends-group-icon.png</file>
+ <file>images/chronoshare-big.png</file>
+ <file>images/chronoshare-ubuntu.png</file>
</qresource>
</RCC>
diff --git a/gui/images/friends-group-icon.png b/gui/images/chronoshare-big.png
similarity index 100%
rename from gui/images/friends-group-icon.png
rename to gui/images/chronoshare-big.png
Binary files differ
diff --git a/gui/images/chronoshare-ubuntu.png b/gui/images/chronoshare-ubuntu.png
new file mode 100644
index 0000000..cbf98d3
--- /dev/null
+++ b/gui/images/chronoshare-ubuntu.png
Binary files differ
diff --git a/wscript b/wscript
index c86104e..4e3b142 100644
--- a/wscript
+++ b/wscript
@@ -48,6 +48,10 @@
conf.check_cfg(package='libevent', args=['--cflags', '--libs'], uselib_store='LIBEVENT', mandatory=True)
conf.check_cfg(package='libevent_pthreads', args=['--cflags', '--libs'], uselib_store='LIBEVENT_PTHREADS', mandatory=True)
+ conf.define ("TRAY_ICON", "chronoshare-big.png")
+ if Utils.unversioned_sys_platform () == "linux":
+ conf.define ("TRAY_ICON", "chronoshare-ubuntu.png")
+
if Utils.unversioned_sys_platform () == "darwin":
conf.check_cxx(framework_name='Foundation', uselib_store='OSX_FOUNDATION', mandatory=False, compile_filename='test.mm')
conf.check_cxx(framework_name='AppKit', uselib_store='OSX_APPKIT', mandatory=False, compile_filename='test.mm')