diff --git a/plugins/startupmanager/startupitem.cpp b/plugins/startupmanager/startupitem.cpp index ec06b86..080f879 100644 --- a/plugins/startupmanager/startupitem.cpp +++ b/plugins/startupmanager/startupitem.cpp @@ -70,7 +70,6 @@ StartupItem::StartupItem(StartupData info, QWidget *parent) : QWidget(parent) switcher->switchedOn = info.enabled; // connect(switcher, SIGNAL(clicked()), this, SLOT() connect(switcher, &KylinSwitcher::clicked, [=] () { - qDebug() << switcher->switchedOn; //changeAutoStartAppStatus emit changeStartup(info.exec, switcher->switchedOn); }); diff --git a/plugins/startupmanager/startupmanager.cpp b/plugins/startupmanager/startupmanager.cpp index bb60842..32b385c 100644 --- a/plugins/startupmanager/startupmanager.cpp +++ b/plugins/startupmanager/startupmanager.cpp @@ -56,7 +56,7 @@ QString StartupManager::getGuid() QString StartupManager::getName() { - return tr("Kylin Startup Manager"); + return tr("Startup Manager"); } QString StartupManager::getDescribe() diff --git a/plugins/startupmanager/startupworker.cpp b/plugins/startupmanager/startupworker.cpp index 69239d1..6f966b4 100644 --- a/plugins/startupmanager/startupworker.cpp +++ b/plugins/startupmanager/startupworker.cpp @@ -448,6 +448,7 @@ void StartupWorker::newStartupInfo(const QString &desktopFile, unsigned int xdg_ isNew = false; if (!isNew) { + //qDebug() << "is not new!!!!"; if (info.xdg_position == xdg_position) { // if (app->priv->skip_next_monitor_event) { // app->priv->skip_next_monitor_event = FALSE; @@ -489,6 +490,8 @@ void StartupWorker::newStartupInfo(const QString &desktopFile, unsigned int xdg_ QString icon = QString::fromStdString(formatted_result); if (name.isEmpty() || name.isNull()) name = exec; + if (comment.isEmpty() || comment.isNull()) + comment = tr("No description"); /*QSettings setting(desktopFile, QSettings::IniFormat); setting.setIniCodec("UTF-8"); @@ -541,6 +544,7 @@ void StartupWorker::newStartupInfo(const QString &desktopFile, unsigned int xdg_ } /* else we keep the old value (which is G_MAXUINT if it wasn't set) */ info.xdg_position = xdg_position; +// printf("info.xdg_position===%d\n", info.xdg_position); info.old_system_path.clear(); //printf("hidden=%s\n", hidden ? "Yes" : "No"); @@ -629,7 +633,7 @@ void StartupWorker::_gsp_ensure_user_autostart_dir (void) char *dir; dir = g_build_filename(g_get_user_config_dir(), "autostart", NULL); g_mkdir_with_parents(dir, S_IRWXU); - printf("ensure dir=%s\n", dir); +// printf("ensure dir=%s\n", dir); g_free(dir); // QDir dir; @@ -667,13 +671,16 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ system_dir = gsp_app_manager_get_dir(info.xdg_system_position); if (system_dir.isEmpty()) { +// qDebug() << "PPP 111"; return false; } path = g_build_filename(system_dir.toStdString().c_str(), info.basename.toStdString().c_str(), NULL); +// printf("_gsp_app_user_equal_system path=%s\n", path);///etc/xdg/autostart/indicator-china-weather.desktop keyfile = g_key_file_new(); if (!g_key_file_load_from_file(keyfile, path, G_KEY_FILE_NONE, NULL)) { +// qDebug() << "PPP 222"; g_free (path); g_key_file_free (keyfile); return false; @@ -687,6 +694,7 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ TRUE) != info.enabled || gsp_key_file_get_shown (keyfile, _gsp_get_current_desktop ()) != info.shown) { +// qDebug() << "PPP 333"; g_free (path); g_key_file_free (keyfile); return false; @@ -694,6 +702,7 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ if (gsp_key_file_get_boolean (keyfile, G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, FALSE) != info.no_display) { +// qDebug() << "PPP 444"; g_free (path); g_key_file_free (keyfile); return false; @@ -701,6 +710,7 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ str = gsp_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_KEY_NAME); if (!_gsp_str_equal (str, info.name.toStdString().c_str())) { +// qDebug() << "PPP 555"; g_free (str); g_free (path); g_key_file_free (keyfile); @@ -710,6 +720,7 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ str = gsp_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_KEY_COMMENT); if (!_gsp_str_equal (str, info.comment.toStdString().c_str())) { +// qDebug() << "PPP 666"; g_free (str); g_free (path); g_key_file_free (keyfile); @@ -720,6 +731,7 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ str = gsp_key_file_get_string (keyfile, G_KEY_FILE_DESKTOP_KEY_EXEC); if (!_gsp_str_equal (str, info.exec.toStdString().c_str())) { +// qDebug() << "PPP 777"; g_free (str); g_free (path); g_key_file_free (keyfile); @@ -729,15 +741,16 @@ bool StartupWorker::_gsp_app_user_equal_system (StartupData info, char **system_ str = gsp_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_KEY_ICON); if (!_gsp_str_equal (str, info.icon.toStdString().c_str())) {//info.icon.toStdString().data() - g_free (str); - g_free (path); - g_key_file_free (keyfile); - return false; +// qDebug() << "PPP 888"; + g_free (str); + g_free (path); + g_key_file_free (keyfile); + return false; } g_free (str); g_key_file_free (keyfile); - +// qDebug() << "PPP 999"; *system_path = path; return true; @@ -835,79 +848,112 @@ bool StartupWorker::_gsp_app_save(StartupData info) /* first check if removing the data from the user dir and using the * data from the system dir is enough -- this helps us keep clean the * user config dir by removing unneeded files */ - if (_gsp_app_user_equal_system (info, &use_path)) { + if (_gsp_app_user_equal_system (info, &use_path)) {//由关闭到开启的转换过程 // if (g_file_test(info.path.toStdString().c_str(), G_FILE_TEST_EXISTS)) { // g_remove(info.path.toStdString().c_str()); // } +// printf("system use_path=%s\n", use_path);///etc/xdg/autostart/indicator-china-weather.desktop +// qDebug() << "tttt info.path="<updatePath(info.exec, info.path); + //printf("start info.xdg_position===%d\n", info.xdg_position); info.xdg_position = info.xdg_system_position; + this->updateXdgPosition(info.exec, info.xdg_position); + //printf("end info.xdg_position===%d\n", info.xdg_position); _gsp_app_save_done_success(info); +// qDebug() << "yyy info.path="<updateXdgPosition(info.exec, info.xdg_position); + qDebug() << "KK info.path=" << info.path; if (info.old_system_path.isEmpty()) { - info.old_system_path = info.path; + info.old_system_path = info.path;//将desktop文件当前路径记录到old_system_path中 + qDebug() << "KK 111 info.old_system_path="<updateOldSystemPath(info.exec, info.old_system_path); /* if old_system_path was not NULL, then it means we * tried to save and we failed; in that case, we want * to try again and use the old file as a basis again */ } + else + qDebug() << "KK 222 info.old_system_path="<updatePath(info.exec, info.path); } _gsp_app_save(info); diff --git a/plugins/startupmanager/startupworker.h b/plugins/startupmanager/startupworker.h index 6209555..5cacaab 100644 --- a/plugins/startupmanager/startupworker.h +++ b/plugins/startupmanager/startupworker.h @@ -48,13 +48,13 @@ #define KEY_FILE_DESKTOP_TYPE_DIRECTORY "Directory" -#define GSP_ASP_SAVE_MASK_HIDDEN 0x0001 +#define SAVE_MASK_HIDDEN 0x0001 #define SAVE_MASK_ENABLED 0x0002 -#define GSP_ASP_SAVE_MASK_NAME 0x0004 -#define GSP_ASP_SAVE_MASK_EXEC 0x0008 -#define GSP_ASP_SAVE_MASK_COMMENT 0x0010 -#define GSP_ASP_SAVE_MASK_NO_DISPLAY 0x0020 -#define GSP_ASP_SAVE_MASK_ALL 0xffff +#define SAVE_MASK_NAME 0x0004 +#define SAVE_MASK_EXEC 0x0008 +#define SAVE_MASK_COMMENT 0x0010 +#define SAVE_MASK_NO_DISPLAY 0x0020 +#define SAVE_MASK_ALL 0xffff typedef struct { QString dir; diff --git a/src/translation/kylin-assistant_de.ts b/src/translation/kylin-assistant_de.ts index 11b2afd..e28bb6c 100644 --- a/src/translation/kylin-assistant_de.ts +++ b/src/translation/kylin-assistant_de.ts @@ -562,173 +562,193 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> EnergyWidget - + + CPU FM mode: + + + + + Ondemand + + + + + Powersave + + + + + Performance + + + + Adjust gamma - + Adjust brightness - + Time before session is considered idle - + Lock screen - + Lock delay - + Battery critical low action - + Laptop lid close action on battery - + Laptop lid close action on AC - + Sleep timeout PC when on battery - + Sleep timeout PC when on AC - + Sleep timeout display when on battery - + Sleep timeout display when on AC - - - + + + suspend - + shutdown - - + + nothing - - - - - - + + + + + + 5 minutes - - - - - - + + + + + + 10 minutes - - - - + + + + 20 minutes - - - - - - + + + + + + Half an hour - - - - - - + + + + + + 1 hour - - - - + + + + 2 hours - - - - - + + + + + never - - + + 1 minute - - + + 2 minutes - - + + 3 minutes - + 30 seconds - + Turn off the screen @@ -1720,49 +1740,49 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> ProcessDialog - - - + + + End process - + Ending a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be ended. Are you sure to continue? - - + + Cancel - - - + + + Kill process - + Killing a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be killed. Are you sure to continue? - + Stop process - + Continue process - + Properties @@ -1863,80 +1883,60 @@ Are you sure to continue? PropertiesDialog - - User name - - - - - Process name - - - - - Command line - - - - - CPU Time - - - - - Started Time + + OK QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low @@ -2735,6 +2735,31 @@ Are you sure to continue? %1days + + + User name: + + + + + Process name: + + + + + Command line: + + + + + CPU Time: + + + + + Started Time: + + QUIBO @@ -2889,6 +2914,41 @@ Are you sure to continue? + + StartupManager + + + Startup Manager + + + + + Help user to manager application startup items + + + + + StartupTitleWidget + + + Kylin Startup Manager + + + + + StartupWorker + + + No name + + + + + + No description + + + ThemeWidget diff --git a/src/translation/kylin-assistant_es.ts b/src/translation/kylin-assistant_es.ts index acd28b5..316a26b 100644 --- a/src/translation/kylin-assistant_es.ts +++ b/src/translation/kylin-assistant_es.ts @@ -562,173 +562,193 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> EnergyWidget - + + CPU FM mode: + + + + + Ondemand + + + + + Powersave + + + + + Performance + + + + Adjust gamma - + Adjust brightness - + Time before session is considered idle - + Lock screen - + Lock delay - + Battery critical low action - + Laptop lid close action on battery - + Laptop lid close action on AC - + Sleep timeout PC when on battery - + Sleep timeout PC when on AC - + Sleep timeout display when on battery - + Sleep timeout display when on AC - - - + + + suspend - + shutdown - - + + nothing - - - - - - + + + + + + 5 minutes - - - - - - + + + + + + 10 minutes - - - - + + + + 20 minutes - - - - - - + + + + + + Half an hour - - - - - - + + + + + + 1 hour - - - - + + + + 2 hours - - - - - + + + + + never - - + + 1 minute - - + + 2 minutes - - + + 3 minutes - + 30 seconds - + Turn off the screen @@ -1720,49 +1740,49 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> ProcessDialog - - - + + + End process - + Ending a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be ended. Are you sure to continue? - - + + Cancel - - - + + + Kill process - + Killing a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be killed. Are you sure to continue? - + Stop process - + Continue process - + Properties @@ -1863,80 +1883,60 @@ Are you sure to continue? PropertiesDialog - - User name - - - - - Process name - - - - - Command line - - - - - CPU Time - - - - - Started Time + + OK QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low @@ -2735,6 +2735,31 @@ Are you sure to continue? %1days + + + User name: + + + + + Process name: + + + + + Command line: + + + + + CPU Time: + + + + + Started Time: + + QUIBO @@ -2889,6 +2914,41 @@ Are you sure to continue? + + StartupManager + + + Startup Manager + + + + + Help user to manager application startup items + + + + + StartupTitleWidget + + + Kylin Startup Manager + + + + + StartupWorker + + + No name + + + + + + No description + + + ThemeWidget diff --git a/src/translation/kylin-assistant_fr.ts b/src/translation/kylin-assistant_fr.ts index 5af4214..2cdab40 100644 --- a/src/translation/kylin-assistant_fr.ts +++ b/src/translation/kylin-assistant_fr.ts @@ -562,173 +562,193 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> EnergyWidget - + + CPU FM mode: + + + + + Ondemand + + + + + Powersave + + + + + Performance + + + + Adjust gamma - + Adjust brightness - + Time before session is considered idle - + Lock screen - + Lock delay - + Battery critical low action - + Laptop lid close action on battery - + Laptop lid close action on AC - + Sleep timeout PC when on battery - + Sleep timeout PC when on AC - + Sleep timeout display when on battery - + Sleep timeout display when on AC - - - + + + suspend - + shutdown - - + + nothing - - - - - - + + + + + + 5 minutes - - - - - - + + + + + + 10 minutes - - - - + + + + 20 minutes - - - - - - + + + + + + Half an hour - - - - - - + + + + + + 1 hour - - - - + + + + 2 hours - - - - - + + + + + never - - + + 1 minute - - + + 2 minutes - - + + 3 minutes - + 30 seconds - + Turn off the screen @@ -1720,49 +1740,49 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> ProcessDialog - - - + + + End process - + Ending a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be ended. Are you sure to continue? - - + + Cancel - - - + + + Kill process - + Killing a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be killed. Are you sure to continue? - + Stop process - + Continue process - + Properties @@ -1863,80 +1883,60 @@ Are you sure to continue? PropertiesDialog - - User name - - - - - Process name - - - - - Command line - - - - - CPU Time - - - - - Started Time + + OK QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low @@ -2735,6 +2735,31 @@ Are you sure to continue? %1days + + + User name: + + + + + Process name: + + + + + Command line: + + + + + CPU Time: + + + + + Started Time: + + QUIBO @@ -2889,6 +2914,41 @@ Are you sure to continue? + + StartupManager + + + Startup Manager + + + + + Help user to manager application startup items + + + + + StartupTitleWidget + + + Kylin Startup Manager + + + + + StartupWorker + + + No name + + + + + + No description + + + ThemeWidget diff --git a/src/translation/kylin-assistant_ru.ts b/src/translation/kylin-assistant_ru.ts index 418ef27..e2ff42d 100644 --- a/src/translation/kylin-assistant_ru.ts +++ b/src/translation/kylin-assistant_ru.ts @@ -562,173 +562,193 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> EnergyWidget - + + CPU FM mode: + + + + + Ondemand + + + + + Powersave + + + + + Performance + + + + Adjust gamma - + Adjust brightness - + Time before session is considered idle - + Lock screen - + Lock delay - + Battery critical low action - + Laptop lid close action on battery - + Laptop lid close action on AC - + Sleep timeout PC when on battery - + Sleep timeout PC when on AC - + Sleep timeout display when on battery - + Sleep timeout display when on AC - - - + + + suspend - + shutdown - - + + nothing - - - - - - + + + + + + 5 minutes - - - - - - + + + + + + 10 minutes - - - - + + + + 20 minutes - - - - - - + + + + + + Half an hour - - - - - - + + + + + + 1 hour - - - - + + + + 2 hours - - - - - + + + + + never - - + + 1 minute - - + + 2 minutes - - + + 3 minutes - + 30 seconds - + Turn off the screen @@ -1720,49 +1740,49 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> ProcessDialog - - - + + + End process - + Ending a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be ended. Are you sure to continue? - - + + Cancel - - - + + + Kill process - + Killing a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be killed. Are you sure to continue? - + Stop process - + Continue process - + Properties @@ -1863,80 +1883,60 @@ Are you sure to continue? PropertiesDialog - - User name - - - - - Process name - - - - - Command line - - - - - CPU Time - - - - - Started Time + + OK QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low @@ -2735,6 +2735,31 @@ Are you sure to continue? %1days + + + User name: + + + + + Process name: + + + + + Command line: + + + + + CPU Time: + + + + + Started Time: + + QUIBO @@ -2889,6 +2914,41 @@ Are you sure to continue? + + StartupManager + + + Startup Manager + + + + + Help user to manager application startup items + + + + + StartupTitleWidget + + + Kylin Startup Manager + + + + + StartupWorker + + + No name + + + + + + No description + + + ThemeWidget diff --git a/src/translation/kylin-assistant_zh_CN.qm b/src/translation/kylin-assistant_zh_CN.qm index 00102a2..38c1ff7 100644 Binary files a/src/translation/kylin-assistant_zh_CN.qm and b/src/translation/kylin-assistant_zh_CN.qm differ diff --git a/src/translation/kylin-assistant_zh_CN.ts b/src/translation/kylin-assistant_zh_CN.ts index 8ee7b6e..719b784 100644 --- a/src/translation/kylin-assistant_zh_CN.ts +++ b/src/translation/kylin-assistant_zh_CN.ts @@ -1247,173 +1247,193 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> EnergyWidget - + + CPU FM mode: + CPU调频模式: + + + + Ondemand + 自动调频 + + + + Powersave + 省电模式 + + + + Performance + 性能模式 + + + Adjust gamma 调整伽马值 - + Adjust brightness 调整屏幕亮度 - + Time before session is considered idle 在此时间范围内无操作则关闭屏幕 - + Lock screen 锁定屏幕 - + Lock delay 锁定延时 - + Battery critical low action 电池严重不足时 - + Laptop lid close action on battery 使用电池合上盖子时 - + Laptop lid close action on AC 使用电源合上盖子时 - + Sleep timeout PC when on battery 使用电池,空闲此时间后电脑转入睡眠 - + Sleep timeout PC when on AC 使用电源,空闲此时间后电脑转入睡眠 - + Sleep timeout display when on battery 使用电池,空闲此时间后屏幕转入睡眠 - + Sleep timeout display when on AC 使用电源,空闲此时间后屏幕转入睡眠 - - - + + + suspend 挂起 - + shutdown 电源关闭 - - + + nothing 不处理 - - - - - - + + + + + + 5 minutes 5 分钟 - - - - - - + + + + + + 10 minutes 10 分钟 - - - - + + + + 20 minutes 20 分钟 - - - - - - + + + + + + Half an hour 半小时 - - - - - - + + + + + + 1 hour 1 小时 - - - - + + + + 2 hours 2 小时 - - - - - + + + + + never 从不 - - + + 1 minute 1 分钟 - - + + 2 minutes 2 分钟 - - + + 3 minutes 3 分钟 - + 30 seconds 30 秒 - + Turn off the screen 关闭屏幕 @@ -2550,46 +2570,46 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> ProcessDialog - - - + + + End process 结束进程 - + Ending a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be ended. Are you sure to continue? 结束进程可能导致数据损坏,中断会话或带来安全风险。您应该只结束无响应的进程。 您确定要继续该操作? - - + + Cancel 取消 - - - + + + Kill process 杀死进程 - + Killing a process may destroy data, break the session or introduce a security risk. Only unresponsive processes should be killed. Are you sure to continue? 杀死进程可能导致数据损坏,中断会话或带来安全风险。您应该只杀死无响应的进程。 您确定要继续该操作? - + Stop process 停止进程 - + Continue process 继续进程 @@ -2622,7 +2642,7 @@ Are you sure to continue? 改变优先级 - + Properties 属性 @@ -2723,29 +2743,29 @@ Are you sure to continue? PropertiesDialog - User name - 用户 + 用户 - Process name - 进程名 + 进程名 - Command line - 命令行 + 命令行 - CPU Time - CPU 时间 + CPU 时间 - Started Time - 开始于 + 开始于 + + + + OK + 确定 @@ -2755,52 +2775,52 @@ Are you sure to continue? 麒麟助手运行中 - + Running 运行中 - + Stopped 已停止 - + Zombie 僵死 - + Uninterruptible 不可中断 - + Sleeping 睡眠中 - + Very High 非常高 - + High - + Normal 普通 - + Low - + Very Low 非常低 @@ -3615,6 +3635,31 @@ Are you sure to continue? %1days %1天 + + + User name: + 用户名: + + + + Process name: + 进程名: + + + + Command line: + 命令行: + + + + CPU Time: + CPU 时间: + + + + Started Time: + 开始于: + QUIBO @@ -3919,6 +3964,45 @@ Are you sure to continue? 输入反馈声音 + + StartupManager + + Kylin Startup Manager + 麒麟启动项管理器 + + + + Startup Manager + 启动项管理器 + + + + Help user to manager application startup items + 帮助用户管理应用程序开机启动项 + + + + StartupTitleWidget + + + Kylin Startup Manager + 麒麟启动项管理器 + + + + StartupWorker + + + No name + 无名称 + + + + + No description + 无描述 + + SystemWidget