mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-25 07:57:20 +00:00
commit before merging
This commit is contained in:
parent
72782a40c2
commit
b983f4424e
@ -1,3 +1,6 @@
|
|||||||
|
Ver.1.0.4:
|
||||||
|
+ added Qt5 gui (by default)
|
||||||
|
|
||||||
Ver.1.0.3:
|
Ver.1.0.3:
|
||||||
+ [plasmoid] edited russian translation
|
+ [plasmoid] edited russian translation
|
||||||
* [all] refactoring
|
* [all] refactoring
|
||||||
|
@ -8,13 +8,14 @@ cmake_policy (SET CMP0015 NEW)
|
|||||||
project (netctl-gui)
|
project (netctl-gui)
|
||||||
set (PROJECT_VERSION_MAJOR 1)
|
set (PROJECT_VERSION_MAJOR 1)
|
||||||
set (PROJECT_VERSION_MINOR 0)
|
set (PROJECT_VERSION_MINOR 0)
|
||||||
set (PROJECT_VERSION_PATCH 3)
|
set (PROJECT_VERSION_PATCH 4)
|
||||||
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
||||||
configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||||
|
|
||||||
message (STATUS "Version: ${PROJECT_VERSION}")
|
message (STATUS "Version: ${PROJECT_VERSION}")
|
||||||
|
|
||||||
# install options
|
# install options
|
||||||
|
option (USE_QT5 "Use Qt5 instead of Qt4" ON)
|
||||||
option (BUILD_GUI "Build GUI" ON)
|
option (BUILD_GUI "Build GUI" ON)
|
||||||
option (BUILD_DATAENGINE "Build data engine" ON)
|
option (BUILD_DATAENGINE "Build data engine" ON)
|
||||||
option (BUILD_PLASMOID "Build plasmoid" ON)
|
option (BUILD_PLASMOID "Build plasmoid" ON)
|
||||||
@ -33,13 +34,12 @@ if (BUILD_PLASMOID)
|
|||||||
set (BUILD_DATAENGINE ON)
|
set (BUILD_DATAENGINE ON)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_subdirectory (icons)
|
|
||||||
if (BUILD_GUI)
|
if (BUILD_GUI)
|
||||||
add_subdirectory (gui)
|
add_subdirectory (gui)
|
||||||
endif ()
|
endif ()
|
||||||
# if (BUILD_DATAENGINE)
|
if (BUILD_DATAENGINE)
|
||||||
# add_subdirectory (dataengine)
|
add_subdirectory (dataengine)
|
||||||
# endif ()
|
endif ()
|
||||||
# if (BUILD_PLASMOID)
|
if (BUILD_PLASMOID)
|
||||||
# add_subdirectory (plasmoid)
|
add_subdirectory (plasmoid)
|
||||||
# endif ()
|
endif ()
|
||||||
|
@ -14,6 +14,7 @@ message (STATUS "${SUBPROJECT} Forms: ${FORMS}")
|
|||||||
# include_path
|
# include_path
|
||||||
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||||
|
|
||||||
|
if (USE_QT5)
|
||||||
find_package(Qt5Core REQUIRED)
|
find_package(Qt5Core REQUIRED)
|
||||||
find_package(Qt5Widgets REQUIRED)
|
find_package(Qt5Widgets REQUIRED)
|
||||||
find_package(Qt5LinguistTools REQUIRED)
|
find_package(Qt5LinguistTools REQUIRED)
|
||||||
@ -42,6 +43,31 @@ source_group ("Generated Files" FILES ${MOC_SOURCES})
|
|||||||
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
||||||
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS})
|
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS})
|
||||||
target_link_libraries (${SUBPROJECT} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES})
|
target_link_libraries (${SUBPROJECT} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES})
|
||||||
|
else ()
|
||||||
|
find_package (Qt4 REQUIRED)
|
||||||
|
include (${QT_USE_FILE})
|
||||||
|
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||||
|
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
||||||
|
qt4_add_resources (QRC_SOURCES ${RESOURCES})
|
||||||
|
|
||||||
|
foreach (LANGUAGE ${LANGUAGES})
|
||||||
|
set (TS ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
|
||||||
|
set (QM ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
|
||||||
|
set (TRANSLATIONS ${TRANSLATIONS} ${TS})
|
||||||
|
set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM})
|
||||||
|
add_custom_command (OUTPUT ${QM} COMMAND ${QT_LRELEASE_EXECUTABLE} ${TS} MAIN_DEPENDENCY ${TS})
|
||||||
|
endforeach ()
|
||||||
|
add_custom_target (translations COMMAND ${QT_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} ${UI_HEADERS} -ts ${TRANSLATIONS})
|
||||||
|
add_custom_command (TARGET translations COMMAND ${QT_LRELEASE_EXECUTABLE} ${TRANSLATIONS})
|
||||||
|
message (STATUS "${SUBPROJECT} Translations: ${TRANSLATIONS_BINARY}")
|
||||||
|
|
||||||
|
source_group ("Header Files" FILES ${HEADERS})
|
||||||
|
source_group ("Source Files" FILES ${SOURCES})
|
||||||
|
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
||||||
|
|
||||||
|
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS})
|
||||||
|
target_link_libraries (${SUBPROJECT} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
# install properties
|
# install properties
|
||||||
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
||||||
|
@ -224,7 +224,11 @@ void MainWindow::updateMainTab()
|
|||||||
|
|
||||||
ui->tableWidget_main->setSortingEnabled(true);
|
ui->tableWidget_main->setSortingEnabled(true);
|
||||||
ui->tableWidget_main->resizeRowsToContents();
|
ui->tableWidget_main->resizeRowsToContents();
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
ui->tableWidget_main->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
ui->tableWidget_main->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
#else
|
||||||
|
ui->tableWidget_main->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||||
|
#endif
|
||||||
ui->tabWidget->setEnabled(true);
|
ui->tabWidget->setEnabled(true);
|
||||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Updated"));
|
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Updated"));
|
||||||
|
|
||||||
@ -284,7 +288,11 @@ void MainWindow::updateWifiTab()
|
|||||||
|
|
||||||
ui->tableWidget_wifi->setSortingEnabled(true);
|
ui->tableWidget_wifi->setSortingEnabled(true);
|
||||||
ui->tableWidget_wifi->resizeRowsToContents();
|
ui->tableWidget_wifi->resizeRowsToContents();
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
ui->tableWidget_wifi->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
ui->tableWidget_wifi->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
#else
|
||||||
|
ui->tableWidget_wifi->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||||
|
#endif
|
||||||
ui->tabWidget->setEnabled(true);
|
ui->tabWidget->setEnabled(true);
|
||||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Updated"));
|
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Updated"));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user