diff --git a/Makefile b/Makefile index e804a8c..4f49f91 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,8 @@ CC = g++ -all: plugins notify +all: origin immutability -plugins: - cd plugin && qmake . - cd plugin && make -j8 -notify: - cd notification && cmake . - cd notification && make -j8 +origin: + cd initial && make -j4 +immutability: + cd immutable && make -j4 diff --git a/immutable/Makefile b/immutable/Makefile new file mode 100644 index 0000000..5459265 --- /dev/null +++ b/immutable/Makefile @@ -0,0 +1,16 @@ +CC = g++ + +all: plugins notify newnotify send + +plugins: + cd plugin && qmake . + cd plugin && make -j8 +notify: + cd notification && cmake . + cd notification && make -j8 +newnotify: + cd upgradenote/RebootAttention && qmake . + cd upgradenote/RebootAttention && make -j8 +send: + cd NotifySend && qmake . + cd NotifySend && make -j8 diff --git a/immutable/NotifySend/Config/NotifySendStart b/immutable/NotifySend/Config/NotifySendStart new file mode 100755 index 0000000..5ef07ae --- /dev/null +++ b/immutable/NotifySend/Config/NotifySendStart @@ -0,0 +1,2 @@ +#! /bin/bash +systemctl --user start kylin-stepinstall-notify.service diff --git a/immutable/NotifySend/Config/UpgradeRebootNotify b/immutable/NotifySend/Config/UpgradeRebootNotify new file mode 100755 index 0000000..e3d9a4f --- /dev/null +++ b/immutable/NotifySend/Config/UpgradeRebootNotify @@ -0,0 +1,3 @@ +#! /bin/bash +NotifySend --PowercheckNotify +gdbus call --system --dest com.kylin.systemupgrade --object-path /com/kylin/systemupgrade --method com.kylin.systemupgrade.interface.TriggerInstallOnShutdown "reboot" diff --git a/immutable/NotifySend/Config/kylin-reboot-installnotify.desktop b/immutable/NotifySend/Config/kylin-reboot-installnotify.desktop new file mode 100644 index 0000000..8f53767 --- /dev/null +++ b/immutable/NotifySend/Config/kylin-reboot-installnotify.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=kylin-reboot-installlnotify +X-UKUI-Autostart-Phase=Notification +Exec=/usr/bin/NotifySend --DesktopNotify +Type=Application +NoDisplay=true +Comment=kylin-DesktopNotify-notify +Name[zh_CN]=重启立即检测是否弹窗 diff --git a/immutable/NotifySend/Config/kylin-stepinstall-notify.desktop b/immutable/NotifySend/Config/kylin-stepinstall-notify.desktop new file mode 100644 index 0000000..43560bb --- /dev/null +++ b/immutable/NotifySend/Config/kylin-stepinstall-notify.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=kylin-stepinstall-notify +X-UKUI-Autostart-Phase=Notification +Exec=/usr/bin/NotifySendStart +Type=Application +NoDisplay=true +Comment=kylin-stepinstall-notify +Name[zh_CN]=分步更新重启提示 diff --git a/immutable/NotifySend/Config/kylin-stepinstall-notify.service b/immutable/NotifySend/Config/kylin-stepinstall-notify.service new file mode 100644 index 0000000..1981342 --- /dev/null +++ b/immutable/NotifySend/Config/kylin-stepinstall-notify.service @@ -0,0 +1,8 @@ +[Unit] +Description=Daily update attention when user login +#ConditionACPower=true +After=systemd-user-sessions.service +[Service] +ExecStart=/usr/bin/NotifySend --WaitSignalNotify +[Install] +WantedBy=graphical-session.target diff --git a/immutable/NotifySend/NotifySend.pro b/immutable/NotifySend/NotifySend.pro new file mode 100644 index 0000000..851de71 --- /dev/null +++ b/immutable/NotifySend/NotifySend.pro @@ -0,0 +1,52 @@ +QT += core dbus gui widgets +#CONFIG += console +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +MOC_DIR = ./moctmp +UI_DIR = ./uitmp +RCC_DIR = ./rcctmp +OBJECTS_DIR = ./objtmp + +!contains(QMAKE_HOST.arch, sw_64){ + LIBS += -L$$[QT_INSTALL_LIBS] -lukui-log4qt +} +DEFINES+=WITHKYSEC KYDEBUG +#DEFINES+=WITHKYSEC KYDEBUG +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + checkpower.cpp \ + desktopnotify.cpp \ + main.cpp \ + mainwindow.cpp \ + rebootinstallnotify.cpp + +HEADERS += \ + checkpower.h \ + desktopnotify.h \ + mainwindow.h \ + rebootinstallnotify.h + +TRANSLATIONS += \ + translations/zh_CN.ts \ + translations/tr.ts \ + translations/bo.ts \ + translations/en_US.ts \ + translations/bo_CN.ts \ + translations/mn.ts + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/immutable/NotifySend/NotifySend.pro.user b/immutable/NotifySend/NotifySend.pro.user new file mode 100644 index 0000000..6250c8f --- /dev/null +++ b/immutable/NotifySend/NotifySend.pro.user @@ -0,0 +1,314 @@ + + + + + + EnvironmentId + {e2626406-5b30-4653-bbdc-5f44d69e770a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {3206ba71-3ff7-4f65-a816-e5c227657c1c} + 0 + 0 + 0 + + /home/hechengyuan/project/study/demo/NotifySend/build-NotifySend-unknown-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/hechengyuan/project/study/demo/NotifySend/build-NotifySend-unknown-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + /home/hechengyuan/project/study/demo/NotifySend/build-NotifySend-unknown-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/home/hechengyuan/project/study/demo/NotifySend/NotifySend/NotifySend.pro + /home/hechengyuan/project/study/demo/NotifySend/NotifySend/NotifySend.pro + + false + + false + true + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/immutable/NotifySend/checkpower.cpp b/immutable/NotifySend/checkpower.cpp new file mode 100644 index 0000000..76ef5a1 --- /dev/null +++ b/immutable/NotifySend/checkpower.cpp @@ -0,0 +1,16 @@ +#include "checkpower.h" + +CheckPower::CheckPower() +{ + QDBusInterface upgrade_interface( "com.kylin.systemupgrade", + "/com/kylin/systemupgrade", + "com.kylin.systemupgrade.interface", + QDBusConnection::systemBus() ); + QDBusMessage rebootresult = upgrade_interface.call("DeployLatestUpdate","reboot"); + int reboot =rebootresult.arguments().value(0).toInt(); + QString reason = rebootresult.arguments().value(1).toString(); + if(!reboot) + { + qInfo()<<"reboot success!"; + } +} diff --git a/immutable/NotifySend/checkpower.h b/immutable/NotifySend/checkpower.h new file mode 100644 index 0000000..9be2045 --- /dev/null +++ b/immutable/NotifySend/checkpower.h @@ -0,0 +1,24 @@ +#ifndef CHECKPOWER_H +#define CHECKPOWER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +class CheckPower: public QWidget +{ + Q_OBJECT +public: + CheckPower(); +}; + +#endif // CHECKPOWER_H diff --git a/immutable/NotifySend/desktopnotify.cpp b/immutable/NotifySend/desktopnotify.cpp new file mode 100644 index 0000000..de761f7 --- /dev/null +++ b/immutable/NotifySend/desktopnotify.cpp @@ -0,0 +1,226 @@ +#include "desktopnotify.h" + +DesktopNotify::DesktopNotify(QWidget *parent) : QWidget(parent) +{ + version=getVersion(); + QDBusInterface iface("com.kylin.systemupgrade", + "/com/kylin/systemupgrade", + "com.kylin.systemupgrade.interface", + QDBusConnection::systemBus()); + QDBusMessage result = iface.call("CheckInstallRequired"); + int reboot =result.arguments().value(0).toInt(); + qInfo()<<"reboot result is"< args; + QVariantMap hints; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < args; + QVariantMap hints; + hints.insert("sound-name","Complete"); + hints.insert("x-ukui-popup-timeout",-1); + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + <start(24*60*60*1000); +// timer->start(2*60*1000); + return; + } + } +} + +void DesktopNotify::timenotification_2309() +{ + timer->stop(); + qInfo()<<"[INFO]timenotification_2309 timeout"; + qInfo()<<"DesktopNotify timenotification_2309"; + QStringList actions; + actions.append("NotifySend --PowercheckNotify"); + actions.append(QObject::tr("Reboot")); + actions.append("NotifySend --RebootInstallNotify"); + actions.append(QObject::tr("Later")); + QDBusInterface iface("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + QDBusConnection::sessionBus()); + QList args; + QVariantMap hints; + hints.insert("sound-name","Complete"); + hints.insert("x-ukui-popup-timeout",-1); + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +class DesktopNotify : public QWidget +{ + Q_OBJECT +public: + explicit DesktopNotify(QWidget *parent = nullptr); + ~DesktopNotify(); + int ID=0; + QTimer *timer; + QString getVersion(); + QString version_t = ""; + QString version; +signals: + +public Q_SLOTS: + void RebootNotify(); + +public slots: + void ButtonAction_2309(uint id, QString key); + void timenotification_2309(); +}; + +#endif // DESKTOPNOTIFY_H diff --git a/immutable/NotifySend/getversion.cpp b/immutable/NotifySend/getversion.cpp new file mode 100644 index 0000000..32eac2c --- /dev/null +++ b/immutable/NotifySend/getversion.cpp @@ -0,0 +1,6 @@ +#include "getversion.h" + +GetVersion::GetVersion() +{ + +} diff --git a/immutable/NotifySend/getversion.h b/immutable/NotifySend/getversion.h new file mode 100644 index 0000000..9b617eb --- /dev/null +++ b/immutable/NotifySend/getversion.h @@ -0,0 +1,13 @@ +#ifndef GETVERSION_H +#define GETVERSION_H + +#include + +class GetVersion +{ + Q_OBJECT +public: + GetVersion(); +}; + +#endif // GETVERSION_H diff --git a/immutable/NotifySend/main.cpp b/immutable/NotifySend/main.cpp new file mode 100644 index 0000000..c660c2c --- /dev/null +++ b/immutable/NotifySend/main.cpp @@ -0,0 +1,103 @@ +#include "mainwindow.h" +#include "rebootinstallnotify.h" +#include "desktopnotify.h" +#include "checkpower.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef KYDEBUG +#ifndef __sw_64__ +#include +#endif +#endif +int main(int argc, char *argv[]) +{ + setenv("QT_DEBUG_PLUGINS", "1", 0); + QApplication a(argc, argv); + /*mainwindows为service弹窗 + desktopnotify为desktop弹窗 + 其余类别为执行命令的弹窗(各种功能)*/ +#ifdef KYDEBUG +#ifndef __sw_64__ + initUkuiLog4qt("kylin-update-frontend-notifysend"); +#endif +#endif + + + /*以后需要写配置文件,通过标志位判断某个弹窗是否弹窗*/ + +/*此部分为demo + QCommandLineOption op1("a");// 短名称,无参数 + QCommandLineOption op2("BBB");// 长名称,无参数 + QCommandLineOption op3(QStringList() << "c" << "CCC");// 多个名称,无参数 + QCommandLineOption op4("D", "", "Name");// 短名称,有参数,无默认值 + QCommandLineOption op5("Age", "", "", "18");// 长名称,有参数,有默认值 + QCommandLineOption op6("m", "", "."); // 短名称,有参数,无默认值 + QCommandLineParser parser; + parser.addOption(op1); + parser.addOption(op2); + parser.addOption(op3); + parser.addOption(op4); + parser.addOption(op5); + parser.addOption(op6); + parser.process(a); + qInfo() << parser.isSet(op1); // true + qInfo() << parser.isSet("BBB"); // true + qInfo() << parser.isSet("CCC"); // true + qInfo() << parser.value(op4); // "Jack" + qInfo() << parser.value(op5); // "18" + qInfo() << parser.values(op6);// ("Hello", "World") + qInfo() << parser.helpText(); +*/ + QTranslator translator ; + qInfo()<<"the system.name is "< args; + QVariantMap hints; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < args; + QVariantMap hints; + hints.insert("sound-name","Complete"); + hints.insert("x-ukui-popup-timeout",-1); + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + <start(24*60*60*1000); +// timer->start(2*60*1000); + return; + } + } + +} + +void MainWindow::RebootResult(bool success,QString error_code, QString reason) +{ + if(!success) + { + if(error_code == "#0208") + { + QDBusInterface iface("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + QDBusConnection::sessionBus()); + QList args; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < args; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < args; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + <stop(); + qInfo()<<"[INFO]timenotification timeout"; + qInfo()<<"mainwindow timenotification_2309"; + QStringList actions; + actions.append("NotifySend --PowercheckNotify"); + actions.append(QObject::tr("Reboot")); + actions.append("NotifySend --RebootInstallNotify"); + actions.append(QObject::tr("Later")); + QDBusInterface iface("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + QDBusConnection::sessionBus()); + QList args; + QVariantMap hints; + hints.insert("sound-name","Complete"); + hints.insert("x-ukui-popup-timeout",-1); + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + int ID=0; + QTimer *timer; + QString getVersion(); + QString version_t = ""; + QString version; +public Q_SLOTS: + void RebootNotify(bool success); + void RebootResult(bool success,QString error_code,QString reason); + +public slots: + void ButtonAction_2309(uint id, QString key); + void timenotification_2309(); +}; +#endif // MAINWINDOW_H diff --git a/immutable/NotifySend/rebootinstallnotify.cpp b/immutable/NotifySend/rebootinstallnotify.cpp new file mode 100644 index 0000000..9b51a18 --- /dev/null +++ b/immutable/NotifySend/rebootinstallnotify.cpp @@ -0,0 +1,95 @@ +#include "rebootinstallnotify.h" +/*2309以下版本使用(不含)*/ +RebootInstallNotify::RebootInstallNotify(QWidget *parent) : QWidget(parent) +{ + qInfo()<<"[INFO]get in RebootInstallNotify"; + timer = new QTimer(this); + timer1 = new QTimer(this); +// timer->setInterval(10); + qInfo()<start(24*60*60*1000); +// timer->start(2*60*1000); + timer1->start(60*60*1000); +} + +void RebootInstallNotify::timenotification_2107() +{ + timer->stop(); + qInfo()<<"[INFO]timenotification_2107 timeout"; + qInfo()<<"RebootInstallNotify timenotification_2107"; + QStringList actions; + actions.append("NotifySend --PowercheckNotify"); + actions.append(QObject::tr("Reboot")); + actions.append("NotifySend --RebootInstallNotify"); + actions.append(QObject::tr("Later")); + QDBusInterface iface("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + QDBusConnection::sessionBus()); + QList args; + QVariantMap hints; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + <stop(); + timer1->start(60*60*1000); +} diff --git a/immutable/NotifySend/rebootinstallnotify.h b/immutable/NotifySend/rebootinstallnotify.h new file mode 100644 index 0000000..a411b7a --- /dev/null +++ b/immutable/NotifySend/rebootinstallnotify.h @@ -0,0 +1,35 @@ +#ifndef REBOOTINSTALLNOTIFY_H +#define REBOOTINSTALLNOTIFY_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +class RebootInstallNotify : public QWidget +{ + Q_OBJECT +public: + explicit RebootInstallNotify(QWidget *parent = nullptr); + QTimer *timer; + QTimer *timer1; + int ID = 0; +public slots: + void timenotification_2107(); + void hourdebug(); + void ButtonAction(int id ,QString key); +signals: + +}; + +#endif // REBOOTINSTALLNOTIFY_H diff --git a/plugin/shell/res/i18n/bo.qm b/immutable/NotifySend/translations/bo.qm similarity index 100% rename from plugin/shell/res/i18n/bo.qm rename to immutable/NotifySend/translations/bo.qm diff --git a/immutable/NotifySend/translations/bo.ts b/immutable/NotifySend/translations/bo.ts new file mode 100644 index 0000000..e3c5ddf --- /dev/null +++ b/immutable/NotifySend/translations/bo.ts @@ -0,0 +1,75 @@ + + + + + QObject + + + + + + Reboot + + + + + + + + Later + + + + + + + + + + + System-Upgrade + + + + + + + + After restarting, the new system will be used. + + + + + Low battery level, system update terminated + + + + + System updates are carried out when the battery level is not less than 50%. + + + + + The system disk space is insufficient to complete the update. + + + + + ukui-control-center-upgrade + + + + + + + + Update download completed, do you want to restart the system? + + + + + Reboot failed. + + + + diff --git a/immutable/NotifySend/translations/bo_CN.qm b/immutable/NotifySend/translations/bo_CN.qm new file mode 100644 index 0000000..f8e8ad0 Binary files /dev/null and b/immutable/NotifySend/translations/bo_CN.qm differ diff --git a/immutable/NotifySend/translations/bo_CN.ts b/immutable/NotifySend/translations/bo_CN.ts new file mode 100644 index 0000000..b6db2fb --- /dev/null +++ b/immutable/NotifySend/translations/bo_CN.ts @@ -0,0 +1,87 @@ + + + + + QObject + + + + + + Reboot + བསྐྱར་སློང་། + + + + + + + Later + རྗེས་སུ། + + + + + + + + + + System-Upgrade + མ་ལག་རིམ་སྤར། + + + + + + + After restarting, the new system will be used. + + + + + Low battery level, system update terminated + + + + + System updates are carried out when the battery level is not less than 50%. + + + + + The system disk space is insufficient to complete the update. + + + + + ukui-control-center-upgrade + ukui-control-center-update + + + + + + + Update download completed, do you want to restart the system? + + + + Reboot failed because battery power is lower than 50%. + གློག་ཚད་དམའ་ཞིང་ཡང་བསྐྱར་ཕམ་ཁ་བྱུང་། + + + Backup room is poor. + གྲབས་གཤོམ་བྱེད་པའི་བར་སྟོང་མི་འདང་བ། + + + + Reboot failed. + བསྐྱར་སློང་ཕམ་པ། + + + It's suggested to reboot. + གྲོས་འགོ་ཡང་བསྐྱར་ཕྱེ་ཡོད། + + + diff --git a/plugin/shell/res/i18n/en_US.qm b/immutable/NotifySend/translations/en_US.qm similarity index 100% rename from plugin/shell/res/i18n/en_US.qm rename to immutable/NotifySend/translations/en_US.qm diff --git a/immutable/NotifySend/translations/en_US.ts b/immutable/NotifySend/translations/en_US.ts new file mode 100644 index 0000000..e3c5ddf --- /dev/null +++ b/immutable/NotifySend/translations/en_US.ts @@ -0,0 +1,75 @@ + + + + + QObject + + + + + + Reboot + + + + + + + + Later + + + + + + + + + + + System-Upgrade + + + + + + + + After restarting, the new system will be used. + + + + + Low battery level, system update terminated + + + + + System updates are carried out when the battery level is not less than 50%. + + + + + The system disk space is insufficient to complete the update. + + + + + ukui-control-center-upgrade + + + + + + + + Update download completed, do you want to restart the system? + + + + + Reboot failed. + + + + diff --git a/immutable/NotifySend/translations/mn.ts b/immutable/NotifySend/translations/mn.ts new file mode 100644 index 0000000..5aedaf4 --- /dev/null +++ b/immutable/NotifySend/translations/mn.ts @@ -0,0 +1,87 @@ + + + + + QObject + + + + + + Reboot + ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ᠃ + + + + + + + Later + ᠤᠳᠠᠰᠬᠢᠭᠠᠳ ᠤᠭᠰᠠᠷᠬᠤ + + + + + + + + + + System-Upgrade + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + + + + After restarting, the new system will be used. + + + + + Low battery level, system update terminated + + + + + System updates are carried out when the battery level is not less than 50%. + + + + + The system disk space is insufficient to complete the update. + + + + + ukui-control-center-upgrade + ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ- ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ + + + + + + + Update download completed, do you want to restart the system? + + + + Reboot failed because battery power is lower than 50%. + ᠴᠠᠬᠢᠯᠭᠠᠨ ᠤ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠳᠣᠣᠷ᠎ᠠ ᠂ ᠳᠠᠬᠢᠨ ᠰᠡᠩᠬᠡᠷᠡᠭᠦᠯᠵᠦ ᠪᠣᠯᠬᠤ ᠦᠭᠡᠶ ᠃ + + + Backup room is poor. + ᠪᠡᠯᠡᠳᠬᠡᠯ ᠦᠨ ᠣᠷᠣᠨ ᠵᠠᠶ ᠬᠦᠷᠦᠯᠴᠡᠬᠦ ᠦᠭᠡᠶ ᠃ + + + + Reboot failed. + ᠢᠯᠠᠭᠳᠠᠯ ᠢ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ ᠃ + + + It's suggested to reboot. + ᠳᠠᠷᠤᠢ ᠲᠦᠷᠭᠡᠨ ᠳᠠᠬᠢᠨ ᠰᠡᠩᠭᠡᠷᠡᠭᠦᠯᠬᠦ ᠶᠢ ᠰᠠᠨᠠᠭᠤᠯᠵᠠᠢ ᠃ + + + diff --git a/plugin/shell/res/i18n/tr.qm b/immutable/NotifySend/translations/tr.qm similarity index 100% rename from plugin/shell/res/i18n/tr.qm rename to immutable/NotifySend/translations/tr.qm diff --git a/immutable/NotifySend/translations/tr.ts b/immutable/NotifySend/translations/tr.ts new file mode 100644 index 0000000..e3c5ddf --- /dev/null +++ b/immutable/NotifySend/translations/tr.ts @@ -0,0 +1,75 @@ + + + + + QObject + + + + + + Reboot + + + + + + + + Later + + + + + + + + + + + System-Upgrade + + + + + + + + After restarting, the new system will be used. + + + + + Low battery level, system update terminated + + + + + System updates are carried out when the battery level is not less than 50%. + + + + + The system disk space is insufficient to complete the update. + + + + + ukui-control-center-upgrade + + + + + + + + Update download completed, do you want to restart the system? + + + + + Reboot failed. + + + + diff --git a/immutable/NotifySend/translations/zh_CN.qm b/immutable/NotifySend/translations/zh_CN.qm new file mode 100644 index 0000000..9198fc6 Binary files /dev/null and b/immutable/NotifySend/translations/zh_CN.qm differ diff --git a/immutable/NotifySend/translations/zh_CN.ts b/immutable/NotifySend/translations/zh_CN.ts new file mode 100644 index 0000000..e6f5b63 --- /dev/null +++ b/immutable/NotifySend/translations/zh_CN.ts @@ -0,0 +1,87 @@ + + + + + QObject + + + + + + Reboot + 立即重启 + + + + + + + Later + 稍后重启 + + + + + + + + + + System-Upgrade + 系统更新 + + + + + + + After restarting, the new system will be used. + 将在重启后使用新系统。 + + + + Low battery level, system update terminated + 电池电量过低,系统更新已终止。 + + + + System updates are carried out when the battery level is not less than 50%. + 系统更新在电池电量不低于50%时进行。 + + + + The system disk space is insufficient to complete the update. + 系统磁盘空间不足,无法完成更新。 + + + + ukui-control-center-upgrade + 设置-更新 + + + + + + + Update download completed, do you want to restart the system? + 更新下载完成,是否重启系统? + + + Reboot failed because battery power is lower than 50%. + 电池电量低于50%,升级失败。 + + + Backup room is poor. + 系统磁盘空间不足,无法完成更新。 + + + + Reboot failed. + 重启失败! + + + It's suggested to reboot. + 建议立即重启进行系统更新 + + + diff --git a/README.MD b/immutable/README.MD similarity index 100% rename from README.MD rename to immutable/README.MD diff --git a/immutable/kylin_release_id_2209.py b/immutable/kylin_release_id_2209.py new file mode 100755 index 0000000..3dd1ee9 --- /dev/null +++ b/immutable/kylin_release_id_2209.py @@ -0,0 +1,52 @@ +#!/usr/bin/python3 +import os +import sys +import apt_pkg +import apt + +def ReadOsReleaseFile(): + file = '' + os_release_info={} + try: + if os.path.exists('/etc/os-release'): + file = '/etc/os-release' + elif os.path.exists('/usr/lib/os-release'): + file = '/usr/lib/os-release' + else: + return os_release_info + with open(file) as f: + lines = f.readlines() + for line in lines: + ls = line.strip().split('=',1) + os_release_info.update({ls[0]:ls[1].strip('\"').strip()}) + except Exception: + pass + return os_release_info + +def get_package_version(packagename): + cache = apt.Cache() + if packagename in cache: + pkg = cache[packagename] + return pkg.installed.version + else: + return '' + +def compare_package_version(v1,v2): + return apt_pkg.version_compare(v1,v2) + +if __name__ == "__main__": + os_release_info = ReadOsReleaseFile() + kylin_release_id = '' + ret = 0 + try: + if 'KYLIN_RELEASE_ID' in os_release_info: + kylin_release_id = os_release_info['KYLIN_RELEASE_ID'] + ukui_control_center_version = get_package_version('ukui-control-center') + res = compare_package_version(ukui_control_center_version,sys.argv[1])#'3.1.1+2022-0324' + if kylin_release_id in ["2203","2209"] or res >= 0: + ret = 1 + else: + pass + except Exception as e: + print(e) + print(ret) diff --git a/immutable/notification/CMakeLists.txt b/immutable/notification/CMakeLists.txt new file mode 100644 index 0000000..b23cb79 --- /dev/null +++ b/immutable/notification/CMakeLists.txt @@ -0,0 +1,56 @@ +# CMake 最低版本号要求 +cmake_minimum_required (VERSION 2.8) + +#项目信息 +project (kylin-update-notify) + +#添加第三方函数库 +find_package(PkgConfig) + +#增加指定头文件 +pkg_check_modules(GLib REQUIRED glib-2.0) +if(GLib_FOUND) +include_directories(${GLib_INCLUDE_DIRS}) +link_libraries(${GLib_LIBRARIES}) +endif(GLib_FOUND) + +pkg_check_modules(DBus REQUIRED dbus-1) +if(DBus_FOUND) +include_directories(${DBus_INCLUDE_DIRS}) +link_libraries(${DBus_LIBRARIES}) +endif(DBus_FOUND) + +pkg_check_modules(GObject REQUIRED gobject-2.0) +if(GObject_FOUND) +include_directories(${GObject_INCLUDE_DIRS}) +link_libraries(${GObject_LIBRARIES}) +endif(GObject_FOUND) + +pkg_check_modules(Libnotify REQUIRED libnotify) +if(Libnotify_FOUND) +include_directories(${Libnotify_INCLUDE_DIRS}) +link_libraries(${Libnotify_LIBRARIES}) +endif(Libnotify_FOUND) + +aux_source_directory(./src SRC_MAIN) +aux_source_directory(./kylin-updateresult-notify/src SRC_MAIN1) + +add_definitions("-Wall -g") + +#指定生成目标 +add_executable(kylin-updatefinish-notify-new ${SRC_MAIN}) +add_executable(kylin-updateresult-notify-new ${SRC_MAIN1}) +#链接动态库 +target_link_libraries(kylin-updatefinish-notify-new libglib-2.0.so libnotify.so libgobject-2.0.so) +target_link_libraries(kylin-updateresult-notify-new libglib-2.0.so libnotify.so libgobject-2.0.so) +#确定执行文件生成路径 +set_target_properties( +kylin-updatefinish-notify-new +PROPERTIES +RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/../" +) +set_target_properties( +kylin-updateresult-notify-new +PROPERTIES +RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/../" +) diff --git a/notification/kylin-system-updater-notify-new.mo b/immutable/notification/kylin-system-updater-notify-new.mo similarity index 100% rename from notification/kylin-system-updater-notify-new.mo rename to immutable/notification/kylin-system-updater-notify-new.mo diff --git a/immutable/notification/kylin-updatefinish-notify1.desktop b/immutable/notification/kylin-updatefinish-notify1.desktop new file mode 100644 index 0000000..42847f3 --- /dev/null +++ b/immutable/notification/kylin-updatefinish-notify1.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=kylin-updatefinish-notify-new +Exec=/usr/bin/kylin-updatefinish-notify-new +Type=Application +NoDisplay=true +Comment=kylin-updatefinish-notify +Name[zh_CN]=更新重启提示 +Name[bo_CN]=གསར་བརྗེ་བསྐྱར་དུ་བྱེད་མགོ་བཙུགས་སྣེ་སྟོན། diff --git a/immutable/notification/kylin-updateresult-notify.desktop b/immutable/notification/kylin-updateresult-notify.desktop new file mode 100644 index 0000000..caec928 --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=kylin-updateresult-notify +Exec=kylin-updateresult-notify-new +Type=Application +X-UKUI-Autostart-Phase=Notification +NoDisplay=true +Comment=kylin-updateresult-notify +Name[zh_CN]=更新结果提示 diff --git a/immutable/notification/kylin-updateresult-notify.mo b/immutable/notification/kylin-updateresult-notify.mo new file mode 100644 index 0000000..a93d85f Binary files /dev/null and b/immutable/notification/kylin-updateresult-notify.mo differ diff --git a/immutable/notification/kylin-updateresult-notify/.vscode/settings.json b/immutable/notification/kylin-updateresult-notify/.vscode/settings.json new file mode 100644 index 0000000..01dac6e --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "files.associations": { + "notify.h": "c", + "notify-enum-types.h": "c", + "dbus.h": "c", + "system_error": "c" + } +} \ No newline at end of file diff --git a/notification/src/gcc.txt b/immutable/notification/kylin-updateresult-notify/src/gcc.txt similarity index 100% rename from notification/src/gcc.txt rename to immutable/notification/kylin-updateresult-notify/src/gcc.txt diff --git a/immutable/notification/kylin-updateresult-notify/src/main.c b/immutable/notification/kylin-updateresult-notify/src/main.c new file mode 100644 index 0000000..cdf27f7 --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify/src/main.c @@ -0,0 +1,105 @@ +#include +#include +// #include +// #include +// #include +// #include +// #include +#include "notifications.h" +#include +#include +int main(void) +{ + FILE *fp; + if( (fp=fopen("/tmp/kylin-updateresult-notify.log","a+")) == NULL ) + { + fprintf(fp,"Fail to open file!\n"); + return -2; + } + fprintf (fp,"prepare to popup notification in 50s\n"); + sleep(50); + // DBusConnection *connection; + // DBusError error; + // DBusMessage *message; + // DBusMessageIter iter; + // DBusPendingCall *call; + // char *sigvalue; + // dbus_error_init(&error); + GDBusProxy *login_proxy = NULL; + GVariant *listsession_var = NULL; + GError *error = NULL; + + login_proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + NULL, + "com.kylin.systemupgrade", + "/com/kylin/systemupgrade", + "com.kylin.systemupgrade.interface", + NULL, + &error); + + if (error != NULL) { + fprintf(fp,"error!\n"); + g_error_free(error); + notifications("error"); + return 1; + } + + error = NULL; + + listsession_var = g_dbus_proxy_call_sync (login_proxy, + "CheckPopupOnPoweroffInstalled", + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + + if (listsession_var == NULL) { + g_object_unref(login_proxy); + fprintf(fp,"error2!\n"); + notifications("error"); + return 1; + } + // GVariantIter *iter; + // g_variant_get(listsession_var, "(a(susso))", &iter); + // gchar *sessionId, *userName, *seatId; + // guint32 userId; + // GObject *objectPath; + + + gchar* content; + gboolean type = TRUE; + content = g_variant_print(listsession_var,type); + fprintf (fp,"the type is %d\n", type); + fprintf (fp,"the content is %s\n", content); + + //gboolean result; + gchar* result; + // result = g_variant_get_boolean(listsession_var); + // while (g_variant_iter_loop (iter, "(susso)", &sessionId, &userId, &userName, &seatId, &objectPath)) + // { + // printf ("the result is %d\n", g_variant_get_boolean(listsession_var)); + g_variant_get(listsession_var, "(s)", &result); + // g_variant_iter_loop (iter, "(b)", result); + fprintf (fp,"the result is %s\n", result); + // } + // while (g_variant_iter_loop (iter, "b", &result)) + // { + // qCritical() << sessionId << userName << seatId << userId; + // } + g_object_unref(login_proxy); + //g_variant_iter_free (iter); + g_variant_unref(listsession_var); + if(strcmp(result,"success") == 0) + notifications("success"); + else if(strcmp(result,"none") == 0) + return 0; + else + notifications(result); + fflush(fp); + fclose(fp); + return 0; +} + + diff --git a/immutable/notification/kylin-updateresult-notify/src/messages.po b/immutable/notification/kylin-updateresult-notify/src/messages.po new file mode 100644 index 0000000..ef2eeff --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify/src/messages.po @@ -0,0 +1,46 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-31 09:33+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: notifications.c:17 +msgid "System Update" +msgstr "系统更新" + +#: notifications.c:25 +msgid "Download finish, do you want to reboot?" +msgstr "更新下载完成,是否重启系统?" + +#: notifications.c:26 +msgid "The system will use the new system after restarting." +msgstr "系统将在重启后使用更新应用。" + +#: notifications.c:29 notifications.c:39 notifications.c:50 notifications.c:63 +msgid "OK" +msgstr "确定" + +#: notifications.c:36 +msgid "Update Failed!" +msgstr "更新失败!" + +#: notifications.c:47 +msgid "The backend is abnormal,please check for updates on settings." +msgstr "后台程序异常,请手动打开更新-设置查找问题" + +#: notifications.c:55 +msgid "upgrade fail! Error code(" +msgstr "更新失败!错误码(" diff --git a/immutable/notification/kylin-updateresult-notify/src/notification.po b/immutable/notification/kylin-updateresult-notify/src/notification.po new file mode 100644 index 0000000..b04decb --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify/src/notification.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-31 09:49+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language:zh_CN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: notifications.c:17 +msgid "System Update" +msgstr "系统更新" + +#: notifications.c:28 +msgid "Update Success!" +msgstr "更新成功!" + +#: notifications.c:31 notifications.c:41 notifications.c:52 notifications.c:65 +msgid "OK" +msgstr "确定" + +#: notifications.c:38 +msgid "Update Failed!" +msgstr "更新失败!" + +#: notifications.c:49 +msgid "The backend is abnormal,please check for updates on settings." +msgstr "后台程序异常,请手动检查更新确定升级是否成功。" + +#: notifications.c:57 +msgid "upgrade fail! Error code(" +msgstr "更新失败!错误码(" diff --git a/immutable/notification/kylin-updateresult-notify/src/notifications.c b/immutable/notification/kylin-updateresult-notify/src/notifications.c new file mode 100644 index 0000000..32232b5 --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify/src/notifications.c @@ -0,0 +1,104 @@ +#include "notifications.h" + +int notifications (char *sigvalue) +{ + FILE *fp; + if( (fp=fopen("/tmp/kylin-updateresult-notify.log","a+")) == NULL ) + { + fprintf(fp,"Fail to open file!\n"); + return -2; + } + setlocale(LC_ALL, ""); + bindtextdomain("kylin-updateresult-notify","/usr/share/locale"); + textdomain("kylin-updateresult-notify"); + NotifyNotification* notification; + gboolean success; + GError* error = NULL; + if (!notify_init (gettext("System Update"))) + { + fprintf(fp,"notify_init failed!\n"); + return 1; + } + if(strcmp(sigvalue,"success") == 0){ + fprintf(fp,"upgrade success!\n"); + notification = notify_notification_new ( + // gettext("Download finish, do you want to reboot?"), + // gettext("The system will use the new system after restarting."), + NULL, + gettext("Update Success!"), + "/usr/share/icons/ukui-icon-theme-default/16x16/apps/ukui-control-center.png"); + notify_notification_set_timeout(notification, 0); + notify_notification_add_action(notification, "OK", gettext("OK"), + (NotifyActionCallback)actionClose ,NULL, NULL); + notify_notification_set_hint_int32(notification,"x-ukui-popup-timeout",-1); + } + else if(strcmp(sigvalue,"failed") == 0){ + fprintf(fp,"upgrade fail!\n"); + notification = notify_notification_new ( + NULL, + gettext("Update Failed!"), + "/usr/share/icons/ukui-icon-theme-default/16x16/apps/ukui-control-center.png"); + notify_notification_set_timeout(notification, 0); + notify_notification_add_action(notification, "OK", gettext("OK"), + (NotifyActionCallback)actionClose ,NULL, NULL); + notify_notification_set_hint_int32(notification,"x-ukui-popup-timeout",-1); + } + else if(strcmp(sigvalue,"error") == 0){ + fprintf(fp,"upgrade error!\n"); + notification = notify_notification_new ( + //gettext("System Update"), + NULL, + gettext("The backend is abnormal,please check for updates on settings."), + "/usr/share/icons/ukui-icon-theme-default/16x16/apps/ukui-control-center.png"); + notify_notification_set_timeout(notification, 0); + notify_notification_add_action(notification, "OK", gettext("OK"), + (NotifyActionCallback)actionClose ,NULL, NULL); + } + else{ + fprintf(fp,"upgrade fail!\n"); + char str[50]; + memset(str,0,sizeof(str)); + char *str1 = gettext("upgrade fail! Error code("); + fprintf(fp,"error code is %s\n",sigvalue); + strcat(str,str1); + strcat(str,sigvalue); + strcat(str,")"); + notification = notify_notification_new ( + NULL, + gettext(str), + "/usr/share/icons/ukui-icon-theme-default/16x16/apps/ukui-control-center.png"); + notify_notification_set_timeout(notification, 0); + notify_notification_add_action(notification, "OK", gettext("OK"), + (NotifyActionCallback)actionClose ,NULL, NULL); + notify_notification_set_hint_int32(notification,"x-ukui-popup-timeout",-1); + } + error = NULL; + success = notify_notification_show (notification, &error); + if (!success){ + //g_print ("That did not work ... \"%s\".\n", error->message); + fprintf (fp,"That did not work ... \"%s\".\n", error->message); + g_error_free (error); + } + g_signal_connect (G_OBJECT (notification), + "closed", + G_CALLBACK (closed_handler), + NULL); + mainloop=g_main_loop_new(NULL, false); + g_main_loop_run(mainloop); + notify_uninit (); + return 0; +} + + +void closed_handler(NotifyNotification* notification, gpointer data){ + notify_uninit (); + g_print ("closed_handler() called\n"); + g_main_loop_quit(mainloop); + return; +} + +void actionClose(NotifyNotification* notification,char *action, gpointer data){ + g_print("Closed\n"); + g_print ("dbus_method_called to change the sigvalue"); + return; +} \ No newline at end of file diff --git a/immutable/notification/kylin-updateresult-notify/src/notifications.h b/immutable/notification/kylin-updateresult-notify/src/notifications.h new file mode 100644 index 0000000..feb4ed5 --- /dev/null +++ b/immutable/notification/kylin-updateresult-notify/src/notifications.h @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //for mainloop +#include +#include +#include +#include //gettext +#include +#include +#define false 0 + +int notifications(char *sigvalue); +void closed_handler(NotifyNotification* notification,gpointer data); +void actionClose(NotifyNotification* notification,char *action, gpointer data); +GMainLoop* mainloop; \ No newline at end of file diff --git a/immutable/notification/src/gcc.txt b/immutable/notification/src/gcc.txt new file mode 100644 index 0000000..b6c63bc --- /dev/null +++ b/immutable/notification/src/gcc.txt @@ -0,0 +1 @@ +gcc `pkg-config --cflags --libs dbus-1` main.c -o main -ldbus-1 diff --git a/notification/src/main.c b/immutable/notification/src/main.c similarity index 100% rename from notification/src/main.c rename to immutable/notification/src/main.c diff --git a/immutable/notification/src/notifications.c b/immutable/notification/src/notifications.c new file mode 100644 index 0000000..520d88e --- /dev/null +++ b/immutable/notification/src/notifications.c @@ -0,0 +1,174 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include //for mainloop +#include +#include +#include + +#include //gettext +#include +#include + + +#define false 0 +//#define _(string) gettext(string) + +void closed_handler(NotifyNotification* notification,gpointer data); +void actionClose(NotifyNotification* notification,char *action, gpointer data); +void actionReboot(NotifyNotification* notification,char *action, gpointer data); +void actionLogout(NotifyNotification* notification,char *action, gpointer data); + + +GMainLoop* mainloop; + +int notifications (char *sigvalue) +{ + + setlocale(LC_ALL, "");//yuyanshezhi + bindtextdomain("kylin-system-updater-notify","/usr/share/locale"); + textdomain("kylin-system-updater-notify"); + + NotifyNotification* notification; + gboolean success; + GError* error = NULL; + printf("2\n"); + if (!notify_init (gettext("Update Finished!")))//zhuti + return 1; + + // /* try the icon-summary-body case */ + // notification = notify_notification_new ( + // gettext("Update Finished!"),//biaoti + // gettext("It's suggested to reboot immediately."),//neirong + // "");//icon + + // notify_notification_set_timeout(notification, 10*1000);//shijian yijing bei xiesi + + if(strcmp(sigvalue,"reboot") == 0) + { + printf("It should reboot\n"); + /* try the icon-summary-body case */ + notification = notify_notification_new ( + gettext("Update Finished!"),//biaoti + gettext("It's suggested to reboot immediately."),//neirong + "/usr/share/icons/ukui-icon-theme-default/16x16/apps/ukui-control-center.png");//icon + + notify_notification_set_timeout(notification, 0);//shijian yijing bei xiesi + notify_notification_add_action(notification, "Reboot", gettext("Reboot") , (NotifyActionCallback)actionReboot , NULL, NULL); + notify_notification_add_action(notification, "Closed", gettext("Closed"), (NotifyActionCallback)actionClose , NULL, NULL); + notify_notification_set_hint_string(notification,"Reboot","reboot"); + //notify_notification_set_hint(notification,"",""); + } + + if(strcmp(sigvalue,"logout") == 0) + { + + /* try the icon-summary-body case */ + notification = notify_notification_new ( + gettext("Update Finished!"),//title + gettext("It's suggested to logout immediately."),//content + "");//icon + + notify_notification_set_timeout(notification, 0);//shijian yijing bei xiesi + + notify_notification_add_action(notification, "Logout", gettext("Logout") , (NotifyActionCallback)actionLogout , NULL, NULL); + notify_notification_add_action(notification, "Closed", gettext("Closed"), (NotifyActionCallback)actionClose , NULL, NULL); + notify_notification_set_hint_string(notification,"Logout","logout"); + //notify_notification_set_hint(notification,"",""); + } + + error = NULL; + success = notify_notification_show (notification, &error); + if (!success) + { + g_print ("That did not work ... \"%s\".\n", error->message); + g_error_free (error); + } + + g_signal_connect (G_OBJECT (notification), + "closed", + G_CALLBACK (closed_handler), + NULL); + + mainloop=g_main_loop_new(NULL, false); + g_main_loop_run(mainloop); + + notify_uninit (); + + return 0; +} + + +void closed_handler(NotifyNotification* notification, gpointer data) +{ notify_uninit (); + g_print ("closed_handler() called\n"); + g_main_loop_quit(mainloop); + return; +} + +void actionClose(NotifyNotification* notification,char *action, gpointer data) +{ + g_print("Closed\n"); + return; +} + +void actionReboot(NotifyNotification* notification,char *action, gpointer data) +{ + g_print ("get signal to reboot\n"); + system("ukui-session-tools --reboot"); + return; + // g_print("Reboot\n"); + // //dbus_reboot_method_call(); + // DBusConnection *connection; + // DBusMessage *message; + // DBusError err ; + // DBusMessageIter iter; + + // dbus_bool_t reboot=false;//dbus 内部bool型 + + // dbus_error_init(&err); + // connection = dbus_bus_get(DBUS_BUS_SYSTEM, &err); + + // if(!connection) + // { + // fprintf(stderr, "Fail to get a system dbus connection: %s\n", err.message); + // exit(1); + // } + + // message = dbus_message_new_method_call("org.freedesktop.login1", + // "/org/freedesktop/login1", //object + // "org.freedesktop.login1.Manager",//interface + // "Reboot");//method name + + + // if (NULL == message) + // { + // fprintf(stderr, "Message Null\n"); + // exit(1); + // } + + // dbus_message_iter_init_append(message, &iter); + // if( !dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &reboot)) + // { + // fprintf(stderr, "Out of Memory!\n"); + // exit(1); + // } + + // dbus_connection_send(connection,message,NULL); + // dbus_connection_flush(connection); + // dbus_message_unref(message); + // return; +} + +void actionLogout(NotifyNotification* notification,char *action, gpointer data) +{ + g_print("Logout\n"); + system("ukui-session-tools --logout"); + return; +} diff --git a/notification/src/notifications.h b/immutable/notification/src/notifications.h similarity index 100% rename from notification/src/notifications.h rename to immutable/notification/src/notifications.h diff --git a/notification/src/notify.po b/immutable/notification/src/notify.po similarity index 100% rename from notification/src/notify.po rename to immutable/notification/src/notify.po diff --git a/plugin/config_file/kylin-need-logout-new.conf b/immutable/plugin/config_file/kylin-need-logout-new.conf similarity index 100% rename from plugin/config_file/kylin-need-logout-new.conf rename to immutable/plugin/config_file/kylin-need-logout-new.conf diff --git a/plugin/config_file/kylin-need-reboot-new.conf b/immutable/plugin/config_file/kylin-need-reboot-new.conf similarity index 100% rename from plugin/config_file/kylin-need-reboot-new.conf rename to immutable/plugin/config_file/kylin-need-reboot-new.conf diff --git a/plugin/image/close.png b/immutable/plugin/image/close.png similarity index 100% rename from plugin/image/close.png rename to immutable/plugin/image/close.png diff --git a/plugin/image/refresh.png b/immutable/plugin/image/refresh.png similarity index 100% rename from plugin/image/refresh.png rename to immutable/plugin/image/refresh.png diff --git a/plugin/image/search.png b/immutable/plugin/image/search.png similarity index 100% rename from plugin/image/search.png rename to immutable/plugin/image/search.png diff --git a/plugin/shell/interface.h b/immutable/plugin/shell/interface.h similarity index 100% rename from plugin/shell/interface.h rename to immutable/plugin/shell/interface.h diff --git a/plugin/translations/bo.qm b/immutable/plugin/shell/res/i18n/bo.qm similarity index 100% rename from plugin/translations/bo.qm rename to immutable/plugin/shell/res/i18n/bo.qm diff --git a/plugin/shell/res/i18n/bo.ts b/immutable/plugin/shell/res/i18n/bo.ts similarity index 100% rename from plugin/shell/res/i18n/bo.ts rename to immutable/plugin/shell/res/i18n/bo.ts diff --git a/plugin/shell/res/i18n/zh_CN.qm b/immutable/plugin/shell/res/i18n/en_US.qm similarity index 100% rename from plugin/shell/res/i18n/zh_CN.qm rename to immutable/plugin/shell/res/i18n/en_US.qm diff --git a/plugin/shell/res/i18n/en_US.ts b/immutable/plugin/shell/res/i18n/en_US.ts similarity index 100% rename from plugin/shell/res/i18n/en_US.ts rename to immutable/plugin/shell/res/i18n/en_US.ts diff --git a/plugin/translations/tr.qm b/immutable/plugin/shell/res/i18n/tr.qm similarity index 100% rename from plugin/translations/tr.qm rename to immutable/plugin/shell/res/i18n/tr.qm diff --git a/plugin/shell/res/i18n/tr.ts b/immutable/plugin/shell/res/i18n/tr.ts similarity index 100% rename from plugin/shell/res/i18n/tr.ts rename to immutable/plugin/shell/res/i18n/tr.ts diff --git a/immutable/plugin/shell/res/i18n/zh_CN.qm b/immutable/plugin/shell/res/i18n/zh_CN.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/plugin/shell/res/i18n/zh_CN.qm @@ -0,0 +1 @@ + + + upgrade/kylin-update-desktop-app.png + upgrade/kylin-update-desktop-kernel-3a4000.png + upgrade/kylin-update-desktop-kernel.png + upgrade/kylin-update-desktop-security.png + upgrade/kylin-update-desktop-support.png + upgrade/kylin-update-desktop-ukui.png + upgrade/linux-generic.png + upgrade/loading10.svg + upgrade/loading11.svg + upgrade/loading12.svg + upgrade/loading13.svg + upgrade/loading14.svg + upgrade/loading15.svg + upgrade/loading16.svg + upgrade/loading17.svg + upgrade/normal.png + upgrade/refresh.png + upgrade/update.png + upgrade/no_content_light.svg + upgrade/no_content_dark.svg + + + upgrade/no_content_light.svg + upgrade/no_content_dark.svg + + diff --git a/plugin/shell/res/upgrade/kylin-update-desktop-app.png b/immutable/plugin/shell/res/upgrade/kylin-update-desktop-app.png similarity index 100% rename from plugin/shell/res/upgrade/kylin-update-desktop-app.png rename to immutable/plugin/shell/res/upgrade/kylin-update-desktop-app.png diff --git a/plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png b/immutable/plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png similarity index 100% rename from plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png rename to immutable/plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png diff --git a/plugin/shell/res/upgrade/kylin-update-desktop-kernel.png b/immutable/plugin/shell/res/upgrade/kylin-update-desktop-kernel.png similarity index 100% rename from plugin/shell/res/upgrade/kylin-update-desktop-kernel.png rename to immutable/plugin/shell/res/upgrade/kylin-update-desktop-kernel.png diff --git a/plugin/shell/res/upgrade/kylin-update-desktop-security.png b/immutable/plugin/shell/res/upgrade/kylin-update-desktop-security.png similarity index 100% rename from plugin/shell/res/upgrade/kylin-update-desktop-security.png rename to immutable/plugin/shell/res/upgrade/kylin-update-desktop-security.png diff --git a/plugin/shell/res/upgrade/kylin-update-desktop-support.png b/immutable/plugin/shell/res/upgrade/kylin-update-desktop-support.png similarity index 100% rename from plugin/shell/res/upgrade/kylin-update-desktop-support.png rename to immutable/plugin/shell/res/upgrade/kylin-update-desktop-support.png diff --git a/plugin/shell/res/upgrade/kylin-update-desktop-ukui.png b/immutable/plugin/shell/res/upgrade/kylin-update-desktop-ukui.png similarity index 100% rename from plugin/shell/res/upgrade/kylin-update-desktop-ukui.png rename to immutable/plugin/shell/res/upgrade/kylin-update-desktop-ukui.png diff --git a/plugin/shell/res/upgrade/linux-generic.png b/immutable/plugin/shell/res/upgrade/linux-generic.png similarity index 100% rename from plugin/shell/res/upgrade/linux-generic.png rename to immutable/plugin/shell/res/upgrade/linux-generic.png diff --git a/plugin/shell/res/upgrade/loading10.svg b/immutable/plugin/shell/res/upgrade/loading10.svg similarity index 100% rename from plugin/shell/res/upgrade/loading10.svg rename to immutable/plugin/shell/res/upgrade/loading10.svg diff --git a/plugin/shell/res/upgrade/loading11.svg b/immutable/plugin/shell/res/upgrade/loading11.svg similarity index 100% rename from plugin/shell/res/upgrade/loading11.svg rename to immutable/plugin/shell/res/upgrade/loading11.svg diff --git a/plugin/shell/res/upgrade/loading12.svg b/immutable/plugin/shell/res/upgrade/loading12.svg similarity index 100% rename from plugin/shell/res/upgrade/loading12.svg rename to immutable/plugin/shell/res/upgrade/loading12.svg diff --git a/plugin/shell/res/upgrade/loading13.svg b/immutable/plugin/shell/res/upgrade/loading13.svg similarity index 100% rename from plugin/shell/res/upgrade/loading13.svg rename to immutable/plugin/shell/res/upgrade/loading13.svg diff --git a/plugin/shell/res/upgrade/loading14.svg b/immutable/plugin/shell/res/upgrade/loading14.svg similarity index 100% rename from plugin/shell/res/upgrade/loading14.svg rename to immutable/plugin/shell/res/upgrade/loading14.svg diff --git a/plugin/shell/res/upgrade/loading15.svg b/immutable/plugin/shell/res/upgrade/loading15.svg similarity index 100% rename from plugin/shell/res/upgrade/loading15.svg rename to immutable/plugin/shell/res/upgrade/loading15.svg diff --git a/plugin/shell/res/upgrade/loading16.svg b/immutable/plugin/shell/res/upgrade/loading16.svg similarity index 100% rename from plugin/shell/res/upgrade/loading16.svg rename to immutable/plugin/shell/res/upgrade/loading16.svg diff --git a/plugin/shell/res/upgrade/loading17.svg b/immutable/plugin/shell/res/upgrade/loading17.svg similarity index 100% rename from plugin/shell/res/upgrade/loading17.svg rename to immutable/plugin/shell/res/upgrade/loading17.svg diff --git a/immutable/plugin/shell/res/upgrade/no_content_dark.svg b/immutable/plugin/shell/res/upgrade/no_content_dark.svg new file mode 100644 index 0000000..2a198f5 --- /dev/null +++ b/immutable/plugin/shell/res/upgrade/no_content_dark.svg @@ -0,0 +1,22 @@ + + + 灰色/通用/无数据-深色模式@3x + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/immutable/plugin/shell/res/upgrade/no_content_light.svg b/immutable/plugin/shell/res/upgrade/no_content_light.svg new file mode 100644 index 0000000..550ca2b --- /dev/null +++ b/immutable/plugin/shell/res/upgrade/no_content_light.svg @@ -0,0 +1,17 @@ + + + 灰色/通用/无数据-浅色模式 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugin/shell/res/upgrade/normal.png b/immutable/plugin/shell/res/upgrade/normal.png similarity index 100% rename from plugin/shell/res/upgrade/normal.png rename to immutable/plugin/shell/res/upgrade/normal.png diff --git a/plugin/shell/res/upgrade/refresh.png b/immutable/plugin/shell/res/upgrade/refresh.png similarity index 100% rename from plugin/shell/res/upgrade/refresh.png rename to immutable/plugin/shell/res/upgrade/refresh.png diff --git a/plugin/shell/res/upgrade/update.png b/immutable/plugin/shell/res/upgrade/update.png similarity index 100% rename from plugin/shell/res/upgrade/update.png rename to immutable/plugin/shell/res/upgrade/update.png diff --git a/immutable/plugin/src/AddFunction/datetimeutils.cpp b/immutable/plugin/src/AddFunction/datetimeutils.cpp new file mode 100644 index 0000000..badf208 --- /dev/null +++ b/immutable/plugin/src/AddFunction/datetimeutils.cpp @@ -0,0 +1,136 @@ +#include "datetimeutils.h" + +#include +#include +#include +#include +DateTimeUtils* DateTimeUtils::m_dataTimeInstance = nullptr; +DateTimeUtils *DateTimeUtils::get_instance() +{ + if(m_dataTimeInstance == nullptr){ + m_dataTimeInstance = new DateTimeUtils; + } + return m_dataTimeInstance; +} + + +DateTimeUtils::DateTimeUtils(QObject *parent /*= nullptr*/): QObject(parent) +{ + WatchingTimeFormat(); +} + +void DateTimeUtils::WatchingTimeFormat() +{ + //监听系统时间格式转换 + m_dateSessionDbus = new QDBusInterface("com.kylin.kysdk.DateServer", + "/com/kylin/kysdk/Date", + "com.kylin.kysdk.DateInterface", + QDBusConnection::sessionBus(), + this); + if (m_dateSessionDbus->isValid()) { + connect(m_dateSessionDbus, SIGNAL(DateSignal(QString)), this, SLOT(TranslationTime(QString))); + connect(m_dateSessionDbus, SIGNAL(ShortDateSignal(QString)), this, SLOT(TranslationTime(QString))); + connect(m_dateSessionDbus, SIGNAL(LongDateSignal(QString)), this, SLOT(TranslationTime(QString))); + connect(m_dateSessionDbus, SIGNAL(TimeSignal(QString)), this, SLOT(TranslationTime(QString))); + } +// m_dateFormatOld = "yyyy-MM-dd"; +// m_dateFormatNow = kdk_system_get_shortformat(); +// m_timeFormatOld = "hh:mm:ss"; +// QString newTimeFormat(kdk_system_get_now_timeformat());//这个接口会影响安全中心翻译 +// setLanguage(); //重新加载翻译 +// if (newTimeFormat.contains("12")) { +// m_timeFormatNow = "ap hh:mm:ss"; +// } else { +// m_timeFormatNow = "hh:mm:ss"; +// } +} + +//void DateTimeUtils::DateFormatChange(QString dateFormat) +//{ +// Q_UNUSED(dateFormat) +// QString shortDateFormat(kdk_system_get_shortformat()); +// if (m_dateFormatNow != shortDateFormat) { +// m_dateFormatOld = m_dateFormatNow; +// m_dateFormatNow = shortDateFormat; +// emit this->ShortDateSignal(); +// qDebug()<<"emit ShortDateSignal"; +// } +//} + +//struct tm DateTimeUtils::QDateTimeToCtm(const QDateTime &datetime) +//{ +// struct tm c_time; +// c_time.tm_year = datetime.date().year(); +// c_time.tm_mon = datetime.date().month(); +// c_time.tm_mday = datetime.date().day(); +// c_time.tm_hour = datetime.time().hour(); +// c_time.tm_min = datetime.time().minute(); +// c_time.tm_sec = datetime.time().second(); + +// return c_time; +//} + +QString DateTimeUtils::TranslationTime(QString time) +{ + qInfo()<<"sdk====>TranslationTime function"; + if(time == tr("No information!")) + { + return time; + } + if(time == NULL) + { + return time; + } + if(!time.contains(" ")) + { + return time; + } + if(!time.contains("-")) + { + return time; + } + if(!time.contains(":")) + { + return time; + } + struct tm timestruct; +// time = "2022-08-01 22:00:00"; + QStringList timelist = time.split(" "); + qDebug()<<"timelist is"<time; + qDebug()<timesec; + QString sdktime = kdk_timestruct->timesec; + QString sdk_time = sdkdatestring + " " +sdktime; + qInfo()<<"finish tanslationtime"; + return sdk_time; +} + +DateTimeUtils::~DateTimeUtils() +{ +// if (m_dateSessionDbus) +// delete m_dateSessionDbus; +} diff --git a/immutable/plugin/src/AddFunction/datetimeutils.h b/immutable/plugin/src/AddFunction/datetimeutils.h new file mode 100644 index 0000000..7a7c448 --- /dev/null +++ b/immutable/plugin/src/AddFunction/datetimeutils.h @@ -0,0 +1,35 @@ +#ifndef DATETIMEUTILS_H +#define DATETIMEUTILS_H + +#include +#include +#include +#include +class DateTimeUtils : public QObject +{ + Q_OBJECT +public: + DateTimeUtils(QObject *parent = nullptr); + virtual ~DateTimeUtils(); + void WatchingTimeFormat(); + static DateTimeUtils* get_instance(); + QString TranslationTime(QString time); +public slots: + void DateFormatChange(QString dateFormat); + void TimeFormatChange(QString timeFormat); +// QString TranslationTime(QString time); +private: + static DateTimeUtils *m_dataTimeInstance; + QString m_dateFormatNow; + QString m_dateFormatOld; + QString m_timeFormatNow; + QString m_timeFormatOld; + struct tm QDateTimeToCtm(const QDateTime &datetime); + + + QDBusInterface * m_dateSessionDbus = nullptr; +signals: + void ShortDateSignal(); +}; + +#endif // DATETIMEUTILS_H diff --git a/immutable/plugin/src/Data/global.cpp b/immutable/plugin/src/Data/global.cpp new file mode 100644 index 0000000..4f2f951 --- /dev/null +++ b/immutable/plugin/src/Data/global.cpp @@ -0,0 +1,15 @@ +#include "global.h" + +Global::Global() +{ + +} + +Global::~Global() +{ + +} + +QString Global::UpdateMode = "True"; +QString Global::Version =""; +int Global::ServerNum = 0; diff --git a/immutable/plugin/src/Data/global.h b/immutable/plugin/src/Data/global.h new file mode 100644 index 0000000..76c0b70 --- /dev/null +++ b/immutable/plugin/src/Data/global.h @@ -0,0 +1,19 @@ +#ifndef GLOBAL_H +#define GLOBAL_H + +#include + + +class Global +{ +public: + Global(); + ~Global(); + +public: + static QString UpdateMode; + static QString Version; + static int ServerNum; +}; + +#endif // GLOBAL_H diff --git a/immutable/plugin/src/SecondaryWidget/setwidget.cpp b/immutable/plugin/src/SecondaryWidget/setwidget.cpp new file mode 100644 index 0000000..9af0862 --- /dev/null +++ b/immutable/plugin/src/SecondaryWidget/setwidget.cpp @@ -0,0 +1,342 @@ +#include "setwidget.h" +#include "src/xatom-helper.h" +SetWidget::SetWidget(QWidget* parent):QDialog(parent) +{ + this->setAutoFillBackground(true); + this->setBackgroundRole(QPalette::Base); + this->setWindowModality(Qt::ApplicationModal); + this->setWindowFlag(Qt::Tool); + this->setFixedWidth(550); + MotifWmHints hints; + hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + hints.functions = MWM_FUNC_ALL; + hints.decorations = MWM_DECOR_BORDER; + XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints); +// this->setFixedSize(450,560); + showAreaWidget = new QWidget(this); + showAreaWidget->setObjectName("showArea"); + scrollArea = new QScrollArea(this); + scrollArea->setObjectName("scroll"); + this->setFixedHeight(560); +// this->setFixedSize(450,560); + scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + scrollArea->horizontalScrollBar()->setEnabled(false); + scrollArea->setFixedHeight(this->height()); + scrollArea->setWidget(showAreaWidget); + scrollArea->setWidgetResizable(true); +// scrollArea->viewport()->setAttribute(Qt::WA_TranslucentBackground); + scrollArea->setStyleSheet("QScrollArea#scroll{background-color: transparent;}"); + scrollArea->viewport()->setStyleSheet("QWidget#showArea{background-color: transparent;}"); + scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove",false); + QVBoxLayout *mainlyt = new QVBoxLayout(); + QHBoxLayout *titleLyt = initTitleBar(); + QVBoxLayout *bodylyt = initBody(); + QHBoxLayout *btnlyt = initButton(); + mainlyt->setMargin(0); + mainlyt->addLayout(titleLyt); + mainlyt->addWidget(scrollArea); + mainlyt->addLayout(btnlyt); + mainlyt->addSpacing(25); + mainlyt->addStretch(); + mainlyt->setSpacing(0); + mainlyt->setContentsMargins(0,0,0,0); + this->setLayout(mainlyt); + showAreaWidget->setLayout(bodylyt); +// showAreaWidget->setFixedWidth(this->width()); + scrollArea->setFixedHeight(this->height() - cancelBtn->height() - 30 -10- 25); + getInitialData(); +} + + +QHBoxLayout* SetWidget::initTitleBar() +{ + titleText = new QLabel(showAreaWidget); + titleIcon = new QPushButton(showAreaWidget); + titleBtnClose = new QPushButton(showAreaWidget); + titleBtnClose->setToolTip(tr("Close")); + titleIcon->setObjectName("titleIcon"); + titleIcon->setFixedSize(24,24); + titleIcon->setIconSize(QSize(25,25)); + //TODO:直接从主题调图标,不会QIcon转qpixmap所以暂时从本地拿 +// titleIcon->setPixmap(QPixmap::fromImage(QImage(iconPath))); + titleIcon->setIcon(QIcon::fromTheme("ukui-control-center")); + titleIcon->setFlat(true); +// titleIcon->setProperty("useButtonPalette", true); + titleIcon->setFocusPolicy(Qt::NoFocus); + titleIcon->setStyleSheet("QPushButton#titleIcon{border:0px;border-radius:4px;background:transparent;}" + "QPushButton#titleIcon::hover{border:0px;border-radius:4px;background:transparent;}" + "QPushButton#titleIcon::pressed{border:0px;border-radius:4px;background:transparent;}"); + titleBtnClose->setFixedSize(30,30); + titleBtnClose->setToolTip(tr("Close")); + titleBtnClose->setIcon(QIcon::fromTheme("window-close-symbolic")); + titleBtnClose->setProperty("isWindowButton",0x2); + titleBtnClose->setProperty("useIconHighlightEffect",0x8); + titleBtnClose->setFlat(true); + connect(titleBtnClose,&QPushButton::clicked,[=](){this->close();}); + QHBoxLayout *hlyt = new QHBoxLayout; + titleText->setText(tr("Advanced Option")); + hlyt->setSpacing(0); + hlyt->setMargin(4); + hlyt->addSpacing(4); + hlyt->addWidget(titleIcon); //居下显示 + hlyt->addSpacing(8); + hlyt->addWidget(titleText);//,0,Qt::AlignBottom + hlyt->addStretch(); + hlyt->addWidget(titleBtnClose); + return hlyt; +} + +QVBoxLayout* SetWidget::initBody() +{ + QVBoxLayout *vLayout4 = initServerAddress(); + QVBoxLayout *vlyt = new QVBoxLayout; + vlyt->setMargin(0); + vlyt->setSpacing(0); + vlyt->addLayout(vLayout4); + vlyt->addStretch(); + vlyt->setContentsMargins(24,10,24,10); + return vlyt; +} + +QVBoxLayout* SetWidget::initServerAddress() +{ + serverAddressTitleLabel = new QLabel(showAreaWidget); + serverAddressTitleLabel->setAlignment(Qt::AlignLeft); + serverAddressTitleLabel->setText(tr("Server address settings")); + tipsTextLabel = new QLabel(showAreaWidget); + tipsTextLabel->setAlignment(Qt::AlignLeft); + tipsTextLabel->setText(tr("If internal services, change the server address.")); +// ProtocolLabel = new QLabel(showAreaWidget); +// ProtocolLabel->setAlignment(Qt::AlignLeft); +// ProtocolLabel->setFixedWidth(80); +// ProtocolLabel->setText(tr("Protocal")); + ProtocolComboBox = new QComboBox(showAreaWidget); + ProtocolComboBox->setFixedWidth(112); + ProtocolComboBox->setEditable(false); + ProtocolComboBox->setObjectName("comboBox1"); + ProtocolComboBox->addItem("https://"); + ProtocolComboBox->addItem("http://"); + PortLabel = new QLabel(showAreaWidget); + PortLabel->setAlignment(Qt::AlignLeft); + PortLabel->setFixedWidth(80); + PortLabel->setText(tr("Port ID ")); + PortEdit = new QLineEdit(showAreaWidget); + PortEdit->setFixedWidth(112); + PortEdit->setObjectName("PortEdit"); + QRegExp regx("[0-9]+$"); + QValidator* validator = new QRegExpValidator(regx, PortEdit); + PortEdit->setValidator(validator); + AddressLabel = new QLabel(showAreaWidget); + AddressLabel->setAlignment(Qt::AlignLeft); + AddressLabel->setText(tr("Address")); + AddressLabel->setFixedWidth(80); + IPEdit = new QLineEdit(showAreaWidget); + IPEdit->setObjectName("IPEdit"); + IPEdit->setFixedWidth(250); + + QHBoxLayout *hlayout1 = new QHBoxLayout(); + hlayout1->addWidget(serverAddressTitleLabel,0,Qt::AlignLeft); + hlayout1->addStretch(); + hlayout1->setSpacing(0); + hlayout1->setContentsMargins(0,0,0,0); + + QHBoxLayout *hlayout2 = new QHBoxLayout(); + hlayout2->addWidget(tipsTextLabel,0,Qt::AlignLeft); + hlayout2->addStretch(); + hlayout2->setSpacing(0); + hlayout2->setContentsMargins(0,0,0,0); + + QHBoxLayout *hlayout3 = new QHBoxLayout(); + hlayout3->addWidget(AddressLabel,0,Qt::AlignLeft); + hlayout3->addSpacing(4); +// hlayout3->addWidget(ProtocolLabel,0,Qt::AlignLeft); +// hlayout3->addSpacing(4); + hlayout3->addWidget(ProtocolComboBox,0,Qt::AlignLeft); + hlayout3->addSpacing(4); + hlayout3->addWidget(IPEdit); + hlayout3->addStretch(); + hlayout3->setSpacing(0); + hlayout3->setContentsMargins(0,0,0,0); + + QHBoxLayout *hlayout4 = new QHBoxLayout(); + hlayout4->addWidget(PortLabel); + hlayout4->addSpacing(4); + hlayout4->addWidget(PortEdit); + hlayout4->setSpacing(0); + hlayout4->addStretch(); + hlayout4->setContentsMargins(0,0,0,0); + +// QHBoxLayout *hlayout5 = new QHBoxLayout(); +// hlayout5->addWidget(AddressLabel); +// hlayout5->addSpacing(4); +// hlayout5->addWidget(IPEdit); +// hlayout5->addStretch(); +// hlayout5->setSpacing(0); +// hlayout5->setContentsMargins(0,0,0,0); + + QVBoxLayout *vlayout = new QVBoxLayout(); + vlayout->addLayout(hlayout1); + vlayout->addSpacing(12); + vlayout->addLayout(hlayout2); + vlayout->addSpacing(8); + vlayout->addLayout(hlayout3); + vlayout->addSpacing(8); + vlayout->addLayout(hlayout4); +// vlayout->addSpacing(8); +// vlayout->addLayout(hlayout5); + vlayout->setSpacing(0); + vlayout->setContentsMargins(0,0,0,0); + return vlayout; +} + + +QHBoxLayout *SetWidget::initButton() +{ + resetBtn = new QPushButton(this); + resetBtn->setText(tr("reset")); +// resetBtn->setFlat(true); +// resetBtn->setText(tr("Restore default settings")); + resetBtn->setObjectName("resetBtn"); + connect(resetBtn,SIGNAL(clicked()),this,SLOT(slotRestoreDefaultSettings())); + cancelBtn = new QPushButton(this); + cancelBtn->setText(tr("Cancel")); + connect(cancelBtn,&QPushButton::clicked,[=](){this->close();}); + determineBtn = new QPushButton(this); + determineBtn->setText(tr("OK")); + connect(determineBtn,SIGNAL(clicked(bool)),this,SLOT(slotModifysettings())); + QHBoxLayout *hlayout = new QHBoxLayout(); + hlayout->addWidget(resetBtn,0,Qt::AlignVCenter); + hlayout->addStretch(); + hlayout->addWidget(cancelBtn,0,Qt::AlignVCenter); + hlayout->addSpacing(10); + hlayout->addWidget(determineBtn,0,Qt::AlignVCenter); + hlayout->setSpacing(0); + hlayout->setContentsMargins(24,0,24,0); + + return hlayout; + +} + + +/*****************获取数据********************/ +void SetWidget::getInitialData() +{ + QString filename = "/var/lib/kylin-software-properties/template/kylin-source-update.conf"; + QSettings *setting = new QSettings(filename, QSettings::IniFormat); + setting->setIniCodec("utf8"); + QStringList group = setting->childGroups(); + int num = group.count(); + int Priority; + int tmp = 0; + int i; + for(i=0; ibeginGroup(Service); + Priority = setting->value("Priority").toInt(); + qDebug()<<"the Priority is "<endGroup(); + if(Priority > tmp) + { + tmp = Priority; + flag = Service; + } + i++; + } + if(Priority == 0) + { + qInfo()<<"Priority is 0,find priority"; + qInfo()<<"=================="; + for(i=0; ibeginGroup(Service); + Priority = setting->value("priority").toInt(); + qDebug()<<"the priority is "<endGroup(); + if(Priority > tmp) + { + tmp = Priority; + flag = Service; + } + i++; + } + qInfo()<<"=================="; + } + qDebug()<<"the tmp is" <beginGroup(flag); + QString Port = setting->value("Port").toString(); + qDebug()<<"the Port is "<< Port; + PortEdit->setText(Port); + /*IP Address initial*/ + QString fullname = setting->value("Address").toString(); + qDebug()<<"the fullname is "<setCurrentText("https://"); + } + else + { + ProtocolComboBox->setCurrentText(networkprotocal+"://"); + } + QString domainname = namelist.at(1); + qDebug()<<"the domainname is "<< domainname; + IPEdit->setText(domainname); +} + + + +/**********************************槽函数***********************************/ +void SetWidget::slotRestoreDefaultSettings() +{ + qDebug()<<"reset the default setting"; +// QDBusInterface modify_interface( "com.kylin.software.properties", +// "/com/kylin/software/properties", +// "com.kylin.software.properties.interface", +// QDBusConnection::systemBus() ); + ProtocolComboBox->setCurrentText("http://"); + PortEdit->setText("59546"); + IPEdit->setText("archive1.kylinos.cn"); +// QDBusMessage modelist = modify_interface.call("setServerAddressConf","Server","http://archive1.kylinos.cn","59546"); +// QDBusMessage modelist1 = modify_interface.call("setServerAddressConf","Server1","https://archive1.kylinos.cn","59546"); +} + +void SetWidget::slotModifysettings() +{ + QString group = flag; + QString protocol = ProtocolComboBox->currentText(); + QString domainname = IPEdit->text(); + QString IP = protocol+domainname; + QString port = PortEdit->text(); + qDebug()<activeModalWidget()); + msgBox.setText(tr("Modification failed!")); + msgBox.setWindowTitle(tr("Attention")); + msgBox.setIcon(QMessageBox::Icon::Warning); + msgBox.addButton(tr("OK"), QMessageBox::YesRole); + } + else + { + this->close(); + } +} diff --git a/immutable/plugin/src/SecondaryWidget/setwidget.h b/immutable/plugin/src/SecondaryWidget/setwidget.h new file mode 100644 index 0000000..2395cae --- /dev/null +++ b/immutable/plugin/src/SecondaryWidget/setwidget.h @@ -0,0 +1,80 @@ +#ifndef SETWIDGET_H +#define SETWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +class SetWidget : public QDialog +{ + Q_OBJECT +public: + + QMap serverMap; + + QString flag = nullptr; + + QWidget *showAreaWidget = nullptr; + QScrollArea *scrollArea = nullptr; + + QLabel *titleText = nullptr; + QPushButton* titleIcon = nullptr; + QPushButton *titleBtnClose = nullptr; + + QLabel *serverAddressTitleLabel = nullptr; + QLabel *tipsTextLabel = nullptr; +// QLabel *ProtocolLabel = nullptr; + QComboBox *ProtocolComboBox = nullptr; + QLabel *PortLabel = nullptr; + QLineEdit *PortEdit = nullptr; + QLabel *AddressLabel = nullptr; + QLineEdit *IPEdit = nullptr; + + + + QPushButton *resetBtn = nullptr; + QPushButton *cancelBtn = nullptr; + QPushButton *determineBtn = nullptr; + + QHBoxLayout* initTitleBar(); + QVBoxLayout* initBody(); + QVBoxLayout* initDownloadDir(); //初始化设置界面下载路径模块 + QVBoxLayout* initPackageClean(); //初始化设置界面包清理模块 + QVBoxLayout* initUpdatePackage(); //初始化设置界面包清理模块 + QVBoxLayout* initServerAddress(); //初始化服务器地址 + QHBoxLayout* initButton(); + void getInitialData(); //获取初始数据 + void slotClickComboBox1(); //combox1添加item + void slotClickLineEdit1(); //combox1添加item + SetWidget(QWidget* parent = nullptr); + +public Q_SLOTS: + void slotSoftUpdateCheckBox5(); //处理应用更新处按钮的点击 + void slotSoftUpdateCheckBox6(); //处理应用更新处按钮的点击 + void slotRestoreDefaultSettings(); //恢复默认设置 + void slotModifysettings(); //修改设置 + +}; + +#endif // SETWIDGET_H diff --git a/immutable/plugin/src/appupdate.cpp b/immutable/plugin/src/appupdate.cpp new file mode 100644 index 0000000..234aee2 --- /dev/null +++ b/immutable/plugin/src/appupdate.cpp @@ -0,0 +1,238 @@ +#include "appupdate.h" +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +#define JSON_FILE_PATH "/var/cache/kylin-system-updater/json/" + +AppUpdateWid::AppUpdateWid(AppAllMsg msg,QWidget *parent):QWidget(parent) +{ + m_updateMutual = UpdateDbus::getInstance(this); + qRegisterMetaType("AppMsg"); //注册信号槽类型 + qRegisterMetaType("AppAllMsg"); //注册信号槽类型 + appAllMsg = msg; + updateAppUi(appAllMsg.name); + this->setObjectName("AppUpdateWid"); + initConnect(); +} + +void AppUpdateWid::updateAppUi(QString name) +{ + this->setFixedHeight(60); + appname.clear(); + appname = name; + frameLayout = new QHBoxLayout(); + frameLayout->setContentsMargins(0,0,0,0); //更新信息之间的间距 + frameLayout->setSpacing(0); + this->setLayout(frameLayout); + + AppFrame = new QFrame(this); //最外层窗口适配主题样式 + AppFrame->setFrameShape(QFrame::Box); + AppFrame->setMaximumSize(QSize(16777215, 16777215)); + frameLayout->addWidget(AppFrame); + + mainVLayout = new QHBoxLayout(); +// smallHLayout = new QHBoxLayout(); + appTitleWid = new QWidget(); + + iconNameLayout = new QHBoxLayout(); + appIconName = new QLabel(this); + appIconName->setFixedWidth(200); + appIcon = new QLabel(appIconName); + appNameLab = new MyLabel(appIconName); + appIconName->setLayout(iconNameLayout); + appIcon->setFixedSize(32,32); + iconNameLayout->addSpacing(6); + iconNameLayout->addWidget(appIcon,1); + iconNameLayout->addSpacing(8); + iconNameLayout->addWidget(appNameLab,10); + + appVersion = new FixLabel(this); + appVersion ->setFixedWidth(250); + + detaileInfo = new KBorderlessButton(this); + // detaileInfo->setText(tr("详情")); + detaileInfo->setText(tr("details")); + + QPalette palette_datailInfo = detaileInfo->palette(); + palette_datailInfo.setColor(QPalette::ButtonText,QColor(55,144,250)); + detaileInfo->setPalette(palette_datailInfo); + + updateAPPBtn = new QPushButton(this); + // updateAPPBtn->setText(tr("更新")); + updateAPPBtn->setText(tr("Update")); + updateAPPBtn->setFixedWidth(95); + updateAPPBtn->hide(); + + mainVLayout->addWidget(appIconName,1,Qt::AlignLeft); + mainVLayout->addWidget(appVersion,1,Qt::AlignLeft); + mainVLayout->addWidget(detaileInfo,0,Qt::AlignHCenter); + mainVLayout->addSpacing(60); + mainVLayout->addWidget(updateAPPBtn,0,Qt::AlignHCenter); + mainVLayout->setContentsMargins(0,0,10,0); +// appTitleWid->setLayout(smallHLayout); +// mainVLayout->addWidget(appTitleWid); + mainVLayout->setMargin(0); + mainVLayout->setSpacing(0); + + AppFrame->setLayout(mainVLayout); + QMap map = getNameAndIconFromJson(name); + if (!map.value("name").isNull()) + { + dispalyName = map.value("name"); + qInfo()<<"map.value.isNull()"<setText(dispalyName); + /*判断图标,优先级: JSON文件指定 > qrc资源文件中 > 主题 > 默认*/ + if (!map.value("icon").isNull()) { + haveThemeIcon = true; + appIcon->setPixmap(QPixmap(map.value("icon"))); + } else if (name.contains("kylin-update-desktop-")||name == "linux-generic") { + qInfo()<<"app exsist icon"; + haveThemeIcon = true; + pkgIconPath = QString(":/img/upgrade/%1.png").arg(name); + appIcon->setPixmap(QPixmap(pkgIconPath)); + } else if (QIcon::fromTheme(name).hasThemeIcon(name)) { //判断是否有主题图标并输出 + haveThemeIcon = true; + qInfo()<<"theme exsist icon"; + QIcon icon = QIcon::fromTheme(name); + QPixmap pixmap = icon.pixmap(icon.actualSize(QSize(32, 32))); + appIcon->setPixmap(pixmap); + } else { + qInfo()<<"else exsist icon"; + QIcon icon = QIcon::fromTheme("application-x-desktop"); + QPixmap pixmap = icon.pixmap(icon.actualSize(QSize(32, 32))); + appIcon->setPixmap(pixmap); + } + QString newStrMsg = appAllMsg.availableVersion; + + if(newStrMsg.size()>16) + { + appVersion->setText(tr("Version:")+newStrMsg); + appVersion->setToolTip(tr("Version:")+newStrMsg); + } + else + { + // appVersion->setText(tr("最新:")+newStrMsg); + appVersion->setText(tr("Version:")+newStrMsg); + appVersion->setToolTip(""); + } +} + + +AppUpdateWid::~AppUpdateWid() +{ +} + +void AppUpdateWid::initConnect() +{ + connect(detaileInfo,&QPushButton::clicked,this,&AppUpdateWid::showDetails); +} + +QMap AppUpdateWid::getNameAndIconFromJson(QString pkgname) +{ + QMap nameIconList; + /*判断json文件是否存在*/ + QString filename = QString(JSON_FILE_PATH) +pkgname +".json"; + qInfo()<<"getNameAndIconFromJson's filename is "<setFixedSize(420,314); + detaillog->logContent->clear(); + detaillog->setContentsMargins(24,24,24,24); + QPoint detail_pos = detaileInfo->mapToGlobal(detaileInfo->pos()); + detaillog->move(QCursor().pos().x()-detaillog->width(),detail_pos.y()+detaileInfo->height()); + QString appname_lab = appNameLab->text(); + qInfo()<<"the appname_lab is"<< appname_lab; + QString filename = "/var/cache/kylin-system-updater/json/"+appname+".json"; + qInfo()<<"file name is: "<logContent->append(description); +// msg->shortDescription=description; + } + else + { + detaillog->logContent->append(tr("Cumulative updates")); + } + } + else + { + QString name = object.value("name").toObject().value("en_US").toString(); + QString description = object.value("description").toObject().value("en_US").toString(); + if (!description.isNull()) { +// msg->shortDescription=description; + detaillog->logContent->append(description); + } + else + { + detaillog->logContent->append(tr("Cumulative updates")); + } + } + } + } + file.close(); + detaillog->show(); +} diff --git a/immutable/plugin/src/appupdate.h b/immutable/plugin/src/appupdate.h new file mode 100644 index 0000000..85ff04d --- /dev/null +++ b/immutable/plugin/src/appupdate.h @@ -0,0 +1,148 @@ +#ifndef APPUPDATE_H +#define APPUPDATE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "updatelog.h" +#include +#include +#include "updatedbus.h" +#include +#include "mylabel.h" +#include "src/Data/global.h" +#include +#include +#include +#include "detaildialog.h" + +#include +#include +#include +#include +//#include +#include "ukcc/interface/upgradeukcccommon.h" +//#include +#include "ukcc/widgets/lightlabel.h" +class Detaildialog; +class UpdateLog; +using namespace kdk; +class AppUpdateWid : public QWidget +{ + Q_OBJECT +public: + explicit AppUpdateWid(AppAllMsg msg, QWidget *parent = nullptr); + ~AppUpdateWid(); +// Detaildialog *detaillog; + + QString appname = nullptr; + + QFrame *AppFrame; + UpdateLog *updatelog1; + UpdateDbus *m_updateMutual; + //缩略界面 + QLabel *appIcon; + QLabel *appIconName; + MyLabel *appNameLab; + FixLabel *appVersion; + QLabel *appVersionIcon; + + QLabel *progressLab; //进度 + QLabel *otherBtnLab; + QLabel *versionLab; + KBorderlessButton *detaileInfo; + QPushButton *updateAPPBtn; + QWidget *appTitleWid; + QHBoxLayout *frameLayout; + QHBoxLayout *iconNameLayout; + QHBoxLayout *smallHLayout; + QVBoxLayout *largeVLayout; + QHBoxLayout *versionlabLayout; + QHBoxLayout *otherBtnLayout; + QWidget *largeWidget; + QHBoxLayout *mainVLayout; + //展开界面 + QTextEdit *someInfoEdit; //详情内容 + QPushButton *updatelogBtn; +// AppMsg *thisAppMessage; + QString chlog; //更新日志完整内容 + QString description; //更新包描述 + QString setDefaultDescription(QString str); //将虚包包名汉化 + void updateOneApp(bool status); //控制更新单个app + QString dispalyName; + QString modifySpeedUnit(long size, float time); + void distUpgradePartial(bool status); + void updateaccept(); + void updatecancel(); +private: + bool isCancel = false; + int connectTimes = 0; + bool downloadFinish = false; + bool stopTimer = false; + UrlMsg urlmsg; + QString path; + QString currentPackage; + QStringList downloadList; + QStringList downloadPackages; + AppAllMsg appAllMsg; + QProcess *downloadProcess; + QProcess *workProcess; + QTimer *timer; + QString downloadPath; + + bool execFun = true; + +public: + bool isUpdateAll = false; + bool isAutoUpgrade = false; + bool haveThemeIcon = false; + bool downloadstart = false; + bool shutdown_install = false; + +public slots: + void showDetails(); + + void updateAllApp(); +private: + void wgetDownload(UrlMsg msg, QString path); //断点续传下载 + bool getDownloadSpeed(QString appName, QString fullName, int fileSize); //获取下载速度 + void initConnect(); //初始化信号槽 + void changeDownloadState(int state); + type checkSourcesType(); + QStringList analysis_config_file(char *p_file_path); + void remove_last_enter(char *p_src_in_out); + void enableupdateAPPBtn(bool enabled);//取消按钮是否置灰 + + QMap getNameAndIconFromJson(QString pkgname); + + enum Environment{ + en, + zh_cn + }environment; + +signals: + void startWork(QString appName); + void startMove(QStringList list, QString appName); + void oneappUpdateResultSignal(bool state,QStringList pkgname,QString error,QString reason); + void changeUpdateAllSignal(bool isUpdate); + void downloadFailedSignal(int exitCode); //网络异常或者其他情况下下载失败时 + void appupdateiscancel(); + void sendProgress(QString pkgName, int Progress, QString type); + void changeupdateall(); + void allappupdatefinishsignal(); + void startoneappupdate(); + void ShutdowninstallFinishSignal();//shutdownfinishsignal + +private: + void updateAppUi(QString name); + QString translationVirtualPackage(QString str); + QString pkgIconPath = ""; +}; + +#endif // APPUPDATE_H diff --git a/plugin/src/checkbutton.cpp b/immutable/plugin/src/checkbutton.cpp similarity index 100% rename from plugin/src/checkbutton.cpp rename to immutable/plugin/src/checkbutton.cpp diff --git a/plugin/src/checkbutton.h b/immutable/plugin/src/checkbutton.h similarity index 100% rename from plugin/src/checkbutton.h rename to immutable/plugin/src/checkbutton.h diff --git a/plugin/src/connection.h b/immutable/plugin/src/connection.h similarity index 100% rename from plugin/src/connection.h rename to immutable/plugin/src/connection.h diff --git a/plugin/src/daemonipcdbus.cpp b/immutable/plugin/src/daemonipcdbus.cpp similarity index 100% rename from plugin/src/daemonipcdbus.cpp rename to immutable/plugin/src/daemonipcdbus.cpp diff --git a/plugin/src/daemonipcdbus.h b/immutable/plugin/src/daemonipcdbus.h similarity index 100% rename from plugin/src/daemonipcdbus.h rename to immutable/plugin/src/daemonipcdbus.h diff --git a/immutable/plugin/src/detaildialog.cpp b/immutable/plugin/src/detaildialog.cpp new file mode 100644 index 0000000..d21f505 --- /dev/null +++ b/immutable/plugin/src/detaildialog.cpp @@ -0,0 +1,53 @@ +#include "detaildialog.h" +/*点击appwidget详情的弹窗*/ +Detaildialog::Detaildialog(QWidget *parent) : QDialog(parent) +//Detaildialog::Detaildialog(QWidget *parent,AppAllMsg msg) : QDialog(parent) +{ + + qRegisterMetaType("AppMsg"); //注册信号槽类型 + qRegisterMetaType("AppAllMsg"); //注册信号槽类型 + + MotifWmHints hints; + hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + hints.functions = MWM_FUNC_ALL; + hints.decorations = MWM_DECOR_BORDER; + XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints); + + logUi(); + +} +void Detaildialog::logUi() +{ +// this->setWindowFlags(Qt::Popup); +// |Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint + logContent = new QTextEdit(this); + logContent->setReadOnly(true); + logContent->lineWrapMode(); + installContent = new FixLabel(this); + installContent->setFixedHeight(26); + logMainLayout = new QVBoxLayout(this); + + this->setLayout(logMainLayout); + logMainLayout->addWidget(logContent,Qt::AlignCenter); + logMainLayout->addStretch(1); + logMainLayout->addWidget(installContent,Qt::AlignLeft|Qt::AlignBottom); +} + +bool Detaildialog::event(QEvent *event) +{ + if(QEvent::WindowDeactivate == event->type()) + { + qDebug()<<"焦点在窗口之外"; + this->close(); + } + else + { + qDebug()<<"焦点在窗口里面"; + } + return QWidget::event(event); +} + + +Detaildialog::~Detaildialog() +{ +} diff --git a/immutable/plugin/src/detaildialog.h b/immutable/plugin/src/detaildialog.h new file mode 100644 index 0000000..791c3f9 --- /dev/null +++ b/immutable/plugin/src/detaildialog.h @@ -0,0 +1,53 @@ +#ifndef DETAILDIALOG_H +#define DETAILDIALOG_H +/*点击appwidget详情的弹窗*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include "ukcc/widgets/fixlabel.h" +#include "appupdate.h" + +class Detaildialog : public QDialog +{ + Q_OBJECT +public: + explicit Detaildialog(QWidget *parent = nullptr); + + void logUi(); + ~Detaildialog(); + + QLabel *logAppIcon; + QLabel *logAppName; + QLabel *logAppVerson; + + QWidget *logWidget; + QWidget *logAppWidget; + + QHBoxLayout *logAppHLayout; + QVBoxLayout *logAppVLayout; + + QVBoxLayout *logVLayout; + + QVBoxLayout *logMainLayout; + + QTextEdit *logContent; + FixLabel *installContent; + QFrame *contentFrame; + +protected: +// void mousePressEvent(QMouseEvent *event) override; + bool event(QEvent *event) override; +// bool eventFilter(QObject *, QEvent *); +// bool eventFilter(QObject *obj,QEvent *event); +}; + + + +#endif // DETAILDIALOG_H diff --git a/immutable/plugin/src/historyupdatelistwig.cpp b/immutable/plugin/src/historyupdatelistwig.cpp new file mode 100644 index 0000000..0df621d --- /dev/null +++ b/immutable/plugin/src/historyupdatelistwig.cpp @@ -0,0 +1,295 @@ +#include "historyupdatelistwig.h" +#include +#include +#include +#define ORG_UKUI_STYLE "org.ukui.style" +#define GSETTING_KEY "systemFontSize" + +const QString FIND_UPDATE_LABLE_TYPE = "FIND_UPDATE_LABLE_TYPE";//历史更新模块标签 +const QString FIND_DES_LABLE_TYPE = "FIND_DES_LABLE_TYPE";//历史更新模块标签 +const QString FIND_CLG_LABLE_TYPE = "FIND_CLG_LABLE_TYPE";//历史更新模块标签 +const QString IS_SELECT = "IS_SELECT";//历史更新模块标签 +const int WIDTH = 296 - 2; +const int LINE_SPACING = 2; +const int TOP_MARGIN = 5;//上(下)边距 +const int RIGHT_MARGIN = 3;//右边距 +const int LEFT_MARGIN = 9;//左边距文字和lable本身有边距 +/*hcy仅维护,未处理过历史界面,继承自2107部分*/ +HistoryUpdateListWig::HistoryUpdateListWig(QLabel* destab) +{ + /*sdk 时间格式接口*/ + m_dateSessionDbus = new QDBusInterface("com.kylin.kysdk.DateServer", + "/com/kylin/kysdk/Date", + "com.kylin.kysdk.DateInterface", + QDBusConnection::sessionBus(), + this); + if (m_dateSessionDbus->isValid()) { + connect(m_dateSessionDbus,SIGNAL(ShortDateSignal(QString)),this,SLOT(UpdateSdkTime(QString))); + connect(m_dateSessionDbus,SIGNAL(TimeSignal(QString)), this, SLOT(UpdateSdkTime(QString))); + } + this->mDesTab = destab; + datetimeutils = DateTimeUtils::get_instance(); + initUI(); + gsettingInit(); +} +HistoryUpdateListWig::~HistoryUpdateListWig() +{ + debName->deleteLater(); + debStatue->deleteLater(); + hl1->deleteLater(); + hl2->deleteLater(); + vl1->deleteLater(); +} +void HistoryUpdateListWig::initUI() +{ + font.setBold(true); + + /* 窗口初始化 */ + this->setFrameStyle(QFrame::Box); +// this->setStyleSheet("QFrame{border-radius:4px;}"); + QPalette palette = qApp->palette(); + QColor listcolor = palette.button().color(); + palette.setBrush(QPalette::Base,listcolor); + this->setPalette(palette); + /* 实例化控件 */ + debName = new QLabel; + debName->setWordWrap(true); + debName->setFixedWidth(WIDTH - LEFT_MARGIN - LEFT_MARGIN);// + debName->setFont(font); + + debStatue = new QLabel; + debStatue->setWordWrap(true); + debStatue->setFixedWidth(WIDTH - LEFT_MARGIN - LEFT_MARGIN);// + + /* 布局 */ + hl1 = new QHBoxLayout; + hl2 = new QHBoxLayout; + vl1 = new QVBoxLayout; + + hl1->setSpacing(0); + hl1->setMargin(0); + hl2->setSpacing(0); + hl2->setMargin(0); + vl1->setSpacing(0); + vl1->setMargin(0); + + hl1->addSpacing(LEFT_MARGIN); + hl1->addWidget(debName); + hl1->addSpacing(RIGHT_MARGIN); + + hl2->addSpacing(LEFT_MARGIN); + hl2->addWidget(debStatue); + hl2->addSpacing(RIGHT_MARGIN); + + vl1->addSpacing(TOP_MARGIN); + vl1->addLayout(hl1); + vl1->addLayout(hl2); + vl1->addSpacing(TOP_MARGIN); + + this->setLayout(vl1); + this->layout()->setSizeConstraint(QLayout::SetFixedSize); +} + +void HistoryUpdateListWig::setAttribute(const QString &mname,const QString &mstatue, const QString &mtime,const QString &mdescription,const QString &mchangelog,const QString &merrorcode,const int &myid) +{ + this->mNameLabel = mname; + + /* 单行显示 , 超出范围加... 和悬浮框 */ + QFontMetrics nameFontMetrics(debName->font()); + int nameFontSize = nameFontMetrics.width(mname); + int nameLableWidth = debName->width(); + QString nameFormatBody = mname; + if (nameFontSize > (nameLableWidth - 10)) { + nameFormatBody = nameFontMetrics.elidedText(nameFormatBody , Qt::ElideRight , nameLableWidth - 10); + debName->setText(nameFormatBody); + this->nameTipStatus = true; + debName->setToolTip(mname); + } else { + this->nameTipStatus = false; + debName->setText(nameFormatBody); + } + + QString str = ""; + if(mstatue == "success" | mstatue == "Success") + { + str=tr("Success"); //更新成功 + debDescription=mchangelog; + } + else + { + str=tr("Failed"); //更新失败 + debDescription=merrorcode; + } + debChangelog=mchangelog; + QString checkedtime = datetimeutils->TranslationTime(mtime); + str+=" "+checkedtime; + + this->mStatusLabel = str; + + QFontMetrics statueFontMetrics(debStatue->font()); + int statueFontSize = statueFontMetrics.width(str); + int statueLableWidth = debStatue->width(); + QString statueFormatBody = str; + if (statueFontSize > (statueLableWidth - 10)) { + statueFormatBody = statueFontMetrics.elidedText(statueFormatBody , Qt::ElideRight , statueLableWidth - 10); + debStatue->setText(statueFormatBody); + debStatue->setToolTip(str); + this->statusTipStatus = true; + } else { + debStatue->setText(statueFormatBody); + this->statusTipStatus = false; + } + id = myid; +} + +QSize HistoryUpdateListWig::getTrueSize() +{ + QSize lsize =this->layout()->sizeHint(); + //lsize.setHeight(lsize.rheight()+LINE_SPACING*2); + return lsize; +} + +//鼠标 点击 +void HistoryUpdateListWig::mousePressEvent(QMouseEvent * e) +{ + if(e->button() == Qt::LeftButton) + { + setDescription(); + selectStyle(); + } + if(e->button() == Qt::RightButton) + { + clearStyleSheet(); + } +} + +void HistoryUpdateListWig::selectStyle() +{ + //如果上次选中的也是自身 + if(this->statusTip()==IS_SELECT) + return; + //清除其他item选中样式及标签 + QList list = this->parent()->findChildren(); + for(HistoryUpdateListWig *tmp : list) + { + if(tmp->statusTip()==IS_SELECT) + { + qInfo()<<"all clear"; + tmp->clearStyleSheet(); + /* 重设tips */ + if (tmp->nameTipStatus == true) { + tmp->debName->setToolTip(tmp->mNameLabel); + } else { + tmp->debName->setToolTip(QString("")); + } + + if (tmp->statusTipStatus == true) { + tmp->debStatue->setToolTip(tmp->mStatusLabel); + } else { + tmp->debStatue->setToolTip(QString("")); + } + } + } + + //设置选中样式及标签 + qInfo()<<"选中标签样式"; +// debName->setToolTip(QString("")); +// debStatue->setToolTip(QString("")); + debName->setStyleSheet("QLabel{color:#fff;}"); + debStatue->setStyleSheet("QLabel{color:#fff;}"); + int r = qApp->palette().highlight().color().red(); + int g = qApp->palette().highlight().color().green(); + int b = qApp->palette().highlight().color().blue(); + qDebug()<setStyleSheet("QFrame{background-color:rgba(55, 144, 250, 1);border-radius:4px}"); + QString style = "QFrame{background-color:rgba(%1,%2, %3, 1);border-radius:4px;}"; + this->setStyleSheet(style.arg(r).arg(g).arg(b)); + this->setStatusTip(IS_SELECT); + + //详细内容 + setDescription(); +} + +void HistoryUpdateListWig::clearStyleSheet() +{ + qInfo()<<"clearStyleSheet"; + debName->setStyleSheet(""); + debStatue->setStyleSheet(""); +// this->setStyleSheet("QFrame{border-radius:4px;}"); + QPalette palette = qApp->palette(); + QColor listcolor = palette.button().color(); + palette.setBrush(QPalette::Base,listcolor); + this->setPalette(palette); + this->setStyleSheet(""); + this->setStatusTip(""); +} + +void HistoryUpdateListWig::setDescription() +{ + if (this->mDesTab != nullptr) { + this->mDesTab->setFont(this->font); + this->mDesTab->setText(this->mNameLabel); + } + + QObject *findwig = this->parent(); + while(findwig != nullptr) + { + if(findwig->objectName()==FIND_UPDATE_LABLE_TYPE) + { + QTextEdit *dsc = findwig->findChild(FIND_DES_LABLE_TYPE,Qt::FindChildrenRecursively); + if(dsc==nullptr) + qDebug()<<"找不到要赋值的窗口1"; + else + dsc->setText(debDescription); + + QTextEdit *changelog = findwig->findChild(FIND_CLG_LABLE_TYPE,Qt::FindChildrenRecursively); + if(changelog==nullptr) + qDebug()<<"找不到要赋值的窗口2"; + else + changelog->setText(debChangelog); + } + findwig = findwig->parent(); + } + +} + +void HistoryUpdateListWig::gsettingInit() +{ + const QByteArray style_id(ORG_UKUI_STYLE); + m_pGsettingFontSize = new QGSettings(style_id); + connect(m_pGsettingFontSize, &QGSettings::changed, this, [=] (const QString &key){ + if (key==GSETTING_KEY) { + QFontMetrics nameFontMetrics(debName->font()); + int nameFontSize = nameFontMetrics.width(this->mNameLabel); + int nameLableWidth = debName->width(); + QString nameFormatBody = this->mNameLabel; + if (nameFontSize > (nameLableWidth - 10)) { + nameFormatBody = nameFontMetrics.elidedText(nameFormatBody , Qt::ElideRight , nameLableWidth - 10); + debName->setFont(this->font); + debName->setText(nameFormatBody); + debName->setToolTip(this->mNameLabel); + this->nameTipStatus = true; + } else { + debName->setFont(this->font); + debName->setToolTip(QString("")); + this->nameTipStatus = false; + debName->setText(nameFormatBody); + } + + QFontMetrics statueFontMetrics(debStatue->font()); + int statueFontSize = statueFontMetrics.width(this->mStatusLabel); + int statueLableWidth = debStatue->width(); + QString statueFormatBody = this->mStatusLabel; + if (statueFontSize > (statueLableWidth - 10)) { + statueFormatBody = statueFontMetrics.elidedText(statueFormatBody , Qt::ElideRight , statueLableWidth - 10); + debStatue->setText(statueFormatBody); + debStatue->setToolTip(this->mStatusLabel); + this->statusTipStatus = true; + } else { + debStatue->setToolTip(QString("")); + debStatue->setText(statueFormatBody); + this->statusTipStatus = false; + } + } + }); +} diff --git a/immutable/plugin/src/historyupdatelistwig.h b/immutable/plugin/src/historyupdatelistwig.h new file mode 100644 index 0000000..b105cd0 --- /dev/null +++ b/immutable/plugin/src/historyupdatelistwig.h @@ -0,0 +1,57 @@ +#ifndef HISTORYUPDATELISTWIG_H +#define HISTORYUPDATELISTWIG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "AddFunction/datetimeutils.h" + +class HistoryUpdateListWig : public QFrame +{ + Q_OBJECT +public: + HistoryUpdateListWig(QLabel *); + ~HistoryUpdateListWig(); + void setAttribute(const QString &mname, const QString &mstatue, const QString &mtime, const QString &mdescription, const QString &mchangelog, const QString &merrorcode,const int &myid);//赋值 + QSize getTrueSize();//获取真实大小 + void selectStyle();//选中样式 + void clearStyleSheet();//取消选中样式 + int id = 0; + void gsettingInit(); + DateTimeUtils *datetimeutils; + QDBusInterface * m_dateSessionDbus = nullptr; +protected: + void mousePressEvent(QMouseEvent * event); + +private: + QHBoxLayout *hl1 = nullptr; + QHBoxLayout *hl2 = nullptr; + QVBoxLayout *vl1 = nullptr; + QLabel *debName = nullptr;//app名字&版本号 + QLabel *debStatue = nullptr;//更新状态 + QString debDescription = "";//描述 + QString debChangelog = "";//修改日志 + //int code = 0 ;//编码 + void initUI();//初始化UI + void setDescription();//赋值事件 + QFont font; + + /* 监听主题字体变化 */ + QGSettings *m_pGsettingFontSize; + QString mNameLabel; + QString mStatusLabel; + + /* 控制悬浮框 */ + bool nameTipStatus = false; + bool statusTipStatus = false; + + /* 右侧顶部标签 */ + QLabel *mDesTab = nullptr; +}; + +#endif // HISTORYUPDATELISTWIG_H diff --git a/plugin/src/kylin-update-frontend.desktop b/immutable/plugin/src/kylin-update-frontend.desktop similarity index 100% rename from plugin/src/kylin-update-frontend.desktop rename to immutable/plugin/src/kylin-update-frontend.desktop diff --git a/immutable/plugin/src/m_updatelog.cpp b/immutable/plugin/src/m_updatelog.cpp new file mode 100644 index 0000000..f86993b --- /dev/null +++ b/immutable/plugin/src/m_updatelog.cpp @@ -0,0 +1,687 @@ +#include "m_updatelog.h" + +#include +#include +#include "xatom-helper.h" + +const QString FIND_UPDATE_LABLE_TYPE = "FIND_UPDATE_LABLE_TYPE";//历史更新模块标签 +const QString FIND_DES_LABLE_TYPE = "FIND_DES_LABLE_TYPE";//历史更新描述模块标签 +const QString FIND_CLG_LABLE_TYPE = "FIND_CLG_LABLE_TYPE";//历史更新日志模块标签 +const int WIDTH = 880;//窗口宽度 +const int HEIGHT = 610 -40;//窗口高度 注:QFram实际高度比setFixedSize指定的高度高40像素,故减去40 +const int LINE_SPACING = 2;//行间距 +const int TOP_MARGIN = 18;//上边距 +const int BOTTOM_MARGIN = 24;//下边距 +const int LEFT_MARGIN = 32;//左(右)边距 + +const int LIST_LEFT = 8;//列表对于其背景,左侧边距 +const int LIST_TOP = 8;//列表对于其背景,顶(底)部边距 +const int LIST_BACKGROUND_WIDTH = 320 + 6;//列表背景宽度 +const int SLIDER_WIDTH = 6;//滑块宽度 +//const int LIST_WIDTH = LIST_BACKGROUND_WIDTH - LIST_LEFT*2 + SLIDER_WIDTH;//列表宽度 +//const int LIST_HEIGHT = 524 - LIST_TOP*2;//列表高度 + +const int TEXT_TAB_LEFT = 16;//更新详情lable对于其背景,左侧边距 +const int TEXT_TAB_RIGHT = 2;//更新详情lable对于其背景,左侧边距 +const int TEXT_DSC_LEFT_SPACING = 5;//QTextEdit左侧有边距 +const int TEXT_TAB_TOP = 17;//更新详情lable对于其背景,顶部边距 +const int TEXT_TAB_SPACING = 18;//更新详情lable对于内容框的间距 + +const QString OBJECT_NAME = "OBJECT_NAME"; + +m_updatelog * m_updatelog::m_instance(nullptr); + +m_updatelog::m_updatelog(QWidget* parent) : QDialog(parent) +{ + /*添加窗管协议*/ + MotifWmHints hints; + hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + hints.functions = MWM_FUNC_ALL; + hints.decorations = MWM_DECOR_BORDER; + XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints); + //日志数量 + lognum=0; + this->setWindowModality(Qt::WindowModal); + initGsettings();//初始化Gsettings + initUI();//初始化UI + dynamicLoadingInit();//动态加载 + updatesql();//更新列表 + if(lognum!=0) + { + nocontent->hide(); + content->show(); + } +// defaultItem();//设置默认选中 + //监听更新完成信号 +// UpdateDbus *uddbus = UpdateDbus::getInstance(); +// connect(uddbus->interface,SIGNAL(update_sqlite_signal(QString,QString)),this,SLOT(historyUpdateNow(QString,QString))); + +} + +QString m_updatelog::setDefaultDescription(QString str) +{ + if(str == "") + str = tr("No content."); //暂无内容 + return str; +} + +m_updatelog * m_updatelog::GetInstance(QWidget *parent) +{ + if(m_instance==nullptr) + { + m_instance = new m_updatelog(parent); + return m_instance; + } + if(m_instance->isHidden()) + { + m_instance->deleteLater(); + m_instance = new m_updatelog(parent); + } + return m_instance; +} + +void m_updatelog::closeUpdateLog() +{ + m_instance->close(); + m_instance->deleteLater(); +} + +void m_updatelog::initUI() +{ + /* 初始化窗口属性 */ + this->setFixedSize(WIDTH,HEIGHT + 40);//(880,610) + this->setObjectName("FIND_UPDATE_LABLE_TYPE"); + + /* 实例化控件 */ + /* 实例化标题栏 */ + updateTitleWidget(); + + QFrame *listBackground = new QFrame; + listBackground->setFrameStyle(QFrame::Box); + listBackground->setFixedWidth(326); + /*mainlistwidget 是frame listbackground 的内部内容*/ + mainListwidget = new QListWidget; +// QPalette palette = mainListwidget->palette(); +// palette.setBrush(QPalette::Base, QColor (0, 0 , 0, 0)); +// QPalette palette = qApp->palette(); +// QColor listcolor = palette.button().color(); +// palette.setBrush(QPalette::Base,listcolor); +// mainListwidget->setPalette(palette); + mainListwidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); /* 滑块平滑滚动 */ + mainListwidget->verticalScrollBar()->setProperty("drawScrollBarGroove" , false); + mainListwidget->setSpacing(2); + + QFrame *desBackground = new QFrame; + desBackground->setFrameStyle(QFrame::Box); + + /* 更新详情 */ + updateDesTab = new QLabel; + /*QFont font; + font.setBold(true); + updateDesTab->setFont(font); + updateDesTab->setWordWrap(true); + updateDesTab->setText(tr("No Contents"));*/ + + /* 描述文本框 */ + des = new QTextEdit; +// QPalette palette2 = des->palette(); +// palette2.setBrush(QPalette::Base, QColor (0, 0 , 0, 0)); + des->verticalScrollBar()->setProperty("drawScrollBarGroove" , false); +// des->setPalette(palette2); + des->setReadOnly(true); + des->setObjectName(FIND_DES_LABLE_TYPE); + + /* 日志文本框 */ + clg = new QTextEdit; +// QPalette palette3 = clg->palette(); +// palette3.setBrush(QPalette::Base, QColor (0, 0 , 0, 0)); + clg->verticalScrollBar()->setProperty("drawScrollBarGroove" , false); +// clg->setPalette(palette3); + clg->setReadOnly(true); + clg->setObjectName(FIND_CLG_LABLE_TYPE); + + /* 布局 */ + /* 布局外边框 */ + QHBoxLayout *contentlayout = new QHBoxLayout; + contentlayout->setSpacing(0); + contentlayout->setMargin(0); + contentlayout->addSpacing(28); + contentlayout->addWidget(listBackground); + contentlayout->addSpacing(2); + contentlayout->addWidget(desBackground); + contentlayout->addSpacing(28); + content = new QWidget(this); + content->setLayout(contentlayout); + + nocontent=new QLabel(this); + QVBoxLayout *nocontentlayout = new QVBoxLayout; + QLabel *nocontentpicture = new QLabel(this); + QVariant stylename = qtSettings->get("style-name"); + qDebug()<<"style name"<setPixmap(QPixmap(nocontentpicturepath).scaled(QSize(120,120))); + nocontentpicture->setAlignment(Qt::AlignCenter); + QLabel *nocontenttext = new QLabel(this); + nocontenttext->setText(tr("no content")); + nocontenttext->setStyleSheet("QLabel{color:grey;}"); + nocontenttext->setAlignment(Qt::AlignCenter); + nocontentlayout->addSpacerItem(new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding)); + nocontentlayout->addWidget(nocontentpicture); + nocontentlayout->addSpacing(10); + nocontentlayout->addWidget(nocontenttext); + nocontentlayout->addSpacerItem(new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding)); + nocontent->setLayout(nocontentlayout); + nocontent->setAlignment(Qt::AlignCenter); + + QVBoxLayout *Mainlayout = new QVBoxLayout; + Mainlayout->setContentsMargins(0,0,0,0); + Mainlayout->addWidget(this->title); + Mainlayout->addSpacing(18); + Mainlayout->addWidget(nocontent); +// Mainlayout->addLayout(contentlayout); + Mainlayout->addWidget(content); + content->hide(); + Mainlayout->addSpacing(18); + + this->setLayout(Mainlayout); + + /* 布局列表 */ + hll = new QHBoxLayout; + hll->setSpacing(0); + hll->setMargin(0); + hll->addSpacing(LIST_LEFT); + hll->addWidget(mainListwidget); + QVBoxLayout *vll = new QVBoxLayout; + vll->setSpacing(0); + vll->setMargin(0); + vll->addSpacing(LIST_TOP); + vll->addLayout(hll); + vll->addSpacing(LIST_TOP); + listBackground->setLayout(vll); + + /* 布局更新详情标签 */ + QHBoxLayout *hlrt = new QHBoxLayout; + hlrt->setSpacing(0); + hlrt->setMargin(0); + hlrt->addSpacing(TEXT_DSC_LEFT_SPACING); + hlrt->addWidget(updateDesTab); + + /* 布局标签及文本框 */ + QVBoxLayout *vlr = new QVBoxLayout; + vlr->setSpacing(0); + vlr->setMargin(0); + vlr->addSpacing(TEXT_TAB_TOP); + vlr->addLayout(hlrt); + vlr->addSpacing(TEXT_TAB_SPACING); + vlr->addWidget(des); +// vlr->addSpacing(TEXT_TAB_SPACING); +// vlr->addWidget(clg); + vlr->addSpacing(TEXT_TAB_TOP); + + QHBoxLayout *hlr = new QHBoxLayout; + hlr->setSpacing(0); + hlr->setMargin(0); + hlr->addSpacing(TEXT_TAB_LEFT - TEXT_DSC_LEFT_SPACING); + hlr->addLayout(vlr); + hlr->addSpacing(TEXT_TAB_RIGHT); + desBackground->setLayout(hlr); + this->installEventFilter(this); +} + +void m_updatelog::initGsettings() +{ + timer = new QTimer; + timer->setSingleShot(true); + connect(timer,&QTimer::timeout,this,&m_updatelog::changeListWidgetItemHeight); + const QByteArray iid(THEME_QT_SCHEMA); + qtSettings = new QGSettings(iid, QByteArray(), this); + + connect(qtSettings,&QGSettings::changed,this,[=] (const QString &key) { + if(key == "systemFontSize") { + timer->start(100); + } + }); +} + +void m_updatelog::changeListWidgetItemHeight() +{ + if(mainListwidget->count()<1) + return; + int row=0; + while(row<(mainListwidget->count())) + { + QListWidgetItem * item = mainListwidget->item(row); + HistoryUpdateListWig * hulw = qobject_cast(mainListwidget->itemWidget(item)); + item->setSizeHint(hulw->getTrueSize()); + row++; + } +} + +void m_updatelog::updatesql( const int &start,const int &num,const QString &intop) +{ + HistoryUpdateListWig *firstWidget = NULL; + bool flag = true; + + //sql 拼接 + QString sqlCmd = "SELECT * FROM updateinfos"; + if(intop!="") + sqlCmd+=" where `date` = '"+intop+"'"; + else if(start>0) + sqlCmd+=" where `id` < "+QString::number(start); + sqlCmd+=" order by `id` desc limit "; + sqlCmd+=QString::number(num); + //载入数据库数据 + QSqlQuery query(QSqlDatabase::database("A")); + query.exec(sqlCmd); + while(query.next()){ + QString statusType = query.value("keyword").toString(); + if(statusType!=""&&statusType!="1") + continue; + HistoryUpdateListWig *hulw = new HistoryUpdateListWig(updateDesTab); + lognum++; + if (flag == true) { + firstWidget = hulw; + flag = false; + } + hulw->setAttribute(translationVirtualPackage(query.value("appname").toString())+" "+query.value("version").toString(), + query.value("status").toString(), + query.value("date").toString(), + setDefaultDescription(query.value("description").toString()), + setDefaultDescription(query.value("changelog").toString()), + query.value("errorcode").toString(), + query.value("id").toInt()); + QListWidgetItem *item = new QListWidgetItem(); + item->setFlags(Qt::NoItemFlags); + item->setSizeHint(hulw->getTrueSize()); + if(intop!="") + { + if(hulw->id<=firstCode) + { + hulw->deleteLater(); + delete item; + item = nullptr; + return; + } + firstCode=hulw->id; + mainListwidget->insertItem(0,item); + } + else + { + loadingCode = hulw->id;//记录加载到哪个位置 + mainListwidget->addItem(item); + } + mainListwidget->setItemWidget(item,hulw); + if(intop!="") + hulw->selectStyle();//设置选中样式 + } + + /* 选中第一条记录 */ + if (firstWidget != NULL && start == 0) { + firstWidget->selectStyle(); + } +} + +void m_updatelog::defaultItem() +{ + //默认选中第一个 + HistoryUpdateListWig *first = mainListwidget->findChild(); + if(first!=nullptr) + { + first->selectStyle();//设置选中样式 + firstCode = first->id;//记录id + } +} + +QString m_updatelog::translationVirtualPackage(QString str) +{ + QString retStr = str; + /*判断json文件是否存在*/ + QString filename = QString("/usr/share/kylin-update-desktop-config/config/") +str +".json"; + QFile file(filename); + if (!file.open(QIODevice::ReadOnly)){ + qDebug() << "JSON file open failed! "; + } else { + QByteArray jsonData = file.readAll(); + QJsonParseError err_rpt; + QJsonDocument root_Doc = QJsonDocument::fromJson(jsonData, &err_rpt); // 字符串格式化为JSON + + if (!root_Doc.isNull() && (err_rpt.error == QJsonParseError::NoError)) { // 解析未发生错误 + if (root_Doc.isObject()) { // JSON 文档为对象 + QJsonObject object = root_Doc.object(); // 转化为对象 + if (QLocale::system().name() == "zh_CN"){ + QString name = object.value("name").toObject().value("zh_CN").toString(); + if (!name.isNull()) { + retStr = name; + return retStr; + } + }else { + QString name = object.value("name").toObject().value("en_US").toString(); + if (!name.isNull()) { + retStr = name; + return retStr; + } + } + } + }else{ + qDebug() << "JSON文件格式错误!"; + } + } + + if(QLocale::system().name()!="zh_CN") + return str; + if(str == "kylin-update-desktop-app") + return "基本应用"; + if(str == "kylin-update-desktop-security") + return "安全更新"; + if(str == "kylin-update-desktop-support") + return "系统基础组件"; + if(str == "kylin-update-desktop-ukui") + return "桌面环境组件"; + if(str == "linux-generic") + return "系统内核组件"; + if(str == "kylin-update-desktop-kernel") + return "系统内核组件"; + if(str == "kylin-update-desktop-kernel-3a4000") + return "系统内核组件"; + if(str == "kylin-update-desktop-kydroid") + return "kydroid补丁包"; + if(str == "kylin-update-desktop") + return "麒麟系统升级"; + + /* 从软件商店数据库根据包名获取应用中文名 */ + QString dst; + dst.clear(); + + QSqlQuery query(QSqlDatabase::database("B")); + bool ret = query.exec(QString("SELECT display_name_cn FROM application WHERE app_name IS '%1'").arg(str)); //执行 + if (ret == false) { + qDebug() << "Error : exec select sql fail , switch chinese pkg name fail"; + return retStr; + } + + while (query.next()) { + dst = query.value(0).toString(); + qDebug() << "Info : switch chinese pkg name is [" << dst << "]"; + } + + if (!dst.isEmpty()) { + retStr = dst; + } + return retStr; +} + + +void m_updatelog::dynamicLoadingInit() +{ + //绑定信号和槽 + connect(mainListwidget->verticalScrollBar(),&QScrollBar::valueChanged, this,&m_updatelog::dynamicLoading ); +} + +void m_updatelog::dynamicLoading(int i) +{ + if(mainListwidget->verticalScrollBar()->maximum()==i) + { + qDebug()<<"动态加载"; + updatesql(loadingCode); + } +} + +void m_updatelog::historyUpdateNow(QString str1,QString str2) +{ + qDebug()<<"动态更新:"<setAttribute(translationVirtualPackage(appName) + " " + version , status , time , description , changelog , errorcode , id); + QListWidgetItem *item = new QListWidgetItem(); + item->setFlags(Qt::NoItemFlags); + item->setSizeHint(updateItem->getTrueSize()); + + mainListwidget->addItem(item); + mainListwidget->setItemWidget(item , updateItem); + + appName.clear(); + version.clear(); + status.clear(); + time.clear(); + description.clear(); + changelog.clear(); + errorcode.clear(); + id = 0; + keyword.clear(); + appname_cn.clear(); + status_cn.clear(); + } + + /* 选中第一条记录 */ + if (firstWidget != NULL) { + firstWidget->selectStyle(); + } else { + if (this->des != NULL) { + des->setText(QString("")); + } + if (this->updateDesTab != NULL) { + updateDesTab->setText(QString("")); + } + if (this->clg != NULL) { + clg->setText(QString("")); + } + } + return; +} + +void m_updatelog::cacheDynamicLoad(void) +{ + disconnect(mainListwidget->verticalScrollBar() , &QScrollBar::valueChanged , this , &m_updatelog::dynamicLoading); +} + +void m_updatelog::clearList(void) +{ + int sum = mainListwidget->count(); + + for (int i = sum ; i >= 0 ; i--) { + QListWidgetItem *item = mainListwidget->takeItem(i); + delete item; + } + + return; +} + +QString m_updatelog::conversionPackageName(QString package) +{ + if (QLocale::system().name() != "zh_CN") + return package; + if (package == "基本应用") + return "kylin-update-desktop-app"; + if (package == "安全更新") + return "kylin-update-desktop-security"; + if (package == "系统基础组件") + return "kylin-update-desktop-support"; + if (package == "桌面环境组件") + return "kylin-update-desktop-ukui"; + if (package == "系统内核组件") + return "linux-generic"; + if (package == "系统内核组件") + return "kylin-update-desktop-kernel"; + if (package == "系统内核组件") + return "kylin-update-desktop-kernel-3a4000"; + if (package == "kydroid补丁包") + return "kylin-update-desktop-kydroid"; + + /* 从软件商店数据库根据包名获取应用英文名 */ + QString dst; + dst.clear(); + + QSqlQuery query(QSqlDatabase::database("B")); + bool ret = query.exec(QString("SELECT `app_name` FROM application WHERE `display_name_cn` = '%1'").arg(package)); //执行 + if (ret == false) { + qDebug() << "Error : exec select sql fail , switch pkg name fail"; + return package; + } + + while (query.next()) { + dst = query.value(0).toString(); + qDebug() << "Info : switch chinese pkg name is [" << dst << "]"; + } + + if (dst.isEmpty()) { + return package; + } else { + return dst; + } + + return package; +} + + +bool m_updatelog::eventFilter(QObject *watch , QEvent *e) +{ + if ((e->type() == QEvent::MouseButtonPress && watch != searchBox)) { + if (this->searchBox->text() == "") { + qDebug()<<"QEvent::MouseButtonPress && watch != searchBox, searchBox->text() == NULL"; + this->searchBox->setAlignment(Qt::AlignLeft); +// this->searchBox->setPlaceholderText(tr("Search content")); +// this->searchBox->setTextMargins(this->searchBox->width()/ 2 - 60 , 0 , 0 , 1); +// this->searchBox->setFocus(); + this->searchBox->clearFocus(); + } + } + + if (e->type() == QEvent::MouseButtonPress && watch == searchBox) { + qDebug()<<"QEvent::MouseButtonPress && watch == searchBox"; + this->searchBox->setAlignment(Qt::AlignLeft); +// this->searchBox->setPlaceholderText(tr("")); +// this->searchBox->setTextMargins(this->searchBox->width()/ 2 - 60 , 0 , 0 , 1); + } + + if (e->type() == 6 && watch == searchBox) { + QKeyEvent *key = static_cast(e); + if (key->key() == Qt::Key_Enter || key->key() == Qt::Key_Return) { + if (this->searchBox->text() != "") { + QString appName = this->searchBox->text(); + slotSearch(appName); + } + if (this->searchBox->text() == "") { + clearList(); + connect(mainListwidget->verticalScrollBar() , &QScrollBar::valueChanged , this , &m_updatelog::dynamicLoading); + updatesql(); + } + } + } + + return QObject::eventFilter(watch , e); +} + +void m_updatelog::updateTitleWidget(void) +{ + this->title = new QWidget(this); + this->title->setFixedHeight(40); + this->title->setObjectName("titleWidget"); + titlewidget = new QWidget(this); + titlewidget->setFixedHeight(40); + + /* 标题栏图标 */ + this->titleIcon = new QLabel(this); + this->titleIcon->setFixedSize(24 , 24); + this->titleIcon->setPixmap(QIcon::fromTheme("ukui-control-center").pixmap(QSize(24 , 24))); + /* 标题栏名字 */ + this->titleName = new QLabel(this); + this->titleName->resize(56 , 20); + //this->titleName->setText(tr("历史更新")); + this->titleName->setText(tr("History Log")); + /*标题整体*/ + titlewidgetlayout = new QHBoxLayout(titlewidget); + titlewidgetlayout->setContentsMargins(3,8,0,8); + titlewidgetlayout->addWidget(titleIcon); + titlewidgetlayout->addSpacing(4); + titlewidgetlayout->addWidget(titleName); + titlewidget->setLayout(titlewidgetlayout); + /* 搜索框 */ + this->searchBox = new KSearchLineEdit(this); + this->searchBox->setFixedSize(300 , 31); + this->searchBox->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); + this->searchBox->installEventFilter(this); +// this->searchBox->setTextMargins(this->searchBox->width()/ 2 - 60 , 0 , 0 , 1); + /* 关闭按钮 */ + this->titleClose = new QPushButton(this); + titleClose->setToolTip(tr("Close")); + this->titleClose->setFixedSize(30 , 30); + this->titleClose->setFlat(true); + this->titleClose->setProperty("isWindowButton" , 0x2); + this->titleClose->setProperty("useIconHighlightEffect" , 0x8); + this->titleClose->setIcon(QIcon::fromTheme("window-close-symbolic")); + this->titleClose->setFocusPolicy(Qt::NoFocus); + this->titleClose->setToolTip(tr("Close")); + connect(this->titleClose , &QPushButton::clicked , this , &m_updatelog::slotClose); + + /* 布局 */ + titlelayout = new QHBoxLayout(title); + titlelayout->setContentsMargins(5,0,5,0); + title->setLayout(titlelayout); + titlelayout->addWidget(titlewidget); + titlelayout->addSpacing(4); + titlelayout->addStretch(); + titlelayout->addWidget(searchBox); + titlelayout->addStretch(); + titlelayout->addSpacing(this->titlewidget->width()+4); + titlelayout->addWidget(titleClose); +} + +void m_updatelog::slotClose(void) +{ + this->close(); +} diff --git a/immutable/plugin/src/m_updatelog.h b/immutable/plugin/src/m_updatelog.h new file mode 100644 index 0000000..1ac4377 --- /dev/null +++ b/immutable/plugin/src/m_updatelog.h @@ -0,0 +1,92 @@ +#ifndef M_UPDATELOG_H +#define M_UPDATELOG_H +//窗体 +#include +#include +//布局 +#include +//控件 +#include +#include +#include +#include +#include +#include +//数据库 +#include +#include +#include +//GSETTINGS +#include +//其他 +#include +#include +#include +#include "historyupdatelistwig.h" +#include "updatedbus.h" +#include +using namespace kdk; +#define THEME_QT_SCHEMA "org.ukui.style" + +class m_updatelog : public QDialog +{ + Q_OBJECT +public: + static m_updatelog * GetInstance(QWidget *parent); + static void closeUpdateLog(); + QTextEdit * des = nullptr; + QTextEdit * clg = nullptr; + +public: + QString conversionPackageName(QString package); + void clearList(void); + void cacheDynamicLoad(void); + void updateTitleWidget(void); + bool eventFilter(QObject *watch, QEvent *e); + +public slots: + void historyUpdateNow(QString str1, QString str2);//实时更新 + void slotClose(void); + +private: + int lognum; + QString nocontentpicturepath; + QHBoxLayout *titlelayout; + QHBoxLayout *titlewidgetlayout; + m_updatelog(QWidget *parent); + static m_updatelog * m_instance; + QListWidget *mainListwidget; //列表容器 + QLabel *updateDesTab; //右侧顶部描述标签 + int firstCode = 0; + int loadingCode = 0; + QHBoxLayout *hll = nullptr; + QString setDefaultDescription(QString str); + QGSettings *qtSettings=nullptr; + QTimer *timer=nullptr; + + /* 搜索框 */ + KSearchLineEdit *searchBox; + QLabel *searchIcon; + + /* 标题栏 */ + QWidget *title; + QWidget *titlewidget; + QLabel *titleIcon; + QLabel *titleName; + QPushButton *titleClose; + QWidget *content; + QLabel *nocontent; +private slots: + void initUI(); //初始化UI + void initGsettings(); //初始化Gsettings + void dynamicLoadingInit(); //动态加载 + void dynamicLoading(int i); //动态加载 + void updatesql(const int &start=0, const int &num=20, const QString &intop="");//更新列表 + void defaultItem();//默认选中 + QString translationVirtualPackage(QString str);//翻译虚包名 + void changeListWidgetItemHeight();//修改列表项高度 + + void slotSearch(QString packageName); +}; + +#endif // M_UPDATELOG_H diff --git a/plugin/src/mylabel.cpp b/immutable/plugin/src/mylabel.cpp similarity index 100% rename from plugin/src/mylabel.cpp rename to immutable/plugin/src/mylabel.cpp diff --git a/plugin/src/mylabel.h b/immutable/plugin/src/mylabel.h similarity index 100% rename from plugin/src/mylabel.h rename to immutable/plugin/src/mylabel.h diff --git a/plugin/src/switchbutton.cpp b/immutable/plugin/src/switchbutton.cpp similarity index 100% rename from plugin/src/switchbutton.cpp rename to immutable/plugin/src/switchbutton.cpp diff --git a/plugin/src/switchbutton.h b/immutable/plugin/src/switchbutton.h similarity index 100% rename from plugin/src/switchbutton.h rename to immutable/plugin/src/switchbutton.h diff --git a/immutable/plugin/src/tabwidget.cpp b/immutable/plugin/src/tabwidget.cpp new file mode 100644 index 0000000..bfc155e --- /dev/null +++ b/immutable/plugin/src/tabwidget.cpp @@ -0,0 +1,1223 @@ +#include "tabwidget.h" +#ifdef signals +#undef signals +#endif +extern "C" { +#include +#include +} + +#define JSON_FILE_PATH "/var/cache/kylin-system-updater/json/" + +TabWid::TabWid(QWidget *parent):QWidget(parent) +{ + allComponents(); +} + +void TabWid::initDbus() +{ + /* 更新管理器dbus接口 */ + updateMutual = UpdateDbus::getInstance(); + datetimeutils = DateTimeUtils::get_instance(); +// connect(updateMutual,&UpdateDbus::startDbusFinished,this,&TabWid::dbusFinished); + /*sdk 时间格式接口*/ + m_dateSessionDbus = new QDBusInterface("com.kylin.kysdk.DateServer", + "/com/kylin/kysdk/Date", + "com.kylin.kysdk.DateInterface", + QDBusConnection::sessionBus(), + this); + if (m_dateSessionDbus->isValid()) { + connect(m_dateSessionDbus,SIGNAL(ShortDateSignal(QString)),this,SLOT(UpdateSdkTime(QString))); + connect(m_dateSessionDbus,SIGNAL(TimeSignal(QString)), this, SLOT(UpdateSdkTime(QString))); + } + /*sdk声效*/ + soundplayeriface = new QDBusInterface("org.ukui.sound.theme.player", + "/org/ukui/sound/theme/player", + "org.ukui.sound.theme.player", + QDBusConnection::sessionBus(), + this); + connect(checkUpdateBtn,&QPushButton::clicked,this,&TabWid::checkUpdateBtnClicked); + connect(checkUpdateBtn,&QPushButton::clicked,this,[=] (bool status){ + ukcc::UkccCommon::buriedSettings("Upgrade",checkUpdateBtn->text(),QString("clicked")); + }); + connect(historyUpdateLog,&QPushButton::clicked,this,&TabWid::showHistoryWidget); + connect(isAutoCheckSBtn,&KSwitchButton::stateChanged,this,&TabWid::isAutoCheckedChanged); + connect(isAutoCheckSBtn,&KSwitchButton::stateChanged,this,[=] (bool status){ + ukcc::UkccCommon::buriedSettings(QString("Upgrade"), QString("isAutoCheckSBtn"), QString("settings"), status ? "true":"false"); + }); + connect(isAutoUpgradeSBtn,&KSwitchButton::stateChanged,this, &TabWid::isAutoUpgradeChanged); + connect(isAutoUpgradeSBtn,&KSwitchButton::stateChanged,this,[=] (bool status){ + ukcc::UkccCommon::buriedSettings(QString("Upgrade"), QString("isAutoUpgradeSBtn"), QString("settings"), status ? "true":"false"); + }); + connect(DownloadHBtn,&KSwitchButton::stateChanged,this,&TabWid::DownloadLimitChanged); + connect(DownloadHBtn,&KSwitchButton::stateChanged,this,[=] (bool status){ + ukcc::UkccCommon::buriedSettings(QString("Upgrade"), QString("DownloadHBtn"), QString("settings"), status ? "true":"false"); + }); + connect(DownloadHValue,&QComboBox::currentTextChanged,this,&TabWid::DownloadLimitValueChanged); + connect(RestoreButton,&QPushButton::clicked,this,&TabWid::OpenBackupTool); + /*策略下发功能*/ + connect(updateMutual->interface,SIGNAL(ButtonStatusChange(QString,QString)),this,SLOT(SecurityDownloadChange(QString,QString))); + /*分步更新安装过程提示*/ +// connect(updateMutual->interface,SIGNAL(NotifyStepsInstalled(bool,QString)),this,SLOT(SetInstallStatus(bool,QString))); + connect(AdvancedOption,&QPushButton::clicked,this,&TabWid::ShowAdvancedOption); +// /*错误码机制*/ +// connect(updateMutual->interface,SIGNAL(InstallDetectStatus(bool,QString)),this,SLOT(GetErrorCode(bool,QString))); +// connect(errorcodeButoon,&KBorderlessButton::clicked,this,[=](bool status){ +// showUserGuide("ukui-control-center/upgrade"); +// }); + + checkUpdateBtn->stop(); + checkUpdateBtn->setText(tr("Check Update")); + checkUpdateBtnClicked(); +} + +void TabWid::allComponents() +{ + AppMessage = new QVBoxLayout(); + AppMessage->setAlignment(Qt::AlignTop); + this->setLayout(AppMessage); + AppMessage->setContentsMargins(0, 0, 0, 0); + this->setMinimumSize(QSize(550,0)); + this->setMaximumSize(QSize(16777215, 16777215)); + + /*系统更新第一部分*/ + /*update一级标题*/ + labUpdate = new TitleLabel(this); + // labUpdate->setText(tr("更新")); + labUpdate->setText(tr("Update")); + /*检查更细框内布局设置*/ + systemWidget = new QFrame(this); + systemWidget->setFrameShape(QFrame::Box); + /*appwidget初始布局*/ + allUpdateWid = new QWidget(this); + allUpdateLayout = new QVBoxLayout(); + allUpdateLayout->setAlignment(Qt::AlignTop); + allUpdateWid->setLayout(allUpdateLayout); + allUpdateLayout->setSpacing(0); + allUpdateLayout->setMargin(0); + + tab1HLayout = new QHBoxLayout(); + systemWidget->setLayout(tab1HLayout); + tab1HLayout->setContentsMargins(16,0,16,0); + systemWidget->setFixedHeight(132); + + /*左侧图片*/ + systemPortraitLab = new QLabel(systemWidget); + systemPortraitLab->setFixedSize(96,96); + systemPortraitLab->setPixmap(QPixmap(":/img/upgrade/normal.png").scaled(QSize(96,96))); + + /*中间布局*/ + QWidget *inforWidget = new QWidget(); + inforLayout = new QVBoxLayout(inforWidget); + inforWidget->setLayout(inforLayout); + versionErrorcodeLab= new QWidget(inforWidget); + versionErrorcodeLablayout = new QHBoxLayout(versionErrorcodeLab); + versionInformationLab = new QLabel(versionErrorcodeLab); +// errorcodeButoon = new KBorderlessButton(versionErrorcodeLab); + versionErrorcodeLab->setLayout(versionErrorcodeLablayout); + versionErrorcodeLablayout->addWidget(versionInformationLab); + versionErrorcodeLablayout->setSpacing(0); +// versionErrorcodeLablayout->addSpacing(2); +// versionErrorcodeLablayout->addWidget(errorcodeButoon); + versionErrorcodeLablayout->addStretch(0); + versionErrorcodeLablayout->setContentsMargins(0,0,0,0); + versionErrorcodeLab->setFixedHeight(versionInformationLab->height()+4); +// errorcodeButoon->setText("#0000"); +// errorcodeButoon-hide(); + allProgressBar = new KProgressBar(systemWidget); + allProgressBar->setFixedHeight(20); + allProgressBar->setBodyWidth(12); + allProgressBar->hide(); + allProgressBar->setValue(0); + lastRefreshTime = new LightLabel(systemWidget); + inforLayout->addStretch(); + inforLayout->addWidget(versionErrorcodeLab); + inforLayout->addWidget(allProgressBar,Qt::AlignVCenter); + inforLayout->addWidget(lastRefreshTime); + inforLayout->addStretch(); + allProgressBar->hide(); + + /*右侧按键布局*/ + checkUpdateBtn = new m_button(systemWidget); + checkUpdateBtn->setDefault(true); + checkUpdateBtn->start(); + + tab1HLayout->addWidget(systemPortraitLab,0,Qt::AlignHCenter|Qt::AlignLeft); + tab1HLayout->addWidget(inforWidget,Qt::AlignLeft|Qt::AlignTop); + tab1HLayout->addWidget(checkUpdateBtn); + tab1HLayout->setContentsMargins(16,16,16,16); + tab1HLayout->setSpacing(0); + + + + /*******Update Settings*******/ + updateSettingLab = new TitleLabel(); + // updateSettingLab->setText(tr("更新设置")); + //~ contents_path /upgrade/Update Settings + updateSettingLab->setText(tr("Update Settings")); + updateSettingLab->setFixedHeight(27); + /*the whole update setting layout*/ + updateSettingWidget = new QFrame(this); + updateSettingWidget->setFrameShape(QFrame::Box); + updatesettingLayout = new QVBoxLayout(); + updateSettingWidget->setLayout(updatesettingLayout); + + /*switchbutton1:允许自动更新*/ + isAutoCheckWidget = new QFrame(); + isAutoCheckWidget->setFrameShape(QFrame::Box); + isAutoCheckWidget->setFixedHeight(60); + isAutoCheckLayout = new QHBoxLayout(); + isAutoCheckedLab = new QLabel(); + // isAutoCheckedLab->setText(tr("允许通知可更新的应用")); + isAutoCheckedLab->setText(tr("Allowed to renewable notice")); + isAutoCheckSBtn = new KSwitchButton(); + isAutoCheckSBtn->setFixedWidth(50); + isAutoCheckWidget->setLayout(isAutoCheckLayout); + isAutoCheckLayout->setContentsMargins(8, 0, 14, 0); + isAutoCheckLayout->addSpacing(6); + isAutoCheckLayout->addWidget(isAutoCheckedLab); + isAutoCheckLayout->addWidget(isAutoCheckSBtn); + + /*switchbutton2:自动下载和安装更新*/ + isAutoUpgradeWidget = new QFrame(); + isAutoUpgradeWidget->setFrameShape(QFrame::Box); + isAutoUpgradeWidget->setFixedHeight(60); + isAutoUpgradeWidget->hide(); + isAutoUpgradeLayout = new QVBoxLayout(); + isAutoUpgradeLayout->setContentsMargins(8, 0, 14, 0); + isAutoUpgradeLab = new QLabel(); + isAutoUpgradeLab->setText(tr("Automatically updates")); + autoUpgradeLab = new LightLabel(tr("The system will automatically updates when there is an available network and backup.")); + autoUpgradeLab->setWordWrap(true); + autoUpgradeLab->setAlignment(Qt::AlignTop); + autoUpgradeLab->hide(); + isAutoUpgradeSBtn = new KSwitchButton(); + isAutoUpgradeSBtn->setFixedWidth(50); + autoUpgradeBtnLayout = new QHBoxLayout(); + autoUpgradeBtnLayout->addSpacing(6); + autoUpgradeBtnLayout->addWidget(isAutoUpgradeLab); + autoUpgradeBtnLayout->addWidget(isAutoUpgradeSBtn); + + /*switchbutton3:下载限速*/ + DownloadVWidget = new QFrame(); + DownloadVWidget->setFrameShape(QFrame::Box); + DownloadVWidget->setFixedHeight(60); + DownloadVWidget->hide(); + DownloadVLayout = new QVBoxLayout(); + DownloadVLayout->setContentsMargins(8, 0, 14, 0); + DownloadHLayout = new QHBoxLayout(); + DownloadVLabLayout = new QHBoxLayout(); + DownloadHLab = new QLabel(); + DownloadHLab->setText(tr("Download Limit")); + DownloadHBtn = new KSwitchButton(); + DownloadHBtn->setFixedWidth(50); + DownloadHValue = new QComboBox(); + QStringList strList; + strList<<"50 kB/s"<<"100 kB/s"<<"200 kB/s"<<"300 kB/s"<<"600 kB/s"; + DownloadHValue->addItems(strList); + DownloadVLab = new LightLabel(tr("It will be avaliable in the next download.")); + DownloadVLab->setWordWrap(true); + DownloadVLab->setAlignment(Qt::AlignTop); + DownloadVLab->hide(); + DownloadHLayout->addSpacing(6); + DownloadHLayout->addWidget(DownloadHLab); + DownloadHLayout->addWidget(DownloadHValue); + DownloadHLayout->addWidget(DownloadHBtn); + DownloadVLayout->addLayout(DownloadHLayout); + DownloadVLayout->addLayout(DownloadVLabLayout); + DownloadVLabLayout->addSpacing(6); + DownloadVLabLayout->addWidget(DownloadVLab); + DownloadVWidget->setLayout(DownloadVLayout); + + /*switchbutton4:还原路径*/ + RestoreWidget = new QFrame(); + RestoreWidget->setFrameShape(QFrame::Box); + RestoreWidget->setFixedHeight(60); + RestoreLayout = new QHBoxLayout(); + RestoreLayout->setContentsMargins(8, 0, 14, 0); + RestoreLabel = new QLabel(); + RestoreLabel->setText(tr("Rollback to previous version")); + RestoreButton = new QPushButton(); + RestoreButton->setText(tr("start")); + RestoreButton->setFixedWidth(120); + RestoreLayout->addSpacing(6); + RestoreLayout->addWidget(RestoreLabel); + RestoreLayout->addWidget(RestoreButton); + RestoreWidget->setLayout(RestoreLayout); + + isAutoUpgradeLayout->addLayout(autoUpgradeBtnLayout); + autoUpgradeLayout = new QHBoxLayout(); + autoUpgradeLayout->addSpacing(6); + autoUpgradeLayout->addWidget(autoUpgradeLab); + isAutoUpgradeLayout->addLayout(autoUpgradeLayout); + isAutoUpgradeWidget->setLayout(isAutoUpgradeLayout); + /*临时加入的分割线,在后期可以化成一个模块*/ + line12 = new QFrame(this); + line12->setMinimumSize(QSize(0, 1)); + line12->setMaximumSize(QSize(16777215, 1)); + line12->setLineWidth(0); + line12->setFrameShape(QFrame::HLine); + line12->setFrameShadow(QFrame::Sunken); + line12->hide(); + line23 = new QFrame(this); + line23->setMinimumSize(QSize(0, 1)); + line23->setMaximumSize(QSize(16777215, 1)); + line23->setLineWidth(0); + line23->setFrameShape(QFrame::HLine); + line23->setFrameShadow(QFrame::Sunken); + line23->hide(); + line34 = new QFrame(this); + line34->setMinimumSize(QSize(0, 1)); + line34->setMaximumSize(QSize(16777215, 1)); + line34->setLineWidth(0); + line34->setFrameShape(QFrame::HLine); + line34->setFrameShadow(QFrame::Sunken); + + QWidget *historyUpdateLogWid = new QWidget(this); + QHBoxLayout *historyUpdateLogLayout = new QHBoxLayout(); + historyUpdateLog = new QPushButton(this); // 历史日志弹出窗口控制按钮 + // historyUpdateLog->setText(tr("更新历史")); + historyUpdateLog->setText(tr("View history")); + historyUpdateLog->setFixedHeight(36); + AdvancedOption = new QPushButton(this); + AdvancedOption->setText(tr("Advanced")); + historyUpdateLog->setFixedHeight(36); + historyUpdateLog->setFixedWidth(132); + AdvancedOption->setFixedWidth(132); + AdvancedOption->hide(); + historyUpdateLogWid->setContentsMargins(2,0,0,0); + historyUpdateLogWid->setLayout(historyUpdateLogLayout); + historyUpdateLogLayout->setAlignment(Qt::AlignLeft); + historyUpdateLogLayout->addWidget(historyUpdateLog); + historyUpdateLogLayout->setSpacing(5); + historyUpdateLogLayout->addWidget(AdvancedOption); + historyUpdateLogLayout->setMargin(0); + + /*第二个titlelabel的布局*/ + updatesettingLayout->setAlignment(Qt::AlignTop); + updatesettingLayout->addWidget(isAutoCheckWidget); + updatesettingLayout->setSpacing(2);/*加了两行参数*/ + updatesettingLayout->setMargin(0);/*加了两行参数*/ + updatesettingLayout->addWidget(line12); + updatesettingLayout->addWidget(isAutoUpgradeWidget); + updatesettingLayout->setSpacing(2); + updatesettingLayout->setMargin(0); + updatesettingLayout->addWidget(line23); + updatesettingLayout->addWidget(DownloadVWidget); + updatesettingLayout->setSpacing(2); + updatesettingLayout->setMargin(0); + updatesettingLayout->addWidget(line34); + updatesettingLayout->addWidget(RestoreWidget); + updatesettingLayout->setSpacing(2); + updatesettingLayout->setMargin(0); + AppMessage->addWidget(labUpdate); + AppMessage->addWidget(systemWidget); + AppMessage->addWidget(allUpdateWid); + AppMessage->addSpacing(30); + AppMessage->addWidget(updateSettingLab); + AppMessage->addWidget(updateSettingWidget); + AppMessage->addSpacing(6); + AppMessage->addWidget(historyUpdateLogWid); + AppMessage->addStretch(); + AppMessage->setContentsMargins(0,0,0,0); + + getAllDisplayInformation(); + + setVisibleBySecurity(); + QDBusConnection::sessionBus().connect(QString(), QString("/"), "org.ukui.ukcc.session.interface", "configChanged", this, SLOT(setVisibleBySecurity())); + +} + +void TabWid::checkUpdateBtnClicked() +{ + qInfo()<<"get in checkUpdateBtnClicked"; + if(checkUpdateBtn->text() == tr("Cancel")) + { + qInfo()<<"cancel download"; + updateMutual->interface->call("CancelDownload"); + versionInformationLab->setText(tr("update has been canceled!")); + disconnect(updateMutual->interface,SIGNAL(UpdateDownloadInfo(int,int,uint,uint,int)),this,SLOT(showDownloadInfo(int,int,uint,uint,int))); + disconnect(updateMutual->interface,SIGNAL(UpdateDownloadFinished(bool,QStringList,QString,QString)),this,SLOT(hideUpdateBtnSlotindownload(bool,QStringList,QString,QString))); + checkUpdateBtn->hide(); + allProgressBar->hide(); + lastRefreshTime->hide(); + return; + } +// errorcodeButoon->hide(); + QDBusMessage msg = updateMutual->interface->call("GetBackendStatus",getLanguageEnv()); + backstatus = msg.errorMessage().isEmpty(); + if(!backstatus) + { + qInfo()<<"the dbus is not start"; + versionInformationLab->setText(tr("The updater is NOT start")); + checkUpdateBtn->hide(); + return; + } + int backendStatus = msg.arguments().value(0).toInt(); + switch(backendStatus) + { + qInfo()<<"backendStatus is "<setText(tr("The progress is updating...")); + checkUpdateBtn->hide(); + connect(updateMutual->interface,SIGNAL(UpdateDetectFinished(bool,QStringList,QString,QString)),this,SLOT(slotUpdateCache(bool,QStringList,QString,QString))); +// connect(updateMutual->interface,SIGNAL(UpdateDetectStatusChanged(int,QString)),this,SLOT(slotUpdateCacheProgress(int,QString))); + return; + break; + case ACTION_DOWNLOADONLY: + qInfo()<<"access to ACTION_DOWNLOADONLY"; + versionInformationLab->setText(tr("The progress is downloading...")); + checkUpdateBtn->setEnabled(false); + allProgressBar->show(); + checkUpdateBtn->setText(tr("Cancel")); + lastRefreshTime->setText(tr("In download")); + connect(updateMutual->interface,SIGNAL(Cancelable(bool)),this,SLOT(isCancelabled(bool))); + connect(updateMutual->interface,SIGNAL(UpdateDownloadInfo(int,int,uint,uint,int)),this,SLOT(showDownloadInfo(int,int,uint,uint,int))); +// connect(updateMutual->interface,SIGNAL(UpdateDownStatusChanged(QStringList,int,QString,QString)),this,SLOT(getAllProgress(QStringList,int,QString,QString))); + connect(updateMutual->interface,SIGNAL(UpdateDownloadFinished(bool,QStringList,QString,QString)),this,SLOT(hideUpdateBtnSlotindownload(bool,QStringList,QString,QString))); + return; + break; + default: + versionInformationLab->setText(tr("The updater is busy!")); + return; + break; + } + //后续需要添加判断接口是否生效的接口 + if(checkUpdateBtn->text() == tr("Retry")) + { + qInfo()<<"access to Retry"; + connect(updateMutual->interface,SIGNAL(UpdateDetectFinished(bool,QStringList,QString,QString)),this,SLOT(slotUpdateCache(bool,QStringList,QString,QString))); +// connect(updateMutual->interface,SIGNAL(UpdateDetectStatusChanged(int,QString)),this,SLOT(slotUpdateCacheProgress(int,QString))); + updateMutual->interface->call("UpdateDetect"); + versionInformationLab->setText(tr("Updating the software source")+"..."); + checkUpdateBtn->start(); + checkUpdateBtn->setEnabled(false); + return; + } + else if(checkUpdateBtn->text() == tr("Check Update")) + { + qInfo()<<"access to Check Update"; + connect(updateMutual->interface,SIGNAL(UpdateDetectFinished(bool,QStringList,QString,QString)),this,SLOT(slotUpdateCache(bool,QStringList,QString,QString))); + updateMutual->interface->call("UpdateDetect"); + versionInformationLab->setText(tr("Updating the software source")+"..."); + checkUpdateBtn->start(); + checkUpdateBtn->show(); + checkUpdateBtn->setEnabled(false); + return; + } + else if(checkUpdateBtn->text() == tr("reboot rightnow")) + { + qInfo()<<"reboot rightnow"; + QDBusMessage rebootresult = updateMutual->interface->call("DeployLatestUpdate","reboot"); + int reboot =rebootresult.arguments().value(0).toInt(); + QString reason = rebootresult.arguments().value(1).toString(); + qInfo()<<"reboot result and reason"<activeModalWidget()); + msgBox.setText(reason); + msgBox.setWindowTitle(tr("Reboot failed!")); + msgBox.setIcon(QMessageBox::Icon::Information); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setButtonText(QMessageBox::Ok,tr("OK")); + msgBox.exec(); + } + return; + } + else if(checkUpdateBtn->text() == tr("UpdateAll")) + { + system("systemctl --user start kylin-stepinstall-notify.service"); + system("systemctl --user enable kylin-stepinstall-notify.service"); + connect(updateMutual->interface,SIGNAL(UpdateDownloadInfo(int,int,uint,uint,int)),this,SLOT(showDownloadInfo(int,int,uint,uint,int))); + connect(updateMutual->interface,SIGNAL(UpdateDownloadFinished(bool,QStringList,QString,QString)),this,SLOT(hideUpdateBtnSlotindownload(bool,QStringList,QString,QString))); + qInfo() << "updateAllApp"; + checkUpdateBtn->setEnabled(true); + lastRefreshTime->setText(tr("The system is updating...")); + updateMutual->interface->call("UpdateDownloadAll"); + return; + } +} + +QString TabWid::getLanguageEnv() +{ + qInfo()<<"getLanguageEnv"; + QStringList environment = QProcess::systemEnvironment(); + QString language_default="zh_CN.UTF-8"; + QString str=""; + foreach(str,environment) + { + if (str.startsWith("LANG=")) + { + return str.mid(5); + } + } + return language_default; +} + +//void TabWid::GetErrorCode(bool success, QString error) +//{ +// qInfo()<<"get in the GetErrorCode"; +// if(!success) +// { +// error_code = error; +// qInfo()<<"errorcode is "<show(); + checkUpdateBtn->show(); + qInfo() <<"更新成功结果:" << result; + if (result) + { + versionInformationLab->setText(tr("Getting update list")+"..."); + QList::Iterator it = pkgname.begin(),itend = pkgname.end(); + int i = 0; + for (;it != itend; it++,i++) + { + qInfo() << "slotUpdateCache函数:获取到的包列表:" << pkgname[i]; + getpkginfoFromJson(&msg,pkgname[i]); + msg.name=pkgname[i]; + qInfo()<<"msg'name is" <setEnabled(true); + checkUpdateBtn->stop(); + checkUpdateBtn->setText(tr("Retry")); + if(error_code == "#0102") + { + qInfo()<<"Internet error"; + versionInformationLab->setText(tr("Network exception, unable to check for updates!")); + } + else if(error_code == "#0204") + { + qInfo()<<"no room to backup"; + versionInformationLab->setText(tr("No room, upgrade failed.")); + checkUpdateBtn->show(); + } + else if(error_code == "#0208") + { + qInfo()<<"low power"; + versionInformationLab->setText(tr("Battery level is below 50%,and upgrade failed.")); + checkUpdateBtn->show(); + } + else + { + qInfo()<<"show error code"; + versionInformationLab->setText(tr("Checking update failed! ")); +// + +// tr("Error Code:") +// errorcodeButoon->setText(error_code); +// errorcodeButoon->show(); + checkedtime = tr("No information!"); + QSqlQuery query(QSqlDatabase::database("A")); + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + } + lastRefreshTime->setText(tr("Last Checked:")+checkedtime); + } + checkUpdateBtn->show(); + disconnect(updateMutual->interface,SIGNAL(UpdateDetectFinished(bool,QStringList,QString,QString)),this,SLOT(slotUpdateCache(bool,QStringList,QString,QString))); +// disconnect(updateMutual->interface,SIGNAL(UpdateDetectStatusChanged(int,QString)),this,SLOT(slotUpdateCacheProgress(int,QString))); + } +} + +void TabWid::getAllProgress (QStringList pkgName,int Progress,QString status,QString detailinfo) +{ + qInfo()<<"getAllProgress"; + qInfo() << pkgName << Progress << status; + versionInformationLab->setText(tr("The system is downloading the update!")); + allProgressBar->setValue(Progress); + allProgressBar->show(); + lastRefreshTime->show(); + if (Progress == 100) + { + disconnect(updateMutual->interface,SIGNAL(UpdateDownStatusChanged(QStringList,int,QString,QString)),this,SLOT(getAllProgress(QStringList,int,QString,QString))); + disconnect(updateMutual->interface,SIGNAL(Cancelable(bool)),this,SLOT(isCancelabled(bool))); + } +} + +void TabWid::getpkginfoFromJson(AppAllMsg *msg,QString pkgname) +{ + qInfo()<<"getpkginfoFromJson"; + /*判断json文件是否存在*/ + QString filename = "/var/cache/kylin-system-updater/json/"+pkgname +".json"; + qInfo() << filename; + QFile file(filename); + if (!file.open(QIODevice::ReadOnly)){ + qInfo() << "JSON file open failed! "; + return ; + } + QByteArray jsonData = file.readAll(); + QJsonParseError err_rpt; + QJsonDocument root_Doc = QJsonDocument::fromJson(jsonData, &err_rpt); // 字符串格式化为JSON + if (!root_Doc.isNull() && (err_rpt.error == QJsonParseError::NoError)) { // 解析未发生错误 + if (root_Doc.isObject()) + { // JSON 文档为对象 + QJsonObject object = root_Doc.object(); // 转化为对象 + if (QLocale::system().name() == "zh_CN") + { + QString name = object.value("name").toObject().value("zh_CN").toString(); + QString description = object.value("description").toObject().value("zh_CN").toString(); + if (!name.isNull()) { + msg->name=name; + } + if (!description.isNull()) { + msg->shortDescription=description; + } + } + else + { + QString name = object.value("name").toObject().value("en_US").toString(); + QString description = object.value("description").toObject().value("en_US").toString(); + if (!name.isNull()) { + msg->name=name; + } + if (!description.isNull()) { + msg->shortDescription=description; + } + } + QString upgrade_download_size_str = object.value("upgrade_list").toObject().value("total_download_size").toString(); + long upgrade_download_size = upgrade_download_size_str.toLong(); + QString install_download_size_str = object.value("install_list").toObject().value("total_download_size").toString(); + long install_download_size = install_download_size_str.toLong(); + msg->msg.allSize = upgrade_download_size + install_download_size; + QString upgrade_install_size_str = object.value("upgrade_list").toObject().value("total_install_size").toString(); + long upgrade_install_size = upgrade_install_size_str.toLong(); + QString install_install_size_str = object.value("install_list").toObject().value("total_install_size").toString(); + long install_install_size = install_install_size_str.toLong(); + msg->msg.installSize = upgrade_install_size + install_install_size; + + QString new_version = object.value("new_version").toString(); + if (!new_version.isNull()) + msg->availableVersion=new_version; + QString cur_version = object.value("cur_version").toString(); + if (!cur_version.isNull()) + msg->version=cur_version; + QString changelog = object.value("changelog").toString(); + if (!changelog.isNull()) + msg->longDescription=changelog; + } + } + else{ + qInfo() << "JSON文件格式错误!"; + return ; + } + file.close(); +} + +void TabWid::loadingOneUpdateMsgSlot(AppAllMsg msg) +{ + qInfo()<<"loadingOneUpdateMsgSlot"; + ukscConnect = new UKSCConn(); + if(updateMutual->importantList.indexOf(msg.name) == -1) + { + qInfo()<<"index = -1"; + struct pkgProgress pkg; + pkg.name = msg.name; + pkgList << pkg; + qInfo()<<"the msg.name is "<< msg.name; + updateMutual->importantList.append(msg.name); //重要更新列表中添加appname + AppUpdateWid *appWidget = new AppUpdateWid(msg, this); + widgetList << appWidget; + if(ukscConnect->isConnectUskc == true) + { + QStringList list = ukscConnect->getInfoByName(msg.name); + if(list[2] != "") + { + qInfo()<<"ukscconnect->appnamelab is"<appNameLab->setText(list[2]); + appWidget->dispalyName = list[2]; + + } + if(list[1] != "" && QLocale::system().name()=="zh_CN") + { + qInfo()<<"ukscconnect->appnamelab is"<appNameLab->setText(list[1]); + appWidget->dispalyName = list[1]; + } + if(list[0] != "" && !appWidget->haveThemeIcon) + { + appWidget->appIcon->setPixmap(QPixmap(list[0]).scaled(32, 32)); + } + } + allUpdateLayout->addWidget(appWidget); + qInfo() <<"loadingOneUpdateMsgSlot:" << appWidget->dispalyName; + } +} + +void TabWid::loadingFinishedSlot() +{ + qInfo()<<"loadingFinishedSlot"; + disconnect(updateMutual->interface,SIGNAL(UpdateDetectFinished(bool,QStringList,QString,QString)),this,SLOT(slotUpdateCache(bool,QStringList,QString,QString))); +// disconnect(updateMutual->interface,SIGNAL(UpdateDetectStatusChanged(int,QString)),this,SLOT(slotUpdateCacheProgress(int,QString))); + if(updateMutual->importantList.size() == 0) + { + qInfo()<<"updateMutual software num is 0"; + checkUpdateBtn->setEnabled(true); + checkUpdateBtn->stop(); + // checkUpdateBtn->setText(tr("检查更新")); + checkUpdateBtn->setText(tr("Check Update")); + // versionInformationLab->setText(tr("您的系统已是最新!")); + version = getversion(); + versionInformationLab->setText(tr("Your system is the latest:")+version); + checkUpdateBtn->hide(); + disconnect(updateMutual->interface,SIGNAL(UpdateDownStatusChanged(QStringList,int,QString,QString)),this,SLOT(getAllProgress(QStringList,int,QString,QString))); + checkedtime = tr("No information!"); + QSqlQuery query(QSqlDatabase::database("A")); + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + } + lastRefreshTime->setText(tr("Last Checked:")+checkedtime); + lastRefreshTime->show(); + allProgressBar->hide(); + } + else + { + updateMutual->importantSize = updateMutual->importantList.size(); //此次检测结果的更新数量 + qInfo()<<"updateMutual software num is "<importantSize; + checkUpdateBtn->stop(); + checkUpdateBtn->setEnabled(true); + // checkUpdateBtn->setText(tr("全部更新")); + checkUpdateBtn->setText(tr("UpdateAll")); + checkUpdateBtn->adjustSize(); + // versionInformationLab->setText(tr("检测到你的系统有可更新的应用!")); + versionInformationLab->setText(tr("Updatable app detected on your system!")); + checkedtime = tr("No information!"); + QSqlQuery query(QSqlDatabase::database("A")); + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + } + lastRefreshTime->setText(tr("Last Checked:")+checkedtime); + systemPortraitLab->setPixmap(QPixmap(":/img/upgrade/update.png").scaled(96,96)); + } +} + +void TabWid::isCancelabled(bool status) +{ + if(status) + { +// checkUpdateBtn->setText(tr("Cancel")); + checkUpdateBtn->setEnabled(true); + } + else + { +// checkUpdateBtn->setText(tr("Cancel")); + checkUpdateBtn->setEnabled(false); + } +} + +void TabWid::showDownloadInfo(int currentserial,int total,uint downloadedsize,uint totalsize,int speed) +{ + qInfo()<<"showDownloadinfo"; + qInfo()<setText(tr("The system is downloading the update!")); + allProgressBar->setValue(Progress); + allProgressBar->show(); + lastRefreshTime->show(); + if(speed > 0) + alldownloadstart=true; + QString downloadspeed = modifySpeedUnit(speed, 1); + if(speed == 0 && !alldownloadstart) + { + lastRefreshTime->setText(tr("In the download")+":"+modifySizeUnit(downloadedsize)+"/"+modifySizeUnit(totalsize)+"("+tr("calculating")+")"); + return; + } + lastRefreshTime->setText(tr("In the download")+":"+modifySizeUnit(downloadedsize)+"/"+modifySizeUnit(totalsize)+"("+downloadspeed+")"); + checkUpdateBtn->setText(tr("Cancel")); + checkUpdateBtn->setEnabled(true); +} + +void TabWid::hideUpdateBtnSlotindownload(bool state,QStringList pkgname,QString error,QString reason) +{ + qInfo()<<"[INFO]get in the hideUpdateBtnSlotindownload fuction"; + Q_UNUSED(pkgname); + checkUpdateBtn->setEnabled(true); + checkUpdateBtn->stop(); + checkUpdateBtn->setText(tr("Check Update")); + lastRefreshTime->setText(tr("Finish the download!")); + if(state) + { + qInfo()<<"[INFO]the state is "<setText(tr("The system has download the update,and you are suggested to reboot to use the new version.")); + checkUpdateBtn->setText(tr("reboot rightnow")); + checkUpdateBtn->show(); + allProgressBar->hide(); + systemPortraitLab->setPixmap(QPixmap(":/img/upgrade/normal.png").scaled(96,96)); + } + else + { + if(error_code == "#0102") + { + qInfo()<<"Internet error"; + versionInformationLab->setText(tr("Network exception, unable to check for updates!")); + } + else if(error_code == "#0204") + { + qInfo()<<"no room to backup"; + versionInformationLab->setText(tr("No room to backup,upgrade failed.")); + checkUpdateBtn->hide(); + } + else if(error_code == "#0208") + { + qInfo()<<"low power"; + versionInformationLab->setText(tr("Battery level is below 50%,and upgrade failed.")); + checkUpdateBtn->hide(); + } + else + { + versionInformationLab->setText(tr("Update failed! ")); +// + +// tr("Error Code:") + + qInfo()<<"show error code of update1"; +// errorcodeButoon->setText(error_code); +// errorcodeButoon->show(); + checkUpdateBtn->hide(); + } + allProgressBar->hide(); + lastRefreshTime->setText(error); + } + disconnect(updateMutual->interface,SIGNAL(UpdateDownloadInfo(int,int,uint,uint,int)),this,SLOT(showDownloadInfo(int,int,uint,uint,int))); +// disconnect(updateMutual->interface,SIGNAL(UpdateDownloadFinished(bool,QStringList,QString,QString)),this,SLOT(hideUpdateBtnSlotindownload(bool,QStringList,QString,QString))); + disconnect(updateMutual->interface,SIGNAL(UpdateDownloadFinished(bool,QStringList,QString,QString)),this,SLOT(hideUpdateBtnSlotindownload(bool,QStringList,QString,QString))); + checkedtime = tr("No information!"); + QSqlQuery query(QSqlDatabase::database("A")); + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + } + lastRefreshTime->setText(tr("Last Checked:")+checkedtime); + lastRefreshTime->show(); +} + +/*静态流程函数*/ +void TabWid::ShowAdvancedOption() +{ + SetWidget *setWidget = new SetWidget(this); + setWidget->setFixedSize(setWidget->width(),setWidget->height()); + setWidget->show(); +} + +void TabWid::SecurityDownloadChange(QString button, QString content) +{ + qInfo()<<"get in SecurityDownloadChange"<setChecked(false); + DownloadHValue->setEnabled(false); + } + else + { + DownloadHBtn->setChecked(true); + DownloadHValue->setEnabled(true); + DownloadHValue->setCurrentText(content+" kB/s"); + } + connect(DownloadHBtn,&KSwitchButton::stateChanged,this,&TabWid::DownloadLimitChanged); + connect(DownloadHValue,&QComboBox::currentTextChanged,this,&TabWid::DownloadLimitValueChanged); + } +} + +void TabWid::OpenBackupTool() +{ + qInfo()<<"OpenBackupTool"; + updateMutual->interface->call("RollbackSysVersion",1,""); + KProgressDialog *dialog = new KProgressDialog(this); + dialog->setModal(true); + dialog->cancel(); + dialog->setWindowTitle("提示"); + dialog->setLabelText("版本回退中"); + dialog->setShowDetail(false); + dialog->progressBar()->hide(); + dialog->closeButton()->hide(); + dialog->show(); +} + +void TabWid::DownloadLimitChanged() +{ + qInfo()<<"DownloadLimitChanged"; + if(DownloadHBtn->isChecked() == false) + { + qInfo()<<"download limit disabled"; + DownloadHValue->setEnabled(false); + updateMutual->SetDownloadLimit(0,false); + updateMutual->insertInstallStates("download_limit","false"); + + } + else if(DownloadHBtn->isChecked() == true) + { + updateMutual->insertInstallStates("download_limit","true"); + qInfo()<<"download limit enabled"; + DownloadHValue->setEnabled(true); + QString dlimit = DownloadHValue->currentText(); + QString limit = dlimit.replace(QString(" kB/s"),""); + updateMutual->SetDownloadLimit(limit,true); + } +} + +void TabWid::isAutoUpgradeChanged() +{ + qInfo()<<"isAutoUpgradeChanged"; + bool list; + if (isAutoUpgradeSBtn->isChecked()) + { + list = true; + } + else + { + list = false; + } + updateMutual->SetAutoUpgradeState(list); +} + +void TabWid::showHistoryWidget() +{ + qInfo() << "showHistoryWidget"; + ukcc::UkccCommon::buriedSettings("Upgrade","historyLog",QString("clicked")); + historyLog = m_updatelog::GetInstance(this); + historyLog->show(); +} + +void TabWid::UpdateSdkTime(QString dateformat) +{ + qInfo()<<"UpdateSdkTime"; + QSqlQuery query(QSqlDatabase::database("A")); + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + } + lastRefreshTime->setText(tr("Last Checked:")+checkedtime); +} + +QString TabWid::getversion() +{ + QDBusInterface upgrade( "com.kylin.systemupgrade", + "/com/kylin/systemupgrade", + "com.kylin.systemupgrade.interface", + QDBusConnection::systemBus() ); + QDBusMessage upgradever = upgrade.call("GetSystemUpdateVersion"); + QString upgradeversion1 = upgradever.arguments().value(0).toString().replace("\"",""); + QString upgradeversion2 = upgradever.arguments().value(1).toString().replace("\"",""); + QString upgradeversion = QString("V10 (SP1) %1 (%2)").arg(upgradeversion1).arg(upgradeversion2); + if(upgradeversion2.isEmpty()) + { + upgradeversion = QString("V10 (SP1) %1").arg(upgradeversion1); + } + return upgradeversion; +} + +void TabWid::showUserGuide(QString programName) +{ + QString dbusName = "com.kylinUserGuide.hotel_" + QString::number(getuid()); + + QDBusInterface *serviceInterface = new QDBusInterface(dbusName,"/","com.guide.hotel",QDBusConnection::sessionBus()); + if(!serviceInterface->isValid()) + { + qDebug() << "用户手册" <<"Service Interface: " << qPrintable(QDBusConnection::sessionBus().lastError().message()); + return; + } + serviceInterface->call(QDBus::Block, "showGuide", QVariant::fromValue(QString(programName))); +} + +//转换包大小的单位 +QString TabWid::modifySizeUnit(long size) +{ + qInfo()<<"modifySizeUnit"; + double tmpSize = size/1024.0; + if(tmpSize >= 1) + { + if((tmpSize/1024.0) >= 1) + { + if((tmpSize/1024.0/1024.0) >= 1) + return QString("%1%2").arg((int)(tmpSize/1024.0/1024.0*100 + 0.5)/100.0).arg("GB");//保留小数点后两位,并四舍五入 + else + return QString("%1%2").arg((int)(tmpSize/1024.0*100 + 0.5)/100.0).arg("MB");//保留小数点后两位,并四舍五入 + } + else + return QString("%1%2").arg((int)(tmpSize*100 + 0.5)/100.0).arg("kB");//保留小数点后两位,并四舍五入 + } + else + return QString("%1%2").arg(size).arg("B"); +} + + +QString TabWid::caltime(uint downloadedsize,uint totalsize,int speed) +{ + int cha = totalsize-downloadedsize; + qInfo()<<"cha is"<= 1) + { + if((size/1024/1024) >= 1) + { + if((size/1024/1024/1024) >= 1) + return QString("%1%2").arg((int)(size/1024/1024/1024)).arg("GB/S"); + else + return QString("%1%2").arg((int)(size/1024/1024)).arg("MB/S"); + } + else + return QString("%1%2").arg((int)(size/1024)).arg("kB/S"); + } + else + return QString("%1%2").arg(size).arg("B/S"); +} + +void TabWid::isAutoCheckedChanged() //自动检测按钮绑定的槽函数 +{ + qInfo()<<"isAutoCheckedChanged"; + if(isAutoCheckSBtn->isChecked() == false) + { + updateMutual->insertInstallStates("auto_check","false"); + + } + else if(isAutoCheckSBtn->isChecked() == true) + { + updateMutual->insertInstallStates("auto_check","true"); + } +} + +TabWid::~TabWid() +{ + qInfo() << "~TabWid" ; + delete updateMutual; + updateMutual = nullptr; +} + +void TabWid::slotUpdateCacheProgress(int progress, QString status) +{ + qInfo()<<"slotUpdateCacheProgress"; + checkUpdateBtn->hide(); + isConnectSourceSignal = true; + QString updatetime = tr("No Information!"); + if (progress > 100) { + return; + } + if (lastprogress > progress) + return; + lastprogress = progress; + lastRefreshTime->hide(); + if(lastprogress==92) + { + lastprogress=0; + checkedtime = tr("No information!"); + QSqlQuery query(QSqlDatabase::database("A")); + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + } + lastRefreshTime->setText(tr("Last Checked:")+checkedtime); + } + qInfo() << "update cache progress :" << progress; + versionInformationLab->setText(tr("The system is checking update :") + QString::number(progress)+"%"); +} + + +void TabWid::getAllDisplayInformation() +{ + qInfo()<<"get in getAllDisplayInformation"; + QSqlQuery query(QSqlDatabase::database("A")); + QString updatetime; + QString checkedstatues; + QString downloadlimitstatus; + QString downloadlimitvalue; + QString allowshutdownupgradestatus; + QString time; + query.exec("select * from display"); + while(query.next()) + { + checkedtime = datetimeutils->TranslationTime(query.value("check_time").toString()); + checkedstatues = query.value("auto_check").toString(); + downloadlimitstatus = query.value("download_limit").toString(); + downloadlimitvalue = query.value("download_limit_value").toString(); + } + qInfo()<<"downloadlimitstatus:"<setText(tr("Last Checked:") + checkedtime); +// versionInformationLab->setText(tr("Last Checked:")+checkedtime); + if(checkedstatues == "false") + { + isAutoCheckSBtn->setChecked(false); + } + else + { + isAutoCheckSBtn->setChecked(true); + } + isAutoCheckSBtn->setEnabled(true); + if(downloadlimitstatus == "false") + { + qInfo()<setChecked(false); + DownloadHValue->setCurrentText(downloadlimitvalue+" kB/s"); + DownloadHValue->setEnabled(false); + } + else + { + qInfo()<setChecked(true); + DownloadHValue->setEnabled(true); + DownloadHValue->setCurrentText(downloadlimitvalue+" kB/s"); + } +} + + +void TabWid::DownloadLimitValueChanged(const QString &value) +{ + qInfo()<<"DownloadLimitValueChanged"; + ukcc::UkccCommon::buriedSettings("Upgrade", QString("DownloadHValue"), QString("select"), value); + if(DownloadHBtn->isChecked()==false) + { + updateMutual->SetDownloadLimit(0,false); + updateMutual->insertInstallStates("download_limit_value","0"); + } + else if (DownloadHBtn->isChecked()==true) + { + QString speedvalue = value; + QString limit = speedvalue.replace(" kB/s",""); + updateMutual->SetDownloadLimit(limit,true); + updateMutual->insertInstallStates("download_limit_value",limit); + } + else + { + qInfo()<<"Download Limit Changed"; + updateMutual->SetDownloadLimit(0,false); + updateMutual->insertInstallStates("download_limit_value","0"); + } +} + +void TabWid::setVisibleBySecurity() +{ + qInfo()<<"get in setVisibleBySecurity"; + // 安全管控 自动更新设置项的显示与隐藏 + QVariantMap ModuleMap = getModuleHideStatus(); + qInfo()<<"ModuleMap is "<< ModuleMap; + if(ModuleMap.isEmpty()) + return ; + QString moduleSettings = ModuleMap.value("upgradeSettings").toString(); + qInfo()<<"moduleSettings is "<< moduleSettings; + QStringList setItems = moduleSettings.split(","); + qInfo()<<"setItems is "<< setItems; + + foreach (QString setItem, setItems) { + QStringList item = setItem.split(":"); + qInfo() << "set item Name: " << item.at(0); + if (item.at(0) == "NotifyFrame") { + isAutoCheckWidget->setVisible(item.at(1) == "true"); + line12->setVisible(item.at(1) == "true"); + } + if (item.at(0) == "AutoUpdateFrame") { + isAutoUpgradeWidget->setVisible(item.at(1) == "true"); + line23->setVisible(item.at(1) == "true"); + } + if (item.at(0) == "DownloadLimitFrame") { + DownloadVWidget->setVisible(item.at(1) == "true"); +// splitHLine2->setVisible(item.at(1) == "true"); + } + if (item.at(0) == "AdvancedOptionsBtn") { + AdvancedOption->setVisible(item.at(1) == "true"); + } + } +} + +QVariantMap TabWid::getModuleHideStatus() +{ + qInfo()<<"getModuleHideStatus"; + QDBusInterface m_interface( "org.ukui.ukcc.session", + "/", + "org.ukui.ukcc.session.interface", + QDBusConnection::sessionBus()); + + QDBusReply obj_reply = m_interface.call("getModuleHideStatus"); + if (!obj_reply.isValid()) { + qInfo()<<"execute dbus method getModuleHideStatus failed"; + } + return obj_reply.value(); +} + +//void TabWid::SetInstallStatus(bool status, QString content) +//{ +// lastRefreshTime->setText(content); +//} + + +//void TabWid::dbusFinished() +//{ +// qInfo()<<"dbusFinished"; +// /*获取自动更新开关的状态*/ +// QString filename = "/var/lib/unattended-upgrades/unattended-upgrades-policy.conf"; +// QSettings *autoupgrade_allow = new QSettings(filename,QSettings::IniFormat); +// QString autoUpgradeState = +// autoupgrade_allow->value("autoUpgradePolicy/autoUpgradeState","off").toString(); +// if(!autoUpgradeState.compare("off")) +// { +// isAutoUpgradeSBtn->setChecked(false); +// } +// else if(!autoUpgradeState.compare("on")) +// { +// isAutoUpgradeSBtn->setChecked(true); +// } +// /*获取当前自动更新的状态*/ +// checkUpdateBtnClicked(); +//} diff --git a/immutable/plugin/src/tabwidget.h b/immutable/plugin/src/tabwidget.h new file mode 100644 index 0000000..df55942 --- /dev/null +++ b/immutable/plugin/src/tabwidget.h @@ -0,0 +1,300 @@ +#ifndef TABWIDGET_H +#define TABWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "appupdate.h" +#include "m_updatelog.h" +#include "ukscconn.h" +#include "checkbutton.h" +#include "AddFunction/datetimeutils.h" +#include "ukcc/widgets/switchbutton.h" +#include "ukcc/widgets/titlelabel.h" +#include "ukcc/widgets/fixlabel.h" +#include "ukcc/widgets/lightlabel.h" +#include "ukcc/interface/upgradeukcccommon.h" +#include "src/Data/global.h" +#include +#include +#include +#include +#include "SecondaryWidget/setwidget.h" + +using namespace kdk; + +#define CRUCIAL_FILE_PATH "/var/lib/kylin-software-properties/template/crucial.list" +#define IMPORTANT_FIEL_PATH "/var/lib/kylin-software-properties/template/important.list" + + +const int needBack = 99; + +const int netErrorRetry = 3; + +enum{ + UpdateAll=1, + UpdatePart, + UpdateSystem, +}; + +enum{ +// ACTION_DEFUALT_STATUS=-1, //默认状态空闲状态 +// ACTION_UPDATE, //处于更新cache状态 +// ACTION_INSTALL, //处于升级安装包括部分升级、全部升级状态 +// ACTION_INSTALL_DEB, //处于安装deb的状态 +// ACTION_CHECK_RESOLVER, //处于计算依赖过程 +// ACTION_DOWNLOADONLY, //单独下载软件包过程 +// ACTION_FIX_BROKEN, //修复依赖的过程 +// ACTION_REMOVE_PACKAGES, //卸载包的状态中 + + ACTION_DEFUALT_STATUS = -1, + ACTION_UPDATE = 0, + ACTION_DOWNLOADONLY = 1, + ACTION_DEPLOY = 2, + ACTION_ROLLBACK = 3, +}; + +class TabWid : public QWidget +{ + Q_OBJECT +public: + explicit TabWid(QWidget *parent = nullptr); + ~TabWid(); + void allComponents(); //更新页面里所有组件 + void getpkginfoFromJson(AppAllMsg *msg,QString pkgname); + void getAllDisplayInformation(); +// void allBinding(); //更新页面里所有组件绑定 + void checkUpdateBtnClicked(); //检测更新、全部更新按钮 + void updateAllApp(); + void dependencyupdateAll(bool status); + void disupdateallaccept(); + /*2309需求,海关管控项目*/ + QVariantMap getModuleHideStatus(); + void setVisibleBySecurity(); + /*2309需求,海关管控项目*/ + QString getversion(); + QString modifySpeedUnit(long size, float time); + QString modifySizeUnit(long size); + QString caltime(uint downloadedsize,uint totalsize,int speed); + QString getLanguageEnv(); + QString allLableData(bool one,QString detailinfo,uint downloadedsize,uint totalsize,int speed); + + //选项卡页面,具有更新和更新设置两个选项卡及对应界面 + QTabWidget *updateWidget; + AppUpdateWid *updatewid; + TitleLabel *labUpdate; + QWidget *updateTab; + QWidget *updateSettingTab; + QVBoxLayout *mainTabLayout; + QFont ft; + QCheckBox *isAutoCheckBox; + + //更新页面布局 + QHBoxLayout *tab1HLayout; + QFrame *systemWidget; + QVBoxLayout *AppMessage; + QScrollArea *scrollArea; + + //系统头像 + QLabel *systemPortraitLab; + m_button *checkUpdateBtn; //检测更新 + //三种状态下的版本信息 显示当前版本、可更新版本、或最新版本 + QLabel *versionInformationLab; + QWidget *versionErrorcodeLab; +// KBorderlessButton *errorcodeButoon; + QHBoxLayout* versionErrorcodeLablayout; + LightLabel *lastRefreshTime; + KProgressBar *allProgressBar; + QLabel *progressLabel; + FixLabel *detailLabel; + QPushButton *historyUpdateLog; //历史更新日志界面 + QPushButton *AdvancedOption; + QPushButton *updatedetaileInfo; + QVBoxLayout *inforLayout; + QVBoxLayout *controlLayout; + + //更新设置页面组件 + QFrame *updateSettingWidget; + TitleLabel *updateSettingLab; + QVBoxLayout *updatesettingLayout; + QFrame *isAutoCheckWidget; + QHBoxLayout *isAutoCheckLayout; + QLabel *isAutoCheckedLab; + + KSwitchButton *isAutoCheckSBtn; + //download limit widgets + QFrame *DownloadHWidget; + QFrame *DownloadVWidget; + QHBoxLayout *DownloadHLayout; + QVBoxLayout *DownloadVLayout; + QLabel *DownloadHLab; + LightLabel *DownloadVLab; + KSwitchButton *DownloadHBtn; + QComboBox *DownloadHValue; + QHBoxLayout *DownloadVLabLayout; + + QFrame *isAutoUpgradeWidget; + QVBoxLayout *isAutoUpgradeLayout; + QHBoxLayout *autoUpgradeLayout; + QHBoxLayout *autoUpgradeBtnLayout; + QLabel *isAutoUpgradeLab; + LightLabel *autoUpgradeLab; + KSwitchButton *isAutoUpgradeSBtn; + /*二選一*/ + QButtonGroup *m_pButtonGroup; + QRadioButton *poweroffUpgradeBtn; + QRadioButton *ontimeUpgradeBtn; + QComboBox *ontimeUpgradeValue; + QLabel *ontimeUpgradeLab; + QHBoxLayout *ontimeUpgradeLayout; + + /*switchbutton4*/ + QFrame *RestoreWidget; + QLabel *RestoreLabel; + QPushButton *RestoreButton; + QHBoxLayout *RestoreLayout; + + QFrame *line12; + QFrame *line23; + QFrame *line34; + + QWidget *allUpdateWid; + QVBoxLayout *allUpdateLayout; + + QList widgetList; + + bool isAllUpgrade = false; + bool isAutoUpgrade = false; + bool isContinueUpgrade = false; + bool isCancel = false; + bool alldownloadstart = false; + int inumber = 0; + int retryTimes = 0; + + bool backstatus; + + QString version; + QString checkedtime; + /*错误码机制*/ + QString error_code; + void showUserGuide(QString programName); + /*由信号或者按键弹出的弹窗*/ + m_updatelog *historyLog; + QDBusInterface * m_dateSessionDbus = nullptr; + QDBusInterface *soundplayeriface; +// QDialog *historyLog; + bool fileLockedStatus = false; //等待静默安装提示是否弹出 + UpdateDbus *updateMutual; + bool downloadFailedStatus = false; //下载失败时的弹窗是否弹出 + + /*additional function*/ + DateTimeUtils *datetimeutils; + + int allProgress = 0; + int allUpgradeNum = 0; + int lastprogress = 0; + + QFileSystemWatcher* filewatcher; + + QList pkgList; +public slots: + void ShowAdvancedOption(); + void showHistoryWidget(); + void isAutoCheckedChanged(); + void isAutoUpgradeChanged(); + void slotCancelDownload(); + void loadingOneUpdateMsgSlot(AppAllMsg msg); //逐个加载更新 + void loadingFinishedSlot(); //加载完毕信号 + + void hideUpdateBtnSlot(bool state,QStringList pkgname,QString error,QString reason); + void hideUpdateBtnSlotindownload(bool state,QStringList pkgname,QString error,QString reason); + void oneappUpdateresultSlot(bool state,QStringList pkgname,QString error,QString reason); + void shutdowninstallfinishslot(); + void allappupdatefinishSlot(); + void changeUpdateAllSlot(bool isUpdate); + void updatecancel(void); + void startoneappupdateslot(void); + + void DownloadLimitSwitchChanged(); + void DownloadLimitValueChanged(const QString &); + void DownloadLimitChanged(); + void ontimeUpgradeValueChanged(const QString &); + void getAllProgress (QStringList pkgName,int Progress,QString status,QString detailinfo); + void showDownloadInfo(int,int,uint,uint,int); + void DependResloveResult(bool ResloveStatus, bool Reslove, QStringList deletepkglist, QStringList DeletePkgDeslist,QStringList DeletePkgReasonlist,QString error, QString reason); + void InstallStatus(bool success,QString err); + void DistupgradeDependResloveResult(bool ResloveStatus, bool Reslove, QStringList deletepkglist, QStringList DeletePkgDeslist, QStringList DeletePkgReasonlist, QString error, QString reason); + //调用源管理器相关 + void slotUpdateCache(bool result,QStringList pkgname, QString error ,QString reason); + void slotUpdateCacheProgress(int progress, QString status); + /*分步更新新增函数*/ +// void SetInstallStatus(bool,QString); + /*策略下发功能*/ + void SecurityDownloadChange(QString,QString); + //解决首次运行卡顿问题 + //DBus单独初始化 + void initDbus(); + + void slotReconnTimes(int times); + + void isCancelabled(bool status); + //自动更新相关 + void progresschanged(); + /*错误码机制*/ + void GetErrorCode(bool,QString); + /*长短格式时间监听与设置*/ + + void UpdateSdkTime(QString dateformat); +private: + UKSCConn *ukscConnect; + bool isConnectSourceSignal = false; + bool distUpgradeAllApp(bool status); + + AppAllMsg appAllMsg; + + void backupMessageBox(QString str); + void backupHideUpdateBtn(int result); + + bool get_battery(); + bool autoUpdateLoadUpgradeList(bool isBackUp); +//自动更新相关 +public Q_SLOTS: + void autoupgradestatusshow(); + void autoinstallfinish(); + + +signals: + int needBackUp(); + void startBackUp(int); + +public slots: + void isAutoBackupChanged(); + void dbusFinished(); + +private slots: + void whenStateIsDuing(); + void OpenBackupTool(); +}; + +#endif // TABWIDGET_H diff --git a/immutable/plugin/src/ukcc/Label/fixlabel.cpp b/immutable/plugin/src/ukcc/Label/fixlabel.cpp new file mode 100644 index 0000000..0009c63 --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/fixlabel.cpp @@ -0,0 +1,61 @@ +/* -*- 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 "fixlabel.h" +#include +#include + +FixLabel::FixLabel(QWidget *parent): + QLabel(parent) +{ + +} + +FixLabel::FixLabel(QString text , QWidget *parent): + QLabel(parent) +{ + this->setText(text); +} + +FixLabel::~FixLabel() +{ + +} + +void FixLabel::paintEvent(QPaintEvent *event) +{ + QFontMetrics fontMetrics(this->font()); + int fontSize = fontMetrics.width(mStr); + if (fontSize > this->width()) { + this->setText(fontMetrics.elidedText(mStr, Qt::ElideRight, this->width()), false); + this->setToolTip(mStr); + } else { + this->setText(mStr, false); + this->setToolTip(""); + } + QLabel::paintEvent(event); +} + +void FixLabel::setText(const QString & text, bool saveTextFlag) +{ + if (saveTextFlag) + mStr = text; + QLabel::setText(text); +} diff --git a/immutable/plugin/src/ukcc/Label/fixlabel.h b/immutable/plugin/src/ukcc/Label/fixlabel.h new file mode 100644 index 0000000..bd4b96f --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/fixlabel.h @@ -0,0 +1,45 @@ +/* -*- 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 FIXLABEL_H +#define FIXLABEL_H +#include + +#include "../libukcc_global.h" + +//文本长自动省略并添加悬浮 +class LIBUKCC_EXPORT FixLabel : public QLabel +{ + + Q_OBJECT +public: + explicit FixLabel(QWidget *parent = nullptr); + explicit FixLabel(QString text , QWidget *parent = nullptr); + ~FixLabel(); + void setText(const QString &text, bool saveTextFlag = true); +protected: + void paintEvent(QPaintEvent *event); + +private: + QString mStr; +}; + + +#endif // FIXLABEL_H diff --git a/immutable/plugin/src/ukcc/Label/iconlabel.cpp b/immutable/plugin/src/ukcc/Label/iconlabel.cpp new file mode 100644 index 0000000..dc0eafa --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/iconlabel.cpp @@ -0,0 +1,20 @@ +#include "iconlabel.h" +#include + +IconLabel::IconLabel(QWidget *parent): + QLabel(parent) +{ + +} + +void IconLabel::enterEvent(QEvent *event){ + Q_EMIT enterWidget(); + + QLabel::enterEvent(event); +} + +void IconLabel::leaveEvent(QEvent *event){ + Q_EMIT leaveWidget(); + + QLabel::leaveEvent(event); +} diff --git a/immutable/plugin/src/ukcc/Label/iconlabel.h b/immutable/plugin/src/ukcc/Label/iconlabel.h new file mode 100644 index 0000000..6165ba4 --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/iconlabel.h @@ -0,0 +1,26 @@ +#ifndef ICONLABEL_H +#define ICONLABEL_H + +#include +#include +#include + +#include "../libukcc_global.h" + +class LIBUKCC_EXPORT IconLabel : public QLabel +{ + Q_OBJECT +public: + IconLabel(QWidget *parent = nullptr); + + +protected: + virtual void leaveEvent(QEvent * event); + virtual void enterEvent(QEvent * event); + +Q_SIGNALS: + void enterWidget(); + void leaveWidget(); +}; + +#endif // ICONLABEL_H diff --git a/immutable/plugin/src/ukcc/Label/lightlabel.cpp b/immutable/plugin/src/ukcc/Label/lightlabel.cpp new file mode 100644 index 0000000..14dd7f2 --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/lightlabel.cpp @@ -0,0 +1,27 @@ +#include "lightlabel.h" + +LightLabel::LightLabel(QWidget *parent): + FixLabel(parent) +{ + +} + +LightLabel::LightLabel(QString text , QWidget *parent): + FixLabel(parent) +{ + this->setText(text); +} + +LightLabel::~LightLabel() +{ + +} + +void LightLabel::paintEvent(QPaintEvent *event) +{ + QPalette paltte; + paltte.setColor(QPalette::WindowText, paltte.placeholderText().color()); + this->setPalette(paltte); + FixLabel::paintEvent(event); + return; +} diff --git a/immutable/plugin/src/ukcc/Label/lightlabel.h b/immutable/plugin/src/ukcc/Label/lightlabel.h new file mode 100644 index 0000000..f986ca4 --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/lightlabel.h @@ -0,0 +1,19 @@ +#ifndef LIGHTLABEL_H +#define LIGHTLABEL_H +#include +#include "../libukcc_global.h" +#include "fixlabel.h" + +class LIBUKCC_EXPORT LightLabel : public FixLabel +{ + Q_OBJECT +public: + explicit LightLabel(QWidget *parent = nullptr); + explicit LightLabel(QString text , QWidget *parent = nullptr); + ~LightLabel(); + +protected: + void paintEvent(QPaintEvent *event); +}; + +#endif // LIGHTLABEL_H diff --git a/immutable/plugin/src/ukcc/Label/titlelabel.cpp b/immutable/plugin/src/ukcc/Label/titlelabel.cpp new file mode 100644 index 0000000..6e722f5 --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/titlelabel.cpp @@ -0,0 +1,36 @@ +/* -*- 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 "titlelabel.h" +#include + +#include +#include + +TitleLabel::TitleLabel(QWidget *parent): + QLabel(parent) +{ + this->setContentsMargins(16,0,0,0); +} + +TitleLabel::~TitleLabel() +{ + +} diff --git a/immutable/plugin/src/ukcc/Label/titlelabel.h b/immutable/plugin/src/ukcc/Label/titlelabel.h new file mode 100644 index 0000000..650dc6d --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/titlelabel.h @@ -0,0 +1,36 @@ +/* -*- 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 TITLE_LABEL_H +#define TITLE_LABEL_H + +#include + +#include "../libukcc_global.h" + +class LIBUKCC_EXPORT TitleLabel : public QLabel +{ + Q_OBJECT +public: + TitleLabel(QWidget *parent = nullptr); + ~TitleLabel(); +}; + +#endif // TITLE_LABEL_H + diff --git a/immutable/plugin/src/ukcc/Label/tristatelabel.cpp b/immutable/plugin/src/ukcc/Label/tristatelabel.cpp new file mode 100644 index 0000000..bbb306e --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/tristatelabel.cpp @@ -0,0 +1,146 @@ +#include "tristatelabel.h" + +static inline qreal mixQreal(qreal a, qreal b, qreal bias) +{ + return a + (b - a) * bias; +} + +QColor mixColor(const QColor &c1, const QColor &c2, qreal bias) +{ + if (bias <= 0.0) { + return c1; + } + if (bias >= 1.0) { + return c2; + } + if (qIsNaN(bias)) { + return c1; + } + + qreal r = mixQreal(c1.redF(), c2.redF(), bias); + qreal g = mixQreal(c1.greenF(), c2.greenF(), bias); + qreal b = mixQreal(c1.blueF(), c2.blueF(), bias); + qreal a = mixQreal(c1.alphaF(), c2.alphaF(), bias); + + return QColor::fromRgbF(r, g, b, a); +} + + +TristateLabel::TristateLabel(const QString &text, QWidget *parent) +{ + setText(abridge(text)); + adjustSize(); + QPalette pal; + QBrush brush = pal.placeholderText(); + QColor textColor = brush.color(); + QString stringColor = QString("color: rgba(%1,%2,%3,%4)") + .arg(textColor.red()) + .arg(textColor.green()) + .arg(textColor.blue()) + .arg(textColor.alphaF()); + this->setStyleSheet(stringColor); + const QByteArray idd(THEME_QT_SCHEMA); + QGSettings *qtSettings = new QGSettings(idd, QByteArray(), this); + connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { + if ("styleName" == key) { + QPalette pal; + QBrush brush = pal.placeholderText(); + QColor textColor = brush.color(); + QString stringColor = QString("color: rgba(%1,%2,%3,%4)") + .arg(textColor.red()) + .arg(textColor.green()) + .arg(textColor.blue()) + .arg(textColor.alphaF()); + this->setStyleSheet(stringColor); + } + }); +} + +TristateLabel::~TristateLabel() +{ + +} + +QString TristateLabel::abridge(QString text) +{ + /* 设计要求,部分首页显示插件名和导航显示名不一致*/ + if (text == "时间和日期") { + text = "时间日期"; + } else if (text == "区域语言") { + text = "语言"; + } + + return text; +} + +void TristateLabel::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) { + + QPalette pal; + QBrush brush = pal.placeholderText(); + QColor textColor = brush.color(); + QPushButton *button = new QPushButton; + QColor highlight = button->palette().color(QPalette::Active, QPalette::Highlight); + QColor mix = button->palette().color(QPalette::Active, QPalette::BrightText); + textColor = mixColor(highlight, mix, 0.2); + QString stringColor = QString("color: rgba(%1,%2,%3,%4)") + .arg(textColor.red()) + .arg(textColor.green()) + .arg(textColor.blue()) + .arg(textColor.alphaF()); + this->setStyleSheet(stringColor); + mClicked = true; + } +} + +void TristateLabel::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) { + mClicked = false; + QPalette pal; + QBrush brush = pal.placeholderText(); + QColor textColor = brush.color(); + QString stringColor = QString("color: rgba(%1,%2,%3,%4)") + .arg(textColor.red()) + .arg(textColor.green()) + .arg(textColor.blue()) + .arg(textColor.alphaF()); + this->setStyleSheet(stringColor); + emit clicked(); + } +} + +void TristateLabel::enterEvent(QEvent *e) +{ + Q_UNUSED(e) + QPalette pal; + QBrush brush = pal.placeholderText(); + QColor textColor = brush.color(); + QPushButton *button = new QPushButton; + QColor highlight = button->palette().color(QPalette::Active, QPalette::Highlight); + QColor mix = button->palette().color(QPalette::Active, QPalette::BrightText); + textColor = mixColor(highlight, mix, 0.05); + QString stringColor = QString("color: rgba(%1,%2,%3,%4)") + .arg(textColor.red()) + .arg(textColor.green()) + .arg(textColor.blue()) + .arg(textColor.alphaF()); + this->setStyleSheet(stringColor); + mMoved = true; +} +void TristateLabel::leaveEvent(QEvent *e) +{ + Q_UNUSED(e) + mMoved = false; + QPalette pal; + QBrush brush = pal.placeholderText(); + QColor textColor = brush.color(); + QString stringColor = QString("color: rgba(%1,%2,%3,%4)") + .arg(textColor.red()) + .arg(textColor.green()) + .arg(textColor.blue()) + .arg(textColor.alphaF()); + this->setStyleSheet(stringColor); +} + diff --git a/immutable/plugin/src/ukcc/Label/tristatelabel.h b/immutable/plugin/src/ukcc/Label/tristatelabel.h new file mode 100644 index 0000000..006dddf --- /dev/null +++ b/immutable/plugin/src/ukcc/Label/tristatelabel.h @@ -0,0 +1,36 @@ +#ifndef TRISTATELABEL_H +#define TRISTATELABEL_H + +#include +#include +#include +#include + +#define THEME_QT_SCHEMA "org.ukui.style" +#define MODE_QT_KEY "style-name" + +class TristateLabel : public QLabel +{ + Q_OBJECT + +public: + TristateLabel(const QString &text, QWidget *parent); + ~TristateLabel(); + + QString abridge(QString text); // 简写英文多长的应用名称 + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); + +protected: + void mousePressEvent(QMouseEvent * event); + void mouseReleaseEvent(QMouseEvent *event); + +private: + bool mMoved = false; + bool mClicked = false; + +signals: + void clicked(); +}; + +#endif // TRISTATELABEL_H diff --git a/immutable/plugin/src/ukcc/SwitchButton/switchbutton.cpp b/immutable/plugin/src/ukcc/SwitchButton/switchbutton.cpp new file mode 100644 index 0000000..6d79dab --- /dev/null +++ b/immutable/plugin/src/ukcc/SwitchButton/switchbutton.cpp @@ -0,0 +1,326 @@ +/* -*- 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 "switchbutton.h" + +#include +#define THEME_QT_SCHEMA "org.ukui.style" +#define THEME_GTK_SCHEMA "org.mate.interface" +#define TIMER_INTERVAL 5 //每隔5ms动画移动一次 +#define MOVING_STEPS 40 //动画总共移动40次 + +SwitchButton::SwitchButton(QWidget *parent) : + QWidget(parent) +{ +// this->resize(QSize(52, 24)); + this->setFixedSize(QSize(50, 24)); + + checked = false; + hover = false; + disabled = false; + isMoving = false; + isAnimation = true; + + space = 4; + rectRadius = height()/2; + + mStep = width()/MOVING_STEPS;//也就是40次动画就可以走完,每次时间间隔是固定的5ms + mStartX = 0; + mEndX= 0; + + mTimer = new QTimer(this); + mTimer->setInterval(TIMER_INTERVAL);//动画更新时间 + connect(mTimer, SIGNAL(timeout()), this, SLOT(updatevalue())); + if(QGSettings::isSchemaInstalled(THEME_GTK_SCHEMA) && QGSettings::isSchemaInstalled(THEME_QT_SCHEMA)) { + QByteArray qtThemeID(THEME_QT_SCHEMA); + QByteArray gtkThemeID(THEME_GTK_SCHEMA); + + m_gtkThemeSetting = new QGSettings(gtkThemeID,QByteArray(),this); + m_qtThemeSetting = new QGSettings(qtThemeID,QByteArray(),this); + + QString style = m_qtThemeSetting->get("styleName").toString(); + changeColor(style); + + connect(m_qtThemeSetting,&QGSettings::changed, [this] (const QString &key) { + QString style = m_qtThemeSetting->get("styleName").toString(); + if (key == "styleName") { + changeColor(style); + } + }); + } +} + +SwitchButton::~SwitchButton() +{ +} + +void SwitchButton::paintEvent(QPaintEvent *){ + + QPainter painter(this); + //启用反锯齿 + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setCompositionMode(QPainter::CompositionMode_Source); + drawBg(&painter); + if(!isAnimation)//动画如果禁用,则圆形滑块isMoving始终为false + isMoving =false; + if(isMoving) + animation(&painter); + drawSlider(&painter); + painter.end(); +} + +void SwitchButton::changeColor(const QString &themes) { + if (hover) { + return ;//在鼠标下,禁止切换颜色鼠标离开时切换颜色 + } + if (themes == "ukui-dark" || themes == "ukui-black") { + bgColorOff = QColor(OFF_BG_DARK_COLOR); + bgColorOn = QColor(ON_BG_DARK_COLOR); + rectColorEnabled = QColor(ENABLE_RECT_DARK_COLOR); + rectColorDisabled = QColor(DISABLE_RECT_DARK_COLOR); + sliderColorDisabled = QColor(DISABLE_RECT_DARK_COLOR); + sliderColorEnabled = QColor(ENABLE_RECT_DARK_COLOR); + bgHoverOnColor = QColor(ON_HOVER_BG_DARK_COLOR); + bgHoverOffColor = QColor(OFF_HOVER_BG_DARK_COLOR); + bgColorDisabled = QColor(DISABLE_DARK_COLOR); + } else { + bgColorOff = QColor(OFF_BG_LIGHT_COLOR); + bgColorOn = QColor(ON_BG_LIGHT_COLOR); + rectColorEnabled = QColor(ENABLE_RECT_LIGHT_COLOR); + rectColorDisabled = QColor(DISABLE_RECT_LIGHT_COLOR); + sliderColorDisabled = QColor(DISABLE_RECT_LIGHT_COLOR); + sliderColorEnabled = QColor(ENABLE_RECT_LIGHT_COLOR); + bgHoverOnColor = QColor(ON_HOVER_BG_LIGHT_COLOR); + bgHoverOffColor = QColor(OFF_HOVER_BG_LIGHT_COLOR); + bgColorDisabled = QColor(DISABLE_LIGHT_COLOR); + } +} + +//动画绘制 +void SwitchButton::animation(QPainter *painter){ + painter->save(); + int h = height(); + int w = width(); + painter->setPen(Qt::NoPen); + //颜色设置 + if(checked){ + //开关在左侧时 + painter->setBrush(bgColorOn); + rect.setRect(0,0,h+mStartX,h); + }else{ + painter->setBrush(bgColorOff); + rect.setRect(mStartX,0,w-mStartX,h); + } + painter->drawRoundedRect(rect,rectRadius,rectRadius); + + painter->restore(); +} + +//绘制背景 +void SwitchButton::drawBg(QPainter *painter){ + int w = width(); + int h = height(); + painter->save(); + painter->setPen(Qt::NoPen); + if (disabled) { + painter->setPen(Qt::NoPen); + painter->setBrush(bgColorDisabled); + } else { + if(checked){ + if(isMoving){ + painter->setBrush(bgColorOff); + rect.setRect(mStartX,0,w-mStartX,h); + }else { + painter->setBrush(bgColorOn); + rect.setRect(0, 0, w, h); + } + }else{ + if(isMoving){ + painter->setBrush(bgColorOn); + rect.setRect(0,0,mStartX+h,h); + } + else { + painter->setBrush(bgColorOff); + rect.setRect(0, 0, w, h); + } + } + } + //半径为高度的一半 + painter->drawRoundedRect(rect,rectRadius,rectRadius); + + painter->restore(); +} + +//绘制滑块,也就是圆形按钮 +void SwitchButton::drawSlider(QPainter *painter){ + painter->save(); + painter->setPen(Qt::NoPen); + + if (!disabled){ + painter->setBrush(sliderColorEnabled); + } + else + painter->setBrush(sliderColorDisabled); + if (disabled) { + if (!checked){ + QRect smallRect(8, height() / 2 - 2, 10 , 4); + painter->drawRoundedRect(smallRect,3,3); + }else{ + QRect smallRect(width() - 8 * 2, height() / 2 - 2, 10 , 4); + painter->drawRoundedRect(smallRect,3,3); + } + } + + QRect rect(0, 0, width(), height()); + int sliderWidth = rect.height() - space * 2; + QRect sliderRect(mStartX + space, space, sliderWidth, sliderWidth); + painter->drawEllipse(sliderRect); + + painter->restore(); +} + +void SwitchButton::mousePressEvent(QMouseEvent *){ + qDebug()<start(); + isMoving = true; + } +} + +void SwitchButton::resizeEvent(QResizeEvent *){ + //每次开始的x坐标都是跳过圆角,从直线的地方开始计算 + mStep = width() / MOVING_STEPS; + + if (checked){ + //circle out +// startX = width() - height() + space; + //circle in + mStartX = width() - height(); + } + else + mStartX = 0; + + rectRadius = height()/2; + update(); +} +void SwitchButton::enterEvent(QEvent *event) { + bgColorOn = bgHoverOnColor; + bgColorOff = bgHoverOffColor; + + hover = true; + update(); + return QWidget::enterEvent(event); +} + +void SwitchButton::leaveEvent(QEvent *event) { + hover = false; + + QString style = m_qtThemeSetting->get("styleName").toString(); + changeColor(style); + + update(); + return QWidget::leaveEvent(event); +} + +//根据事件向左还是向右移动 +void SwitchButton::updatevalue(){ + if (checked) + if (mStartX < mEndX-mStep){ + mStartX = mStartX + mStep; + } + else{ + mStartX = mEndX; + mTimer->stop(); + isMoving = false; + } + else{ + if (mStartX > mEndX+mStep){ + mStartX = mStartX - mStep; + } + else{ + mStartX = mEndX; + mTimer->stop(); + isMoving = false; + } + } + update(); +} + +void SwitchButton::setChecked(bool checked){ + if (this->checked != checked){ + this->checked = checked; + Q_EMIT checkedChanged(checked); + update(); + } + + mStep = width() / MOVING_STEPS; + + if (checked){ + //circle out +// endX = width() - height() + space; + //circle in + mEndX = width() - height(); + } + else{ + mEndX = 0; + } + mTimer->start(); + isMoving = true; +} + +bool SwitchButton::isChecked(){ + return this->checked; +} + +void SwitchButton::setDisabledFlag(bool value) +{ + disabled = value; + update(); +} + +bool SwitchButton::getDisabledFlag() +{ + return disabled; +} + +void SwitchButton::setAnimation(bool on){ + isAnimation = on; +} + diff --git a/immutable/plugin/src/ukcc/SwitchButton/switchbutton.h b/immutable/plugin/src/ukcc/SwitchButton/switchbutton.h new file mode 100644 index 0000000..a125741 --- /dev/null +++ b/immutable/plugin/src/ukcc/SwitchButton/switchbutton.h @@ -0,0 +1,122 @@ +/* -*- 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 SWITCHBUTTON_H +#define SWITCHBUTTON_H + +#include +#include +#include +#include +#include +#include + +#include "../libukcc_global.h" + +#define OFF_BG_DARK_COLOR "#404040" +#define OFF_HOVER_BG_DARK_COLOR "#666666" +#define ON_BG_DARK_COLOR "#3790FA" +#define ON_HOVER_BG_DARK_COLOR "#40A9FB" +#define DISABLE_DARK_COLOR "#474747" +#define DISABLE_RECT_DARK_COLOR "#6E6E6E" +#define ENABLE_RECT_DARK_COLOR "#FFFFFF" + +#define OFF_BG_LIGHT_COLOR "#E0E0E0" +#define OFF_HOVER_BG_LIGHT_COLOR "#B3B3B3" +#define ON_BG_LIGHT_COLOR "#3790FA" +#define ON_HOVER_BG_LIGHT_COLOR "#40A9FB" +#define DISABLE_LIGHT_COLOR "#E9E9E9" +#define DISABLE_RECT_LIGHT_COLOR "#B3B3B3" +#define ENABLE_RECT_LIGHT_COLOR "#FFFFFF" + + +class LIBUKCC_EXPORT SwitchButton : public QWidget +{ + Q_OBJECT + +public: + SwitchButton(QWidget *parent = 0); + ~SwitchButton(); + + void setChecked(bool checked); + void setAnimation(bool on); + + bool isChecked(); + void setDisabledFlag(bool); + bool getDisabledFlag(); +protected: + void mousePressEvent(QMouseEvent *); + void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *); + void enterEvent(QEvent *event); + void leaveEvent(QEvent *event); + + void drawBg(QPainter * painter); + void drawSlider(QPainter * painter); + void changeColor(const QString &themes); + +private: + bool checked; //切换的判断 + bool disabled; + + void animation(QPainter *painter); + QRect rect; + bool isMoving; //滑块动作判断 + bool isAnimation; // 是否允许动画执行 + + QColor bgColorOff; + QColor bgColorOn; + QColor bgHoverOnColor; + QColor bgHoverOffColor; + QColor bgColorDisabled; + + QColor sliderColorEnabled; + QColor sliderColorDisabled; + + + QColor rectColorEnabled; + QColor rectColorDisabled; + + QColor sliderColorOff; + QColor sliderColorOn; + QGSettings *m_qtThemeSetting; + QGSettings *m_gtkThemeSetting; + + int space; //滑块离背景间隔 + int rectRadius; //圆角角度 + + int mStep; //移动步长 + int mStartX; + int mEndX; + + bool hover; + QTimer * mTimer; + + +private Q_SLOTS: + void updatevalue(); + + +Q_SIGNALS: + void checkedChanged(bool checked); + void disabledClick(); + +}; + +#endif // SWITCHBUTTON_H diff --git a/immutable/plugin/src/ukcc/interface.h b/immutable/plugin/src/ukcc/interface.h new file mode 100644 index 0000000..22a235f --- /dev/null +++ b/immutable/plugin/src/ukcc/interface.h @@ -0,0 +1,76 @@ +/* -*- 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 INTERFACE_H +#define INTERFACE_H + +#include +#include + +#include "libukcc_global.h" + +class QString; +class QWidget; +class QStringLiteral; + +enum FunType{ + SYSTEM, + DEVICES, + NETWORK, + PERSONALIZED, + ACCOUNT, + DATETIME, + UPDATE, + SECURITY, + APPLICATION, + SEARCH_F, + COMMONINFO, + TOTALMODULES, +}; + +class LIBUKCC_EXPORT CommonInterface{ +public: + virtual ~CommonInterface(){} + virtual QString plugini18nName() = 0; // 插件名字 + virtual int pluginTypes() = 0; // 插件类型 + virtual QWidget * pluginUi() = 0; // 插件主界面 + virtual bool isShowOnHomePage() const = 0; // 是否显示在首页 + virtual QIcon icon() const = 0; // 图标 + virtual bool isEnable() const = 0; // 插件是否启用 + virtual const QString name() const = 0; // 模块名称 + virtual QString translationPath() const { // 获取多语言文件路径,用于搜索 + return QStringLiteral(":/i18n/%1.ts"); + } + QPushButton *pluginBtn = nullptr; + + bool isIntel(){ + QString sysVersion = "/etc/apt/ota_version"; + QFile file(sysVersion); + return file.exists(); + } + virtual void plugin_leave() { + return ; + } +}; + +#define CommonInterface_iid "org.ukcc.CommonInterface" + +Q_DECLARE_INTERFACE(CommonInterface, CommonInterface_iid) + +#endif // INTERFACE_H diff --git a/immutable/plugin/src/ukcc/interface/interface.h b/immutable/plugin/src/ukcc/interface/interface.h new file mode 100644 index 0000000..36d2576 --- /dev/null +++ b/immutable/plugin/src/ukcc/interface/interface.h @@ -0,0 +1,76 @@ +/* -*- 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 INTERFACE_H +#define INTERFACE_H + +#include +#include + +#include "libukcc_global.h" + +class QString; +class QWidget; +class QStringLiteral; + +enum FunType { + ACCOUNT, + SYSTEM, + DEVICES, + NETWORK, + PERSONALIZED, + DATETIME, + UPDATE, + SECURITY, + APPLICATION, + SEARCH_F, + COMMONINFO, + TOTALMODULES, +}; + +class LIBUKCC_EXPORT CommonInterface{ +public: + virtual ~CommonInterface(){} + virtual QString plugini18nName() = 0; // 插件名字 + virtual int pluginTypes() = 0; // 插件类型 + virtual QWidget * pluginUi() = 0; // 插件主界面 + virtual bool isShowOnHomePage() const = 0; // 是否显示在首页 + virtual QIcon icon() const = 0; // 图标 + virtual bool isEnable() const = 0; // 插件是否启用 + virtual const QString name() const = 0; // 模块名称 + virtual QString translationPath() const { // 获取多语言文件路径,用于搜索 + return QStringLiteral("/usr/share/ukui-control-center/shell/res/i18n/%1.ts"); + } + QPushButton *pluginBtn = nullptr; + + bool isIntel(){ + QString sysVersion = "/etc/apt/ota_version"; + QFile file(sysVersion); + return file.exists(); + } + virtual void plugin_leave() { + return ; + } +}; + +#define CommonInterface_iid "org.ukcc.CommonInterface" + +Q_DECLARE_INTERFACE(CommonInterface, CommonInterface_iid) + +#endif // INTERFACE_H diff --git a/immutable/plugin/src/ukcc/interface/libukcc_global.h b/immutable/plugin/src/ukcc/interface/libukcc_global.h new file mode 100644 index 0000000..14b895b --- /dev/null +++ b/immutable/plugin/src/ukcc/interface/libukcc_global.h @@ -0,0 +1,12 @@ +#ifndef LIBUKCC_GLOBAL_H +#define LIBUKCC_GLOBAL_H + +#include + +#if defined(LIBUKCC_LIBRARY) +# define LIBUKCC_EXPORT Q_DECL_EXPORT +#else +# define LIBUKCC_EXPORT Q_DECL_IMPORT +#endif + +#endif // LIBUKCC_GLOBAL_H diff --git a/immutable/plugin/src/ukcc/interface/upgradeukcccommon.cpp b/immutable/plugin/src/ukcc/interface/upgradeukcccommon.cpp new file mode 100644 index 0000000..cd8df93 --- /dev/null +++ b/immutable/plugin/src/ukcc/interface/upgradeukcccommon.cpp @@ -0,0 +1,366 @@ +/* -*- 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 "upgradeukcccommon.h" + +#include +#include +#include +#include +#include +#include +#include +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 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 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 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(); + qInfo()<= 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 res = ifc.call("getDmiDecodeRes", "-s system-product-name"); + return res.value().trimmed(); +} diff --git a/immutable/plugin/src/ukcc/interface/upgradeukcccommon.h b/immutable/plugin/src/ukcc/interface/upgradeukcccommon.h new file mode 100644 index 0000000..782b1b1 --- /dev/null +++ b/immutable/plugin/src/ukcc/interface/upgradeukcccommon.h @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 diff --git a/immutable/plugin/src/ukcc/libukcc_global.h b/immutable/plugin/src/ukcc/libukcc_global.h new file mode 100644 index 0000000..14b895b --- /dev/null +++ b/immutable/plugin/src/ukcc/libukcc_global.h @@ -0,0 +1,12 @@ +#ifndef LIBUKCC_GLOBAL_H +#define LIBUKCC_GLOBAL_H + +#include + +#if defined(LIBUKCC_LIBRARY) +# define LIBUKCC_EXPORT Q_DECL_EXPORT +#else +# define LIBUKCC_EXPORT Q_DECL_IMPORT +#endif + +#endif // LIBUKCC_GLOBAL_H diff --git a/plugin/src/ukscconn.cpp b/immutable/plugin/src/ukscconn.cpp similarity index 100% rename from plugin/src/ukscconn.cpp rename to immutable/plugin/src/ukscconn.cpp diff --git a/plugin/src/ukscconn.h b/immutable/plugin/src/ukscconn.h similarity index 100% rename from plugin/src/ukscconn.h rename to immutable/plugin/src/ukscconn.h diff --git a/immutable/plugin/src/updatedbus.cpp b/immutable/plugin/src/updatedbus.cpp new file mode 100644 index 0000000..e102922 --- /dev/null +++ b/immutable/plugin/src/updatedbus.cpp @@ -0,0 +1,164 @@ +#include "updatedbus.h" +#include "connection.h" +#include +#define PROGRAM_NAME "control-upgrade" +#define PATH_MAX_LEN 1024 +#define PID_STRING_LEN 64 + +UpdateDbus* UpdateDbus::updateMutual = nullptr; +using namespace std; + +UpdateDbus* UpdateDbus::getInstance(QObject *parent) +{ + static QMutex mutex; + if(nullptr == updateMutual) + { + QMutexLocker locker(&mutex); + updateMutual = new UpdateDbus(parent); + } + return updateMutual; +} + +UpdateDbus::UpdateDbus(QObject *parent) + :QObject(parent) +{ + qRegisterMetaType("AppMsg"); //注册信号槽类型 + qRegisterMetaType("AppAllMsg"); //注册信号槽类型 + strategy_interface = new QDBusInterface("com.kylin.UpgradeStrategies", + "/com/kylin/UpgradeStrategies", + "com.kylin.UpgradeStrategies.interface", + QDBusConnection::systemBus()); + interface = new QDBusInterface("com.kylin.systemupgrade", + "/com/kylin/systemupgrade", + "com.kylin.systemupgrade.interface", + QDBusConnection::systemBus()); + qDebug() << "interface 成功"; + emit startDbusFinished(); +} + +bool UpdateDbus::UpgradeAll() +{ + interface->asyncCall("UpdateDownloadAll"); + return true; +} + + + + + + +void UpdateDbus::SetDownloadLimit(QString value,bool whetherlimit) +{ + interface->call("SetDownloadspeedMax",value,whetherlimit); +} + +void UpdateDbus::SetAutoUpgrade(bool gs,bool allow) +{ + if(allow) + interface->call("GetSetDatabaseInfo",gs,"display","autoupdate_allow=true"); + else + interface->call("GetSetDatabaseInfo",gs,"display","autoupdate_allow=false"); +} + +void UpdateDbus::SetAutoUpgradeState(bool allow) +{ + strategy_interface->call("SetAutoUpgradeState",allow); +} + +QString UpdateDbus::GetAutoUpgrade(bool gs) +{ + QDBusPendingReply reply = interface->call("GetSetDatabaseInfo",gs,"display","autoupdate_allow"); + return reply; +} + +int UpdateDbus::GetDownloadLimit(void) +{ + QDBusPendingReply reply = interface->call("GetDownloadspeedLimitValue"); + if (!reply.isValid()) + { + qDebug()<<"error getting download speed limit value"; + return -1; + } + if (reply.argumentAt(0)==true) + { + return reply.argumentAt(1).toInt(); + } + else + { + return -2; + } +} + +void UpdateDbus::onRequestSendDesktopNotify(QString message) +{ + qInfo()<<"get in onRequestSendDesktopNotify fuction"; + QDBusInterface iface("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + QDBusConnection::sessionBus()); + if (!notifyMsg.compare(message)) { + return ; + } + QDBusInterface upgrade_interface( "com.kylin.systemupgrade", + "/com/kylin/systemupgrade", + "com.kylin.systemupgrade.interface", + QDBusConnection::systemBus() ); + QDBusMessage modelist = upgrade_interface.call("GetConfigValue","InstallMode","shutdown_install"); + QString mode =modelist.arguments().value(1).toString(); + qInfo()<<"[INFO]the mode is "< args; + QVariantMap hints; + hints.insert("sound-name","Complete"); + args<<(tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + <asyncCall("DistUpgradePartial",status,pkgName); + return true; +} + +bool UpdateDbus::DistUpgradeSystem(bool status) +{ + interface->asyncCall("DistUpgradeSystem",status); + return true; +} + +bool UpdateDbus::CancelDownload() +{ + interface->asyncCall("CancelDownload"); + return true; +} + +void UpdateDbus::callDBusUpdateSource() +{ + QDBusPendingCall call = interface->asyncCall("UpdateDetect"); + if (call.isValid()) { + qDebug() << "UpdateDetect 失败"; + } + qDebug() << "源管理器:" <<"Call updateSourcePackages" ; +} + +void UpdateDbus::insertInstallStates(QString item, QString info) +{ + interface->asyncCall("InsertInstallState",item,info); +} + +UpdateDbus::~UpdateDbus() +{ +} diff --git a/immutable/plugin/src/updatedbus.h b/immutable/plugin/src/updatedbus.h new file mode 100644 index 0000000..4a0f2bd --- /dev/null +++ b/immutable/plugin/src/updatedbus.h @@ -0,0 +1,132 @@ +#ifndef UPDATEDBUS_H +#define UPDATEDBUS_H + +#define KYLIN_SYSTEM_UPGRADE_PATH "/com/kylin/systemupgrade" + +#define KYLIN_SYSTEM_UPGRADE_SERVICE "com.kylin.systemupgrade" + +#define KYLIN_SYSTEM_UPGRADE_INTERFACE "com.kylin.systemupgrade.interface" + +//#define SERVICE_NAME_SIZE 30 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include +#include + + +//Q_DECLARE_METATYPE(AppAllMsg) //注册AppMsg结构用于信号槽传输 + +class UpdateDbus : public QObject +{ + Q_OBJECT +public: + static UpdateDbus *getInstance(QObject *parenet = nullptr); + ~UpdateDbus(); + QDBusInterface *strategy_interface;//策略下发dbus接口 + QDBusInterface *interface; //dbus接口 + QDBusReply replyStr; //string类型的返回值 + QDBusReply replyBool; //bool类型的返回值 + QDBusReply replyStrList; + QDBusReply replyInt; //int类型的返回值 + QDBusInterface *interface1; + + void callDBusUpdateSource(); + //拷贝软件包到安装目录 + void copyFinsh(QStringList srcPath,QString appName); + //创建root目录 + bool makeDirs(QString path); + // setImportantStatus + void setImportantStatus(bool status); + //检查列表中的包是否可升级 + QStringList checkInstallOrUpgrade(QStringList list); + + void getAppMessage(QStringList list); + //安装和升级 + bool installAndUpgrade(QString pkgName); + bool DistUpgradeAll(bool status); + bool DistUpgradePartial(bool status,QString pkgName); + bool DistUpgradeSystem(bool status); + bool CancelDownload(); + bool UpgradeAll(); + + //修改配置文件 + void modifyConf(QString path,QString group,QString key,QString value); + //kill pid + void cleanUpdateList(); + //初始化cache + void init_cache(); +// bool makeDirs(QString path); +//dbus接口函数定义完毕 + // + void SetAutoUpgradeState(bool); + void SetDownloadLimit(QString,bool); + void SetAutoUpgrade(bool,bool); + QString GetAutoUpgrade(bool); + int GetDownloadLimit(void); + void onRequestSendDesktopNotify(QString message); + QStringList inameList; //重要更新列表 + QStringList importantList; + QStringList failedList; + int importantSize = 0; + bool isPointOutNotBackup = true; //是否在单包更新时弹出提示未备份 + + QString notifyMsg = ""; + + + bool fileLock(); + void fileUnLock(); + //调用接口插入数据库 + void insertInstallStates(QString item, QString info); +signals: + void copyFinish(QString appName); + void transferAptProgress(QString status,QString appName,float aptPercent,QString errormsg); + void sendImportant(); + void sendAppMessageSignal(AppAllMsg msg); +// void emitInameList(QStringList list); + void sendFinishGetMsgSignal(int size); + void sendUpdateSize(long size); + void startDbusFinished(); +public slots: + void getAptSignal(QString arg, QMap map); + void slotCopyFinished(QString appName); + void getInameAndCnameList(QString arg); //获取重要更新列表和紧急更新列表 +// void initD_bus(bool status); + void getAppMessageSignal(QMap map, QStringList urlList, QStringList nameList,QStringList fullnameList,QStringList sizeList, QString allSize, bool dependState); + void slotFinishGetMessage(QString num); + +private: + explicit UpdateDbus(QObject *parent = nullptr); + static UpdateDbus *updateMutual; //UpdateDbus类静态对象 + QString lockPath = "/tmp/lock/kylin-update.lock"; +}; + + +#endif // UPDATEDBUS_H diff --git a/immutable/plugin/src/updatelog.cpp b/immutable/plugin/src/updatelog.cpp new file mode 100644 index 0000000..0a9e203 --- /dev/null +++ b/immutable/plugin/src/updatelog.cpp @@ -0,0 +1,85 @@ +#include "updatelog.h" + + +UpdateLog::UpdateLog(QWidget *parent) : QDialog(parent) +{ + MotifWmHints hints; + hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + hints.functions = MWM_FUNC_ALL; + hints.decorations = MWM_DECOR_BORDER; + XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints); + + logUi(); + +} +void UpdateLog::logUi() +{ +// this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); +// this->setAttribute(Qt::WA_TranslucentBackground, true); + + this->setFixedSize(460,560); + if(QLocale::system().name()!="zh_CN") + { + this->setWindowTitle(tr("Update log")); + } + else + { + this->setWindowTitle("更新日志"); + } +// this->setWindowTitle("更新日志"); + + logVLayout = new QVBoxLayout(); + logMainLayout = new QVBoxLayout(); + + logAppHLayout = new QHBoxLayout(); + logAppVLayout = new QVBoxLayout(); + + logAppIcon = new QLabel(this); + logAppIcon->setFixedSize(48,48); + + logAppName = new QLabel(this); + logAppVerson = new QLabel(this); + + logWidget = new QWidget(this); + logAppWidget = new QWidget(this); + + + logContent = new QTextEdit(this); + QPalette pl = logContent->palette(); + pl.setBrush(QPalette::Base,QBrush(QColor(255,0,0,0))); + logContent->setPalette(pl); + contentFrame = new QFrame(this); + contentFrame->setFrameShape(QFrame::Box); + QVBoxLayout *contentLayout = new QVBoxLayout(); + contentFrame->setLayout(contentLayout); + contentLayout->addWidget(logContent); + contentLayout->setMargin(0); + contentLayout->setSpacing(0); + logContent->setReadOnly(true); + + logAppVLayout->addWidget(logAppName); + logAppVLayout->addWidget(logAppVerson); + logAppVLayout->setMargin(0); + logAppVLayout->setSpacing(0); + logAppHLayout->addWidget(logAppIcon); + logAppHLayout->addLayout(logAppVLayout); + logAppHLayout->setMargin(0); + logAppHLayout->setSpacing(8); + logAppWidget->setLayout(logAppHLayout); + + logVLayout->addWidget(logAppWidget); + logVLayout->addSpacing(12); + logVLayout->addWidget(contentFrame); + logVLayout->setContentsMargins(24,0,24,24); + logVLayout->setSpacing(0); + logWidget->setLayout(logVLayout); + + + logMainLayout->addWidget(logWidget); + logMainLayout->setMargin(5); + logMainLayout->setSpacing(0); + + + this->setLayout(logMainLayout); +} + diff --git a/immutable/plugin/src/updatelog.h b/immutable/plugin/src/updatelog.h new file mode 100644 index 0000000..8a6bd7c --- /dev/null +++ b/immutable/plugin/src/updatelog.h @@ -0,0 +1,44 @@ +#ifndef UPDATELOG_H +#define UPDATELOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xatom-helper.h" + + +class UpdateLog : public QDialog +{ + Q_OBJECT +public: + explicit UpdateLog(QWidget *parent = nullptr); + + void logUi(); + + QLabel *logAppIcon; + QLabel *logAppName; + QLabel *logAppVerson; + + QWidget *logWidget; + QWidget *logAppWidget; + + QHBoxLayout *logAppHLayout; + QVBoxLayout *logAppVLayout; + QVBoxLayout *logVLayout; + QVBoxLayout *logMainLayout; + + QTextEdit *logContent; + QFrame *contentFrame; + +// void paintEvent(QPaintEvent *); +}; + + + +#endif // UPDATELOG_H diff --git a/immutable/plugin/src/upgrademain.cpp b/immutable/plugin/src/upgrademain.cpp new file mode 100644 index 0000000..2378248 --- /dev/null +++ b/immutable/plugin/src/upgrademain.cpp @@ -0,0 +1,225 @@ +/* + * Copyright (C) 2020, KylinSoft 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 3 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, see . + */ + +#include "upgrademain.h" + +#include +#include +#include +#include +#ifdef KYDEBUG +#ifndef __sw_64__ +#include +#endif +#endif + +#define PROGRAM_NAME "kylin-update-frontend" +static FILE *fp = NULL; + +void msgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); +void log_env_init(); + + + +UpgradeMain::UpgradeMain(QString arg,QWidget *parent) + : QMainWindow(parent) +{ +// log_env_init(); +// qInstallMessageHandler(msgHandler); + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + + if(!CreatConnection()) + { + qInfo() << "datebase can not open."; + } + + // 用户手册功能 + mDaemonIpcDbus = new DaemonIpcDbus(); + + // 初始化组件 + setWidgetUi(); + + //初始化DBus + QTimer *timer = new QTimer; + timer->setSingleShot(true); + connect(timer,&QTimer::timeout,myTabwidget,&TabWid::initDbus); + timer->start(100); + qInfo()<<"start to connect dbus"; +} + +UpgradeMain::~UpgradeMain() +{ +// qInfo() << "quit mainwindow"; +} + +// 初始化组件 +void UpgradeMain::setWidgetUi() +{ + // 整体界面widget + mainWid = new QWidget(this); + + // 整体界面布局 + mainLayout = new QVBoxLayout(); + + // 设置整体界面布局 + mainLayout->setMargin(0); + mainLayout->setSpacing(0); + myTabwidget = new TabWid(this); + mainLayout->addWidget(myTabwidget); + + this->mainWid->setLayout(mainLayout); + // 将mainWid作为整体界面 + this->setCentralWidget(mainWid); +} + +// 实现键盘响应 +void UpgradeMain::keyPressEvent(QKeyEvent *event) +{ + // F1快捷键打开用户手册 + if (event->key() == Qt::Key_F1) { + if (!mDaemonIpcDbus->daemonIsNotRunning()){ + // F1快捷键打开用户手册,如kylin-update-manager + mDaemonIpcDbus->showGuide("kylin-update-manager"); + } + } +} + + +void msgHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) +{ + static char logPath[255] = {0}; + static int uid = -1; + + + Q_UNUSED(context); + + QDateTime currentTime = QDateTime::currentDateTime(); + QString timeStr = currentTime.toString("yy.MM.dd hh:mm:ss +zzz"); + + // 获取用于控制命令行输出的环境变量 + char *ctrlEnv = getenv("XXXX_DEBUG"); + QString env; + + // 格式化输出字符串,添加消息发生时间、消息等级 + QString outMsg; + switch (type) { + case QtDebugMsg: + outMsg = QString("[%1 D]: %2").arg(timeStr).arg(msg); + break; + case QtInfoMsg: + outMsg = QString("[%1 I]: %2").arg(timeStr).arg(msg); + break; + case QtWarningMsg: + outMsg = QString("[%1 W]: %2").arg(timeStr).arg(msg); + break; + case QtCriticalMsg: + outMsg = QString("[%1 C]: %2").arg(timeStr).arg(msg); + break; + case QtFatalMsg: + outMsg = QString("[%1 F]: %2").arg(timeStr).arg(msg); + } + + if (fp != NULL) { + // 日志文件存在,则输出到日志文件中 + fprintf(fp, "%s\n", outMsg.toUtf8().data()); + fflush(fp); + } + + if (ctrlEnv != NULL) { + // 环境变量为true或者1,则将信息输出到命令行 + env = QString(ctrlEnv).toLower(); + if ((env == "true") || (env == "1")) { + fprintf(stdout, "%s\n", outMsg.toStdString().c_str()); + fflush(stdout); + } + } + + // 遇到致命错误,需要终止程序(这里终止程序是可选的) + if (type == QtFatalMsg) + abort(); +} + +void log_env_init() +{ + static int uid = -1; + static char logPath[255] = {0}; + bool _is_root = false; + + // 初始执行时,设置log文件路径 + if (uid == -1) { + uid = getuid(); + + } + if (uid == 0) { + // root user + sprintf(logPath, "/var/log/kylin-update-frontend/frontend-upgrade.log", uid, PROGRAM_NAME); + _is_root = true; + } else { + // normal user + sprintf(logPath, "/run/user/%d/%s.log", uid, PROGRAM_NAME); + } + + if (access(logPath, F_OK|W_OK) == 0) + { // log文件存在且可写 + if (fp == NULL) + fp = fopen(logPath, "a+"); + QFileInfo info(logPath); + if (info.size() > 1024*1024*200) + { //200MB + fclose(fp); fp = NULL; + QFile fileclean(logPath); + fileclean.open(QIODevice::WriteOnly | QIODevice::Text | QFile::Truncate); + fileclean.close(); + if (fp == NULL) + fp = fopen(logPath, "a+"); + } + } + else if (access(logPath, F_OK) != 0) + { //文件不存在 + if (fp == NULL) + { + if (_is_root) + { //root用户日志文件 + QDir* dir = new QDir(); + if(!dir->exists("/var/log/RevisionsManager/")) + { + dir->mkpath("/var/log/RevisionsManager/"); + } + fp = fopen(logPath, "a+"); + if (fp == NULL) + printf("Can't open logfile!\n"); + } + else + { + fp = fopen(logPath, "a+"); + if (fp == NULL) + printf("Can't open logfile!\n"); + } + } + } + else + { + // log文件不可写,则需要判断是否被打开过,被打开过就需要关闭 + if (fp != NULL) + fclose(fp); + fp = NULL; + } +} + + + diff --git a/immutable/plugin/src/upgrademain.h b/immutable/plugin/src/upgrademain.h new file mode 100644 index 0000000..e63e89b --- /dev/null +++ b/immutable/plugin/src/upgrademain.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2020, KylinSoft 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 3 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, see . + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "connection.h" +#include "daemonipcdbus.h" +#include "tabwidget.h" +#include "updatedbus.h" + + +class UpgradeMain : public QMainWindow +{ + Q_OBJECT + +public: + UpgradeMain(QString arg, QWidget *parent = nullptr); + ~UpgradeMain(); + + // 初始化组件 + void setWidgetUi(); + +public slots: + + // 键盘响应事件 + void keyPressEvent(QKeyEvent *event); + + + +private: + + + // 更新管理器Dbus + UpdateDbus *updateDbus; + // 整体界面widget + QWidget *mainWid; + // QGSettings + QGSettings *gSettings = nullptr; + // 用户手册功能 + DaemonIpcDbus *mDaemonIpcDbus; + // 整体界面布局 + QVBoxLayout *mainLayout; + TabWid *myTabwidget; + QTimer *my_time; + + +}; + +#endif // MAINWINDOW_H diff --git a/plugin/src/utils.h b/immutable/plugin/src/utils.h similarity index 100% rename from plugin/src/utils.h rename to immutable/plugin/src/utils.h diff --git a/plugin/src/xatom-helper.cpp b/immutable/plugin/src/xatom-helper.cpp similarity index 100% rename from plugin/src/xatom-helper.cpp rename to immutable/plugin/src/xatom-helper.cpp diff --git a/plugin/src/xatom-helper.h b/immutable/plugin/src/xatom-helper.h similarity index 100% rename from plugin/src/xatom-helper.h rename to immutable/plugin/src/xatom-helper.h diff --git a/plugin/translate_generation.sh b/immutable/plugin/translate_generation.sh similarity index 100% rename from plugin/translate_generation.sh rename to immutable/plugin/translate_generation.sh diff --git a/immutable/plugin/translations/bo.qm b/immutable/plugin/translations/bo.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/plugin/translations/bo.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + details + + + + + + + + + + + + + + Update + + + + + + Update log + + + + + + + + Version: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + Cancel failed,Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + Being installed + + + + + + + Download finished,it is recommended that you restart later to use the new version. + + + + + + reboot + + + + + Download succeeded! + + + + + + + + Update succeeded! + + + + + + + + + Update has been canceled! + + + + + + + + + Update failed! + + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + + + Cancel + + + + + No Content. + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + Cumulative updates + + + + + version: + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to update + + + + + The updater is busy! + + + + + downloaded + + + + + + downloading + + + + + calculating + + + + + No content. + + + + + DateTimeUtils + + + No information! + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + SetWidget + + + + Close + + + + + Advanced Option + + + + + Server address settings + + + + + If internal services, change the server address. + + + + + Port ID + + + + + Address + + + + + update period + + + + + + + 1 day + + + + + + 7 days + + + + + + + + 1 month + + + + + + + 3 months + + + + + + + + half a year + + + + + + + + never + + + + + a month + + + + + 7 day + + + + + during the work time,there's no download + + + + + work time + + + + + to + + + + + reset + + + + + Cancel + + + + + + OK + + + + + Modification failed! + + + + + Attention + + + + + TabWid + + + + + + + + + + + + Check Update + + + + + + + + + Prompt information + + + + + Reboot + + + + + Later + + + + + + + + OK + + + + + + + + + + + Your system is the latest: + + + + + + + + + + + + + + + No information! + + + + + + + + + + + + + + + + + Last Checked: + + + + + Downloading and installing updates... + + + + + Keeping update + + + + + + + + + + + + + + + Cancel + + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + + + + + + + Update + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + + + + + + + + + UpdateAll + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + + + + + Dist-upgrade + + + + + Insufficient disk space to download updates! + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + Sure + + + + + supposed + + + + + + The system is downloading the update! + + + + + + Downloading the updates... + + + + + + Installing the updates... + + + + + s + + + + + min + + + + + h + + + + + + + + + In the install + + + + + + In the download + + + + + calculating + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + The status of backup completion is abnormal + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + + Retry + + + + + + + + + Error Code: + + + + + SystemUpdate + + + + + feedback UI end failed! + + + + + + System-Upgrade + + + + + + ukui-control-center-update + + + + + feedback UI start failed! + + + + + + + + Network exception, unable to check for updates! + + + + + No room, upgrade failed. + + + + + + Checking update failed! + + + + + + No Information! + + + + + The system is checking update : + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Download Limit + + + + + It will be avaliable in the next download. + + + + + Automatically updates + + + + + The system will automatically updates when there is an available network and backup. + + + + + Accept beta version and + + + + + to help improving the system. + + + + + provide feedback + + + + + Rollback to previous version + + + + + start + + + + + View history + + + + + Ready to install + + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + The updater is NOT start + + + + + + The progress is updating... + + + + + + + + The progress is installing... + + + + + + + + The updater is busy! + + + + + + Updating the software source + + + + + The update stopped because of low battery. + + + + + The system update requires that the battery power is not less than 50% + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + Calculating Capacity... + + + + + This update has been completed! + + + + + + + + update has been canceled! + + + + + Finish the download! + + + + + + The system has download the update,and you are suggested to reboot to use the new version. + + + + + + + reboot rightnow + + + + + Advanced + + + + + Reboot failed! + + + + + + + Update failed! + + + + + + + No room to backup,upgrade failed. + + + + + + + + Battery level is below 50%,and upgrade failed. + + + + + preparing to backup + + + + + An important update is in progress, please wait. + + + + + insufficient backup space + + + + + backup start success + + + + + backup failed + + + + + + The system is updating... + + + + + Calculating + + + + + Auto-Update progress is installing new file: + + + + + Auto-Update progress finished! + + + + + Auto-Update progress fail in backup! + + + + + It's fixing up the environment... + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + View history + + /Upgrade/View history + + + + Update Settings + + /Upgrade/Update Settings + + + + Allowed to renewable notice + + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + + show details + + + + + uninstall and update + + + + + cancel + + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Attention on update + + + + + back + + + + + fixupdetaillist + + + No content. + + + + + Update Details + + + + + Update + + + + + m_updatelog + + + No content. + + + + + no content + + + + + History Log + + + + + + Close + + + + + updatedeleteprompt + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + Keep + + + + + Remove + + + + + Update + + + + diff --git a/immutable/plugin/translations/bo_CN.qm b/immutable/plugin/translations/bo_CN.qm new file mode 100644 index 0000000..12e57b8 Binary files /dev/null and b/immutable/plugin/translations/bo_CN.qm differ diff --git a/immutable/plugin/translations/bo_CN.ts b/immutable/plugin/translations/bo_CN.ts new file mode 100644 index 0000000..85f4675 --- /dev/null +++ b/immutable/plugin/translations/bo_CN.ts @@ -0,0 +1,1392 @@ + + + + + AppUpdateWid + + + Cancel failed,Being installed + 取消失败,安装中 + ཕམ་ཉེས་བྱུང་ནས་སྒྲིག་སྦྱོར་བྱེད་བཞིན་ཡོད། + + + + Being installed + སྒྲིག་སྦྱོར་བྱེད་བཞིན་པ། + + + + Download succeeded! + ཕབ་ལེན་ལེགས་འགྲུབ་བྱུང་བ་རེད། + + + + + + Update succeeded , It is recommended that you restart later! + གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་སོང་། ཁྱེད་ཀྱིས་རྗེས་སུ་ཡང་བསྐྱར་འགོ་འཛུགས་རྒྱུའི་གྲོས་འགོ་འདོན་རྒྱུ་ཡིན། + + + + + + + Version: + པར་གཞི་འདི་ལྟ་སྟེ། + + + + + + Download finished,it is recommended that you restart later to use the new version. + ཕབ་ལེན་ལེགས་གྲུབ་བྱུང་ནས་གྲོས་འགོ་བསྐྱར་དུ་འདོན་དགོས། + + + + + reboot + བསྐྱར་སློང་། + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ་རེད། ཁྱེད་ཀྱིས་རྗེས་སུ་ཐོ་འགོད་བྱས་ནས་ཡང་བསྐྱར་ཐོ་འགོད་བྱ་རྒྱུའི་གྲོས་འགོ་འདོན་རྒྱུ་ཡིན། + + + + + + + Update succeeded! + གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ་རེད། + + + + + + + + Update has been canceled! + གསར་སྒྱུར་མེད་པར་བཟོས་ཟིན། + + + + + + + + Update failed! + གསར་སྒྱུར་ལ་ཕམ་ཉེས་བྱུང་བ་རེད། + + + + + Failure reason: + ཕམ་ཉེས་བྱུང་བའི་རྒྱུ་རྐྱེན་ནི། + + + Network exception, unable to check for updates! + དྲ་རྒྱའི་དམིགས་བསལ་གྱིས་གནས་ཚུལ་གསར་བར་ཞིབ་བཤེར་བྱེད་ཐབས་བྲལ། + + + No room, upgrade failed. + བར་སྟོང་མི་འདང་བ་དང་ཕམ་ཁ་གསར་པ་བྱུང་། + + + Battery level is below 50%,and upgrade failed. + གློག་ཚད་དམའ་ཞིང་གསར་སྒྱུར་ཕམ་ཁ་བྱུང་། + + + Update failed! + གསར་སྒྱུར་ལ་ཕམ་ཉེས་བྱུང་བ་རེད། + + + Error Code: + ནོར་འཁྲུལ་གྱི་ཨང་གྲངས། + + + + There are unresolved dependency conflicts in this update,Please select update all + གསར་སྒྱུར་འདིའི་ནང་དུ་ཐག་གཅོད་བྱས་མེད་པའི་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས། ཚང་མ་གསར་སྒྱུར་བྱེད་རོགས། + + + + + Prompt information + མགྱོགས་མྱུར་གྱི་ཆ་འཕྲིན། + + + + Update ALL + ཚང་མ་གསར་སྒྱུར་བྱ་ + + + + + + + + Cancel + ཕྱིར་འཐེན། + + + + No Content. + ནང་དོན་གང་ཡང་མེད། + + + + There are + དེ་རུ་ཡོད་པ་ནི། + + + + packages going to be removed,Please confirm whether to accept! + ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། + + + + Cumulative updates + གསོག་འཇོག་གསར་སྒྱུར་བྱེད་དགོས། + + + packages are going to be removed,Please confirm whether to accept! + ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། + + + + version: + པར་གཞི་འདི་ལྟ་སྟེ། + + + The update stopped because of low battery. + གློག་སྨན་དམའ་བའི་རྐྱེན་གྱིས་གསར་སྒྱུར་བྱེད་མཚམས་བཞག་པ་རེད། + + + The system update requires that the battery power is not less than 50% + མ་ལག་གསར་སྒྱུར་བྱེད་པར་གློག་སྨན་གྱི་སྒུལ་ཤུགས་50%ལས་མི་ཉུང་བའི་བླང་བྱ་བཏོན་ཡོད། + + + pkg will be uninstall! + 个软件包将被卸载! + + + + + + + + + + + + Update + གསར་སྒྱུར། + + + + details + ཞིབ་ཕྲའི་གནས་ཚུལ། + + + + + Update log + གསར་སྒྱུར་ཉིན་ཐོ། + + + Newest: + 最新: + + + + Download size: + ཕབ་ལེན་གྱི་གཞི་ཁྱོན་ནི། + + + + Install size: + སྒྲིག་སྦྱོར་བྱས་པའི་གཞི་ཁྱོན་ནི། + + + + Current version: + ད་ལྟའི་པར་གཞི་ནི། + + + back + 收起 + + + The battery is below 50% and the update cannot be downloaded + 电池电量低于 50%,无法下载更新 + + + OK + འགྲིགས། + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + གསར་སྒྱུར་རྐྱང་པ་ཞིག་གིས་མ་ལག་རང་འགུལ་གྱིས་རྗེས་གྲབས་བྱེད་མི་སྲིད། གལ་ཏེ་ཁྱོད་ཀྱིས་རྗེས་གྲབས་བྱེད་འདོད་ན་གསར་སྒྱུར་ཚང་མ་མནན་རོགས། + + + + Do not backup, continue to update + རྗེས་གྲབས་མི་བྱེད་པར་མུ་མཐུད་དུ་གསར་སྒྱུར་བྱེད་དགོས། + + + + This time will no longer prompt + ཐེངས་འདིར་ཡང་བསྐྱར་སྐུལ་འདེད་བྱེད་མི་ཐུབ། + + + + Ready to update + 准备更新 + གསར་སྒྱུར་བྱེད་པར་གྲ་སྒྲིག་ + + + + downloaded + 已下载 + ཕབ་ལེན་བྱས་པ། + + + Ready to install + 准备安装 + + + + + downloading + ཕབ་ལེན་བྱེད་པ། + + + + calculating + 计算中 + རྩིས་རྒྱག་པ། + + + + No content. + ནང་དོན་གང་ཡང་མེད། + + + + DateTimeUtils + + + No information! + དཔྱད་གཞིའི་ཡིག་ཆ་མེད། + + + + HistoryUpdateListWig + + + Success + ལེགས་འགྲུབ་བྱུང་བ། + + + + Failed + ཕམ་ཉེས་བྱུང་བ། + + + + QObject + + + system upgrade new backup + མ་ལག་རིམ་སྤར་གྱི་རྗེས་གྲབས་དཔུང་ཁག་ + + + + system upgrade increment backup + མ་ལག་རིམ་སྤར་འཕར་སྣོན་གྱི་རྗེས་གྲབས་དཔུང་ཁག + + + + SetWidget + + + + Close + སྒོ་རྒྱག་པ། + + + + Advanced Option + མཐོ་རིམ་འདེམས་ཚན། + + + + Server address settings + ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་ས་གནས་འཛུགས་པ། + + + + + If internal services, change the server address. + གལ་ཏེ་ནང་ཁུལ་གྱི་ཞབས་ཞུ་ཡོད་ན། ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི + + + + Port ID + འབོད་ཚིག་བཤད་པ། + + + + Address + ཤག་གནས། + + + + reset + བསྐྱར་དུ་བཀོད་སྒྲིག་བྱེད་པ། + + + + Cancel + ཕྱིར་འཐེན། + + + + + OK + འགྲིགས། + + + + Modification failed! + ར་སྤྲོད་ཕམ་པ། + + + + Attention + དོ་སྣང་བྱེད་དགོས། + + + + TabWid + + + + + + + + + + + + Check Update + ཞིབ་བཤེར་གསར་སྒྱུར། + + + initializing + 初始化中 + + + + + + + + + + + + UpdateAll + གསར་སྒྱུར་བྱེད་པ། + + + Your system is the latest! + 您的系统已是最新! + + + + + No Information! + དཔྱད་གཞིའི་ཡིག་ཆ་མེད། + + + Last refresh: + 检查时间: + + + + Downloading and installing updates... + ཕབ་ལེན་དང་སྒྲིག་སྦྱོར་བྱས་པའི་གནས་ཚུལ་གསར་བ་ + + + Update now + 立即更新 + + + Cancel update + 取消更新 + + + + + Being updated... + གསར་སྒྱུར་བྱེད་བཞིན་པའི་སྒང་ཡིན། + + + + + Updatable app detected on your system! + ཁྱེད་ཚོའི་མ་ལག་ནང་དུ་ཞིབ་དཔྱད་ཚད་ལེན་བྱས་པའི་ཉེར་སྤྱོད་གོ་རིམ་གསར་པ་ + + + + The backup restore partition could not be found. The system will not be backed up in this update! + རྗེས་གྲབས་སླར་གསོ་བྱེད་པའི་ཆ་ཤས་རྙེད་མི་ཐུབ། ཐེངས་འདིའི་གསར་སྒྱུར་ཁྲོད་མ་ལག་ལ་རྒྱབ་སྐྱོར་བྱེད་མི་སྲིད། + + + + Kylin backup restore tool is doing other operations, please update later. + ཅིན་ལིན་གྱི་རྗེས་གྲབས་ཡོ་བྱད་སླར་གསོ་བྱེད་པའི་ཡོ་བྱད་ཀྱིས་ད་དུང་ལས་ཀ་གཞན་དག་བྱེད་བཞིན་ཡོད་པས། རྗེས་སུ + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + འབྱུང་ཁུངས་ཀྱི་སྤྱི་གཉེར་བའི་བཀོད་སྒྲིག་ཡིག་ཆ་རྒྱུན་ལྡན་མིན་པས་མ་ལག་གནས་སྐབས་སུ་གསར་སྒྱུར་བྱེད་ཐབས་བྲལ་ + + + + Backup already, no need to backup again. + རྗེས་གྲབས་བྱས་ཟིན་པས་སླར་ཡང་རྗེས་གྲབས་བྱེད་དགོས་དོན་མེད། + + + + Start backup,getting progress + རྗེས་གྲབས་ལས་དོན་སྤེལ་འགོ་བཙུགས་ཏེ་ཡར་རྒྱས་ཡོང + + + + Kylin backup restore tool does not exist, this update will not backup the system! + ཅིན་ལིན་གྱི་རྗེས་གྲབས་སླར་གསོ་ཡོ་བྱད་མེད་པས། གསར་སྒྱུར་འདིས་མ་ལག་ལ་རྗེས་གྲབས་བྱེད་མི་སྲིད། + + + + + + + + + + + + Cancel + ཕྱིར་འཐེན། + + + + Calculated + རྩིས་བརྒྱབ་པ། + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + གསར་སྒྱུར་འདིའི་ནང་དུ་ཐག་གཅོད་བྱས་མེད་པའི་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས། དོ་དམ་པར་འབྲེལ་གཏུག་བྱེད་རོགས། + + + + + + + + Prompt information + མགྱོགས་མྱུར་གྱི་ཆ་འཕྲིན། + + + + + + + + + + Your system is the latest: + ཁྱོད་ཀྱི་མ་ལག་ནི་པར་གཞི་ཆེས་གསར་བ་ཡིན + + + + Sure + གཏན་འཁེལ་བྱ་དགོས། + + + + + In the download + ཕབ་ལེན་བྱེད་པའི་ཁྲོད། + + + + calculating + 计算中 + རྩིས་རྒྱག་པ། + + + In the install... + 安装中... + + + + Backup complete. + རྗེས་གྲབས་ལས་ཀ་ལེགས་འགྲུབ་བྱུང་བ + + + + System is backing up... + མ་ལག་གིས་རྒྱབ་སྐྱོར་བྱེད་བཞིན་ཡོད། + + + + Backup interrupted, stop updating! + རྗེས་གྲབས་བྱེད་མཚམས་བཞག་ནས་གསར་སྒྱུར་བྱེད་མཚམས་འཇོག་དགོས། + + + Backup finished! + 备份完成! + + + + Kylin backup restore tool exception: + ཅིན་ལིན་གྱི་རྗེས་གྲབས་ཡོ་བྱད་སླར་གསོ་བྱེད་པའི་ཡོ་བྱད་ + + + + There will be no backup in this update! + གསར་སྒྱུར་འདིའི་ནང་དུ་རྗེས་གྲབས་དཔུང་ཁག་ཡོད་མི་སྲིད། + + + + The status of backup completion is abnormal + 备份完成状态异常 + རྗེས་གྲབས་ལེགས་འགྲུབ་བྱུང་བའི་གནས་ཚུལ་ནི་རྒྱུན་ལྡན་མིན་པ + + + + Getting update list + གསར་སྒྱུར་གྱི་མིང་ཐོ་ཐོབ་པ། + + + Software source update successed: + 软件源更新成功: + མཉེན་ཆས་ཀྱི་འབྱུང་ཁུངས་གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ + + + Software source update failed: + མཉེན་ཆས་ཀྱི་འབྱུང་ཁུངས་གསར་སྒྱུར་ལ་ཕམ་ཉེས་བྱུང + + + Update software source : + 更新软件源进度: + + + + + Update + གསར་སྒྱུར། + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + 本次更新存在无法解决的依赖冲突,请选择全盘更新 + ཐེངས་འདིའི་གསར་སྒྱུར་ཁྲོད་དུ་ཐག་གཅོད་བྱས་མེད་པའི་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས། ཁྱེད་ཀྱིས་Dist-upgradeབདམས་རོགས། + + + + Dist-upgrade + 全盘更新 + རྒྱང་རིང་གི་རིམ་པ་འཕར་བ། + + + + + The system is downloading the update! + མ་ལག་གིས་གསར་སྒྱུར་ཕབ་ལེན་བྱེད་བཞིན་ཡོད། + + + + + Downloading the updates... + གནས་ཚུལ་གསར་པ་ཕབ་ལེན་བྱ་དགོས། + + + + + Installing the updates... + གསར་སྒྱུར་སྒྲིག་སྦྱོར་བྱེད་པ... + + + + + + In the install + སྒྲིག་སྦྱོར་བྱེད་པའི་ཁྲོད་ + + + + + Retry + བསྐྱར་དུ་ཞིབ་བཤེར་བྱ་དགོས། + + + + + + + + Error Code: + + + + + + + + Network exception, unable to check for updates! + དྲ་རྒྱའི་དམིགས་བསལ་གྱིས་གནས་ཚུལ་གསར་བར་ཞིབ་བཤེར་བྱེད་ཐབས་བྲལ། + + + + No room, upgrade failed. + བར་སྟོང་མི་འདང་བ་དང་ཕམ་ཁ་གསར་པ་བྱུང་། + + + + + + No room to backup,upgrade failed. + བར་སྟོང་མི་འདང་བ་དང་ཕམ་ཁ་གསར་པ་ཡོང་བར་བྱ་དགོས། + + + + + + + Battery level is below 50%,and upgrade failed. + གློག་ཚད་དམའ་ཞིང་གསར་སྒྱུར་ཕམ་ཁ་བྱུང་། + + + + + Checking update failed! + ཞིབ་དཔྱད་ཚད་ལེན་ཕམ་ཉེས་བྱུང་བ་གསར་སྒྱུར་ + + + Error Code: + ནོར་འཁྲུལ་གྱི་ཨང་གྲངས། + + + + The system is checking update : + མ་ལག་གིས་གནས་ཚུལ་གསར་བར་ཞིབ་བཤེར་བྱེད་བཞིན་ཡོད། + + + + Rollback to previous version + པར་གཞི་སྔོན་མ་ཞིག་ལ་ཕྱིར་ལོག་པ། + + + + start + འགོ་ཚུགས་པ་རེད། + + + + Upgrade + རིམ་པ་སྤར་བ། + + + Download Limit(Kb/s) + 下载限速(Kb/s) + + + + View history + ལོ་རྒྱུས་ལ་ལྟ་ཞིབ་ + + + details + 详情 + + + + Update Settings + གསར་སྒྱུར་སྒྲིག་བཀོད། + /upgrade/Update Settings + + + + Allowed to renewable notice + བསྐྱར་སྤྱོད་རུང་བའི་བརྡ་ཐོ་བཏང་ཆོག། + + + Backup current system before updates all + ཚང་མ་གསར་སྒྱུར་མ་བྱས་གོང་ལ་ད་ལྟ་སྤྱོད་བཞིན་ + + + Download Limit(KB/s) + 下载限速(KB/s) + + + + It will be avaliable in the next download. + ཐེངས་རྗེས་མར་ཕབ་ལེན་བྱས་ན་འགན་འཁྲི་འཁུར་དགོས། + + + Automatically download and install updates + 自动下载和安装更新 + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + 开启后,当有可用网络和可用备份和恢复分区时,系统会自动下载和安装更新。 + + + Upgrade during poweroff + 关机检测更新 + + + Download Limit(kB/s) + 下载限速(kB/s) + + + + The system will automatically updates when there is an available network and backup. + མ་ལག་འདི་ལ་ད་ཡོད་ཀྱི་དྲ་རྒྱ་དང་རྗེས་གྲབས་ཡོད་པའི་སྐབས་སུ་རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་སྲིད། + + + + Ready to install + སྒྲིག་སྦྱོར་བྱེད་པར་གྲ་སྒྲིག་ + + + + + + + + + + + + + + + + Last Checked: + མཇུག་མཐར་ཞིབ་བཤེར་བྱས་པ་གཤམ་ + + + Your system is the latest:V10sp1- + 你的系统已是最新版本:V10sp1- + + + + + + + + + + + + + + No information! + དཔྱད་གཞིའི་ཡིག་ཆ་མེད། + + + + Download Limit + ཕབ་ལེན་གྱི་བཅད་གྲངས། + + + + Advanced + སྔོན་ཐོན་རང་བཞིན། + + + + + Dependency conflict exists in this update,need to be completely repaired! + གསར་སྒྱུར་འདིའི་ཁྲོད་དུ་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས་རྦད་དེ་ཉམས་གསོ་བྱེད་དགོས། + + + + There are + དེ་རུ་ཡོད་པ་ནི། + + + + packages going to be removed,Please confirm whether to accept! + ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། + + + + packages are going to be removed,Please confirm whether to accept! + ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། + + + + trying to reconnect + ཐབས་བརྒྱ་ཇུས་སྟོང་གིས་འབྲེལ་མཐུད་བྱེད་པ། + + + + times + དུས་རབས་ + + + back + 收起 + + + Auto-Update is backing up...... + 自动更新进程正在备份中...... + རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་པར་རྒྱབ་སྐྱོར་བྱེད་བཞིན་ཡོད། + + + + The updater is NOT start + གསར་སྒྱུར་བྱེད་མཁན་གྱིས་གསར་སྒྱུར་བྱེད་འགོ་ཚུགས་མེད། + + + + The progress is updating... + འཕེལ་རིམ་གསར་སྒྱུར་བྱེད་བཞིན་ཡོད། + + + + + The progress is installing... + འཕེལ་རིམ་སྒྲིག་སྦྱོར་བྱེད་བཞིན་པའི་སྒང་རེད། + + + + The updater is busy! + གསར་སྒྱུར་བྱེད་མཁན་དེ་བྲེལ་བ་ཧ་ཅང་ཆེ། + + + + + Updating the software source + མཉེན་ཆས་ཀྱི་འབྱུང་ཁུངས་གསར་སྒྱུར་བྱེད་པ། + + + The battery is below 50% and the update cannot be downloaded + 电池电量低于 50%,无法下载更新 + + + + + + + OK + འགྲིགས། + + + + Please back up the system before all updates to avoid unnecessary losses + གསར་སྒྱུར་མ་བྱས་གོང་ལ་མ་ལག་ཕྱིར་འཐེན་བྱས་ནས་དགོས་མེད་ཀྱི་གྱོང་གུན་མི་ཡོང་བ་བྱེད་དགོས། + + + + Only Update + གསར་སྒྱུར་ཁོ་ན་བྱེད་ + + + + Back And Update + རྒྱབ་ཕྱོགས་དང་གསར་སྒྱུར། + + + + + + + update has been canceled! + གསར་སྒྱུར་མེད་པར་བཟོས་ཟིན། + + + + + This update has been completed! + 本次更新已完成! + གསར་སྒྱུར་འདི་ལེགས་འགྲུབ་བྱུང་སོང་། + + + Your system is the latest:V10 + ཁྱེད་ཚོའི་མ་ལག་ནི་ཆེས་གསར་བ་ཡིན། V10 + + + + Keeping update + གསར་སྒྱུར་རྒྱུན་འཁྱོངས་བྱེད་པ + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + གསར་སྒྱུར་མ་བྱས་གོང་ལ་མ་ལག་ལ་རྒྱབ་སྐྱོར་བྱས་ནས་དགོས་མེད་ཀྱི་གྱོང་གུན་མི་ཡོང་བ་བྱ་རྒྱུའི་གྲོས་འགོ་བཏོན་པ་རེད། + + + + Insufficient disk space to download updates! + ཕབ་ལེན་བྱས་པའི་གསར་སྒྱུར་གྱི་བར་སྟོང་མི་འདང་བ་རེད། + + + + supposed + ཚོད་དཔག་བྱས་པ་ + + + + s + s + + + + min + ཟིན་བྲིས་གནད་བསྡུས། + + + + h + h + + + + Automatically updates + རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་ + + + Advanced Option + ཚད་མཐོའི་གདམ་ཁ་ + + + + The update stopped because of low battery. + གློག་སྨན་དམའ་བའི་རྐྱེན་གྱིས་གསར་སྒྱུར་བྱེད་མཚམས་བཞག་པ་རེད། + + + + The system update requires that the battery power is not less than 50% + མ་ལག་གསར་སྒྱུར་བྱེད་པར་གློག་སྨན་གྱི་སྒུལ་ཤུགས་50%ལས་མི་ཉུང་བའི་བླང་བྱ་བཏོན་ཡོད། + + + Part of the update failed! + གསར་སྒྱུར་གྱི་ཆ་ཤས་ཤིག་ལ་ཕམ་ཉེས་བྱུང་བ་རེད། + + + Failure reason: + 失败原因: + ཕམ་ཉེས་བྱུང་བའི་རྒྱུ་རྐྱེན་ནི། + + + + Finish the download! + ཕབ་ལེན་བྱས་ཚར་སོང་། + + + The system has download the update! + མ་ལག་གིས་གསར་སྒྱུར་ཕབ་ལེན་བྱས་ཡོད། + + + It's need to reboot to make the install avaliable + སྒྲིག་སྦྱོར་བྱས་ནས་སྒྲིག་སྦྱོར་བྱས་ན་འགྲིག་གི་རེད། + + + Reboot notification + བསྐྱར་དུ་བརྡ་ཐོ་གཏོང་དགོས། + + + Reboot rightnow + གཡས་ཕྱོགས་པ་བསྐྱར་དུ་ཐོན་པ། + + + + Later + རྗེས་སུ། + + + Part of the update success! + གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བའི་ཆ་ཤས་ཤིག་རེད། + + + All the update has been downloaded. + གསར་སྒྱུར་ཚང་མ་ཕབ་ལེན་བྱས་ཟིན། + + + + An important update is in progress, please wait. + གལ་འགངས་ཆེ་བའི་གནས་ཚུལ་གསར་བ་ཞིག་ད་ལྟ་སྤེལ་བཞིན་ཡོད།རེ་སྒུག་ + + + plase clean up your disk or expand the backup space + ཁྱེད་ལ་གཙང་བཤེར་འཁོར་གཞོང་བར་སྟོང་འམ་རྒྱ་བསྐྱེད་རྗེས་གྲབས།འཛུགས་སྐྲུན་ཁག། + + + + insufficient backup space + གསོག་ཉར་ཁམས་མི་འདང་བ། + + + + backup failed + གསོག་ཉར་ཕམ་ཁ། + + + Failed to write configuration file, this update will not back up the system! + བཀོད་སྒྲིག་ཡིག་ཆ་འབྲི་མ་ཐུབ་ན། གསར་སྒྱུར་འདིས་མ་ལག་ལ་རྒྱབ་སྐྱོར་བྱེད་མི་སྲིད། + + + Insufficient backup space, this update will not backup your system! + རྗེས་གྲབས་ཀྱི་བར་སྟོང་མི་འདང་བས། གསར་སྒྱུར་འདིས་ཁྱེད་ཚོའི་མ་ལག་ལ་རྗེས་གྲབས་བྱེད་མི་སྲིད། + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + ཅིན་ལིན་གྱི་རྗེས་གྲབས་ཡོ་བྱད་ཀྱིས་UUIDམ་རྙེད་པས། གསར་སྒྱུར་འདིས་མ་ལག་ལ་རྗེས་གྲབས་བྱེད་མི་ཐུབ། + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + 备份还原分区异常,您可能没有备份还原分区。更多详细信息,可以参看/var/log/backup.log + + + + Calculating Capacity... + ནུས་པ་རྩིས་རྒྱག་པ... + + + The system backup partition is not detected. Do you want to continue updating? + 未检测到系统备份还原分区,是否继续更新? + + + + Calculating + རྩིས་རྒྱག་པ། + + + + + The system is updating... + ལམ་ལུགས་གསར་སྒྱུར་བྱེད་བཞིན་ཡོད། + + + + Reboot + བསྐྱར་སློང་། + + + + + The system has download the update,and you are suggested to reboot to use the new version. + མ་ལག་གསར་སྒྱུར་བྱས་ནས་ཕབ་ལེན་བྱས་པ་དང་གྲོས་འགོ་ཡང་བསྐྱར་སྒྲིག་སྦྱོར་བྱ་རྒྱུའི་གྲོས་འགོ + + + + + + reboot rightnow + ལམ་སང་བསྐྱར་དུ་སྒོ་འབྱེད་དགོས། + + + + Reboot failed! + བསྐྱར་སློང་ཕམ་པ། + + + + preparing to backup + སྐལ་བ་གྲ་སྒྲིག་བྱེད་དགོས། + + + + + + Update failed! + གསར་སྒྱུར་ལ་ཕམ་ཉེས་བྱུང་བ་རེད། + + + + backup start success + སྐལ་ཆ་གྲ་སྒྲིག་བྱེད་འགོ་ + + + + Auto-Update progress is installing new file: + 系统自动更新功能正在安装新文件: + རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་པའི་འཕེལ་རིམ་ནི་ཡིག་ཆ་གསར་པ་སྒྲིག་སྦྱོར་བྱེད་ + + + + Auto-Update progress finished! + 系统自动更新完成! + རང་འགུལ་གྱིས་གསར་སྒྱུར་གྱི་འཕེལ་རིམ་ལེགས་འགྲུབ་བྱུང་ + + + + Auto-Update progress fail in backup! + 自动更新安装时备份失败! + རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་པའི་འཕེལ་རིམ་དེ་རྗེས་གྲབས་ལས་དོན་ལ་ཕམ + + + Failed in updating because of broken environment. + ཁོར་ཡུག་གཏོར་བཤིག་བཏང་བའི་རྐྱེན་གྱིས་གསར་སྒྱུར་བྱེད་མ་ཐུབ་པ་རེད། + + + + It's fixing up the environment... + དེས་ཁོར་ཡུག་ཞིག་གསོ་བྱེད་བཞིན་ཡོད། + + + + UpdateDbus + + + System-Upgrade + མ་ལག་རིམ་སྤར། + + + + ukui-control-center-update + ukui-control-center-update + + + + UpdateLog + + + Update log + གསར་སྒྱུར་ཉིན་ཐོ། + + + + UpdateSource + + + Connection failed, please reconnect! + འབྲེལ་མཐུད་བྱེད་མ་ཐུབ་པས་ཡང་བསྐྱར་འབྲེལ་མཐུད་བྱེད་རོགས། + + + + Upgrade + + + Upgrade + རིམ་པ་སྤར་བ། + + + + View history + ལོ་རྒྱུས་ལ་ལྟ་ཞིབ་ + /Upgrade/View history + + + + Update Settings + གསར་སྒྱུར་སྒྲིག་བཀོད། + /Upgrade/Update Settings + + + + Allowed to renewable notice + བསྐྱར་སྤྱོད་རུང་བའི་བརྡ་ཐོ་བཏང་ཆོག། + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + རང་འགུལ་གྱིས་ཕབ་ལེན་དང་སྒྲིག་སྦྱོར་བྱས་པའི་གནས་ + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + details + 详情 + + + + show details + ཞིབ་ཕྲའི་གནས་ཚུལ་གསལ་བཤད་ + + + + uninstall and update + སྒྲིག་སྦྱོར་དང་གསར་སྒྱུར་མ་བྱས་པ། + + + uninstall + 移除 + + + + cancel + ཕྱིར་འཐེན། + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + ང་ཚོས་ཁོར་ཡུག་ཞིག་གསོ་བྱེད་དགོས། + + + + There will be uninstall some packages to complete the update! + དེ་རུ་ཐུམ་སྒྲིལ་ཁ་ཤས་སྒྲིག་སྦྱོར་བྱས་ནས་གསར་སྒྱུར་ལེགས་འགྲུབ་བྱེད་རྒྱུ་རེད། + + + + The following packages will be uninstalled: + གཤམ་གསལ་གྱི་ཐུམ་སྒྲིལ་དེ་དག་སྒྲིག་སྦྱོར་བྱས་མེད་པ་སྟེ། + + + + PKG Details + PKGཡི་ཞིབ་ཕྲའི་གནས་ཚུལ། + + + + + details + ཞིབ་ཕྲའི་གནས་ཚུལ། + + + + Keep + ཉར་ཚགས་ཡག་པོ་ + + + + Remove + མེད་པར་བཟོ་བ། + + + + Attention on update + གསར་སྒྱུར་ལ་དོ་སྣང་བྱེད་པ། + + + + back + རྒྱབ་ཕྱོགས་སུ་ཕྱིར་ + + + + fixupdetaillist + + + No content. + ནང་དོན་གང་ཡང་མེད། + + + + Update Details + གནས་ཚུལ་ཞིབ་ཕྲ་གསར་སྒྱུར་བྱ་ + + + + Update + གསར་སྒྱུར། + + + + m_updatelog + + + No content. + ནང་དོན་གང་ཡང་མེད། + + + + no content + གནས་སྐབས་སུ་ནང་དོན་མེད་པ། + + + + + Close + སྒོ་རྒྱག་པ། + + + Update Details + གནས་ཚུལ་ཞིབ་ཕྲ་གསར་སྒྱུར་བྱ་ + + + No Contents + གནས་སྐབས་མེད་པའི་ནང་དོན། + + + Search content + འཚོལ་བཤེར་གྱི་ནང་དོན། + + + + History Log + ལོ་རྒྱུས་ཀྱི་ཟིན་ཐོ། + + + + updatedeleteprompt + + Dependency conflict exists in this update! + 本次更新存在依赖冲突! + + + There will be uninstall some packages to complete the update! + 将卸载部分软件包以完成更新! + + + + The following packages will be uninstalled: + གཤམ་གསལ་གྱི་ཐུམ་སྒྲིལ་དེ་དག་སྒྲིག་སྦྱོར་བྱས་མེད་པ་སྟེ། + + + + PKG Details + PKGཡི་ཞིབ་ཕྲའི་གནས་ཚུལ། + + + + Update + གསར་སྒྱུར། + + + details + 详情 + + + + Keep + ཉར་ཚགས་ཡག་པོ་ + + + + Remove + མེད་པར་བཟོ་བ། + + + Update Prompt + 更新提示 + + + back + 收起 + + + diff --git a/immutable/plugin/translations/en_US.qm b/immutable/plugin/translations/en_US.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/plugin/translations/en_US.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + details + + + + + + + + + + + + + Update + + + + + + Update log + + + + + + + + Version: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + Cancel failed,Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + Being installed + + + + + + + Download finished,it is recommended that you restart later to use the new version. + + + + + + reboot + + + + + Download succeeded! + + + + + + + + Update succeeded! + + + + + + + + + Update has been canceled! + + + + + + + + + Update failed! + + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + + + Cancel + + + + + No Content. + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + Cumulative updates + + + + + version: + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to update + + + + + downloaded + + + + + + downloading + + + + + calculating + + + + + No content. + + + + + DateTimeUtils + + + No information! + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + SetWidget + + + + Close + + + + + Advanced Option + + + + + Server address settings + + + + + If internal services, change the server address. + + + + + Port ID + + + + + Address + + + + + reset + + + + + Cancel + + + + + + OK + + + + + Modification failed! + + + + + Attention + + + + + TabWid + + + + + + + + + + + + Check Update + + + + + + + + + Prompt information + + + + + Reboot + + + + + Later + + + + + + + + OK + + + + + + + + + + + Your system is the latest: + + + + + + + + + + + + + + + No information! + + + + + + + + + + + + + + + + + Last Checked: + + + + + Downloading and installing updates... + + + + + Keeping update + + + + + + + + + + + + + Cancel + + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + + + + + + Update + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + + + + + + + + + UpdateAll + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + + + + + Dist-upgrade + + + + + Insufficient disk space to download updates! + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + Sure + + + + + supposed + + + + + + The system is downloading the update! + + + + + + Downloading the updates... + + + + + + Installing the updates... + + + + + s + + + + + min + + + + + h + + + + + + + In the install + + + + + + In the download + + + + + calculating + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + The status of backup completion is abnormal + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + + Retry + + + + + + + + + Error Code: + + + + + + + + Network exception, unable to check for updates! + + + + + No room, upgrade failed. + + + + + + Checking update failed! + + + + + + No Information! + + + + + The system is checking update : + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Download Limit + + + + + It will be avaliable in the next download. + + + + + Automatically updates + + + + + The system will automatically updates when there is an available network and backup. + + + + + Rollback to previous version + + + + + start + + + + + View history + + + + + Ready to install + + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + The updater is NOT start + + + + + The progress is updating... + + + + + + The progress is installing... + + + + + The updater is busy! + + + + + + Updating the software source + + + + + Upgrade + + + + + The update stopped because of low battery. + + + + + The system update requires that the battery power is not less than 50% + + + + + Advanced + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + Calculating Capacity... + + + + + + This update has been completed! + + + + + + + + update has been canceled! + + + + + Finish the download! + + + + + + The system has download the update,and you are suggested to reboot to use the new version. + + + + + + + reboot rightnow + + + + + Reboot failed! + + + + + + + Update failed! + + + + + + + No room to backup,upgrade failed. + + + + + + + + Battery level is below 50%,and upgrade failed. + + + + + preparing to backup + + + + + An important update is in progress, please wait. + + + + + insufficient backup space + + + + + backup start success + + + + + backup failed + + + + + + The system is updating... + + + + + Calculating + + + + + Auto-Update progress is installing new file: + + + + + Auto-Update progress finished! + + + + + Auto-Update progress fail in backup! + + + + + It's fixing up the environment... + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + View history + + /Upgrade/View history + + + + Update Settings + + /Upgrade/Update Settings + + + + Allowed to renewable notice + + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + + show details + + + + + uninstall and update + + + + + cancel + + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Attention on update + + + + + back + + + + + fixupdetaillist + + + No content. + + + + + Update Details + + + + + Update + + + + + m_updatelog + + + No content. + + + + + no content + + + + + History Log + + + + + + Close + + + + + updatedeleteprompt + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + Keep + + + + + Remove + + + + + Update + + + + diff --git a/immutable/plugin/translations/mn.qm b/immutable/plugin/translations/mn.qm new file mode 100644 index 0000000..473136c Binary files /dev/null and b/immutable/plugin/translations/mn.qm differ diff --git a/immutable/plugin/translations/mn.ts b/immutable/plugin/translations/mn.ts new file mode 100644 index 0000000..2b22d3b --- /dev/null +++ b/immutable/plugin/translations/mn.ts @@ -0,0 +1,1383 @@ + + + + + AppUpdateWid + + + Cancel failed,Being installed + 取消失败,安装中 + ᠦᠬᠡᠢᠰᠬᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ᠂ ᠤᠭᠰᠠᠷᠴᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + Being installed + ᠤᠭᠰᠠᠷᠴᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + Download succeeded! + ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠴᠢᠳᠠᠪᠠ! + + + + + + Update succeeded , It is recommended that you restart later! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠪᠠ᠂ ᠤᠳᠠᠰᠬᠢᠭᠠᠳ ᠳᠠᠬᠢᠵᠤ ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ ᠵᠢ ᠵᠦᠪᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ! + + + + + + + Version: + ᠬᠡᠪᠯᠡᠯ: + + + + + + Download finished,it is recommended that you restart later to use the new version. + ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠳᠠᠭᠤᠰᠬᠠᠭᠠᠳ ᠂ ᠳᠠᠬᠢᠨ ᠤᠭᠰᠠᠷᠠᠬᠤ ᠶᠢ ᠰᠠᠨᠠᠭᠤᠯᠤᠨ᠎ᠠ ᠃ + + + + + reboot + ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ᠃ + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠪᠠ᠂ ᠤᠳᠠᠰᠬᠢᠭᠠᠳ ᠳᠠᠩᠰᠠᠨ ᠡᠴᠡ ᠬᠠᠰᠤᠭᠰᠠᠨ ᠤ᠋ ᠳᠠᠷᠠᠭ᠎ᠠ ᠳᠠᠬᠢᠨ ᠰᠢᠨ᠎ᠡ ᠪᠡᠷ ᠨᠡᠪᠳᠡᠷᠡᠬᠦ ᠵᠢ ᠵᠦᠪᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ! + + + + + + + Update succeeded! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠪᠠ! + + + + + + + + Update has been canceled! + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠨᠢᠭᠡᠨᠳᠡ ᠦᠬᠡᠢᠰᠬᠡᠪᠡ! + + + + + + + + Update failed! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ! + + + + + Failure reason: + ᠢᠯᠠᠭᠳᠠᠭᠰᠠᠨ ᠰᠢᠯᠳᠠᠭᠠᠨ: + + + Network exception, unable to check for updates! + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠡᠪ ᠦᠨ ᠪᠤᠰᠤ ᠪᠠᠶᠢᠵᠤ ᠂ ᠪᠠᠶᠢᠴᠠᠭᠠᠵᠤ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠶᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠭᠡᠶ ᠃ + + + No room, upgrade failed. + ᠣᠷᠣᠨ ᠵᠠᠶ ᠬᠦᠷᠦᠯᠴᠡᠬᠦ ᠦᠭᠡᠶ ᠂ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠢᠯᠠᠭᠳᠠᠨ᠎ᠠ ᠃ + + + Battery level is below 50%,and upgrade failed. + ᠴᠠᠬᠢᠯᠭᠠᠨ ᠤ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠳᠣᠣᠷ᠎ᠠ ᠂ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠨ᠎ᠠ ᠃ + + + Update failed! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ! + + + Error Code: + ᠪᠤᠷᠤᠭᠤ ᠨᠣᠮᠧᠷ ᠃ + + + + There are unresolved dependency conflicts in this update,Please select update all + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠰᠢᠢᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ ᠳᠦᠰᠢᠭᠯᠡᠯ ᠤᠷᠤᠰᠢᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠵᠢ ᠰᠤᠩᠭᠤᠭᠠᠷᠠᠢ + + + + + Prompt information + ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ᠵᠢᠨ ᠮᠡᠳᠡᠭᠡ ᠵᠠᠩᠬᠢ + + + + Update ALL + ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + + + + + Cancel + ᠦᠬᠡᠢᠰᠬᠡᠬᠦ + + + + No Content. + ᠳᠦᠷ ᠠᠭᠤᠯᠭ᠎ᠠ ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ. + + + + There are + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠳᠦᠰᠢᠭᠯᠡᠯ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠤᠷᠤᠰᠢᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠤᠳᠠᠬᠤ ᠦᠬᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠨ᠎ᠠ + + + + packages going to be removed,Please confirm whether to accept! + ᠨᠢᠭᠡ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠳᠠᠭᠤᠰᠬᠠᠪᠠ! + + + + Cumulative updates + ᠬᠤᠷᠠᠮᠳᠤᠭᠤᠯᠭ᠎ᠠ ᠰᠢᠨᠡᠳᠭᠡᠨ᠎ᠡ ᠃ + + + packages are going to be removed,Please confirm whether to accept! + ᠨᠢᠭᠡ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠬᠤ ᠬᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠬᠦ ᠡᠰᠡᠬᠦ ᠢ᠋ ᠪᠠᠳᠤᠯᠠᠭᠠᠷᠠᠢ! + + + + version: + ᠬᠡᠪᠯᠡᠯ: + + + The update stopped because of low battery. + ᠳ᠋ᠢᠶᠠᠨ ᠤ᠋ᠤᠢ ᠵᠢᠨ ᠴᠠᠬᠢᠯᠭᠠᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠨᠡᠯᠢᠶᠡᠳ ᠳᠤᠤᠷ᠎ᠠ᠂ ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠨᠢᠭᠡᠨᠳᠡ ᠦᠬᠡᠢᠰᠬᠡᠭᠳᠡᠪᠡ. + + + The system update requires that the battery power is not less than 50% + ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠳ᠋ᠢᠶᠠᠨ ᠤ᠋ᠤᠢ ᠵᠢᠨ ᠴᠠᠬᠢᠯᠭᠠᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ50% ᠡᠴᠡ ᠳᠤᠤᠷ᠎ᠠ ᠪᠠᠢᠵᠤ ᠪᠤᠯᠬᠤ ᠦᠬᠡᠢ + + + pkg will be uninstall! + 个软件包将被卸载! + + + + + + + + + + + + Update + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + details + ᠳᠡᠯᠭᠡᠷᠡᠩᠭᠦᠢ ᠪᠠᠢᠳᠠᠯ + + + + + Update log + ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠰᠡᠨ ᠡᠳᠦᠷ ᠤ᠋ᠨ ᠳᠡᠮᠳᠡᠭᠯᠡᠯ + + + Newest: + 最新: + + + + Download size: + ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠶᠡᠬᠡ ᠪᠠᠭ᠎ᠠ: + + + + Install size: + ᠤᠭᠰᠠᠷᠬᠤ ᠶᠡᠬᠡ ᠪᠠᠭ᠎ᠠ: + + + + Current version: + ᠤᠳᠤᠬᠠᠨ ᠤ᠋ ᠬᠡᠪᠯᠡᠯ: + + + back + 收起 + + + The battery is below 50% and the update cannot be downloaded + 电池电量低于 50%,无法下载更新 + + + OK + OK + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + ᠳᠠᠩ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠨᠢ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ᠂ ᠬᠡᠷᠪᠡ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠴᠢᠬᠤᠯᠠᠳᠠ ᠪᠤᠯ ᠳᠤᠪᠴᠢᠳᠠᠵᠤ ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠡᠷᠡᠢ. + + + + Do not backup, continue to update + ᠨᠦᠬᠡᠴᠯᠡᠡᠬᠦ ᠦᠬᠡᠢ᠂ ᠦᠷᠬᠦᠯᠵᠢᠯᠡᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠨ᠎ᠡ + + + + This time will no longer prompt + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠳᠠᠬᠢᠵᠤ ᠰᠠᠨᠠᠭᠤᠯᠬᠤ ᠦᠬᠡᠢ + + + + Ready to update + 准备更新 + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠪᠡᠷ ᠪᠡᠯᠡᠳᠬᠡᠬᠦ + + + + downloaded + 已下载 + ᠨᠢᠭᠡᠨᠳᠡ ᠪᠠᠭᠤᠯᠭᠠᠪᠠ + + + Ready to install + 准备安装 + + + + + downloading + ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + calculating + 计算中 + ᠪᠤᠳᠤᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + No content. + ᠳᠦᠷ ᠠᠭᠤᠯᠭ᠎ᠠ ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ. + + + + DateTimeUtils + + + No information! + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠳᠡᠬᠡ ᠦᠬᠡᠢ! + + + + HistoryUpdateListWig + + + Success + ᠰᠢᠨᠡᠴᠢᠯᠡᠪᠡ + + + + Failed + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ + + + + QObject + + + system upgrade new backup + ᠰᠢᠰᠲ᠋ᠧᠮ ᠳᠡᠰ ᠳᠡᠪᠰᠢᠵᠤ ᠰᠢᠨ᠎ᠡ ᠨᠦᠬᠡᠴᠡ ᠪᠠᠢᠭᠤᠯᠬᠤ + + + + system upgrade increment backup + ᠰᠢᠰᠲ᠋ᠧᠮ ᠳᠡᠰ ᠳᠡᠪᠰᠢᠵᠤ ᠨᠦᠬᠡᠴᠡ ᠵᠢ ᠨᠡᠮᠡᠭᠳᠡᠬᠦᠯᠬᠦ + + + + SetWidget + + + + Close + ᠬᠠᠭᠠᠬᠤ + + + + Advanced Option + ᠳᠡᠭᠡᠳᠦ ᠵᠡᠷᠭᠡ ᠶᠢᠨ ᠰᠣᠩᠭᠣᠯᠲᠠ ᠃ + + + + Server address settings + ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠦᠷ ᠦᠨ ᠬᠠᠶᠢᠭ ᠢ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠨ᠎ᠠ ᠃ + + + + If internal services, change the server address. + ᠬᠡᠷᠪᠡ ᠳᠣᠲᠣᠭᠠᠳᠤ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠪᠣᠯ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠦᠷ ᠦᠨ ᠬᠠᠶᠢᠭ ᠢᠶᠠᠨ ᠥᠭᠡᠷᠡᠴᠢᠯᠡᠬᠦ ᠪᠣᠯᠪᠠᠤ ᠃ + + + + Port ID + ᠦᠵᠦᠭᠦᠷ ᠦᠨ ᠤᠷᠢᠶ᠎ᠠ ᠃ + + + + Address + ᠬᠠᠶᠢᠭ ᠃ + + + + reset + ᠳᠠᠬᠢᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠨ᠎ᠠ ᠃ + + + + Cancel + ᠦᠬᠡᠢᠰᠬᠡᠬᠦ + + + + + OK + ᠪᠠᠰᠠ ᠪᠣᠯᠣᠨ᠎ᠠ ᠃ + + + + Modification failed! + ᠭᠡᠷᠡᠴᠢᠯᠡᠬᠦ ᠢᠯᠠᠭᠳᠠᠭᠰᠠᠨ + + + + Attention + ᠠᠩᠬᠠᠷᠬᠤ ᠴᠢᠳᠠᠯ ᠃ + + + + TabWid + + + + + + + + + + + + Check Update + ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠬᠤ + + + initializing + 初始化中 + + + + + + + + + + + + UpdateAll + ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + Your system is the latest! + 您的系统已是最新! + + + + + No Information! + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠳᠡᠬᠡ ᠦᠬᠡᠢ! + + + Last refresh: + 检查时间: + + + + Downloading and installing updates... + ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠶᠠᠭ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠤᠭᠰᠠᠷᠴᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + Update now + 立即更新 + + + Cancel update + 取消更新 + + + + + Being updated... + ᠶᠠᠭ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + + Updatable app detected on your system! + ᠰᠢᠰᠲ᠋ᠧᠮ ᠳ᠋ᠤ᠌ ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠰᠡᠨ ᠬᠡᠷᠡᠭᠯᠡᠬᠡ ᠪᠠᠢᠬᠤ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠮᠡᠳᠡᠪᠡ! + + + + The backup restore partition could not be found. The system will not be backed up in this update! + ᠨᠦᠬᠡᠴᠡ ᠵᠢ ᠰᠡᠷᠬᠦᠬᠡᠭᠰᠡᠨ ᠬᠤᠪᠢᠶᠠᠷᠢ ᠬᠡᠰᠡᠭ ᠢ᠋ ᠡᠷᠢᠵᠤ ᠤᠯᠤᠭᠰᠠᠨ ᠦᠬᠡᠢ᠂ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ! + + + + Kylin backup restore tool is doing other operations, please update later. + ᠴᠢ ᠯᠢᠨ ᠨᠦᠬᠡᠴᠡ ᠵᠢ ᠰᠡᠷᠬᠦᠬᠡᠬᠦ ᠪᠠᠭᠠᠵᠢ ᠤᠳᠤ ᠪᠡᠷ ᠪᠤᠰᠤᠳ ᠠᠵᠢᠯᠯᠠᠬᠤᠢ ᠵᠢ ᠬᠦᠢᠴᠡᠳᠬᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠤᠳᠠᠰᠬᠢᠭᠠᠳ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠡᠷᠡᠢ. + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + ᠡᠬᠢ ᠬᠠᠮᠢᠶᠠᠷᠤᠭᠴᠢ ᠵᠢᠨ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠤᠭᠰᠠᠨ ᠹᠠᠢᠯ ᠬᠡᠪ ᠤ᠋ᠨ ᠪᠤᠰᠤ᠂ ᠳᠦᠷ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ! + + + + Backup already, no need to backup again. + ᠨᠢᠬᠡᠨᠳᠡ ᠨᠦᠬᠡᠴᠡᠯᠡᠪᠡ᠂ ᠳᠠᠬᠢᠵᠤ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠴᠢᠬᠤᠯᠠ ᠦᠬᠡᠢ. + + + + Start backup,getting progress + ᠡᠬᠢᠯᠡᠵᠤ ᠨᠦᠬᠡᠴᠡᠯᠡᠪᠡ᠂ ᠤᠳᠤ ᠶᠠᠭ ᠠᠬᠢᠴᠠ ᠵᠢ ᠤᠯᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + Kylin backup restore tool does not exist, this update will not backup the system! + ᠴᠢ ᠯᠢᠨ ᠨᠦᠬᠡᠴᠡ ᠵᠢ ᠰᠡᠷᠬᠦᠬᠡᠬᠦ ᠪᠠᠭᠠᠵᠢ UUID ᠢ᠋/ ᠵᠢ ᠡᠷᠢᠵᠤ ᠤᠯᠬᠤ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ᠂ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ! + + + + + + + + + + + + Cancel + ᠦᠬᠡᠢᠰᠬᠡᠬᠦ + + + + Calculated + ᠪᠤᠳᠤᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠰᠢᠢᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ ᠳᠦᠰᠢᠭᠯᠡᠯ ᠤᠷᠤᠰᠢᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠬᠠᠮᠢᠶᠠᠷᠤᠭᠴᠢ ᠲᠠᠢ ᠬᠠᠷᠢᠯᠴᠠᠭᠠᠷᠠᠢ! + + + + + + + + Prompt information + ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ᠵᠢᠨ ᠮᠡᠳᠡᠭᠡ ᠵᠠᠩᠬᠢ + + + + Sure + ᠪᠤᠯᠤᠨ᠎ᠠ + + + + + In the download + ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + calculating + 计算中 + ᠪᠤᠳᠤᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + In the install... + 安装中... + + + + Backup complete. + ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ. + + + + System is backing up... + ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + Backup interrupted, stop updating! + ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠶᠠᠪᠤᠴᠠ ᠳᠠᠰᠤᠯᠠᠭᠳᠠᠪᠠ᠂ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠪᠡᠨ ᠵᠤᠭᠰᠤᠭᠠᠷᠠᠢ! + + + Backup finished! + 备份完成! + + + + Kylin backup restore tool exception: + ᠴᠢ ᠯᠢᠨ ᠨᠦᠬᠡᠴᠡ ᠵᠢ ᠰᠡᠷᠬᠦᠬᠡᠬᠦ ᠪᠠᠭᠠᠵᠢ ᠬᠡᠪ ᠤ᠋ᠨ ᠪᠤᠰᠤ: + + + + There will be no backup in this update! + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ! + + + + The status of backup completion is abnormal + 备份完成状态异常 + ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ ᠳᠠᠭᠤᠰᠤᠭᠰᠠᠨ ᠪᠠᠢᠳᠠᠯ ᠬᠡᠪ ᠤ᠋ᠨ ᠪᠤᠰᠤ + + + + Getting update list + ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠰᠡᠨ ᠵᠢᠭᠰᠠᠭᠠᠯᠳᠠ ᠵᠢ ᠤᠳᠤ ᠶᠠᠭ ᠤᠯᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + Software source update successed: + 软件源更新成功: + ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠡᠬᠢ ᠵᠢ ᠰᠢᠨᠡᠴᠢᠯᠡᠪᠡ: + + + Software source update failed: + ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠡᠬᠢ ᠵᠢ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ: + + + Update software source : + 更新软件源进度: + + + + + Update + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + 本次更新存在无法解决的依赖冲突,请选择全盘更新 + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠰᠢᠢᠳᠪᠦᠷᠢᠯᠡᠬᠦ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ ᠳᠦᠰᠢᠭᠯᠡᠯ ᠤᠷᠤᠰᠢᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠪᠦᠬᠦ ᠲᠠᠪᠠᠭ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠵᠢ ᠰᠤᠩᠭᠤᠭᠠᠷᠠᠢ + + + + Dist-upgrade + 全盘更新 + ᠪᠦᠬᠦ ᠲᠠᠪᠠᠭ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + + The system is downloading the update! + ᠶᠠᠭ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ! + + + + + Downloading the updates... + ᠶᠠᠭ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + + Installing the updates... + ᠶᠠᠭ ᠤᠭᠰᠠᠷᠴᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + + + In the install + ᠤᠭᠰᠠᠷᠴᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + + Retry + ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠰᠢᠬᠤ + + + + + + + Network exception, unable to check for updates! + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠬᠡᠪ ᠦᠨ ᠪᠤᠰᠤ ᠪᠠᠶᠢᠵᠤ ᠂ ᠪᠠᠶᠢᠴᠠᠭᠠᠵᠤ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠶᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠭᠡᠶ ᠃ + + + + + + No room to backup,upgrade failed. + ᠪᠡᠯᠡᠳᠬᠡᠯ ᠣᠷᠣᠨ ᠵᠠᠶ ᠪᠠᠶᠢᠬᠤ ᠦᠭᠡᠢ ᠂ ᠳᠡᠰ ᠳᠡᠪᠰᠢᠬᠦ ᠳᠦ ᠢᠯᠠᠭᠳᠠᠨ᠎ᠠ ᠃ + + + + + + + Battery level is below 50%,and upgrade failed. + ᠴᠠᠬᠢᠯᠭᠠᠨ ᠤ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠳᠣᠣᠷ᠎ᠠ ᠂ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠨᠢ ᠢᠯᠠᠭᠳᠠᠨ᠎ᠠ ᠃ + + + + + Checking update failed! + ᠰᠢᠨᠡᠳᠬᠡᠨ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ ᠬᠡᠮᠵᠢᠬᠦ ᠢᠯᠠᠭᠳᠠᠯ ᠢ ᠪᠠᠶᠢᠴᠠᠭᠠᠨ᠎ᠠ ᠃ + + + Error Code: + ᠪᠤᠷᠤᠭᠤ ᠨᠣᠮᠧᠷ ᠃ + + + + The system is checking update : + ᠶᠠᠭ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠪᠠᠢᠨ᠎ᠠ: + + + Download Limit(Kb/s) + 下载限速(Kb/s) + + + + View history + ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠰᠡᠨ ᠲᠡᠤᠬᠡ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠦᠵᠡᠬᠦ + + + details + 详情 + + + + Update Settings + ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ + /upgrade/Update Settings + + + + Allowed to renewable notice + ᠬᠡᠷᠡᠭᠯᠡᠭᠡ ᠵᠢ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠦᠶ᠎ᠡ ᠵᠢᠨ ᠮᠡᠳᠡᠭᠳᠡᠯ ᠪᠠᠢᠨ᠎ᠠ + + + Backup current system before updates all + ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠡᠴᠡ ᠡᠮᠦᠨ᠎ᠡ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ + + + Download Limit(KB/s) + 下载限速(KB/s) + + + + It will be avaliable in the next download. + ᠡᠬᠢᠯᠡᠬᠦᠯᠦᠭᠰᠡᠨ ᠤ᠋ ᠬᠤᠢᠨ᠎ᠠ᠂ ᠳᠠᠷᠠᠭ᠎ᠠ ᠤᠳᠠᠭ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠦᠶ᠎ᠡ ᠳ᠋ᠤ᠌ ᠬᠤᠷᠳᠤᠴᠠ ᠵᠢ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠨ᠎ᠠ. + + + Automatically download and install updates + 自动下载和安装更新 + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + 开启后,当有可用网络和可用备份和恢复分区时,系统会自动下载和安装更新。 + + + Upgrade during poweroff + 关机检测更新 + + + Download Limit(kB/s) + 下载限速(kB/s) + + + + The system will automatically updates when there is an available network and backup. + ᠰᠦᠯᠵᠢᠶ᠎ᠡ ᠵᠢ ᠬᠡᠷᠡᠭᠯᠡᠵᠤ ᠪᠤᠯᠬᠤ ᠦᠶ᠎ᠡ ᠳ᠋ᠤ᠌᠂ ᠬᠡᠷᠪᠡ ᠨᠦᠬᠡᠴᠡ ᠲᠠᠢ ᠪᠤᠯ ᠰᠢᠰᠲ᠋ᠧᠮ ᠨᠢ ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠵᠢᠨ ᠵᠡᠷᠬᠡᠴᠡᠬᠡ ᠤᠭᠰᠠᠷᠴᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠳᠡᠨ᠎ᠡ. + + + + Ready to install + ᠤᠭᠰᠠᠷᠬᠤ ᠪᠡᠷ ᠪᠡᠯᠡᠳᠬᠡᠬᠦ + + + + + + + + + + + + + + + + Last Checked: + ᠪᠠᠢᠴᠠᠭᠠᠬᠤ ᠴᠠᠭ: + + + Your system is the latest:V10sp1- + 你的系统已是最新版本:V10sp1- + + + + + + + + + + + + + + No information! + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠳᠡᠬᠡ ᠦᠬᠡᠢ! + + + + Download Limit + ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠬᠤᠷᠳᠤᠴᠠ ᠵᠢᠨ ᠬᠢᠵᠠᠭᠠᠷᠯᠠᠯ + + + + Advanced + ᠦᠨᠳᠦᠷ ᠭᠦᠨ᠃ + + + + + Dependency conflict exists in this update,need to be completely repaired! + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠳᠦᠰᠢᠭᠯᠡᠯ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠤᠷᠤᠰᠢᠵᠤ ᠪᠠᠢᠨ᠎ᠠ ᠪᠦᠬᠦ ᠲᠠᠪᠠᠭ ᠢ᠋ ᠰᠡᠯᠪᠢᠨ ᠵᠠᠰᠠᠵᠤ ᠳᠠᠭᠤᠰᠤᠭᠰᠠᠨ ᠤ᠋ ᠳᠠᠷᠠᠭ᠎ᠠ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠡᠷᠡᠢ! + + + + There are + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠳᠦᠰᠢᠭᠯᠡᠯ ᠤ᠋ᠨ ᠮᠦᠷᠬᠦᠯᠳᠦᠬᠡᠨ ᠤᠷᠤᠰᠢᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠤᠳᠠᠬᠤ ᠦᠬᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠨ᠎ᠠ + + + + packages going to be removed,Please confirm whether to accept! + ᠨᠢᠭᠡ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠳᠠᠭᠤᠰᠬᠠᠪᠠ! + + + + packages are going to be removed,Please confirm whether to accept! + ᠨᠢᠭᠡ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠬᠤ ᠬᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠬᠦ ᠡᠰᠡᠬᠦ ᠢ᠋ ᠪᠠᠳᠤᠯᠠᠭᠠᠷᠠᠢ! + + + + trying to reconnect + ᠴᠦᠷᠬᠡᠯᠡᠬᠡ ᠵᠢ ᠳᠠᠬᠢᠵᠤ ᠳᠤᠷᠰᠢᠭᠠᠷᠠᠢ + + + + times + ᠤᠳᠠᠭ᠎ᠠ + + + back + 收起 + + + Auto-Update is backing up...... + 自动更新进程正在备份中...... + ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠠᠬᠢᠴᠠ ᠶᠠᠭ ᠨᠦᠬᠡᠴᠡᠯᠡᠭᠳᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ...... + + + + The updater is NOT start + ᠠᠷᠤ ᠲᠠᠪᠴᠠᠩ ᠤ᠋ᠨ ᠫᠷᠤᠭ᠍ᠷᠠᠮ ᠢ᠋ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠭᠡᠳᠦᠶ + + + + The progress is updating... + ᠶᠠᠭ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠵᠢᠨ ᠵᠡᠷᠬᠡᠴᠡᠬᠡ ᠤᠭᠰᠠᠷᠴᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + + The progress is installing... + ᠶᠠᠭ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠵᠢᠨ ᠵᠡᠷᠬᠡᠴᠡᠬᠡ ᠤᠭᠰᠠᠷᠴᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + The updater is busy! + ᠠᠷᠤ ᠲᠠᠪᠴᠠᠩ ᠤ᠋ᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠳᠡᠭᠰᠡᠨ ᠫᠷᠤᠭ᠍ᠷᠠᠮ ᠶᠠᠭ ᠡᠵᠡᠯᠡᠭᠳᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ! + + + + + Updating the software source + ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠡᠬᠢ ᠶᠠᠭ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + The battery is below 50% and the update cannot be downloaded + 电池电量低于 50%,无法下载更新 + + + + + + + OK + OK + + + + Please back up the system before all updates to avoid unnecessary losses + ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠡᠴᠡ ᠡᠮᠦᠨ᠎ᠡ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ᠂ ᠬᠤᠬᠢᠷᠠᠯ ᠭᠠᠷᠬᠤ ᠡᠴᠡ ᠰᠡᠷᠬᠡᠢᠯᠡᠬᠡᠷᠡᠢ + + + + Only Update + ᠰᠢᠭ᠋ᠤᠳ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + Back And Update + ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + + + + update has been canceled! + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠨᠢᠭᠡᠨᠳᠡ ᠦᠬᠡᠢᠰᠬᠡᠪᠡ! + + + + + This update has been completed! + 本次更新已完成! + ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠨᠢᠭᠡᠨᠳᠡ ᠳᠠᠭᠤᠰᠬᠠᠪᠠ! + + + Your system is the latest:V10 + ᠲᠠᠨ ᠤ᠋ ᠰᠢᠰᠲ᠋ᠧᠮ ᠬᠠᠮᠤᠭ ᠤ᠋ᠨ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠪᠠᠢᠨ᠎ᠠ:V10 + + + + Keeping update + ᠦᠷᠬᠦᠯᠵᠢᠯᠡᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + ᠪᠦᠬᠦᠨ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠡᠴᠡ ᠡᠮᠦᠨ᠎ᠡ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ᠂ ᠬᠤᠬᠢᠷᠠᠯ ᠭᠠᠷᠬᠤ ᠡᠴᠡ ᠰᠡᠷᠬᠡᠢᠯᠡᠬᠡᠷᠡᠢ! + + + + Insufficient disk space to download updates! + ᠳ᠋ᠢᠰᠺ ᠤ᠋ᠨ ᠣᠷᠣᠨ ᠵᠠᠶ ᠬᠦᠷᠦᠯᠴᠡᠬᠦ ᠦᠭᠡᠢ ᠂ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠭᠡᠢ! + + + + supposed + ᠪᠠᠷᠤᠭᠴᠠᠯᠠᠭᠰᠠᠨ ᠡᠵᠡᠯᠡᠯ + + + + s + ᠰᠸᠺᠦᠨ᠋ᠲ + + + + min + ᠮᠢᠨᠦ᠋ᠲ + + + + h + ᠴᠠᠭ + + + + Automatically updates + ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ + + + + The update stopped because of low battery. + ᠳ᠋ᠢᠶᠠᠨ ᠤ᠋ᠤᠢ ᠵᠢᠨ ᠴᠠᠬᠢᠯᠭᠠᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ ᠨᠡᠯᠢᠶᠡᠳ ᠳᠤᠤᠷ᠎ᠠ᠂ ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠨᠢᠭᠡᠨᠳᠡ ᠦᠬᠡᠢᠰᠬᠡᠭᠳᠡᠪᠡ. + + + + The system update requires that the battery power is not less than 50% + ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠳ᠋ᠢᠶᠠᠨ ᠤ᠋ᠤᠢ ᠵᠢᠨ ᠴᠠᠬᠢᠯᠭᠠᠨ ᠬᠡᠮᠵᠢᠶ᠎ᠡ 50% ᠡᠴᠡ ᠳᠤᠤᠷ᠎ᠠ ᠪᠠᠢᠵᠤ ᠪᠤᠯᠬᠤ ᠦᠬᠡᠢ + + + Part of the update failed! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ! + + + Failure reason: + 失败原因: + ᠢᠯᠠᠭᠳᠠᠭᠰᠠᠨ ᠰᠢᠯᠳᠠᠭᠠᠨ: + + + + Finish the download! + ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ! + + + The system has download the update! + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠠᠭᠤᠯᠭ᠎ᠠ ᠵᠢ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ! + + + It's need to reboot to make the install avaliable + ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠨᠢᠭᠡᠨᠳᠡ ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ᠂ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠤᠭᠰᠠᠷᠬᠤ ᠤᠤ + + + Reboot notification + ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦᠯᠬᠦ ᠰᠠᠨᠠᠭᠤᠯᠭ᠎ᠠ + + + Reboot rightnow + ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠬᠦᠯᠵᠤ ᠤᠭᠰᠠᠷᠬᠤ + + + + Later + ᠤᠳᠠᠰᠬᠢᠭᠠᠳ ᠤᠭᠰᠠᠷᠬᠤ + + + Part of the update success! + ᠬᠡᠰᠡᠭ ᠪᠦᠯᠦᠭ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠵᠢ ᠰᠢᠨᠡᠴᠢᠯᠡᠪᠡ! + + + All the update has been downloaded. + ᠪᠦᠬᠦᠢᠯᠡ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠠᠭᠤᠯᠭ᠎ᠠ ᠵᠢ ᠨᠢᠭᠡᠨᠳᠡ ᠪᠠᠭᠤᠯᠭᠠᠪᠠ. + + + + An important update is in progress, please wait. + ᠶᠠᠭ ᠨᠢᠭᠡ ᠳᠦᠷᠦᠯ ᠤ᠋ᠨ ᠴᠢᠬᠤᠯᠠ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠶᠠᠪᠤᠭᠳᠠᠭᠤᠯᠵᠤ ᠪᠠᠢᠨ᠎ᠠ᠂ ᠳᠦᠷ ᠬᠦᠯᠢᠶᠡᠬᠡᠷᠡᠢ. + + + Failed to write configuration file, this update will not back up the system! + ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠤᠯᠳᠠ ᠵᠢᠨ ᠹᠠᠢᠯ ᠢ᠋ ᠪᠢᠴᠢᠵᠤ ᠤᠷᠤᠭᠤᠯᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ᠂ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ! + + + Insufficient backup space, this update will not backup your system! + ᠨᠦᠬᠡᠴᠡ ᠵᠢᠨ ᠤᠷᠤᠨ ᠵᠠᠢ ᠬᠦᠷᠦᠯᠴᠡᠬᠦ ᠦᠬᠡᠢ᠂ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ! + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + ᠴᠢ ᠯᠢᠨ ᠨᠦᠬᠡᠴᠡ ᠵᠢ ᠰᠡᠷᠬᠦᠬᠡᠬᠦ ᠪᠠᠭᠠᠵᠢ UUID ᠢ᠋/ ᠵᠢ ᠡᠷᠢᠵᠤ ᠤᠯᠬᠤ ᠵᠢᠨ ᠠᠷᠭ᠎ᠠ ᠦᠬᠡᠢ᠂ ᠳᠤᠰ ᠤᠳᠠᠭ᠎ᠠ ᠵᠢᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠳ᠋ᠤ᠌ ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠨᠦᠬᠡᠴᠡᠯᠡᠬᠦ ᠦᠬᠡᠢ! + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + 备份还原分区异常,您可能没有备份还原分区。更多详细信息,可以参看/var/log/backup.log + + + + Calculating Capacity... + ᠪᠤᠳᠤᠬᠤ ᠰᠢᠰᠲ᠋ᠧᠮ ᠤ᠋ᠨ ᠤᠷᠤᠨ ᠵᠠᠢ ᠵᠢᠨ ᠶᠡᠬᠡ ᠪᠠᠭ᠎ᠠ... + + + The system backup partition is not detected. Do you want to continue updating? + 未检测到系统备份还原分区,是否继续更新? + + + + Calculating + ᠪᠤᠳᠤᠵᠤ ᠪᠠᠢᠨ᠎ᠠ + + + + + The system is updating... + ᠶᠠᠭ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠪᠡᠷ ᠪᠡᠯᠡᠳᠬᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + Reboot + ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ᠃ + + + + + + + + + + Your system is the latest: + ᠲᠠᠨ ᠤ ᠰᠢᠰᠲ᠋ᠧᠮ ᠪᠣᠯ ᠬᠠᠮᠤᠭ ᠰᠢᠨ᠎ᠡ ᠬᠡᠪᠯᠡᠯ ᠪᠣᠯᠣᠨ᠎ᠠ ᠃ + + + + No room, upgrade failed. + ᠣᠷᠣᠨ ᠵᠠᠶ ᠬᠦᠷᠦᠯᠴᠡᠬᠦ ᠦᠭᠡᠶ ᠂ ᠰᠢᠨᠡᠳᠬᠡᠬᠦ ᠢᠯᠠᠭᠳᠠᠨ᠎ᠠ ᠃ + + + + + + + + Error Code: + + + + + Rollback to previous version + ᠳᠡᠭᠡᠷ᠎ᠡ ᠨᠢᠭᠡ ᠬᠡᠪᠯᠡᠯ ᠳᠡᠪᠲᠡᠷ ᠲᠦ ᠪᠤᠴᠠᠵᠤ ᠢᠷᠡᠪᠡ ᠃ + + + + start + ᠡᠬᠢᠯᠡᠪᠡ ᠃ + + + + + + reboot rightnow + ᠳᠠᠷᠤᠢ ᠲᠦᠷᠭᠡᠨ ᠳᠠᠬᠢᠨ ᠰᠡᠩᠭᠡᠷᠡᠭᠦᠯᠪᠡ ᠃ + + + + Reboot failed! + ᠢᠯᠠᠭᠳᠠᠯ ᠢ ᠳᠠᠬᠢᠨ ᠡᠬᠢᠯᠡᠭᠦᠯᠦᠨ᠎ᠡ ᠃ + + + + preparing to backup + ᠪᠡᠯᠡᠳᠬᠡᠵᠦ ᠪᠡᠯᠡᠳᠭᠡᠵᠦ ᠪᠡᠯᠡᠳᠬᠡᠵᠦ ᠪᠠᠶᠢᠨ᠎ᠠ᠃ + + + + + + Update failed! + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ! + + + + + The system has download the update,and you are suggested to reboot to use the new version. + ᠰᠢᠨᠡᠴᠢᠯᠡᠯᠲᠡ ᠶᠢ ᠨᠢᠭᠡᠨᠲᠡ ᠪᠠᠭᠤᠯᠭᠠᠵᠠᠢ ᠂ ᠳᠠᠬᠢᠨ ᠤᠭᠰᠠᠷᠠᠬᠤ ᠶᠢ ᠰᠠᠨᠠᠭᠤᠯᠵᠠᠢ ᠃ + + + + insufficient backup space + ᠪᠡᠯᠡᠳᠬᠡᠯ ᠦᠨ ᠣᠷᠣᠨ ᠵᠠᠶ ᠬᠦᠷᠦᠯᠴᠡᠬᠦ ᠦᠭᠡᠶ ᠃ + + + + backup start success + ᠪᠡᠯᠡᠳᠬᠡᠯ ᠡᠬᠢᠯᠡᠨ᠎ᠡ ᠃ + + + + backup failed + ᠪᠡᠯᠡᠳᠬᠡᠯ ᠢᠯᠠᠭᠳᠠᠨ᠎ᠠ ᠃ + + + + Auto-Update progress is installing new file: + 系统自动更新功能正在安装新文件: + ᠰᠢᠰᠲ᠋ᠧᠮ ᠨᠢ ᠴᠢᠳᠠᠪᠬᠢ ᠵᠢ ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠳᠠᠭᠤᠰᠤᠭᠠᠳ ᠰᠢᠨ᠎ᠡ ᠹᠠᠢᠯ ᠢ᠋ ᠶᠠᠭ ᠤᠭᠰᠠᠷᠴᠤ ᠪᠠᠢᠨ᠎ᠠ: + + + + Auto-Update progress finished! + 系统自动更新完成! + ᠰᠢᠰᠲ᠋ᠧᠮ ᠢ᠋ ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ! + + + + Auto-Update progress fail in backup! + 自动更新安装时备份失败! + ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠤᠭᠰᠠᠷᠬᠤ ᠦᠶ᠎ᠡ ᠳ᠋ᠤ᠌ ᠨᠦᠬᠡᠴᠡᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ! + + + Failed in updating because of broken environment. + ᠤᠷᠴᠢᠨ ᠳᠤᠭᠤᠷᠢᠨ ᠡᠪᠳᠡᠭᠳᠡᠭᠰᠡᠨ ᠡᠴᠡ ᠪᠤᠯᠵᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ. + + + + It's fixing up the environment... + ᠰᠢᠨ᠎ᠡ ᠤᠷᠴᠢᠨ ᠳᠤᠭᠤᠷᠢᠨ ᠢ᠋ ᠵᠠᠰᠠᠨ ᠰᠢᠨᠡᠳᠬᠡᠵᠤ ᠪᠠᠢᠨ᠎ᠠ... + + + + Upgrade + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + UpdateDbus + + + System-Upgrade + ᠰᠢᠰᠲ᠋ᠧᠮ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + ukui-control-center-update + ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ- ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ + + + + UpdateLog + + + Update log + ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠰᠡᠨ ᠡᠳᠦᠷ ᠤ᠋ᠨ ᠳᠡᠮᠳᠡᠭᠯᠡᠯ + + + + UpdateSource + + + Connection failed, please reconnect! + ᠴᠦᠷᠬᠡᠯᠡᠵᠤ ᠴᠢᠳᠠᠭᠰᠠᠨ ᠦᠬᠡᠢ᠂ ᠳᠠᠬᠢᠵᠤ ᠰᠢᠨ᠎ᠡ ᠪᠡᠷ ᠴᠦᠷᠬᠡᠯᠡᠬᠡᠷᠡᠢ! + + + + Upgrade + + + Upgrade + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + View history + ᠰᠢᠨᠡᠴᠢᠯᠡᠭᠰᠡᠨ ᠲᠡᠤᠬᠡ ᠵᠢ ᠪᠠᠢᠴᠠᠭᠠᠵᠤ ᠦᠵᠡᠬᠦ + /Upgrade/View history + + + + Update Settings + ᠰᠢᠨᠡᠴᠢᠯᠡᠯ ᠢ᠋ ᠳᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ + /Upgrade/Update Settings + + + + Allowed to renewable notice + ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠪᠤᠯᠬᠤ ᠬᠡᠷᠡᠭᠯᠡᠭᠡ ᠵᠢ ᠮᠡᠳᠡᠭᠳᠡᠬᠦ ᠵᠢ ᠵᠦᠪᠰᠢᠶᠡᠷᠡᠨ᠎ᠡ + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + ᠠᠦ᠋ᠲ᠋ᠣ᠋ ᠪᠡᠷ ᠪᠠᠭᠤᠯᠭᠠᠬᠤ ᠪᠠ ᠤᠭᠰᠠᠷᠴᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + details + 详情 + + + + show details + ᠳᠡᠯᠭᠡᠷᠡᠩᠬᠦᠢ ᠪᠠᠢᠳᠠᠯ ᠢ᠋ ᠤᠢᠯᠠᠭᠠᠬᠤ + + + + uninstall and update + ᠪᠠᠭᠤᠯᠭᠠᠵᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + uninstall + 移除 + + + + cancel + ᠦᠬᠡᠢᠰᠬᠡᠬᠦ + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + ᠤᠷᠴᠢᠨ ᠳᠤᠭᠤᠷᠢᠨ ᠢ᠋ ᠵᠠᠰᠠᠨ ᠰᠢᠨᠡᠳᠬᠡᠵᠤ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠴᠢᠬᠤᠯᠠᠳᠠᠢ! + + + + There will be uninstall some packages to complete the update! + ᠤᠳᠠᠬᠤ ᠦᠬᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠬᠤ ᠬᠡᠰᠡᠭ ᠪᠦᠯᠦᠭ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠵᠢ ᠨᠢᠭᠡᠨᠳᠡ ᠰᠢᠨᠡᠴᠢᠯᠡᠵᠤ ᠳᠠᠭᠤᠰᠪᠠ! + + + + The following packages will be uninstalled: + ᠳᠠᠷᠠᠭᠠᠬᠢ ᠵᠢᠭᠰᠠᠭᠠᠯᠳᠠ ᠳ᠋ᠡᠬᠢ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠤᠳᠠᠬᠤ ᠦᠬᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠨ᠎ᠠ: + + + + PKG Details + ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭᠠᠨ ᠤ᠋ ᠳᠡᠯᠭᠡᠷᠡᠩᠬᠦᠢ ᠪᠠᠢᠳᠠᠯ + + + + + details + ᠳᠡᠯᠭᠡᠷᠡᠩᠭᠦᠢ ᠪᠠᠢᠳᠠᠯ + + + + Keep + ᠳᠡᠪᠴᠢᠬᠦ + + + + Remove + ᠰᠢᠯᠵᠢᠬᠦᠯᠦᠨ ᠬᠠᠰᠤᠬᠤ + + + + Attention on update + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ + + + + back + ᠬᠤᠷᠢᠶᠠᠬᠤ + + + + fixupdetaillist + + + No content. + ᠳᠦᠷ ᠳᠡᠯᠬᠡᠷᠡᠩᠬᠦᠢ ᠪᠠᠢᠳᠠᠯ ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ. + + + + Update Details + ᠳᠡᠯᠭᠡᠷᠡᠩᠬᠦᠢ ᠪᠠᠢᠳᠠᠯ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + Update + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + + m_updatelog + + + No content. + ᠳᠦᠷ ᠠᠭᠤᠯᠭ᠎ᠠ ᠪᠠᠢᠬᠤ ᠦᠬᠡᠢ. + + + + no content + ᠠᠭᠤᠯᠭ᠎ᠠ ᠶᠢ ᠨᠢ ᠳᠣᠢᠷ ᠠᠭᠤᠯᠭ᠎ᠠ ᠦᠭᠡᠢ ᠃ + + + + + Close + ᠬᠠᠭᠠᠬᠤ + + + Update Details + ᠳᠡᠯᠭᠡᠷᠡᠩᠬᠦᠢ ᠪᠠᠢᠳᠠᠯ ᠢ᠋ ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + No Contents + ᠠᠭᠤᠯᠭ᠎ᠠ ᠦᠭᠡᠢ ᠃ + + + Search content + ᠠᠭᠤᠯᠭ᠎ᠠ ᠵᠢ ᠬᠠᠢᠬᠤ + + + + History Log + ᠳᠡᠤᠬᠡᠨ ᠰᠢᠨᠡᠴᠢᠯᠡᠯ + + + + updatedeleteprompt + + Dependency conflict exists in this update! + 本次更新存在依赖冲突! + + + There will be uninstall some packages to complete the update! + 将卸载部分软件包以完成更新! + + + + The following packages will be uninstalled: + ᠳᠠᠷᠠᠭᠠᠬᠢ ᠵᠢᠭᠰᠠᠭᠠᠯᠳᠠ ᠳ᠋ᠡᠬᠢ ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭ᠎ᠠ ᠤᠳᠠᠬᠤ ᠦᠬᠡᠢ ᠪᠠᠭᠤᠯᠭᠠᠭᠳᠠᠨ᠎ᠠ: + + + + PKG Details + ᠰᠣᠹᠲ᠋ᠧᠠᠢᠢᠷ ᠤ᠋ᠨ ᠪᠠᠭᠯᠠᠭᠠᠨ ᠤ᠋ ᠳᠡᠯᠭᠡᠷᠡᠩᠬᠦᠢ ᠪᠠᠢᠳᠠᠯ + + + + Update + ᠰᠢᠨᠡᠴᠢᠯᠡᠬᠦ + + + details + 详情 + + + + Keep + ᠳᠡᠪᠴᠢᠬᠦ + + + + Remove + ᠬᠦᠯᠢᠶᠡᠬᠦ + + + Update Prompt + 更新提示 + + + back + 收起 + + + diff --git a/immutable/plugin/translations/tr.qm b/immutable/plugin/translations/tr.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/plugin/translations/tr.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + details + + + + + + + + + + + + + + Update + + + + + + Update log + + + + + + + + Version: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + Cancel failed,Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + Being installed + + + + + + + Download finished,it is recommended that you restart later to use the new version. + + + + + + reboot + + + + + Download succeeded! + + + + + + + + Update succeeded! + + + + + + + + + Update has been canceled! + + + + + + + + + Update failed! + + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + + + Cancel + + + + + No Content. + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + Cumulative updates + + + + + version: + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to update + + + + + The updater is busy! + + + + + downloaded + + + + + + downloading + + + + + calculating + + + + + No content. + + + + + DateTimeUtils + + + No information! + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + SetWidget + + + + Close + + + + + Advanced Option + + + + + Server address settings + + + + + If internal services, change the server address. + + + + + Port ID + + + + + Address + + + + + update period + + + + + + + 1 day + + + + + + 7 days + + + + + + + + 1 month + + + + + + + 3 months + + + + + + + + half a year + + + + + + + + never + + + + + a month + + + + + 7 day + + + + + during the work time,there's no download + + + + + work time + + + + + to + + + + + reset + + + + + Cancel + + + + + + OK + + + + + Modification failed! + + + + + Attention + + + + + TabWid + + + + + + + + + + + + Check Update + + + + + + + + + Prompt information + + + + + Reboot + + + + + Later + + + + + + + + OK + + + + + + + + + + + Your system is the latest: + + + + + + + + + + + + + + + No information! + + + + + + + + + + + + + + + + + Last Checked: + + + + + Downloading and installing updates... + + + + + Keeping update + + + + + + + + + + + + + + + Cancel + + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + + + + + + + Update + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + + + + + + + + + UpdateAll + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + + + + + Dist-upgrade + + + + + Insufficient disk space to download updates! + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + Sure + + + + + supposed + + + + + + The system is downloading the update! + + + + + + Downloading the updates... + + + + + + Installing the updates... + + + + + s + + + + + min + + + + + h + + + + + + + + + In the install + + + + + + In the download + + + + + calculating + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + The status of backup completion is abnormal + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + + Retry + + + + + + + + + Error Code: + + + + + SystemUpdate + + + + + feedback UI end failed! + + + + + + System-Upgrade + + + + + + ukui-control-center-update + + + + + feedback UI start failed! + + + + + + + + Network exception, unable to check for updates! + + + + + No room, upgrade failed. + + + + + + Checking update failed! + + + + + + No Information! + + + + + The system is checking update : + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Download Limit + + + + + It will be avaliable in the next download. + + + + + Automatically updates + + + + + The system will automatically updates when there is an available network and backup. + + + + + Accept beta version and + + + + + to help improving the system. + + + + + provide feedback + + + + + Rollback to previous version + + + + + start + + + + + View history + + + + + Ready to install + + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + The updater is NOT start + + + + + + The progress is updating... + + + + + + + + The progress is installing... + + + + + + + + The updater is busy! + + + + + + Updating the software source + + + + + The update stopped because of low battery. + + + + + The system update requires that the battery power is not less than 50% + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + Calculating Capacity... + + + + + This update has been completed! + + + + + + + + update has been canceled! + + + + + Finish the download! + + + + + + The system has download the update,and you are suggested to reboot to use the new version. + + + + + + + reboot rightnow + + + + + Advanced + + + + + Reboot failed! + + + + + + + Update failed! + + + + + + + No room to backup,upgrade failed. + + + + + + + + Battery level is below 50%,and upgrade failed. + + + + + preparing to backup + + + + + An important update is in progress, please wait. + + + + + insufficient backup space + + + + + backup start success + + + + + backup failed + + + + + + The system is updating... + + + + + Calculating + + + + + Auto-Update progress is installing new file: + + + + + Auto-Update progress finished! + + + + + Auto-Update progress fail in backup! + + + + + It's fixing up the environment... + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + View history + + /Upgrade/View history + + + + Update Settings + + /Upgrade/Update Settings + + + + Allowed to renewable notice + + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + + show details + + + + + uninstall and update + + + + + cancel + + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Attention on update + + + + + back + + + + + fixupdetaillist + + + No content. + + + + + Update Details + + + + + Update + + + + + m_updatelog + + + No content. + + + + + no content + + + + + History Log + + + + + + Close + + + + + updatedeleteprompt + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + Keep + + + + + Remove + + + + + Update + + + + diff --git a/immutable/plugin/translations/zh_CN.qm b/immutable/plugin/translations/zh_CN.qm new file mode 100644 index 0000000..a8cde5e Binary files /dev/null and b/immutable/plugin/translations/zh_CN.qm differ diff --git a/immutable/plugin/translations/zh_CN.ts b/immutable/plugin/translations/zh_CN.ts new file mode 100644 index 0000000..750d220 --- /dev/null +++ b/immutable/plugin/translations/zh_CN.ts @@ -0,0 +1,1395 @@ + + + + + AppUpdateWid + + + Cancel failed,Being installed + 正在安装,无法取消 + 正在安装,无法取消 + + + + Being installed + 正在安装更新 + + + + Download succeeded! + 下载成功! + + + + + + Update succeeded , It is recommended that you restart later! + 更新成功,建议稍后重启! + + + + + + + Version: + 版本: + + + + + + Download finished,it is recommended that you restart later to use the new version. + 更新下载已完成,重启使用新版本。 + + + + + reboot + 重启 + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + 更新成功,建议稍后注销后重新登录! + + + + + + + Update succeeded! + 更新成功! + + + + + + + + Update has been canceled! + 本次更新已取消! + + + + + + + + Update failed! + 更新异常! + + + + + Failure reason: + 失败原因: + + + Network exception, unable to check for updates! + 网络异常,检查更新异常! + + + No room, upgrade failed. + 磁盘空间不足,请清理磁盘后进行升级更新。 + + + Battery level is below 50%,and upgrade failed. + 电池电量低于50%,无法升级。 + + + Update failed! + 更新异常! + + + Error Code: + 错误码: + + + + There are unresolved dependency conflicts in this update,Please select update all + 本次更新存在无法解决的依赖,请选择全部更新 + + + + + Prompt information + 提示信息 + + + + Update ALL + 全部更新 + + + + + + + + Cancel + 取消 + + + + No Content. + 应用累积更新 + + + + There are + 本次更新存在依赖冲突,将卸载 + + + + packages going to be removed,Please confirm whether to accept! + 个软件包以完成本次更新。 + + + + Cumulative updates + 应用累积更新 + + + packages are going to be removed,Please confirm whether to accept! + 个软件包将被卸载,请确认是否接受! + + + + version: + 版本: + + + Reboot failed! + 重启失败! + + + The update stopped because of low battery. + 电池电量较低,系统更新已终止。 + + + The system update requires that the battery power is not less than 50% + 系统更新需要电池电量不低于50%时进行。 + + + pkg will be uninstall! + 个软件包将被卸载! + + + + + + + + + + + + Update + 更新 + + + + details + 详情 + + + + + Update log + 更新日志 + + + Newest: + 最新: + + + + Download size: + 下载大小: + + + + Install size: + 安装大小: + + + + Current version: + 当前版本: + + + back + 收起 + + + The battery is below 50% and the update cannot be downloaded + 电池电量低于 50%,无法下载更新 + + + OK + 确定 + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + 单个更新不会自动备份系统,如需备份,请点击全部更新。 + + + + Do not backup, continue to update + 不备份,继续更新 + + + + This time will no longer prompt + 本次更新不再提示 + + + + Ready to update + 准备更新 + 准备更新 + + + + downloaded + 已下载 + 已下载 + + + Ready to install + 准备安装 + + + + + downloading + 下载中 + + + + calculating + 计算中 + 计算中 + + + + No content. + 应用累积更新 + + + + DateTimeUtils + + + No information! + 尚未更新 + + + + HistoryUpdateListWig + + + Success + 更新成功 + + + + Failed + 更新失败 + + + + QObject + + + system upgrade new backup + 系统升级新建备份 + + + + system upgrade increment backup + 系统升级增量备份 + + + + SetWidget + + + Advanced Option + 高级选项 + + + + Server address settings + 服务器地址设置 + + + If there are internal services, you can change the server address. + 如果想使用内部服务,可以更换服务器地址 + + + Protocal + 协议 + + + close + 关闭 + + + + + Close + 关闭 + + + + If internal services, change the server address. + 如果想使用内部服务,可以更换服务器地址 + + + + Port ID + 端口 + + + + Address + 地址 + + + + reset + 恢复默认 + + + + Cancel + 取消 + + + + + OK + 确定 + + + + Modification failed! + 修改失败! + + + + Attention + 提示 + + + + TabWid + + + + + + + + + + + + Check Update + 检查更新 + + + initializing + 初始化中 + + + + + + + + + + + + UpdateAll + 全部更新 + + + Your system is the latest! + 您的系统已是最新! + + + + + No Information! + 系统未更新 + + + Last refresh: + 检查时间: + + + + Downloading and installing updates... + 正在下载并安装更新... + + + Update now + 立即更新 + + + Cancel update + 取消更新 + + + + + Being updated... + 正在更新... + + + + + Updatable app detected on your system! + 检测到系统有更新的应用。 + + + + The backup restore partition could not be found. The system will not be backed up in this update! + 未能找到备份还原分区,本次更新不会备份系统! + + + + Kylin backup restore tool is doing other operations, please update later. + 麒麟备份还原工具正在进行其他操作,请稍后更新。 + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + 源管理器配置文件异常,暂时无法更新! + + + + Backup already, no need to backup again. + 已备份,无需再次备份。 + + + + Start backup,getting progress + 开始备份,正在获取进度 + + + + Kylin backup restore tool does not exist, this update will not backup the system! + 麒麟备份还原工具无法找到UUID,本次更新不会备份系统! + + + + + + + + + + + + Cancel + 取消 + + + + Calculated + 计算完成 + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + 本次更新存在无法解决的依赖问题,请联系管理员! + + + + + + + + Prompt information + 提示信息 + + + + + + + + + + Your system is the latest: + 您的系统已是最新: + + + + Sure + 好的 + + + + + In the download + 下载中 + + + + calculating + 计算中 + 计算中 + + + In the install... + 安装中... + + + + Backup complete. + 备份完成。 + + + + System is backing up... + 正在备份系统... + + + + Backup interrupted, stop updating! + 备份过程被中断,停止更新! + + + Backup finished! + 备份完成! + + + + Kylin backup restore tool exception: + 麒麟备份还原工具异常: + + + + There will be no backup in this update! + 本次更新不会备份系统! + + + + The status of backup completion is abnormal + 备份完成状态异常 + 备份完成状态异常 + + + + Getting update list + 正在获取更新列表 + + + Software source update successed: + 软件源更新成功: + 软件源更新成功: + + + Software source update failed: + 软件源更新失败: + + + + + Update + 系统更新 + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + 本次更新存在无法解决的依赖冲突,请选择全盘更新 + 本次更新存在无法解决的依赖冲突,请选择全盘更新 + + + + Dist-upgrade + 全盘更新 + 全盘更新 + + + + + The system is downloading the update! + 正在下载更新 + + + + + Downloading the updates... + 正在下载更新...... + + + + + Installing the updates... + 正在安装更新...... + + + + + + In the install + 安装中 + + + + + Retry + 重试 + + + + The system is checking update : + 正在检测更新: + + + Download Limit(Kb/s) + 下载限速(Kb/s) + + + + View history + 更新历史 + + + details + 详情 + + + + Update Settings + 更新设置 + /upgrade/Update Settings + + + + Allowed to renewable notice + 有更新应用时通知 + + + Backup current system before updates all + 全部更新前备份系统 + + + Download Limit(KB/s) + 下载限速(KB/s) + + + + It will be avaliable in the next download. + 开启后会在下次下载时进行限速。 + + + Automatically download and install updates + 自动下载和安装更新 + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + 开启后,当有可用网络和可用备份和恢复分区时,系统会自动下载和安装更新。 + + + Upgrade during poweroff + 关机检测更新 + + + Download Limit(kB/s) + 下载限速(kB/s) + + + + The system will automatically updates when there is an available network and backup. + 网络可用时,若存在备份,系统会自动下载并安装更新 + + + + Ready to install + 准备安装 + + + + + + + + + + + + + + + + Last Checked: + 检查时间: + + + + + + + + + + + + + + No information! + 尚未更新 + + + + + + + + Error Code: + 错误码: + + + + Download Limit + 下载限速 + + + + Advanced + 高级选项 + + + + + Dependency conflict exists in this update,need to be completely repaired! + 本次更新存在包依赖冲突,需要全盘修复以完成更新! + + + + There are + 本次更新存在依赖冲突,将卸载 + + + + packages going to be removed,Please confirm whether to accept! + 个软件包以完成本次更新。 + + + + packages are going to be removed,Please confirm whether to accept! + 个软件包将被卸载,请确认是否接受! + + + + trying to reconnect + 重新尝试连接 + + + + times + 次数 + + + back + 收起 + + + Auto-Update is backing up...... + 自动更新进程正在备份中...... + 自动更新进程正在备份中...... + + + + The updater is NOT start + 后台更新服务未启动,建议重启计算机! + + + + The progress is updating... + 正在检查更新... + + + + + The progress is installing... + 正在下载并安装更新... + + + + The updater is busy! + 其他应用正在安装软件包,请稍后再试 + + + + + Updating the software source + 正在更新软件源 + + + The battery is below 50% and the update cannot be downloaded + 电池电量低于 50%,无法下载更新 + + + + + + + OK + 确定 + + + + Please back up the system before all updates to avoid unnecessary losses + 全部更新前请先备份系统,以免造成不必要的损失! + + + + Only Update + 直接更新 + + + + Back And Update + 备份并更新 + + + + + + + update has been canceled! + 本次更新已取消! + + + + + This update has been completed! + 本次更新已完成! + 本次更新已完成! + + + + Keeping update + 继续更新 + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + 全部更新前建议备份系统,以免造成不必要的损失! + + + + Insufficient disk space to download updates! + 磁盘空间不足,无法下载更新! + + + + supposed + 预计占用 + + + + s + + + + + min + 分钟 + + + + h + 小时 + + + + + + + Network exception, unable to check for updates! + 网络异常,检查更新异常! + + + + No room, upgrade failed. + 磁盘空间不足,请清理磁盘后进行升级更新。 + + + + + Checking update failed! + 检查更新异常! + + + Error Code: + 错误码: + + + + Automatically updates + 自动更新 + + + + Rollback to previous version + 回退到上一个版本 + + + + start + 开始 + + + + Upgrade + 更新 + + + Advanced Option + 高级选项 + + + + The update stopped because of low battery. + 电池电量较低,系统更新已终止! + + + + The system update requires that the battery power is not less than 50% + 系统更新需要电池电量不低于50%时进行。 + + + Part of the update failed! + 更新异常! + + + Failure reason: + 失败原因: + 失败原因: + + + + Finish the download! + 完成下载! + + + The system has download the update! + 系统完成更新内容下载 + + + It's need to reboot to make the install avaliable + 更新下载已完成,是否安装更新。 + + + Reboot notification + 重启提示 + + + Reboot rightnow + 重启并安装 + + + + Later + 稍后安装 + + + Part of the update success! + 部分软件包更新成功! + + + All the update has been downloaded. + 所有的更新内容已经被下载 + + + + An important update is in progress, please wait. + 正在进行一项重要更新,请等待。 + + + plase clean up your disk or expand the backup space + 请清理磁盘空间或扩大备份分区 + + + + insufficient backup space + 备份空间不足 + + + + backup failed + 备份异常 + + + Failed to write configuration file, this update will not back up the system! + 写入配置文件失败,本次更新不会备份系统! + + + Insufficient backup space, this update will not backup your system! + 备份空间不足,本次更新不会备份系统! + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + 麒麟备份还原工具无法找到UUID,本次更新不会备份系统! + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + 备份还原分区异常,您可能没有备份还原分区。更多详细信息,可以参看/var/log/backup.log + + + + Calculating Capacity... + 计算系统空间大小... + + + The system backup partition is not detected. Do you want to continue updating? + 未检测到系统备份还原分区,是否继续更新? + + + + Calculating + 计算中 + + + + + The system is updating... + 正在准备更新... + + + + Reboot + 重启 + + + + + The system has download the update,and you are suggested to reboot to use the new version. + 已下载最新版本,重启系统后使用新版本。 + + + + + + reboot rightnow + 立即重启 + + + + Reboot failed! + 重启失败! + + + + + + Update failed! + 更新异常! + + + + + + No room to backup,upgrade failed. + 磁盘空间不足,更新升级异常。 + + + + + + + Battery level is below 50%,and upgrade failed. + 电池电量低于50%,无法升级。 + + + + preparing to backup + 准备备份 + + + + backup start success + 备份开始 + + + + Auto-Update progress is installing new file: + 系统自动更新功能正在安装新文件: + 系统自动更新功能正在安装新文件: + + + + Auto-Update progress finished! + 系统自动更新完成! + 系统自动更新完成! + + + + Auto-Update progress fail in backup! + 自动更新安装时备份失败! + 自动更新安装时备份失败! + + + Failed in updating because of broken environment. + 环境破损未修复,更新失败 + + + + It's fixing up the environment... + 正在修复更新环境...... + + + + UpdateDbus + + + System-Upgrade + 系统更新 + + + + ukui-control-center-update + 设置-更新提示 + + + + UpdateLog + + + Update log + 更新日志 + + + + UpdateSource + + + Connection failed, please reconnect! + 连接失败,请重新连接! + + + + Upgrade + + + Upgrade + 更新 + + + + View history + 查看更新历史 + /Upgrade/View history + + + + Update Settings + 更新设置 + /Upgrade/Update Settings + + + + Allowed to renewable notice + 有更新应用时通知 + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + 自动下载和安装更新 + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + details + 详情 + + + + show details + 了解详情 + + + + uninstall and update + 卸载并更新 + + + uninstall + 移除 + + + + cancel + 取消 + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + 需要修复更新环境 + + + + There will be uninstall some packages to complete the update! + 将卸载部分软件包以完成更新! + + + + The following packages will be uninstalled: + 下列软件包将被卸载: + + + + PKG Details + 软件包详情 + + + + + details + 详情 + + + + Keep + 拒绝 + + + + Remove + 移除 + + + + Attention on update + 更新提示 + + + + back + 收起 + + + + fixupdetaillist + + + No content. + 暂无详情 + + + + Update Details + 更新详情 + + + + Update + 更新 + + + + m_updatelog + + + No content. + 暂无内容. + + + + no content + 暂无内容 + + + + + Close + 关闭 + + + Update Details + 更新详情 + + + No Contents + 暂无内容 + + + Search content + 搜索内容 + + + + History Log + 历史更新 + + + + updatedeleteprompt + + Dependency conflict exists in this update! + 本次更新存在依赖冲突! + + + There will be uninstall some packages to complete the update! + 将卸载部分软件包以完成更新! + + + + The following packages will be uninstalled: + 下列软件包将被卸载: + + + + PKG Details + 软件包详情 + + + + Update + 更新 + + + details + 详情 + + + + Keep + 拒绝 + + + + Remove + 接受 + + + Update Prompt + 更新提示 + + + back + 收起 + + + diff --git a/immutable/plugin/upgrade.cpp b/immutable/plugin/upgrade.cpp new file mode 100644 index 0000000..d92040f --- /dev/null +++ b/immutable/plugin/upgrade.cpp @@ -0,0 +1,72 @@ +#include "upgrade.h" + +#include +#include + +Upgrade::Upgrade() :mFirstLoad(true) { + QTranslator *translator = new QTranslator (this); + qInfo()<<"the system.name is "<load("/usr/share/upgrade/translations/" + QLocale::system().name()); + QApplication::installTranslator(translator); + pluginName = tr("Upgrade"); + pluginType = UPDATE; +} + +Upgrade::~Upgrade(){ + QFile File; + File.remove("/tmp/upgrade/upgrade.list"); +} + +QString Upgrade::plugini18nName(){ + return pluginName; +} + +int Upgrade::pluginTypes(){ + return pluginType; +} + + +QWidget *Upgrade::pluginUi(){ + if (mFirstLoad) { + mFirstLoad = false; + // will delete by takewidget + pluginWidget = new UpgradeMain(""); + } + return pluginWidget; +} + +bool Upgrade::isEnable() const{ + QString version; + version =kdk_system_get_projectName(); + if("V10SP1-edu" == version) + return false; + else + return true; +} + +const QString Upgrade::name() const{ + return QStringLiteral("Upgrade"); +} + +bool Upgrade::isShowOnHomePage() const{ + return true; +} + +QIcon Upgrade::icon() const{ + return QIcon::fromTheme("software-update-available-symbolic"); +} + +QString Upgrade::translationPath() const{ + return "/usr/share/upgrade/translations/%1.ts"; +} + +void Upgrade::initSearchText(){ + //~ contents_path /Upgrade/View history + tr("View history"); + //~ contents_path /Upgrade/Update Settings + tr("Update Settings"); + //~ contents_path /Upgrade/Allowed to renewable notice + tr("Allowed to renewable notice"); + //~ contents_path /Upgrade/Automatically download and install updates + tr("Automatically download and install updates"); +} diff --git a/immutable/plugin/upgrade.h b/immutable/plugin/upgrade.h new file mode 100644 index 0000000..ae27f80 --- /dev/null +++ b/immutable/plugin/upgrade.h @@ -0,0 +1,47 @@ +#ifndef UPGRADE_H +#define UPGRADE_H + +#include + +//#include +#include "ukcc/interface/interface.h" +#include "src/upgrademain.h" +#include + +class Upgrade : public QObject, CommonInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface") + Q_INTERFACES(CommonInterface) +public: + Upgrade(); + ~Upgrade(); + +// QString get_plugin_name() Q_DECL_OVERRIDE; +// int get_plugin_type() Q_DECL_OVERRIDE; +// QWidget * get_plugin_ui() Q_DECL_OVERRIDE; +// void plugin_delay_control() Q_DECL_OVERRIDE; +// const QString name() const Q_DECL_OVERRIDE; + + QString plugini18nName() Q_DECL_OVERRIDE; + int pluginTypes() Q_DECL_OVERRIDE; + QWidget *pluginUi() Q_DECL_OVERRIDE; + bool isEnable() const Q_DECL_OVERRIDE; + const QString name() const Q_DECL_OVERRIDE; + bool isShowOnHomePage() const Q_DECL_OVERRIDE; + QIcon icon() const Q_DECL_OVERRIDE; + QString translationPath() const Q_DECL_OVERRIDE; + + +private: + QString pluginName; + int pluginType; + UpgradeMain *pluginWidget; + bool mFirstLoad; + +private: + void initSearchText(); // 搜索翻译 + +}; + +#endif // UPGRADE_H diff --git a/immutable/plugin/upgrade.pro b/immutable/plugin/upgrade.pro new file mode 100644 index 0000000..8af3552 --- /dev/null +++ b/immutable/plugin/upgrade.pro @@ -0,0 +1,150 @@ +QT += core gui widgets network dbus sql + +TEMPLATE = lib +CONFIG += plugin link_pkgconfig c++11 warn_on +PKGCONFIG += gsettings-qt kysdk-qtwidgets kysdk-sysinfo yaml-cpp kysdk-diagnostics kysdk-systime +TARGET = $$qtLibraryTarget(upgrade) +target.path = $$[QT_INSTALL_LIBS]/ukui-control-center/V2.0 + +MOC_DIR = ./moctmp +UI_DIR = ./uitmp +RCC_DIR = ./rcctmp +OBJECTS_DIR = ./objtmp + +TRANSLATIONS += \ + translations/zh_CN.ts \ + translations/tr.ts \ + translations/bo.ts \ + translations/en_US.ts \ + translations/bo_CN.ts \ + translations/mn.ts + +QMAKE_CXXFLAGS+=-g +QMAKE_CFLAGS +=-g + +# Automating generation .qm files from .ts files +CONFIG(release, debug|release) { + !system($$PWD/translate_generation.sh): error("Failed to generate translation") +} + +isEmpty(PREFIX) { + PREFIX = /usr +} + +qm_files.path = $${PREFIX}/share/upgrade/translations +qm_files.files = translations/* + + +# 适配窗口管理器圆角阴影 +QT += KWindowSystem dbus x11extras + +# 适配窗口管理器圆角阴影 +LIBS +=-lpthread +LIBS +=-lX11 +#LIBS += -lukcc +!contains(QMAKE_HOST.arch, sw_64){ + LIBS += -L$$[QT_INSTALL_LIBS] -lukui-log4qt +} +DEFINES+=KYDEBUG +# 应用图标装载 +#icon.path = /usr/share/pixmaps +#icon.files = img/kylin-update-manager.png + +# desktop文件装载 +#desktop.path = /usr/share/applications/ +#desktop.files = ./src/kylin-system-update.desktop + +# gsetting文件装载 +#schemes.files = data/org.kylin-update-manager-data.gschema.xml +#schemes.path = /usr/share/glib-2.0/schemas/ + +#config.files = ./config_file/* +#config.path = /usr/share/ukui-control-center/upgrade/ + +INCLUDEPATH += \ + $$PROJECT_COMPONENTSOURCE \ + $$PROJECT_ROOTDIR \ +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS \ + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + src/AddFunction/datetimeutils.cpp \ + src/detaildialog.cpp \ + src/Data/global.cpp \ +# src/logger.cpp \ + src/ukcc/Label/fixlabel.cpp \ + src/ukcc/Label/iconlabel.cpp \ + src/ukcc/Label/lightlabel.cpp \ + src/ukcc/Label/titlelabel.cpp \ + src/ukcc/Label/tristatelabel.cpp \ + src/ukcc/SwitchButton/switchbutton.cpp \ + src/ukcc/interface/upgradeukcccommon.cpp \ + src/xatom-helper.cpp \ + src/appupdate.cpp \ + src/checkbutton.cpp \ + src/daemonipcdbus.cpp \ + src/historyupdatelistwig.cpp \ + src/m_updatelog.cpp \ + src/mylabel.cpp \ +# src/switchbutton.cpp \ + src/tabwidget.cpp \ + src/ukscconn.cpp \ + src/updatedbus.cpp \ + src/updatelog.cpp \ + src/upgrademain.cpp \ + src/SecondaryWidget/setwidget.cpp \ + upgrade.cpp + +HEADERS += \ + src/AddFunction/datetimeutils.h \ + src/detaildialog.h \ + src//Data/global.h \ +# src/logger.h \ + src/ukcc/Label/fixlabel.h \ + src/ukcc/Label/iconlabel.h \ + src/ukcc/Label/lightlabel.h \ + src/ukcc/Label/titlelabel.h \ + src/ukcc/Label/tristatelabel.h \ + src/ukcc/SwitchButton/switchbutton.h \ + src/ukcc/interface.h \ + src/ukcc/interface/interface.h \ + src/ukcc/interface/upgradeukcccommon.h \ + src/ukcc/libukcc_global.h \ + src/xatom-helper.h \ + src/appupdate.h \ + src/checkbutton.h \ + src/connection.h \ + src/daemonipcdbus.h \ + src/historyupdatelistwig.h \ + src/m_updatelog.h \ + src/mylabel.h \ +# src/switchbutton.h \ + src/tabwidget.h \ + src/ukscconn.h \ + src/updatedbus.h \ + src/updatelog.h \ + src/upgrademain.h \ + src/utils.h \ + src/SecondaryWidget/setwidget.h \ + upgrade.h + + +# Default rules for deployment. +INSTALLS += target \ +# icon \ +# desktop \ +# schemes \ +# config \ + qm_files \ + +RESOURCES += \ + shell/res/img.qrc + diff --git a/immutable/plugin/upgrade.pro.user b/immutable/plugin/upgrade.pro.user new file mode 100644 index 0000000..3bd428d --- /dev/null +++ b/immutable/plugin/upgrade.pro.user @@ -0,0 +1,314 @@ + + + + + + EnvironmentId + {e2626406-5b30-4653-bbdc-5f44d69e770a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {3206ba71-3ff7-4f65-a816-e5c227657c1c} + 0 + 0 + 0 + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/build-upgrade-unknown-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/build-upgrade-unknown-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/build-upgrade-unknown-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + /usr/bin/ukui-control-center + ProjectExplorer.CustomExecutableRunConfiguration + + -p /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/build-upgrade-unknown-Debug/libupgrade.so + true + + false + true + false + false + true + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/build-upgrade-unknown-Debug + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/immutable/plugin_2107/aarch64/libupgrade.so.tar.gz b/immutable/plugin_2107/aarch64/libupgrade.so.tar.gz new file mode 100644 index 0000000..a30f9e9 Binary files /dev/null and b/immutable/plugin_2107/aarch64/libupgrade.so.tar.gz differ diff --git a/immutable/plugin_2107/aarch64/libupgrade.so_old.tar.gz b/immutable/plugin_2107/aarch64/libupgrade.so_old.tar.gz new file mode 100644 index 0000000..e18b9e4 Binary files /dev/null and b/immutable/plugin_2107/aarch64/libupgrade.so_old.tar.gz differ diff --git a/immutable/plugin_2107/loongarch64/libupgrade.so.tar.gz b/immutable/plugin_2107/loongarch64/libupgrade.so.tar.gz new file mode 100644 index 0000000..ba8faf0 Binary files /dev/null and b/immutable/plugin_2107/loongarch64/libupgrade.so.tar.gz differ diff --git a/immutable/plugin_2107/loongarch64/libupgrade_old.so.tar.gz b/immutable/plugin_2107/loongarch64/libupgrade_old.so.tar.gz new file mode 100644 index 0000000..653f972 Binary files /dev/null and b/immutable/plugin_2107/loongarch64/libupgrade_old.so.tar.gz differ diff --git a/immutable/plugin_2107/mips64/libupgrade.so.tar.gz b/immutable/plugin_2107/mips64/libupgrade.so.tar.gz new file mode 100644 index 0000000..9d5fcae Binary files /dev/null and b/immutable/plugin_2107/mips64/libupgrade.so.tar.gz differ diff --git a/immutable/plugin_2107/mips64/libupgrade.so_old.tar.gz b/immutable/plugin_2107/mips64/libupgrade.so_old.tar.gz new file mode 100644 index 0000000..f10e853 Binary files /dev/null and b/immutable/plugin_2107/mips64/libupgrade.so_old.tar.gz differ diff --git a/immutable/plugin_2107/sw_64/libupgrade.so.tar.gz b/immutable/plugin_2107/sw_64/libupgrade.so.tar.gz new file mode 100644 index 0000000..c05b446 Binary files /dev/null and b/immutable/plugin_2107/sw_64/libupgrade.so.tar.gz differ diff --git a/immutable/plugin_2107/sw_64/libupgrade.so_old.tar.gz b/immutable/plugin_2107/sw_64/libupgrade.so_old.tar.gz new file mode 100644 index 0000000..7370d7f Binary files /dev/null and b/immutable/plugin_2107/sw_64/libupgrade.so_old.tar.gz differ diff --git a/immutable/plugin_2107/x86_64/libupgrade.so.tar.gz b/immutable/plugin_2107/x86_64/libupgrade.so.tar.gz new file mode 100644 index 0000000..56978a8 Binary files /dev/null and b/immutable/plugin_2107/x86_64/libupgrade.so.tar.gz differ diff --git a/immutable/plugin_2107/x86_64/libupgrade.so_old.tar.gz b/immutable/plugin_2107/x86_64/libupgrade.so_old.tar.gz new file mode 100644 index 0000000..5a272d2 Binary files /dev/null and b/immutable/plugin_2107/x86_64/libupgrade.so_old.tar.gz differ diff --git a/immutable/upgradenote/RebootAttention/RebootAttention.pro b/immutable/upgradenote/RebootAttention/RebootAttention.pro new file mode 100644 index 0000000..57f6d95 --- /dev/null +++ b/immutable/upgradenote/RebootAttention/RebootAttention.pro @@ -0,0 +1,38 @@ +QT += core gui dbus +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +QMAKE_CXXFLAGS+=-g +QMAKE_CFLAGS +=-g + + +TRANSLATIONS += \ + translations/zh_CN.ts \ + translations/tr.ts \ + translations/bo.ts \ + translations/en_US.ts \ + translations/bo_CN.ts \ + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/immutable/upgradenote/RebootAttention/RebootAttention.pro.user b/immutable/upgradenote/RebootAttention/RebootAttention.pro.user new file mode 100644 index 0000000..0c3b9a0 --- /dev/null +++ b/immutable/upgradenote/RebootAttention/RebootAttention.pro.user @@ -0,0 +1,314 @@ + + + + + + EnvironmentId + {e2626406-5b30-4653-bbdc-5f44d69e770a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {3206ba71-3ff7-4f65-a816-e5c227657c1c} + 0 + 0 + 0 + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/upgradenote/build-RebootAttention-unknown-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/upgradenote/build-RebootAttention-unknown-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/upgradenote/build-RebootAttention-unknown-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/upgradenote/RebootAttention/RebootAttention.pro + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/upgradenote/RebootAttention/RebootAttention.pro + + false + + false + true + true + false + false + true + + /home/hechengyuan/project/kylin-update-frontend/kylin-update-frontend/upgradenote/build-RebootAttention-unknown-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/immutable/upgradenote/RebootAttention/main.cpp b/immutable/upgradenote/RebootAttention/main.cpp new file mode 100644 index 0000000..87365fe --- /dev/null +++ b/immutable/upgradenote/RebootAttention/main.cpp @@ -0,0 +1,16 @@ +#include "mainwindow.h" + +#include +#include +#include +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + QTranslator translator ; + qDebug()<<"the system.name is "< +#include +#include +#include +#include +#include +#include +#include + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) +{ +// QTranslator *translator = new QTranslator (this); +// qDebug()<<"the system.name is "<load("/usr/share/upgradenote/translations/" + QLocale::system().name()); + QString homePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); + QString path = homePath+"/.config/kylin-update-frontend/"; + QDir dir(path); + if(!dir.exists()) + { + qDebug()<<"No dir exits"; + return ; + } + + QString filename = homePath+"/.config/kylin-update-frontend/reboot.config"; + QFile file(filename); + if(!file.exists()) + { + qDebug()<<"No file exits"; + return ; + } + QSettings *settings = new QSettings(filename,QSettings::IniFormat); + settings->beginGroup("CONFIG"); + QString status = settings->value("reboot_status").toString(); + settings->endGroup(); + qDebug()< args; + args<<(QObject::tr("System-Upgrade")) + <<((unsigned int) 0) + <<("ukui-control-center") + < + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + void Reboot(); +}; +#endif // MAINWINDOW_H diff --git a/immutable/upgradenote/RebootAttention/translations/bo.qm b/immutable/upgradenote/RebootAttention/translations/bo.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/upgradenote/RebootAttention/translations/bo.qm @@ -0,0 +1 @@ + + + + + QObject + + + Reboot + + + + + Later + + + + + System-Upgrade + + + + + ukui-control-center-upgrade + + + + + It's suggested to reboot. + + + + diff --git a/immutable/upgradenote/RebootAttention/translations/bo_CN.qm b/immutable/upgradenote/RebootAttention/translations/bo_CN.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/upgradenote/RebootAttention/translations/bo_CN.qm @@ -0,0 +1 @@ + + + + + QObject + + + Reboot + + + + + Later + + + + + System-Upgrade + + + + + ukui-control-center-upgrade + + + + + It's suggested to reboot. + + + + diff --git a/immutable/upgradenote/RebootAttention/translations/en_US.qm b/immutable/upgradenote/RebootAttention/translations/en_US.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/upgradenote/RebootAttention/translations/en_US.qm @@ -0,0 +1 @@ + + + + + QObject + + + Reboot + + + + + Later + + + + + System-Upgrade + + + + + ukui-control-center-upgrade + + + + + It's suggested to reboot. + + + + diff --git a/immutable/upgradenote/RebootAttention/translations/tr.qm b/immutable/upgradenote/RebootAttention/translations/tr.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/immutable/upgradenote/RebootAttention/translations/tr.qm @@ -0,0 +1 @@ + + + + + QObject + + + Reboot + + + + + Later + + + + + System-Upgrade + + + + + ukui-control-center-upgrade + + + + + It's suggested to reboot. + + + + diff --git a/immutable/upgradenote/RebootAttention/translations/zh_CN.qm b/immutable/upgradenote/RebootAttention/translations/zh_CN.qm new file mode 100644 index 0000000..5c4df56 Binary files /dev/null and b/immutable/upgradenote/RebootAttention/translations/zh_CN.qm differ diff --git a/immutable/upgradenote/RebootAttention/translations/zh_CN.ts b/immutable/upgradenote/RebootAttention/translations/zh_CN.ts new file mode 100644 index 0000000..a2f88ff --- /dev/null +++ b/immutable/upgradenote/RebootAttention/translations/zh_CN.ts @@ -0,0 +1,32 @@ + + + + + QObject + + + Reboot + 重启 + + + + Later + 稍后 + + + + System-Upgrade + 系统更新 + + + + ukui-control-center-upgrade + 设置-升级 + + + + It's suggested to reboot. + 建议现在进行重启实现更新。 + + + diff --git a/immutable/upgradenote/RebootAttention/untitled.pro.user b/immutable/upgradenote/RebootAttention/untitled.pro.user new file mode 100644 index 0000000..0152c28 --- /dev/null +++ b/immutable/upgradenote/RebootAttention/untitled.pro.user @@ -0,0 +1,314 @@ + + + + + + EnvironmentId + {e2626406-5b30-4653-bbdc-5f44d69e770a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + 桌面 + 桌面 + {3206ba71-3ff7-4f65-a816-e5c227657c1c} + 0 + 0 + 0 + + /home/hechengyuan/project/tmp/test/build-untitled-unknown-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/hechengyuan/project/tmp/test/build-untitled-unknown-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + /home/hechengyuan/project/tmp/test/build-untitled-unknown-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/immutable/upgradenote/UpgradeRebootNotify b/immutable/upgradenote/UpgradeRebootNotify new file mode 100755 index 0000000..eab408d --- /dev/null +++ b/immutable/upgradenote/UpgradeRebootNotify @@ -0,0 +1,2 @@ +#! /bin/bash +gdbus call --system --dest com.kylin.systemupgrade --object-path /com/kylin/systemupgrade --method com.kylin.systemupgrade.interface.TriggerInstallOnShutdown "reboot" diff --git a/immutable/upgradenote/UpgradeRebootNotify.service b/immutable/upgradenote/UpgradeRebootNotify.service new file mode 100644 index 0000000..c574218 --- /dev/null +++ b/immutable/upgradenote/UpgradeRebootNotify.service @@ -0,0 +1,8 @@ +[Unit] +Description=Daily reboot attention +#ConditionACPower=true + +[Service] +Type=oneshot +ExecStart=/usr/bin/RebootAttention + diff --git a/immutable/upgradenote/UpgradeRebootNotify.timer b/immutable/upgradenote/UpgradeRebootNotify.timer new file mode 100644 index 0000000..bf3d1b0 --- /dev/null +++ b/immutable/upgradenote/UpgradeRebootNotify.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Daily auto-download activities + +[Timer] +OnCalendar=*-*-* 17:00 +#RandomizedDelaySec=1h +Persistent=true + +[Install] +WantedBy=timers.target + diff --git a/initial/Makefile b/initial/Makefile new file mode 100644 index 0000000..e804a8c --- /dev/null +++ b/initial/Makefile @@ -0,0 +1,10 @@ +CC = g++ + +all: plugins notify + +plugins: + cd plugin && qmake . + cd plugin && make -j8 +notify: + cd notification && cmake . + cd notification && make -j8 diff --git a/initial/README.MD b/initial/README.MD new file mode 100644 index 0000000..b59463e --- /dev/null +++ b/initial/README.MD @@ -0,0 +1,13 @@ +### Software Updater for apt + +- 目录架构: + + ```shell + debian Makefile plugin notifications README.MD + ``` + +- 其中分为控制面板插件目录`plugin` 和 更新弹窗提醒`notifications` + + + + diff --git a/kylin-updatefinish-notify-new b/initial/kylin-updatefinish-notify-new similarity index 100% rename from kylin-updatefinish-notify-new rename to initial/kylin-updatefinish-notify-new diff --git a/kylin_release_id.py b/initial/kylin_release_id.py similarity index 87% rename from kylin_release_id.py rename to initial/kylin_release_id.py index 8dbcf2b..a7acd05 100755 --- a/kylin_release_id.py +++ b/initial/kylin_release_id.py @@ -22,4 +22,7 @@ def ReadOsReleaseFile(): if __name__ == "__main__": os_release_info = ReadOsReleaseFile() - print(os_release_info['KYLIN_RELEASE_ID']) \ No newline at end of file + try: + print(os_release_info['KYLIN_RELEASE_ID']) + except KeyError: + print("") \ No newline at end of file diff --git a/notification/CMakeLists.txt b/initial/notification/CMakeLists.txt similarity index 100% rename from notification/CMakeLists.txt rename to initial/notification/CMakeLists.txt diff --git a/initial/notification/kylin-system-updater-notify-new.mo b/initial/notification/kylin-system-updater-notify-new.mo new file mode 100644 index 0000000..57a968e Binary files /dev/null and b/initial/notification/kylin-system-updater-notify-new.mo differ diff --git a/notification/kylin-updatefinish-notify1.desktop b/initial/notification/kylin-updatefinish-notify1.desktop similarity index 100% rename from notification/kylin-updatefinish-notify1.desktop rename to initial/notification/kylin-updatefinish-notify1.desktop diff --git a/initial/notification/src/gcc.txt b/initial/notification/src/gcc.txt new file mode 100644 index 0000000..b6c63bc --- /dev/null +++ b/initial/notification/src/gcc.txt @@ -0,0 +1 @@ +gcc `pkg-config --cflags --libs dbus-1` main.c -o main -ldbus-1 diff --git a/initial/notification/src/main.c b/initial/notification/src/main.c new file mode 100644 index 0000000..31dcabf --- /dev/null +++ b/initial/notification/src/main.c @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "notifications.h" + +int main(void) +{ + DBusConnection *connection; + DBusError error; + DBusMessage *message; + DBusMessageIter iter; + char *sigvalue; + + dbus_error_init(&error); + + /*connect to the deamon bus*/ + connection=dbus_bus_get(DBUS_BUS_SYSTEM, &error); + if(!connection) + { + fprintf(stderr, "Failed to get a system DBus connection: %s\n", error.message); + exit(1); + } + + /*add a rule for which message we want to see*/ + dbus_bus_add_match(connection, + "type='signal',interface='com.kylin.systemupgrade.interface'", + &error);//,member='RebootLogoutRequired' + dbus_connection_flush(connection);//阻塞 + if (dbus_error_is_set(&error)) + { + fprintf(stderr, "Match Error (%s)\n", error.message); + exit(1); + } + + /*loop listening for signals being emmitted*/ + while(true) + { + //noblocking read of the next available message + dbus_connection_read_write(connection, 0); + message= dbus_connection_pop_message(connection);//等待消息 + + //没接收到等一秒钟继续 + if(NULL == message) + { + sleep(1); + continue; + } + + //check if the message is the message we want to get + if(dbus_message_is_signal(message,"com.kylin.systemupgrade.interface", "RebootLogoutRequired")) + { + printf("notifications is ought to be send\n"); + if(!dbus_message_iter_init(message,&iter)) + fprintf(stderr,"MessageHas no Param"); + else if(dbus_message_iter_get_arg_type(&iter)!= DBUS_TYPE_STRING) + fprintf(stderr,"Param is not string"); + else + { + /*try to get the content of signal*/ + dbus_message_iter_get_basic(&iter,&sigvalue); + printf("Recetive Singal Value : %s\n",sigvalue); + notifications(sigvalue); + //此处添加notifications函数 + } + }//注意此处是持续监听的,可以让沈亚峰进行每三十分钟发送一次信号的操作? + } + //free the message + dbus_message_unref(message); + return 0; +} + + diff --git a/notification/src/notifications.c b/initial/notification/src/notifications.c similarity index 100% rename from notification/src/notifications.c rename to initial/notification/src/notifications.c diff --git a/initial/notification/src/notifications.h b/initial/notification/src/notifications.h new file mode 100644 index 0000000..53ee198 --- /dev/null +++ b/initial/notification/src/notifications.h @@ -0,0 +1,7 @@ +#include +#include +#include +#include +#include + +int notifications(char *sigvalue); \ No newline at end of file diff --git a/initial/notification/src/notify.po b/initial/notification/src/notify.po new file mode 100644 index 0000000..28d9110 --- /dev/null +++ b/initial/notification/src/notify.po @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-09-21 10:12+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: notifications.c:42 notifications.c:58 notifications.c:74 +msgid "Update Finished!" +msgstr "更新成功" + +#: notifications.c:59 +msgid "It's suggested to reboot immediately." +msgstr "本次更新已完成,系统将在重启后使用更新应用。是否重启系统?" + +#: notifications.c:63 +msgid "Reboot" +msgstr "立即重启" + +#: notifications.c:64 notifications.c:81 +msgid "Closed" +msgstr "稍后重启" + +#: notifications.c:75 +msgid "It's suggested to logout immediately." +msgstr "本次更新已完成,系统将在注销后使用更新应用。是否注销系统?" + +#: notifications.c:80 +msgid "Logout" +msgstr "立即注销" diff --git a/initial/plugin/config_file/kylin-need-logout-new.conf b/initial/plugin/config_file/kylin-need-logout-new.conf new file mode 100644 index 0000000..e69de29 diff --git a/initial/plugin/config_file/kylin-need-reboot-new.conf b/initial/plugin/config_file/kylin-need-reboot-new.conf new file mode 100644 index 0000000..b186e61 --- /dev/null +++ b/initial/plugin/config_file/kylin-need-reboot-new.conf @@ -0,0 +1,7 @@ +linux-generic +kylin-update-desktop-kernel +kylin-update-desktop-kernel-3a4000 +kylin-update-desktop-ukui +kylin-update-desktop-support +linux-meta +kylin-update-desktop-system diff --git a/initial/plugin/image/close.png b/initial/plugin/image/close.png new file mode 100644 index 0000000..5e0a90b Binary files /dev/null and b/initial/plugin/image/close.png differ diff --git a/initial/plugin/image/refresh.png b/initial/plugin/image/refresh.png new file mode 100644 index 0000000..876a950 Binary files /dev/null and b/initial/plugin/image/refresh.png differ diff --git a/initial/plugin/image/search.png b/initial/plugin/image/search.png new file mode 100644 index 0000000..120215a Binary files /dev/null and b/initial/plugin/image/search.png differ diff --git a/initial/plugin/shell/interface.h b/initial/plugin/shell/interface.h new file mode 100644 index 0000000..b0c247c --- /dev/null +++ b/initial/plugin/shell/interface.h @@ -0,0 +1,136 @@ +/* -*- 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 INTERFACE_H +#define INTERFACE_H + +class QString; +class QWidget; +class QStringLiteral; + +enum FunType{ + SYSTEM, + DEVICES, + PERSONALIZED, + NETWORK, + ACCOUNT, + DATETIME, + UPDATE, + NOTICEANDTASKS, + TOTALMODULES, +}; + +enum SystemIndex{ + DISPLAY, + TOUCHSCREEN, + DEFAULTAPP, + POWER, + AUTOBOOT, + TOTALSYSFUNC, +}; + +enum DevicesIndex{ + PRINTER, + PROJECTION, + MOUSE, + TOUCHPAD, + KEYBOARD, + SHORTCUT, + AUDIO, + BLUETOOTH, + TOTALDEVICESFUNC, +}; + +enum PersonalizedIndex{ + BACKGROUND, + THEME, + SCREENLOCK, + FONTS, + SCREENSAVER, + DESKTOP, + TOTALPERSFUNC, +}; + +enum NetworkIndex{ + NETCONNECT, + VPN, + PROXY, + VINO, + TOTALNETFUNC, +}; + +enum AccountIndex{ + USERINFO, + NETWORKACCOUNT, + BIOMETRICS, + TOTALACCOUNTFUNC, +}; + +enum DatetimeIndex{ + DAT, + AREA, + TOTALDTFUNC, +}; + +enum SeUpdatesIndex{ + SECURITYCENTER, + BACKUP, + UPDATES, + UPGRADE, + TOTALSUFUNC, +}; + +enum NoticeAndTasksIndex{ + NOTICE, + SEARCH, + ABOUT, + EXPERIENCEPLAN, + TOTALNATFUNC, +}; + +class CommonInterface{ +public: + virtual ~CommonInterface(){} + virtual QString get_plugin_name() = 0; + virtual int get_plugin_type() = 0; + virtual QWidget * get_plugin_ui() = 0; + virtual void plugin_delay_control() = 0; + + + /** + * \brief name + * module name (用于搜索?) + */ + virtual const QString name() const = 0; + + /** + * \brief translationPath + * 获取多语言文件路径,用于搜索 + * \return QString + */ + virtual QString translationPath()const { + return QStringLiteral(":/i18n/%1.ts"); + } +}; + +#define CommonInterface_iid "org.kycc.CommonInterface" + +Q_DECLARE_INTERFACE(CommonInterface, CommonInterface_iid) + +#endif // INTERFACE_H diff --git a/initial/plugin/shell/res/i18n/bo.qm b/initial/plugin/shell/res/i18n/bo.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/shell/res/i18n/bo.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + + Update succeeded! + + + + + + Update has been canceled! + + + + + + Update failed! + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + Cancel + + + + + pkg will be uninstall! + + + + + + + + + Update + + + + + + details + + + + + + Update log + + + + + + + + + + + Newest: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + back + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to install + + + + + downloading + + + + + No content. + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + TabWid + + + + + + + + + + + + + Check Update + + + + + initializing + + + + + + + + + + + + + UpdateAll + + + + + + + + + Your system is the latest! + + + + + + + + + + No Information! + + + + + + + + + + Last refresh: + + + + + + Downloading and installing updates... + + + + + Update now + + + + + Cancel update + + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + + + + Cancel + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + + Prompt information + + + + + Sure + + + + + In the download + + + + + In the install... + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + Backup finished! + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + Software source update failed: + + + + + Update software source : + + + + + Update + + + + + View history + + + + + + details + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Backup current system before updates all + + + + + Download Limit(Kb/s) + + + + + It will be avaliable in the next download. + + + + + Automatically download and install updates + + + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + + + + + Ready to install + + + + + Last Checked: + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + back + + + + + Updating the software source + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + + + + update has been canceled! + + + + + + Part of the update failed! + + + + + Part of the update success! + + + + + An important update is in progress, please wait. + + + + + Failed to write configuration file, this update will not back up the system! + + + + + Insufficient backup space, this update will not backup your system! + + + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + + + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + + + + + Calculating Capacity... + + + + + Calculating + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + m_updatelog + + + No content. + + + + + Update Details + + + + + + Search content + + + + + History Log + + + + + updatedeleteprompt + + + Dependency conflict exists in this update! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Update Prompt + + + + + back + + + + diff --git a/initial/plugin/shell/res/i18n/en_US.qm b/initial/plugin/shell/res/i18n/en_US.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/shell/res/i18n/en_US.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + + Update succeeded! + + + + + + Update has been canceled! + + + + + + Update failed! + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + Cancel + + + + + pkg will be uninstall! + + + + + + + + + Update + + + + + + details + + + + + + Update log + + + + + + + + + + + Newest: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + back + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to install + + + + + downloading + + + + + No content. + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + TabWid + + + + + + + + + + + + + Check Update + + + + + initializing + + + + + + + + + + + + + UpdateAll + + + + + + + + + Your system is the latest! + + + + + + + + + + No Information! + + + + + + + + + + Last refresh: + + + + + + Downloading and installing updates... + + + + + Update now + + + + + Cancel update + + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + + + + Cancel + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + + Prompt information + + + + + Sure + + + + + In the download + + + + + In the install... + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + Backup finished! + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + Software source update failed: + + + + + Update software source : + + + + + Update + + + + + View history + + + + + + details + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Backup current system before updates all + + + + + Download Limit(Kb/s) + + + + + It will be avaliable in the next download. + + + + + Automatically download and install updates + + + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + + + + + Ready to install + + + + + Last Checked: + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + back + + + + + Updating the software source + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + + + + update has been canceled! + + + + + + Part of the update failed! + + + + + Part of the update success! + + + + + An important update is in progress, please wait. + + + + + Failed to write configuration file, this update will not back up the system! + + + + + Insufficient backup space, this update will not backup your system! + + + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + + + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + + + + + Calculating Capacity... + + + + + Calculating + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + m_updatelog + + + No content. + + + + + Update Details + + + + + + Search content + + + + + History Log + + + + + updatedeleteprompt + + + Dependency conflict exists in this update! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Update Prompt + + + + + back + + + + diff --git a/initial/plugin/shell/res/i18n/tr.qm b/initial/plugin/shell/res/i18n/tr.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/shell/res/i18n/tr.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + + Update succeeded! + + + + + + Update has been canceled! + + + + + + Update failed! + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + Cancel + + + + + pkg will be uninstall! + + + + + + + + + Update + + + + + + details + + + + + + Update log + + + + + + + + + + + Newest: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + back + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to install + + + + + downloading + + + + + No content. + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + TabWid + + + + + + + + + + + + + Check Update + + + + + initializing + + + + + + + + + + + + + UpdateAll + + + + + + + + + Your system is the latest! + + + + + + + + + + No Information! + + + + + + + + + + Last refresh: + + + + + + Downloading and installing updates... + + + + + Update now + + + + + Cancel update + + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + + + + Cancel + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + + Prompt information + + + + + Sure + + + + + In the download + + + + + In the install... + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + Backup finished! + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + Software source update failed: + + + + + Update software source : + + + + + Update + + + + + View history + + + + + + details + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Backup current system before updates all + + + + + Download Limit(Kb/s) + + + + + It will be avaliable in the next download. + + + + + Automatically download and install updates + + + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + + + + + Ready to install + + + + + Last Checked: + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + back + + + + + Updating the software source + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + + + + update has been canceled! + + + + + + Part of the update failed! + + + + + Part of the update success! + + + + + An important update is in progress, please wait. + + + + + Failed to write configuration file, this update will not back up the system! + + + + + Insufficient backup space, this update will not backup your system! + + + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + + + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + + + + + Calculating Capacity... + + + + + Calculating + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + m_updatelog + + + No content. + + + + + Update Details + + + + + + Search content + + + + + History Log + + + + + updatedeleteprompt + + + Dependency conflict exists in this update! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Update Prompt + + + + + back + + + + diff --git a/initial/plugin/shell/res/i18n/zh_CN.qm b/initial/plugin/shell/res/i18n/zh_CN.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/shell/res/i18n/zh_CN.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + Being installed + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + + Update succeeded! + + + + + + Update has been canceled! + + + + + + Update failed! + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + Cancel + + + + + pkg will be uninstall! + + + + + + + + + Update + + + + + + details + + + + + + Update log + + + + + + + + + + + Newest: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + back + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to install + + + + + downloading + + + + + No content. + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + TabWid + + + + + + + + + + + + + Check Update + + + + + initializing + + + + + + + + + + + + + UpdateAll + + + + + + + + + Your system is the latest! + + + + + + + + + + No Information! + + + + + + + + + + Last refresh: + + + + + + Downloading and installing updates... + + + + + Update now + + + + + Cancel update + + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + + + + Cancel + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + + Prompt information + + + + + Sure + + + + + In the download + + + + + In the install... + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + Backup finished! + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + Software source update failed: + + + + + Update software source : + + + + + Update + + + + + View history + + + + + + details + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Backup current system before updates all + + + + + Download Limit(Kb/s) + + + + + It will be avaliable in the next download. + + + + + Automatically download and install updates + + + + + After it is turned on, the system will automatically download and install updates when there is an available network and available backup and restore partitions. + + + + + Ready to install + + + + + Last Checked: + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + back + + + + + Updating the software source + + + + + The battery is below 50% and the update cannot be downloaded + + + + + OK + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + + + + update has been canceled! + + + + + + Part of the update failed! + + + + + Part of the update success! + + + + + An important update is in progress, please wait. + + + + + Failed to write configuration file, this update will not back up the system! + + + + + Insufficient backup space, this update will not backup your system! + + + + + Kylin backup restore tool could not find the UUID, this update will not backup the system! + + + + + The backup restore partition is abnormal. You may not have a backup restore partition.For more details,see /var/log/backup.log + + + + + Calculating Capacity... + + + + + Calculating + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + m_updatelog + + + No content. + + + + + Update Details + + + + + + Search content + + + + + History Log + + + + + updatedeleteprompt + + + Dependency conflict exists in this update! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Update Prompt + + + + + back + + + + diff --git a/plugin/shell/res/img.qrc b/initial/plugin/shell/res/img.qrc similarity index 100% rename from plugin/shell/res/img.qrc rename to initial/plugin/shell/res/img.qrc diff --git a/initial/plugin/shell/res/upgrade/kylin-update-desktop-app.png b/initial/plugin/shell/res/upgrade/kylin-update-desktop-app.png new file mode 100644 index 0000000..2a7c756 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/kylin-update-desktop-app.png differ diff --git a/initial/plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png b/initial/plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png new file mode 100644 index 0000000..0fb16ef Binary files /dev/null and b/initial/plugin/shell/res/upgrade/kylin-update-desktop-kernel-3a4000.png differ diff --git a/initial/plugin/shell/res/upgrade/kylin-update-desktop-kernel.png b/initial/plugin/shell/res/upgrade/kylin-update-desktop-kernel.png new file mode 100644 index 0000000..0fb16ef Binary files /dev/null and b/initial/plugin/shell/res/upgrade/kylin-update-desktop-kernel.png differ diff --git a/initial/plugin/shell/res/upgrade/kylin-update-desktop-security.png b/initial/plugin/shell/res/upgrade/kylin-update-desktop-security.png new file mode 100644 index 0000000..d2ac186 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/kylin-update-desktop-security.png differ diff --git a/initial/plugin/shell/res/upgrade/kylin-update-desktop-support.png b/initial/plugin/shell/res/upgrade/kylin-update-desktop-support.png new file mode 100644 index 0000000..2fadbd0 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/kylin-update-desktop-support.png differ diff --git a/initial/plugin/shell/res/upgrade/kylin-update-desktop-ukui.png b/initial/plugin/shell/res/upgrade/kylin-update-desktop-ukui.png new file mode 100644 index 0000000..250e727 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/kylin-update-desktop-ukui.png differ diff --git a/initial/plugin/shell/res/upgrade/linux-generic.png b/initial/plugin/shell/res/upgrade/linux-generic.png new file mode 100644 index 0000000..0fb16ef Binary files /dev/null and b/initial/plugin/shell/res/upgrade/linux-generic.png differ diff --git a/initial/plugin/shell/res/upgrade/loading10.svg b/initial/plugin/shell/res/upgrade/loading10.svg new file mode 100644 index 0000000..7a93e56 --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading10.svg @@ -0,0 +1 @@ +loading1 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading11.svg b/initial/plugin/shell/res/upgrade/loading11.svg new file mode 100644 index 0000000..705a9f0 --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading11.svg @@ -0,0 +1 @@ +loading12 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading12.svg b/initial/plugin/shell/res/upgrade/loading12.svg new file mode 100644 index 0000000..e8a0f1f --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading12.svg @@ -0,0 +1 @@ +loading13 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading13.svg b/initial/plugin/shell/res/upgrade/loading13.svg new file mode 100644 index 0000000..b129170 --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading13.svg @@ -0,0 +1 @@ +loading14 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading14.svg b/initial/plugin/shell/res/upgrade/loading14.svg new file mode 100644 index 0000000..6f39b2b --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading14.svg @@ -0,0 +1 @@ +loading15 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading15.svg b/initial/plugin/shell/res/upgrade/loading15.svg new file mode 100644 index 0000000..4ec561c --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading15.svg @@ -0,0 +1 @@ +loading16 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading16.svg b/initial/plugin/shell/res/upgrade/loading16.svg new file mode 100644 index 0000000..fe484fb --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading16.svg @@ -0,0 +1 @@ +loading17 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/loading17.svg b/initial/plugin/shell/res/upgrade/loading17.svg new file mode 100644 index 0000000..e86d540 --- /dev/null +++ b/initial/plugin/shell/res/upgrade/loading17.svg @@ -0,0 +1 @@ +loading18 \ No newline at end of file diff --git a/initial/plugin/shell/res/upgrade/normal.png b/initial/plugin/shell/res/upgrade/normal.png new file mode 100644 index 0000000..0173381 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/normal.png differ diff --git a/initial/plugin/shell/res/upgrade/refresh.png b/initial/plugin/shell/res/upgrade/refresh.png new file mode 100644 index 0000000..876a950 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/refresh.png differ diff --git a/initial/plugin/shell/res/upgrade/update.png b/initial/plugin/shell/res/upgrade/update.png new file mode 100644 index 0000000..fe222a3 Binary files /dev/null and b/initial/plugin/shell/res/upgrade/update.png differ diff --git a/plugin/src/appupdate.cpp b/initial/plugin/src/appupdate.cpp similarity index 100% rename from plugin/src/appupdate.cpp rename to initial/plugin/src/appupdate.cpp diff --git a/plugin/src/appupdate.h b/initial/plugin/src/appupdate.h similarity index 100% rename from plugin/src/appupdate.h rename to initial/plugin/src/appupdate.h diff --git a/plugin/src/backup.cpp b/initial/plugin/src/backup.cpp similarity index 100% rename from plugin/src/backup.cpp rename to initial/plugin/src/backup.cpp diff --git a/plugin/src/backup.h b/initial/plugin/src/backup.h similarity index 100% rename from plugin/src/backup.h rename to initial/plugin/src/backup.h diff --git a/plugin/src/backuptools-define.h b/initial/plugin/src/backuptools-define.h similarity index 100% rename from plugin/src/backuptools-define.h rename to initial/plugin/src/backuptools-define.h diff --git a/initial/plugin/src/checkbutton.cpp b/initial/plugin/src/checkbutton.cpp new file mode 100644 index 0000000..1162daf --- /dev/null +++ b/initial/plugin/src/checkbutton.cpp @@ -0,0 +1,52 @@ +#include "checkbutton.h" +#include + +m_button::m_button(QWidget *parent) : QPushButton(parent) +{ + m_cTimer = new QTimer(this); + states =true; + m_cTimer->setInterval(140);//设置动画速度?不是设置超时? + buttonshow(); + +} + +void m_button::buttonshow() +{ + //通过定时器实现循环插入载入图片 + connect(m_cTimer,&QTimer::timeout, [this] () { + QIcon icon; + QString str = QString(":/img/upgrade/loading%1.svg").arg(i); + icon.addFile(str); + this->setIcon(icon); + i++; + if(i==18){//8个图片 + i=10; + } + }); +} + +void m_button::start() +{ + this->setText(""); + m_cTimer->start(); + states = false; +} + +void m_button::stop() +{ + QIcon icon; + this->setIcon(icon); + m_cTimer->stop(); + states = true; +} + +void m_button::buttonswitch() +{ + //两态开关,实现一个按钮开始暂停功能 + qDebug()< +#include +#include + +class m_button : public QPushButton +{ + Q_OBJECT +public: + m_button(QWidget *parent = nullptr); + QTimer *m_cTimer; + int i = 10;//初始化从17图片开始 + bool states; + + void start(); + + void stop(); + + void buttonshow(); + + void buttonswitch(); + + +signals: + +}; +#endif // CHECKBUTTON_H diff --git a/initial/plugin/src/connection.h b/initial/plugin/src/connection.h new file mode 100644 index 0000000..de7b386 --- /dev/null +++ b/initial/plugin/src/connection.h @@ -0,0 +1,48 @@ +#ifndef CONNECTION_H +#define CONNECTION_H +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static bool CreatConnection() +{ + QSqlDatabase db1 = QSqlDatabase::addDatabase("QSQLITE","A"); + QString dirPath = QString("/var/cache/kylin-system-updater"); + QString dbPath = QString("%1/kylin-system-updater.db").arg(dirPath); + QDir dir(dirPath); + if(!dir.exists()) + { + dir.mkpath(dirPath); + } + QFile file(dbPath); + if(!file.exists()) + { + QFile::copy("/usr/share/kylin-system-updater/kylin-system-updater.db", dbPath); + } + db1.setDatabaseName(dbPath); + if (!db1.open()) { + qDebug()<<"更新管理器数据库打开失败."; + return false; + } + qDebug()<<"更新管理器数据库打开成功."; + + /* 获取软件商店数据库链接 */ + QSqlDatabase db2 = QSqlDatabase::addDatabase("QSQLITE" , "B"); + db2.setDatabaseName(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.cache/uksc/uksc.db"); + if (!db2.open()) { + qDebug() << "Error : open software database fail"; + return false; + } + + qDebug() << "open software center database success!"; + + return true; +} + +#endif // CONNECTION_H diff --git a/initial/plugin/src/daemonipcdbus.cpp b/initial/plugin/src/daemonipcdbus.cpp new file mode 100644 index 0000000..e468da6 --- /dev/null +++ b/initial/plugin/src/daemonipcdbus.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2020, KylinSoft 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 3 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, see . + */ + + +#include "daemonipcdbus.h" + +int DaemonIpcDbus::daemonIsNotRunning() +{ + char service_name[SERVICE_NAME_SIZE]; + memset(service_name, 0, SERVICE_NAME_SIZE); + snprintf(service_name, SERVICE_NAME_SIZE, "%s_%d",KYLIN_USER_GUIDE_SERVICE,getuid()); + QDBusConnection conn = QDBusConnection::sessionBus(); + if (!conn.isConnected()) + return -1; + + QDBusReply reply = conn.interface()->call("GetNameOwner", service_name); + return reply.value() == ""; +} + +void DaemonIpcDbus::showGuide(QString appName) +{ + qDebug() << Q_FUNC_INFO << appName; + bool bRet = false; + + char service_name[SERVICE_NAME_SIZE]; + memset(service_name, 0, SERVICE_NAME_SIZE); + snprintf(service_name, SERVICE_NAME_SIZE, "%s_%d",KYLIN_USER_GUIDE_SERVICE,getuid()); + + qDebug() << "service_name " << service_name; + // 用来构造一个在D-Bus上传递的Message + QDBusMessage m = QDBusMessage::createMethodCall(QString(service_name),KYLIN_USER_GUIDE_PATH,KYLIN_USER_GUIDE_INTERFACE,"showGuide"); + // 给QDBusMessage增加一个参数; + // 这是一种比较友好的写法,也可以用setArguments来实现 + m << appName; + + // 发送Message + QDBusMessage response = QDBusConnection::sessionBus().call(m); + // 判断Method是否被正确返回 + if (response.type()== QDBusMessage::ReplyMessage) + { + // QDBusMessage的arguments不仅可以用来存储发送的参数,也用来存储返回值; +// bRet = response.arguments().at(0).toBool(); + } + else { + qDebug()<<"showGuide In fail!\n"; + } + + qDebug()<<"bRet:"<. + */ + +#ifndef DAEMONIPCDBUS_H +#define DAEMONIPCDBUS_H + +#define KYLIN_USER_GUIDE_PATH "/" + +#define KYLIN_USER_GUIDE_SERVICE "com.kylinUserGuide.hotel" + +#define KYLIN_USER_GUIDE_INTERFACE "com.guide.hotel" + +#define SERVICE_NAME_SIZE 30 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class DaemonIpcDbus : public QObject +{ + Q_OBJECT + // 定义Interface名称为com.scorpio.test.value + // Q_CLASSINFO("D-Bus Interface", "com.scorpio.test.value") +public: + + DaemonIpcDbus() {} + +public slots: + + int daemonIsNotRunning(); + void showGuide(QString appName); + +}; + +/* +// 使用方法 +DaemonIpcDbus *mDaemonIpcDbus; +mDaemonIpcDbus = new DaemonIpcDbus(); +if (!mDaemonIpcDbus->daemonIsNotRunning()){ + //增加标题栏帮助菜单、F1快捷键打开用户手册 + mDaemonIpcDbus->showGuide("kylin-ipmsg"); +} +*/ + +#endif // DAEMONIPCDBUS_H diff --git a/plugin/src/deletepkglistwig.cpp b/initial/plugin/src/deletepkglistwig.cpp similarity index 100% rename from plugin/src/deletepkglistwig.cpp rename to initial/plugin/src/deletepkglistwig.cpp diff --git a/plugin/src/deletepkglistwig.h b/initial/plugin/src/deletepkglistwig.h similarity index 100% rename from plugin/src/deletepkglistwig.h rename to initial/plugin/src/deletepkglistwig.h diff --git a/plugin/src/dependencyfixdialog.cpp b/initial/plugin/src/dependencyfixdialog.cpp similarity index 100% rename from plugin/src/dependencyfixdialog.cpp rename to initial/plugin/src/dependencyfixdialog.cpp diff --git a/plugin/src/dependencyfixdialog.h b/initial/plugin/src/dependencyfixdialog.h similarity index 100% rename from plugin/src/dependencyfixdialog.h rename to initial/plugin/src/dependencyfixdialog.h diff --git a/plugin/src/detaildialog.cpp b/initial/plugin/src/detaildialog.cpp similarity index 100% rename from plugin/src/detaildialog.cpp rename to initial/plugin/src/detaildialog.cpp diff --git a/plugin/src/detaildialog.h b/initial/plugin/src/detaildialog.h similarity index 100% rename from plugin/src/detaildialog.h rename to initial/plugin/src/detaildialog.h diff --git a/plugin/src/fixbrokeninstalldialog.cpp b/initial/plugin/src/fixbrokeninstalldialog.cpp similarity index 100% rename from plugin/src/fixbrokeninstalldialog.cpp rename to initial/plugin/src/fixbrokeninstalldialog.cpp diff --git a/plugin/src/fixbrokeninstalldialog.h b/initial/plugin/src/fixbrokeninstalldialog.h similarity index 100% rename from plugin/src/fixbrokeninstalldialog.h rename to initial/plugin/src/fixbrokeninstalldialog.h diff --git a/plugin/src/fixupdetaillist.cpp b/initial/plugin/src/fixupdetaillist.cpp similarity index 100% rename from plugin/src/fixupdetaillist.cpp rename to initial/plugin/src/fixupdetaillist.cpp diff --git a/plugin/src/fixupdetaillist.h b/initial/plugin/src/fixupdetaillist.h similarity index 100% rename from plugin/src/fixupdetaillist.h rename to initial/plugin/src/fixupdetaillist.h diff --git a/plugin/src/global.cpp b/initial/plugin/src/global.cpp similarity index 100% rename from plugin/src/global.cpp rename to initial/plugin/src/global.cpp diff --git a/plugin/src/global.h b/initial/plugin/src/global.h similarity index 100% rename from plugin/src/global.h rename to initial/plugin/src/global.h diff --git a/plugin/src/historyupdatelistwig.cpp b/initial/plugin/src/historyupdatelistwig.cpp similarity index 100% rename from plugin/src/historyupdatelistwig.cpp rename to initial/plugin/src/historyupdatelistwig.cpp diff --git a/plugin/src/historyupdatelistwig.h b/initial/plugin/src/historyupdatelistwig.h similarity index 100% rename from plugin/src/historyupdatelistwig.h rename to initial/plugin/src/historyupdatelistwig.h diff --git a/initial/plugin/src/kylin-update-frontend.desktop b/initial/plugin/src/kylin-update-frontend.desktop new file mode 100644 index 0000000..b395b23 --- /dev/null +++ b/initial/plugin/src/kylin-update-frontend.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Name=System-Upgrade +Name[zh_CN]=系统更新 +Name[zh_HK]=系统更新 +Name[zh_TW]=系统更新 +Comment=Kylin系统更新 +Comment[tr]=Kylin System Upgrade +Icon=ukui-control-center +Exec=ukui-control-center --upgrade +Terminal=false +Type=Application +NoDisplay=true +StartupNotify=true +Categories=Qt;Upgrade; diff --git a/plugin/src/m_updatelog.cpp b/initial/plugin/src/m_updatelog.cpp similarity index 100% rename from plugin/src/m_updatelog.cpp rename to initial/plugin/src/m_updatelog.cpp diff --git a/plugin/src/m_updatelog.h b/initial/plugin/src/m_updatelog.h similarity index 100% rename from plugin/src/m_updatelog.h rename to initial/plugin/src/m_updatelog.h diff --git a/plugin/src/metatypes.h b/initial/plugin/src/metatypes.h similarity index 100% rename from plugin/src/metatypes.h rename to initial/plugin/src/metatypes.h diff --git a/initial/plugin/src/mylabel.cpp b/initial/plugin/src/mylabel.cpp new file mode 100644 index 0000000..6bfed1d --- /dev/null +++ b/initial/plugin/src/mylabel.cpp @@ -0,0 +1,89 @@ +#include "mylabel.h" +#include + +MyLabel::MyLabel(QWidget *parent, Qt::WindowFlags f) + : QLabel(parent, f) +{ + this->setMinimumWidth(minSize); + setTextFormat(Qt::PlainText); +} + +MyLabel::MyLabel(const QString &text, QWidget *parent, Qt::WindowFlags f) + : QLabel(text, parent, f), m_fullText(text) +{ + this->setMinimumWidth(minSize); + setTextFormat(Qt::PlainText); +} + +void MyLabel::setText(const QString &text) +{ + setFullText(text); +} + +void MyLabel::setFullText(const QString &text) +{ + m_fullText = text; + update(); +} + +void MyLabel::setTextLimitShrink(const QString &text, int width) +{ + this->setMinimumWidth(qMin(this->fontMetrics().width(text), width)); +// this->setMinimumSize(200); + setFullText(text); +} + +void MyLabel::setTextLimitExpand(const QString &text) +{ + int textWidth = this->fontMetrics().width(text); + this->setMaximumWidth(textWidth); + setFullText(text); +} + +QString MyLabel::fullText() const +{ + return m_fullText; +} + +void MyLabel::paintEvent(QPaintEvent *event) +{ + QLabel::paintEvent(event); + elideText(); +} + +void MyLabel::elideText() +{ + QFontMetrics fm = this->fontMetrics(); + int dif = fm.width(m_fullText) - this->width(); + if (dif > 0) { + QString showText = fm.elidedText(m_fullText, Qt::ElideRight, this->width()); + QLabel::setText(showText); + if (showText != m_fullText) { + QString str = dealMessage(m_fullText); + this->setToolTip(str); + } else { + this->setToolTip(""); + } + } else { + QLabel::setText(m_fullText); + this->setToolTip(""); + } +} + +QString MyLabel::dealMessage(QString msg) +{ + if(msg.size() > fontSize) + { + QString str; + int time = msg.size()/fontSize; + for(int i = 0; i <= time-1; i++) + { + str = QString(str + msg.mid(i*fontSize,fontSize)+"\r\n"); + } + str = QString(str+msg.mid(time*fontSize,fontSize)); + return str; + } + else + return msg; +} + diff --git a/initial/plugin/src/mylabel.h b/initial/plugin/src/mylabel.h new file mode 100644 index 0000000..e105e1f --- /dev/null +++ b/initial/plugin/src/mylabel.h @@ -0,0 +1,28 @@ +#ifndef MYLABEL_H +#define MYLABEL_H +#include + +class MyLabel : public QLabel +{ + Q_OBJECT +public: + explicit MyLabel(QWidget *parent=0, Qt::WindowFlags f=0); + explicit MyLabel(const QString &text, QWidget *parent=0, Qt::WindowFlags f=0); + + void setText(const QString &text); + void setFullText(const QString &text); + void setTextLimitShrink(const QString &text, int width); + void setTextLimitExpand(const QString &text); + QString fullText() const; + QString dealMessage(QString msg); + int fontSize = 24; + int minSize = 120; +protected: + void paintEvent(QPaintEvent *); + +private: + void elideText(); +private: + QString m_fullText; +}; +#endif // MYLABEL_H diff --git a/plugin/src/picturetowhite.cpp b/initial/plugin/src/picturetowhite.cpp similarity index 100% rename from plugin/src/picturetowhite.cpp rename to initial/plugin/src/picturetowhite.cpp diff --git a/plugin/src/picturetowhite.h b/initial/plugin/src/picturetowhite.h similarity index 100% rename from plugin/src/picturetowhite.h rename to initial/plugin/src/picturetowhite.h diff --git a/plugin/src/shadowwidget.h b/initial/plugin/src/shadowwidget.h similarity index 100% rename from plugin/src/shadowwidget.h rename to initial/plugin/src/shadowwidget.h diff --git a/initial/plugin/src/switchbutton.cpp b/initial/plugin/src/switchbutton.cpp new file mode 100644 index 0000000..e16c8c7 --- /dev/null +++ b/initial/plugin/src/switchbutton.cpp @@ -0,0 +1,204 @@ +/* -*- 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 "switchbutton.h" + +#include + +SwitchButton::SwitchButton(QWidget *parent) : + QWidget(parent) +{ +// this->resize(QSize(52, 24)); + this->setFixedSize(QSize(48, 24)); + + checked = false; + + borderColorOff = QColor("#cccccc"); + + bgColorOff = QColor("#cccccc"); + bgColorOn = QColor("#3790FA"); + + sliderColorOff = QColor("#ffffff"); + sliderColorOn = QColor("#ffffff"); + + space = 4; +// rectRadius = 5; + + step = width() / 40; + startX = 0; + endX= 0; + + timer = new QTimer(this); + timer->setInterval(5); + connect(timer, SIGNAL(timeout()), this, SLOT(updatevalue())); +} + +SwitchButton::~SwitchButton() +{ +} + +void SwitchButton::paintEvent(QPaintEvent *){ + //启用反锯齿 + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing, true); + + drawBg(&painter); + drawSlider(&painter); +} + +void SwitchButton::drawBg(QPainter *painter){ + painter->save(); +// painter->setPen(Qt::NoPen); + + if (!checked){ + painter->setPen(Qt::NoPen); + painter->setBrush(bgColorOff); + } + else{ + painter->setPen(Qt::NoPen); + painter->setBrush(bgColorOn); + } + //circle out +// QRect rect(space, space, width() - space * 2, height() - space * 2); +// painter->drawRoundedRect(rect, rectRadius, rectRadius); + + //circle in + QRect rect(0, 0, width(), height()); + //半径为高度的一半 + int radius = rect.height() / 2; + //圆的宽度为高度 + int circleWidth = rect.height(); + + QPainterPath path; + path.moveTo(radius, rect.left()); + path.arcTo(QRectF(rect.left(), rect.top(), circleWidth, circleWidth), 90, 180); + path.lineTo(rect.width() - radius, rect.height()); + path.arcTo(QRectF(rect.width() - rect.height(), rect.top(), circleWidth, circleWidth), 270, 180); + path.lineTo(radius, rect.top()); + + painter->drawPath(path); + + painter->restore(); +} + +void SwitchButton::drawSlider(QPainter *painter){ + painter->save(); + painter->setPen(Qt::NoPen); + + if (!checked){ + painter->setBrush(sliderColorOff); + } + else + painter->setBrush(sliderColorOn); + //circle out +// QRect rect(0, 0, width() - space, height() - space); +// int sliderwidth = rect.height(); +// QRect sliderRect(startX, space / 2, sliderwidth, sliderwidth); +// painter->drawEllipse(sliderRect); + + //circle in + QRect rect(0, 0, width(), height()); + int sliderWidth = rect.height() - space * 2; + QRect sliderRect(startX + space, space, sliderWidth, sliderWidth); + painter->drawEllipse(sliderRect); + + painter->restore(); +} + +void SwitchButton::mousePressEvent(QMouseEvent *){ + checked = !checked; + emit checkedChanged(checked); + + step = width() / 40; + + if (checked){ + //circle out +// endX = width() - height() + space; + //circle in + endX = width() - height(); + } + else{ + endX = 0; + } + timer->start(); +} + +void SwitchButton::resizeEvent(QResizeEvent *){ + // + step = width() / 40; + + if (checked){ + //circle out +// startX = width() - height() + space; + //circle in + startX = width() - height(); + } + else + startX = 0; + + update(); +} + +void SwitchButton::updatevalue(){ + if (checked) + if (startX < endX){ + startX = startX + step; + } + else{ + startX = endX; + timer->stop(); + } + else{ + if (startX > endX){ + startX = startX - step; + } + else{ + startX = endX; + timer->stop(); + } + } + update(); +} + +void SwitchButton::setChecked(bool checked){ + if (this->checked != checked){ + this->checked = checked; + emit checkedChanged(checked); + update(); + } + + step = width() / 40; + + if (checked){ + //circle out +// endX = width() - height() + space; + //circle in + endX = width() - height(); + } + else{ + endX = 0; + } + timer->start(); +} + +bool SwitchButton::isChecked(){ + return this->checked; +} + + diff --git a/initial/plugin/src/switchbutton.h b/initial/plugin/src/switchbutton.h new file mode 100644 index 0000000..895b828 --- /dev/null +++ b/initial/plugin/src/switchbutton.h @@ -0,0 +1,78 @@ +/* -*- 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 SWITCHBUTTON_H +#define SWITCHBUTTON_H + +#include +#include +#include +#include +#include + +class SwitchButton : public QWidget +{ + Q_OBJECT + +public: + SwitchButton(QWidget *parent = 0); + ~SwitchButton(); + + void setChecked(bool checked); + + bool isChecked(); + +protected: + void mousePressEvent(QMouseEvent *); + void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *); + void drawBg(QPainter * painter); + void drawSlider(QPainter * painter); + +private: + bool checked; + + QColor borderColorOff; + + QColor bgColorOff; + QColor bgColorOn; + + QColor sliderColorOff; + QColor sliderColorOn; + + int space; //滑块离背景间隔 + int rectRadius; //圆角角度 + + int step; //移动步长 + int startX; + int endX; + + QTimer * timer; + + +private slots: + void updatevalue(); + + +Q_SIGNALS: + void checkedChanged(bool checked); + +}; + +#endif // SWITCHBUTTON_H diff --git a/plugin/src/tabwidget.cpp b/initial/plugin/src/tabwidget.cpp similarity index 99% rename from plugin/src/tabwidget.cpp rename to initial/plugin/src/tabwidget.cpp index 1ba6e7e..adb659f 100644 --- a/plugin/src/tabwidget.cpp +++ b/initial/plugin/src/tabwidget.cpp @@ -1,6 +1,8 @@ #include "tabwidget.h" #include #include "backuptools-define.h" +#include "ukuistylehelper/ukuistylehelper.h" +#include "windowmanager/windowmanager.h" #define JSON_FILE_PATH "/var/lib/kylin-system-updater/json/" @@ -1532,6 +1534,7 @@ void TabWid::showHistoryWidget() { historyLog = m_updatelog::GetInstance(this); + kdk::UkuiStyleHelper::self()->removeHeader(historyLog); //在屏幕中央显示 //QRect availableGeometry = qApp->primaryScreen()->availableGeometry(); //historyLog->move((availableGeometry.width()-historyLog->width())/2,(availableGeometry.height()- historyLog->height())/2); @@ -2385,7 +2388,7 @@ void TabWid::receiveBackupStartResult(int result) case 20: { QMessageBox msgBox; - msgBox.setText("insufficient backup space"); + msgBox.setText(tr("insufficient backup space")); msgBox.setWindowTitle(tr("Prompt information")); msgBox.setIcon(QMessageBox::Icon::Information); msgBox.addButton(tr("OK"), QMessageBox::AcceptRole); diff --git a/plugin/src/tabwidget.h b/initial/plugin/src/tabwidget.h similarity index 100% rename from plugin/src/tabwidget.h rename to initial/plugin/src/tabwidget.h diff --git a/plugin/src/traybusthread.cpp b/initial/plugin/src/traybusthread.cpp similarity index 100% rename from plugin/src/traybusthread.cpp rename to initial/plugin/src/traybusthread.cpp diff --git a/plugin/src/traybusthread.h b/initial/plugin/src/traybusthread.h similarity index 100% rename from plugin/src/traybusthread.h rename to initial/plugin/src/traybusthread.h diff --git a/initial/plugin/src/ukscconn.cpp b/initial/plugin/src/ukscconn.cpp new file mode 100644 index 0000000..573670b --- /dev/null +++ b/initial/plugin/src/ukscconn.cpp @@ -0,0 +1,74 @@ +#include "ukscconn.h" +UKSCConn::UKSCConn() +{ + ukscDb = QSqlDatabase::addDatabase("QSQLITE"); + + QString UKSC_CACHE_DIR = QString(getenv("HOME")) + "/.cache/uksc/"; + QString UKSC_DATA_DIR = "/usr/share/kylin-software-center/data/"; + QString KUM_DIR = "/usr/share/kylin-update-manager/"; + QString dbFileName = ""; + dbFileName = UKSC_CACHE_DIR + "uksc.db"; + QFile file(dbFileName); + if (!file.exists()) { + dbFileName = UKSC_DATA_DIR + "uksc.db"; + file.setFileName(dbFileName); + + if (!file.exists()) { + dbFileName = KUM_DIR + "uksc.db"; + file.setFileName(dbFileName); + if (file.exists()) { + ukscDb.setDatabaseName(dbFileName); + } + } + } + ukscDb.setDatabaseName(dbFileName); + if (!ukscDb.open()) + { + qWarning() << "软件商店数据库打开错误!"; + isConnectUskc = false; + } + else + { + query = QSqlQuery(ukscDb);//连接数据库 + } +} + +// 根据应用名获取应用信息 +QStringList UKSCConn::getInfoByName(QString appName) +{ + QStringList appInfo; + if(isConnectUskc == true) + { + QString str = QString("select * from application where app_name = '%1'").arg(appName); + query.exec(str); + QString iconPath; // 应用图标 + QString displayNameCN; // 应用中文名 + QString displayName; // 应用英文名 + QString description; // 应用描述 + + while (query.next()) + { + iconPath = query.value(15).toString(); + displayNameCN = query.value(4).toString(); + displayName = query.value(3).toString(); + description = query.value(7).toString(); + } + + iconPath = QString(getenv("HOME")) + "/.cache/uksc/icons/" + appName + ".png"; + QFile file(iconPath); + if (!file.exists()) + { + appInfo.append(""); + } + else + { + appInfo.append(iconPath); + + } + appInfo.append(displayNameCN); + appInfo.append(displayName); + appInfo.append(description); + } + return appInfo; + +} diff --git a/initial/plugin/src/ukscconn.h b/initial/plugin/src/ukscconn.h new file mode 100644 index 0000000..c93435f --- /dev/null +++ b/initial/plugin/src/ukscconn.h @@ -0,0 +1,26 @@ +#ifndef UKSCCONN_H +#define UKSCCONN_H + +#include +#include +#include +#include +#include +#include +#include +#include + +class UKSCConn : public QObject +{ +public: + explicit UKSCConn(); + QSqlDatabase ukscDb; + QSqlQuery query; + bool isConnectUskc = true; + + // 根据应用名获取图标、中文名、描述 + QStringList getInfoByName(QString appName); + +}; + +#endif // UKSCCONN_H diff --git a/plugin/src/updatedbus.cpp b/initial/plugin/src/updatedbus.cpp similarity index 100% rename from plugin/src/updatedbus.cpp rename to initial/plugin/src/updatedbus.cpp diff --git a/plugin/src/updatedbus.h b/initial/plugin/src/updatedbus.h similarity index 100% rename from plugin/src/updatedbus.h rename to initial/plugin/src/updatedbus.h diff --git a/plugin/src/updatedeleteprompt.cpp b/initial/plugin/src/updatedeleteprompt.cpp similarity index 100% rename from plugin/src/updatedeleteprompt.cpp rename to initial/plugin/src/updatedeleteprompt.cpp diff --git a/plugin/src/updatedeleteprompt.h b/initial/plugin/src/updatedeleteprompt.h similarity index 100% rename from plugin/src/updatedeleteprompt.h rename to initial/plugin/src/updatedeleteprompt.h diff --git a/plugin/src/updatelog.cpp b/initial/plugin/src/updatelog.cpp similarity index 100% rename from plugin/src/updatelog.cpp rename to initial/plugin/src/updatelog.cpp diff --git a/plugin/src/updatelog.h b/initial/plugin/src/updatelog.h similarity index 100% rename from plugin/src/updatelog.h rename to initial/plugin/src/updatelog.h diff --git a/plugin/src/updatesource.cpp b/initial/plugin/src/updatesource.cpp similarity index 100% rename from plugin/src/updatesource.cpp rename to initial/plugin/src/updatesource.cpp diff --git a/plugin/src/updatesource.h b/initial/plugin/src/updatesource.h similarity index 100% rename from plugin/src/updatesource.h rename to initial/plugin/src/updatesource.h diff --git a/plugin/src/upgrademain.cpp b/initial/plugin/src/upgrademain.cpp similarity index 100% rename from plugin/src/upgrademain.cpp rename to initial/plugin/src/upgrademain.cpp diff --git a/plugin/src/upgrademain.h b/initial/plugin/src/upgrademain.h similarity index 100% rename from plugin/src/upgrademain.h rename to initial/plugin/src/upgrademain.h diff --git a/initial/plugin/src/utils.h b/initial/plugin/src/utils.h new file mode 100644 index 0000000..174990e --- /dev/null +++ b/initial/plugin/src/utils.h @@ -0,0 +1,60 @@ +#ifndef UTILS_H +#define UTILS_H +#include +#include + +#define DOWN_CACHE_PATH QString("%1/.kylin-update-manager/").arg(QDir::homePath()) +#define DOWN_TEMP_PATH QString("%1/.kylin-update-manager/kylin-update-manager-deb/deb/").arg(QDir::homePath()) +#define SOURCESLIST "/etc/apt/sources.list" + +enum type {http, ftp, file}; +struct UrlMsg //记录单包信息:包名、全名、链接、大小 +{ + QString name = ""; + QString fullname = ""; + QString url = ""; + long size = 0; +}; + +struct pkgProgress +{ + QString name; + mutable int downloadProgress = 0; + mutable int installProgress = 0; +}; + +struct AppMsg //记录当前包信息:包名、依赖列表、总大小、获取依赖状态 +{ + QVector depList; + long allSize = 0; + long installSize = 0; + bool getDepends = false; +}; + +struct AppAllMsg +{ + QString name; + QString section; + QString origin; + long installedSize; + QString maintainer; + QString source; + QString version; + long packageSize; + QString shortDescription; + QString longDescription; + + QString changedPackages; + QString packageCount; + + QString changelogUrl; + QString screenshotUrl; + QString availableVersion; + + bool isInstalled; + bool upgradeable; + AppMsg msg; +}; +Q_DECLARE_METATYPE(AppMsg) //注册AppMsg结构用于信号槽传输 +Q_DECLARE_METATYPE(AppAllMsg) //注册AppMsg结构用于信号槽传输 +#endif // UTILS_H diff --git a/plugin/src/widgetstyle.cpp b/initial/plugin/src/widgetstyle.cpp similarity index 100% rename from plugin/src/widgetstyle.cpp rename to initial/plugin/src/widgetstyle.cpp diff --git a/plugin/src/widgetstyle.h b/initial/plugin/src/widgetstyle.h similarity index 100% rename from plugin/src/widgetstyle.h rename to initial/plugin/src/widgetstyle.h diff --git a/initial/plugin/src/xatom-helper.cpp b/initial/plugin/src/xatom-helper.cpp new file mode 100644 index 0000000..2babe0b --- /dev/null +++ b/initial/plugin/src/xatom-helper.cpp @@ -0,0 +1,212 @@ +/* + * KWin Style UKUI + * + * Copyright (C) 2020, KylinSoft 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 3 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, see . + * + * Authors: Yue Lan + * + */ + +#include "xatom-helper.h" + +#include +#include +#include +#include + +static XAtomHelper *global_instance = nullptr; + +XAtomHelper *XAtomHelper::getInstance() +{ + if (!global_instance) + global_instance = new XAtomHelper; + return global_instance; +} + +bool XAtomHelper::isFrameLessWindow(int winId) +{ + auto hints = getInstance()->getWindowMotifHint(winId); + if (hints.flags == MWM_HINTS_DECORATIONS && hints.functions == 1) { + return true; + } + return false; +} + +bool XAtomHelper::isWindowDecorateBorderOnly(int winId) +{ + return isWindowMotifHintDecorateBorderOnly(getInstance()->getWindowMotifHint(winId)); +} + +bool XAtomHelper::isWindowMotifHintDecorateBorderOnly(const MotifWmHints &hint) +{ + bool isDeco = false; + if (hint.flags & MWM_HINTS_DECORATIONS && hint.flags != MWM_HINTS_DECORATIONS) { + if (hint.decorations == MWM_DECOR_BORDER) + isDeco = true; + } + return isDeco; +} + +bool XAtomHelper::isUKUICsdSupported() +{ + // fixme: + return false; +} + +bool XAtomHelper::isUKUIDecorationWindow(int winId) +{ + if (m_ukuiDecorationAtion == None) + return false; + + Atom type; + int format; + ulong nitems; + ulong bytes_after; + uchar *data; + + bool isUKUIDecoration = false; + + XGetWindowProperty(QX11Info::display(), winId, m_ukuiDecorationAtion, + 0, LONG_MAX, false, + m_ukuiDecorationAtion, &type, + &format, &nitems, + &bytes_after, &data); + + if (type == m_ukuiDecorationAtion) { + if (nitems == 1) { + isUKUIDecoration = data[0]; + } + } + + return isUKUIDecoration; +} + +UnityCorners XAtomHelper::getWindowBorderRadius(int winId) +{ + UnityCorners corners; + + Atom type; + int format; + ulong nitems; + ulong bytes_after; + uchar *data; + + if (m_unityBorderRadiusAtom != None) { + XGetWindowProperty(QX11Info::display(), winId, m_unityBorderRadiusAtom, + 0, LONG_MAX, false, + XA_CARDINAL, &type, + &format, &nitems, + &bytes_after, &data); + + if (type == XA_CARDINAL) { + if (nitems == 4) { + corners.topLeft = static_cast(data[0]); + corners.topRight = static_cast(data[1*sizeof (ulong)]); + corners.bottomLeft = static_cast(data[2*sizeof (ulong)]); + corners.bottomRight = static_cast(data[3*sizeof (ulong)]); + } + XFree(data); + } + } + + return corners; +} + +void XAtomHelper::setWindowBorderRadius(int winId, const UnityCorners &data) +{ + if (m_unityBorderRadiusAtom == None) + return; + + ulong corners[4] = {data.topLeft, data.topRight, data.bottomLeft, data.bottomRight}; + + XChangeProperty(QX11Info::display(), winId, m_unityBorderRadiusAtom, XA_CARDINAL, + 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &corners, sizeof (corners)/sizeof (corners[0])); +} + +void XAtomHelper::setWindowBorderRadius(int winId, int topLeft, int topRight, int bottomLeft, int bottomRight) +{ + if (m_unityBorderRadiusAtom == None) + return; + + ulong corners[4] = {(ulong)topLeft, (ulong)topRight, (ulong)bottomLeft, (ulong)bottomRight}; + + XChangeProperty(QX11Info::display(), winId, m_unityBorderRadiusAtom, XA_CARDINAL, + 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &corners, sizeof (corners)/sizeof (corners[0])); +} + +void XAtomHelper::setUKUIDecoraiontHint(int winId, bool set) +{ + if (m_ukuiDecorationAtion == None) + return; + + XChangeProperty(QX11Info::display(), winId, m_ukuiDecorationAtion, m_ukuiDecorationAtion, 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &set, 1); +} + +void XAtomHelper::setWindowMotifHint(int winId, const MotifWmHints &hints) +{ + if (m_unityBorderRadiusAtom == None) + return; + + XChangeProperty(QX11Info::display(), winId, m_motifWMHintsAtom, m_motifWMHintsAtom, + 32, XCB_PROP_MODE_REPLACE, (const unsigned char *)&hints, sizeof (MotifWmHints)/ sizeof (ulong)); +} + +MotifWmHints XAtomHelper::getWindowMotifHint(int winId) +{ + MotifWmHints hints; + + if (m_unityBorderRadiusAtom == None) + return hints; + + uchar *data; + Atom type; + int format; + ulong nitems; + ulong bytes_after; + + XGetWindowProperty(QX11Info::display(), winId, m_motifWMHintsAtom, + 0, sizeof (MotifWmHints)/sizeof (long), false, AnyPropertyType, &type, + &format, &nitems, &bytes_after, &data); + + if (type == None) { + return hints; + } else { + hints = *(MotifWmHints *)data; + XFree(data); + } + return hints; +} + +XAtomHelper::XAtomHelper(QObject *parent) : QObject(parent) +{ + if (!QX11Info::isPlatformX11()) + return; + + m_motifWMHintsAtom = XInternAtom(QX11Info::display(), "_MOTIF_WM_HINTS", true); + m_unityBorderRadiusAtom = XInternAtom(QX11Info::display(), "_UNITY_GTK_BORDER_RADIUS", false); + m_ukuiDecorationAtion = XInternAtom(QX11Info::display(), "_KWIN_UKUI_DECORAION", false); +} + +Atom XAtomHelper::registerUKUICsdNetWmSupportAtom() +{ + // fixme: + return None; +} + +void XAtomHelper::unregisterUKUICsdNetWmSupportAtom() +{ + // fixme: +} diff --git a/initial/plugin/src/xatom-helper.h b/initial/plugin/src/xatom-helper.h new file mode 100644 index 0000000..56d8549 --- /dev/null +++ b/initial/plugin/src/xatom-helper.h @@ -0,0 +1,110 @@ +/* + * KWin Style UKUI + * + * Copyright (C) 2020, KylinSoft 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 3 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, see . + * + * Authors: Yue Lan + * + */ + +#ifndef XATOMHELPER_H +#define XATOMHELPER_H + +#include +#include +#include + +struct UnityCorners { + ulong topLeft = 0; + ulong topRight = 0; + ulong bottomLeft = 0; + ulong bottomRight = 0; +}; + +typedef struct { + ulong flags = 0; + ulong functions = 0; + ulong decorations = 0; + long input_mode = 0; + ulong status = 0; +} MotifWmHints, MwmHints; + +#define MWM_HINTS_FUNCTIONS (1L << 0) +#define MWM_HINTS_DECORATIONS (1L << 1) +#define MWM_HINTS_INPUT_MODE (1L << 2) +#define MWM_HINTS_STATUS (1L << 3) + +#define MWM_FUNC_ALL (1L << 0) +#define MWM_FUNC_RESIZE (1L << 1) +#define MWM_FUNC_MOVE (1L << 2) +#define MWM_FUNC_MINIMIZE (1L << 3) +#define MWM_FUNC_MAXIMIZE (1L << 4) +#define MWM_FUNC_CLOSE (1L << 5) + +#define MWM_DECOR_ALL (1L << 0) +#define MWM_DECOR_BORDER (1L << 1) +#define MWM_DECOR_RESIZEH (1L << 2) +#define MWM_DECOR_TITLE (1L << 3) +#define MWM_DECOR_MENU (1L << 4) +#define MWM_DECOR_MINIMIZE (1L << 5) +#define MWM_DECOR_MAXIMIZE (1L << 6) + +#define MWM_INPUT_MODELESS 0 +#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 +#define MWM_INPUT_SYSTEM_MODAL 2 +#define MWM_INPUT_FULL_APPLICATION_MODAL 3 +#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL + +#define MWM_TEAROFF_WINDOW (1L<<0) + +namespace UKUI { +class Decoration; +} + +class XAtomHelper : public QObject +{ + friend class UKUI::Decoration; + Q_OBJECT +public: + static XAtomHelper *getInstance(); + + static bool isFrameLessWindow(int winId); + + bool isWindowDecorateBorderOnly(int winId); + bool isWindowMotifHintDecorateBorderOnly(const MotifWmHints &hint); + bool isUKUICsdSupported(); + bool isUKUIDecorationWindow(int winId); + + UnityCorners getWindowBorderRadius(int winId); + void setWindowBorderRadius(int winId, const UnityCorners &data); + void setWindowBorderRadius(int winId, int topLeft, int topRight, int bottomLeft, int bottomRight); + void setUKUIDecoraiontHint(int winId, bool set = true); + + void setWindowMotifHint(int winId, const MotifWmHints &hints); + MotifWmHints getWindowMotifHint(int winId); + +private: + explicit XAtomHelper(QObject *parent = nullptr); + + Atom registerUKUICsdNetWmSupportAtom(); + void unregisterUKUICsdNetWmSupportAtom(); + + Atom m_motifWMHintsAtom = None; + Atom m_unityBorderRadiusAtom = None; + Atom m_ukuiDecorationAtion = None; +}; + +#endif // XATOMHELPER_H diff --git a/initial/plugin/translate_generation.sh b/initial/plugin/translate_generation.sh new file mode 100755 index 0000000..72f748b --- /dev/null +++ b/initial/plugin/translate_generation.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +ts_list=(`ls translations/*.ts`) +source /etc/os-release +version=(`echo $ID`) + +for ts in "${ts_list[@]}" +do + printf "\nprocess ${ts}\n" + if [ "$version" == "fedora" ] || [ "$version" == "opensuse-leap" ] || [ "$version" == "opensuse-tumbleweed" ];then + lrelease-qt5 "${ts}" + else + lrelease "${ts}" + fi +done diff --git a/initial/plugin/translations/bo.qm b/initial/plugin/translations/bo.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/translations/bo.qm @@ -0,0 +1 @@ + AppUpdateWid - + Cancel failed,Being installed 取消失败,安装中 ཕམ་ཉེས་བྱུང་ནས་སྒྲིག་སྦྱོར་བྱེད་བཞིན་ཡོད། - + Being installed སྒྲིག་སྦྱོར་བྱེད་བཞིན་པ། - + Download succeeded! ཕབ་ལེན་ལེགས་འགྲུབ་བྱུང་བ་རེད། - - - - - - - - Update succeeded , It is recommended that you restart later! - གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་སོང་། ཁྱེད་ཀྱིས་རྗེས་སུ་ཡང་བསྐྱར་འགོ་འཛུགས་རྒྱུའི་གྲོས་འགོ་འདོན་རྒྱུ་ཡིན། - - - - - - - Version: - པར་གཞི་འདི་ལྟ་སྟེ། - @@ -44,71 +26,89 @@ + Update succeeded , It is recommended that you restart later! + གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་སོང་། ཁྱེད་ཀྱིས་རྗེས་སུ་ཡང་བསྐྱར་འགོ་འཛུགས་རྒྱུའི་གྲོས་འགོ་འདོན་རྒྱུ་ཡིན། + + + + + + + Version: + པར་གཞི་འདི་ལྟ་སྟེ། + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ་རེད། ཁྱེད་ཀྱིས་རྗེས་སུ་ཐོ་འགོད་བྱས་ནས་ཡང་བསྐྱར་ཐོ་འགོད་བྱ་རྒྱུའི་གྲོས་འགོ་འདོན་རྒྱུ་ཡིན། - - - - + + + + Update succeeded! གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ་རེད། - - - - - + + + + + Update has been canceled! གསར་སྒྱུར་མེད་པར་བཟོས་ཟིན། - - - - + + + + Update failed! གསར་སྒྱུར་ལ་ཕམ་ཉེས་བྱུང་བ་རེད། - - + + Failure reason: ཕམ་ཉེས་བྱུང་བའི་རྒྱུ་རྐྱེན་ནི། - + There are unresolved dependency conflicts in this update,Please select update all གསར་སྒྱུར་འདིའི་ནང་དུ་ཐག་གཅོད་བྱས་མེད་པའི་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས། ཚང་མ་གསར་སྒྱུར་བྱེད་རོགས། - - + + Prompt information མགྱོགས་མྱུར་གྱི་ཆ་འཕྲིན། - + Update ALL ཚང་མ་གསར་སྒྱུར་བྱ་ - - - - + + + + Cancel ཕྱིར་འཐེན། - + There are དེ་རུ་ཡོད་པ་ནི། - + packages going to be removed,Please confirm whether to accept! ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། @@ -117,17 +117,17 @@ ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། - + version: པར་གཞི་འདི་ལྟ་སྟེ། - + The update stopped because of low battery. གློག་སྨན་དམའ་བའི་རྐྱེན་གྱིས་གསར་སྒྱུར་བྱེད་མཚམས་བཞག་པ་རེད། - + The system update requires that the battery power is not less than 50% མ་ལག་གསར་སྒྱུར་བྱེད་པར་གློག་སྨན་གྱི་སྒུལ་ཤུགས་50%ལས་མི་ཉུང་བའི་བླང་བྱ་བཏོན་ཡོད། @@ -136,26 +136,26 @@ 个软件包将被卸载! - - - - - - - - - + + + + + + + + + Update གསར་སྒྱུར། - + details ཞིབ་ཕྲའི་གནས་ཚུལ། - - + + Update log གསར་སྒྱུར་ཉིན་ཐོ། @@ -164,17 +164,17 @@ 最新: - + Download size: ཕབ་ལེན་གྱི་གཞི་ཁྱོན་ནི། - + Install size: སྒྲིག་སྦྱོར་བྱས་པའི་གཞི་ཁྱོན་ནི། - + Current version: ད་ལྟའི་པར་གཞི་ནི། @@ -187,33 +187,33 @@ 电池电量低于 50%,无法下载更新 - + OK འགྲིགས། - + A single update will not automatically backup the system, if you want to backup, please click Update All. གསར་སྒྱུར་རྐྱང་པ་ཞིག་གིས་མ་ལག་རང་འགུལ་གྱིས་རྗེས་གྲབས་བྱེད་མི་སྲིད། གལ་ཏེ་ཁྱོད་ཀྱིས་རྗེས་གྲབས་བྱེད་འདོད་ན་གསར་སྒྱུར་ཚང་མ་མནན་རོགས། - + Do not backup, continue to update རྗེས་གྲབས་མི་བྱེད་པར་མུ་མཐུད་དུ་གསར་སྒྱུར་བྱེད་དགོས། - + This time will no longer prompt ཐེངས་འདིར་ཡང་བསྐྱར་སྐུལ་འདེད་བྱེད་མི་ཐུབ། - + Ready to update 准备更新 གསར་སྒྱུར་བྱེད་པར་གྲ་སྒྲིག་ - + downloaded 已下载 ཕབ་ལེན་བྱས་པ། @@ -223,19 +223,19 @@ 准备安装 - - + + downloading ཕབ་ལེན་བྱེད་པ། - + calculating 计算中 རྩིས་རྒྱག་པ། - + No content. ནང་དོན་གང་ཡང་མེད། @@ -274,16 +274,16 @@ - - - - - - - - - - + + + + + + + + + + Check Update ཞིབ་བཤེར་གསར་སྒྱུར། @@ -293,15 +293,15 @@ - - - - - - - - - + + + + + + + + + UpdateAll གསར་སྒྱུར་བྱེད་པ། @@ -310,8 +310,8 @@ 您的系统已是最新! - - + + No Information! དཔྱད་གཞིའི་ཡིག་ཆ་མེད། @@ -333,100 +333,101 @@ 取消更新 - - + + Being updated... གསར་སྒྱུར་བྱེད་བཞིན་པའི་སྒང་ཡིན། - - + + Updatable app detected on your system! ཁྱེད་ཚོའི་མ་ལག་ནང་དུ་ཞིབ་དཔྱད་ཚད་ལེན་བྱས་པའི་ཉེར་སྤྱོད་གོ་རིམ་གསར་པ་ - + The backup restore partition could not be found. The system will not be backed up in this update! རྗེས་གྲབས་སླར་གསོ་བྱེད་པའི་ཆ་ཤས་རྙེད་མི་ཐུབ། ཐེངས་འདིའི་གསར་སྒྱུར་ཁྲོད་མ་ལག་ལ་རྒྱབ་སྐྱོར་བྱེད་མི་སྲིད། - + Kylin backup restore tool is doing other operations, please update later. ཅིན་ལིན་གྱི་རྗེས་གྲབས་ཡོ་བྱད་སླར་གསོ་བྱེད་པའི་ཡོ་བྱད་ཀྱིས་ད་དུང་ལས་ཀ་གཞན་དག་བྱེད་བཞིན་ཡོད་པས། རྗེས་སུ - + The source manager configuration file is abnormal, the system temporarily unable to update! འབྱུང་ཁུངས་ཀྱི་སྤྱི་གཉེར་བའི་བཀོད་སྒྲིག་ཡིག་ཆ་རྒྱུན་ལྡན་མིན་པས་མ་ལག་གནས་སྐབས་སུ་གསར་སྒྱུར་བྱེད་ཐབས་བྲལ་ - + Backup already, no need to backup again. རྗེས་གྲབས་བྱས་ཟིན་པས་སླར་ཡང་རྗེས་གྲབས་བྱེད་དགོས་དོན་མེད། - + Start backup,getting progress རྗེས་གྲབས་ལས་དོན་སྤེལ་འགོ་བཙུགས་ཏེ་ཡར་རྒྱས་ཡོང - + Kylin backup restore tool does not exist, this update will not backup the system! ཅིན་ལིན་གྱི་རྗེས་གྲབས་སླར་གསོ་ཡོ་བྱད་མེད་པས། གསར་སྒྱུར་འདིས་མ་ལག་ལ་རྗེས་གྲབས་བྱེད་མི་སྲིད། - - - - - - - - + + + + + + + + Cancel ཕྱིར་འཐེན། - + Calculated རྩིས་བརྒྱབ་པ། - + There are unresolved dependency conflicts in this update,Please contact the administrator! གསར་སྒྱུར་འདིའི་ནང་དུ་ཐག་གཅོད་བྱས་མེད་པའི་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས། དོ་དམ་པར་འབྲེལ་གཏུག་བྱེད་རོགས། - - - + + + + Prompt information མགྱོགས་མྱུར་གྱི་ཆ་འཕྲིན། - - - - - - + + + + + + Your system is the latest: ཁྱོད་ཀྱི་མ་ལག་ནི་པར་གཞི་ཆེས་གསར་བ་ཡིན - + Sure གཏན་འཁེལ་བྱ་དགོས། - - + + In the download ཕབ་ལེན་བྱེད་པའི་ཁྲོད། - + calculating 计算中 རྩིས་རྒྱག་པ། @@ -436,17 +437,17 @@ 安装中... - + Backup complete. རྗེས་གྲབས་ལས་ཀ་ལེགས་འགྲུབ་བྱུང་བ - + System is backing up... མ་ལག་གིས་རྒྱབ་སྐྱོར་བྱེད་བཞིན་ཡོད། - + Backup interrupted, stop updating! རྗེས་གྲབས་བྱེད་མཚམས་བཞག་ནས་གསར་སྒྱུར་བྱེད་མཚམས་འཇོག་དགོས། @@ -455,31 +456,30 @@ 备份完成! - + Kylin backup restore tool exception: ཅིན་ལིན་གྱི་རྗེས་གྲབས་ཡོ་བྱད་སླར་གསོ་བྱེད་པའི་ཡོ་བྱད་ - + There will be no backup in this update! གསར་སྒྱུར་འདིའི་ནང་དུ་རྗེས་གྲབས་དཔུང་ཁག་ཡོད་མི་སྲིད། - + The status of backup completion is abnormal 备份完成状态异常 རྗེས་གྲབས་ལེགས་འགྲུབ་བྱུང་བའི་གནས་ཚུལ་ནི་རྒྱུན་ལྡན་མིན་པ - + Getting update list གསར་སྒྱུར་གྱི་མིང་ཐོ་ཐོབ་པ། - Software source update successed: 软件源更新成功: - མཉེན་ཆས་ཀྱི་འབྱུང་ཁུངས་གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ + མཉེན་ཆས་ཀྱི་འབྱུང་ཁུངས་གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བ Software source update failed: @@ -490,19 +490,19 @@ 更新软件源进度: - - + + Update གསར་སྒྱུར། - + There are unresolved dependency conflicts in this update,Please select Dist-upgrade 本次更新存在无法解决的依赖冲突,请选择全盘更新 ཐེངས་འདིའི་གསར་སྒྱུར་ཁྲོད་དུ་ཐག་གཅོད་བྱས་མེད་པའི་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས། ཁྱེད་ཀྱིས་Dist-upgradeབདམས་རོགས། - + Dist-upgrade 全盘更新 རྒྱང་རིང་གི་རིམ་པ་འཕར་བ། @@ -523,18 +523,18 @@ གསར་སྒྱུར་སྒྲིག་སྦྱོར་བྱེད་པ... - + In the install སྒྲིག་སྦྱོར་བྱེད་པའི་ཁྲོད་ - - + + Retry བསྐྱར་དུ་ཞིབ་བཤེར་བྱ་དགོས། - + The system is checking update : མ་ལག་གིས་གནས་ཚུལ་གསར་བར་ཞིབ་བཤེར་བྱེད་བཞིན་ཡོད། @@ -543,7 +543,7 @@ 下载限速(Kb/s) - + View history ལོ་རྒྱུས་ལ་ལྟ་ཞིབ་ @@ -552,18 +552,18 @@ 详情 - + Update Settings གསར་སྒྱུར་སྒྲིག་བཀོད། /upgrade/Update Settings - + Allowed to renewable notice བསྐྱར་སྤྱོད་རུང་བའི་བརྡ་ཐོ་བཏང་ཆོག། - + Backup current system before updates all ཚང་མ་གསར་སྒྱུར་མ་བྱས་གོང་ལ་ད་ལྟ་སྤྱོད་བཞིན་ @@ -572,7 +572,7 @@ 下载限速(KB/s) - + It will be avaliable in the next download. ཐེངས་རྗེས་མར་ཕབ་ལེན་བྱས་ན་འགན་འཁྲི་འཁུར་དགོས། @@ -593,27 +593,27 @@ 下载限速(kB/s) - + The system will automatically updates when there is an available network and backup. མ་ལག་འདི་ལ་ད་ཡོད་ཀྱི་དྲ་རྒྱ་དང་རྗེས་གྲབས་ཡོད་པའི་སྐབས་སུ་རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་སྲིད། - + Ready to install སྒྲིག་སྦྱོར་བྱེད་པར་གྲ་སྒྲིག་ - - - - - - - - - - + + + + + + + + + + Last Checked: མཇུག་མཐར་ཞིབ་བཤེར་བྱས་པ་གཤམ་ @@ -623,51 +623,51 @@ - - - - - - - - - + + + + + + + + + No information! དཔྱད་གཞིའི་ཡིག་ཆ་མེད། - + Download Limit ཕབ་ལེན་གྱི་བཅད་གྲངས། - - + + Dependency conflict exists in this update,need to be completely repaired! གསར་སྒྱུར་འདིའི་ཁྲོད་དུ་གཞན་རྟེན་རང་བཞིན་གྱི་འགལ་བ་ཡོད་པས་རྦད་དེ་ཉམས་གསོ་བྱེད་དགོས། - + There are དེ་རུ་ཡོད་པ་ནི། - + packages going to be removed,Please confirm whether to accept! ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། - + packages are going to be removed,Please confirm whether to accept! ཐུམ་སྒྲིལ་མེད་པར་བཟོ་རྒྱུ་རེད། ཁྱེད་ཀྱིས་དང་ལེན་བྱེད་མིན་གཏན་འཁེལ་བྱེད་རོགས། - + trying to reconnect ཐབས་བརྒྱ་ཇུས་སྟོང་གིས་འབྲེལ་མཐུད་བྱེད་པ། - + times དུས་རབས་ @@ -676,34 +676,34 @@ 收起 - + Auto-Update is backing up...... 自动更新进程正在备份中...... རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་པར་རྒྱབ་སྐྱོར་བྱེད་བཞིན་ཡོད། - + The updater is NOT start གསར་སྒྱུར་བྱེད་མཁན་གྱིས་གསར་སྒྱུར་བྱེད་འགོ་ཚུགས་མེད། - + The progress is updating... འཕེལ་རིམ་གསར་སྒྱུར་བྱེད་བཞིན་ཡོད། - + The progress is installing... འཕེལ་རིམ་སྒྲིག་སྦྱོར་བྱེད་བཞིན་པའི་སྒང་རེད། - + The updater is busy! གསར་སྒྱུར་བྱེད་མཁན་དེ་བྲེལ་བ་ཧ་ཅང་ཆེ། - - + + Updating the software source མཉེན་ཆས་ཀྱི་འབྱུང་ཁུངས་གསར་སྒྱུར་བྱེད་པ། @@ -712,38 +712,38 @@ 电池电量低于 50%,无法下载更新 - - - + + + OK འགྲིགས། - + Please back up the system before all updates to avoid unnecessary losses གསར་སྒྱུར་མ་བྱས་གོང་ལ་མ་ལག་ཕྱིར་འཐེན་བྱས་ནས་དགོས་མེད་ཀྱི་གྱོང་གུན་མི་ཡོང་བ་བྱེད་དགོས། - + Only Update གསར་སྒྱུར་ཁོ་ན་བྱེད་ - + Back And Update རྒྱབ་ཕྱོགས་དང་གསར་སྒྱུར། - - - - + + + + update has been canceled! གསར་སྒྱུར་མེད་པར་བཟོས་ཟིན། - - + + This update has been completed! 本次更新已完成! གསར་སྒྱུར་འདི་ལེགས་འགྲུབ་བྱུང་སོང་། @@ -753,22 +753,22 @@ ཁྱེད་ཚོའི་མ་ལག་ནི་ཆེས་གསར་བ་ཡིན། V10 - + Keeping update གསར་སྒྱུར་རྒྱུན་འཁྱོངས་བྱེད་པ - + It is recommended to back up the system before all updates to avoid unnecessary losses! གསར་སྒྱུར་མ་བྱས་གོང་ལ་མ་ལག་ལ་རྒྱབ་སྐྱོར་བྱས་ནས་དགོས་མེད་ཀྱི་གྱོང་གུན་མི་ཡོང་བ་བྱ་རྒྱུའི་གྲོས་འགོ་བཏོན་པ་རེད། - + Insufficient disk space to download updates! ཕབ་ལེན་བྱས་པའི་གསར་སྒྱུར་གྱི་བར་སྟོང་མི་འདང་བ་རེད། - + supposed ཚོད་དཔག་བྱས་པ་ @@ -788,93 +788,93 @@ h - + Automatically updates རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་ - + The update stopped because of low battery. གློག་སྨན་དམའ་བའི་རྐྱེན་གྱིས་གསར་སྒྱུར་བྱེད་མཚམས་བཞག་པ་རེད། - + The system update requires that the battery power is not less than 50% མ་ལག་གསར་སྒྱུར་བྱེད་པར་གློག་སྨན་གྱི་སྒུལ་ཤུགས་50%ལས་མི་ཉུང་བའི་བླང་བྱ་བཏོན་ཡོད། - - - + + + Part of the update failed! གསར་སྒྱུར་གྱི་ཆ་ཤས་ཤིག་ལ་ཕམ་ཉེས་བྱུང་བ་རེད། - - - + + + Failure reason: 失败原因: ཕམ་ཉེས་བྱུང་བའི་རྒྱུ་རྐྱེན་ནི། - + Finish the download! ཕབ་ལེན་བྱས་ཚར་སོང་། - + The system has download the update! མ་ལག་གིས་གསར་སྒྱུར་ཕབ་ལེན་བྱས་ཡོད། - + It's need to reboot to make the install avaliable སྒྲིག་སྦྱོར་བྱས་ནས་སྒྲིག་སྦྱོར་བྱས་ན་འགྲིག་གི་རེད། - + Reboot notification བསྐྱར་དུ་བརྡ་ཐོ་གཏོང་དགོས། - + Reboot rightnow གཡས་ཕྱོགས་པ་བསྐྱར་དུ་ཐོན་པ། - + Later རྗེས་སུ། - - + + Part of the update success! གསར་སྒྱུར་ལེགས་འགྲུབ་བྱུང་བའི་ཆ་ཤས་ཤིག་རེད། - + All the update has been downloaded. གསར་སྒྱུར་ཚང་མ་ཕབ་ལེན་བྱས་ཟིན། - + An important update is in progress, please wait. གལ་འགངས་ཆེ་བའི་གནས་ཚུལ་གསར་བ་ཞིག་ད་ལྟ་སྤེལ་བཞིན་ཡོད།རེ་སྒུག་ - + plase clean up your disk or expand the backup space ཁྱེད་ལ་གཙང་བཤེར་འཁོར་གཞོང་བར་སྟོང་འམ་རྒྱ་བསྐྱེད་རྗེས་གྲབས།འཛུགས་སྐྲུན་ཁག། - + insufficient backup space གསོག་ཉར་ཁམས་མི་འདང་བ། - + backup failed གསོག་ཉར་ཕམ་ཁ། @@ -895,8 +895,8 @@ 备份还原分区异常,您可能没有备份还原分区。更多详细信息,可以参看/var/log/backup.log - - + + Calculating Capacity... ནུས་པ་རྩིས་རྒྱག་པ... @@ -905,40 +905,41 @@ 未检测到系统备份还原分区,是否继续更新? - + Calculating རྩིས་རྒྱག་པ། - + + The system is updating... ལམ་ལུགས་གསར་སྒྱུར་བྱེད་བཞིན་ཡོད། - + Auto-Update progress is installing new file: 系统自动更新功能正在安装新文件: རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་པའི་འཕེལ་རིམ་ནི་ཡིག་ཆ་གསར་པ་སྒྲིག་སྦྱོར་བྱེད་ - + Auto-Update progress finished! 系统自动更新完成! རང་འགུལ་གྱིས་གསར་སྒྱུར་གྱི་འཕེལ་རིམ་ལེགས་འགྲུབ་བྱུང་ - + Auto-Update progress fail in backup! 自动更新安装时备份失败! རང་འགུལ་གྱིས་གསར་སྒྱུར་བྱེད་པའི་འཕེལ་རིམ་དེ་རྗེས་གྲབས་ལས་དོན་ལ་ཕམ - + Failed in updating because of broken environment. ཁོར་ཡུག་གཏོར་བཤིག་བཏང་བའི་རྐྱེན་གྱིས་གསར་སྒྱུར་བྱེད་མ་ཐུབ་པ་རེད། - + It's fixing up the environment... དེས་ཁོར་ཡུག་ཞིག་གསོ་བྱེད་བཞིན་ཡོད། @@ -959,7 +960,7 @@ UpdateLog - + Update log གསར་སྒྱུར་ཉིན་ཐོ། @@ -980,25 +981,25 @@ རིམ་པ་སྤར་བ། - + View history ལོ་རྒྱུས་ལ་ལྟ་ཞིབ་ /Upgrade/View history - + Update Settings གསར་སྒྱུར་སྒྲིག་བཀོད། /Upgrade/Update Settings - + Allowed to renewable notice བསྐྱར་སྤྱོད་རུང་བའི་བརྡ་ཐོ་བཏང་ཆོག། /Upgrade/Allowed to renewable notice - + Automatically download and install updates རང་འགུལ་གྱིས་ཕབ་ལེན་དང་སྒྲིག་སྦྱོར་བྱས་པའི་གནས་ /Upgrade/Automatically download and install updates @@ -1100,23 +1101,27 @@ m_updatelog - + No content. ནང་དོན་གང་ཡང་མེད། - Update Details - གནས་ཚུལ་ཞིབ་ཕྲ་གསར་སྒྱུར་བྱ་ + གནས་ཚུལ་ཞིབ་ཕྲ་གསར་སྒྱུར་བྱ་ - - + + No Contents + + + + + Search content འཚོལ་བཤེར་གྱི་ནང་དོན། - + History Log ལོ་རྒྱུས་ཀྱི་ཟིན་ཐོ། diff --git a/initial/plugin/translations/en_US.qm b/initial/plugin/translations/en_US.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/translations/en_US.qm @@ -0,0 +1 @@ + + + + + AppUpdateWid + + + details + + + + + + + + + + + + + Update + + + + + + Update log + + + + + + + + Version: + + + + + Download size: + + + + + Install size: + + + + + Current version: + + + + + Cancel failed,Being installed + + + + + Being installed + + + + + + + + + + Update succeeded , It is recommended that you restart later! + + + + + + + + + + Update succeeded , It is recommended that you log out later and log in again! + + + + + Download succeeded! + + + + + + + + Update succeeded! + + + + + + + + + Update has been canceled! + + + + + + + + Update failed! + + + + + + Failure reason: + + + + + There are unresolved dependency conflicts in this update,Please select update all + + + + + + Prompt information + + + + + Update ALL + + + + + + + + Cancel + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + version: + + + + + The update stopped because of low battery. + + + + + The system update requires that the battery power is not less than 50% + + + + + OK + + + + + A single update will not automatically backup the system, if you want to backup, please click Update All. + + + + + Do not backup, continue to update + + + + + This time will no longer prompt + + + + + Ready to update + + + + + downloaded + + + + + + downloading + + + + + calculating + + + + + No content. + + + + + HistoryUpdateListWig + + + Success + + + + + Failed + + + + + QObject + + + system upgrade new backup + + + + + system upgrade increment backup + + + + + TabWid + + + + + + + + + + + + + + + + + Check Update + + + + + + + + + + + + + + UpdateAll + + + + + + + + + + + Your system is the latest: + + + + + + + + + + + + + + No information! + + + + + + + + + + + + + + + Last Checked: + + + + + Downloading and installing updates... + + + + + Keeping update + + + + + + + + + + + + Cancel + + + + + It is recommended to back up the system before all updates to avoid unnecessary losses! + + + + + + Update + + + + + + Being updated... + + + + + + Updatable app detected on your system! + + + + + The backup restore partition could not be found. The system will not be backed up in this update! + + + + + Kylin backup restore tool is doing other operations, please update later. + + + + + The source manager configuration file is abnormal, the system temporarily unable to update! + + + + + Backup already, no need to backup again. + + + + + Start backup,getting progress + + + + + Kylin backup restore tool does not exist, this update will not backup the system! + + + + + Calculated + + + + + There are unresolved dependency conflicts in this update,Please select Dist-upgrade + + + + + + + + Prompt information + + + + + Dist-upgrade + + + + + Insufficient disk space to download updates! + + + + + + + OK + + + + + There are unresolved dependency conflicts in this update,Please contact the administrator! + + + + + Sure + + + + + supposed + + + + + The system is downloading the update! + + + + + Downloading the updates... + + + + + Installing the updates... + + + + + s + + + + + min + + + + + h + + + + + In the install + + + + + + In the download + + + + + calculating + + + + + Backup complete. + + + + + System is backing up... + + + + + Backup interrupted, stop updating! + + + + + The status of backup completion is abnormal + + + + + Kylin backup restore tool exception: + + + + + There will be no backup in this update! + + + + + Getting update list + + + + + + Retry + + + + + + No Information! + + + + + The system is checking update : + + + + + Update Settings + + /upgrade/Update Settings + + + + Allowed to renewable notice + + + + + Backup current system before updates all + + + + + Download Limit + + + + + It will be avaliable in the next download. + + + + + Automatically updates + + + + + The system will automatically updates when there is an available network and backup. + + + + + View history + + + + + Ready to install + + + + + + Dependency conflict exists in this update,need to be completely repaired! + + + + + There are + + + + + packages going to be removed,Please confirm whether to accept! + + + + + packages are going to be removed,Please confirm whether to accept! + + + + + trying to reconnect + + + + + times + + + + + Auto-Update is backing up...... + + + + + The updater is NOT start + + + + + The progress is updating... + + + + + The progress is installing... + + + + + The updater is busy! + + + + + + Updating the software source + + + + + The update stopped because of low battery. + + + + + The system update requires that the battery power is not less than 50% + + + + + Please back up the system before all updates to avoid unnecessary losses + + + + + Only Update + + + + + Back And Update + + + + + + Calculating Capacity... + + + + + + This update has been completed! + + + + + + + + update has been canceled! + + + + + + + Part of the update failed! + + + + + + + Failure reason: + + + + + Finish the download! + + + + + The system has download the update! + + + + + It's need to reboot to make the install avaliable + + + + + Reboot notification + + + + + Reboot rightnow + + + + + Later + + + + + + Part of the update success! + + + + + All the update has been downloaded. + + + + + An important update is in progress, please wait. + + + + + plase clean up your disk or expand the backup space + + + + + + insufficient backup space + + + + + backup failed + + + + + + The system is updating... + + + + + Calculating + + + + + Auto-Update progress is installing new file: + + + + + Auto-Update progress finished! + + + + + Auto-Update progress fail in backup! + + + + + Failed in updating because of broken environment. + + + + + It's fixing up the environment... + + + + + UpdateDbus + + + System-Upgrade + + + + + ukui-control-center-update + + + + + UpdateLog + + + Update log + + + + + UpdateSource + + + Connection failed, please reconnect! + + + + + Upgrade + + + Upgrade + + + + + View history + + /Upgrade/View history + + + + Update Settings + + /Upgrade/Update Settings + + + + Allowed to renewable notice + + /Upgrade/Allowed to renewable notice + + + + Automatically download and install updates + + /Upgrade/Automatically download and install updates + + + + dependencyfixdialog + + + show details + + + + + uninstall and update + + + + + cancel + + + + + fixbrokeninstalldialog + + + We need to fix up the environment! + + + + + There will be uninstall some packages to complete the update! + + + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + + details + + + + + Keep + + + + + Remove + + + + + Attention on update + + + + + back + + + + + fixupdetaillist + + + No content. + + + + + Update Details + + + + + Update + + + + + m_updatelog + + + No content. + + + + + No Contents + + + + + + Search content + + + + + History Log + + + + + updatedeleteprompt + + + The following packages will be uninstalled: + + + + + PKG Details + + + + + Keep + + + + + Remove + + + + + Update + + + + diff --git a/initial/plugin/translations/tr.qm b/initial/plugin/translations/tr.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/initial/plugin/translations/tr.qm @@ -0,0 +1 @@ + TabWid - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Check Update 检查更新 @@ -292,16 +292,16 @@ 初始化中 - - - - - - - - - - + + + + + + + + + + UpdateAll 全部更新 @@ -310,8 +310,8 @@ 您的系统已是最新! - - + + No Information! 系统未更新 @@ -320,7 +320,7 @@ 检查时间: - + Downloading and installing updates... 正在下载并安装更新... @@ -333,101 +333,101 @@ 取消更新 - - + + Being updated... 正在更新... - - + + Updatable app detected on your system! 检测到系统有更新的应用。 - + The backup restore partition could not be found. The system will not be backed up in this update! 未能找到备份还原分区,本次更新不会备份系统! - + Kylin backup restore tool is doing other operations, please update later. 麒麟备份还原工具正在进行其他操作,请稍后更新。 - + The source manager configuration file is abnormal, the system temporarily unable to update! 源管理器配置文件异常,暂时无法更新! - + Backup already, no need to backup again. 已备份,无需再次备份。 - + Start backup,getting progress 开始备份,正在获取进度 - + Kylin backup restore tool does not exist, this update will not backup the system! 麒麟备份还原工具无法找到UUID,本次更新不会备份系统! - - - - - - - - + + + + + + + + Cancel 取消 - + Calculated 计算完成 - + There are unresolved dependency conflicts in this update,Please contact the administrator! 本次更新存在无法解决的依赖问题,请联系管理员! - - - - + + + + Prompt information 提示信息 - - - - - - - + + + + + + + Your system is the latest: 您的系统已是最新: - + Sure 好的 - - + + In the download 下载中 - + calculating 计算中 计算中 @@ -437,17 +437,17 @@ 安装中... - + Backup complete. 备份完成。 - + System is backing up... 正在备份系统... - + Backup interrupted, stop updating! 备份过程被中断,停止更新! @@ -456,23 +456,23 @@ 备份完成! - + Kylin backup restore tool exception: 麒麟备份还原工具异常: - + There will be no backup in this update! 本次更新不会备份系统! - + The status of backup completion is abnormal 备份完成状态异常 备份完成状态异常 - + Getting update list 正在获取更新列表 @@ -486,51 +486,51 @@ 软件源更新失败: - - + + Update 系统更新 - + There are unresolved dependency conflicts in this update,Please select Dist-upgrade 本次更新存在无法解决的依赖冲突,请选择全盘更新 本次更新存在无法解决的依赖冲突,请选择全盘更新 - + Dist-upgrade 全盘更新 全盘更新 - + The system is downloading the update! 正在下载更新 - + Downloading the updates... 正在下载更新...... - + Installing the updates... 正在安装更新...... - + In the install 安装中 - - + + Retry 重试 - + The system is checking update : 正在检测更新: @@ -539,7 +539,7 @@ 下载限速(Kb/s) - + View history 查看更新历史 @@ -548,18 +548,18 @@ 详情 - + Update Settings 更新设置 /upgrade/Update Settings - + Allowed to renewable notice 有更新应用时通知 - + Backup current system before updates all 全部更新前备份系统 @@ -568,7 +568,7 @@ 下载限速(KB/s) - + It will be avaliable in the next download. 开启后会在下次下载时进行限速。 @@ -589,27 +589,27 @@ 下载限速(kB/s) - + The system will automatically updates when there is an available network and backup. 网络可用时,若存在备份,系统会自动下载并安装更新 - + Ready to install 准备安装 - - - - - - - - - - - + + + + + + + + + + + Last Checked: 检查时间: @@ -618,52 +618,52 @@ 你的系统已是最新版本:V10sp1- - - - - - - - - - - + + + + + + + + + + No information! 尚未更新 - + Download Limit 下载限速 - - + + Dependency conflict exists in this update,need to be completely repaired! 本次更新存在包依赖冲突,需要全盘修复以完成更新! - + There are 本次更新存在依赖冲突,将卸载 - + packages going to be removed,Please confirm whether to accept! 个软件包以完成本次更新。 - + packages are going to be removed,Please confirm whether to accept! 个软件包将被卸载,请确认是否接受! - + trying to reconnect 重新尝试连接 - + times 次数 @@ -672,34 +672,34 @@ 收起 - + Auto-Update is backing up...... 自动更新进程正在备份中...... 自动更新进程正在备份中...... - + The updater is NOT start 后台程序未启动 - + The progress is updating... 正在检查更新... - + The progress is installing... 正在下载并安装更新... - + The updater is busy! 后台更新程序正在被占用! - - + + Updating the software source 正在更新软件源 @@ -708,38 +708,38 @@ 电池电量低于 50%,无法下载更新 - - - + + + OK 确定 - + Please back up the system before all updates to avoid unnecessary losses 全部更新前请先备份系统,以免造成不必要的损失! - + Only Update 直接更新 - + Back And Update 备份并更新 - - - - + + + + update has been canceled! 本次更新已取消! - - + + This update has been completed! 本次更新已完成! 本次更新已完成! @@ -749,128 +749,129 @@ 你的系统已是最新版本:V10 - + Keeping update 继续更新 - + It is recommended to back up the system before all updates to avoid unnecessary losses! 全部更新前建议备份系统,以免造成不必要的损失! - + Insufficient disk space to download updates! 磁盘空间不足,无法下载更新! - + supposed 预计占用 - + s - + min 分钟 - + h 小时 - + Automatically updates 自动更新 - + The update stopped because of low battery. 电池电量较低,系统更新已终止! - + The system update requires that the battery power is not less than 50% 系统更新需要电池电量不低于50%时进行。 - - - + + + Part of the update failed! 更新失败! - - - + + + Failure reason: 失败原因: 失败原因: - + Finish the download! 完成下载! - + The system has download the update! 系统完成更新内容下载 - + It's need to reboot to make the install avaliable 更新下载已完成,是否安装更新。 - + Reboot notification 重启提示 - + Reboot rightnow 重启并安装 - + Later 稍后安装 - - + + Part of the update success! 部分软件包更新成功! - + All the update has been downloaded. 所有的更新内容已经被下载 - + An important update is in progress, please wait. 正在进行一项重要更新,请等待。 - + plase clean up your disk or expand the backup space 请清理磁盘空间或扩大备份分区 - + + insufficient backup space 备份空间不足 - + backup failed 备份失败 @@ -891,8 +892,8 @@ 备份还原分区异常,您可能没有备份还原分区。更多详细信息,可以参看/var/log/backup.log - - + + Calculating Capacity... 计算系统空间大小... @@ -901,41 +902,41 @@ 未检测到系统备份还原分区,是否继续更新? - + Calculating 计算中 - - + + The system is updating... 正在准备更新... - + Auto-Update progress is installing new file: 系统自动更新功能正在安装新文件: 系统自动更新功能正在安装新文件: - + Auto-Update progress finished! 系统自动更新完成! 系统自动更新完成! - + Auto-Update progress fail in backup! 自动更新安装时备份失败! 自动更新安装时备份失败! - + Failed in updating because of broken environment. 因为环境破损,更新失败 - + It's fixing up the environment... 正在修复更新环境...... @@ -1097,7 +1098,7 @@ m_updatelog - + No content. 暂无内容. @@ -1106,18 +1107,18 @@ 更新详情 - + No Contents 暂无内容 - - + + Search content 搜索内容 - + History Log 历史更新 diff --git a/plugin/upgrade.cpp b/initial/plugin/upgrade.cpp similarity index 100% rename from plugin/upgrade.cpp rename to initial/plugin/upgrade.cpp diff --git a/plugin/upgrade.h b/initial/plugin/upgrade.h similarity index 100% rename from plugin/upgrade.h rename to initial/plugin/upgrade.h diff --git a/plugin/upgrade.pro b/initial/plugin/upgrade.pro similarity index 100% rename from plugin/upgrade.pro rename to initial/plugin/upgrade.pro diff --git a/plugin/upgrade.pro.user b/initial/plugin/upgrade.pro.user similarity index 99% rename from plugin/upgrade.pro.user rename to initial/plugin/upgrade.pro.user index a0fb965..681df32 100644 --- a/plugin/upgrade.pro.user +++ b/initial/plugin/upgrade.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/plugin_2107/aarch64/libupgrade.so.tar.gz b/initial/plugin_2107/aarch64/libupgrade.so.tar.gz similarity index 100% rename from plugin_2107/aarch64/libupgrade.so.tar.gz rename to initial/plugin_2107/aarch64/libupgrade.so.tar.gz diff --git a/plugin_2107/loongarch64/libupgrade.so.tar.gz b/initial/plugin_2107/loongarch64/libupgrade.so.tar.gz similarity index 100% rename from plugin_2107/loongarch64/libupgrade.so.tar.gz rename to initial/plugin_2107/loongarch64/libupgrade.so.tar.gz diff --git a/plugin_2107/mips64/libupgrade.so.tar.gz b/initial/plugin_2107/mips64/libupgrade.so.tar.gz similarity index 100% rename from plugin_2107/mips64/libupgrade.so.tar.gz rename to initial/plugin_2107/mips64/libupgrade.so.tar.gz diff --git a/plugin_2107/sw_64/libupgrade.so.tar.gz b/initial/plugin_2107/sw_64/libupgrade.so.tar.gz similarity index 100% rename from plugin_2107/sw_64/libupgrade.so.tar.gz rename to initial/plugin_2107/sw_64/libupgrade.so.tar.gz diff --git a/plugin_2107/x86_64/libupgrade.so.tar.gz b/initial/plugin_2107/x86_64/libupgrade.so.tar.gz similarity index 100% rename from plugin_2107/x86_64/libupgrade.so.tar.gz rename to initial/plugin_2107/x86_64/libupgrade.so.tar.gz diff --git a/plugin/translations/en_US.qm b/plugin/translations/en_US.qm deleted file mode 100644 index 067c9d8..0000000 Binary files a/plugin/translations/en_US.qm and /dev/null differ diff --git a/plugin/translations/zh_CN.qm b/plugin/translations/zh_CN.qm deleted file mode 100644 index 388606e..0000000 Binary files a/plugin/translations/zh_CN.qm and /dev/null differ