Skip to content

Commit

Permalink
Merge pull request #63 from BitHaru/master
Browse files Browse the repository at this point in the history
add logo
  • Loading branch information
BitHaru committed Jun 22, 2020
2 parents 5964f11 + 452873d commit ac1817f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ if (RAI_GUI)
WriteRegStr HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Raicoin\\\\Raicoin' 'EventMessageFile' '$INSTDIR\\\\rai_wallet.exe'")
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "DeleteRegKey HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Raicoin'")
set (CPACK_PACKAGE_INSTALL_DIRECTORY "raicoin")
set (CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/Raicoin.ico)
set (CPACK_NSIS_DISPLAY_NAME "Raicoin")
set (CPACK_PACKAGE_NAME "raicoin-wallet")
set (CPACK_NSIS_PACKAGE_NAME "Raicoin")
Expand Down
5 changes: 5 additions & 0 deletions rai/rai_wallet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
if (WIN32)
set (PLATFORM_GUI_TARGET_PROPERTIES WIN32)
set (PLATFORM_WALLET_SOURCE plat/windows/icon.cpp ../../Raicoin.rc)
else (WIN32)
set (PLATFORM_GUI_TARGET_PROPERTIES "")
endif (WIN32)

#qt5_add_resources(RES resources.qrc)

add_executable (rai_wallet
${PLATFORM_GUI_TARGET_PROPERTIES}
${PLATFORM_WALLET_SOURCE}
${RES}
qt.hpp
qt.cpp
entry.cpp)
Expand Down
2 changes: 2 additions & 0 deletions rai/rai_wallet/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <iostream>
#include <rai/secure/util.hpp>
#include <rai/rai_wallet/qt.hpp>
#include <rai/rai_wallet/icon.hpp>
#include <rai/wallet/config.hpp>

namespace
Expand Down Expand Up @@ -137,6 +138,7 @@ int main(int argc, char* const* argv)
return 1;
}

rai::SetAppIcon(application);
rai::ErrorCode error_code = Run(application, data_path);
if (rai::ErrorCode::SUCCESS != error_code)
{
Expand Down
7 changes: 7 additions & 0 deletions rai/rai_wallet/icon.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

class QApplication;
namespace rai
{
void SetAppIcon(QApplication&);
}
14 changes: 14 additions & 0 deletions rai/rai_wallet/plat/windows/icon.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <rai/rai_wallet/icon.hpp>

#include <QApplication>
#include <QtGui>
#include <qwinfunctions.h>

void rai::SetAppIcon(QApplication& app)
{
HICON hIcon = static_cast<HICON>(
LoadImage(GetModuleHandle(nullptr), MAKEINTRESOURCE(1), IMAGE_ICON, 0,
0, LR_DEFAULTSIZE | LR_LOADTRANSPARENT));
app.setWindowIcon(QIcon(QtWin::fromHICON(hIcon)));
DestroyIcon(hIcon);
}
1 change: 1 addition & 0 deletions rai/rai_wallet/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ void rai::QtSend::Start(const std::weak_ptr<rai::QtMain>& qt_main_w)
{
qt_main.send_.amount_->clear();
qt_main.send_.destination_->clear();
qt_main.send_.note_->clear();
qt_main.send_.send_->setEnabled(true);
}
else
Expand Down

0 comments on commit ac1817f

Please sign in to comment.