Skip to content

Commit

Permalink
show icons in Qt6 + improve some UI elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Nov 13, 2024
1 parent 974fa71 commit 749930d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 68 deletions.
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ else()
endif()

if( BUILD_FLATPAK )
file( WRITE ${PROJECT_BINARY_DIR}/flatpak.h "\n#define FLATPAK 1\n" )
file( WRITE ${PROJECT_BINARY_DIR}/flatpak.h "\n#define FLATPAK 1\n" )
else()
file( WRITE ${PROJECT_BINARY_DIR}/flatpak.h "\n#define FLATPAK 0\n" )
file( WRITE ${PROJECT_BINARY_DIR}/flatpak.h "\n#define FLATPAK 0\n" )
endif()

#pkg_check_modules( MCHUNGU_TASK mhogomchungu_task )
Expand Down Expand Up @@ -282,8 +282,7 @@ set( UI_FILES src/sirikali.ui
src/engines/fscryptcreateoptions.ui
)

set( MOC_FILES
src/configoptions.h
set( MOC_FILES src/configoptions.h
src/configfileoption.h
src/dialogok.h
src/checkforupdates.h
Expand All @@ -310,7 +309,7 @@ set( MOC_FILES
src/engines/fscryptcreateoptions.h
)

set( SRC src/dialogok.cpp
set( SRC src/dialogok.cpp
src/main.cpp
src/systemsignalhandler.cpp
src/crypto.cpp
Expand Down Expand Up @@ -367,27 +366,30 @@ INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${GCRYPT_INCLUDE_PATH} )

if(BUILD_WITH_QT6)
set( CMAKE_AUTOMOC ON )

SET( TRAY_RC_SRCS "src/icon.qrc" )

set( CMAKE_AUTOMOC ON )
set( CMAKE_AUTORCC ON )
set( CMAKE_AUTOUIC ON )

if( APPLE )
add_executable( SiriKali MACOSX_BUNDLE ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} ${PROJECT_SOURCE_DIR}/icons/256x256/sirikali.icns )
add_executable( SiriKali MACOSX_BUNDLE ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} ${PROJECT_SOURCE_DIR}/icons/256x256/sirikali.icns )
set_target_properties( SiriKali PROPERTIES MACOSX_BUNDLE ON )

set_target_properties( SiriKali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
else()
if( WIN32 )
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/src/appicon.rc" )
if( WIN32 )
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/src/appicon.rc" )
add_executable( sirikali WIN32 ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} ${APP_ICON_RESOURCE_WINDOWS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -pedantic")
else()
add_executable( sirikali ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} )
add_executable( sirikali ${MOC_FILES} ${UI_FILES} ${SRC} ${TRAY_RC_SRCS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
endif()
endif()
else()
QT5_WRAP_UI( UI ${UI_FILES} )
QT5_WRAP_UI( UI ${UI_FILES} )
QT5_WRAP_CPP( MOC ${MOC_FILES} )
QT5_ADD_RESOURCES( TRAY_RC_SRCS src/icon.qrc )

Expand All @@ -396,7 +398,7 @@ else()
set_target_properties( SiriKali PROPERTIES MACOSX_BUNDLE ON )
set_target_properties( SiriKali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -fPIC -pedantic")
else()
if( WIN32 )
if( WIN32 )
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/src/appicon.rc" )
add_executable( sirikali WIN32 ${MOC} ${UI} ${SRC} ${TRAY_RC_SRCS} ${APP_ICON_RESOURCE_WINDOWS} )
set_target_properties( sirikali PROPERTIES COMPILE_FLAGS "-Wextra -Wall -s -pedantic")
Expand Down Expand Up @@ -612,7 +614,7 @@ endif()
set( OutputBaseFilename "SiriKali-${PGR_VERSION}.setup" )

if(OUTPUT_BASE_NAME)
set( OutputBaseFilename ${OUTPUT_BASE_NAME})
set( OutputBaseFilename ${OUTPUT_BASE_NAME})
endif()

if( WIN32 )
Expand Down
6 changes: 6 additions & 0 deletions src/checkforupdateswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ void checkforupdateswindow::downloading( Ctx& ctx,const utils::network::progress
auto m = tr( "Error" ) + "\n" + tr( "Download Failed" ) ;

this->tableUpdate( row,m ) ;

m_ui->pbOK->setEnabled( true ) ;
}

}else if( p.timeOut() ){
Expand All @@ -197,6 +199,8 @@ void checkforupdateswindow::downloading( Ctx& ctx,const utils::network::progress
auto m = tr( "Error" ) + "\n" + tr( "Network Timed Out" ) ;

this->tableUpdate( row,m ) ;

m_ui->pbOK->setEnabled( true ) ;
}else{
ctx.fileWrite( p.data() ) ;

Expand Down Expand Up @@ -359,6 +363,8 @@ void checkforupdateswindow::extract( Ctx ctx )
}() ;

this->tableUpdate( row,m + "\n" + mm ) ;

m_ui->pbOK->setEnabled( true ) ;
}else{
auto exePath = this->exePath( row ) ;

Expand Down
60 changes: 5 additions & 55 deletions src/favorites2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</rect>
</property>
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<widget class="QWidget" name="FavoritesList">
<attribute name="title">
Expand Down Expand Up @@ -1453,19 +1453,9 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="cbShowFavoriteListOnContextMenu">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>Show Favorite List On Context Menu(Restart Required)</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
Expand All @@ -1475,26 +1465,16 @@
<rect>
<x>191</x>
<y>170</y>
<width>311</width>
<width>401</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="cbAutoMountAtStartUp">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_27">
<property name="text">
<string>Auto Mount Favorites Volumes At Startup</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
Expand All @@ -1504,7 +1484,7 @@
<rect>
<x>191</x>
<y>210</y>
<width>344</width>
<width>401</width>
<height>26</height>
</rect>
</property>
Expand All @@ -1517,19 +1497,9 @@
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string>Auto Mount Favorites Volumes When Available</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
Expand All @@ -1539,26 +1509,16 @@
<rect>
<x>191</x>
<y>250</y>
<width>307</width>
<width>401</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="cbShowMountDialogWhenAutoMounting">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_25">
<property name="text">
<string>Show Mount Dialog When Auto Mounting</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
Expand All @@ -1568,26 +1528,16 @@
<rect>
<x>191</x>
<y>290</y>
<width>378</width>
<width>401</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="cbAllowExternalToolsToReadPasswords">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_26">
<property name="text">
<string>Allow External Tools To Get Passwords From Wallets</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
Expand Down

0 comments on commit 749930d

Please sign in to comment.