diff --git a/0001-fix-translate-add-some-translation.patch b/0001-fix-translate-add-some-translation.patch index af2c24579887f49efe71d47853fb949f641e6734..b21462e6760b3c85eeb272e8b72e55f495c83dc0 100644 --- a/0001-fix-translate-add-some-translation.patch +++ b/0001-fix-translate-add-some-translation.patch @@ -1,7 +1,7 @@ From e2344f8e42bdf83d99062f03e44b6ec719af1487 Mon Sep 17 00:00:00 2001 From: wangyucheng Date: Mon, 27 Mar 2023 16:56:40 +0800 -Subject: [PATCH] fix(translate):add some translation +Subject: [PATCH 1/6] fix(translate):add some translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0001-fix-icon-add-KiranNew-icon-selector-in-ui.patch b/0002-fix-icon-add-KiranNew-icon-selector-in-ui.patch similarity index 98% rename from 0001-fix-icon-add-KiranNew-icon-selector-in-ui.patch rename to 0002-fix-icon-add-KiranNew-icon-selector-in-ui.patch index 47a85d191cda3e8d7a489729cd0b8affb830ffde..62786dc5069f01f4ee6358b402e1e0ec3095443a 100644 --- a/0001-fix-icon-add-KiranNew-icon-selector-in-ui.patch +++ b/0002-fix-icon-add-KiranNew-icon-selector-in-ui.patch @@ -1,7 +1,7 @@ From 141c91b449bb0c4b90b30b48cb36756e8c4b6ced Mon Sep 17 00:00:00 2001 From: yuanxing Date: Thu, 13 Apr 2023 14:32:36 +0800 -Subject: [PATCH 1/2] fix(icon):add KiranNew icon selector in ui +Subject: [PATCH 2/6] fix(icon):add KiranNew icon selector in ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0002-feature-options.cmake-Add-compilation-option-switch-.patch b/0003-feature-options.cmake-Add-compilation-option-switch-.patch similarity index 97% rename from 0002-feature-options.cmake-Add-compilation-option-switch-.patch rename to 0003-feature-options.cmake-Add-compilation-option-switch-.patch index 3ee38cd05a364792eb83263ce8bdf6855d92432c..ad974306bdf3a4804a3a88447e76eaf24f233dfa 100644 --- a/0002-feature-options.cmake-Add-compilation-option-switch-.patch +++ b/0003-feature-options.cmake-Add-compilation-option-switch-.patch @@ -1,7 +1,7 @@ From 4b93ca3e5b8eed92c1dfc4468780733ded46a886 Mon Sep 17 00:00:00 2001 From: luoqing Date: Mon, 17 Apr 2023 10:20:11 +0800 -Subject: [PATCH 2/2] feature(options.cmake):Add compilation option switch, +Subject: [PATCH 3/6] feature(options.cmake):Add compilation option switch, whether to enable network, volume, and user group plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/0003-fix-Compatible-for-versions-below-5.14.patch b/0004-fix-Compatible-for-versions-below-5.14.patch similarity index 99% rename from 0003-fix-Compatible-for-versions-below-5.14.patch rename to 0004-fix-Compatible-for-versions-below-5.14.patch index ed683861136c9a8adcdf480ac5cff6805bf10495..d89255e7640107ca2e47c45d05fd6dfcff2f5c35 100644 --- a/0003-fix-Compatible-for-versions-below-5.14.patch +++ b/0004-fix-Compatible-for-versions-below-5.14.patch @@ -1,7 +1,7 @@ From 1c20cbda6f9dda373f77bbb5525b1ffd9ff9af13 Mon Sep 17 00:00:00 2001 From: yuanxing Date: Sun, 23 Apr 2023 10:07:32 +0800 -Subject: [PATCH] fix(*):Compatible for versions below 5.14 +Subject: [PATCH 4/6] fix(*):Compatible for versions below 5.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0001-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch b/0005-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch similarity index 98% rename from 0001-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch rename to 0005-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch index 713e4a8aaae4e08ac85c07dc5049203d4c316df7..27781880dd7a1f9f42a46bd5f9e916aa2a649278 100644 --- a/0001-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch +++ b/0005-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch @@ -1,7 +1,7 @@ From 20bce602db4eae6cb6d21429054916dbc8393113 Mon Sep 17 00:00:00 2001 From: luoqing Date: Wed, 26 Apr 2023 14:12:21 +0800 -Subject: [PATCH] fix(network):Fix the issue of ineffective cloning of MAC +Subject: [PATCH 5/6] fix(network):Fix the issue of ineffective cloning of MAC addresses after saving the network settings of the control center, and then modify and clear them. It is also compatible with the lower version of kf5 networkmanager qt5 diff --git a/0006-fix-launcher-compatible-with-older-versions-launch-p.patch b/0006-fix-launcher-compatible-with-older-versions-launch-p.patch new file mode 100644 index 0000000000000000000000000000000000000000..cdb70a0d33bbbbc5b1f43007a8313fd767f42774 --- /dev/null +++ b/0006-fix-launcher-compatible-with-older-versions-launch-p.patch @@ -0,0 +1,176 @@ +From 7325100bfd5e40e4904178870a2d9de09296f33a Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Thu, 27 Apr 2023 14:49:22 +0800 +Subject: [PATCH 6/6] fix(launcher): compatible with older versions, launch + plugins separately, and pull up the control center +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- launcher已不再提供单独拉起插件的功能,兼容老版本接口单独启动插件,生成命令,拉起控制中心。 +--- + launcher/src/main.cpp | 88 ++++++++++++++++++++++++------------------- + 1 file changed, 50 insertions(+), 38 deletions(-) + +diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp +index 1c6d6c6..2e5905a 100644 +--- a/launcher/src/main.cpp ++++ b/launcher/src/main.cpp +@@ -16,30 +16,36 @@ + #include "launcher.h" + #include "plugin-v1-subitem-wrapper.h" + #include "plugin-v1.h" ++#include "plugin-v2.h" + + #include ++#include + #include + #include + #include + #include + #include + #include ++#include + #include ++#include ++#include + #include + #include +-#include +-#include +-#include + +-int main(int argc, char *argv[]) ++// NOTE: ++// 2.4版本之后,kiran-cpanel-launcher已不提供单独启动控制中心插件的功能 ++// 保留launcher只是为了兼容,转发拉起控制中心 ++ ++int main(int argc, char* argv[]) + { +- ///先将插件选项从参数中提取出来,作为校验进程单例的一部分 ++ /// 先将插件选项从参数中提取出来,作为校验进程单例的一部分 + QStringList arguments; + for (int i = 0; i < argc; i++) + { + arguments << argv[i]; + } +- QString pluginDesktopName; ++ QString pluginName; + QCommandLineOption pluginOption("cpanel-plugin", "plugin desktop filename", "plugin", ""); + QCommandLineParser parser; + parser.setApplicationDescription("kiran control panel module runalone"); +@@ -48,17 +54,18 @@ int main(int argc, char *argv[]) + parser.parse(arguments); + if (parser.isSet(pluginOption)) + { +- pluginDesktopName = parser.value(pluginOption); +- KiranSingleApplication::addApplicationIDUserData(pluginDesktopName); ++ pluginName = parser.value(pluginOption); ++ KiranSingleApplication::addApplicationIDUserData(pluginName); + } + +- KiranSingleApplication app(argc, argv,false, +- KiranSingleApplication::Mode::User|KiranSingleApplication::Mode::SecondaryNotification); ++ KiranSingleApplication app(argc, argv, false, ++ KiranSingleApplication::Mode::User | ++ KiranSingleApplication::Mode::SecondaryNotification); + +- ///NOTE: 由于strftime获取系统locale进行格式化,Qt使用UTF8,若编码设置不为UTF8中文环境下会导致乱码 +- ///所以LANG后面的编码若不为UTF-8,修改成UTF-8,使获取时间都为UTF-8格式 ++ /// NOTE: 由于strftime获取系统locale进行格式化,Qt使用UTF8,若编码设置不为UTF8中文环境下会导致乱码 ++ /// 所以LANG后面的编码若不为UTF-8,修改成UTF-8,使获取时间都为UTF-8格式 + QString lang = qgetenv("LANG"); +- if(lang.contains(".")) ++ if (lang.contains(".")) + { + #if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) + QStringList splitRes = lang.split(".", QString::SkipEmptyParts); +@@ -67,20 +74,20 @@ int main(int argc, char *argv[]) + #endif + if(splitRes.size() == 2 && splitRes.at(1)!="UTF-8" ) + { +- splitRes.replace(1,"UTF-8"); ++ splitRes.replace(1, "UTF-8"); + QString newLocale = splitRes.join("."); +- setlocale(LC_TIME,newLocale.toStdString().c_str()); ++ setlocale(LC_TIME, newLocale.toStdString().c_str()); + } + } + +- //为了保持插件使用启动器进行启动后,底部面板不堆叠,插件图标显示正常, +- //设置ApplicationName,更新窗口WM_CLASS属性为插件desktop名称 +- if( !pluginDesktopName.isEmpty() ) ++ // 为了保持插件使用启动器进行启动后,底部面板不堆叠,插件图标显示正常, ++ // 设置ApplicationName,更新窗口WM_CLASS属性为插件desktop名称 ++ if (!pluginName.isEmpty()) + { +- QApplication::setApplicationName(pluginDesktopName); ++ QApplication::setApplicationName(pluginName); + } + +- ///再次解析命令行参数是为了处理--help选项得到正确的输出 ++ /// 再次解析命令行参数是为了处理--help选项得到正确的输出 + parser.addHelpOption(); + parser.process(app); + +@@ -100,34 +107,39 @@ int main(int argc, char *argv[]) + KLOG_ERROR() << "can't load translator!" << qmFile; + } + +- QString pluginDesktopPath = QString("%1/%2").arg(PLUGIN_DESKTOP_DIR).arg(pluginDesktopName); ++ QVector pluginSubItems; ++ ++ ++ //兼容两个版本 ++ // plugin v1接口通过desktop文件拿到信息再找so ++ QString pluginDesktopPath = QString("%1/%2").arg(PLUGIN_DESKTOP_DIR).arg(pluginName); + if (!pluginDesktopPath.endsWith(".desktop")) + { + pluginDesktopPath.append(".desktop"); + } + +- if (klog_qt5_init("", "kylinsec-session","kiran-cpanel-launcher", pluginDesktopName) != 0) ++ // plugin v2接口直接加载so读取信息 ++ QString pluginV2LibraryPath = QString("%1/lib%2.so").arg(PLUGIN_LIBRARY_DIR).arg(pluginName); ++ ++ PluginV1 plugin; ++ PluginV2 pluginV2; ++ if (plugin.load(pluginDesktopPath)) + { +- KLOG_CERR("kiran log init error"); ++ pluginSubItems = plugin.getSubItems(); ++ } ++ else if (pluginV2.load(pluginV2LibraryPath)) ++ { ++ pluginSubItems = pluginV2.getSubItems(); + } + +- PluginV1 plugin; +- if (!plugin.load(pluginDesktopPath)) ++ ++ if( pluginSubItems.isEmpty() ) + { + exit(EXIT_FAILURE); + } + +- Launcher w; +- w.setTitle(plugin.getName()); +- QIcon titleIcon = QIcon::fromTheme(plugin.getIcon()); +- w.setIcon(titleIcon); +- w.setSubItems(plugin.getSubItems()); +- w.resize(w.sizeHint()); +- +- QScreen* screen = QApplication::screenAt(QCursor::pos()); +- QRect screenGeometry = screen->geometry(); +- w.move(screenGeometry.x() + (screenGeometry.width() - w.width()) / 2, +- screenGeometry.y() + (screenGeometry.height() - w.height()) / 2); +- w.show(); +- return KiranApplication::exec(); ++ auto category = pluginSubItems.at(0)->getCategory(); ++ auto subitemName = pluginSubItems.at(0)->getName(); ++ QString cmdline = QString("kiran-control-panel -c %1 -s %2").arg(category).arg(subitemName); ++ return QProcess::startDetached(cmdline); + } +-- +2.33.0 + diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index 6697b9b1ad4c640109b805eaff510dfdea5a1bb5..cefd7ef3bb528d823290700d3d2e64728140724e 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -1,16 +1,18 @@ Name: kiran-control-panel Version: 2.5.0 -Release: 6 +Release: 8 Summary: Kiran Control Panel Summary(zh_CN): Kiran桌面控制面板 License: MulanPSL-2.0 Source0: %{name}-%{version}.tar.gz -Patch0: 0001-fix-translate-add-some-translation.patch -Patch1: 0001-fix-icon-add-KiranNew-icon-selector-in-ui.patch -Patch2: 0002-feature-options.cmake-Add-compilation-option-switch-.patch -Patch3: 0003-fix-Compatible-for-versions-below-5.14.patch -Patch4: 0001-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch + +Patch0001: 0001-fix-translate-add-some-translation.patch +Patch0002: 0002-fix-icon-add-KiranNew-icon-selector-in-ui.patch +Patch0003: 0003-feature-options.cmake-Add-compilation-option-switch-.patch +Patch0004: 0004-fix-Compatible-for-versions-below-5.14.patch +Patch0005: 0005-fix-network-Fix-the-issue-of-ineffective-cloning-of-.patch +Patch0006: 0006-fix-launcher-compatible-with-older-versions-launch-p.patch BuildRequires: gcc-c++ BuildRequires: cmake >= 3.2 @@ -160,6 +162,12 @@ make %{?_smp_mflags} rm -rf %{buildroot} %changelog +* Fri Apr 28 2023 liuxinhao - 2.5.0-8 +- KYOS-F: compatible with older versions, launch plugins separately, and pull up the control center(#3565) + +* Wed Apr 26 2023 kpkg - 2.5.0-7 +- rebuild for KiranUI-2.5-next + * Wed Apr 26 2023 luoqing - 2.5.0-6 - KYOS-F: Fix the issue of ineffective cloning of MAC addresses, compatible with the lower version of kf5 networkmanager qt5