diff --git a/debian/changelog b/debian/changelog index 1c4b1c4..575af2c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +ukui-control-center (3.20.0.2022.0601-ok3~0810) v101; urgency=medium + + * 提交commit: 0466e45b + * close-cd#bug#130710设计】【控制面板】关于界面调用sdk + * close-cd#127771单例应用最小化后,从搜索无法将原页面呼出 + * 需求号 :无 + * 任务号: + * 其他改动说明 :无 + * 其他改动影响域 : 无 + + -- zhoubin Wed, 10 Aug 2022 13:55:10 +0800 + ukui-control-center (3.20.0.2022.0601-ok3~0721.1) v101; urgency=medium * 提交commit: 8861db58 diff --git a/plugins/network/proxy/proxy.cpp b/plugins/network/proxy/proxy.cpp index fc56123..a54b699 100644 --- a/plugins/network/proxy/proxy.cpp +++ b/plugins/network/proxy/proxy.cpp @@ -158,7 +158,6 @@ void Proxy::initUi(QWidget *widget) mverticalLayout->setContentsMargins(0, 0, 0, 0); mProxyBtnGroup = new QButtonGroup(this); - mProxyBtnGroup->setExclusive (false); // 防止互斥 mTitleLabel = new TitleLabel(widget); diff --git a/shell/mainwindow.cpp b/shell/mainwindow.cpp index aba84bb..78c925d 100644 --- a/shell/mainwindow.cpp +++ b/shell/mainwindow.cpp @@ -77,6 +77,7 @@ extern "C" { const int dbWitdth = 50; extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), @@ -85,6 +86,19 @@ MainWindow::MainWindow(QWidget *parent) : mate_mixer_init(); qApp->installEventFilter(this); is_ExitPower = isExitsPower(); + connect(WindowManager::self(),&WindowManager::windowAdded,this,[=](const WindowId& windowId){ + /*注意: + * 最新创建的窗体被设置为操作窗体,此demo中每个按钮对应一个接口函数调用,所有接口函数操作的窗口都是该最新创建的窗体 + */ + if (getpid() == WindowManager::getPid(windowId)) { + m_listWinIds.append(windowId); + } + }); + connect(WindowManager::self(),&WindowManager::windowRemoved,this,[=](const WindowId& windowId){ + if (m_listWinIds.contains(windowId)) { + m_listWinIds.removeOne(windowId); + } + }); initUI(); hideComponent(); } @@ -563,9 +577,12 @@ void MainWindow::initUkccAbout() { connect(ukccExit, SIGNAL(triggered()), this, SLOT(close())); - connect(ukccAbout, &QAction::triggered, this, [=] { - UkccAbout *ukcc = new UkccAbout(this); - ukcc->exec(); + connect(ukccAbout, &QAction::triggered, this, [=] { + KAboutDialog *ukcc = new KAboutDialog(this); + ukcc->setAppIcon(QIcon::fromTheme("ukui-control-center")); + ukcc->setAppName(tr("Settings")); + ukcc->setAppVersion(Utils::getUkccVersion()); + ukcc->setAppSupport(""); }); connect(ukccHelp, &QAction::triggered, this, &MainWindow::onF1ButtonClicked); @@ -1137,7 +1154,14 @@ void MainWindow::functionBtnClicked(QObject *plugin) { } void MainWindow::sltMessageReceived(const QString &msg) { - KWindowSystem::forceActiveWindow(this->winId()); + QString platform = QGuiApplication::platformName(); + if(platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) { + if (!m_listWinIds.isEmpty()) { + WindowManager::activateWindow(m_listWinIds.back()); + } + } else { + KWindowSystem::forceActiveWindow(this->winId()); + } this->show(); bootOptionsFilter(msg); } diff --git a/shell/mainwindow.h b/shell/mainwindow.h index 7f40bc1..32cc720 100644 --- a/shell/mainwindow.h +++ b/shell/mainwindow.h @@ -39,12 +39,16 @@ #include "homepagewidget.h" #include "modulepagewidget.h" #include "searchwidget.h" +#include "kaboutdialog.h" +#include "windowmanager/windowmanager.h" + class QLabel; class QPushButton; class QButtonGroup; class KeyValueConverter; +using namespace kdk; namespace Ui { class MainWindow; } @@ -111,6 +115,7 @@ private: QDBusInterface *m_statusSessionDbus; QDBusReply is_tabletmode; + QList m_listWinIds; private: void initUI(); diff --git a/shell/shell.pro b/shell/shell.pro index 829cb3f..e367931 100644 --- a/shell/shell.pro +++ b/shell/shell.pro @@ -35,7 +35,8 @@ PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ gsettings-qt \ kysdk-waylandhelper \ - libmatemixer + libmatemixer \ + kysdk-qtwidgets desktop.files += ukui-control-center.desktop desktop.path = /usr/share/applications diff --git a/shell/utils/utils.cpp b/shell/utils/utils.cpp index 6c0c2b4..27d7fa1 100644 --- a/shell/utils/utils.cpp +++ b/shell/utils/utils.cpp @@ -264,3 +264,35 @@ bool Utils::isZJY() } return true; } + +QString Utils::getUkccVersion() +{ + FILE *pp = NULL; + char *line = NULL; + size_t len = 0; + ssize_t read; + char *q = NULL; + QString version = "none"; + + pp = popen("dpkg -l ukui-control-center | grep ukui-control-center", "r"); + if(NULL == pp) + return version; + + while((read = getline(&line, &len, pp)) != -1){ + q = strrchr(line, '\n'); + *q = '\0'; + + QString content = line; + QStringList list = content.split(" "); + + list.removeAll(""); + + if (list.size() >= 3) + version = list.at(2); + } + + free(line); + line = NULL; + pclose(pp); + return version; +} diff --git a/shell/utils/utils.h b/shell/utils/utils.h index 62c024b..b7eb5eb 100644 --- a/shell/utils/utils.h +++ b/shell/utils/utils.h @@ -35,7 +35,7 @@ #include namespace Utils -{ +{ void centerToScreen(QWidget *widget); QRect sizeOnCursor(); QVariantMap getModuleHideStatus(); @@ -49,5 +49,6 @@ namespace Utils bool isTablet(); bool isZJY(); QString getHostName(); + QString getUkccVersion(); } #endif // UTILS_H