diff --git a/data/org.ukui.control-center.yaml b/data/org.ukui.control-center.yaml new file mode 100644 index 0000000..27052c6 --- /dev/null +++ b/data/org.ukui.control-center.yaml @@ -0,0 +1,337 @@ +control-center: + 2.0.0-0k0.0: + children: + apt: + children: + proxy: + keys: + enabled: + _type: b + default: 'false' + description: This key is used to control whether to open apt-proxy. + summary: Whether open + host: + _type: s + default: '' + description: The machine name to proxy APT through. + summary: APT proxy host name + port: + _type: i + default: '8080' + description: "The port on the machine defined by “/apt/proxy/host”\ + \ that you\n proxy through." + range: 0,65535 + summary: APT proxy port + desktop: + keys: + computer-icon-locking: + _type: b + default: 'true' + description: Whether lock computer icon on start menu or not. + summary: Lock computer icon on start menu + computer-icon-visible: + _type: b + default: 'true' + description: Whether show computer icon on desktop or not. + summary: Show computer icon on desktop + home-icon-visible: + _type: b + default: 'true' + description: Whether show home icon on desktop or not. + summary: Show home icon on desktop + menufull-screen: + _type: b + default: 'false' + description: Whether to always use the start menu in full screen. + summary: menufull-screen switch button + network-icon-visible: + _type: b + default: 'true' + description: Whether show network icon on desktop or not. + summary: Show network icon on desktop + personal-icon-locking: + _type: b + default: 'false' + description: Whether personal icon on start menu or not. + summary: Lock personal icon on start menu + settings-icon-locking: + _type: b + default: 'true' + description: Whether lock settings icon on start menu or not. + summary: Lock settings icon on start menu + trash-icon-locking: + _type: b + default: 'false' + description: Whether lock trash icon on start menu or not. + summary: Lock trash icon on start menu + trash-icon-visible: + _type: b + default: 'true' + description: Whether show trash icon on desktop or not. + summary: Show trash icon on desktop + volumes-visible: + _type: b + default: 'true' + description: Whether show volumes icon on desktop or not. + summary: Show volumes icon on desktop + enum_org.ukui.control-center.noticeorigin.Type: + - nick: none + value: '0' + - nick: corner + value: '1' + - nick: all + value: '2' + experienceplan: + keys: + join: + _type: b + default: 'true' + description: Whether this plugin would be activated by ukui-settings-daemon + or not + summary: join user experience plan + keybinding: + keys: + action: + _type: s + default: '' + description: Command associated with a custom keybinding. + summary: Command + binding: + _type: s + default: '' + description: Keybinding associated with a custom shortcut. + summary: Keybinding + name: + _type: s + default: '' + description: Description associated with a custom keybinding. + summary: Name + keyboard: {} + notice: + keys: + blacklist: + _type: as + default: '[]' + description: Hidden DektopList + summary: '' + enable-notice: + _type: b + default: 'true' + description: Whether an OSD notification is shown to notify about changes + summary: Show OSD notification + iscn-env: + _type: b + default: 'true' + description: Determine whether the environment is Chinese + summary: '' + show-new-feature: + _type: b + default: 'true' + description: Whether this plugin would be activated by ukui-settings-daemon + or not + summary: Activation of this plugin + show-on-lockscreen: + _type: b + default: 'true' + description: Binding to eject an optical disc. + summary: Eject + noticeorigin: + keys: + maximize: + _type: i + default: '3' + description: The maximize num of messages on notice window. + summary: maximize num of messages + messages: + _type: b + default: 'true' + description: . + summary: messages notice + name-cn: + _type: s + default: '' + description: The name passed to the sidebar + summary: app's name + name-us: + _type: s + default: '' + description: The name passed to the sidebar + summary: app's name + notification-style: + _type: s + default: mutative + description: 'Select the notification style. Supported values are "none", + + "mutative","always". + + + If this is "none", notifications don''t show up on the screen, + + but go to the notification center + + + If this is "mutative", show on the upper right corner of the screen, + + it will disappear automatically. + + + If this is "always", remain on the screen until turned off.' + summary: The display style of the notification + show-detail: + _type: b + default: 'false' + description: Whether the notification show detail on screenlock + summary: '' + show-on-screenlock: + _type: b + default: 'false' + description: Whether the notification show on screenlock + summary: '' + type: + _type: enum + default: corner + description: the type of notice in system. + range: '@enum_org.ukui.control-center.noticeorigin.Type' + summary: type of notice message + voice: + _type: b + default: 'true' + description: . + summary: voice notice + osd: + keys: + show-lock-tip: + _type: b + default: 'true' + description: show keyboard tip or not. eg. Caps Lock. Num Lock + summary: show keyboard tip + panel: + children: + plugins: + keys: + calendar: + _type: s + default: lunar + description: calendar system used in UKUI Desktop Environment ,ontrol + by ukui-panel and ukui-control-center + summary: Lunar calendar + date: + _type: s + default: cn + description: date format + summary: date formate + firstday: + _type: s + default: monday + description: Select the first day of the week + summary: first of week + gammaforbrightness: + _type: b + default: 'false' + description: '' + summary: Modify brightness by gamma + hoursystem: + _type: s + default: '24' + description: hoursystem used in UKUI Desktop Environment ,ontrol by + ukui-panel and ukui-control-center + summary: HourSystem status + nightmodestatus: + _type: b + default: 'false' + description: '' + summary: ukui-control-center sets the night mode status so that ukui-panel + can get the status + ntp: + _type: s + default: '' + description: user-defined ntp server address + summary: customize ntp server address + showlanguage: + _type: as + default: '[]' + description: show language in plugin area + summary: show language in plugin area + synctime: + _type: b + default: 'true' + description: '' + summary: sync time from network + themebynight: + _type: b + default: 'false' + description: '' + summary: ukui-control-center theme changes follow with the night + mode + time: + _type: s + default: '24' + description: Select the first day of the week + summary: first of week + timezones: + _type: as + default: '[]' + description: other time zones + summary: all time zones of time display + personalise: + keys: + blurry: + _type: i + default: '3' + description: 1- Low effect;2-Middle effect;3-High effect + summary: Control the frosted glass effect of the component + custompower: + _type: b + default: 'false' + description: Used to determine that the control panel user has customized + a power plan + summary: Whether to customize the power plan + effect: + _type: b + default: 'true' + description: 'ture:Special effects open; false: Special effects off' + summary: Control panel special effects transmit signal + save-transparency: + _type: i + default: '100' + description: Save the transparency before the special effects mode is + turned off + summary: Save the transparency before the special effects mode is turned + off + transparency: + _type: d + default: '0.65' + description: Control the transparency of all components + summary: Control the transparency of all components + plugins: + keys: + plugin-name: + _type: s + default: '' + description: the name to match status + summary: plugin's name + show: + _type: b + default: 'true' + description: . + summary: whether the plugin's status + pluginstatus: {} + wifi: + children: + switch: + keys: + switch: + _type: b + default: 'true' + description: wifi switch + summary: wifi switch + switchor: + _type: b + default: 'true' + description: wifi switch of kylin network manager + summary: wifi switchor + wificard: + _type: b + default: 'true' + description: Determine if the wireless network card is inserted + summary: Wireless network card diff --git a/debian/ukui-control-center.install b/debian/ukui-control-center.install index 84c0d84..7ce2ec1 100644 --- a/debian/ukui-control-center.install +++ b/debian/ukui-control-center.install @@ -18,4 +18,5 @@ usr/share/ukui-control-center/shell/res/i18n/* usr/share/ukui-control-center/shell/res/* usr/lib/*/ukui-control-center/*.so usr/share/ukui-control-center/data/* -/usr/share/protocol/* +usr/share/protocol/* +etc/kylin-config/basic/* diff --git a/plugins/personalized/theme/theme.cpp b/plugins/personalized/theme/theme.cpp index 0d2717d..5bd651b 100644 --- a/plugins/personalized/theme/theme.cpp +++ b/plugins/personalized/theme/theme.cpp @@ -247,7 +247,7 @@ void Theme::initSearchText() { mThemeModeLabel->setText(tr("Window Theme")); //~ contents_path /Theme/Icon theme mThemeIconLabel->setText(tr("Icon theme")); - if (mThemeCursorLabel) { + if (mThemeCursorLabel != nullptr) { //~ contents_path /Theme/Cursor theme mThemeCursorLabel->setText(tr("Cursor theme")); } @@ -294,7 +294,7 @@ void Theme::setupSettings() { if (xder == kXder || kwinOG || !kwinEN) { mEffectGroup->setVisible(false); mEffectLabel->setVisible(false); - personliseGsettings->set(PERSONALSIE_EFFECT_KEY, false); + setEffectStatus(false); } else { } kwinSettings->endGroup(); @@ -866,17 +866,6 @@ void Theme::setThemeBtnStatus() } } -QFrame *Theme::setLine(QFrame *frame) -{ - QFrame *line = new QFrame(frame); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - return line; -} - QStringList Theme::readFile(QString filepath) { QStringList fileCont; QFile file(filepath); @@ -914,6 +903,10 @@ void Theme::setupGSettings() { personliseGsettings = new QGSettings(iiid, QByteArray(), this); mMateBgSettings = new QGSettings(bgID, QByteArray(), this); +#ifdef Nile + mKySettings = kdk_conf2_new("control-center.personalise", NULL); +#endif + if (QGSettings::isSchemaInstalled(autoID)) { mAutoSettings = new QGSettings(autoID, QByteArray(), this); } @@ -924,6 +917,15 @@ void Theme::setupGSettings() { } } +void Theme::setEffectStatus(bool status) +{ +#ifdef Nile + kdk_conf2_set_boolean(mKySettings, "effect", status); +#else + personliseGsettings->set(PERSONALSIE_EFFECT_KEY, false); +#endif +} + void Theme::kwinCursorSlot(QString value) { QString filename = QDir::homePath() + "/.config/kcminputrc"; @@ -1322,7 +1324,7 @@ void Theme::changeEffectSlot(bool checked) writeKwinSettings(checked); } // 提供给外部监听特效接口 - personliseGsettings->set(PERSONALSIE_EFFECT_KEY, checked); + setEffectStatus(checked); mTranWidget->setVisible(checked && !UkccCommon::isTablet()); mCornerWidget->setVisible(checked && !UkccCommon::isTablet()); } diff --git a/plugins/personalized/theme/theme.h b/plugins/personalized/theme/theme.h index 842d629..0f33dc7 100644 --- a/plugins/personalized/theme/theme.h +++ b/plugins/personalized/theme/theme.h @@ -34,6 +34,9 @@ #include #include +#ifdef Nile +#include +#endif #include "uslider.h" #include "titlelabel.h" @@ -100,7 +103,7 @@ private: TitleLabel *mJumpLabel; TitleLabel *mThemeModeLabel; TitleLabel *mThemeIconLabel; - TitleLabel *mThemeCursorLabel; + TitleLabel *mThemeCursorLabel = nullptr; TitleLabel *mEffectLabel; ThemeButton *mCustomPicUnit = nullptr; @@ -142,7 +145,11 @@ private: SettingGroup *mEffectGroup = nullptr; SwitchWidget *mEffectWidget = nullptr; SliderWidget *mTranWidget = nullptr; - ComboxWidget *mCornerWidget = nullptr; + ComboxWidget *mCornerWidget = nullptr; + +#ifdef Nile + KSettings *mKySettings = nullptr; +#endif public: Theme(); @@ -180,8 +187,6 @@ public: QStringList getSystemCursorThemes(); void setThemeBtnStatus(); - QFrame *setLine(QFrame *frame); - QString mGlobalName; bool mIsUpgrade = false; @@ -192,6 +197,7 @@ private: int tranConvertToSlider(const double value); QStringList readFile(QString filepath); void setupGSettings(); + void setEffectStatus(bool status); void kwinCursorSlot(QString value); QString dullCursorTranslation(QString str); diff --git a/plugins/personalized/theme/theme.pro b/plugins/personalized/theme/theme.pro index 67cae16..68b8692 100644 --- a/plugins/personalized/theme/theme.pro +++ b/plugins/personalized/theme/theme.pro @@ -21,8 +21,12 @@ DESTDIR = ../.. target.path = $${PLUGIN_INSTALL_DIRS} INSTALLS += target -INCLUDEPATH += \ - $$PROJECT_ROOTDIR \ +INCLUDEPATH += $$PROJECT_ROOTDIR \ + +if(contains(DEFINES, Nile)){ +INCLUDEPATH += /usr/include/kysdk/kysdk-base +LIBS += -lkyconf2 +} LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt -lX11 -lXfixes -lXcursor diff --git a/shell/shell.pro b/shell/shell.pro index 837383a..bb5158e 100644 --- a/shell/shell.pro +++ b/shell/shell.pro @@ -29,7 +29,6 @@ LIBS += -L$$[QT_INSTALL_LIBS] -lX11 -lgsettings-qt -ldconf !contains(QMAKE_HOST.arch, sw_64){ LIBS += -L$$[QT_INSTALL_LIBS] -lukui-log4qt } -DEFINES+= KYDEBUG ##加载gio库和gio-unix库,用于处理desktop文件 CONFIG += link_pkgconfig \ @@ -43,6 +42,9 @@ PKGCONFIG += gio-2.0 \ kysdk-qtwidgets \ kysdk-waylandhelper +DBUS_ADAPTORS += $$PROJECT_ROOTDIR/data/org.ukui.ukcc.search.xml +DBUS_INTERFACES += $$PROJECT_ROOTDIR/data/org.ukui.ukcc.search.xml + desktop.files += ukui-control-center.desktop desktop.path = /usr/share/applications @@ -70,12 +72,18 @@ imageformats.path = /usr/share/kylin-user-guide/data/guide/ukui-control-center/ target.source += $$TARGET target.path = /usr/bin +search.files += $$PROJECT_ROOTDIR/data/org.ukui.ukcc.search.service +search.path = /usr/share/dbus-1/services/ + modules.files += $$PROJECT_ROOTDIR/data/ukui-control-center-config.json modules.path += /usr/share/ukui-control-center/data/ protocol.files += $$PROJECT_ROOTDIR/data/*.txt protocol.path += /usr/share/protocol/ +ukccYaml.files += $$PROJECT_ROOTDIR/data/*.yaml +ukccYaml.path += /etc/kylin-config/basic/ + INSTALLS += \ target \ desktop \ @@ -87,7 +95,9 @@ INSTALLS += \ imageformats \ guideEN \ modules \ - protocol + protocol \ + search \ + ukccYaml \ INCLUDEPATH += qtsingleapplication \ /usr/include/dconf @@ -112,6 +122,7 @@ SOURCES += \ searchwidget.cpp \ titlewidget.cpp \ ukccabout.cpp \ + ukccsearchserver.cpp \ component/leftwidgetitem.cpp \ qtsingleapplication/qtsingleapplication.cpp \ qtsingleapplication/qtlocalpeer.cpp \ @@ -139,6 +150,7 @@ HEADERS += \ searchwidget.h \ titlewidget.h \ ukccabout.h \ + ukccsearchserver.h \ component/leftwidgetitem.h \ qtsingleapplication/qtsingleapplication_copy.h \ qtsingleapplication/qtsingleapplication.h \