Skip to content

Commit

Permalink
revisit UI and cmake build system
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Jun 24, 2024
1 parent a4598b5 commit 6bc3b51
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 106 deletions.
34 changes: 24 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,35 @@ set( CMAKE_CXX_STANDARD 14 )

option(BUILD_WITH_QT6 "Build with Qt 6" OFF)

if(BUILD_WITH_QT6)
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED )
else()
find_package(Qt5 COMPONENTS Core QUIET)
if(Qt5_FOUND)
set(BUILD_WITH_QT6 OFF)
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)
else()
find_package(Qt6 COMPONENTS Core QUIET)
if(Qt6_FOUND)
set(BUILD_WITH_QT6 ON)
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
else()
message( FATAL_ERROR "-- Failed to find Qt5 or Qt6")
endif()
endif()
endif()

set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF)

MESSAGE( STATUS "Setting C++ version to C++14" )
if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
message("Warning your cmake version is too old(<3.1.0) and code my not compile")
add_definitions(-std=c++14)
add_definitions(-std=c++14)
endif()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_definitions(-Qunused-arguments)
add_definitions(-Qunused-arguments)
endif()

include_directories( ${PROJECT_BINARY_DIR} )
Expand All @@ -47,9 +65,9 @@ INCLUDE(CMakeDependentOption)
INCLUDE(FindPkgConfig)

if( WIN32 )
add_definitions( -D_DEFAULT_SOURCE )
add_definitions( -D_DEFAULT_SOURCE )
else()
add_definitions( -D_DEFAULT_SOURCE -fstack-protector-all --param ssp-buffer-size=4 )
add_definitions( -D_DEFAULT_SOURCE -fstack-protector-all --param ssp-buffer-size=4 )
endif()

include_directories( ${PROJECT_BINARY_DIR} )
Expand Down Expand Up @@ -337,10 +355,6 @@ set( SRC src/dialogok.cpp
)

set( CMAKE_INCLUDE_CURRENT_DIR ON )
include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
include_directories( ${Qt5Network_INCLUDE_DIRS} )

add_definitions( ${Qt5Widgets_DEFINITIONS} )

INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${GCRYPT_INCLUDE_PATH} )
Expand Down Expand Up @@ -416,11 +430,11 @@ endif()

if(BUILD_WITH_QT6)
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "Building GUI components using Qt6" )
message( STATUS "Building using Qt6" )
message( STATUS "---------------------------------------------------------------------------\n\n" )
else()
message( STATUS "---------------------------------------------------------------------------" )
message( STATUS "Building GUI components using Qt5" )
message( STATUS "Building using Qt5" )
message( STATUS "---------------------------------------------------------------------------\n\n" )
endif()

Expand Down
116 changes: 20 additions & 96 deletions src/configoptions.ui
Original file line number Diff line number Diff line change
Expand Up @@ -57,51 +57,32 @@
<widget class="QCheckBox" name="cbHiDPI">
<property name="geometry">
<rect>
<x>270</x>
<x>100</x>
<y>80</y>
<width>31</width>
<width>181</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string/>
<string>Enable HiDPI Scalling</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEditHiDPI">
<property name="geometry">
<rect>
<x>270</x>
<x>102</x>
<y>130</y>
<width>113</width>
<width>101</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_19">
<property name="geometry">
<rect>
<x>20</x>
<y>80</y>
<width>241</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Enable HiDPI Scalling</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_18">
<property name="geometry">
<rect>
<x>20</x>
<x>210</x>
<y>110</y>
<width>241</width>
<width>311</width>
<height>61</height>
</rect>
</property>
Expand All @@ -110,7 +91,7 @@
(Enter A Decimal Number)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand All @@ -136,170 +117,113 @@
</property>
</widget>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>120</x>
<y>0</y>
<width>184</width>
<width>191</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="cbAutoOpenMountPoint">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Auto Open Mount Point</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget1">
<property name="geometry">
<rect>
<x>120</x>
<y>30</y>
<width>159</width>
<width>166</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="cbReUseMountPoint">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Re Use Mount Point</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget2">
<property name="geometry">
<rect>
<x>120</x>
<y>60</y>
<width>187</width>
<width>195</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="cbAutoCheckForUpdates">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Auto Check For Updates</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget3">
<property name="geometry">
<rect>
<x>120</x>
<y>90</y>
<width>133</width>
<width>141</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="cbStartMinimized">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Start Minimized</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget4">
<property name="geometry">
<rect>
<x>120</x>
<y>120</y>
<width>276</width>
<width>288</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="cbUseDarkTheme">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Use Dark Theme(Restarting Required)</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget5">
<property name="geometry">
<rect>
<x>120</x>
<y>150</y>
<width>243</width>
<width>252</width>
<height>26</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="chShowDebugWindowOnStartup">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Show Debug Window On Startup</string>
</property>
Expand Down

0 comments on commit 6bc3b51

Please sign in to comment.