Permalink
Please sign in to comment.
Showing
with
1,352 additions
and 204 deletions.
- +77 −48 CMakeLists.txt
- +82 −43 config-tool/CMakeLists.txt
- +1 −1 config.h.in → config-tool/config_qt4.h.in
- +6 −0 config-tool/config_qt5.h.in
- +9 −0 config-tool/main.cpp
- +2 −1 config-tool/main.qrc
- +31 −8 config-tool/main_model.cpp
- +22 −7 config-tool/main_model.h
- +18 −5 config-tool/mainwindow.cpp
- +16 −3 config-tool/mainwindow.h
- +248 −0 config-tool/qt4_main.qml
- 0 config-tool/{main.qml → qt5_main.qml}
- +6 −0 config_qt4.h.in
- +6 −0 config_qt5.h.in
- +15 −2 main.cpp
- +28 −4 main_controller.cpp
- +14 −2 main_controller.h
- +47 −22 main_model.cpp
- +21 −4 main_model.h
- +38 −30 po/fcitx-qimpanel.pot
- +4 −2 qml.qrc
- +329 −0 qml/qt4_main.qml
- +260 −0 qml/qt4_sogou.qml
- 0 qml/{main.qml → qt5_main.qml}
- 0 qml/{sogou.qml → qt5_sogou.qml}
- +57 −16 system_tray_menu.cpp
- +4 −1 system_tray_menu.h
- +11 −5 toplevel.cpp
125
CMakeLists.txt
| @@ -1,51 +1,80 @@ | ||
| project(fcitx-qimpanel) | ||
| cmake_minimum_required(VERSION 2.8.6) | ||
| +option(QT_5 "This is a option for QT_5" ON) | ||
| +option(QT_4 "This is a option for QT_4" OFF) | ||
| +SET(CMAKE_C_FLAGS "-std=c++11 -g -O0 ${CMAKE_C_FLAGS} ${HARDENED_C_FLAGS}") | ||
| +SET(CMAKE_CXX_FLAGS "-std=c++11 -g -O0 ${CMAKE_CXX_FLAGS} ${HARDENED_C_FLAGS}") | ||
| +if(QT_5) | ||
| + find_package(Fcitx 4.2.7 REQUIRED) | ||
| + find_package(Qt5DBus REQUIRED) | ||
| + find_package(Qt5LinguistTools REQUIRED) | ||
| + find_package(Qt5Quick REQUIRED) | ||
| + find_package(Qt5QuickWidgets REQUIRED) | ||
| + find_package(Qt5Widgets REQUIRED) | ||
| -find_package(Fcitx 4.2.7 REQUIRED) | ||
| -find_package(Qt5DBus REQUIRED) | ||
| -find_package(Qt5LinguistTools REQUIRED) | ||
| -find_package(Qt5Quick REQUIRED) | ||
| -find_package(Qt5QuickWidgets REQUIRED) | ||
| -find_package(Qt5Widgets REQUIRED) | ||
| - | ||
| -include_directories( | ||
| - ${Qt5DBus_INCLUDE_DIRS} | ||
| - ${Qt5Quick_INCLUDE_DIRS} | ||
| - ${Qt5QuickWidgets_INCLUDE_DIRS} | ||
| - ${Qt5Widgets_INCLUDE_DIRS} | ||
| - ${CMAKE_CURRENT_BINARY_DIR} | ||
| - ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| - | ||
| -SET(fcitx-qimpanel_RCCS qml.qrc) | ||
| -set(fcitx-qimpanel_SRCS main.cpp main_controller.cpp toplevel.cpp | ||
| - main_model.cpp kimpanelagent.cpp candidate_word.cpp system_tray_menu.cpp | ||
| - my_action.cpp skin/skinbase.cpp skin/skinfcitx.cpp) | ||
| -QT5_ADD_DBUS_ADAPTOR(fcitx-qimpanel_SRCS | ||
| - org.kde.impanel.xml | ||
| - kimpanelagent.h | ||
| - PanelAgent) | ||
| - | ||
| -QT5_ADD_RESOURCES(fcitx-qimpanel_RCC_SRCS ${fcitx-qimpanel_RCCS}) | ||
| - | ||
| -configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) | ||
| - | ||
| -add_executable(fcitx-qimpanel ${fcitx-qimpanel_SRCS} ${fcitx-qimpanel_TRAN_SRCS} | ||
| - ${fcitx-qimpanel_RCC_SRCS}) | ||
| -set_target_properties(fcitx-qimpanel PROPERTIES AUTOMOC TRUE) | ||
| -target_link_libraries( | ||
| - fcitx-qimpanel | ||
| - fcitx-config | ||
| - fcitx-utils | ||
| - ${Qt5DBus_LIBRARIES} | ||
| - ${Qt5Quick_LIBRARIES} | ||
| - ${Qt5QuickWidgets_LIBRARIES} | ||
| - ${Qt5Widgets_LIBRARIES}) | ||
| - | ||
| -set(pkgbindir /usr/bin/) | ||
| -set(pkgdatadir /usr/share/fcitx-qimpanel) | ||
| -install(TARGETS fcitx-qimpanel RUNTIME DESTINATION ${pkgbindir}) | ||
| -install(FILES ${fcitx-qimpanel_TRAN_SRCS} DESTINATION ${pkgdatadir}) | ||
| - | ||
| -add_subdirectory(ubuntu-default-skin) | ||
| -add_subdirectory(config-tool) | ||
| -add_subdirectory(po) | ||
| + include_directories( | ||
| + ${Qt5DBus_INCLUDE_DIRS} | ||
| + ${Qt5Quick_INCLUDE_DIRS} | ||
| + ${Qt5QuickWidgets_INCLUDE_DIRS} | ||
| + ${Qt5Widgets_INCLUDE_DIRS} | ||
| + ${CMAKE_CURRENT_BINARY_DIR} | ||
| + ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| + | ||
| + configure_file(${PROJECT_SOURCE_DIR}/config_qt5.h.in ${PROJECT_BINARY_DIR}/config.h) | ||
| + | ||
| + SET(fcitx-qimpanel_RCCS qml.qrc) | ||
| + set(fcitx-qimpanel_SRCS main.cpp main_controller.cpp toplevel.cpp | ||
| + main_model.cpp kimpanelagent.cpp candidate_word.cpp system_tray_menu.cpp | ||
| + my_action.cpp skin/skinbase.cpp skin/skinfcitx.cpp) | ||
| + QT5_ADD_DBUS_ADAPTOR(fcitx-qimpanel_SRCS | ||
| + org.kde.impanel.xml | ||
| + kimpanelagent.h | ||
| + PanelAgent) | ||
| + | ||
| + QT5_ADD_RESOURCES(fcitx-qimpanel_RCC_SRCS ${fcitx-qimpanel_RCCS}) | ||
| + | ||
| + add_executable(fcitx-qimpanel ${fcitx-qimpanel_SRCS} ${fcitx-qimpanel_RCC_SRCS}) | ||
| + set_target_properties(fcitx-qimpanel PROPERTIES AUTOMOC TRUE) | ||
| + target_link_libraries( | ||
| + fcitx-qimpanel | ||
| + fcitx-config | ||
| + fcitx-utils | ||
| + ${Qt5DBus_LIBRARIES} | ||
| + ${Qt5Quick_LIBRARIES} | ||
| + ${Qt5QuickWidgets_LIBRARIES} | ||
| + ${Qt5Widgets_LIBRARIES}) | ||
| +endif() | ||
| +if(QT_4) | ||
| + find_package(Fcitx 4.2.7 REQUIRED) | ||
| + find_package(Qt4 REQUIRED) | ||
| + | ||
| + configure_file(${PROJECT_SOURCE_DIR}/config_qt4.h.in ${PROJECT_BINARY_DIR}/config.h) | ||
| + | ||
| + include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} | ||
| + ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| + | ||
| + SET(fcitx-qimpanel_RCCS qml.qrc) | ||
| + set(fcitx-qimpanel_SRCS main.cpp main_controller.cpp toplevel.cpp | ||
| + main_model.cpp kimpanelagent.cpp candidate_word.cpp system_tray_menu.cpp | ||
| + my_action.cpp skin/skinbase.cpp skin/skinfcitx.cpp) | ||
| + QT4_ADD_DBUS_ADAPTOR(fcitx-qimpanel_SRCS | ||
| + org.kde.impanel.xml | ||
| + kimpanelagent.h | ||
| + PanelAgent) | ||
| + | ||
| + QT4_ADD_RESOURCES(fcitx-qimpanel_RCC_SRCS ${fcitx-qimpanel_RCCS}) | ||
| + | ||
| + add_executable(fcitx-qimpanel ${fcitx-qimpanel_SRCS} ${fcitx-qimpanel_RCC_SRCS}) | ||
| + set_target_properties(fcitx-qimpanel PROPERTIES AUTOMOC TRUE) | ||
| + target_link_libraries(fcitx-qimpanel fcitx-config fcitx-utils | ||
| + ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} | ||
| + ${QT_QTDBUS_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}) | ||
| +endif() | ||
| + | ||
| + set(pkgbindir /usr/bin/) | ||
| + set(pkgdatadir /usr/share/fcitx-qimpanel) | ||
| + install(TARGETS fcitx-qimpanel RUNTIME DESTINATION ${pkgbindir}) | ||
| + | ||
| + add_subdirectory(ubuntu-default-skin) | ||
| + add_subdirectory(config-tool) | ||
| + add_subdirectory(po) |
| @@ -1,47 +1,86 @@ | ||
| project(fcitx-qimpanel-configtool) | ||
| cmake_minimum_required(VERSION 2.8.6) | ||
| - | ||
| +option(QT_5 "This is a option for QT_5" ON) | ||
| +option(QT_4 "This is a option for QT_4" OFF) | ||
| find_package(Fcitx 4.2.7 REQUIRED) | ||
| -find_package(Qt5DBus REQUIRED) | ||
| -find_package(Qt5LinguistTools REQUIRED) | ||
| -find_package(Qt5Quick REQUIRED) | ||
| -find_package(Qt5QuickWidgets REQUIRED) | ||
| - | ||
| -include_directories(BEFORE | ||
| - ${CMAKE_CURRENT_BINARY_DIR} | ||
| - ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| - | ||
| -SET(fcitx-qimpanel-configtool_RCCS main.qrc) | ||
| - | ||
| -set(fcitx-qimpanel-configtool_SRCS main.cpp | ||
| - mainwindow.cpp | ||
| - main_model.cpp | ||
| - candidate_word.cpp | ||
| - editingskindialog.cpp | ||
| - skin/skinbase.cpp | ||
| - skin/skinfcitx.cpp | ||
| - ) | ||
| -set(fcitx-qimpanel-configtool_FORMS mainwindow.ui | ||
| - editingskindialog.ui | ||
| - ) | ||
| - | ||
| -QT5_ADD_RESOURCES(fcitx-qimpanel-configtool_RCC_SRCS ${fcitx-qimpanel-configtool_RCCS}) | ||
| -QT5_WRAP_UI(helloworld_FORMS_HEADERS ${fcitx-qimpanel-configtool_FORMS}) | ||
| - | ||
| -add_executable(fcitx-qimpanel-configtool ${fcitx-qimpanel-configtool_SRCS} ${fcitx-qimpanel-configtool_TRAN_SRCS} | ||
| - ${fcitx-qimpanel-configtool_RCC_SRCS} ${fcitx-qimpanel-configtool_FORMS}) | ||
| -set_target_properties(fcitx-qimpanel-configtool PROPERTIES AUTOMOC TRUE) | ||
| - | ||
| -target_link_libraries( | ||
| - fcitx-qimpanel-configtool | ||
| - fcitx-utils | ||
| - ${Qt5DBus_LIBRARIES} | ||
| - ${Qt5Quick_LIBRARIES} | ||
| - ${Qt5QuickWidgets_LIBRARIES}) | ||
| -install(FILES fcitx_ubuntukylin.png DESTINATION /usr/share/pixmaps) | ||
| -install(FILES fcitx-qimpanel-configtool.desktop DESTINATION /usr/share/applications) | ||
| -set(pkgbindir /usr/bin/) | ||
| -set(pkgdatadir /usr/share/fcitx-qimpanel) | ||
| -install(TARGETS fcitx-qimpanel-configtool RUNTIME DESTINATION ${pkgbindir}) | ||
| -install(FILES ${fcitx-qimpanel-configtool_TRAN_SRCS} DESTINATION ${pkgdatadir}) | ||
| +if(QT_5) | ||
| + find_package(Qt5DBus REQUIRED) | ||
| + find_package(Qt5LinguistTools REQUIRED) | ||
| + find_package(Qt5Quick REQUIRED) | ||
| + find_package(Qt5QuickWidgets REQUIRED) | ||
| + | ||
| + configure_file(${PROJECT_SOURCE_DIR}/config_qt5.h.in ${PROJECT_BINARY_DIR}/config.h) | ||
| + | ||
| + include_directories(BEFORE | ||
| + ${CMAKE_CURRENT_BINARY_DIR} | ||
| + ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| + | ||
| + SET(fcitx-qimpanel-configtool_RCCS main.qrc) | ||
| + | ||
| + set(fcitx-qimpanel-configtool_SRCS main.cpp | ||
| + mainwindow.cpp | ||
| + main_model.cpp | ||
| + candidate_word.cpp | ||
| + editingskindialog.cpp | ||
| + skin/skinbase.cpp | ||
| + skin/skinfcitx.cpp | ||
| + ) | ||
| + set(fcitx-qimpanel-configtool_FORMS mainwindow.ui | ||
| + editingskindialog.ui | ||
| + ) | ||
| + | ||
| + QT5_ADD_RESOURCES(fcitx-qimpanel-configtool_RCC_SRCS ${fcitx-qimpanel-configtool_RCCS}) | ||
| + QT5_WRAP_UI(helloworld_FORMS_HEADERS ${fcitx-qimpanel-configtool_FORMS}) | ||
| + | ||
| + add_executable(fcitx-qimpanel-configtool ${fcitx-qimpanel-configtool_SRCS} ${fcitx-qimpanel-configtool_RCC_SRCS} ${fcitx-qimpanel-configtool_FORMS}) | ||
| + set_target_properties(fcitx-qimpanel-configtool PROPERTIES AUTOMOC TRUE) | ||
| + | ||
| + target_link_libraries( | ||
| + fcitx-qimpanel-configtool | ||
| + fcitx-utils | ||
| + ${Qt5DBus_LIBRARIES} | ||
| + ${Qt5Quick_LIBRARIES} | ||
| + ${Qt5QuickWidgets_LIBRARIES}) | ||
| + | ||
| +endif() | ||
| +if(QT_4) | ||
| + find_package(Qt4 REQUIRED) | ||
| + | ||
| + configure_file(${PROJECT_SOURCE_DIR}/config_qt4.h.in ${PROJECT_BINARY_DIR}/config.h) | ||
| + | ||
| + include_directories(BEFORE ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} | ||
| + ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| + | ||
| + SET(fcitx-qimpanel-configtool_RCCS main.qrc) | ||
| + | ||
| + set(fcitx-qimpanel-configtool_SRCS main.cpp | ||
| + mainwindow.cpp | ||
| + main_model.cpp | ||
| + candidate_word.cpp | ||
| + editingskindialog.cpp | ||
| + skin/skinbase.cpp | ||
| + skin/skinfcitx.cpp | ||
| + ) | ||
| + set(fcitx-qimpanel-configtool_FORMS mainwindow.ui | ||
| + editingskindialog.ui | ||
| + ) | ||
| + | ||
| + QT4_ADD_RESOURCES(fcitx-qimpanel-configtool_RCC_SRCS ${fcitx-qimpanel-configtool_RCCS}) | ||
| + QT4_WRAP_UI(helloworld_FORMS_HEADERS ${fcitx-qimpanel-configtool_FORMS}) | ||
| + | ||
| + add_executable(fcitx-qimpanel-configtool ${fcitx-qimpanel-configtool_SRCS} ${fcitx-qimpanel-configtool_RCC_SRCS} ${fcitx-qimpanel-configtool_FORMS}) | ||
| + set_target_properties(fcitx-qimpanel-configtool PROPERTIES AUTOMOC TRUE) | ||
| + target_link_libraries(fcitx-qimpanel-configtool fcitx-utils | ||
| + ${QT_QTCORE_LIBRARY} | ||
| + ${QT_QTGUI_LIBRARY} | ||
| + ${QT_QTDBUS_LIBRARY} | ||
| + ${QT_QTDECLARATIVE_LIBRARY} | ||
| + #${QT_QTNETWORK_LIBRARY} | ||
| + ) | ||
| +endif() | ||
| + install(FILES fcitx_ubuntukylin.png DESTINATION /usr/share/pixmaps) | ||
| + install(FILES fcitx-qimpanel-configtool.desktop DESTINATION /usr/share/applications) | ||
| + set(pkgbindir /usr/bin/) | ||
| + set(pkgdatadir /usr/share/fcitx-qimpanel) | ||
| + install(TARGETS fcitx-qimpanel-configtool RUNTIME DESTINATION ${pkgbindir}) |
| @@ -1,6 +1,6 @@ | ||
| #ifndef ___CONFIG_H___ | ||
| #define ___CONFIG_H___ | ||
| - | ||
| +#cmakedefine01 IS_QT_4 | ||
| #endif |
| @@ -0,0 +1,6 @@ | ||
| +#ifndef ___CONFIG_H___ | ||
| +#define ___CONFIG_H___ | ||
| + | ||
| +#cmakedefine01 IS_QT_5 | ||
| + | ||
| +#endif |
| @@ -1,5 +1,6 @@ | ||
| <RCC> | ||
| <qresource prefix="/new/prefix1"> | ||
| - <file>main.qml</file> | ||
| + <file>qt5_main.qml</file> | ||
| + <file>qt4_main.qml</file> | ||
| </qresource> | ||
| </RCC> |
Oops, something went wrong.
0 comments on commit
a64d64a