Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ include(ECMSetupVersion)
include(GenerateExportHeader)
option(ENABLE_CONFIG_QT "Enable fcitx5-config-qt" On)
option(ENABLE_TEST "Enable test" Off)
option(BUILD_UOS "Build for UOS (use UOS Sogou IM)" Off)
if (BUILD_UOS)
add_definitions(-DBUILD_UOS)
message(" >>> Build for UOS: Sogou IM = com.sogou.ime.ng.fcitx5.uos")
else()
message(" >>> Build for Deepin: Sogou IM = com.sogou.ime.ng.fcitx5.deepin")
endif()
add_definitions(-DTRANSLATION_DOMAIN=\"org.fcitx.fcitx5.kcm\")
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"deepin-fcitx5-configtool\")
add_definitions(-DQT_NO_KEYWORDS)
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Build-Depends:
libpolkit-qt6-1-dev,
pkg-config,
xkb-data,
lsb-release,
Standards-Version: 4.6.2
Rules-Requires-Root: no
Homepage: https://github.com/fcitx/fcitx5-configtool
Expand Down
5 changes: 4 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ $(eval $(call detect_qt_version))
%:
dh $@ --parallel

UOS_SYSTEM := $(shell lsb_release -i -s 2>/dev/null | grep -i uos | wc -l | tr -d ' ')

override_dh_auto_configure:
dh_auto_configure -- \
-DENABLE_KCM=Off \
-DCMAKE_BUILD_TYPE=Release \
-DQT_DIR=$(QT_DIR)
-DQT_DIR=$(QT_DIR) \
$(if $(filter 1,$(UOS_SYSTEM)),-DBUILD_UOS=ON,)

override_dh_auto_install:
dh_auto_install --destdir=debian/tmp
Expand Down
5 changes: 5 additions & 0 deletions src-old/src/dcc-module/imsettingwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@

DWIDGET_USE_NAMESPACE

#ifdef BUILD_UOS
const QString SOGOU_IM_UNIQUE_NAME = "com.sogou.ime.ng.fcitx5.uos";
const QString SOGOU_CONFIGURE_APP_ID = "com.sogou.ime.ng.fcitx5.uos.configurer";
#else
const QString SOGOU_IM_UNIQUE_NAME = "com.sogou.ime.ng.fcitx5.deepin";
const QString SOGOU_CONFIGURE_APP_ID = "com.sogou.ime.ng.fcitx5.deepin.configurer";
#endif

using namespace dcc_fcitx_configtool::widgets;

Expand Down
8 changes: 7 additions & 1 deletion src/dcc-fcitx5configtool/operation/fcitx5configtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ namespace deepin {
namespace fcitx5configtool {

static QString kFcitxConfigGlobalPath = "fcitx://config/global";
#ifdef BUILD_UOS
static const QString kSogouAddonUniqueName = "com.sogou.ime.ng.fcitx5.uos-addon";
static const QString kSogouIMUniqueName = "com.sogou.ime.ng.fcitx5.uos";
static const QString kSogouConfigureAppId = "com.sogou.ime.ng.fcitx5.uos.configurer";
#else
static const QString kSogouAddonUniqueName = "com.sogou.ime.ng.fcitx5.deepin-addon";
static const QString kSogouIMUniqueName = "com.sogou.ime.ng.fcitx5.deepin";
static const QString kSogouConfigureAppId = "sogou-ime-setting";
static const QString kSogouConfigureAppId = "com.sogou.ime.ng.fcitx5.deepin.configurer";
#endif

Fcitx5ConfigToolWorkerPrivate::Fcitx5ConfigToolWorkerPrivate(Fcitx5ConfigToolWorker *parent)
: QObject(parent), q(parent)
Expand Down
191 changes: 95 additions & 96 deletions src/dcc-fcitx5configtool/qml/DetailConfigItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,121 +65,120 @@ DccObject {
}
}

Loader {
active: !root.loading
asynchronous: true
sourceComponent: DccRepeater {
model: root.configOptions
delegate: Component {
DccObject {
parentName: containerItem.name
displayName: modelData.description
weight: root.weight + index + 1
pageType: DccObject.Editor
visible: headerItem.expanded
backgroundType: DccObject.Normal | DccObject.Hover
page: Loader {
height: 40
sourceComponent: {
switch (modelData.type) {
case "Boolean":
return booleanComponent
case "Integer":
return integerComponent
case "String":
return stringComponent
case "List|Key":
return keyComponent
case "Enum":
return enumComponent
default:
return null
}
// Must be a direct child of containerItem so DccManager can register it.
DccRepeater {
id: optionRepeater
visible: !root.loading
model: root.configOptions
delegate: Component {
DccObject {
parentName: containerItem.name
displayName: modelData.description
weight: root.weight + index + 1
pageType: DccObject.Editor
visible: headerItem.expanded
backgroundType: DccObject.Normal | DccObject.Hover
page: Loader {
height: 40
sourceComponent: {
switch (modelData.type) {
case "Boolean":
return booleanComponent
case "Integer":
return integerComponent
case "String":
return stringComponent
case "List|Key":
return keyComponent
case "Enum":
return enumComponent
default:
return null
}
}

Component {
id: booleanComponent
D.Switch {
checked: modelData.value === "True"
onCheckedChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
checked ? "True" : "False")
}
Component {
id: booleanComponent
D.Switch {
checked: modelData.value === "True"
onCheckedChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
checked ? "True" : "False")
}
}
}

Component {
id: integerComponent
D.SpinBox {
width: 55
implicitWidth: 55
value: parseInt(modelData.value)
onValueChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
value.toString())
}
Component {
id: integerComponent
D.SpinBox {
width: 55
implicitWidth: 55
value: parseInt(modelData.value)
onValueChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
value.toString())
}
}
}

Component {
id: stringComponent
D.TextField {
text: modelData.value
onTextChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
text)
}
Component {
id: stringComponent
D.TextField {
text: modelData.value
onTextChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
text)
}
}
}

Component {
id: keyComponent
KeySequenceDisplay {
placeholderText: qsTr("Please enter a new shortcut")
keys: modelData.value
background.visible: false
onFocusChanged: {
if (!focus) {
if (keys.length > 0) {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name + "/0",
keys, true)
} else if (root.keyName != modelData.name) {
keys = modelData.value
}
Component {
id: keyComponent
KeySequenceDisplay {
placeholderText: qsTr("Please enter a new shortcut")
keys: modelData.value
background.visible: false
onFocusChanged: {
if (!focus) {
if (keys.length > 0) {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name + "/0",
keys, true)
} else if (root.keyName != modelData.name) {
keys = modelData.value
}
}
onKeysChanged: {
root.keyName = modelData.name
}
}
onKeysChanged: {
root.keyName = modelData.name
}

Connections {
target: root
function onKeyNameChanged() {
if (root.keyName != modelData.name) {
focus = false
}
Connections {
target: root
function onKeyNameChanged() {
if (root.keyName != modelData.name) {
focus = false
}
}
}
}
}

Component {
id: enumComponent
D.ComboBox {
model: modelData.propertiesI18n
flat: true
currentIndex: modelData.properties.indexOf(
modelData.value) ? modelData.properties.indexOf(
modelData.value) : 0
onCurrentIndexChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
modelData.properties[currentIndex])
}
Component {
id: enumComponent
D.ComboBox {
model: modelData.propertiesI18n
flat: true
currentIndex: modelData.properties.indexOf(
modelData.value) ? modelData.properties.indexOf(
modelData.value) : 0
onCurrentIndexChanged: {
dccData.fcitx5ConfigProxy.setValue(
root.name + "/" + modelData.name,
modelData.properties[currentIndex])
}
}
}
Expand Down
Loading