chore: update changelog
This commit is contained in:
parent
2530c0cbfe
commit
6b0ef1b306
|
@ -1,3 +1,12 @@
|
|||
ukui-control-center (3.22.1.25-ok18) yangtze; urgency=medium
|
||||
|
||||
* bug#I72LR7 小时制且日期时间格式为藏文,登录界面的时间显示为英文
|
||||
* 需求:无
|
||||
* 任务:重新编译代码
|
||||
* 其他改动:无
|
||||
|
||||
-- zhoubin <zhoubin@kylinos.cn> Tue, 23 May 2023 20:25:00 +0800
|
||||
|
||||
ukui-control-center (3.22.1.25-ok17) yangtze; urgency=medium
|
||||
|
||||
* bug#无
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
<message xml:lang="zh">修改用户组需要认证</message>
|
||||
<message xml:lang="bo">དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་དགོས་།</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
<action id="org.ukui.groupmanager.action.del">
|
||||
|
|
|
@ -6,10 +6,10 @@ CONFIG += link_pkgconfig
|
|||
PKGCONFIG += kysdk-diagnostics
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/interface/common.cpp \
|
||||
$$PWD/interface/mthread.cpp \
|
||||
$$PWD/interface/ukcccommon.cpp
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/interface/common.h \
|
||||
$$PWD/interface/interface.h \
|
||||
$$PWD/interface/mthread.h \
|
||||
$$PWD/interface/ukcccommon.h
|
||||
|
|
|
@ -0,0 +1,371 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
#include "ukcccommon.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QProcess>
|
||||
#include <QFile>
|
||||
#include <QRegularExpression>
|
||||
#include <kysdk/kysdk-system/libkysysinfo.h>
|
||||
|
||||
#ifdef WITHKYSEC
|
||||
#include <kysec/libkysec.h>
|
||||
#include <kysec/status.h>
|
||||
#endif
|
||||
using namespace ukcc;
|
||||
|
||||
UkccCommon::UkccCommon()
|
||||
{
|
||||
}
|
||||
|
||||
UkccCommon::~UkccCommon()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UkccCommon::centerToScreen(QWidget* widget) {
|
||||
if (!widget)
|
||||
return;
|
||||
QDesktopWidget* m = QApplication::desktop();
|
||||
QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos()));
|
||||
int desk_x = desk_rect.width();
|
||||
int desk_y = desk_rect.height();
|
||||
int x = widget->width();
|
||||
int y = widget->height();
|
||||
widget->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 2 - y / 2 + desk_rect.top());
|
||||
}
|
||||
|
||||
QVariantMap UkccCommon::getModuleHideStatus() {
|
||||
QDBusInterface m_interface( "org.ukui.ukcc.session",
|
||||
"/",
|
||||
"org.ukui.ukcc.session.interface",
|
||||
QDBusConnection::sessionBus());
|
||||
|
||||
QDBusReply<QVariantMap> obj_reply = m_interface.call("getModuleHideStatus");
|
||||
if (!obj_reply.isValid()) {
|
||||
qDebug()<<"execute dbus method getModuleHideStatus failed";
|
||||
}
|
||||
return obj_reply.value();
|
||||
}
|
||||
|
||||
QString UkccCommon::getCpuInfo() {
|
||||
QFile file("/proc/cpuinfo");
|
||||
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
QString buffer = file.readAll();
|
||||
QStringList modelLine = buffer.split('\n').filter(QRegularExpression("^model name"));
|
||||
QStringList modelLineWayland = buffer.split('\n').filter(QRegularExpression("^Hardware"));
|
||||
QStringList lines = buffer.split('\n');
|
||||
|
||||
if (modelLine.isEmpty()) {
|
||||
if (modelLineWayland.isEmpty()) {
|
||||
return "Unknown";
|
||||
}
|
||||
modelLine = modelLineWayland;
|
||||
}
|
||||
|
||||
|
||||
int count = lines.filter(QRegularExpression("^processor")).count();
|
||||
|
||||
QString result;
|
||||
result.append(modelLine.first().split(':').at(1));
|
||||
result = result.trimmed();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
QString UkccCommon::getCpuArchitecture()
|
||||
{
|
||||
QString cpuArchitecture;
|
||||
// 设置系统环境变量
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert("LANG","en_US");
|
||||
QProcess *process = new QProcess;
|
||||
process->setProcessEnvironment(env);
|
||||
process->start("lscpu");
|
||||
process->waitForFinished();
|
||||
|
||||
QByteArray ba = process->readAllStandardOutput();
|
||||
|
||||
delete process;
|
||||
QString cpuinfo = QString(ba.data());
|
||||
QStringList cpuinfo_list = cpuinfo.split("\n");
|
||||
for (int i = 0; i < cpuinfo_list.count(); i++) {
|
||||
QString mstring = cpuinfo_list.at(i);
|
||||
if (mstring.contains("Architecture")) {
|
||||
// 去除空格
|
||||
mstring = mstring.remove(QRegExp("\\s"));
|
||||
QStringList list = mstring.split(":");
|
||||
cpuArchitecture = list.at(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return cpuArchitecture;
|
||||
}
|
||||
|
||||
bool UkccCommon::isExistEffect() {
|
||||
QString filename = QDir::homePath() + "/.config/ukui-kwinrc";
|
||||
QSettings kwinSettings(filename, QSettings::IniFormat);
|
||||
|
||||
QStringList keys = kwinSettings.childGroups();
|
||||
|
||||
kwinSettings.beginGroup("Plugins");
|
||||
bool kwin = kwinSettings.value("blurEnabled", kwin).toBool();
|
||||
|
||||
if (!kwinSettings.childKeys().contains("blurEnabled")) {
|
||||
kwin = true;
|
||||
}
|
||||
kwinSettings.endGroup();
|
||||
|
||||
QFileInfo dir(filename);
|
||||
if (!dir.isFile()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keys.contains("Compositing")) {
|
||||
kwinSettings.beginGroup("Compositing");
|
||||
QString xder;
|
||||
bool kwinOG = false;
|
||||
bool kwinEN = true;
|
||||
xder = kwinSettings.value("Backend", xder).toString();
|
||||
kwinOG = kwinSettings.value("OpenGLIsUnsafe", kwinOG).toBool();
|
||||
kwinEN = kwinSettings.value("Enabled", kwinEN).toBool();
|
||||
if ("XRender" == xder || kwinOG || !kwinEN) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
kwinSettings.endGroup();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void UkccCommon::setKwinMouseSize(int size) {
|
||||
|
||||
QString filename = QDir::homePath() + "/.config/kcminputrc";
|
||||
QSettings *mouseSettings = new QSettings(filename, QSettings::IniFormat);
|
||||
|
||||
mouseSettings->beginGroup("Mouse");
|
||||
mouseSettings->setValue("cursorSize", size);
|
||||
mouseSettings->endGroup();
|
||||
|
||||
delete mouseSettings;
|
||||
mouseSettings = nullptr;
|
||||
|
||||
QDBusMessage message = QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "notifyChange");
|
||||
QList<QVariant> args;
|
||||
args.append(5);
|
||||
args.append(0);
|
||||
message.setArguments(args);
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
}
|
||||
|
||||
bool UkccCommon::isWayland() {
|
||||
QString sessionType = getenv("XDG_SESSION_TYPE");
|
||||
|
||||
if (!sessionType.compare("wayland", Qt::CaseSensitive)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool UkccCommon::isOpenkylin()
|
||||
{
|
||||
QString systemName = QString(QLatin1String(kdk_system_get_systemName()));
|
||||
if (systemName.compare("openkylin", Qt::CaseInsensitive) == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UkccCommon::isCommunity()
|
||||
{
|
||||
QString filename = "/etc/os-release";
|
||||
QSettings osSettings(filename, QSettings::IniFormat);
|
||||
|
||||
QString versionID = osSettings.value("VERSION_ID").toString();
|
||||
|
||||
if (versionID.compare("22.04", Qt::CaseSensitive)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QRect UkccCommon::sizeOnCursor()
|
||||
{
|
||||
QDesktopWidget* m = QApplication::desktop();
|
||||
QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos()));
|
||||
return desk_rect;
|
||||
}
|
||||
|
||||
bool UkccCommon::isTablet()
|
||||
{
|
||||
QString projectName = QString(QLatin1String(kdk_system_get_projectSubName()));
|
||||
|
||||
if (projectName.compare("mavis", Qt::CaseInsensitive) == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UkccCommon::isExitBattery()
|
||||
{
|
||||
/* 默认机器没有电池 */
|
||||
bool hasBat = false;
|
||||
QDBusInterface *brightnessInterface = new QDBusInterface("org.freedesktop.UPower",
|
||||
"/org/freedesktop/UPower/devices/DisplayDevice",
|
||||
"org.freedesktop.DBus.Properties",
|
||||
QDBusConnection::systemBus());
|
||||
if (!brightnessInterface->isValid()) {
|
||||
qDebug() << "Create UPower Interface Failed : " << QDBusConnection::systemBus().lastError();
|
||||
return false;
|
||||
}
|
||||
|
||||
QDBusReply<QVariant> briginfo;
|
||||
briginfo = brightnessInterface ->call("Get", "org.freedesktop.UPower.Device", "PowerSupply");
|
||||
|
||||
if (briginfo.value().toBool()) {
|
||||
hasBat = true ;
|
||||
}
|
||||
delete brightnessInterface;
|
||||
|
||||
return hasBat;
|
||||
}
|
||||
|
||||
|
||||
QString UkccCommon::getHostName()
|
||||
{
|
||||
QString hostname;
|
||||
// 设置系统环境变量
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert("LANG","en_US");
|
||||
QProcess *process = new QProcess;
|
||||
process->setProcessEnvironment(env);
|
||||
process->start("hostname");
|
||||
process->waitForFinished();
|
||||
|
||||
QByteArray ba = process->readAllStandardOutput();
|
||||
|
||||
delete process;
|
||||
hostname = ba.data();
|
||||
|
||||
hostname.replace(QString("\n"),QString(""));
|
||||
return hostname;
|
||||
}
|
||||
|
||||
bool UkccCommon::isZJY()
|
||||
{
|
||||
QString filename = "/etc/os-release";
|
||||
QSettings osSettings(filename, QSettings::IniFormat);
|
||||
|
||||
QString versionID = osSettings.value("PROJECT_CODENAME").toString();
|
||||
|
||||
if (versionID.compare("v10sp1-zyj", Qt::CaseSensitive)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UkccCommon::buriedSettings(QString pluginName, QString settingsName, QString action, QString value)
|
||||
{
|
||||
// 埋点数据
|
||||
char appName[] = "ukui-control-center";
|
||||
QByteArray actiontr = action.toLocal8Bit(); // toLocal8Bit 支持中文
|
||||
char *messageType = actiontr.data();
|
||||
|
||||
KBuriedPoint pt[3];
|
||||
pt[0].key = "pluginName";
|
||||
std::string pluginStr = pluginName.toStdString();
|
||||
pt[0].value = pluginStr.c_str();
|
||||
|
||||
pt[1].key = "settingsName";
|
||||
std::string settingStr = settingsName.toStdString();
|
||||
pt[1].value = settingStr.c_str();
|
||||
|
||||
pt[2].key = "value";
|
||||
std::string valueStr = value.toStdString();
|
||||
pt[2].value = valueStr.c_str();
|
||||
|
||||
if (kdk_buried_point(appName , messageType , pt , 3) == -1) {
|
||||
qDebug() << __FUNCTION__ << "messageType:" << action << "pluginName:" << pluginName
|
||||
<< "settingsName:" << settingsName << "value:" << value << "buried point fail !" << __LINE__;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString UkccCommon::boolToString(bool b)
|
||||
{
|
||||
if (b) {
|
||||
return QString("true");
|
||||
} else {
|
||||
return QString("false");
|
||||
}
|
||||
}
|
||||
|
||||
QString UkccCommon::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;
|
||||
}
|
||||
|
||||
QString UkccCommon::getProductName()
|
||||
{
|
||||
QDBusInterface ifc("com.control.center.qt.systemdbus",
|
||||
"/",
|
||||
"com.control.center.interface",
|
||||
QDBusConnection::systemBus());
|
||||
QDBusReply<QString> res = ifc.call("getDmiDecodeRes", "-s system-product-name");
|
||||
return res.value().trimmed();
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
#ifndef UKCCCOMMON_H
|
||||
#define UKCCCOMMON_H
|
||||
|
||||
#include <QRect>
|
||||
#include <QCursor>
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QSettings>
|
||||
#include <QApplication>
|
||||
#include <QCommandLineOption>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDesktopWidget>
|
||||
#include <QVariantMap>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QtDBus/QDBusReply>
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <kysdk/kysdk-base/libkydiagnostics.h>
|
||||
|
||||
#include "libukcc_global.h"
|
||||
|
||||
namespace ukcc
|
||||
{
|
||||
/**
|
||||
* @brief 提供判断、获取信息等功能性接口
|
||||
*
|
||||
*/
|
||||
class LIBUKCC_EXPORT UkccCommon : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
explicit UkccCommon();
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
~UkccCommon();
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief 将 widget 移动到屏幕中间
|
||||
*
|
||||
* @param widget 需要移动的窗口
|
||||
*/
|
||||
static void centerToScreen(QWidget *widget);
|
||||
/**
|
||||
* @brief 获取鼠标所在屏幕大小
|
||||
*
|
||||
* @return 鼠标所在屏幕大小
|
||||
*/
|
||||
static QRect sizeOnCursor();
|
||||
/**
|
||||
* @brief 根据 ukui-control-center-security-config.json 获取插件隐藏状态
|
||||
*
|
||||
* @return QVariantMap 插件隐藏状态列表
|
||||
*/
|
||||
static QVariantMap getModuleHideStatus();
|
||||
/**
|
||||
* @brief 获取 CPU 信息
|
||||
*
|
||||
* @return QString
|
||||
*/
|
||||
static QString getCpuInfo();
|
||||
/**
|
||||
* @brief 获取 CPU 架构
|
||||
*
|
||||
* @return QString CPU 架构
|
||||
*/
|
||||
static QString getCpuArchitecture();
|
||||
/**
|
||||
* @brief 是否支持特效模式
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isExistEffect();
|
||||
/**
|
||||
* @brief 是否存在电池
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isExitBattery();
|
||||
/**
|
||||
* @brief set kwin cursorSize
|
||||
*
|
||||
* @param size 大小
|
||||
*/
|
||||
static void setKwinMouseSize(int size);
|
||||
/**
|
||||
* @brief 是否 wayland
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isWayland();
|
||||
/**
|
||||
* @brief 是否 openkylin
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isOpenkylin();
|
||||
/**
|
||||
* @brief 是否 22.04 社区版
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isCommunity();
|
||||
/**
|
||||
* @brief 是否 mavis 平板
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isTablet();
|
||||
/**
|
||||
* @brief 是否 v10sp1-zyj
|
||||
*
|
||||
* @return bool 是:true,否:false
|
||||
*/
|
||||
static bool isZJY();
|
||||
/**
|
||||
* @brief 获取主机名
|
||||
*
|
||||
* @return QString hostname
|
||||
*/
|
||||
static QString getHostName();
|
||||
/**
|
||||
* @brief 埋点
|
||||
*
|
||||
* @param pluginName 插件名
|
||||
* @param settingsName 设置名
|
||||
* @param action 操作
|
||||
* @param value 设置的值
|
||||
* @return bool 是否埋点成功
|
||||
*/
|
||||
static bool buriedSettings(QString pluginName, QString settingsName, QString action, QString value = nullptr);
|
||||
/**
|
||||
* @brief bool 转换为 string
|
||||
*
|
||||
* @param b true or false
|
||||
* @return QString "true" or "false"
|
||||
*/
|
||||
static QString boolToString(bool b);
|
||||
/**
|
||||
* @brief 获取控制面板版本
|
||||
*
|
||||
* @return QString 版本号
|
||||
*/
|
||||
static QString getUkccVersion();
|
||||
|
||||
/**
|
||||
* @brief 获取system-product-name
|
||||
*
|
||||
* @return QString system-product-name
|
||||
*/
|
||||
static QString getProductName();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif // UKCCCOMMON_H
|
|
@ -283,6 +283,7 @@ void changeUserGroup::connectToServer()
|
|||
return;
|
||||
}
|
||||
// 将以后所有DBus调用的超时设置为 milliseconds
|
||||
serviceInterface->call("setAuth", true);
|
||||
serviceInterface->setTimeout(2147483647); // -1 为默认的25s超时
|
||||
}
|
||||
|
||||
|
@ -366,7 +367,7 @@ void changeUserGroup::loadAllGroup()
|
|||
connect(allUserGroupTableView,&QTableView::clicked,this,[=](const QModelIndex &index){
|
||||
bool idSetEnable = true;
|
||||
currentRow = index.row();
|
||||
Common::buriedSettings(QString("Userinfo"), this->windowTitle(), QString("clicked"), groupList->at(currentRow)->groupname);
|
||||
UkccCommon::buriedSettings(QString("Userinfo"), this->windowTitle(), QString("clicked"), groupList->at(currentRow)->groupname);
|
||||
|
||||
if (setTextDynamic(mUserGroupLineEdit, groupList->at(currentRow)->groupname)) {
|
||||
mUserGroupLineEdit->setToolTip(groupList->at(currentRow)->groupname);
|
||||
|
@ -386,7 +387,6 @@ void changeUserGroup::loadAllGroup()
|
|||
break;
|
||||
}
|
||||
}
|
||||
qDebug() << "**************_deleteable = " << _deleteable;
|
||||
|
||||
mDelUserGroupButton->setEnabled(_deleteable);
|
||||
|
||||
|
@ -510,7 +510,7 @@ void changeUserGroup::refreshCertainBtnStatus(){
|
|||
mUserGroupIdLineEdit->text().isEmpty())
|
||||
mConfirmButton->setEnabled(false);
|
||||
else
|
||||
mConfirmButton->setEnabled(_nameHasModified || _idHasModified || _boxModified);
|
||||
mConfirmButton->setEnabled(_nameHasModified || _idHasModified || _boxModified || _deleted || _addable);
|
||||
}
|
||||
|
||||
void changeUserGroup::refreshList()
|
||||
|
@ -525,6 +525,7 @@ void changeUserGroup::refreshList()
|
|||
// item = nullptr;
|
||||
// }
|
||||
mAllUserGroupModel->removeRows(0,mAllUserGroupModel->rowCount());
|
||||
|
||||
loadGroupInfo();
|
||||
loadAllGroup();
|
||||
}
|
||||
|
@ -616,6 +617,8 @@ void changeUserGroup::addUserGroupSlot()
|
|||
if (reply.isValid()){
|
||||
// use the returned value
|
||||
qDebug() << "get call value" << reply.value();
|
||||
_addable = true;
|
||||
refreshCertainBtnStatus();
|
||||
} else {
|
||||
// call failed. Show an error condition.
|
||||
qDebug() << "call failed" << reply.error();
|
||||
|
@ -647,6 +650,9 @@ void changeUserGroup::delUserGroupSlot()
|
|||
qDebug() << "current index" << allUserGroupTableView->currentIndex();
|
||||
mAllUserGroupModel->removeRow(currentRow);
|
||||
allUserGroupTableView->scrollTo(allUserGroupTableView->currentIndex());
|
||||
mDelUserGroupButton->setEnabled(false);
|
||||
_deleted = true;
|
||||
refreshCertainBtnStatus();
|
||||
} else {
|
||||
// call failed. Show an error condition.
|
||||
qDebug() << "call failed" << reply.error();
|
||||
|
@ -688,18 +694,12 @@ void changeUserGroup::saveUserGroupInfoSlot()
|
|||
|
||||
}
|
||||
}
|
||||
QDBusReply<bool> retSetAuth = this->serviceInterface->call("setAuth", false);
|
||||
if (retSetAuth) {
|
||||
QDBusReply<bool> setReply = this->serviceInterface->call("set",
|
||||
mUserGroupLineEdit->text(),mUserGroupIdLineEdit->text());
|
||||
if (setReply.isValid()){
|
||||
// use the returned value
|
||||
qDebug() << "set get call value" << setReply.value();
|
||||
} else {
|
||||
// call failed. Show an error condition.
|
||||
qDebug() << "set call failed" << setReply.error();
|
||||
}
|
||||
|
||||
QDBusReply<bool> setReply = this->serviceInterface->call("set",
|
||||
mUserGroupLineEdit->text(),mUserGroupIdLineEdit->text());
|
||||
if (setReply.isValid()){
|
||||
// use the returned value
|
||||
qDebug() << "set get call value" << setReply.value();
|
||||
QDBusReply<bool> addUserReply = this->serviceInterface->call("addUserToGroup",
|
||||
mUserGroupLineEdit->text(), addUserList);
|
||||
if (addUserReply.isValid()){
|
||||
|
@ -718,14 +718,14 @@ void changeUserGroup::saveUserGroupInfoSlot()
|
|||
// call failed. Show an error condition.
|
||||
qDebug() << "delUserFromGroup call failed" << delUserReply.error();
|
||||
}
|
||||
this->serviceInterface->call("setAuth", true);
|
||||
|
||||
emit needRefresh();
|
||||
|
||||
close();
|
||||
} else {
|
||||
this->serviceInterface->call("setAuth", true);
|
||||
// call failed. Show an error condition.
|
||||
qDebug() << "set call failed" << setReply.error();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void changeUserGroup::editUserGroupInfoSlot()
|
||||
|
|
|
@ -131,7 +131,9 @@ private:
|
|||
bool _idHasModified;
|
||||
bool _boxModified;
|
||||
bool _deleteable = false;
|
||||
bool _addable = false;
|
||||
bool _editable;
|
||||
bool _deleted = false;
|
||||
|
||||
private:
|
||||
void connectToServer();
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
#include <QFileSystemWatcher>
|
||||
|
||||
#include <QDebug>
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#ifdef signals
|
||||
#undef signals
|
||||
#endif
|
||||
|
@ -63,11 +65,11 @@ void ChangeUserLogo::loadSystemLogo(){
|
|||
foreach (QString filename, facesDir.entryList(QDir::Files)) {
|
||||
QString fullface = QString("%1%2").arg(FACEPATH).arg(filename);
|
||||
// 社区版不加载商业默认头像
|
||||
if ((Common::isCommunity() || Common::isOpenkylin()) && fullface.endsWith("commercial.png")) {
|
||||
if ((UkccCommon::isCommunity() || UkccCommon::isOpenkylin()) && fullface.endsWith("commercial.png")) {
|
||||
continue;
|
||||
}
|
||||
// 商业版不加载社区默认头像
|
||||
if ((!Common::isCommunity() && !Common::isOpenkylin()) &&fullface.endsWith("community.png")) {
|
||||
if ((!UkccCommon::isCommunity() && !UkccCommon::isOpenkylin()) &&fullface.endsWith("community.png")) {
|
||||
continue;
|
||||
}
|
||||
// 升级后 default.png 不存在导致开始菜单无头像显示 #108837
|
||||
|
@ -137,7 +139,6 @@ void ChangeUserLogo::initUI()
|
|||
culUserHorLayout->addLayout(culUserInfoVerLayout);
|
||||
|
||||
culNoteLabel = new QLabel;
|
||||
culNoteLabel->setFixedHeight(24);
|
||||
culNoteLabel->setText(tr("System Logos"));
|
||||
|
||||
culLogoNoteHorLayout = new QHBoxLayout;
|
||||
|
|
|
@ -42,7 +42,6 @@ void ChangeUserType::initUI(){
|
|||
|
||||
|
||||
cutNickNameLabel = new QLabel();
|
||||
cutNickNameLabel->setFixedHeight(24);
|
||||
cutUserTypeLabel = new LightLabel();
|
||||
cutUserTypeLabel->setFixedHeight(24);
|
||||
|
||||
|
|
|
@ -17,13 +17,14 @@
|
|||
|
||||
#include <kylin-chkname.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#define USER_LENGTH 32
|
||||
#define NICKNAME_LENGTH 32
|
||||
#define DEFAULTFACECOMMUNITY "/usr/share/ukui/faces/01-default-community.png"
|
||||
#define DEFAULTFACECOMMERCIAL "/usr/share/ukui/faces/01-default-commercial.png"
|
||||
#define DEFAULTFACE (Common::isCommunity() || Common::isOpenkylin())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL
|
||||
#define DEFAULTFACE (UkccCommon::isCommunity() || UkccCommon::isOpenkylin())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL
|
||||
|
||||
CreateUserNew::CreateUserNew(QStringList allUsers, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include <QFile>
|
||||
#include <QDebug>
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#define PAM_CONF_FILE "/etc/pam.d/common-password"
|
||||
|
||||
|
@ -33,7 +34,7 @@ PasswdCheckUtil::PasswdCheckUtil(QObject *parent) : QObject(parent)
|
|||
|
||||
bool PasswdCheckUtil::getCurrentPamState(){
|
||||
// pam_pwquality.so为安全中心密码强度是否开启判断,社区版不做判断
|
||||
if (Common::isCommunity() || Common::isWayland()) {
|
||||
if (UkccCommon::isCommunity() || UkccCommon::isWayland()) {
|
||||
return true;
|
||||
}
|
||||
QFile * readFile = new QFile(PAM_CONF_FILE);
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
#include "passwdcheckutil.h"
|
||||
#include "loginedusers.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "imageutil.h"
|
||||
/* qt会将glib里的signals成员识别为宏,所以取消该宏
|
||||
* 后面如果用到signals时,使用Q_SIGNALS代替即可
|
||||
|
@ -65,7 +66,7 @@
|
|||
#endif
|
||||
#define DEFAULTFACECOMMUNITY "/usr/share/ukui/faces/01-default-community.png"
|
||||
#define DEFAULTFACECOMMERCIAL "/usr/share/ukui/faces/01-default-commercial.png"
|
||||
#define DEFAULTFACE (Common::isCommunity() || Common::isOpenkylin())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL
|
||||
#define DEFAULTFACE (UkccCommon::isCommunity() || UkccCommon::isOpenkylin())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL
|
||||
#define ITEMHEIGH 60
|
||||
|
||||
UserInfo::UserInfo() : mFirstLoad(true)
|
||||
|
@ -132,7 +133,7 @@ const QString UserInfo::name() const {
|
|||
|
||||
bool UserInfo::isShowOnHomePage() const
|
||||
{
|
||||
return !Common::isTablet();
|
||||
return !UkccCommon::isTablet();
|
||||
}
|
||||
|
||||
QIcon UserInfo::icon() const
|
||||
|
@ -142,7 +143,7 @@ QIcon UserInfo::icon() const
|
|||
|
||||
bool UserInfo::isEnable() const
|
||||
{
|
||||
return !Common::isTablet();
|
||||
return !UkccCommon::isTablet();
|
||||
}
|
||||
|
||||
void UserInfo::initSearchText()
|
||||
|
@ -197,7 +198,6 @@ void UserInfo::initUI(){
|
|||
changeCurrentGroupsBtn->setObjectName("Groups");
|
||||
|
||||
currentNickNameLabel = new QLabel();
|
||||
currentNickNameLabel->setFixedHeight(27);
|
||||
currentNickNameChangeLabel = new QLabel();
|
||||
currentNickNameChangeLabel->setObjectName("currentNickNameChange");
|
||||
currentNickNameChangeLabel->setFixedSize(QSize(15, 22));
|
||||
|
@ -319,7 +319,7 @@ void UserInfo::hideComponent()
|
|||
void UserInfo::setNoPwdAndAutoLogin()
|
||||
{
|
||||
// 安全管控 免密登录及自动登录设置项的显示与隐藏
|
||||
QVariantMap ModuleMap = Common::getModuleHideStatus();
|
||||
QVariantMap ModuleMap = UkccCommon::getModuleHideStatus();
|
||||
QString moduleSettings = ModuleMap.value(name().toLower() + "Settings").toString();
|
||||
QStringList setItems = moduleSettings.split(",");
|
||||
|
||||
|
@ -741,36 +741,33 @@ void UserInfo::setUserConnect(){
|
|||
currentNickNameChangeLabel->installEventFilter(this);
|
||||
|
||||
connect(currentUserlogoBtn, &QPushButton::clicked, this, [=]{
|
||||
Common::buriedSettings(name(), currentUserlogoBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), currentUserlogoBtn->objectName(), QString("clicked"));
|
||||
|
||||
showChangeUserLogoDialog(QString(g_get_user_name()), nullptr);
|
||||
});
|
||||
|
||||
connect(changeCurrentPwdBtn, &QPushButton::clicked, this, [=]{
|
||||
Common::buriedSettings(name(), changeCurrentPwdBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), changeCurrentPwdBtn->objectName(), QString("clicked"));
|
||||
|
||||
showChangeUserPwdDialog(QString(g_get_user_name()));
|
||||
});
|
||||
|
||||
connect(changeCurrentTypeBtn, &QPushButton::clicked, [=]{
|
||||
Common::buriedSettings(name(), changeCurrentTypeBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), changeCurrentTypeBtn->objectName(), QString("clicked"));
|
||||
|
||||
showChangeUserTypeDialog(QString(g_get_user_name()));
|
||||
});
|
||||
|
||||
connect(changeCurrentGroupsBtn, &QPushButton::clicked, this, [=](bool checked){
|
||||
Q_UNUSED(checked)
|
||||
Common::buriedSettings(name(), changeCurrentGroupsBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), changeCurrentGroupsBtn->objectName(), QString("clicked"));
|
||||
|
||||
bool reply = polkitEdit();
|
||||
if (reply) {
|
||||
showChangeGroupDialog();
|
||||
}
|
||||
showChangeGroupDialog();
|
||||
|
||||
});
|
||||
//自动登录登录
|
||||
connect(autoLoginFrame, &SwitchWidget::stateChanged, this, [=](bool checked){
|
||||
Common::buriedSettings(name(), autoLoginFrame->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), autoLoginFrame->objectName(), QString("settings"), checked ? "true":"false");
|
||||
|
||||
UserInfomation user = allUserInfoMap.value(g_get_user_name());
|
||||
|
||||
|
@ -805,7 +802,7 @@ void UserInfo::setUserConnect(){
|
|||
|
||||
//免密登录
|
||||
connect(nopwdLoginFrame, &SwitchWidget::stateChanged, this, [=](bool checked){
|
||||
Common::buriedSettings(name(), nopwdLoginFrame->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), nopwdLoginFrame->objectName(), QString("settings"), checked ? "true":"false");
|
||||
|
||||
UserInfomation user = allUserInfoMap.value(g_get_user_name());
|
||||
|
||||
|
@ -831,7 +828,7 @@ void UserInfo::setUserConnect(){
|
|||
});
|
||||
|
||||
connect(addUserBtn, &AddButton::clicked, [=]{
|
||||
Common::buriedSettings(name(), addUserBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), addUserBtn->objectName(), QString("settings"));
|
||||
|
||||
showCreateUserNewDialog();
|
||||
});
|
||||
|
@ -1337,11 +1334,10 @@ QStringList UserInfo::getLoginedUsers() {
|
|||
return m_loginedUser;
|
||||
}
|
||||
|
||||
void UserInfo::showChangeGroupDialog(){
|
||||
// ChangeGroupDialog * dialog = new ChangeGroupDialog(pluginWidget2);
|
||||
// dialog->exec();
|
||||
void UserInfo::showChangeGroupDialog()
|
||||
{
|
||||
changeUserGroup *dialog = new changeUserGroup(pluginWidget2);
|
||||
dialog->exec();
|
||||
dialog->exec();
|
||||
}
|
||||
|
||||
bool UserInfo::eventFilter(QObject *watched, QEvent *event){
|
||||
|
@ -1351,7 +1347,7 @@ bool UserInfo::eventFilter(QObject *watched, QEvent *event){
|
|||
if (mouseEvent->button() == Qt::LeftButton ){
|
||||
if ((watched == currentNickNameChangeLabel && currentNickNameChangeLabel->isEnabled())
|
||||
|| (watched == currentNickNameLabel && currentNickNameLabel->isEnabled())){
|
||||
Common::buriedSettings(name(), currentNickNameChangeLabel->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), currentNickNameChangeLabel->objectName(), QString("settings"));
|
||||
|
||||
showChangeUserNicknameDialog();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
#include "utilsforuserinfo.h"
|
||||
|
||||
#include "shell/interface.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "switchwidget.h"
|
||||
#include "settinggroup.h"
|
||||
#include "titlelabel.h"
|
||||
|
|
|
@ -41,22 +41,22 @@ UtilsForUserinfo::UtilsForUserinfo(QObject *parent) : QObject(parent)
|
|||
delUserBtn->setObjectName("Del");
|
||||
|
||||
connect(changePwdBtn, &QPushButton::clicked, this, [=]{
|
||||
Common::buriedSettings(QString("UtilsForUserinfo"), changePwdBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(QString("UtilsForUserinfo"), changePwdBtn->objectName(), QString("settings"));
|
||||
|
||||
emit changePwdBtnPressed();
|
||||
});
|
||||
connect(changeTypeBtn, &QPushButton::clicked, this, [=]{
|
||||
Common::buriedSettings(QString("UtilsForUserinfo"), changeTypeBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(QString("UtilsForUserinfo"), changeTypeBtn->objectName(), QString("settings"));
|
||||
|
||||
emit changeTypeBtnPressed();
|
||||
});
|
||||
connect(logoBtn, &QPushButton::clicked, this, [=]{
|
||||
Common::buriedSettings(QString("UtilsForUserinfo"), logoBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(QString("UtilsForUserinfo"), logoBtn->objectName(), QString("settings"));
|
||||
|
||||
emit changeLogoBtnPressed();
|
||||
});
|
||||
connect(delUserBtn, &QPushButton::clicked, this, [=]{
|
||||
Common::buriedSettings(QString("UtilsForUserinfo"), delUserBtn->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(QString("UtilsForUserinfo"), delUserBtn->objectName(), QString("settings"));
|
||||
|
||||
emit deleteUserBtnPressed();
|
||||
});
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
#include <QVariant>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "ukccframe.h"
|
||||
|
||||
class QFrame;
|
||||
|
|
|
@ -126,7 +126,7 @@ const QString UserInfoIntel::name() const {
|
|||
|
||||
bool UserInfoIntel::isShowOnHomePage() const
|
||||
{
|
||||
return Common::isTablet();
|
||||
return UkccCommon::isTablet();
|
||||
}
|
||||
|
||||
QIcon UserInfoIntel::icon() const
|
||||
|
@ -136,7 +136,7 @@ QIcon UserInfoIntel::icon() const
|
|||
|
||||
bool UserInfoIntel::isEnable() const
|
||||
{
|
||||
return Common::isTablet();
|
||||
return UkccCommon::isTablet();
|
||||
}
|
||||
|
||||
void UserInfoIntel::initSearchText() {
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
#include "picturetowhite.h"
|
||||
#include "messageboxpowerintel.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#ifdef ENABLEPQ
|
||||
extern "C" {
|
||||
|
|
|
@ -231,7 +231,7 @@ void AutoBoot::initItem(AutoApp &it)
|
|||
QAction* mDel = new QAction(tr("Delete"),this);
|
||||
pMenu->addAction(mDel);
|
||||
connect(mDel, &QAction::triggered, this, [=](){
|
||||
Common::buriedSettings(name(), "autoboot item " + bname, QString("settings"), "delete from list");
|
||||
UkccCommon::buriedSettings(name(), "autoboot item " + bname, QString("settings"), "delete from list");
|
||||
QMap<QString, AutoApp>::iterator iter = statusMaps.find(bname);
|
||||
if (iter == statusMaps.end()) {
|
||||
qDebug() << "AutoBoot Data Error";
|
||||
|
@ -313,7 +313,7 @@ void AutoBoot::checkboxChangedSlot(QString bname)
|
|||
{
|
||||
foreach (QString key, appgroupMultiMaps.keys()) {
|
||||
if (key == bname) {
|
||||
Common::buriedSettings(name(), "whether " + bname + " auto startup", QString("settings"), ((KSwitchButton *)appgroupMultiMaps.value(key))->isChecked() ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether " + bname + " auto startup", QString("settings"), ((KSwitchButton *)appgroupMultiMaps.value(key))->isChecked() ? "true" : "false");
|
||||
mAutobootDBus->call("saveAppStatus", bname, ((SwitchWidget *)appgroupMultiMaps.value(key))->isChecked());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include <QtPlugin>
|
||||
|
||||
#include "shell/interface.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "titlelabel.h"
|
||||
#include "hoverwidget.h"
|
||||
#include "switchwidget.h"
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include <QDBusArgument>
|
||||
|
||||
#include "defaultapp.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "service.h"
|
||||
|
||||
#define BROWSERTYPE "x-scheme-handler/http"
|
||||
|
@ -169,7 +170,7 @@ void DefaultApp::browserComBoBox_changed_cb(int index) {
|
|||
QString appid = mDefaultWidget->getBrowserWidget()->comboBox()->itemData(index).toString();
|
||||
mDefaultUkccDbus->call("setDefaultApp", appid, BROWSERTYPE);
|
||||
findSelectItem(mDefaultWidget->getBrowserWidget()->comboBox());
|
||||
Common::buriedSettings(name(), "the default browser", QString("settings"), appid);
|
||||
UkccCommon::buriedSettings(name(), "the default browser", QString("settings"), appid);
|
||||
qDebug()<<"browserComBoBox_changed_cb线程耗时:"<<timedebuge.elapsed()<<"ms";
|
||||
});
|
||||
}
|
||||
|
@ -182,7 +183,7 @@ void DefaultApp::mailComBoBox_changed_cb(int index) {
|
|||
QString appid = mDefaultWidget->getMailWidget()->comboBox()->itemData(index).toString();
|
||||
mDefaultUkccDbus->call("setDefaultApp", appid, MAILTYPE);
|
||||
findSelectItem(mDefaultWidget->getMailWidget()->comboBox());
|
||||
Common::buriedSettings(name(), "the defaultapp to open mail", QString("settings"), appid);
|
||||
UkccCommon::buriedSettings(name(), "the defaultapp to open mail", QString("settings"), appid);
|
||||
qDebug()<<"mailComBoBox_changed_cb线程耗时:"<<timedebuge.elapsed()<<"ms";
|
||||
});
|
||||
}
|
||||
|
@ -196,7 +197,7 @@ void DefaultApp::imageComBoBox_changed_cb(int index) {
|
|||
QString appid = mDefaultWidget->getImageWidget()->comboBox()->itemData(index).toString();
|
||||
mDefaultUkccDbus->call("setDefaultApp", appid, IMAGETYPE);
|
||||
findSelectItem(mDefaultWidget->getImageWidget()->comboBox());
|
||||
Common::buriedSettings(name(), "the defaultapp to open image", QString("settings"), appid);
|
||||
UkccCommon::buriedSettings(name(), "the defaultapp to open image", QString("settings"), appid);
|
||||
qDebug()<<"imageComBoBox_changed_cb线程耗时:"<<timedebuge.elapsed()<<"ms";
|
||||
});
|
||||
}
|
||||
|
@ -210,7 +211,7 @@ void DefaultApp::audioComBoBox_changed_cb(int index) {
|
|||
QString appid = mDefaultWidget->getAudioWidget()->comboBox()->itemData(index).toString();
|
||||
mDefaultUkccDbus->call("setDefaultApp", appid, AUDIOTYPE);
|
||||
findSelectItem(mDefaultWidget->getAudioWidget()->comboBox());
|
||||
Common::buriedSettings(name(), "the defaultapp to play audio", QString("settings"), appid);
|
||||
UkccCommon::buriedSettings(name(), "the defaultapp to play audio", QString("settings"), appid);
|
||||
qDebug()<<"audioComBoBox_changed_cb线程耗时:"<<timedebuge.elapsed()<<"ms";
|
||||
});
|
||||
}
|
||||
|
@ -224,7 +225,7 @@ void DefaultApp::videoComBoBox_changed_cb(int index) {
|
|||
QString appid = mDefaultWidget->getVideoWidget()->comboBox()->itemData(index).toString();
|
||||
mDefaultUkccDbus->call("setDefaultApp", appid, VIDEOTYPE);
|
||||
findSelectItem(mDefaultWidget->getAudioWidget()->comboBox());
|
||||
Common::buriedSettings(name(), "the defaultapp to play video", QString("settings"), appid);
|
||||
UkccCommon::buriedSettings(name(), "the defaultapp to play video", QString("settings"), appid);
|
||||
qDebug()<<"videoComBoBox_changed_cb线程耗时:"<<timedebuge.elapsed()<<"ms";
|
||||
});
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ void DefaultApp::textComBoBox_changed_cb(int index) {
|
|||
QString appid = mDefaultWidget->getTextWidget()->comboBox()->itemData(index).toString();
|
||||
mDefaultUkccDbus->call("setDefaultApp", appid, TEXTTYPE);
|
||||
findSelectItem(mDefaultWidget->getAudioWidget()->comboBox());
|
||||
Common::buriedSettings(name(), "the defaultapp to open text", QString("settings"), appid);
|
||||
UkccCommon::buriedSettings(name(), "the defaultapp to open text", QString("settings"), appid);
|
||||
qDebug()<<"textComBoBox_changed_cb线程耗时:"<<timedebuge.elapsed()<<"ms";
|
||||
});
|
||||
}
|
||||
|
@ -315,7 +316,7 @@ void DefaultApp::keyChangedSlot(const QString &key) {
|
|||
|
||||
void DefaultApp::reset()
|
||||
{
|
||||
Common::buriedSettings(name(), "reset defaultapp", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "reset defaultapp", QString("clicked"));
|
||||
if (!QFile(mLocalMimefile).exists())
|
||||
return;
|
||||
QFile(mLocalMimefile).remove();
|
||||
|
|
|
@ -85,7 +85,7 @@ QIcon KeyboardMain::icon() const
|
|||
|
||||
bool KeyboardMain::isEnable() const
|
||||
{
|
||||
return !Common::isWayland();
|
||||
return !UkccCommon::isWayland();
|
||||
}
|
||||
|
||||
void KeyboardMain::initConnection()
|
||||
|
@ -177,7 +177,7 @@ void KeyboardMain::keyRepeatSlot(bool checked)
|
|||
{
|
||||
setKeyboardVisible(checked);
|
||||
keyBoardDbus->call("setKeyRepeat", checked);
|
||||
Common::buriedSettings(name(), keyBoardWidget->keyRepeatFrame()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), keyBoardWidget->keyRepeatFrame()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
}
|
||||
|
||||
void KeyboardMain::keyDelaySlot(int value)
|
||||
|
@ -193,12 +193,12 @@ void KeyboardMain::keySpeedSlot(int value)
|
|||
void KeyboardMain::keyTipsSlot(bool checked)
|
||||
{
|
||||
keyBoardDbus->call("setKeyTips", checked);
|
||||
Common::buriedSettings(name(), keyBoardWidget->keyTipsFrame()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), keyBoardWidget->keyTipsFrame()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
}
|
||||
|
||||
void KeyboardMain::inputMethodSetSlot()
|
||||
{
|
||||
Common::buriedSettings(name(), keyBoardWidget->inputMethodPushButton()->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), keyBoardWidget->inputMethodPushButton()->objectName(), QString("settings"));
|
||||
|
||||
QProcess process;
|
||||
process.startDetached("fcitx5-config-qt");
|
||||
|
@ -209,10 +209,10 @@ bool KeyboardMain::eventFilter(QObject *watched, QEvent *event)
|
|||
if (event->type() == QEvent::FocusOut) {
|
||||
if (watched == keyBoardWidget->delayFrame()->slider()) {
|
||||
int value = keyBoardWidget->delayFrame()->value();
|
||||
Common::buriedSettings(name(), keyBoardWidget->delayFrame()->objectName(), QString("settings"), QString::number(value));
|
||||
UkccCommon::buriedSettings(name(), keyBoardWidget->delayFrame()->objectName(), QString("settings"), QString::number(value));
|
||||
} else if (watched == keyBoardWidget->speedFrame()->slider()) {
|
||||
int value = keyBoardWidget->speedFrame()->value();
|
||||
Common::buriedSettings(name(), keyBoardWidget->speedFrame()->objectName(), QString("settings"), QString::number(value));
|
||||
UkccCommon::buriedSettings(name(), keyBoardWidget->speedFrame()->objectName(), QString("settings"), QString::number(value));
|
||||
}
|
||||
}
|
||||
return QObject::eventFilter(watched, event);
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include <QtDBus/QDBusInterface>
|
||||
#include "shell/interface.h"
|
||||
#include "keyboardui.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
|
||||
class KeyboardMain : public QWidget, CommonInterface
|
||||
|
|
|
@ -18,8 +18,8 @@ void KeyboardUi::initUI()
|
|||
{
|
||||
mKeyboardFrame = new SettingGroup(this);
|
||||
mKeyboardSetTitleLabel = new TitleLabel(this);
|
||||
//~ contents_path /Keyboard/Key board settings
|
||||
mKeyboardSetTitleLabel->setText(tr("Key board settings"));
|
||||
//~ contents_path /Keyboard/Keyboard Settings
|
||||
mKeyboardSetTitleLabel->setText(tr("Keyboard Settings"));
|
||||
mKeyboardSetTitleLabel->setContentsMargins(16, 0, 0, 0);
|
||||
|
||||
setKeyRepeatFrame();
|
||||
|
@ -103,5 +103,6 @@ void KeyboardUi::setInputMethodFrame()
|
|||
//~ contents_path /Keyboard/Input settings
|
||||
mInputMethodSetBtn->setText(tr("Input settings"));
|
||||
mInputMethodSetBtn->setObjectName("Input settings");
|
||||
mInputMethodSetBtn->setFixedSize(QSize(160, 36));
|
||||
mInputMethodSetBtn->setMinimumWidth(160);
|
||||
mInputMethodSetBtn->setMaximumWidth(180);
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ void Mouse::dominantHandSlot(int id)
|
|||
|
||||
mouseDbus->call("setDominantHand", tmpLeftHand);
|
||||
|
||||
Common::buriedSettings(name(), mouseWidget->dominantHandWidget()->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->dominantHandWidget()->objectName(), QString("settings"));
|
||||
}
|
||||
|
||||
void Mouse::scrollDirectionSlot(int id)
|
||||
|
@ -272,7 +272,7 @@ void Mouse::scrollDirectionSlot(int id)
|
|||
|
||||
mouseDbus->call("setScrollDirection", tmpScrollDirection);
|
||||
|
||||
Common::buriedSettings(name(), mouseWidget->scrollDirectionWdiget()->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->scrollDirectionWdiget()->objectName(), QString("settings"));
|
||||
}
|
||||
|
||||
void Mouse::wheelSpeedSlot()
|
||||
|
@ -296,14 +296,14 @@ void Mouse::mouseAccelerationSlot(bool checked)
|
|||
{
|
||||
mouseDbus->call("setMouseAcceleration", checked);
|
||||
|
||||
Common::buriedSettings(name(), mouseWidget->mouseAccelerationWidget()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->mouseAccelerationWidget()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
}
|
||||
|
||||
void Mouse::pointerPositionSlot(bool checked)
|
||||
{
|
||||
mouseDbus->call("setPointerPosition", checked);
|
||||
|
||||
Common::buriedSettings(name(), mouseWidget->pointerPositionWidget()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->pointerPositionWidget()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
}
|
||||
|
||||
void Mouse::pointerSizeSlot(int id)
|
||||
|
@ -312,7 +312,7 @@ void Mouse::pointerSizeSlot(int id)
|
|||
|
||||
mouseDbus->call("setPointerSize", tmpPointerSize);
|
||||
|
||||
Common::buriedSettings(name(), mouseWidget->pointerSizeWidet()->objectName(), QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->pointerSizeWidet()->objectName(), QString("settings"));
|
||||
}
|
||||
|
||||
void Mouse::blinkCursorOnTextSlot(bool checked)
|
||||
|
@ -327,7 +327,7 @@ void Mouse::blinkCursorOnTextSlot(bool checked)
|
|||
mouseDbus->call("setCursorSpeed", mValue);
|
||||
}
|
||||
|
||||
Common::buriedSettings(name(), mouseWidget->cursorSpeedWidget()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->cursorSpeedWidget()->objectName(), QString("settings"), checked ? "true":"false");
|
||||
}
|
||||
|
||||
void Mouse::cursorSpeedSlot()
|
||||
|
@ -341,16 +341,16 @@ bool Mouse::eventFilter(QObject *watched, QEvent *event)
|
|||
if (event->type() == QEvent::FocusOut) {
|
||||
if (watched == mouseWidget->wheelSpeedWidget()->slider()) {
|
||||
int value = mouseWidget->wheelSpeedWidget()->value();
|
||||
Common::buriedSettings(name(), mouseWidget->wheelSpeedWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->wheelSpeedWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
} else if (watched == mouseWidget->doubleClickIntervalWidget()->slider()) {
|
||||
int value = mouseWidget->doubleClickIntervalWidget()->value();
|
||||
Common::buriedSettings(name(), mouseWidget->doubleClickIntervalWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->doubleClickIntervalWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
} else if (watched == mouseWidget->pointerSpeedWidget()->slider()) {
|
||||
int value = mouseWidget->pointerSpeedWidget()->value();
|
||||
Common::buriedSettings(name(), mouseWidget->pointerSpeedWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->pointerSpeedWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
} else if (watched == mouseWidget->cursorSpeedWidget()->slider()) {
|
||||
int value = mouseWidget->cursorSpeedWidget()->value();
|
||||
Common::buriedSettings(name(), mouseWidget->cursorSpeedWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
UkccCommon::buriedSettings(name(), mouseWidget->cursorSpeedWidget()->objectName(), QString("settings"), QString::number(value));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
#include <QToolButton>
|
||||
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include "titlelabel.h"
|
||||
#include "switchwidget.h"
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
*/
|
||||
#include "printer.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <QtPrintSupport/QPrinterInfo>
|
||||
#include <QProcess>
|
||||
|
@ -212,8 +213,8 @@ void Printer::refreshPrinterDevSlot()
|
|||
|
||||
void Printer::runExternalApp()
|
||||
{
|
||||
Common::buriedSettings(name(), "open system-config-printer", QString("clicked"));
|
||||
if (Common::isTablet() || Common::isWayland()) {
|
||||
UkccCommon::buriedSettings(name(), "open system-config-printer", QString("clicked"));
|
||||
if (UkccCommon::isTablet() || UkccCommon::isWayland()) {
|
||||
QDBusInterface ifc("com.kylin.AppManager",
|
||||
"/com/kylin/AppManager",
|
||||
"com.kylin.AppManager",
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
*/
|
||||
#include "shortcut.h"
|
||||
#include "realizeshortcutwheel.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include <QDebug>
|
||||
|
||||
/* qt会将glib里的signals成员识别为宏,所以取消该宏
|
||||
|
@ -180,7 +181,7 @@ void Shortcut::connectUiSignals()
|
|||
createNewShortcut(path, name, exec, key, true, true);
|
||||
shortcutInterface->call("updateShortcut");
|
||||
});
|
||||
Common::buriedSettings(this->name(), QString("AddBtn"), QString("clicked"));
|
||||
UkccCommon::buriedSettings(this->name(), QString("AddBtn"), QString("clicked"));
|
||||
addDialog->exec();
|
||||
});
|
||||
}
|
||||
|
@ -234,7 +235,7 @@ void Shortcut::createNewShortcut(QString path, QString name, QString exec, QStri
|
|||
availablepath = path; // 更新快捷键
|
||||
|
||||
if (convertFlag) {
|
||||
Common::buriedSettings(name, exec, QString("settings"), key);
|
||||
UkccCommon::buriedSettings(name, exec, QString("settings"), key);
|
||||
}
|
||||
// 更新数据
|
||||
for (int i = 0; i < customEntryList.count(); i++) {
|
||||
|
|
|
@ -146,7 +146,7 @@ void Fonts::setupConnect(){
|
|||
connectToServer();
|
||||
connect(mSlider, &KSlider::valueChanged, [=](int value){
|
||||
float size = sliderConvertToSize(value);
|
||||
Common::buriedSettings(name(), ui->fontSizeLabel->text(), QString("settings"), QString::number(size, 'f', 1));
|
||||
UkccCommon::buriedSettings(name(), ui->fontSizeLabel->text(), QString("settings"), QString::number(size, 'f', 1));
|
||||
// 获取当前字体信息
|
||||
getCurrentFontInfo();
|
||||
|
||||
|
@ -161,7 +161,7 @@ void Fonts::setupConnect(){
|
|||
connect(ui->fontSelectComBox, &QComboBox::currentTextChanged, [=](QString text){
|
||||
// 获取当前字体信息
|
||||
getCurrentFontInfo();
|
||||
Common::buriedSettings(name(), ui->fontSelectLabel->text(), QString("select"), text);
|
||||
UkccCommon::buriedSettings(name(), ui->fontSelectLabel->text(), QString("select"), text);
|
||||
ifsettings->set(GTK_FONT_KEY, QVariant(QString("%1 %2").arg(text).arg(gtkfontStrList.at(1))));
|
||||
ifsettings->set(DOC_FONT_KEY, QVariant(QString("%1 %2").arg(text).arg(docfontStrList.at(1))));
|
||||
stylesettings->set(SYSTEM_NAME_KEY, QVariant(QString("%1").arg(text)));
|
||||
|
@ -171,7 +171,7 @@ void Fonts::setupConnect(){
|
|||
connect(ui->monoSelectComBox, &QComboBox::currentTextChanged, [=](QString text){
|
||||
// 获取当前字体信息
|
||||
QVariant monoName = QVariant(QString("%1 %2").arg(text).arg(monospacefontStrList.at(1)));
|
||||
Common::buriedSettings(name(), ui->monoSelectLabel->text(), QString("select"), monoName.toString());
|
||||
UkccCommon::buriedSettings(name(), ui->monoSelectLabel->text(), QString("select"), monoName.toString());
|
||||
getCurrentFontInfo();
|
||||
ifsettings->set(MONOSPACE_FONT_KEY, monoName);
|
||||
mGnomeSettings->set(MONOSPACE_FONT_KEY, monoName);
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
#include <kslider.h>
|
||||
|
||||
#include "shell/interface.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
using namespace kdk;
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
*
|
||||
*/
|
||||
#include "screenlock.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
|
@ -146,17 +147,17 @@ void Screenlock::connectUiSignals()
|
|||
});
|
||||
connect(screenlockui, &ScreenlockUi::onlineButtonClicked, this, [=](){
|
||||
QDesktopServices::openUrl(QUrl(QLatin1String("https://www.ubuntukylin.com/wallpaper.html")));
|
||||
Common::buriedSettings(name(), QString("onlineBtnonlineButton"), QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), QString("onlineBtnonlineButton"), QString("clicked"));
|
||||
});
|
||||
connect(screenlockui, &ScreenlockUi::resetButtonClicked, this, [=](){
|
||||
screenlockInterface->call("resetDefault");
|
||||
});
|
||||
connect(screenlockui, &ScreenlockUi::toSetMonitor, this, [=](){
|
||||
Common::buriedSettings(name(), "setBtn(Monitor Off)", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "setBtn(Monitor Off)", QString("clicked"));
|
||||
QProcess::startDetached("ukui-control-center", QStringList() << "-m" << "Power");
|
||||
});
|
||||
connect(screenlockui, &ScreenlockUi::toSetScreensaver, this, [=](){
|
||||
Common::buriedSettings(name(), "setBtn(Screensaver)", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "setBtn(Screensaver)", QString("clicked"));
|
||||
QProcess::startDetached("ukui-control-center", QStringList() << "-m" << "Screensaver");
|
||||
});
|
||||
|
||||
|
@ -231,7 +232,7 @@ void Screenlock::showLocalWpDialog()
|
|||
process->start(program, arguments);
|
||||
|
||||
screenlockInterface->call("setWallpaper", selectedfile);
|
||||
Common::buriedSettings(name(), QString("browserLocalwpBtn"), QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), QString("browserLocalwpBtn"), QString("clicked"));
|
||||
}
|
||||
|
||||
void Screenlock::connectToServer()
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
#include "cursor/xcursortheme.h"
|
||||
#include "../../../shell/customstyle.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
// GTK主题
|
||||
#define THEME_GTK_SCHEMA "org.mate.interface"
|
||||
|
@ -225,7 +226,7 @@ void Theme::initSearchText() {
|
|||
|
||||
void Theme::setupSettings() {
|
||||
QString filename;
|
||||
if (Common::isOpenkylin()) {
|
||||
if (UkccCommon::isOpenkylin()) {
|
||||
filename = QDir::homePath() + "/.config/kwinrc";
|
||||
} else {
|
||||
filename = QDir::homePath() + "/.config/ukui-kwinrc";
|
||||
|
@ -281,8 +282,8 @@ void Theme::setupSettings() {
|
|||
|
||||
void Theme::setupComponent() {
|
||||
|
||||
mIsOpenkylin = Common::isOpenkylin();
|
||||
mDarkBtn->setVisible(!Common::isCommunity());
|
||||
mIsOpenkylin = UkccCommon::isOpenkylin();
|
||||
mDarkBtn->setVisible(!UkccCommon::isCommunity());
|
||||
|
||||
mDefaultBtn->setProperty("value", "ukui-default");
|
||||
mLightBtn->setProperty("value", "ukui-light");
|
||||
|
@ -299,7 +300,7 @@ void Theme::setupComponent() {
|
|||
revokeGlobalThemeSlot("getSupportTransparency", "true");
|
||||
});
|
||||
connect(ui->tranSlider, &MySlider::sliderClickedSignals, this, [=]() {
|
||||
Common::buriedSettings(name(), "set transparency", QString("settings"), QString::number(ui->tranSlider->value()));
|
||||
UkccCommon::buriedSettings(name(), "set transparency", QString("settings"), QString::number(ui->tranSlider->value()));
|
||||
});
|
||||
|
||||
//构建并填充特效开关按钮
|
||||
|
@ -378,9 +379,9 @@ void Theme::initIconTheme() {
|
|||
}
|
||||
}
|
||||
foreach (QString themedir, iconThemes) {
|
||||
if ((Common::isCommunity() && (!themedir.compare("ukui") || !themedir.compare("ukui-classical") || !themedir.compare("ukui-fashion"))) ||
|
||||
(!Common::isCommunity()) ||
|
||||
(Common::isTablet() && (!themedir.compare("ukui") || themedir.startsWith("ukui-classical")))) {
|
||||
if ((UkccCommon::isCommunity() && (!themedir.compare("ukui") || !themedir.compare("ukui-classical") || !themedir.compare("ukui-fashion"))) ||
|
||||
(!UkccCommon::isCommunity()) ||
|
||||
(UkccCommon::isTablet() && (!themedir.compare("ukui") || themedir.startsWith("ukui-classical")))) {
|
||||
|
||||
if (("ukui-icon-theme-basic" == themedir) || ("ukui-icon-theme-default" == themedir) || ("ukui-hp" == themedir)
|
||||
||("ukui-icon-theme-fashion" == themedir) || ("ukui-icon-theme-classical" == themedir)) {
|
||||
|
@ -458,7 +459,7 @@ void Theme::initControlTheme()
|
|||
}
|
||||
|
||||
void Theme::initCursorTheme(){
|
||||
if (Common::isTablet() || Common::isWayland())
|
||||
if (UkccCommon::isTablet() || UkccCommon::isWayland())
|
||||
return;
|
||||
|
||||
mThemeCursorFrame = new QFrame(pluginWidget);
|
||||
|
@ -602,12 +603,12 @@ void Theme::initJumpTheme()
|
|||
ui->jumpLyt->addWidget(mRelatedGroup);
|
||||
|
||||
connect(mWallWidget, &PushButtonWidget::clicked, this, [=]{
|
||||
Common::buriedSettings(name(), mBeepWidget->objectName(), QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), mBeepWidget->objectName(), QString("clicked"));
|
||||
jumpFunctionSlot("wallpaper");
|
||||
});
|
||||
|
||||
connect(mBeepWidget, &PushButtonWidget::clicked, this, [=]{
|
||||
Common::buriedSettings(name(), mBeepWidget->objectName(), QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), mBeepWidget->objectName(), QString("clicked"));
|
||||
jumpFunctionSlot("audio");
|
||||
});
|
||||
}
|
||||
|
@ -616,7 +617,7 @@ void Theme::initConnection()
|
|||
{
|
||||
connect(ui->resetBtn, &QPushButton::clicked, this, &Theme::resetBtnClickSlot);
|
||||
connect(effectSwitchBtn, &KSwitchButton::stateChanged, [this](bool checked) {
|
||||
Common::buriedSettings(name(), "whether open effect mode", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether open effect mode", QString("settings"), checked ? "true" : "false");
|
||||
revokeGlobalThemeSlot("getBlurEnabled", checked ? "true" : "false");
|
||||
revokeGlobalThemeSlot("getSupportBlur", "true");
|
||||
|
||||
|
@ -671,7 +672,7 @@ void Theme::initConnection()
|
|||
}
|
||||
});
|
||||
|
||||
if (!Common::isOpenkylin()) {
|
||||
if (!UkccCommon::isOpenkylin()) {
|
||||
connect(curSettings, &QGSettings::changed, this, [=](const QString &key) {
|
||||
if (key == "cursorTheme") {
|
||||
QString cursorTheme = curSettings->get(CURSOR_THEME_KEY).toString();
|
||||
|
@ -688,7 +689,7 @@ void Theme::initConnection()
|
|||
|
||||
connect(personliseGsettings, &QGSettings::changed,this,[=] (const QString &key) {
|
||||
if (key == "effect") {
|
||||
if (Common::isOpenkylin())
|
||||
if (UkccCommon::isOpenkylin())
|
||||
qApp->setStyle(new InternalStyle("ukui"));
|
||||
bool effectEnabled = personliseGsettings->get("effect").toBool();
|
||||
effectSwitchBtn->blockSignals(true);
|
||||
|
@ -730,7 +731,7 @@ void Theme::initIconThemeWidget(QString themedir , FlowLayout *horLyt)
|
|||
QStringList showIconsList;
|
||||
QStringList realIconsList;
|
||||
|
||||
if (!Common::isTablet()) {
|
||||
if (!UkccCommon::isTablet()) {
|
||||
realIconsList = defaultIconList;
|
||||
} else {
|
||||
realIconsList = kIntelIconList;
|
||||
|
@ -951,11 +952,11 @@ void Theme::hideComponent()
|
|||
ui->resetBtn->setVisible(false);
|
||||
mDefaultBtn->setVisible(false);
|
||||
|
||||
if (Common::isOpenkylin()) {
|
||||
if (UkccCommon::isOpenkylin()) {
|
||||
mAutoBtn->setVisible(false);
|
||||
}
|
||||
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
ui->transFrame->setVisible(false);
|
||||
ui->line->setVisible(false);
|
||||
}
|
||||
|
@ -997,15 +998,15 @@ QString Theme::dullTranslation(QString str) {
|
|||
if (!QString::compare(str, "basic")){
|
||||
return tr("basic");
|
||||
} else if (!QString::compare(str, "classical")) { // 启典
|
||||
return Common::isTablet() ? tr("classic") : tr("Classic");
|
||||
return UkccCommon::isTablet() ? tr("classic") : tr("Classic");
|
||||
} else if (!QString::compare(str, "default") || !QString::compare(str, "xunguang")) { // 寻光
|
||||
return Common::isTablet() ? tr("basic") : tr("Light-Seeking");
|
||||
return UkccCommon::isTablet() ? tr("basic") : tr("Light-Seeking");
|
||||
} else if (!QString::compare(str, "fashion") || !QString::compare(str, "heyin")) { // 和印
|
||||
return tr("HeYin");
|
||||
} else if (!QString::compare(str, "hp")) {
|
||||
return tr("hp");
|
||||
} else if (!QString::compare(str, "ukui")) {
|
||||
return Common::isTablet() ? tr("basic") : tr("ukui");
|
||||
return UkccCommon::isTablet() ? tr("basic") : tr("ukui");
|
||||
} else if (!QString::compare(str, "daybreakBlue")) {
|
||||
return tr("daybreakBlue");
|
||||
} else if (!QString::compare(str, "jamPurple")) {
|
||||
|
@ -1107,7 +1108,7 @@ void Theme::themeBtnClickSlot(QAbstractButton *button) {
|
|||
QString themeMode = button->property("value").toString();
|
||||
QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString();
|
||||
QString tmpMode;
|
||||
Common::buriedSettings(name(), "set theme mode", QString("settings"), themeMode);
|
||||
UkccCommon::buriedSettings(name(), "set theme mode", QString("settings"), themeMode);
|
||||
|
||||
if (QString::compare(currentThemeMode, themeMode)) {
|
||||
if ("ukui-dark" == themeMode) {
|
||||
|
@ -1146,7 +1147,7 @@ void Theme::changeGlobalThemeSlot(QAbstractButton *button)
|
|||
theme = globaltheme;
|
||||
}
|
||||
if (!theme) return;
|
||||
Common::buriedSettings(name(), "set theme", QString("settings"), value.toString());
|
||||
UkccCommon::buriedSettings(name(), "set theme", QString("settings"), value.toString());
|
||||
|
||||
if (mPrePicUnit != nullptr) mPrePicUnit->setBtnClicked(false);
|
||||
|
||||
|
@ -1286,8 +1287,8 @@ void Theme::changeEffectSlot(bool checked)
|
|||
}
|
||||
// 提供给外部监听特效接口
|
||||
personliseGsettings->set(PERSONALSIE_EFFECT_KEY, checked);
|
||||
ui->transFrame->setVisible(checked && !Common::isTablet());
|
||||
ui->line->setVisible(checked && !Common::isTablet());
|
||||
ui->transFrame->setVisible(checked && !UkccCommon::isTablet());
|
||||
ui->line->setVisible(checked && !UkccCommon::isTablet());
|
||||
}
|
||||
|
||||
void Theme::changeEffectBtnSlot(bool checked)
|
||||
|
@ -1322,7 +1323,7 @@ void Theme::iconThemeBtnClickSlot(QAbstractButton *button)
|
|||
{
|
||||
// 设置图标主题
|
||||
QVariant valueVariant = button->property("value");
|
||||
Common::buriedSettings(name(), "set icon theme", QString("settings"), valueVariant.toString());
|
||||
UkccCommon::buriedSettings(name(), "set icon theme", QString("settings"), valueVariant.toString());
|
||||
qtSettings->set(ICON_QT_KEY, valueVariant);
|
||||
gtkSettings->set(ICON_GTK_KEY, valueVariant);
|
||||
|
||||
|
@ -1333,7 +1334,7 @@ void Theme::cursorThemeBtnClickSlot(QAbstractButton *button)
|
|||
{
|
||||
// 设置光标主题
|
||||
QVariant valueVariant = button->property("value");
|
||||
Common::buriedSettings(name(), "set cursor theme", QString("settings"), valueVariant.toString());
|
||||
UkccCommon::buriedSettings(name(), "set cursor theme", QString("settings"), valueVariant.toString());
|
||||
curSettings->set(CURSOR_THEME_KEY, valueVariant);
|
||||
kwinCursorSlot(valueVariant.toString());
|
||||
revokeGlobalThemeSlot("getCursorThemeName", valueVariant.toString());
|
||||
|
|
|
@ -178,7 +178,7 @@ void Wallpaper::connectUiSignals()
|
|||
});
|
||||
connect(wallpaperUi, &WallpaperUi::onlineButtonClicked, this, [=](){
|
||||
QDesktopServices::openUrl(QUrl(QLatin1String("https://www.ubuntukylin.com/wallpaper.html")));
|
||||
Common::buriedSettings(name(), QString("onlineBtn"), QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), QString("onlineBtn"), QString("clicked"));
|
||||
});
|
||||
connect(wallpaperUi, &WallpaperUi::resetButtonClicked, this, [=](){
|
||||
wallpaperInterface->call("resetDefault");
|
||||
|
@ -261,5 +261,5 @@ void Wallpaper::showLocalWpDialog()
|
|||
QString bgfile = "/tmp/" + fileRes.at(fileRes.length() - 1);
|
||||
|
||||
wallpaperInterface->call("setWallpaper", "picture", selectedfile);
|
||||
Common::buriedSettings(name(), QString("browserLocalwpBtn"), QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), QString("browserLocalwpBtn"), QString("clicked"));
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
|
||||
#include "shell/interface.h"
|
||||
#include "wallpaperui.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
#include <QFileDialog>
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include <QFile>
|
||||
#include <QDebug>
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include <kysdk/kysdk-system/libkysysinfo.h>
|
||||
|
||||
const QString kDesktopfp = "/usr/share/applications/yhkylin-backup-tools.desktop";
|
||||
|
@ -165,7 +166,7 @@ void Backup::initTitleLabel()
|
|||
|
||||
void Backup::initConnection()
|
||||
{
|
||||
if (Common::isCommunity()) {
|
||||
if (UkccCommon::isCommunity()) {
|
||||
connect(mBackBtn, &QPushButton::clicked, this, [=](bool checked){
|
||||
Q_UNUSED(checked)
|
||||
communitySlot();
|
||||
|
@ -190,7 +191,7 @@ void Backup::initConnection()
|
|||
|
||||
void Backup::btnClickedSlot()
|
||||
{
|
||||
Common::buriedSettings(name(), "open the backup restore application", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "open the backup restore application", QString("clicked"));
|
||||
QString desktopfp = "/usr/share/applications/yhkylin-backup-tools.desktop";
|
||||
GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data());
|
||||
g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr);
|
||||
|
@ -199,7 +200,7 @@ void Backup::btnClickedSlot()
|
|||
|
||||
void Backup::restoreSlot()
|
||||
{
|
||||
Common::buriedSettings(name(), "open the backup restore application", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "open the backup restore application", QString("clicked"));
|
||||
QString desktopfp = "/usr/share/applications/yhkylin-backup-tools.desktop";
|
||||
GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data());
|
||||
|
||||
|
@ -211,7 +212,7 @@ void Backup::restoreSlot()
|
|||
|
||||
void Backup::communitySlot()
|
||||
{
|
||||
Common::buriedSettings(name(), "open the backup restore application", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "open the backup restore application", QString("clicked"));
|
||||
QString cmd = "/usr/bin/deja-dup";
|
||||
QProcess process(this);
|
||||
process.startDetached(cmd);
|
||||
|
|
|
@ -175,13 +175,13 @@ void About::setConnect()
|
|||
connect(mAboutWidget->getActivationBtn(), &QPushButton::clicked, this, &About::runActiveWindow);
|
||||
|
||||
connect(mAboutWidget->getTrialBtn(), &KBorderlessButton::clicked, this, [=]() {
|
||||
Common::buriedSettings(name(), "show trial exemption agreement", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "show trial exemption agreement", QString("clicked"));
|
||||
TrialDialog *dialog = new TrialDialog(mAboutWidget);
|
||||
dialog->exec();
|
||||
});
|
||||
|
||||
connect(mAboutWidget->getAgreeBtn(), &KBorderlessButton::clicked, this, [=]() {
|
||||
Common::buriedSettings(name(), "show user privacy agreement", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "show user privacy agreement", QString("clicked"));
|
||||
PrivacyDialog *dialog = new PrivacyDialog(mAboutWidget);
|
||||
dialog->exec();
|
||||
});
|
||||
|
@ -341,7 +341,7 @@ void About::setupKernelCompenent()
|
|||
mAboutWidget->getKerner()->setText(kernal);
|
||||
mAboutWidget->getMemeory()->setText(memorySize);
|
||||
|
||||
cpuType = Common::getCpuInfo();
|
||||
cpuType = UkccCommon::getCpuInfo();
|
||||
mAboutWidget->getCpuInfo()->setText(cpuType);
|
||||
}
|
||||
|
||||
|
@ -420,12 +420,12 @@ void About::setupDiskCompenet()
|
|||
|
||||
void About::setHostNameCompenet()
|
||||
{
|
||||
mAboutWidget->getHostName()->setText(Common::getHostName());
|
||||
mAboutWidget->getHostName()->setText(UkccCommon::getHostName());
|
||||
}
|
||||
|
||||
void About::setPrivacyCompent()
|
||||
{
|
||||
if (Common::isWayland())
|
||||
if (UkccCommon::isWayland())
|
||||
return;
|
||||
QDBusInterface *PriDBus = new QDBusInterface("com.kylin.daq",
|
||||
"/com/kylin/daq",
|
||||
|
@ -440,7 +440,7 @@ void About::setPrivacyCompent()
|
|||
mAboutWidget->getPriBtn()->blockSignals(false);
|
||||
|
||||
connect(mAboutWidget->getPriBtn(),&KSwitchButton::stateChanged ,this ,[=](bool status){
|
||||
Common::buriedSettings(name(), "Send optional diagnostic data", QString("settings"), status ? "true": "false");
|
||||
UkccCommon::buriedSettings(name(), "Send optional diagnostic data", QString("settings"), status ? "true": "false");
|
||||
PriDBus->call("SetUploadState" , (status ? 1 : 0));
|
||||
} );
|
||||
}
|
||||
|
@ -501,11 +501,11 @@ bool About::eventFilter(QObject *obj, QEvent *event)
|
|||
if (event->type() == QEvent::MouseButtonPress){
|
||||
QMouseEvent * mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton ){
|
||||
QString str = Common::getHostName();
|
||||
QString str = UkccCommon::getHostName();
|
||||
HostNameDialog *dialog = new HostNameDialog(mAboutWidget);
|
||||
QWidget *widget = qApp->activeWindow(); // 记录mainwindow的地址,exec之后,activeWindow会变成空值
|
||||
dialog->exec();
|
||||
if (str != Common::getHostName()) {
|
||||
if (str != UkccCommon::getHostName()) {
|
||||
QMessageBox *mReboot = new QMessageBox(widget);
|
||||
mReboot->setIcon(QMessageBox::Warning);
|
||||
mReboot->setText(tr("The system needs to be restarted to set the HostName, whether to reboot"));
|
||||
|
@ -518,8 +518,8 @@ bool About::eventFilter(QObject *obj, QEvent *event)
|
|||
reboot();
|
||||
break;
|
||||
}
|
||||
mAboutWidget->getHostName()->setText(Common::getHostName());
|
||||
Common::buriedSettings(name(), "change hostname", QString("settings"), Common::getHostName());
|
||||
mAboutWidget->getHostName()->setText(UkccCommon::getHostName());
|
||||
UkccCommon::buriedSettings(name(), "change hostname", QString("settings"), UkccCommon::getHostName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ bool About::eventFilter(QObject *obj, QEvent *event)
|
|||
if (event->type() == QEvent::MouseButtonPress){
|
||||
QMouseEvent * mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton && !mAboutWidget->getSequenceContent()->text().isEmpty()){
|
||||
Common::buriedSettings(name(), "show activation info", QString("clicked"));
|
||||
UkccCommon::buriedSettings(name(), "show activation info", QString("clicked"));
|
||||
if (!dateRes.isEmpty())
|
||||
compareTime(dateRes);
|
||||
StatusDialog *dialog = new StatusDialog(mAboutWidget);
|
||||
|
@ -632,7 +632,7 @@ void About::securityControl()
|
|||
mAboutWidget->getInstallDateFrame()->hide();
|
||||
mAboutWidget->getUpgradeDateFrame()->hide();
|
||||
// 安全管控 安装时间及系统更新时间的显示与隐藏
|
||||
QVariantMap ModuleMap = Common::getModuleHideStatus();
|
||||
QVariantMap ModuleMap = UkccCommon::getModuleHideStatus();
|
||||
QString moduleSettings = ModuleMap.value(name().toLower() + "Settings").toString();
|
||||
QStringList setItems = moduleSettings.split(",");
|
||||
|
||||
|
@ -698,7 +698,7 @@ void About::activeSlot(int activeSignal)
|
|||
/* 打开激活窗口 */
|
||||
void About::runActiveWindow()
|
||||
{
|
||||
Common::buriedSettings(name(), "Activate the system or extend the service", QString("settings"));
|
||||
UkccCommon::buriedSettings(name(), "Activate the system or extend the service", QString("settings"));
|
||||
mAboutDBus->call("openActivation");
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@
|
|||
|
||||
#include "aboutui.h"
|
||||
#include "HpQRCodeInterface.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "hostnamedialog.h"
|
||||
#include "privacydialog.h"
|
||||
#include "statusdialog.h"
|
||||
|
|
|
@ -36,7 +36,7 @@ void AboutUi::initUi()
|
|||
setShape(mInformationFrame, QFrame::Box);
|
||||
|
||||
QVBoxLayout *mInformationLayout = new QVBoxLayout(mInformationFrame);
|
||||
int space = Common::isTablet() ? 32 : 16;
|
||||
int space = UkccCommon::isTablet() ? 32 : 16;
|
||||
mInformationLayout->setContentsMargins(space, space, space, space);
|
||||
|
||||
/* LOGO */
|
||||
|
@ -380,7 +380,7 @@ void AboutUi::initSearchText()
|
|||
|
||||
void AboutUi::setComponent()
|
||||
{
|
||||
if (!Common::isTablet()) {
|
||||
if (!UkccCommon::isTablet()) {
|
||||
mDiskFrame->hide();
|
||||
mHoldWidget->hide();
|
||||
mHoldTitleLabel->hide();
|
||||
|
@ -395,7 +395,7 @@ void AboutUi::setComponent()
|
|||
mTrialBtn->hide();
|
||||
mPatchVersionFrame->hide();
|
||||
}
|
||||
if (Common::isWayland() || Common::isOpenkylin()) {
|
||||
if (UkccCommon::isWayland() || UkccCommon::isOpenkylin()) {
|
||||
mPrivacyFrame->hide();
|
||||
mPriTitleLabel->hide();
|
||||
mAgreeBtn->hide();
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
#include <QHBoxLayout>
|
||||
|
||||
#include "HpQRCodeInterface.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "hostnamedialog.h"
|
||||
#include "privacydialog.h"
|
||||
#include "statusdialog.h"
|
||||
|
|
|
@ -138,7 +138,7 @@ void HostNameDialog::setEdit()
|
|||
|
||||
void HostNameDialog::setupComponent()
|
||||
{
|
||||
mfirsthostname = Common::getHostName();
|
||||
mfirsthostname = UkccCommon::getHostName();
|
||||
mHostNameEdit->setText(mfirsthostname);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ void HostNameDialog::setHostname(QString hostname)
|
|||
delete process;
|
||||
|
||||
//修改/etc/hosts文件中的主机名
|
||||
hostname = Common::getHostName();
|
||||
hostname = UkccCommon::getHostName();
|
||||
QDBusInterface *sethostnameDbus = new QDBusInterface("com.control.center.qt.systemdbus",
|
||||
"/",
|
||||
"com.control.center.interface",
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
class HostNameDialog : public QDialog
|
||||
{
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include <unistd.h>
|
||||
#include <QDBusReply>
|
||||
#include <QDBusInterface>
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#define POWER_SCHMES "org.ukui.power-manager"
|
||||
#define POWER_KEY "brightness-ac"
|
||||
|
@ -138,7 +139,7 @@ void BrightnessFrame::runConnectThread(const bool &openFlag)
|
|||
qDebug()<<outputName<<"brightness"<<" is changed, value = "<<slider->value();
|
||||
setTextLabelValue(QString::number(slider->value()));
|
||||
setDDCBrightness(slider->value());
|
||||
Common::buriedSettings(QString("display"), QString("Brightness-pc"), QString("settings"), QString::number(slider->value()));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("Brightness-pc"), QString("settings"), QString::number(slider->value()));
|
||||
});
|
||||
});
|
||||
mGetBrightnessThread->start();
|
||||
|
@ -169,7 +170,7 @@ void BrightnessFrame::runConnectThread(const bool &openFlag)
|
|||
mPowerGSettings->set(POWER_KEY, slider->value());
|
||||
mPowerGSettings->blockSignals(false);
|
||||
setTextLabelValue(QString::number(mPowerGSettings->get(POWER_KEY).toInt()));
|
||||
Common::buriedSettings(QString("display"), QString("Brightness-book"), QString("settings"), QString::number(slider->value()));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("Brightness-book"), QString("settings"), QString::number(slider->value()));
|
||||
});
|
||||
disconnect(mPowerGSettings,&QGSettings::changed,this,0);
|
||||
connect(mPowerGSettings,&QGSettings::changed,this,[=](QString key){
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
|
||||
#include "display.h"
|
||||
#include "ui_display.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <KF5/KScreen/kscreen/getconfigoperation.h>
|
||||
#include <KF5/KScreen/kscreen/output.h>
|
||||
|
@ -78,7 +79,7 @@ const QString DisplaySet::name() const
|
|||
|
||||
bool DisplaySet::isShowOnHomePage() const
|
||||
{
|
||||
return !Common::isWayland();
|
||||
return true;
|
||||
}
|
||||
|
||||
QIcon DisplaySet::icon() const
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#include "resolutionslider.h"
|
||||
#include "utils.h"
|
||||
#include "scalesize.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <QStringBuilder>
|
||||
#include <QFormLayout>
|
||||
|
@ -98,7 +99,7 @@ void OutputConfig::initUi()
|
|||
this, [=](QSize size, bool emitFlag){
|
||||
slotResolutionChanged(size, emitFlag);
|
||||
scaleChanged(size);
|
||||
Common::buriedSettings(QString("display"), QString("mResolution"), QString("select"), Utils::sizeToString(size));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mResolution"), QString("select"), Utils::sizeToString(size));
|
||||
});
|
||||
|
||||
// 方向下拉框
|
||||
|
@ -199,7 +200,7 @@ void OutputConfig::initUi()
|
|||
|
||||
initConnection();
|
||||
|
||||
if (!(Common::isOpenkylin() && Common::isWayland()))
|
||||
if (!(UkccCommon::isOpenkylin() && UkccCommon::isWayland()))
|
||||
return;
|
||||
// 缩放率下拉框
|
||||
|
||||
|
@ -438,7 +439,7 @@ void OutputConfig::slotRotationChanged(int index)
|
|||
changeItm = ORIENTATION;
|
||||
Q_EMIT toSetScreenPos();//要在save之前修正坐标
|
||||
Q_EMIT changed();
|
||||
Common::buriedSettings(QString("display"), QString("mRotation"), QString("select"), QString::number(index));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mRotation"), QString("select"), QString::number(index));
|
||||
//widget.cpp中收到changed信号会延迟200+1000ms,因此这里相应延迟,避免接收到信号改变导致方向多次修改。
|
||||
QTimer::singleShot(1400, this, [=](){
|
||||
mOutput.data()->blockSignals(false);
|
||||
|
@ -491,7 +492,7 @@ void OutputConfig::slotRefreshRateChanged(int index)
|
|||
mOutput->blockSignals(false);
|
||||
changeItm = FREQUENCY;
|
||||
Q_EMIT changed();
|
||||
Common::buriedSettings(QString("display"), QString("mRefreshRate"), QString("select"), mRefreshRate->currentText());
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mRefreshRate"), QString("select"), mRefreshRate->currentText());
|
||||
}
|
||||
|
||||
void OutputConfig::slotEnableWidget()
|
||||
|
@ -523,7 +524,7 @@ void OutputConfig::initConfig(const KScreen::ConfigPtr &config)
|
|||
|
||||
void OutputConfig::initScaleItem()
|
||||
{
|
||||
if (!Common::isOpenkylin() && !Common::isWayland())
|
||||
if (!UkccCommon::isOpenkylin() && !UkccCommon::isWayland())
|
||||
return;
|
||||
mScaleCombox->blockSignals(true);
|
||||
if (!mOutput->currentMode())
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#include "resolutionslider.h"
|
||||
#include "scalesize.h"
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QIcon>
|
||||
|
@ -105,7 +106,7 @@ void UnifiedOutputConfig::initUi()
|
|||
this, [=](QSize size, bool emitFlag){
|
||||
slotResolutionChanged(size, emitFlag);
|
||||
emit scaleChanged(size);
|
||||
Common::buriedSettings(QString("display"), QString("U-mResolution"), QString("select"), Utils::sizeToString(size));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("U-mResolution"), QString("select"), Utils::sizeToString(size));
|
||||
});
|
||||
|
||||
// 方向下拉框
|
||||
|
@ -222,7 +223,7 @@ void UnifiedOutputConfig::initUi()
|
|||
}
|
||||
});
|
||||
|
||||
if (!(Common::isOpenkylin() && Common::isWayland()))
|
||||
if (!(UkccCommon::isOpenkylin() && UkccCommon::isWayland()))
|
||||
return;
|
||||
|
||||
UkccFrame *scaleFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true);
|
||||
|
@ -422,7 +423,7 @@ void UnifiedOutputConfig::slotRefreshRateChanged(int index)
|
|||
}
|
||||
changeItm = FREQUENCY;
|
||||
Q_EMIT changed();
|
||||
Common::buriedSettings(QString("display"), QString("U-mRefreshRate"), QString("select"), mRefreshRate->currentText());
|
||||
UkccCommon::buriedSettings(QString("display"), QString("U-mRefreshRate"), QString("select"), mRefreshRate->currentText());
|
||||
}
|
||||
|
||||
void UnifiedOutputConfig::slotScaleChanged(int index)
|
||||
|
@ -466,7 +467,7 @@ void UnifiedOutputConfig::slotRotationChangedDerived(int index)
|
|||
}
|
||||
changeItm = ORIENTATION;
|
||||
Q_EMIT changed();
|
||||
Common::buriedSettings(QString("display"), QString("U-mRotation"), QString("select"), QString::number(index));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("U-mRotation"), QString("select"), QString::number(index));
|
||||
}
|
||||
|
||||
void UnifiedOutputConfig::rotationDbusSlot(bool autoRotation)
|
||||
|
@ -550,7 +551,7 @@ bool UnifiedOutputConfig::isCloneMode()
|
|||
|
||||
void UnifiedOutputConfig::initScaleItem()
|
||||
{
|
||||
if (!Common::isOpenkylin() && !Common::isWayland())
|
||||
if (!UkccCommon::isOpenkylin() && !UkccCommon::isWayland())
|
||||
return;
|
||||
mScaleCombox->blockSignals(true);
|
||||
if (!mOutput->currentMode())
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include "displayperformancedialog.h"
|
||||
#include "colorinfo.h"
|
||||
#include "scalesize.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QTimer>
|
||||
|
@ -108,7 +109,7 @@ Widget::Widget(QWidget *parent) :
|
|||
QWidget(parent),
|
||||
ui(new Ui::DisplayWindow())
|
||||
{
|
||||
cpuArchitecture = Common::getCpuArchitecture();
|
||||
cpuArchitecture = UkccCommon::getCpuArchitecture();
|
||||
qRegisterMetaType<QQuickView *>();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
@ -244,7 +245,7 @@ void Widget::setConfig(const KScreen::ConfigPtr &config)
|
|||
compareScale();
|
||||
if (mIsSCaleRes) {
|
||||
mIsSCaleRes = false;
|
||||
showZoomtips();
|
||||
showZoomtips();
|
||||
}
|
||||
}
|
||||
mFirstLoad = false;
|
||||
|
@ -711,7 +712,7 @@ void Widget::setcomBoxScale()
|
|||
|
||||
void Widget::initAutoBrihgtUI()
|
||||
{
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
//~ contents_path /Display/Auto Brightness
|
||||
QHBoxLayout *autoBrightLayout = new QHBoxLayout(autoBrightFrame);
|
||||
QHBoxLayout *backLightLayout = new QHBoxLayout(backLightFrame);
|
||||
|
@ -743,7 +744,7 @@ void Widget::initAutoBrihgtUI()
|
|||
mAutoBrightBtn->setChecked(mAutoBrightSettings->get(BRIGHT_KEY).toBool());
|
||||
connect(mAutoBrightBtn, &KSwitchButton::stateChanged, this, [=](bool status) {
|
||||
mAutoBrightSettings->set(BRIGHT_KEY, status);
|
||||
Common::buriedSettings(QString("display"), QString("mAutoBrightBtn"), QString("clicked"), Common::boolToString(status));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mAutoBrightBtn"), QString("clicked"), UkccCommon::boolToString(status));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -751,7 +752,7 @@ void Widget::initAutoBrihgtUI()
|
|||
mBackBrightBtn->setChecked(mAutoBrightSettings->get(DYNAMIC_BRIHT_KEY).toBool());
|
||||
connect(mBackBrightBtn, &KSwitchButton::stateChanged, this, [=](bool status) {
|
||||
mAutoBrightSettings->set(DYNAMIC_BRIHT_KEY, status);
|
||||
Common::buriedSettings(QString("display"), QString("mBackBrightBtn"), QString("clicked"), Common::boolToString(status));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mBackBrightBtn"), QString("clicked"), UkccCommon::boolToString(status));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -857,7 +858,7 @@ bool Widget::isRestoreConfig()
|
|||
|
||||
QString Widget::getCpuInfo()
|
||||
{
|
||||
return Common::getCpuInfo();
|
||||
return UkccCommon::getCpuInfo();
|
||||
}
|
||||
|
||||
bool Widget::isCloneMode()
|
||||
|
@ -889,6 +890,7 @@ bool Widget::isBacklight()
|
|||
QDBusReply<QString> m_reply;
|
||||
m_reply = ukccIfc.call("getDmidecodeType");
|
||||
if (m_reply.isValid()) {
|
||||
mMachineType = m_reply.value();
|
||||
if (m_reply.value() == "all in one") { //一体机
|
||||
return isBacklightAllInOne();
|
||||
} else if (m_reply.value() == "notebook") { //笔记本
|
||||
|
@ -1099,7 +1101,7 @@ void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash)
|
|||
}
|
||||
#endif
|
||||
|
||||
if ((mIsBattery && name != firstAddOutputName) || (Common::getProductName().startsWith("MT") && !mIsBattery)) //笔记本非内置
|
||||
if ((mIsBattery && name != firstAddOutputName) || (UkccCommon::getProductName().startsWith("MT") && !mIsBattery)) //笔记本非内置
|
||||
return;
|
||||
|
||||
if (mIsBattery) { //移除之前的亮度条,适用于kscreen返回当前为笔记本屏幕,但之前已经把第一个屏幕当做笔记本屏幕的情况
|
||||
|
@ -1165,8 +1167,7 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged)
|
|||
}
|
||||
|
||||
//bug:124276,特殊判断为笔记本屏幕
|
||||
if (output->type() == 14 && Common::getCpuInfo() == "Phytium,D2000/8 ULP8C"
|
||||
&& Utils::outputName(output) == "DP-2" && output->isConnected()) {
|
||||
if (output->type() == 14 && UkccCommon::getCpuInfo() == "Phytium,D2000/8 ULP8C" && Utils::outputName(output) == "DP-2" && output->isConnected()) {
|
||||
bool flag = true;
|
||||
for (const KScreen::ModePtr &mode : output->modes()) {
|
||||
//该机器内置屏只有1920*1080分辨率
|
||||
|
@ -1180,6 +1181,11 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged)
|
|||
}
|
||||
}
|
||||
|
||||
// bug#170141
|
||||
if (output->type() == 14 && Utils::getCpuInfo() == "ZHAOXIN KaiXian KX-6640MA@2.2+GHz"&& Utils::outputName(output) == "DisplayPort-0" && mMachineType == "all in one") {
|
||||
firstAddOutputName = Utils::outputName(output);
|
||||
}
|
||||
|
||||
if (output->isConnected()) {
|
||||
QDBusReply<QByteArray> replyEdid = dbusEdid->call("getEdid",output->id());
|
||||
const quint8 *edidData = reinterpret_cast<const quint8 *>(replyEdid.value().constData());
|
||||
|
@ -1295,7 +1301,7 @@ void Widget::slotIdentifyButtonClicked(bool checked)
|
|||
|
||||
void Widget::slotIdentifyOutputs(KScreen::ConfigOperation *op)
|
||||
{
|
||||
if (op->hasError() || Common::isOpenkylin()) {
|
||||
if (op->hasError() || UkccCommon::isOpenkylin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1605,7 +1611,7 @@ bool Widget::writeGlobalPart(const KScreen::OutputPtr &output, QVariantMap &info
|
|||
info[QStringLiteral("metadata")] = metadata(output);
|
||||
info[QStringLiteral("rotation")] = output->rotation();
|
||||
|
||||
// Round scale to four digits
|
||||
// Round scale to four digits
|
||||
info[QStringLiteral("scale")] = output->scale();
|
||||
|
||||
QVariantMap modeInfo;
|
||||
|
@ -1852,7 +1858,7 @@ void Widget::initConnection()
|
|||
});
|
||||
|
||||
// Intel隐藏分辨率等调整选项
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
mControlPanel->setVisible(false);
|
||||
scaleFrame->setVisible(false);
|
||||
}
|
||||
|
@ -1889,7 +1895,7 @@ void Widget::initConnection()
|
|||
} else {
|
||||
applyNightModeSlot();
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mOpenTimeHCombox"), QString("select"), mOpenTimeHCombox->currentText());
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mOpenTimeHCombox"), QString("select"), mOpenTimeHCombox->currentText());
|
||||
});
|
||||
|
||||
connect(mQpenTimeMCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]{
|
||||
|
@ -1898,7 +1904,7 @@ void Widget::initConnection()
|
|||
} else {
|
||||
applyNightModeSlot();
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mQpenTimeMCombox"), QString("select"), mQpenTimeMCombox->currentText());
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mQpenTimeMCombox"), QString("select"), mQpenTimeMCombox->currentText());
|
||||
});
|
||||
|
||||
connect(mCloseTimeHCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]{
|
||||
|
@ -1907,7 +1913,7 @@ void Widget::initConnection()
|
|||
} else {
|
||||
applyNightModeSlot();
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mCloseTimeHCombox"), QString("select"), mCloseTimeHCombox->currentText());
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mCloseTimeHCombox"), QString("select"), mCloseTimeHCombox->currentText());
|
||||
});
|
||||
|
||||
connect(mCloseTimeMCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]{
|
||||
|
@ -1916,7 +1922,7 @@ void Widget::initConnection()
|
|||
} else {
|
||||
applyNightModeSlot();
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mCloseTimeMCombox"), QString("select"), mCloseTimeMCombox->currentText());
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mCloseTimeMCombox"), QString("select"), mCloseTimeMCombox->currentText());
|
||||
});
|
||||
|
||||
connect(mTemptWidget, &SliderWidget::valueChanged, this, [=]{
|
||||
|
@ -1925,12 +1931,12 @@ void Widget::initConnection()
|
|||
} else {
|
||||
applyNightModeSlot();
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mTemptWidget"), QString("settings"), QString::number(mTemptWidget->value()));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mTemptWidget"), QString("settings"), QString::number(mTemptWidget->value()));
|
||||
});
|
||||
|
||||
connect(mMultiScreenCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index){
|
||||
setMultiScreenSlot(index);
|
||||
Common::buriedSettings(QString("display"), QString("mMultiScreenCombox"), QString("select"), QString::number(index));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mMultiScreenCombox"), QString("select"), QString::number(index));
|
||||
});
|
||||
|
||||
QDBusConnection::sessionBus().connect(QString("org.ukui.SettingsDaemon"),
|
||||
|
@ -1984,7 +1990,7 @@ void Widget::initConnection()
|
|||
}
|
||||
break;
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mTimeModeWidget"), QString("select"), QString::number(mTimeModeWidget->comboBox()->currentIndex()));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mTimeModeWidget"), QString("select"), QString::number(mTimeModeWidget->comboBox()->currentIndex()));
|
||||
});
|
||||
|
||||
connect(mNightModeWidget, &SwitchWidget::stateChanged,[=](bool checked){
|
||||
|
@ -1995,7 +2001,7 @@ void Widget::initConnection()
|
|||
} else {
|
||||
applyNightModeSlot();
|
||||
}
|
||||
Common::buriedSettings(QString("display"), QString("mNightModeWidget"), QString("clicked"), Common::boolToString(checked));
|
||||
UkccCommon::buriedSettings(QString("display"), QString("mNightModeWidget"), QString("clicked"), UkccCommon::boolToString(checked));
|
||||
});
|
||||
|
||||
connect(scaleComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
|
@ -2130,7 +2136,7 @@ void Widget::initUiComponent()
|
|||
|
||||
void Widget::hideComponent()
|
||||
{
|
||||
if (Common::isOpenkylin() && Common::isWayland()) {
|
||||
if (UkccCommon::isOpenkylin() && UkccCommon::isWayland()) {
|
||||
scaleFrame->hide();
|
||||
}
|
||||
mNightModeFrame->setVisible(this->mRedshiftIsValid && QString(QLatin1String(kdk_system_get_hostVirtType())) == "none");
|
||||
|
@ -2143,7 +2149,7 @@ void Widget::initNightStatus()
|
|||
"/ColorCorrect",
|
||||
"org.freedesktop.DBus.Properties",
|
||||
QDBusConnection::sessionBus());
|
||||
if (colorIft.isValid() && !Common::isOpenkylin() && !Common::isWayland()) {
|
||||
if (colorIft.isValid() && !UkccCommon::isOpenkylin() && !UkccCommon::isWayland()) {
|
||||
this->mRedshiftIsValid = true;
|
||||
QDBusReply<QVariant> reply = colorIft.call("Get", "org.ukui.kwin.ColorCorrect", "available");
|
||||
if (!reply.value().toBool()) {
|
||||
|
@ -2397,7 +2403,7 @@ void Widget::setPreScreenCfg(KScreen::OutputList screens)
|
|||
|
||||
void Widget::changescale(QSize size)
|
||||
{
|
||||
if (Common::isTablet() || (Common::isOpenkylin() && Common::isWayland()))
|
||||
if (UkccCommon::isTablet() || (UkccCommon::isOpenkylin() && UkccCommon::isWayland()))
|
||||
return;
|
||||
|
||||
mScaleSizeRes = QSize();
|
||||
|
@ -2465,13 +2471,11 @@ void Widget::changescale(QSize size)
|
|||
scaleres = scale;
|
||||
scale = 1.0;
|
||||
}
|
||||
|
||||
scaleComboBox->setCurrentText(QString::number(scale * 100) + "%");
|
||||
scaleChangedSlot(scale);
|
||||
scaleComboBox->blockSignals(false);
|
||||
|
||||
mScaleSizeRes = QSize();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2523,8 +2527,8 @@ void Widget::getAllI2Cbus()
|
|||
I2CbusMap.clear();
|
||||
//暂时仅D2000机器直接使用i2c
|
||||
// 11th该机型也使用i2c,bug#154976,后续再出问题则考虑弃用ddc,暂特殊处理
|
||||
if (!(Common::getCpuInfo().contains("D2000", Qt::CaseInsensitive) ||
|
||||
Common::getCpuInfo() == QString("11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz"))) {
|
||||
if (!(UkccCommon::getCpuInfo().contains("D2000", Qt::CaseInsensitive) ||
|
||||
UkccCommon::getCpuInfo() == QString("11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz"))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -315,6 +315,7 @@ private:
|
|||
QString mOutputClickedName;
|
||||
QDBusInterface *dbusEdid = nullptr;
|
||||
QString cpuArchitecture = "";
|
||||
QString mMachineType;
|
||||
|
||||
int mKdsStatus = INT_MIN;
|
||||
QMap<QString, QString> I2CbusMap;
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
|
||||
#include "display_hw.h"
|
||||
#include "ui_display_hw.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <KF5/KScreen/kscreen/getconfigoperation.h>
|
||||
#include <KF5/KScreen/kscreen/output.h>
|
||||
|
@ -71,7 +72,7 @@ const QString DisplaySet::name() const
|
|||
|
||||
bool DisplaySet::isShowOnHomePage() const
|
||||
{
|
||||
return Common::isWayland();
|
||||
return UkccCommon::isWayland();
|
||||
}
|
||||
|
||||
QIcon DisplaySet::icon() const
|
||||
|
@ -81,7 +82,7 @@ QIcon DisplaySet::icon() const
|
|||
|
||||
bool DisplaySet::isEnable() const
|
||||
{
|
||||
return Common::isWayland();
|
||||
return UkccCommon::isWayland();
|
||||
}
|
||||
|
||||
void DisplaySet::requestBackend()
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
#include "ui_display_hw.h"
|
||||
#include "displayperformancedialog.h"
|
||||
#include "colorinfo.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "../../../shell/mainwindow.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
|
@ -584,7 +585,7 @@ void Widget::writeScale(double scale)
|
|||
scaleGSettings->set(SCALE_KEY, scale);
|
||||
}
|
||||
cursorSettings.set(CURSOR_SIZE_KEY, cursize);
|
||||
Common::setKwinMouseSize(cursize);
|
||||
UkccCommon::setKwinMouseSize(cursize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2186,7 +2187,7 @@ void Widget::initNightStatus()
|
|||
"/ColorCorrect",
|
||||
"org.ukui.kwin.ColorCorrect",
|
||||
QDBusConnection::sessionBus());
|
||||
if (colorIft.isValid() && Common::isExistEffect() && !mIsWayland) {
|
||||
if (colorIft.isValid() && UkccCommon::isExistEffect() && !mIsWayland) {
|
||||
this->mRedshiftIsValid = true;
|
||||
} else {
|
||||
qWarning() << "create org.ukui.kwin.ColorCorrect failed";
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include <QSettings>
|
||||
#include <QToolButton>
|
||||
#include <QStandardPaths>
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#define NOTICE_SCHEMA "org.ukui.control-center.notice"
|
||||
#define NEW_FEATURE_KEY "show-new-feature"
|
||||
|
@ -135,49 +136,49 @@ void Notice::setupGSettings()
|
|||
{
|
||||
|
||||
connect(mNoticeWidget->getAutoOpenSwitchBtn(), &KSwitchButton::stateChanged, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether auto turn on do not disturb mode", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether auto turn on do not disturb mode", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setNoticeDisturb", AUTOSTART_KEY, checked);
|
||||
setComBoxStatus(checked);
|
||||
});
|
||||
connect(mNoticeWidget->getMultiScreenWidget(), &SwitchWidget::stateChanged, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether auto turn on do not disturb mode when multi screen connection", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether auto turn on do not disturb mode when multi screen connection", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setNoticeDisturb", PROJECTIONSCREEN_KEY, checked);
|
||||
});
|
||||
connect(mNoticeWidget->getFullScreenWidget(), &SwitchWidget::stateChanged, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether auto turn on do not disturb mode when full screen mode", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether auto turn on do not disturb mode when full screen mode", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setNoticeDisturb", FULLSCREEN_KEY, checked);
|
||||
});
|
||||
connect(mNoticeWidget->getAllowAlarmrWidget(), &SwitchWidget::stateChanged, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether allow alarm prompt at not disturb mode", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether allow alarm prompt at not disturb mode", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setNoticeDisturb", ALARMCLOCK_KEY, checked);
|
||||
});
|
||||
connect(mNoticeWidget->getOpenTimeHCombox(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index){
|
||||
Q_UNUSED(index);
|
||||
Common::buriedSettings(name(), "open time(hour) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getOpenTimeHCombox()->currentText());
|
||||
UkccCommon::buriedSettings(name(), "open time(hour) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getOpenTimeHCombox()->currentText());
|
||||
mNoticeDBus->call("setNoticeDisturb", TIMESTART_KEY, QString("%1%2%3").arg(mNoticeWidget->getOpenTimeHCombox()->currentText()).arg(":").arg(mNoticeWidget->getOpenTimeMCombox()->currentText()));
|
||||
});
|
||||
|
||||
connect(mNoticeWidget->getOpenTimeMCombox(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index){
|
||||
Q_UNUSED(index);
|
||||
Common::buriedSettings(name(), "open time(minute) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getOpenTimeMCombox()->currentText());
|
||||
UkccCommon::buriedSettings(name(), "open time(minute) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getOpenTimeMCombox()->currentText());
|
||||
mNoticeDBus->call("setNoticeDisturb", TIMESTART_KEY, QString("%1%2%3").arg(mNoticeWidget->getOpenTimeHCombox()->currentText()).arg(":").arg(mNoticeWidget->getOpenTimeMCombox()->currentText()));
|
||||
});
|
||||
|
||||
connect(mNoticeWidget->getCloseTimeHCombox(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index){
|
||||
Q_UNUSED(index);
|
||||
Common::buriedSettings(name(), "close time(hour) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getCloseTimeHCombox()->currentText());
|
||||
UkccCommon::buriedSettings(name(), "close time(hour) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getCloseTimeHCombox()->currentText());
|
||||
mNoticeDBus->call("setNoticeDisturb", TIMEEND_KEY, QString("%1%2%3").arg(mNoticeWidget->getCloseTimeHCombox()->currentText()).arg(":").arg(mNoticeWidget->getCloseTimeMCombox()->currentText()));
|
||||
});
|
||||
|
||||
connect(mNoticeWidget->getCloseTimeMCombox(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index){
|
||||
Q_UNUSED(index);
|
||||
Common::buriedSettings(name(), "close time(minute) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getCloseTimeMCombox()->currentText());
|
||||
UkccCommon::buriedSettings(name(), "close time(minute) when auto turn on do not disturb mode", QString("settings"), mNoticeWidget->getCloseTimeMCombox()->currentText());
|
||||
mNoticeDBus->call("setNoticeDisturb", TIMEEND_KEY, QString("%1%2%3").arg(mNoticeWidget->getCloseTimeHCombox()->currentText()).arg(":").arg(mNoticeWidget->getCloseTimeMCombox()->currentText()));
|
||||
});
|
||||
|
||||
|
||||
connect(mNoticeWidget->getNoticeWidget(), &SwitchWidget::stateChanged, [=](bool checked){
|
||||
Common::buriedSettings(name(), "whether to get the notification from the app", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether to get the notification from the app", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setUkccNotice", ENABLE_NOTICE_KEY, checked);
|
||||
setHiddenNoticeApp(checked);
|
||||
});
|
||||
|
@ -208,17 +209,17 @@ void Notice::initItemUi(NoticeApp &app)
|
|||
mNoticeWidget->getAppListWidget()->addWidget(baseWidget);
|
||||
|
||||
connect(menu, &NoticeMenu::voiceSignals, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether prompt sound during notification", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether prompt sound during notification", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setAppInfo", app.desktop, VOICE_KEY, checked);
|
||||
});
|
||||
|
||||
connect(menu, &NoticeMenu::detailSignals, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether to show the message content in the lock screen interface", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether to show the message content in the lock screen interface", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setAppInfo", app.desktop, SHOW_DETAIL_KEY, checked);
|
||||
});
|
||||
|
||||
connect(menu, &NoticeMenu::showSignals, [=](bool checked) {
|
||||
Common::buriedSettings(name(), "whether to show the notice in the lock screen interface", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), "whether to show the notice in the lock screen interface", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setAppInfo", app.desktop, SHOW_SCREENLOCK_KEY, checked);
|
||||
});
|
||||
|
||||
|
@ -230,12 +231,12 @@ void Notice::initItemUi(NoticeApp &app)
|
|||
str = "always";
|
||||
else if (id == 2)
|
||||
str = "none";
|
||||
Common::buriedSettings(name(), "set notice style", QString("settings"), str);
|
||||
UkccCommon::buriedSettings(name(), "set notice style", QString("settings"), str);
|
||||
mNoticeDBus->call("setAppInfo", app.desktop, STYLE_KEY, str);
|
||||
});
|
||||
|
||||
connect(baseWidget, &SwitchWidget::stateChanged, [=](bool checked) {
|
||||
Common::buriedSettings(name(), app.desktop + " whether to start notification", QString("settings"), checked ? "true" : "false");
|
||||
UkccCommon::buriedSettings(name(), app.desktop + " whether to start notification", QString("settings"), checked ? "true" : "false");
|
||||
mNoticeDBus->call("setAppInfo", app.desktop, MESSAGES_KEY, checked);
|
||||
});
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
*
|
||||
*/
|
||||
#include "vino.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <QGSettings>
|
||||
|
||||
|
@ -84,7 +85,7 @@ QIcon Vino::icon() const
|
|||
|
||||
bool Vino::isEnable() const
|
||||
{
|
||||
return !Common::isCommunity() && !Common::isWayland() && isExistVino();
|
||||
return !UkccCommon::isCommunity() && !UkccCommon::isWayland() && isExistVino();
|
||||
}
|
||||
|
||||
bool Vino::isExistVino() const
|
||||
|
@ -200,33 +201,33 @@ void Vino::pwdInputSlot()
|
|||
void Vino::initConnection()
|
||||
{
|
||||
connect(mVinoWidget->getEnableWidget(), &SwitchWidget::stateChanged, this, [=](bool status) {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), mVinoWidget->getEnableWidget()->objectName(), QString("settings"), status ? "true" : "false");
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), mVinoWidget->getEnableWidget()->objectName(), QString("settings"), status ? "true" : "false");
|
||||
enabledSlot(status);
|
||||
});
|
||||
|
||||
connect(mVinoWidget->getXrdpEnableWidget(), &SwitchWidget::stateChanged, this, [=](bool status) {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), mVinoWidget->getXrdpEnableWidget()->objectName(), QString("settings"), status ? "true" : "false");
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), mVinoWidget->getXrdpEnableWidget()->objectName(), QString("settings"), status ? "true" : "false");
|
||||
xrdpEnabledSlot(status);
|
||||
});
|
||||
|
||||
connect(mVinoWidget->getVinoEnableWidget(), &SwitchWidget::stateChanged, this, [=](bool status) {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), "whether allow others to connect to your desktop remotely", QString("settings"), status ? "true" : "false");
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), "whether allow others to connect to your desktop remotely", QString("settings"), status ? "true" : "false");
|
||||
vinoEnableSlot(status);
|
||||
});
|
||||
connect(mVinoWidget->getViewWidget(), &SwitchWidget::stateChanged, this, [=](bool status) {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), "whether allow others to control your desktop remotely", QString("settings"), status ? "true" : "false");
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), "whether allow others to control your desktop remotely", QString("settings"), status ? "true" : "false");
|
||||
viewBoxSlot(status);
|
||||
});
|
||||
connect(mVinoWidget->getSecurityWidget(), &SwitchWidget::stateChanged, this, [=](bool status) {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), "whether to confirm each visit for the local mach", QString("settings"), status ? "true" : "false");
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), "whether to confirm each visit for the local mach", QString("settings"), status ? "true" : "false");
|
||||
accessSlot(status);
|
||||
});
|
||||
connect(mVinoWidget->getSecurityPwdWidget(), &SwitchWidget::stateChanged, this, [=](bool status) {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), "whether password verification is required", QString("settings"), status ? "true" : "false");
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), "whether password verification is required", QString("settings"), status ? "true" : "false");
|
||||
pwdEnableSlot(status);
|
||||
});
|
||||
connect(mVinoWidget->getPwdinputBtn(), &QPushButton::clicked, this, [=]() {
|
||||
Common::buriedSettings(QStringLiteral("Vino"), "set password", QString("clicked"));
|
||||
UkccCommon::buriedSettings(QStringLiteral("Vino"), "set password", QString("clicked"));
|
||||
pwdInputSlot();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
*
|
||||
*/
|
||||
#include "vino_hw.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
Vino::Vino() : mFirstLoad(true)
|
||||
{
|
||||
|
@ -69,5 +70,5 @@ QIcon Vino::icon() const
|
|||
|
||||
bool Vino::isEnable() const
|
||||
{
|
||||
return Common::isWayland();
|
||||
return UkccCommon::isWayland();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
*
|
||||
*/
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include <QDebug>
|
||||
#include <QDateTime>
|
||||
#include <QMessageBox>
|
||||
|
@ -91,7 +92,7 @@ QWidget *Area::pluginUi()
|
|||
} else {
|
||||
initContent();
|
||||
connectToServer();
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
areaWidget->settingForIntel();
|
||||
}
|
||||
QDBusConnection::sessionBus().connect("org.ukui.ukcc.session",
|
||||
|
@ -240,7 +241,7 @@ void Area::initComboBox(QComboBox *comboBox, InteractiveInfo info)
|
|||
Q_UNUSED(num);
|
||||
changeKey = info.key;
|
||||
areaInterface->call(info.setkey.toUtf8().data(), comboBox->currentData().toString());
|
||||
Common::buriedSettings(name(), info.setkey, QString("select"), comboBox->currentData().toString());
|
||||
UkccCommon::buriedSettings(name(), info.setkey, QString("select"), comboBox->currentData().toString());
|
||||
if (info.setkey == QString("setFormatCountry")) {
|
||||
showMessageBox(1);
|
||||
}
|
||||
|
@ -354,7 +355,7 @@ void Area::initConnect()
|
|||
connect(areaWidget, &AreaUi::languageChanged, this, [=](QString languageCode) {
|
||||
changeKey = QString("language");
|
||||
areaInterface->call("setLanguage", languageCode);
|
||||
Common::buriedSettings(name(), QString("languageFrame"), QString("clicked"), languageCode);
|
||||
UkccCommon::buriedSettings(name(), QString("languageFrame"), QString("clicked"), languageCode);
|
||||
showMessageBox(2);
|
||||
});
|
||||
connect(areaWidget, &AreaUi::showLanguageListRemoved, this, [=](QString languageCode) {
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include <QTextCodec>
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
LanguageFrame::LanguageFrame(QString showName, QWidget *parent)
|
||||
:UkccFrame(parent, BorderRadiusStyle::Top, true)
|
||||
|
|
|
@ -276,18 +276,13 @@ void DateTime::connectUiSignals()
|
|||
if (mode == "manual") {
|
||||
toChangeKey = "timeMode";
|
||||
reply = datetimeInterface->call("setTimeMode", "manual");
|
||||
if (reply.isValid() && !reply.value()) {
|
||||
datetimeUi->setTimeMode("automatic");
|
||||
}
|
||||
timerTimes = 0;
|
||||
timer->stop();
|
||||
datetimeUi->setSyncResultLabel(2);
|
||||
} else {
|
||||
toChangeKey = "timeMode";
|
||||
reply = datetimeInterface->call("setTimeMode", "automatic");
|
||||
if (reply.isValid() && !reply.value()) {
|
||||
datetimeUi->setTimeMode("manual");
|
||||
} else {
|
||||
if (!reply.isValid() || reply.value()) {
|
||||
timer->start(80);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1065,8 +1065,12 @@ QString SysdbusRegister::getShowTimezone()
|
|||
|
||||
void SysdbusRegister::setShowTimezone(QString timezone)
|
||||
{
|
||||
QProcess process;
|
||||
QString cmd = QString("echo %1 > /etc/.kytimezone").arg(timezone);
|
||||
system(cmd.toUtf8().data());
|
||||
|
||||
process.start(cmd);
|
||||
process.waitForFinished();
|
||||
|
||||
Q_EMIT changed("timezone");
|
||||
return;
|
||||
}
|
||||
|
@ -1131,8 +1135,8 @@ QString SysdbusRegister::getSysInstallTime(const QString &part)
|
|||
{
|
||||
QProcess process;
|
||||
|
||||
QString cmd = QString("tune2fs -l /dev/%1 |grep create").arg(part);
|
||||
process.start("bash" , QStringList() << "-c" << cmd);
|
||||
QString cmd = QString("/usr/sbin/tune2fs -l /dev/%1 |grep create").arg(part);
|
||||
process.start(cmd);
|
||||
process.waitForFinished();
|
||||
QString info = process.readAllStandardOutput();
|
||||
if (!info.isEmpty()) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "areainterface.h"
|
||||
#include "common.h"
|
||||
#include "ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include <unistd.h>
|
||||
#include <QDBusConnection>
|
||||
|
||||
|
@ -62,7 +63,12 @@ void AreaInterface::gsettingSet(const QString &key, const QString &value)
|
|||
|
||||
QStringList AreaInterface::getFormatCountryList()
|
||||
{
|
||||
return QStringList() << QString("en_US.UTF-8") << QString("zh_CN.UTF-8") << QString("bo_CN.UTF-8");
|
||||
QStringList formatList;
|
||||
formatList << QString("en_US.UTF-8") << QString("zh_CN.UTF-8") << QString("bo_CN.UTF-8");
|
||||
if (isOpenkylin()) {
|
||||
formatList.removeLast();
|
||||
}
|
||||
return formatList;
|
||||
}
|
||||
|
||||
QStringList AreaInterface::getCalendarList()
|
||||
|
@ -103,12 +109,21 @@ QStringList AreaInterface::getShowLanguageList()
|
|||
|
||||
QStringList AreaInterface::getLanguageList()
|
||||
{
|
||||
if (Common::isOpenkylin()) {
|
||||
if (isOpenkylin()) {
|
||||
return QStringList() << QString("zh_CN") << QString("en");
|
||||
}
|
||||
return QStringList() << QString("zh_CN") << QString("en") << QString("bo_CN");
|
||||
}
|
||||
|
||||
bool AreaInterface::isOpenkylin()
|
||||
{
|
||||
QString systemName = QString(QLatin1String(kdk_system_get_systemName()));
|
||||
if (systemName.compare("openkylin", Qt::CaseInsensitive) == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString AreaInterface::getFormatCountry()
|
||||
{
|
||||
return accountInterface->property("FormatsLocale").toString();;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <QObject>
|
||||
#include <QtDBus>
|
||||
#include "universalinterface.h"
|
||||
#include <kysdk/kysdk-system/libkysysinfo.h>
|
||||
|
||||
class AreaInterface : public QObject
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ protected:
|
|||
QString getDateFormat();
|
||||
QString getTimeFormat();
|
||||
QString getLanguage();
|
||||
bool isOpenkylin();
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@ CONFIG += c++11 console link_pkgconfig
|
|||
CONFIG -= app_bundle
|
||||
PKGCONFIG += gio-2.0 \
|
||||
kysdk-sysinfo \
|
||||
gsettings-qt
|
||||
gsettings-qt \
|
||||
|
||||
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -O2
|
||||
INCLUDEPATH += ../libukcc/interface/ \
|
||||
|
@ -40,7 +40,6 @@ INSTALLS += inst1
|
|||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
../libukcc/interface/common.cpp \
|
||||
json.cpp \
|
||||
main.cpp \
|
||||
plugins/about/aboutinterface.cpp \
|
||||
|
@ -69,7 +68,6 @@ target.path = /usr/bin/
|
|||
|
||||
|
||||
HEADERS += \
|
||||
../libukcc/interface/common.h \
|
||||
json.h \
|
||||
plugins/about/aboutinterface.h \
|
||||
plugins/area/areainterface.h \
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
#include "mainwindow.h"
|
||||
#include "utils/keyvalueconverter.h"
|
||||
#include "utils/functionselect.h"
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "flowlayout.h"
|
||||
#include "tristatelabel.h"
|
||||
|
||||
|
@ -70,7 +71,7 @@ HomePageWidget::~HomePageWidget()
|
|||
void HomePageWidget::initUI() {
|
||||
FlowLayout * flowLayout = new FlowLayout(ui->widget_2, true, 0);
|
||||
flowLayout->setContentsMargins(70, 0, 70, 0);
|
||||
mModuleMap = Common::getModuleHideStatus();
|
||||
mModuleMap = UkccCommon::getModuleHideStatus();
|
||||
|
||||
//构建枚举键值转换对象
|
||||
KeyValueConverter * kvConverter = new KeyValueConverter(); //继承QObject,No Delete
|
||||
|
@ -90,12 +91,12 @@ void HomePageWidget::initUI() {
|
|||
QString modulenameString = kvConverter->keycodeTokeystring(moduleIndex).toLower();
|
||||
QString modulenamei18nString = kvConverter->keycodeTokeyi18nstring(moduleIndex);
|
||||
if ((mModuleMap.keys().contains(modulenameString) && !mModuleMap[modulenameString].toBool())
|
||||
|| (Common::isTablet() && KexcludeModule.contains(modulenameString))) {
|
||||
|| (UkccCommon::isTablet() && KexcludeModule.contains(modulenameString))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// pangw无安全模块-不显示 社区无更新和安全-不显示
|
||||
if ((modulenameString == "security" || modulenameString == "update") && Common::isCommunity()) {
|
||||
if ((modulenameString == "security" || modulenameString == "update") && UkccCommon::isCommunity()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -255,7 +256,7 @@ void HomePageWidget::initUI() {
|
|||
QString firstFunc;
|
||||
QList<FuncInfo> tmpList = FunctionSelect::funcinfoListHomePage[moduleIndex];
|
||||
for (FuncInfo tmpStruct : tmpList) {
|
||||
bool isIntel = Common::isTablet();
|
||||
bool isIntel = UkccCommon::isTablet();
|
||||
|
||||
if ((isIntel && tmpStruct.namei18nString == "User Info")
|
||||
|| (!isIntel && tmpStruct.namei18nString == "User Info Intel")) {
|
||||
|
@ -279,7 +280,7 @@ void HomePageWidget::initUI() {
|
|||
if (moduleMap.keys().contains(tmpStruct.namei18nString)) {
|
||||
if (mModuleMap.isEmpty() || !mModuleMap.contains(tmpStruct.nameString.toLower()) || mModuleMap[tmpStruct.nameString.toLower()].toBool()) {
|
||||
firstFunc = tmpStruct.namei18nString;
|
||||
Common::buriedSettings(tmpStruct.nameString, nullptr, "home clicked");
|
||||
UkccCommon::buriedSettings(tmpStruct.nameString, nullptr, "home clicked");
|
||||
//跳转
|
||||
pmainWindow->functionBtnClicked(moduleMap.value(firstFunc));
|
||||
break;
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
|
||||
#include "framelessExtended/framelesshandle.h"
|
||||
#include "customstyle.h"
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "utils/xatom-helper.h"
|
||||
|
||||
const QString KLong = "Loongson";
|
||||
|
@ -69,7 +70,7 @@ int main(int argc, char *argv[])
|
|||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
if (Common::getCpuInfo().startsWith(KLong, Qt::CaseInsensitive)) {
|
||||
if (UkccCommon::getCpuInfo().startsWith(KLong, Qt::CaseInsensitive)) {
|
||||
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
|
||||
}
|
||||
|
||||
|
@ -87,7 +88,7 @@ int main(int argc, char *argv[])
|
|||
return EXIT_SUCCESS;
|
||||
} else {
|
||||
//控制面板是否被禁用
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
QString m_initPath = QString("%1/%2/%3").arg(QDir::homePath()).arg(".cache/ukui-menu").arg("ukui-menu.ini");
|
||||
QSettings settings(m_initPath, QSettings::IniFormat);
|
||||
settings.beginGroup("application");
|
||||
|
@ -129,8 +130,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
MainWindow w;
|
||||
mainWindow = &w;
|
||||
if (!Common::isOpenkylin())
|
||||
Common::centerToScreen(&w);
|
||||
if (!UkccCommon::isOpenkylin())
|
||||
UkccCommon::centerToScreen(&w);
|
||||
|
||||
w.setAttribute(Qt::WA_TranslucentBackground);
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
#include "ui_mainwindow.h"
|
||||
#include "utils/keyvalueconverter.h"
|
||||
#include "utils/functionselect.h"
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "imageutil.h"
|
||||
#include "ukccabout.h"
|
||||
|
||||
|
@ -85,7 +86,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
qApp->installEventFilter(this);
|
||||
qApp->setStyle(new InternalStyle("ukui"));
|
||||
is_ExitPower = isExitsPower();
|
||||
if (Common::isOpenkylin()) {
|
||||
if (UkccCommon::isOpenkylin()) {
|
||||
connect(WindowManager::self(),&WindowManager::windowAdded,this,[=](const WindowId& windowId){
|
||||
if (getpid() == WindowManager::getPid(windowId)) {
|
||||
m_listWinIds.append(windowId);
|
||||
|
@ -144,7 +145,7 @@ void MainWindow::bootOptionsFilter(QString opt, bool firstIn) {
|
|||
|
||||
if (!isExitsModule) {
|
||||
//避免无限循环的风险
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
if (firstIn) {
|
||||
bootOptionsFilter("userinfointel", false);
|
||||
}
|
||||
|
@ -186,7 +187,7 @@ void MainWindow::bootOptionsFilter(QString opt, bool firstIn) {
|
|||
bool MainWindow::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == scrollArea) {
|
||||
if (!Common::isTablet()) {
|
||||
if (!UkccCommon::isTablet()) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
scrollArea->verticalScrollBar()->setVisible(true);
|
||||
} else if (event->type() == QEvent::Leave) {
|
||||
|
@ -215,7 +216,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
|
|||
} else if (watched == homepageWidget) {
|
||||
if (event->type() == QEvent::Paint) {
|
||||
QTimer::singleShot(1, this, [=]() {
|
||||
if (!Common::isTablet()) {
|
||||
if (!UkccCommon::isTablet()) {
|
||||
m_searchWidget->setFixedWidth(350 > mOptionBtn->x() - titleLabel->x() - titleLabel->width() ? (mOptionBtn->x() - m_searchWidget->x() - 16) : 350);
|
||||
}
|
||||
});
|
||||
|
@ -234,11 +235,11 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
|
|||
|
||||
void MainWindow::initUI() {
|
||||
ui->setupUi(this);
|
||||
QRect screenSize = Common::sizeOnCursor();
|
||||
QRect screenSize = UkccCommon::sizeOnCursor();
|
||||
this->setMinimumSize(978, 630);
|
||||
if (screenSize.width() > 1440)
|
||||
this->resize(1160,720);
|
||||
m_ModuleMap = Common::getModuleHideStatus();
|
||||
m_ModuleMap = UkccCommon::getModuleHideStatus();
|
||||
|
||||
const QByteArray id("org.ukui.style");
|
||||
m_fontSetting = new QGSettings(id, QByteArray(), this);
|
||||
|
@ -349,7 +350,7 @@ void MainWindow::initUI() {
|
|||
});
|
||||
connect(modulepageWidget, &ModulePageWidget::hScrollBarShow, this, [=]() {
|
||||
QTimer::singleShot(1, this, [=]() {
|
||||
if (!Common::isTablet()) {
|
||||
if (!UkccCommon::isTablet()) {
|
||||
if (m_searchWidget->width() > backBtn->x() - mOptionBtn->x()) {
|
||||
m_searchWidget->setFixedWidth(mOptionBtn->x() - backBtn->x() - mOptionBtn->width() - 16);
|
||||
}
|
||||
|
@ -360,7 +361,7 @@ void MainWindow::initUI() {
|
|||
//top left return button
|
||||
connect(backBtn, &QPushButton::clicked, this, [=]{
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
Common::buriedSettings(backBtn->objectName(), nullptr, QString("clicked"));
|
||||
UkccCommon::buriedSettings(backBtn->objectName(), nullptr, QString("clicked"));
|
||||
});
|
||||
|
||||
// 快捷参数
|
||||
|
@ -439,7 +440,7 @@ void MainWindow::initTileBar() {
|
|||
|
||||
backBtn->setFixedSize(36, 36);
|
||||
mOptionBtn->setFixedSize(30, 30);
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
minBtn->setFixedSize(48, 48);
|
||||
maxBtn->setFixedSize(48, 48);
|
||||
closeBtn->setFixedSize(48, 48);
|
||||
|
@ -573,8 +574,8 @@ void MainWindow::initUkccAbout() {
|
|||
KAboutDialog *ukcc = new KAboutDialog(this);
|
||||
ukcc->setAppIcon(QIcon::fromTheme("ukui-control-center"));
|
||||
ukcc->setAppName(tr("Settings"));
|
||||
ukcc->setAppVersion(tr("Version: ") + Common::getUkccVersion());
|
||||
ukcc->setAppSupport(Common::isOpenkylin() ? "" : ukcc->appSupport());
|
||||
ukcc->setAppVersion(tr("Version: ") + UkccCommon::getUkccVersion());
|
||||
ukcc->setAppSupport(UkccCommon::isOpenkylin() ? "" : ukcc->appSupport());
|
||||
ukcc->exec();
|
||||
});
|
||||
|
||||
|
@ -765,8 +766,8 @@ void MainWindow::initLeftsideBar()
|
|||
}
|
||||
|
||||
// intel与sp1做区分
|
||||
if ((Common::isTablet() && single.nameString == "Userinfo")
|
||||
|| (!Common::isTablet() && single.nameString == "Userinfointel")) {
|
||||
if ((UkccCommon::isTablet() && single.nameString == "Userinfo")
|
||||
|| (!UkccCommon::isTablet() && single.nameString == "Userinfointel")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -821,7 +822,7 @@ void MainWindow::initLeftsideBar()
|
|||
modulepageWidget->refreshPluginWidget(pluginInstance);
|
||||
|
||||
// 埋点点击左侧导航插件
|
||||
Common::buriedSettings(pluginInstance->name(), nullptr, QString("left clicked"));
|
||||
UkccCommon::buriedSettings(pluginInstance->name(), nullptr, QString("left clicked"));
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -834,7 +835,7 @@ QPushButton * MainWindow::buildLeftsideBtn(QString bname,QString tipName, QIcon
|
|||
QPushButton * leftsidebarBtn = new QPushButton();
|
||||
leftsidebarBtn->setAttribute(Qt::WA_DeleteOnClose);
|
||||
leftsidebarBtn->setCheckable(true);
|
||||
if (Common::isTablet()) {
|
||||
if (UkccCommon::isTablet()) {
|
||||
leftsidebarBtn->setFixedSize(230,48);
|
||||
} else {
|
||||
leftsidebarBtn->setFixedSize(230,40); //一级菜单按钮显示的宽度
|
||||
|
@ -1071,7 +1072,7 @@ void MainWindow::showGuide(QString pluName)
|
|||
void MainWindow::hideComponent()
|
||||
{
|
||||
QTimer::singleShot(100, this, [=]() {
|
||||
if(Common::isTablet()) {
|
||||
if(UkccCommon::isTablet()) {
|
||||
if (QApplication::arguments().length() < 2) {
|
||||
bootOptionsFilter("userinfointel");
|
||||
}
|
||||
|
@ -1096,7 +1097,7 @@ QMap<QString, QObject *> MainWindow::exportModule(int type) {
|
|||
void MainWindow::pluginBtnClicked(QObject *plugin) {
|
||||
|
||||
CommonInterface * pluginInstance = qobject_cast<CommonInterface *>(plugin);
|
||||
Common::buriedSettings(pluginInstance->name(), nullptr, "home clicked");
|
||||
UkccCommon::buriedSettings(pluginInstance->name(), nullptr, "home clicked");
|
||||
|
||||
functionBtnClicked(plugin);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
#include "interface.h"
|
||||
#include "utils/keyvalueconverter.h"
|
||||
#include "utils/functionselect.h"
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
#include "component/leftwidgetitem.h"
|
||||
#include "component/leftmenulist.h"
|
||||
#include <QScrollBar>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -61,7 +61,7 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||
QString retValue = text();
|
||||
|
||||
if (popup->model()->rowCount() == 0) {
|
||||
Common::buriedSettings(QString("SearchWidget"), nullptr, QString("No search results"), retValue);
|
||||
UkccCommon::buriedSettings(QString("SearchWidget"), nullptr, QString("No search results"), retValue);
|
||||
if (m_model->data(m_model->index(m_model->rowCount() - 1, 0)) != tr("No search results"))
|
||||
m_model->appendRow(new QStandardItem(tr("No search results")));
|
||||
m_model->setData(m_model->index(m_model->rowCount() - 1, 0), text(), Qt::UserRole);
|
||||
|
@ -71,7 +71,7 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||
if (!m_bIsChinese)
|
||||
m_completer->setCompletionRole(Qt::DisplayRole);
|
||||
if (m_model->data(m_model->index(m_model->rowCount() - 1, 0)) == tr("No search results")) {
|
||||
Common::buriedSettings(QString("SearchWidget"), nullptr, QString("No search results"), retValue);
|
||||
UkccCommon::buriedSettings(QString("SearchWidget"), nullptr, QString("No search results"), retValue);
|
||||
while (m_model->data(m_model->index(m_model->rowCount() - 1, 0)) == tr("No search results")) {
|
||||
m_model->clearItemData(m_model->index(m_model->rowCount() - 1, 0));
|
||||
m_model->removeRow(m_model->rowCount() - 1);
|
||||
|
@ -159,7 +159,7 @@ bool SearchWidget::jumpContentPathWidget(QString path) {
|
|||
bResult = true;
|
||||
|
||||
// 埋点搜索插件
|
||||
Common::buriedSettings(QString("SearchWidget"), nullptr, QString("search"), m_EnterNewPagelist[i].fullPagePath);
|
||||
UkccCommon::buriedSettings(QString("SearchWidget"), nullptr, QString("search"), m_EnterNewPagelist[i].fullPagePath);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -252,12 +252,12 @@ void SearchWidget::loadxml() {
|
|||
} else if (m_xmlExplain == XML_Explain_Path) {
|
||||
m_searchBoxStruct.fullPagePath = xmlRead.text().toString();
|
||||
// mavis过滤掉的搜索项
|
||||
if ((Common::isTablet() && mavisFilterPathList.contains(m_searchBoxStruct.fullPagePath)) || mExcludeList.contains(m_searchBoxStruct.fullPagePath)) {
|
||||
if ((UkccCommon::isTablet() && mavisFilterPathList.contains(m_searchBoxStruct.fullPagePath)) || mExcludeList.contains(m_searchBoxStruct.fullPagePath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// openkylin 过滤掉的搜索项
|
||||
if (Common::isOpenkylin() && openkylinFilterPathList.contains(m_searchBoxStruct.fullPagePath)) {
|
||||
if (UkccCommon::isOpenkylin() && openkylinFilterPathList.contains(m_searchBoxStruct.fullPagePath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ void SearchWidget::loadxml() {
|
|||
}
|
||||
|
||||
if ((!g_file_test("/usr/sbin/ksc-defender", G_FILE_TEST_EXISTS) && m_searchBoxStruct.fullPagePath.contains("securitycenter",Qt::CaseInsensitive))
|
||||
|| (!Common::isCommunity() && m_searchBoxStruct.fullPagePath.contains("update")) ) {
|
||||
|| (!UkccCommon::isCommunity() && m_searchBoxStruct.fullPagePath.contains("update")) ) {
|
||||
break;
|
||||
}
|
||||
#ifndef __sw_64__
|
||||
|
@ -542,18 +542,18 @@ void SearchWidget::hiddenSearchItem(QString name, bool show)
|
|||
}
|
||||
|
||||
void SearchWidget::initExcludeSearch() {
|
||||
if (!Common::isExistEffect()) {
|
||||
if (!UkccCommon::isExistEffect()) {
|
||||
mExcludeList << "/Theme/Performance mode" << "/Theme/Transparency";
|
||||
}
|
||||
|
||||
if (!Common::isExitBattery()) {
|
||||
if (!UkccCommon::isExitBattery()) {
|
||||
mExcludeList << "/Power/Battery saving plan";
|
||||
}
|
||||
|
||||
if (Common::isWayland() || !Common::isExistEffect()) {
|
||||
if (UkccCommon::isWayland() || !UkccCommon::isExistEffect()) {
|
||||
mExcludeList << "/Display/night mode";
|
||||
}
|
||||
if (!Common::isTablet()) {
|
||||
if (!UkccCommon::isTablet()) {
|
||||
mExcludeList << "/UserinfoIntel/Change Tel" << "/Display/Dynamic light";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef SEARCHWIDGET_H
|
||||
#define SEARCHWIDGET_H
|
||||
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
using namespace ukcc;
|
||||
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
#include "ukccabout.h"
|
||||
#include "xatom-helper.h"
|
||||
#include "interface/common.h"
|
||||
#include "interface/ukcccommon.h"
|
||||
|
||||
#include <QVariant>
|
||||
#include <QDesktopServices>
|
||||
|
|
|
@ -242,6 +242,7 @@ void FunctionSelect::initPluginName()
|
|||
systemPluginName.insert(3, "Notice");
|
||||
systemPluginName.insert(4, "Vino");
|
||||
systemPluginName.insert(5, "About");
|
||||
systemPluginName.insert(6, "TouchCalibrate");
|
||||
|
||||
devicePluginName.insert(0, "BlueTooth");
|
||||
devicePluginName.insert(1, "Printer");
|
||||
|
|
Loading…
Reference in New Issue