Skip to content

Commit

Permalink
Add GUI config tool on path addon/rime/custom_config
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 committed Oct 31, 2020
1 parent e20996d commit 9f0cbf2
Show file tree
Hide file tree
Showing 19 changed files with 2,101 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ add_definitions(-DFCITX_RIME_VERSION=\"${PROJECT_VERSION}\")

include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")

option(ENABLE_GUI "Build Fcitx5 Rime Config GUI Tool" ON)

add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(data)
if(ENABLE_GUI)
add_subdirectory(gui)
endif()
4 changes: 4 additions & 0 deletions Messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ source_files=$(find . -name \*.cpp -o -name \*.h)
$XGETTEXT --keyword=_ --keyword=N_ --language=C++ -o ${POT_FILE} $source_files
desktop_files=$(find . -name \*.conf.in -o -name \*.conf.in.in -o -name \*.desktop.in)
$XGETTEXT --language=Desktop -k --keyword=Name --keyword=GenericName --keyword=Comment --keyword=Keywords $desktop_files -j -o ${POT_FILE}
ui_files=$(find . -name \*.ui)
extractrc $ui_files > rc.cpp
$XGETTEXT --kde --language=C++ --add-comments --sort-output -j -o ${POT_FILE} rc.cpp
rm -f rc.cpp

sed -i 's|^"Content-Type: text/plain; charset=CHARSET\\n"|"Content-Type: text/plain; charset=utf-8\\n"|g' ${POT_FILE}

Expand Down
41 changes: 41 additions & 0 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
set(REQUIRED_QT5_VERSION 5.7)

find_package(Qt5 ${REQUIRED_QT5_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets Concurrent)
find_package(Fcitx5Qt5WidgetsAddons REQUIRED)

set(RIME_CONFIG_SRCS
Main.cpp
ConfigMain.cpp
Model.cpp
RimeConfigParser.cpp
ErrorOverlay.cpp
keylistwidget.cpp)

set(RIME_CONFIG_HDRS
Main.h
ConfigMain.h
Model.h
Common.h
RimeConfigParser.h
ErrorOverlay.h
keylistwidget.h)

add_library(rime-config
MODULE ${RIME_CONFIG_SRCS})

target_include_directories(rime-config PRIVATE ${PROJECT_SOURCE_DIR}/gui)

set_target_properties(rime-config PROPERTIES
LINK_FLAGS "-Wl,--no-undefined"
AUTOMOC TRUE
AUTOUIC TRUE
AUTOUIC_OPTIONS "-tr=fcitx::tr2fcitx;--include=fcitxqti18nhelper.h")

target_link_libraries(rime-config
Qt5::Widgets
Qt5::Concurrent
Fcitx5::Core
Fcitx5Qt5::WidgetsAddons
PkgConfig::Rime)

install(TARGETS rime-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/fcitx5/qt5)
Loading

0 comments on commit 9f0cbf2

Please sign in to comment.