Added Windows icon.

Use a 16x16 tray icon under Windows.
Fix disk space funcion under Windows.
This commit is contained in:
codestation
2013-09-16 00:46:43 -04:30
parent 6d432bfafb
commit 092e0d9aa0
6 changed files with 11 additions and 2 deletions

View File

@@ -129,7 +129,11 @@ void MainWidget::createTrayIcon()
trayIcon = new QSystemTrayIcon(this); trayIcon = new QSystemTrayIcon(this);
trayIcon->setContextMenu(trayIconMenu); trayIcon->setContextMenu(trayIconMenu);
#ifndef Q_OS_WIN32
trayIcon->setIcon(QIcon(":/main/resources/psv_icon.png")); trayIcon->setIcon(QIcon(":/main/resources/psv_icon.png"));
#else
trayIcon->setIcon(QIcon(":/main/resources/psv_icon_16.png"));
#endif
trayIcon->show(); trayIcon->show();
// try to avoid the iconTray Qt bug // try to avoid the iconTray Qt bug
Sleeper::sleep(1); Sleeper::sleep(1);

View File

@@ -67,7 +67,8 @@ OTHER_FILES += \
resources/psp2-updatelist.xml \ resources/psp2-updatelist.xml \
resources/psv_icon.png \ resources/psv_icon.png \
README.md \ README.md \
qcma.desktop qcma.desktop \
qcma.rc
FORMS += \ FORMS += \
configwidget.ui \ configwidget.ui \
@@ -96,3 +97,5 @@ unix {
target.path = $$BINDIR target.path = $$BINDIR
INSTALLS += target desktop icon64 INSTALLS += target desktop icon64
} }
win32:RC_FILE = qcma.rc

1
qcma.rc Normal file
View File

@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "resources/qcma.ico"

View File

@@ -3,5 +3,6 @@
<file>resources/psp2-updatelist.xml</file> <file>resources/psp2-updatelist.xml</file>
<file>resources/psv_icon.png</file> <file>resources/psv_icon.png</file>
<file>resources/translations/qcma.es.qm</file> <file>resources/translations/qcma.es.qm</file>
<file>resources/psv_icon_16.png</file>
</qresource> </qresource>
</RCC> </RCC>

BIN
resources/psv_icon_16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

View File

@@ -35,7 +35,7 @@ bool getDiskSpace(const QString &dir, quint64 *free, quint64 *total)
{ {
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
if(GetDiskFreeSpaceExW(dir.toStdWString().c_str(), free, total, NULL) != 0) { if(GetDiskFreeSpaceEx(dir.toStdWString().c_str(), (ULARGE_INTEGER *)free, (ULARGE_INTEGER *)total, NULL) != 0) {
return true; return true;
} }