diff --git a/changeUserPwd/main.cpp b/changeUserPwd/main.cpp index 498f18f..9df117e 100644 --- a/changeUserPwd/main.cpp +++ b/changeUserPwd/main.cpp @@ -35,7 +35,8 @@ auth_cb (PasswdHandler *passwd_handler, if (error){ secondary_text = error->message; - printf("%s\n", secondary_text); + char ** lines = g_strsplit(secondary_text, "\n", -1); + printf("%s\n", lines[0]); qApp->exit(1); } else { passwd_change_password (passwd_handler, pwd, chpasswd_cb, NULL); diff --git a/changeUserPwd/run-passwd.cpp b/changeUserPwd/run-passwd.cpp index c48297d..b753a37 100644 --- a/changeUserPwd/run-passwd.cpp +++ b/changeUserPwd/run-passwd.cpp @@ -14,12 +14,13 @@ #include #include #include +#include #include "run-passwd.h" /* Buffer size for backend output */ -#define BUFSIZE 64 +#define BUFSIZE 1024 /* Passwd states */ //后端passwd的状态,NONE应该是passwd还没有启动,ERROR表示报错但还没退出 @@ -43,6 +44,7 @@ struct PasswdHandler { GIOChannel *backend_stdin; GIOChannel *backend_stdout; + GIOChannel *backend_stderr; GQueue *backend_stdin_queue; /* Write queue to backend_stdin */ @@ -50,6 +52,7 @@ struct PasswdHandler { guint backend_child_watch_id; /* g_child_watch_add (PID) */ guint backend_stdout_watch_id; /* g_io_add_watch (stdout) */ + /* State of the passwd program */ PasswdState backend_state; gboolean changing_password; @@ -84,7 +87,7 @@ static void free_passwd_resources (PasswdHandler *passwd_handler); static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *passwd_handler); - +static gboolean io_watch_stdout2 (GIOChannel *source, GIOCondition condition, PasswdHandler *passwd_handler); static void free_passwd_resources (PasswdHandler *passwd_handler) { GError *error = NULL; @@ -199,6 +202,33 @@ static gboolean is_string_complete (gchar *str, ...) return FALSE; } +int isDomainUser(const char* username) +{ + FILE *fp; + fp=fopen("/etc/passwd","r"); + if(fp == NULL) + { + return 1; + } + char buf[1024], name[128]; + while(!feof(fp)) + { + if(fgets(buf,sizeof (buf),fp) == NULL) + { + break; + } + sscanf(buf,"%[^:]",name); + if(strcmp(name,username) == 0) + { + fclose(fp); + return 0; + } + } + fclose(fp); + return 1; +} + + static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswdHandler *passwd_handler) { static GString *str = NULL; /* Persistent buffer */ @@ -227,17 +257,16 @@ static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, Pas return TRUE; } - // g_warning("----------bytes_read=%d",bytes_read); - // g_warning("----------io_watch_buf=%s-------",buf); - str = g_string_append_len (str, buf, bytes_read); + g_warning("----io_watch_stdout DEBUG#msg: %s\n", str->str); + + /* In which state is the backend? */ switch (passwd_handler->backend_state) { case PASSWD_STATE_AUTH: /* Passwd is asking for our current password */ - - if (is_string_complete (str->str, "assword: ", "failure", "wrong", "error", NULL)) { + if (is_string_complete (str->str, "assword: ", "failure", "wrong", "error", "failed", NULL)) { if (g_strrstr (str->str, "New password: ") != NULL) { /* Authentication successful */ @@ -253,9 +282,15 @@ static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, Pas } else { /* Authentication failed */ + // 域用户出错只关注服务器消息(stdout),sdterr消息不关注 + if (isDomainUser(g_get_user_name())) { + break; + } + error = g_error_new_literal (PASSWD_ERROR, PASSWD_ERROR_AUTH_FAILED, "Authentication token manipulation error!"); + g_warning ("Change password failed: %s", error->message); passwd_handler->changing_password = FALSE; /* This error can happen both while authenticating or while changing password: @@ -277,7 +312,6 @@ static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, Pas break; case PASSWD_STATE_NEW: /* Passwd is asking for our new password */ - if (is_string_complete (str->str, "assword: ", NULL)) { /* Advance to next state */ passwd_handler->backend_state = PASSWD_STATE_RETYPE; @@ -321,10 +355,14 @@ static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, Pas passwd_handler->chpasswd_cb (passwd_handler, NULL, passwd_handler->chpasswd_cb_data); - } - else { + } else { /* Ohnoes! */ + // 域用户出错只关注服务器消息(stdout),sdterr消息不关注 + if (isDomainUser(g_get_user_name())) { + break; + } + if (g_strrstr (str->str, "recovered") != NULL) { /* What does this indicate? * "Authentication information cannot be recovered?" from libpam? */ @@ -433,6 +471,63 @@ static gboolean io_watch_stdout (GIOChannel *source, GIOCondition condition, Pas return TRUE; } +static gboolean io_watch_stdout2 (GIOChannel *source, GIOCondition condition, PasswdHandler *passwd_handler) +{ + g_warning("----io_watch_stdout2 revieve server message"); + static GString *str = NULL; /* Persistent buffer */ + + gchar buf[BUFSIZE]; /* Temporary buffer */ + gsize bytes_read; + GError *gio_error = NULL; /* Error returned by functions */ + GError *error = NULL; /* Error sent to callbacks */ + + //GtkBuilder *dialog; + + gboolean reinit = FALSE; + + /* Initialize buffer */ + if (str == NULL) { + str = g_string_new (""); + } + + //dialog = passwd_handler->ui; + //buf将保存从channel中读取到的数据,bytes_read表示从buf中读取的数据长度 + if (g_io_channel_read_chars (source, buf, BUFSIZE, &bytes_read, &gio_error) + != G_IO_STATUS_NORMAL) { + g_warning ("IO Channel read error: %s", gio_error->message); + g_error_free (gio_error); + + return TRUE; + } + + str = g_string_append_len (str, buf, bytes_read); + + g_warning("----io_watch_stdout2 DEBUG#msg2: %s\n", str->str); + + if (is_string_complete (str->str, "Server message", "System is offline", NULL)) { + error = g_error_new_literal (PASSWD_ERROR, PASSWD_ERROR_UNKNOWN, + str->str); + + g_warning ("Change password failed: %s", error->message); + passwd_handler->changing_password = FALSE; + + /* This error can happen both while authenticating or while changing password: + * if chpasswd_cb is set, this means we're already changing password */ + if (passwd_handler->chpasswd_cb) + passwd_handler->chpasswd_cb (passwd_handler, + error, + passwd_handler->auth_cb_data); + else if (passwd_handler->auth_cb) + passwd_handler->auth_cb (passwd_handler, + error, + passwd_handler->auth_cb_data); + + g_error_free (error); + } + + return TRUE; +} + /* Child watcher */ static void child_watch_cb (GPid pid, gint status, PasswdHandler *passwd_handler) { @@ -507,31 +602,34 @@ static gboolean spawn_passwd (PasswdHandler *passwd_handler, GError **error) /* 2>&1 */ //复制文件描述符,也就是将stderr重定向到stdout - if (dup2 (my_stderr, my_stdout) == -1) { - /* Failed! */ - g_set_error_literal (error, - PASSWD_ERROR, - PASSWD_ERROR_BACKEND, - strerror (errno)); +// if (dup2 (my_stderr, my_stdout) == -1) { +// /* Failed! */ +// g_set_error_literal (error, +// PASSWD_ERROR, +// PASSWD_ERROR_BACKEND, +// strerror (errno)); - /* Clean up */ - stop_passwd (passwd_handler); +// /* Clean up */ +// stop_passwd (passwd_handler); - return FALSE; - } +// return FALSE; +// } /* Open IO Channels */ //指定一个文件描述符,创建一个IO Channel,默认使用UTF-8编码格式 passwd_handler->backend_stdin = g_io_channel_unix_new (my_stdin); passwd_handler->backend_stdout = g_io_channel_unix_new (my_stdout); + passwd_handler->backend_stderr = g_io_channel_unix_new(my_stderr); /* Set raw encoding */ /* Set nonblocking mode */ //设置通道的编码方式为NULL,设置为非阻塞的方式 if (g_io_channel_set_encoding (passwd_handler->backend_stdin, NULL, error) != G_IO_STATUS_NORMAL || g_io_channel_set_encoding (passwd_handler->backend_stdout, NULL, error) != G_IO_STATUS_NORMAL || + g_io_channel_set_encoding (passwd_handler->backend_stderr, NULL, error) != G_IO_STATUS_NORMAL || g_io_channel_set_flags (passwd_handler->backend_stdin, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL || - g_io_channel_set_flags (passwd_handler->backend_stdout, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL ) { + g_io_channel_set_flags (passwd_handler->backend_stdout, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL || + g_io_channel_set_flags (passwd_handler->backend_stderr, G_IO_FLAG_NONBLOCK, error) != G_IO_STATUS_NORMAL ) { /* Clean up */ stop_passwd (passwd_handler); @@ -542,13 +640,19 @@ static gboolean spawn_passwd (PasswdHandler *passwd_handler, GError **error) //只有通道的编码方式为NULL,才能设置缓冲状态为FASLE,其他任何编码,通道必须被缓冲,这里是为了清掉上次的密码 g_io_channel_set_buffered (passwd_handler->backend_stdin, FALSE); g_io_channel_set_buffered (passwd_handler->backend_stdout, FALSE); + g_io_channel_set_buffered (passwd_handler->backend_stderr, FALSE); /* Add IO Channel watcher */ - //当IO通道的状态为G_IO_IN(从IO通道读数据时)或者G_IO_PRI(读紧急数据时)时,调用io_watch_stdout passwd_handler->backend_stdout_watch_id = g_io_add_watch (passwd_handler->backend_stdout, - G_IO_IN /*| G_IO_PRI*/, + G_IO_IN, + (GIOFunc) io_watch_stdout2, passwd_handler); + + //当IO通道的状态为G_IO_IN(从IO通道读数据时)或者G_IO_PRI(读紧急数据时)时,调用io_watch_stdout + passwd_handler->backend_stdout_watch_id = g_io_add_watch (passwd_handler->backend_stderr, + G_IO_IN /*| G_IO_PRI*/ , (GIOFunc) io_watch_stdout, passwd_handler); + /* Add child watcher */ //在指定pid的进程退出时,调用child_watch_cb(),进行错误检查,以及资源回收 passwd_handler->backend_child_watch_id = g_child_watch_add (passwd_handler->backend_pid, (GChildWatchFunc) child_watch_cb, passwd_handler); diff --git a/data/bo_CN/installer-timezones.mo b/data/bo_CN/installer-timezones.mo new file mode 100644 index 0000000..b0d6908 Binary files /dev/null and b/data/bo_CN/installer-timezones.mo differ diff --git a/data/en_US/image/1.png b/data/en_US/image/1.png index bd3e470..8d88b21 100644 Binary files a/data/en_US/image/1.png and b/data/en_US/image/1.png differ diff --git a/data/en_US/image/10.png b/data/en_US/image/10.png new file mode 100755 index 0000000..86232c4 Binary files /dev/null and b/data/en_US/image/10.png differ diff --git a/data/en_US/image/11.png b/data/en_US/image/11.png new file mode 100755 index 0000000..6091b2b Binary files /dev/null and b/data/en_US/image/11.png differ diff --git a/data/en_US/image/12.png b/data/en_US/image/12.png new file mode 100755 index 0000000..fd04173 Binary files /dev/null and b/data/en_US/image/12.png differ diff --git a/data/en_US/image/13.png b/data/en_US/image/13.png index 656c166..765746b 100644 Binary files a/data/en_US/image/13.png and b/data/en_US/image/13.png differ diff --git a/data/en_US/image/14.png b/data/en_US/image/14.png index 9f27989..b008214 100644 Binary files a/data/en_US/image/14.png and b/data/en_US/image/14.png differ diff --git a/data/en_US/image/15.png b/data/en_US/image/15.png index 8ffc059..edce10f 100644 Binary files a/data/en_US/image/15.png and b/data/en_US/image/15.png differ diff --git a/data/en_US/image/16.png b/data/en_US/image/16.png index 8dfdb3c..283b729 100644 Binary files a/data/en_US/image/16.png and b/data/en_US/image/16.png differ diff --git a/data/en_US/image/17.png b/data/en_US/image/17.png index 8017ce7..b84d1b8 100644 Binary files a/data/en_US/image/17.png and b/data/en_US/image/17.png differ diff --git a/data/en_US/image/18.png b/data/en_US/image/18.png index b0773e3..369064a 100644 Binary files a/data/en_US/image/18.png and b/data/en_US/image/18.png differ diff --git a/data/en_US/image/19.png b/data/en_US/image/19.png index 62f64d2..f2e4366 100644 Binary files a/data/en_US/image/19.png and b/data/en_US/image/19.png differ diff --git a/data/en_US/image/2.png b/data/en_US/image/2.png index e491dc7..b84b173 100644 Binary files a/data/en_US/image/2.png and b/data/en_US/image/2.png differ diff --git a/data/en_US/image/20.png b/data/en_US/image/20.png index f1c99a5..fe13bc7 100644 Binary files a/data/en_US/image/20.png and b/data/en_US/image/20.png differ diff --git a/data/en_US/image/21.png b/data/en_US/image/21.png index 1ec8e5c..8f65917 100644 Binary files a/data/en_US/image/21.png and b/data/en_US/image/21.png differ diff --git a/data/en_US/image/22.png b/data/en_US/image/22.png index 4686236..18ba281 100644 Binary files a/data/en_US/image/22.png and b/data/en_US/image/22.png differ diff --git a/data/en_US/image/23.png b/data/en_US/image/23.png index 3d531b8..2e18edb 100644 Binary files a/data/en_US/image/23.png and b/data/en_US/image/23.png differ diff --git a/data/en_US/image/24.png b/data/en_US/image/24.png index b62bb60..b18affa 100644 Binary files a/data/en_US/image/24.png and b/data/en_US/image/24.png differ diff --git a/data/en_US/image/25.png b/data/en_US/image/25.png index df3f085..1c369c5 100644 Binary files a/data/en_US/image/25.png and b/data/en_US/image/25.png differ diff --git a/data/en_US/image/26.png b/data/en_US/image/26.png index f3e023e..1511e2c 100644 Binary files a/data/en_US/image/26.png and b/data/en_US/image/26.png differ diff --git a/data/en_US/image/27.png b/data/en_US/image/27.png index 4fec342..db13a10 100644 Binary files a/data/en_US/image/27.png and b/data/en_US/image/27.png differ diff --git a/data/en_US/image/28.png b/data/en_US/image/28.png index 765d0ae..97bce91 100644 Binary files a/data/en_US/image/28.png and b/data/en_US/image/28.png differ diff --git a/data/en_US/image/29.png b/data/en_US/image/29.png index f7a84c7..e8de263 100644 Binary files a/data/en_US/image/29.png and b/data/en_US/image/29.png differ diff --git a/data/en_US/image/3.png b/data/en_US/image/3.png index ced514a..bdaa467 100644 Binary files a/data/en_US/image/3.png and b/data/en_US/image/3.png differ diff --git a/data/en_US/image/30.png b/data/en_US/image/30.png index 0677375..1161aea 100644 Binary files a/data/en_US/image/30.png and b/data/en_US/image/30.png differ diff --git a/data/en_US/image/31.png b/data/en_US/image/31.png index c75dea3..2d98597 100644 Binary files a/data/en_US/image/31.png and b/data/en_US/image/31.png differ diff --git a/data/en_US/image/32.png b/data/en_US/image/32.png index c327f7b..3a0c8fa 100644 Binary files a/data/en_US/image/32.png and b/data/en_US/image/32.png differ diff --git a/data/en_US/image/33.png b/data/en_US/image/33.png index 8775ea1..d1fbe67 100644 Binary files a/data/en_US/image/33.png and b/data/en_US/image/33.png differ diff --git a/data/en_US/image/34.png b/data/en_US/image/34.png index 42949af..60bf419 100644 Binary files a/data/en_US/image/34.png and b/data/en_US/image/34.png differ diff --git a/data/en_US/image/35.png b/data/en_US/image/35.png index 2ca6583..b875bce 100644 Binary files a/data/en_US/image/35.png and b/data/en_US/image/35.png differ diff --git a/data/en_US/image/36.png b/data/en_US/image/36.png index a026c33..6e4b923 100644 Binary files a/data/en_US/image/36.png and b/data/en_US/image/36.png differ diff --git a/data/en_US/image/37.png b/data/en_US/image/37.png index 02a31ec..13f45b3 100644 Binary files a/data/en_US/image/37.png and b/data/en_US/image/37.png differ diff --git a/data/en_US/image/38.png b/data/en_US/image/38.png index 03ca767..ce0260a 100644 Binary files a/data/en_US/image/38.png and b/data/en_US/image/38.png differ diff --git a/data/en_US/image/39.png b/data/en_US/image/39.png index c8b24bd..d1228e7 100644 Binary files a/data/en_US/image/39.png and b/data/en_US/image/39.png differ diff --git a/data/en_US/image/4.png b/data/en_US/image/4.png index 20fa3cf..651124e 100644 Binary files a/data/en_US/image/4.png and b/data/en_US/image/4.png differ diff --git a/data/en_US/image/40.png b/data/en_US/image/40.png index 47378ef..e26a07d 100644 Binary files a/data/en_US/image/40.png and b/data/en_US/image/40.png differ diff --git a/data/en_US/image/5.png b/data/en_US/image/5.png index baae7ac..ac327ee 100644 Binary files a/data/en_US/image/5.png and b/data/en_US/image/5.png differ diff --git a/data/en_US/image/6.png b/data/en_US/image/6.png index a9c2ed9..04bc8f3 100644 Binary files a/data/en_US/image/6.png and b/data/en_US/image/6.png differ diff --git a/data/en_US/image/7.png b/data/en_US/image/7.png index 5a25524..aeaaebd 100644 Binary files a/data/en_US/image/7.png and b/data/en_US/image/7.png differ diff --git a/data/en_US/image/8.png b/data/en_US/image/8.png index ee8b896..63f8b84 100644 Binary files a/data/en_US/image/8.png and b/data/en_US/image/8.png differ diff --git a/data/en_US/image/9.png b/data/en_US/image/9.png index 49e578e..24b6d0a 100644 Binary files a/data/en_US/image/9.png and b/data/en_US/image/9.png differ diff --git a/data/en_US/image/PINCodeinterface.png b/data/en_US/image/PINCodeinterface.png index 3bf9cd1..517fdde 100644 Binary files a/data/en_US/image/PINCodeinterface.png and b/data/en_US/image/PINCodeinterface.png differ diff --git a/data/en_US/image/chooseDevice.png b/data/en_US/image/chooseDevice.png index c3a943d..e6ae563 100644 Binary files a/data/en_US/image/chooseDevice.png and b/data/en_US/image/chooseDevice.png differ diff --git a/data/en_US/image/chooseTypeInterface.png b/data/en_US/image/chooseTypeInterface.png index 38bed53..5e18257 100644 Binary files a/data/en_US/image/chooseTypeInterface.png and b/data/en_US/image/chooseTypeInterface.png differ diff --git a/data/en_US/image/deviceInterface.png b/data/en_US/image/deviceInterface.png index a694d6d..af86cd3 100644 Binary files a/data/en_US/image/deviceInterface.png and b/data/en_US/image/deviceInterface.png differ diff --git a/data/en_US/image/keyboard.png b/data/en_US/image/keyboard.png index d3ebb00..bf5df6b 100644 Binary files a/data/en_US/image/keyboard.png and b/data/en_US/image/keyboard.png differ diff --git a/data/en_US/image/mainInterface.png b/data/en_US/image/mainInterface.png index ebc7fd0..3ff982f 100644 Binary files a/data/en_US/image/mainInterface.png and b/data/en_US/image/mainInterface.png differ diff --git a/data/en_US/image/mouse.png b/data/en_US/image/mouse.png index 7c1e26b..df4bac4 100644 Binary files a/data/en_US/image/mouse.png and b/data/en_US/image/mouse.png differ diff --git a/data/en_US/image/nameChangeInterface.png b/data/en_US/image/nameChangeInterface.png index fa3aa2b..9619c39 100644 Binary files a/data/en_US/image/nameChangeInterface.png and b/data/en_US/image/nameChangeInterface.png differ diff --git a/data/en_US/image/phoneOpenProjectionInterface.png b/data/en_US/image/phoneOpenProjectionInterface.png index 1a15798..36a27e4 100644 Binary files a/data/en_US/image/phoneOpenProjectionInterface.png and b/data/en_US/image/phoneOpenProjectionInterface.png differ diff --git a/data/en_US/image/phonePINcodeInterface.png b/data/en_US/image/phonePINcodeInterface.png index b275275..58df74c 100644 Binary files a/data/en_US/image/phonePINcodeInterface.png and b/data/en_US/image/phonePINcodeInterface.png differ diff --git a/data/en_US/image/phoneSearchInterface.png b/data/en_US/image/phoneSearchInterface.png index 45e811b..69a8992 100755 Binary files a/data/en_US/image/phoneSearchInterface.png and b/data/en_US/image/phoneSearchInterface.png differ diff --git a/data/en_US/image/receiverConnectInterface.png b/data/en_US/image/receiverConnectInterface.png index afa90d2..6da1476 100644 Binary files a/data/en_US/image/receiverConnectInterface.png and b/data/en_US/image/receiverConnectInterface.png differ diff --git a/data/en_US/image/searchDeviceInterface.png b/data/en_US/image/searchDeviceInterface.png index 8277d8b..567028e 100644 Binary files a/data/en_US/image/searchDeviceInterface.png and b/data/en_US/image/searchDeviceInterface.png differ diff --git a/data/en_US/image/senderConnectInterface.png b/data/en_US/image/senderConnectInterface.png index 4f051a4..18f2934 100644 Binary files a/data/en_US/image/senderConnectInterface.png and b/data/en_US/image/senderConnectInterface.png differ diff --git a/data/en_US/image/touchpad.png b/data/en_US/image/touchpad.png index 0708bf9..05a81de 100644 Binary files a/data/en_US/image/touchpad.png and b/data/en_US/image/touchpad.png differ diff --git a/data/en_US/image/unUseInterface.png b/data/en_US/image/unUseInterface.png index 691e3bd..b72f9f5 100644 Binary files a/data/en_US/image/unUseInterface.png and b/data/en_US/image/unUseInterface.png differ diff --git a/data/en_US/image/withoutPINCodeinterface.png b/data/en_US/image/withoutPINCodeinterface.png index 3e8d200..dae8a2d 100644 Binary files a/data/en_US/image/withoutPINCodeinterface.png and b/data/en_US/image/withoutPINCodeinterface.png differ diff --git a/data/en_US/index.md b/data/en_US/index.md index 90643d1..ab2932a 100644 --- a/data/en_US/index.md +++ b/data/en_US/index.md @@ -5,54 +5,7 @@ Ukui Control Center provides a friendly graphic interface to set the system. As ![Fig 1 Ukui Control Center-big](image/1.png)
-## Account - -### User Info - -![Fig 25-1 Account-big](image/22.png) - -#### Current User - -- Change User Face: Click user's face can change it. - -![Fig 25-2 Change face](image/23.png) - -- Change Password: Click "Password" to modify the current user's password. - -![Fig 25-3 Change password](image/25.png) - -- Change Account Type: administrator -- can elevated permission temporarily; standard user -- can't elevated permission. - -![Fig 25-4 Change password](image/26.png) - -#### Other Users - -Administrator can modify other user's information, add new user, etc.. - -- Add new user - --Password complexity requirements(Password strength can be customized through security neutrality): - -1. The user password cannot contain illegal characters ("'" and non-standard characters); - -2. The minimum password length is 8; - -3. The password shall contain at least two types of characters; - -4. The password must not contain the user name; - -5. It is forbidden to use palindrome in password; - -6. Enable password similarity check (detect when modifying password); - -7. Enable password dictionary; - -8. The validity period of the password is unlimited; - -![Fig 25-5 Add new user](image/27.png) - ## System - ### Display As shown in Fig 2. @@ -114,11 +67,6 @@ As shown in Fig touchpad. ![Fig touchpad Touchpad-big](image/touchpad.png) -### Touchscreen -This interface introduces several gesture operations commonly used in the system in the form of animation. - -![Fig touchscreen Touchscreen-big](image/touchscreen.png) - ### Keyboard As shown in Fig keyboard. @@ -129,6 +77,93 @@ As shown in Fig 13. ![Fig 13 Shortcut-big](image/13.png) +### Projection +Projection is a software that is allowed to be projected by mobile phones and other Kylin-OS and can be projected to other Kylin OS in Kylin OS desktop environment. It is divided into two parts: receiving terminal and sending terminal. The main interface is shown in Figure. + + ![Fig 14-1 Projection main interface-big](image/mainInterface.png) + + The function buttons at the receiving terminal are in the upper part of the main interface, from top to bottom: + +1) Receiving terminal on / off button: after the button is turned on, the current Kylin-OS device can be searched by mobile phone device or other Kylin-OS devices. + +2) PIN code function on / off button: after the button is turned on, the PIN code needs to be entered during connection. + + ![Fig 14-2 Enter PIN code interface-big](image/PINCodeinterface.png) + + ![Fig 14-3 Without PIN code interface-big](image/withoutPINCodeinterface.png) + +3) Historical device show / hide button: when the button arrow points down, you can see the relevant devices connected to the current Kylin-OS device. + + ![Fig 14-4 Historical device interface-big](image/deviceInterface.png) + +The function buttons at the sending terminal are in the lower part of the main interface, including: + +Receiving terminal on / off button: this button is mutually exclusive with the sending terminal on / off button. When the receiving terminal on / off button is turned on, the receiving terminal on / off button needs to be turned off before the sending terminal on / off button can be turned on (the same is true for the receiving terminal turn on / off button). After opening this button, click Find device to pop up the search window, in which the searchable Kylin-OS device at the receiving terminal will be displayed. + + Connection process between mobile phone and Kylin-OS: + +1) Open the receiving terminal on / off button (close the sending terminal on / off button first). + +2) The mobile phone drop-down menu opens the projection (or mobile phone projection / multi screen collaboration). + + ![Fig 14-5 Phone open projection interface-big](image/phoneOpenProjectionInterface.png) + +3) Select the Kylin-OS device to be projected in the mobile search device list. + + ![Fig 14-6 Phone search device interface-big](image/phoneSearchInterface.png) + +4) Connect (there are two types: PIN code required and PIN code not required). + +![Fig 14-7 Phone enter pin code interface-big](image/phonePINcodeInterface.png) + +5) Select the mobile phone model (currently divided into Huawei, Xiaomi and others). + + ![Fig 14-8 Select phone model interface-big](image/chooseTypeInterface.png) + +6) Projection interface: the mobile phone screen is displayed in the center of the interface. There are 5 buttons on the right side of the interface, from top to bottom: soft / hard decoding switching button; Full screen / window switching button; Return to parent directory button; Return to the main interface button; Display the application process button; + + ![Fig 14-9 Receiving terminal projection interface-big](image/receiverConnectInterface.png) + +Kylin-OS and Kylin-OS connection process: + +1) Open the on / off button at the sending terminal (close the on / off button at the receiving terminal in advance). + +2) Click the search device on the left side of the switch button; + + ![Fig 14-10 Find device interface-big](image/searchDeviceInterface.png) + +3) In the pop-up search window, select the Kylin-OS device to project to. + + ![Fig 14-11 Choose device interface-big](image/chooseDevice.png) + +4) Projection interface. + + ![Fig 14-12 Sending terminal projection interface-big](image/senderConnectInterface.png) + +**FAQ** + +1. If the projection is unsuccessful, you can try to connect again, and the device connected once will be automatically recorded in the history device. + +2. Kylin OS and some phones support the control return function (that is, the receiving terminal can indirectly affect the sending terminal by operating the mouse or keyboard). + +3. At present only some Huawei phones and Xiaomi phones support Android three button function (the last three buttons on the interface on the right side of the screen). For other models, clicking these buttons may cause unknown problems. + +4. The system will use soft decoding by default. At this time, you can manually switch to hard decoding (use hardware to decode video, reduce CPU occupation, and need hardware support). + +5. The name of the receiving device can be changed in the screen projection interface. Click the "pen" icon on the right side of the projection screen to enter the modification interface. + +![Fig 14-9 Sending terminal name modification interface-big](image/nameChangeInterface.png) + +6. When the wireless network card is not inserted, or the wireless network card does not support the connection required for projection, it is necessary to insert the network card or replace the inserted network card. + +![Fig 14-10 Projection function unavailable interface-big](image/unUseInterface.png) + +7. When the package with wireless projection is not installed or the package version is too low, the projection function will not be displayed in the control panel. + +8. When used as the sending terminal, it does not support projecting to the receiving terminal of SP1 version. + +
+ ## Network ### WiredConnect As shown in Fig 15. @@ -150,6 +185,13 @@ As shown in Fig 18. ![Fig 18 Vpn-big](image/15.png) +### MobileHotspot +As shown in Fig 19. + +![Fig 19 MobileHotspot-big](image/39.png) + +
+ ## Personalized ### Background As shown in Fig 20. @@ -172,17 +214,95 @@ As shown in Fig 20. ### Screenlock As shown in Fig 22. -![Fig 22 Screenlock-big](image/19.png) +![Fig 22 Screenlock-big](image/20.png) ### Screensaver As shown in Fig 23. -![Fig 23 Screensaver-big](image/20.png) +![Fig 23 Screensaver-big](image/21.png) ### Fonts As shown in Fig 24. -![Fig 24 Fonts-big](image/21.png) +![Fig 24 Fonts-big](image/22.png) + +
+ +## Account +### User Info +![Fig 25-1 Account-big](image/23.png) +#### Current User +- Change User Face: Click user's face can change it. + +![Fig 25-2 Change face](image/24.png) + +- Change Password: Click "Password" to modify the current user's password. + +![Fig 25-3 Change password](image/25.png) + +- Change Account Type: administrator -- can elevated permission temporarily; standard user -- can't elevated permission. + +![Fig 25-4 Change password](image/26.png) + +#### Other Users +Administrator can modify other user's information, add new user, etc.. + +- Add new user + +-Password complexity requirements(Password strength can be customized through security neutrality): + +1. The user password cannot contain illegal characters ("'" and non-standard characters); + +2. The minimum password length is 8; + +3. The password shall contain at least two types of characters; + +4. The password must not contain the user name; + +5. It is forbidden to use palindrome in password; + +6. Enable password similarity check (detect when modifying password); + +7. Enable password dictionary; + +8. The validity period of the password is unlimited; + +![Fig 25-5 Add new user](image/27.png) + +### Biometrics +As shown in Fig 26. + +![Fig 26 Biometrics-big](image/40.png) + +### Cloud Account +Synchronize personalized settings and data, and this function needs to sign in. + +![Fig 27 Cloud account-big](image/28.png) + +#### Sign In +Login through Kylin ID login Center. + +#### Synchronizable Items +- Desktop wallpaper + +- Screensaver: wallpaper and idle time + +- Fonts + +- User's face + +- The settings in control center, such as start menu, taskbar, theme, etc. + +- The settings of pluma, kylin weather, peony, terminal, kylin video. + +#### Tips +1) When opening the cloud account first time, it will synchronize once by default. If the cloud exists configuration files, it will download them and sync to local; Otherwise, the local configuration files will be uploaded to the cloud. + +2) After login, if the automatic synchronization is opened, the cloud will synchronize the local configurations every 5 minutes. And they can be used by different machines, different users. + +3) If the automatic synchronization is closed, all the cloud configurations will keep the last upload status. + +4) The automatic synchronization for the single item is the similar effects.
@@ -199,6 +319,28 @@ As shown in Fig 29:
+## Update Operation + +In update configuration, you can configure backup and update. + +-Click start backup to automatically open our Kirin backup and restore tool for system content backup. +-Click Detect update to automatically open our Kirin update manager to obtain the updated content. + + +![Fig 30 Backup-big](image/31.png) + +![Fig 31 Upgrade-big](image/32.png) + +
+ +## Security +### Security Center +As shown in Fig 32. + +![Fig 32 SecurityCenter-big](image/33.png) + +
+ ## Application ### Auto Boot As shown in Fig 33: @@ -215,4 +357,4 @@ As shown in Fig 34: ### Search As shown in Fig 35: -![Fig 35 Search-big](image/36.png) \ No newline at end of file +![Fig 35 Search-big](image/36.png) diff --git a/data/org.ukui.control-center.gschema.xml b/data/org.ukui.control-center.gschema.xml index f0e4258..4bf96ad 100644 --- a/data/org.ukui.control-center.gschema.xml +++ b/data/org.ukui.control-center.gschema.xml @@ -5,5 +5,10 @@ Control panel default font list Control panel default font list + + ['kylin-weather.desktop', 'sogouImeService.desktop'] + Control panel autoapp list + Control panel autoapp list + diff --git a/data/org.ukui.control-center.notice.gschema.xml b/data/org.ukui.control-center.notice.gschema.xml index ce5ce71..50b128b 100644 --- a/data/org.ukui.control-center.notice.gschema.xml +++ b/data/org.ukui.control-center.notice.gschema.xml @@ -48,7 +48,7 @@ The maximize num of messages on notice window. - true + false "" Whether the notification show on screenlock diff --git a/data/ukui-control-center.png b/data/ukui-control-center.png index 092b684..4c742c9 100644 Binary files a/data/ukui-control-center.png and b/data/ukui-control-center.png differ diff --git a/data/zh_CN/image/PINCodeinterface.png b/data/zh_CN/image/PINCodeinterface.png index 1446b47..4457d10 100644 Binary files a/data/zh_CN/image/PINCodeinterface.png and b/data/zh_CN/image/PINCodeinterface.png differ diff --git a/data/zh_CN/image/about.png b/data/zh_CN/image/about.png index 74ff7cd..5dd48dc 100644 Binary files a/data/zh_CN/image/about.png and b/data/zh_CN/image/about.png differ diff --git a/data/zh_CN/image/account-add.png b/data/zh_CN/image/account-add.png index ca1f73b..9223825 100644 Binary files a/data/zh_CN/image/account-add.png and b/data/zh_CN/image/account-add.png differ diff --git a/data/zh_CN/image/account-edit.png b/data/zh_CN/image/account-edit.png index 0561bd9..fd2a74f 100644 Binary files a/data/zh_CN/image/account-edit.png and b/data/zh_CN/image/account-edit.png differ diff --git a/data/zh_CN/image/account-face.png b/data/zh_CN/image/account-face.png index a784184..7f83481 100644 Binary files a/data/zh_CN/image/account-face.png and b/data/zh_CN/image/account-face.png differ diff --git a/data/zh_CN/image/account-pwd.png b/data/zh_CN/image/account-pwd.png index 9dbf01e..17c80d4 100644 Binary files a/data/zh_CN/image/account-pwd.png and b/data/zh_CN/image/account-pwd.png differ diff --git a/data/zh_CN/image/account-type.png b/data/zh_CN/image/account-type.png index fc572c7..2b5791d 100644 Binary files a/data/zh_CN/image/account-type.png and b/data/zh_CN/image/account-type.png differ diff --git a/data/zh_CN/image/account.png b/data/zh_CN/image/account.png index 923a03f..5a600be 100644 Binary files a/data/zh_CN/image/account.png and b/data/zh_CN/image/account.png differ diff --git a/data/zh_CN/image/add-autoboot.png b/data/zh_CN/image/add-autoboot.png index d16666b..868bcba 100644 Binary files a/data/zh_CN/image/add-autoboot.png and b/data/zh_CN/image/add-autoboot.png differ diff --git a/data/zh_CN/image/add-shortcut.png b/data/zh_CN/image/add-shortcut.png index eafb9e3..c9849b8 100644 Binary files a/data/zh_CN/image/add-shortcut.png and b/data/zh_CN/image/add-shortcut.png differ diff --git a/data/zh_CN/image/appearance.png b/data/zh_CN/image/appearance.png index be7ba54..f36821f 100644 Binary files a/data/zh_CN/image/appearance.png and b/data/zh_CN/image/appearance.png differ diff --git a/data/zh_CN/image/area-format.png b/data/zh_CN/image/area-format.png index 65d2f86..0206d5c 100644 Binary files a/data/zh_CN/image/area-format.png and b/data/zh_CN/image/area-format.png differ diff --git a/data/zh_CN/image/area.png b/data/zh_CN/image/area.png index f2e364f..3feeced 100644 Binary files a/data/zh_CN/image/area.png and b/data/zh_CN/image/area.png differ diff --git a/data/zh_CN/image/audio.png b/data/zh_CN/image/audio.png index cedf596..4a0f13e 100644 Binary files a/data/zh_CN/image/audio.png and b/data/zh_CN/image/audio.png differ diff --git a/data/zh_CN/image/autoboot.png b/data/zh_CN/image/autoboot.png index f9e1d69..cf6e22a 100644 Binary files a/data/zh_CN/image/autoboot.png and b/data/zh_CN/image/autoboot.png differ diff --git a/data/zh_CN/image/background.png b/data/zh_CN/image/background.png index 77b08f0..128834d 100644 Binary files a/data/zh_CN/image/background.png and b/data/zh_CN/image/background.png differ diff --git a/data/zh_CN/image/backup.png b/data/zh_CN/image/backup.png index 98478da..7b2e494 100644 Binary files a/data/zh_CN/image/backup.png and b/data/zh_CN/image/backup.png differ diff --git a/data/zh_CN/image/blutooth.png b/data/zh_CN/image/blutooth.png index a0910c5..10d7e00 100644 Binary files a/data/zh_CN/image/blutooth.png and b/data/zh_CN/image/blutooth.png differ diff --git a/data/zh_CN/image/choicewidget.png b/data/zh_CN/image/choicewidget.png index b6583c9..2a459b9 100755 Binary files a/data/zh_CN/image/choicewidget.png and b/data/zh_CN/image/choicewidget.png differ diff --git a/data/zh_CN/image/chooseDevice.png b/data/zh_CN/image/chooseDevice.png index bbd8aff..cd7a097 100644 Binary files a/data/zh_CN/image/chooseDevice.png and b/data/zh_CN/image/chooseDevice.png differ diff --git a/data/zh_CN/image/chooseTypeInterface.png b/data/zh_CN/image/chooseTypeInterface.png index 23f16ef..537fe6e 100644 Binary files a/data/zh_CN/image/chooseTypeInterface.png and b/data/zh_CN/image/chooseTypeInterface.png differ diff --git a/data/zh_CN/image/cloudaccount.png b/data/zh_CN/image/cloudaccount.png index 24f7ec1..fa3fd45 100644 Binary files a/data/zh_CN/image/cloudaccount.png and b/data/zh_CN/image/cloudaccount.png differ diff --git a/data/zh_CN/image/datetime-change.png b/data/zh_CN/image/datetime-change.png index a1d0569..d74a2a2 100644 Binary files a/data/zh_CN/image/datetime-change.png and b/data/zh_CN/image/datetime-change.png differ diff --git a/data/zh_CN/image/datetime-zone.png b/data/zh_CN/image/datetime-zone.png index 49d0bd7..83d6648 100644 Binary files a/data/zh_CN/image/datetime-zone.png and b/data/zh_CN/image/datetime-zone.png differ diff --git a/data/zh_CN/image/datetime.png b/data/zh_CN/image/datetime.png index 43b9fdf..9e4dc83 100644 Binary files a/data/zh_CN/image/datetime.png and b/data/zh_CN/image/datetime.png differ diff --git a/data/zh_CN/image/default.png b/data/zh_CN/image/default.png index b3d4f15..6996258 100644 Binary files a/data/zh_CN/image/default.png and b/data/zh_CN/image/default.png differ diff --git a/data/zh_CN/image/delegate.png b/data/zh_CN/image/delegate.png index 75078af..d60fc19 100644 Binary files a/data/zh_CN/image/delegate.png and b/data/zh_CN/image/delegate.png differ diff --git a/data/zh_CN/image/desktop.png b/data/zh_CN/image/desktop.png index de08e92..9d9bec6 100644 Binary files a/data/zh_CN/image/desktop.png and b/data/zh_CN/image/desktop.png differ diff --git a/data/zh_CN/image/deviceInterface.png b/data/zh_CN/image/deviceInterface.png index cec789a..9e8f650 100644 Binary files a/data/zh_CN/image/deviceInterface.png and b/data/zh_CN/image/deviceInterface.png differ diff --git a/data/zh_CN/image/display.png b/data/zh_CN/image/display.png index 2d2b5a4..c073d93 100644 Binary files a/data/zh_CN/image/display.png and b/data/zh_CN/image/display.png differ diff --git a/data/zh_CN/image/font.png b/data/zh_CN/image/font.png index dcb6e27..76677a9 100644 Binary files a/data/zh_CN/image/font.png and b/data/zh_CN/image/font.png differ diff --git a/data/zh_CN/image/gesure.png b/data/zh_CN/image/gesure.png new file mode 100644 index 0000000..d243d4e Binary files /dev/null and b/data/zh_CN/image/gesure.png differ diff --git a/data/zh_CN/image/historylog.png b/data/zh_CN/image/historylog.png index 8f94078..1e80942 100644 Binary files a/data/zh_CN/image/historylog.png and b/data/zh_CN/image/historylog.png differ diff --git a/data/zh_CN/image/icon.png b/data/zh_CN/image/icon.png new file mode 100755 index 0000000..4248854 Binary files /dev/null and b/data/zh_CN/image/icon.png differ diff --git a/data/zh_CN/image/keyboard.png b/data/zh_CN/image/keyboard.png index fca473c..10cab0a 100644 Binary files a/data/zh_CN/image/keyboard.png and b/data/zh_CN/image/keyboard.png differ diff --git a/data/zh_CN/image/login-options-close.png b/data/zh_CN/image/login-options-close.png index 0f164dd..c12fdfc 100644 Binary files a/data/zh_CN/image/login-options-close.png and b/data/zh_CN/image/login-options-close.png differ diff --git a/data/zh_CN/image/login-options-open.png b/data/zh_CN/image/login-options-open.png index bf4cfbd..cbfa6bd 100644 Binary files a/data/zh_CN/image/login-options-open.png and b/data/zh_CN/image/login-options-open.png differ diff --git a/data/zh_CN/image/login-options-rename.png b/data/zh_CN/image/login-options-rename.png index 9a9c658..0e600ee 100644 Binary files a/data/zh_CN/image/login-options-rename.png and b/data/zh_CN/image/login-options-rename.png differ diff --git a/data/zh_CN/image/login-options-scroll.png b/data/zh_CN/image/login-options-scroll.png index 00b1941..636d81d 100644 Binary files a/data/zh_CN/image/login-options-scroll.png and b/data/zh_CN/image/login-options-scroll.png differ diff --git a/data/zh_CN/image/mainInterface.png b/data/zh_CN/image/mainInterface.png index 129bf21..5a6b36d 100644 Binary files a/data/zh_CN/image/mainInterface.png and b/data/zh_CN/image/mainInterface.png differ diff --git a/data/zh_CN/image/mobilehotspot.png b/data/zh_CN/image/mobilehotspot.png index 35865fd..2146f9b 100644 Binary files a/data/zh_CN/image/mobilehotspot.png and b/data/zh_CN/image/mobilehotspot.png differ diff --git a/data/zh_CN/image/mouse.png b/data/zh_CN/image/mouse.png index d356d45..de917a7 100644 Binary files a/data/zh_CN/image/mouse.png and b/data/zh_CN/image/mouse.png differ diff --git a/data/zh_CN/image/nameChangeInterface.png b/data/zh_CN/image/nameChangeInterface.png index 06a82fb..7967c5a 100644 Binary files a/data/zh_CN/image/nameChangeInterface.png and b/data/zh_CN/image/nameChangeInterface.png differ diff --git a/data/zh_CN/image/netconnect.png b/data/zh_CN/image/netconnect.png index 14ec3dc..1c8db3f 100644 Binary files a/data/zh_CN/image/netconnect.png and b/data/zh_CN/image/netconnect.png differ diff --git a/data/zh_CN/image/notice.png b/data/zh_CN/image/notice.png index 7fff19a..0a4378f 100644 Binary files a/data/zh_CN/image/notice.png and b/data/zh_CN/image/notice.png differ diff --git a/data/zh_CN/image/notiend.png b/data/zh_CN/image/notiend.png index dc929d6..1f7d39c 100755 Binary files a/data/zh_CN/image/notiend.png and b/data/zh_CN/image/notiend.png differ diff --git a/data/zh_CN/image/notiffirst.png b/data/zh_CN/image/notiffirst.png index 19e16d7..cd613d5 100755 Binary files a/data/zh_CN/image/notiffirst.png and b/data/zh_CN/image/notiffirst.png differ diff --git a/data/zh_CN/image/phonePINcodeInterface.png b/data/zh_CN/image/phonePINcodeInterface.png index c56b576..6c725fc 100644 Binary files a/data/zh_CN/image/phonePINcodeInterface.png and b/data/zh_CN/image/phonePINcodeInterface.png differ diff --git a/data/zh_CN/image/power-custom.png b/data/zh_CN/image/power-custom.png index 3e1bb5e..7695e82 100644 Binary files a/data/zh_CN/image/power-custom.png and b/data/zh_CN/image/power-custom.png differ diff --git a/data/zh_CN/image/power.png b/data/zh_CN/image/power.png index 07fcad0..c713c76 100644 Binary files a/data/zh_CN/image/power.png and b/data/zh_CN/image/power.png differ diff --git a/data/zh_CN/image/printer.png b/data/zh_CN/image/printer.png index 14b2623..aab793d 100644 Binary files a/data/zh_CN/image/printer.png and b/data/zh_CN/image/printer.png differ diff --git a/data/zh_CN/image/receiverConnectInterface.png b/data/zh_CN/image/receiverConnectInterface.png index 4bc0522..c9a8d0e 100644 Binary files a/data/zh_CN/image/receiverConnectInterface.png and b/data/zh_CN/image/receiverConnectInterface.png differ diff --git a/data/zh_CN/image/related-settings.png b/data/zh_CN/image/related-settings.png index 00b41f7..8ef5697 100644 Binary files a/data/zh_CN/image/related-settings.png and b/data/zh_CN/image/related-settings.png differ diff --git a/data/zh_CN/image/screenlock.png b/data/zh_CN/image/screenlock.png index 6f0a0fd..bd14947 100644 Binary files a/data/zh_CN/image/screenlock.png and b/data/zh_CN/image/screenlock.png differ diff --git a/data/zh_CN/image/screensaver.png b/data/zh_CN/image/screensaver.png index 9aae59a..17ad220 100644 Binary files a/data/zh_CN/image/screensaver.png and b/data/zh_CN/image/screensaver.png differ diff --git a/data/zh_CN/image/search.png b/data/zh_CN/image/search.png index d56e974..2eb2605 100644 Binary files a/data/zh_CN/image/search.png and b/data/zh_CN/image/search.png differ diff --git a/data/zh_CN/image/searchDeviceInterface.png b/data/zh_CN/image/searchDeviceInterface.png index fb8e054..aa53fdd 100644 Binary files a/data/zh_CN/image/searchDeviceInterface.png and b/data/zh_CN/image/searchDeviceInterface.png differ diff --git a/data/zh_CN/image/security.png b/data/zh_CN/image/security.png index c9912c7..43f0fc2 100644 Binary files a/data/zh_CN/image/security.png and b/data/zh_CN/image/security.png differ diff --git a/data/zh_CN/image/senderConnectInterface.png b/data/zh_CN/image/senderConnectInterface.png index 48f0a45..103db45 100644 Binary files a/data/zh_CN/image/senderConnectInterface.png and b/data/zh_CN/image/senderConnectInterface.png differ diff --git a/data/zh_CN/image/shortcut.png b/data/zh_CN/image/shortcut.png index 67feffc..dfc2bc6 100644 Binary files a/data/zh_CN/image/shortcut.png and b/data/zh_CN/image/shortcut.png differ diff --git a/data/zh_CN/image/theme-cursor.png b/data/zh_CN/image/theme-cursor.png index feca40c..6ee9fb5 100644 Binary files a/data/zh_CN/image/theme-cursor.png and b/data/zh_CN/image/theme-cursor.png differ diff --git a/data/zh_CN/image/theme-effect.png b/data/zh_CN/image/theme-effect.png index 2d35080..ed1fdde 100644 Binary files a/data/zh_CN/image/theme-effect.png and b/data/zh_CN/image/theme-effect.png differ diff --git a/data/zh_CN/image/theme.png b/data/zh_CN/image/theme.png index 80bc6cd..5b4e0f9 100644 Binary files a/data/zh_CN/image/theme.png and b/data/zh_CN/image/theme.png differ diff --git a/data/zh_CN/image/touchpad.png b/data/zh_CN/image/touchpad.png index 65277be..4bfbe2a 100644 Binary files a/data/zh_CN/image/touchpad.png and b/data/zh_CN/image/touchpad.png differ diff --git a/data/zh_CN/image/touchscreen.png b/data/zh_CN/image/touchscreen.png index 01aa064..3cbfc88 100644 Binary files a/data/zh_CN/image/touchscreen.png and b/data/zh_CN/image/touchscreen.png differ diff --git a/data/zh_CN/image/tray.png b/data/zh_CN/image/tray.png index 8261e1f..12b0edb 100644 Binary files a/data/zh_CN/image/tray.png and b/data/zh_CN/image/tray.png differ diff --git a/data/zh_CN/image/ukcc.png b/data/zh_CN/image/ukcc.png index 4b82413..5aa882e 100644 Binary files a/data/zh_CN/image/ukcc.png and b/data/zh_CN/image/ukcc.png differ diff --git a/data/zh_CN/image/unUseInterface.png b/data/zh_CN/image/unUseInterface.png index 17eff20..e3a0309 100644 Binary files a/data/zh_CN/image/unUseInterface.png and b/data/zh_CN/image/unUseInterface.png differ diff --git a/data/zh_CN/image/update.png b/data/zh_CN/image/update.png index 4a3f120..064018d 100644 Binary files a/data/zh_CN/image/update.png and b/data/zh_CN/image/update.png differ diff --git a/data/zh_CN/image/vino.png b/data/zh_CN/image/vino.png index 6f97fec..c4a2cbc 100644 Binary files a/data/zh_CN/image/vino.png and b/data/zh_CN/image/vino.png differ diff --git a/data/zh_CN/image/vpn.png b/data/zh_CN/image/vpn.png index 96ee10c..ff7df2f 100644 Binary files a/data/zh_CN/image/vpn.png and b/data/zh_CN/image/vpn.png differ diff --git a/data/zh_CN/image/withoutPINCodeinterface.png b/data/zh_CN/image/withoutPINCodeinterface.png index 054c84f..4cabe73 100644 Binary files a/data/zh_CN/image/withoutPINCodeinterface.png and b/data/zh_CN/image/withoutPINCodeinterface.png differ diff --git a/data/zh_CN/image/wlanconnect.png b/data/zh_CN/image/wlanconnect.png index a4ae8b6..584a6a6 100644 Binary files a/data/zh_CN/image/wlanconnect.png and b/data/zh_CN/image/wlanconnect.png differ diff --git a/data/zh_CN/index.md b/data/zh_CN/index.md index 926134a..2751e93 100644 --- a/data/zh_CN/index.md +++ b/data/zh_CN/index.md @@ -6,8 +6,8 @@
-## 帐户 -帐户设置提供了帐户信息、登录选项两个模块。 +## 帐 户 +帐户设置提供了帐户信、登录选项和云帐户三个模块。 ### 帐户信息 @@ -74,15 +74,66 @@ Tips:系统至少需要存在一个管理员用户。 ![图 3-2 打开生物识别-big](image/login-options-open.png) +- 录入新特征 + +![图 3-3 录入新特征-big](image/login-options-scroll.png) + +- 修改特征名 + +![图 3-4 修改特征名-big](image/login-options-rename.png) + +### 云帐户 +云帐户可用于同步设置配置选项,需要注册登录生效。 + +![图 4 云帐户-big](image/cloudaccount.png) +#### 登录方式 +- 通过麒麟ID登录中心登录,使用云帐户只需拥有麒麟ID即可。 + + +#### 可同步项 +- 桌面背景:同步桌面背景 +- 屏保:同步屏保壁纸、屏保休眠时间等 +- 字体:同步设置字体设置 +- 头像:同步系统用户头像 +- 开始菜单:开始菜单的相关设置 +- 任务栏: 同步任务栏位置、大小等 +- 快速启动项:同步任务栏插件快速启动栏相关设置 +- 主题:同步设置主题设置 +- 鼠标:同步设置鼠标设置 +- 触控板:如果有触控板的话,同步设置触控板界面 +- 键盘:同步设置键盘设置 +- 快捷键:同步设置自定义快捷键 +- 语言和地区:同步语言以及地区时区,并非一一对应设置 +- 时间和日期:同步时间,并非一一对应设置 +- 默认打开方式:同步设置默认应用相关设置 +- 侧边栏:同步设置通知页面相关设置 +- 登录选项:同步设置用户信息自动登录以及免密登录 +- 电源:同步设置电源相关选项 +- 文本编辑器:同步文本编辑器Pluma的设置,需要关闭所有Pluma进程并重新打开文本编辑器才能看到效果 +- 终端:同步终端设置资料卡,需要关闭所有终端实例再打开终端才能看到效果 +- 天气:同步天气设置 +- 文件管理器:同步文件管理器的设置,不包括置顶窗口设置 +- 开机启动项:同步设置开机启动设置 +- 影音:同步影音相关设置 + + +#### 使用须知 +- 使用麒麟ID登录云帐户,首次打开默认会同步一次,如果云端有配置文件,则会先把云端配置下载下来同步到本地,否则把本地帐户配置上传到云端。 +- 登录云帐户之后,如果打开了自动同步按钮,用户无需其他操作,云帐户每隔5分钟会同步一次本地配置到云端,上传的配置可供跨机器,跨用户同步。 +- 单独的同步开关关闭会导致此项停止上传到云端,如果开启,则会将之前的此项的云端配置同步到本地。 +- 如果关闭自动同步按钮,所有云端配置将会保留在关闭同步前最后一次上传到云端的本地配置。 +- 如果开启自动同步按钮,则将云端配置下载下来并同步到本地。 +- 单独的开关类似自动同步按钮效果,只是同步效果范围变成了当前项的同步效果。 +
## 系 统 -系统配置设置提供了显示器、声音、电源、通知、远程桌面、关于六个模块。 +系统配置设置提供了显示器、声音、电源、通知、远程桌面、关于、触摸校准七个模块。 ### 显示器 显示器可以配置显示相关的设置,上方彩色矩形代表当前屏幕,中间显示了显示器名称及接口名,如图所示。 -![图 4 显示器设置-big](image/display.png) +![图 5 显示器设置-big](image/display.png) - 显示器:选择当前显示器 - 分辨率、方向、刷新率、缩放屏幕的修改都是针对当前活动显示器 @@ -103,7 +154,7 @@ Tips:系统至少需要存在一个管理员用户。 ### 声 音 对输入、输出和系统音效进行设置,如图所示。 -![图 5 声音-big](image/audio.png) +![图 6 声音-big](image/audio.png) - 选择输出设备:输出设备是获取声卡选择的输出配置文件生成的,可以点击下拉框查看当前系统可用的输出设备,可根据需要切换的对应的输出设备 @@ -168,9 +219,9 @@ Tips:系统至少需要存在一个管理员用户。 ## 设 备 -设备设置提供了蓝牙、打印机、鼠标、触控板、触摸屏、键盘、快捷键七个设置模块。 +设备设置提供了蓝牙、打印机、鼠标、触控板、平板与触摸屏、键盘、快捷键和多屏协调八个设置模块。 -### 蓝牙 +### 蓝 牙 蓝牙模块提供了开关蓝牙、修改蓝牙名称、显示隐藏蓝牙任务图标、自动发现周围蓝牙设备、本机设备的可见性;与发现的蓝牙设备配对、连接、断开、移除蓝牙设备、文件传输的基本功能,如图所示。 @@ -184,13 +235,13 @@ Tips:系统至少需要存在一个管理员用户。 - 发现的蓝牙设备基础操作:鼠标单、双击已发现的蓝牙设备执行连接和断开操作,移除和发送文件选项需要通过蓝牙设备的设置选项打开(注:部分蓝牙设备/机型无发送文件选项) -![图 11 蓝牙-big](image/blutooth.png) +![图 12 蓝牙-big](image/blutooth.png) ### 打印机 打印机功能提供了打印机程序入口 -![图 12 打印机-big](image/printer.png) +![图 13 打印机-big](image/printer.png) ### 鼠 标 @@ -220,7 +271,7 @@ Tips:系统至少需要存在一个管理员用户。 - 光标速度设置 -![图 13 鼠标设备-big](image/mouse.png) +![图 14 鼠标设备-big](image/mouse.png) ### 触控板 @@ -252,14 +303,7 @@ Tips:系统至少需要存在一个管理员用户。 - 四指点击:呼出侧边栏 -![图 14 触控板-big](image/touchpad.png) - -### 触摸屏 - -此界面通过动画的形式介绍了系统中常用的几种手势操作。 - -![图 15 触摸屏-big](image/touchscreen.png) - +![图 15 触控板-big](image/touchpad.png) ### 键 盘 您可在“键盘”配置中,进行键盘响应速度、键盘布局、添加输入法等相关配置。 @@ -294,6 +338,86 @@ Tips:系统至少需要存在一个管理员用户。 ![图 17-2 添加快捷键](image/add-shortcut.png) +### 多屏协同 +多屏协同是一款在KyLin-OS桌面环境下允许被手机以及其它Kylin-OS进行投射且可投射到其它Kylin-OS的软件,分为接收端和投射端两部分,主界面如图所示。 +![图 11-1 多屏协同主界面-big](image/mainInterface.png) + +接收端的功能按钮在主界面的上半部分,由上到下依次为: + +1)接收端开/关按钮:按钮开启后,当前Kylin-OS设备可被手机设备或其它Kylin-OS设备搜索到; + +2)PIN码功能开/关按钮:按钮开启后,在连接过程中,需要输入PIN码; +![图 11-2 带PIN码的弹窗提示-big](image/PINCodeinterface.png) + +![图 11-3 不带PIN码的弹窗提示-big](image/withoutPINCodeinterface.png) + +3)历史设备显示/隐藏按钮:按钮箭头指向下时,可看见与曾经当前Kylin-OS设备连接过的相关设备。 +![图 11-4 历史设备界面-big](image/deviceInterface.png) + +投射端的功能按钮在主界面的下半部分,包括: + +投射端开/关按钮:此按钮与接收端开/关按钮互斥,当接收端开/关按钮开启时,需要先关闭接收端开/关按钮,才能开启投射端开/关按钮(开启接收端开/关按钮时同理)。开启此按钮后,点击查找设备会弹出搜索窗口,窗口中会显示可搜索到的接收端Kylin-OS设备。 + +手机与Kylin-OS连接过程: + +1)开启接收端开/关按钮(需先关闭接收端开/关按钮); + +2)手机下拉菜单打开投屏(也可能是手机投屏/多屏协同); + +![图 11-5 手机开启投屏界面-big](image/phoneOpenProjectionInterface.png) + +3)在手机搜索设备列表里选择要投射到的Kylin-OS设备; + +![图 11-6 手机搜索设备界面-big](image/phoneSearchInterface.png) + +4)进行连接(分为需要PIN码和不需要PIN码两种); + +![图 11-7 手机输入PIN码界面-big](image/phonePINcodeInterface.png) + +5)选择手机型号(目前分为华为、小米、其它); + +![图 11-8 选择手机型号界面-big](image/chooseTypeInterface.png) + +6)投屏界面,在界面的中央显示手机屏幕,界面右侧有5个按钮,有上到下依次为:软/硬解码切换按钮;全屏/窗口切换按钮;返回上级目录按钮;返回主界面按钮;显示应用进程按钮。 + +![图 11-9 接收端投屏界面-big](image/receiverConnectInterface.png) + +Kylin-OS与Kylin-OS连接过程: + +1)开启投射端开/关按钮(需提前将接收端开/关按钮关闭); + +2)点击开/关按钮左侧的查找设备; + +![图 11-10 查找设备界面-big](image/searchDeviceInterface.png) + +3)在弹出的搜索窗口中选择要投射到的Kylin-OS设备; + +![图 11-11 选择设备界面-big](image/chooseDevice.png) + +4)投屏界面。 + +![图 11-12 投射端投射界面-big](image/senderConnectInterface.png) + +**FAQ** + +1.如未成功投屏,可重新尝试连接,连接过一次的设备会自动记录到历史设备中。 + +2.Kylin-OS、部分手机支持控制回传功能(即可通过鼠标或键盘操作投屏界面间接影响投射设备)。 + +3.当前仅有部分华为手机以及小米手机支持安卓三键功能(投屏右侧界面倒数的三个按钮),其余型号手机点击这些按钮可能出现未知问题。 + +4.系统会默认使用软解码,此时可手动切换成硬解码(使用硬件对视频进行解码,降低CPU占用,需要硬件支持)。 + +5.在投屏界面可以更改接收设备的名称,点击开启投屏右侧的“笔”图标,即可进入修改界面。 +![图 11-13 投射端名称修改界面-big](image/nameChangeInterface.png) + +6.当未插入无线网卡,或无线网卡不支持建立投屏所需的连接时,需要插入网卡或者对已插入网卡进行更换处理。 +![图 11-14 投屏功能不可用界面-big](image/unUseInterface.png) + +7.当未安装无线投屏的包或包版本过低时,在控制面板中不会显示投屏功能。 + +8.当作为投射端使用时,暂不支持投射到SP1版本的接收端。 +
## 网 络 @@ -312,13 +436,14 @@ Tips:系统至少需要存在一个管理员用户。 ![图 19 无线网络-big](image/wlanconnect.png) -### 代理 +### 代 理 -可设置系统代理以及APT代理 +可设置系统代理、应用代理以及APT代理 ![图 20 代理-big](image/delegate.png) - 系统代理可选择自动代理和手动代理,手动代理包括HTTP,HTTPS,SOCKET,FTP代理 +- 应用代理可以勾选要使用代理的应用,这些应用可以通过指定的代理去访问网络 - 开启APT代理,通过设置的代理服务器可在软件商店进行应用程序的下载和更新 ### VPN @@ -405,8 +530,6 @@ Tips:系统至少需要存在一个管理员用户。 ![图 28-2 手动更改时间](image/datetime-change.png) -- 时间格式分12小时和24小时,点击右侧开关立即生效 - - 更改时区:如图所示,根据个人需求进行选择 ![图 28-3 时区-big](image/datetime-zone.png) @@ -425,7 +548,37 @@ Tips:系统至少需要存在一个管理员用户。
-## 应用 +## 更新操作 + +在“更新”配置中,可进行“备份”、“更新”的相关配置。 + +### 备 份 +​ 备份”模块可以创建系统、数据的备份,还原历史备份。点击“开始备份”或“开始还原”会自动打开备份还原工具,您可以进行系统备份、系统还原、数据备份、数据还原等操作。详细操作介绍请见手册中备份还原工具部分内容。 + +![图 30 备份还原-big](image/backup.png) + +### 更 新 +- “更新”模块可以检测系统是否有可用更新并进行更新的相关设置。 +- “系统更新”中显示当前系统更新状态和上次检测更新时间,点击“检查更新”,会自动打开麒麟更新管理器进行更新内容的获取。 +- “更新设置”中您可以设置是否允许通知可更新的应用、是否自动下载和安装更新、下载限速,开启下载限速后会在下次下载时进行限速。 +- 在“查看历史更新”中可以搜索和查看更新详情。 + +![图 31 系统更新-big](image/update.png) + +
+ +## 安 全 + +提供了安全中心的入口 + +### 安全中心 + +如图所示 +![图 32 安全中心-big](image/security.png) + +
+ +## 应 用 应用包括默认应用和开机启动 @@ -443,7 +596,7 @@ Tips:系统至少需要存在一个管理员用户。
-## 搜索 +## 搜 索 ### 全局搜索 diff --git a/data/zh_CN/installer-timezones.mo b/data/zh_CN/installer-timezones.mo new file mode 100644 index 0000000..7b6a9dc Binary files /dev/null and b/data/zh_CN/installer-timezones.mo differ diff --git a/debian/changelog b/debian/changelog index 53ba2a4..d3e5490 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,120 +1,1993 @@ -ukui-control-center (3.20.0.2022.0601-ok3~0817) v101; urgency=medium +ukui-control-center (3.22.1.25build1) yangtze; urgency=medium - * 提交commit: f48555d8 - * close-cd132048特效模式关闭后重新打开控制面板,此时特性模式按钮为打开状态且透明度为最低 - * 需求号 :无 + * 提交commit:1bf353a3 * 任务号:无 - * 其他改动说明 :无 - * 其他改动影响域 : 无 + * 其他改动:编译失败,重新编译 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Wed, 23 Nov 2022 17:01:38 +0800 + +ukui-control-center (3.22.1.25) v101; urgency=medium + + * 提交commit:ba59fec3 + * 任务号:122228完善控制面板libukcc开发文档注释与例子 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Wed, 23 Nov 2022 15:14:53 +0800 + +ukui-control-center (3.22.1.24) v101; urgency=medium + + * 提交commit:03ad2939 + * bug#148597删除用户窗口打开闪烁,随后恢复正常 + * bug#148355字体页面中,文字显示不全 + * 任务号:无 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Fri, 18 Nov 2022 17:27:24 +0800 + +ukui-control-center (3.22.1.23) v101; urgency=medium + + * 提交commit:31c8aceb + * bug#148523修改密码页面,无法使用虚拟键盘编辑 + * 任务号:无 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Thu, 17 Nov 2022 13:48:29 +0800 + +ukui-control-center (3.22.1.22) v101; urgency=medium + + * 提交commit:0ce5b3fd + * bug#147659无法通过虚拟键盘编辑主机名 + * bug#145453缩放后系统自研应用输入框中的搜索图标显示不清晰 + * bug#147503修改缩放稍后提示文案未正确显示 + * 任务号:无 + * 其他改动:编译失败,重新编译 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Wed, 16 Nov 2022 09:51:45 +0800 + +ukui-control-center (3.22.1.21) v101; urgency=medium + + * 提交commit:cdcd8c8f + * bug#无 + * 任务号:无 + * 其他改动:编译失败,重新编译 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Mon, 14 Nov 2022 15:08:13 +0800 + +ukui-control-center (3.22.1.20) v101; urgency=medium + + * 提交commit:70b6d6bd + * bug#147210ukui-control-cente KVE-2021-0704 + * bug#144412并行且扩展模式顺时针/逆时针旋转eDP屏,窗口只能移动到扩展屏的1/4位置,不能往下移动窗口但鼠标光标可以往下移动 + * bug#147395,147398,147396ukui-control-center存在删除任意用户组漏洞 + * 任务号:无 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Mon, 14 Nov 2022 13:51:10 +0800 + +ukui-control-center (3.22.1.19) v101; urgency=medium + + * 提交commit:3258b85d + * bug#143935搜索配置项显示器项跳转错误,部分项目搜不到 + * bug#145756用户手册中修改时区的设置图标不是默认样式 + * bug#147462【平板】【显示器】跟随日出日落时间格式有误 + * bug#147469调节分辨率或刷新率,弹出的窗口自动选中保存按钮 + * bug#147466调节分辨率后关闭弹窗,缩放率窗口出现英文 + * bug#145756用户手册中修改时区的设置图标不是默认样式 + * bug#148826按钮每次开启关闭均有提权密码弹窗,请修改提权策略与“开机自动登录”按钮相同 + * 任务号:无 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Wed, 09 Nov 2022 18:35:11 +0800 + +ukui-control-center (3.22.1.18) v101; urgency=medium + + * 提交commit:c3ce6743 + * bug#143935搜索配置项显示器项跳转错误,部分项目搜不到 + * bug#145498 添加快捷键弹窗实现不符合设计规范 + * 任务号:无 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Tue, 08 Nov 2022 10:05:22 +0800 + +ukui-control-center (3.22.1.17) v101; urgency=medium + + * 提交commit:27ea57f8 + * bug#146416输入法设置按钮点击无反应 + * bug#142928新增开机启动应用排序混乱 + * bug#146831热拔插手写屏,控制面板闪退 + * 任务号:无 + * 其他改动:无 + * 需求:无 + * 其他改动影响:无 + + -- zhoubin Fri, 04 Nov 2022 14:57:48 +0800 + +ukui-control-center (3.22.1.16) v101; urgency=medium + + * 提交commit:eb83d7 + * bug#无 + * 任务号:无 + * 其他改动:无 + * 需求:16989 创建的VPN等虚拟网络可直接查看、操作连接等 #2 + * 其他改动影响:无 + + -- zhoubin Thu, 03 Nov 2022 10:49:34 +0800 + +ukui-control-center (3.22.1.15) v101; urgency=medium + + * 提交commit:c0398ca0 + * bug#145737点击输入法设置后没有反应 + * bug#145740添加藏语输入法时弹出的窗口页面异常 + * bug#143702select控件高度不等于48px + * bug#145567删除用户窗口与常规弹窗差别过大 + * 任务号:无 + * 其他改动:无 + * 其他改动影响:无 - -- zhoubin Wed, 17 Aug 2022 15:17:05 +0800 + -- zhoubin Thu, 03 Nov 2022 09:39:15 +0800 -ukui-control-center (3.20.0.2022.0601-ok3~0810) v101; urgency=medium +ukui-control-center (3.22.1.14) v101; urgency=medium - * 提交commit: 0466e45b - * close-cd#bug#130710设计】【控制面板】关于界面调用sdk - * close-cd#127771单例应用最小化后,从搜索无法将原页面呼出 - * 需求号 :无 + * 提交commit:ba0ad336 + * bug#145784修改当前帐户密码时输入错误旧密码并设置新密码提示与旧密码相同 + * bug#145597平板模式下下拉控件高度不一致 + * bug#145599平板模式下button高度不统一 + * bug#119221切换各方向时整个系统桌面显示花屏 + * bug#145724卸载可选择的全部应用并重置后提示“选择默认应用” + * bug#145528升级前设置鼠标指针大小,升级后指针大小未选中 + * 任务号:无 + * 其他改动:无 + * 其他改动影响:无 + + -- zhoubin Mon, 31 Oct 2022 15:07:45 +0800 + +ukui-control-center (3.22.1.13) v101; urgency=medium + + * 提交commit:3a23d57d + * 问题:bug#114890显示器色温设置增加【日出到日落】可选项 / 显示器色温增加日出日落时间 + * bug#125277时区增加藏文翻译 + * bug#145598平板pc详情页默认边距未调整 + * bug#143702select控件的高度不等于48px + * bug#136415仅打开4k屏,设置缩放为250%,切换主屏后控制面板缩放屏幕显示与实际不一致 + * bug#136864主题模式不为自定义时,若修改桌面壁纸,主题模式不会变为自定义 + * bug#145158默认应用列表中视频播放器无默认应用 + * 任务号:无 + * 其他改动:无 + * 其他改动影响:无 + + -- zhoubin Thu, 27 Oct 2022 11:33:13 +0800 + +ukui-control-center (3.22.1.12) v101; urgency=medium + + * 提交commit:b6ba31c7 + * 问题:bug#145216[平板][控制面板]左侧一级导航无插件,点击插件奔溃 + * 任务号:无 + * 其他改动:无 + * 其他改动影响:无 + + -- zhoubin Mon, 24 Oct 2022 10:20:43 +0800 + +ukui-control-center (3.22.1.11) v101; urgency=medium + + * 提交commit:9994c298 + * 问题:bug#14538系统更新”升级完成后,控制面板“更新”模块消失 + * bug#143702【UKUI需求16212】【平板】select控件的高度不等于48px + * bug#144809修改显示器旋转方向,弹出确认框不点击保存,时间耗尽没有恢复成默认 + * 任务号:无 + * 其他改动:无 + * 其他改动影响:无 + + -- zhoubin Sat, 22 Oct 2022 15:16:40 +0800 + +ukui-control-center (3.22.1.10) v101; urgency=medium + + * 提交commit:c93ff535 + * 问题:无 + * 需求:story#112767应用代理功能开发 + * 任务号:无 + * 其他改动:无 + * 其他改动影响:无 + + -- zhoubin Thu, 20 Oct 2022 15:52:35 +0800 + +ukui-control-center (3.22.1.9) v101; urgency=medium + + * 提交commit:c93ff535 + * 问题:无 + * 需求:无 + * 任务号:无 + * 其他改动:解决编译依赖问题 + * 其他改动影响:无,平台依赖问题 + + -- zhoubin Thu, 20 Oct 2022 10:37:28 +0800 + +ukui-control-center (3.22.1.8) v101; urgency=medium + + * 提交commit:80396ac3 + * bug#143667创建用户的输入控件可点击区域不等于48px + * bug#141098重启提示弹窗未正确调用主题弹窗 + * bug#143907:【平板】【时间和日期】手动修改年份的数字不显示 + * bug#144197存在两个C059字体,且其中一个不可选择 + * 需求:无 + * 任务号:无 + * 其他改动:无 + + -- zhoubin Thu, 20 Oct 2022 09:40:39 +0800 + +ukui-control-center (3.22.1.7) v101; urgency=medium + + * 提交commit:cc3436ec + * bug#143481切换到平板模式,开启飞行模式,控制面板各项的背景消失 + * bug#143426隐私按钮点击时显示异常 + * 需求:无 + * 任务号:无 + * 其他改动:无 + + -- zhoubin Mon, 17 Oct 2022 14:53:53 +0800 + +ukui-control-center (3.22.1.6) v101; urgency=medium + + * 提交commit:708b0ff7 + * bug#143362备份还原导航文案不完整 + * 需求:无 + * 任务号:无 + * 其他改动:无 + + -- zhoubin Mon, 17 Oct 2022 10:52:28 +0800 + +ukui-control-center (3.22.1.5) v101; urgency=medium + + * 提交commit:a9455ef2 + * bug#143677设置密码为空时保存为乱码 + * 需求:无 + * 任务号:task#104119控制面板平板全屏化界面调整 + * 其他改动:无 + + -- zhoubin Fri, 14 Oct 2022 10:41:26 +0800 + +ukui-control-center (3.22.1.4) v101; urgency=medium + + * 提交commit:edb7c915 + * bug:无 + * 需求:无 + * 任务号:task#104119控制面板平板全屏化界面调整 + * 其他改动:无 + + -- zhoubin Thu, 13 Oct 2022 18:39:18 +0800 + +ukui-control-center (3.22.1.3) v101; urgency=medium + + * 提交commit:62bf54ed + * bug#142638一体机控制面板无调节显示方向功能,且旋转显示器不会更改方向 + * bug#142537:W515控制面板无亮度调节功能 + * bug#142977:【设计】【控制面板】删除新增时区的图标使用主题标准灰色button + * task#104119控制面板平板全屏化界面调整 + * 需求:无 + * 其他改动:无 + + -- zhoubin Tue, 11 Oct 2022 16:35:04 +0800 + +ukui-control-center (3.22.1.2) v101; urgency=medium + + * 提交commit:5040ddb2 + * bug#141602主题页面显示不符合预期 + * bug#139380打开控制面板-显示器选项卡界面卡顿,界面信息不正确 + * bug#140793切换自定义主题时无毛玻璃特效 + * bug#141539提示语为“系统将在x后恢复配置”,x后缺少“秒 + * task#112635org.ukui.groupmanager更改非自启动 + * 其他改动:缩放回退到2203 + * 需求:无 + + -- zhoubin Mon, 10 Oct 2022 09:50:09 +0800 + +ukui-control-center (3.22.1.1build1) v101; urgency=medium + + * 提交commit:8f2a1254 + * bug#140748:锁屏】锁屏界面添加修改过后缀名的图片,上方预览界面显示空白 + * bug#137288:【藏文】【电源管理】登录、锁屏、屏保、电源管理中的时间未显示藏文 + * bug#136321:【控制面板】测试过程中出现core.ukui-control-ce的core文件 + * bug#140561【藏文搜索】语言设置为藏文 + * bug#112635org.ukui.groupmanager更改非自启动 + * bug#137486藏文系统全局搜索搜到的配置项为中文 + * bug#140266鼠标滚轮速度调整方式,易用性不好 + * bug#141522不切换缩放率产生文件 + * bug#140536藏文系统“设置”显示非藏文 + * bug#140793切换自定义主题时无毛玻璃特效 + * bug#140029无法搜索到北京 + * bug#139714:【设计】【控制面板】时间日期-12小时制时英文时间显示不正确 + * bug#130577修改判断dbus接口调用返回方式 + * bug#139638【快速启动栏】关于界面版本号为空 + * 任务: + * task#104119控制面板平板全屏化界面调整 + * task#11154控制面板-关于-系统概述文本支持光标选中复制,同时支持ctrl+c快捷键复制、选中,右键菜单复制 + * task#100239应用通知弹窗新增自定义通知设置 + * task#17071 控制面板-显示器增加【自动旋转】功能 + * 其他改动:修正版本号 + + -- zhoubin Tue, 13 Sep 2022 15:40:29 +0800 + +ukui-control-center (3.20.0.2022.0907-0k0) v101; urgency=medium + + * 提交commit:fa8d0530 + * bug:bug#121117华为云桌面屏蔽功能选项 + * 需求号 :stroy#12731显示从软件商店下载的主题 * 任务号: * 其他改动说明 :无 * 其他改动影响域 : 无 - -- zhoubin Wed, 10 Aug 2022 13:55:10 +0800 + -- zhoubin Wed, 01 Jun 2022 11:45:15 +0800 -ukui-control-center (3.20.0.2022.0601-ok3~0721.1) v101; urgency=medium +ukui-control-center (3.20.0.2022.0601-0k0) v101; urgency=medium - * 提交commit: 8861db58 - * close-cd#130161和印主题的默认特效透明度不为75% - * close-cd#129277隐藏光标设置 - * 需求号 :无 - * 任务号: - * 其他改动说明 :无 - * 其他改动影响域 : 无 - - -- zhoubin Thu, 21 Jul 2022 16:36:21 +0800 - -ukui-control-center (3.20.0.2022.0601-ok3~0721) v101; urgency=medium - - * 提交commit: 5f30c927 - * close-cd#130675添加安全校验 - * 需求号 :无 - * 任务号: - * 其他改动说明 :无 - * 其他改动影响域 : 无 - - -- zhoubin Thu, 21 Jul 2022 10:35:36 +0800 - -ukui-control-center (3.20.0.2022.0601-ok3~0720.3) v101; urgency=medium - - * 提交commit:07771974 - * close-cd#128046控制面板VPN界面"添加"按钮的点击效果和其他地方不一致 - * close-cd##128470:控制面板-显示器示意图中概率存在无法拖拽两相对位置 - * 需求号 :无 - * 任务号: - * 其他改动说明 :无 - * 其他改动影响域 : 无 - - -- zhoubin Wed, 20 Jul 2022 17:47:11 +0800 - -ukui-control-center (3.20.0.2022.0601-ok3~0720.2) v101; urgency=medium - - * 提交commit:04bd0765 + * 提交commit:b3fecce * bug: - * close-cd#130577修改判断dbus接口调用返回方式 - * close-cd#128451:"不保存"设置分辨率/刷新率,控制面板-显示器页面的相应设置没有恢复为之前的设置 - * close-cd#127265:【控制面板】【快捷键】自定义快捷键不生效 - * close-cd#128877【wayland】【控制面板】 【系统】控制面板系统界面设置缩放不生效 - * close-cd#130175由其他主题切换为自定义主题后,壁纸变为纯蓝色图片 - * close-cd#129272一键切换主题为和印或者寻光,强调色未跟随主题变化 - * close-cd#126831隐藏部分功能设置 - * close-cd#127663不加载键盘模块 - * close-cd#127352修改键盘输入法设置调用的desktop - * close-cd#127663隐藏按键提示相关设置项 - * close-cd#127871:【wayland】【屏保】屏保默认ukui缩略图为黑色,进入屏保不显示休息时间,名言警句等 - * close-cd#130404:【wayland】【控制面板】【个性化】装机没有切换过锁屏壁纸时默认选中第一个锁屏壁纸,但是下方的壁纸周围没有选中的蓝色框(必现) - * 需求号 :无 + * 需求号 : * 任务号: - * 其他改动说明 :无 + * 其他改动说明 : 同步gloabltheme主题代码 + * 其他改动影响域 : 影响控制面板主题 + + -- zhoubin Wed, 01 Jun 2022 09:40:18 +0800 + +ukui-control-center (3.20.0.2022.0531-0k0build1) v101; urgency=medium + + * bug:无 + * 需求:无 + * 任务: 无 + * 其他改动说明 : 编译问题,重编代码 * 其他改动影响域 : 无 - -- zhoubin Wed, 20 Jul 2022 14:36:37 +0800 + -- zhoubin Tue, 31 May 2022 13:45:16 +0800 -ukui-control-center (3.20.0.2022.0601-ok3~0715) v101; urgency=medium +ukui-control-center (3.20.0.2022.0531-0k0) v101; urgency=medium + * bug:无 + * 需求:无 + * 任务: 无 + * 其他改动说明 : 编译问题,重编代码 + * 其他改动影响域 : 无 + + -- zhoubin Tue, 31 May 2022 09:47:34 +0800 + +ukui-control-center (3.20.0.2022.0530-0k0) v101; urgency=medium + + * 提交commit:3911fe4d * bug: - * close-cd#129448 【控制面板】【个性化】调节特效模式透明度时,点击和拖动进度条出现卡顿、明显延迟现象 - * close-cd#129965:【控制面板】将主题设置为自定义后点击背景,在背景界面将类型设置为图片,再次在主题界面将主题设置为寻光,之后点击背景控制面板闪退 - * close-cd#128967:【wayland】【控制面板】【时间和日期】点击同服务器下拉菜单选择任意项,弹出授权密码框,但是同步服务器下拉菜单不会自动消失(必现) - * close-cd#128675:【控制面板】【区域语言】openkylin不集成藏文,需删除藏文相关内容 - * 需求号 :无 + * bug#120220:【ukui3.1.4】【设计】添加快捷键窗口无最大化 + * bug#121114 【UKUI3.1】【蓝牙】用户手册的蓝牙图片与设置-蓝牙界面不符 + * 需求号 : * 任务号: - * 其他改动说明 :无 + * task#88913根据主题框架theme-color的key,添加主题色切换的接口 + * 其他改动说明 : 无 * 其他改动影响域 : 无 + -- zhoubin Mon, 30 May 2022 18:36:21 +0800 - -- zhoubin Fri, 15 Jul 2022 16:22:53 +0800 - -ukui-control-center (3.20.0.2022.0601-ok3~0712) yangtze; urgency=medium +ukui-control-center (3.14.0.2022.0527-0k0) v101; urgency=medium + * 提交commit:38065630 * bug: - * close-cd#125660LTP运行过程中日志出现报错 - * close-cd#128076去掉更新及安全模块 - * close-cd#128380将代理设置为手动后不输入IP地址和端口号,重新打开控制面板代理未设置为自动 - * close-cd#128076去掉更新及安全模块 - * 需求号 :无 + * bug#120707: 背景UI界面还原度优化与体验问题 + * bug#120213添加”按钮三态效果与设计不符 + * 需求号 : * 任务号: - * 其他改动说明 :无 + * 其他改动说明 : 无 * 其他改动影响域 : 无 - -- zhoubin Tue, 12 Jul 2022 11:04:49 +0800 + -- zhoubin Fri, 27 May 2022 10:43:50 +0800 -ukui-control-center (3.20.0.2022.0601-ok3~0707) yangtze; urgency=medium +ukui-control-center (3.14.0.2022.0526-0k0) v101; urgency=medium - * Initial for openKylin. - * 使用应用管理组件接口打开第三方应用 - * 合并主线功能 - * close-cd #125460 修复锁屏模块bug - * close-cd #127666 + * 提交commit:17252d5b + * bug: + * bug#120656电源UI界面还原度优化 + * bug#121422自定义设置图片后显示方式中无适应跨区等 + * bug#107088解决控制面板中预览图没有变化 + * 需求号 : + * 任务号: + * 其他改动说明 : 无 + * 其他改动影响域 : 无 - -- Kevin Duan Wed, 08 Jun 2022 14:46:21 +0800 + -- zhoubin Thu, 26 May 2022 13:31:22 +0800 + +ukui-control-center (3.14.0.2022.0524-0k1) v101; urgency=medium + + * 提交commit:1891afe8 + * bug: + * bug#115742英文系统下将字体修改为15号,控制面板-锁屏界面部分字体显示异常 + * 需求号 : + * 任务号: + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Tue, 24 May 2022 16:33:18 +0800 + +ukui-control-center (3.14.0.2022.0524-0k0) v101; urgency=medium + + * 提交commit:1e3a7 + * bug号码: + * bug#117828A用户删除新建用户后切换到打开控制面板的B用户界面显示异常 + * bug#120556设置a用户免密登录,登录b(a用户名包含b用户名)用户后免密登录也是打开状态 + * bug#112824控制面板菜单栏的滚动条只有鼠标从右/下方离开菜单栏的时候才会隐藏,从左/上方离开未隐藏 + * bug#90239150缩放比例时控制面板主题界面图标主题处图标显示模糊(必现) + * 需求号 : + * stroy#13969图形界面显示激活码 + * 任务号: + * task#84262主题框架实现一键切换机制 / 和控制面板对接,设计全局主题的接口 + * + * 其他改动说明 : 更改版本号 + * 其他改动影响域 : 仅仅影响changelog版本号 + + -- zhoubin Mon, 23 May 2022 17:56:52 +0800 + +ukui-control-center (3.14.0.2022.0518) v101; urgency=medium + + * 提交commit: 93a0aeb8 + * bug号码: + * bug#119918导入授权文件但未激活,激活按钮被隐藏 + * bug#118062:【控制面板|搜索】【时间日期】搜索栏弹出路径与实际不符 + * 需求号 : + * 任务号:task#84858控制面板应用字体与字体管理器联动 + * 其他改动说明 : 更改版本号 + * 其他改动影响域 : 仅仅影响changelog版本号 + + -- zhoubin Wed, 18 May 2022 16:30:04 +0800 + +ukui-control-center (3.14.0.2022.0512) v101; urgency=medium + + * 提交commit:450efedf + * task#84440添加滚动方向 + * bug#117507修改备份还原ui,添加账户信息搜索条目 + * bug#91326 【控制面板】-首页图标、左侧导航线性图标可以跟随主题切换 + * bug#118058修改账户搜索条目 + * bug#114741【设计】【控制面板】首页在默认情况下有滑动条 + * bug#117504图标主题处的图标显示模糊(必现) + * bug#118104修改用户名lineedit的背景色为透明 + * bug号码:无 + * 需求号 : + * 任务号:无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + + -- zhoubin Thu, 12 May 2022 15:44:55 +0800 + +ukui-control-center (3.1.4.2022.0510) v101; urgency=medium + + * bug号码:无 + * 需求号 : + * 任务号:无 + * 其他改动说明 : 更改版本号 + * 其他改动影响域 : 仅仅影响changelog版本号 + + + -- zhoubin Tue, 10 May 2022 16:19:16 +0800 + +ukui-control-center (3.1.4+2022-0510) v101; urgency=medium + + * 提交commit:72b131dd + * bug号码: + * bug#117791打开控制面板后首次点击时间日期,会先闪现英语环境 + * 需求号 : + * 任务号:无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Tue, 10 May 2022 11:30:02 +0800 + +ukui-control-center (3.1.4+2022-0509) v101; urgency=medium + + * 提交commit:24fb62cb + * bug号码:无 + * 需求号 : + * stroy#11017个性化主题可以选择浅色模式 + * 任务号:无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Mon, 09 May 2022 17:07:48 +0800 + +ukui-control-center (3.1.4+2022-0507) v101; urgency=medium + + * BUG号 : + * bug#101133 网络代理界面启用关闭代理开关 + * bug#113829设置-字体界面没有恢复默认按钮 + * 需求号 : 无 + * 任务号:无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Sat, 07 May 2022 13:46:10 +0800 + +ukui-control-center (3.1.4+2022-0506.1) v101; urgency=medium + + * 提交commit:5c769538 + * BUG号 : + * bug#117410窗口主题默认值和备选项与设计不符 + * 需求号 : 无 + * 任务号:无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Fri, 06 May 2022 13:59:19 +0800 + +ukui-control-center (3.1.4+2022-0506) v101; urgency=medium + + * 提交commit:5c769538 + * BUG号 : + * bug#113270设置任意锁屏壁纸后恢复默认壁纸,从test用户切换回kylin用户后锁屏壁纸并非默认壁纸 + * bug#116384修改添加按钮悬浮效果 + * 需求号 : 无 + * 任务号:无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Fri, 06 May 2022 13:53:54 +0800 + +ukui-control-center (3.1.4+2022-0505.1) v101; urgency=medium + + * 提交commit:2e3d632f + * BUG号 : + * bug#117020控制面板首页图标不会随着主题修改而改变 + * 需求号 : 无 + * 任务号: + * task#81576版本号获取机制优化及系统补丁版本号显示机制开发 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Thu, 05 May 2022 17:41:04 +0800 + +ukui-control-center (3.1.4+2022-0505) v101; urgency=medium + + * 提交commit:7b59e14b + * BUG号 : + * bug#116777判断dbus调用是否成功 + * bug#113473【电源】点击控制面板-电源,控制面板会闪退 + * bug#113692判断用户名是否存于用户组 + * bug#116384控制面板-开机启动“添加”button与设计效果不一致 + * 需求号 : 无 + * 其他改动说明 : 无 + * 其他改动影响域 : 无 + + -- zhoubin Thu, 05 May 2022 15:13:25 +0800 + +ukui-control-center (3.1.4+2022-0427) v101; urgency=medium + + * 提交commit:1d3fc7c5 + * story#7772增加重置按钮,重置为系统推荐应用 + * bug#116393: 【设计】控制面板 logo图标与文字未对齐,导航距离过宽 + * task#61499改用户组弹窗,ui:左侧选中未实现,添加界面未完成,修改保存存在段错误,删除未开始 + * bug#116536win+”+”和win+”-“可用,预期为不可用(必现) + * task#61499重构用户组界面 + + -- zhoubin Wed, 27 Apr 2022 15:14:05 +0800 + +ukui-control-center (3.1.4+2022-0424.6) v101; urgency=medium + + * 提交commit:4416a99b + * bug#116669设置缩放率后注销或者重启均无法生效 + * bug#115977三权分立下非root用户不显示网络、时间日期、更新模块 + * bug#114878添加sdk依赖及弹簧解决使按钮不被拉伸 + * bug#114878使用sdk的switchbutton;解决深色模式下,控制面板显示器区域未反白 + * bug#115539Intel判断是否禁用控制面板 + * bug#114186深色主题下修改时区多个城市选择弹框未深色处理 + * bug#114809添加自启动程序弹窗交互优化 + * bug#113143: 【时间日期】"同步失败"的提示不会在同步成功后消失 + * bug#16311社区版密码复杂度校验始终开启 + * bug#114676超过服务到期时间后,计算机属性的激活状态提示不正确 + + -- zhoubin Sun, 24 Apr 2022 16:44:03 +0800 + +ukui-control-center (3.1.1+2022-0420) v101; urgency=medium + + * 提交commit: 1d8b1bc1 + * bug#116372字体页缺少恢复默认设置按钮 + + -- zhoubin Thu, 21 Apr 2022 10:10:12 +0800 + +ukui-control-center (3.1.1+2022-0419) v101; urgency=medium + + * 提交commit: e0c6a0d4 + * bug#115264默认应用的视频播放器里包含音乐; 【控制面板】控制面板中开机启动界面有一项程序名字显示空白 + * bug#115934:时间同步过程中没有loading图片显示 + * bug#115224:【x100】【控制面板|显示器】镜像模式下,插拔外接显示器,控制面板的选项重复显示 + * bug#115243:接入hdmi屏,win+p切换双屏,显示器亮度自动变为10% + * bug#114770,114489,113224首页icon调用主题规范图标; 【设置】设置-关于界面的描述文字没有跟随新的控制面板菜单划分而变化; + * task#78605:优化控制面板一级菜单图标加载流程 + * bug#110044外接4K屏,修改为200%缩放率时,鼠标会变大 + + -- zhoubin Tue, 19 Apr 2022 15:45:36 +0800 + +ukui-control-center (3.1.1+2022-0413) v101; urgency=medium + + * 提交commit: f666de9f + * bug#114752调整删除用户及修改账户类型ui,修改账户类型后添加注销提示 + * bug#114519关闭标准用户下点击手动设置时间后弹出的授权窗口后无法点击开始菜单 + + -- zhoubin Wed, 13 Apr 2022 16:42:07 +0800 + +ukui-control-center (3.1.1+2022-0412.1) v101; urgency=medium + + * 提交commit:afc48ccf + * fix bug#114519,fix bug#114516关闭标准用户下点击手动设置时间后弹出的授权窗口后无法点击开始菜单 + * bug#96304三权分立下secadm及auditadm用户按钮置灰 + * bug#113583仅打开4k屏,设置缩放为250%,切换主屏后控制面板缩放屏幕显示与实际不一致 + + -- zhoubin Tue, 12 Apr 2022 09:52:56 +0800 + +ukui-control-center (3.1.1+2022-0405) v101; urgency=medium + + * 提交commit: a38a445f + * bug#102893: 【3.1走查】【功能】打开文件及另存为弹窗无法读取U盘信息 + * bug#112852鼠标悬浮在最大化按钮时的提示信息不对 + * bug#113144提示信息使用红色 + * bug#112922关于界面显示系统内存为15G + * bug#92867备份时可以通过切换缩放注销系统 + * bug#113152添加刻度显示 + + -- zhoubin Fri, 01 Apr 2022 09:20:08 +0800 + +ukui-control-center (3.1.1+2022-0330) v101; urgency=medium + + * 提交commit: 5804d0a8 + * bug#110121: 【x100板子】【显示器】外接屏幕,反复进行扩展-镜像设置,大概率在设置为扩展时,两个显示器预览图标重叠 + * bug#111769:【显示器】接双屏时由VGA或HDMI切换至镜像屏,缩略图未居中 + * bug#112130:【控制面板|显示器】【宝新创PF215T】控制面板显示器亮度提示未能获得该显示器的亮度信息 + * bug#111994【控制面板|显示器】【宝新创PF215T】控制面板显示器亮度提示未能获得该显示器的亮度信息 + * bug#112016【设置】英文系统15号字体下,设置中关于显示不全 + * bug#112091【控制面板】【系统】【关于】从控制面板和任务栏进度”关于“窗口,控制面板闪退 + + -- zhoubin Wed, 30 Mar 2022 16:54:58 +0800 + +ukui-control-center (3.1.1+2022-0325) v101; urgency=medium + + * bug#111484打开控制面板后长按f1,系统卡死;【设置|打印】打印机界面不显示已连接的打印机列表 + + -- zhoubin Fri, 25 Mar 2022 10:44:55 +0800 + +ukui-control-center (3.1.1+2022-0324) v101; urgency=medium + + * 提交commit: 1abb8cf1 + * bug#111484打开控制面板后长按f1,系统卡死;【设置|打印】打印机界面不显示已连接的打印机列表 + + -- zhoubin Thu, 24 Mar 2022 14:29:44 +0800 + +ukui-control-center (3.1.1+2022-0314) v101; urgency=medium + + * 提交commit: 98cdc158 + * bug#111161用户登录时修改用户昵称按钮置灰 + * bug#98530:接入双屏,拓展模式下调整缩放为125%以上时,屏幕检测反馈图异常 + * bug#110899修改密码控制面板闪退 + * bug#73982修改取消和确认按钮的焦点 + + -- zhoubin Tue, 22 Mar 2022 14:28:23 +0800 + +ukui-control-center (3.1.1+2022-0317) v101; urgency=medium + + * 提交commit: c4fa4d6b + * bug#110238,bug#110233缩放率为125%和150%时,控制面板关于界面的修改计算机名图标显示不全 + * bug#108837,bug#109706,bug#109288添加default.png图片解决iconfile图片不存在时使用默认头像 + + -- zhoubin Thu, 17 Mar 2022 13:41:01 +0800 + +ukui-control-center (3.1.1+2022-0315.1) v101; urgency=medium + + * 提交commit:85cd19f4 + * task#74184添加计算机版本号 + * bug#110223控制面板-关于选项里的版本显示与版权所有显示错误 + + -- zhoubin Tue, 15 Mar 2022 12:21:30 +0800 + +ukui-control-center (3.1.1+2022-0314) v101; urgency=medium + + * 提交commit: 428e69dc + * bug#92073浪潮信息】-【3A5000】-【CE520L】-【Kylin-Desktop-V10-SP1-OEM-LC-CE520L-20211113-LoongArch64】【6388】系统下调整刷新率为59.9402,显示器直接黑屏 + + -- zhoubin Mon, 14 Mar 2022 17:53:44 +0800 + +ukui-control-center (3.1.1+2022-0309.2) v101; urgency=medium + + * 提交commit: 062f5dfd + * bug#98530:屏幕检测反馈图异常 + + -- zhoubin Wed, 09 Mar 2022 14:16:35 +0800 + +ukui-control-center (3.1.1+2022-0309.1) v101; urgency=medium + + * 提交commit: 4b8558f8 + * 添加判断条件,当横坐标大于20时才记录搜索框的初始位置,避免下拉提示框出现再消失(输入字母再回退)时触发FocusIn信号导致坐标几率异常 + * 更新翻译 + + -- zhoubin Wed, 09 Mar 2022 09:18:29 +0800 + +ukui-control-center (3.1.1+2022-0308) v101; urgency=medium + + * 提交commit: 54fe98a0 + * bug#105166:修改分辨率的弹窗不居中 + + -- zhoubin Tue, 08 Mar 2022 15:26:07 +0800 + +ukui-control-center (3.1.1+2022-0307) v101; urgency=medium + + * 提交commit: 36f77b55 + * bug#108735:从镜像模式恢复成扩展模式后,亮度值不是镜像模式调节的值 + * bug#108872未定义符号错误 + * bug#108273开放所有第三方屏保,不再过滤 + * bug#107929: 双屏模式下插拔HDMI线然后切换到复制模式下可以必现分辨率栏为空,点开下拉菜单可以看到分辨率 + + -- zhoubin Wed, 02 Mar 2022 15:50:41 +0800 + +ukui-control-center (3.1.1+2022-0301) v101; urgency=medium + + * 提交commit: 38104feb + * setProcessEnvironment导致乱码问题(自测问题,现象为打开控制面板崩溃) + + -- zhoubin Tue, 01 Mar 2022 09:15:14 +0800 + +ukui-control-center (3.1.1+2022-0228) v101; urgency=medium + + * 提交commit: e3694f95 + * bug#107949删除提示窗居中于控制面板 + + -- zhoubin Mon, 28 Feb 2022 09:39:11 +0800 + +ukui-control-center (3.1.1+2022-0224) v101; urgency=medium + + * 提交commit: 71ab2ff3 + * bug#103995“设置”的用户手册侧边导航栏中有两个“搜索” + * bug#101914【用户手册】用户手册-设置中快捷键内容需按照文档进行修改 + * bug#103862【SP2 UI走查】用户名显示长度不正确 + * bug#106810【控制面板】【文字走查】控制面板搜索框中“搜索”字样位置偏下,未垂直居中 + * bug#65937 ukui-control-center存在未授权漏洞_免密码登录 + + -- zhoubin Thu, 24 Feb 2022 13:44:45 +0800 + +ukui-control-center (3.1.1+2022-0221) v101; urgency=medium + + * 提交commit: 1ed415fd + * bug#104813【706驻场】【TR11A2】多次切换显示器后打开的显示器设置窗口无法关闭 + * bug#105803输入框不可复制剪切 + * bug#98549打开控制面板,切换页面和开启关闭开关时卡顿明显 + * bug#101551 PS:仅完成蓝牙界面的屏蔽【cpm】【HUAWEI】【KOS】【WIFI】【功能测试】【L0】BIOS高级设置处关闭无线网卡和蓝牙,对应的蓝牙、WiFi入口没有屏蔽(一般+必现+常用功能) + * bug#106135镜像模式下亮度调节仅显示一个 + * bug#10307控制面板"更新""备份""多屏协同"插件无法跳转用户手册相应界面 + * bug#105842锁屏设置为“从不”,3小时后系统进入锁屏 + * bug#99700镜像模式的缩略图,在不同情况下显示的大小不一致 + * bug#105039设置中的“开机启动”对添加自启动程序的表述与图片不一致 + + -- zhoubin Mon, 21 Feb 2022 10:46:06 +0800 + +ukui-control-center (3.1.1+2022-0211) v101; urgency=medium + + * 提交commit: 9792d74e + * bug#103632【无线投屏】测试机作为投射端跨系统投屏,点击连接闪退 + * bug#104562添加三指和四指使用介绍 + * bug#103455:【控制面板】在时区地图输入框内输入一个字符后点击其他位置,此时输入框仍处于可输入状态但是无法输入 + * story#11004域用户登录,除头像外其他按钮置灰 + * bug#104666自定义头像截取圆形 + + -- zhoubin Fri, 11 Feb 2022 14:01:19 +0800 + +ukui-control-center (3.1.1+2022-0125.2) v101; urgency=medium + + * 提交commit: 046449e2 + * bug#104561家目录已存在,无法创建 + * bug#104563修改账户类型为帐户类型 + + -- zhoubin Tue, 25 Jan 2022 16:24:27 +0800 + +ukui-control-center (3.1.1+2022-0125) v101; urgency=medium + + * 提交commit: b6f237a9 + * bug#95418英文状态下用户手册控制面板主题页面中图标主题的部分内容与实际和设计均不符(必现) + * bug#103323,#100779【706驻场】【TR41A1笔记本】【电源管理】-点击“此时间段后降低屏幕亮度”下拉框,修改为5分钟,选不中 + * bug#103924修改用户名label高度 + * bug#103757创建用户的错误提示未汉化,修改安全依赖 + * bug#103852【设置|关于】【隐私和协议】发送可选诊断数据默认为关闭 + * bug#102409输入新密码,确认密码之后再修改新密码为不一致,提示不更新 + + -- zhoubin Tue, 25 Jan 2022 10:27:30 +0800 + +ukui-control-center (3.1.1+2022-0119) v101; urgency=medium + + * 提交commit: ffa8b2a4 + * bug#102121字体显示不全 + * bug#103442错误信息使用红色提示 + * bug#103423锁屏和背景中出现图片重叠现象 + * bug92513编辑和删除在15号字体下显示不全 + + -- zhoubin Wed, 19 Jan 2022 10:26:53 +0800 + +ukui-control-center (3.1.1+2022-0118) v101; urgency=medium + + * 提交commit: ee91018a + * bug#98039选中图标跟随主题变化 + * bug#100931设置-主题中光标主题没有更新 + + -- zhoubin Tue, 18 Jan 2022 09:16:26 +0800 + +ukui-control-center (3.1.1+2022-0114) v101; urgency=medium + + * 提交commit: a42e45e5 + * bug#98443root用户设置账户类型按钮不可设置 + + -- zhoubin Fri, 14 Jan 2022 10:29:04 +0800 + +ukui-control-center (3.1.1+2022-0113) v101; urgency=medium + + * 提交commit: 7693e428 + * bug#98842设置tab键在lineedit间切换 + * bug#98159登录选项-生物识别,存在以下两处与设计稿不一致内容,请修正 + * bug#101833修改触摸为触控 + * bug#1023448【新CRB台式机】【设置】显示器亮度最开始显示未能获取该显示器的亮度信息,后面提示消失,亮度设置不生效 + * bug#97439控制面板-手动更改时区,哈萨克斯坦国家名未汉化 + * bug#100640【地图】【控制面板】时区地图中"台北" "符拉迪沃斯托克"位置定位错误 + * bug#101357【自适应升级】【控制面板】从SP1自适应升级到SP2版本后,控制面板开机启动列表中多个一个"天气" + * bug#102205时间和日期】时区不会自动清空 + + -- zhoubin Thu, 13 Jan 2022 10:33:12 +0800 + +ukui-control-center (3.1.1+2022-0111) v101; urgency=medium + + * 将光标翻译【寻光】改为【黑色质感】 + + -- zhoubin Tue, 11 Jan 2022 13:59:24 +0800 + +ukui-control-center (3.1.1+2022-0107.2) v101; urgency=medium + + * 提交commit: 2cdcf13c + * bug#100995【用户手册】设置部分内容不正确 + * bug#98476适配安全用户名合法检测 + * bug#102188【时间和日期】时区下拉框无边框 + + -- zhoubin Fri, 07 Jan 2022 17:29:19 +0800 + +ukui-control-center (3.1.1+2022-0107) v101; urgency=medium + + * 提交commit: cd433609 + * bug#101874,bug#101868,bug#101833修改用户手册中鼠标、触摸板、键盘的描述 + * bug#100379同时连接HDMI和VGA显示器,设为镜像模式,改变分辨率为1280*960以下分辨率,Unified Output字体显示不全 + * bug#100694扩展模式下,拔掉HDMI,控制面板内的“打开显示器”选项未去掉 + + -- zhoubin Fri, 07 Jan 2022 10:00:05 +0800 + +ukui-control-center (3.1.1+2022-0106.1) v101; urgency=medium + + * 提交commit: 79fdcc32 + * bug#98039选中图标使用主题的图标 + * bug#99789【sp2 UI走查】控制面板-非焦点状态 背景色与主题效果不一致 + * bug#91601【控制面板】-关于界面未按设计稿实现 + + -- zhoubin Thu, 06 Jan 2022 10:00:12 +0800 + +ukui-control-center (3.1.1+2022-0105) v101; urgency=medium + + * 提交commit: a26c0575 + * bug#97923【控制面板】低概率出现一个多余的搜索图标 + * bug#100456 bug#【SP2 UI走查】【控制面板】侧边栏深色主题三态未符合设计规范 + * bug#101666:【用户手册】【系统更新】英文版用户手册中更新的检测更新按钮显示不全 + * bug#100528【内测】【显示】【98883】双屏模式下刷新率为6Hz + + -- zhoubin Wed, 05 Jan 2022 10:58:19 +0800 + +ukui-control-center (3.1.1+2022-0104) v101; urgency=medium + + * 提交commit:caf52d35 + * Bug#99314切换深色主题详情页按钮颜色错误 + + -- zhoubin Tue, 04 Jan 2022 09:52:08 +0800 + +ukui-control-center (3.1.1+2021-1231) v101; urgency=medium + + * 提交commit: fe36bcbf + * bug#100514用户手册多张图片显示与实际页面不一致 + + -- zhoubin Fri, 31 Dec 2021 17:05:23 +0800 + +ukui-control-center (3.1.1+2021-1230) v101; urgency=medium + + * 提交commit: 4dcd8a65 + * bug#99614修改下拉框控件居中显示 + * bug#100456【SP2 UI走查】【控制面板】侧边栏深色主题三态未符合设计规范 + * bug#100548【快捷键】【UI】英文模式下-快捷键界面 + + -- zhoubin Thu, 30 Dec 2021 16:53:00 +0800 + +ukui-control-center (3.1.1+2021-1229) v101; urgency=medium + + * 提交commit:93dff0c6 + * bug#100013解决mOptionBtn设置的qss与主题冲突 + * bug#91033系统设置语言为English,登录界面输入错误密码提示为中文,系统下打开Computer,有些提示也为中文,日期样式也有部分中文样式 + * bug#91559【需求9018】【隐私和协议】发送可选诊断数据默认为关闭 + * bug#100679扩展模式下,拔掉HDMI,再插上,切换显示模式会导致重复显示,其中重复显示内容可能为空 + * bug#91531第二次修改用户头像界面未生效 + + -- zhoubin Wed, 29 Dec 2021 17:02:09 +0800 + +ukui-control-center (3.1.1+2021-1228.1) v101; urgency=medium + + * 提交commit:8f6360c9 + * bug#100012双屏,扩展模式,使得VGA在左边,HDMI屏幕在右。设置HDMI为主屏,选中HDMI屏,关闭显示器,再打开显示器。实际屏幕位置左右互换了 + * bug#98842修改自己密码和修改其他用户密码窗口需要按两下Tab键才能切换输入框 + * bug#100399修改用户密码时,需按两次tab键,才会自动跳转到下个按钮, + * bug#100514:用户手册多张图片显示与实际页面不一致 + * bug#989789控制面板-锁屏界面的锁屏时间设置条,在14号及15号字体下,选项“3h”和“never”距离过近 + * bug#100441【用例94640】【用户手册】手册中设置主界面未更新 + + -- zhoubin Tue, 28 Dec 2021 18:49:39 +0800 + +ukui-control-center (3.1.1+2021-1227.1) v101; urgency=medium + + * 提交commit: 55edf93b + * bug#96582【控制面板】-关于界面未按设计稿实现 + * bug#91601激活导入授权文件类型及到期时间状态---关于界面显示与设计图不符 + * bug#95141【云帐户】字体和主题的图标同步成功后,设置-字体和主题-图标中标注的与实际上展示的不一致 + * task#64549将控制面板中用户手册图片过大(超过1m)的进行替换 + * bug#97429【需求转化】【控制面板】显示器中"夜间模式"标题需要改为"色温" + * bug#100034【设置|关于】试用免责协议界面内容格式不规范 + * bug#89450接双屏,打开控制面板-显示器,使用win+p切换显示模式,切换至扩展模式,两缩略图重叠。概率:1/10 + + -- zhoubin Mon, 27 Dec 2021 11:11:04 +0800 + +ukui-control-center (3.1.1+1224) v101; urgency=medium + + * 提交commit:a91c3452 + * bug#99632:控制面板-新增时区时间 删除icon未反白处理 + * bug#98883:双显复制模式下,设置刷新率时不会黑屏提示是否保存设置 + * bug#99631修改用户昵称与图标间距,头像背景完全透明,首页悬浮效果跟随主题变化 + * bug#98434鼠标悬浮在备份省略号上,悬浮的是黑色小字体,不美观 + * bug#92674【需求-vpn-9078】vpn界面最大化后,界面显示异常,没有适配最大化 + * bug#99789【sp2 UI走查】控制面板-非焦点状态 背景色与主题效果不一致 + * bug#99619【sp2 UI走查】控制面板-主题窗口特效开启状态下,未使用分割想区分 + + -- zhoubin Fri, 24 Dec 2021 10:14:54 +0800 + +ukui-control-center (3.1.1+1223.1) v101; urgency=medium + + * 提交commit: d4d5a772 + * bug#99614修改下拉框控件高度 + * bug#96769设置-关于-《用户隐私协议》中内容不准确、格式有错误 + * bug#99446【无线投屏】系统语言为英文,无线投屏用户手册仍有图片语言显示为中文 + + -- zhoubin Thu, 23 Dec 2021 10:38:49 +0800 + +ukui-control-center (3.1.1+1222) v101; urgency=medium + + * 提交commit:8cc75c0d + * bug#97481概率17/20,系统字体大小从15调整至14时,主界面与左侧导航栏短暂分离,闪过一条缝隙 + * bug#98739选择纯色壁纸后,原图片壁纸仍为选中状态 + * bug#99149修改tristatelabel + * bug#99000打开自定义颜色窗口后按回车该窗口会自动关闭 + * bug#98499自定义颜色窗口中,在HEX输入框中输入3个数字就会自动补齐无法自由输入 + * bug#99001修改标题 + * bug#98971控制面板-背景下拉框高度不一致 + + -- zhoubin Wed, 22 Dec 2021 09:11:40 +0800 + +ukui-control-center (3.1.1+1217) v101; urgency=medium + + * 提交commit:88693d50 + * bug#957502K+150%及以上分辨率下,将控制面板拖到四个角时部分界面显示不全 + * bug#95026用户手册中蓝牙模块未更新(部分内容与实际不符) + * bug#93420修改文案 + * bug#98199修改模块图标 + * bug#95816修改 修改用户头像文案 + + -- zhoubin Fri, 17 Dec 2021 16:01:48 +0800 + +ukui-control-center (3.1.1+1216) v101; urgency=medium + + * 提交commit:4b509d3f + * bug#94799修改其他用户头像大小 + * bug#97650修改鼠标主按钮及指针大小ui + * bug#91805修改vpn页面ui与设计稿一致 + * bug#91666字体、缩放均设置为最大时,系统设置界面部分显示异 + * bug#92580【电源管理】使用电池自动开启节能模式,不进入节能模式 + * bug#96510修改密码,输入正确原始密码后提示密码错误 + * bug#94800锁屏同步后,设置-锁屏模块中的蓝色框仍框选同步前的背景 + * bug#96518桌面右键,选择设置背景。控制面板打开后,左边导航栏选中的背景条目未显示居中 + + -- zhoubin Thu, 16 Dec 2021 17:09:19 +0800 + +ukui-control-center (3.1.1+1214) v101; urgency=medium + + * 提交commit:64320fca + * bug#97384打开控制面板-显示器,打开奇安信浏览器,当浏览器窗口在控制面板窗口上时,控制面板的窗口部分变成了透明,可以透视桌面背景 + * bug#97484打开控制面板-显示器,修改分辨率,没有生效,不能使用currentModeId判断 + * bug#96275内测】【窗口管理器】右键菜单栏打开控制面板时有缓冲图标 + + -- zhoubin Tue, 14 Dec 2021 16:18:32 +0800 + +ukui-control-center (3.1.1+1210) v101; urgency=medium + + * 提交commit:bf18fe2f + * bug#90400:无线投屛用户手册内容仍为sp1的投屏,sp2已有大幅度改动 + * bug#90400:无线投屛用户手册内容仍为sp1的投屏,sp2已有大幅度改动;修改用户手册部分文案 + * bug#90400:无线投屛用户手册内容仍为sp1的投屏,sp2已有大幅度改动 + * bug#9423412小时制下日期组件中的"上午、下午"未跟随日期语言变化(目前跟随系统语言变化) + * bug#95753快捷键-自定义快捷键弹窗未按设计稿实现(必现) + * bug#95489选择自定义屏保,在屏保文本框中输入内容,输入指针会跳转 + + -- zhoubin Fri, 10 Dec 2021 18:16:25 +0800 + +ukui-control-center (3.1.1+1209.1) v101; urgency=medium + + * 提交commit:1b5ade8b + * bug#81106【strict】【用例86879】四种用户打开控制面板均有全部设置项 + + -- zhoubin Thu, 09 Dec 2021 11:01:31 +0800 + +ukui-control-center (3.1.1+1209) v101; urgency=medium + + * 提交commit:7e1e17b5 + * bug#93897修改frame的spacing为0 + * bug#92467 【显示器】【双屏】win+p切换双屏时,控制面板-系统-显示器中,“多屏显示”“显示器”内容显示错误 + + -- zhoubin Wed, 08 Dec 2021 18:45:04 +0800 + +ukui-control-center (3.1.1+1208) v101; urgency=medium + + * 提交commit:70db4040 + * bug#95142【显示】【控制面板】1600*900以下分辨率下,代理界面端口字样被白框盖住 + * bug#95739 【设置】【3A5000】装完系统后第一次打开设置过程中桌面闪现设置图标 + * bug#93750:双屏,连接4K显示器,镜像模式下,打开控制面板-显示器,查看亮度条,没有对齐 + + -- zhoubin Wed, 08 Dec 2021 10:47:13 +0800 + +ukui-control-center (3.1.1+1207) v101; urgency=medium + + * 提交commit:29664a01 + * bug#92467 【显示器】【双屏】win+p切换双屏时,控制面板-系统-显示器中,“多屏显示”“显示器”内容显示错误 + * bug#93420修改 修改密码的翻译 + * bug#93897修改镜像模式下frame的区分 + * bug#93420修改 修改密码的翻译 + + -- zhoubin Tue, 07 Dec 2021 15:23:40 +0800 + +ukui-control-center (3.1.1+1206) v101; urgency=medium + + * 提交commit:7439c1e2 + * bug#93087【显示】【控制面板】【必现】125%缩放比1920*1080分辨率情况下,将分辨率修改为最低分辨率1024*768,显示界面异常,控制面板和开始菜单显示不全 + * bug#92781 【双屏】【开天M630Z】镜像切VGA,控制面板闪退(主屏幕为空导致) + + -- zhoubin Mon, 06 Dec 2021 17:44:27 +0800 + +ukui-control-center (3.1.1+1203.1) v101; urgency=medium + + * bug#92781 【双屏】【开天M630Z】镜像切VGA,控制面板闪退 + + -- zhoubin Mon, 06 Dec 2021 11:03:53 +0800 + +ukui-control-center (3.1.1+1203) v101; urgency=medium + + * 提交commit:a46dc6e2 + * bug#92549【控制面板】双屏下,HDMI屏(2K)的方向设置从90度顺时针->90度逆时针->上下颠倒后出现异常 + * bug#94784修改创建用户提权认证文案 + * bug#91601【控制面板】-关于界面未按设计稿实现 + * bug#94063浏览本地背景时,应屏蔽非图片格式的文件 + * bug#92480【控制面板|搜索】台式机在搜索栏输入“触”,出现三个选项,点击无效 + * bug#93487【控制面板】控制面板-开机启动中有默认应用无图标且未翻译; 【控制面板】开机启动默认列表需按照设计稿实现 + * bug#91624【apt代理】apt代理关闭后,apt下载软件时还是会有apt代理服务端出现 + + -- zhoubin Fri, 03 Dec 2021 20:56:21 +0800 + +ukui-control-center (3.1.1+1202) v101; urgency=medium + + * 提交commit:cc1251ec + * bug#93897修改显示模块页面布局 + * bug#92401 【控制面板】新建账户点击确定,面板关闭存在延时 + * bug#94763修改模块边距 + * bug#93420修改密码页面 + * bug#93930文案对齐 + * bug#93897修改显示模块页面布局 + * bug#92672用线做区分行与行 + * bug#93395修改确认按钮为无不可点击状态 + + -- zhoubin Thu, 02 Dec 2021 15:43:24 +0800 + +ukui-control-center (3.1.1+1130.2) v101; urgency=medium + + * 提交commit:e21a2e75 + * bug#93134双屏,打开控制面板-显示器,切换显示模式,从仅HDMI-镜像模式,控制面板崩溃 + * bug#93342英文环境下,电源和后台更新图片未英化 + * bug#93967修改设为主屏的英文 + * bug#93957修改设为主屏的英文 + * bug#93813笔记本接4k屏,4k屏设置界面有亮度调节自带屏无,测试10次复现8次 + * bug#93134双屏,打开控制面板-显示器,切换显示模式,从仅HDMI-镜像模式,控制面板崩溃 + * bug#94118触摸屏在导航位置 + * bug#92249修改用户昵称框在mips下不显示 + + -- zhoubin Tue, 30 Nov 2021 09:19:36 +0800 + +ukui-control-center (3.1.1+1129) v101; urgency=medium + + * 提交commit:0a24b166 + * bug#90290修改登录选项用户手册 + * bug#93763手动设置时间,点开下拉框后键盘任意输入,下拉日期框出现异常显示 + * bug#92792【主题】【控制面板】光标主题的排列顺序不符合设计,默认选项应排在第一个(必现) + * bug#91737修改用户昵称显示 + * bug#92515装机后特效模式透明度默认1,但点击恢复默认设置后变为0.75 + * bug#93514添加更新相关条目至search.xml + * bug#92679,bug#92676,bug#91789限制用户昵称长度 + + -- zhoubin Mon, 29 Nov 2021 09:18:24 +0800 + +ukui-control-center (3.1.1+1125.2) v101; urgency=medium + + * 提交commit:eba6f821 + * bug#90290,91783,63450设置中多处图片、内容需调整 + * bug#92345修改已新建好的自定义快捷键,win键名称变为Meta + * bug#91946输入密码限制中文 + * bug#91660关闭24小时制,手动设置时间的“小时”选项为24时制选项 + * bug#92349【电源管理|控制面板】控制面板-电源管理,电源计划没有性能模式 + * bug#93396【SP2 UI走查】【控制面板】开机启动界面"添加"按钮行的位置不对 + * bug#89378 【需求-控制面板-9013】【账户信息】【SP2】12-15号字体,用户名和用户类型显示不完全 + * bug#91591修改用户昵称时的提示 + + -- zhoubin Thu, 25 Nov 2021 17:38:40 +0800 + +ukui-control-center (3.1.1+1125.1) v101; urgency=medium + + * 提交commit:6cdad638 + * bug#92222字体由小调大,账户信息页用户名显示不全 + * bug#90295 【账户信息】【SP2】第二个用户开启开机自动登录时无弹窗提示 + * bug#92349【控制面板】-备份还原页面未按设计稿实现 ; + * bug#92658 【电源管理|控制面板】控制面板-电源管理,电源计划没有性能模式 + * bug#92222修改 修改密码时提示的显示 + * bug#91396【设置】设置界面部分子菜单界面显示线条 + * bug#92796【控制面板】关于中免责协议和隐私协议的窗口标题不一致 + * bug#92990【UI优化】【控制面板】部分界面中button高度问题导致显示不完全 + * bug#91313修改触摸板、鼠标、键盘详情页的边距 + * bug#92670修稿主题设置界面标题文案 + + -- zhoubin Thu, 25 Nov 2021 09:09:53 +0800 + +ukui-control-center (3.1.1+1118.2) v101; urgency=medium + + * 提交commit:6406b3c7 + * bug#90999打开控制面板-显示器,切换显示模式,从扩展模式-仅VGA-仅HDMI,在仅VGA显示时实际显示的为HDMI屏幕。在仅HDMI显示时实际显示的为VGA屏幕 + * bug#90995打开控制面板-显示器,切换显示模式,从仅VGA-仅HDMI,切换失败,显示为扩展模式 + * bug#90862控制面板-多屏显示处修改显示模式,扩展-镜像,再使用win+p修改为HDMI,控制面板显示为镜像,实际为hdmi + + -- zhoubin Fri, 19 Nov 2021 21:02:23 +0800 + +ukui-control-center (3.1.1+1118) v101; urgency=medium + + * 提交commit:766c86f3 + * bug#91567修改用户昵称、计算机名界面未按设计稿实现 + * bug#91323修改左侧导航间距及图标选中反白 + * bug#91394修改滑动条靠右显示,最大化时一行显示四个模块 + * bug#91229修改刷新率和方向,弹出提示分辨率已修改是否保存 + * bug#91618修改浅色主题下点击添加按钮图标的颜色 + * bug#88693点击任务栏下方的设置,跳转到控制面板比较缓慢,大概需要两秒 + + -- zhoubin Thu, 18 Nov 2021 14:31:30 +0800 + +ukui-control-center (3.1.1+1117) v101; urgency=medium + + * 提交commit:224f0e92 + * bug#88661修改模块isShowOnHomePage函数 + * bug#90457:修改分辨率重疊问题 + * bug#91001英文模式下用户隐私协议仍翻译为中文 + * bug#91185修改搜索备份时无法跳转到备份设置 + * bug#89174修改翻译 + * bug#84882修改分辨率或者旋转方向后的提示框,会从边缘部分出现,再回到中央位置 + * bug#90580修改方向/刷新率,提示“屏幕分辨率已修改,是否保存”。提示语不合适 + + -- zhoubin Wed, 17 Nov 2021 10:01:40 +0800 + +ukui-control-center (3.1.1+1111) v101; urgency=medium + + * 提交commit:06fb475d + * bug#89218【控制面板】【显示】刷新率整数文案与设计稿不一致 + * bug#89625自定义快捷键-修改快捷键名称为之前设置过但当前不存在的快捷键名称时,提示快捷键名称重复 + * bug#90447连接双屏,打开控制面板-显示器,在控制面板切换显示模式,从扩展-HDMI-VGA,控制面板崩溃 + * bug#90496更新升级】【控制面板】从sp1最终版本更新升级到sp2版本后,点击控制面板"锁屏"后控制面板闪退 + * bug#89643【快捷键】自定义快捷键名称可为空(必现) + * bug#89391【控制面板】背景、锁屏界面点击恢复默认不会恢复壁纸的选中框 + * bug#89174修改触摸板为触控板 + * bug#89312修改滑动条范围为1-5 + * bug#90261修改图标主题后发现控制面板左上角图标没有立即跟随主题变化 + * bug#89177设置主屏幕按钮状态错误 + * bug#87684按照设计稿修改左侧菜单模块显示顺序 + * bug#88926修改光标速度为指针速度,并修改滚动类型 + * bug#87684按照设计稿修改左侧菜单模块显示顺序 + + -- zhoubin Thu, 11 Nov 2021 20:53:43 +0800 + +ukui-control-center (3.1.1+1109.2) v101; urgency=medium + + * 提交commit:ea4f317d + * bug#84828用户手册中投屏PIN码仍为8位(目前实为4位),且投屏开关页面提示词也未更新 + * bug#89507 无线投屛无用户手册 + + -- zhoubin Tue, 09 Nov 2021 14:15:35 +0800 + +ukui-control-center (3.1.1+1109.1) v101; urgency=medium + + * 提交commit:7400c406 + * bug#88884【显示】【控制面板】【必现】修改分辨率后的提示框没有居中控制面板界面——同步SP1居中方案 + * bug#78266热插拔HDMI线,显示器状态显示错误,同时优化有关插拔的一些代码 + * bug#89214修改分辨率的提示文案与设计稿不一致 + * bug#89178多屏显示下拉框文案与设计稿不一致,且与win+p不统一 + * bug#89521文模式+13号及以上字体下关于、代理界面部分文字显示不全 + + -- zhoubin Tue, 09 Nov 2021 10:10:16 +0800 + +ukui-control-center (3.1.1+1109) v101; urgency=medium + + * 无改动,由于没有pull代码,只更新了版本号 + + -- zhoubin Mon, 08 Nov 2021 20:51:56 +0800 + +ukui-control-center (3.1.1+1108) v101; urgency=medium + + * 提交commit:5f33d137 + * bug#88403打开控制面板时跳转到制定页面 + * 更改插件依赖libkysset + + -- zhoubin Mon, 08 Nov 2021 10:06:37 +0800 + +ukui-control-center (3.1.1+1105) v101; urgency=medium + + * 提交commit:737f16 + * bug#78897 【设置】修改用户名后,再修改为之前用户名,提示用户名已存在 + * bug#71876优化镜像、非镜像的刷新率/分辨率修改逻辑,当有可选刷新率存在时,去掉自动选项 + * bug#89260修改左右键逻辑 + * bug#85157无法修改刷新率 + * bug#89109修改滚动类型文案 + * bug#89084禁止滚动时滚动类型均禁用 + * bug#89022未检测到触摸板时不显示触摸板模块 + * bug#88403 修改命令行参数不区分大小写 + * bug#89074win+p与控制面板不同步问题 + + -- zhoubin Fri, 05 Nov 2021 15:57:15 +0800 + +ukui-control-center (3.1.1+1104) v101; urgency=medium + + * 提交commit:57d93a4d + * bug#88820【用户手册】【设置】设置部分内容、格式不正确 + + -- zhoubin Thu, 04 Nov 2021 19:04:58 +0800 + +ukui-control-center (3.1.1+1103) v101; urgency=medium + + * 提交commit:148bee55 + * task#59034新增两套主题图标--寻光、和印 / 控制面板新增两套主题图标 + * task#59060计算机名称输入规则与用户名称输入规则保持一致 + * bug#85079设置主屏幕按钮状态错误 + + -- zhoubin Wed, 03 Nov 2021 18:04:14 +0800 + +ukui-control-center (3.1.1+1102) v101; urgency=medium + + * 提交commit:0bb4ecae + * bug#85384 【内测】【账户设置】英文模式下新建账户授权界面有中文 + * bug#82662 【账户设置】15号字体英文系统下,修改用户名弹框显示截断 + * bug#86746 【内测】【摸底测试】【账户信息】更换头像时无法识别本地目录下GIF格式图片 + * bug#控制面板多屏显示设置项文案需要和win+p保持一致(文案为 接口1/接口2/镜像/扩展) + * bug# 78266 【双屏】【mips】热插拔HDMI线,显示器状态显示错误 + * bug#85384 【内测】【账户设置】英文模式下新建账户授权界面有中 + * bug#82662 【账户设置】15号字体英文系统下,修改用户名弹框显示截断 + * bug#84737连接4K显示器,打开控制面板-显示器,刷新率为空 + * bug#77780无法应用4K分辨率 + * bug# 78266 【双屏】【mips】热插拔HDMI线,显示器状态显示错误(测试20次,出现13次) + + -- zhoubin Tue, 02 Nov 2021 11:05:30 +0800 + +ukui-control-center (3.1.1+1101) v101; urgency=medium + + * 提交commit:87d11157 + * bug#82326更新search.xml + * task58041显示器缩放增加稍后注销功能 / 去掉实时缩放功能 + * bug#85240:双屏,扩展模式下,在控制面板-显示器,拖拽改变屏幕AB的位置后,放大/还原控制面板窗口,两个显示器的缩略图重叠/分离 + + -- zhoubin Mon, 01 Nov 2021 10:21:55 +0800 + +ukui-control-center (3.1.1+1028.4) v101; urgency=medium + + * 提交commit:4ca53dae + * bug#85852设置免密登录需要验证 + * task#56584 and task#56686支持北京时区 + * task56451制面板中,增加用户信息收集隐私协议和用户收集控制开关 + * task56445可在系统中修改计算机名 + * 提交commit:dacd24fc + * 需求8946 【蓝牙3.1】设置里增加蓝牙设备分类 + * 需求46102增加APT代理功能 + * bug#82778修改鼠标左键文案 + * bug#82499从ukui-search 打开备份还原设置 + * bug#84379:【需求转化-同步时间-7742】【控制面板】自定义服务器地址后切成其他系统默认地址,自定义服务器地址的输入框内容应清空 + * 提交commit:3c1cf0c8 + * bug#82045 + * bug#83232http代理选择启用认证,打开网页后,仍然弹出认证 + * bug #83949 #83657 #83225 + * task#8767多屏情况下可检测当前显示器是哪个 + * bug#83853时区地图中文字描述未汉化 + * 提交commit:09171d50 + * bug#82889,81427,81244,81167 + * 提交commit:ad974407 + * bug#44385标题与文本对齐 + * bug#77854 【UKUI V3.1】【账户信息】存在多个用户时鼠标悬停点击用户名,出现不完整蓝色边框 + * bug#77551 【UKUI V3.1】【账户信息】修改自己的账户类型后,sudo权限没有即时更改 + * bug#77456 【UKUI V3.1 】【账户信息】页面显示按钮与设计图不符合 + * bug#81284 【UKUI V3.1】【账户信息】昵称名字符过长时控制面板中昵称显示末尾不是 + * 提交commit:e0e51463 + * bug#82885 【UKUI V3.1】【账户信息】添加用户时出现两次授权弹框 + * bug#83234 【UKUI V3.1】【账户信息】修改昵称按副键盘Enter键成功 + * bug#82037:根据设计稿修改声音样式解决提示音的问题 + * bug#81102 【UKUI V3.1】【蓝牙】连接部分设备无法连接成功( beats-x、sony wh-xm3),小米耳机、音响可以成功连 + * bug#81018 【UKUI V3.1】【Intel 0923版本】【蓝牙】连接手机设备后点击发送文件选项,无响应 + * bug#80936 【UKUI V3.1】【蓝牙】蓝牙部分界面未汉化完全 + * bug#82885 【UKUI V3.1】【账户信息】添加用户时出现两次授权弹框 + * bug#81102 【UKUI V3.1】【蓝牙】连接部分设备无法连接成功( beats-x、sony wh-xm3),小米耳机、音响可以成功连 + * bug#81018 【UKUI V3.1】【Intel 0923版本】【蓝牙】连接手机设备后点击发送文件选项,无响应 + * bug#80936 【UKUI V3.1】【蓝牙】蓝牙部分界面未汉化完全 + * bug#82720关闭文本区域光标闪烁后重新打开控制面板,光标速度控件仍存在 + * bug#82778 【控制面板-鼠标】文案优化 + * bug#81170显示器中点击夜间模式开关后控制面板闪退产生core文件,且之后点击显示器控制面板必闪退无法恢复 + * 提交commit:6c276356 + * bug#82037修改了声音一些控件的大小还有一处声音控件的翻译 + * bug#82037 + * bug#81511每次第一次设置为其他屏/第一屏,第一次在显示器预览处点击被关闭的屏幕时都会自动闪回到打开的屏幕上,再次点击正常 + * bug#81855侧边栏调节亮度条后,控制面板亮度未同步修改 + * 提交commit:405f9f + * bug#77857【控制面板】背景界面未集成显示方式功能 + * 提交commit:9bec34e9 + * bug#73429搜索搜控制面板某些配置项无法搜到,如“方向”和“分辨率”等(需及时更新对应配置文件) + * 提交commit:4dde28dc + * bug#77659 【UKUI V3.1】【账户信息】更换头像时无法识别本地目录下GIF格式图片 + * bug# 77596 【UKUI V3.1】【账户信息】修改昵称后新建同样的用户成功建立 + * bug# 77416 【UKUI V3.1】【账户信息】修改昵称界面未汉化 + * bug# 77839 【UKUI V3.1】【账户信息】开启免密登录后注销用户再登入,免密登录开关自动关闭,再次注销后仍可免密登录 + * 提交commit:846a3662 + * bug#77967 【UKUI V3.1】【账户信息】密码输错达到上限后无账户被锁提示语 + * bug#77847 【UKUI V3.1】【账户信息】系统存在多个用户或新建用户后开启免密登录,控制面板出现异常卡顿、卡死 + * bug#81110 【UKUI V3.1】【账户信息】修改昵称时按Enter键修改成功 + * bug#77967 【UKUI V3.1】【账户信息】密码输错达到上限后无账户被锁提示语 + * bug# 77847 【UKUI V3.1】【账户信息】系统存在多个用户或新建用户后开启免密登录,控制面板出现异常卡顿、卡死 + * bug#77751间和日期界面日期输入框中的下拉框样式不符合UI设计 + * bug#81289深色模式下,菜单栏中"投屏、手势、生物特征与密码"标签图标未反白 + * bug#77892 + * 提交commit:6070d40c + * #bug79441 + * 提交commit:fe872931 + * bug#78545禁止对关闭的屏幕进行显示调整 + * bug#78416从第一屏切换到拓展状态错误 + * 提交commit:38deedb9 + * bug#78442刷新率设置最多未保留两位小数 + * bug#78588自定义快捷键UI和部分功能和设计稿不符 + * bug#78321深色模式下,时间和日期界面的钟表内数字不显示 + * bug#78336修改了背景和快捷键弹出窗口dialog中的按钮click和hover效果 + * bug#77862背景界面点击"自定义颜色"弹出的弹窗不符合UI设计 + * bug#77850锁屏、背景界面中的"浏览本地壁纸"应修改为"浏览","线上图片"位置应靠下 + * bug#77684导航标签中的"账户"需要改为"帐户" + * bug#79328多台设备刷机后,控制面板蓝牙选项,在任务栏点击蓝牙,无法跳转蓝牙界面 + * bug#77792英文模式下部分界面文字描述显示不全 + * bug#77792完整显示英语 + * bug#77792英文模式下部分界面文字描述显示不全 + * task#51066Intel账户添加userinfo_intel 插件,其他环境隐藏 + * bug#78594按cltr+alt+类时不会检测和系统快捷键的冲突,按win+类时都提示无效快捷键 + * bug#73598修改导航显示时间日期为时间和日期 + * bug#73598首页显示插件名和以及导航展示的名称不一致处理 + * bug#77763先加载插件页面,再加载控件 + * bug#78589编辑自定义快捷键时,只修改快捷键名称无法点击"确定" + * 编译错误(dt无需测试bluetoothmessagebox.h: No such file or directory) + * 提交commit:08907d7f + * bug#73650桌面共享界面标题显示为英文"Remote Desktop"未汉化,且该标签应该修改为"远程桌面 + * task#7486 子 【UKUI3.1】控制面板大模块重构 + * bug#77983控制面板中应去掉"桌面"模块 + * bug#78179代理界面选择自动代理时,底部的忽略列表未置灰 + * 添加移动热点插件(zxl) + * bug#77812中文模式下"远程桌面"功能在菜单栏不显示,英文模式下可以正常显示 + * task#44403声音功能开发重构工作 + * 提交commit:c9c298c7 + * task#45525 子 ukui3.1控制面板账户功能开发重构工作与intel代码整合工作 / 3.1控制面板账户改动 + * 提交commit:a3ce01aa + * task#50239 生物识别与密码插件添加 + * 提交commit:f5e8c011 + * task#44833 ukui3.1控制面板字体模块功能开发以及与intel代码整合 + * task44388ukui3.1控制面板打印机功能开发重构工作与intel代码整合工作 + * task#44391ukui3.1控制面板默认应用功能开发重构工作与intel代码整合工作 + * bug#73598:【ukui v3.1】【控制面板】时间和日期界面部分功能描述与设计图不符 + * bug#74549:【ukui v3.1】【控制面板】手动更改时间日期后,区域语言中日期显示不会实时修改,需要重新关开控制面板生效 + * bug#73594:【ukui v3.1】【控制面板】添加其他时区没有数量限制(设计稿为限制数量为5) + * bug#73540:【ukui v3.1】【控制面板】区域语言界面部分功能描述与设计图不符 + * task#44392ukui3.1控制面板快捷键功能开发重构工作与intel代码整合工作 + * 提交commit:61269fa + * task#44401ukui3.1控制面板通知功能开发重构工作与intel代码整合工作 + * task#44386重写键盘通用设置界面 + * task#4402ukui3.1控制面板电源功能开发重构工作与intel代码整合工作 + * bug#44385解决鼠标设置中改变指针速度触摸板中光标未改变的问题 + * task#44406ukui3.1控制面板远程桌面功能开发重构工作与intel代码整合工作 + * 提交commit:8c8c4a9 + * task#44387基于sp1-3.1setting-intel设计稿重构鼠标模块 + * task:44528 + * task#44830控制面板屏保模块功能开发以及与intel代码整合 + * task#44391控制面板默认应用功能开发重构工作与intel代码整合工作 + * task#44225关于页面整合 + * task#44832主题UI样式更改 + * task#44506背景与锁屏插件3.1开发 + * task#44828多屏设置 + * task#44394控制面板区域语言功能开发重构工作与intel代码整合工作 + + -- zhoubin Thu, 28 Oct 2021 14:25:55 +0800 + +ukui-control-center (3.0.1-1-57.2) v101; urgency=medium + + * 解决bug#50577显示亮度调整数值 + * 解决bug#43141修改分辨率后加延时,得到准确的控制面板位置 + + -- zhoubin Fri, 23 Apr 2021 18:00:29 +0800 + +ukui-control-center (3.0.1-1-57.1) v101; urgency=medium + + * 修改翻译:"自动登录"改为开机自动登录; + + -- zhoubin Thu, 22 Apr 2021 17:53:50 +0800 + +ukui-control-center (3.0.1-1-57) v101; urgency=medium + + * 990分数缩放添加 + * 解决bug#43141使用i2ctransfer写入bus数据调整台式机亮度 + * 解决bug#50120鼠标左键可以点击 + * 添加搜索插件 + * 解决bug#32085打开统一输出,点击两次应用设置,再关闭统一输出,显示器预览窗口仍然显示Unified outputs + + -- zhoubin Thu, 22 Apr 2021 15:40:18 +0800 + +ukui-control-center (3.0.1-1-56) v101; urgency=medium + + * 解决bug#34463拔掉HDMI屏再接入,控制面板中两个屏的位置不对 + * 解决bug#47830统一输出模式,调整屏幕亮度只有一个屏幕生效 + * 使用usd的dbus调用vino服务 + * 解决bug#48215打印机列表显示不一致问题 + * 解决bug#43100控制面板显示器名称显示未知 + * 解决bug#46560将笔记本设置为200%,VGA屏幕缩放也会变成200%,但是控制面板显示的100% + * 解决bug#BUG#47578,16号字体控制面板创建用户页面存在显示不全现象 + * 解决bug#45602 and bug#46710修复打开控制面板缩放自动为1的bug,修复刷新率数值重复的bug + * 解决bug#47203时间显示存在延迟 + * 解决bug#43489统一输出后恢复原来配置还是开关还是处于统一输出状态 + * 将网络监测机制迁移到dbus(彭代欣) + + -- zhoubin Tue, 20 Apr 2021 15:29:44 +0800 + +ukui-control-center (3.0.1-1-55) v101; urgency=medium + + * 解决bug#42212旧密码可与新密码相同 + * 解决bug#44081同步win+p更改 + * 解决bug#选择非默认光标主题后点击恢复默认设置,拉伸窗体光标显示为“白”光标 + * 解决bug#43275 + * 解决bug#43635,bug#43632,bug#43141 + + -- zhoubin Fri, 02 Apr 2021 09:58:44 +0800 + +ukui-control-center (3.0.1-1-54) v101; urgency=medium + + * 解决bug#45596 恢复原来配置主屏幕更改问题 + * 解决bug#45235可用网络列表中,“网络连接”的按钮和灰色背景有部分重叠 + * 解决bug#45233更改用户部分UI + + -- zhoubin Tue, 30 Mar 2021 16:01:44 +0800 + +ukui-control-center (3.0.1-1-53) v101; urgency=medium + + * 解决bug#43244 【双屏】【VGA+HDMI】更改HDMI屏分辨率为1024*768,刷新率为60,重新打开控制面板,分辨率自动变为1280*720 + + -- zhoubin Sat, 27 Mar 2021 11:37:15 +0800 + +ukui-control-center (3.0.1-1-52.1) v101; urgency=medium + + * 解决输入设备未及时更新以及深色主题下未反白的问题(封昭翔) + + -- zhoubin Thu, 25 Mar 2021 17:07:22 +0800 + +ukui-control-center (3.0.1-1-52) v101; urgency=medium + + * 解决bug#43058显示预览没有切换 + * 解决bug#44293mode id为空导致的闪退出问题 + * 解决bug#44472屏幕位置错误导致任务错位问题 + + -- zhoubin Wed, 24 Mar 2021 19:01:31 +0800 + +ukui-control-center (3.0.1-1-51.3) v101; urgency=medium + + * 版权符号错误 + + -- zhoubin Tue, 23 Mar 2021 17:15:11 +0800 + +ukui-control-center (3.0.1-1-51.2) v101; urgency=medium + + * 版本英文描述更改判断 + + -- zhoubin Tue, 23 Mar 2021 16:24:48 +0800 + +ukui-control-center (3.0.1-1-51.1) v101; urgency=medium + + * 版本描述增加一个空格 + + -- zhoubin Tue, 23 Mar 2021 13:56:49 +0800 + +ukui-control-center (3.0.1-1-51) v101; urgency=medium + + * 更新版权信息 + + -- zhoubin Tue, 23 Mar 2021 11:18:59 +0800 + +ukui-control-center (3.0.1-1-50) v101; urgency=medium + + * 解决bug#43396去掉夜间模式,但搜索框中仍然可以搜索到 + * 解决bug#42412控制面板”的显示器名称和“系统投屏”的第一屏幕名称不一致 + * 解决bug#42752【个性化】更改光标主题不生效 + * 解决bug#43073主副屏幕更改问题 + * 备份还原dbus接口添加参数(锁定系统更新时的备份操作) + + -- zhoubin Fri, 19 Mar 2021 18:59:43 +0800 + +ukui-control-center (3.0.1-1-49) v101; urgency=medium + + * 公司内部bug#42078键盘输入测试字符,有些字符没有显示完全 + * 解决bug#4229dbus接口造成的超时卡顿问题 + * 解决bug#37713镜像模式恢复以前配置显示错误 + * 解决bug#39697modeid錯誤引起的黑屏 + * 解决bug#42066主副屏幕记录错误 + + -- zhoubin Thu, 18 Mar 2021 16:43:32 +0800 + +ukui-control-center (3.0.1-1-48) v101; urgency=medium + + * 使用左右键快捷键调整亮度 + * 解决BUG#41698【控制面板】输入正确的当前密码,按tab键后,概率性提示密码错误 + * 解决BUG#37381 【控制面板】【用户头像】更改用户头像,选择头像图片时,选择框异常 + * 解决BUG#39995【账户信息】更改用户头像,未选择图像,点击确认,头像恢复到默认状态 + * 解决bug#21438通过控制面板的显示器设置夜间模式后,不生效 + * 解决bug39116#打开控制面板,控制面板显示黑屏三秒 + + -- zhoubin Fri, 12 Mar 2021 09:32:23 +0800 + +ukui-control-center (3.0.1-1-47.2) v101; urgency=medium + + * 取消modeid是否相等判断 + + -- zhoubin Tue, 09 Mar 2021 09:02:44 +0800 + +ukui-control-center (3.0.1-1-47.1) v101; urgency=medium + + * 取消modeid是否相等判断 + + -- zhoubin Mon, 08 Mar 2021 20:57:24 +0800 + +ukui-control-center (3.0.1-1-47) v101; urgency=medium + + * wayland添加缩放判断 + * 添加搜索词过滤(bug#40243) + + -- zhoubin Mon, 08 Mar 2021 16:05:52 +0800 + +ukui-control-center (3.0.1-1-46.2) v101; urgency=medium + + * 平台问题chroot problem,重新上传 + + -- zhoubin Thu, 04 Mar 2021 16:26:44 +0800 + +ukui-control-center (3.0.1-1-46.1) v101; urgency=medium + + * 还原插拔屏幕修改 + + -- zhoubin Thu, 04 Mar 2021 14:51:38 +0800 + +ukui-control-center (3.0.1-1-46) v101; urgency=medium + + * 解决禅道bug40205 39709 + * 亮度范围错误值(bug#41208) + * 控制面板-网络链接中,出现没有图标的wifi(bug#41011) + * 控制面板的网络状态在连接有线网络时会显示无网络连接(bug#39788) + + -- zhoubin Thu, 04 Mar 2021 11:47:13 +0800 + +ukui-control-center (3.0.1-1-45) v101; urgency=medium + + * 左侧以及导航栏改版 + * 接入4k屏的情况下,win+p切换模式后,点击控制面板-显示器-显示器区域里的显示器图标,控制面板闪退(bug#39978) + * 低分辨率下屏幕抖动(bug#39432) + + -- zhoubin Mon, 01 Mar 2021 10:29:35 +0800 + +ukui-control-center (3.0.1-1-44) v101; urgency=medium + + * 更改安全中心搜索关键字 + * wayland上面隐藏夜间模式(bug#39271) + * 修改英文用户手册 + * 内核,cpu,内存,硬盘等显示空白;对比麒麟助手显示正常(bug#38847) + * 获取屏幕大小错误(bug#34098) + + -- zhoubin Thu, 25 Feb 2021 09:57:09 +0800 + +ukui-control-center (3.0.1-1-43.20) v101; urgency=medium + + * 解决指定Qt Quick场景图形后端(bug#28609) + + -- zhoubin Sun, 21 Feb 2021 15:15:23 +0800 + +ukui-control-center (3.0.1-1-41.2) v101; urgency=medium + + * 解决平台编译失败问题 + + -- zhoubin Fri, 19 Feb 2021 09:45:38 +0800 + +ukui-control-center (3.0.1-1-40.1) v101; urgency=medium + + * 任务栏WiFi列表显示已经连接,但是控制面板的WiFi列表依然显示无网络连接(bug#38090) + * 不带安全性的WiFi,仍显示上锁(bug#38361) + * 搜索字体显示不全(bug#34565) + * 屏蔽1920x1080且50hz以下分辨率(bug#32123) + + -- zhoubin Sun, 07 Feb 2021 15:27:51 +0800 + +ukui-control-center (3.0.1-1-40) v101; urgency=medium + + * 修复用户手册错别字(bug#38116) + * 夜间模式在loongson上无效(bug#32814) + * 恢复默认透明度(bug#35990) + * 设置副屏在主屏右边(bug#27025) + * 添加自启动程序,设置程序名,添加一个程序后,设置好的程序名被更改(bug#19188) + * 用户手册图片显示不全(bug#35424) + * 在控制面板任务栏搜索安全中心搜索不到设置项(bug#37349) + * 无法添加biometri-manager.desktop文件(bug#37606) + * 解决无法设置镜像模式方向问题(#bug22989) + * 更改夜间模式描述(bug#22278i) + * 更改字体大小为16后,控制面板-安全中心字体没有加粗(bug#35704) + * 英文字体显示不全(bug#30701) + * 更新版本信息(bug#37030) + + -- zhoubin Fri, 05 Feb 2021 15:23:21 +0800 + +ukui-control-center (3.0.1-1-39.4) v101; urgency=medium + + * 云账户信号槽更改 + + -- zhoubin Fri, 29 Jan 2021 19:53:10 +0800 + +ukui-control-center (3.0.1-1-39.3) v101; urgency=medium + + * 更改亮度gsettings + + -- zhoubin Fri, 29 Jan 2021 14:46:17 +0800 + +ukui-control-center (3.0.1-1-39.2) v101; urgency=medium + + * 更新翻译 + + -- zhoubin Thu, 28 Jan 2021 14:47:30 +0800 + +ukui-control-center (3.0.1-1-39.1) v101; urgency=medium + + * 解决跳转编译失败问题 + + -- zhoubin Thu, 28 Jan 2021 14:30:15 +0800 + +ukui-control-center (3.0.1-1-39) v101; urgency=medium + + * 补充通知中心缺失的图标与汉化 + + -- zhoubin Thu, 28 Jan 2021 09:35:08 +0800 + +ukui-control-center (3.0.1-1-38.1) v101; urgency=medium + + * 解决插入耳机时调节不了输出音量的问题(bug#33827) + * 点击主题,关闭再打开透明度的设置,透明度界面先后显示不一致(bug#36029) + * 调节字体大小,个性化和字体两个标题字体大小不变(bug#35705) + * 【控制面板】网络-WiFi图标右下角无“密码”标识(bug#33339) + * 搜索框内搜索更新,出现搜索结果后,无法打出中文(bug#31887) + * 网络连接】点击打开wifi无提示信息(bug#33663) + * 屏蔽低分辨率(bug#35611) + * 输入密码框不输入密码时,通过VNC连接时密码框不输入密码连接失败(bug#32623) + * 【控制面板|时间与日期】设置日期年份为1970年前不生效(bug#29138) + * 点击“打开显示器”后再点击别的选项仍弹出“请确保至少一个屏幕开启(bug#32807) + * 深色主题下对图标反白处理(bug#33945) + * 双屏限制显示器紧靠(bug#32126) + * 亮度未同步变化(bug#28499) + + -- zhoubin Wed, 27 Jan 2021 14:17:40 +0800 + +ukui-control-center (3.0.1-1-38) v101; urgency=medium + + * 修复用户手册控制面板图标缺失 + + -- zhoubin Tue, 19 Jan 2021 10:05:18 +0800 + +ukui-control-center (3.0.1-1-37) v101; urgency=medium + + * 补充用户手册控制面板图标 + + -- zhoubin Mon, 18 Jan 2021 20:59:40 +0800 + +ukui-control-center (3.0.1-1-36) v101; urgency=medium + + * 增加蓝牙gsettings判断 + * 补充用户手册控制面板图标 + + -- zhoubin Mon, 18 Jan 2021 15:31:29 +0800 + +ukui-control-center (3.0.1-1-35) v101; urgency=medium + + * 连接投影仪,点击统一输出,控制面板闪退(bug#32309) + * 属性-网络-桌面共享-安全-要求输入此密码类项置灰(bug#33665) + * 密码最大长度为8(bug#32624) + * 托盘图标设置,显示和其他样式不一致(bug#23520) + * 切换当前区域后,区域格式的日期显示与任务栏的不一致(bug#33732) + * 特效模式关闭的情况下,点击恢复默认设置按钮,无法恢复到默认设置(bug#33871) + * 任务栏切换到夜间模式,打开控制面板主题,系统主题勾选已无(bug#33854) + * 更新界面中,关于安全中心的相关模块没有更新(bug#33465) + * 语言显示错误(bug#33697) + * 提示应用显示分辨率弹出内容文字显示错误(bug#33630) + * 系统进入空闲时间达到时间关闭显示器,设置位30分钟,重启控制面板设置变为平衡模式(bug#31101) + * 更改内存描述单位GIB为GB(bug#28848) + * QLabel更改为QTextEdit控件避免显示不全(bug#28170) + * 添加跳转到用户手册跳转到控制面板参数(bug#33341) + * 右键桌面中间部分选择设置壁纸,大概率会闪出一个半透明的右键菜单(bug#21586) + * 显示设置界面更改配置,点击应用后,弹出的提示窗口上下高度会动态收缩一次(bug#31405) + * 控制面板无法打开,top查看CPU占用率100%(bug#32164) + * 可用大小内存显示错误(bug#30880) + + -- zhoubin Sat, 16 Jan 2021 17:31:36 +0800 + +ukui-control-center (3.0.1-1-34) v101; urgency=medium + + * 首次打开控制面板-电源统计开关,控制面板闪退(bug#31081) + * 控制面板点击备份和还原无法打开备份还原工具(bug#31398) + * 增加标题栏关于入口 + * 个性化中的桌面的麒麟截图和蓝牙没有图标(bug#30918) + * 显示托盘上图标设置,电源管理和蓝牙设置与实际显示相反(bug#30913) + * 【控制面板】控制面板搜索“升级”无结果(bug#31090) + * 由高到低排序wifi强度(bug#31277) + * 时间未到进入夜间模式(bug#22276) + + -- zhoubin Fri, 08 Jan 2021 14:03:51 +0800 + +ukui-control-center (3.0.1-1-31) v101; urgency=medium + + * 退出更新管理器段错误问题 + * 修改其他用户的头像后,当前用户的头像也被修改 + * 被vnc远程连接后,断开连接,杀掉vncserver进程,打开控制面板->显示器,控制面板闪退 + + -- zhoubin Wed, 30 Dec 2020 17:47:26 +0800 + +ukui-control-center (3.0.1-1-30) v101; urgency=medium + + * 解决important为空奔溃问题 + + -- lijiang (rain) Mon, 28 Dec 2020 20:16:39 +0800 + +ukui-control-center (3.0.1-1-29) v101; urgency=medium + + * 添加升级跳转 + + -- zhoubin Mon, 28 Dec 2020 20:16:39 +0800 + +ukui-control-center (3.0.1-1-28) v101; urgency=medium + + * 添加触摸屏功能 + + -- zhoubin Mon, 28 Dec 2020 18:30:40 +0800 + +ukui-control-center (3.0.1-1-27) v101; urgency=medium + + * 首次打开控制面板-设备-声音,将提示音开关打开,调节提示音后控制面板闪 + * 设置夜间模式成功后再次点击应用,系统恢复正常模式,回到桌面后变回夜间模式 + * 设置要求用户输入此密码不生效,vnc不输入密码即可访问 + * 增加第一次是否为镜像模式判断 + * 安装系统后,首次添加自启动程序无反应 + * 关闭主屏幕再打开时候闪退问题 + * 标题水平对齐 + * 同步win+p镜像模式 && 屏幕设置无法保存 + * 密码输入框置灰色 + * 添加蓝牙不存在时隐藏判断 + + -- zhoubin Mon, 28 Dec 2020 15:40:46 +0800 + +ukui-control-center (3.0.1-1-26) v101; urgency=medium + + * 添加应用窗口图标 + * 修复云账户搜索无法跳转 + * 修复切换字体为华文新魏,字体大小界面出现重叠 + * 修复主题图标只有一套问题 + * 添加低电量执行操作行为 + * 修复系统亮度剩余20%,控制面板亮度显示为0% + * 修复首次登录打开侧面通知拦,点击顶部设置按钮,打开控制面板,关闭通知按钮,控制面板闪退 + * 修复切换到1152*864分辨率后应用,系统黑屏并显示NO SUPPORT,无法进去系统桌面,重启后也无法进入 + * 添加电源按键功能 + * 修复开始菜单-控制面板-通知和操作,多次点击后电源统计图标出现蓝色框 + + + -- zhoubin Mon, 21 Dec 2020 16:52:24 +0800 + +ukui-control-center (3.0.1-1-25) v101; urgency=medium + + * 修复电源管理布局异常问题 + + -- zhoubin Fri, 11 Dec 2020 10:52:56 +0800 + +ukui-control-center (3.0.1-1-24) v101; urgency=medium + + * 修复密码校验未生效(包含用户名、相似性) + * 修复开始菜单-控制面板-个性化-背景,在背景没加载完成的时候通过鼠标下拉,会出现大量空白 + * 修复mouse whee事件无法调整透明度 + * 修复双屏接入4k屏后,关闭4k屏后再打开,概率性出现屏幕重叠 + + -- zhoubin Thu, 10 Dec 2020 15:00:32 +0800 + +ukui-control-center (3.0.0-1) unstable; urgency=medium + + * New upstream release. + + -- handsome_feng Thu, 30 Jul 2020 11:43:51 +0000 + +ukui-control-center (2.0.5-1) unstable; urgency=medium + + * New upstream release. (Closes: #964606) + * debian/control: + - Add libmatemixer-dev, qtmultimedia5-dev, libxml2-dev, qtbase5-dev, + libcanberra-dev to Build-Depends. + - Add qml-module-qtgraphicaleffects, edid-decode to Depends. + - Move edid-decode from Recommends to Depends. + + -- handsome_feng Sun, 12 Jul 2020 18:22:09 +0800 + +ukui-control-center (2.0.4-1) unstable; urgency=medium + + * New upstream bugfix release: + - Add judgement for gsettings to avoid crash. + - Add judgement for FormatsLocale to avoid crash. + + -- handsome_feng Tue, 07 Apr 2020 16:08:40 +0800 + +ukui-control-center (2.0.3-1) unstable; urgency=medium + + * New upstream bugfix release: + - Fix the wrong return value of QGsettings. + - Fix that failed to reset the theme. + - Fix the error when open display module. + - Fix that the settings been reset on multi-screen. + - Fix that the user information display incomplete. + - Fix a memory leak. + - Remove the useless component. + - Fix that can't switch to the submodule when it already opened. + - Fix the wrong default value of power plan. + - Avoid crash when set default app. + - Fix the error when create user. + - Fix the spelling errors in zh_CN.ts. + - Fix that the function of adjust brightness didn't work. + - Fix the error when set shortcuts. + - Fix the error when the path of background contains chinese. + * debian/control: + - Add qml-module-qtquick-controls to depends. (LP: #1870934) + - Remove the unused build-depends libdbus-glib-1-dev. + (Closes: #955851) + + -- handsome_feng Tue, 07 Apr 2020 00:13:01 +0800 + +ukui-control-center (2.0.2-1) unstable; urgency=medium + + * New upstream bugfix release: + - Avoid crash when adjust the fonts and proxy. + - Fix that failed to create new user. + - Fix the memory leak in wallpaper module. + - Fix the segfault when delete gsettings. + * debian/control: + - Add build dependencies: edid-decode redshift. + + -- handsome_feng Mon, 30 Mar 2020 20:40:57 +0800 + +ukui-control-center (2.0.1.1-1) unstable; urgency=medium + + [ He Bing ] + * New upstream release. + - Migrate from gtk3.0 to Qt5. + + [ handsome_feng ] + * Debian: + - Bump standard version to 4.5.0. + - Bump compat level to 12. + - Set Rules-Requires-Root to no. + - Refresh the depends and suggests. + + -- handsome_feng Sat, 21 Mar 2020 17:43:39 +0800 + +ukui-control-center (1.1.6-2) unstable; urgency=medium + + * Debian/control: + + Drop gnome-control-center-face. (Closes: #911061) + + -- handsome_feng Wed, 17 Oct 2018 14:04:33 +0800 + +ukui-control-center (1.1.6-1) unstable; urgency=medium + + * Change background-image when theme changed. + * Add theme settings page. + + -- handsome_feng Tue, 25 Sep 2018 11:15:48 +0800 + +ukui-control-center (1.1.5-0ubuntu1) cosmic; urgency=medium + + * Didn't show 'Sleep' when can't hibernate. (LP: #1762119) + + -- handsome_feng Sun, 23 Sep 2018 12:53:01 +0800 + +ukui-control-center (1.1.4-0ubuntu1) cosmic; urgency=medium + + * Adjust the width of the wallpaper layout. (LP: #1766506) + * Drop liboobs. (Closes: #888672) + + -- handsome_feng Tue, 10 Jul 2018 09:48:14 +0800 + +ukui-control-center (1.1.3-0ubuntu1) bionic; urgency=medium + + * Fix that user icon is incomplete when creating user. + * Fix that the default browser does not work. + + -- handsome_feng Wed, 18 Apr 2018 17:23:34 +0800 + +ukui-control-center (1.1.2-0ubuntu1) bionic; urgency=medium + + * Fix the issue that user icon can't be selected. (LP: #1755408) + * Highlight current selected font. + + -- handsome_feng Thu, 12 Apr 2018 19:35:12 +0800 + +ukui-control-center (1.1.1-0ubuntu1) bionic; urgency=medium + + * Adapt the ukwm windowmanager. + * Add brightness adjustment options. + * Only open one window at the same time. (LP: #1682134) + * Adjust the user-account's layout. (LP: #1755423) + * Fix error when adding launguage layout. (LP: #1755636) + * Remove some low resolution. (LP: #1755650) + * Fix the problem that can't preview screensavers. (LP: #1724156) + + -- handsome_feng Sat, 17 Mar 2018 16:17:33 +0800 + +ukui-control-center (1.1.0-0ubuntu1) bionic; urgency=medium + + * Update API of ukui-menus. + * Use GApplication to rewrite the command-line parameter. + * Update the shell/ukcc.css. + + -- handsome_feng Wed, 28 Feb 2018 14:10:06 +0800 + +ukui-control-center (1.0.4-0ubuntu1) artful; urgency=medium + + * Adjust the whole layout. + * Update translation. + * Update the icons. + * Add the page of screensaver-settings. + + -- handsome_feng Wed, 13 Sep 2017 11:31:55 +0800 +ukui-control-center (1.0.3-2) unstable; urgency=medium + + * Use tracker.d.o team address (Closes: #899844) + + -- Aron Xu Mon, 09 Jul 2018 14:40:01 +0800 + +ukui-control-center (1.0.3-1) unstable; urgency=medium + + * Initial release (Closes: #872964) + + -- Aron Xu Sat, 26 Aug 2017 09:58:32 +0800 diff --git a/debian/control b/debian/control index 1f17cfa..5a8dfcf 100644 --- a/debian/control +++ b/debian/control @@ -40,6 +40,7 @@ Build-Depends: debhelper-compat (= 12), libkysdk-qtwidgets-dev(>=1.0.0kylin12+0429), libkysdk-sysinfo-dev, libkysdk-waylandhelper-dev, + libkysdk-diagnostics-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/ukui-control-center diff --git a/debian/libukcc3.postinst b/debian/libukcc3.postinst new file mode 100755 index 0000000..61fc5db --- /dev/null +++ b/debian/libukcc3.postinst @@ -0,0 +1,5 @@ +is_hwe=$(cat /etc/kylin-build | grep "V10-SP1-hwe") +file_path="/usr/lib/x86_64-linux-gnu/libukcc.so.1.0.0.old" +if [ -f /usr/sbin/kysec_get ] && [ -n "${is_hwe}" ] && [ -f $file_path ];then + kysec_set -n exectl -v verified $file_path +fi diff --git a/debian/libukcc3.preinst b/debian/libukcc3.preinst index 33b9fa6..4a0b36f 100644 --- a/debian/libukcc3.preinst +++ b/debian/libukcc3.preinst @@ -1,5 +1,5 @@ #!/bin/bash - + set -e path="/usr/lib/`/usr/bin/dpkg-architecture -qDEB_TARGET_MULTIARCH`/libukcc.so.1.0.0" diff --git a/debian/ukui-control-center.install b/debian/ukui-control-center.install index b074945..bdbaecf 100644 --- a/debian/ukui-control-center.install +++ b/debian/ukui-control-center.install @@ -1,6 +1,5 @@ etc/dbus-1/system.d/* etc/pam.d/* -lib/systemd/system/* usr/bin/* usr/share/applications/* usr/share/dbus-1/services/* @@ -12,6 +11,7 @@ usr/share/kylin-user-guide/data/guide/ukui-control-center/zh_CN/image/* usr/share/kylin-user-guide/data/guide/ukui-control-center/zh_CN/* usr/share/kylin-user-guide/data/guide/ukui-control-center/* usr/share/locale/zh_CN/LC_MESSAGES/* +usr/share/locale/bo_CN/LC_MESSAGES/* usr/share/polkit-1/actions/* usr/share/ukui/faces/* usr/share/ukui-control-center/shell/res/i18n/* diff --git a/env.pri b/env.pri index 919aafc..618cab6 100644 --- a/env.pri +++ b/env.pri @@ -1,7 +1,5 @@ PROJECT_ROOTDIR = $$PWD PROJECT_COMPONENTLIBS = $$PWD/cclibs -PLUGIN_INSTALL_DIRS = $$[QT_INSTALL_LIBS]/ukui-control-center -DEFINES += SP2 - -INCLUDEPATH = ./libukcc -include(./libukcc/widgets.pri) +PLUGIN_INSTALL_DIRS = $$[QT_INSTALL_LIBS]/ukui-control-center +PLUGIN_INSTALL_UPDATE = $$[QT_INSTALL_LIBS]/ukui-control-center/V2.0 +DEFINES += SP2 BUILD_NO_SPLICE_SCREEN OPENKYLIN diff --git a/group-manager-server/conf/org.ukui.groupmanager.policy b/group-manager-server/conf/org.ukui.groupmanager.policy index 7aaae66..4075317 100644 --- a/group-manager-server/conf/org.ukui.groupmanager.policy +++ b/group-manager-server/conf/org.ukui.groupmanager.policy @@ -10,8 +10,10 @@ group tools 用户组 + སྤྱོད་མཁན་ཚོ་ To add the group, you need to authenticate. 添加用户组需要认证 + དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲོད་དགོས་། auth_admin auth_admin @@ -21,8 +23,10 @@ group tools 用户组 + སྤྱད་མཁན་ཚོ་ To edit the group, you need to authenticate. 修改用户组需要认证 + དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་དགོས་། auth_admin auth_admin @@ -32,8 +36,10 @@ group tools 用户组 + སྤྱད་མཁན་ཚོ་ To delete the group, you need to authenticate. 删除用户组需要认证 + དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་དགོས་། auth_admin auth_admin diff --git a/group-manager-server/conf/org.ukui.groupmanager.service b/group-manager-server/conf/org.ukui.groupmanager.service new file mode 100644 index 0000000..2fb6a2b --- /dev/null +++ b/group-manager-server/conf/org.ukui.groupmanager.service @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.ukui.groupmanager +Exec=/usr/bin/group-manager-server +User=root diff --git a/group-manager-server/group-manager-server.pro b/group-manager-server/group-manager-server.pro index 2eec263..c6c8b87 100644 --- a/group-manager-server/group-manager-server.pro +++ b/group-manager-server/group-manager-server.pro @@ -18,6 +18,8 @@ DEFINES += QT_DEPRECATED_WARNINGS DBUS_ADAPTORS += org.ukui.groupmanager.xml DBUS_INTERFACES += org.ukui.groupmanager.xml +LIBS += -L$$[QT_INSTALL_LIBS] -lpolkit-qt5-core-1 + HEADERS += \ custom_struct.h \ group_manager_server.h @@ -32,8 +34,8 @@ dbus_conf.path = /etc/dbus-1/system.d dbus_conf.files += conf/org.ukui.groupmanager.conf INSTALLS += dbus_conf -systemd_service.path = /lib/systemd/system -systemd_service.files += conf/ukui-group-manager.service +systemd_service.path = /usr/share/dbus-1/system-services/ +systemd_service.files += conf/org.ukui.groupmanager.service INSTALLS += systemd_service polkit.path = /usr/share/polkit-1/actions/ diff --git a/group-manager-server/group_manager_server.cpp b/group-manager-server/group_manager_server.cpp index 974ef68..060f35c 100644 --- a/group-manager-server/group_manager_server.cpp +++ b/group-manager-server/group_manager_server.cpp @@ -19,12 +19,33 @@ #include "group_manager_server.h" #include "custom_struct.h" #include +#include +#include +#include group_manager_server::group_manager_server() + : QDBusContext() { } +bool group_manager_server::setAuth(bool auth) +{ + if (authoriy) { + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = QDBusContext::message(); + + if (!authoriyEdit(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + } + + authoriy = auth; + + return true; +} + // 解析组文件 QVariantList group_manager_server::getGroup() { @@ -97,6 +118,14 @@ QVariantList group_manager_server::getPasswd() // 添加组 bool group_manager_server::add(QString groupName, QString groupId) { + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = QDBusContext::message(); + + if (!authoriyEdit(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + QString groupadd = "/usr/sbin/groupadd"; QString addgroup = "/usr/sbin/addgroup"; QString command; @@ -132,6 +161,16 @@ bool group_manager_server::add(QString groupName, QString groupId) // 修改组 bool group_manager_server::set(QString groupName, QString groupId) { + if (authoriy) { + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = QDBusContext::message(); + + if (!authoriyEdit(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + } + QString groupmod = "/usr/sbin/groupmod"; QFile groupmodFile(groupmod); QProcess p(0); @@ -155,6 +194,14 @@ bool group_manager_server::set(QString groupName, QString groupId) // 删除组 bool group_manager_server::del(QString groupName) { + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = QDBusContext::message(); + + if (!authoriyEdit(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + QString groupdel = "/usr/sbin/groupdel"; QFile groupdelFile(groupdel); QProcess p(0); @@ -173,7 +220,7 @@ bool group_manager_server::del(QString groupName) } // 添加用户到组 -bool group_manager_server::addUserToGroup(QString groupName, QString userName) +bool group_manager_server::_addUserToGroup(QString groupName, QString userName) { QString usermod = "/usr/sbin/usermod"; QString gpasswd = "/usr/bin/gpasswd"; @@ -208,8 +255,51 @@ bool group_manager_server::addUserToGroup(QString groupName, QString userName) return true; } -// 删除用户从组 -bool group_manager_server::delUserFromGroup(QString groupName, QString userName) +bool group_manager_server::addUserToGroup(QString groupName, QStringList userNameList) +{ + if (authoriy) { + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = QDBusContext::message(); + + if (!authoriyEdit(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + } + + foreach (QString userName,userNameList) { + bool ret = _addUserToGroup(groupName, userName); + if (!ret) { + qDebug() << "adduser " << userName << " to " << groupName << " failed!"; + } + } + return true; +} + +bool group_manager_server::authoriyEdit(qint64 id) +{ + _id = id; + + if (_id == 0) + return false; + + PolkitQt1::Authority::Result result; + + result = PolkitQt1::Authority::instance()->checkAuthorizationSync( + "org.ukui.groupmanager.action.edit", + PolkitQt1::UnixProcessSubject(_id), + PolkitQt1::Authority::AllowUserInteraction); + + if (result == PolkitQt1::Authority::No){ + _id = 0; + return false; + } else { + _id = 0; + return true; + } +} + +bool group_manager_server::_delUserFromGroup(QString groupName, QString userName) { QString gpasswd = "/usr/bin/gpasswd"; QString command; @@ -233,3 +323,25 @@ bool group_manager_server::delUserFromGroup(QString groupName, QString userName) // qDebug() << QString::fromLocal8Bit(p.readAllStandardError()); return true; } + +// 删除用户从组 +bool group_manager_server::delUserFromGroup(QString groupName, QStringList userNameList) +{ + if (authoriy) { + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = QDBusContext::message(); + + if (!authoriyEdit(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + } + + foreach (QString userName,userNameList) { + bool ret = _delUserFromGroup(groupName, userName); + if (!ret) { + qDebug() << "deluser " << userName << " to " << groupName << " failed!"; + } + } + return true; +} diff --git a/group-manager-server/group_manager_server.h b/group-manager-server/group_manager_server.h index 4d78999..f39e574 100644 --- a/group-manager-server/group_manager_server.h +++ b/group-manager-server/group_manager_server.h @@ -22,28 +22,38 @@ #include #include #include +#include +#include #include "custom_struct.h" -class group_manager_server : public QObject +class group_manager_server : public QObject,QDBusContext { Q_OBJECT //定义Interface名称 Q_CLASSINFO("D-Bus Interface", "org.ukui.groupmanager.interface") public: explicit group_manager_server(); + bool authoriyEdit(qint64 id); + +private: + bool _addUserToGroup(QString groupName, QString userName); + bool _delUserFromGroup(QString groupName, QString userName); public slots: + bool setAuth(bool auth); QVariantList getGroup(); QVariantList getPasswd(); bool add(QString groupName, QString groupId); bool set(QString groupName, QString groupId); bool del(QString groupName); - bool addUserToGroup(QString groupName, QString userName); - bool delUserFromGroup(QString groupName, QString userName); + bool addUserToGroup(QString groupName, QStringList userNameList); + bool delUserFromGroup(QString groupName, QStringList userNameList); private: QList value; + qint64 _id = 0; + bool authoriy = true; signals: void message(); diff --git a/group-manager-server/org.ukui.groupmanager.xml b/group-manager-server/org.ukui.groupmanager.xml index fdba6f4..59b89d7 100644 --- a/group-manager-server/org.ukui.groupmanager.xml +++ b/group-manager-server/org.ukui.groupmanager.xml @@ -1,6 +1,10 @@ + + + + @@ -24,12 +28,12 @@ - + - + diff --git a/libukcc/interface.pri b/libukcc/interface.pri index f72e4d7..6015d4e 100644 --- a/libukcc/interface.pri +++ b/libukcc/interface.pri @@ -1,2 +1,11 @@ +INCLUDEPATH += $$PWD $$PWD/interface +QT += dbus + +SOURCES += \ + $$PWD/interface/common.cpp \ + $$PWD/interface/mthread.cpp \ + HEADERS += \ + $$PWD/interface/common.h \ $$PWD/interface/interface.h \ + $$PWD/interface/mthread.h \ diff --git a/libukcc/interface/common.cpp b/libukcc/interface/common.cpp new file mode 100644 index 0000000..958f68e --- /dev/null +++ b/libukcc/interface/common.cpp @@ -0,0 +1,362 @@ +/* -*- 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 "common.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WITHKYSEC +#include +#include +#endif + +Common::Common() +{ +} + +Common::~Common() +{ + +} + +void Common::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 Common::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 Common::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 Common::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 Common::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 Common::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 Common::isWayland() { + QString sessionType = getenv("XDG_SESSION_TYPE"); + + if (!sessionType.compare("wayland", Qt::CaseSensitive)) { + return true; + } else { + return false; + } +} + +bool Common::isOpenkylin() +{ + QString systemName = QString(QLatin1String(kdk_system_get_systemName())); + if (systemName.compare("openkylin", Qt::CaseInsensitive) == 0) { + return true; + } + return false; +} + +bool Common::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 Common::sizeOnCursor() +{ + QDesktopWidget* m = QApplication::desktop(); + QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos())); + return desk_rect; +} + +bool Common::isTablet() +{ + QString projectName = QString(QLatin1String(kdk_system_get_projectSubName())); + + if (projectName.compare("mavis", Qt::CaseInsensitive) == 0) { + return true; + } + return false; +} + +bool Common::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 Common::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 Common::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 Common::buriedSettings(QString pluginName, QString settingsName, QString action, QString value) +{ +#ifdef SP2 + // 埋点数据 + char appName[] = "ukui-control-center"; + QString message; + if (settingsName != nullptr) { + message = pluginName + "/" + settingsName; + } else { + message = pluginName; + } + QByteArray ba = message.toLatin1(); + char *messageType = ba.data(); + KBuriedPoint pt[2]; + pt[0].key = "action"; + std::string str = action.toStdString(); + pt[0].value = str.c_str(); + + pt[1].key = "value"; + std::string valueStr = value.toStdString(); + pt[1].value = valueStr.c_str(); + + if (kdk_buried_point(appName , messageType , pt , 2)) { + qDebug() << __FUNCTION__ << "messageType:" << message << "action:" << action << "value:" << value << "buried point fail !" << __LINE__; + return false; + } +#endif + + return true; +} + +QString Common::boolToString(bool b) +{ + if (b) { + return QString("true"); + } else { + return QString("false"); + } +} + +QString Common::getUkccVersion() +{ + FILE *pp = NULL; + char *line = NULL; + size_t len = 0; + ssize_t read; + char *q = NULL; + QString version = "none"; + + pp = popen("dpkg -l ukui-control-center | grep ukui-control-center", "r"); + if(NULL == pp) + return version; + + while((read = getline(&line, &len, pp)) != -1){ + q = strrchr(line, '\n'); + *q = '\0'; + + QString content = line; + QStringList list = content.split(" "); + + list.removeAll(""); + + if (list.size() >= 3) + version = list.at(2); + } + + free(line); + line = NULL; + pclose(pp); + return version; +} diff --git a/libukcc/interface/common.h b/libukcc/interface/common.h new file mode 100644 index 0000000..006276c --- /dev/null +++ b/libukcc/interface/common.h @@ -0,0 +1,169 @@ +/* -*- 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 COMMON_H +#define COMMON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libukcc_global.h" + +/** + * @brief 提供判断、获取信息等功能性接口 + * + */ +class LIBUKCC_EXPORT Common : public QObject +{ + Q_OBJECT +public: + /** + * @brief + * + */ + explicit Common(); + /** + * @brief + * + */ + ~Common(); + +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(); + +}; +#endif // COMMON_H diff --git a/libukcc/interface/interface.h b/libukcc/interface/interface.h index 1930997..3a1e814 100644 --- a/libukcc/interface/interface.h +++ b/libukcc/interface/interface.h @@ -29,6 +29,10 @@ class QString; class QWidget; class QStringLiteral; +/** + * @brief 各插件类型 + * + */ enum FunType { ACCOUNT, SYSTEM, @@ -39,30 +43,88 @@ enum FunType { UPDATE, SECURITY, APPLICATION, - SEARCH_F, + SEARCH_F, + CURRENCY, TOTALMODULES, }; +/** + * @brief 插件类,各插件需继承该类 + * + */ class LIBUKCC_EXPORT CommonInterface{ public: + /** + * @brief + * + */ 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; // 插件是否启用 + /** + * @brief 插件名字 + * + * @return QString + */ + virtual QString plugini18nName() = 0; + /** + * @brief 插件类型 + * + * @return int + */ + virtual int pluginTypes() = 0; + /** + * @brief 插件主界面 + * + * @return QWidget + */ + virtual QWidget * pluginUi() = 0; + /** + * @brief 是否显示在首页 + * + * @return bool + */ + virtual bool isShowOnHomePage() const = 0; + /** + * @brief 图标 + * + * @return QIcon + */ + virtual QIcon icon() const = 0; + /** + * @brief 插件是否启用 + * + * @return bool + */ + virtual bool isEnable() const = 0; + /** + * @brief + * + * @return const QString + */ virtual const QString name() const = 0; // 模块名称 - virtual QString translationPath() const { // 获取多语言文件路径,用于搜索 + /** + * @brief 获取多语言文件路径,用于搜索 + * + * @return QString + */ + virtual QString translationPath() const { return QStringLiteral(":/i18n/%1.ts"); } - QPushButton *pluginBtn = nullptr; + QPushButton *pluginBtn = nullptr; /**< TODO: describe */ + /** + * @brief 是否莱卡 Intel 教育定制项目 + * + * @return bool + */ bool isIntel(){ QString sysVersion = "/etc/apt/ota_version"; QFile file(sysVersion); return file.exists(); } + /** + * @brief 离开插件界面时的操作 eg:离开蓝牙界面停止扫描 + * + */ virtual void plugin_leave() { return ; } diff --git a/libukcc/interface/mthread.cpp b/libukcc/interface/mthread.cpp new file mode 100644 index 0000000..ca31ed5 --- /dev/null +++ b/libukcc/interface/mthread.cpp @@ -0,0 +1,42 @@ +#include "mthread.h" +#include +#include +#include + +MThread::MThread(QObject *parent) : QObject(parent) +{ + +} + +MThread::~MThread() +{ + +} + +void MThread::run() +{ + qDebug() << QThread::currentThreadId(); + QTime timedebuge;//声明一个时钟对象 + timedebuge.start();//开始计时 + m_cloudInterface = new QDBusInterface("org.kylinssoclient.dbus", + "/org/kylinssoclient/path", + "org.freedesktop.kylinssoclient.interface", + QDBusConnection::sessionBus()); + if (!m_cloudInterface->isValid()) { + qDebug() << "fail to connect to service"; + qDebug() << qPrintable(QDBusConnection::systemBus().lastError().message()); + return; + } + QDBusConnection::sessionBus().connect(QString(), QString("/org/kylinssoclient/path"), + QString( + "org.freedesktop.kylinssoclient.interface"), "keyChanged", this, + SLOT(keychanged(QString))); + // 将以后所有DBus调用的超时设置为 milliseconds + m_cloudInterface->setTimeout(2147483647); // -1 为默认的25s超时 + qDebug()<<"NetWorkAcount"<<" 线程耗时: "< +#include +#include +#include "libukcc_global.h" + +class LIBUKCC_EXPORT MThread : public QObject +{ + Q_OBJECT +public: + explicit MThread(QObject *parent = nullptr); + ~MThread(); + + void run(); + +private: + QDBusInterface *m_cloudInterface; + +public slots: + void keychanged(QString str); + +Q_SIGNALS: + void keychangedsignal(QString str); +}; + +#endif // MTHREAD_H diff --git a/libukcc/libukcc.pro b/libukcc/libukcc.pro index 0532757..5beaf7d 100644 --- a/libukcc/libukcc.pro +++ b/libukcc/libukcc.pro @@ -1,10 +1,17 @@ -QT += widgets +QT += core widgets dbus TARGET = ukcc TEMPLATE = lib DEFINES += LIBUKCC_LIBRARY -CONFIG += c++11 +CONFIG += link_pkgconfig \ + c++11 + +PKGCONFIG += gio-2.0 \ + gio-unix-2.0 \ + kysdk-qtwidgets \ + kysdk-diagnostics \ + kysdk-sysinfo \ include(interface.pri) include(widgets.pri) @@ -19,7 +26,6 @@ DEFINES += QT_DEPRECATED_WARNINGS # 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 += HEADERS += \ @@ -35,7 +41,7 @@ unix { widgets/FlowLayout/*.h widgets/Frame/*.h widgets/HoverBtn/*.h \ widgets/HoverWidget/*.h widgets/ImageUtil/*.h widgets/InfoButton/*.h \ widgets/Label/*.h widgets/ListDelegate/*.h widgets/MaskWidget/*.h \ - widgets/Uslider/*.h *.h + widgets/Uslider/*.h widgets/SettingWidget/*.h *.h interfaces.path = /usr/include/ukcc/interface interfaces.files = *.h interface/*.h diff --git a/libukcc/plugin-test/ukccplugin.cpp b/libukcc/plugin-test/ukccplugin.cpp index 808b499..cccefcc 100644 --- a/libukcc/plugin-test/ukccplugin.cpp +++ b/libukcc/plugin-test/ukccplugin.cpp @@ -1,6 +1,14 @@ #include "ukccplugin.h" #include +#include +#include +#include +#include +#include +#include +#include + UkccPlugin::UkccPlugin() : mFirstLoad(true) { @@ -33,6 +41,8 @@ QWidget *UkccPlugin::pluginUi() if (mFirstLoad) { widget = new QWidget; mFirstLoad = false; + + settingWidgetTest(); } return widget; } @@ -70,3 +80,90 @@ void UkccPlugin::initSearchText() tr("ukccplugin test"); } +void UkccPlugin::settingWidgetTest() +{ + QVBoxLayout *Vlayout = new QVBoxLayout(this->widget); + Vlayout->setContentsMargins(0, 0, 0, 0); + + SettingGroup *settingGroup = new SettingGroup(); + + // test ComboxWidget + ComboxWidget *comboxWidgetTest = new ComboxWidget(tr("test for ComboxWidget")); + comboxWidgetTest->setObjectName("test ComboxWidget"); + qDebug() << "title = " << comboxWidgetTest->title(); + comboxWidgetTest->setTitleFixedWidth(220);; + comboxWidgetTest->setCurrentText(tr("test 0")); + comboxWidgetTest->comboBox()->insertItem(1, tr("test 1")); + comboxWidgetTest->setCurrentIndex(0); + comboxWidgetTest->installEventFilter(this); + connect(comboxWidgetTest, &ComboxWidget::currentIndexChanged, this, [=](int index){ + qDebug() << "IndexChanged, index = " << index; + }); + + connect(comboxWidgetTest, &ComboxWidget::currentTextChanged, this, [=](QString text){ + qDebug() << "TextChanged, text = " << text; + }); + + // test LineEditWidget + LineEditWidget *lineEditWidgetTest = new LineEditWidget(tr("test for LineEditWidget"), settingGroup, UkccFrame::None); + lineEditWidgetTest->setTitleFixedWidth(220); + lineEditWidgetTest->setObjectName("test LineEditWidget"); + qDebug() << "title = " << lineEditWidgetTest->title(); + + connect(lineEditWidgetTest->lineEdit(), &QLineEdit::textEdited, this, [=](QString text){ + qDebug() << "LineEditWidget textEdited, text = " << text; + }); + + // test PushButtonWidget + PushButtonWidget *pushButtonWidgetTest = new PushButtonWidget(tr("test for PushButtonWidget")); + pushButtonWidgetTest->setButtonText(tr("button text")); + pushButtonWidgetTest->setButtonFixedWidth(200); + pushButtonWidgetTest->setTitleFixedWidth(108); + connect(pushButtonWidgetTest, &PushButtonWidget::clicked, this, [=](bool checked){ + qDebug() << "PushButtonWidget clicked " << checked; + }); + + // test RadioButtonWidget + RadioButtonWidget *radioButtonWidgetTest = new RadioButtonWidget(tr("test for PushButtonWidget")); + QRadioButton *leftRadio = new QRadioButton(tr("Left")); + QRadioButton *rightRadio = new QRadioButton(tr("Right")); + radioButtonWidgetTest->addButton(leftRadio, 0); + radioButtonWidgetTest->addButton(rightRadio, 1, true); + radioButtonWidgetTest->setButtonSpacing(24); + + connect(radioButtonWidgetTest, &RadioButtonWidget::buttonClicked, this, [=](int id){ + qDebug() << "RadioButtonWidget buttonClicked, id = " << id; + }); + + // test SliderWidget + SliderWidget *sliderWidgetTest = new SliderWidget(tr("test for SliderWidget"), true, settingGroup); + sliderWidgetTest->setLeftPixmap(QIcon::fromTheme("document-edit-symbolic").pixmap(sliderWidgetTest->leftLabel()->size())); + sliderWidgetTest->setRightText(tr("Fast")); + sliderWidgetTest->slider()->setSliderType(KSliderType::NodeSlider); + sliderWidgetTest->slider()->setRange(1,10); + sliderWidgetTest->slider()->setTickInterval(1); + sliderWidgetTest->slider()->setPageStep(1); + sliderWidgetTest->slider()->installEventFilter(this); + connect(sliderWidgetTest, &SliderWidget::valueChanged, this, [=](int value){ + qDebug() << "SliderWidget valueChanged, value = " << value; + }); + + // test + SwitchWidget *switchWidgetTest = new SwitchWidget(tr("test for SwitchWidget")); + QPushButton *button = new QPushButton(tr("QPushButton")); + switchWidgetTest->insertWidget(switchWidgetTest->layout()->count()-1, button); + connect(switchWidgetTest, &SwitchWidget::stateChanged, this, [=](bool checked){ + qDebug() << "SwitchWidget clicked " << checked; + }); + + settingGroup->addWidget(comboxWidgetTest); + settingGroup->addWidget(lineEditWidgetTest); + settingGroup->addWidget(pushButtonWidgetTest); + settingGroup->addWidget(radioButtonWidgetTest); + settingGroup->insertWidget(0,switchWidgetTest); + + Vlayout->addWidget(settingGroup); + Vlayout->addStretch(); + +} + diff --git a/libukcc/plugin-test/ukccplugin.h b/libukcc/plugin-test/ukccplugin.h index eae4e90..b141e9d 100644 --- a/libukcc/plugin-test/ukccplugin.h +++ b/libukcc/plugin-test/ukccplugin.h @@ -38,6 +38,8 @@ private: private: void initSearchText(); // 搜索翻译 + + void settingWidgetTest(); // settingWidget demo }; #endif // UKCCPLUGIN_H diff --git a/libukcc/widgets.pri b/libukcc/widgets.pri index ed564ce..355c0b2 100644 --- a/libukcc/widgets.pri +++ b/libukcc/widgets.pri @@ -16,4 +16,5 @@ include(widgets/ListDelegate/listdelegate.pri) include(widgets/MaskWidget/maskwidget.pri) include(widgets/SwitchButton/switchbutton.pri) include(widgets/Uslider/uslider.pri) +include(widgets/SettingWidget/settingwidget.pri) diff --git a/libukcc/widgets/AddBtn/addbtn.cpp b/libukcc/widgets/AddBtn/addbtn.cpp index 985c677..0388985 100644 --- a/libukcc/widgets/AddBtn/addbtn.cpp +++ b/libukcc/widgets/AddBtn/addbtn.cpp @@ -6,10 +6,15 @@ #include #include +#define TOP_LEFT_CORNER 1 +#define TOP_RIGHT_CORNER 2 +#define BOTTOM_RIGHT_CORNER 4 +#define BOTTOM_LEFT_CORNER 8 + AddBtn::AddBtn(QWidget *parent): QPushButton(parent) { - this->setObjectName("this"); + this->setObjectName("AddBtn"); this->setMinimumSize(QSize(580, 60)); this->setMaximumSize(QSize(16777215, 60)); this->setBtnStyle(Box); @@ -61,26 +66,71 @@ void AddBtn::enterEvent(QEvent *event){ QPushButton::enterEvent(event); } +void AddBtn::paintEvent(QPaintEvent *event) +{ + QPainter p(this); + p.setRenderHint(QPainter::Antialiasing, true); + p.setClipping(true); + p.setPen(Qt::transparent); + QPalette pal; + p.setBrush(pal.base()); + QPainterPath picPath = makeRoundedRect(this->rect(), 6, mCorner); + p.setClipPath(picPath); + p.drawPath(picPath); + + QPushButton::paintEvent(event); +} + void AddBtn::setBtnStyle(AddBtn::Shape type) { switch (type) { case None: - this->setStyleSheet("AddBtn:!checked:!pressed:!hover{background-color: palette(base);border-rdius: 0px}" - "AddBtn:!checked:!pressed:hover{background-color: palette(button);border-rdius: 0px}"); + mCorner = 0; break; case Top: - this->setStyleSheet("AddBtn:!checked:!pressed:!hover{background-color: palette(base); border-top-left-radius: 6px; border-top-right-radius: 6px;}" - "AddBtn:!checked:!pressed:hover{background-color: palette(button); border-top-left-radius: 6px; border-top-right-radius: 6px;}"); + mCorner = TOP_LEFT_CORNER | TOP_RIGHT_CORNER; break; case Bottom: - this->setStyleSheet("AddBtn:!checked:!pressed:!hover{background-color: palette(base); border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;}" - "AddBtn:!checked:!pressed:hover{background-color: palette(button); border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;}"); + mCorner = BOTTOM_RIGHT_CORNER | BOTTOM_LEFT_CORNER; break; case Box: - this->setStyleSheet( "AddBtn:!checked:!pressed:!hover{background-color: palette(base); border-radius: 6px;}" - "AddBtn:!checked:!pressed:hover{background-color: palette(button); border-radius: 6px;}"); + mCorner = TOP_LEFT_CORNER | TOP_RIGHT_CORNER | BOTTOM_RIGHT_CORNER | BOTTOM_LEFT_CORNER; break; } + repaint(); +} + +QPainterPath AddBtn::makeRoundedRect(const QRect &rect, int radius, int corner) +{ + QPainterPath path; + if(corner & TOP_LEFT_CORNER) { + path.moveTo(rect.x() + radius,rect.y()); + path.arcTo(rect.x(), rect.y(), radius*2, radius*2, 90.f, 90.f);//画左上圆角 + } else { + path.moveTo(rect.x(), rect.y()); + } + + if(corner & BOTTOM_LEFT_CORNER) { + path.lineTo(rect.x(), rect.y() + rect.height() -radius); + path.arcTo(rect.x(), rect.y() + rect.height() - radius *2, radius*2, radius*2, 180.0f, 90.f); + } else { + path.lineTo(rect.x(), rect.y() + rect.height()); + } + + if(corner & BOTTOM_RIGHT_CORNER) { + path.lineTo(rect.x() + rect.width() - radius,rect.y() + rect.height()); + path.arcTo(rect.x() + rect.width() - 2*radius, rect.y() + rect.height() - 2*radius,radius*2, radius*2, 270.0f, 90.f); + } else { + path.lineTo(rect.x()+ rect.width(), rect.y() + rect.height()); + } + + if(corner & TOP_RIGHT_CORNER) { + path.lineTo(rect.x() + rect.width(), rect.y() + radius); + path.arcTo(rect.x() + rect.width() - 2*radius, rect.y(), radius*2,radius*2, 0.f, 90.f); + } else { + path.lineTo(rect.x()+ rect.width(), rect.y()); + } + return path; } void AddBtn::leaveEvent(QEvent *event){ diff --git a/libukcc/widgets/AddBtn/addbtn.h b/libukcc/widgets/AddBtn/addbtn.h index d22bfbf..50fb976 100644 --- a/libukcc/widgets/AddBtn/addbtn.h +++ b/libukcc/widgets/AddBtn/addbtn.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "libukcc_global.h" @@ -25,10 +26,16 @@ public: }; Q_ENUM(Shape) void setBtnStyle(Shape type); + + QPainterPath makeRoundedRect(const QRect& rect,int radius,int corner); protected: - virtual void leaveEvent(QEvent *event); - virtual void enterEvent(QEvent *event); + void leaveEvent(QEvent *event); + void enterEvent(QEvent *event); + void paintEvent(QPaintEvent *event); + +private: + int mCorner = 0; Q_SIGNALS: void enterWidget(); diff --git a/libukcc/widgets/AddBtn/addbtn.pri b/libukcc/widgets/AddBtn/addbtn.pri index a1e3fb8..42fbee0 100644 --- a/libukcc/widgets/AddBtn/addbtn.pri +++ b/libukcc/widgets/AddBtn/addbtn.pri @@ -1,3 +1,4 @@ +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/addbtn.cpp \ diff --git a/libukcc/widgets/Button/button.pri b/libukcc/widgets/Button/button.pri index ded778b..0a28bf4 100644 --- a/libukcc/widgets/Button/button.pri +++ b/libukcc/widgets/Button/button.pri @@ -1,3 +1,4 @@ +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/fixbutton.cpp \ diff --git a/libukcc/widgets/CloseButton/closebutton.pri b/libukcc/widgets/CloseButton/closebutton.pri index 4a4b096..fa52f80 100644 --- a/libukcc/widgets/CloseButton/closebutton.pri +++ b/libukcc/widgets/CloseButton/closebutton.pri @@ -1,4 +1,4 @@ - +INCLUDEPATH += $$PWD #LIBINTERFACE_NAME = $$qtLibraryTarget(switchbutton) SOURCES += \ diff --git a/libukcc/widgets/ComboBox/combobox.pri b/libukcc/widgets/ComboBox/combobox.pri index 3da25a4..dfed143 100644 --- a/libukcc/widgets/ComboBox/combobox.pri +++ b/libukcc/widgets/ComboBox/combobox.pri @@ -1,3 +1,4 @@ +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/combobox.cpp \ $$PWD/comboboxitem.cpp \ diff --git a/libukcc/widgets/ComboxFrame/comboxframe.pri b/libukcc/widgets/ComboxFrame/comboxframe.pri index b7f7ab4..9c0492d 100644 --- a/libukcc/widgets/ComboxFrame/comboxframe.pri +++ b/libukcc/widgets/ComboxFrame/comboxframe.pri @@ -1,5 +1,5 @@ #LIBINTERFACE_NAME = $$qtLibraryTarget(comboxframe) - +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/comboxframe.cpp \ diff --git a/libukcc/widgets/FlowLayout/flowlayout.pri b/libukcc/widgets/FlowLayout/flowlayout.pri index a1e6ec8..c24ab09 100644 --- a/libukcc/widgets/FlowLayout/flowlayout.pri +++ b/libukcc/widgets/FlowLayout/flowlayout.pri @@ -1,4 +1,4 @@ - +INCLUDEPATH += $$PWD #LIBINTERFACE_NAME = $$qtLibraryTarget(flowlayout) SOURCES += \ diff --git a/libukcc/widgets/Frame/frame.pri b/libukcc/widgets/Frame/frame.pri index b1d5db4..09d55dd 100644 --- a/libukcc/widgets/Frame/frame.pri +++ b/libukcc/widgets/Frame/frame.pri @@ -1,3 +1,4 @@ +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/hlineframe.cpp \ diff --git a/libukcc/widgets/HoverBtn/hoverbtn.pri b/libukcc/widgets/HoverBtn/hoverbtn.pri index 55509d1..4d4f7d6 100644 --- a/libukcc/widgets/HoverBtn/hoverbtn.pri +++ b/libukcc/widgets/HoverBtn/hoverbtn.pri @@ -1,4 +1,4 @@ - +INCLUDEPATH += $$PWD #LIBINTERFACE_NAME = $$qtLibraryTarget(hoverbtn) SOURCES += \ diff --git a/libukcc/widgets/HoverWidget/hoverwidget.pri b/libukcc/widgets/HoverWidget/hoverwidget.pri index 8aac743..7088504 100644 --- a/libukcc/widgets/HoverWidget/hoverwidget.pri +++ b/libukcc/widgets/HoverWidget/hoverwidget.pri @@ -1,4 +1,4 @@ - +INCLUDEPATH += $$PWD #LIBINTERFACE_NAME = $$qtLibraryTarget(switchbutton) SOURCES += \ diff --git a/libukcc/widgets/ImageUtil/imageutil.pri b/libukcc/widgets/ImageUtil/imageutil.pri index 9964ccc..ea4f8be 100644 --- a/libukcc/widgets/ImageUtil/imageutil.pri +++ b/libukcc/widgets/ImageUtil/imageutil.pri @@ -1,6 +1,6 @@ #LIBINTERFACE_NAME = $$qtLibraryTarget(imageutil) QT += svg - +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/imageutil.cpp \ diff --git a/libukcc/widgets/InfoButton/infobutton.pri b/libukcc/widgets/InfoButton/infobutton.pri index a307102..ac0027e 100644 --- a/libukcc/widgets/InfoButton/infobutton.pri +++ b/libukcc/widgets/InfoButton/infobutton.pri @@ -1,5 +1,5 @@ #LIBINTERFACE_NAME = $$qtLibraryTarget(infobutton) - +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/infobutton.cpp \ diff --git a/libukcc/widgets/Label/label.pri b/libukcc/widgets/Label/label.pri index afd3fe6..a46f04c 100644 --- a/libukcc/widgets/Label/label.pri +++ b/libukcc/widgets/Label/label.pri @@ -1,3 +1,5 @@ +INCLUDEPATH += $$PWD + SOURCES += \ $$PWD/fixlabel.cpp \ $$PWD/iconlabel.cpp \ @@ -9,5 +11,5 @@ HEADERS += \ $$PWD/iconlabel.h \ $$PWD/lightlabel.h \ $$PWD/titlelabel.h \ - $$PWD/tristatelabel.h + $$PWD/tristatelabel.h \ diff --git a/libukcc/widgets/ListDelegate/listdelegate.pri b/libukcc/widgets/ListDelegate/listdelegate.pri index 665521f..cf79dfc 100644 --- a/libukcc/widgets/ListDelegate/listdelegate.pri +++ b/libukcc/widgets/ListDelegate/listdelegate.pri @@ -1,4 +1,4 @@ - +INCLUDEPATH += $$PWD #LIBINTERFACE_NAME = $$qtLibraryTarget(listdelegate) SOURCES += \ diff --git a/libukcc/widgets/MaskWidget/maskwidget.pri b/libukcc/widgets/MaskWidget/maskwidget.pri index 0fb9734..58a6b5e 100644 --- a/libukcc/widgets/MaskWidget/maskwidget.pri +++ b/libukcc/widgets/MaskWidget/maskwidget.pri @@ -1,4 +1,4 @@ - +INCLUDEPATH += $$PWD #LIBINTERFACE_NAME = $$qtLibraryTarget(maskwidget) SOURCES += \ diff --git a/libukcc/widgets/SettingWidget/addbutton.cpp b/libukcc/widgets/SettingWidget/addbutton.cpp new file mode 100644 index 0000000..861ba51 --- /dev/null +++ b/libukcc/widgets/SettingWidget/addbutton.cpp @@ -0,0 +1,154 @@ +#include "addbutton.h" +#include +#include +#include +#include +#include +#include +#include +#include + +AddButton::AddButton(QWidget *parent, UkccFrame::BorderRadiusStyle style, bool heightAdaptive) + : QPushButton(parent), + m_radiusType(style), + m_heightAdaptive(heightAdaptive) + +{ + this->setObjectName("AddButton"); + this->setProperty("useButtonPalette", true); + this->setFlat(true); + + QHBoxLayout *addLyt = new QHBoxLayout; + + QLabel *iconLabel = new QLabel(); + QLabel *textLabel = new QLabel(tr("Add")); + + QIcon mAddIcon = QIcon::fromTheme("list-add-symbolic"); + iconLabel->setPixmap(mAddIcon.pixmap(mAddIcon.actualSize(QSize(16, 16)))); + iconLabel->setProperty("iconHighlightEffectMode", 1); + + const QByteArray idd(THEME_QT_SCHEMA); + QGSettings *qtSettings = new QGSettings(idd, QByteArray(), this); + QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); + if ("ukui-dark" == currentThemeMode || "ukui-black" == currentThemeMode){ + iconLabel->setProperty("useIconHighlightEffect", true); + } + connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { + if (key == "styleName") { + QString currentThemeMode = qtSettings->get(key).toString(); + if ("ukui-black" == currentThemeMode || "ukui-dark" == currentThemeMode) { + iconLabel->setProperty("useIconHighlightEffect", true); + } else if("ukui-white" == currentThemeMode || "ukui-default" == currentThemeMode) { + iconLabel->setProperty("useIconHighlightEffect", false); + } + } + }); + + m_statusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + if (m_statusSessionDbus->isValid()) { + QDBusReply is_tabletmode = m_statusSessionDbus->call("get_current_tabletmode"); + mode_change_signal_slots(is_tabletmode.isValid() ? is_tabletmode.value() : false); + connect(m_statusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mode_change_signal_slots(bool))); + } else { + mode_change_signal_slots(false); + qWarning() << "Create com.kylin.statusmanager.interface Interface Failed When : " << QDBusConnection::systemBus().lastError(); + } + + addLyt->addStretch(); + addLyt->addWidget(iconLabel); + addLyt->addWidget(textLabel); + addLyt->addStretch(); + this->setLayout(addLyt); + +} + +AddButton::~AddButton() +{ + +} + +void AddButton::mode_change_signal_slots(bool b) +{ + if (m_heightAdaptive) { + if (b) { + this->setMinimumSize(550, TABLET_HEIGHT); + this->setMaximumSize(16777215, TABLET_HEIGHT); + } else { + this->setMinimumSize(550, PC_HEIGHT); + this->setMaximumSize(16777215, PC_HEIGHT); + } + } + m_isTabletMode = b; + Q_EMIT tabletModeChanged(b); +} + +void AddButton::setRadiusType(UkccFrame::BorderRadiusStyle style) +{ + m_radiusType = style; + update(); +} + +void AddButton::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; + painter.setClipping(true); + painter.setPen(Qt::transparent); + painter.setBrush(qApp->palette().base()); + QPainterPath painterPath = getPaintrPath(); + painter.setClipPath(painterPath); + painter.drawPath(painterPath); + + QPushButton::paintEvent(event); +} + + +QPainterPath AddButton::getPaintrPath() +{ + const QRect rect = this->rect(); + int radius = RADIUS_VALUE; + int corner = 0; + + if (m_radiusType == UkccFrame::BorderRadiusStyle::None) { + corner = 0; + } else if (m_radiusType == UkccFrame::BorderRadiusStyle::Top) { + corner = TOP_LEFT_CORNER + TOP_RIGHT_CORNER; + } else if (m_radiusType == UkccFrame::BorderRadiusStyle::Bottom) { + corner = BOTTOM_LEFT_CORNER + BOTTOM_RIGHT_CORNER; + } else { + corner = TOP_LEFT_CORNER + TOP_RIGHT_CORNER + BOTTOM_LEFT_CORNER + BOTTOM_RIGHT_CORNER; + } + + QPainterPath path; + if(corner & TOP_LEFT_CORNER) { + path.moveTo(rect.x() + radius, rect.y()); + path.arcTo(rect.x(), rect.y(), radius * 2, radius * 2, 90.f, 90.f);//画左上圆角 + } else { + path.moveTo(rect.x(), rect.y()); + } + + if(corner & BOTTOM_LEFT_CORNER) { + path.lineTo(rect.x(), rect.y() + rect.height() -radius); + path.arcTo(rect.x(), rect.y() + rect.height() - radius * 2, radius * 2, radius * 2, 180.0f, 90.f); + } else { + path.lineTo(rect.x(), rect.y() + rect.height()); + } + + if(corner & BOTTOM_RIGHT_CORNER) { + path.lineTo(rect.x() + rect.width() - radius,rect.y() + rect.height()); + path.arcTo(rect.x() + rect.width() - 2 * radius, rect.y() + rect.height() - 2 * radius,radius*2, radius * 2, 270.0f, 90.f); + } else { + path.lineTo(rect.x()+ rect.width(), rect.y() + rect.height()); + } + + if(corner & TOP_RIGHT_CORNER) { + path.lineTo(rect.x() + rect.width(), rect.y() + radius); + path.arcTo(rect.x() + rect.width() - 2 * radius, rect.y(), radius * 2, radius * 2, 0.f, 90.f); + } else { + path.lineTo(rect.x()+ rect.width(), rect.y()); + } + return path; +} diff --git a/libukcc/widgets/SettingWidget/addbutton.h b/libukcc/widgets/SettingWidget/addbutton.h new file mode 100644 index 0000000..cda2900 --- /dev/null +++ b/libukcc/widgets/SettingWidget/addbutton.h @@ -0,0 +1,56 @@ +#ifndef ADDBUTTON_H +#define ADDBUTTON_H + +#include +#include +#include +#include +#include + +#include "libukcc_global.h" +#include "ukccframe.h" + +#define TOP_LEFT_CORNER 1 +#define TOP_RIGHT_CORNER 2 +#define BOTTOM_RIGHT_CORNER 4 +#define BOTTOM_LEFT_CORNER 8 +#define THEME_QT_SCHEMA "org.ukui.style" +#define MODE_QT_KEY "style-name" + +class LIBUKCC_EXPORT AddButton : public QPushButton +{ + Q_OBJECT +public: + explicit AddButton(QWidget* parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::BorderRadiusStyle::Bottom, bool heightAdaptive = true); + ~AddButton(); + + void setRadiusType(UkccFrame::BorderRadiusStyle style); + /** + * @brief 获取平板模式 + * + * @return bool 是否是平板模式 + */ + inline bool getTabletMode() + { + return m_isTabletMode; + } +protected: + void paintEvent(QPaintEvent *event); + QPainterPath getPaintrPath(); + +Q_SIGNALS: + void tabletModeChanged(bool b); + +private Q_SLOTS: + void mode_change_signal_slots(bool b); + +private: + UkccFrame::BorderRadiusStyle m_radiusType; + bool m_isTabletMode = false; + QDBusInterface *m_statusSessionDbus = nullptr; + bool m_heightAdaptive = false; + +}; + + +#endif // ADDBUTTON_H diff --git a/libukcc/widgets/SettingWidget/comboxwidget.cpp b/libukcc/widgets/SettingWidget/comboxwidget.cpp new file mode 100644 index 0000000..3f79839 --- /dev/null +++ b/libukcc/widgets/SettingWidget/comboxwidget.cpp @@ -0,0 +1,79 @@ +#include "comboxwidget.h" + +#include + +ComboxWidget::ComboxWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) + : UkccFrame(parent, style, true) +{ + m_settingName = new FixLabel(title, this); + m_combox = new QComboBox(this); + init(); +} + +ComboxWidget::~ComboxWidget() +{ +} + +void ComboxWidget::init() +{ + mainLayout = new QHBoxLayout(); + mainLayout->setContentsMargins(16, 0, 16, 0); + m_settingName->setFixedWidth(214); + mainLayout->addWidget(m_settingName); + mainLayout->setSpacing(16); + mainLayout->addWidget(m_combox); + this->setLayout(mainLayout); + connect(m_combox, QOverload::of(&QComboBox::currentIndexChanged), this, &ComboxWidget::currentIndexChanged); + connect(m_combox, &QComboBox::currentTextChanged, this, &ComboxWidget::currentTextChanged); +} + +void ComboxWidget::setEnabled(const bool checked) +{ + if (m_combox) { + m_combox->setEnabled(checked); + } +} + +bool ComboxWidget::isEnabled() const +{ + return m_combox->isEnabled(); +} + +void ComboxWidget::setTitle(const QString &title) +{ + if (m_settingName) { + m_settingName->setText(title); + } + this->setAccessibleName(title); + m_combox->setAccessibleName(title); +} + +QString ComboxWidget::title() const +{ + if (m_settingName) { + return m_settingName->text(); + } + return QString(); +} + +void ComboxWidget::setCurrentText(const QString &text) +{ + m_combox->setCurrentText(text); +} + +void ComboxWidget::setCurrentIndex(int index) +{ + m_combox->setCurrentIndex(index); +} + +void ComboxWidget::setTitleFixedWidth(int w) +{ + m_settingName->setFixedWidth(w); +} + +QComboBox *ComboxWidget::comboBox() const +{ + return m_combox; +} + + diff --git a/libukcc/widgets/SettingWidget/comboxwidget.h b/libukcc/widgets/SettingWidget/comboxwidget.h new file mode 100644 index 0000000..3dad76f --- /dev/null +++ b/libukcc/widgets/SettingWidget/comboxwidget.h @@ -0,0 +1,115 @@ +#ifndef COMBOXWIDGET_H +#define COMBOXWIDGET_H + +#include +#include +#include + +#include "fixlabel.h" +#include "libukcc_global.h" +#include "ukccframe.h" + +/** + * @brief 创建一个带 QComboBox 的 Frame + * + */ +class LIBUKCC_EXPORT ComboxWidget : public UkccFrame +{ + Q_OBJECT + +public: + /** + * @brief 创建一个带 QComboBox 的 Frame + * + * @param title: text of m_settingName + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + explicit ComboxWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); + /** + * @brief + * + */ + ~ComboxWidget(); + + /** + * @brief 设置 m_combox 是否可选 + * @param checked + */ + void setEnabled(const bool checked = true); + + /** + * @brief m_combox 是否 enabled + * + * @return bool 是:true,否:false + */ + bool isEnabled() const; + + /** + * @brief 设置 m_settingName text + * @param title + */ + void setTitle(const QString &title); + + /** + * @brief 获取 m_settingName text + * @return + */ + QString title() const; + + /** + * @brief 设置 m_settingName label 宽度 + * + * @param w + */ + void setTitleFixedWidth(int w); + + /** + * @brief 设置 QComboBox 当前 text + * + * @param text + */ + void setCurrentText(const QString &text); + + /** + * @brief 设置 QComboBox 当前 index + * + * @param index + */ + void setCurrentIndex(int index); + + /** + * @brief 获取 m_combox + * + * @return QComboBox: m_combox + */ + QComboBox *comboBox() const; + +private: + void init(); + + QHBoxLayout *mainLayout; + FixLabel *m_settingName; + QComboBox *m_combox; + + +private Q_SLOTS: + +Q_SIGNALS: + /** + * @brief QComboBox 当前 index 改变信号 + * + * @param index + */ + void currentIndexChanged(int index); + + /** + * @brief QComboBox 当前 text 改变信号 + * + * @param index + */ + void currentTextChanged(const QString &text); + +}; + +#endif // COMBOXWIDGET_H diff --git a/libukcc/widgets/SettingWidget/lineeditwidget.cpp b/libukcc/widgets/SettingWidget/lineeditwidget.cpp new file mode 100644 index 0000000..f3c4688 --- /dev/null +++ b/libukcc/widgets/SettingWidget/lineeditwidget.cpp @@ -0,0 +1,65 @@ +#include "lineeditwidget.h" + +#include + +LineEditWidget::LineEditWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) + : UkccFrame(parent, style, true) +{ + m_settingName = new FixLabel(title, this); + m_lineEdit = new QLineEdit(this); + init(); +} + +LineEditWidget::~LineEditWidget() +{ +} + +void LineEditWidget::init() +{ + mainLayout = new QHBoxLayout(this); + mainLayout->setContentsMargins(16, 0, 16, 0); + m_settingName->setFixedWidth(214); + mainLayout->addWidget(m_settingName); + mainLayout->setSpacing(16); + mainLayout->addWidget(m_lineEdit); + this->setLayout(mainLayout); +} + +void LineEditWidget::setEnabled(const bool checked) +{ + if (m_lineEdit) { + m_lineEdit->setEnabled(checked); + } +} + +bool LineEditWidget::isEnabled() const +{ + return m_lineEdit->isEnabled(); +} + +void LineEditWidget::setTitle(const QString &title) +{ + if (m_settingName) { + m_settingName->setText(title); + } + this->setAccessibleName(title); + m_lineEdit->setAccessibleName(title); +} + +QString LineEditWidget::title() const +{ + if (m_settingName) { + return m_settingName->text(); + } + return QString(); +} + +void LineEditWidget::setTitleFixedWidth(int w) +{ + m_settingName->setFixedWidth(w); +} + +QLineEdit *LineEditWidget::lineEdit() +{ + return m_lineEdit; +} diff --git a/libukcc/widgets/SettingWidget/lineeditwidget.h b/libukcc/widgets/SettingWidget/lineeditwidget.h new file mode 100644 index 0000000..6474864 --- /dev/null +++ b/libukcc/widgets/SettingWidget/lineeditwidget.h @@ -0,0 +1,93 @@ +#ifndef LINEEDITWIDGET_H +#define LINEEDITWIDGET_H + +#include +#include +#include +#include + + +#include "fixlabel.h" +#include "libukcc_global.h" +#include "ukccframe.h" +#include +/** + * @brief 创建一个带 QLineEdit 的 Frame + * + */ +class LIBUKCC_EXPORT LineEditWidget : public UkccFrame +{ + Q_OBJECT + +public: + /** + * @brief 创建一个带 QLineEdit 的 Frame + * + * @param title: text of m_settingName + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + explicit LineEditWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); + /** + * @brief + * + */ + ~LineEditWidget(); + + /** + * @brief 设置 m_lineEdit 是否可点击 + * + * @param checked + */ + void setEnabled(const bool checked); + + /** + * @brief 获取 m_lineEdit 是否 Enabled + * + * @return bool 是:true,否:false + */ + bool isEnabled() const; + + /** + * @brief 设置 m_settingName text + * + * @param title + */ + void setTitle(const QString &title); + + /** + * @brief 获取 m_settingName text + * + * @return QString + */ + QString title() const; + + /** + * @brief 设置 m_settingName label 宽度 + * + * @param w + */ + void setTitleFixedWidth(int w); + + /** + * @brief 获取 m_lineEdit + * + * @return QLineEdit: m_lineEdit + */ + QLineEdit *lineEdit(); + +private: + void init(); + + QHBoxLayout *mainLayout; + FixLabel *m_settingName; + QLineEdit *m_lineEdit; + +private Q_SLOTS: + +Q_SIGNALS: + + +}; + +#endif // LINEEDITWIDGET_H diff --git a/libukcc/widgets/SettingWidget/pushbuttonwidget.cpp b/libukcc/widgets/SettingWidget/pushbuttonwidget.cpp new file mode 100644 index 0000000..f1bbc49 --- /dev/null +++ b/libukcc/widgets/SettingWidget/pushbuttonwidget.cpp @@ -0,0 +1,79 @@ +#include "pushbuttonwidget.h" + +#include + +PushButtonWidget::PushButtonWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) + : UkccFrame(parent, style, true) +{ + m_settingName = new FixLabel(title, this); + m_pushButton = new QPushButton(this); + init(); +} + +PushButtonWidget::~PushButtonWidget() +{ + +} + +void PushButtonWidget::init() +{ + mainLayout = new QHBoxLayout(this); + mainLayout->setContentsMargins(16, 0, 16, 0); + m_pushButton->setFixedWidth(100); + mainLayout->addWidget(m_settingName); + mainLayout->addStretch(); + mainLayout->addWidget(m_pushButton); + this->setLayout(mainLayout); + + connect(m_pushButton, &QPushButton::clicked, this, &PushButtonWidget::clicked); +} + +void PushButtonWidget::setEnabled(const bool checked) +{ + if (m_pushButton) { + m_pushButton->setEnabled(checked); + } +} + +bool PushButtonWidget::isEnabled() const +{ + return m_pushButton->isEnabled(); +} + +void PushButtonWidget::setTitle(const QString &title) +{ + if (m_settingName) { + m_settingName->setText(title); + } + this->setAccessibleName(title); + m_pushButton->setAccessibleName(title); +} + +QString PushButtonWidget::title() const +{ + if (m_settingName) { + return m_settingName->text(); + } + return QString(); +} + +void PushButtonWidget::setTitleFixedWidth(int w) +{ + m_settingName->setFixedWidth(w); +} + +void PushButtonWidget::setButtonText(const QString &text) +{ + m_pushButton->setText(text); +} + +void PushButtonWidget::setButtonFixedWidth(int w) +{ + m_pushButton->setFixedWidth(w); +} + +QPushButton *PushButtonWidget::pushButton() +{ + return m_pushButton; +} + diff --git a/libukcc/widgets/SettingWidget/pushbuttonwidget.h b/libukcc/widgets/SettingWidget/pushbuttonwidget.h new file mode 100644 index 0000000..0e39e50 --- /dev/null +++ b/libukcc/widgets/SettingWidget/pushbuttonwidget.h @@ -0,0 +1,110 @@ +#ifndef PUSHBUTTONWIDGET_H +#define PUSHBUTTONWIDGET_H + +#include +#include + +#include +#include + +#include "fixlabel.h" +#include "libukcc_global.h" +#include "ukccframe.h" + +/** + * @brief 创建一个带 QPushButton 的 Frame + * + */ +class LIBUKCC_EXPORT PushButtonWidget : public UkccFrame +{ + Q_OBJECT +public: + /** + * @brief 创建一个带 QPushButton 的 Frame + * + * @param title: text of m_settingName + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + explicit PushButtonWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); + /** + * @brief + * + */ + ~PushButtonWidget(); + + /** + * @brief 设置 m_pushButton 是否可点击 + * + * @param checked + */ + void setEnabled(const bool checked); + + /** + * @brief 获取 m_pushButton 是否可点击 + * + * @return bool 是:true,否:false + */ + bool isEnabled() const; + + /** + * @brief 设置 m_settingName text + * + * @param title + */ + void setTitle(const QString &title); + + /** + * @brief 获取 m_settingName text + * + * @return QString + */ + QString title() const; + + /** + * @brief 设置 m_settingName label 宽度 + * + * @param w + */ + void setTitleFixedWidth(int w); + + /** + * @brief 设置 m_pushButton text + * + * @param text + */ + void setButtonText(const QString & text); + + /** + * @brief 设置 m_pushButton 宽度 + * + * @param w + */ + void setButtonFixedWidth(int w); + + /** + * @brief 获取 m_pushButton + * + * @return QPushButton: m_pushButton + */ + QPushButton *pushButton(); + +private: + void init(); + + QHBoxLayout *mainLayout; + FixLabel *m_settingName; + QPushButton *m_pushButton; + +private Q_SLOTS: + +Q_SIGNALS: + /** + * @brief m_pushButton 点击信号 + * + * @param checked + */ + void clicked(bool checked = false); +}; + +#endif // PUSHBUTTONWIDGET_H diff --git a/libukcc/widgets/SettingWidget/radiobuttonwidget.cpp b/libukcc/widgets/SettingWidget/radiobuttonwidget.cpp new file mode 100644 index 0000000..67372a9 --- /dev/null +++ b/libukcc/widgets/SettingWidget/radiobuttonwidget.cpp @@ -0,0 +1,73 @@ +#include "radiobuttonwidget.h" + +#include + +RadioButtonWidget::RadioButtonWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) + : UkccFrame(parent, style, true) +{ + m_settingName = new FixLabel(title, this); + m_buttonGroup = new QButtonGroup(this); + init(); +} + +RadioButtonWidget::~RadioButtonWidget() +{ +} + +void RadioButtonWidget::init() +{ + mainLayout = new QHBoxLayout(); + radioLayout = new QHBoxLayout(); + radioLayout->setContentsMargins(0, 0, 0, 0); + radioLayout->setSpacing(80); + mainLayout->setContentsMargins(16, 0, 16, 0); + m_settingName->setFixedWidth(214); + mainLayout->addWidget(m_settingName); + mainLayout->setSpacing(16); + mainLayout->addLayout(radioLayout); + mainLayout->addStretch(); + this->setLayout(mainLayout); + connect(m_buttonGroup, QOverload::of(&QButtonGroup::buttonClicked), + this, &RadioButtonWidget::buttonClicked); +} + + +void RadioButtonWidget::setTitle(const QString &title) +{ + if (m_settingName) { + m_settingName->setText(title); + } + this->setAccessibleName(title); +} + +QString RadioButtonWidget::title() const +{ + if (m_settingName) { + return m_settingName->text(); + } + return QString(); +} + +void RadioButtonWidget::setTitleFixedWidth(int w) +{ + m_settingName->setFixedWidth(w); +} + +void RadioButtonWidget::addButton(QRadioButton *button, int id, bool addStretch) +{ + m_buttonGroup->addButton(button, id); + radioLayout->addWidget(button, 0, Qt::AlignLeft | Qt::AlignVCenter); + if (addStretch) { + radioLayout->addStretch(); + } +} + +void RadioButtonWidget::setButtonSpacing(int spacing) +{ + radioLayout->setSpacing(spacing); +} + +QButtonGroup *RadioButtonWidget::buttonGroup() const +{ + return m_buttonGroup; +} diff --git a/libukcc/widgets/SettingWidget/radiobuttonwidget.h b/libukcc/widgets/SettingWidget/radiobuttonwidget.h new file mode 100644 index 0000000..f4936c3 --- /dev/null +++ b/libukcc/widgets/SettingWidget/radiobuttonwidget.h @@ -0,0 +1,101 @@ +#ifndef RADIOBUTTONWIDGET_H +#define RADIOBUTTONWIDGET_H + +#include +#include +#include +#include +#include + +#include "fixlabel.h" +#include "libukcc_global.h" +#include "ukccframe.h" + +/** + * @brief 创建一个带 QButtonGroup 的 Frame + * + */ +class LIBUKCC_EXPORT RadioButtonWidget : public UkccFrame +{ + Q_OBJECT + +public: + /** + * @brief 创建一个带 QButtonGroup 的 Frame + * + * @param title: text of m_settingName + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + explicit RadioButtonWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); + + /** + * @brief + * + */ + ~RadioButtonWidget(); + + /** + * @brief 设置 m_settingName text + * + * @param title + */ + void setTitle(const QString &title); + + /** + * @brief 获取 m_settingName text + * + * @return QString + */ + QString title() const; + + /** + * @brief 设置 m_settingName label 宽度 + * + * @param w + */ + void setTitleFixedWidth(int w); + + /** + * @brief 添加一个 id = id 的 QRadioButton 到 m_buttonGroup,并放到 radioLayout 中 + * + * @param button: 需要添加的 QRadioButton + * @param id: 用于 buttonClicked 信号传递的参数 + * @param addStretch: 是否 addStretch + */ + void addButton(QRadioButton *button, int id = -1, bool addStretch = false); + + /** + * @brief setSpacing of radioLayout + * + * @param spacing + */ + void setButtonSpacing(int spacing); + + /** + * @brief 获取 m_buttonGroup + * + * @return QButtonGroup: m_buttonGroup + */ + QButtonGroup *buttonGroup() const; + +private: + void init(); + + QHBoxLayout *mainLayout; + FixLabel *m_settingName; + QButtonGroup *m_buttonGroup; + QHBoxLayout *radioLayout; + +private Q_SLOTS: + +Q_SIGNALS: + /** + * @brief 点击 QButtonGroup 中的 QRadioButton 信号 + * + * @param int: addButton 时的 id + */ + void buttonClicked(int); +}; + +#endif // RADIOBUTTONWIDGET_H diff --git a/libukcc/widgets/SettingWidget/settinggroup.cpp b/libukcc/widgets/SettingWidget/settinggroup.cpp new file mode 100644 index 0000000..98e4dd9 --- /dev/null +++ b/libukcc/widgets/SettingWidget/settinggroup.cpp @@ -0,0 +1,169 @@ +#include "settinggroup.h" +#include + +SettingGroup::SettingGroup(QWidget *parent, Shape shape, UkccFrame::BorderRadiusStyle style) : UkccFrame(parent, style, false) +{ + mainLayout = new QVBoxLayout(this); + mainLayout->setSpacing(1); + mainLayout->setContentsMargins(0, 0, 0, 0); + this->setLayout(mainLayout); + this->setFrameShape(shape); + qApp->installEventFilter(this); + this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + +} + +SettingGroup::~SettingGroup() +{ +} + +void SettingGroup::addWidget(QFrame *item, bool autoUpdateShape, bool visible) +{ + mainLayout->addWidget(item, autoUpdateShape); + item->setVisible(visible); + if (autoUpdateShape) { + updateShape(); + } +} + +void SettingGroup::insertWidget(int index, QFrame *item, bool autoUpdateShape, bool visible) +{ + mainLayout->insertWidget(index, item); + item->setVisible(visible); + if (autoUpdateShape) { + updateShape(); + } +} + +void SettingGroup::removeWidget(QWidget *w, bool autoUpdateShape) +{ + mainLayout->removeWidget(w); + if (autoUpdateShape) { + updateShape(); + } +} + +void SettingGroup::updateAllItemList(UkccFrame *frame) +{ + if (frame->iscontainer() && frame->frameShape() == QFrame::NoFrame && frame->layout()) { + for (int i = 0; i < frame->layout()->count(); i++) { + QLayoutItem *it = frame->layout()->itemAt(i); + UkccFrame *item = qobject_cast(it->widget()); + if (!item) { + continue; + } + updateAllItemList(item); + } + } else { + allItemList.append(frame); + return; + } +} + +void SettingGroup::updateShowItemList(UkccFrame *frame) +{ + if (frame->iscontainer() && frame->frameShape() == QFrame::NoFrame && frame->layout()) { + for (int i = 0; i < frame->layout()->count(); i++) { + QLayoutItem *it = frame->layout()->itemAt(i); + UkccFrame *item = qobject_cast(it->widget()); + if (!item) { + continue; + } + updateShowItemList(item); + } + } else { + if (frame->isVisibleTo(this)) { + showItemList.append(frame); + } + return; + } +} + +void SettingGroup::updateShape() +{ + showItemList.clear(); + for (int i = 0; i < mainLayout->count(); i++) { + QLayoutItem *it = mainLayout->itemAt(i); + UkccFrame *item = qobject_cast(it->widget()); + if (!item) { + continue; + } + updateShowItemList(item); + } + + for (int i = 0; i < showItemList.size(); i++) { + UkccFrame *item = showItemList.at(i); + if (showItemList.size() == 1) { + item->setRadiusType(m_OneRadiusStyle); + } else if (i == 0) { + item->setRadiusType(UkccFrame::Top); + } else if (i == showItemList.size() - 1) { + item->setRadiusType(m_lastRadiusStyle); + } else { + item->setRadiusType(UkccFrame::None); + } + } +} + +QVBoxLayout *SettingGroup::layout() +{ + return mainLayout; +} + +void SettingGroup::setLastRadiusStyle(UkccFrame::BorderRadiusStyle style) +{ + m_lastRadiusStyle = style; +} + +void SettingGroup::setOneRadiusStyle(UkccFrame::BorderRadiusStyle style) +{ + m_OneRadiusStyle = style; +} + +bool SettingGroup::eventFilter(QObject *watched, QEvent *event) +{ + if (event->type() == QEvent::Hide || event->type() == QEvent::Show) { + allItemList.clear(); + for (int i = 0; i < mainLayout->count(); i++) { + QLayoutItem *it = mainLayout->itemAt(i); + UkccFrame *item = qobject_cast(it->widget()); + updateAllItemList(item); + + } + for (int i = 0; i < allItemList.size(); i++) { + if (allItemList.at(i) == watched) { + updateShape(); + } + } + } + return UkccFrame::eventFilter(watched, event); +} + +int SettingGroup::showItemsCount() +{ + showItemList.clear(); + for (int i = 0; i < mainLayout->count(); i++) { + QLayoutItem *it = mainLayout->itemAt(i); + UkccFrame *item = qobject_cast(it->widget()); + if (!item) { + continue; + } + updateShowItemList(item); + } + return showItemList.size(); +} + +void SettingGroup::removeAndDeleteAllWidget() +{ + while (mainLayout->count() > 0) { + QLayoutItem *it = mainLayout->itemAt(0); + UkccFrame *item = qobject_cast(it->widget()); + if (!item) { + continue; + } + mainLayout->removeWidget(item); + item->deleteLater(); + item = nullptr; + } + return; +} diff --git a/libukcc/widgets/SettingWidget/settinggroup.h b/libukcc/widgets/SettingWidget/settinggroup.h new file mode 100644 index 0000000..cebfebf --- /dev/null +++ b/libukcc/widgets/SettingWidget/settinggroup.h @@ -0,0 +1,139 @@ +#ifndef SETTINGGROUP_H +#define SETTINGGROUP_H + +#include +#include +#include +#include +#include +#include +#include "libukcc_global.h" +#include "ukccframe.h" +#include + +/** + * @brief 创建一个 Spacing 为 1 的垂直布局 Frame + * + */ +class LIBUKCC_EXPORT SettingGroup : public UkccFrame +{ + Q_OBJECT +public: + /** + * @brief 创建一个 Spacing 为 1 的垂直布局 Frame + * + * @param Shape: 设置frameShap + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + explicit SettingGroup(QWidget *parent = nullptr, Shape shape = QFrame::NoFrame, UkccFrame::BorderRadiusStyle style = UkccFrame::None); + + /** + * @brief + * + */ + ~SettingGroup(); + + /** + * @brief 为 mainLayout 添加控件并更新圆角 + * + * @param item: 需要添加的控件 + * @param autoUpdateShape: 是否自动更新item圆角样式 + * @param visible 实际未show控件时isVisible总是false,导致圆角无法正常,因此重新设置,应为Qt的BUG + */ + void addWidget(QFrame *item, bool autoUpdateShape = true, bool visible = true); + + /** + * @brief 为 mainLayout 添加控件并更新圆角 + * + * @param index: 序号 + * @param item: 需要添加的控件 + * @param autoUpdateShape: 是否自动更新item圆角样式 + * @param visible 实际未show控件时isVisible总是false,导致圆角无法正常,因此重新设置,应为Qt的BUG + */ + void insertWidget(int index, QFrame *item, bool autoUpdateShape = true, bool visible = true); + + /** + * @brief 为 mainLayout 移除控件并更新圆角 + * + * @param w: 需要移除的控件 + * @param autoUpdateShape: 是否自动更新item圆角样式 + */ + void removeWidget(QWidget *w, bool autoUpdateShape = true); + + /** + * @brief 更新圆角 + * + */ + void updateShape(); + + /** + * @brief 获取 mainLayout + * + * @return QVBoxLayout mainLayout + */ + QVBoxLayout *layout(); + + + /** + * @brief 设置最后一个frame的圆角风格 + * + * @param style 圆角风格 + */ + void setLastRadiusStyle(UkccFrame::BorderRadiusStyle style); + + + /** + * @brief 设置仅一个frame时的圆角风格 + * + * @param style + */ + void setOneRadiusStyle(UkccFrame::BorderRadiusStyle style); + + + /** + * @brief 获取显示的子控件个数 + * + * @return int 显示的子控件个数 + */ + int showItemsCount(); + + /** + * @brief 移除并删除所有子控件 + * + */ + void removeAndDeleteAllWidget(); + + +private: + /** + * @brief 递归添加显示出来的ukccFrame + * + * @param frame + */ + void updateShowItemList(UkccFrame *frame); + /** + * @brief 递归获取所有ukccFrame + * + * @param frame + */ + void updateAllItemList(UkccFrame *frame); + +protected: + bool eventFilter(QObject *watched, QEvent *event); + +private: + QDBusInterface *m_statusSessionDbus = nullptr; + QVBoxLayout *mainLayout; + UkccFrame::BorderRadiusStyle m_lastRadiusStyle = UkccFrame::BorderRadiusStyle::Bottom; + UkccFrame::BorderRadiusStyle m_OneRadiusStyle = UkccFrame::BorderRadiusStyle::Around; + QListshowItemList; + QListallItemList; + +private Q_SLOTS: + +Q_SIGNALS: + +}; + +#endif // SETTINGGROUP_H diff --git a/libukcc/widgets/SettingWidget/settingwidget.pri b/libukcc/widgets/SettingWidget/settingwidget.pri new file mode 100644 index 0000000..fca8a8e --- /dev/null +++ b/libukcc/widgets/SettingWidget/settingwidget.pri @@ -0,0 +1,23 @@ +QT += dbus +INCLUDEPATH += $$PWD $$PWD/../label +SOURCES += \ + $$PWD/addbutton.cpp \ + $$PWD/comboxwidget.cpp \ + $$PWD/lineeditwidget.cpp \ + $$PWD/pushbuttonwidget.cpp \ + $$PWD/radiobuttonwidget.cpp \ + $$PWD/settinggroup.cpp \ + $$PWD/sliderwidget.cpp \ + $$PWD/switchwidget.cpp \ + $$PWD/ukccframe.cpp + +HEADERS += \ + $$PWD/addbutton.h \ + $$PWD/comboxwidget.h \ + $$PWD/lineeditwidget.h \ + $$PWD/pushbuttonwidget.h \ + $$PWD/radiobuttonwidget.h \ + $$PWD/settinggroup.h \ + $$PWD/sliderwidget.h \ + $$PWD/switchwidget.h \ + $$PWD/ukccframe.h diff --git a/libukcc/widgets/SettingWidget/sliderwidget.cpp b/libukcc/widgets/SettingWidget/sliderwidget.cpp new file mode 100644 index 0000000..b64fd74 --- /dev/null +++ b/libukcc/widgets/SettingWidget/sliderwidget.cpp @@ -0,0 +1,120 @@ +#include "sliderwidget.h" + +#include + +SliderWidget::SliderWidget(QString title, bool hasNode, QWidget *parent, UkccFrame::BorderRadiusStyle style, Qt::Orientation orientation): + UkccFrame(parent, style, true) +{ + m_settingName = new FixLabel(title, this); + m_slider = new KSlider(orientation, this); + m_slider->setNodeVisible(hasNode); + init(); +} + +SliderWidget::~SliderWidget() +{ +} + +void SliderWidget::init() +{ + mainLayout = new QHBoxLayout(); + mainLayout->setContentsMargins(16, 0, 16, 0); + m_leftLabel = new QLabel(this); + m_leftLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); + m_rightLabel = new QLabel(this); + m_rightLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); + m_settingName->setFixedWidth(214); + mainLayout->addWidget(m_settingName); + mainLayout->addSpacing(8); + mainLayout->addWidget(m_leftLabel); + mainLayout->addWidget(m_slider); + mainLayout->addWidget(m_rightLabel); + this->setLayout(mainLayout); + connect(m_slider, &KSlider::valueChanged, this, &SliderWidget::valueChanged); +} + +void SliderWidget::setEnabled(const bool checked) +{ + if (m_slider) { + m_slider->setEnabled(checked); + } +} + +bool SliderWidget::isEnabled() const +{ + return m_slider->isEnabled(); +} + +void SliderWidget::setValue(const int value) +{ + m_slider->setValue(value); +} + +void SliderWidget::setTitle(const QString &title) +{ + if (m_settingName) { + m_settingName->setText(title); + } + this->setAccessibleName(title); + m_slider->setAccessibleName(title); +} + +void SliderWidget::setLeftText(const QString text) +{ + m_leftLabel->setText(text); +} + +void SliderWidget::setRightText(const QString text) +{ + m_rightLabel->setText(text); +} + +QString SliderWidget::title() const +{ + if (m_settingName) { + return m_settingName->text(); + } + return QString(); +} + +void SliderWidget::setTitleFixedWidth(int w) +{ + m_settingName->setFixedWidth(w); +} + +int SliderWidget::value() const +{ + return m_slider->value(); +} + +KSlider *SliderWidget::slider() const +{ + return m_slider; +} + +QLabel *SliderWidget::leftLabel() const +{ + return m_leftLabel; +} + +QLabel *SliderWidget::rightLabel() const +{ + return m_rightLabel; +} + +void SliderWidget::insertWidget(int index, QWidget *widget, int stretch, Qt::Alignment alignment) +{ + mainLayout->insertWidget(index, widget, stretch, alignment); +} + +void SliderWidget::setLeftPixmap(const QPixmap &pixmap) +{ + m_leftLabel->setPixmap(pixmap); +} + +void SliderWidget::setRightPixmap(const QPixmap &pixmap) +{ + m_rightLabel->setPixmap(pixmap); +} + + diff --git a/libukcc/widgets/SettingWidget/sliderwidget.h b/libukcc/widgets/SettingWidget/sliderwidget.h new file mode 100644 index 0000000..9e0c0d3 --- /dev/null +++ b/libukcc/widgets/SettingWidget/sliderwidget.h @@ -0,0 +1,157 @@ +#ifndef SLIDERWIDGET_H +#define SLIDERWIDGET_H +#include +#include +#include +#include + +#include "fixlabel.h" +#include +#include "libukcc_global.h" +#include "ukccframe.h" + +using namespace kdk; +/** + * @brief 创建一个带 KSlider 的 Frame + * + */ +class LIBUKCC_EXPORT SliderWidget : public UkccFrame +{ + Q_OBJECT + +public: + /** + * @brief 创建一个带 KSlider 的 Frame + * + * @param title: text of m_settingName + * @param hasNode: 是否带节点 + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + SliderWidget(QString title, bool hasNode, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None, Qt::Orientation orientation = Qt::Horizontal); + + /** + * @brief + * + */ + ~SliderWidget(); + + /** + * @brief 设置是否可点击 + * @param checked + */ + void setEnabled(const bool checked = true); + + /** + * @brief + * + * @return bool + */ + bool isEnabled() const; + + /** + * @brief 设置滑动条值 + * @param value + */ + void setValue(const int value); + + /** + * @brief 设置 m_settingName text + * @param title + */ + void setTitle(const QString &title); + + /** + * @brief 设置 m_leftLabel text + * @param text + */ + void setLeftText(const QString text); + + /** + * @brief 设置 m_rightLabel text + * @param text + */ + void setRightText(const QString text); + + /** + * @brief 设置 m_leftLabel pixmap + * + * @param pixmap + */ + void setLeftPixmap(const QPixmap &pixmap); + + /** + * @brief 设置 m_rightLabel pixmap + * + * @param pixmap + */ + void setRightPixmap(const QPixmap &pixmap); + + /** + * @brief 获取 m_settingName text + * @return + */ + QString title() const; + + /** + * @brief 设置 m_settingName label 宽度 + * + * @param w + */ + void setTitleFixedWidth(int w); + + /** + * @brief 获取 m_slider 值 + * @return int + */ + int value() const; + + /** + * @brief 获取 m_slider + * @return KSlider: m_slider + */ + KSlider *slider() const; + + /** + * @brief 获取 m_leftLabel + * @return QLabel: m_leftLabel + */ + QLabel *leftLabel() const; + + /** + * @brief 获取 m_rightLabel + * @return QLabel: m_rightLabel + */ + QLabel *rightLabel() const; + + /** + * @brief 在 mainLayout 中插入序号为 index 的 widget + * + * @param index: 插入序号 + * @param widget: 插入控件 + * @param stretch: stretch factor + * @param alignment:alignment + */ + void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment()); + +private: + void init(); + + QHBoxLayout *mainLayout; + FixLabel *m_settingName; + KSlider *m_slider; + QLabel *m_leftLabel; + QLabel *m_rightLabel; + +private Q_SLOTS: + +Q_SIGNALS: + /** + * @brief This signal is emitted when the slider value has changed + * + * @param value: the new slider value + */ + void valueChanged(int value); +}; + +#endif // SLIDERWIDGET_H diff --git a/libukcc/widgets/SettingWidget/switchwidget.cpp b/libukcc/widgets/SettingWidget/switchwidget.cpp new file mode 100644 index 0000000..7769b37 --- /dev/null +++ b/libukcc/widgets/SettingWidget/switchwidget.cpp @@ -0,0 +1,95 @@ +/* -*- 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 "switchwidget.h" + +#include + +SwitchWidget::SwitchWidget(const QString title, QWidget *parent, UkccFrame::BorderRadiusStyle style) : + UkccFrame(parent, style, true) +{ + m_settingName = new FixLabel(title, this); + m_switchButton = new KSwitchButton(this); + init(); +} + +SwitchWidget::~SwitchWidget() +{ +} + +void SwitchWidget::init() +{ + mainLayout = new QHBoxLayout(); + mainLayout->setContentsMargins(16, 0, 16, 0); + mainLayout->addWidget(m_settingName); + mainLayout->addStretch(); + mainLayout->addWidget(m_switchButton); + setLayout(mainLayout); + connect(m_switchButton, &KSwitchButton::stateChanged, this, &SwitchWidget::stateChanged); +} + +void SwitchWidget::setEnabled(const bool checked) +{ + if (m_switchButton) { + m_switchButton->setEnabled(checked); + } +} + +void SwitchWidget::setChecked(const bool checked) +{ + m_switchButton->setChecked(checked); +} + +bool SwitchWidget::isChecked() const +{ + return m_switchButton->isChecked(); +} + +bool SwitchWidget::isEnabled() const +{ + return m_switchButton->isEnabled(); +} + +void SwitchWidget::setTitle(const QString &title) +{ + if (m_settingName) { + m_settingName->setText(title); + } + this->setAccessibleName(title); + m_switchButton->setAccessibleName(title); +} + +QString SwitchWidget::title() const +{ + if (m_settingName) { + return m_settingName->text(); + } + return QString(); +} + +bool SwitchWidget::blockSignals(bool b) +{ + return m_switchButton->blockSignals(b); +} + +void SwitchWidget::insertWidget(int index, QWidget *widget, int stretch, Qt::Alignment alignment) +{ + mainLayout->insertWidget(index, widget, stretch, alignment); +} + diff --git a/libukcc/widgets/SettingWidget/switchwidget.h b/libukcc/widgets/SettingWidget/switchwidget.h new file mode 100644 index 0000000..304dbc2 --- /dev/null +++ b/libukcc/widgets/SettingWidget/switchwidget.h @@ -0,0 +1,128 @@ +/* -*- 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 SWITCHWIDGET_H +#define SWITCHWIDGET_H + +#include +#include +#include "fixlabel.h" +#include "libukcc_global.h" +#include "ukccframe.h" + +#include +using namespace kdk; + +/** + * @brief 创建一个带 KSwitchButton 的 Frame + * + */ +class LIBUKCC_EXPORT SwitchWidget : public UkccFrame +{ + Q_OBJECT + +public: + /** + * @brief 创建一个带 KSwitchButton 的 Frame + * + * @param title: text of m_settingName + * @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) + * @param parent + */ + explicit SwitchWidget(const QString title, QWidget *parent = nullptr, UkccFrame::BorderRadiusStyle style = UkccFrame::None); + + /** + * @brief + * + */ + ~SwitchWidget(); + + /** + * @brief 设置是否可点击 + * @param checked + */ + void setEnabled(const bool checked = true); + + /** + * @brief + * + * @return bool + */ + bool isEnabled() const; + + /** + * @brief 设置开启状态 + * @param checked + */ + void setChecked(const bool checked = true); + + /** + * @brief 返回是否选中 + * @return + */ + bool isChecked() const; + + /** + * @brief 设置 m_settingName text + * @param title + */ + void setTitle(const QString &title); + + /** + * @brief 获取 m_settingName text + * @return + */ + QString title() const; + + /** + * @brief blockSignals of m_switchButton + * @param b + * @return bool + */ + bool blockSignals(bool b); + + /** + * @brief 在 mainLayout 中插入序号为 index 的 widget + * + * @param index: 插入序号 + * @param widget: 插入控件 + * @param stretch: stretch factor + * @param alignment:alignment + */ + void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment()); + +private: + void init(); + + QHBoxLayout *mainLayout; + FixLabel *m_settingName; + KSwitchButton *m_switchButton; + +private Q_SLOTS: + +Q_SIGNALS: + /** + * @brief m_switchButton 状态改变信号 + * + * @param checked + */ + void stateChanged(const bool checked); +}; + +#endif // SWITCHWIDGET_H diff --git a/libukcc/widgets/SettingWidget/ukccframe.cpp b/libukcc/widgets/SettingWidget/ukccframe.cpp new file mode 100644 index 0000000..80661fa --- /dev/null +++ b/libukcc/widgets/SettingWidget/ukccframe.cpp @@ -0,0 +1,83 @@ +#include "ukccframe.h" +#include +#include +#include +#include + +UkccFrame::UkccFrame(QWidget *parent, BorderRadiusStyle style, bool heightAdaptive) : + QFrame(parent), + mRadiusType(style), + mHeightAdaptive(heightAdaptive), + mIscontainer(false) +{ + this->setFrameShape(QFrame::Box); + mStatusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + if (mStatusSessionDbus->isValid()) { + QDBusReply is_tabletmode = mStatusSessionDbus->call("get_current_tabletmode"); + mode_change_signal_slots(is_tabletmode.isValid() ? is_tabletmode.value() : false); + connect(mStatusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mode_change_signal_slots(bool))); + } else { + mode_change_signal_slots(false); +// qWarning() << "Create com.kylin.statusmanager.interface Interface Failed When : " << QDBusConnection::systemBus().lastError(); + } + +} + +UkccFrame::~UkccFrame() +{ + +} + +void UkccFrame::mode_change_signal_slots(bool b) +{ + if (mHeightAdaptive) { + if (b) { + this->setMinimumSize(550, TABLET_HEIGHT); + this->setMaximumSize(16777215, TABLET_HEIGHT); + } else { + this->setMinimumSize(550, PC_HEIGHT); + this->setMaximumSize(16777215, PC_HEIGHT); + } + } + mIsTabletMode = b; + Q_EMIT tabletModeChanged(b); +} + + +void UkccFrame::setRadiusType(BorderRadiusStyle style) +{ + mRadiusType = style; + update(); +} + +void UkccFrame::paintEvent(QPaintEvent *e) +{ + Q_UNUSED(e); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; + if (this->frameShape() != QFrame::NoFrame) { + painter.setBrush(qApp->palette().base()); + } + painter.setPen(Qt::transparent); + QRect rect = this->rect(); + + if (mRadiusType == UkccFrame::None) { + painter.drawRoundedRect(rect, 0, 0); + } else { + QPainterPath painterPath; + painterPath.addRoundedRect(rect, RADIUS_VALUE, RADIUS_VALUE); + + painterPath.setFillRule(Qt::WindingFill); + if (mRadiusType == UkccFrame::Bottom) { + painterPath.addRect(rect.width() - RADIUS_VALUE, 0, RADIUS_VALUE, RADIUS_VALUE); + painterPath.addRect(0, 0, RADIUS_VALUE, RADIUS_VALUE); + } else if (mRadiusType == UkccFrame::Top) { + painterPath.addRect(0, rect.height() - RADIUS_VALUE, RADIUS_VALUE, RADIUS_VALUE); + painterPath.addRect(rect.width() - RADIUS_VALUE, rect.height() - RADIUS_VALUE, RADIUS_VALUE, RADIUS_VALUE); + } + painter.drawPath(painterPath); + } +} diff --git a/libukcc/widgets/SettingWidget/ukccframe.h b/libukcc/widgets/SettingWidget/ukccframe.h new file mode 100644 index 0000000..543e604 --- /dev/null +++ b/libukcc/widgets/SettingWidget/ukccframe.h @@ -0,0 +1,92 @@ +#ifndef UKCCFRAME_H +#define UKCCFRAME_H + +#include +#include + +#include "libukcc_global.h" +#include + +#define RADIUS_VALUE 6 /**< 圆角数值 */ +#define PC_HEIGHT 60 /**< pc模式下高度 */ +#define TABLET_HEIGHT 64 /**< 平板模式下高度 */ + +class LIBUKCC_EXPORT UkccFrame : public QFrame { + Q_OBJECT +public: + enum BorderRadiusStyle { + Top, /**< 顶部有圆角 */ + None, /**< 没有圆角 */ + Bottom, /**< 底部有圆角 */ + Around /**< 四周都有圆角 */ + }; + /** + * @brief 构造函数 + * + * @param parent 父对象 + * @param style 圆角风格枚举值 + * @param heightAdaptive 是否自动调整高度,默认PC下60,平板模式64 + */ + explicit UkccFrame(QWidget* parent = nullptr, BorderRadiusStyle style = Around, bool heightAdaptive = false); + ~UkccFrame(); + /** + * @brief 设置圆角风格 + * + * @param style 圆角风格枚举值 + */ + void setRadiusType(BorderRadiusStyle style); + + /** + * @brief 获取平板模式 + * + * @return bool 是否是平板模式 + */ + inline bool getTabletMode() + { + return mIsTabletMode; + } + + /** + * @brief 获取是否是一个容器frame,此时settinggroup需要设置的是其子frame的圆角 + * + * @return bool 是/不是 + */ + inline bool iscontainer() + { + return mIscontainer; + } + + /** + * @brief 设置该frame是否是一个容器frame,如果是同时setFrameShape(NoFrame); + * + * @param b 是/不是 + */ + inline void setContainer(bool b = false) + { + mIscontainer = b; + if (b) { + this->setFrameShape(QFrame::NoFrame); + } + } + + +Q_SIGNALS: + void tabletModeChanged(bool b); + +private Q_SLOTS: + void mode_change_signal_slots(bool b); + +protected: + void paintEvent(QPaintEvent *e); + +private: + BorderRadiusStyle mRadiusType; + bool mIsTabletMode = false; + QDBusInterface *mStatusSessionDbus = nullptr; + bool mHeightAdaptive = false; + bool mIscontainer = false; +}; + + + +#endif // UKCCFRAME_H diff --git a/libukcc/widgets/SwitchButton/switchbutton.pri b/libukcc/widgets/SwitchButton/switchbutton.pri index feac79a..259105a 100644 --- a/libukcc/widgets/SwitchButton/switchbutton.pri +++ b/libukcc/widgets/SwitchButton/switchbutton.pri @@ -1,3 +1,4 @@ +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/switchbutton.cpp \ diff --git a/libukcc/widgets/Uslider/uslider.pri b/libukcc/widgets/Uslider/uslider.pri index 02bc38d..74c14c2 100644 --- a/libukcc/widgets/Uslider/uslider.pri +++ b/libukcc/widgets/Uslider/uslider.pri @@ -1,4 +1,5 @@ #LIBINTERFACE_NAME = $$qtLibraryTarget(uslier) +INCLUDEPATH += $$PWD SOURCES += \ $$PWD/uslider.cpp \ diff --git a/plugins/account/userinfo/changeusergroup.cpp b/plugins/account/userinfo/changeusergroup.cpp index e970359..1d898f6 100644 --- a/plugins/account/userinfo/changeusergroup.cpp +++ b/plugins/account/userinfo/changeusergroup.cpp @@ -262,7 +262,7 @@ void changeUserGroup::initConnect() connect(mUserGroupLineEdit, &QLineEdit::textEdited,[=](){ _nameHasModified = true; }); - connect(mUserGroupNumbersModel, &QStandardItemModel::itemChanged, this, [=](QStandardItem *){ + connect(mUserGroupNumbersModel, &QStandardItemModel::itemChanged, this, [=](QStandardItem *item){ qDebug() << "checkbox clicked"; _boxModified = true; refreshCertainBtnStatus(); @@ -639,6 +639,8 @@ void changeUserGroup::cancelUserGroupSlot() void changeUserGroup::saveUserGroupInfoSlot() { + QStringList addUserList; + QStringList delUserList; for (int i = 0; i < mUserGroupNumbersTableView->model()->rowCount(); i++) { if(_idHasModified){ for (int j = 0; j < this->groupList->size(); j++){ @@ -653,40 +655,47 @@ void changeUserGroup::saveUserGroupInfoSlot() } } - QDBusReply reply = this->serviceInterface->call("set", - mUserGroupLineEdit->text(),mUserGroupIdLineEdit->text()); - if (reply.isValid()){ - // use the returned value - qDebug() << "set get call value" << reply.value(); - } else { - // call failed. Show an error condition. - qDebug() << "set call failed" << reply.error(); - } - if (mUserGroupNumbersModel->item(i)->checkState()) { qDebug() << "---------i = " << i << "--------checked = " << mUserGroupNumbersModel->item(i)->text(); - QDBusReply reply = this->serviceInterface->call("addUserToGroup", - mUserGroupLineEdit->text(),mUserGroupNumbersModel->item(i)->text()); - if (reply.isValid()){ - // use the returned value - qDebug() << "addUserToGroup get call value" << reply.value(); - } else { - // call failed. Show an error condition. - qDebug() << "addUserToGroup call failed" << reply.error(); - } + addUserList << mUserGroupNumbersModel->item(i)->text(); + } else { + delUserList << mUserGroupNumbersModel->item(i)->text(); qDebug() << "---------i = " << i << "--------unchecked = " << mUserGroupNumbersModel->item(i)->text(); - QDBusReply reply = this->serviceInterface->call("delUserFromGroup", - mUserGroupLineEdit->text(),mUserGroupNumbersModel->item(i)->text()); - if (reply.isValid()){ - // use the returned value - qDebug() << "delUserFromGroup get call value" << reply.value(); - } else { - // call failed. Show an error condition. - qDebug() << "delUserFromGroup call failed" << reply.error(); - } + } } + this->serviceInterface->call("setAuth", false); + QDBusReply setReply = this->serviceInterface->call("set", + mUserGroupLineEdit->text(),mUserGroupIdLineEdit->text()); + if (setReply.isValid()){ + // use the returned value + qDebug() << "set get call value" << setReply.value(); + } else { + // call failed. Show an error condition. + qDebug() << "set call failed" << setReply.error(); + } + + QDBusReply addUserReply = this->serviceInterface->call("addUserToGroup", + mUserGroupLineEdit->text(), addUserList); + if (addUserReply.isValid()){ + // use the returned value + qDebug() << "addUserToGroup get call value" << addUserReply.value(); + } else { + // call failed. Show an error condition. + qDebug() << "addUserToGroup call failed" << addUserReply.error(); + } + QDBusReply delUserReply = this->serviceInterface->call("delUserFromGroup", + mUserGroupLineEdit->text(), delUserList); + if (delUserReply.isValid()){ + // use the returned value + qDebug() << "delUserFromGroup get call value" << delUserReply.value(); + } else { + // call failed. Show an error condition. + qDebug() << "delUserFromGroup call failed" << delUserReply.error(); + } + this->serviceInterface->call("setAuth", true); + emit needRefresh(); close(); diff --git a/plugins/account/userinfo/changeuserlogo.cpp b/plugins/account/userinfo/changeuserlogo.cpp index 63ce918..9dae605 100644 --- a/plugins/account/userinfo/changeuserlogo.cpp +++ b/plugins/account/userinfo/changeuserlogo.cpp @@ -16,7 +16,7 @@ #include #include -#include "../../../shell/utils/utils.h" +#include "common.h" #ifdef signals #undef signals #endif @@ -24,7 +24,7 @@ #include #include -#include "widgets/FlowLayout/flowlayout.h" +#include "flowlayout.h" #define FACEPATH "/usr/share/ukui/faces/" @@ -63,11 +63,11 @@ void ChangeUserLogo::loadSystemLogo(){ foreach (QString filename, facesDir.entryList(QDir::Files)) { QString fullface = QString("%1%2").arg(FACEPATH).arg(filename); // 社区版不加载商业默认头像 - if (Utils::isCommunity() && fullface.endsWith("commercial.png")) { + if (Common::isCommunity() && fullface.endsWith("commercial.png")) { continue; } // 商业版不加载社区默认头像 - if (!Utils::isCommunity() &&fullface.endsWith("community.png")) { + if (!Common::isCommunity() &&fullface.endsWith("community.png")) { continue; } // 升级后 default.png 不存在导致开始菜单无头像显示 #108837 diff --git a/plugins/account/userinfo/changeusernickname.cpp b/plugins/account/userinfo/changeusernickname.cpp index 856534d..343a09b 100644 --- a/plugins/account/userinfo/changeusernickname.cpp +++ b/plugins/account/userinfo/changeusernickname.cpp @@ -57,6 +57,7 @@ void ChangeUserNickname::initUI(){ userNameLineEdit->setFixedSize(QSize(300, 36)); userNameLineEdit->setPlaceholderText(QString(g_get_user_name())); userNameLineEdit->setReadOnly(true); + userNameLineEdit->setFocusPolicy(Qt::NoFocus); userNameHorLayout = new QHBoxLayout; userNameHorLayout->setSpacing(25); diff --git a/plugins/account/userinfo/changeuserpwd.cpp b/plugins/account/userinfo/changeuserpwd.cpp index d47409a..8bc8abf 100644 --- a/plugins/account/userinfo/changeuserpwd.cpp +++ b/plugins/account/userinfo/changeuserpwd.cpp @@ -9,10 +9,11 @@ #include #include #include +#include #include #include - +#include #include #include @@ -113,7 +114,9 @@ void ChangeUserPwd::initUI(){ currentPwdLineEdit->setFixedSize(QSize(322, 36)); currentPwdLineEdit->setPlaceholderText(tr("Current Pwd")); currentPwdLineEdit->setEchoMode(QLineEdit::Password); - currentPwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false); + QRegExp inputRegExp("^[A-Za-z0-9`~!@#$%^&*()_-+=<>,.\\\/?:;\"'|\{\}\ ]+$"); + QRegExpValidator *inputLimits = new QRegExpValidator(inputRegExp, this); + currentPwdLineEdit->setValidator(inputLimits); currentPwdLineEdit->setTextMargins(0,0,30,0); currentPwdLineEdit->setContextMenuPolicy(Qt::NoContextMenu); currentPwdLineEdit->installEventFilter(this); @@ -153,7 +156,7 @@ void ChangeUserPwd::initUI(){ newPwdLineEdit->setFixedSize(QSize(322, 36)); newPwdLineEdit->setPlaceholderText(tr("New Pwd")); newPwdLineEdit->setEchoMode(QLineEdit::Password); - newPwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false); + newPwdLineEdit->setValidator(inputLimits); newPwdLineEdit->setTextMargins(0,0,30,0); newPwdLineEdit->setContextMenuPolicy(Qt::NoContextMenu); newPwdLineEdit->installEventFilter(this); @@ -186,7 +189,7 @@ void ChangeUserPwd::initUI(){ surePwdLineEdit->setFixedSize(QSize(322, 36)); surePwdLineEdit->setPlaceholderText(tr("Sure Pwd")); surePwdLineEdit->setEchoMode(QLineEdit::Password); - surePwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false); + surePwdLineEdit->setValidator(inputLimits); surePwdLineEdit->setTextMargins(0,0,30,0); surePwdLineEdit->setContextMenuPolicy(Qt::NoContextMenu); surePwdLineEdit->installEventFilter(this); @@ -269,6 +272,32 @@ void ChangeUserPwd::test(){ } +int ChangeUserPwd::isDomainUser(const char* username) +{ + FILE *fp; + fp=fopen("/etc/passwd","r"); + if(fp == NULL) + { + return 1; + } + char buf[1024], name[128]; + while(!feof(fp)) + { + if(fgets(buf,sizeof (buf),fp) == NULL) + { + break; + } + sscanf(buf,"%[^:]",name); + if(strcmp(name,username) == 0) + { + fclose(fp); + return 0; + } + } + fclose(fp); + return 1; +} + void ChangeUserPwd::setupConnect(){ //通用的connect @@ -337,15 +366,17 @@ void ChangeUserPwd::setupConnect(){ //返回值为空,密码校验成功 if (re.isEmpty()){ - if (QString::compare(newPwdLineEdit->text(), currentPwdLineEdit->text()) == 0 && !newPwdLineEdit->text().isEmpty()){ + if (newPwdLineEdit->text().compare(currentPwdLineEdit->text(), Qt::CaseSensitive) == 0 && !newPwdLineEdit->text().isEmpty()) { newPwdTip = tr("Same with old pwd"); - updateTipLableInfo(newTipLabel,newPwdTip); + updateTipLableInfo(newTipLabel, newPwdTip); + newPwdLineEdit->setFocus(); + confirmBtn->setIconSize(QSize(0,0)); + confirmBtn->setText(tr("Confirm")); + m_timer->stop(); refreshConfirmBtnStatus(); //密码校验完成 isChecking = false; - - refreshCloseBtnStatus(); } else { //修改密码 QString output; @@ -366,8 +397,14 @@ void ChangeUserPwd::setupConnect(){ pclose(stream); this->accept(); - } + if (isDomainUser(g_get_user_name())) { + QString primaryText; + primaryText = output.simplified().isEmpty() ? tr("Pwd Changed Succes") : output; + qDebug() << "output of changeUserpwd = " << output; + QMessageBox::warning(NULL, "", primaryText, QMessageBox::Yes); + } + } } else { if (re.contains("Failed")){ curPwdTip = tr("Authentication failed, input authtok again!"); @@ -379,15 +416,14 @@ void ChangeUserPwd::setupConnect(){ currentPwdLineEdit->setText(""); currentPwdLineEdit->setFocus(); + confirmBtn->setIconSize(QSize(0,0)); + confirmBtn->setText(tr("Confirm")); + m_timer->stop(); refreshConfirmBtnStatus(); //密码校验完成 isChecking = false; - - refreshCloseBtnStatus(); } - - }); connect(currentPwdLineEdit, &QLineEdit::textEdited, [=](QString txt){ @@ -414,8 +450,20 @@ void ChangeUserPwd::setupConnect(){ //开始当前密码校验 isChecking = true; - refreshCloseBtnStatus(); - + if(m_timer == nullptr) + { + m_timer = new QTimer(this); + m_timer->setInterval(150); + connect(m_timer, &QTimer::timeout, this, &ChangeUserPwd::updatePixmap); + m_waitingPixmap = QIcon::fromTheme("ukui-loading-0-symbolic").pixmap(24, 24); + confirmBtn->setIcon(QIcon(m_waitingPixmap)); + confirmBtn->setText(tr("")); + m_timer->start(); + } else { + confirmBtn->setIconSize(QSize(24,24)); + confirmBtn->setText(tr("")); + m_timer->start(); + } }); } else { connect(confirmBtn, &QPushButton::clicked, this, [=]{ @@ -435,12 +483,18 @@ void ChangeUserPwd::setupConnect(){ this->accept(); }); - - } } +void ChangeUserPwd::updatePixmap() +{ + QMatrix matrix; + matrix.rotate(90.0); + m_waitingPixmap = m_waitingPixmap.transformed(matrix, Qt::FastTransformation); + confirmBtn->setIcon(m_waitingPixmap); +} + void ChangeUserPwd::setupStatus(QString n){ curPwdTip = QString(); @@ -528,7 +582,10 @@ void ChangeUserPwd::checkPwdLegality(){ ret = pwquality_check(settings, ba.data(), NULL, name.toLatin1().data(), &auxerror); } - if (ret < 0 && newPwdLineEdit->text().length() > 0 && ret != -21){ + if (ret == PWQ_ERROR_SAME_PASSWORD) { + ret = pwquality_check(settings, ba.data(), NULL, name.toLatin1().data(), &auxerror); + } + if (ret < 0 && newPwdLineEdit->text().length() > 0){ msg = pwquality_strerror(buf, sizeof(buf), ret, auxerror); newPwdTip = QString(msg); } else { diff --git a/plugins/account/userinfo/changeuserpwd.h b/plugins/account/userinfo/changeuserpwd.h index 9c25a14..fd87a31 100644 --- a/plugins/account/userinfo/changeuserpwd.h +++ b/plugins/account/userinfo/changeuserpwd.h @@ -2,6 +2,7 @@ #define CHANGEUSERPWD_H #include +#include #include "pwdcheckthread.h" #include "passwdcheckutil.h" @@ -84,6 +85,8 @@ private: QString curPwdTip; QString newPwdTip; QString surePwdTip; + QPixmap m_waitingPixmap; + QTimer *m_timer = nullptr; bool isCurrentUser; bool isChecking; @@ -100,9 +103,11 @@ private: void checkPwdLegality(); bool isContainLegitimacyChar(QString word); + int isDomainUser(const char* username); private slots: void test(); + void updatePixmap(); }; diff --git a/plugins/account/userinfo/changeusertype.cpp b/plugins/account/userinfo/changeusertype.cpp index 8e31162..74c04bf 100644 --- a/plugins/account/userinfo/changeusertype.cpp +++ b/plugins/account/userinfo/changeusertype.cpp @@ -66,7 +66,7 @@ void ChangeUserType::initUI(){ cutUserHorLayout->addStretch(); cutNoteLabel = new QLabel; - cutNoteLabel->setFixedHeight(24); + cutNoteLabel->setFixedHeight(32); cutNoteLabel->setText(tr("Select account type (Ensure have admin on system):")); cutAdminRadioBtn = new QRadioButton; @@ -165,7 +165,7 @@ void ChangeUserType::initUI(){ cutMainVerLayout->addLayout(cutUserHorLayout); cutMainVerLayout->addSpacing(35); cutMainVerLayout->addWidget(cutNoteLabel); - cutMainVerLayout->addSpacing(16); + cutMainVerLayout->addSpacing(8); cutMainVerLayout->addWidget(cutAdminFrame); cutMainVerLayout->addSpacing(0); cutMainVerLayout->addWidget(cutStandardFrame); diff --git a/plugins/account/userinfo/changeusertype.h b/plugins/account/userinfo/changeusertype.h index a8b2c73..1ae64e0 100644 --- a/plugins/account/userinfo/changeusertype.h +++ b/plugins/account/userinfo/changeusertype.h @@ -5,7 +5,7 @@ #include #include #include -#include "widgets/Label/lightlabel.h" +#include "lightlabel.h" class QHBoxLayout; class QVBoxLayout; diff --git a/plugins/account/userinfo/creategroupdialog.cpp b/plugins/account/userinfo/creategroupdialog.cpp index 08b4bc7..8d3b6ae 100644 --- a/plugins/account/userinfo/creategroupdialog.cpp +++ b/plugins/account/userinfo/creategroupdialog.cpp @@ -20,7 +20,7 @@ #include "creategroupdialog.h" #include "userinfo.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include "changeusergroup.h" extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); diff --git a/plugins/account/userinfo/createusernew.cpp b/plugins/account/userinfo/createusernew.cpp index 1e1005f..84e7503 100644 --- a/plugins/account/userinfo/createusernew.cpp +++ b/plugins/account/userinfo/createusernew.cpp @@ -17,13 +17,13 @@ #include -#include "../../../shell/utils/utils.h" +#include "common.h" #define USER_LENGTH 32 #define NICKNAME_LENGTH 32 #define DEFAULTFACECOMMUNITY "/usr/share/ukui/faces/01-default-community.png" #define DEFAULTFACECOMMERCIAL "/usr/share/ukui/faces/01-default-commercial.png" -#define DEFAULTFACE (Utils::isCommunity())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL +#define DEFAULTFACE (Common::isCommunity())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL CreateUserNew::CreateUserNew(QStringList allUsers, QWidget *parent) : QDialog(parent), @@ -91,20 +91,20 @@ void CreateUserNew::initUI(){ tipLabel->setStyleSheet("color:red;"); usernameLineEdit = new QLineEdit; - usernameLineEdit->setFixedSize(340, 36); + usernameLineEdit->setFixedWidth(340); usernameLineEdit->setPlaceholderText(tr("Required")); nicknameLineEdit = new QLineEdit; - nicknameLineEdit->setFixedSize(340, 36); + nicknameLineEdit->setFixedWidth(340); nicknameLineEdit->setPlaceholderText(tr("Required")); hostnameLineEdit = new QLineEdit; - hostnameLineEdit->setFixedSize(340, 36); + hostnameLineEdit->setFixedWidth(340); hostnameLineEdit->setPlaceholderText(tr("Required")); newPwdLineEdit = new QLineEdit; - newPwdLineEdit->setFixedSize(340, 36); + newPwdLineEdit->setFixedWidth(340); newPwdLineEdit->setPlaceholderText(tr("Required")); newPwdLineEdit->setEchoMode(QLineEdit::Password); surePwdLineEdit = new QLineEdit; - surePwdLineEdit->setFixedSize(340, 36); + surePwdLineEdit->setFixedWidth(340); surePwdLineEdit->setPlaceholderText(tr("verification")); surePwdLineEdit->setEchoMode(QLineEdit::Password); diff --git a/plugins/account/userinfo/deleteuserexists.cpp b/plugins/account/userinfo/deleteuserexists.cpp index 3badc79..72dd698 100644 --- a/plugins/account/userinfo/deleteuserexists.cpp +++ b/plugins/account/userinfo/deleteuserexists.cpp @@ -25,8 +25,7 @@ DeleteUserExists::DeleteUserExists(QString name, QString nick, qint64 uid, QWidg _nick(nick), _id(uid) { - setFixedHeight(280); - setMinimumWidth(520); + setFixedSize(570, 280); setWindowFlags(Qt::FramelessWindowHint | Qt::Tool); setAttribute(Qt::WA_TranslucentBackground); diff --git a/plugins/account/userinfo/passwdcheckutil.cpp b/plugins/account/userinfo/passwdcheckutil.cpp index 382927f..b040d12 100644 --- a/plugins/account/userinfo/passwdcheckutil.cpp +++ b/plugins/account/userinfo/passwdcheckutil.cpp @@ -22,7 +22,7 @@ #include #include -#include "../../../shell/utils/utils.h" +#include "common.h" #define PAM_CONF_FILE "/etc/pam.d/common-password" @@ -32,9 +32,8 @@ PasswdCheckUtil::PasswdCheckUtil(QObject *parent) : QObject(parent) } bool PasswdCheckUtil::getCurrentPamState(){ - return true; // pam_pwquality.so为安全中心密码强度是否开启判断,社区版不做判断 - if (Utils::isCommunity()) { + if (Common::isCommunity() || Common::isWayland()) { return true; } QFile * readFile = new QFile(PAM_CONF_FILE); diff --git a/plugins/account/userinfo/userinfo.cpp b/plugins/account/userinfo/userinfo.cpp index 6ec2cd5..d227e96 100644 --- a/plugins/account/userinfo/userinfo.cpp +++ b/plugins/account/userinfo/userinfo.cpp @@ -42,11 +42,13 @@ #include -#include "widgets/ImageUtil/imageutil.h" + #include "elipsemaskwidget.h" #include "passwdcheckutil.h" #include "loginedusers.h" -#include "../../../shell/utils/utils.h" + +#include "common.h" +#include "imageutil.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 **/ @@ -63,7 +65,7 @@ #endif #define DEFAULTFACECOMMUNITY "/usr/share/ukui/faces/01-default-community.png" #define DEFAULTFACECOMMERCIAL "/usr/share/ukui/faces/01-default-commercial.png" -#define DEFAULTFACE (Utils::isCommunity())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL +#define DEFAULTFACE (Common::isCommunity())?DEFAULTFACECOMMUNITY:DEFAULTFACECOMMERCIAL #define ITEMHEIGH 60 UserInfo::UserInfo() : mFirstLoad(true) @@ -130,7 +132,7 @@ const QString UserInfo::name() const { bool UserInfo::isShowOnHomePage() const { - return !isIntel(); + return !Common::isTablet(); } QIcon UserInfo::icon() const @@ -140,23 +142,21 @@ QIcon UserInfo::icon() const bool UserInfo::isEnable() const { - return !isIntel(); + return !Common::isTablet(); } -void UserInfo::initSearchText() { - //~ contents_path /Userinfo/Password - ui->changePwdBtn->setText(tr("Password")); - //~ contents_path /Userinfo/Type - ui->changeTypeBtn->setText(tr("Type")); - //~ contents_path /Userinfo/Login no passwd - ui->loginpwdLabel->setText(tr("Login no passwd")); - //~ contents_path /Userinfo/enable autoLogin - ui->autologinLabel->setText(tr("enable autoLogin")); - - +void UserInfo::initSearchText() +{ + //~ contents_path /Userinfo/CurrentUser currentLabel->setText(tr("CurrentUser")); +// //~ contents_path /Userinfo/LoginWithoutPwd +// nopwdLoginLabel->setText(tr("LoginWithoutPwd")); +// //~ contents_path /Userinfo/AutoLoginOnBoot +// autoLoginLabel->setText(tr("AutoLoginOnBoot")); + //~ contents_path /Userinfo/OthersUser othersLabel->setText(tr("OthersUser")); - + //~ contents_path /Userinfo/Add + tr("Add"); } /**3.1****begin************/ @@ -168,33 +168,38 @@ void UserInfo::initUI(){ othersLabel = new TitleLabel(); //当前用户区域 - currentFrame = new QFrame(); + currentFrame = new SettingGroup(); ////当前用户 - currentUserFrame = new QFrame(); + currentUserFrame = new UkccFrame(); //////分割线 splitVLine1 = createVLine(currentUserFrame, 10); splitVLine2 = createVLine(currentUserFrame, 10); currentUserlogoBtn = new QPushButton(); + currentUserlogoBtn->setObjectName("currentUserlogo"); currentUserlogoBtn->setFixedSize(QSize(104, 104)); currentUserlogoBtn->setIconSize(QSize(96, 96)); changeCurrentPwdBtn = new QPushButton(); changeCurrentPwdBtn->setFlat(true); changeCurrentPwdBtn->setText(tr("Passwd")); + changeCurrentPwdBtn->setObjectName("Passwd"); changeCurrentTypeBtn = new QPushButton(); changeCurrentTypeBtn->setFlat(true); changeCurrentTypeBtn->setText(tr("Type")); + changeCurrentTypeBtn->setObjectName("Type"); changeCurrentGroupsBtn = new QPushButton(); changeCurrentGroupsBtn->setFlat(true); changeCurrentGroupsBtn->setText(tr("Groups")); + changeCurrentGroupsBtn->setObjectName("Groups"); currentNickNameLabel = new QLabel(); currentNickNameLabel->setFixedHeight(27); currentNickNameChangeLabel = new QLabel(); + currentNickNameChangeLabel->setObjectName("currentNickNameChange"); currentNickNameChangeLabel->setFixedSize(QSize(15, 22)); currentNickNameChangeLabel->setProperty("useIconHighlightEffect", 0x8); currentNickNameChangeLabel->setPixmap(QIcon::fromTheme("document-edit-symbolic").pixmap(currentNickNameChangeLabel->size())); @@ -231,95 +236,38 @@ void UserInfo::initUI(){ currentUserFrame->setMinimumSize(QSize(550, 127)); currentUserFrame->setMaximumSize(QSize(16777215, 127)); - currentUserFrame->setFrameShape(QFrame::NoFrame); + currentUserFrame->setFrameShape(QFrame::WinPanel); currentUserFrame->setLayout(currentUserHorLayout); + //免密登录 + //~ contents_path /Userinfo/LoginWithoutPwd + nopwdLoginFrame = new SwitchWidget(tr("LoginWithoutPwd")); + nopwdLoginFrame->setObjectName("LoginWithoutPwd"); - ////分割线 - splitHLine1 = createHLine(currentFrame); - splitHLine2 = createHLine(currentFrame); + //开机自动登录 + //~ contents_path /Userinfo/AutoLoginOnBoot + autoLoginFrame = new SwitchWidget(tr("AutoLoginOnBoot"), pluginWidget2, UkccFrame::Bottom); + autoLoginFrame->setObjectName("AutoLoginOnBoot"); - ////免密登录 - nopwdLoginFrame = new QFrame(); - - nopwdLoginLabel = new QLabel(); - nopwdLoginLabel->setText(tr("LoginWithoutPwd")); - - nopwdLoginSBtn = new KSwitchButton(nopwdLoginFrame); - - nopwdLoginHorLayout = new QHBoxLayout(); - nopwdLoginHorLayout->setSpacing(8); - nopwdLoginHorLayout->setContentsMargins(16, 0, 16, 0); - nopwdLoginHorLayout->addWidget(nopwdLoginLabel); - nopwdLoginHorLayout->addStretch(); - nopwdLoginHorLayout->addWidget(nopwdLoginSBtn); - - nopwdLoginFrame->setMinimumSize(QSize(550, 60)); - nopwdLoginFrame->setMaximumSize(QSize(16777215, 60)); - nopwdLoginFrame->setFrameShape(QFrame::NoFrame); - nopwdLoginFrame->setLayout(nopwdLoginHorLayout); - - ////开机自动登录 - autoLoginFrame = new QFrame(); - - autoLoginLabel = new QLabel(); - autoLoginLabel->setText(tr("AutoLoginOnBoot")); -// autoLoginLabel->setFixedWidth(550); - - autoLoginSBtn = new KSwitchButton(autoLoginFrame); - - autoLoginHorLayout = new QHBoxLayout(); - autoLoginHorLayout->setSpacing(8); - autoLoginHorLayout->setContentsMargins(16, 0, 16, 0); - autoLoginHorLayout->addWidget(autoLoginLabel); - autoLoginHorLayout->addStretch(); - autoLoginHorLayout->addWidget(autoLoginSBtn); - - autoLoginFrame->setMinimumSize(QSize(550, 60)); - autoLoginFrame->setMaximumSize(QSize(16777215, 60)); - autoLoginFrame->setFrameShape(QFrame::NoFrame); - autoLoginFrame->setLayout(autoLoginHorLayout); - - - currentVerLayout = new QVBoxLayout(); - currentVerLayout->setSpacing(0); - currentVerLayout->setContentsMargins(0, 0, 0, 0); - currentVerLayout->addWidget(currentUserFrame); - currentVerLayout->addWidget(splitHLine1); - currentVerLayout->addWidget(nopwdLoginFrame); - currentVerLayout->addWidget(splitHLine2); - currentVerLayout->addWidget(autoLoginFrame); - - currentFrame->setMinimumSize(QSize(550, 248)); - currentFrame->setMaximumSize(QSize(16777215, 248)); - currentFrame->setFrameShape(QFrame::Box); - currentFrame->setLayout(currentVerLayout); + currentFrame->insertWidget(0, currentUserFrame); + currentFrame->insertWidget(1, nopwdLoginFrame); + currentFrame->insertWidget(2, autoLoginFrame); //其他用户区域 addUserBtn = new AddBtn; + addUserBtn->setObjectName("addUser"); addUserHorLayout = new QHBoxLayout(); addUserHorLayout->setSpacing(8); addUserHorLayout->setContentsMargins(0, 0, 0, 0); addUserHorLayout->addWidget(addUserBtn); - addUserFrame = new QFrame(); + addUserFrame = new UkccFrame(pluginWidget2, UkccFrame::BorderRadiusStyle::Around, true); addUserFrame->setObjectName("continue"); - addUserFrame->setMinimumSize(QSize(550, 60)); - addUserFrame->setMaximumSize(QSize(16777215, 60)); - addUserFrame->setFrameShape(QFrame::NoFrame); addUserFrame->setLayout(addUserHorLayout); - otherVerLayout = new QVBoxLayout(); - otherVerLayout->setSpacing(0); - otherVerLayout->setContentsMargins(0, 0, 0, 0); - otherVerLayout->addWidget(addUserFrame); - otherVerLayout->addStretch(); - - othersFrame = new QFrame(); - othersFrame->setFixedHeight(60); - othersFrame->setFrameShape(QFrame::Box); - othersFrame->setLayout(otherVerLayout); + othersFrame = new SettingGroup(pluginWidget2); + othersFrame->insertWidget(0, addUserFrame); //界面主布局 mainVerLayout = new QVBoxLayout(pluginWidget2); @@ -366,6 +314,30 @@ void UserInfo::hideComponent() } } +void UserInfo::setNoPwdAndAutoLogin() +{ + // 安全管控 免密登录及自动登录设置项的显示与隐藏 + QVariantMap ModuleMap = Common::getModuleHideStatus(); + QString moduleSettings = ModuleMap.value(name().toLower() + "Settings").toString(); + QStringList setItems = moduleSettings.split(","); + + foreach (QString setItem, setItems) { + QStringList item = setItem.split(":"); + qDebug() << "set item Name: " << item.at(0); + if (item.at(0) == "noPwdLoginFrame") { + nopwdLoginFrame->setVisible(item.at(1) == "true"); + } + if (item.at(0) == "autoLoginFrame") { + if (item.at(1) == "true") { + nopwdLoginFrame->setRadiusType(UkccFrame::None); + } else { + nopwdLoginFrame->setRadiusType(UkccFrame::Bottom); + } + autoLoginFrame->setVisible(item.at(1) == "true"); + } + } +} + void UserInfo::buildAndSetupUsers(){ QMap::iterator it = allUserInfoMap.begin(); @@ -422,20 +394,20 @@ void UserInfo::buildAndSetupUsers(){ currentNickNameLabel->setEnabled(false); changeCurrentGroupsBtn->setEnabled(false); changeCurrentTypeBtn->setEnabled(false); - nopwdLoginSBtn->setEnabled(false); - autoLoginSBtn->setEnabled(false); + nopwdLoginFrame->setEnabled(false); + autoLoginFrame->setEnabled(false); addUserBtn->setEnabled(false); } //设置自动登录状态 - autoLoginSBtn->blockSignals(true); - autoLoginSBtn->setChecked(user.autologin); - autoLoginSBtn->blockSignals(false); + autoLoginFrame->blockSignals(true); + autoLoginFrame->setChecked(user.autologin); + autoLoginFrame->blockSignals(false); //设置免密登录状态 - nopwdLoginSBtn->blockSignals(true); - nopwdLoginSBtn->setChecked(user.noPwdLogin); - nopwdLoginSBtn->blockSignals(false); + nopwdLoginFrame->blockSignals(true); + nopwdLoginFrame->setChecked(user.noPwdLogin); + nopwdLoginFrame->blockSignals(false); //绑定当前用户的属性改变回调 setUserDBusPropertyConnect(user.objpath); @@ -446,6 +418,9 @@ void UserInfo::buildAndSetupUsers(){ } } + setNoPwdAndAutoLogin(); + QDBusConnection::sessionBus().connect(QString(), QString("/"), "org.ukui.ukcc.session.interface", "configChanged", this, SLOT(setNoPwdAndAutoLogin())); + QDBusConnection::systemBus().connect(QString(), QString(), "org.freedesktop.Accounts", "UserAdded", this, SLOT(newUserCreateDoneSlot(QDBusObjectPath))); QDBusConnection::systemBus().connect(QString(), QString(), "org.freedesktop.Accounts", "UserDeleted", this, SLOT(existsUserDeleteDoneSlot(QDBusObjectPath))); } @@ -550,10 +525,9 @@ void UserInfo::buildItemForUsersAndSetConnect(UserInfomation user){ tmpProperty.connection().connect("org.freedesktop.Accounts", user.objpath, "org.freedesktop.DBus.Properties", "PropertiesChanged", utils, SLOT(userPropertyChangedSlot(QString, QMap, QStringList))); - QFrame * newUserFrame = utils->buildItemForUsers(); - othersFrame->setFixedHeight(othersFrame->height() + newUserFrame->height()); + UkccFrame *newUserFrame = utils->buildItemForUsers(); - otherVerLayout->insertWidget(0, newUserFrame); + othersFrame->insertWidget(0, newUserFrame); } void UserInfo::showCreateUserNewDialog(){ @@ -760,19 +734,27 @@ void UserInfo::setUserConnect(){ currentNickNameChangeLabel->installEventFilter(this); connect(currentUserlogoBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(name(), currentUserlogoBtn->objectName(), QString("setting")); + showChangeUserLogoDialog(QString(g_get_user_name()), nullptr); }); connect(changeCurrentPwdBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(name(), changeCurrentPwdBtn->objectName(), QString("setting")); + showChangeUserPwdDialog(QString(g_get_user_name())); }); connect(changeCurrentTypeBtn, &QPushButton::clicked, [=]{ + Common::buriedSettings(name(), changeCurrentTypeBtn->objectName(), QString("setting")); + showChangeUserTypeDialog(QString(g_get_user_name())); }); connect(changeCurrentGroupsBtn, &QPushButton::clicked, this, [=](bool checked){ Q_UNUSED(checked) + Common::buriedSettings(name(), changeCurrentGroupsBtn->objectName(), QString("setting")); + bool reply = polkitEdit(); if (reply) { showChangeGroupDialog(); @@ -780,7 +762,9 @@ void UserInfo::setUserConnect(){ }); //自动登录登录 - connect(autoLoginSBtn, &KSwitchButton::stateChanged, autoLoginSBtn, [=](bool checked){ + connect(autoLoginFrame, &SwitchWidget::stateChanged, this, [=](bool checked){ + Common::buriedSettings(name(), autoLoginFrame->objectName(), QString("setting"), checked ? "true":"false"); + UserInfomation user = allUserInfoMap.value(g_get_user_name()); QString autoUser = getAutomaticLogin(); @@ -790,9 +774,9 @@ void UserInfo::setUserConnect(){ if (checked && !autoUser.isEmpty()){ if (!openAutoLoginMsg(user.username)){ - autoLoginSBtn->blockSignals(true); - autoLoginSBtn->setChecked(false); - autoLoginSBtn->blockSignals(false); + autoLoginFrame->blockSignals(true); + autoLoginFrame->setChecked(false); + autoLoginFrame->blockSignals(false); return; } } @@ -806,14 +790,16 @@ void UserInfo::setUserConnect(){ if (response.type() == QDBusMessage::ErrorMessage){ - autoLoginSBtn->blockSignals(true); - autoLoginSBtn->setChecked(!checked); - autoLoginSBtn->blockSignals(false); + autoLoginFrame->blockSignals(true); + autoLoginFrame->setChecked(!checked); + autoLoginFrame->blockSignals(false); } }); //免密登录 - connect(nopwdLoginSBtn, &KSwitchButton::stateChanged, [=](bool checked){ + connect(nopwdLoginFrame, &SwitchWidget::stateChanged, this, [=](bool checked){ + Common::buriedSettings(name(), nopwdLoginFrame->objectName(), QString("setting"), checked ? "true":"false"); + UserInfomation user = allUserInfoMap.value(g_get_user_name()); QDBusInterface piface("com.control.center.qt.systemdbus", @@ -821,23 +807,25 @@ void UserInfo::setUserConnect(){ "com.control.center.interface", QDBusConnection::systemBus()); if (!piface.isValid()){ - nopwdLoginSBtn->blockSignals(true); - nopwdLoginSBtn->setChecked(!checked); - nopwdLoginSBtn->blockSignals(false); + nopwdLoginFrame->blockSignals(true); + nopwdLoginFrame->setChecked(!checked); + nopwdLoginFrame->blockSignals(false); qCritical() << "Create Client Interface Failed When execute gpasswd: " << QDBusConnection::systemBus().lastError(); return; } - QDBusReply ret = piface.call("setNoPwdLoginStatus", checked, user.username); - if (ret == 0) { - nopwdLoginSBtn->blockSignals(true); - nopwdLoginSBtn->setChecked(!checked); - nopwdLoginSBtn->blockSignals(false); + QDBusReply ret = piface.call("setNoPwdLoginStatus", checked, user.username); + if (ret == false) { + nopwdLoginFrame->blockSignals(true); + nopwdLoginFrame->setChecked(!checked); + nopwdLoginFrame->blockSignals(false); } }); connect(addUserBtn, &AddBtn::clicked, [=]{ + Common::buriedSettings(name(), addUserBtn->objectName(), QString("setting")); + showCreateUserNewDialog(); }); } @@ -886,18 +874,34 @@ void UserInfo::setUserDBusPropertyConnect(const QString pObjPath){ iproperty.connection().connect("org.freedesktop.Accounts", pObjPath, "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT(currentUserPropertyChangedSlot(QString, QMap, QStringList))); + + QDBusInterface ukccProperty("com.control.center.qt.systemdbus", + "/", + "org.freedesktop.DBus.Properties", + QDBusConnection::systemBus()); + ukccProperty.connection().connect("com.control.center.qt.systemdbus", "/", "org.freedesktop.DBus.Properties", "PropertiesChanged", + this, SLOT(ukccPropertyChangedSlot(QString, QMap, QStringList))); } - +void UserInfo::ukccPropertyChangedSlot(QString property, QMap propertyMap, QStringList propertyList) { + qDebug() << "------------key:" << propertyMap.keys(); + Q_UNUSED(property); + Q_UNUSED(propertyList); + if (propertyMap.keys().contains("NoPwdLoginStatus")) { + nopwdLoginFrame->blockSignals(true); + nopwdLoginFrame->setChecked(getNoPwdStatus()); + nopwdLoginFrame->blockSignals(false); + } +} void UserInfo::currentUserPropertyChangedSlot(QString property, QMap propertyMap, QStringList propertyList){ Q_UNUSED(property); Q_UNUSED(propertyList); if (propertyMap.keys().contains("AutomaticLogin") && getuid()){ bool current = propertyMap.value("AutomaticLogin").toBool(); - if (current != autoLoginSBtn->isChecked()){ - autoLoginSBtn->blockSignals(true); - autoLoginSBtn->setChecked(current); - autoLoginSBtn->blockSignals(false); + if (current != autoLoginFrame->isChecked()){ + autoLoginFrame->blockSignals(true); + autoLoginFrame->setChecked(current); + autoLoginFrame->blockSignals(false); } } @@ -969,10 +973,8 @@ void UserInfo::existsUserDeleteDoneSlot(QDBusObjectPath op){ if (obj->objectName() == op.path()){ QFrame * f = qobject_cast(obj); f->setParent(NULL); - otherVerLayout->removeWidget(f); + othersFrame->removeWidget(f); - //重置高度 - othersFrame->setFixedHeight(othersFrame->height() - f->height()); f->hide(); } } @@ -1149,8 +1151,9 @@ UserInfomation UserInfo::_acquireUserInfo(QString objpath){ user.autologin = propertyMap.find("AutomaticLogin").value().toBool(); user.objpath = objpath; - //用户头像为.face且.face文件不存在 - char * iconpath = user.iconfile.toLatin1().data(); + //用户头像文件不存在 使用DEFAULTFACE + std::string iconpathString = user.iconfile.toStdString(); + const char *iconpath = iconpathString.c_str(); if (!g_file_test(iconpath, G_FILE_TEST_EXISTS)){ user.iconfile = DEFAULTFACE; } @@ -1346,6 +1349,8 @@ bool UserInfo::eventFilter(QObject *watched, QEvent *event){ if (mouseEvent->button() == Qt::LeftButton ){ if ((watched == currentNickNameChangeLabel && currentNickNameChangeLabel->isEnabled()) || (watched == currentNickNameLabel && currentNickNameLabel->isEnabled())){ + Common::buriedSettings(name(), currentNickNameChangeLabel->objectName(), QString("setting")); + showChangeUserNicknameDialog(); } } @@ -1362,6 +1367,11 @@ bool UserInfo::getNoPwdStatus() { QDBusConnection::systemBus()); // 获取免密登录状态 QDBusReply noPwdres; + if (!tmpSysinterface.isValid()) { + qDebug() << "Create dbus error: " << QDBusConnection::systemBus().lastError(); + return false; + } + noPwdres = tmpSysinterface.call("getNoPwdLoginStatus"); if (!noPwdres.isValid()) { qDebug() << noPwdres.error(); diff --git a/plugins/account/userinfo/userinfo.h b/plugins/account/userinfo/userinfo.h index 501e3f4..64085a7 100644 --- a/plugins/account/userinfo/userinfo.h +++ b/plugins/account/userinfo/userinfo.h @@ -20,13 +20,15 @@ #ifndef USERINFO_H #define USERINFO_H -#include "widgets/Label/titlelabel.h" -#include "widgets/AddBtn/addbtn.h" -#include "widgets/SwitchButton/switchbutton.h" - #include #include #include +#include +#include +#include +#include +#include +#include #include "changeusertype.h" #include "changeusernickname.h" @@ -36,22 +38,18 @@ #include "deleteuserexists.h" #include "utilsforuserinfo.h" -#include -#include -#include -#include -#include - #include "shell/interface.h" +#include "common.h" +#include "switchwidget.h" +#include "settinggroup.h" +#include "titlelabel.h" +#include "addbtn.h" #include "qtdbus/systemdbusdispatcher.h" #include "qtdbus/userdispatcher.h" #include "changeusergroup.h" -#include "kswitchbutton.h" -using namespace kdk; - #ifdef ENABLEPQ extern "C" { #include @@ -134,9 +132,6 @@ public: public: AddBtn * addUserBtn; - KSwitchButton * nopwdLoginSBtn; - KSwitchButton * autoLoginSBtn; - TitleLabel * currentLabel; TitleLabel * othersLabel; QLabel * currentNickNameLabel; @@ -160,15 +155,13 @@ public: QVBoxLayout * otherVerLayout; QHBoxLayout * addUserHorLayout; - QFrame * currentFrame; - QFrame * currentUserFrame; - QFrame * nopwdLoginFrame; - QFrame * autoLoginFrame; - QFrame * othersFrame; - QFrame * addUserFrame; + SettingGroup * currentFrame; + UkccFrame * currentUserFrame; + SwitchWidget * nopwdLoginFrame; + SwitchWidget * autoLoginFrame; + SettingGroup * othersFrame; + UkccFrame * addUserFrame; - QFrame * splitHLine1; - QFrame * splitHLine2; QFrame * splitVLine1; QFrame * splitVLine2; @@ -204,6 +197,8 @@ private: public slots: void currentUserPropertyChangedSlot(QString, QMap, QStringList); + void ukccPropertyChangedSlot(QString, QMap, QStringList); + void setNoPwdAndAutoLogin(); void newUserCreateDoneSlot(QDBusObjectPath op); void existsUserDeleteDoneSlot(QDBusObjectPath op); diff --git a/plugins/account/userinfo/userinfo.pro b/plugins/account/userinfo/userinfo.pro index 6c233db..6e3de70 100644 --- a/plugins/account/userinfo/userinfo.pro +++ b/plugins/account/userinfo/userinfo.pro @@ -4,6 +4,14 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) + QT += widgets dbus gui @@ -19,6 +27,7 @@ INCLUDEPATH += \ $$PROJECT_ROOTDIR \ LIBS += -L$$[QT_INSTALL_LIBS] -lcrypt -lpolkit-qt5-core-1 -lpam -lpwquality -lkylin_chkname +DEFINES += ENABLEPQ ##加载gio库和gio-unix库 CONFIG += link_pkgconfig \ @@ -31,7 +40,7 @@ PKGCONFIG += gio-2.0 \ #DEFINES += QT_DEPRECATED_WARNINGS -DEFINES += ENABLEPQ + SOURCES += \ changeusergroup.cpp \ changeuserlogo.cpp \ diff --git a/plugins/account/userinfo/userinfo.ui b/plugins/account/userinfo/userinfo.ui index 6e0ec97..2870415 100644 --- a/plugins/account/userinfo/userinfo.ui +++ b/plugins/account/userinfo/userinfo.ui @@ -704,7 +704,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
diff --git a/plugins/account/userinfo/utilsforuserinfo.cpp b/plugins/account/userinfo/utilsforuserinfo.cpp index 27bf419..258d100 100644 --- a/plugins/account/userinfo/utilsforuserinfo.cpp +++ b/plugins/account/userinfo/utilsforuserinfo.cpp @@ -13,11 +13,12 @@ UtilsForUserinfo::UtilsForUserinfo(QObject *parent) : QObject(parent) { - mainItemFrame = new QFrame(); + mainItemFrame = new UkccFrame(nullptr, UkccFrame::Top, true); logoBtn = new QPushButton(); logoBtn->setFixedSize(QSize(50, 50)); logoBtn->setIconSize(QSize(48, 48)); + logoBtn->setObjectName("logo"); nickNameLabel = new QLabel(); nickNameLabel->setFixedHeight(26); @@ -29,29 +30,40 @@ UtilsForUserinfo::UtilsForUserinfo(QObject *parent) : QObject(parent) changePwdBtn = new QPushButton(); changePwdBtn->setFlat(true); changePwdBtn->setText(tr("Passwd")); + changePwdBtn->setObjectName("Passwd"); changeTypeBtn = new QPushButton(); changeTypeBtn->setFlat(true); changeTypeBtn->setText(tr("Type")); + changeTypeBtn->setObjectName("Type"); delUserBtn = new QPushButton(); delUserBtn->setFlat(true); delUserBtn->setText(tr("Del")); + delUserBtn->setObjectName("Del"); connect(changePwdBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(QString("UtilsForUserinfo"), changePwdBtn->objectName(), QString("setting")); + emit changePwdBtnPressed(); }); connect(changeTypeBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(QString("UtilsForUserinfo"), changeTypeBtn->objectName(), QString("setting")); + emit changeTypeBtnPressed(); }); connect(logoBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(QString("UtilsForUserinfo"), logoBtn->objectName(), QString("setting")); + emit changeLogoBtnPressed(); }); connect(delUserBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(QString("UtilsForUserinfo"), delUserBtn->objectName(), QString("setting")); + emit deleteUserBtnPressed(); }); } -QFrame * UtilsForUserinfo::buildItemForUsers(){ +UkccFrame * UtilsForUserinfo::buildItemForUsers(){ //圆形头像遮罩 ElipseMaskWidget * currentElipseMaskWidget = new ElipseMaskWidget(logoBtn); @@ -82,11 +94,8 @@ QFrame * UtilsForUserinfo::buildItemForUsers(){ mainUserVerLayout->setSpacing(0); mainUserVerLayout->setContentsMargins(0, 0, 0, 0); mainUserVerLayout->addLayout(mUserInfoHorLayout); - mainUserVerLayout->addWidget(createHLine(mainItemFrame)); - mainItemFrame->setMinimumSize(QSize(550, 60)); - mainItemFrame->setMaximumSize(QSize(16777215, 60)); - mainItemFrame->setFrameShape(QFrame::NoFrame); + mainItemFrame->setRadiusType(UkccFrame::Top); mainItemFrame->setLayout(mainUserVerLayout); return mainItemFrame; @@ -104,10 +113,9 @@ void UtilsForUserinfo::refreshUserNickname(QString name){ } void UtilsForUserinfo::refreshUserType(int type){ + QString t = _accountTypeIntToString(type); - if (setUtilsTextDynamic(typeLabel, t)){ - typeLabel->setToolTip(t); - } + typeLabel->setText(t); } void UtilsForUserinfo::refreshDelStatus(bool enabled){ diff --git a/plugins/account/userinfo/utilsforuserinfo.h b/plugins/account/userinfo/utilsforuserinfo.h index 1cf52b3..2381cfd 100644 --- a/plugins/account/userinfo/utilsforuserinfo.h +++ b/plugins/account/userinfo/utilsforuserinfo.h @@ -6,6 +6,8 @@ #include #include #include +#include "common.h" +#include "ukccframe.h" class QFrame; class QPushButton; @@ -20,7 +22,7 @@ public: explicit UtilsForUserinfo(QObject *parent = nullptr); public: - QFrame * buildItemForUsers(); + UkccFrame * buildItemForUsers(); void refreshUserLogo(QString logo); void refreshUserNickname(QString name); @@ -31,7 +33,7 @@ public: void setObjectPathData(QString op); public: - QFrame * mainItemFrame; + UkccFrame * mainItemFrame; QPushButton * logoBtn; QPushButton * changeTypeBtn; diff --git a/plugins/account/userinfo_intel/changefaceinteldialog.cpp b/plugins/account/userinfo_intel/changefaceinteldialog.cpp index a5fab6d..1bf77c8 100644 --- a/plugins/account/userinfo_intel/changefaceinteldialog.cpp +++ b/plugins/account/userinfo_intel/changefaceinteldialog.cpp @@ -20,7 +20,7 @@ #include "changefaceinteldialog.h" #include "ui_changefaceinteldialog.h" -#include "widgets/FlowLayout/flowlayout.h" +#include "flowlayout.h" #include "elipsemaskwidget.h" #include diff --git a/plugins/account/userinfo_intel/changefaceinteldialog.h b/plugins/account/userinfo_intel/changefaceinteldialog.h index 56098f4..d4e73c6 100644 --- a/plugins/account/userinfo_intel/changefaceinteldialog.h +++ b/plugins/account/userinfo_intel/changefaceinteldialog.h @@ -29,10 +29,10 @@ #include #include #include -#include "widgets/FlowLayout/flowlayout.h" +#include "flowlayout.h" #include #include -#include "widgets/ImageUtil/imageutil.h" +#include "imageutil.h" #define UKUI_QT_STYLE "org.ukui.style" #define UKUI_STYLE_KEY "style-name" diff --git a/plugins/account/userinfo_intel/changegroupinteldialog.cpp b/plugins/account/userinfo_intel/changegroupinteldialog.cpp index d5e21ce..4446fc9 100644 --- a/plugins/account/userinfo_intel/changegroupinteldialog.cpp +++ b/plugins/account/userinfo_intel/changegroupinteldialog.cpp @@ -21,7 +21,7 @@ #include "changegroupinteldialog.h" #include "ui_changegroupinteldialog.h" #include "definegroupitemintel.h" -#include "widgets/ImageUtil/imageutil.h" +#include "imageutil.h" //#include "group_manager_client.h" #include "creategroupinteldialog.h" diff --git a/plugins/account/userinfo_intel/changegroupinteldialog.h b/plugins/account/userinfo_intel/changegroupinteldialog.h index eac2f68..933ce68 100644 --- a/plugins/account/userinfo_intel/changegroupinteldialog.h +++ b/plugins/account/userinfo_intel/changegroupinteldialog.h @@ -27,7 +27,7 @@ #include #include -#include "widgets/HoverWidget/hoverwidget.h" +#include "hoverwidget.h" //struct custom_struct //{ diff --git a/plugins/account/userinfo_intel/userinfo_intel.cpp b/plugins/account/userinfo_intel/userinfo_intel.cpp index 03611c9..c8833c7 100644 --- a/plugins/account/userinfo_intel/userinfo_intel.cpp +++ b/plugins/account/userinfo_intel/userinfo_intel.cpp @@ -33,8 +33,8 @@ #include #include -#include "widgets/SwitchButton/switchbutton.h" -#include "widgets/ImageUtil/imageutil.h" +#include "switchbutton.h" +#include "imageutil.h" #include "elipsemaskwidget.h" #include "passwdcheckutil.h" @@ -126,7 +126,7 @@ const QString UserInfoIntel::name() const { bool UserInfoIntel::isShowOnHomePage() const { - return isIntel(); + return Common::isTablet(); } QIcon UserInfoIntel::icon() const @@ -136,7 +136,7 @@ QIcon UserInfoIntel::icon() const bool UserInfoIntel::isEnable() const { - return isIntel(); + return Common::isTablet(); } void UserInfoIntel::initSearchText() { diff --git a/plugins/account/userinfo_intel/userinfo_intel.h b/plugins/account/userinfo_intel/userinfo_intel.h index 33fb15c..6ebe2fb 100644 --- a/plugins/account/userinfo_intel/userinfo_intel.h +++ b/plugins/account/userinfo_intel/userinfo_intel.h @@ -48,10 +48,12 @@ #include "changevalidinteldialog.h" #include "deluserinteldialog.h" #include "createuserinteldialog.h" -#include "widgets/HoverWidget/hoverwidget.h" +#include "hoverwidget.h" #include "picturetowhite.h" #include "messageboxpowerintel.h" +#include "common.h" + #ifdef ENABLEPQ extern "C" { #include @@ -130,13 +132,6 @@ public: QIcon icon() const Q_DECL_OVERRIDE; bool isEnable() const Q_DECL_OVERRIDE; - bool isIntel() const - { - QString sysVersion = "/etc/apt/ota_version"; - QFile file(sysVersion); - return file.exists(); - } - public: void initSearchText(); void initComponent(); diff --git a/plugins/account/userinfo_intel/userinfo_intel.pro b/plugins/account/userinfo_intel/userinfo_intel.pro index c6802de..19e8556 100644 --- a/plugins/account/userinfo_intel/userinfo_intel.pro +++ b/plugins/account/userinfo_intel/userinfo_intel.pro @@ -4,6 +4,11 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SwitchButton/switchbutton.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets dbus gui network diff --git a/plugins/application/autoboot/addautoboot.cpp b/plugins/application/autoboot/addautoboot.cpp index ac4f152..2f6eda4 100644 --- a/plugins/application/autoboot/addautoboot.cpp +++ b/plugins/application/autoboot/addautoboot.cpp @@ -18,7 +18,7 @@ * */ #include "addautoboot.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include #include diff --git a/plugins/application/autoboot/addautoboot.h b/plugins/application/autoboot/addautoboot.h index e2b1e49..220fd0a 100644 --- a/plugins/application/autoboot/addautoboot.h +++ b/plugins/application/autoboot/addautoboot.h @@ -27,7 +27,7 @@ #include #include #include -#include "widgets/Label/fixlabel.h" +#include "fixlabel.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 **/ diff --git a/plugins/application/autoboot/autoboot.cpp b/plugins/application/autoboot/autoboot.cpp index 1cbce72..02c0bf7 100644 --- a/plugins/application/autoboot/autoboot.cpp +++ b/plugins/application/autoboot/autoboot.cpp @@ -18,10 +18,6 @@ * */ #include "autoboot.h" -#include "widgets/SwitchButton/switchbutton.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/ImageUtil/imageutil.h" -#include "shell/utils/mthread.h" #include #include @@ -35,6 +31,8 @@ #include #include #include "rmenu.h" +#include "imageutil.h" +#include "mthread.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 @@ -59,6 +57,9 @@ using namespace kdk; #define THEME_QT_SCHEMA "org.ukui.style" #define THEME_GTK_SCHEMA "org.mate.interface" +#define UKCC_SCHEMA "org.ukui.control-center" +#define UKCC_AUTOAPP_EKY "autoapp-list" + #define ICON_QT_KEY "icon-theme-name" #define ICON_GTK_KEY "icon-theme" @@ -94,6 +95,9 @@ AutoBoot::AutoBoot() : mFirstLoad(true) AutoBoot::~AutoBoot() { if (!mFirstLoad) { + if (mUkccSettings && mUkccSettings->keys().contains("autoappList")) { + mUkccSettings->set(UKCC_AUTOAPP_EKY, mAutoAppList); + } } } @@ -119,9 +123,9 @@ QWidget *AutoBoot::pluginUi() whitelist.append("kylin-weather.desktop"); initConfig(); connectToServer(); + setupGSettings(); initUI(pluginWidget); initStyle(); - setupGSettings(); initConnection(); } return pluginWidget; @@ -151,40 +155,16 @@ bool AutoBoot::isEnable() const void AutoBoot::initUI(QWidget *widget) { QVBoxLayout *mverticalLayout = new QVBoxLayout(widget); - mverticalLayout->setSpacing(0); + mverticalLayout->setSpacing(8); mverticalLayout->setContentsMargins(0, 0, 0, 0); - - QWidget *AutobootWidget = new QWidget(widget); - AutobootWidget->setMinimumSize(QSize(550, 0)); - AutobootWidget->setMaximumSize(QSize(16777215, 16777215)); - - QVBoxLayout *AutobootLayout = new QVBoxLayout(AutobootWidget); - AutobootLayout->setContentsMargins(0, 0, 0, 0); - AutobootLayout->setSpacing(0); - - mTitleLabel = new TitleLabel(AutobootWidget); - - mAutoBootFrame = new QFrame(AutobootWidget); - mAutoBootFrame->setMinimumSize(QSize(550, 0)); - mAutoBootFrame->setMaximumSize(QSize(16777215, 16777215)); - mAutoBootFrame->setFrameShape(QFrame::Box); - - mAutoBootLayout = new QVBoxLayout(mAutoBootFrame); - mAutoBootLayout->setContentsMargins(0, 0, 0, 0); - mAutoBootLayout->setSpacing(0); - + mTitleLabel = new TitleLabel(widget); + mAutobootWidget = new SettingGroup(widget); + initAutoUI(); initAddBtn(); - AutobootLayout->addWidget(mTitleLabel); - AutobootLayout->addSpacing(8); - AutobootLayout->addWidget(mAutoBootFrame); - AutobootLayout->addWidget(addWgt); - - mverticalLayout->addWidget(AutobootWidget); + mverticalLayout->addWidget(mTitleLabel); + mverticalLayout->addWidget(mAutobootWidget); mverticalLayout->addStretch(); - - initAutoUI(); - } @@ -192,107 +172,98 @@ void AutoBoot::initAutoUI() { initStatus(); appgroupMultiMaps.clear(); - QSignalMapper *checkSignalMapper = new QSignalMapper(this); + checkSignalMapper = new QSignalMapper(this); // 构建每个启动项 - QMap::iterator it = statusMaps.begin(); - for (int index = 0; it != statusMaps.end(); it++, index++) { - QString bname = it.value().bname; - QString appName = it.value().name; + QMap::iterator iter; - QFrame *baseWidget = new QFrame(pluginWidget); - baseWidget->setMinimumWidth(550); - baseWidget->setMaximumWidth(16777215); - baseWidget->setFrameShape(QFrame::NoFrame); - baseWidget->setAttribute(Qt::WA_DeleteOnClose); + for (QMap::iterator it = statusMaps.begin(); it != statusMaps.end(); it++) { + if (!mAutoAppList.contains(it.value().bname)) + mAutoAppList.append(it.value().bname); + } - QVBoxLayout *baseVerLayout = new QVBoxLayout(baseWidget); - baseVerLayout->setSpacing(0); - baseVerLayout->setContentsMargins(0, 0, 0, 2); - - HoverWidget *widget = new HoverWidget(bname); - widget->setMinimumWidth(550); - widget->setMaximumWidth(16777215); - - widget->setMinimumHeight(60); - widget->setMaximumHeight(60); - - widget->setAttribute(Qt::WA_DeleteOnClose); - - QHBoxLayout *mainHLayout = new QHBoxLayout(widget); - mainHLayout->setContentsMargins(16, 0, 16, 0); - mainHLayout->setSpacing(16); - - QLabel *iconLabel = new QLabel(widget); - iconLabel->setFixedSize(32, 32); - iconLabel->setPixmap(it.value().pixmap); - - QLabel *textLabel = new QLabel(widget); - textLabel->setFixedWidth(500); - textLabel->setText(appName); - - KSwitchButton *button = new KSwitchButton(widget); - button->setAttribute(Qt::WA_DeleteOnClose); - button->setChecked(!it.value().hidden); - checkSignalMapper->setMapping(button, it.key()); - connect(button, SIGNAL(stateChanged(bool)), checkSignalMapper, SLOT(map())); - appgroupMultiMaps.insert(it.key(), button); - - QToolButton *deBtn = new QToolButton(widget); - deBtn->setStyleSheet("QToolButton:!checked{background-color: palette(base)}"); - deBtn->setProperty("useButtonPalette", true); - deBtn->setPopupMode(QToolButton::InstantPopup); - deBtn->setFixedSize(QSize(36, 36)); - deBtn->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); - - RMenu *pMenu = new RMenu(deBtn); - - deBtn->setMenu(pMenu); - QAction* mDel = new QAction(tr("Delete"),this); - pMenu->addAction(mDel); - connect(mDel, &QAction::triggered, this, [=](){ - QMap::iterator it = statusMaps.find(bname); - if (it == statusMaps.end()) { - qDebug() << "AutoBoot Data Error"; - return; - } - deleteLocalAutoapp(bname); - baseWidget->close(); - }); - - mainHLayout->addWidget(iconLabel); - mainHLayout->addWidget(textLabel); - mainHLayout->addStretch(); - if (it.value().xdg_position == LOCALPOS) { - mainHLayout->addWidget(deBtn); - } else { - deBtn->hide(); + for (QString str : mAutoAppList) { + iter = statusMaps.find(str); + if (iter != statusMaps.end()) { + initItem(iter.value()); } - - mainHLayout->addWidget(button); - widget->setLayout(mainHLayout); - - QFrame *line = new QFrame(pluginWidget); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - baseVerLayout->addWidget(widget); - - baseVerLayout->addWidget(line); - - baseWidget->setLayout(baseVerLayout); - - mAutoBootLayout->addWidget(baseWidget); } connect(checkSignalMapper, SIGNAL(mapped(QString)), this, SLOT(checkbox_changed_cb(QString))); } +void AutoBoot::initItem(AutoApp &it) +{ + QString bname = it.bname; + QString appName = it.name; + + SwitchWidget *baseWidget = new SwitchWidget(appName); + + QLabel *iconLabel = new QLabel(baseWidget); + iconLabel->setFixedSize(32, 32); + setAutoPixmap(it.pixmap, it.icon); + iconLabel->setPixmap(it.pixmap); + if (mQtSettings) { + connect(mQtSettings, &QGSettings::changed, this, [=, &it](const QString &key) { + if (key == "iconThemeName") { + setAutoPixmap(it.pixmap, it.icon); + iconLabel->setPixmap(it.pixmap); + } + }); + } + baseWidget->insertWidget(0, iconLabel); + + baseWidget->setChecked(!it.hidden); + checkSignalMapper->setMapping(baseWidget, bname); + connect(baseWidget, SIGNAL(stateChanged(bool)), checkSignalMapper, SLOT(map())); + appgroupMultiMaps.insert(bname, baseWidget); + + QToolButton *deBtn = new QToolButton(baseWidget); + deBtn->setStyleSheet("QToolButton:!checked{background-color: palette(base)}"); + deBtn->setProperty("useButtonPalette", true); + deBtn->setPopupMode(QToolButton::InstantPopup); + deBtn->setFixedSize(QSize(36, 36)); + deBtn->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); + + RMenu *pMenu = new RMenu(deBtn); + + deBtn->setMenu(pMenu); + QAction* mDel = new QAction(tr("Delete"),this); + pMenu->addAction(mDel); + connect(mDel, &QAction::triggered, this, [=](){ + Common::buriedSettings(name(), "autoboot item " + bname, QString("settings"), "delete from list"); + QMap::iterator iter = statusMaps.find(bname); + if (iter == statusMaps.end()) { + qDebug() << "AutoBoot Data Error"; + return; + } + deleteLocalAutoapp(bname); + appgroupMultiMaps.erase(appgroupMultiMaps.find(bname)); + mAutoAppList.removeOne(bname); + baseWidget->close(); + }); + + if (it.xdg_position == LOCALPOS) { + baseWidget->insertWidget(2, deBtn, 1, Qt::AlignRight); + } else { + deBtn->hide(); + } + mAutobootWidget->addWidget(baseWidget); +} + void AutoBoot::setupGSettings() { const QByteArray id(THEME_QT_SCHEMA); - mQtSettings = new QGSettings(id, QByteArray(), this); + const QByteArray iid(UKCC_SCHEMA); + + if (QGSettings::isSchemaInstalled(id) && + QGSettings::isSchemaInstalled(iid)) { + + mQtSettings = new QGSettings(id, QByteArray(), this); + mUkccSettings = new QGSettings(iid, QByteArray(), this); + if (mUkccSettings->keys().contains("autoappList")) { + mAutoAppList.clear(); + mAutoAppList = mUkccSettings->get(UKCC_AUTOAPP_EKY).toStringList(); + } + } } AutoApp AutoBoot::setInformation(QString filepath) @@ -327,20 +298,9 @@ AutoApp AutoBoot::setInformation(QString filepath) } } app.shown = mshow; + app.icon = icon; - QFileInfo iconfile(icon); - - if (!QString(icon).isEmpty()) { - QIcon currenticon - = QIcon::fromTheme(icon, - QIcon(QString("/usr/share/pixmaps/"+icon - +".png"))); - app.pixmap = currenticon.pixmap(QSize(32, 32)); - } else if (iconfile.exists()) { - app.pixmap = QPixmap(iconfile.filePath()).scaled(32, 32); - } else { - app.pixmap = QPixmap(QString(":/img/plugins/autoboot/desktop.png")); - } + setAutoPixmap(app.pixmap, icon); delete desktopFile; desktopFile = nullptr; @@ -359,6 +319,22 @@ AutoApp AutoBoot::setInformation(QString filepath) } +void AutoBoot::setAutoPixmap(QPixmap &pixmap, const QString &icon) +{ + QFileInfo iconfile(icon); + if (!QString(icon).isEmpty()) { + QIcon currenticon + = QIcon::fromTheme(icon, + QIcon(QString("/usr/share/pixmaps/"+icon + +".png"))); + pixmap = currenticon.pixmap(QSize(32, 32)); + } else if (iconfile.exists()) { + pixmap = QPixmap(iconfile.filePath()).scaled(32, 32); + } else { + pixmap = QPixmap(QString(":/img/plugins/autoboot/desktop.png")); + } +} + bool AutoBoot::copyFileToLocal(QString bname) { QString srcPath; @@ -454,9 +430,9 @@ bool AutoBoot::setAutoAppStatus(QString bname, bool status) void AutoBoot::clearAutoItem() { - if (mAutoBootLayout->layout() != NULL) { + if (mAutobootWidget->layout() != NULL) { QLayoutItem *item; - while ((item = mAutoBootLayout->layout()->takeAt(0)) != NULL) + while ((item = mAutobootWidget->layout()->takeAt(0)) != NULL) { if(item->widget()) { item->widget()->setParent(NULL); @@ -480,8 +456,10 @@ void AutoBoot::open_desktop_dir_slots() fd->setWindowTitle(tr("select autoboot desktop")); fd->setLabelText(QFileDialog::Accept, tr("Select")); fd->setLabelText(QFileDialog::Reject, tr("Cancel")); - if (fd->exec() != QDialog::Accepted) + if (fd->exec() != QDialog::Accepted) { return; + } + QString selectedfile; selectedfile = fd->selectedFiles().first(); @@ -539,13 +517,14 @@ void AutoBoot::checkbox_changed_cb(QString bname) { foreach (QString key, appgroupMultiMaps.keys()) { if (key == bname) { + Common::buriedSettings(name(), "whether " + bname + " auto startup", QString("settings"), ((KSwitchButton *)appgroupMultiMaps.value(key))->isChecked() ? "true" : "false"); QMap::iterator it = statusMaps.find(bname); if (it == statusMaps.end()) { qDebug() << "AutoBoot Data Error"; return; } - if (((KSwitchButton *)appgroupMultiMaps.value(key))->isChecked()) { // 开启开机启动 + if (((SwitchWidget *)appgroupMultiMaps.value(key))->isChecked()) { // 开启开机启动 if (it.value().xdg_position == SYSTEMPOS) { // } else if (it.value().xdg_position == ALLPOS) { // 从~/.config/autostart目录下删除 QMap::iterator appit = appMaps.find(bname); @@ -588,6 +567,7 @@ void AutoBoot::keyChangedSlot(const QString &key) if (key == "boot") { clearAutoItem(); initAutoUI(); + initAddBtn(); } } @@ -613,17 +593,29 @@ void AutoBoot::add_autoboot_realize_slot(QString path, QString name, QString exe QString filepath = QDir::homePath()+LOCAL_CONFIG_DIR+mFileName; if(!QFile::copy(path,filepath)) return; - clearAutoItem(); - initAutoUI(); + Common::buriedSettings(QStringLiteral("Autoboot"), mFileName, QString("settings"), "add to autoboot list"); + AutoApp app; + app = setInformation(filepath); + app.xdg_position = LOCALPOS; + statusMaps.insert(statusMaps.end(), app.bname, app); + mAutoAppList.append(app.bname); + mAutobootWidget->removeWidget(addWgt); + initItem(app); + mAutobootWidget->addWidget(addWgt); } void AutoBoot::initAddBtn() { - addWgt = new AddBtn(pluginWidget); - addWgt->setBtnStyle(AddBtn::Bottom); - //~ contents_path /autoboot/Add - tr("Add"); // 用于添加搜索索引 - connect(addWgt, &AddBtn::clicked, this, &AutoBoot::open_desktop_dir_slots); + //~ contents_path /Autoboot/Add + addWgt = new UkccFrame(mAutobootWidget); + addWgt->setLineWidth(0); + QHBoxLayout *Lyt = new QHBoxLayout(addWgt); + Lyt->setContentsMargins(0, 0, 0, 0); + AddBtn *addBtn = new AddBtn(pluginWidget); + addBtn->setBtnStyle(AddBtn::Bottom); + Lyt->addWidget(addBtn); + mAutobootWidget->addWidget(addWgt); + connect(addBtn, &AddBtn::clicked, this, &AutoBoot::open_desktop_dir_slots); } void AutoBoot::initStyle() @@ -653,6 +645,8 @@ void AutoBoot::initStatus() for( QString file_name : whitelist) { AutoApp app; + if (!QFile(SYSTEM_CONFIG_DIR+file_name).exists() && file_name == "kylin-weather.desktop") + file_name = "indicator-china-weather.desktop";; app = setInformation(SYSTEM_CONFIG_DIR+file_name); if (app.name.isEmpty()) continue; @@ -721,13 +715,6 @@ void AutoBoot::initStatus() void AutoBoot::initConnection() { - connect(mQtSettings, &QGSettings::changed, this, [=](const QString &key) { - if (key == "iconThemeName") { - clearAutoItem(); - initAutoUI(); - } - }); - connect(this, &AutoBoot::autoboot_adding_signals, this, &AutoBoot::add_autoboot_realize_slot); } diff --git a/plugins/application/autoboot/autoboot.h b/plugins/application/autoboot/autoboot.h index dc1f18c..db4e316 100644 --- a/plugins/application/autoboot/autoboot.h +++ b/plugins/application/autoboot/autoboot.h @@ -24,11 +24,16 @@ #include #include "shell/interface.h" +#include "common.h" #include "datadefined.h" //#include "addautoboot.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/AddBtn/addbtn.h" +#include "titlelabel.h" +#include "hoverwidget.h" +#include "addbtn.h" +#include "switchwidget.h" +#include "settinggroup.h" +#include "ukccframe.h" + #include #include @@ -71,8 +76,8 @@ private: void initAddBtn(); void initStyle(); void initUI(QWidget *widget); - void initAutoUI(); + void initItem(AutoApp &it); void initStatus(); void initConnection(); void connectToServer(); @@ -80,6 +85,7 @@ private: void setupGSettings(); AutoApp setInformation(QString filepath); + void setAutoPixmap(QPixmap &pixmap, const QString &icon); bool copyFileToLocal(QString bname); bool deleteLocalAutoapp(QString bname); bool setAutoAppStatus(QString bname, bool status); @@ -88,6 +94,7 @@ private: private: Ui::AutoBoot *ui; + SettingGroup *mAutobootWidget; QString pluginName; int pluginType; @@ -101,17 +108,16 @@ private: QMap statusMaps; QMultiMap appgroupMultiMaps; - AddBtn *addWgt; + QSignalMapper *checkSignalMapper; + UkccFrame *addWgt; TitleLabel *mTitleLabel; - QFrame *mAutoBootFrame; - QVBoxLayout *mAutoBootLayout; bool mFirstLoad; - QGSettings *mQtSettings; - + QGSettings *mUkccSettings; QStringList whitelist; + QStringList mAutoAppList; public slots: void checkbox_changed_cb(QString bname); diff --git a/plugins/application/autoboot/autoboot.pro b/plugins/application/autoboot/autoboot.pro index 2a2ad79..335542d 100644 --- a/plugins/application/autoboot/autoboot.pro +++ b/plugins/application/autoboot/autoboot.pro @@ -4,6 +4,13 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) QT += widgets svg dbus TEMPLATE = lib diff --git a/plugins/application/autoboot/datadefined.h b/plugins/application/autoboot/datadefined.h index 23994d7..ceed423 100644 --- a/plugins/application/autoboot/datadefined.h +++ b/plugins/application/autoboot/datadefined.h @@ -38,6 +38,7 @@ typedef struct _AutoApp{ bool shown; bool hidden; + QString icon; QString name; QString comment; QPixmap pixmap; diff --git a/plugins/application/autoboot/rmenu.cpp b/plugins/application/autoboot/rmenu.cpp index 72909cf..e1587d1 100644 --- a/plugins/application/autoboot/rmenu.cpp +++ b/plugins/application/autoboot/rmenu.cpp @@ -1,6 +1,8 @@ #include "rmenu.h" #include #include +#include +#include RMenu::RMenu(QWidget *parent): QMenu(parent) @@ -10,8 +12,14 @@ RMenu::RMenu(QWidget *parent): void RMenu::showEvent(QShowEvent *event) { + QDesktopWidget* m = QApplication::desktop(); + QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos())); + int desk_x = desk_rect.width(); int menuXPos = this->pos().x(); - int menuWidth = this->size().width()-4; + int menuWidth = this->size().width() - 4; + + if (menuXPos < menuWidth || menuXPos >= (desk_x - this->size().width() - 4)) + return QMenu::showEvent(event); int buttonWidth = 36; QPoint pos = QPoint(menuXPos - menuWidth + buttonWidth, this->pos().y()); diff --git a/plugins/application/defaultapp/defaultapp.cpp b/plugins/application/defaultapp/defaultapp.cpp index 5f8b5eb..c1d380f 100644 --- a/plugins/application/defaultapp/defaultapp.cpp +++ b/plugins/application/defaultapp/defaultapp.cpp @@ -22,6 +22,7 @@ #include #include #include "defaultapp.h" +#include "common.h" #define BROWSERTYPE "x-scheme-handler/http" #define MAILTYPE "x-scheme-handler/mailto" @@ -33,6 +34,7 @@ #define DESKTOPPATH "/usr/share/applications/" #define LOCAL_CONFIG_DIR "/.config/" +#define LOCAL_APP_DIR "/.local/share/applications/" #define SYSTEM_CONFIG_DIR "/usr/share/applications/" DefaultApp::DefaultApp() : mFirstLoad(true) @@ -100,167 +102,28 @@ void DefaultApp::initUi(QWidget *widget) mverticalLayout->setSpacing(8); mverticalLayout->setContentsMargins(0, 0, 0, 0); - mTitleLabel = new TitleLabel(widget); + TitleLabel *mTitleLabel = new TitleLabel(widget); + mTitleLabel->setText(QApplication::translate("DefaultAppWindow", "Select Default Application", nullptr)); + SettingGroup *mDefaultFrame = new SettingGroup(widget); - QFrame *mDefaultFrame = new QFrame(widget); - mDefaultFrame->setMinimumSize(QSize(550, 0)); - mDefaultFrame->setMaximumSize(QSize(16777215, 16777215)); - mDefaultFrame->setFrameShape(QFrame::Box); - - QVBoxLayout *mDefaultLyt = new QVBoxLayout(mDefaultFrame); - mDefaultLyt->setContentsMargins(0, 0, 0, 0); - mDefaultLyt->setSpacing(0); - - mBrowserFrame = new QFrame(mDefaultFrame); - mBrowserFrame->setMinimumSize(QSize(550, 60)); - mBrowserFrame->setMaximumSize(QSize(16777215, 60)); - mBrowserFrame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *mBrowserLyt = new QHBoxLayout(mBrowserFrame); - mBrowserLyt->setContentsMargins(16, 0, 16, 0); - mBrowserLyt->setSpacing(0); - - mBrowserLabel = new FixLabel(mBrowserFrame); - mBrowserLabel->setFixedSize(180,60); - - mBrowserCombo = new QComboBox(mBrowserFrame); - mBrowserCombo->setFixedHeight(40); - - mBrowserLyt->addWidget(mBrowserLabel); - mBrowserLyt->addWidget(mBrowserCombo); - - QFrame *line_1 = setLine(mDefaultFrame); - - mMailFrame = new QFrame(mDefaultFrame); - mMailFrame->setMinimumSize(QSize(550, 60)); - mMailFrame->setMaximumSize(QSize(16777215, 60)); - mMailFrame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *mMailLyt = new QHBoxLayout(mMailFrame); - mMailLyt->setContentsMargins(16, 0, 16, 0); - mMailLyt->setSpacing(0); - - mMailLabel = new FixLabel(mMailFrame); - mMailLabel->setFixedSize(180,60); - - mMailCombo = new QComboBox(mMailFrame); - mMailCombo->setFixedHeight(40); - - mMailLyt->addWidget(mMailLabel); - mMailLyt->addWidget(mMailCombo); - - QFrame *line_2 = setLine(mDefaultFrame); - - mImageFrame = new QFrame(mDefaultFrame); - mImageFrame->setMinimumSize(QSize(550, 60)); - mImageFrame->setMaximumSize(QSize(16777215, 60)); - mImageFrame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *mImageLyt = new QHBoxLayout(mImageFrame); - mImageLyt->setContentsMargins(16, 0, 16, 0); - mImageLyt->setSpacing(0); - - mImageLabel = new FixLabel(mImageFrame); - mImageLabel->setFixedSize(180,60); - - mImageCombo = new QComboBox(mImageFrame); - mImageCombo->setFixedHeight(40); - - mImageLyt->addWidget(mImageLabel); - mImageLyt->addWidget(mImageCombo); - - QFrame *line_3 = setLine(mDefaultFrame); - - mAudioFrame = new QFrame(mDefaultFrame); - mAudioFrame->setMinimumSize(QSize(550, 60)); - mAudioFrame->setMaximumSize(QSize(16777215, 60)); - mAudioFrame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *mAudioLyt = new QHBoxLayout(mAudioFrame); - mAudioLyt->setContentsMargins(16, 0, 16, 0); - mAudioLyt->setSpacing(0); - - mAudioLabel = new FixLabel(mAudioFrame); - mAudioLabel->setFixedSize(180,60); - - mAudioCombo = new QComboBox(mAudioFrame); - mAudioCombo->setFixedHeight(40); - - mAudioLyt->addWidget(mAudioLabel); - mAudioLyt->addWidget(mAudioCombo); - - QFrame *line_4 = setLine(mDefaultFrame); - - mVideoFrame = new QFrame(mDefaultFrame); - mVideoFrame->setMinimumSize(QSize(550, 60)); - mVideoFrame->setMaximumSize(QSize(16777215, 60)); - mVideoFrame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *mVideoLyt = new QHBoxLayout(mVideoFrame); - mVideoLyt->setContentsMargins(16, 0, 16, 0); - mVideoLyt->setSpacing(0); - - mVideoLabel = new FixLabel(mVideoFrame); - mVideoLabel->setFixedSize(180,60); - - mVideoCombo = new QComboBox(mVideoFrame); - mVideoCombo->setFixedHeight(40); - - mVideoLyt->addWidget(mVideoLabel); - mVideoLyt->addWidget(mVideoCombo); - - QFrame *line_5 = setLine(mDefaultFrame); - - mTextFrame = new QFrame(mDefaultFrame); - mTextFrame->setMinimumSize(QSize(550, 60)); - mTextFrame->setMaximumSize(QSize(16777215, 60)); - mTextFrame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *mTextLyt = new QHBoxLayout(mTextFrame); - mTextLyt->setContentsMargins(16, 0, 16, 0); - mTextLyt->setSpacing(0); - - mTextLabel = new FixLabel(mTextFrame); - mTextLabel->setFixedSize(180,60); - - mTextCombo = new QComboBox(mTextFrame); - mTextCombo->setFixedHeight(40); - - mTextLyt->addWidget(mTextLabel); - mTextLyt->addWidget(mTextCombo); + mBrowserFrame = new ComboxWidget(tr("Browser")); + mMailFrame = new ComboxWidget(tr("Mail")); + mImageFrame = new ComboxWidget(tr("Image Viewer")); + mAudioFrame = new ComboxWidget(tr("Audio Player")); + mVideoFrame = new ComboxWidget(tr("Video Player")); + mTextFrame = new ComboxWidget(tr("Text Editor")); // 恢复默认 - mResetFrame = new QFrame(mDefaultFrame); - mResetFrame->setMinimumSize(QSize(550, 60)); - mResetFrame->setMaximumSize(QSize(16777215, 60)); - mResetFrame->setFrameShape(QFrame::NoFrame); + mResetFrame = new PushButtonWidget(tr("Reset default apps to system recommended apps")); + mResetFrame->setButtonText(tr("Reset")); - QHBoxLayout *mResetLyt = new QHBoxLayout(mResetFrame); - mResetLyt->setContentsMargins(16, 0, 16, 0); - mResetLyt->setSpacing(0); - - FixLabel *mResetLabel = new FixLabel(tr("Reset default apps to system recommended apps"), mResetFrame); - mResetBtn= new QPushButton(tr("Reset"), mResetFrame); - mResetBtn->setFixedWidth(100); - - mResetLyt->addWidget(mResetLabel); - mResetLyt->addWidget(mResetBtn); - - QFrame *line_6 = setLine(mDefaultFrame); - - mDefaultLyt->addWidget(mBrowserFrame); - mDefaultLyt->addWidget(line_1); - mDefaultLyt->addWidget(mMailFrame); - mDefaultLyt->addWidget(line_2); - mDefaultLyt->addWidget(mImageFrame); - mDefaultLyt->addWidget(line_3); - mDefaultLyt->addWidget(mAudioFrame); - mDefaultLyt->addWidget(line_4); - mDefaultLyt->addWidget(mVideoFrame); - mDefaultLyt->addWidget(line_5); - mDefaultLyt->addWidget(mTextFrame); - mDefaultLyt->addWidget(line_6); - mDefaultLyt->addWidget(mResetFrame); + mDefaultFrame->addWidget(mBrowserFrame); + mDefaultFrame->addWidget(mMailFrame); + mDefaultFrame->addWidget(mImageFrame); + mDefaultFrame->addWidget(mAudioFrame); + mDefaultFrame->addWidget(mVideoFrame); + mDefaultFrame->addWidget(mTextFrame); + mDefaultFrame->addWidget(mResetFrame); mverticalLayout->addWidget(mTitleLabel); mverticalLayout->addWidget(mDefaultFrame); @@ -269,78 +132,68 @@ void DefaultApp::initUi(QWidget *widget) /* 建立对应的信号槽 */ void DefaultApp::initSlots() { - connect(mBrowserCombo, static_cast (&QComboBox::currentIndexChanged), this, &DefaultApp::browserComBoBox_changed_cb); - connect(mMailCombo, static_cast (&QComboBox::currentIndexChanged), this, &DefaultApp::mailComBoBox_changed_cb); - connect(mImageCombo, static_cast (&QComboBox::currentIndexChanged), this, &DefaultApp::imageComBoBox_changed_cb); - connect(mAudioCombo, static_cast (&QComboBox::currentIndexChanged), this, &DefaultApp::audioComBoBox_changed_cb); - connect(mVideoCombo, static_cast (&QComboBox::currentIndexChanged), this, &DefaultApp::videoComBoBox_changed_cb); - connect(mTextCombo, static_cast (&QComboBox::currentIndexChanged), this, &DefaultApp::textComBoBox_changed_cb); - connect(mResetBtn, &QPushButton::clicked, this, &DefaultApp::reset); + connect(mBrowserFrame, &ComboxWidget::currentIndexChanged, this, &DefaultApp::browserComBoBox_changed_cb); + connect(mMailFrame, &ComboxWidget::currentIndexChanged, this, &DefaultApp::mailComBoBox_changed_cb); + connect(mImageFrame, &ComboxWidget::currentIndexChanged, this, &DefaultApp::imageComBoBox_changed_cb); + connect(mAudioFrame, &ComboxWidget::currentIndexChanged, this, &DefaultApp::audioComBoBox_changed_cb); + connect(mVideoFrame, &ComboxWidget::currentIndexChanged, this, &DefaultApp::videoComBoBox_changed_cb); + connect(mTextFrame, &ComboxWidget::currentIndexChanged, this, &DefaultApp::textComBoBox_changed_cb); + connect(mResetFrame, &PushButtonWidget::clicked, this, &DefaultApp::reset); } /* 初始化各默认应用 */ void DefaultApp::initDefaultUI() { // 若默认应用被卸载,显示"选择默认应用",若不存在其它应用,则显示"无可用程序" - QTime timedebuge;//声明一个时钟对象 timedebuge.start();//开始计时 - mBrowserCombo->blockSignals(true); - mImageCombo->blockSignals(true); - mMailCombo->blockSignals(true); - mAudioCombo->blockSignals(true); - mVideoCombo->blockSignals(true); - mTextCombo->blockSignals(true); + mBrowserFrame->blockSignals(true); + mImageFrame->blockSignals(true); + mMailFrame->blockSignals(true); + mAudioFrame->blockSignals(true); + mVideoFrame->blockSignals(true); + mTextFrame->blockSignals(true); // BROWSER - initDefaultAppInfo(BROWSERTYPE,mBrowserCombo); + initDefaultAppInfo(BROWSERTYPE,mBrowserFrame); // IMAGE - initDefaultAppInfo(IMAGETYPE,mImageCombo); + initDefaultAppInfo(IMAGETYPE,mImageFrame); // MAIL - initDefaultAppInfo(MAILTYPE,mMailCombo); + initDefaultAppInfo(MAILTYPE,mMailFrame); // AUDIO - initDefaultAppInfo(AUDIOTYPE,mAudioCombo); + initDefaultAppInfo(AUDIOTYPE,mAudioFrame); // VIDEO - initDefaultAppInfo(VIDEOTYPE,mVideoCombo); + initDefaultAppInfo(VIDEOTYPE,mVideoFrame); // TEXT - initDefaultAppInfo(TEXTTYPE,mTextCombo); + initDefaultAppInfo(TEXTTYPE,mTextFrame); - mBrowserCombo->blockSignals(false); - mImageCombo->blockSignals(false); - mMailCombo->blockSignals(false); - mAudioCombo->blockSignals(false); - mVideoCombo->blockSignals(false); - mTextCombo->blockSignals(false); -// qDebug()<<"initUI耗时:"<blockSignals(false); + mImageFrame->blockSignals(false); + mMailFrame->blockSignals(false); + mAudioFrame->blockSignals(false); + mVideoFrame->blockSignals(false); + mTextFrame->blockSignals(false); } /* 添加搜索索引 */ void DefaultApp::initSearchText() { - mTitleLabel->setText(QApplication::translate("DefaultAppWindow", "Select Default Application", nullptr)); //~ contents_path /Defaultapp/Browser - mBrowserLabel->setText(tr("Browser")); //~ contents_path /Defaultapp/Mail - mMailLabel->setText(tr("Mail")); //~ contents_path /Defaultapp/Image Viewer - mImageLabel->setText(tr("Image Viewer")); //~ contents_path /Defaultapp/Audio Player - mAudioLabel->setText(tr("Audio Player")); //~ contents_path /Defaultapp/Video Player - mVideoLabel->setText(tr("Video Player")); //~ contents_path /Defaultapp/Text Editor - mTextLabel->setText(tr("Text Editor")); } /* 设置各默认应用初始状态 */ -void DefaultApp::initDefaultAppInfo(const char* type, QComboBox *combox) +void DefaultApp::initDefaultAppInfo(const char* type, ComboxWidget *widget) { - combox->clear(); + widget->comboBox()->clear(); QString currentapp(getDefaultAppId(type)); if (!currentapp.isEmpty()) { QByteArray ba = QString(DESKTOPPATH + currentapp).toUtf8(); @@ -351,10 +204,10 @@ void DefaultApp::initDefaultAppInfo(const char* type, QComboBox *combox) appicon = QIcon::fromTheme(QString(QLatin1String(iconname)), QIcon(QString("/usr/share/pixmaps/"+QString(QLatin1String(iconname)) +".png"))); - combox->addItem(appicon, appname, currentapp); + widget->comboBox()->addItem(appicon, appname, currentapp); } else { - combox->addItem(mSelectString); - combox->setCurrentText(mSelectString); + widget->comboBox()->addItem(mSelectString); + widget->setCurrentText(mSelectString); mAppCount++; } @@ -382,14 +235,14 @@ void DefaultApp::initDefaultAppInfo(const char* type, QComboBox *combox) } if (appname.isEmpty()) continue; - combox->addItem(appicon, appname, single); + widget->comboBox()->addItem(appicon, appname, single); } - } else { - combox->clear(); - if (currentapp.isEmpty()) - mAppCount--; - combox->addItem(mDefaultString); - combox->setCurrentText(mDefaultString); + } + if (widget->comboBox()->count() == 1 && currentapp.isEmpty()) { + mAppCount--; + widget->comboBox()->clear(); + widget->comboBox()->addItem(mDefaultString); + widget->setCurrentText(mDefaultString); } }); } @@ -397,26 +250,19 @@ void DefaultApp::initDefaultAppInfo(const char* type, QComboBox *combox) /* 重构界面 */ void DefaultApp::resetUi() { - mBrowserCombo->clear(); - mAudioCombo->clear(); - mImageCombo->clear(); - mTextCombo->clear(); - mMailCombo->clear(); - mVideoCombo->clear(); - - mBrowserCombo->blockSignals(true); - mAudioCombo->blockSignals(true); - mImageCombo->blockSignals(true); - mTextCombo->blockSignals(true); - mMailCombo->blockSignals(true); - mVideoCombo->blockSignals(true); + mBrowserFrame->blockSignals(true); + mAudioFrame->blockSignals(true); + mImageFrame->blockSignals(true); + mTextFrame->blockSignals(true); + mMailFrame->blockSignals(true); + mVideoFrame->blockSignals(true); initDefaultUI(); - mBrowserCombo->blockSignals(false); - mAudioCombo->blockSignals(false); - mImageCombo->blockSignals(false); - mTextCombo->blockSignals(false); - mMailCombo->blockSignals(false); - mVideoCombo->blockSignals(false); + mBrowserFrame->blockSignals(false); + mAudioFrame->blockSignals(false); + mImageFrame->blockSignals(false); + mTextFrame->blockSignals(false); + mMailFrame->blockSignals(false); + mVideoFrame->blockSignals(false); } /* BROWSER SLOT */ @@ -424,10 +270,11 @@ void DefaultApp::browserComBoBox_changed_cb(int index) { QtConcurrent::run([=] { QTime timedebuge;//声明一个时钟对象 timedebuge.start();//开始计时 - QString appid = mBrowserCombo->itemData(index).toString(); + QString appid = mBrowserFrame->comboBox()->itemData(index).toString(); QByteArray ba = appid.toUtf8(); // QString to char * setWebBrowsersDefaultProgram(ba.data()); - findSelectItem(mBrowserCombo); + findSelectItem(mBrowserFrame->comboBox()); + Common::buriedSettings(name(), "the default browser", QString("settings"), ba.data()); qDebug()<<"browserComBoBox_changed_cb线程耗时:"<itemData(index).toString(); + QString appid = mMailFrame->comboBox()->itemData(index).toString(); QByteArray ba = appid.toUtf8(); // QString to char * setMailReadersDefaultProgram(ba.data()); - findSelectItem(mMailCombo); + findSelectItem(mMailFrame->comboBox()); + Common::buriedSettings(name(), "the defaultapp to open mail", QString("settings"), ba.data()); qDebug()<<"mailComBoBox_changed_cb线程耗时:"<itemData(index).toString(); + QString appid = mImageFrame->comboBox()->itemData(index).toString(); QByteArray ba = appid.toUtf8(); // QString to char * setImageViewersDefaultProgram(ba.data()); - findSelectItem(mImageCombo); + findSelectItem(mImageFrame->comboBox()); + Common::buriedSettings(name(), "the defaultapp to open image", QString("settings"), ba.data()); qDebug()<<"imageComBoBox_changed_cb线程耗时:"<itemData(index).toString(); + QString appid = mAudioFrame->comboBox()->itemData(index).toString(); QByteArray ba = appid.toUtf8(); // QString to char * setAudioPlayersDefaultProgram(ba.data()); - findSelectItem(mAudioCombo); + findSelectItem(mAudioFrame->comboBox()); + Common::buriedSettings(name(), "the defaultapp to play audio", QString("settings"), ba.data()); qDebug()<<"audioComBoBox_changed_cb线程耗时:"<itemData(index).toString(); + QString appid = mVideoFrame->comboBox()->itemData(index).toString(); QByteArray ba = appid.toUtf8(); // QString to char * setVideoPlayersDefaultProgram(ba.data()); - qDebug() << __FUNCTION__ << QThread::currentThreadId() << QThread::currentThread(); - findSelectItem(mVideoCombo); + findSelectItem(mVideoFrame->comboBox()); + Common::buriedSettings(name(), "the defaultapp to play video", QString("settings"), ba.data()); qDebug()<<"videoComBoBox_changed_cb线程耗时:"<itemData(index).toString(); + QString appid = mTextFrame->comboBox()->itemData(index).toString(); QByteArray ba = appid.toUtf8(); // QString to char * setTextEditorsDefautlProgram(ba.data()); - findSelectItem(mTextCombo); + findSelectItem(mTextFrame->comboBox()); + Common::buriedSettings(name(), "the defaultapp to open text", QString("settings"), ba.data()); qDebug()<<"textComBoBox_changed_cb线程耗时:"< reply = ukccDbus.call("copyFile", QDir::homePath() + LOCAL_APP_DIR + str, SYSTEM_CONFIG_DIR +str); + if (reply) + return str; } } delete mimeappFile; @@ -527,8 +385,15 @@ QString DefaultApp::getDefaultAppId(const char *contentType) { if (!str.isEmpty()) { if (QFile(SYSTEM_CONFIG_DIR +str).exists()) { return str; - } else { - return QString(""); + } else if (QFile(QDir::homePath() + LOCAL_APP_DIR + str).exists()) { + QDBusInterface ukccDbus("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus()); + + QDBusReply reply = ukccDbus.call("copyFile", QDir::homePath() + LOCAL_APP_DIR + str, SYSTEM_CONFIG_DIR +str); + if (reply) + return str; } } delete mimeappFile; @@ -750,7 +615,7 @@ bool DefaultApp::setAudioPlayersDefaultProgram(char *appid) { gboolean ret8 = g_app_info_set_as_default_for_type(appitem, "audio/ac3", NULL); gboolean ret9 = g_app_info_set_as_default_for_type(appitem, "audio/acc", NULL); gboolean ret10 = g_app_info_set_as_default_for_type(appitem, "audio/aac", NULL); - gboolean ret11 = g_app_info_set_as_default_for_type(appitem, "audio/mp4", NULL); + gboolean ret11 = g_app_info_set_as_default_for_type(appitem, "audio/AMR", NULL); gboolean ret12 = g_app_info_set_as_default_for_type(appitem, "audio/x-m4r", NULL); gboolean ret13 = g_app_info_set_as_default_for_type(appitem, "audio/midi", NULL); gboolean ret14 = g_app_info_set_as_default_for_type(appitem, "audio/mp2", NULL); @@ -760,10 +625,16 @@ bool DefaultApp::setAudioPlayersDefaultProgram(char *appid) { gboolean ret18 = g_app_info_set_as_default_for_type(appitem, "audio/mp3", NULL); gboolean ret19 = g_app_info_set_as_default_for_type(appitem, "audio/flac", NULL); gboolean ret20 = g_app_info_set_as_default_for_type(appitem, "audio/wma", NULL); - gboolean ret21 = g_app_info_set_as_default_for_type(appitem, "audio/x-matroska", NULL); - gboolean ret22 = g_app_info_set_as_default_for_type(appitem, "application/x-smaf", NULL); - if(ret1 && ret2 && ret3 && ret4 && ret5 && ret6 && ret7 && ret8 && ret9 && ret10 && - ret11 && ret12 && ret13 && ret14 && ret15 && ret16 && ret17 && ret18 && ret19 && ret20 && ret21 && ret22) { + gboolean ret21 = g_app_info_set_as_default_for_type(appitem, "audio/amr", NULL); + gboolean ret22 = g_app_info_set_as_default_for_type(appitem, "audio/vnd.dts", NULL); + gboolean ret23 = g_app_info_set_as_default_for_type(appitem, "audio/basic", NULL); + gboolean ret24 = g_app_info_set_as_default_for_type(appitem, "audio/x-aiff", NULL); + gboolean ret25 = g_app_info_set_as_default_for_type(appitem, "audio/x-matroska", NULL); + gboolean ret26 = g_app_info_set_as_default_for_type(appitem, "audio/x-voc", NULL); + gboolean ret27 = g_app_info_set_as_default_for_type(appitem, "application/x-smaf", NULL); + if(ret1 && ret2 && ret3 && ret4 && ret5 && ret6 && ret7 && ret8 && ret9 && ret10 && ret11 && ret12 && ret13 && ret14 + && ret15 && ret16 && ret17 && ret18 && ret19 && ret20 && ret21 && ret22 && ret23 && ret24 && ret25 && ret26 + && ret27) { judge=true; } break; @@ -804,7 +675,7 @@ void DefaultApp::connectToServer() connect(NetThread, &QThread::started, NetWorker, &MThread::run); connect(NetWorker,&MThread::keychangedsignal,this,&DefaultApp::keyChangedSlot); connect(NetThread, &QThread::finished, NetWorker, &MThread::deleteLater); - NetThread->start(); + NetThread->start(); } /* 监听默认应用的改变刷新界面 */ @@ -835,17 +706,6 @@ void DefaultApp::findSelectItem(QComboBox *combox) } } -QFrame *DefaultApp::setLine(QFrame *frame) -{ - QFrame *line = new QFrame(frame); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - return line; -} - void DefaultApp::keyChangedSlot(const QString &key) { if(key == "default-open") { resetUi(); @@ -854,6 +714,7 @@ void DefaultApp::keyChangedSlot(const QString &key) { void DefaultApp::reset() { + Common::buriedSettings(name(), "reset defaultapp", QString("clicked")); QString localfile = QDir::homePath() + LOCAL_CONFIG_DIR + "mimeapps.list"; QFile(localfile).remove(); mAppCount = 0; diff --git a/plugins/application/defaultapp/defaultapp.h b/plugins/application/defaultapp/defaultapp.h index 532113d..0461f18 100644 --- a/plugins/application/defaultapp/defaultapp.h +++ b/plugins/application/defaultapp/defaultapp.h @@ -30,12 +30,16 @@ #include #include #include +#include #include "shell/interface.h" -#include "widgets/Label/fixlabel.h" -#include "widgets/Label/titlelabel.h" -#include "shell/utils/mthread.h" +#include "fixlabel.h" +#include "titlelabel.h" +#include "mthread.h" +#include "comboxwidget.h" +#include "settinggroup.h" +#include "pushbuttonwidget.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 @@ -84,7 +88,7 @@ public: void initDefaultUI(); void initSlots(); void initSearchText(); - void initDefaultAppInfo(const char*type, QComboBox *combox); + void initDefaultAppInfo(const char*type, ComboxWidget *widget); void resetUi(); bool setWebBrowsersDefaultProgram(char *appid); @@ -97,7 +101,6 @@ public: void connectToServer(); void watchFileChange(); void findSelectItem(QComboBox *combox); - QFrame *setLine(QFrame *frame); private: QString getDefaultAppId(const char *contentType); @@ -109,30 +112,13 @@ private: QWidget *pluginWidget; - QFrame *mBrowserFrame; - QFrame *mMailFrame; - QFrame *mImageFrame; - QFrame *mAudioFrame; - QFrame *mVideoFrame; - QFrame *mTextFrame; - QFrame *mResetFrame; - - TitleLabel *mTitleLabel; - FixLabel *mBrowserLabel; - FixLabel *mMailLabel; - FixLabel *mImageLabel; - FixLabel *mAudioLabel; - FixLabel *mVideoLabel; - FixLabel *mTextLabel; - - QComboBox *mBrowserCombo; - QComboBox *mMailCombo; - QComboBox *mImageCombo; - QComboBox *mAudioCombo; - QComboBox *mVideoCombo; - QComboBox *mTextCombo; - QPushButton *mResetBtn; - + ComboxWidget *mBrowserFrame; + ComboxWidget *mMailFrame; + ComboxWidget *mImageFrame; + ComboxWidget *mAudioFrame; + ComboxWidget *mVideoFrame; + ComboxWidget *mTextFrame; + PushButtonWidget *mResetFrame; QString pluginName; int pluginType; diff --git a/plugins/application/defaultapp/defaultapp.pro b/plugins/application/defaultapp/defaultapp.pro index f4340a2..341a369 100644 --- a/plugins/application/defaultapp/defaultapp.pro +++ b/plugins/application/defaultapp/defaultapp.pro @@ -5,6 +5,10 @@ #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) + QT += widgets dbus concurrent TEMPLATE = lib CONFIG += plugin @@ -20,7 +24,8 @@ CONFIG += link_pkgconfig \ C++11 PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ - gsettings-qt + gsettings-qt \ + kysdk-qtwidgets \ INCLUDEPATH += \ $$PROJECT_ROOTDIR \ diff --git a/plugins/currency/boot/boot.cpp b/plugins/currency/boot/boot.cpp new file mode 100644 index 0000000..a526ffd --- /dev/null +++ b/plugins/currency/boot/boot.cpp @@ -0,0 +1,167 @@ +#include "boot.h" + +#include + +Boot::Boot() : mFirstLoad(true) +{ + pluginName = tr("Boot"); + pluginType = CURRENCY; +} + +Boot::~Boot() +{ +} + +QString Boot::plugini18nName() +{ + return pluginName; +} + +int Boot::pluginTypes() +{ + return pluginType; +} + +QWidget *Boot::pluginUi() +{ + if (mFirstLoad) { + mFirstLoad = false; + pluginWidget = new QWidget; + pluginWidget->setAttribute(Qt::WA_DeleteOnClose); + + initUI(pluginWidget); + + mSystemDbus = new QDBusInterface("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus(), this); + if (!mSystemDbus->isValid()){ + qCritical() << "Create Client Interface Failed:" << QDBusConnection::systemBus().lastError(); + } + + initConnection(); + + } + return pluginWidget; +} + +const QString Boot::name() const +{ + return QStringLiteral("Boot"); +} + +bool Boot::isShowOnHomePage() const +{ + return true; +} + +QIcon Boot::icon() const +{ + return QIcon::fromTheme("ukui-bootmenu-symbolic"); +} + +bool Boot::isEnable() const +{ + return true; +} + +void Boot::initUI(QWidget *widget) +{ + mVlayout = new QVBoxLayout(widget); + mVlayout->setContentsMargins(0, 0, 0, 0); + + mBootTitleLabel = new TitleLabel(pluginWidget); + mBootTitleLabel->setText(tr("boot")); + mBootTitleLabel->setContentsMargins(14,0,0,0); + + mBootFrame = new QFrame(pluginWidget); + mBootFrame->setFrameShape(QFrame::Shape::Box); + mBootFrame->setMinimumSize(550, 80); + mBootFrame->setMaximumSize(16777215, 80); + + QHBoxLayout *bootHLayout = new QHBoxLayout(); + QVBoxLayout *leftVlayout = new QVBoxLayout(); + + //~ contents_path /Boot/Grub verify + mGrubLabel = new QLabel(tr("Grub verify")); + mGrubLabel->setAlignment(Qt::AlignBottom); + mGrubLabel->setMinimumWidth(140); + mNeedPasswdLabel = new LightLabel(tr("Password required for Grub editing after enabling"), pluginWidget); + mNeedPasswdLabel->setAlignment(Qt::AlignTop); + mResetPasswdBtn = new QPushButton(tr("Reset password")); + mGrubBtn = new SwitchButton(); + + leftVlayout->addWidget(mGrubLabel); + leftVlayout->addWidget(mNeedPasswdLabel); + leftVlayout->setContentsMargins(0, 0, 0, 0); + + bootHLayout->addLayout(leftVlayout); + bootHLayout->addStretch(); + bootHLayout->addWidget(mResetPasswdBtn); + bootHLayout->addSpacing(7); + bootHLayout->addWidget(mGrubBtn); + + bootHLayout->setContentsMargins(12, 0, 14, 0); + + mBootFrame->setLayout(bootHLayout); + + mVlayout->addWidget(mBootTitleLabel); + mVlayout->addWidget(mBootFrame); + mVlayout->addStretch(); +} + +void Boot::initConnection() +{ + + initEnableStatus(); + + connect(mGrubBtn, &SwitchButton::checkedChanged, this, &Boot::bootSlot); + + connect(mResetPasswdBtn, &QPushButton::clicked, this, &Boot::resetPasswdSlot); + +} + +void Boot::initEnableStatus() +{ + if (mSystemDbus != nullptr) { + QDBusReply ret = mSystemDbus->call("getGrupPasswdStatus"); + mGrubBtn->blockSignals(true); + mGrubBtn->setChecked(ret); + mGrubBtn->blockSignals(false); + } + + mResetPasswdBtn->setVisible(mGrubBtn->isChecked()); +} + +void Boot::bootSlot(bool checked) +{ + if (checked) { + GrubVerify dia(pluginWidget); + if (dia.exec() != QDialog::Accepted) { + mGrubBtn->blockSignals(true); + mGrubBtn->setChecked(!checked); + mGrubBtn->blockSignals(false); + } + } else { + if (mSystemDbus != nullptr) { + QDBusReply ret = mSystemDbus->call("setGrupPasswd", "", "", false); + if (ret == false) { + mGrubBtn->blockSignals(true); + mGrubBtn->setChecked(!checked); + mGrubBtn->blockSignals(false); + qDebug() << "call setGrupPasswd to close grub password failed!"; + } + } + } + + mResetPasswdBtn->setVisible(mGrubBtn->isChecked()); +} + +void Boot::resetPasswdSlot() +{ + GrubVerify dia(pluginWidget); + if (dia.exec() != QDialog::Accepted) { + qDebug() << "reset passwd failed!" << __FUNCTION__; + } +} + diff --git a/plugins/currency/boot/boot.h b/plugins/currency/boot/boot.h new file mode 100644 index 0000000..1ca3af8 --- /dev/null +++ b/plugins/currency/boot/boot.h @@ -0,0 +1,61 @@ +#ifndef BOOT_H +#define BOOT_H + +#include +#include +#include +#include + +#include +#include +#include + +#include "shell/interface.h" +#include "grubverifydialog.h" + +class Boot : public QObject, CommonInterface +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface") + Q_INTERFACES(CommonInterface) + +public: + Boot(); + ~Boot() Q_DECL_OVERRIDE; + + QString plugini18nName() Q_DECL_OVERRIDE; + int pluginTypes() Q_DECL_OVERRIDE; + QWidget *pluginUi() Q_DECL_OVERRIDE; + const QString name() const Q_DECL_OVERRIDE; + bool isShowOnHomePage() const Q_DECL_OVERRIDE; + QIcon icon() const Q_DECL_OVERRIDE; + bool isEnable() const Q_DECL_OVERRIDE; + +private: + QWidget *pluginWidget; + int pluginType; + QString pluginName; + bool mFirstLoad; + +private: + QVBoxLayout *mVlayout; + TitleLabel *mBootTitleLabel; + QFrame *mBootFrame; + QLabel *mGrubLabel; + SwitchButton *mGrubBtn; + QPushButton *mResetPasswdBtn; + LightLabel *mNeedPasswdLabel; + + QDBusInterface *mSystemDbus = nullptr; + +private: + void initUI(QWidget *widget); + void initConnection(); + void gsettingConnection(); + void initEnableStatus(); + +private Q_SLOTS: + void bootSlot(bool checked); + void resetPasswdSlot(); +}; +#endif // BOOT_H diff --git a/plugins/currency/boot/boot.pro b/plugins/currency/boot/boot.pro new file mode 100644 index 0000000..3dab3b2 --- /dev/null +++ b/plugins/currency/boot/boot.pro @@ -0,0 +1,42 @@ +include(../../../env.pri) + +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 + +TEMPLATE = lib +CONFIG += plugin \ + link_pkgconfig + +PKGCONFIG += gsettings-qt + +TARGET = $$qtLibraryTarget(boot) +DESTDIR = ../.. +target.path = $${PLUGIN_INSTALL_DIRS} + +INCLUDEPATH += \ + $$PROJECT_ROOTDIR \ + +# 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 += \ + boot.cpp \ + grubverifydialog.cpp + +HEADERS += \ + boot.h \ + grubverifydialog.h + +# Default rules for deployment. +INSTALLS += target diff --git a/plugins/currency/boot/grubverifydialog.cpp b/plugins/currency/boot/grubverifydialog.cpp new file mode 100644 index 0000000..1d7c900 --- /dev/null +++ b/plugins/currency/boot/grubverifydialog.cpp @@ -0,0 +1,320 @@ +#include "grubverifydialog.h" + +#include +#include +#include +#include + +GrubVerify::GrubVerify(QWidget *parent) : QDialog(parent) +{ + initUI(); + setupConnect(); +} + + +GrubVerify::~GrubVerify() +{ + +} + +void GrubVerify::initUI() +{ + setFixedSize(QSize(480, 266)); + setWindowTitle(tr("Grub verify")); + + // 用户 + userLabel = new QLabel(); + userLabel->setFixedSize(100,36); + setTextDynamicInPwd(userLabel, tr("User:")); + usernameLabel = new QLabel("root"); + usernameLabel->setFixedSize(QSize(322, 36)); + + userHorLayout = new QHBoxLayout; + userHorLayout->setSpacing(8); + userHorLayout->setContentsMargins(0, 0, 0, 0); + userHorLayout->addWidget(userLabel); + userHorLayout->addWidget(usernameLabel); + + //新密码 + newPwdLabel = new QLabel(); + newPwdLabel->setFixedSize(100,24); + setTextDynamicInPwd(newPwdLabel, tr("Pwd")); + newTipLabel = new QLabel(); + QFont ft; + ft.setPixelSize(14); + newTipLabel->setFont(ft); + newTipLabel->setFixedSize(QSize(322, 24)); + newTipLabel->setStyleSheet("color:red;"); + newTipHorLayout = new QHBoxLayout; + newTipHorLayout->setContentsMargins(110, 0, 0, 0); + newTipHorLayout->addStretch(); + newTipHorLayout->addWidget(newTipLabel); + newPwdLineEdit = new QLineEdit(); + QRegExp inputRegExp("^[A-Za-z0-9`~!@#$%^&*()_-+=<>,.\\\/?:;\"'|\{\}\ ]+$"); + QRegExpValidator *inputLimits = new QRegExpValidator(inputRegExp, this); + newPwdLineEdit->setValidator(inputLimits); + newPwdLineEdit->setFixedSize(QSize(322, 36)); + newPwdLineEdit->setEchoMode(QLineEdit::Password); + newPwdLineEdit->setTextMargins(0,0,30,0); + newPwdLineEdit->setContextMenuPolicy(Qt::NoContextMenu); + newPwdLineEdit->installEventFilter(this); + newPwdEyeBtn = new QPushButton; + newPwdEyeBtn->setFixedSize(QSize(24, 24)); + newPwdEyeBtn->setIcon(QIcon::fromTheme("ukui-eye-hidden-symbolic")); + newPwdEyeBtn->setCursor(Qt::PointingHandCursor); + newPwdEyeBtn->setFlat(true); + newPwdEyeBtn->setStyleSheet("QPushButton::pressed{border:none;background-color:transparent}" + "QPushButton::hover::!pressed{border:none;background-color:transparent}"); + newPwdEyeBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); + QHBoxLayout *newPwdEyeBtnHLayout = new QHBoxLayout; + newPwdEyeBtnHLayout->addStretch(); + newPwdEyeBtnHLayout->addWidget(newPwdEyeBtn); + newPwdEyeBtnHLayout->setContentsMargins(0,0,8,0); + newPwdLineEdit->setLayout(newPwdEyeBtnHLayout); + + newPwdHorLayout = new QHBoxLayout; + newPwdHorLayout->setSpacing(8); + newPwdHorLayout->setContentsMargins(0, 0, 0, 0); + newPwdHorLayout->addWidget(newPwdLabel); + newPwdHorLayout->addWidget(newPwdLineEdit); + + //确认密码 + surePwdLabel = new QLabel(); + surePwdLabel->setFixedSize(100,24); + setTextDynamicInPwd(surePwdLabel, tr("Sure Pwd")); + + surePwdLineEdit = new QLineEdit(); + surePwdLineEdit->setValidator(inputLimits); + surePwdLineEdit->setFixedSize(QSize(322, 36)); + surePwdLineEdit->setEchoMode(QLineEdit::Password); + surePwdLineEdit->setTextMargins(0,0,30,0); + surePwdLineEdit->setContextMenuPolicy(Qt::NoContextMenu); + surePwdLineEdit->installEventFilter(this); + surePwdEyeBtn = new QPushButton; + surePwdEyeBtn->setFixedSize(QSize(24, 24)); + surePwdEyeBtn->setIcon(QIcon::fromTheme("ukui-eye-hidden-symbolic")); + surePwdEyeBtn->setCursor(Qt::PointingHandCursor); + surePwdEyeBtn->setFlat(true); + surePwdEyeBtn->setStyleSheet("QPushButton::pressed{border:none;background-color:transparent}" + "QPushButton::hover::!pressed{border:none;background-color:transparent}"); + surePwdEyeBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); + QHBoxLayout *surePwdEyeBtnHLayout = new QHBoxLayout; + surePwdEyeBtnHLayout->addStretch(); + surePwdEyeBtnHLayout->addWidget(surePwdEyeBtn); + surePwdEyeBtnHLayout->setContentsMargins(0,0,8,0); + surePwdLineEdit->setLayout(surePwdEyeBtnHLayout); + + surePwdHorLayout = new QHBoxLayout; + surePwdHorLayout->setSpacing(8); + surePwdHorLayout->setContentsMargins(0, 0, 0, 0); + surePwdHorLayout->addWidget(surePwdLabel); + surePwdHorLayout->addWidget(surePwdLineEdit); + + sureTipLabel = new QLabel(); + sureTipLabel->setFont(ft); + sureTipLabel->setFixedSize(QSize(322, 30)); + sureTipLabel->setStyleSheet("color:red;"); + + sureTipHorLayout = new QHBoxLayout; + sureTipHorLayout->setSpacing(0); + sureTipHorLayout->setContentsMargins(110, 0, 0, 0); + sureTipHorLayout->addStretch(); + sureTipHorLayout->addWidget(sureTipLabel); + + //中部输入区域 + contentVerLayout = new QVBoxLayout; + contentVerLayout->setSpacing(0); + contentVerLayout->setContentsMargins(24, 0, 35, 0); + contentVerLayout->addLayout(userHorLayout); + contentVerLayout->addLayout(newPwdHorLayout); + contentVerLayout->addLayout(newTipHorLayout); + contentVerLayout->addLayout(surePwdHorLayout); + contentVerLayout->addLayout(sureTipHorLayout); + + //底部“取消”、“确定”按钮 + cancelBtn = new QPushButton(); + cancelBtn->setMinimumWidth(96); + cancelBtn->setText(tr("Cancel")); + cancelBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); + confirmBtn = new QPushButton(); + confirmBtn->setMinimumWidth(96); + confirmBtn->setText(tr("Confirm")); + confirmBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); + + bottomBtnsHorLayout = new QHBoxLayout; + bottomBtnsHorLayout->setSpacing(16); + bottomBtnsHorLayout->setContentsMargins(0, 0, 25, 0); + bottomBtnsHorLayout->addStretch(); + bottomBtnsHorLayout->addWidget(cancelBtn); + bottomBtnsHorLayout->addWidget(confirmBtn); + + mainVerLayout = new QVBoxLayout; + mainVerLayout->setContentsMargins(0, 10, 0, 24); + mainVerLayout->addLayout(contentVerLayout); + mainVerLayout->addStretch(); + mainVerLayout->addLayout(bottomBtnsHorLayout); + + setLayout(mainVerLayout); +} + +void GrubVerify::setupConnect() +{ + //通用的connect + connect(cancelBtn, &QPushButton::clicked, this, [=]{ + close(); + }); + + connect(newPwdEyeBtn, &QPushButton::clicked, this, [=](){ + if (newPwdLineEdit->echoMode() == QLineEdit::Password) { + newPwdLineEdit->setEchoMode(QLineEdit::Normal); + newPwdEyeBtn->setIcon(QIcon::fromTheme("ukui-eye-display-symbolic")); + } else { + newPwdLineEdit->setEchoMode(QLineEdit::Password); + newPwdEyeBtn->setIcon(QIcon::fromTheme("ukui-eye-hidden-symbolic")); + } + + }); + + connect(surePwdEyeBtn, &QPushButton::clicked, this, [=](){ + if (surePwdLineEdit->echoMode() == QLineEdit::Password) { + surePwdLineEdit->setEchoMode(QLineEdit::Normal); + surePwdEyeBtn->setIcon(QIcon::fromTheme("ukui-eye-display-symbolic")); + } else { + surePwdLineEdit->setEchoMode(QLineEdit::Password); + surePwdEyeBtn->setIcon(QIcon::fromTheme("ukui-eye-hidden-symbolic")); + } + + }); + + connect(newPwdLineEdit, &QLineEdit::textEdited, this, [=](){ + checkPwdLegality(); + refreshConfirmBtnStatus(); + }); + + connect(surePwdLineEdit, &QLineEdit::textEdited, this, [=](QString txt){ + if (!txt.isEmpty() && txt != newPwdLineEdit->text()){ + surePwdTip = tr("Inconsistency with pwd"); + } else { + surePwdTip = ""; + } + + updateTipLableInfo(sureTipLabel, surePwdTip); + + refreshConfirmBtnStatus(); + }); + + connect(confirmBtn, &QPushButton::clicked, this, [=](){ + QDBusInterface piface("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus(), this); + if (!piface.isValid()){ + qCritical() << "Create Client Interface Failed:" << QDBusConnection::systemBus().lastError(); + close(); + } + + QDBusReply ret = piface.call("setGrupPasswd", "root", newPwdLineEdit->text(), true); + if (ret == false) { + close(); + } else { + accept(); + } + }); +} + +void GrubVerify::checkPwdLegality() +{ + if (newPwdLineEdit->text().isEmpty()) { + newPwdTip = tr("pwd cannot be empty!"); + } else { + newPwdTip = tr(""); + } + + //防止先输入确认密码,再输入密码后tipLabel无法刷新 + if (!surePwdLineEdit->text().isEmpty()){ + if (QString::compare(newPwdLineEdit->text(), surePwdLineEdit->text()) == 0){ + surePwdTip = ""; + } else { + surePwdTip = tr("Inconsistency with pwd"); + } + } + + //设置新密码的提示 + updateTipLableInfo(newTipLabel,newPwdTip); + + updateTipLableInfo(sureTipLabel,surePwdTip); +} + +void GrubVerify::updateTipLableInfo(QLabel *Label,QString info) +{ + if (setTextDynamicInPwd(Label, info)){ + Label->setToolTip(info); + } else { + Label->setToolTip(""); + } +} + +void GrubVerify::refreshConfirmBtnStatus() +{ + + if (newPwdLineEdit->text().isEmpty() || surePwdLineEdit->text().isEmpty() || \ + !newPwdTip.isEmpty() || !surePwdTip.isEmpty()) { + confirmBtn->setEnabled(false); + } else { + confirmBtn->setEnabled(true); + } +} + +bool GrubVerify::setTextDynamicInPwd(QLabel *label, QString string){ + + bool isOverLength = false; + QFontMetrics fontMetrics(label->font()); + int fontSize = fontMetrics.width(string); + + QString str = string; + int pSize = label->width(); + if (fontSize > pSize) { + str = fontMetrics.elidedText(string, Qt::ElideRight, pSize); + isOverLength = true; + label->setToolTip(string); + } else { + label->setToolTip(""); + } + label->setText(str); + return isOverLength; + +} + +bool GrubVerify::eventFilter(QObject *target, QEvent *event) +{ + if (target == newPwdLineEdit || target == surePwdLineEdit) { + if (event->type() == QEvent::KeyPress) + { + QKeyEvent *keyEvent = static_cast(event); + + if(keyEvent->matches(QKeySequence::Copy) || keyEvent->matches(QKeySequence::Cut)) + { + qDebug() <<"Copy || Cut"; + return true; + } + } + } + + if (event->type() == QEvent::FocusOut) { + if (target == newPwdLineEdit) { + if (newPwdLineEdit->text().isEmpty()) { + newPwdTip = tr("pwd cannot be empty!"); + updateTipLableInfo(newTipLabel, newPwdTip); + } + } else if (target == surePwdLineEdit) { + if (surePwdLineEdit->text().isEmpty()) { + surePwdTip = tr("sure pwd cannot be empty!"); + updateTipLableInfo(sureTipLabel, surePwdTip); + } + } + } + + return QWidget::eventFilter(target, event); + //继续传递该事件到被观察者,由其本身调用相应的事件。 +} + diff --git a/plugins/currency/boot/grubverifydialog.h b/plugins/currency/boot/grubverifydialog.h new file mode 100644 index 0000000..6bfb284 --- /dev/null +++ b/plugins/currency/boot/grubverifydialog.h @@ -0,0 +1,66 @@ +#ifndef GRUBVERIFY_H +#define GRUBVERIFY_H + +#include +#include +#include +#include +#include +#include +#include + +class GrubVerify : public QDialog +{ + Q_OBJECT +public: + explicit GrubVerify(QWidget *parent = nullptr); + ~GrubVerify(); + +private: + + QVBoxLayout * mainVerLayout; + QVBoxLayout * contentVerLayout; + QHBoxLayout * userHorLayout; + QHBoxLayout * newPwdHorLayout; + QHBoxLayout * surePwdHorLayout; + QHBoxLayout * bottomBtnsHorLayout; + QHBoxLayout *newTipHorLayout; + QHBoxLayout *sureTipHorLayout; + QString newPwdTip; + QString surePwdTip; + + QPushButton *cancelBtn; + QPushButton *confirmBtn; + + QLabel *userLabel; + QLabel *curTipLabel; + QLabel *newPwdLabel; + QLabel *newTipLabel; + QLabel *surePwdLabel; + QLabel *sureTipLabel; + + QLabel * usernameLabel; + QLineEdit * newPwdLineEdit; + QLineEdit * surePwdLineEdit; + + QPushButton *currentPwdEyeBtn; + QPushButton *newPwdEyeBtn; + QPushButton *surePwdEyeBtn; + +private: + void initUI(); + void setupConnect(); + bool setTextDynamicInPwd(QLabel * label, QString string); + void checkPwdLegality(); + void updateTipLableInfo(QLabel *Label,QString info); + void refreshConfirmBtnStatus(); + +protected: + bool eventFilter(QObject *target, QEvent *event); + +signals: + + +}; + +#endif // GRUBVERIFY_H diff --git a/plugins/devices/keyboard/kbdlayoutmanager.cpp b/plugins/devices/keyboard/kbdlayoutmanager.cpp index 93d974c..1a81c8e 100644 --- a/plugins/devices/keyboard/kbdlayoutmanager.cpp +++ b/plugins/devices/keyboard/kbdlayoutmanager.cpp @@ -19,7 +19,7 @@ */ #include "kbdlayoutmanager.h" #include "ui_layoutmanager.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include #include diff --git a/plugins/devices/keyboard/keyboard.pro b/plugins/devices/keyboard/keyboard.pro index c1a9d8c..9355725 100644 --- a/plugins/devices/keyboard/keyboard.pro +++ b/plugins/devices/keyboard/keyboard.pro @@ -5,6 +5,10 @@ #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets x11extras KWindowSystem xml KGuiAddons KCoreAddons concurrent KConfigCore KConfigGui KI18n #greaterThan(QT_MAJOR_VERSION, 4): QT += widgets @@ -32,12 +36,10 @@ PKGCONFIG += libmatekbd \ #DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ - keyboardcontrol.cpp \ kbdlayoutmanager.cpp \ keyboardmain.cpp \ HEADERS += \ - keyboardcontrol.h \ kbdlayoutmanager.h \ keyboardmain.h \ diff --git a/plugins/devices/keyboard/keyboardmain.cpp b/plugins/devices/keyboard/keyboardmain.cpp index bfb05f4..23db263 100644 --- a/plugins/devices/keyboard/keyboardmain.cpp +++ b/plugins/devices/keyboard/keyboardmain.cpp @@ -1,43 +1,86 @@ +/* -*- 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 "keyboardmain.h" -KeyboardMain::KeyboardMain(QWidget *parent) - : QWidget(parent) +KeyboardMain::KeyboardMain() : mFirstLoad(true) { - mVlayout = new QVBoxLayout(this); - mVlayout->setContentsMargins(0, 0, 0, 0);; - initUI(); - initConnection(); + pluginName = tr("Keyboard"); + pluginType = DEVICES; } KeyboardMain::~KeyboardMain() { } -QFrame* KeyboardMain::myLine() +QString KeyboardMain::plugini18nName() { - QFrame *line = new QFrame(this); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - return line; + return pluginName; } -void KeyboardMain::initUI() -{ - QFrame *keyboardFrame = new QFrame(this); - keyboardFrame->setMinimumSize(550, 0); - keyboardFrame->setMaximumSize(16777215, 16777215); - keyboardFrame->setFrameShape(QFrame::Box); +int KeyboardMain::pluginTypes() { + return pluginType; +} - QVBoxLayout *keyboardLyt = new QVBoxLayout(keyboardFrame); - keyboardLyt->setContentsMargins(0, 0, 0, 0); +QWidget *KeyboardMain::pluginUi() +{ + if (mFirstLoad) { + mFirstLoad = false; + pluginWidget = new QWidget; + pluginWidget->setAttribute(Qt::WA_DeleteOnClose); + initUI(pluginWidget); + initConnection(); + } + return pluginWidget; +} + +const QString KeyboardMain::name() const +{ + return QStringLiteral("Keyboard"); +} + +bool KeyboardMain::isShowOnHomePage() const +{ + return true; +} + +QIcon KeyboardMain::icon() const +{ + return QIcon::fromTheme("input-keyboard-symbolic"); +} + +bool KeyboardMain::isEnable() const +{ + return !Common::isWayland(); +} + +void KeyboardMain::initUI(QWidget *widget) +{ + mVlayout = new QVBoxLayout(widget); + mVlayout->setContentsMargins(0, 0, 0, 0);; + + mKeyboardFrame = new SettingGroup(this); mKeyboardSetTitleLabel = new TitleLabel(this); mKeyboardSetTitleLabel->setText(tr("Key board settings")); - mKeyboardSetTitleLabel->setContentsMargins(14, 0, 0, 0); + mKeyboardSetTitleLabel->setContentsMargins(16, 0, 0, 0); setKeyRepeatFrame(); setDelayFrame(); @@ -49,28 +92,19 @@ void KeyboardMain::initUI() mInputMethodSetBtn = new QPushButton(this); //~ contents_path /Keyboard/Input settings mInputMethodSetBtn->setText(tr("Input settings")); + mInputMethodSetBtn->setObjectName("Input settings"); mInputMethodSetBtn->setFixedSize(QSize(160, 36)); - keyRepeatAndDelayLine = myLine(); - delayAndSpeedLine = myLine(); - speedAndInputTestLine = myLine(); - inputTestAndKeyTipsLine = myLine(); - /* add widget */ - keyboardLyt->addWidget(mKeyRepeatFrame); - keyboardLyt->addWidget(keyRepeatAndDelayLine); - keyboardLyt->addWidget(mDelayFrame); - keyboardLyt->addWidget(delayAndSpeedLine); - keyboardLyt->addWidget(mSpeedFrame); - keyboardLyt->addWidget(speedAndInputTestLine); - keyboardLyt->addWidget(mInputTestFrame); - keyboardLyt->addWidget(inputTestAndKeyTipsLine); - keyboardLyt->addWidget(mKeyTipsFrame); - keyboardLyt->setSpacing(0); + mKeyboardFrame->insertWidget(0, mKeyRepeatFrame); + mKeyboardFrame->insertWidget(1, mDelayFrame); + mKeyboardFrame->insertWidget(2, mSpeedFrame); + mKeyboardFrame->insertWidget(3, mInputTestFrame); + mKeyboardFrame->insertWidget(4, mKeyTipsFrame); mVlayout->addWidget(mKeyboardSetTitleLabel); mVlayout->setSpacing(8); - mVlayout->addWidget(keyboardFrame); + mVlayout->addWidget(mKeyboardFrame); mVlayout->addWidget(mInputMethodSetBtn); mVlayout->addStretch(); } @@ -78,130 +112,55 @@ void KeyboardMain::initUI() void KeyboardMain::setKeyRepeatFrame() { /* Key Repeat */ - mKeyRepeatFrame = new QFrame(this); - mKeyRepeatFrame->setFrameShape(QFrame::Shape::NoFrame); - mKeyRepeatFrame->setMinimumSize(550, 60); - mKeyRepeatFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *KeyRepeatHLayout = new QHBoxLayout(); - //~ contents_path /Keyboard/Key repeat - mKeyRepeatLabel = new QLabel(tr("Key repeat"), this); - mKeyRepeatLabel->setMinimumWidth(140); - mKeyRepeatBtn = new KSwitchButton(this); - KeyRepeatHLayout->addWidget(mKeyRepeatLabel); - KeyRepeatHLayout->addStretch(); - KeyRepeatHLayout->addWidget(mKeyRepeatBtn); - KeyRepeatHLayout->setContentsMargins(12, 0, 14, 0); - - mKeyRepeatFrame->setLayout(KeyRepeatHLayout); + mKeyRepeatFrame = new SwitchWidget(tr("Key repeat"), this, UkccFrame::None); + mKeyRepeatFrame->setObjectName("Key repeat"); } void KeyboardMain::setDelayFrame() { /* delay */ - mDelayFrame = new QFrame(this); - mDelayFrame->setFrameShape(QFrame::Shape::NoFrame); - mDelayFrame->setMinimumSize(550, 60); - mDelayFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *DelayHLayout = new QHBoxLayout(); - //~ contents_path /Keyboard/Delay - mDelayLabel = new QLabel(tr("Delay"), this); - mDelayLabel->setMinimumWidth(140); - mDelayShortLabel =new QLabel(tr("Short"), this); - mDelayShortLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); - mDelayShortLabel->setFixedWidth(50); - mDelayLongLabel = new QLabel(tr("Long"), this); - mDelayLongLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); - mDelayLongLabel->setFixedWidth(45); - mDelaySlider = new QSlider(Qt::Horizontal); - mDelaySlider->setMinimum(200); - mDelaySlider->setMaximum(2100); - mDelaySlider->setPageStep(1); - DelayHLayout->addWidget(mDelayLabel); - DelayHLayout->addWidget(mDelayShortLabel); - DelayHLayout->addWidget(mDelaySlider); - DelayHLayout->addWidget(mDelayLongLabel); - DelayHLayout->setContentsMargins(12, 0, 14, 0); - - mDelayFrame->setLayout(DelayHLayout); + mDelayFrame = new SliderWidget(tr("Delay"), false, this); + mDelayFrame->setObjectName("Delay"); + mDelayFrame->setLeftText(tr("Short")); + mDelayFrame->setRightText(tr("Long")); + mDelayFrame->slider()->setMinimum(200); + mDelayFrame->slider()->setMaximum(2100); + mDelayFrame->slider()->setPageStep(20); + mDelayFrame->slider()->setSingleStep(20); + mDelayFrame->slider()->installEventFilter(this); } void KeyboardMain::setSpeedFrame() { /* Speed */ - mSpeedFrame = new QFrame(this); - mSpeedFrame->setFrameShape(QFrame::Shape::NoFrame); - mSpeedFrame->setMinimumSize(550, 60); - mSpeedFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *SpeedHLayout = new QHBoxLayout(); - //~ contents_path /Keyboard/Speed - mSpeedLabel = new QLabel(tr("Speed"), this); - mSpeedLabel->setMinimumWidth(140); - mSpeedSlowLabel = new QLabel(tr("Slow"), this); - mSpeedSlowLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); - mSpeedSlowLabel->setFixedWidth(50); - mSpeedFastLabel = new QLabel(tr("Fast"), this); - mSpeedFastLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); - mSpeedFastLabel->setFixedWidth(45); - mSpeedSlider = new QSlider(Qt::Horizontal); - mSpeedSlider->setMinimum(10); - mSpeedSlider->setMaximum(110); - mSpeedSlider->setPageStep(1); - SpeedHLayout->addWidget(mSpeedLabel); - SpeedHLayout->addWidget(mSpeedSlowLabel); - SpeedHLayout->addWidget(mSpeedSlider); - SpeedHLayout->addWidget(mSpeedFastLabel); - SpeedHLayout->setContentsMargins(12, 0, 14, 0); - - mSpeedFrame->setLayout(SpeedHLayout); + mSpeedFrame = new SliderWidget(tr("Speed"), false, this); + mSpeedFrame->setObjectName("Speed"); + mSpeedFrame->setLeftText(tr("Slow")); + mSpeedFrame->setRightText(tr("Fast")); + mSpeedFrame->slider()->setMinimum(10); + mSpeedFrame->slider()->setMaximum(110); + mSpeedFrame->slider()->setPageStep(1); + mSpeedFrame->slider()->installEventFilter(this); } void KeyboardMain::setInputTestFrame() { /* Input test */ - mInputTestFrame = new QFrame(this); - mInputTestFrame->setFrameShape(QFrame::Shape::NoFrame); - mInputTestFrame->setMinimumSize(550, 60); - mInputTestFrame->setMaximumSize(16777215, 60); - QHBoxLayout *InputTestHLayout = new QHBoxLayout(); + //~ contents_path /Keyboard/Input test + mInputTestFrame = new LineEditWidget(tr("Input test"), this); - //~ contents_path /Keyboard/Input test - mInputTestLabel = new QLabel(tr("Input test"), this); - mInputTestLabel->setMinimumWidth(140); - mInputTestLine = new QLineEdit(this); - InputTestHLayout->addWidget(mInputTestLabel); - InputTestHLayout->addWidget(mInputTestLine); - InputTestHLayout->setContentsMargins(12, 0, 14, 0); - - mInputTestFrame->setLayout(InputTestHLayout); } void KeyboardMain::setKeyTipsFrame() { /* key tips */ - mKeyTipsFrame = new QFrame(this); - mKeyTipsFrame->setFrameShape(QFrame::Shape::NoFrame); - mKeyTipsFrame->setMinimumSize(550, 60); - mKeyTipsFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *KeyTipsHLayout = new QHBoxLayout; - - //~ contents_path /Keyboard/Key tips - mKeyTipsLabel = new QLabel(tr("Key tips"), this); - mKeyTipsLabel->setMinimumWidth(140); - mKeyTipsBtn = new KSwitchButton(this); - KeyTipsHLayout->addWidget(mKeyTipsLabel); - KeyTipsHLayout->addStretch(); - KeyTipsHLayout->addWidget(mKeyTipsBtn); - KeyTipsHLayout->setContentsMargins(12, 0, 14, 0); - - mKeyTipsFrame->setLayout(KeyTipsHLayout); + //~ contents_path /Keyboard/Key tips + mKeyTipsFrame = new SwitchWidget(tr("Key tips"), this, UkccFrame::None); + mKeyTipsFrame->setObjectName("Key tips"); } void KeyboardMain::initConnection() @@ -217,13 +176,13 @@ void KeyboardMain::initConnection() initKeyboardStatus(); //将界面设置改动的key值写入GSettings - connect(mKeyRepeatBtn, &KSwitchButton::stateChanged, this, &KeyboardMain::keyRepeatSlot); + connect(mKeyRepeatFrame, &SwitchWidget::stateChanged, this, &KeyboardMain::keyRepeatSlot); - connect(mDelaySlider, &QSlider::valueChanged, this, &KeyboardMain::keyDelaySlot); + connect(mDelayFrame, &SliderWidget::valueChanged, this, &KeyboardMain::keyDelaySlot); - connect(mSpeedSlider, &QSlider::valueChanged, this, &KeyboardMain::keySpeedSlot); + connect(mSpeedFrame, &SliderWidget::valueChanged, this, &KeyboardMain::keySpeedSlot); - connect(mKeyTipsBtn, &KSwitchButton::stateChanged, this, &KeyboardMain::keyTipsSlot); + connect(mKeyTipsFrame, &SwitchWidget::stateChanged, this, &KeyboardMain::keyTipsSlot); connect(mInputMethodSetBtn, &QPushButton::clicked, this, &KeyboardMain::inputMethodSetSlot); @@ -234,19 +193,19 @@ void KeyboardMain::initConnection() void KeyboardMain::initKeyboardStatus() { //设置按键重复状态 - mKeyRepeatBtn->setChecked(mKeyboardGsettings->get(kKeyRepeatKey).toBool()); - setKeyboardVisible(mKeyRepeatBtn->isChecked()); + mKeyRepeatFrame->setChecked(mKeyboardGsettings->get(kKeyRepeatKey).toBool()); + setKeyboardVisible(mKeyRepeatFrame->isChecked()); //设置按键重复的延时 - mDelaySlider->setValue(mKeyboardGsettings->get(kDelayKey).toInt()); + mDelayFrame->setValue(mKeyboardGsettings->get(kDelayKey).toInt()); //设置按键重复的速度 - mSpeedSlider->setValue(mKeyboardGsettings->get(kSpeedKey).toInt()); + mSpeedFrame->setValue(mKeyboardGsettings->get(kSpeedKey).toInt()); //设置按键提示状态 - mKeyTipsBtn->blockSignals(true); - mKeyTipsBtn->setChecked(mKeyboardOsdGsetting->get(kKeyTipsKey).toBool()); - mKeyTipsBtn->blockSignals(false); + mKeyTipsFrame->blockSignals(true); + mKeyTipsFrame->setChecked(mKeyboardOsdGsetting->get(kKeyTipsKey).toBool()); + mKeyTipsFrame->blockSignals(false); } @@ -255,9 +214,6 @@ void KeyboardMain::setKeyboardVisible(bool checked) mDelayFrame->setVisible(checked); mSpeedFrame->setVisible(checked); mInputTestFrame->setVisible(checked); - delayAndSpeedLine->setVisible(checked); - speedAndInputTestLine->setVisible(checked); - inputTestAndKeyTipsLine->setVisible(checked); } void KeyboardMain::gsettingConnectUi() @@ -265,20 +221,20 @@ void KeyboardMain::gsettingConnectUi() //命令行 set key 值,界面设置做出相应的变化 connect(mKeyboardGsettings, &QGSettings::changed, this, [=](const QString &key) { if(key == "repeat") { - mKeyRepeatBtn->setChecked(mKeyboardGsettings->get(kKeyRepeatKey).toBool()); - setKeyboardVisible(mKeyRepeatBtn->isChecked()); + mKeyRepeatFrame->setChecked(mKeyboardGsettings->get(kKeyRepeatKey).toBool()); + setKeyboardVisible(mKeyRepeatFrame->isChecked()); } else if(key == "delay") { - mDelaySlider->setValue(mKeyboardGsettings->get(kDelayKey).toInt()); + mDelayFrame->setValue(mKeyboardGsettings->get(kDelayKey).toInt()); } else if(key == "rate") { - mSpeedSlider->setValue(mKeyboardGsettings->get(kSpeedKey).toInt()); + mSpeedFrame->setValue(mKeyboardGsettings->get(kSpeedKey).toInt()); } }); connect(mKeyboardOsdGsetting, &QGSettings::changed,this, [=](const QString &key) { if(key == "showLockTip") { - mKeyTipsBtn->blockSignals(true); - mKeyTipsBtn->setChecked(mKeyboardOsdGsetting->get(kKeyTipsKey).toBool()); - mKeyTipsBtn->blockSignals(false); + mKeyTipsFrame->blockSignals(true); + mKeyTipsFrame->setChecked(mKeyboardOsdGsetting->get(kKeyTipsKey).toBool()); + mKeyTipsFrame->blockSignals(false); } }); } @@ -288,6 +244,7 @@ void KeyboardMain::keyRepeatSlot(bool checked) { setKeyboardVisible(checked); mKeyboardGsettings->set(kKeyRepeatKey, checked); + Common::buriedSettings(name(), mKeyRepeatFrame->objectName(), QString("setting"), checked ? "true":"false"); } void KeyboardMain::keyDelaySlot(int value) @@ -303,14 +260,28 @@ void KeyboardMain::keySpeedSlot(int value) void KeyboardMain::keyTipsSlot(bool checked) { mKeyboardOsdGsetting->set(kKeyTipsKey, checked); + Common::buriedSettings(name(), mKeyTipsFrame->objectName(), QString("setting"), checked ? "true":"false"); } void KeyboardMain::inputMethodSetSlot() { - QDBusInterface ifc("com.kylin.AppManager", - "/com/kylin/AppManager", - "com.kylin.AppManager", - QDBusConnection::sessionBus()); - ifc.call("LaunchApp", "/usr/share/applications/fcitx-configtool.desktop"); + Common::buriedSettings(name(), mInputMethodSetBtn->objectName(), QString("setting")); + QProcess process; + process.startDetached("fcitx5-config-qt"); } + +bool KeyboardMain::eventFilter(QObject *watched, QEvent *event) +{ + if (event->type() == QEvent::FocusOut) { + if (watched == mDelayFrame->slider()) { + int value = mDelayFrame->value(); + Common::buriedSettings(name(), mDelayFrame->objectName(), QString("setting"), QString::number(value)); + } else if (watched == mSpeedFrame->slider()) { + int value = mSpeedFrame->value(); + Common::buriedSettings(name(), mSpeedFrame->objectName(), QString("setting"), QString::number(value)); + } + } + return QObject::eventFilter(watched, event); +} + diff --git a/plugins/devices/keyboard/keyboardmain.h b/plugins/devices/keyboard/keyboardmain.h index 327e80d..8fa253b 100644 --- a/plugins/devices/keyboard/keyboardmain.h +++ b/plugins/devices/keyboard/keyboardmain.h @@ -12,11 +12,15 @@ #include #include #include +#include "shell/interface.h" -#include "widgets/Label/titlelabel.h" +#include "titlelabel.h" +#include "lineeditwidget.h" +#include "switchwidget.h" +#include "sliderwidget.h" +#include "settinggroup.h" -#include "kswitchbutton.h" -using namespace kdk; +#include "common.h" const QByteArray kKeyboardSchamas = "org.ukui.peripherals-keyboard"; const QString kKeyRepeatKey = "repeat"; @@ -26,55 +30,50 @@ const QString kSpeedKey = "rate"; const QByteArray kKeyboardOsdSchemas = "org.ukui.control-center.osd"; const QString kKeyTipsKey = "show-lock-tip"; -class KeyboardMain : public QWidget +class KeyboardMain : public QWidget, CommonInterface { Q_OBJECT - + Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface") + Q_INTERFACES(CommonInterface) public: - KeyboardMain(QWidget *parent = nullptr); - ~KeyboardMain(); + KeyboardMain(); + ~KeyboardMain() Q_DECL_OVERRIDE; + + QString plugini18nName() Q_DECL_OVERRIDE; + int pluginTypes() Q_DECL_OVERRIDE; + QWidget *pluginUi() Q_DECL_OVERRIDE; + const QString name() const Q_DECL_OVERRIDE; + bool isShowOnHomePage() const Q_DECL_OVERRIDE; + QIcon icon() const Q_DECL_OVERRIDE; + bool isEnable() const Q_DECL_OVERRIDE; private: - QFrame *mKeyRepeatFrame; //按键重复 - QFrame *mDelayFrame; //延迟 - QFrame *mSpeedFrame; //速度 - QFrame *mInputTestFrame; //输入测试 - QFrame *mKeyTipsFrame; //按键提示 + QString pluginName; + int pluginType; + QWidget *pluginWidget; - KSwitchButton *mKeyTipsBtn; - KSwitchButton *mKeyRepeatBtn; + bool mFirstLoad; + +private: + SwitchWidget *mKeyRepeatFrame; //按键重复 + SliderWidget *mDelayFrame; //延迟 + SliderWidget *mSpeedFrame; //速度 + LineEditWidget *mInputTestFrame; //输入测试 + SwitchWidget *mKeyTipsFrame; //按键提示 + + SettingGroup *mKeyboardFrame; TitleLabel *mKeyboardSetTitleLabel; - QLabel *mKeyRepeatLabel; - QLabel *mDelayLabel; - QLabel *mDelayShortLabel; - QLabel *mDelayLongLabel; - QLabel *mSpeedLabel; - QLabel *mSpeedFastLabel; - QLabel *mSpeedSlowLabel; - QLabel *mInputTestLabel; - QLabel *mKeyTipsLabel; - - QFrame *keyRepeatAndDelayLine; - QFrame *delayAndSpeedLine; - QFrame *speedAndInputTestLine; - QFrame *inputTestAndKeyTipsLine; QPushButton *mInputMethodSetBtn; //输入法设置 QVBoxLayout *mVlayout; - QSlider *mDelaySlider; - QSlider *mSpeedSlider; - - QLineEdit *mInputTestLine; - QGSettings *mKeyboardGsettings; QGSettings *mKeyboardOsdGsetting; private: - QFrame* myLine(); - void initUI(); + void initUI(QWidget *widget); void setKeyRepeatFrame(); void setDelayFrame(); void setSpeedFrame(); @@ -92,5 +91,7 @@ private: void keyTipsSlot(bool checked); void inputMethodSetSlot(); + bool eventFilter(QObject *watched, QEvent *event); + }; #endif // KEYBOARDMAIN_H diff --git a/plugins/devices/keyboard/layoutmanager.ui b/plugins/devices/keyboard/layoutmanager.ui index 7418cc2..f1a4b54 100644 --- a/plugins/devices/keyboard/layoutmanager.ui +++ b/plugins/devices/keyboard/layoutmanager.ui @@ -464,12 +464,12 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
CloseButton QPushButton -
../../../libukcc/widgets/CloseButton/closebutton.h
+
closebutton.h
diff --git a/plugins/devices/mouse/mouse.pro b/plugins/devices/mouse/mouse.pro index b302880..c5c34df 100644 --- a/plugins/devices/mouse/mouse.pro +++ b/plugins/devices/mouse/mouse.pro @@ -5,6 +5,9 @@ #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets x11extras dbus @@ -34,11 +37,9 @@ PKGCONFIG += gio-2.0 \ #DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ - mousecontrol.cpp \ mouseui.cpp HEADERS += \ - mousecontrol.h \ mouseui.h FORMS += diff --git a/plugins/devices/mouse/mouseui.cpp b/plugins/devices/mouse/mouseui.cpp index 7295879..57965e1 100644 --- a/plugins/devices/mouse/mouseui.cpp +++ b/plugins/devices/mouse/mouseui.cpp @@ -1,4 +1,90 @@ -#include "mouseui.h" +/* -*- 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 "mouseui.h" + +MouseUI::MouseUI() : mFirstLoad(true) +{ + pluginName = tr("Mouse"); + pluginType = DEVICES; +} + +MouseUI::~MouseUI() +{ +} + +QString MouseUI::plugini18nName() +{ + return pluginName; +} + +int MouseUI::pluginTypes() +{ + return pluginType; +} + +QWidget *MouseUI::pluginUi() +{ + if (mFirstLoad) { + mFirstLoad = false; + pluginWidget = new QWidget; + pluginWidget->setAttribute(Qt::WA_DeleteOnClose); + + initUI(pluginWidget); + initConnection(); + if (Common::isTablet()) { + settingForIntel(); + } + } + return pluginWidget; +} + +const QString MouseUI::name() const +{ + return QStringLiteral("Mouse"); +} + +bool MouseUI::isShowOnHomePage() const +{ + return true; +} + +QIcon MouseUI::icon() const +{ + return QIcon::fromTheme("input-mouse-symbolic"); +} + +bool MouseUI::isEnable() const +{ + return true; +} + +void MouseUI::settingForIntel() +{ + if (pluginWidget) { + mWheelSpeedWidget->hide(); + mDoubleClickIntervalWidget->hide(); + mScrollDirectionWdiget->setFrameShape(QFrame::HLine); + mMouseAccelerationWidget->hide(); + } +} MyLabel::MyLabel() { @@ -35,73 +121,23 @@ void MyLabel::mouseDoubleClickEvent(QMouseEvent *event) }); } -MouseUI::MouseUI(QWidget *parent) - : QWidget(parent) +void MouseUI::initUI(QWidget *widget) { - mVlayout = new QVBoxLayout(this); + mVlayout = new QVBoxLayout(widget); mVlayout->setContentsMargins(0, 0, 0, 0); - initUI(); - initConnection(); -} -MouseUI::~MouseUI() -{ -} - -QFrame* MouseUI::myLine() -{ - QFrame *line = new QFrame(this); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - return line; -} - -void MouseUI::hideOnIntel() -{ - mScrollDirectionAndWheelLine->hide(); - mWheelSpeedFrame->hide(); - mWheelAndDoubleLine->hide(); - mDoubleClickIntervalFrame->hide(); - mPointerAndMouseLine->hide(); - mMouseAccelerationFrame->hide(); -} - -void MouseUI::initUI() -{ //鼠标 - QFrame *mouseFrame = new QFrame(this); - mouseFrame->setMinimumSize(550, 0); - mouseFrame->setMaximumSize(16777215, 16777215); - mouseFrame->setFrameShape(QFrame::Box); - - QVBoxLayout *mouseLyt = new QVBoxLayout(mouseFrame); - mouseLyt->setContentsMargins(0, 0, 0, 0); + SettingGroup *mouseFrame = new SettingGroup(this); //指针 - QFrame *pointerFrame = new QFrame(this); - pointerFrame->setMinimumSize(550, 0); - pointerFrame->setMaximumSize(16777215, 16777215); - pointerFrame->setFrameShape(QFrame::Box); - - QVBoxLayout *pointerLyt = new QVBoxLayout(pointerFrame); - pointerLyt->setContentsMargins(0, 0, 0, 0); + SettingGroup *pointerFrame = new SettingGroup(this); //光标 - QFrame *cursorFrame = new QFrame(this); - cursorFrame->setMinimumSize(550, 0); - cursorFrame->setMaximumSize(16777215, 16777215); - cursorFrame->setFrameShape(QFrame::Box); - - QVBoxLayout *cursorLyt = new QVBoxLayout(cursorFrame); - cursorLyt->setContentsMargins(0, 0, 0, 0); + SettingGroup *cursorFrame = new SettingGroup(this); mMouseTitleLabel = new TitleLabel(this); mMouseTitleLabel->setText(tr("Mouse")); - mMouseTitleLabel->setContentsMargins(14,0,0,0); + mMouseTitleLabel->setContentsMargins(16,0,0,0); setDominantHandFrame(); setScrollDirectionFrame(); setWheelSpeedFrame(); @@ -109,7 +145,7 @@ void MouseUI::initUI() mPointerTitleLabel = new TitleLabel(this); mPointerTitleLabel->setText(tr("Pointer")); - mPointerTitleLabel->setContentsMargins(14,0,0,0); + mPointerTitleLabel->setContentsMargins(16,0,0,0); setPointerSpeedFrame(); setMouseAccelerationFrame(); setPointerPositionFrame(); @@ -117,41 +153,23 @@ void MouseUI::initUI() mCursorTitleLabel = new TitleLabel(this); mCursorTitleLabel->setText(tr("Cursor")); - mCursorTitleLabel->setContentsMargins(14,0,0,0); + mCursorTitleLabel->setContentsMargins(16,0,0,0); setBlinkCursorFrame(); setCursorSpeedFrame(); /* add all frame to widget */ - mDominantAndScrollDirectionLine =myLine(); - mScrollDirectionAndWheelLine = myLine(); - mWheelAndDoubleLine = myLine(); - mPointerAndMouseLine = myLine(); - mMouseAndPointerPositionLine = myLine(); - mPositionAndSizeLine = myLine(); - mBlinkAndCursorspeedLine = myLine(); + mouseFrame->insertWidget(0, mDominantHandWidget); + mouseFrame->insertWidget(1, mScrollDirectionWdiget); + mouseFrame->insertWidget(2, mWheelSpeedWidget); + mouseFrame->insertWidget(3, mDoubleClickIntervalWidget); - mouseLyt->addWidget(mDominantHandFrame); - mouseLyt->addWidget(mDominantAndScrollDirectionLine); - mouseLyt->addWidget(mScrollDirectionFrame); - mouseLyt->addWidget(mScrollDirectionAndWheelLine); - mouseLyt->addWidget(mWheelSpeedFrame); - mouseLyt->addWidget(mWheelAndDoubleLine); - mouseLyt->addWidget(mDoubleClickIntervalFrame); - mouseLyt->setSpacing(0); + pointerFrame->insertWidget(0, mPointerSpeedWidget); + pointerFrame->insertWidget(1, mMouseAccelerationWidget); + pointerFrame->insertWidget(2, mPointerPositionWidget); + pointerFrame->insertWidget(3, mPointerSizeWidet); - pointerLyt->addWidget(mPointerSpeedFrame); - pointerLyt->addWidget(mPointerAndMouseLine); - pointerLyt->addWidget(mMouseAccelerationFrame); - pointerLyt->addWidget(mMouseAndPointerPositionLine); - pointerLyt->addWidget(mPointerPositionFrame); - pointerLyt->addWidget(mPositionAndSizeLine); - pointerLyt->addWidget(mPointerSizeFrame); - pointerLyt->setSpacing(0); - - cursorLyt->addWidget(mBlinkingCursorOnTextFrame); - cursorLyt->addWidget(mBlinkAndCursorspeedLine); - cursorLyt->addWidget(mCursorSpeedFrame); - cursorLyt->setSpacing(0); + cursorFrame->insertWidget(0, mBlinkingCursorOnTextWidget); + cursorFrame->insertWidget(1, mCursorSpeedWidget); mVlayout->addWidget(mMouseTitleLabel); mVlayout->addWidget(mouseFrame); @@ -166,305 +184,140 @@ void MouseUI::initUI() mVlayout->addWidget(mCursorTitleLabel); mVlayout->addWidget(cursorFrame); mVlayout->addStretch(); - - // fix 126831 暂时屏蔽部分功能 - mMouseAndPointerPositionLine->setVisible(false); - mPointerPositionFrame->setVisible(false); - mPositionAndSizeLine->setVisible(false); - mPointerSizeFrame->setVisible(false); } void MouseUI::setDominantHandFrame() { /* dominant hand Frame Setting */ - mDominantHandFrame = new QFrame(this); - mDominantHandFrame->setFrameShape(QFrame::Shape::Box); - mDominantHandFrame->setMinimumSize(550, 60); - mDominantHandFrame->setMaximumSize(16777215, 60); - QHBoxLayout *dominantHandHLayout = new QHBoxLayout(); - - //~ contents_path /Mouse/Dominant hand - mDominantHandLabel = new QLabel(tr("Dominant hand"), this); - mDominantHandLabel->setMinimumWidth(140); + //~ contents_path /Mouse/Dominant hand + mDominantHandWidget = new RadioButtonWidget(tr("Dominant hand"), this, UkccFrame::Top); + mDominantHandWidget->setObjectName("Dominant hand"); mDominantHandLeftRadio = new QRadioButton(tr("Left hand"), this); mDominantHandRightRadio = new QRadioButton(tr("Right hand"), this); - mDominantHandLeftRadio->setProperty("dominatHand", "left-key"); - mDominantHandRightRadio->setProperty("dominatHand", "right-key"); - mDominantRadioGroup = new QButtonGroup(this); - mDominantRadioGroup->addButton(mDominantHandLeftRadio); - mDominantRadioGroup->addButton(mDominantHandRightRadio); - dominantHandHLayout->addSpacing(4); - dominantHandHLayout->addWidget(mDominantHandLabel); - dominantHandHLayout->addWidget(mDominantHandLeftRadio); - dominantHandHLayout->addSpacing(80); - dominantHandHLayout->addWidget(mDominantHandRightRadio); - dominantHandHLayout->addStretch(); + mDominantHandWidget->addButton(mDominantHandLeftRadio, 0); + mDominantHandWidget->addButton(mDominantHandRightRadio, 1, true); - mDominantHandFrame->setLayout(dominantHandHLayout); } void MouseUI::setScrollDirectionFrame() { /* dominant hand Frame Setting */ - mScrollDirectionFrame = new QFrame(this); - mScrollDirectionFrame->setFrameShape(QFrame::Shape::Box); - mScrollDirectionFrame->setMinimumSize(550, 60); - mScrollDirectionFrame->setMaximumSize(16777215, 60); - QHBoxLayout *scrollDirectionHLayout = new QHBoxLayout(); - - //~ contents_path /Mouse/Scroll direction - mScrollDirectionLabel = new QLabel(tr("Scroll direction"), this); - mScrollDirectionLabel->setMinimumWidth(140); + //~ contents_path /Mouse/Scroll direction + mScrollDirectionWdiget = new RadioButtonWidget(tr("Scroll direction"), this); + mScrollDirectionWdiget->setObjectName("Scroll direction"); mScrollDirectionForwardRadio = new QRadioButton(tr("Forward"), this); mScrollDirectionReverseRadio = new QRadioButton(tr("Reverse"), this); - mScrollDirectionForwardRadio->setProperty("scrollDirection", "Forward"); - mScrollDirectionReverseRadio->setProperty("scrollDirection", "Reverse"); - mScrollDirectionRadioGroup = new QButtonGroup(this); - mScrollDirectionRadioGroup->addButton(mScrollDirectionForwardRadio); - mScrollDirectionRadioGroup->addButton(mScrollDirectionReverseRadio); - scrollDirectionHLayout->addSpacing(4); - scrollDirectionHLayout->addWidget(mScrollDirectionLabel); - scrollDirectionHLayout->addWidget(mScrollDirectionForwardRadio); - scrollDirectionHLayout->addSpacing(80); - scrollDirectionHLayout->addWidget(mScrollDirectionReverseRadio); - scrollDirectionHLayout->addStretch(); - - mScrollDirectionFrame->setLayout(scrollDirectionHLayout); + mScrollDirectionWdiget->addButton(mScrollDirectionForwardRadio, 0); + mScrollDirectionWdiget->addButton(mScrollDirectionReverseRadio, 1, true); } void MouseUI::setWheelSpeedFrame() { /* wheel speed Frame Setting */ - mWheelSpeedFrame = new QFrame(this); - mWheelSpeedFrame->setFrameShape(QFrame::Shape::Box); - mWheelSpeedFrame->setMinimumSize(550, 60); - mWheelSpeedFrame->setMaximumSize(16777215, 60); - - - QHBoxLayout *wheelSpeedHLayout = new QHBoxLayout(); //~ contents_path /Mouse/Wheel speed - mWheelSpeedLabel = new QLabel(tr("Wheel speed"), this); - mWheelSpeedLabel->setMinimumWidth(140); - mWheelSpeedSlowLabel = new QLabel(tr("Slow"), this); - mWheelSpeedSlowLabel->setMinimumWidth(40); - QStringList wheelSpeed; - wheelSpeed<< " " << " " << " " << " " <<" "; - mWheelSpeedSlider = new Uslider(wheelSpeed); - // 1=3行,2=6行,3=9行,4=12行,5=15行 - mWheelSpeedSlider->setRange(1,5); - mWheelSpeedSlider->setTickInterval(1); - mWheelSpeedSlider->setPageStep(1); - mWheelSpeedFastLabel = new QLabel(tr("Fast"), this); - mWheelSpeedFastLabel->setMinimumWidth(40); - mWheelSpeedFastLabel->setContentsMargins(8, 0, 13, 0); - wheelSpeedHLayout->addWidget(mWheelSpeedLabel); - wheelSpeedHLayout->addWidget(mWheelSpeedSlowLabel); - wheelSpeedHLayout->addWidget(mWheelSpeedSlider); - wheelSpeedHLayout->addWidget(mWheelSpeedFastLabel); - wheelSpeedHLayout->setContentsMargins(12, 0, 0, 0); - - mWheelSpeedFrame->setLayout(wheelSpeedHLayout); + mWheelSpeedWidget = new SliderWidget(tr("Wheel speed"), true, this); + mWheelSpeedWidget->setObjectName("Wheel speed"); + mWheelSpeedWidget->setLeftText(tr("Slow")); + mWheelSpeedWidget->setRightText(tr("Fast")); + mWheelSpeedWidget->slider()->setSliderType(KSliderType::NodeSlider); + mWheelSpeedWidget->slider()->setRange(1,10); + mWheelSpeedWidget->slider()->setTickInterval(1); + mWheelSpeedWidget->slider()->setPageStep(1); + mWheelSpeedWidget->slider()->installEventFilter(this); } void MouseUI::setDoubleClickFrame() { /* Double Click Interval time Frame Setting */ - mDoubleClickIntervalFrame = new QFrame(this); - mDoubleClickIntervalFrame->setFrameShape(QFrame::Shape::Box); - mDoubleClickIntervalFrame->setMinimumSize(550, 60); - mDoubleClickIntervalFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *doubleClickIntervalHLayout = new QHBoxLayout(); //~ contents_path /Mouse/Double-click interval time - mDoubleClickIntervalLabel = new QLabel(tr("Double-click interval time"), this); - mDoubleClickIntervalLabel->setMinimumWidth(140); - mDoubleClickIntervalShortLabel = new QLabel(tr("Short"), this); - mDoubleClickIntervalShortLabel->setMinimumWidth(40); - mDoubleClickIntervalSlider = new QSlider(Qt::Horizontal); - mDoubleClickIntervalSlider->setMinimum(170); - mDoubleClickIntervalSlider->setMaximum(1000); - mDoubleClickIntervalSlider->setSingleStep(100); - mDoubleClickIntervalSlider->setPageStep(100); - mDoubleClickIntervalLongLabel = new QLabel(tr("Long"), this); - mDoubleClickIntervalLongLabel->setContentsMargins(8, 0, 0, 0); - mDoubleClickIntervalLongLabel->setMinimumWidth(40); - doubleClickIntervalHLayout->addWidget(mDoubleClickIntervalLabel); - doubleClickIntervalHLayout->addWidget(mDoubleClickIntervalShortLabel); - doubleClickIntervalHLayout->addWidget(mDoubleClickIntervalSlider); - doubleClickIntervalHLayout->addWidget(mDoubleClickIntervalLongLabel); - doubleClickIntervalHLayout->addWidget(new MyLabel()); - doubleClickIntervalHLayout->setContentsMargins(12, 0, 12, 0); - - mDoubleClickIntervalFrame->setLayout(doubleClickIntervalHLayout); + mDoubleClickIntervalWidget = new SliderWidget(tr("Double-click interval time"), false, this, UkccFrame::Bottom); + mDoubleClickIntervalWidget->setObjectName("Double-click interval time"); + mDoubleClickIntervalWidget->setLeftText(tr("Slow")); + mDoubleClickIntervalWidget->setRightText(tr("Fast")); + mDoubleClickIntervalWidget->slider()->setSliderType(KSliderType::SmoothSlider); + mDoubleClickIntervalWidget->slider()->setMinimum(170); + mDoubleClickIntervalWidget->slider()->setMaximum(1000); + mDoubleClickIntervalWidget->slider()->setSingleStep(100); + mDoubleClickIntervalWidget->slider()->setPageStep(100); + mDoubleClickIntervalWidget->slider()->installEventFilter(this); + mDoubleClickIntervalWidget->insertWidget(5, new MyLabel()); } void MouseUI::setPointerSpeedFrame() { /* Pointer Speed Frame Setting */ - mPointerSpeedFrame = new QFrame(this); - mPointerSpeedFrame->setFrameShape(QFrame::Shape::Box); - mPointerSpeedFrame->setMinimumSize(550, 60); - mPointerSpeedFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *pointerSpeedHLayout = new QHBoxLayout(); //~ contents_path /Mouse/Pointer speed - mPointerSpeedLabel = new QLabel(tr("Pointer speed"), this); - mPointerSpeedLabel->setMinimumWidth(140); - mPointerSpeedSlowLabel = new QLabel(tr("Slow"), this); - mPointerSpeedSlowLabel->setMinimumWidth(40); - mPointerSpeedSlider = new QSlider(Qt::Horizontal); - mPointerSpeedSlider->setMinimum(100); - mPointerSpeedSlider->setMaximum(1000); - mPointerSpeedSlider->setSingleStep(50); - mPointerSpeedSlider->setPageStep(50); - mPointerSpeedFastLabel = new QLabel(tr("Fast"), this); - mPointerSpeedFastLabel->setContentsMargins(8, 0, 13, 0); - mPointerSpeedFastLabel->setMinimumWidth(40); - pointerSpeedHLayout->addWidget(mPointerSpeedLabel); - pointerSpeedHLayout->addWidget(mPointerSpeedSlowLabel); - pointerSpeedHLayout->addWidget(mPointerSpeedSlider); - pointerSpeedHLayout->addWidget(mPointerSpeedFastLabel); - pointerSpeedHLayout->setContentsMargins(12, 0, 0, 0); - - mPointerSpeedFrame->setLayout(pointerSpeedHLayout); + mPointerSpeedWidget = new SliderWidget(tr("Pointer speed"), false, this, UkccFrame::Top); + mPointerSpeedWidget->setObjectName("Pointer speed"); + mPointerSpeedWidget->setLeftText(tr("Slow")); + mPointerSpeedWidget->setRightText(tr("Fast")); + mPointerSpeedWidget->slider()->setSliderType(KSliderType::SmoothSlider); + mPointerSpeedWidget->slider()->setMinimum(100); + mPointerSpeedWidget->slider()->setMaximum(1000); + mPointerSpeedWidget->slider()->setSingleStep(50); + mPointerSpeedWidget->slider()->setPageStep(50); + mPointerSpeedWidget->slider()->installEventFilter(this); } void MouseUI::setMouseAccelerationFrame() { /* Mouse Acceleration Frame Setting */ - mMouseAccelerationFrame = new QFrame(this); - mMouseAccelerationFrame->setFrameShape(QFrame::Shape::Box); - mMouseAccelerationFrame->setMinimumSize(550, 60); - mMouseAccelerationFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *mouseAccelerationHLayout = new QHBoxLayout(); - - mMouseAccelerationBtn = new KSwitchButton(this); //~ contents_path /Mouse/Mouse acceleration - mMouseAccelerationLabel = new QLabel(tr("Mouse acceleration"), this); - mMouseAccelerationLabel->setMinimumWidth(140); - mouseAccelerationHLayout->addWidget(mMouseAccelerationLabel); - mouseAccelerationHLayout->addStretch(); - mouseAccelerationHLayout->addWidget(mMouseAccelerationBtn); - mouseAccelerationHLayout->setContentsMargins(12, 0, 14, 0); - - mMouseAccelerationFrame->setLayout(mouseAccelerationHLayout); + mMouseAccelerationWidget = new SwitchWidget(tr("Mouse acceleration"), this, UkccFrame::None); + mMouseAccelerationWidget->setObjectName("Mouse acceleration"); } void MouseUI::setPointerPositionFrame() { /* Pointer Position Frame Setting */ - mPointerPositionFrame = new QFrame(this); - mPointerPositionFrame->setFrameShape(QFrame::Shape::Box); - mPointerPositionFrame->setMinimumSize(550, 60); - mPointerPositionFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *PointerPositionHLayout = new QHBoxLayout(); - //~ contents_path /Mouse/Show pointer position when pressing ctrl - mPointerPositionLabel = new QLabel(tr("Show pointer position when pressing ctrl"), this); - mPointerPositionLabel->setMinimumWidth(140); - mPointerPositionBtn = new KSwitchButton(this); - PointerPositionHLayout->addWidget(mPointerPositionLabel); - PointerPositionHLayout->addStretch(); - PointerPositionHLayout->addWidget(mPointerPositionBtn); - PointerPositionHLayout->setContentsMargins(12, 0, 14, 0); - - mPointerPositionFrame->setLayout(PointerPositionHLayout); + mPointerPositionWidget = new SwitchWidget(tr("Show pointer position when pressing ctrl"), this, UkccFrame::None); + mPointerPositionWidget->setObjectName("Show pointer position when pressing ctrl"); } void MouseUI::setPointerSizeFrame() { /* Pointer Size Frame Setting */ - mPointerSizeFrame = new QFrame(this); - mPointerSizeFrame->setFrameShape(QFrame::Shape::Box); - mPointerSizeFrame->setMinimumSize(550, 60); - mPointerSizeFrame->setMaximumSize(16777215, 60); - QHBoxLayout *pointerSizeHLayout = new QHBoxLayout(); - - //~ contents_path /Mouse/Pointer size - mPointerSizeLabel = new QLabel(tr("Pointer size"),this); - mPointerSizeLabel->setMinimumWidth(140); + //~ contents_path /Mouse/Pointer size + mPointerSizeWidet = new RadioButtonWidget(tr("Pointer size"), this, UkccFrame::Bottom); + mPointerSizeWidet->setObjectName("Pointer size"); mPointerSizeSmallRadio = new QRadioButton(tr("Small(recommend)"), this); mPointerSizeMediumRadio = new QRadioButton(tr("Medium"), this); mPointerSizeLargeRadio = new QRadioButton(tr("Large"), this); - mPointerSizeSmallRadio->setProperty("pointer", "Small"); - mPointerSizeMediumRadio->setProperty("pointer", "Medium"); - mPointerSizeLargeRadio->setProperty("pointer", "Large"); - mPointerSizeRadioGroup = new QButtonGroup(this); - mPointerSizeRadioGroup->addButton(mPointerSizeSmallRadio); - mPointerSizeRadioGroup->addButton(mPointerSizeMediumRadio); - mPointerSizeRadioGroup->addButton(mPointerSizeLargeRadio); - pointerSizeHLayout->addSpacing(4); - pointerSizeHLayout->addWidget(mPointerSizeLabel); - pointerSizeHLayout->addWidget(mPointerSizeSmallRadio); - pointerSizeHLayout->addSpacing(50); - pointerSizeHLayout->addWidget(mPointerSizeMediumRadio); - pointerSizeHLayout->addSpacing(50); - pointerSizeHLayout->addWidget(mPointerSizeLargeRadio); - pointerSizeHLayout->addStretch(); - - mPointerSizeFrame->setLayout(pointerSizeHLayout); + mPointerSizeWidet->addButton(mPointerSizeSmallRadio, 24); + mPointerSizeWidet->addButton(mPointerSizeMediumRadio, 36); + mPointerSizeWidet->addButton(mPointerSizeLargeRadio, 48, true); } void MouseUI::setBlinkCursorFrame() { /* Blinking Cursor On Text Frame Setting */ - mBlinkingCursorOnTextFrame = new QFrame(this); - mBlinkingCursorOnTextFrame->setFrameShape(QFrame::Shape::Box); - mBlinkingCursorOnTextFrame->setMinimumSize(550, 60); - mBlinkingCursorOnTextFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *blinkingCursorOnTextHLayout = new QHBoxLayout(); - - //~ contents_path /Mouse/Blinking cursor in text area - mBlinkingCursorOnTextLabel = new QLabel(tr("Blinking cursor in text area"), this); - mBlinkingCursorOnTextLabel->setMinimumWidth(140); - mBlinkingCursorOnTextBtn = new KSwitchButton(this); - blinkingCursorOnTextHLayout->addWidget(mBlinkingCursorOnTextLabel); - blinkingCursorOnTextHLayout->addStretch(); - blinkingCursorOnTextHLayout->addWidget(mBlinkingCursorOnTextBtn); - blinkingCursorOnTextHLayout->setContentsMargins(12, 0, 14, 0); - - mBlinkingCursorOnTextFrame->setLayout(blinkingCursorOnTextHLayout); + //~ contents_path /Mouse/Blinking cursor in text area + mBlinkingCursorOnTextWidget = new SwitchWidget(tr("Blinking cursor in text area"), this, UkccFrame::Top); + mBlinkingCursorOnTextWidget->setObjectName("Blinking cursor in text area"); } void MouseUI::setCursorSpeedFrame() { /* Cursor Speed Frame Setting */ - mCursorSpeedFrame = new QFrame(this); - mCursorSpeedFrame->setFrameShape(QFrame::Shape::Box); - mCursorSpeedFrame->setMinimumSize(550, 60); - mCursorSpeedFrame->setMaximumSize(16777215, 60); - - QHBoxLayout *cursorSpeedHLayout = new QHBoxLayout(); //~ contents_path /Mouse/Cursor speed - mCursorSpeedlabel = new QLabel(tr("Cursor speed"), this); - mCursorSpeedlabel->setMinimumWidth(140); - mCursorSpeedSlowlabel = new QLabel(tr("Slow"), this); - mCursorSpeedSlowlabel->setMinimumWidth(40); - mCursorSpeedSlider = new QSlider(Qt::Horizontal); - mCursorSpeedSlider->setMinimum(100); - mCursorSpeedSlider->setMaximum(2500); - mCursorSpeedSlider->setSingleStep(200); - mCursorSpeedSlider->setPageStep(200); - mCursorSpeedFastlabel = new QLabel(tr("Fast"), this); - mCursorSpeedFastlabel->setContentsMargins(8, 0, 13, 0); - mCursorSpeedFastlabel->setMinimumWidth(40); - cursorSpeedHLayout->addWidget(mCursorSpeedlabel); - cursorSpeedHLayout->addWidget(mCursorSpeedSlowlabel); - cursorSpeedHLayout->addWidget(mCursorSpeedSlider); - cursorSpeedHLayout->addWidget(mCursorSpeedFastlabel); - cursorSpeedHLayout->setContentsMargins(12, 0, 0, 0); - - mCursorSpeedFrame->setLayout(cursorSpeedHLayout); + mCursorSpeedWidget = new SliderWidget(tr("Cursor speed"), false, this, UkccFrame::Bottom); + mCursorSpeedWidget->setObjectName("Cursor speed"); + mCursorSpeedWidget->setLeftText(tr("Slow")); + mCursorSpeedWidget->setRightText(tr("Fast")); + mCursorSpeedWidget->slider()->setSliderType(KSliderType::SmoothSlider); + mCursorSpeedWidget->slider()->setMinimum(100); + mCursorSpeedWidget->slider()->setMaximum(2500); + mCursorSpeedWidget->slider()->setSingleStep(200); + mCursorSpeedWidget->slider()->setPageStep(200); + mCursorSpeedWidget->installEventFilter(this); } void MouseUI::initConnection() @@ -479,28 +332,28 @@ void MouseUI::initConnection() initEnableStatus(); - connect(mDominantRadioGroup, QOverload::of(&QButtonGroup::buttonClicked), + connect(mDominantHandWidget, QOverload::of(&RadioButtonWidget::buttonClicked), this, &MouseUI::dominantHandSlot); - connect(mScrollDirectionRadioGroup, QOverload::of(&QButtonGroup::buttonClicked), + connect(mScrollDirectionWdiget, QOverload::of(&RadioButtonWidget::buttonClicked), this, &MouseUI::scrollDirectionSlot); - connect(mWheelSpeedSlider, &QSlider::valueChanged, this, &MouseUI::wheelSpeedSlot); + connect(mWheelSpeedWidget, &SliderWidget::valueChanged, this, &MouseUI::wheelSpeedSlot); - connect(mDoubleClickIntervalSlider, &QSlider::valueChanged , this, &MouseUI::doubleClickIntervalSlot); + connect(mDoubleClickIntervalWidget, &SliderWidget::valueChanged , this, &MouseUI::doubleClickIntervalSlot); - connect(mPointerSpeedSlider, &QSlider::valueChanged, this, &MouseUI::pointerSpeedSlot); + connect(mPointerSpeedWidget, &SliderWidget::valueChanged, this, &MouseUI::pointerSpeedSlot); - connect(mMouseAccelerationBtn, &KSwitchButton::stateChanged, this, &MouseUI::mouseAccelerationSlot); + connect(mMouseAccelerationWidget, &SwitchWidget::stateChanged, this, &MouseUI::mouseAccelerationSlot); - connect(mPointerPositionBtn, &KSwitchButton::stateChanged, this, &MouseUI::pointerPositionSlot); + connect(mPointerPositionWidget, &SwitchWidget::stateChanged, this, &MouseUI::pointerPositionSlot); - connect(mPointerSizeRadioGroup, QOverload::of(&QButtonGroup::buttonClicked), + connect(mPointerSizeWidet, QOverload::of(&RadioButtonWidget::buttonClicked), this, &MouseUI::pointerSizeSlot); - connect(mBlinkingCursorOnTextBtn, &KSwitchButton::stateChanged, this, &MouseUI::blinkCursorOnTextSlot); + connect(mBlinkingCursorOnTextWidget, &SwitchWidget::stateChanged, this, &MouseUI::blinkCursorOnTextSlot); - connect(mCursorSpeedSlider, &QSlider::valueChanged, this, &MouseUI::cursorSpeedSlot); + connect(mCursorSpeedWidget, &SliderWidget::valueChanged, this, &MouseUI::cursorSpeedSlot); gsettingConnection(); } @@ -519,32 +372,38 @@ void MouseUI::gsettingConnection() } } else if(key == "naturalScroll") { bool scrollDirection = mMouseGsetting->get(kScrollDirection).toBool(); - mScrollDirectionRadioGroup->blockSignals(true); + mScrollDirectionWdiget->buttonGroup()->blockSignals(true); if (scrollDirection) { mScrollDirectionReverseRadio->setChecked(true); } else { mScrollDirectionForwardRadio->setChecked(true); } - mScrollDirectionRadioGroup->blockSignals(false); + mScrollDirectionWdiget->buttonGroup()->blockSignals(false); } else if(key == "wheelSpeed") { - mWheelSpeedSlider->setValue(mMouseGsetting->get(kWheelSpeedKey).toInt()); + mWheelSpeedWidget->slider()->blockSignals(true); + int value = mMouseGsetting->get(kWheelSpeedKey).toInt(); + if (value < 1 || value >10) { + mMouseGsetting->reset(kWheelSpeedKey); + } + mWheelSpeedWidget->setValue(mMouseGsetting->get(kWheelSpeedKey).toInt()); + mWheelSpeedWidget->slider()->blockSignals(false); } else if(key == "doubleClick") { int dc = mMouseGsetting->get(kDoubleClickIntervalKey).toInt(); - mDoubleClickIntervalSlider->blockSignals(true); - mDoubleClickIntervalSlider->setValue(dc); - mDoubleClickIntervalSlider->blockSignals(false); + mDoubleClickIntervalWidget->slider()->blockSignals(true); + mDoubleClickIntervalWidget->setValue(dc); + mDoubleClickIntervalWidget->slider()->blockSignals(false); } else if(key == "motionAcceleration") { - mPointerSpeedSlider->blockSignals(true); - mPointerSpeedSlider->setValue(static_cast(mMouseGsetting->get(kPointerSpeedKey).toDouble()*100)); - mPointerSpeedSlider->blockSignals(false); + mPointerSpeedWidget->slider()->blockSignals(true); + mPointerSpeedWidget->setValue(static_cast(mMouseGsetting->get(kPointerSpeedKey).toDouble()*100)); + mPointerSpeedWidget->slider()->blockSignals(false); } else if(key == "mouseAccel") { - mMouseAccelerationBtn->blockSignals(true); - mMouseAccelerationBtn->setChecked(mMouseGsetting->get(kMouseAccelerationKey).toBool()); - mMouseAccelerationBtn->blockSignals(false); + mMouseAccelerationWidget->blockSignals(true); + mMouseAccelerationWidget->setChecked(mMouseGsetting->get(kMouseAccelerationKey).toBool()); + mMouseAccelerationWidget->blockSignals(false); } else if(key == "locatePointer") { - mPointerPositionBtn->blockSignals(true); - mPointerPositionBtn->setChecked(mMouseGsetting->get(kPointerPositionKey).toBool()); - mPointerPositionBtn->blockSignals(false); + mPointerPositionWidget->blockSignals(true); + mPointerPositionWidget->setChecked(mMouseGsetting->get(kPointerPositionKey).toBool()); + mPointerPositionWidget->blockSignals(false); } else if(key == "cursorSize") { int PointerSize = mMouseGsetting->get(kPointerSizeKey).toInt(); if (PointerSize == 24) { @@ -553,21 +412,28 @@ void MouseUI::gsettingConnection() mPointerSizeMediumRadio->setChecked(true); } else if (PointerSize == 48) { mPointerSizeLargeRadio->setChecked(true); + } else { + mMouseGsetting->reset(kPointerSizeKey); } } }); connect(mDesktopGsetting,&QGSettings::changed,[=](const QString &key) { if (key == "cursorBlink") { - mBlinkingCursorOnTextBtn->blockSignals(true); - mBlinkingCursorOnTextBtn->setChecked(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); - mCursorSpeedFrame->setVisible(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); - mBlinkingCursorOnTextBtn->blockSignals(false); + mBlinkingCursorOnTextWidget->blockSignals(true); + mBlinkingCursorOnTextWidget->setChecked(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); + mBlinkingCursorOnTextWidget->blockSignals(false); + if (mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()) { + mBlinkingCursorOnTextWidget->setRadiusType(UkccFrame::Top); + } else { + mBlinkingCursorOnTextWidget->setRadiusType(UkccFrame::Around); + } + mCursorSpeedWidget->setVisible(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); }else if (key == "cursorBlinkTime") { - mCursorSpeedSlider->blockSignals(true); - int mValue = mCursorSpeedSlider->maximum() - mDesktopGsetting->get(kCursorSpeedKey).toInt() + mCursorSpeedSlider->minimum(); - mCursorSpeedSlider->setValue(mValue); - mCursorSpeedSlider->blockSignals(false); + int mValue = mCursorSpeedWidget->slider()->maximum() - mDesktopGsetting->get(kCursorSpeedKey).toInt() + mCursorSpeedWidget->slider()->minimum(); + mCursorSpeedWidget->slider()->blockSignals(true); + mCursorSpeedWidget->setValue(mValue); + mCursorSpeedWidget->slider()->blockSignals(false); } }); } @@ -575,17 +441,17 @@ void MouseUI::gsettingConnection() void MouseUI::initEnableStatus() { //初始化惯用手, 左手:右键为主键,右手:左键为主键 - mDominantRadioGroup->blockSignals(true); + mDominantHandWidget->buttonGroup()->blockSignals(true); bool currentDominantHand = mMouseGsetting->get(kDominantHandKey).toBool(); if (currentDominantHand == true) { mDominantHandRightRadio->setChecked(true); } else { mDominantHandLeftRadio->setChecked(true); } - mDominantRadioGroup->blockSignals(false); + mDominantHandWidget->buttonGroup()->blockSignals(false); // 初始化滚动方向 true:界面与鼠标滚轮滚动方向相反(反向),false:界面与滚轮滚动方向相同(正向) - mScrollDirectionRadioGroup->blockSignals(true); + mScrollDirectionWdiget->buttonGroup()->blockSignals(true); if (mMouseGsetting->keys().contains("naturalScroll")) { bool currentScrollDirection = mMouseGsetting->get(kScrollDirection).toBool(); if (currentScrollDirection) { @@ -594,36 +460,44 @@ void MouseUI::initEnableStatus() mScrollDirectionForwardRadio->setChecked(true); } } - mScrollDirectionRadioGroup->blockSignals(false); + mScrollDirectionWdiget->buttonGroup()->blockSignals(false); //初始化滚轮速度 - mWheelSpeedSlider->blockSignals(true); - mWheelSpeedSlider->setValue(mMouseGsetting->get(kWheelSpeedKey).toInt()); - mWheelSpeedSlider->blockSignals(false); + mWheelSpeedWidget->slider()->blockSignals(true); + int value = mMouseGsetting->get(kWheelSpeedKey).toInt(); + if (value < 1 || value >10) { + mMouseGsetting->reset(kWheelSpeedKey); + } + mWheelSpeedWidget->setValue(mMouseGsetting->get(kWheelSpeedKey).toInt()); + mWheelSpeedWidget->slider()->blockSignals(false); //初始化双击间隔时长 - mDoubleClickIntervalSlider->blockSignals(true); - mDoubleClickIntervalSlider->setValue(mMouseGsetting->get(kDoubleClickIntervalKey).toInt()); - mDoubleClickIntervalSlider->blockSignals(false); + mDoubleClickIntervalWidget->slider()->blockSignals(true); + mDoubleClickIntervalWidget->setValue(mMouseGsetting->get(kDoubleClickIntervalKey).toInt()); + mDoubleClickIntervalWidget->slider()->blockSignals(false); //初始化指针速度 - mPointerSpeedSlider->blockSignals(true); - mPointerSpeedSlider->setValue(static_cast(mMouseGsetting->get(kPointerSpeedKey).toDouble()*100)); - mPointerSpeedSlider->blockSignals(false); + mPointerSpeedWidget->slider()->blockSignals(true); + mPointerSpeedWidget->setValue(static_cast(mMouseGsetting->get(kPointerSpeedKey).toDouble()*100)); + mPointerSpeedWidget->slider()->blockSignals(false); //初始化鼠标加速 - mMouseAccelerationBtn->blockSignals(true); - mMouseAccelerationBtn->setChecked(mMouseGsetting->get(kMouseAccelerationKey).toBool()); - mMouseAccelerationBtn->blockSignals(false); + mMouseAccelerationWidget->blockSignals(true); + mMouseAccelerationWidget->setChecked(mMouseGsetting->get(kMouseAccelerationKey).toBool()); + mMouseAccelerationWidget->blockSignals(false); //初始化按 ctrl 键时显示指针位置 - mPointerPositionBtn->blockSignals(true); - mPointerPositionBtn->setChecked(mMouseGsetting->get(kPointerPositionKey).toBool()); - mPointerPositionBtn->blockSignals(false); + mPointerPositionWidget->blockSignals(true); + mPointerPositionWidget->setChecked(mMouseGsetting->get(kPointerPositionKey).toBool()); + mPointerPositionWidget->blockSignals(false); //初始化指针大小 - mPointerSizeRadioGroup->blockSignals(true); + mPointerSizeWidet->buttonGroup()->blockSignals(true); int currentPointerSize = mMouseGsetting->get(kPointerSizeKey).toInt(); + if (currentPointerSize != 24 && currentPointerSize != 36 && currentPointerSize != 48) { + mMouseGsetting->reset(kPointerSizeKey); + currentPointerSize = mMouseGsetting->get(kPointerSizeKey).toInt(); + } if (currentPointerSize == 24) { mPointerSizeSmallRadio->setChecked(true); } else if (currentPointerSize == 36) { @@ -631,113 +505,148 @@ void MouseUI::initEnableStatus() } else if (currentPointerSize == 48) { mPointerSizeLargeRadio->setChecked(true); } - mPointerSizeRadioGroup->blockSignals(false); + mPointerSizeWidet->buttonGroup()->blockSignals(false); //初始化文本区域光标闪烁 - mBlinkingCursorOnTextBtn->blockSignals(true); - mBlinkingCursorOnTextBtn->setChecked(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); - mBlinkingCursorOnTextBtn->blockSignals(false); + mBlinkingCursorOnTextWidget->blockSignals(true); + mBlinkingCursorOnTextWidget->setChecked(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); + mBlinkingCursorOnTextWidget->blockSignals(false); //初始化光标速度 - mCursorSpeedSlider->blockSignals(true); - mCursorSpeedSlider->setValue(mCursorSpeedSlider->maximum() - mDesktopGsetting->get(kCursorSpeedKey).toInt() - + mCursorSpeedSlider->minimum()); - mCursorSpeedSlider->blockSignals(false); - mCursorSpeedFrame->setVisible(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); + mCursorSpeedWidget->slider()->blockSignals(true); + mCursorSpeedWidget->setValue(mCursorSpeedWidget->slider()->maximum() - mDesktopGsetting->get(kCursorSpeedKey).toInt() + + mCursorSpeedWidget->slider()->minimum()); + mCursorSpeedWidget->slider()->blockSignals(false); + if (mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()) { + mBlinkingCursorOnTextWidget->setRadiusType(UkccFrame::Top); + } else { + mBlinkingCursorOnTextWidget->setRadiusType(UkccFrame::Around); + } + mCursorSpeedWidget->setVisible(mDesktopGsetting->get(kBlinkCursorOnTextKey).toBool()); } /* Slot */ -void MouseUI::dominantHandSlot(QAbstractButton *button) +void MouseUI::dominantHandSlot(int id) { - QString dominantHand = button->property("dominatHand").toString(); bool tmpLeftHand; // 左键主键:右手、left-handed=false,右键主键:左手、left-handed=true - if (QString::compare(dominantHand, "left-key") == 0) { + if (id == 0) { tmpLeftHand = false; } else { tmpLeftHand = true; } mMouseGsetting->set(kDominantHandKey, tmpLeftHand); + + Common::buriedSettings(name(), mDominantHandWidget->objectName(), QString("setting")); } -void MouseUI::scrollDirectionSlot(QAbstractButton *button) +void MouseUI::scrollDirectionSlot(int id) { - QString scrollDirection = button->property("scrollDirection").toString(); bool tmpScrollDirection; // true:界面与鼠标滚轮滚动方向相反(反向),false:界面与滚轮滚动方向相同(正向) - if (QString::compare(scrollDirection, "Forward") == 0) { + if (id == 0) { tmpScrollDirection = false; } else { tmpScrollDirection = true; } - mMouseGsetting->set(kScrollDirection, tmpScrollDirection); + if (mMouseGsetting->keys().contains("naturalScroll")) { + mMouseGsetting->set(kScrollDirection, tmpScrollDirection); + } else { + qDebug() << "naturalScroll is not exist in org.ukui.peripherals-mouse"; + } + + Common::buriedSettings(name(), mScrollDirectionWdiget->objectName(), QString("setting")); } void MouseUI::wheelSpeedSlot() { - mMouseGsetting->set(kWheelSpeedKey, mWheelSpeedSlider->value()); + mMouseGsetting->set(kWheelSpeedKey, mWheelSpeedWidget->value()); } void MouseUI::doubleClickIntervalSlot() { - mMouseGsetting->set(kDoubleClickIntervalKey, mDoubleClickIntervalSlider->value()); - qApp->setDoubleClickInterval(mDoubleClickIntervalSlider->value()); + mMouseGsetting->set(kDoubleClickIntervalKey, mDoubleClickIntervalWidget->value()); + qApp->setDoubleClickInterval(mDoubleClickIntervalWidget->value()); } void MouseUI::pointerSpeedSlot(int value) { - mMouseGsetting->set(kPointerSpeedKey, static_cast(value)/mPointerSpeedSlider->maximum() * 10); + mMouseGsetting->set(kPointerSpeedKey, static_cast(value)/mPointerSpeedWidget->slider()->maximum() * 10); } void MouseUI::mouseAccelerationSlot(bool checked) { mMouseGsetting->set(kMouseAccelerationKey, checked); + + Common::buriedSettings(name(), mMouseAccelerationWidget->objectName(), QString("setting"), checked ? "true":"false"); } void MouseUI::pointerPositionSlot(bool checked) { mMouseGsetting->set(kPointerPositionKey, checked); + + Common::buriedSettings(name(), mPointerPositionWidget->objectName(), QString("setting"), checked ? "true":"false"); } -void MouseUI::pointerSizeSlot(QAbstractButton *button) +void MouseUI::pointerSizeSlot(int id) { - QString pointerSize = button->property("pointer").toString(); - int tmpPointerSize; - - if (QString::compare(pointerSize, "Small") == 0) { - tmpPointerSize = 24; - } else if (QString::compare(pointerSize, "Medium") == 0) { - tmpPointerSize = 36; - } else if (QString::compare(pointerSize, "Large") == 0) { - tmpPointerSize = 48; - } + int tmpPointerSize = id; mMouseGsetting->set(kPointerSizeKey, tmpPointerSize); + + Common::buriedSettings(name(), mPointerSizeWidet->objectName(), QString("setting")); } void MouseUI::blinkCursorOnTextSlot(bool checked) { - mCursorSpeedFrame->setVisible(checked); + mCursorSpeedWidget->setVisible(checked); mDesktopGsetting->set(kBlinkCursorOnTextKey, checked); mThemeSettings->set(kBlinkCursorOnTextKey, checked); if (!checked) { + mBlinkingCursorOnTextWidget->setRadiusType(UkccFrame::Around); mThemeSettings->set(kCursorSpeedKey, 0); } else { - int mValue = mCursorSpeedSlider->maximum() - mCursorSpeedSlider->value() + mCursorSpeedSlider->minimum(); + mBlinkingCursorOnTextWidget->setRadiusType(UkccFrame::Top); + int mValue = mCursorSpeedWidget->slider()->maximum() - mCursorSpeedWidget->slider()->value() + mCursorSpeedWidget->slider()->minimum(); mThemeSettings->set(kCursorSpeedKey, mValue); } + + Common::buriedSettings(name(), mBlinkingCursorOnTextWidget->objectName(), QString("setting"), checked ? "true":"false"); } void MouseUI::cursorSpeedSlot() { - mDesktopGsetting->set(kCursorSpeedKey, mCursorSpeedSlider->maximum() - mCursorSpeedSlider->value() - + mCursorSpeedSlider->minimum()); - mThemeSettings->set(kCursorSpeedKey, mCursorSpeedSlider->maximum() - mCursorSpeedSlider->value() - + mCursorSpeedSlider->minimum()); + mDesktopGsetting->set(kCursorSpeedKey, mCursorSpeedWidget->slider()->maximum() - mCursorSpeedWidget->value() + + mCursorSpeedWidget->slider()->minimum()); + mThemeSettings->set(kCursorSpeedKey, mCursorSpeedWidget->slider()->maximum() - mCursorSpeedWidget->value() + + mCursorSpeedWidget->slider()->minimum()); +} + +bool MouseUI::eventFilter(QObject *watched, QEvent *event) +{ + if (event->type() == QEvent::FocusOut) { + if (watched == mWheelSpeedWidget->slider()) { + int value = mWheelSpeedWidget->value(); + Common::buriedSettings(name(), mWheelSpeedWidget->objectName(), QString("setting"), QString::number(value)); + } else if (watched == mDoubleClickIntervalWidget->slider()) { + int value = mDoubleClickIntervalWidget->value(); + Common::buriedSettings(name(), mDoubleClickIntervalWidget->objectName(), QString("setting"), QString::number(value)); + + } else if (watched == mPointerSpeedWidget->slider()) { + int value = mPointerSpeedWidget->value(); + Common::buriedSettings(name(), mPointerSpeedWidget->objectName(), QString("setting"), QString::number(value)); + + } else if (watched == mCursorSpeedWidget->slider()) { + int value = mCursorSpeedWidget->value(); + Common::buriedSettings(name(), mCursorSpeedWidget->objectName(), QString("setting"), QString::number(value)); + + } + } + return QObject::eventFilter(watched, event); } diff --git a/plugins/devices/mouse/mouseui.h b/plugins/devices/mouse/mouseui.h index 2fa7399..5d5a67d 100644 --- a/plugins/devices/mouse/mouseui.h +++ b/plugins/devices/mouse/mouseui.h @@ -15,10 +15,18 @@ #include #include #include +#include +#include "shell/interface.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/Uslider/uslider.h" +#include "common.h" +#include "titlelabel.h" +#include "switchwidget.h" +#include "sliderwidget.h" +#include "radiobuttonwidget.h" +#include "settinggroup.h" + +#include "kslider.h" #include "kswitchbutton.h" using namespace kdk; @@ -54,59 +62,48 @@ protected: void mouseDoubleClickEvent(QMouseEvent *event); }; -class MouseUI : public QWidget +class MouseUI : public QWidget, CommonInterface { Q_OBJECT + Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface") + Q_INTERFACES(CommonInterface) public: - MouseUI(QWidget *parent = nullptr); - ~MouseUI(); + MouseUI(); + ~MouseUI() Q_DECL_OVERRIDE; - void hideOnIntel(); + QString plugini18nName() Q_DECL_OVERRIDE; + int pluginTypes() Q_DECL_OVERRIDE; + QWidget *pluginUi() Q_DECL_OVERRIDE; + const QString name() const Q_DECL_OVERRIDE; + bool isShowOnHomePage() const Q_DECL_OVERRIDE; + QIcon icon() const Q_DECL_OVERRIDE; + bool isEnable() const Q_DECL_OVERRIDE; + + void settingForIntel(); +private: + QWidget *pluginWidget; + + int pluginType; + QString pluginName; + + bool mFirstLoad; private: - QFrame *mDominantHandFrame; // 惯用手 - QFrame *mScrollDirectionFrame; // 滚动方向 - QFrame *mWheelSpeedFrame; // 滚轮速度 - QFrame *mDoubleClickIntervalFrame; // 双击间隔时长 - QFrame *mPointerSpeedFrame; // 指针速度 - QFrame *mMouseAccelerationFrame; // 鼠标加速 - QFrame *mPointerPositionFrame; // 按 ctrl 键时显示指针位置 - QFrame *mPointerSizeFrame; // 指针大小 - QFrame *mBlinkingCursorOnTextFrame; // 文本区域闪烁光标 - QFrame *mCursorSpeedFrame; // 光标速度 - - QFrame *mDominantAndScrollDirectionLine; - QFrame *mScrollDirectionAndWheelLine; - QFrame *mWheelAndDoubleLine; - QFrame *mPointerAndMouseLine; - QFrame *mMouseAndPointerPositionLine; - QFrame *mPositionAndSizeLine; - QFrame *mBlinkAndCursorspeedLine; + RadioButtonWidget *mDominantHandWidget; // 惯用手 + RadioButtonWidget *mScrollDirectionWdiget; // 滚动方向 + SliderWidget *mWheelSpeedWidget; // 滚轮速度 + SliderWidget *mDoubleClickIntervalWidget; // 双击间隔时长 + SliderWidget *mPointerSpeedWidget; // 指针速度 + SwitchWidget *mMouseAccelerationWidget; // 鼠标加速 + SwitchWidget *mPointerPositionWidget; // 按 ctrl 键时显示指针位置 + RadioButtonWidget *mPointerSizeWidet; // 指针大小 + SwitchWidget *mBlinkingCursorOnTextWidget; // 文本区域闪烁光标 + SliderWidget *mCursorSpeedWidget; // 光标速度 TitleLabel *mMouseTitleLabel; - QLabel *mDominantHandLabel; - QLabel *mScrollDirectionLabel; - QLabel *mWheelSpeedLabel; - QLabel *mWheelSpeedSlowLabel; - QLabel *mWheelSpeedFastLabel; - QLabel *mDoubleClickIntervalLabel; - QLabel *mDoubleClickIntervalShortLabel; - QLabel *mDoubleClickIntervalLongLabel; - TitleLabel *mPointerTitleLabel; - QLabel *mPointerSpeedLabel; - QLabel *mPointerSpeedSlowLabel; - QLabel *mPointerSpeedFastLabel; - QLabel *mMouseAccelerationLabel; - QLabel *mPointerPositionLabel; - QLabel *mPointerSizeLabel; - TitleLabel *mCursorTitleLabel; - QLabel *mBlinkingCursorOnTextLabel; - QLabel *mCursorSpeedlabel; - QLabel *mCursorSpeedSlowlabel; - QLabel *mCursorSpeedFastlabel; QRadioButton *mDominantHandLeftRadio; QRadioButton *mDominantHandRightRadio; @@ -116,19 +113,6 @@ private: QRadioButton *mPointerSizeMediumRadio; QRadioButton *mPointerSizeLargeRadio; - QButtonGroup *mDominantRadioGroup; - QButtonGroup *mScrollDirectionRadioGroup; - QButtonGroup *mPointerSizeRadioGroup; - - KSwitchButton *mMouseAccelerationBtn; - KSwitchButton *mPointerPositionBtn; - KSwitchButton *mBlinkingCursorOnTextBtn; - - Uslider *mWheelSpeedSlider; - QSlider *mDoubleClickIntervalSlider; - QSlider *mPointerSpeedSlider; - QSlider *mCursorSpeedSlider; - QVBoxLayout *mVlayout; QGSettings *mMouseGsetting; @@ -136,8 +120,7 @@ private: QGSettings *mThemeSettings; private: - QFrame* myLine(); - void initUI(); + void initUI(QWidget *widget); void setDominantHandFrame(); void setScrollDirectionFrame(); void setWheelSpeedFrame(); @@ -153,15 +136,17 @@ private: void initEnableStatus(); + bool eventFilter(QObject *watched, QEvent *event); + public slots: - void dominantHandSlot(QAbstractButton *button); - void scrollDirectionSlot(QAbstractButton *button); + void dominantHandSlot(int id); + void scrollDirectionSlot(int id); void wheelSpeedSlot(); void doubleClickIntervalSlot(); void pointerSpeedSlot(int value); void mouseAccelerationSlot(bool checked); void pointerPositionSlot(bool checked); - void pointerSizeSlot(QAbstractButton *button); + void pointerSizeSlot(int id); void blinkCursorOnTextSlot(bool checked); void cursorSpeedSlot(); diff --git a/plugins/devices/printer/printer.cpp b/plugins/devices/printer/printer.cpp index 020c221..32fa812 100644 --- a/plugins/devices/printer/printer.cpp +++ b/plugins/devices/printer/printer.cpp @@ -19,7 +19,7 @@ */ #include "printer.h" -#include "../../../shell/utils/utils.h" +#include "common.h" #include #include @@ -30,6 +30,7 @@ #include #include #include "usbthread.h" +#include "printerbtn.h" #define ITEMFIXEDHEIGH 58 #define UEVENT_BUFFER_SIZE 2048 @@ -67,7 +68,6 @@ QWidget *Printer::pluginUi() pluginWidget->setAttribute(Qt::WA_DeleteOnClose); initUi(pluginWidget); - refreshPrinterDevSlot(); if (!QDBusConnection::systemBus().connect(QString(), PRINTER_PATH, PRINTER_SERVICE, "PrinterAdded", this, SIGNAL(addsignal(QString)))) { @@ -114,91 +114,53 @@ bool Printer::isEnable() const void Printer::initUi(QWidget *widget) { - QVBoxLayout *mverticalLayout = new QVBoxLayout(widget); - mverticalLayout->setSpacing(0); - mverticalLayout->setContentsMargins(0, 0, 0, 0); - - PrinterWidget = new QWidget(widget); - PrinterWidget->setMinimumSize(QSize(550, 0)); - PrinterWidget->setMaximumSize(QSize(16777215, 16777215)); - - QVBoxLayout *PrinterLayout = new QVBoxLayout(PrinterWidget); - PrinterLayout->setContentsMargins(0, 0, 0, 0); - PrinterLayout->setSpacing(0); - - mPrinterLabel = new TitleLabel(PrinterWidget); - mPrinterLabel->setText(tr("Printers And Scanners")); - - mPrinterListFrame = new QFrame(PrinterWidget); - mPrinterListFrame->setMinimumSize(QSize(550, 0)); - mPrinterListFrame->setMaximumSize(QSize(16777215, 16777215)); - mPrinterListFrame->setFrameShape(QFrame::Box); - - mPrinterListLayout = new QVBoxLayout(mPrinterListFrame); - mPrinterListLayout->setContentsMargins(0, 0, 0, 0); - mPrinterListLayout->setSpacing(0); + QVBoxLayout *verticaLyt = new QVBoxLayout(widget); + verticaLyt->setSpacing(8); + verticaLyt->setContentsMargins(0, 0, 0, 0); + mPrinterLabel = new TitleLabel; + mPrinterLabel->setText(tr("Printers")); + mPrinterWidget = new SettingGroup(widget); initComponent(); + mPrinterWidget->addWidget(mAddWidget); - PrinterLayout->addWidget(mPrinterLabel); - PrinterLayout->addSpacing(8); - PrinterLayout->addWidget(mPrinterListFrame); - PrinterLayout->addWidget(mAddWgt); - - mverticalLayout->addWidget(PrinterWidget); - mverticalLayout->addStretch(); + verticaLyt->addWidget(mPrinterLabel); + verticaLyt->addWidget(mPrinterWidget);; + verticaLyt->addStretch(); } void Printer::initPrinterUi() { + QString info = getPrinterInfo(); + mPrinterWidget->removeWidget(mAddWidget); clearAutoItem(); for (int i = 0; i < mPrinterList.count(); i++) { - QPushButton *mPriterBtn = new QPushButton(mPrinterListFrame); - mPriterBtn->setProperty("useButtonPalette", true); - mPriterBtn->setMinimumSize(QSize(580, 60)); - mPriterBtn->setMaximumSize(QSize(16777215, 60)); - mPriterBtn->setStyleSheet("QPushButton:!checked{background-color: palette(base)}"); - QHBoxLayout *mPrinterLyt = new QHBoxLayout(mPriterBtn); - mPrinterLyt->setSpacing(16); - - QLabel *iconLabel = new QLabel(mPriterBtn); - QIcon printerIcon = QIcon::fromTheme("printer"); - iconLabel->setPixmap(printerIcon.pixmap(printerIcon.actualSize(QSize(24, 24)))); - FixLabel *textLabel = new FixLabel(mPriterBtn); - textLabel->setText(mPrinterList.at(i)); - - mPrinterLyt->addWidget(iconLabel); - mPrinterLyt->addWidget(textLabel,Qt::AlignLeft); - - QFrame *line = new QFrame(mPrinterListFrame); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - mPrinterListLayout->addWidget(mPriterBtn); - mPrinterListLayout->addWidget(line); - + UkccFrame *printerBtnFrame = new UkccFrame; + printerBtnFrame->setLineWidth(0); + QHBoxLayout *hLyt = new QHBoxLayout(printerBtnFrame); + hLyt->setContentsMargins(0, 0, 0, 0); + PrinterBtn *mPriterBtn = new PrinterBtn(info, mPrinterList.at(i), printerBtnFrame); + hLyt->addWidget(mPriterBtn); + mPrinterWidget->addWidget(printerBtnFrame); connect(mPriterBtn, &QPushButton::clicked, this, [=]() { runExternalApp(); }); } -} + mPrinterWidget->addWidget(mAddWidget); + -void Printer::initTitleLabel() -{ - //~ contents_path /Printer/Add - tr("Add"); } void Printer::initComponent() { - mAddWgt = new AddBtn(pluginWidget); - - connect(mAddWgt, &AddBtn::clicked, this, [=]() { - runExternalApp(); - }); + mAddWidget = new UkccFrame; + mAddWidget->setLineWidth(0); + QHBoxLayout *hLyt = new QHBoxLayout(mAddWidget); + hLyt->setContentsMargins(0, 0, 0, 0); + //~ contents_path /Printer/Add + AddBtn *addBtn = new AddBtn(pluginWidget); + hLyt->addWidget(addBtn); + connect(addBtn, &AddBtn::clicked, this, &Printer::runExternalApp); } @@ -211,12 +173,12 @@ void Printer::refreshPrinterDevSlot() mPrinterList.clear(); for (i = num_dests, dest = dests; i > 0; i --, dest ++) { // 获取打印机状态,3为空闲,4为忙碌,5为不可用 - const char* value = cupsGetOption("printer-state", dest->num_options, dest->options); + const char *value = cupsGetOption("printer-state", dest->num_options, dest->options); qDebug()<name<<"----------------"<name))) { @@ -228,30 +190,33 @@ void Printer::refreshPrinterDevSlot() } } } + cupsFreeDests(num_dests, dests); initPrinterUi(); - - if (mPrinterList.count() == 0) { - mPrinterListFrame->setVisible(false); - } else { - mPrinterListFrame->setVisible(true); - } } void Printer::runExternalApp() { - QDBusInterface ifc("com.kylin.AppManager", - "/com/kylin/AppManager", - "com.kylin.AppManager", - QDBusConnection::sessionBus()); - ifc.call("LaunchApp", "/usr/share/applications/kylin-printer.desktop"); + Common::buriedSettings(name(), "open system-config-printer", QString("clicked")); + if (Common::isTablet()) { + QDBusInterface ifc("com.kylin.AppManager", + "/com/kylin/AppManager", + "com.kylin.AppManager", + QDBusConnection::sessionBus()); + + ifc.call("LaunchApp", "/usr/share/applications/kylin-printer.desktop"); + } else { + QString cmd = "system-config-printer"; + QProcess process(this); + process.startDetached(cmd); + } } void Printer::clearAutoItem() { - if (mPrinterListLayout->layout() != NULL) { + if (mPrinterWidget->layout() != NULL) { QLayoutItem *item; - while ((item = mPrinterListLayout->layout()->takeAt(0)) != NULL) + while ((item = mPrinterWidget->layout()->takeAt(0)) != NULL) { delete item->widget(); delete item; @@ -259,3 +224,18 @@ void Printer::clearAutoItem() } } } + +QString Printer::getPrinterInfo() +{ + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + env.insert("LANG","en_US"); + QProcess *process = new QProcess; + process->setProcessEnvironment(env); + process->start("lpstat -v"); + process->waitForFinished(); + + QByteArray ba = process->readAllStandardOutput(); + + delete process; + return QString(ba.data()); +} diff --git a/plugins/devices/printer/printer.h b/plugins/devices/printer/printer.h index 5dd28d4..59d1a5f 100644 --- a/plugins/devices/printer/printer.h +++ b/plugins/devices/printer/printer.h @@ -27,12 +27,15 @@ #include #include "shell/interface.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/ImageUtil/imageutil.h" -#include "widgets/HoverBtn/hoverbtn.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/Label/fixlabel.h" -#include "widgets/AddBtn/addbtn.h" +#include "hoverwidget.h" +#include "imageutil.h" +#include "hoverbtn.h" +#include "titlelabel.h" +#include "fixlabel.h" +#include "addbtn.h" +#include "settinggroup.h" +#include "ukccframe.h" + namespace Ui { class Printer; @@ -59,30 +62,22 @@ public: public: void initUi(QWidget *widget); void initPrinterUi(); - void initTitleLabel(); void initComponent(); void runExternalApp(); void clearAutoItem(); + QString getPrinterInfo(); private: QString pluginName; int pluginType; - QWidget * pluginWidget; - QWidget *PrinterWidget; - AddBtn * mAddWgt; - QPushButton *mAddBtn; - - QFrame *mPrinterListFrame; - + QWidget *pluginWidget; + SettingGroup *mPrinterWidget; + UkccFrame *mAddWidget; TitleLabel *mPrinterLabel; - QListWidget *mPrinterListWidget; QStringList mPrinterList; - QVBoxLayout *mPrinterListLayout; bool mFirstLoad; - QTimer *mTimer; - public slots: void refreshPrinterDevSlot(); diff --git a/plugins/devices/printer/printer.pro b/plugins/devices/printer/printer.pro index c8c5123..4c51a5b 100644 --- a/plugins/devices/printer/printer.pro +++ b/plugins/devices/printer/printer.pro @@ -6,6 +6,14 @@ include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverBtn/hoverbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) + QT += widgets printsupport dbus LIBS += -L$$[QT_INSTALL_LIBS] -lcups @@ -14,7 +22,9 @@ TEMPLATE = lib CONFIG += plugin \ link_pkgconfig -PKGCONFIG += gsettings-qt +PKGCONFIG += gsettings-qt \ + kysdk-qtwidgets \ + TARGET = $$qtLibraryTarget(printer) DESTDIR = ../.. target.path = $${PLUGIN_INSTALL_DIRS} @@ -26,10 +36,12 @@ INCLUDEPATH += \ SOURCES += \ printer.cpp \ + printerbtn.cpp \ usbthread.cpp HEADERS += \ printer.h \ + printerbtn.h \ usbthread.h FORMS += diff --git a/plugins/devices/printer/printerbtn.cpp b/plugins/devices/printer/printerbtn.cpp new file mode 100644 index 0000000..7b78efe --- /dev/null +++ b/plugins/devices/printer/printerbtn.cpp @@ -0,0 +1,61 @@ +#include "printerbtn.h" +#include +#include +#include +#include +#include + +#include "fixlabel.h" +#define THEME_QT_SCHEMA "org.ukui.style" + +#define ICON_QT_KEY "icon-theme-name" + +const QStringList networktype {"socket", "lpd", "dnssd", "hp:/net/", "hpfax:/net/"}; + +PrinterBtn::PrinterBtn(const QString info, const QString name, QWidget *parent): + printerinfo(info), + QPushButton(parent) +{ + this->setStyleSheet("PrinterBtn:!pressed:hover{background-color: palette(button); border-radius: 6px;}" + "PrinterBtn:!pressed:!hover{background-color: palette(base); border-radius: 6px;}"); + this->setProperty("useButtonPalette", true); + this->setFlat(true); + setMinimumSize(QSize(550, 60)); + setMaximumSize(QSize(16777215, 60)); + QHBoxLayout *mPrinterLyt = new QHBoxLayout(this); + mPrinterLyt->setSpacing(16); + + QLabel *iconLabel = new QLabel(this); + QIcon icon = QIcon::fromTheme(isNetPrinter(name) ? "printer-remote" : "cupsprinter"); + iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize(24, 24)))); + + const QByteArray id(THEME_QT_SCHEMA); + QGSettings *icongsettings = new QGSettings(id, QByteArray(), this); + + connect(icongsettings, &QGSettings::changed, this, [=](const QString &key) { + if (key == "iconThemeName") { + QIcon icon = QIcon::fromTheme(isNetPrinter(name) ? "printer-remote" : "cupsprinter"); + iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize(24, 24)))); + } + }); + + FixLabel *textLabel = new FixLabel(this); + textLabel->setText(name); + + mPrinterLyt->addWidget(iconLabel); + mPrinterLyt->addWidget(textLabel,Qt::AlignLeft); +} + +bool PrinterBtn::isNetPrinter(QString printername) +{ + QStringList printerinfo_list = printerinfo.split("\n"); + for (QString str : printerinfo_list) { + if (str.contains(printername)) { + for (QString type : networktype) { + if (str.contains(type)) + return true; + } + } + } + return false; +} diff --git a/plugins/devices/printer/printerbtn.h b/plugins/devices/printer/printerbtn.h new file mode 100644 index 0000000..8d7cb2c --- /dev/null +++ b/plugins/devices/printer/printerbtn.h @@ -0,0 +1,18 @@ +#ifndef PRINTERBTN_H +#define PRINTERBTN_H + +#include +#include + +class PrinterBtn : public QPushButton +{ + Q_OBJECT +public: + PrinterBtn(const QString info, const QString name, QWidget *parent = nullptr); + bool isNetPrinter(QString printername); + +private: + QString printerinfo; +}; + +#endif // PRINTERBTN_H diff --git a/plugins/devices/shortcut/addshortcutdialog.cpp b/plugins/devices/shortcut/addshortcutdialog.cpp index 4efb656..8c780a1 100644 --- a/plugins/devices/shortcut/addshortcutdialog.cpp +++ b/plugins/devices/shortcut/addshortcutdialog.cpp @@ -20,7 +20,7 @@ #include "addshortcutdialog.h" #include "ui_addshortcutdialog.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include "realizeshortcutwheel.h" #include #include @@ -49,8 +49,8 @@ addShortcutDialog::addShortcutDialog(QList generalEntries, nameIsAvailable = false; execIcon = new QLabel(ui->execLineEdit); execIcon->move(execIcon->x() + 8, execIcon->y()); - execIcon->setFixedSize(24,36); - ui->execLineEdit->setTextMargins(32,ui->execLineEdit->textMargins().top(),\ + execIcon->setFixedSize(24, 36); + ui->execLineEdit->setTextMargins(32, ui->execLineEdit->textMargins().top(),\ ui->execLineEdit->textMargins().right(),\ ui->execLineEdit->textMargins().bottom()); initSetup(); @@ -82,7 +82,6 @@ void addShortcutDialog::initSetup() shortcutLine = new ShortcutLine(systemEntry, &customEntry); ui->horizontalLayout_2->addWidget(shortcutLine); shortcutLine->setMinimumWidth(280); - shortcutLine->setFixedHeight(36); shortcutLine->setPlaceholderText(tr("Please enter a shortcut")); shortcutLine->installEventFilter(this); @@ -98,6 +97,11 @@ void addShortcutDialog::initSetup() } refreshCertainChecked(3); }); + if (shortcutLine->sizeHint().height() > 30 && shortcutLine->sizeHint().height() < 40) { + this->setFixedHeight(254); + } else if (shortcutLine->sizeHint().height() >= 40 && shortcutLine->sizeHint().height() < 50) { + this->setFixedHeight(302); + } } void addShortcutDialog::slotsSetup() @@ -511,6 +515,14 @@ bool addShortcutDialog::eventFilter(QObject *o, QEvent *e) ui->label_5->setText(tr("Name cannot be empty")); } } + } else if (e->type() == QEvent::Resize) { + if (o == shortcutLine) { + if (shortcutLine->sizeHint().height() > 30 && shortcutLine->sizeHint().height() < 40) { + this->setFixedHeight(254); + } else if (shortcutLine->sizeHint().height() >= 40 && shortcutLine->sizeHint().height() < 50) { + this->setFixedHeight(302); + } + } } return QDialog::eventFilter(o, e); } diff --git a/plugins/devices/shortcut/addshortcutdialog.ui b/plugins/devices/shortcut/addshortcutdialog.ui index d03cdd8..b3e9766 100644 --- a/plugins/devices/shortcut/addshortcutdialog.ui +++ b/plugins/devices/shortcut/addshortcutdialog.ui @@ -7,19 +7,25 @@ 0 0 480 - 252 + 254 + + + 0 + 0 + + 480 - 252 + 254 480 - 252 + 254 @@ -75,13 +81,13 @@ 48 - 36 + 0 48 - 36 + 16777215 @@ -94,13 +100,13 @@ 160 - 36 + 0 16777215 - 36 + 16777215 @@ -110,13 +116,13 @@ 84 - 36 + 0 84 - 36 + 16777215 @@ -161,13 +167,13 @@ 48 - 36 + 0 48 - 36 + 16777215 @@ -180,13 +186,13 @@ 16 - 36 + 0 16777215 - 36 + 16777215 @@ -235,13 +241,13 @@ 48 - 36 + 0 48 - 36 + 16777215 @@ -373,7 +379,7 @@ FixLabel QLabel -
../../../libukcc/widgets/Label/fixlabel.h
+
fixlabel.h
diff --git a/plugins/devices/shortcut/shortcut.cpp b/plugins/devices/shortcut/shortcut.cpp index 2f57443..8594111 100644 --- a/plugins/devices/shortcut/shortcut.cpp +++ b/plugins/devices/shortcut/shortcut.cpp @@ -27,11 +27,12 @@ #include "realizeshortcutwheel.h" #include "defineshortcutitem.h" -#include "widgets/Label/fixlabel.h" -#include "widgets/Frame/hlineframe.h" +#include "fixlabel.h" +#include "hlineframe.h" #include "doubleclicklineedit.h" #include #include "clickfixlabel.h" +#include "common.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 @@ -107,7 +108,7 @@ QWidget *Shortcut::pluginUi() pluginWidget = new QWidget; pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); - + initUi(); pKeyMap = new KeyMap; isCloudService = false; @@ -148,7 +149,7 @@ void Shortcut::connectToServer() connect(NetThread, &QThread::started, NetWorker, &MThread::run); connect(NetWorker,&MThread::keychangedsignal,this,&Shortcut::shortcutChangedSlot); connect(NetThread, &QThread::finished, NetWorker, &MThread::deleteLater); - NetThread->start(); + NetThread->start(); } void Shortcut::setupComponent() @@ -162,9 +163,6 @@ void Shortcut::setupComponent() //~ contents_path /Shortcut/Customize Shortcut ui->customLabel->setText(tr("Customize Shortcut")); - ui->customLabel->setVisible(false); - ui->verticalFrame->setVisible(false); - QWidget *systemTitleWidget = new QWidget; QVBoxLayout *systemVerLayout = new QVBoxLayout(systemTitleWidget); @@ -181,20 +179,19 @@ void Shortcut::setupComponent() systemVerLayout->addStretch(); systemTitleWidget->setLayout(systemVerLayout); - AddBtn *addBtn = new AddBtn(); - connect(addBtn, &AddBtn::clicked, this, [=](){ + connect(addButtonShortcut, &AddBtn::clicked, this, [=](){ addShortcutDialog *addDialog = new addShortcutDialog(generalEntries, customEntries, pluginWidget); addDialog->setTitleText(QObject::tr("Customize Shortcut")); connect(addDialog, &addShortcutDialog::shortcutInfoSignal, [=](QString path, QString name, QString exec, QString key){ createNewShortcut(path, name, exec, key); + Common::buriedSettings(this->name(), QString("createNewShortcut"), QString("setting"), key); }); - + Common::buriedSettings(this->name(), QString("AddBtn"), QString("clicked")); addDialog->exec(); }); - - ui->addLyt->addWidget(addBtn); + return; } void Shortcut::setupConnect() @@ -285,7 +282,7 @@ QMap Shortcut:: MergerOfTheSamekind(QMap des return desktopMap; } -QWidget *Shortcut::buildGeneralWidget(QString schema, QMap subShortcutsMap) +void Shortcut::buildGeneralWidget(QString schema, QMap subShortcutsMap) { GSettingsSchema *pSettings; QString domain; @@ -309,28 +306,15 @@ QWidget *Shortcut::buildGeneralWidget(QString schema, QMap sub FALSE); domain = "gsettings-desktop-schemas"; } else { - return NULL; + return; } - QWidget *pWidget = new QWidget; - pWidget->setAttribute(Qt::WA_DeleteOnClose); - QVBoxLayout *pVerLayout = new QVBoxLayout(pWidget); - pVerLayout->setSpacing(0); - pVerLayout->setContentsMargins(0, 0, 0, 0); - QMap::iterator it = subShortcutsMap.begin(); - for (int i = 0; it != subShortcutsMap.end(); it++,i++) { - if (i != 0) { - HLineFrame *line = new HLineFrame; - pVerLayout->addWidget(line); - } - QWidget *gWidget = new QWidget; - gWidget->setFixedHeight(52); - gWidget->setStyleSheet( - "QWidget{background: palette(base); border: none; border-radius: 6px}"); + UkccFrame *shortCutFrame = new UkccFrame(systemShortcutGroup); + shortCutFrame->setFixedHeight(52); - QHBoxLayout *gHorLayout = new QHBoxLayout(gWidget); + QHBoxLayout *gHorLayout = new QHBoxLayout(shortCutFrame); gHorLayout->setSpacing(140); gHorLayout->setContentsMargins(16, 0, 16, 0); @@ -340,14 +324,14 @@ QWidget *Shortcut::buildGeneralWidget(QString schema, QMap sub GSettingsSchemaKey *keyObj = g_settings_schema_get_key(pSettings, ba1.data()); char *i18nKey; - FixLabel *nameLabel = new FixLabel(gWidget); + FixLabel *nameLabel = new FixLabel(shortCutFrame); i18nKey = const_cast(g_dgettext(ba.data(), g_settings_schema_key_get_summary( keyObj))); nameLabel->setText(QString(i18nKey)); nameLabel->setToolTip(QString(i18nKey)); - FixLabel *bindingLabel = new FixLabel(gWidget); + FixLabel *bindingLabel = new FixLabel(shortCutFrame); bindingLabel->setText(getShowShortcutString(it.value())); bindingLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); @@ -366,26 +350,20 @@ QWidget *Shortcut::buildGeneralWidget(QString schema, QMap sub gHorLayout->addWidget(nameLabel, 1); gHorLayout->addWidget(bindingLabel, 1); - gWidget->setLayout(gHorLayout); - - pVerLayout->addWidget(gWidget); - + systemShortcutGroup->addWidget(shortCutFrame); g_settings_schema_key_unref(keyObj); } g_settings_schema_unref(pSettings); - return pWidget; + return; } void Shortcut::appendGeneralItems(QMap > shortcutsMap) { QMap >::iterator it = shortcutsMap.begin(); for (; it != shortcutsMap.end(); it++) { - QWidget *gWidget = buildGeneralWidget(it.key(), it.value()); - if (gWidget != NULL) { - ui->showFrame->layout()->addWidget(gWidget); - } + buildGeneralWidget(it.key(), it.value()); } } @@ -398,15 +376,15 @@ void Shortcut::appendCustomItems() void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) { - QFrame *frame = new QFrame; - frame->setFixedHeight(60); - ui->verticalLayout_3->addWidget(frame); + UkccFrame *frame = new UkccFrame(this->pluginWidget, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *layout = new QHBoxLayout(frame); QHBoxLayout *lineEditLayout = new QHBoxLayout; - DoubleClickLineEdit *nameLineEdit = new DoubleClickLineEdit(&customEntries,frame); + DoubleClickLineEdit *nameLineEdit = new DoubleClickLineEdit(&customEntries, frame); DoubleClickShortCut *bingdingLineEdit = new DoubleClickShortCut(generalEntries, &customEntries); ClickFixLabel *nameLabel = new ClickFixLabel(frame); ClickFixLabel *bingdingLabel = new ClickFixLabel(frame); + customShortcutGroup->addWidget(frame); + addButtonShortcut->setRadiusType(UkccFrame::BorderRadiusStyle::Bottom); // 大小写字母数字中文 QRegExp rx("[a-zA-Z0-9\u4e00-\u9fa5]+"); @@ -418,8 +396,6 @@ void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) bingdingLineEdit->setAlignment(Qt::AlignRight); bingdingLabel->setAlignment(Qt::AlignRight | Qt::AlignCenter); - HLineFrame *line = new HLineFrame; - ui->verticalLayout_3->addWidget(line); QToolButton *btn = new QToolButton(frame); btn->setAutoRaise(true); @@ -434,11 +410,15 @@ void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) menu->addAction(del); connect(del, &QAction::triggered, this, [=](){ + customShortcutGroup->removeWidget(frame); + if (customShortcutGroup->showItemsCount() == 0) { + addButtonShortcut->setRadiusType(UkccFrame::BorderRadiusStyle::Around); + } frame->deleteLater(); - line->deleteLater(); deleteCustomShortcut(nkeyEntry->gsPath); customEntries.removeOne(nkeyEntry); Q_EMIT updateCustomShortcut(); + Common::buriedSettings(name(), QString("del"), QString("clicked")); }); connect(edit, &QAction::triggered, this, [=](){ @@ -450,14 +430,11 @@ void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) addDialog->setNameText(nkeyEntry->nameStr); addDialog->setKeyText(nkeyEntry->bindingStr); addDialog->setKeyIsAvailable(3); - + Common::buriedSettings(name(), QString("edit"), QString("clicked")); connect(addDialog, &addShortcutDialog::shortcutInfoSignal, [=](QString path, QString name, QString exec, QString key){ Q_UNUSED(path) createNewShortcut(nkeyEntry->gsPath, name, exec, key, false); - nkeyEntry->actionStr = exec; - nkeyEntry->nameStr = name; - nkeyEntry->bindingStr= key; nameLineEdit->setToolTip(name); nameLineEdit->blockSignals(true); @@ -480,9 +457,9 @@ void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) btn->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); btn->setProperty("useButtonPalette", true); - btn->setFixedSize(36,36); + btn->setFixedSize(36, 36); - layout->setContentsMargins(8,0,16,0); + layout->setContentsMargins(8, 0, 16, 0); layout->setSpacing(24); layout->addLayout(lineEditLayout); layout->addWidget(btn); @@ -508,10 +485,10 @@ void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) policy.setHorizontalPolicy(QSizePolicy::Ignored); bingdingLabel->setSizePolicy(policy); - lineEditLayout->addWidget(nameLineEdit,1); - lineEditLayout->addWidget(nameLabel,1); - lineEditLayout->addWidget(bingdingLineEdit,1); - lineEditLayout->addWidget(bingdingLabel,1); + lineEditLayout->addWidget(nameLineEdit, 1); + lineEditLayout->addWidget(nameLabel, 1); + lineEditLayout->addWidget(bingdingLineEdit, 1); + lineEditLayout->addWidget(bingdingLabel, 1); nameLineEdit->setVisible(false); bingdingLineEdit->setVisible(false); @@ -569,7 +546,6 @@ void Shortcut::buildCustomItem(KeyEntry *nkeyEntry) });; return; - } QString Shortcut::keyToUI(QString key) @@ -698,13 +674,10 @@ bool Shortcut::keyIsForbidden(QString key) void Shortcut::shortcutChangedSlot() { - qDebug() << "receive cloud service signal"; - while (ui->verticalLayout_3->count()) { - QWidget *p = ui->verticalLayout_3->takeAt(0)->widget(); - ui->verticalLayout_3->removeWidget(p); - p->deleteLater(); - } + qInfo() << "receive cloud service signal"; + customShortcutGroup->removeAndDeleteAllWidget(); isCloudService = true; + addButtonShortcut->setRadiusType(UkccFrame::BorderRadiusStyle::Around); initFunctionStatus(); } @@ -725,3 +698,16 @@ QString Shortcut::getShowShortcutString(QString src) { return str; } +void Shortcut::initUi() +{ + systemShortcutGroup = new SettingGroup(this->pluginWidget); + customShortcutGroup = new SettingGroup(this->pluginWidget); + addButtonShortcut = new AddButton(this->pluginWidget); + + ui->systemLayout->addWidget(systemShortcutGroup); + ui->customLayout->addWidget(customShortcutGroup); + ui->addLyt->addWidget(addButtonShortcut); + addButtonShortcut->setRadiusType(UkccFrame::BorderRadiusStyle::Around); + customShortcutGroup->setOneRadiusStyle(UkccFrame::BorderRadiusStyle::Top); + customShortcutGroup->setLastRadiusStyle(UkccFrame::BorderRadiusStyle::None); +} diff --git a/plugins/devices/shortcut/shortcut.h b/plugins/devices/shortcut/shortcut.h index 6569a56..412f5af 100644 --- a/plugins/devices/shortcut/shortcut.h +++ b/plugins/devices/shortcut/shortcut.h @@ -32,10 +32,14 @@ #include "keymap.h" #include "addshortcutdialog.h" #include "getshortcutworker.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/ImageUtil/imageutil.h" -#include "widgets/AddBtn/addbtn.h" -#include "shell/utils/mthread.h" +#include "hoverwidget.h" +#include "imageutil.h" +#include "addbtn.h" +#include "mthread.h" +#include "settinggroup.h" +#include "ukccframe.h" +#include "addbutton.h" + QT_BEGIN_NAMESPACE namespace Ui { @@ -70,7 +74,7 @@ public: void appendGeneralItems(QMap > shortcutsMap); void appendCustomItems(); void buildCustomItem(KeyEntry *nkeyEntry); - QWidget *buildGeneralWidget(QString schema, QMap subShortcutsMap); + void buildGeneralWidget(QString schema, QMap subShortcutsMap); void createNewShortcut(QString path, QString name, QString exec, QString key, bool buildFlag = true, bool convertFlag = true); void deleteCustomShortcut(QString path); @@ -82,6 +86,7 @@ public: QString keyToUI(QString key); QString keyToLib(QString key); QString getShowShortcutString(QString src); + void initUi(); private: Ui::Shortcut *ui; @@ -107,5 +112,10 @@ private slots: Q_SIGNALS: void hideDelBtn(); void updateCustomShortcut(); + +private: + SettingGroup *systemShortcutGroup = nullptr; + SettingGroup *customShortcutGroup = nullptr; + AddButton *addButtonShortcut = nullptr; }; #endif // SHORTCUT_H diff --git a/plugins/devices/shortcut/shortcut.pro b/plugins/devices/shortcut/shortcut.pro index ced200b..cc86419 100644 --- a/plugins/devices/shortcut/shortcut.pro +++ b/plugins/devices/shortcut/shortcut.pro @@ -1,4 +1,12 @@ include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Frame/frame.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets dbus KXmlGui KGlobalAccel x11extras greaterThan(QT_MAJOR_VERSION, 4): QT += widgets @@ -12,7 +20,7 @@ target.path = $${PLUGIN_INSTALL_DIRS} INCLUDEPATH += \ $$PROJECT_ROOTDIR \ - /usr/include/dconf + /usr/include/dconf \ LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt -ldconf @@ -21,6 +29,7 @@ CONFIG += link_pkgconfig c++11 PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ gsettings-qt \ + kysdk-qtwidgets \ DEFINES += QT_DEPRECATED_WARNINGS diff --git a/plugins/devices/shortcut/shortcut.ui b/plugins/devices/shortcut/shortcut.ui index 3b183f3..3ac2642 100644 --- a/plugins/devices/shortcut/shortcut.ui +++ b/plugins/devices/shortcut/shortcut.ui @@ -52,28 +52,7 @@ - - - QFrame::Box - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + @@ -107,14 +86,14 @@ - QFrame::Box + QFrame::NoFrame 0 - 0 + 1 0 @@ -129,7 +108,7 @@ 0 - + 0 @@ -173,7 +152,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
diff --git a/plugins/network/proxy/proxy.cpp b/plugins/network/proxy/proxy.cpp index a54b699..6ebbddb 100644 --- a/plugins/network/proxy/proxy.cpp +++ b/plugins/network/proxy/proxy.cpp @@ -53,7 +53,7 @@ Proxy::Proxy() : mFirstLoad(true) Proxy::~Proxy() { if (!mFirstLoad) { - plugin_leave(); + plugin_leave(); } } @@ -86,7 +86,7 @@ QWidget *Proxy::pluginUi() { const QByteArray iddd(HTTPS_PROXY_SCHEMA); const QByteArray iid(FTP_PROXY_SCHEMA); const QByteArray iiid(SOCKS_PROXY_SCHEMA); - const QByteArray iVd(APT_PROXY_SCHEMA); + const QByteArray iVd(APT_PROXY_SCHEMA); initSearchText(); setupComponent(); @@ -118,10 +118,10 @@ void Proxy::plugin_leave() { if (isExistSettings) { if (proxysettings->get(PROXY_MODE_KEY) == "manual") { - if ((httpsettings->get(PROXY_HOST_KEY).toString().isEmpty() || httpsettings->get(PROXY_PORT_KEY).toInt() == 0) - && (securesettings->get(PROXY_HOST_KEY).toString().isEmpty() || securesettings->get(PROXY_PORT_KEY).toInt() == 0) - && (ftpsettings->get(PROXY_HOST_KEY).toString().isEmpty() || ftpsettings->get(PROXY_PORT_KEY).toInt() == 0) - && (sockssettings->get(PROXY_HOST_KEY).toString().isEmpty() || sockssettings->get(PROXY_PORT_KEY).toInt() == 0)) { + if ((httpsettings->get(PROXY_HOST_KEY).toString().isEmpty() || httpsettings->get(PROXY_PORT_KEY).toInt() > 65536 || httpsettings->get(PROXY_PORT_KEY).toInt() < 0) + && (securesettings->get(PROXY_HOST_KEY).toString().isEmpty() || securesettings->get(PROXY_PORT_KEY).toInt() > 65536 || securesettings->get(PROXY_PORT_KEY).toInt() < 0) + && (ftpsettings->get(PROXY_HOST_KEY).toString().isEmpty() || ftpsettings->get(PROXY_PORT_KEY).toInt() > 65536 || ftpsettings->get(PROXY_PORT_KEY).toInt() < 0) + && (sockssettings->get(PROXY_HOST_KEY).toString().isEmpty() || sockssettings->get(PROXY_PORT_KEY).toInt() > 65536 || sockssettings->get(PROXY_PORT_KEY).toInt() < 0)) { proxysettings->set(PROXY_MODE_KEY,"auto"); mManualBtn->setChecked(false); mAutoBtn->setChecked(true); @@ -176,6 +176,7 @@ void Proxy::initUi(QWidget *widget) enableLyt->setContentsMargins(16, 0, 16, 0); QLabel *enableLabel = new QLabel(tr("Start using"), mEnableFrame); mEnableBtn = new KSwitchButton(mEnableFrame); + mEnableBtn->setObjectName("openproxy"); enableLyt->addWidget(enableLabel); enableLyt->addStretch(); enableLyt->addWidget(mEnableBtn); @@ -190,9 +191,11 @@ void Proxy::initUi(QWidget *widget) QLabel *selectLabel = new QLabel(tr("Proxy mode"), mSelectFrame); selectLabel->setFixedWidth(148); mAutoBtn = new QRadioButton(mSelectFrame); + mAutoBtn->setObjectName("autoproxy"); mProxyBtnGroup->addButton(mAutoBtn); QLabel *autoLabel = new QLabel(tr("Auto"), mSelectFrame); mManualBtn = new QRadioButton(mSelectFrame); + mManualBtn->setObjectName("manualproxy"); mProxyBtnGroup->addButton(mManualBtn); QLabel *manualLabel = new QLabel(tr("Manual"), mSelectFrame); selectLyt->addWidget(selectLabel); @@ -216,6 +219,7 @@ void Proxy::initUi(QWidget *widget) mUrlLabel->setFixedWidth(136); mUrlLineEdit = new QLineEdit(mUrlFrame); + mUrlLineEdit->setObjectName("auto-url"); mUrlLineEdit->setFixedHeight(36); mUrlLayout->addWidget(mUrlLabel); @@ -236,8 +240,10 @@ void Proxy::initUi(QWidget *widget) mHTTPPortLabel->setFixedWidth(100); mHTTPPortLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); mHTTPLineEdit_1 = new QLineEdit(mHTTPFrame); + mHTTPLineEdit_1->setObjectName("http-ip"); mHTTPLineEdit_1->resize(300, 36); mHTTPLineEdit_2 = new QLineEdit(mHTTPFrame); + mHTTPLineEdit_2->setObjectName("http-port"); mHTTPLineEdit_2->setFixedHeight(36); mHTTPLineEdit_2->setValidator(new QRegExpValidator(QRegExp("[0-9]*") , this)); mHTTPLayout_1->addWidget(mHTTPLabel); @@ -248,7 +254,7 @@ void Proxy::initUi(QWidget *widget) line_3 = setLine(mProxyFrame); mHTTPSFrame = new QFrame(mProxyFrame); - setFrame_Noframe(mHTTPSFrame); + setFrame_Noframe(mHTTPSFrame); QHBoxLayout *mHTTPSLayout = new QHBoxLayout(mHTTPSFrame); mHTTPSLayout->setSpacing(8); @@ -259,8 +265,10 @@ void Proxy::initUi(QWidget *widget) mHTTPSPortLabel->setFixedWidth(100); mHTTPSPortLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); mHTTPSLineEdit_1 = new QLineEdit(mHTTPSFrame); + mHTTPSLineEdit_1->setObjectName("https-ip"); mHTTPSLineEdit_1->resize(300, 36); mHTTPSLineEdit_2 = new QLineEdit(mHTTPSFrame); + mHTTPSLineEdit_2->setObjectName("https-port"); mHTTPSLineEdit_2->setFixedHeight(36); mHTTPSLineEdit_2->setValidator(new QRegExpValidator(QRegExp("[0-9]*") , this)); mHTTPSLayout->addWidget(mHTTPSLabel); @@ -282,8 +290,10 @@ void Proxy::initUi(QWidget *widget) mFTPPortLabel->setFixedWidth(100); mFTPPortLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); mFTPLineEdit_1 = new QLineEdit(mFTPFrame); + mFTPLineEdit_1->setObjectName("ftp-ip"); mFTPLineEdit_1->resize(300, 36); mFTPLineEdit_2 = new QLineEdit(mFTPFrame); + mFTPLineEdit_2->setObjectName("ftp-port"); mFTPLineEdit_2->setFixedHeight(36); mFTPLineEdit_2->setValidator(new QRegExpValidator(QRegExp("[0-9]*") , this)); mFTPLayout->addWidget(mFTPLabel); @@ -305,8 +315,10 @@ void Proxy::initUi(QWidget *widget) mSOCKSPortLabel->setFixedWidth(100); mSOCKSPortLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); mSOCKSLineEdit_1 = new QLineEdit(mSOCKSFrame); + mSOCKSLineEdit_1->setObjectName("socks-ip"); mSOCKSLineEdit_1->resize(300, 36); mSOCKSLineEdit_2 = new QLineEdit(mSOCKSFrame); + mSOCKSLineEdit_2->setObjectName("socks-ip"); mSOCKSLineEdit_2->setFixedHeight(36); mSOCKSLineEdit_2->setValidator(new QRegExpValidator(QRegExp("[0-9]*") , this)); mSOCKSLayout->addWidget(mSOCKSLabel); @@ -326,6 +338,7 @@ void Proxy::initUi(QWidget *widget) mIgnoreLabel = new QLabel(mIgnoreFrame); mIgnoreLabel->setFixedHeight(36); mIgnoreLineEdit = new QTextEdit(mIgnoreFrame); + mIgnoreLineEdit->setObjectName("ignore"); mIgnoreLineEdit->setFixedHeight(120); mIgnoreLineEdit->setStyleSheet("border-radius:6px;background-color: palette(button)"); mIgnoreLayout->addWidget(mIgnoreLabel); @@ -368,6 +381,7 @@ void Proxy::initUi(QWidget *widget) mAptLabel = new QLabel(mAPTFrame_1); mAptLabel->setFixedWidth(200); mAptBtn = new KSwitchButton(mAPTFrame_1); + mAptBtn->setObjectName("aptsettings"); mAptLayout_1->addWidget(mAptLabel); mAptLayout_1->addStretch(); mAptLayout_1->addWidget(mAptBtn); @@ -384,6 +398,7 @@ void Proxy::initUi(QWidget *widget) mAPTPortLabel_1 = new QLabel(mAPTFrame_2); mAPTPortLabel_2 = new QLabel(mAPTFrame_2); mEditBtn = new QPushButton(mAPTFrame_2); + mEditBtn->setObjectName("aptedit"); mEditBtn->setFixedWidth(80); mAptLayout_2->addWidget(mAPTHostLabel_1); mAptLayout_2->addWidget(mAPTHostLabel_2); @@ -483,6 +498,7 @@ void Proxy::setupComponent(){ void Proxy::setupConnect(){ connect(mEnableBtn, &KSwitchButton::stateChanged, this ,[=](bool checked) { + Utils::buriedSettings(name(), "whether to start the agent", QString("settings"), checked ? "true" : "false"); mSelectFrame->setVisible(checked); line_8->setVisible(checked); mAutoBtn->setChecked(checked); @@ -492,37 +508,72 @@ void Proxy::setupConnect(){ _setSensitivity(); }); - connect(mEditBtn ,&QPushButton::clicked, this, &Proxy::setAptProxySlot); + connect(mEditBtn ,&QPushButton::clicked, this, [=]() { + Utils::buriedSettings(name(), "set aptproxy", QString("clicked")); + setAptProxySlot(); + }); connect(mProxyBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ if (eBtn == mAutoBtn) { + Utils::buriedSettings(name(), "set autoproxy", QString("clicked")); mManualBtn->setChecked(false); proxysettings->set(PROXY_MODE_KEY,"auto"); } else if (eBtn == mManualBtn){ + Utils::buriedSettings(name(), "set manualproxy", QString("clicked")); mAutoBtn->setChecked(false); proxysettings->set(PROXY_MODE_KEY,"manual"); } _setSensitivity(); }); - connect(mUrlLineEdit, &QLineEdit::textChanged, this, [=](const QString &txt){proxysettings->set(PROXY_AUTOCONFIG_URL_KEY, QVariant(txt));}); + connect(mUrlLineEdit, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set autoproxy url", QString("settings"), txt); + proxysettings->set(PROXY_AUTOCONFIG_URL_KEY, QVariant(txt)); + }); - connect(mHTTPLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mHTTPSLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mFTPLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mSOCKSLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mHTTPLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mHTTPSLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mFTPLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); - connect(mSOCKSLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){manualProxyTextChanged(txt);}); + connect(mHTTPLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set http ip", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + connect(mHTTPSLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set https ip", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + connect(mFTPLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set ftp ip", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + connect(mSOCKSLineEdit_1, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set socks ip", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + connect(mHTTPLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set http port", QString("settings"), txt); + manualProxyTextChanged(txt); + }); - connect(mIgnoreLineEdit, &QTextEdit::textChanged, this, [=](){ + connect(mHTTPSLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set https port", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + connect(mFTPLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set ftp port", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + connect(mSOCKSLineEdit_2, &QLineEdit::textChanged, this, [=](const QString &txt){ + Utils::buriedSettings(name(), "set socks port", QString("settings"), txt); + manualProxyTextChanged(txt); + }); + + connect(mIgnoreLineEdit, &QTextEdit::textChanged, this, [=](){ QString text = mIgnoreLineEdit->toPlainText(); + Utils::buriedSettings(name(), "set ignore ip", QString("settings"), text); QStringList hostStringList = text.split(";"); proxysettings->set(IGNORE_HOSTS_KEY, QVariant(hostStringList)); }); connect(mAptBtn , &KSwitchButton::stateChanged, this ,[=](bool checked){ + Utils::buriedSettings(name(), "whether open aptproxy", QString("settings"), checked ? "true" : "false"); if (checked) { emit mEditBtn->click(); } else { // 关闭APT代理,删除对应的配置文件 @@ -678,14 +729,22 @@ int Proxy::_getCurrentProxyMode(){ } void Proxy::_setSensitivity(){ + bool autoChecked; + bool manualChecked; + if (mEnableBtn->isChecked()) { + autoChecked = mAutoBtn->isChecked(); + manualChecked = mManualBtn->isChecked(); + + } else { + autoChecked = false; + manualChecked = false; + } //自动配置代理界面敏感性 - bool autoChecked = mAutoBtn->isChecked(); mUrlFrame->setVisible(autoChecked); line_1->setVisible(autoChecked); //手动配置代理界面敏感性 - bool manualChecked = mManualBtn->isChecked(); mHTTPFrame->setVisible(manualChecked); mHTTPSFrame->setVisible(manualChecked); mFTPFrame->setVisible(manualChecked); diff --git a/plugins/network/vpn/vpn.cpp b/plugins/network/vpn/vpn.cpp index 21a9878..611966b 100644 --- a/plugins/network/vpn/vpn.cpp +++ b/plugins/network/vpn/vpn.cpp @@ -22,6 +22,9 @@ #include #include +#include + +#include "shell/utils/utils.h" Vpn::Vpn() : mFirstLoad(true) { @@ -80,8 +83,12 @@ bool Vpn::isEnable() const void Vpn::initComponent(){ mAddBtn = new AddBtn(pluginWidget); + mAddBtn->setObjectName("add"); + //~ contents_path /Vpn/Add a vpn connection + tr("Add a vpn connection"); connect(mAddBtn, &AddBtn::clicked, this, [=]() { + Utils::buriedSettings(name(), "open vpn settings", QString("clicked")); runExternalApp(); }); @@ -89,9 +96,7 @@ void Vpn::initComponent(){ } void Vpn::runExternalApp(){ - QDBusInterface ifc("com.kylin.AppManager", - "/com/kylin/AppManager", - "com.kylin.AppManager", - QDBusConnection::sessionBus()); - ifc.call("LaunchApp", "/usr/share/applications/nm-connection-editor.desktop"); + QString cmd = "nm-connection-editor"; + QProcess process(this); + process.startDetached(cmd); } diff --git a/plugins/personalized/fonts/fonts.cpp b/plugins/personalized/fonts/fonts.cpp index bc198d3..80714b7 100644 --- a/plugins/personalized/fonts/fonts.cpp +++ b/plugins/personalized/fonts/fonts.cpp @@ -19,7 +19,7 @@ */ #include "fonts.h" #include "ui_fonts.h" -#include "shell/utils/mthread.h" +#include "mthread.h" #include #include @@ -126,19 +126,22 @@ void Fonts::setupComponent(){ fontScale<< "10" << "11" << "12" << "13" << "14" <<"15"; - uslider = new Uslider(fontScale); - uslider->setRange(1,6); - uslider->setTickInterval(1); - uslider->setPageStep(1); + mSlider = new KSlider(pluginWidget); + mSlider->setRange(1, 4); + mSlider->setTickInterval(1); + mSlider->setPageStep(1); - ui->fontLayout->addWidget(uslider); + ui->fontLayout->addWidget(new QLabel(tr("Small"))); + ui->fontLayout->addSpacing(16); + ui->fontLayout->addWidget(mSlider); + ui->fontLayout->addSpacing(16); + ui->fontLayout->addWidget(new QLabel(tr("Large"))); } void Fonts::setupConnect(){ connectToServer(); - connect(uslider, &QSlider::valueChanged, [=](int value){ - int size = sliderConvertToSize(value); - + connect(mSlider, &KSlider::valueChanged, [=](int value){ + float size = sliderConvertToSize(value); // 获取当前字体信息 _getCurrentFontInfo(); @@ -174,7 +177,8 @@ void Fonts::setupConnect(){ // 监听系统字体的变化 connect(stylesettings , &QGSettings::changed, this, [=](const QString &key) { if("systemFont" == key || "systemFontSize" == key) { - uslider->setValue(stylesettings->get(SYSTEM_FONT_EKY).toInt() - 9); + int value = fontConvertToSlider(stylesettings->get(SYSTEM_FONT_EKY).toFloat()); + mSlider->setValue(value); ui->fontSelectComBox->setCurrentText(stylesettings->get(SYSTEM_NAME_KEY).toString()); ui->monoSelectComBox->setCurrentText(ifsettings->get(MONOSPACE_FONT_KEY).toString()); } @@ -220,11 +224,11 @@ void Fonts::initGeneralFontStatus(){ ui->monoSelectComBox->setCurrentText(currentmonofont); ui->monoSelectComBox->blockSignals(false); - int size = fontConvertToSlider(QString(docfontStrList[1]).toInt()); + int size = fontConvertToSlider(QString(docfontStrList[1]).toFloat()); - uslider->blockSignals(true); - uslider->setValue(size); - uslider->blockSignals(false); + mSlider->blockSignals(true); + mSlider->setValue(size); + mSlider->blockSignals(false); } void Fonts::_getCurrentFontInfo(){ @@ -249,71 +253,48 @@ QStringList Fonts::_splitFontNameSize(QString value) { return valueStringList; } -int Fonts::fontConvertToSlider(const int size) const { - switch (size) { - case 10: +int Fonts::fontConvertToSlider(float size) const { + if (size == 10.0) { return 1; - break; - case 11: + } else if (size == 11.0) { + return 1; + } else if (size == 12.0) { return 2; - break; - case 12: + } else if (size == 13.0) { + return 2; + } else if (size == 13.5) { return 3; - break; - case 13: + } else if (size == 14.0) { + return 3; + } else if (size == 15.0) { return 4; - break; - case 14: - return 5; - break; - case 15: - return 6; - break; - case 16: - return 7; - break; - case 17: - return 8; - break; - default: + } else { return 1; - break; } } -int Fonts::sliderConvertToSize(const int value) const +float Fonts::sliderConvertToSize(int value) const { switch (value) { case 1: return 10; break; case 2: - return 11; - break; - case 3: return 12; break; + case 3: + return 13.5; + break; case 4: - return 13; - break; - case 5: - return 14; - break; - case 6: return 15; break; - case 7: - return 16; - break; - case 8: - return 17; default: return 10; break; } } -void Fonts::resetDefault(){ +void Fonts::resetDefault() { // Reset font ifsettings->reset(GTK_FONT_KEY); ifsettings->reset(DOC_FONT_KEY); @@ -333,7 +314,7 @@ void Fonts::connectToServer(){ connect(NetThread, &QThread::started, NetWorker, &MThread::run); connect(NetWorker,&MThread::keychangedsignal,this,&Fonts::keyChangedSlot); connect(NetThread, &QThread::finished, NetWorker, &MThread::deleteLater); - NetThread->start(); + NetThread->start(); } void Fonts::keyChangedSlot(const QString &key) { @@ -369,7 +350,7 @@ void Fonts::updateFontListSlot(const QStringList &fontList) } void Fonts::fontKwinSlot() { - const int fontSize = sliderConvertToSize(uslider->value()); + const int fontSize = sliderConvertToSize(mSlider->value()); const QString fontType = ui->fontSelectComBox->currentText(); qDebug() << fontSize << fontType; QDBusMessage message =QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "slotFontChange"); diff --git a/plugins/personalized/fonts/fonts.h b/plugins/personalized/fonts/fonts.h index defd6cb..aae3d14 100644 --- a/plugins/personalized/fonts/fonts.h +++ b/plugins/personalized/fonts/fonts.h @@ -30,9 +30,11 @@ #include #include -#include "shell/interface.h" -#include "widgets/Uslider/uslider.h" +#include +#include "shell/interface.h" + +using namespace kdk; /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 @@ -80,8 +82,8 @@ public: void _getCurrentFontInfo(); QStringList _splitFontNameSize(QString value); - int fontConvertToSlider(const int size) const; - int sliderConvertToSize(const int value) const; + int fontConvertToSlider(float size) const; + float sliderConvertToSize(int value) const; void connectToServer(); @@ -117,7 +119,7 @@ private: private: bool mFirstLoad; - Uslider * uslider; + KSlider *mSlider; }; #endif // FONTS_H diff --git a/plugins/personalized/fonts/fonts.pro b/plugins/personalized/fonts/fonts.pro index 2559be8..65de35c 100644 --- a/plugins/personalized/fonts/fonts.pro +++ b/plugins/personalized/fonts/fonts.pro @@ -5,6 +5,8 @@ #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets dbus @@ -22,6 +24,7 @@ CONFIG += link_pkgconfig \ PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ gsettings-qt \ + kysdk-qtwidgets \ INCLUDEPATH += \ $$PROJECT_ROOTDIR \ diff --git a/plugins/personalized/fonts/fonts.ui b/plugins/personalized/fonts/fonts.ui index 18a1f08..fa3c661 100644 --- a/plugins/personalized/fonts/fonts.ui +++ b/plugins/personalized/fonts/fonts.ui @@ -7,7 +7,7 @@ 0 0 594 - 336 + 360
@@ -83,7 +83,7 @@ 550 - 80 + 60 @@ -123,7 +123,7 @@ 0 - + 0 @@ -241,7 +241,7 @@ 0 - + 0 @@ -276,7 +276,7 @@ 16777215 - 36 + 16777215 @@ -347,7 +347,7 @@ 0 - + 0 @@ -382,7 +382,7 @@ 1677215 - 36 + 16777215 @@ -457,7 +457,12 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
+
+ + FixLabel + QLabel +
fixlabel.h
diff --git a/plugins/personalized/screenlock/buildpicunitsworker.cpp b/plugins/personalized/screenlock/buildpicunitsworker.cpp index cabffb4..25fd00f 100644 --- a/plugins/personalized/screenlock/buildpicunitsworker.cpp +++ b/plugins/personalized/screenlock/buildpicunitsworker.cpp @@ -20,12 +20,15 @@ #include "buildpicunitsworker.h" #include +#include +#include BuildPicUnitsWorker::BuildPicUnitsWorker() { //自定义结构提,线程传递时无法放入列表,注册解决 qRegisterMetaType("BgInfo"); exitFlag = false; + filenameList.clear(); } BuildPicUnitsWorker::~BuildPicUnitsWorker() @@ -37,19 +40,83 @@ BuildPicUnitsWorker::~BuildPicUnitsWorker() void BuildPicUnitsWorker::run(){ //构建xmlhandle对象 xmlHandleObj = new XmlHandle(); - //解析壁纸数据,如果本地xml文件不存在则自动构建 xmlHandleObj->init(); - + QByteArray allData = ""; //获取本地壁纸列表 QMap wholeBgInfo = BgFileParse::bgFileReader(); for (BgInfo sinBfInfo : wholeBgInfo){ if (exitFlag) { return; } - - emit pixmapGeneral(QPixmap(sinBfInfo.filename).scaled(QSize(166, 110)), sinBfInfo); + QFile file(sinBfInfo.filename); + if(file.open(QIODevice::ReadOnly)) {//打开文件(只读 + QByteArray content = file.readAll(); + allData += content; + file.close(); + } + filenameList.append(sinBfInfo.filename); } + QByteArray hashDataWrite = QCryptographicHash::hash(allData, QCryptographicHash::Md5); + QFile hashFile; + hashFile.setFileName(LOCAL_WALLPAPER_HASH_PATH); + if (hashFile.open(QIODevice::ReadOnly)) { + QByteArray hashDataRead = hashFile.readAll(); + hashFile.close(); + if (hashDataRead.compare(hashDataWrite) == 0) { //和已保存的一样 + QDir dir(LOCAL_WALLPAPER_PATH); + QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Dirs); + if ((fileInfoList.size() - 1) == filenameList.size()) { //文件数量也一致 + emit readWallPaper_data(filenameList); + return; + } + } + } + //未保存正确的缩略壁纸,先创建pixmap发送到wallpaper进行显示 + for (BgInfo sinBfInfo : wholeBgInfo) { + QString filename = sinBfInfo.filename; + QPixmap pixmap = QPixmap(filename).scaled(QSize(166, 110)); + if (exitFlag) { + return; + } + emit pixmapGeneral(pixmap, sinBfInfo); + } + + //保存正确的缩略壁纸 + QDir dir; + dir.setPath(LOCAL_WALLPAPER_PATH); + if (dir.exists()) { + dir.removeRecursively(); + qDebug()<<"removeRecursively:"< +#include + +#define LOCAL_USR_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +#define LOCAL_APP_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ + %QStringLiteral("/ukui-control-center/") +#define LOCAL_WALLPAPER_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ + %QStringLiteral("/ukui-control-center/wallpaperData/") +#define LOCAL_WALLPAPER_HASH_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ + %QStringLiteral("/ukui-control-center/wallpaperData/HASH") class BuildPicUnitsWorker : public QObject { @@ -40,12 +50,12 @@ public: private: XmlHandle * xmlHandleObj; bool exitFlag; - + QStringList filenameList; Q_SIGNALS: void pixmapGeneral(QPixmap pixmap, BgInfo bginfo); void workerComplete(); - + void readWallPaper_data(QStringList filenameList); }; #endif // BUILDPICUNITSWORKER_H diff --git a/plugins/personalized/screenlock/pictureunit.cpp b/plugins/personalized/screenlock/pictureunit.cpp index c8e8bef..d932a04 100644 --- a/plugins/personalized/screenlock/pictureunit.cpp +++ b/plugins/personalized/screenlock/pictureunit.cpp @@ -19,13 +19,14 @@ */ #include "pictureunit.h" #include -#include "widgets/MaskWidget/maskwidget.h" +#include "maskwidget.h" #include #include #include #include -PictureUnit::PictureUnit() +PictureUnit::PictureUnit(QWidget *parent) + : QLabel(parent) { _filename = ""; hoverStyleSheet = QString("border-width: 3px;border-style: solid;border-color: palette(highlight);"); diff --git a/plugins/personalized/screenlock/pictureunit.h b/plugins/personalized/screenlock/pictureunit.h index 2dc49c4..6960119 100644 --- a/plugins/personalized/screenlock/pictureunit.h +++ b/plugins/personalized/screenlock/pictureunit.h @@ -28,7 +28,7 @@ class PictureUnit : public QLabel Q_OBJECT public: - explicit PictureUnit(); + explicit PictureUnit(QWidget *parent = nullptr); ~PictureUnit(); public: diff --git a/plugins/personalized/screenlock/screenlock.cpp b/plugins/personalized/screenlock/screenlock.cpp index b7a0534..a50c37d 100644 --- a/plugins/personalized/screenlock/screenlock.cpp +++ b/plugins/personalized/screenlock/screenlock.cpp @@ -21,13 +21,15 @@ #include "ui_screenlock.h" #include "bgfileparse.h" #include "pictureunit.h" -#include "widgets/MaskWidget/maskwidget.h" +#include "maskwidget.h" #include #include #include #include #include +#include +#include "common.h" #define BGPATH "/usr/share/backgrounds/" #define SCREENLOCK_BG_SCHEMA "org.ukui.screensaver" @@ -38,8 +40,7 @@ #define MATE_BACKGROUND_SCHEMAS "org.mate.background" #define FILENAME "picture-filename" -#define DEFAULT_LOCK "/usr/share/backgrounds/1-openkylin.jpg" -#define DEFAULT_LOCK_2 "/usr/share/backgrounds/openkylin.jpg" +#define DEFAULT_LOCK "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg" const QString kylinUrl = "https://www.ubuntukylin.com/wallpaper.html"; @@ -56,10 +57,15 @@ Screenlock::~Screenlock() { if (pWorker) { pWorker->setExit(true); + delete pWorker; + pWorker = nullptr; } if (pThread) { + pThread->terminate(); pThread->quit(); // 退出事件循环 pThread->wait(); // 释放资源 + delete pThread; + pThread = nullptr; } if (!mFirstLoad) { delete ui; @@ -86,12 +92,13 @@ QWidget *Screenlock::pluginUi() pluginWidget = new QWidget; pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); + initUi(); ui->titleLabel->setStyleSheet(" QLabel{color: palette(windowText);}"); const QByteArray id(SCREENLOCK_BG_SCHEMA); lSetting = new QGSettings(id, QByteArray(), this); - + initRelatedSettings(); connectToServer(); initSearchText(); setupComponent(); @@ -99,12 +106,12 @@ QWidget *Screenlock::pluginUi() initScreenlockStatus(); lockbgSize = QSize(400, 240); - if (isIntel()) { + if (Common::isTablet()) { settingForIntel(); } } else { - ui->backgroundsWidget->resize(ui->backgroundsWidget->size() - QSize(1,1)); - ui->backgroundsWidget->resize(ui->backgroundsWidget->size() + QSize(1,1)); + picFrame->resize(picFrame->size() - QSize(1,1)); + picFrame->resize(picFrame->size() + QSize(1,1)); } return pluginWidget; } @@ -130,8 +137,8 @@ bool Screenlock::isEnable() const } void Screenlock::initSearchText() { - //~ contents_path /Screenlock/Show picture of screenlock on screenlogin - ui->loginpicLabel->setText(tr("Show picture of screenlock on screenlogin")); + //~ contents_path /Screenlock/Screenlock Interface + ui->titleLabel->setText(tr("Screenlock Interface")); //~ contents_path /Screenlock/Browse ui->browserLocalwpBtn->setText(tr("Browse")); //~ contents_path /Screenlock/Online Picture @@ -140,12 +147,9 @@ void Screenlock::initSearchText() { ui->onlineBtn->setContentsMargins(0,0,0,0); ui->onlineBtn->setCursor( QCursor(Qt::PointingHandCursor)); ui->onlineBtn->setStyleSheet("QPushButton{background: transparent;border-radius: 4px;text-decoration: underline;} "); - connect( ui->onlineBtn, &QPushButton::clicked, this,[=] { - QDBusInterface ifc("com.kylin.AppManager", - "/com/kylin/AppManager", - "com.kylin.AppManager", - QDBusConnection::sessionBus()); - ifc.call("LaunchDefaultAppWithUrl", "https://www.ubuntukylin.com/wallpaper.html"); + connect(ui->onlineBtn, &QPushButton::clicked, this,[=] { + QDesktopServices::openUrl(QUrl(QLatin1String("https://www.ubuntukylin.com/wallpaper.html"))); + Common::buriedSettings(name(), QString("onlineBtn"), QString("clicked")); }); //~ contents_path /Screenlock/Reset To Default ui->resetBtn->setText(tr("Reset To Default")); @@ -164,76 +168,47 @@ void Screenlock::setupComponent() QString lockfilename = "/var/lib/lightdm-data/" + name + "/ukui-greeter.conf"; lockLoginSettings = new QSettings(lockfilename, QSettings::IniFormat, this); - QStringList scaleList; - scaleList<< tr("1min") << tr("5min") << tr("10min") << tr("30min") << tr("45min") - <setRange(1,9); - uslider->setTickInterval(1); - uslider->setPageStep(1); - - ui->delayFrame->layout()->addWidget(uslider); - ui->delayFrame->hide(); - ui->line_3->hide(); - - - showMsgBtn = new KSwitchButton(pluginWidget); - ui->showMsgLayout->addStretch(); - ui->showMsgLayout->addWidget(showMsgBtn); - ui->showMsgLabel->setText(tr("Show message on lock screen")); - ui->showMsgLabel->setVisible(false); - showMsgBtn->setVisible(false); - ui->line_4->setVisible(false); - - loginbgSwitchBtn = new KSwitchButton(pluginWidget); - ui->loginbgHorLayout->addStretch(); - ui->loginbgHorLayout->addWidget(loginbgSwitchBtn); - loginbgSwitchBtn->setChecked(getLockStatus()); - + showPicWidget->setChecked(getLockStatus()); bool lockKey = false; QStringList keys = lSetting->keys(); if (keys.contains("showMessageEnabled")) { - showMsgBtn->setChecked(lSetting->get("show-message-enabled").toBool()); - connect(showMsgBtn, &KSwitchButton::stateChanged, this, [=](bool checked){ + showMsgWidget->setChecked(lSetting->get("show-message-enabled").toBool()); + connect(showMsgWidget, &SwitchWidget::stateChanged, this, [=](bool checked){ lSetting->set("show-message-enabled", checked); }); } - connect(lockSwitchBtn, &KSwitchButton::stateChanged, this, [=](bool checked) { - if (lockKey) { - lSetting->set(SCREENLOCK_LOCK_KEY, checked); - } - }); - connect(lSetting, &QGSettings::changed, this, [=](QString key) { if ("background" == key) { QString filename = lSetting->get(key).toString(); - ui->previewLabel->setPixmap(QPixmap(filename).scaled(ui->previewLabel->size())); + QImageReader reader(filename); + reader.setDecideFormatFromContent(true); + ui->previewLabel->setPixmap(QPixmap::fromImage(reader.read()).scaled(ui->previewLabel->size())); setClickedPic(filename); } else if ("idleLock" == key) { - uslider->blockSignals(true); - uslider->setValue(lockConvertToSlider(lSetting->get(SCREENLOCK_DELAY_KEY).toInt())); - uslider->blockSignals(false); + timeSlider->blockSignals(true); + timeSlider->setValue(lockConvertToSlider(lSetting->get(SCREENLOCK_DELAY_KEY).toInt())); + timeSlider->blockSignals(false); } else if ("showMessageEnabled" == key) { - showMsgBtn->blockSignals(true); - showMsgBtn->setChecked(lSetting->get("show-message-enabled").toBool()); - showMsgBtn->blockSignals(false); + showMsgWidget->blockSignals(true); + showMsgWidget->setChecked(lSetting->get("show-message-enabled").toBool()); + showMsgWidget->blockSignals(false); } }); //设置布局 - flowLayout = new FlowLayout(ui->backgroundsWidget, 16, -1, -1); + flowLayout = new FlowLayout(picFrame, 16, -1, -1); } void Screenlock::setupConnect() { - connect(loginbgSwitchBtn, &KSwitchButton::stateChanged, this, [=](bool checked) { + connect(showPicWidget, &SwitchWidget::stateChanged, this, [=](bool checked) { setLockBackground(checked); + Common::buriedSettings(name(), QString("showPicWidget"), QString("clicked"), Common::boolToString(checked)); }); - connect(uslider, &QSlider::valueChanged, [&](int value) { + connect(timeSlider, &QSlider::valueChanged, [&](int value) { QStringList keys = lSetting->keys(); if (keys.contains("idleLock")) { lSetting->set(SCREENLOCK_DELAY_KEY, convertToLocktime(value)); @@ -243,7 +218,7 @@ void Screenlock::setupConnect() QStringList keys = lSetting->keys(); if (keys.contains("idleLock")) { int value = lockConvertToSlider(lSetting->get(SCREENLOCK_DELAY_KEY).toInt()); - uslider->setValue(value); + timeSlider->setValue(value); } connect(ui->browserLocalwpBtn, &QPushButton::clicked, this, &Screenlock::setScreenLockBgSlot); @@ -253,67 +228,54 @@ void Screenlock::setupConnect() void Screenlock::initScreenlockStatus() { // 获取当前锁屏壁纸 - QString bgStr = ""; + initBgStr = ""; if (lSetting->keys().contains(SCREENLOCK_BG_KEY)) { - bgStr = lSetting->get(SCREENLOCK_BG_KEY).toString(); + initBgStr = lSetting->get(SCREENLOCK_BG_KEY).toString(); } // 锁屏壁纸不存在,则展示默认壁纸 - if (!QFile::exists(bgStr) || bgStr == DEFAULT_LOCK_2) { - bgStr = DEFAULT_LOCK; + if (!QFile::exists(initBgStr)) { + initBgStr = DEFAULT_LOCK; } - ui->previewLabel->setPixmap(QPixmap(bgStr).scaled(ui->previewLabel->size())); + QImageReader reader(initBgStr); + reader.setDecideFormatFromContent(true); + ui->previewLabel->setPixmap(QPixmap::fromImage(reader.read()).scaled(ui->previewLabel->size())); // 使用线程解析本地壁纸文件;获取壁纸单元 pThread = new QThread; pWorker = new BuildPicUnitsWorker; + + connect(pWorker, &BuildPicUnitsWorker::readWallPaper_data, this, [=](QStringList filenameList) { + for (int i = 0; i < filenameList.size(); i++) { + QString filename = filenameList.at(i); + QString filanemaTemp = filename; + filanemaTemp.replace("/","-"); + QString loadFilename = LOCAL_WALLPAPER_PATH + QString::number(i) + filanemaTemp; + QPixmap pixmap; + pixmap.load(loadFilename); + createPictureUnit(pixmap, filename); + } + }); connect(pWorker, &BuildPicUnitsWorker::pixmapGeneral, this, [=](QPixmap pixmap, BgInfo bgInfo){ // 线程中构建控件传递会报告event无法install 的警告 - PictureUnit * picUnit = new PictureUnit; - picUnit->setPixmap(pixmap); - picUnit->setFilenameText(bgInfo.filename); - - // 选定当前锁屏壁纸 - if (bgInfo.filename == bgStr){ - if (prePicUnit != nullptr) { - prePicUnit->changeClickedFlag(false); - prePicUnit->setStyleSheet("border-width: 0px;"); - } - picUnit->changeClickedFlag(true); - prePicUnit = picUnit; - picUnit->setFrameShape(QFrame::Box); - picUnit->setStyleSheet(picUnit->clickedStyleSheet); - } - - connect(picUnit, &PictureUnit::clicked, [=](QString filename){ - if (prePicUnit != nullptr) { - prePicUnit->changeClickedFlag(false); - prePicUnit->setStyleSheet("border-width: 0px;"); - } - picUnit->changeClickedFlag(true); - prePicUnit = picUnit; - picUnit->setFrameShape(QFrame::Box); - picUnit->setStyleSheet(picUnit->clickedStyleSheet); - ui->previewLabel->setPixmap(QPixmap(filename).scaled(ui->previewLabel->size())); - if (lSetting->keys().contains(SCREENLOCK_BG_KEY)) - lSetting->set(SCREENLOCK_BG_KEY, filename); - setLockBackground(loginbgSwitchBtn->isChecked()); - }); - - flowLayout->addWidget(picUnit); - }); - connect(pWorker, &BuildPicUnitsWorker::workerComplete, [=]{ - pThread->quit(); // 退出事件循环 - pThread->wait(); // 释放资源 + createPictureUnit(pixmap, bgInfo.filename); }); pWorker->moveToThread(pThread); connect(pThread, &QThread::started, pWorker, &BuildPicUnitsWorker::run); - connect(pThread, &QThread::finished, this, [=] { - + connect(pThread, &QThread::finished, pWorker, [=](){ + pThread->quit(); // 退出事件循环 + pThread->wait(); // 释放资源 + if (pThread) { + delete pThread; + pThread = nullptr; + } + if (pWorker) { + delete pWorker; + pWorker = nullptr; + } }); - connect(pThread, &QThread::finished, pWorker, &BuildPicUnitsWorker::deleteLater); pThread->start(); @@ -323,9 +285,9 @@ void Screenlock::initScreenlockStatus() lDelay = lSetting->get(SCREENLOCK_DELAY_KEY).toInt(); } - uslider->blockSignals(true); - uslider->setValue(lockConvertToSlider(lDelay)); - uslider->blockSignals(false); + timeSlider->blockSignals(true); + timeSlider->setValue(lockConvertToSlider(lDelay)); + timeSlider->blockSignals(false); } int Screenlock::convertToLocktime(const int value) @@ -462,14 +424,10 @@ void Screenlock::keyChangedSlot(const QString &key) bgStr = bgGsetting->get(FILENAME).toString(); } } - - ui->previewLabel->setPixmap(QPixmap(bgStr).scaled(ui->previewLabel->size())); - QStringList keys = lSetting->keys(); - if (keys.contains("lockEnabled")) { - bool status = lSetting->get(SCREENLOCK_LOCK_KEY).toBool(); - lockSwitchBtn->setChecked(status); - } - loginbgSwitchBtn->setChecked(getLockStatus()); + QImageReader reader(bgStr); + reader.setDecideFormatFromContent(true); + ui->previewLabel->setPixmap(QPixmap::fromImage(reader.read()).scaled(ui->previewLabel->size())); + showPicWidget->setChecked(getLockStatus()); } } @@ -542,11 +500,12 @@ void Screenlock::setScreenLockBgSlot() process->start(program, arguments); lSetting->set(SCREENLOCK_BG_KEY, selectedfile); - setLockBackground(loginbgSwitchBtn->isChecked()); + setLockBackground(showPicWidget->isChecked()); if (prePicUnit != nullptr) { //去掉选定标记 prePicUnit->changeClickedFlag(false); prePicUnit->setStyleSheet("border-width: 0px;"); } + Common::buriedSettings(name(), QString("browserLocalwpBtn"), QString("clicked")); } QString Screenlock::copyLoginFile(QString fileName) { @@ -569,13 +528,11 @@ void Screenlock::resetDefaultScreenLockSlot(){ g_object_unref(wpgsettings); lSetting->set(SCREENLOCK_BG_KEY, QVariant(QString(dwp))); setClickedPic(QString(dwp)); - setLockBackground(loginbgSwitchBtn->isChecked()); + setLockBackground(showPicWidget->isChecked()); + Common::buriedSettings(name(), QString("resetBtn"), QString("clicked")); } void Screenlock::setClickedPic(QString fileName) { - if (fileName == DEFAULT_LOCK_2) { - fileName = DEFAULT_LOCK; - } for (int i = flowLayout->count() - 1; i >= 0; --i) { QLayoutItem *it = flowLayout->itemAt(i); PictureUnit *picUnit = static_cast(it->widget()); @@ -594,16 +551,108 @@ void Screenlock::setClickedPic(QString fileName) { void Screenlock::settingForIntel() { - ui->loginpicLabel->setVisible(false); - ui->line->setVisible(false); - if (loginbgSwitchBtn) { - loginbgSwitchBtn->setVisible(false); - } - - ui->showMsgLabel->setVisible(true); - showMsgBtn->setVisible(true); - ui->line_4->setVisible(true); + timeFrame->setVisible(true); + showPicWidget->setVisible(false); + showMsgWidget->setVisible(true); ui->onlineBtn->setVisible(false); ui->browserLocalwpBtn->setFixedHeight(48); ui->resetBtn->setFixedHeight(48); } + +void Screenlock::initRelatedSettings() +{ + connect(monitorWidget->pushButton(), &QPushButton::clicked, this, [=](){ + Common::buriedSettings(name(), "setBtn(Monitor Off)", QString("clicked")); + QProcess::startDetached("ukui-control-center", QStringList() << "-m" << "Power"); + }); + connect(screensaverWidget->pushButton(), &QPushButton::clicked, this, [=](){ + Common::buriedSettings(name(), "setBtn(Screensaver)", QString("clicked")); + QProcess::startDetached("ukui-control-center", QStringList() << "-m" << "Screensaver"); + }); +} + +void Screenlock::createPictureUnit(QPixmap pixmap, QString filename) +{ + PictureUnit * picUnit = new PictureUnit(); + picUnit->setPixmap(pixmap); + picUnit->setFilenameText(filename); + + // 选定当前锁屏壁纸 + if (filename == initBgStr){ + if (prePicUnit != nullptr) { + prePicUnit->changeClickedFlag(false); + prePicUnit->setStyleSheet("border-width: 0px;"); + } + picUnit->changeClickedFlag(true); + prePicUnit = picUnit; + picUnit->setFrameShape(QFrame::Box); + picUnit->setStyleSheet(picUnit->clickedStyleSheet); + } + + connect(picUnit, &PictureUnit::clicked, [=](QString filename){ + if (prePicUnit != nullptr) { + prePicUnit->changeClickedFlag(false); + prePicUnit->setStyleSheet("border-width: 0px;"); + } + picUnit->changeClickedFlag(true); + prePicUnit = picUnit; + picUnit->setFrameShape(QFrame::Box); + picUnit->setStyleSheet(picUnit->clickedStyleSheet); + QImageReader reader(filename); + reader.setDecideFormatFromContent(true); + ui->previewLabel->setPixmap(QPixmap::fromImage(reader.read()).scaled(ui->previewLabel->size())); + if (lSetting->keys().contains(SCREENLOCK_BG_KEY)) + lSetting->set(SCREENLOCK_BG_KEY, filename); + setLockBackground(showPicWidget->isChecked()); + Common::buriedSettings(name(), QString("picUnit"), QString("clicked"), filename); + }); + + flowLayout->addWidget(picUnit); +} + +void Screenlock::initUi() +{ + QStringList timeList; + timeList << tr("1min") << tr("5min") << tr("10min") << tr("30min") << tr("45min") + << tr("1hour") << tr("2hour") << tr("3hour") << tr("Never"); + + centerGroup = new SettingGroup(this->pluginWidget); + showMsgWidget = new SwitchWidget(tr("Show message on lock screen"), centerGroup); + //~ contents_path /Screenlock/Show picture of screenlock on screenlogin + showPicWidget = new SwitchWidget(tr("Show picture of screenlock on screenlogin"), centerGroup); + picFrame = new UkccFrame(centerGroup); + timeFrame = new UkccFrame(centerGroup, UkccFrame::BorderRadiusStyle::None, true); + timeLayout = new QHBoxLayout(timeFrame); + timeSlider = new LockSlider(timeList, timeFrame); + timeLabel = new FixLabel(timeFrame); + relatedGroup = new SettingGroup(this->pluginWidget); + monitorWidget = new PushButtonWidget(tr("Monitor Off"), relatedGroup); + screensaverWidget = new PushButtonWidget(tr("Screensaver"), relatedGroup); + + ui->centerLayout->addWidget(centerGroup); + centerGroup->addWidget(showMsgWidget); + centerGroup->addWidget(showPicWidget); + centerGroup->addWidget(timeFrame); + centerGroup->addWidget(picFrame); + timeLayout->addWidget(timeLabel); + timeLayout->addWidget(timeSlider); + ui->relatedLayout->addWidget(relatedGroup); + relatedGroup->addWidget(monitorWidget); + relatedGroup->addWidget(screensaverWidget); + timeLayout->setContentsMargins(16, 0, 16, 0); + timeLayout->setSpacing(16); + timeLabel->setText(tr("Lock screen delay")); + timeSlider->setRange(1, 9); + timeSlider->setTickInterval(1); + timeSlider->setPageStep(1); + picFrame->setLineWidth(0); + monitorWidget->setButtonText(tr("Set")); + screensaverWidget->setButtonText(tr("Set")); + + showMsgWidget->setVisible(false); + timeFrame->setVisible(false); + + return; +} + + diff --git a/plugins/personalized/screenlock/screenlock.h b/plugins/personalized/screenlock/screenlock.h index 58c0c78..216172d 100644 --- a/plugins/personalized/screenlock/screenlock.h +++ b/plugins/personalized/screenlock/screenlock.h @@ -30,13 +30,16 @@ #include #include "shell/interface.h" -#include "widgets/FlowLayout/flowlayout.h" +#include "flowlayout.h" -#include "shell/utils/mthread.h" +#include "mthread.h" #include "buildpicunitsworker.h" #include "pictureunit.h" #include "kswitchbutton.h" #include "lockslider.h" +#include "settinggroup.h" +#include "switchwidget.h" +#include "pushbuttonwidget.h" using namespace kdk; @@ -75,6 +78,8 @@ public: void setupConnect(); void initScreenlockStatus(); void setClickedPic(QString fileName); + void initRelatedSettings(); + void initUi(); private: int convertToLocktime(const int value); @@ -83,6 +88,7 @@ private: bool getLockStatus(); void connectToServer(); QString copyLoginFile(QString fileName); + void createPictureUnit(QPixmap pixmap, QString filename); private: Ui::Screenlock *ui; @@ -91,10 +97,6 @@ private: int pluginType; QWidget *pluginWidget; - KSwitchButton *loginbgSwitchBtn = nullptr; // 显示锁屏壁纸在登录页面 - KSwitchButton *lockSwitchBtn = nullptr; // 激活屏保时锁定屏幕 - KSwitchButton *showMsgBtn = nullptr; // 锁屏时显示消息 - KSlider *uslider; QGSettings *lSetting; @@ -103,19 +105,20 @@ private: QSize lockbgSize; - QThread *pThread; + QThread *pThread = nullptr; QDBusInterface *m_cloudInterface; bool bIsCloudService; FlowLayout *flowLayout; - BuildPicUnitsWorker *pWorker; + BuildPicUnitsWorker *pWorker = nullptr; PictureUnit *prePicUnit; bool mFirstLoad; QString mUKCConfig; + QString initBgStr; public Q_SLOTS: void keyChangedSlot(const QString &key); @@ -123,6 +126,19 @@ public Q_SLOTS: private slots: void setScreenLockBgSlot(); + +private: + SettingGroup *centerGroup = nullptr; + SwitchWidget *showMsgWidget = nullptr; + SwitchWidget *showPicWidget = nullptr; + UkccFrame *picFrame = nullptr; + UkccFrame *timeFrame = nullptr; + QHBoxLayout *timeLayout = nullptr; + LockSlider *timeSlider = nullptr; + FixLabel *timeLabel = nullptr; + SettingGroup *relatedGroup = nullptr; + PushButtonWidget *monitorWidget = nullptr; + PushButtonWidget *screensaverWidget = nullptr; }; #endif // SCREENLOCK_H diff --git a/plugins/personalized/screenlock/screenlock.pro b/plugins/personalized/screenlock/screenlock.pro index bb2a04a..61afe4f 100644 --- a/plugins/personalized/screenlock/screenlock.pro +++ b/plugins/personalized/screenlock/screenlock.pro @@ -5,6 +5,11 @@ #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/MaskWidget/maskwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets xml dbus diff --git a/plugins/personalized/screenlock/screenlock.ui b/plugins/personalized/screenlock/screenlock.ui index 6e7a96b..9e77862 100644 --- a/plugins/personalized/screenlock/screenlock.ui +++ b/plugins/personalized/screenlock/screenlock.ui @@ -6,8 +6,8 @@ 0 0 - 601 - 569 + 550 + 700
@@ -144,245 +144,7 @@
- - - - 0 - 200 - - - - QFrame::Box - - - QFrame::Raised - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 16 - - - 16 - - - 0 - - - - - - 0 - 60 - - - - - 16777215 - 60 - - - - Show message on lock screen - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - 0 - - - 16 - - - 16 - - - - - - 0 - 0 - - - - - 0 - 60 - - - - - 16777215 - 60 - - - - Show picture of screenlock on screenlogin - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 0 - 80 - - - - - 0 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 60 - - - - - 16777215 - 60 - - - - Lock screen delay - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - - + @@ -403,13 +165,13 @@ 110 - 36 + 0 110 - 36 + 16777215 @@ -442,13 +204,13 @@ 120 - 36 + 0 16777215 - 36 + 16777215 @@ -461,6 +223,30 @@
+ + + + 24 + + + 8 + + + + + Related Settings + + + + + + + + + 0 + + + @@ -481,7 +267,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
diff --git a/plugins/personalized/screensaver/previewwidget.cpp b/plugins/personalized/screensaver/previewwidget.cpp new file mode 100644 index 0000000..410816d --- /dev/null +++ b/plugins/personalized/screensaver/previewwidget.cpp @@ -0,0 +1,29 @@ +#include "previewwidget.h" +#include "previewwindow.h" + +PreviewWidget::PreviewWidget(QWidget *parent):QWidget(parent) +{ + +} + +PreviewWidget::~PreviewWidget() +{ + +} + +void PreviewWidget::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event); + + QPainter p(this); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawRect(rect()); +} + +void PreviewWidget::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + PreviewWindow::previewScreensaver(); + } +} diff --git a/plugins/personalized/screensaver/previewwidget.h b/plugins/personalized/screensaver/previewwidget.h new file mode 100644 index 0000000..fbece96 --- /dev/null +++ b/plugins/personalized/screensaver/previewwidget.h @@ -0,0 +1,21 @@ +#ifndef PREVIEWWIDGET_H +#define PREVIEWWIDGET_H +#include +#include +#include + +class PreviewWidget : public QWidget +{ + Q_OBJECT +public: + PreviewWidget(QWidget *parent = nullptr); + ~PreviewWidget(); + +protected: + void paintEvent(QPaintEvent *e); + +private: + void mousePressEvent(QMouseEvent *e); +}; + +#endif // PREVIEWWIDGET_H diff --git a/plugins/personalized/screensaver/previewwindow.cpp b/plugins/personalized/screensaver/previewwindow.cpp new file mode 100644 index 0000000..80ea6e7 --- /dev/null +++ b/plugins/personalized/screensaver/previewwindow.cpp @@ -0,0 +1,24 @@ +#include "previewwindow.h" + +PreviewWindow::PreviewWindow() +{ + +} +PreviewWindow::~PreviewWindow() +{ + +} + +void PreviewWindow::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton) { + previewScreensaver(); + } +} + +void PreviewWindow::previewScreensaver() +{ + static QProcess *viewProcess = new QProcess(); + viewProcess->start("ukui-screensaver-command --screensaver"); + Common::buriedSettings(QString("Screensaver"), QString("previewScreensaver"), QString("clicked")); +} diff --git a/plugins/personalized/screensaver/previewwindow.h b/plugins/personalized/screensaver/previewwindow.h new file mode 100644 index 0000000..50af703 --- /dev/null +++ b/plugins/personalized/screensaver/previewwindow.h @@ -0,0 +1,19 @@ +#ifndef PREVIEWWINDOW_H +#define PREVIEWWINDOW_H +#include +#include +#include +#include "common.h" + +class PreviewWindow : public QWindow +{ + Q_OBJECT +public: + PreviewWindow(); + ~PreviewWindow(); + static void previewScreensaver(); +private: + void mousePressEvent(QMouseEvent *e); +}; + +#endif // PREVIEWWINDOW_H diff --git a/plugins/personalized/screensaver/screensaver.cpp b/plugins/personalized/screensaver/screensaver.cpp index ca77854..215ea46 100644 --- a/plugins/personalized/screensaver/screensaver.cpp +++ b/plugins/personalized/screensaver/screensaver.cpp @@ -25,13 +25,13 @@ #include #include #include -#include "widgets/ComboBox/combobox.h" +#include "combobox.h" #include -#include "widgets/Frame/hlineframe.h" +#include "hlineframe.h" #include #include -#include "widgets/Label/fixlabel.h" -#include "../../../shell/utils/utils.h" +#include "fixlabel.h" +#include "common.h" #define SSTHEMEPATH "/usr/share/applications/screensavers/" #define ID_PREFIX "screensavers-ukui-" @@ -130,7 +130,7 @@ QWidget *Screensaver::pluginUi() pluginWidget = new QWidget; pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); - + initUi(); process = new QProcess(); previewWind = new PreviewWindow(); @@ -141,11 +141,12 @@ QWidget *Screensaver::pluginUi() QPluginLoader pluginLoader("/usr/lib/ukui-screensaver/libscreensaver-default.so"); pluginLoader.load(); QObject *plugin = pluginLoader.instance(); - screensaver_ptr = nullptr; + screensaverPtr = nullptr; if (plugin) { - screensaver_ptr = std::unique_ptr(qobject_cast(plugin)); + screensaverPtr = std::unique_ptr(qobject_cast(plugin)); + } else { + qWarning()<<"pluginLoader '/usr/lib/ukui-screensaver/libscreensaver-default.so' failed"; } - initSearchText(); _acquireThemeinfoList(); initComponent(); initShowTimeBtnStatus(); @@ -200,14 +201,6 @@ void Screensaver::initPreviewLabel() previewLabel->raise(); } -void Screensaver::initSearchText() -{ - //~ contents_path /Screensaver/Screensaver program - ui->programLabel->setText(tr("Screensaver program")); - //~ contents_path /Screensaver/Idle time - ui->idleLabel->setText(tr("Idle time")); -} - void Screensaver::initComponent() { if (QGSettings::isSchemaInstalled(SCREENSAVER_SCHEMA)) { @@ -232,22 +225,21 @@ void Screensaver::initComponent() initCustomizeFrame(); //初始化屏保程序下拉列表 - ui->programCombox->addItem(tr("UKUI")); - ui->programCombox->addItem(tr("Blank_Only")); - // ui->programCombox->addItem(tr("Random")); + programWidget->comboBox()->addItem(tr("UKUI")); + programWidget->comboBox()->addItem(tr("Blank_Only")); + // programWidget->comboBox()->addItem(tr("Random")); QMap::iterator it = infoMap.begin(); for (int index = 2; it != infoMap.end(); it++) { SSThemeInfo info = (SSThemeInfo)it.value(); - // if (!screensaverList.contains(info.name)) //开放所有下载的第三方屏保,接口保留 - // continue; - ui->programCombox->addItem(info.name); - ui->programCombox->setItemData(index, QVariant::fromValue(info)); + programWidget->comboBox()->addItem(info.name); + programWidget->comboBox()->setItemData(index, QVariant::fromValue(info)); index++; } - ui->programCombox->addItem(tr("Customize")); - INDEX_MODE_CUSTOMIZE = ui->programCombox->count() - 1; //得到【自定义】在滑动栏中的位置 + programWidget->comboBox()->addItem(tr("Customize")); + INDEX_MODE_CUSTOMIZE = programWidget->comboBox()->count() - 1; //得到【自定义】在滑动栏中的位置 - QListView* view = qobject_cast(ui->programCombox->view()); + qInfo()<<"INDEX_MODE_CUSTOMIZE = "<(programWidget->comboBox()->view()); Q_ASSERT(view != nullptr); view->setRowHidden(1, true); //隐藏纯黑,使用隐藏,防止以后会需要纯黑 //初始化滑动条 @@ -255,25 +247,28 @@ void Screensaver::initComponent() scaleList<< tr("5min") << tr("10min") << tr("15min") << tr("30min") << tr("1hour") << tr("Never"); - ui->idleCombox->addItems(scaleList); + idleTimeWidget->comboBox()->addItems(scaleList); //初始化激活屏保时锁住屏幕的功能 - lockBtn->setChecked(qScreenSaverSetting->get(SCREENLOCK_ACTIVE_KEY).toBool()); + lockBtn->setChecked(qScreenSaverSetting->get(LOCK_KEY).toBool()); connect(lockBtn, &KSwitchButton::stateChanged, [=](bool status){ - qScreenSaverSetting->set(SCREENLOCK_ACTIVE_KEY, status); + qScreenSaverSetting->set(LOCK_KEY, status); + Common::buriedSettings(name(), QString("Lock screen when screensaver boot"), QString("clicked"), Common::boolToString(status)); }); - connect(ui->idleCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](){ - int value = ui->idleCombox->currentIndex(); + connect(idleTimeWidget->comboBox(), QOverload::of(&QComboBox::currentIndexChanged), this, [=](){ + int value = idleTimeWidget->comboBox()->currentIndex(); screensaver_settings = g_settings_new(SCREENSAVER_SCHEMA); int setValue = convertToLocktime(value + 1); qScreenSaverSetting->set(IDLE_DELAY_KEY, setValue); + Common::buriedSettings(name(), QString("Idle time"), QString("select"), QString::number(setValue)); }); connectToServer(); connect(qScreenSaverSetting, &QGSettings::changed, this,[=](const QString& key) { if ("idleDelay" == key) { int value = qScreenSaverSetting->get(key).toInt(); - ui->idleCombox->setCurrentIndex(lockConvertToSlider(value) - 1); + idleTimeWidget->comboBox()->setCurrentIndex(lockConvertToSlider(value) - 1); + qInfo()<<"idleDelay changed:"<get(key).toBool(); @@ -282,7 +277,7 @@ void Screensaver::initComponent() lockBtn->blockSignals(false); } }); - connect(ui->programCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(themesComboxChanged(int))); + connect(programWidget->comboBox(), SIGNAL(currentIndexChanged(int)), this, SLOT(themesComboxChanged(int))); connect(ui->previewWidget, &QWidget::destroyed, this, [=] { closeScreensaver(); }); @@ -306,6 +301,7 @@ void Screensaver::initShowTimeBtnStatus() showCustomTimeBtn->setChecked(qScreensaverDefaultSetting->get(SHOW_CUSTOM_REST_TIME_KEY).toBool()); connect(showCustomTimeBtn,&KSwitchButton::stateChanged,this,[=]{ qScreensaverDefaultSetting->set(SHOW_CUSTOM_REST_TIME_KEY,showCustomTimeBtn->isChecked()); + Common::buriedSettings(name(), QString("showRestTime(Customize)"), QString("clicked"), Common::boolToString(showCustomTimeBtn->isChecked())); }); } else { showCustomTimeBtn->setChecked(false); @@ -314,6 +310,7 @@ void Screensaver::initShowTimeBtnStatus() showUkuiTimeBtn->setChecked(qScreensaverDefaultSetting->get(SHOW_UKUI_REST_TIME_KEY).toBool()); connect(showUkuiTimeBtn,&KSwitchButton::stateChanged,this,[=]{ qScreensaverDefaultSetting->set(SHOW_UKUI_REST_TIME_KEY,showUkuiTimeBtn->isChecked()); + Common::buriedSettings(name(), QString("showRestTime(UKUI)"), QString("clicked"), Common::boolToString(showUkuiTimeBtn->isChecked())); }); } else { showUkuiTimeBtn->setChecked(false); @@ -329,7 +326,7 @@ void Screensaver::initThemeStatus() int mode; char * name; - ui->programCombox->blockSignals(true); + programWidget->comboBox()->blockSignals(true); QByteArray id(SCREENSAVER_SCHEMA); if (QGSettings::isSchemaInstalled(id)) { @@ -346,16 +343,16 @@ void Screensaver::initThemeStatus() } if (mode == MODE_DEFAULT_UKUI) { - ui->programCombox->setCurrentIndex(INDEX_MODE_DEFAULT_UKUI); //UKUI + programWidget->comboBox()->setCurrentIndex(INDEX_MODE_DEFAULT_UKUI); //UKUI hideCustomizeFrame(); showUkuiTimeBtn->show(); showCustomTimeBtn->hide(); } else if (mode == MODE_BLANK_ONLY) { - ui->programCombox->setCurrentIndex(INDEX_MODE_BLANK_ONLY); //Black_Only + programWidget->comboBox()->setCurrentIndex(INDEX_MODE_BLANK_ONLY); //Black_Only hideCustomizeFrame(); } else if (mode == MODE_CUSTOMIZE) { - ui->programCombox->setCurrentIndex(INDEX_MODE_CUSTOMIZE); //CUSTOMIZE + programWidget->comboBox()->setCurrentIndex(INDEX_MODE_CUSTOMIZE); //CUSTOMIZE showCustomizeFrame(); showUkuiTimeBtn->hide(); showCustomTimeBtn->show(); @@ -371,18 +368,18 @@ void Screensaver::initThemeStatus() QString dest = (infoMap.find(name) != infoMap.end()) ? infoMap.value(name).name : ""; if (dest == "") { - ui->programCombox->setCurrentIndex(INDEX_MODE_DEFAULT_UKUI); + programWidget->comboBox()->setCurrentIndex(INDEX_MODE_DEFAULT_UKUI); } else { - ui->programCombox->setCurrentText(dest); + programWidget->comboBox()->setCurrentText(dest); } } else { - ui->programCombox->setCurrentIndex(INDEX_MODE_DEFAULT_UKUI); //no data, default + programWidget->comboBox()->setCurrentIndex(INDEX_MODE_DEFAULT_UKUI); //no data, default } g_strfreev(strv); } g_object_unref(screensaver_settings); - ui->programCombox->blockSignals(false); + programWidget->comboBox()->blockSignals(false); } void Screensaver::initIdleSliderStatus() @@ -390,14 +387,16 @@ void Screensaver::initIdleSliderStatus() int minutes = 0; //判断是否存在该设置项 if (!mScreenSaverKeies.contains("idleDelay")) { - ui->idleCombox->blockSignals(true); - ui->idleCombox->setCurrentIndex(5); - ui->idleCombox->blockSignals(false); + idleTimeWidget->comboBox()->blockSignals(true); + idleTimeWidget->comboBox()->setCurrentIndex(5); + idleTimeWidget->comboBox()->blockSignals(false); + idleTimeWidget->hide(); } else { minutes = qScreenSaverSetting->get(IDLE_DELAY_KEY).toInt(); - ui->idleCombox->blockSignals(true); - ui->idleCombox->setCurrentIndex(lockConvertToSlider(minutes) - 1); - ui->idleCombox->blockSignals(false); + idleTimeWidget->comboBox()->blockSignals(true); + idleTimeWidget->comboBox()->setCurrentIndex(lockConvertToSlider(minutes) - 1); + qInfo()<<"idleDelay init:"<comboBox()->blockSignals(false); } } @@ -405,42 +404,44 @@ void Screensaver::startupScreensaver() { //关闭屏保 closeScreensaver(); - - if (screensaver_ptr) { - qDebug()<<"screensaver_ptr can be used"; - QWidget* widget = screensaver_ptr->createWidget(false,this); + qInfo()<<"programWidget->comboBox()->currentIndex() = "<comboBox()->currentIndex(); + if (screensaverPtr && (programWidget->comboBox()->currentIndex() == INDEX_MODE_DEFAULT_UKUI || + programWidget->comboBox()->currentIndex() == INDEX_MODE_CUSTOMIZE)) { + previewWind->hide(); + qInfo()<<"screensaverPtr can be used"; + QWidget* widget = screensaverPtr->createWidget(false, this); widget->setObjectName("screensaverWidget"); widget->setFixedSize(ui->previewWidget->size()); ui->previewWidget->layout()->addWidget(widget); } else { - qDebug()<<"screensaver_ptr can not be used"; - if (Utils::isWayland()) { - qDebug()<<"Utils::isWayland() is true"; + if (Common::isWayland()) { + qInfo()<<"screensaverPtr can not be used and is wayland: unable to preview screensaver"; return; - } - QWindow *preWidFromWin = QWindow::fromWinId(ui->previewWidget->winId()); - previewWind->winId(); - previewWind->setParent(preWidFromWin); - previewWind->show(); + } else { + qInfo()<<"screensaverPtr can not be used and is not wayland: preview screensaver from winId"; + QWindow *preWidFromWin = QWindow::fromWinId(ui->previewWidget->winId()); + previewWind->winId(); + previewWind->setParent(preWidFromWin); + previewWind->show(); - qDebug() << Q_FUNC_INFO << ui->previewWidget->winId(); - if (ui->programCombox->currentIndex() == INDEX_MODE_DEFAULT_UKUI || \ - ui->programCombox->currentIndex() == INDEX_MODE_CUSTOMIZE) { //UKUI && 自定义 - QStringList args; - args << "-window-id" << QString::number(previewWind->winId()); - //启动屏保 - process->startDetached(screensaver_bin, args); - runStringList.append(screensaver_bin); - } else if (ui->programCombox->currentIndex() == INDEX_MODE_BLANK_ONLY) {//黑屏 - previewWind->setVisible(false); - ui->previewWidget->update(); - } else {// 屏保 - SSThemeInfo info = ui->programCombox->currentData().value(); - QStringList args; - args << "-window-id" << QString::number(previewWind->winId()); - // 启动屏保 - process->startDetached(info.exec, args); - runStringList.append(info.exec); + if (programWidget->comboBox()->currentIndex() == INDEX_MODE_DEFAULT_UKUI || \ + programWidget->comboBox()->currentIndex() == INDEX_MODE_CUSTOMIZE) { //UKUI && 自定义 + QStringList args; + args << "-window-id" << QString::number(previewWind->winId()); + //启动屏保 + process->startDetached(screensaver_bin, args); + runStringList.append(screensaver_bin); + } else if (programWidget->comboBox()->currentIndex() == INDEX_MODE_BLANK_ONLY) {//黑屏 + previewWind->setVisible(false); + ui->previewWidget->update(); + } else {// 屏保 + SSThemeInfo info = programWidget->comboBox()->currentData().value(); + QStringList args; + args << "-window-id" << QString::number(previewWind->winId()); + // 启动屏保 + process->startDetached(info.exec, args); + runStringList.append(info.exec); + } } } } @@ -452,14 +453,16 @@ void Screensaver::closeScreensaver() { for(int i = 0; i < runStringList.count(); i++) { cmd = cmd + " " + runStringList.at(i); } - qDebug()<<"cmd = "<previewWidget->children()) { if (o->objectName() == "screensaverWidget") { o->setParent(nullptr); - o->deleteLater(); + delete o; + o = nullptr; + qInfo()<<"delete object: screensaverWidget"; } } } @@ -467,19 +470,19 @@ void Screensaver::closeScreensaver() { void Screensaver::kill_and_start() { emit kill_signals(); //如果有屏保先杀死 - if (ui->programCombox->currentIndex() == INDEX_MODE_DEFAULT_UKUI || \ - ui->programCombox->currentIndex() == INDEX_MODE_CUSTOMIZE) { //UKUI && 自定义 + if (programWidget->comboBox()->currentIndex() == INDEX_MODE_DEFAULT_UKUI || \ + programWidget->comboBox()->currentIndex() == INDEX_MODE_CUSTOMIZE) { //UKUI && 自定义 QStringList args; args << "-window-id" << QString::number(mPreviewWidget->winId()); //启动屏保 process->startDetached(screensaver_bin, args); runStringList.append(screensaver_bin); - } else if (ui->programCombox->currentIndex() == INDEX_MODE_BLANK_ONLY) { //黑屏 + } else if (programWidget->comboBox()->currentIndex() == INDEX_MODE_BLANK_ONLY) { //黑屏 mPreviewWidget->update(); - } else if (ui->programCombox->currentIndex() == 2) {//随机 + } else if (programWidget->comboBox()->currentIndex() == 2) {//随机 mPreviewWidget->update(); } else {//屏保 - SSThemeInfo info = ui->programCombox->currentData().value(); + SSThemeInfo info = programWidget->comboBox()->currentData().value(); QStringList args; args << "-window-id" << QString::number(mPreviewWidget->winId()); //启动屏保 @@ -556,6 +559,7 @@ void Screensaver::themesComboxChanged(int index) showUkuiTimeBtn->show(); showCustomTimeBtn->hide(); } + Common::buriedSettings(name(), QString("programCombox"), QString("select"), QString("UKUI")); } else if (index == INDEX_MODE_BLANK_ONLY) { hideCustomizeFrame(); g_settings_set_enum(screensaver_settings, MODE_KEY, MODE_BLANK_ONLY); @@ -567,13 +571,14 @@ void Screensaver::themesComboxChanged(int index) showUkuiTimeBtn->hide(); showCustomTimeBtn->show(); } + Common::buriedSettings(name(), QString("programCombox"), QString("select"), QString("Customize")); } else { hideCustomizeFrame(); if (showTimeFrame) showTimeFrame->hide(); g_settings_set_enum(screensaver_settings, MODE_KEY, MODE_SINGLE); //获取当前屏保的id - QVariant variant = ui->programCombox->itemData(index); + QVariant variant = programWidget->comboBox()->itemData(index); SSThemeInfo info = variant.value(); QByteArray ba = info.id.toLatin1(); strv = g_strsplit(ba.data(), "%%%", 1); @@ -658,18 +663,14 @@ void Screensaver::keyChangedSlot(const QString &key) { } void Screensaver::showCustomizeFrame() { - ui->customizeFrame->setVisible(true); + customizeGroup->setVisible(true); } void Screensaver::hideCustomizeFrame() { - ui->customizeFrame->setVisible(false); + customizeGroup->setVisible(false); } void Screensaver::initCustomizeFrame() { - ui->customizeFrame->setFrameShape(QFrame::NoFrame); - ui->customizeFrame->setFixedHeight(306); - ui->customizeFrame->adjustSize(); - ui->customizeLayout->setMargin(0); initScreensaverSourceFrame(); initPictureSwitchFrame(); initTimeSetFrame(); @@ -681,20 +682,18 @@ void Screensaver::initCustomizeFrame() { void Screensaver::initScreensaverSourceFrame() { - QFrame *screensaverSourceFrame = new QFrame(); + UkccFrame *screensaverSourceFrame = new UkccFrame(customizeGroup, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *sourceLayout = new QHBoxLayout(); FixLabel *sourceLabel = new FixLabel(); sourcePathLine = new QLineEdit(); QPushButton *sourceBtn = new QPushButton(); - screensaverSourceFrame->setFixedHeight(60); screensaverSourceFrame->setLayout(sourceLayout); - sourceLayout->setContentsMargins(16,0,16,0); + sourceLayout->setContentsMargins(16, 0, 16, 0); sourceLayout->addWidget(sourceLabel); sourceLayout->addWidget(sourcePathLine); sourceLayout->addWidget(sourceBtn); sourceLabel->setText(tr("Screensaver source")); sourceLabel->setFixedWidth(220); - sourcePathLine->setFixedHeight(36); sourcePathLine->setMinimumWidth(252); sourcePathLine->setReadOnly(true); sourceBtn->adjustSize(); @@ -770,24 +769,20 @@ void Screensaver::initScreensaverSourceFrame() sourceBtn->setEnabled(false); } - ui->customizeLayout->addWidget(screensaverSourceFrame); - HLineFrame *line = new HLineFrame(); - ui->customizeLayout->addWidget(line); + customizeGroup->addWidget(screensaverSourceFrame); } void Screensaver::initTimeSetFrame() { - QFrame *timeSetFrame = new QFrame(); + UkccFrame *timeSetFrame = new UkccFrame(customizeGroup, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *timeSetLayout = new QHBoxLayout(); FixLabel *timeSetLabel = new FixLabel(); QComboBox *timeCom = new QComboBox(); - timeSetFrame->setFixedHeight(60); timeSetFrame->setLayout(timeSetLayout); - timeSetLayout->setContentsMargins(16,0,16,0); + timeSetLayout->setContentsMargins(16, 0, 16, 0); timeSetLayout->addWidget(timeSetLabel); timeSetLayout->addWidget(timeCom); timeSetLabel->setText(tr("Switching time")); timeSetLabel->setFixedWidth(220); - timeCom->setFixedHeight(36); timeCom->setMinimumWidth(340); timeCom->addItem(tr("1min")); timeCom->addItem(tr("5min")); @@ -807,25 +802,22 @@ void Screensaver::initTimeSetFrame() { } connect(timeCom,QOverload::of(&QComboBox::currentIndexChanged), this, [=](){ if (timeCom->currentIndex() == 0) { - qScreensaverDefaultSetting->set(CYCLE_TIME_KEY,60); + qScreensaverDefaultSetting->set(CYCLE_TIME_KEY, 60); } else if (timeCom->currentIndex() == 1) { - qScreensaverDefaultSetting->set(CYCLE_TIME_KEY,300); + qScreensaverDefaultSetting->set(CYCLE_TIME_KEY, 300); } else if (timeCom->currentIndex() == 2) { - qScreensaverDefaultSetting->set(CYCLE_TIME_KEY,600); + qScreensaverDefaultSetting->set(CYCLE_TIME_KEY, 600); } else if (timeCom->currentIndex() == 3) { - qScreensaverDefaultSetting->set(CYCLE_TIME_KEY,1800); + qScreensaverDefaultSetting->set(CYCLE_TIME_KEY, 1800); } + Common::buriedSettings(name(), QString("Switching time"), QString("select"), QString::number(qScreensaverDefaultSetting->get(CYCLE_TIME_KEY).toInt())); }); } - ui->customizeLayout->addWidget(timeSetFrame); - HLineFrame *line = new HLineFrame(); - ui->customizeLayout->addWidget(line); + customizeGroup->addWidget(timeSetFrame); } - - void Screensaver::initPictureSwitchFrame() { - QFrame *pictureSwitchFrame = new QFrame(); + UkccFrame *pictureSwitchFrame = new UkccFrame(customizeGroup, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *randomLayout = new QHBoxLayout(); FixLabel *randomLabel = new FixLabel(); KSwitchButton *randomBtn = new KSwitchButton(); @@ -840,9 +832,8 @@ void Screensaver::initPictureSwitchFrame() { radioOrder->setText(tr("Ordinal")); radioRand->setText(tr("Random")); - pictureSwitchFrame->setFixedHeight(60); pictureSwitchFrame->setLayout(randomLayout); - randomLayout->setContentsMargins(16,0,16,0); + randomLayout->setContentsMargins(16, 0, 16, 0); randomLayout->addWidget(randomLabel); randomLayout->addWidget(radioOrder); randomLayout->addWidget(radioRand); @@ -863,27 +854,26 @@ void Screensaver::initPictureSwitchFrame() { connect(modeBtn, QOverload::of(&QButtonGroup::buttonClicked), this, [=](int id){ if (id == 0) { qScreensaverDefaultSetting->set(AUTO_SWITCH_KEY, false); + Common::buriedSettings(name(), QString("Random switching"), QString("clicked"), "Ordinal"); } else { qScreensaverDefaultSetting->set(AUTO_SWITCH_KEY, true); + Common::buriedSettings(name(), QString("Random switching"), QString("clicked"), "Random"); } }); } else { //不存在【随机切换】 radioRand->setChecked(true); radioOrder->setChecked(false); } - ui->customizeLayout->addWidget(pictureSwitchFrame); - HLineFrame *line = new HLineFrame(); - ui->customizeLayout->addWidget(line); + customizeGroup->addWidget(pictureSwitchFrame); } void Screensaver::initShowTextFrame() { - QFrame *showTextFrame = new QFrame(); + UkccFrame *showTextFrame = new UkccFrame(customizeGroup, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *showTextLayout = new QHBoxLayout(); FixLabel *showLabel = new FixLabel(); inputText = new QLineEdit(); //用户输入文字 - showTextFrame->setFixedHeight(60); showTextFrame->setLayout(showTextLayout); - showTextLayout->setContentsMargins(16,6,15,8); + showTextLayout->setContentsMargins(16, 6, 15, 8); showTextLayout->addWidget(showLabel); showTextLayout->addWidget(inputText); @@ -899,18 +889,15 @@ void Screensaver::initShowTextFrame() { } else {//不存在【文本设置】 inputText->setEnabled(false); } - ui->customizeLayout->addWidget(showTextFrame); - HLineFrame *line = new HLineFrame(); - ui->customizeLayout->addWidget(line); + customizeGroup->addWidget(showTextFrame); } void Screensaver::initShowtimeFrame() { - showTimeFrame = new QFrame(); + showTimeFrame = new UkccFrame(screensaverGroup, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *showTimeLayout = new QHBoxLayout(showTimeFrame); FixLabel *showTimeLabel = new FixLabel(); - showTimeFrame->setFixedHeight(60); showTimeLayout->setContentsMargins(16,0,16,0); showTimeLayout->addWidget(showTimeLabel); //添加休息时间显示按钮 @@ -922,12 +909,12 @@ void Screensaver::initShowtimeFrame() showTimeLabel->setFixedWidth(220); showTimeLabel->setText(tr("Show rest time")); - ui->verticalLayout_4->addWidget(showTimeFrame); + screensaverGroup->addWidget(showTimeFrame); } void Screensaver::initLockFrame() { - QFrame *lockFrame = new QFrame; + QFrame *lockFrame = new UkccFrame(screensaverGroup, UkccFrame::BorderRadiusStyle::Around, true);; QHBoxLayout *lockLayout = new QHBoxLayout(lockFrame); FixLabel *lockLabel = new FixLabel(); lockLabel->setText(tr("Lock screen when screensaver boot")); @@ -941,13 +928,11 @@ void Screensaver::initLockFrame() lockLayout->addStretch(); lockLayout->addWidget(lockBtn); - HLineFrame *line = new HLineFrame(); - ui->verticalLayout_4->addWidget(line); - ui->verticalLayout_4->addWidget(lockFrame); + screensaverGroup->addWidget(lockFrame); } void Screensaver::initShowTextSetFrame() { - QFrame *showTextSetFrame = new QFrame(); + QFrame *showTextSetFrame = new UkccFrame(customizeGroup, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *textSetLayout = new QHBoxLayout(); FixLabel *textSetLabel = new FixLabel(); QButtonGroup *groupBtn = new QButtonGroup(); @@ -983,8 +968,10 @@ void Screensaver::initShowTextSetFrame() { connect(groupBtn, QOverload::of(&QButtonGroup::buttonClicked), this, [=](int id){ if (id == 0) { qScreensaverDefaultSetting->set(TEXT_CENTER_KEY, false); + Common::buriedSettings(name(), QString("Text position"), QString("clicked"), "radioRandom"); } else if (id == 1) { qScreensaverDefaultSetting->set(TEXT_CENTER_KEY, true); + Common::buriedSettings(name(), QString("Text position"), QString("clicked"), "radioCenter"); } }); } else { //不存在【文本设置】 @@ -992,9 +979,7 @@ void Screensaver::initShowTextSetFrame() { radioCenter->setEnabled(false); } - ui->customizeLayout->addWidget(showTextSetFrame); - HLineFrame *line = new HLineFrame(); - ui->customizeLayout->addWidget(line); + customizeGroup->addWidget(showTextSetFrame); } void Screensaver::setSourcePathText() @@ -1013,33 +998,6 @@ void Screensaver::setSourcePathText() } } -PreviewWidget::PreviewWidget(QWidget *parent):QWidget(parent) -{ - -} - -PreviewWidget::~PreviewWidget() -{ - -} - -void PreviewWidget::paintEvent(QPaintEvent *event) -{ - Q_UNUSED(event); - - QPainter p(this); - p.setPen(Qt::NoPen); - p.setBrush(Qt::black); - p.drawRect(rect()); -} - -void PreviewWidget::mousePressEvent(QMouseEvent *e) -{ - if(e->button() == Qt::LeftButton) { - PreviewWindow::previewScreensaver(); - } -} - bool Screensaver::eventFilter(QObject *watched, QEvent *event) { if (event->type() == QMouseEvent::Enter && watched == previewWind) { @@ -1058,24 +1016,19 @@ bool Screensaver::eventFilter(QObject *watched, QEvent *event) return QObject::eventFilter(watched, event); } -PreviewWindow::PreviewWindow() +void Screensaver::initUi() { + screensaverGroup = new SettingGroup(this->pluginWidget); + //~ contents_path /Screensaver/Idle time + idleTimeWidget = new ComboxWidget(tr("Idle time"), screensaverGroup); + //~ contents_path /Screensaver/Screensaver program + programWidget = new ComboxWidget(tr("Screensaver program"), screensaverGroup); + customizeGroup = new SettingGroup(screensaverGroup); -} -PreviewWindow::~PreviewWindow() -{ + ui->screensaverLayout->addWidget(screensaverGroup); + screensaverGroup->addWidget(idleTimeWidget); + screensaverGroup->addWidget(programWidget); + screensaverGroup->addWidget(customizeGroup); } -void PreviewWindow::mousePressEvent(QMouseEvent *e) -{ - if(e->button() == Qt::LeftButton) { - previewScreensaver(); - } -} - -void PreviewWindow::previewScreensaver() -{ - static QProcess *viewProcess = new QProcess(); - viewProcess->start("ukui-screensaver-command --screensaver"); -} diff --git a/plugins/personalized/screensaver/screensaver.h b/plugins/personalized/screensaver/screensaver.h index f8f5f11..c8d50bf 100644 --- a/plugins/personalized/screensaver/screensaver.h +++ b/plugins/personalized/screensaver/screensaver.h @@ -27,21 +27,22 @@ #include #include #include -#include -#include -#include #include #include #include #include #include +#include "screensaverpluginso.h" #include "shell/interface.h" -#include "widgets/Uslider/uslider.h" +#include "uslider.h" #include "presslabel.h" -#include "shell/utils/mthread.h" +#include "mthread.h" #include "kswitchbutton.h" -#include "screensaverpluginso.h" +#include "settinggroup.h" +#include "comboxwidget.h" +#include "previewwidget.h" +#include "previewwindow.h" using namespace kdk; @@ -69,29 +70,6 @@ namespace Ui { class Screensaver; } -class PreviewWidget : public QWidget -{ - Q_OBJECT -public: - PreviewWidget(QWidget *parent = nullptr); - ~PreviewWidget(); -protected: - void paintEvent(QPaintEvent *e); -private: - void mousePressEvent(QMouseEvent *e); -}; - -class PreviewWindow : public QWindow -{ - Q_OBJECT -public: - PreviewWindow(); - ~PreviewWindow(); - static void previewScreensaver(); -private: - void mousePressEvent(QMouseEvent *e); -}; - class Screensaver : public QWidget, CommonInterface { Q_OBJECT @@ -112,8 +90,8 @@ public: bool isEnable() const Q_DECL_OVERRIDE; public: + void initUi(); void initPreviewLabel(); - void initSearchText(); void initComponent(); void initPreviewWidget(); void initEnableBtnStatus(); @@ -189,7 +167,7 @@ private: PreviewWindow *previewWind; QString sourcePathText; PressLabel *previewLabel = nullptr; - std::unique_ptr screensaver_ptr; + std::unique_ptr screensaverPtr; private slots: void themesComboxChanged(int index); @@ -198,6 +176,12 @@ private slots: Q_SIGNALS: void kill_signals(); + +private: + SettingGroup *screensaverGroup = nullptr; + ComboxWidget *idleTimeWidget = nullptr; + ComboxWidget *programWidget = nullptr; + SettingGroup *customizeGroup = nullptr; }; #endif // SCREENSAVER_H diff --git a/plugins/personalized/screensaver/screensaver.pro b/plugins/personalized/screensaver/screensaver.pro index 6d3e2b0..79ccf42 100644 --- a/plugins/personalized/screensaver/screensaver.pro +++ b/plugins/personalized/screensaver/screensaver.pro @@ -5,6 +5,12 @@ #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ComboBox/combobox.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Frame/frame.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Uslider/uslider.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets dbus @@ -35,10 +41,14 @@ PKGCONFIG += gio-2.0 \ SOURCES += \ presslabel.cpp \ + previewwidget.cpp \ + previewwindow.cpp \ screensaver.cpp HEADERS += \ presslabel.h \ + previewwidget.h \ + previewwindow.h \ screensaver.h \ screensaverpluginso.h diff --git a/plugins/personalized/screensaver/screensaver.ui b/plugins/personalized/screensaver/screensaver.ui index 96eddd2..9bbdfdf 100644 --- a/plugins/personalized/screensaver/screensaver.ui +++ b/plugins/personalized/screensaver/screensaver.ui @@ -7,7 +7,7 @@ 0 0 684 - 555 + 560
@@ -117,292 +117,7 @@
- - - - 550 - 0 - - - - - 16777215 - 16777215 - - - - QFrame::Box - - - QFrame::Raised - - - 0 - - - - 20 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - - - 8 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 0 - 0 - - - - - 220 - 60 - - - - - 220 - 60 - - - - Idle time - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 550 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - 0 - - - - 2 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - 16 - - - 16 - - - - - - 0 - 0 - - - - - 220 - 60 - - - - - 220 - 60 - - - - Screensaver program - - - - - - - - 0 - 0 - - - - - 0 - 36 - - - - - 16777215 - 36 - - - - - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 0 - 69 - - - - - 550 - 100 - - - - - 16777215 - 16777215 - - - - QFrame::Box - - - 0 - - - - 2 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - - - - - - - - + @@ -520,17 +235,17 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
FixLabel QLabel -
../../../libukcc/widgets/Label/fixlabel.h
+
fixlabel.h
PreviewWidget QWidget -
screensaver.h
+
previewwidget.h
1
diff --git a/plugins/personalized/screensaver/screensaverpluginso.h b/plugins/personalized/screensaver/screensaverpluginso.h index 4949451..ea22558 100644 --- a/plugins/personalized/screensaver/screensaverpluginso.h +++ b/plugins/personalized/screensaver/screensaverpluginso.h @@ -11,7 +11,7 @@ public: virtual QString name() const = 0; //创建UI的实例 - virtual QWidget* createWidget(bool isScreensaver,QWidget* parent) = 0; + virtual QWidget* createWidget(bool isScreensaver, QWidget* parent) = 0; //获得插件的展示名称 virtual QString displayName() const = 0; diff --git a/plugins/personalized/theme/drawiconlabel.cpp b/plugins/personalized/theme/drawiconlabel.cpp index 7ffccc7..301317c 100644 --- a/plugins/personalized/theme/drawiconlabel.cpp +++ b/plugins/personalized/theme/drawiconlabel.cpp @@ -7,14 +7,16 @@ #define BOTTOM_LEFT_CORNER 8 DrawIconLabel::DrawIconLabel(int radius, QWidget *parent): - mRadius(radius) + mRadius(radius), + QLabel(parent) { setScaledContents(true); } DrawIconLabel::DrawIconLabel(const QPixmap &pixmap, int radius, QWidget *parent): mPixmap(pixmap), - mRadius(radius) + mRadius(radius), + QLabel(parent) { setScaledContents(true); } diff --git a/plugins/personalized/theme/globaltheme/customglobaltheme.cpp b/plugins/personalized/theme/globaltheme/customglobaltheme.cpp index 0081510..3173329 100644 --- a/plugins/personalized/theme/globaltheme/customglobaltheme.cpp +++ b/plugins/personalized/theme/globaltheme/customglobaltheme.cpp @@ -59,9 +59,14 @@ QString CustomGlobalTheme::getQtDarkThemeName() return qsettings->value("getQtDarkThemeName", "ukui-dark").toString(); } +QString CustomGlobalTheme::getQtMixedThemeName() +{ + return qsettings->value("getQtMixedThemeName", "ukui-default").toString(); +} + QString CustomGlobalTheme::getQtAccentRole() { - return qsettings->value("getQtAccentRole", "default").toString(); + return qsettings->value("getQtAccentRole", "daybreakBlue").toString(); } QString CustomGlobalTheme::getGtkThemeName() @@ -111,7 +116,7 @@ bool CustomGlobalTheme::getSupportBlur() bool CustomGlobalTheme::getBlurEnabled() { - return qsettings->value("getBlurEnabled").toBool(); + return qsettings->value("getBlurEnabled", true).toBool(); } bool CustomGlobalTheme::getSupportTransparency() @@ -121,12 +126,12 @@ bool CustomGlobalTheme::getSupportTransparency() int CustomGlobalTheme::getTransparencyBlur() { - return qsettings->value("getTransparencyBlur", 90).toInt(); + return qsettings->value("getTransparencyBlur", 65).toInt(); } int CustomGlobalTheme::getTransparencyNoBlur() { - return qsettings->value("getTransparencyNoBlur", 100).toInt(); + return qsettings->value("getTransparencyNoBlur", 90).toInt(); } bool CustomGlobalTheme::getSupportAnimation() diff --git a/plugins/personalized/theme/globaltheme/customglobaltheme.h b/plugins/personalized/theme/globaltheme/customglobaltheme.h index e3d57cf..a998b75 100644 --- a/plugins/personalized/theme/globaltheme/customglobaltheme.h +++ b/plugins/personalized/theme/globaltheme/customglobaltheme.h @@ -37,6 +37,7 @@ public: QString getWidgetStyleName() override; QString getQtLightThemeName() override; QString getQtDarkThemeName() override; + QString getQtMixedThemeName() override; QString getQtAccentRole() override; QString getGtkThemeName() override; diff --git a/plugins/personalized/theme/globaltheme/globaltheme.cpp b/plugins/personalized/theme/globaltheme/globaltheme.cpp index 498de4e..026f0b7 100644 --- a/plugins/personalized/theme/globaltheme/globaltheme.cpp +++ b/plugins/personalized/theme/globaltheme/globaltheme.cpp @@ -88,6 +88,10 @@ GlobalTheme::GlobalTheme(const QString &theme, QObject *parent) : QObject(parent if (var.isValid()) { d_ptr->qtAccentRole = var.toString(); } + var = d_ptr->settings->value("mixedThemeName"); + if (var.isValid()) { + d_ptr->qtMixedThemeName = var.toString(); + } d_ptr->settings->endGroup(); // gtk @@ -226,6 +230,12 @@ QString GlobalTheme::getQtDarkThemeName() return d_func()->qtDarkThemeName; } +QString GlobalTheme::getQtMixedThemeName() +{ + Q_D(GlobalTheme); + return d_func()->qtMixedThemeName; +} + QString GlobalTheme::getQtAccentRole() { Q_D(GlobalTheme); diff --git a/plugins/personalized/theme/globaltheme/globaltheme.h b/plugins/personalized/theme/globaltheme/globaltheme.h index c95734c..db9dd45 100644 --- a/plugins/personalized/theme/globaltheme/globaltheme.h +++ b/plugins/personalized/theme/globaltheme/globaltheme.h @@ -33,6 +33,7 @@ public: Q_INVOKABLE virtual QString getWidgetStyleName(); Q_INVOKABLE virtual QString getQtLightThemeName(); Q_INVOKABLE virtual QString getQtDarkThemeName(); + Q_INVOKABLE virtual QString getQtMixedThemeName(); Q_INVOKABLE virtual QString getQtAccentRole(); Q_INVOKABLE virtual QString getGtkThemeName(); diff --git a/plugins/personalized/theme/globaltheme/globaltheme_p.h b/plugins/personalized/theme/globaltheme/globaltheme_p.h index d0fd12a..31105e1 100644 --- a/plugins/personalized/theme/globaltheme/globaltheme_p.h +++ b/plugins/personalized/theme/globaltheme/globaltheme_p.h @@ -21,6 +21,7 @@ public: QString widgetStyleName = "default"; QString qtLightThemeName = "ukui-light"; QString qtDarkThemeName = "ukui-dark"; + QString qtMixedThemeName = "ukui-default"; QString qtAccentRole = "daybreakBlue"; QString gtkThemeName = "ukui-white"; diff --git a/plugins/personalized/theme/myslider.cpp b/plugins/personalized/theme/myslider.cpp index 522cb22..568362f 100644 --- a/plugins/personalized/theme/myslider.cpp +++ b/plugins/personalized/theme/myslider.cpp @@ -15,6 +15,7 @@ void MySlider::mousePressEvent(QMouseEvent *ev) int currentx = ev->pos().x(); int value = (currentx /(double)this->width())*(this->maximum() - this->minimum()) + this->minimum(); this->setValue(value); + } void MySlider::wheelEvent(QWheelEvent *ev) @@ -27,3 +28,9 @@ void MySlider::leaveEvent(QEvent *ev) { isMouseCliked = false; } + +void MySlider::mouseReleaseEvent(QMouseEvent *ev) +{ + emit sliderClickedSignals(); + QSlider::mouseReleaseEvent(ev); +} diff --git a/plugins/personalized/theme/myslider.h b/plugins/personalized/theme/myslider.h index ae4fa0c..86fc9e4 100644 --- a/plugins/personalized/theme/myslider.h +++ b/plugins/personalized/theme/myslider.h @@ -6,6 +6,7 @@ class MySlider : public QSlider { + Q_OBJECT public: MySlider(QWidget *parent = nullptr); ~MySlider(); @@ -13,10 +14,14 @@ protected: void mousePressEvent(QMouseEvent *ev); void wheelEvent(QWheelEvent *ev); void leaveEvent(QEvent *ev); + void mouseReleaseEvent(QMouseEvent *ev); private: bool isMouseCliked = false; +Q_SIGNALS: + void sliderClickedSignals(); + }; #endif // MYSLIDER_H diff --git a/plugins/personalized/theme/theme.cpp b/plugins/personalized/theme/theme.cpp index f1c3bfa..9ddb4d4 100644 --- a/plugins/personalized/theme/theme.cpp +++ b/plugins/personalized/theme/theme.cpp @@ -27,11 +27,11 @@ #include #include -#include "widgets/Label/iconlabel.h" +#include "iconlabel.h" #include "cursor/xcursortheme.h" #include "../../../shell/customstyle.h" -#include "../../../shell/utils/utils.h" +#include "common.h" // GTK主题 #define THEME_GTK_SCHEMA "org.mate.interface" @@ -68,6 +68,10 @@ #define PERSONALSIE_EFFECT_KEY "effect" #define PERSONALSIE_SAVE_TRAN_KEY "save-transparency" +// 自动主题设置 +#define AUTO_SCHEMA "org.ukui.SettingsDaemon.plugins.color" +#define COLOR_KEY_AUTO_THEME "theme-schedule-automatic" + const QString kDefCursor = "DMZ-White"; const QString UbuntuVesionEnhance = "22.04"; const QString kXder = "XRender"; @@ -76,9 +80,11 @@ const int transparency = 85; //保存关闭特效模式之前的透明度 int save_trans = 0; -const QStringList effectList {"blur", "kwin4_effect_translucency", "kwin4_effect_maximize", "zoom"}; -const QStringList kIconsList {"computer.png", "user-trash.png", "system-file-manager.png", "ukui-control-center.png", "kylin-software-center.png", "kylin-video.png", "kylin-assistant.png"}; -const QStringList kIntelIconList {"computer.png", "kylin-software-center.png", "ukui-control-center.png", "kylin-weather.png", "calendar-app.png", "kylin-camera.png"}; +const QStringList blackList {"Adwaita", "bloom", "default", "hicolor", "HighContrast", "locolor", "LoginIcons", "ubuntu-mono-dark", "ubuntu-mono-light"}; +const QStringList effectList {"blur", "kwin4_effect_translucency", "kwin4_effect_maximize", "zoom"}; +const QStringList effectListMavis {"blur", "kwin4_effect_maximize", "zoom"}; +const QStringList kIconsList {"computer.png", "user-trash.png", "system-file-manager.png", "ukui-control-center.png", "kylin-software-center.png", "kylin-video.png", "kylin-assistant.png"}; +const QStringList kIntelIconList {"computer.png", "kylin-software-center.png", "ukui-control-center.png", "kylin-weather.png", "calendar-app.png", "kylin-camera.png"}; const QStringList defaultIconList {"kylin-startmenu.png", "kylin-software-center.png", "indicator-china-weather.png", "burner.png", "kylin-music.png", "kylin-photo-viewer.png"}; const QStringList heyinIconList {"kylin-alarm-clock.png", "kylin-clipboard.png", "ukui-control-center.png", "kylin-calendar.png", "kylin-ipmsg.png", "kylin-photo-viewer.png"}; @@ -99,34 +105,18 @@ namespace { const int numCursors = 6; // The number of cursors from the above list to be previewed } -Theme::Theme() +Theme::Theme() : mFirstLoad(true) { - ui = new Ui::Theme; - pluginWidget = new QWidget; - pluginWidget->setAttribute(Qt::WA_DeleteOnClose); - pluginName = tr("Theme"); pluginType = PERSONALIZED; - ui->setupUi(pluginWidget); - - initThemeUi(); - setupGSettings(); - - // 设置组件 - setupComponent(); - setupSettings(); - initThemeMode(); - initIconTheme(); - initCursorTheme(); - initConnection(); - initSearchText(); - hideIntelComponent(); } Theme::~Theme() { - delete ui; - ui = nullptr; + if (!mFirstLoad) { + delete ui; + ui = nullptr; + } } QString Theme::plugini18nName() { @@ -138,6 +128,25 @@ int Theme::pluginTypes() { } QWidget *Theme::pluginUi() { + if (mFirstLoad) { + mFirstLoad = false; + ui = new Ui::Theme; + pluginWidget = new QWidget; + pluginWidget->setAttribute(Qt::WA_DeleteOnClose); + ui->setupUi(pluginWidget); + initThemeUi(); + setupGSettings(); + + isUpgrade(); + setupComponent(); + setupSettings(); + initThemeMode(); + initIconTheme(); + initCursorTheme(); + initConnection(); + initSearchText(); + hideIntelComponent(); + } return pluginWidget; } @@ -164,30 +173,35 @@ bool Theme::isEnable() const void Theme::initThemeUi() { mThemeModeFrame = new QFrame(pluginWidget); - mThemeModeFrame->setFixedHeight(156); + mThemeModeFrame->setMinimumHeight(156); mThemeModeFrame->setFrameShape(QFrame::Shape::Box); QHBoxLayout *hLyt = new QHBoxLayout(mThemeModeFrame); mThemeModeLabel = new TitleLabel(mThemeModeFrame); mLightBtn = new ThemeButton(tr("Light"), QPixmap(QString("://img/plugins/theme/%1.png").arg("light")), mThemeModeFrame); + mLightBtn->setObjectName("lighttheme"); mDarkBtn = new ThemeButton(tr("Dark"),QPixmap(QString("://img/plugins/theme/%1.png").arg("dark")), mThemeModeFrame); - mDefaultBtn = new ThemeButton(Utils::isTablet() ? tr("Auto") : tr("Default"), QPixmap(QString("://img/plugins/theme/%1.png").arg("default")),mThemeModeFrame); + mDarkBtn->setObjectName("darktheme"); + mDefaultBtn = new ThemeButton(tr("Auto"), QPixmap(QString("://img/plugins/theme/%1.png").arg("default")),mThemeModeFrame); + mDefaultBtn->setObjectName("defaulttheme"); mThemeModeBtnGroup = new QButtonGroup(this); - mThemeModeBtnGroup->addButton(mDefaultBtn); - mThemeModeBtnGroup->addButton(mDarkBtn); + mThemeModeBtnGroup->addButton(mLightBtn); + mThemeModeBtnGroup->addButton(mDarkBtn); + mThemeModeBtnGroup->addButton(mDefaultBtn); buildThemeModeBtn(mLightBtn); buildThemeModeBtn(mDarkBtn); buildThemeModeBtn(mDefaultBtn); hLyt->setSpacing(40); - hLyt->setContentsMargins(16, 0 , 0, 0); + hLyt->setContentsMargins(16, 16, 0, 0); hLyt->addWidget(mLightBtn); hLyt->addWidget(mDarkBtn); hLyt->addWidget(mDefaultBtn); + hLyt->addStretch(); ui->thememodeLayout->addWidget(mThemeModeLabel); @@ -262,7 +276,8 @@ void Theme::setupSettings() { void Theme::setupComponent() { - mDarkBtn->setVisible(!Utils::isCommunity()); + mIsOpenkylin = Common::isOpenkylin(); + mDarkBtn->setVisible(!Common::isCommunity()); mDefaultBtn->setProperty("value", "ukui-default"); mLightBtn->setProperty("value", "ukui-light"); @@ -272,11 +287,18 @@ void Theme::setupComponent() { ui->tranSlider->setValue(static_cast(personliseGsettings->get(PERSONALSIE_TRAN_KEY).toDouble() * 100.0)); connect(ui->tranSlider, &QSlider::valueChanged, this, [=]() { + int value = ui->tranSlider->value(); changeTranpancySlot(ui->tranSlider->value()); + revokeGlobalThemeSlot("getTransparencyBlur", QString::number(value, 10)); + revokeGlobalThemeSlot("getSupportTransparency", "true"); + }); + connect(ui->tranSlider, &MySlider::sliderClickedSignals, this, [=]() { + Common::buriedSettings(name(), "set transparency", QString("settings"), QString::number(ui->tranSlider->value())); }); //构建并填充特效开关按钮 effectSwitchBtn = new KSwitchButton(pluginWidget); + effectSwitchBtn->setObjectName("effect"); ui->effectHorLayout->addWidget(effectSwitchBtn); ui->kwinFrame->setVisible(false); @@ -293,15 +315,16 @@ void Theme::setupComponent() { void Theme::buildThemeModeBtn(ThemeButton *button) { connect(mThemeModeBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ - emit button->mBtnCheckedSignals(eBtn == button ? true : false); + emit button->btnCheckedSignals(eBtn == button ? true : false); }); - } void Theme::initThemeMode() { // 获取当前主题 QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); - if ("ukui-white" == currentThemeMode || "ukui-default" == currentThemeMode) { + bool isAutoTheme = mAutoSettings->get(COLOR_KEY_AUTO_THEME).toBool(); + + if ("ukui-white" == currentThemeMode || "ukui-default" == currentThemeMode || isAutoTheme) { mThemeModeBtnGroup->buttonClicked(mDefaultBtn); emit mDefaultBtn->clicked(); } else if ("ukui-dark" == currentThemeMode || "ukui-black" == currentThemeMode){ @@ -311,80 +334,6 @@ void Theme::initThemeMode() { mThemeModeBtnGroup->buttonClicked(mLightBtn); emit mLightBtn->clicked(); } - - qApp->setStyle(new InternalStyle("ukui")); - - // 监听主题改变 - connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { - QString currentThemeMode = qtSettings->get(key).toString(); - if (key == "styleName") { - // 获取当前主题 - for (QAbstractButton * button : mThemeModeBtnGroup->buttons()){ - QVariant valueVariant = button->property("value"); - if ("ukui-black" == currentThemeMode) { - currentThemeMode = "ukui-dark"; - } else if("ukui-white" == currentThemeMode) { - currentThemeMode = "ukui-default"; - } - if (valueVariant.isValid() && valueVariant.toString() == currentThemeMode) { - disconnect(mThemeModeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(themeBtnClickSlot(QAbstractButton*))); - button->click(); - connect(mThemeModeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(themeBtnClickSlot(QAbstractButton*))); - } - } - qApp->setStyle(new InternalStyle("ukui")); - } - if (key == "iconThemeName") { - QString icoName = qtSettings->get(ICON_QT_KEY).toString(); - foreach (QAbstractButton *btn, mThemeIconBtnGroup->buttons()) { - if (btn->property("value").isValid() && btn->property("value") == icoName) { - disconnect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); - btn->click(); - connect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); - } - } - } - - if (key == "themeColor") { - updateAccentColorSlot(currentThemeMode); - } - }); - - connect(gtkSettings,&QGSettings::changed,this,[=] (const QString &key) { - if(key == "iconTheme") { - QString icoName = qtSettings->get(ICON_QT_KEY).toString(); - foreach (QAbstractButton *btn, mThemeIconBtnGroup->buttons()) { - if (btn->property("value").isValid() && btn->property("value") == icoName) { - disconnect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); - btn->click(); - connect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); - } - } - } - }); - - connect(curSettings,&QGSettings::changed,this,[=](const QString &key) { - if(key == "cursorTheme") { - QString cursorTheme = curSettings->get(CURSOR_THEME_KEY).toString(); - foreach (QAbstractButton *btn, mThemeCursorBtnGroup->buttons()) { - if (btn->property("value").isValid() && btn->property("value") == cursorTheme) { - disconnect(mThemeCursorBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(cursorThemeBtnClickSlot(QAbstractButton*))); - btn->click(); - connect(mThemeCursorBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(cursorThemeBtnClickSlot(QAbstractButton*))); - } - } - } - }); - - connect(personliseGsettings, &QGSettings::changed,this,[=] (const QString &key) { - if (key == "effect") { - qApp->setStyle(new InternalStyle("ukui")); - bool effectEnabled = personliseGsettings->get("effect").toBool(); - effectSwitchBtn->setChecked(effectEnabled); - } - }); - - connect(mThemeModeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(themeBtnClickSlot(QAbstractButton*))); } void Theme::initIconTheme() { @@ -392,30 +341,44 @@ void Theme::initIconTheme() { mThemeIconFrame->setMinimumHeight(156); mThemeIconFrame->setFrameShape(QFrame::Shape::Box); - FlowLayout *fLyt = new FlowLayout(mThemeIconFrame, 16, 40, 16); - mThemeIconLabel = new TitleLabel(mThemeIconFrame); - + FlowLayout *fLyt = new FlowLayout(mThemeIconFrame, 0, 40, 0); + fLyt->setContentsMargins(16, 16, 0, 4); + mThemeIconLabel = new TitleLabel(); // 构建图标主题Widget Group,方便更新选中/非选中状态 mThemeIconBtnGroup = new QButtonGroup; //构建图标主题QDir - QDir themesDir = QDir(ICONTHEMEPATH); - QStringList IconThemeList = themesDir.entryList(QDir::Dirs); - foreach (QString themedir, IconThemeList) { + QStringList iconThemes = getSystemIconThemes(); + foreach (QString themedir, iconThemes) { if (("ukui-icon-theme-default" == themedir) || ("ukui-hp" == themedir)) { initIconThemeWidget(themedir, fLyt); break; } } - foreach (QString themedir, IconThemeList) { - if ((Utils::isCommunity() && (!themedir.compare("ukui") || !themedir.compare("ukui-classical") || !themedir.compare("ukui-fashion"))) || - (!Utils::isCommunity() && themedir.startsWith("ukui-icon-theme-")) || - (Utils::isTablet() && (!themedir.compare("ukui") || themedir.startsWith("ukui-classical")))) { + foreach (QString themedir, iconThemes) { + if (("ukui-icon-theme-fashion" == themedir)) { + initIconThemeWidget(themedir, fLyt); + break; + } + } + foreach (QString themedir, iconThemes) { + if (("ukui-icon-theme-classical" == themedir)) { + initIconThemeWidget(themedir, fLyt); + break; + } + } + foreach (QString themedir, iconThemes) { + if ((Common::isCommunity() && (!themedir.compare("ukui") || !themedir.compare("ukui-classical") || !themedir.compare("ukui-fashion"))) || + (!Common::isCommunity()) || + (Common::isTablet() && (!themedir.compare("ukui") || themedir.startsWith("ukui-classical")))) { - if (("ukui-icon-theme-basic" == themedir) || ("ukui-icon-theme-default" == themedir) || ("ukui-hp" == themedir)) { + if (("ukui-icon-theme-basic" == themedir) || ("ukui-icon-theme-default" == themedir) || ("ukui-hp" == themedir) + ||("ukui-icon-theme-fashion" == themedir) || ("ukui-icon-theme-classical" == themedir)) { continue; } + if (blackList.contains(themedir)) + continue; initIconThemeWidget(themedir, fLyt); } } @@ -475,6 +438,7 @@ void Theme::initControlTheme() const QString& value = radioBtn->property("key").toString(); qtSettings->set(COLOR_QT_KEY, value); revokeGlobalThemeSlot("getQtAccentRole", value); + qApp->setStyle(new InternalStyle("ukui")); }); it++; } @@ -485,13 +449,15 @@ void Theme::initControlTheme() } void Theme::initCursorTheme(){ - if (Utils::isTablet()) + if (Common::isTablet() || Common::isWayland()) return; + mThemeCursorFrame = new QFrame(pluginWidget); mThemeCursorFrame->setMinimumHeight(156); mThemeCursorFrame->setFrameShape(QFrame::Shape::Box); - FlowLayout *fLyt = new FlowLayout(mThemeCursorFrame, 16, 40, 16); + FlowLayout *fLyt = new FlowLayout(mThemeCursorFrame, 0, 40, 0); + fLyt->setContentsMargins(16, 16, 0, 4); mThemeCursorLabel = new TitleLabel(mThemeCursorFrame); @@ -502,22 +468,27 @@ void Theme::initCursorTheme(){ for (QString cursor : cursorThemes){ if (cursor == "dark-sense") { initCursorThemeWidget(cursor , fLyt); + break; + } + } + for (QString cursor : cursorThemes){ + if (cursor == "DMZ-White") { + initCursorThemeWidget(cursor , fLyt); + break; } } for (QString cursor : cursorThemes){ - if (cursor != "dark-sense") { - initCursorThemeWidget(cursor , fLyt); + if (cursor == "dark-sense" || cursor == "DMZ-White") { + continue; } + initCursorThemeWidget(cursor , fLyt); } connect(mThemeCursorBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(cursorThemeBtnClickSlot(QAbstractButton*))); ui->cursorVerLayout->addWidget(mThemeCursorLabel); ui->cursorVerLayout->addWidget(mThemeCursorFrame); - // To fix 129277 - mThemeCursorLabel->setVisible(false); - mThemeCursorFrame->setVisible(false); -// ui->cursorVerLayout->addSpacing(40); + ui->cursorVerLayout->addSpacing(40); } void Theme::initGlobalTheme() @@ -531,7 +502,8 @@ void Theme::initGlobalTheme() mSwitchFrame->setMinimumHeight(196); mSwitchFrame->setFrameShape(QFrame::Shape::Box); - mFLyt = new FlowLayout(mSwitchFrame, 16, 40, 16); + mFLyt = new FlowLayout(mSwitchFrame, 0, 40, 0); + mFLyt->setContentsMargins(16, 16, 0, 4); mSwitchLabel = new TitleLabel(); mSwitchLabel->setText(tr("Theme")); @@ -540,13 +512,18 @@ void Theme::initGlobalTheme() mThemeBtnGroup = new QButtonGroup(this); - for (GlobalTheme *theme: mGlobalthemehelper->getAllGlobalThemes()) { + QList globalThemes = mGlobalthemehelper->getAllGlobalThemes(); + QList sorthemes = sortGlobalTheme(globalThemes); + + for (GlobalTheme *theme: sorthemes) { + mGlobalthemehelper->loadThumbnail(theme); QString themeName = theme->getThemeName(); QString i18nName = theme->getLocaleThemeName(); ThemeButton *btn = new ThemeButton(i18nName, mSwitchFrame); + btn->setObjectName(themeName); btn->setProperty("value", themeName); btn->setRect(QSize(200, 164)); mThemeBtnGroup->addButton(btn); @@ -567,11 +544,34 @@ void Theme::initGlobalTheme() connect(theme, &GlobalTheme::thumbnailLoaded, this, [=]{ btn->setPixmap(theme->getThumbnail()); + btn->update(); }); } ui->switchLyt->addWidget(mSwitchFrame); ui->switchLyt->addSpacing(40); connect(mThemeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(changeGlobalThemeSlot(QAbstractButton*))); + connect(mGlobalthemehelper, &GlobalThemeHelper::globalThemesChanged, this, &Theme::changeGlobalDirSlot); +} + +QList Theme::sortGlobalTheme(const QList &globalThemes) +{ + QList tmpGlogbalThemes; + GlobalTheme *heyin = nullptr; + GlobalTheme *lightSeeking = nullptr; + + for (GlobalTheme *theme: globalThemes) { + if (theme->getThemeName() == "Light-Seeking") { + lightSeeking = theme; + } else if (theme->getThemeName() == "HeYin"){ + heyin = theme; + } else { + tmpGlogbalThemes.append(theme); + } + } + if (heyin != nullptr) tmpGlogbalThemes.prepend(heyin); + if (lightSeeking != nullptr) tmpGlogbalThemes.prepend(lightSeeking); + + return tmpGlogbalThemes; } void Theme::initJumpTheme() @@ -583,7 +583,8 @@ void Theme::initJumpTheme() aboutVLyt->setContentsMargins(0, 0, 0, 0); QPushButton *wallBtn = new QPushButton(tr("Set")); - wallBtn->setFixedSize(QSize(96, 36)); + wallBtn->setObjectName("wallpapersettings"); + wallBtn->setFixedWidth(96); mWallHLyt = new QHBoxLayout(); mWallHLyt->setContentsMargins(16, 0, 16, 0); mWallHLyt->addWidget(new QLabel(tr("Wallpaper"))); @@ -595,7 +596,8 @@ void Theme::initJumpTheme() mOtherFrame->setLayout(aboutVLyt); QPushButton *soundBtn = new QPushButton(tr("Set")); - soundBtn->setFixedSize(QSize(96, 36)); + soundBtn->setObjectName("soundsettings"); + soundBtn->setFixedWidth(96); mSoundHLyt = new QHBoxLayout(); mSoundHLyt->setContentsMargins(16, 0, 16, 0); mSoundHLyt->addWidget(new QLabel(tr("Beep"))); @@ -609,10 +611,12 @@ void Theme::initJumpTheme() ui->jumpLyt->addWidget(mOtherFrame); connect(wallBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(name(), "set wallpaper", QString("clicked")); jumpFunctionSlot("wallpaper"); }); connect(soundBtn, &QPushButton::clicked, this, [=]{ + Common::buriedSettings(name(), "set sound", QString("clicked")); jumpFunctionSlot("audio"); }); } @@ -621,14 +625,102 @@ void Theme::initConnection() { connect(ui->resetBtn, &QPushButton::clicked, this, &Theme::resetBtnClickSlot); connect(effectSwitchBtn, &KSwitchButton::stateChanged, [this](bool checked) { + Common::buriedSettings(name(), "whether open effect mode", QString("settings"), checked ? "true" : "false"); + revokeGlobalThemeSlot("getBlurEnabled", checked ? "true" : "false"); + revokeGlobalThemeSlot("getSupportBlur", "true"); + changeEffectSlot(checked); + + revokeGlobalThemeSlot("getTransparencyBlur", checked ? QString::number(save_trans) : "100"); + revokeGlobalThemeSlot("getSupportTransparency", "true"); }); connect(mMateBgSettings, &QGSettings::changed, this, [=](const QString &key) { - if (key == "pictureFilename") { + if (key == "pictureFilename" && mGlobalthemehelper != nullptr) { const QString& value = mMateBgSettings->get(key).toString(); mGlobalthemehelper->updateCustomThemeSetting("getWallPaperPath", value); } }); + + // 监听主题改变 + connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) { + QString currentThemeMode = qtSettings->get(key).toString(); + if (key == "styleName") { + // 获取当前主题 + if (mAutoSettings) { + bool isAutoTheme = mAutoSettings->get(COLOR_KEY_AUTO_THEME).toBool(); + if (!isAutoTheme) setThemeBtnStatus(); + } + } + + if (key == "iconThemeName") { + QString icoName = qtSettings->get(ICON_QT_KEY).toString(); + foreach (QAbstractButton *btn, mThemeIconBtnGroup->buttons()) { + if (btn->property("value").isValid() && btn->property("value") == icoName) { + disconnect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); + btn->click(); + connect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); + } + } + } + + if (key == "themeColor") { + updateAccentColorSlot(currentThemeMode); + } + }); + + connect(gtkSettings,&QGSettings::changed,this,[=] (const QString &key) { + if(key == "iconTheme") { + QString icoName = qtSettings->get(ICON_QT_KEY).toString(); + foreach (QAbstractButton *btn, mThemeIconBtnGroup->buttons()) { + if (btn->property("value").isValid() && btn->property("value") == icoName) { + disconnect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); + btn->click(); + connect(mThemeIconBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(iconThemeBtnClickSlot(QAbstractButton*))); + } + } + } + }); + + connect(curSettings, &QGSettings::changed, this, [=](const QString &key) { + if (key == "cursorTheme") { + QString cursorTheme = curSettings->get(CURSOR_THEME_KEY).toString(); + foreach (QAbstractButton *btn, mThemeCursorBtnGroup->buttons()) { + if (btn->property("value").isValid() && btn->property("value") == cursorTheme) { + disconnect(mThemeCursorBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(cursorThemeBtnClickSlot(QAbstractButton*))); + btn->click(); + connect(mThemeCursorBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(cursorThemeBtnClickSlot(QAbstractButton*))); + } + } + } + }); + + connect(personliseGsettings, &QGSettings::changed,this,[=] (const QString &key) { + if (key == "effect") { + if (Common::isOpenkylin()) + qApp->setStyle(new InternalStyle("ukui")); + bool effectEnabled = personliseGsettings->get("effect").toBool(); + effectSwitchBtn->blockSignals(true); + effectSwitchBtn->setChecked(effectEnabled); + effectSwitchBtn->blockSignals(false); + } + }); + + if (mAutoSettings) { + connect(mAutoSettings, &QGSettings::changed, this, [=](const QString &key) { + + if (key == "themeScheduleAutomatic") { + bool isAutoTheme = mAutoSettings->get(COLOR_KEY_AUTO_THEME).toBool(); + if (isAutoTheme) { + if (!mDefaultBtn->isChecked()) + emit mDefaultBtn->click(); + } else { + setThemeBtnStatus(); + } + } + }); + } + + connect(mThemeModeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(themeBtnClickSlot(QAbstractButton*))); } void Theme::initIconThemeWidget(QString themedir , FlowLayout *horLyt) @@ -646,16 +738,8 @@ void Theme::initIconThemeWidget(QString themedir , FlowLayout *horLyt) QStringList showIconsList; QStringList realIconsList; - if (!Utils::isTablet()) { - if (("ukui-icon-theme-default" == themedir)) { - realIconsList = defaultIconList; - } else if (("ukui-icon-theme-fashion" == themedir)) { - realIconsList = heyinIconList; - } else if (("ukui-icon-theme-classical" == themedir)) { - realIconsList = classicIconList; - } else { - return; - } + if (!Common::isTablet()) { + realIconsList = defaultIconList; } else { realIconsList = kIntelIconList; } @@ -667,13 +751,18 @@ void Theme::initIconThemeWidget(QString themedir , FlowLayout *horLyt) showIconsList.append(devicesDir.path() + "/" + realIconsList.at(i)); } else if (QFile(placesDir.path() + "/" + realIconsList.at(i)).exists()) { showIconsList.append(placesDir.path() + "/" + realIconsList.at(i)); + } else if (QFile(ICONTHEMEPATH + themedir + "/32x32/mimetypes/application-x-desktop.png").exists()){ + showIconsList.append(ICONTHEMEPATH + themedir + "/32x32/mimetypes/application-x-desktop.png"); + } else { + return; } } ThemeButton *button = new ThemeButton(dullTranslation(themedir.section("-", -1, -1, QString::SectionSkipEmpty)), showIconsList, pluginWidget); + button->setObjectName(themedir); button->setProperty("value", themedir); mThemeIconBtnGroup->addButton(button); connect(mThemeIconBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ - emit button->mBtnCheckedSignals(eBtn == button ? true : false); + emit button->btnCheckedSignals(eBtn == button ? true : false); }); // 加入Layout horLyt->addWidget(button); @@ -689,6 +778,7 @@ void Theme::initCursorThemeWidget(QString themedir, FlowLayout *fLyt) // 获取当前指针主题 QString currentCursorTheme; currentCursorTheme = curSettings->get(CURSOR_THEME_KEY).toString(); + if (themedir == "DMZ-Black" && !mIsUpgrade) return; QList cursorVec; QString path = CURSORS_THEMES_PATH + themedir; @@ -701,10 +791,11 @@ void Theme::initCursorThemeWidget(QString themedir, FlowLayout *fLyt) } ThemeButton *button = new ThemeButton(dullCursorTranslation(themedir), cursorVec, pluginWidget); + button->setObjectName(themedir); button->setProperty("value", themedir); - mThemeCursorBtnGroup->addButton(button); + mThemeCursorBtnGroup->addButton(button); connect(mThemeCursorBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), [=](QAbstractButton * eBtn){ - emit button->mBtnCheckedSignals(eBtn == button ? true : false); + emit button->btnCheckedSignals(eBtn == button ? true : false); }); // 加入Layout fLyt->addWidget(button); @@ -731,6 +822,24 @@ QStringList Theme::getSystemCursorThemes() { return themes; } +void Theme::setThemeBtnStatus() +{ + QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); + for (QAbstractButton * button : mThemeModeBtnGroup->buttons()){ + QVariant valueVariant = button->property("value"); + if ("ukui-black" == currentThemeMode) { + currentThemeMode = "ukui-dark"; + } else if("ukui-white" == currentThemeMode) { + currentThemeMode = "ukui-light"; + } + if (valueVariant.isValid() && valueVariant.toString() == currentThemeMode) { + disconnect(mThemeModeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(themeBtnClickSlot(QAbstractButton*))); + button->click(); + connect(mThemeModeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(themeBtnClickSlot(QAbstractButton*))); + } + } +} + QFrame *Theme::setLine(QFrame *frame) { QFrame *line = new QFrame(frame); @@ -771,14 +880,21 @@ void Theme::setupGSettings() { const QByteArray iiid(PERSONALSIE_SCHEMA); const QByteArray globalID(GLOBAL_SCHEMA); const QByteArray bgID(BG_MATE_SCHEMA); + const QByteArray autoID(AUTO_SCHEMA); + gtkSettings = new QGSettings(id, QByteArray(), this); qtSettings = new QGSettings(idd, QByteArray(), this); curSettings = new QGSettings(iid, QByteArray(), this); personliseGsettings = new QGSettings(iiid, QByteArray(), this); mMateBgSettings = new QGSettings(bgID, QByteArray(), this); + if (QGSettings::isSchemaInstalled(autoID)) { + mAutoSettings = new QGSettings(autoID, QByteArray(), this); + } + if (QGSettings::isSchemaInstalled(globalID)) { mGlobalSettings = new QGSettings(globalID, QByteArray(), this); + connect(mGlobalSettings, &QGSettings::changed, this, &Theme::setCustomGlobalSlot); } } @@ -831,35 +947,57 @@ QString Theme::getGlobalName() void Theme::hideIntelComponent() { ui->resetBtn->setVisible(false); - if (Utils::isTablet()) { + if (Common::isTablet()) { ui->transFrame->setVisible(false); ui->line->setVisible(false); } } +void Theme::clickedCustomTheme() +{ + if (mCustomPicUnit && !mCustomPicUnit->isChecked()) { + disconnect(mThemeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(changeGlobalThemeSlot(QAbstractButton*))); + mCustomPicUnit->setBtnClicked(true); + mThemeBtnGroup->buttonClicked(mCustomPicUnit); + connect(mThemeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(changeGlobalThemeSlot(QAbstractButton*))); + } + + if (mPrePicUnit && mPrePicUnit != mCustomPicUnit) { + mPrePicUnit->setBtnClicked(false); + mPrePicUnit = mCustomPicUnit; + } +} + bool Theme::isBlurEffect() { - QDBusInterface ifc("org.kde.KWin", - "/Effects", - "org.kde.kwin.Effects", - QDBusConnection::sessionBus()); + QDBusInterface ifc(!mIsOpenkylin ? "org.ukui.KWin" : "org.kde.KWin", + "/Effects", + !mIsOpenkylin ? "org.ukui.kwin.Effects" : "org.kde.kwin.Effects", + QDBusConnection::sessionBus()); QStringList effects = ifc.property("activeEffects").toStringList(); return effects.contains("blur"); } +bool Theme::isUpgrade() +{ + version_t ver= kdk_system_get_version_detaile(); + QString version = QString(ver.update_version); + mIsUpgrade = (version != "2209"); +} + QString Theme::dullTranslation(QString str) { if (!QString::compare(str, "basic")){ return tr("basic"); } else if (!QString::compare(str, "classical")) { // 启典 - return Utils::isTablet() ? tr("classic") : tr("Classic"); + return Common::isTablet() ? tr("classic") : tr("Classic"); } else if (!QString::compare(str, "default") || !QString::compare(str, "xunguang")) { // 寻光 - return Utils::isTablet() ? tr("basic") : tr("Light-Seeking"); + return Common::isTablet() ? tr("basic") : tr("Light-Seeking"); } else if (!QString::compare(str, "fashion") || !QString::compare(str, "heyin")) { // 和印 return tr("HeYin"); } else if (!QString::compare(str, "hp")) { return tr("hp"); } else if (!QString::compare(str, "ukui")) { - return tr("ukui"); + return Common::isTablet() ? tr("basic") : tr("ukui"); } else if (!QString::compare(str, "daybreakBlue")) { return tr("daybreakBlue"); } else if (!QString::compare(str, "jamPurple")) { @@ -875,10 +1013,27 @@ QString Theme::dullTranslation(QString str) { } else if (!QString::compare(str, "polarGreen")) { return tr("polarGreen"); } else { - return tr("default"); + return str; } } +QStringList Theme::getSystemIconThemes() +{ + QStringList themes; + QDir themesDir(ICONTHEMEPATH); + + if (themesDir.exists()){ + foreach (QString dirname, themesDir.entryList(QDir::Dirs)){ + if (dirname == "." || dirname == "..") + continue; + QFile iconthemefile(ICONTHEMEPATH + dirname + "/icon-theme.cache"); + if (iconthemefile.exists()) + themes.append(dirname); + } + } + return themes; +} + // 重置设置 void Theme::resetBtnClickSlot() { @@ -912,69 +1067,100 @@ void Theme::writeKwinSettings(bool change, QString theme, bool effect) { if (!change) { kwinSettings->beginGroup("Plugins"); - kwinSettings->setValue("blurEnabled", false); kwinSettings->setValue("kwin4_effect_maximizeEnabled", false); + kwinSettings->setValue("blurEnabled", false); +#ifndef MAVIS kwinSettings->setValue("kwin4_effect_translucencyEnabled", false); +#endif kwinSettings->endGroup(); -#if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0) +#ifdef MAVIS + for (int i = 0; i < effectListMavis.length(); i++) { #else for (int i = 0; i < effectList.length(); i++) { - QDBusMessage message = QDBusMessage::createMethodCall("org.kde.KWin", +#endif + + QDBusMessage message = QDBusMessage::createMethodCall(!mIsOpenkylin ? "org.ukui.KWin" : "org.kde.KWin", "/Effects", - "org.ukui.kde.Effects", + !mIsOpenkylin ? "org.ukui.kwin.Effects" : "org.kde.kwin.Effects", "unloadEffect"); +#ifdef MAVIS + message << effectListMavis.at(i); +#else message << effectList.at(i); +#endif QDBusConnection::sessionBus().send(message); } -#endif } else { kwinSettings->beginGroup("Plugins"); - kwinSettings->setValue("blurEnabled", true); kwinSettings->setValue("kwin4_effect_maximizeEnabled", true); + kwinSettings->setValue("blurEnabled", true); +#ifndef MAVIS kwinSettings->setValue("kwin4_effect_translucencyEnabled", true); +#endif kwinSettings->endGroup(); -#if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0) - +#ifdef MAVIS + for (int i = 0; i < effectListMavis.length(); i++) { #else - // 开启模糊特效: for (int i = 0; i < effectList.length(); i++) { +#endif - QDBusMessage message = QDBusMessage::createMethodCall("org.kde.KWin", + QDBusMessage message = QDBusMessage::createMethodCall(!mIsOpenkylin ? "org.ukui.KWin" : "org.kde.KWin", "/Effects", - "org.kde.kwin.Effects", + !mIsOpenkylin ? "org.ukui.kwin.Effects" : "org.kde.kwin.Effects", "loadEffect"); +#ifdef MAVIS + message << effectListMavis.at(i); +#else message << effectList.at(i); +#endif QDBusConnection::sessionBus().send(message); } -#endif } kwinSettings->sync(); } void Theme::themeBtnClickSlot(QAbstractButton *button) { + QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), + QStringLiteral("/org/kde/KWin/BlendChanges"), + QStringLiteral("org.kde.KWin.BlendChanges"), + QStringLiteral("start")); + msg << 300; + QDBusConnection::sessionBus().send(msg); + // 设置主题 - QString themeMode = button->property("value").toString(); - QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); + QString themeMode = button->property("value").toString(); + QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); + QString tmpMode; + Common::buriedSettings(name(), "set theme mode", QString("settings"), themeMode); - if (QString::compare(currentThemeMode, themeMode)){ - QString tmpMode; - if ("ukui-dark" == themeMode) { - tmpMode = "ukui-black"; + if (QString::compare(currentThemeMode, themeMode)) { + if ("ukui-dark" == themeMode) { + tmpMode = "ukui-black"; + revokeGlobalThemeSlot("getDefaultLightDarkMode", "dark"); + revokeGlobalThemeSlot("getQtDarkThemeName", themeMode); + revokeGlobalThemeSlot("getGtkDarkThemeName", tmpMode); + mAutoSettings->set(COLOR_KEY_AUTO_THEME, false); + } else if ("ukui-light" == themeMode){ + tmpMode = "ukui-white"; + revokeGlobalThemeSlot("getDefaultLightDarkMode", "light"); + revokeGlobalThemeSlot("getQtLightThemeName", themeMode); + revokeGlobalThemeSlot("getGtkLightThemeName", tmpMode); + mAutoSettings->set(COLOR_KEY_AUTO_THEME, false); + } else if ("ukui-default" == themeMode) { + if (mAutoSettings) { + revokeGlobalThemeSlot("getDefaultLightDarkMode", "light"); + revokeGlobalThemeSlot("getQtLightThemeName", themeMode); + revokeGlobalThemeSlot("getGtkLightThemeName", tmpMode); + mAutoSettings->set(COLOR_KEY_AUTO_THEME, true); + return; + } + } - revokeGlobalThemeSlot("getDefaultLightDarkMode", "dark"); - revokeGlobalThemeSlot("getQtDarkThemeName", themeMode); - revokeGlobalThemeSlot("getGtkDarkThemeName", tmpMode); - } else { - tmpMode = "ukui-white"; - revokeGlobalThemeSlot("getDefaultLightDarkMode", "light"); - revokeGlobalThemeSlot("getQtLightThemeName", themeMode); - revokeGlobalThemeSlot("getGtkLightThemeName", tmpMode); - } - gtkSettings->set(MODE_GTK_KEY, tmpMode); - qtSettings->set(MODE_QT_KEY, themeMode); - } + gtkSettings->set(MODE_GTK_KEY, tmpMode); + qtSettings->set(MODE_QT_KEY, themeMode); + } } void Theme::changeGlobalThemeSlot(QAbstractButton *button) @@ -986,15 +1172,16 @@ void Theme::changeGlobalThemeSlot(QAbstractButton *button) theme = globaltheme; } if (!theme) return; + Common::buriedSettings(name(), "set theme", QString("settings"), value.toString()); if (mPrePicUnit != nullptr) mPrePicUnit->setBtnClicked(false); mPrePicUnit = static_cast(button); - bool supportBlur = theme->getSupportBlur(); + bool supportBlur = ui->effectFrame->isVisible(); bool blurEnable = theme->getBlurEnabled(); - bool supportTranspancy = theme->getSupportTransparency(); + bool supportTranspancy = ui->transFrame->isVisible(); int transparency = theme->getTransparencyBlur(); QString globalName = theme->getThemeName(); @@ -1012,6 +1199,9 @@ void Theme::changeGlobalThemeSlot(QAbstractButton *button) } else if (!colorTheme.compare("dark")) { colorTheme = theme->getQtDarkThemeName(); gtkColorTheme = theme->getGtkDarkThemeName(); + } else if (!colorTheme.compare("mixed")) { + colorTheme = theme->getQtMixedThemeName(); + gtkColorTheme = theme->getGtkLightThemeName(); } mMateBgSettings->set(BG_FILE_KEY, wallpaper); @@ -1021,16 +1211,26 @@ void Theme::changeGlobalThemeSlot(QAbstractButton *button) qtSettings->set(ICON_QT_KEY, iconName); qtSettings->set(WIDGET_QT_KEY, widgetName); - qtSettings->set(MODE_QT_KEY, colorTheme); + qtSettings->set(COLOR_QT_KEY, accentColor); gtkSettings->set(ICON_GTK_KEY, iconName); - gtkSettings->set(MODE_GTK_KEY, gtkColorTheme); + if (colorTheme != "ukui-default") { + gtkSettings->set(MODE_GTK_KEY, gtkColorTheme); + qtSettings->set(MODE_QT_KEY, colorTheme); + } + +#ifndef OPENKYLIN curSettings->set(CURSOR_THEME_KEY, cursorName); +#endif + + if (mAutoSettings && value != "custom") { + mAutoSettings->set(COLOR_KEY_AUTO_THEME, false); + } if (supportBlur) { - changeEffectBtnSlot(supportBlur); + changeEffectBtnSlot(blurEnable); } if (supportTranspancy) { @@ -1040,24 +1240,18 @@ void Theme::changeGlobalThemeSlot(QAbstractButton *button) void Theme::revokeGlobalThemeSlot(const QString &funcName, const QString &value) { -#ifdef SP2 + if (mGlobalSettings == nullptr) { + return; + } + if (mGlobalSettings) { mGlobalSettings->set(ISMODIFY_KEY, true); mGlobalSettings->set(GLOBAL_NAME_KEY, "custom"); } - if (mCustomPicUnit && !mCustomPicUnit->isChecked()) { - disconnect(mThemeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(changeGlobalThemeSlot(QAbstractButton*))); - mCustomPicUnit->setBtnClicked(true); - mThemeBtnGroup->buttonClicked(mCustomPicUnit); - connect(mThemeBtnGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(changeGlobalThemeSlot(QAbstractButton*))); - } - if (mPrePicUnit != mCustomPicUnit) { - mPrePicUnit->setBtnClicked(false); - mPrePicUnit = mCustomPicUnit; - } + clickedCustomTheme(); + mGlobalthemehelper->updateCustomThemeSetting(funcName, value); -#endif } void Theme::changeGlobalDirSlot() @@ -1098,7 +1292,6 @@ void Theme::changeGlobalDirSlot() } } }); - } void Theme::changeEffectSlot(bool checked) @@ -1109,22 +1302,25 @@ void Theme::changeEffectSlot(bool checked) personliseGsettings->set(PERSONALSIE_TRAN_KEY, 1.0); qtSettings->set(THEME_TRAN_KEY, 100); qtSettings->set(PEONY_TRAN_KEY, 100); - ui->tranSlider->setValue(100); + changeTranpancySliderSlot(100); } else { save_trans = personliseGsettings->get(PERSONALSIE_SAVE_TRAN_KEY).toInt(); - ui->tranSlider->setValue(save_trans); + changeTranpancySliderSlot(save_trans); } // 提供给外部监听特效接口 personliseGsettings->set(PERSONALSIE_EFFECT_KEY, checked); QString currentThemeMode = qtSettings->get(MODE_QT_KEY).toString(); - ui->transFrame->setVisible(checked && !Utils::isTablet()); - ui->line->setVisible(checked && !Utils::isTablet()); + ui->transFrame->setVisible(checked && !Common::isTablet()); + ui->line->setVisible(checked && !Common::isTablet()); writeKwinSettings(checked, currentThemeMode, true); } void Theme::changeEffectBtnSlot(bool checked) { + effectSwitchBtn->blockSignals(true); effectSwitchBtn->setChecked(checked); + effectSwitchBtn->blockSignals(false); + changeEffectSlot(checked); } void Theme::changeTranpancySlot(int value) @@ -1136,7 +1332,10 @@ void Theme::changeTranpancySlot(int value) void Theme::changeTranpancySliderSlot(int value) { + ui->tranSlider->blockSignals(true); ui->tranSlider->setValue(value); + ui->tranSlider->blockSignals(false); + changeTranpancySlot(value); } void Theme::jumpFunctionSlot(const QString &arg) @@ -1148,6 +1347,7 @@ void Theme::iconThemeBtnClickSlot(QAbstractButton *button) { // 设置图标主题 QVariant valueVariant = button->property("value"); + Common::buriedSettings(name(), "set icon theme", QString("settings"), valueVariant.toString()); qtSettings->set(ICON_QT_KEY, valueVariant); gtkSettings->set(ICON_GTK_KEY, valueVariant); @@ -1158,6 +1358,7 @@ void Theme::cursorThemeBtnClickSlot(QAbstractButton *button) { // 设置光标主题 QVariant valueVariant = button->property("value"); + Common::buriedSettings(name(), "set cursor theme", QString("settings"), valueVariant.toString()); curSettings->set(CURSOR_THEME_KEY, valueVariant); kwinCursorSlot(valueVariant.toString()); revokeGlobalThemeSlot("getCursorThemeName", valueVariant.toString()); @@ -1174,6 +1375,15 @@ void Theme::updateAccentColorSlot(const QString &color) } } +void Theme::setCustomGlobalSlot(const QString &key) +{ + QString value = mGlobalSettings->get(key).toString(); + + if (mCustomPicUnit != nullptr && value == "custom") { + clickedCustomTheme(); + } +} + double Theme::convertToTran(const int value) { switch (value) { case 1: diff --git a/plugins/personalized/theme/theme.h b/plugins/personalized/theme/theme.h index ca3d7a7..5759292 100644 --- a/plugins/personalized/theme/theme.h +++ b/plugins/personalized/theme/theme.h @@ -33,9 +33,11 @@ #include #include -#include "widgets/Uslider/uslider.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/FlowLayout/flowlayout.h" +#include + +#include "uslider.h" +#include "titlelabel.h" +#include "flowlayout.h" #include "shell/interface.h" #include "themewidget.h" @@ -66,24 +68,24 @@ public: private: Ui::Theme *ui; + bool mFirstLoad; QString pluginName; int pluginType; QWidget *pluginWidget; - QGSettings *gtkSettings = nullptr; - QGSettings *qtSettings = nullptr; - QGSettings *curSettings = nullptr; - QGSettings *personliseGsettings = nullptr; - QGSettings *mGlobalSettings = nullptr; + QGSettings *gtkSettings = nullptr; + QGSettings *qtSettings = nullptr; + QGSettings *curSettings = nullptr; + QGSettings *personliseGsettings = nullptr; + QGSettings *mGlobalSettings = nullptr; QGSettings *mMateBgSettings = nullptr; + QGSettings *mAutoSettings = nullptr; - QSettings *kwinSettings; + QSettings *kwinSettings = nullptr; KSwitchButton *effectSwitchBtn; - bool settingsCreate; - WidgetGroup *cursorThemeWidgetGroup; WidgetGroup *iconThemeWidgetGroup; @@ -92,12 +94,12 @@ private: TitleLabel *mJumpLabel; TitleLabel *mThemeModeLabel; TitleLabel *mThemeIconLabel; - TitleLabel *mThemeCursorLabel = nullptr; + TitleLabel *mThemeCursorLabel = nullptr; - ThemeButton *mCustomPicUnit = nullptr; - ThemeButton *mPrePicUnit = nullptr; + ThemeButton *mCustomPicUnit = nullptr; + ThemeButton *mPrePicUnit = nullptr; - GlobalThemeHelper *mGlobalthemehelper; + GlobalThemeHelper *mGlobalthemehelper = nullptr; FlowLayout *mFLyt; QHBoxLayout *mControlHLyt; @@ -146,6 +148,7 @@ public: void initControlTheme(); void initCursorTheme(); void initGlobalTheme(); + QList sortGlobalTheme(const QList &globalThemes); void initJumpTheme(); void initConnection(); void initIconThemeWidget(QString themedir, FlowLayout *fLyt); @@ -155,11 +158,16 @@ public: QString dullTranslation(QString str); + QStringList getSystemIconThemes(); QStringList getSystemCursorThemes(); + void setThemeBtnStatus(); QFrame *setLine(QFrame *frame); QString mGlobalName; + bool mIsUpgrade = false; + + bool mIsOpenkylin = false; private: double convertToTran(const int value); @@ -173,8 +181,10 @@ private: QString getGlobalName(); void hideIntelComponent(); + void clickedCustomTheme(); bool isBlurEffect(); + bool isUpgrade(); private slots: void resetBtnClickSlot(); @@ -191,6 +201,7 @@ private slots: void iconThemeBtnClickSlot(QAbstractButton *button); void cursorThemeBtnClickSlot(QAbstractButton *button); void updateAccentColorSlot(const QString &color); + void setCustomGlobalSlot(const QString &key); }; #endif // THEME_H diff --git a/plugins/personalized/theme/theme.pro b/plugins/personalized/theme/theme.pro index d0d422d..5017da4 100644 --- a/plugins/personalized/theme/theme.pro +++ b/plugins/personalized/theme/theme.pro @@ -4,6 +4,10 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Uslider/uslider.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets KConfigCore KI18n x11extras concurrent dbus @@ -22,7 +26,8 @@ INCLUDEPATH += \ LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt -lX11 -lXfixes -lXcursor PKGCONFIG += gsettings-qt \ - kysdk-qtwidgets + kysdk-qtwidgets \ + kysdk-sysinfo SOURCES += \ cursor/cursortheme.cpp \ diff --git a/plugins/personalized/theme/theme.ui b/plugins/personalized/theme/theme.ui index b6cde23..4745387 100644 --- a/plugins/personalized/theme/theme.ui +++ b/plugins/personalized/theme/theme.ui @@ -514,7 +514,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
MySlider diff --git a/plugins/personalized/theme/themebutton.cpp b/plugins/personalized/theme/themebutton.cpp index 65365e1..f071bfd 100644 --- a/plugins/personalized/theme/themebutton.cpp +++ b/plugins/personalized/theme/themebutton.cpp @@ -47,8 +47,9 @@ void ThemeButton::initUi() enterBtnStyle = getStyle(1, mRadius); leaveBtnStyle = getStyle(0, mRadius); + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); setCheckable(true); - setFixedSize(mWidth, mHeigh); + setFixedWidth(mWidth); QVBoxLayout *baseVerLayout = new QVBoxLayout(this); baseVerLayout->setSpacing(8); baseVerLayout->setMargin(0); @@ -62,9 +63,10 @@ void ThemeButton::initUi() mNameLabel = new QLabel(this); mNameLabel->setText(themename); + mNameLabel->setAlignment(Qt::AlignTop); bottomHorLayout->addStretch(); - bottomHorLayout->setContentsMargins(0, 16, 0, 0); + bottomHorLayout->setContentsMargins(0, 0, 0, 0); bottomHorLayout->addWidget(mNameLabel); bottomHorLayout->addStretch(); @@ -80,7 +82,7 @@ void ThemeButton::setConnect() mIconLabel->setStyleSheet(clickedBtnStyle); }); - connect(this, &ThemeButton::mBtnCheckedSignals, [=](bool status) { + connect(this, &ThemeButton::btnCheckedSignals, [=](bool status) { this->setChecked(status); if (!status) mIconLabel->setStyleSheet(leaveBtnStyle); @@ -113,7 +115,7 @@ void ThemeButton::setRect(QSize size) { mWidth = size.width(); mHeigh = size.height(); - setFixedSize(size); + setFixedWidth(mWidth); mIconLabel->setFixedSize(QSize(mWidth, mHeigh - 32)); } @@ -146,4 +148,9 @@ void ThemeButton::paintEvent(QPaintEvent *event) painter.setPen(Qt::transparent); painter.drawRoundedRect(this->rect(), mRadius, mRadius); + + + if (height() != mIconLabel->height() + 8 + mNameLabel->height()) + this->setFixedHeight(mIconLabel->height() + 8 + mNameLabel->height()); + } diff --git a/plugins/personalized/theme/themebutton.h b/plugins/personalized/theme/themebutton.h index bd97c2b..e873bfa 100644 --- a/plugins/personalized/theme/themebutton.h +++ b/plugins/personalized/theme/themebutton.h @@ -40,7 +40,7 @@ private: QString leaveBtnStyle; Q_SIGNALS: - void mBtnCheckedSignals(bool status); + void btnCheckedSignals(bool status); }; #endif // THEMEBUTTON_H diff --git a/plugins/personalized/theme/themewidget.h b/plugins/personalized/theme/themewidget.h index c4b6895..aa66bb2 100644 --- a/plugins/personalized/theme/themewidget.h +++ b/plugins/personalized/theme/themewidget.h @@ -27,7 +27,7 @@ #include #include #include -#include "widgets/Label/fixlabel.h" +#include "fixlabel.h" #define THEME_QT_SCHEMA "org.ukui.style" diff --git a/plugins/personalized/wallpaper/colordialog.cpp b/plugins/personalized/wallpaper/colordialog.cpp index b822120..1e078ca 100644 --- a/plugins/personalized/wallpaper/colordialog.cpp +++ b/plugins/personalized/wallpaper/colordialog.cpp @@ -20,8 +20,8 @@ #include "colordialog.h" #include "ui_colordialog.h" #include "colorsquare.h" -#include "widgets/MaskWidget/maskwidget.h" -#include "widgets/CloseButton/closebutton.h" +#include "maskwidget.h" +#include "closebutton.h" #include extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); @@ -176,18 +176,10 @@ void ColorDialog::setupInit() sliderBlue->setOrientation(Qt::Horizontal); // CloseBtn + ui->closeBtn->setProperty("isWindowButton", 0x02); + ui->closeBtn->setProperty("useIconHighlightEffect", 0x08); + ui->closeBtn->setFlat(true); ui->closeBtn->setIcon(QIcon::fromTheme("window-close-symbolic")); -// ui->closeBtn->setProperty("useIconHighlightEffect", true); -// ui->closeBtn->setProperty("iconHighlightEffectMode", 1); - //取消按钮默认主题灰色背景 - QPalette palette = ui->closeBtn->palette(); - QColor ColorPlaceholderText(255,255,255,0); - QBrush brush; - brush.setColor(ColorPlaceholderText); - palette.setBrush(QPalette::Button, brush); - palette.setBrush(QPalette::ButtonText, brush); - //palette.setColor(QPalette::Highlight, Qt::transparent); /* 取消按钮高亮 */ - ui->closeBtn->setPalette(palette); // 绘制滑动条 drawSlider(); @@ -196,7 +188,7 @@ void ColorDialog::setupInit() void ColorDialog::signalsBind() { qDebug() << "signals bind"; - connect(ui->closeBtn, &CloseButton::clicked, [=](bool checked){ + connect(ui->closeBtn, &QPushButton::clicked, [=](bool checked){ Q_UNUSED(checked) close(); }); diff --git a/plugins/personalized/wallpaper/colordialog.ui b/plugins/personalized/wallpaper/colordialog.ui index b8d862d..2a40fee 100644 --- a/plugins/personalized/wallpaper/colordialog.ui +++ b/plugins/personalized/wallpaper/colordialog.ui @@ -88,7 +88,7 @@
- + 32 @@ -436,11 +436,6 @@ QSpinBox::up-button,QSpinBox::down-button - - CloseButton - QPushButton -
../../../libukcc/widgets/CloseButton/closebutton.h
-
ColorPreview QWidget diff --git a/plugins/personalized/wallpaper/pictureunit.cpp b/plugins/personalized/wallpaper/pictureunit.cpp index 81304c2..71d33f9 100644 --- a/plugins/personalized/wallpaper/pictureunit.cpp +++ b/plugins/personalized/wallpaper/pictureunit.cpp @@ -19,11 +19,12 @@ */ #include "pictureunit.h" #include -#include "widgets/MaskWidget/maskwidget.h" +#include "maskwidget.h" #include #include -PictureUnit::PictureUnit() +PictureUnit::PictureUnit(QWidget *parent) + : QLabel(parent) { _filename = ""; diff --git a/plugins/personalized/wallpaper/pictureunit.h b/plugins/personalized/wallpaper/pictureunit.h index 7b56be6..53b3695 100644 --- a/plugins/personalized/wallpaper/pictureunit.h +++ b/plugins/personalized/wallpaper/pictureunit.h @@ -29,7 +29,7 @@ class PictureUnit : public QLabel Q_OBJECT public: - explicit PictureUnit(); + explicit PictureUnit(QWidget *parent = nullptr); ~PictureUnit(); public: diff --git a/plugins/personalized/wallpaper/wallpaper.cpp b/plugins/personalized/wallpaper/wallpaper.cpp index a977a61..3b09a1a 100644 --- a/plugins/personalized/wallpaper/wallpaper.cpp +++ b/plugins/personalized/wallpaper/wallpaper.cpp @@ -20,7 +20,7 @@ #include "wallpaper.h" #include "ui_wallpaper.h" #include "pictureunit.h" -#include "widgets/MaskWidget/maskwidget.h" +#include "maskwidget.h" #include #include @@ -29,7 +29,8 @@ #include #include #include -#include "widgets/AddBtn/addbtn.h" +#include "addbtn.h" +#include "common.h" const QString kylinUrl = "https://www.ubuntukylin.com/wallpaper.html"; @@ -40,7 +41,7 @@ enum{ }; -#define DEFAULT_BACKGROUND "/usr/share/backgrounds/1-openkylin.jpg" +#define DEFAULT_BACKGROUND "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg" #define ITEMWIDTH 182 #define ITEMHEIGH 126 @@ -58,17 +59,21 @@ Wallpaper::Wallpaper() : mFirstLoad(true), prePicUnit = nullptr; pObject = nullptr; pThread = nullptr; - } Wallpaper::~Wallpaper() { if (pObject) { pObject->setExit(true); + delete pObject; + pObject = nullptr; } if (pThread) { + pThread->terminate(); pThread->quit(); // 退出事件循环 pThread->wait(); // 释放资源 + delete pThread; + pThread = nullptr; } if (!mFirstLoad) { delete ui; @@ -94,7 +99,7 @@ QWidget *Wallpaper::pluginUi() { pluginWidget = new QWidget; pluginWidget->setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(pluginWidget); - + initCenterUi(); settingsCreate = false; initSearchText(); // 初始化控件 @@ -113,12 +118,12 @@ QWidget *Wallpaper::pluginUi() { } // 构建xmlhandle对象 xmlhandleObj = new XmlHandle(); - if (isIntel()) { + if (Common::isTablet()) { settingForIntel(); } } else { - ui->picFrame->resize(ui->picFrame->size() - QSize(1,1)); - ui->picFrame->resize(ui->picFrame->size() + QSize(1,1)); + picFrame->resize(picFrame->size() - QSize(1,1)); + picFrame->resize(picFrame->size() + QSize(1,1)); } return pluginWidget; } @@ -144,7 +149,8 @@ bool Wallpaper::isEnable() const } void Wallpaper::initSearchText() { - ui->selectLabel->setText(tr("Background")); + //~ contents_path /Wallpaper/Desktop Background + tr("Desktop Background"); //~ contents_path /Wallpaper/Browse ui->browserLocalwpBtn->setText(tr("Browse")); //~ contents_path /Wallpaper/Online Picture @@ -153,12 +159,9 @@ void Wallpaper::initSearchText() { ui->onlineBtn->setContentsMargins(0,0,0,0); ui->onlineBtn->setCursor( QCursor(Qt::PointingHandCursor)); ui->onlineBtn->setStyleSheet("QPushButton{background: transparent;border-radius: 4px;text-decoration: underline;} "); - connect( ui->onlineBtn, &QPushButton::clicked, this,[=] { - QDBusInterface ifc("com.kylin.AppManager", - "/com/kylin/AppManager", - "com.kylin.AppManager", - QDBusConnection::sessionBus()); - ifc.call("LaunchDefaultAppWithUrl", "https://www.ubuntukylin.com/wallpaper.html"); + connect(ui->onlineBtn, &QPushButton::clicked, this,[=] { + QDesktopServices::openUrl(QUrl(QLatin1String("https://www.ubuntukylin.com/wallpaper.html"))); + Common::buriedSettings(name(), QString("onlineBtn"), QString("clicked")); }); //~ contents_path /Wallpaper/Reset To Default ui->resetBtn->setText(tr("Reset To Default")); @@ -177,34 +180,32 @@ void Wallpaper::setupComponent(){ // 背景形式 QStringList formList; formList << tr("picture") << tr("color")/* << tr("slideshow")*/ ; - ui->formComBox->addItem(formList.at(0), PICTURE); - ui->formComBox->addItem(formList.at(1), COLOR); + formWidget->comboBox()->addItem(formList.at(0), PICTURE); + formWidget->comboBox()->addItem(formList.at(1), COLOR); // 图片背景 - ui->picFrame->adjustSize(); - picFlowLayout = new FlowLayout(ui->picFrame,16, -1, -1); - ui->picFrame->setLayout(picFlowLayout); + picFlowLayout = new FlowLayout(picFrame,16, -1, -1); + picFrame->setLayout(picFlowLayout); // 纯色背景 - colorFlowLayout = new FlowLayout(ui->colorListWidget,16, -1, -1); - ui->colorListWidget->setLayout(colorFlowLayout); + colorFlowLayout = new FlowLayout(colorFrame,16, -1, -1); + colorFrame->setLayout(colorFlowLayout); // 背景放置方式 QStringList optionList; optionList << tr("scaled") << tr("wallpaper") << tr("centered") << tr("stretched") << tr("zoom") << tr("spanned"); - ui->showModeComboBox->addItem(optionList.at(0), "scaled"); - ui->showModeComboBox->addItem(optionList.at(1), "wallpaper"); - ui->showModeComboBox->addItem(optionList.at(2), "centered"); - ui->showModeComboBox->addItem(optionList.at(3), "stretched"); - ui->showModeComboBox->addItem(optionList.at(4), "zoom"); - ui->showModeComboBox->addItem(optionList.at(5), "spanned"); - - AddBtn *addBtn = new AddBtn(); - ui->horizontalLayout_7->addWidget(addBtn); + showModeWidget->comboBox()->addItem(optionList.at(0), "scaled"); + showModeWidget->comboBox()->addItem(optionList.at(1), "wallpaper"); + showModeWidget->comboBox()->addItem(optionList.at(2), "centered"); + showModeWidget->comboBox()->addItem(optionList.at(3), "stretched"); +#ifndef MAVIS + showModeWidget->comboBox()->addItem(optionList.at(4), "zoom"); + showModeWidget->comboBox()->addItem(optionList.at(5), "spanned"); +#endif // 打开自定义颜色面板 - connect(addBtn, &AddBtn::clicked,[=](){ + connect(colorAddButton, &AddBtn::clicked,[=](){ colordialog = new ColorDialog(pluginWidget); connect(colordialog,&ColorDialog::colorSelected,this,&Wallpaper::colorSelectedSlot); colordialog->exec(); @@ -215,57 +216,43 @@ void Wallpaper::setupConnect(){ //使用线程构建本地壁纸文件;获取壁纸压缩QPixmap pThread = new QThread; pObject = new WorkerObject; - connect(pObject, &WorkerObject::pixmapGenerate, this, [=](QPixmap pixmap, QString filename){ - PictureUnit * picUnit = new PictureUnit; - picUnit->setPixmap(pixmap); - picUnit->setFilenameText(filename); - if (initBackgroundFilename == filename) { - if (prePicUnit != nullptr) { - prePicUnit->changeClickedFlag(false); - prePicUnit->setStyleSheet("border-width: 0px;"); - } - picUnit->changeClickedFlag(true); - prePicUnit = picUnit; - picUnit->setFrameShape(QFrame::Box); - picUnit->setStyleSheet(picUnit->clickedStyleSheet); + + connect(pObject, &WorkerObject::readWallPaper_data, this, [=](QStringList filenameList) { + for (int i = 0; i < filenameList.size(); i++) { + QString filename = filenameList.at(i); + QString filanemaTemp = filename; + filanemaTemp.replace("/","-"); + QString loadFilename = LOCAL_WALLPAPER_PATH + QString::number(i) + filanemaTemp; + QPixmap pixmap; + pixmap.load(loadFilename); + createPictureUnit(pixmap, filename); } + }); - connect(picUnit, &PictureUnit::clicked, [=](QString fn){ - if(prePicUnit != nullptr) - { - prePicUnit->changeClickedFlag(false); - prePicUnit->setStyleSheet("border-width: 0px;"); - } - picUnit->changeClickedFlag(true); - prePicUnit = picUnit; - picUnit->setFrameShape(QFrame::Box); - picUnit->setStyleSheet(picUnit->clickedStyleSheet); - bgsettings->set(FILENAME, fn); - setLockBackground(""); - ui->previewStackedWidget->setCurrentIndex(PICTURE); - }); - - picFlowLayout->addWidget(picUnit); - picNum++; + connect(pObject, &WorkerObject::pixmapGenerate, this, [=](QPixmap pixmap, QString filename){ + createPictureUnit(pixmap, filename); }); connect(pObject, &WorkerObject::workComplete, this, [=](QMap> wpInfoMaps){ wallpaperinfosMap = wpInfoMaps; - pThread->quit(); //退出事件循环 - pThread->wait(); //释放资源 }); pObject->moveToThread(pThread); connect(pThread, &QThread::started, pObject, &WorkerObject::run); - connect(pThread, &QThread::finished, this, [=](){ - - + connect(pThread, &QThread::finished, pObject, [=](){ + pThread->quit(); //退出事件循环 + pThread->wait(); //释放资源 + if (pThread) { + delete pThread; + pThread = nullptr; + } + if (pObject) { + delete pObject; + pObject = nullptr; + } }); - connect(pThread, &QThread::finished, pObject, &WorkerObject::deleteLater); - pThread->start(); - connect(ui->browserLocalwpBtn, &QPushButton::clicked, [=]{ showLocalWpDialog(); }); @@ -279,15 +266,15 @@ void Wallpaper::setupConnect(){ colors << "#ff8c00" << "#e81123" << "#d13438" << "#c30052" << "#bf0077" << "#9a0089" << "#881798" << "#744da9" << "#8764b8" << "#e9e9e9"; for (QString color : colors){ - QPushButton * button = new QPushButton(ui->colorListWidget); + QPushButton * button = new QPushButton(colorFrame); button->setFixedSize(QSize(48, 48)); QString btnQss = QString("QPushButton{background: %1; border: none; border-radius: 4px;}").arg(color); button->setStyleSheet(btnQss); - connect(button, &QPushButton::clicked, [=]{ + connect(button, &QPushButton::clicked, [=] { QString widgetQss = QString("QWidget{background: %1; border-radius: 6px;}").arg(color); ui->previewWidget->setStyleSheet(widgetQss); - + changeGlobalTheme(); // 设置系统纯色背景 bgsettings->set(FILENAME, ""); bgsettings->set(PRIMARY, QVariant(color)); @@ -300,42 +287,44 @@ void Wallpaper::setupConnect(){ } #if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0) - connect(ui->formComBox, static_cast(&QComboBox::currentIndexChanged), [=](int index){ + connect(formWidget->comboBox(), static_cast(&QComboBox::currentIndexChanged), [=](int index){ #else - connect(ui->formComBox, QOverload::of(&QComboBox::currentIndexChanged), [=](int index){ + connect(formWidget->comboBox(), QOverload::of(&QComboBox::currentIndexChanged), [=](int index){ #endif Q_UNUSED(index) //切换 - int currentPage = ui->formComBox->currentData(Qt::UserRole).toInt(); + int currentPage = formWidget->comboBox()->currentData(Qt::UserRole).toInt(); if (currentPage == PICTURE) { - ui->colorFrame->setHidden(true); - ui->picFrame->setHidden(false); + colorGroup->setHidden(true); + picFrame->setHidden(false); ui->bottomWidget->setHidden(false); + Common::buriedSettings(name(), QString("formComBox"), QString("select"), QString("picture")); } else if (currentPage == COLOR){ - ui->picFrame->setHidden(true); - ui->colorFrame->setHidden(false); + picFrame->setHidden(true); + colorGroup->setHidden(false); ui->bottomWidget->setHidden(true); + Common::buriedSettings(name(), QString("formComBox"), QString("select"), QString("color")); } }); - connect(bgsettings, &QGSettings::changed, [=](QString key){ + connect(bgsettings, &QGSettings::changed, [=](QString key) { + QString curPicname = bgsettings->get(key).toString(); initBgFormStatus(true); - if (key != "pictureOptions" && ui->formComBox->currentIndex() == PICTURE) { + if (key != "pictureOptions" && formWidget->comboBox()->currentIndex() == PICTURE) { QString filename = bgsettings->get(FILENAME).toString(); setClickedPic(filename); } if (key == "pictureOptions") { QString option = bgsettings->get(OPTIONS).toString(); - int index = ui->showModeComboBox->findData(option); - ui->showModeComboBox->blockSignals(true); - ui->showModeComboBox->setCurrentIndex(index); - ui->showModeComboBox->blockSignals(false); + int index = showModeWidget->comboBox()->findData(option); + showModeWidget->comboBox()->blockSignals(true); + showModeWidget->comboBox()->setCurrentIndex(index); + showModeWidget->comboBox()->blockSignals(false); ui->previewLabel->setMode(option); ui->previewLabel->update(); } //GSettings key picture-filename 这里收到 pictureFilename的返回值 - if (!QString::compare(key, "pictureFilename")){ - QString curPicname = bgsettings->get(key).toString(); + if (!QString::compare(key, "pictureFilename")) { if (curPicname == "") { if (prePicUnit != nullptr) { prePicUnit->changeClickedFlag(false); @@ -372,16 +361,16 @@ void Wallpaper::initBgFormStatus(bool gsettingChange){ int currentIndex = _getCurrentBgForm(); //设置当前背景形式 - ui->formComBox->blockSignals(true); - ui->formComBox->setCurrentIndex(currentIndex); - ui->formComBox->blockSignals(false); - if (ui->formComBox->currentIndex() == PICTURE) { - ui->colorFrame->setHidden(true); - ui->picFrame->setHidden(false); + formWidget->comboBox()->blockSignals(true); + formWidget->comboBox()->setCurrentIndex(currentIndex); + formWidget->comboBox()->blockSignals(false); + if (formWidget->comboBox()->currentIndex() == PICTURE) { + colorGroup->setHidden(true); + picFrame->setHidden(false); ui->bottomWidget->setHidden(false); - } else if (ui->formComBox->currentIndex() == COLOR){ - ui->picFrame->setHidden(true); - ui->colorFrame->setHidden(false); + } else if (formWidget->comboBox()->currentIndex() == COLOR){ + picFrame->setHidden(true); + colorGroup->setHidden(false); ui->bottomWidget->setHidden(true); } @@ -404,18 +393,19 @@ void Wallpaper::setLockBackground(QString bg) { void Wallpaper::initBgOption() { QString option = bgsettings->get(OPTIONS).toString(); - int index = ui->showModeComboBox->findData(option); - ui->showModeComboBox->setCurrentIndex(index); + int index = showModeWidget->comboBox()->findData(option); + showModeWidget->comboBox()->setCurrentIndex(index); ui->previewLabel->setMode(option); ui->previewLabel->update(); - connect(ui->showModeComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { - bgsettings->set(OPTIONS, ui->showModeComboBox->itemData(index).toString()); + connect(showModeWidget->comboBox(), QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + bgsettings->set(OPTIONS, showModeWidget->comboBox()->itemData(index).toString()); + Common::buriedSettings(name(), QString("showModeComboBox"), QString("select"), showModeWidget->comboBox()->itemData(index).toString()); }); } void Wallpaper::hideComponent() { - ui->onlineBtn->setHidden(Utils::isZJY()); + ui->onlineBtn->setHidden(Common::isZJY()); } void Wallpaper::initPreviewStatus(bool gsettingChange){ @@ -430,7 +420,7 @@ void Wallpaper::initPreviewStatus(bool gsettingChange){ initBackgroundFilename = bgsettings->get(FILENAME).toString(); } - if (!QFile::exists(initBackgroundFilename) || initBackgroundFilename == "/usr/share/backgrounds/openkylin.jpg") { + if (!QFile::exists(initBackgroundFilename) || initBackgroundFilename == "/usr/share/backgrounds/ubuntukylin-default-settings.jpg") { initBackgroundFilename = DEFAULT_BACKGROUND; } @@ -501,6 +491,7 @@ void Wallpaper::resetDefaultWallpaperSlot(){ bgsettings->set(FILENAME, QVariant(QString(dwp))); setClickedPic(QString(dwp)); + Common::buriedSettings(name(), QString("resetBtn"), QString("clicked")); } void Wallpaper::showLocalWpDialog(){ @@ -576,6 +567,7 @@ void Wallpaper::showLocalWpDialog(){ prePicUnit->changeClickedFlag(false); prePicUnit->setStyleSheet("border-width: 0px;"); } + Common::buriedSettings(name(), QString("browserLocalwpBtn"), QString("clicked")); } void Wallpaper::add_custom_wallpaper(){ @@ -638,11 +630,9 @@ void Wallpaper::setClickedPic(QString fileName) { } } - void Wallpaper::settingForIntel() { - ui->selectLabel->setVisible(false); - ui->formComBox->setVisible(false); + formWidget->setVisible(false); ui->onlineBtn->setVisible(false); ui->resetBtn->setFixedHeight(48);; ui->browserLocalwpBtn->setFixedHeight(48); @@ -689,4 +679,77 @@ void Wallpaper::initAccountDbus() qCritical() << QString("Create %1 Client Interface Failed").arg(userPath) << QDBusConnection::systemBus().lastError(); return; } + } + +void Wallpaper::createPictureUnit(QPixmap pixmap, QString filename) +{ + PictureUnit * picUnit = new PictureUnit(this->pluginWidget); + picUnit->setPixmap(pixmap); + picUnit->setFilenameText(filename); + if (initBackgroundFilename == filename) { + if (prePicUnit != nullptr) { + prePicUnit->changeClickedFlag(false); + prePicUnit->setStyleSheet("border-width: 0px;"); + } + picUnit->changeClickedFlag(true); + prePicUnit = picUnit; + picUnit->setFrameShape(QFrame::Box); + picUnit->setStyleSheet(picUnit->clickedStyleSheet); + } + + connect(picUnit, &PictureUnit::clicked, [=](QString fn){ + if (prePicUnit != picUnit && prePicUnit != nullptr) { + changeGlobalTheme(); + prePicUnit->changeClickedFlag(false); + prePicUnit->setStyleSheet("border-width: 0px;"); + } + picUnit->changeClickedFlag(true); + prePicUnit = picUnit; + picUnit->setFrameShape(QFrame::Box); + picUnit->setStyleSheet(picUnit->clickedStyleSheet); + bgsettings->set(FILENAME, fn); + setLockBackground(""); + ui->previewStackedWidget->setCurrentIndex(PICTURE); + Common::buriedSettings(name(), QString("picUnit"), QString("clicked"), fn); + }); + + picFlowLayout->addWidget(picUnit); + picNum++; +} + +void Wallpaper::changeGlobalTheme() +{ + if (QGSettings::isSchemaInstalled(QByteArray("org.ukui.globaltheme.settings"))) { + QGSettings globalTheme("org.ukui.globaltheme.settings"); + globalTheme.set("global-theme-name", "custom"); + } +} + +void Wallpaper::initCenterUi() +{ + centerGroup = new SettingGroup(this->pluginWidget); + formWidget = new ComboxWidget(tr("Background"), centerGroup); + showModeWidget = new ComboxWidget(tr("Mode"), centerGroup); + colorGroup = new SettingGroup(centerGroup); + addbuttonFrame = new UkccFrame(colorGroup); + addbuttonlayout = new QHBoxLayout(addbuttonFrame); + colorAddButton = new AddButton(addbuttonFrame); + colorFrame = new UkccFrame(colorGroup); + picFrame = new UkccFrame(centerGroup); + + addbuttonlayout -> setMargin(0); + formWidget -> setTitleFixedWidth(172); + showModeWidget -> setTitleFixedWidth(172); + ui->centerLayout -> addWidget(centerGroup); + centerGroup -> addWidget(formWidget); + centerGroup -> addWidget(showModeWidget); + centerGroup -> addWidget(colorGroup); + centerGroup -> addWidget(picFrame); + colorGroup -> addWidget(colorFrame); + colorGroup -> addWidget(addbuttonFrame); + addbuttonlayout -> addWidget(colorAddButton); + picFrame -> setLineWidth(0); +} + + diff --git a/plugins/personalized/wallpaper/wallpaper.h b/plugins/personalized/wallpaper/wallpaper.h index 8324596..c4b540d 100644 --- a/plugins/personalized/wallpaper/wallpaper.h +++ b/plugins/personalized/wallpaper/wallpaper.h @@ -34,16 +34,19 @@ #include #include "shell/interface.h" -#include "widgets/FlowLayout/flowlayout.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/ImageUtil/imageutil.h" +#include "flowlayout.h" +#include "hoverwidget.h" +#include "imageutil.h" #include "xmlhandle.h" #include "component/custdomitemmodel.h" #include "simplethread.h" #include "workerobject.h" #include "colordialog.h" #include "pictureunit.h" -#include "../../../shell/utils/utils.h" +#include "common.h" +#include "settinggroup.h" +#include "comboxwidget.h" +#include "addbutton.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 **/ @@ -55,17 +58,11 @@ #include #define BACKGROUND "org.mate.background" - -// 图片文件路径 -#define FILENAME "picture-filename" -// 图片不透明度 -#define OPACITY "picture-opacity" -// 图片放置方式 -#define OPTIONS "picture-options" -// 主色 -#define PRIMARY "primary-color" -// 副色 -#define SECONDARY "secondary-color" +#define FILENAME "picture-filename" // 图片文件路径 +#define OPACITY "picture-opacity" // 图片不透明度 +#define OPTIONS "picture-options" // 图片放置方式 +#define PRIMARY "primary-color" // 主色 +#define SECONDARY "secondary-color" // 副色 const QString ScaledKey = "scaled"; // 填充 const QString WallpaperKey = "wallpaper"; // 平铺 @@ -110,10 +107,14 @@ public: void setClickedPic(QString fileName); void initAccountDbus(); + void initCenterUi(); + private: void setLockBackground(QString bg); void initBgOption(); // 背景放置方式 void hideComponent(); + void createPictureUnit(QPixmap pixmap, QString filename); + void changeGlobalTheme(); private: Ui::Wallpaper *ui; @@ -141,12 +142,11 @@ private: QDBusInterface *readBackgroundBus; QString initBackgroundFilename; QDBusInterface *useriFace; - //尝试mode view void setModeldata(); private: - QThread * pThread; - WorkerObject * pObject; + QThread * pThread = nullptr; + WorkerObject * pObject = nullptr; QMap picWpItemMap; @@ -160,6 +160,18 @@ public slots: void add_custom_wallpaper(); void del_wallpaper(); + +private: + SettingGroup *centerGroup = nullptr; + ComboxWidget *formWidget = nullptr; + ComboxWidget *showModeWidget = nullptr; + SettingGroup *colorGroup = nullptr; + UkccFrame *addbuttonFrame = nullptr; + QHBoxLayout *addbuttonlayout = nullptr; + AddButton *colorAddButton = nullptr; + UkccFrame *colorFrame = nullptr; + UkccFrame *picFrame = nullptr; + }; #endif // WALLPAPER_H diff --git a/plugins/personalized/wallpaper/wallpaper.pro b/plugins/personalized/wallpaper/wallpaper.pro index cc591b2..85c1726 100644 --- a/plugins/personalized/wallpaper/wallpaper.pro +++ b/plugins/personalized/wallpaper/wallpaper.pro @@ -4,6 +4,15 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/MaskWidget/maskwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets xml dbus @@ -26,11 +35,11 @@ CONFIG += link_pkgconfig \ PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ gsettings-qt \ + kysdk-qtwidgets \ #DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ - ../../../shell/utils/utils.cpp \ colordialog.cpp \ colorpreview.cpp \ colorsquare.cpp \ @@ -44,7 +53,6 @@ SOURCES += \ workerobject.cpp HEADERS += \ - ../../../shell/utils/utils.h \ colordialog.h \ colorpreview.h \ colorsquare.h \ diff --git a/plugins/personalized/wallpaper/wallpaper.ui b/plugins/personalized/wallpaper/wallpaper.ui index 0ea9b58..6d5ef7f 100644 --- a/plugins/personalized/wallpaper/wallpaper.ui +++ b/plugins/personalized/wallpaper/wallpaper.ui @@ -122,7 +122,7 @@ QFrame::Box
- 1 + 0 @@ -264,237 +264,11 @@ - - - - 0 - 0 - - - - QFrame::Box - - - QFrame::Raised - - + + 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 8 - - - 16 - - - 16 - - - - - - 0 - 0 - - - - - 180 - 60 - - - - - 180 - 60 - - - - Background - - - - - - - - 144 - 0 - - - - - 16777215 - 16777215 - - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - 16 - - - 16 - - - - - - 180 - 60 - - - - - 180 - 60 - - - - Mode - - - - - - - - 144 - 0 - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - 0 - - - 0 - - - - - - - - + @@ -524,13 +298,13 @@ 110 - 36 + 0 110 - 36 + 16777215 @@ -563,13 +337,13 @@ 120 - 36 + 0 16777215 - 36 + 16777215 @@ -600,7 +374,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
PictureLabel diff --git a/plugins/personalized/wallpaper/workerobject.cpp b/plugins/personalized/wallpaper/workerobject.cpp index 1eb6063..2daf0f8 100644 --- a/plugins/personalized/wallpaper/workerobject.cpp +++ b/plugins/personalized/wallpaper/workerobject.cpp @@ -22,12 +22,16 @@ #include "xmlhandle.h" #include #include +#include +#include + WorkerObject::WorkerObject() { //自定义结构提,线程传递时无法放入列表,注册解决 qRegisterMetaType>>("QMap>"); exitFlag = false; + filenameList.clear(); } WorkerObject::~WorkerObject() @@ -45,7 +49,7 @@ void WorkerObject::run(){ //获取壁纸数据 wallpaperinfosMap = xmlHandleObj->requireXmlData(); - + QByteArray allData = ""; //压缩壁纸 QSize IMAGE_SIZE(166, 110); QMap >::iterator iters = wallpaperinfosMap.begin(); @@ -64,13 +68,75 @@ void WorkerObject::run(){ continue; QString filename = QString(iters.key()); - QPixmap pixmap = QPixmap(filename).scaled(IMAGE_SIZE); - - emit pixmapGenerate(pixmap, filename); + QFile file(filename); + if(file.open(QIODevice::ReadOnly)) {//打开文件(只读 + QByteArray content = file.readAll(); + allData += content; + file.close(); + } + filenameList.append(filename); + } + QByteArray hashDataWrite = QCryptographicHash::hash(allData, QCryptographicHash::Md5); + QFile hashFile; + hashFile.setFileName(LOCAL_WALLPAPER_HASH_PATH); + if (hashFile.open(QIODevice::ReadOnly)) { + QByteArray hashDataRead = hashFile.readAll(); + hashFile.close(); + if (hashDataRead.compare(hashDataWrite) == 0) { //和已保存的一样 + QDir dir(LOCAL_WALLPAPER_PATH); + QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Dirs); + if ((fileInfoList.size() - 1) == filenameList.size()) { //文件数量也一致 + emit readWallPaper_data(filenameList); + return; + } + } } + //未保存正确的缩略壁纸,先创建pixmap发送到wallpaper进行显示 + for (QString filename : filenameList) { + if (exitFlag) { + return; + } + QPixmap pixmap = QPixmap(filename).scaled(IMAGE_SIZE); + emit pixmapGenerate(pixmap, filename); + } emit workComplete(wallpaperinfosMap); + //保存正确的缩略壁纸 + QDir dir; + dir.setPath(LOCAL_WALLPAPER_PATH); + if (dir.exists()) { + dir.removeRecursively(); + qDebug()<<"removeRecursively:"< #include "xmlhandle.h" +#include +#include + +#define LOCAL_USR_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +#define LOCAL_APP_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ + %QStringLiteral("/ukui-control-center/") +#define LOCAL_WALLPAPER_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ + %QStringLiteral("/ukui-control-center/wallpaperData/") +#define LOCAL_WALLPAPER_HASH_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ + %QStringLiteral("/ukui-control-center/wallpaperData/HASH") + + class WorkerObject : public QObject { @@ -41,12 +53,13 @@ private: XmlHandle * xmlHandleObj; QMap > wallpaperinfosMap; + QStringList filenameList; bool exitFlag; Q_SIGNALS: void pixmapGenerate(QPixmap pixmap, QString filename); void workComplete(QMap> wpInfoMaps); - + void readWallPaper_data(QStringList filenameList); }; #endif // WORKEROBJECT_H diff --git a/plugins/plugins.pro b/plugins/plugins.pro index 34754b6..21c98b9 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -6,12 +6,9 @@ TEMPLATE = subdirs SUBDIRS = devices/printer \ devices/mouse \ system/about \ - system/power \ personalized/wallpaper \ personalized/theme \ personalized/screenlock \ - network/vpn \ - network/proxy \ time-language/datetime \ time-language/area @@ -39,3 +36,7 @@ SUBDIRS += system/display \ system/backup_intel \ account/userinfo_intel \ } + +if(contains(DEFINES, UKCC_ENABLE_GRUB)){ +SUBDIRS += currency/boot \ +} diff --git a/plugins/security-updates/backup/backup.cpp b/plugins/security-updates/backup/backup.cpp index dbd3dd0..6bb4c43 100644 --- a/plugins/security-updates/backup/backup.cpp +++ b/plugins/security-updates/backup/backup.cpp @@ -24,7 +24,7 @@ #include #include -#include "../../../shell/utils/utils.h" +#include "common.h" #include const QString kDesktopfp = "/usr/share/applications/yhkylin-backup-tools.desktop"; @@ -40,7 +40,7 @@ extern "C" { Backup::Backup() : mFirstLoad(true) { - pluginName = tr("Backup"); + pluginName = tr("Backup Restore"); pluginType = UPDATE; } @@ -108,6 +108,7 @@ void Backup::initUi(QWidget *widget) mBackLayout->setContentsMargins(16, 0, 16, 0); mBackLayout->setSpacing(48); mBackBtn = new FixButton(widget); + mBackBtn->setObjectName("backup"); mBackBtn->setFixedWidth(120); FixLabel *mBackLabel_1 = new FixLabel(tr("Backup") , mBackFrame); mBackLabel_1->setContentsMargins(0 , 12 , 0 , 0); @@ -131,6 +132,7 @@ void Backup::initUi(QWidget *widget) mRestoreLayout->setContentsMargins(16, 0, 16, 0); mRestoreLayout->setSpacing(48); mRestoreBtn = new FixButton(widget); + mRestoreBtn->setObjectName("restore"); mRestoreBtn->setFixedWidth(120); FixLabel *mRestoreLabel_1 = new FixLabel(tr("Restore") , mRestoreFrame); mRestoreLabel_1->setContentsMargins(0 , 12 , 0 , 0); @@ -162,7 +164,7 @@ void Backup::initTitleLabel() void Backup::initConnection() { - if (Utils::isCommunity()) { + if (Common::isCommunity()) { connect(mBackBtn, &QPushButton::clicked, this, [=](bool checked){ Q_UNUSED(checked) communitySlot(); @@ -187,6 +189,7 @@ void Backup::initConnection() void Backup::btnClickedSlot() { + Common::buriedSettings(name(), "open the backup restore application", QString("clicked")); QString desktopfp = "/usr/share/applications/yhkylin-backup-tools.desktop"; GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data()); g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr); @@ -195,6 +198,7 @@ void Backup::btnClickedSlot() void Backup::restoreSlot() { + Common::buriedSettings(name(), "open the backup restore application", QString("clicked")); QString desktopfp = "/usr/share/applications/yhkylin-backup-tools.desktop"; GDesktopAppInfo *desktopAppInfo = g_desktop_app_info_new_from_filename(desktopfp.toLocal8Bit().data()); @@ -206,6 +210,7 @@ void Backup::restoreSlot() void Backup::communitySlot() { + Common::buriedSettings(name(), "open the backup restore application", QString("clicked")); QString cmd = "/usr/bin/deja-dup"; QProcess process(this); process.startDetached(cmd); diff --git a/plugins/security-updates/backup/backup.h b/plugins/security-updates/backup/backup.h index 59e298d..fb02be0 100644 --- a/plugins/security-updates/backup/backup.h +++ b/plugins/security-updates/backup/backup.h @@ -24,10 +24,10 @@ #include #include "shell/interface.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/Label/fixlabel.h" -#include "widgets/Button/fixbutton.h" -#include "widgets/Label/lightlabel.h" +#include "titlelabel.h" +#include "fixlabel.h" +#include "fixbutton.h" +#include "lightlabel.h" namespace Ui { class Backup; diff --git a/plugins/security-updates/backup/backup.pro b/plugins/security-updates/backup/backup.pro index ca1f281..2eaf2a3 100644 --- a/plugins/security-updates/backup/backup.pro +++ b/plugins/security-updates/backup/backup.pro @@ -4,6 +4,9 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Button/button.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets @@ -24,7 +27,8 @@ CONFIG += link_pkgconfig \ PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ gsettings-qt \ - kysdk-sysinfo + kysdk-sysinfo \ + kysdk-qtwidgets \ diff --git a/plugins/system/about/about.cpp b/plugins/system/about/about.cpp index e2a1fe5..4f57a3d 100644 --- a/plugins/system/about/about.cpp +++ b/plugins/system/about/about.cpp @@ -35,7 +35,8 @@ #include #include #include -#include +#include +#include #ifdef Q_OS_LINUX #include @@ -49,9 +50,11 @@ #include #include #include +#include const QString kAboutFile = "/usr/share/applications/kylin-user-guide.desktop"; const QString kHPFile = "/usr/share/applications/hp-document.desktop"; +QStringList mIpList; About::About() : mFirstLoad(true) { @@ -93,6 +96,7 @@ QWidget *About::pluginUi() initSearchText(); initActiveDbus(); + setConnect(); setupVersionCompenent(); setVersionNumCompenent(); setupDesktopComponent(); @@ -173,279 +177,143 @@ void About::initUI(QWidget *widget) AboutLayout->setSpacing(8); mTitleLabel = new TitleLabel(Aboutwidget); - AboutLayout->addWidget(mTitleLabel); + mTitleLabel->setText(tr("System Summary")); + mPriTitleLabel = new TitleLabel(Aboutwidget); + mPriTitleLabel->setText(tr("Privacy and agreement")); + mHoldTitleLabel = new TitleLabel(Aboutwidget); + mHoldTitleLabel->setText(tr("Support")); mInformationFrame = new QFrame(Aboutwidget); setFrame_Box(mInformationFrame); QVBoxLayout *mInformationLayout = new QVBoxLayout(mInformationFrame); - int space = Utils::isTablet() ? 32 : 16; + int space = Common::isTablet() ? 32 : 16; mInformationLayout->setContentsMargins(space, space, space, space); + /* LOGO */ mLogoLabel = new FixLabel(mInformationFrame); mLogoLabel->setFixedSize(130, 50); - mInformationLayout->addWidget(mLogoLabel); - mInformationLayout->addSpacing(24); - /* 版本名称 */ - mVersionFrame = new QFrame(mInformationFrame); - mVersionFrame->installEventFilter(this); - setFrame_NoFrame(mVersionFrame); - - QHBoxLayout *mVersionLayout = new QHBoxLayout(mVersionFrame); - mVersionLayout->setContentsMargins(0, 0, 16, 0); - - mVersionLabel_1 = new FixLabel(mVersionFrame); - mVersionLabel_1->setFixedSize(120,30); - - mVersionLabel_2 = new LightLabel(mVersionFrame); - mVersionLabel_2->setFixedHeight(30); - - mVersionLayout->addWidget(mVersionLabel_1); - mVersionLayout->addSpacing(40); - mVersionLayout->addWidget(mVersionLabel_2, Qt::AlignLeft); - - mInformationLayout->addWidget(mVersionFrame); + mVersionLabel_1 = new FixLabel(tr("Version")); + mVersionLabel_2 = new LightLabel; + mVersionFrame = createFrame(mVersionLabel_1, mVersionLabel_2); /* 版本号 */ - mVersionNumberFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mVersionNumberFrame); - - QHBoxLayout *mVersionNumberLayout = new QHBoxLayout(mVersionNumberFrame); - mVersionNumberLayout->setContentsMargins(0, 0, 16, 0); - - mVersionNumberLabel_1 = new FixLabel(tr("Version Number") , mVersionNumberFrame); - mVersionNumberLabel_1->setFixedSize(120,30); - - mVersionNumberLabel_2 = new LightLabel(mVersionNumberFrame); - mVersionNumberLabel_2->setFixedHeight(30); - - mVersionNumberLayout->addWidget(mVersionNumberLabel_1); - mVersionNumberLayout->addSpacing(40); - mVersionNumberLayout->addWidget(mVersionNumberLabel_2, Qt::AlignLeft); - - mInformationLayout->addWidget(mVersionNumberFrame); - - /* 内部版本 */ - mInterVersionFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mInterVersionFrame); - - QHBoxLayout *mInterVersionLayout = new QHBoxLayout(mInterVersionFrame); - mInterVersionLayout->setContentsMargins(0, 0, 16, 0); - - mInterVersionLabel_1 = new FixLabel(tr("InterVersion") , mInterVersionFrame); - mInterVersionLabel_1->setFixedSize(120,30); - - mInterVersionLabel_2 = new LightLabel(mInterVersionFrame); - mInterVersionLabel_2->setFixedHeight(30); - - mInterVersionLayout->addWidget(mInterVersionLabel_1); - mInterVersionLayout->addSpacing(40); - mInterVersionLayout->addWidget(mInterVersionLabel_2, Qt::AlignLeft); - - mInformationLayout->addWidget(mInterVersionFrame); - - /* Intel版本号 */ - mVersionNumFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mVersionNumFrame); - - QHBoxLayout *mVersionNumLayout = new QHBoxLayout(mVersionNumFrame); - mVersionNumLayout->setContentsMargins(0, 0, 16, 0); - - mVersionNumLabel_1 = new FixLabel(mVersionNumFrame); - mVersionNumLabel_1->setFixedSize(120,30); - - mVersionNumLabel_2 = new LightLabel(mVersionNumFrame); - mVersionNumLabel_2->setFixedHeight(30); - - mVersionNumLayout->addWidget(mVersionNumLabel_1); - mVersionNumLayout->addSpacing(40); - mVersionNumLayout->addWidget(mVersionNumLabel_2, Qt::AlignLeft); - - mInformationLayout->addWidget(mVersionNumFrame); + mVersionNumberLabel_1 = new FixLabel(tr("Version Number")); + mVersionNumberLabel_2 = new LightLabel; + mVersionNumberFrame = createFrame(mVersionNumberLabel_1, mVersionNumberLabel_2); /* 系统补丁版本号 */ - mPatchVersionFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mPatchVersionFrame); - - QHBoxLayout *mPatchLayout = new QHBoxLayout(mPatchVersionFrame); - mPatchLayout->setContentsMargins(0, 0, 16, 0); - - mPatchVersionLabel_1 = new FixLabel(tr("Patch Version"), mPatchVersionFrame); - mPatchVersionLabel_1->setFixedSize(120,30); - - mPatchVersionLabel_2 = new LightLabel(mPatchVersionFrame); - mPatchVersionLabel_2->setFixedHeight(30); - - mPatchLayout->addWidget(mPatchVersionLabel_1); - mPatchLayout->addSpacing(40); - mPatchLayout->addWidget(mPatchVersionLabel_2, Qt::AlignLeft); - - mInformationLayout->addWidget(mPatchVersionFrame); + mPatchVersionLabel_1 = new FixLabel(tr("Patch Version")); + mPatchVersionLabel_2 = new LightLabel; + mPatchVersionFrame = createFrame(mPatchVersionLabel_1, mPatchVersionLabel_2); /* 主机名 */ - mHostNameFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mHostNameFrame); - - QHBoxLayout *mHostNameLayout = new QHBoxLayout(mHostNameFrame); - mHostNameLayout->setContentsMargins(0, 0, 16, 0); - - QHBoxLayout *mHostNameLayout_1 = new QHBoxLayout(); - mHostNameLayout_1->setContentsMargins(0, 0, 0, 0); - - mHostNameLabel_1 = new FixLabel(tr("HostName") , mHostNameFrame); - mHostNameLabel_1->setFixedSize(120,30); - - mHostNameLabel_2 = new LightLabel(mHostNameFrame ); - mHostNameLabel_2->setFixedHeight(30); - - mHostNameLabel_3 = new LightLabel(mHostNameFrame); + mHostNameLabel_1 = new FixLabel(tr("HostName")); + mHostNameLabel_2 = new LightLabel; + mHostNameLabel_3 = new LightLabel; mHostNameLabel_3->setFixedSize(16, 16); mHostNameLabel_3->setProperty("useIconHighlightEffect", 0x8); mHostNameLabel_3->setPixmap(QIcon::fromTheme("document-edit-symbolic").pixmap(mHostNameLabel_3->size())); mHostNameLabel_3->setScaledContents(true); - mHostNameLabel_2->installEventFilter(this); mHostNameLabel_3->installEventFilter(this); + mHostNameFrame = createFrame(mHostNameLabel_1, mHostNameLabel_2, mHostNameLabel_3); - mHostNameLayout_1->setSpacing(4); - mHostNameLayout_1->addWidget(mHostNameLabel_2); - mHostNameLayout_1->addWidget(mHostNameLabel_3); + /* 内核 */ + mKernelLabel_1 = new FixLabel(tr("Kernel")); + mKernelLabel_2 = new LightLabel; + mKernelFrame = createFrame(mKernelLabel_1, mKernelLabel_2); - mHostNameLayout->addWidget(mHostNameLabel_1); - mHostNameLayout->addSpacing(40); - mHostNameLayout->addLayout(mHostNameLayout_1); - mHostNameLayout->addStretch(); + /* CPU */ + mCpuLabel_1 = new FixLabel(tr("CPU")); + mCpuLabel_2 = new LightLabel; + mCpuFrame = createFrame(mCpuLabel_1, mCpuLabel_2); + /* 内存 */ + mMemoryLabel_1 = new FixLabel(tr("Memory")); + mMemoryLabel_2 = new LightLabel; + mMemoryFrame = createFrame(mMemoryLabel_1, mMemoryLabel_2); + + /* 硬盘 */ + mDiskLabel_1 = new FixLabel(tr("Disk")); + mDiskLabel_2 = new LightLabel; + mDiskFrame = createFrame(mDiskLabel_1, mDiskLabel_2); + + /* 桌面 */ + mDesktopLabel_1 = new FixLabel(tr("Desktop")); + mDesktopLabel_2 = new LightLabel; + mDesktopFrame = createFrame(mDesktopLabel_1, mDesktopLabel_2); + + /* 用户名 */ + mUsernameLabel_1 = new FixLabel(tr("User")); + mUsernameLabel_2 = new LightLabel; + mUsernameFrame = createFrame(mUsernameLabel_1, mUsernameLabel_2); + + /* 激活信息 */ + mActivationFrame = initActiveUi(); + + /* 版权所有 */ + QString currentYear("2022"); + mTipLabel = new FixLabel(QString(tr("Copyright © 2009-%1 %2. All rights reserved.")).arg(currentYear).arg(mCopyRightName), Aboutwidget); + mTipLabel->setContentsMargins(16, 0, 0, 0); + + /* 隐私和协议 */ + mPrivacyFrame = initPrivacyUi(); + + /* 授权信息和隐私协议弹窗 */ + mBtnFrame = initInfoBtnUi(); + + /* Intel手册 */ + mHoldWidget = initHoldUi(); + + item = new QSpacerItem(10 ,32); + mInformationLayout->addWidget(mLogoLabel); + mInformationLayout->addSpacing(24); + mInformationLayout->addWidget(mVersionFrame); + mInformationLayout->addWidget(mVersionNumberFrame); + mInformationLayout->addWidget(mPatchVersionFrame); mInformationLayout->addWidget(mHostNameFrame); - - mKernelFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mKernelFrame); - - QHBoxLayout *mKernerLayout = new QHBoxLayout(mKernelFrame); - mKernerLayout->setContentsMargins(0, 0, 16, 0); - - mKernelLabel_1 = new FixLabel(mKernelFrame); - mKernelLabel_1->setFixedSize(120,30); - - mKernelLabel_2 = new LightLabel(mKernelFrame); - mKernelLabel_2->setFixedHeight(30); - - mKernerLayout->addWidget(mKernelLabel_1); - mKernerLayout->addSpacing(40); - mKernerLayout->addWidget(mKernelLabel_2, Qt::AlignLeft); - mInformationLayout->addWidget(mKernelFrame); - - mCpuFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mCpuFrame); - - QHBoxLayout *mCpuLayout = new QHBoxLayout(mCpuFrame); - mCpuLayout->setContentsMargins(0, 0, 16, 0); - - mCpuLabel_1 = new FixLabel(mCpuFrame); - mCpuLabel_1->setFixedSize(120,30); - - mCpuLabel_2 = new LightLabel(mCpuFrame); - mCpuLabel_2->setFixedHeight(30); - - mCpuLayout->addWidget(mCpuLabel_1); - mCpuLayout->addSpacing(40); - mCpuLayout->addWidget(mCpuLabel_2, Qt::AlignLeft); - mInformationLayout->addWidget(mCpuFrame); - - mMemoryFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mMemoryFrame); - - QHBoxLayout *mMemoryLayout = new QHBoxLayout(mMemoryFrame); - mMemoryLayout->setContentsMargins(0, 0, 16, 0); - - mMemoryLabel_1 = new FixLabel(mMemoryFrame); - mMemoryLabel_1->setFixedSize(120,30); - - mMemoryLabel_2 = new LightLabel(mMemoryFrame); - mMemoryLabel_2->setFixedHeight(30); - - mMemoryLayout->addWidget(mMemoryLabel_1); - mMemoryLayout->addSpacing(40); - mMemoryLayout->addWidget(mMemoryLabel_2, Qt::AlignLeft); - mInformationLayout->addWidget(mMemoryFrame); - - mDiskFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mDiskFrame); - - mDiskLayout = new QHBoxLayout(mDiskFrame); - mDiskLayout->setContentsMargins(0, 0, 16, 0); - - mDiskLabel_1 = new FixLabel(mDiskFrame); - mDiskLabel_1->setFixedSize(120,30); - - mDiskLabel_2 = new LightLabel(mDiskFrame); - mDiskLabel_2->setFixedHeight(30); - - mDiskLayout->addWidget(mDiskLabel_1); - mDiskLayout->addSpacing(40); - mDiskLayout->addWidget(mDiskLabel_2, Qt::AlignLeft); - mInformationLayout->addWidget(mDiskFrame); - - mDesktopFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mDesktopFrame); - - QHBoxLayout *mDesktopLayout = new QHBoxLayout(mDesktopFrame); - mDesktopLayout->setContentsMargins(0, 0, 16, 0); - - mDesktopLabel_1 = new FixLabel(mDesktopFrame); - mDesktopLabel_1->setFixedSize(120,30); - - mDesktopLabel_2 = new LightLabel(mDesktopFrame); - mDesktopLabel_2->setFixedHeight(30); - - mDesktopLayout->addWidget(mDesktopLabel_1); - mDesktopLayout->addSpacing(40); - mDesktopLayout->addWidget(mDesktopLabel_2, Qt::AlignLeft); - mInformationLayout->addWidget(mDesktopFrame); - - mUsernameFrame = new QFrame(mInformationFrame); - setFrame_NoFrame(mUsernameFrame); - - QHBoxLayout *mUsernameLayout = new QHBoxLayout(mUsernameFrame); - mUsernameLayout->setContentsMargins(0, 0, 16, 0); - - mUsernameLabel_1 = new FixLabel(mUsernameFrame); - mUsernameLabel_1->setFixedSize(120,30); - - mUsernameLabel_2 = new LightLabel(mUsernameFrame); - mUsernameLabel_2->setFixedHeight(30); - - mUsernameLayout->addWidget(mUsernameLabel_1); - mUsernameLayout->addSpacing(40); - mUsernameLayout->addWidget(mUsernameLabel_2, Qt::AlignLeft); - mInformationLayout->addWidget(mUsernameFrame); - mPriTitleLabel = new TitleLabel(Aboutwidget); - mPriTitleLabel->setText(tr("Privacy and agreement")); + AboutLayout->addWidget(mTitleLabel); + AboutLayout->addWidget(mInformationFrame); + AboutLayout->addWidget(mActivationFrame); + AboutLayout->addWidget(mTipLabel); + AboutLayout->addSpacerItem(item); + AboutLayout->addWidget(mPriTitleLabel); + AboutLayout->addWidget(mPrivacyFrame); + AboutLayout->addSpacing(0); + AboutLayout->addWidget(mBtnFrame); + AboutLayout->addWidget(mHoldTitleLabel); + AboutLayout->addWidget(mHoldWidget); - mPrivacyFrame = new QFrame(Aboutwidget); - setFrame_Box(mPrivacyFrame); + mverticalLayout->addWidget(Aboutwidget); + mverticalLayout->addStretch(); +} - QHBoxLayout *mPrivacyLayout = new QHBoxLayout(mPrivacyFrame); +QFrame *About::initPrivacyUi() +{ + QFrame *frame = new QFrame; + setFrame_Box(frame); + + QHBoxLayout *mPrivacyLayout = new QHBoxLayout(frame); mPrivacyLayout->setContentsMargins(16, 16, 16, 16); mPrivacyLayout->setSpacing(48); - mPriBtn = new KSwitchButton(mPrivacyFrame); + mPriBtn = new KSwitchButton(frame); + mPriBtn->setObjectName("privacysettings"); - FixLabel *mPriLabel_1 = new FixLabel(tr("Send optional diagnostic data"), mPrivacyFrame); -// mPriLabel_1->setContentsMargins(0 , , 0 , 0); - LightLabel *mPriLabel_2 = new LightLabel(tr("By sending us diagnostic data, improve the system experience and solve your problems faster"), mPrivacyFrame); -// mPriLabel_2->setContentsMargins(0 , 0 , 0 , 12); + FixLabel *mPriLabel_1 = new FixLabel(tr("Send optional diagnostic data")); + LightLabel *mPriLabel_2 = new LightLabel(tr("By sending us diagnostic data, improve the system experience and solve your problems faster")); QVBoxLayout *mverticalLayout_2 = new QVBoxLayout; mverticalLayout_2->setSpacing(0); - mverticalLayout_2->setContentsMargins(0 , 0 , 0 , 0); + mverticalLayout_2->setContentsMargins(0, 0, 0, 0); mverticalLayout_2->addWidget(mPriLabel_1); mverticalLayout_2->addWidget(mPriLabel_2 ); @@ -453,29 +321,36 @@ void About::initUI(QWidget *widget) mPrivacyLayout->addStretch(); mPrivacyLayout->addWidget(mPriBtn); - mActivationFrame = new QFrame(Aboutwidget); - setFrame_Box(mActivationFrame); + return frame; +} - QHBoxLayout *mActivationLayout_1 = new QHBoxLayout(mActivationFrame); +QFrame *About::initActiveUi() +{ + QFrame *frame = new QFrame; + setFrame_Box(frame); + + QHBoxLayout *mActivationLayout_1 = new QHBoxLayout(frame); mActivationLayout_1->setContentsMargins(16, 16, 16, 16); mActivationLayout_1->setSpacing(8); QGridLayout *mActivationLayout = new QGridLayout(); mActivationLayout->setVerticalSpacing(8); - mStatusLabel_1 = new FixLabel(mActivationFrame); - mStatusLabel_1->setFixedSize(160,30); - mStatusLabel_2 = new LightLabel(mActivationFrame); - mSequenceLabel_1 = new FixLabel(mActivationFrame); - mSequenceLabel_1->setFixedSize(160,30); - mSequenceLabel_2 = new FixLabel(mActivationFrame); + mStatusLabel_1 = new FixLabel; + mStatusLabel_1->setFixedSize(160, 30); + mStatusLabel_2 = new LightLabel; + mSequenceLabel_1 = new FixLabel; + mSequenceLabel_1->setFixedSize(160, 30); + mSequenceLabel_2 = new FixLabel; + mSequenceLabel_2->setObjectName("sequence"); mSequenceLabel_2->installEventFilter(this); - mTimeLabel_1 = new FixLabel(mActivationFrame); - mTimeLabel_1->setFixedSize(160,30); - mTimeLabel_2 = new FixLabel(mActivationFrame); - mActivationBtn = new QPushButton(mActivationFrame); + mTimeLabel_1 = new FixLabel; + mTimeLabel_1->setFixedSize(160, 30); + mTimeLabel_2 = new FixLabel; + mActivationBtn = new QPushButton; + mActivationBtn->setObjectName("acivation"); - mActivationBtn->setFixedSize(120,40); + mActivationBtn->setFixedWidth(120); mActivationLayout->addWidget(mStatusLabel_1, 0, 0, 1, 1); mActivationLayout->addWidget(mStatusLabel_2, 0, 1, 1, 3,Qt::AlignLeft); @@ -489,116 +364,59 @@ void About::initUI(QWidget *widget) mActivationLayout_1->addLayout(mActivationLayout); mActivationLayout_1->addWidget(mActivationBtn); - QString currentyear("2022"); - mTipLabel = new FixLabel(QString(tr("Copyright © 2009-%1 KylinSoft. All rights reserved.")).arg(currentyear) , Aboutwidget); - mTipLabel->setContentsMargins(16 , 0 , 0 , 0); + return frame; +} - mBtnFrame = new QFrame(Aboutwidget); - mBtnFrame->setMinimumSize(QSize(550, 0)); - mBtnFrame->setMaximumSize(QSize(16777215, 16777215)); - mBtnFrame->setFrameShape(QFrame::NoFrame); +QFrame *About::initInfoBtnUi() +{ + QFrame *frame = new QFrame; + setFrame_NoFrame(frame); - QHBoxLayout *mBtnLyt = new QHBoxLayout(mBtnFrame); + QHBoxLayout *mBtnLyt = new QHBoxLayout(frame); mBtnLyt->setContentsMargins(16, 0, 0, 0); - mTrialLabel = new FixLabel(tr("<>") , mBtnFrame); - mAndLabel = new FixLabel(tr("and") , mBtnFrame); - mAgreeLabel = new FixLabel(tr("<>") , mBtnFrame); - mTrialLabel->setStyleSheet("background: transparent;color:#2FB3E8;border-width:1px;" - "text-decoration:underline;border-style:none none none;"); - mAgreeLabel->setStyleSheet("background: transparent;color:#2FB3E8;border-width:1px;" - "text-decoration:underline;border-style:none none none;"); - mTrialLabel->installEventFilter(this); - mAgreeLabel->installEventFilter(this); - mBtnLyt->addWidget(mTrialLabel); + mTrialBtn = new KBorderlessButton(tr("<>")); + mAndLabel = new FixLabel(tr("and")); + mAgreeBtn = new KBorderlessButton(tr("<>")); + mTrialBtn->setStyleSheet("text-decoration:underline"); + mAgreeBtn->setStyleSheet("text-decoration:underline"); + + mBtnLyt->addWidget(mTrialBtn); mBtnLyt->addWidget(mAndLabel); - mBtnLyt->addWidget(mAgreeLabel); + mBtnLyt->addWidget(mAgreeBtn); mBtnLyt->addStretch(); - mHoldTitleLabel = new TitleLabel(Aboutwidget); + return frame; +} - mHoldWidget = new QFrame(Aboutwidget); - mHoldWidget->setMinimumSize(QSize(550, 120)); - mHoldWidget->setMaximumSize(QSize(16777215, 120)); - mHoldWidget->setFrameShape(QFrame::Box); +QFrame *About::initHoldUi() +{ + QFrame *frame = new QFrame; + frame->setMinimumSize(QSize(550, 120)); + frame->setMaximumSize(QSize(16777215, 120)); + frame->setFrameShape(QFrame::Box); - QHBoxLayout *mHoldLayout = new QHBoxLayout(mHoldWidget); + QHBoxLayout *mHoldLayout = new QHBoxLayout(frame); mHoldLayout->setSpacing(8); mHoldLayout->setContentsMargins(16, 0, 8, 0); - mQrCodeWidget = new QWidget(mHoldWidget); + mQrCodeWidget = new QWidget; mQrCodeWidget->setFixedSize(104, 104); QHBoxLayout *qrhLyt = new QHBoxLayout(mQrCodeWidget); qrhLyt->setContentsMargins(0, 4, 0, 0); - mHpLabel = new QLabel(mHoldWidget); - mEducateIconLabel = new FixLabel(mHoldWidget); + mHpLabel = new QLabel; + mEducateLabel = new QLabel; + mEducateIconLabel = new FixLabel; mEducateIconLabel->setFixedSize(96,96); - mEducateLabel = new QLabel(mHoldWidget); mHpLabel->setWordWrap(true); mEducateLabel->setWordWrap(true); - - mHpBtn = new QPushButton(mHoldWidget); - mEducateBtn = new QPushButton(mHoldWidget); - - QVBoxLayout *Lyt_1 = new QVBoxLayout(); - Lyt_1->setContentsMargins(0, 8, 0, 8); - Lyt_1->setSpacing(4); - Lyt_1->addStretch(); - Lyt_1->addWidget(mHpLabel); - Lyt_1->addWidget(mHpBtn); - Lyt_1->addStretch(); - - QVBoxLayout *Lyt_2 = new QVBoxLayout(); - Lyt_2->setContentsMargins(0, 8, 0, 8); - Lyt_2->setSpacing(4); - Lyt_2->addStretch(); - Lyt_2->addWidget(mEducateLabel); - Lyt_2->addWidget(mEducateBtn); - Lyt_2->addStretch(); - - mHoldLayout->addWidget(mQrCodeWidget); - mHoldLayout->addLayout(Lyt_1); - mHoldLayout->addSpacing(16); - mHoldLayout->addStretch(1); - mHoldLayout->addWidget(mEducateIconLabel); - mHoldLayout->addLayout(Lyt_2); - mHoldLayout->addStretch(1); - - AboutLayout->addWidget(mInformationFrame); - AboutLayout->addWidget(mActivationFrame); - AboutLayout->addWidget(mTipLabel); - item = new QSpacerItem(10 , 32); - AboutLayout->addSpacerItem(item); -// AboutLayout->addSpacing(32); - AboutLayout->addWidget(mPriTitleLabel); - AboutLayout->addWidget(mPrivacyFrame); - AboutLayout->addSpacing(0); - AboutLayout->addWidget(mBtnFrame); - AboutLayout->addWidget(mHoldTitleLabel); - AboutLayout->addWidget(mHoldWidget); - - mverticalLayout->addWidget(Aboutwidget); - mverticalLayout->addStretch(); - - retranslateUi(); -} - -/* 初始化各文本内容 */ -void About::retranslateUi() -{ - mTitleLabel->setText(tr("System Summary")); - mHoldTitleLabel->setText(tr("Support")); - mVersionNumLabel_1->setText(tr("Version Number")); - mDiskLabel_1->setText(tr("Disk")); - mHpLabel->setText(tr("Wechat code scanning obtains HP professional technical support")); mEducateLabel->setText(tr("See more about Kylin Tianqi edu platform")); -// mTrialLabel->setText(tr("<>")); + mHpBtn = new QPushButton; + mEducateBtn = new QPushButton; - - //Intel部分 #ifdef WIN32 QPluginLoader loader("../HpQRCodePlugin/hp-qrcode-plugind.dll"); #else @@ -617,18 +435,65 @@ void About::retranslateUi() mHpBtn->setText(tr("Learn more HP user manual>>")); mHpBtn->setStyleSheet("background: transparent;color:#2FB3E8;font-family:Microsoft YaHei;" "border-width:1px;text-decoration:underline;border-style:none none none;border-color:#2FB3E8;text-align: left"); - connect(mHpBtn,&QPushButton::clicked,this,[=](){ - openIntelSlot(kHPFile); - }); -// mEducateIconLabel->setPixmap(QPixmap(":/help-app.png").scaled(mEducateIconLabel->size(), Qt::KeepAspectRatio)); mEducateIconLabel->setPixmap(loadSvg(":/help-app.svg", mEducateIconLabel->size().width(), mEducateIconLabel->size().height())); mEducateBtn->setText(tr("See user manual>>")); mEducateBtn->setStyleSheet("background: transparent;color:#2FB3E8;font-size;font-family:Microsoft YaHei;" "border-width:1px;text-decoration:underline;border-style:none none none;border-color:#2FB3E8;text-align: left"); - connect(mEducateBtn, &QPushButton::clicked, this, [=]{ - openIntelSlot(kAboutFile); - }); + + QVBoxLayout *hpLayout = new QVBoxLayout(); + hpLayout->setContentsMargins(0, 8, 0, 8); + hpLayout->setSpacing(4); + hpLayout->addStretch(); + hpLayout->addWidget(mHpLabel); + hpLayout->addWidget(mHpBtn); + hpLayout->addStretch(); + + QVBoxLayout *eduLayout = new QVBoxLayout(); + eduLayout->setContentsMargins(0, 8, 0, 8); + eduLayout->setSpacing(4); + eduLayout->addStretch(); + eduLayout->addWidget(mEducateLabel); + eduLayout->addWidget(mEducateBtn); + eduLayout->addStretch(); + + mHoldLayout->addWidget(mQrCodeWidget); + mHoldLayout->addLayout(hpLayout); + mHoldLayout->addSpacing(16); + mHoldLayout->addStretch(1); + mHoldLayout->addWidget(mEducateIconLabel); + mHoldLayout->addLayout(eduLayout); + mHoldLayout->addStretch(1); + + return frame; + +} + +QFrame *About::createFrame(FixLabel *label_1, LightLabel *label_2, LightLabel *label_3) +{ + QFrame *frame = new QFrame; + frame->installEventFilter(this); + setFrame_NoFrame(frame); + + QHBoxLayout *layout = new QHBoxLayout(frame); + layout->setContentsMargins(0, 0, 16, 0); + + label_1->setFixedSize(120,30); + + label_2->setTextInteractionFlags(Qt::TextSelectableByMouse); + label_2->setFixedHeight(30); + + layout->addWidget(label_1); + layout->addSpacing(40); + if (label_3) { + layout->addWidget(label_2); + layout->addWidget(label_3); + layout->addStretch(); + } else { + layout->addWidget(label_2, Qt::AlignLeft); + } + + return frame; } /* 添加搜索索引 */ @@ -665,6 +530,40 @@ void About::initActiveDbus() } } +void About::initCopyRightName() +{ +#ifdef OPENKYLIN + mCopyRightName = tr("Openkylin"); +#else + mCopyRightName = tr("KylinSoft"); +#endif +} + +void About::setConnect() +{ + connect(mHpBtn,&QPushButton::clicked,this,[=](){ + openIntelSlot(kHPFile); + }); + + connect(mEducateBtn, &QPushButton::clicked, this, [=]{ + openIntelSlot(kAboutFile); + }); + + connect(mActivationBtn, &QPushButton::clicked, this, &About::runActiveWindow); + + connect(mTrialBtn, &KBorderlessButton::clicked, this, [=]() { + Common::buriedSettings(name(), "show trial exemption agreement", QString("clicked")); + TrialDialog *mDialog = new TrialDialog(pluginWidget); + mDialog->exec(); + }); + + connect(mAgreeBtn, &KBorderlessButton::clicked, this, [=]() { + Common::buriedSettings(name(), "show user privacy agreement", QString("clicked")); + PrivacyDialog *mDialog = new PrivacyDialog(pluginWidget); + mDialog->exec(); + }); +} + /* 获取激活信息 */ void About::setupSerialComponent() { @@ -723,48 +622,21 @@ void About::setupSerialComponent() activestatus = false; } else { //已激活 mActivationBtn->hide(); - mTrialLabel->hide(); + mTrialBtn->hide(); mAndLabel->hide(); mStatusLabel_2->setStyleSheet(""); mStatusLabel_2->setText(tr("Activated")); mTimeLabel_2->setText(dateRes); - mActivationBtn->setText(tr("Extend")); + mActivationBtn->setText(tr("Extend")); } - connect(mActivationBtn, &QPushButton::clicked, this, &About::runActiveWindow); } /* 获取内部版本号 */ void About::setVersionNumCompenent() { - mInterVersionFrame->hide(); - QDBusInterface upgradeDBus("com.kylin.systemupgrade", - "/com/kylin/systemupgrade", - "com.kylin.systemupgrade.interface", - QDBusConnection::systemBus()); - if (!upgradeDBus.isValid()) { - mPatchVersionFrame->hide(); - mVersionNumberFrame->hide(); - return; - } - - QDBusMessage result = upgradeDBus.call("GetSystemUpdateVersion"); - QString str_1 = result.arguments().value(1).toString(); - QString str_2 = result.arguments().value(0).toString(); - qDebug()<hide(); - else - mPatchVersionLabel_2->setText(str_1.replace("\"","").replace(QRegExp("[\\s]+"), " ")); - - if (str_2.isEmpty()) - mVersionNumberFrame->hide(); - else - mVersionNumberLabel_2->setText(str_2.replace("\"","").replace(QRegExp("[\\s]+"), " ")); - -// char* str = kdk_system_get_version(1); -// mPatchVersionLabel_2->setText(QString(str)); + version_t ver= kdk_system_get_version_detaile(); + mVersionNumberLabel_2->setText(ver.os_version); + mPatchVersionLabel_2->setText(QString(ver.update_version)); } /* 获取logo图片和版本名称 */ @@ -840,7 +712,7 @@ void About::setupVersionCompenent() } } else { mActivationFrame->setVisible(false); - mTrialLabel->setVisible(false); + mTrialBtn->setVisible(false); mAndLabel->setVisible(false); mLogoLabel->setPixmap(loadSvg("://img/plugins/about/logoukui.svg", 130, 50)); mThemePixmap = loadSvg("://img/plugins/about/logoukui.svg", 130, 50); @@ -891,7 +763,7 @@ void About::setupKernelCompenent() if (memoryDbus->isValid()) { QDBusReply result = memoryDbus->call("getMemory"); qDebug()<<"memory :"<setText(kernal); mMemoryLabel_2->setText(memorySize); - cpuType = Utils::getCpuInfo(); + cpuType = Common::getCpuInfo(); mCpuLabel_2->setText(cpuType); } @@ -929,7 +801,7 @@ void About::setupDiskCompenet() } } QProcess process_2; - process_2.start("df -l "); + process_2.start("df -Tl "); process_2.waitForFinished(); QString diskSize2 = process_2.readAllStandardOutput(); double availSize=0; @@ -942,8 +814,10 @@ void About::setupDiskCompenet() continue; diskResult.replace(QRegExp("[\\s]+"), " "); diskInfo2 = diskResult.split(" "); + if(diskInfo2.at(1).contains("overlay")) + continue; if(diskInfo2.at(0).contains(iter.key())){ - availSize += diskInfo2.at(3).toInt(); + availSize += diskInfo2.at(4).toInt(); } } QString diskAvailable = QString::number((availSize/1024/1024), 'f', 1) + "G"; @@ -979,10 +853,7 @@ void About::setupDiskCompenet() /* 获取系统版本 */ void About::setupSystemVersion() { - QString sysVersion = "/etc/apt/ota_version"; - QFile file(sysVersion); - if (!Utils::isTablet()) { - mVersionNumFrame->hide(); + if (!Common::isTablet()) { mDiskFrame->hide(); mHoldWidget->hide(); mHoldTitleLabel->hide(); @@ -992,39 +863,25 @@ void About::setupSystemVersion() mHostNameFrame->hide(); mPriTitleLabel->hide(); mAndLabel->hide(); - mAgreeLabel->hide(); + mAgreeBtn->hide(); mActivationFrame->hide(); mTipLabel->hide(); - mTrialLabel->hide(); + mTrialBtn->hide(); + mPatchVersionFrame->hide(); } - - file.open(QIODevice::ReadOnly | QIODevice::Text); - QByteArray t = file.readAll(); - file.close(); - QString content = t; - QStringList versionResult1; - foreach (QString versionResult, content.split("\n")) { - if (versionResult == NULL) - continue; - versionResult1.append(versionResult); - } - QString content1 = versionResult1.at(1); - content1.replace('"', ""); - QString content2 = content1.split(" = ").at(1); - mVersionNumLabel_2->setText(content2); } void About::setHostNameCompenet() { - mHostNameLabel_2->setText(Utils::getHostName()); + mHostNameLabel_2->setText(Common::getHostName()); } void About::setPrivacyCompent() { - if (Utils::isWayland()) { + if (Common::isWayland()) { mPrivacyFrame->setVisible(false); mPriTitleLabel->setVisible(false); - mAgreeLabel->setVisible(false); + mAgreeBtn->setVisible(false); mAndLabel->setVisible(false); item->changeSize(0, 0); return; @@ -1034,7 +891,7 @@ void About::setPrivacyCompent() "com.kylin.daq.interface", QDBusConnection::systemBus(), this); if (!PriDBus->isValid()) { - qDebug()<<"create pridbus error"; +// qDebug()<<"create pridbus error"; return; } QDBusReply reply = PriDBus->call("GetUploadState"); @@ -1043,7 +900,8 @@ void About::setPrivacyCompent() mPriBtn->blockSignals(false); connect(mPriBtn,&KSwitchButton::stateChanged ,this ,[=](bool status){ - PriDBus->call("SetUploadState" , (status ? 1 : 0)); + Common::buriedSettings(name(), "Send optional diagnostic data", QString("settings"), status ? "true": "false"); + PriDBus->call("SetUploadState" , (status ? 1 : 0)); } ); } @@ -1051,53 +909,84 @@ void About::showExtend(QString dateres) { mTimeLabel_2->setText(dateres+QString("(%1)").arg(tr("expired"))); mTimeLabel_2->setStyleSheet("color : red "); - mTrialLabel->setVisible(true); - if (mAgreeLabel->isVisible()) - mAndLabel->setVisible(true); mActivationBtn->setText(tr("Extend")); } -int About::ntp_gethostbyname(char *dname, int family, QStringList &host) +int About::ntpGethostbyname(char *servname) { - int err = -1; - struct addrinfo hint; - struct addrinfo *rptr = NULL; - struct addrinfo *iptr = NULL; + pthread_t t1 = 0; + int ret = 0; - char iphost[256] = { 0 }; + struct dnsInfo dnsinfo; + dnsinfo.servname = servname; + dnsinfo.pid = pthread_self(); - do { - if (NULL == dname) - break; - - memset(&hint, 0, sizeof(hint)); - hint.ai_family = family; - hint.ai_socktype = SOCK_DGRAM; - - err = getaddrinfo(dname, NULL, &hint, &rptr); - if (0 != err) - break; - - for (iptr = rptr; NULL != iptr; iptr = iptr->ai_next) { - if (family != iptr->ai_family) - continue; - memset(iphost, 0, 256); - if (NULL == inet_ntop(family, &(((struct sockaddr_in *)(iptr->ai_addr))->sin_addr), iphost, 256)) { - continue; - } - - host.append(iphost); - } - - err = (host.size() > 0) ? 0 : -3; - } while (0); - - if (NULL != rptr) { - freeaddrinfo(rptr); - rptr = NULL; + ret = pthread_create(&t1, NULL, threadGetAddrInfo, (void *)&dnsinfo); + if(ret == -1) { + qDebug()<<"pthread_create error"; + return -1; } - return err; + int btimeout = 1; + ret = pthread_kill(t1, 0); + if(0 == ret) { + qDebug()<<"thread exist"; //子线程还在阻塞,主线程30ms后返回 + usleep(30*1000);//30ms + } else if (ESRCH == ret) { + qDebug()<<"thread not exist"; //子线程结束,主线程直接返回 + btimeout = 0; + } + + return 0 == btimeout ? 0 : -1; +} + +void *About::threadGetAddrInfo(void *arg) +{ + pthread_detach(pthread_self()); //设置为分离线程 + int ret = 0; + struct dnsInfo *dnsinfo = (struct dnsInfo *)arg; + struct addrinfo *rptr = NULL; + struct addrinfo *iptr = NULL; + char iphost[256] = { 0 }; + + char *node = NULL; + char *servname = NULL; + + if(dnsinfo->servname !=NULL) + servname = strdup(dnsinfo->servname); //子线程中结构体数据使用strdup进行了保存,防止主线程退出后,传进来的指针数据丢失 + + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_DGRAM; + + pthread_t pid_master = dnsinfo->pid; + + ret = getaddrinfo(servname, node, &hints, &rptr); + + if(ret != 0) { + free(servname); + free(node); + pthread_exit(NULL); + } + + ret = pthread_kill(pid_master, 0); //判断主线程是否退出 + if(0 == ret) { + for (iptr = rptr; NULL != iptr; iptr = iptr->ai_next) { + if (AF_INET != iptr->ai_family) + continue; + memset(iphost, 0, 256); + if (NULL == inet_ntop(AF_INET, &(((struct sockaddr_in *)(iptr->ai_addr))->sin_addr), iphost, 256)) { + continue; + } + mIpList.append(iphost); + } + } + + freeaddrinfo(rptr); + free(servname); + free(node); + pthread_exit(NULL); } char *About::ntpdate(char *hostname) @@ -1158,17 +1047,15 @@ char *About::ntpdate(char *hostname) char *About::getntpdate() { - QStringList list; for (QString host : mNtphostName) { - list.clear(); - if (ntp_gethostbyname(host.toLatin1().data(), AF_INET, list) == 0) { - for (QString ip : list) { - qDebug()<"<"<type() == QEvent::MouseButtonPress){ QMouseEvent * mouseEvent = static_cast(event); - if (mouseEvent->button() == Qt::LeftButton ){ - QString str = Utils::getHostName(); + if (mouseEvent->button() == Qt::LeftButton ){ + QString str = Common::getHostName(); HostNameDialog *mdialog = new HostNameDialog(pluginWidget); QWidget *widget = qApp->activeWindow(); // 记录mainwindow的地址,exec之后,activeWindow会变成空值 mdialog->exec(); - if (str != Utils::getHostName()) { + if (str != Common::getHostName()) { QMessageBox *mReboot = new QMessageBox(widget); mReboot->setIcon(QMessageBox::Warning); mReboot->setText(tr("The system needs to be restarted to set the HostName, whether to reboot")); @@ -1256,24 +1143,16 @@ bool About::eventFilter(QObject *obj, QEvent *event) reboot(); break; } - mHostNameLabel_2->setText(Utils::getHostName()); + mHostNameLabel_2->setText(Common::getHostName()); + Common::buriedSettings(name(), "change hostname", QString("settings"), Common::getHostName()); } } } - } else if (obj == mTrialLabel) { - if (event->type() == QEvent::MouseButtonPress) { - TrialDialog *mDialog = new TrialDialog(pluginWidget); - mDialog->exec(); - } - } else if (obj == mAgreeLabel) { - if (event->type() == QEvent::MouseButtonPress) { - PrivacyDialog *mDialog = new PrivacyDialog(pluginWidget); - mDialog->exec(); - } } else if ( obj == mSequenceLabel_2) { if (event->type() == QEvent::MouseButtonPress){ QMouseEvent * mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::LeftButton && !mSequenceLabel_2->text().isEmpty()){ + Common::buriedSettings(name(), "show activation info", QString("clicked")); if (!dateRes.isEmpty()) compareTime(dateRes); StatusDialog *mDialog = new StatusDialog(pluginWidget); @@ -1509,6 +1388,7 @@ void About::activeSlot(int activeSignal) /* 打开激活窗口 */ void About::runActiveWindow() { + Common::buriedSettings(name(), "Activate the system or extend the service", QString("settings")); QString cmd = "kylin-activation"; QProcess process(this); diff --git a/plugins/system/about/about.h b/plugins/system/about/about.h index 13b44ac..d3b5d7e 100644 --- a/plugins/system/about/about.h +++ b/plugins/system/about/about.h @@ -39,18 +39,27 @@ #include #include "HpQRCodeInterface.h" -#include "shell/utils/utils.h" +#include "common.h" #include "hostnamedialog.h" #include "privacydialog.h" #include "statusdialog.h" #include "shell/interface.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/Label/fixlabel.h" -#include "widgets/Label/lightlabel.h" +#include "titlelabel.h" +#include "fixlabel.h" +#include "lightlabel.h" #include "kswitchbutton.h" +#include +#include using namespace kdk; + +struct dnsInfo +{ + char *servname; + pthread_t pid; +}; + namespace Ui { class About; } @@ -75,9 +84,15 @@ public: private: void initUI(QWidget *widget); - void retranslateUi(); + QFrame *initPrivacyUi(); + QFrame *initActiveUi(); + QFrame *initInfoBtnUi(); + QFrame *initHoldUi(); + QFrame *createFrame(FixLabel *label_1, LightLabel *label_2, LightLabel *label_3 = nullptr); void initSearchText(); void initActiveDbus(); + void initCopyRightName(); + void setConnect(); void setupSerialComponent(); void setVersionNumCompenent(); void setupVersionCompenent(); @@ -88,7 +103,8 @@ private: void setHostNameCompenet(); void setPrivacyCompent(); void showExtend(QString dateres); - int ntp_gethostbyname(char *dname, int family, QStringList & host); //获取 IP 地址列表 + int ntpGethostbyname(char *servname); //获取 IP 地址列表 + static void *threadGetAddrInfo(void *arg); char *ntpdate(char *hostname); char *getntpdate(); int getMonth(QString month); @@ -177,11 +193,13 @@ private: FixLabel *mTipLabel; QPushButton *mActivationBtn; - QPushButton *mTrialBtn; QPushButton *mHpBtn; QPushButton *mEducateBtn; KSwitchButton *mPriBtn; + KBorderlessButton *mTrialBtn; + KBorderlessButton *mAgreeBtn; + QStringList diskInfo; QMap disk2; //disk2的结构 QMap<块设备名,总大小和可用大小> @@ -190,12 +208,13 @@ private: QSharedPointer activeInterface; QGSettings *themeStyleQgsettings; - hp::QRCodeInterface *app;//hp插件 + hp::QRCodeInterface *app; //hp插件 QSpacerItem *item; QString mMemtotal; QString mMemAvaliable; + QString mCopyRightName; QString dateRes = ""; diff --git a/plugins/system/about/about.pro b/plugins/system/about/about.pro index 96a18a5..f79bcdb 100644 --- a/plugins/system/about/about.pro +++ b/plugins/system/about/about.pro @@ -1,4 +1,6 @@ include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets dbus KI18n KCoreAddons \ widgets dbus concurrent svg @@ -7,7 +9,9 @@ CONFIG += plugin \ link_pkgconfig PKGCONFIG += gsettings-qt \ - kysdk-qtwidgets + kysdk-qtwidgets \ + kysdk-sysinfo + TARGET = $$qtLibraryTarget(about) DESTDIR = ../.. diff --git a/plugins/system/about/hostnamedialog.cpp b/plugins/system/about/hostnamedialog.cpp index 784082e..058d38f 100644 --- a/plugins/system/about/hostnamedialog.cpp +++ b/plugins/system/about/hostnamedialog.cpp @@ -43,7 +43,6 @@ void HostNameDialog::InitUi() mHostNameLabel->setText(tr("HostName")); mHostNameEdit = new QLineEdit(mInputPwdFrame); - mHostNameEdit->setAttribute(Qt::WA_InputMethodEnabled, false); //限制中文输入法 mHostNameEdit->setFixedSize(322, 36); mHostNameEdit->installEventFilter(this); @@ -119,7 +118,7 @@ void HostNameDialog::setEdit() void HostNameDialog::setupComponent() { - mfirsthostname = Utils::getHostName(); + mfirsthostname = Common::getHostName(); mHostNameEdit->setText(mfirsthostname); } @@ -134,7 +133,7 @@ void HostNameDialog::setHostname(QString hostname) delete process; //修改/etc/hosts文件中的主机名 - + hostname = Common::getHostName(); QDBusInterface *sethostnameDbus = new QDBusInterface("com.control.center.qt.systemdbus", "/", "com.control.center.interface", @@ -145,14 +144,3 @@ void HostNameDialog::setHostname(QString hostname) sethostnameDbus = nullptr; } - - - - - - - - - - - diff --git a/plugins/system/about/hostnamedialog.h b/plugins/system/about/hostnamedialog.h index 81d2634..64d3935 100644 --- a/plugins/system/about/hostnamedialog.h +++ b/plugins/system/about/hostnamedialog.h @@ -8,7 +8,7 @@ #include #include -#include "shell/utils/utils.h" +#include "common.h" class HostNameDialog : public QDialog { diff --git a/plugins/system/about/privacydialog.cpp b/plugins/system/about/privacydialog.cpp index eef2d97..b358517 100644 --- a/plugins/system/about/privacydialog.cpp +++ b/plugins/system/about/privacydialog.cpp @@ -293,7 +293,7 @@ void PrivacyDialog::initUi() " Changsha (0731) 88280166 Shanghai (021) 51062866\n\n" " Company website: www.kylinos.cn\n" " E-mail: support@kylinos.cn"); - mContentLabel->setText(mContent); + mContentLabel->setText(mContent); mverticalLayout->addWidget(mContentLabel); QLabel *label_1 = new QLabel(QString(tr("Kylinsoft Co., Ltd.")) , this); label_1->setAlignment(Qt::AlignRight); diff --git a/plugins/system/about/privacydialog.h b/plugins/system/about/privacydialog.h index 50e64c2..4ec52ef 100644 --- a/plugins/system/about/privacydialog.h +++ b/plugins/system/about/privacydialog.h @@ -5,7 +5,7 @@ #include #include #include -#include "widgets/Label/titlelabel.h" +#include "titlelabel.h" class PrivacyDialog : public QDialog { diff --git a/plugins/system/about/statusdialog.h b/plugins/system/about/statusdialog.h index b7bce71..6252163 100644 --- a/plugins/system/about/statusdialog.h +++ b/plugins/system/about/statusdialog.h @@ -6,7 +6,7 @@ #include #include -#include "widgets/Label/fixlabel.h" +#include "fixlabel.h" const QString vTen = "v10"; const QString vTenEnhance = "v10.1"; diff --git a/plugins/system/about/trialdialog.h b/plugins/system/about/trialdialog.h index dff4e47..e4462d5 100644 --- a/plugins/system/about/trialdialog.h +++ b/plugins/system/about/trialdialog.h @@ -3,7 +3,7 @@ #include #include -#include "widgets/Label/titlelabel.h" +#include "titlelabel.h" class TrialDialog : public QDialog { diff --git a/plugins/system/display/brightnessFrame.cpp b/plugins/system/display/brightnessFrame.cpp index f7abc94..eb73479 100644 --- a/plugins/system/display/brightnessFrame.cpp +++ b/plugins/system/display/brightnessFrame.cpp @@ -7,16 +7,15 @@ #include #include #include +#include "common.h" #define POWER_SCHMES "org.ukui.power-manager" #define POWER_KEY "brightness-ac" #define POWER_KEY_C "brightnessAc" -BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash, QWidget *parent) : - QFrame(parent) +BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash, QWidget *parent) + : UkccFrame(parent, UkccFrame::BorderRadiusStyle::None, false) { - this->setFrameShape(QFrame::Shape::Box); - QHBoxLayout *layout = new QHBoxLayout; layout->setSpacing(6); layout->setMargin(0); @@ -25,12 +24,12 @@ BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, con layout->setMargin(0); QVBoxLayout *fLayout = new QVBoxLayout(this); + fLayout->setContentsMargins(16, 0, 16, 0); fLayout->setSpacing(4); fLayout->addLayout(layout); fLayout->addLayout(layout_2); - labelMsg = new FixLabel; - labelMsg->setFixedHeight(36); + labelMsg = new LightLabel(this); layout_2->addWidget(labelMsg); labelMsg->setDisabled(true); labelMsg->setText(tr("Failed to get the brightness information of this monitor"));//未能获得该显示器的亮度信息 @@ -39,6 +38,7 @@ BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, con labelName->setFixedWidth(118); slider = new Uslider(Qt::Horizontal, this); + slider->setPageStep(1); slider->setRange(0, 100); labelValue = new QLabel(this); @@ -55,17 +55,43 @@ BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, con this->isBattery = isBattery; this->outputName = name; this->edidHash = edidHash; - this->threadRunFlag = false; this->i2cBus = "-1"; + this->mGetBrightnessThread = nullptr; labelValue->setText("0"); //最低亮度10,获取前显示为0 slider->setEnabled(false); //成功连接了再改为true,否则表示无法修改亮度 + if (getTabletMode()) { + this->setFixedHeight(TABLET_HEIGHT + 48); + } else { + this->setFixedHeight(PC_HEIGHT + 36); + } + + connect(this, &BrightnessFrame::tabletModeChanged, this, [=](bool isTablet) { + if (isTablet) { + if (labelMsg) { + this->setFixedHeight(TABLET_HEIGHT + 48); + } else { + this->setFixedHeight(TABLET_HEIGHT); + } + } else { + if (labelMsg) { + this->setFixedHeight(PC_HEIGHT + 36); + } else { + this->setFixedHeight(PC_HEIGHT); + } + } + }); } BrightnessFrame::~BrightnessFrame() { exitFlag = true; - threadRun.waitForFinished(); + if (mGetBrightnessThread && mGetBrightnessThread->isRunning()) { + mGetBrightnessThread->setExit(true); + mGetBrightnessThread->terminate(); + mGetBrightnessThread->quit(); + mGetBrightnessThread->wait(); + } } void BrightnessFrame::setTextLabelName(QString text) @@ -82,35 +108,38 @@ void BrightnessFrame::runConnectThread(const bool &openFlag) { outputEnable = openFlag; if (false == isBattery) { - if (true == threadRunFlag) - return; - - threadRun = QtConcurrent::run([=]{ - threadRunFlag = true; - if ("" == this->edidHash) { - threadRunFlag = false; - return; - } - - int brightnessValue = getDDCBrighthess(); - if (brightnessValue < 0 || !slider || exitFlag) { - threadRunFlag = false; - return; - } - slider->blockSignals(true); - slider->setValue(brightnessValue); - slider->blockSignals(false); - setTextLabelValue(QString::number(brightnessValue)); - setSliderEnable(true); - labelMsg->hide(); - disconnect(slider,&QSlider::valueChanged,this,0); - connect(slider, &QSlider::valueChanged, this, [=](){ - qDebug()<value())); + }); + }); + mGetBrightnessThread->start(); + } } else { QByteArray powerId(POWER_SCHMES); if (QGSettings::isSchemaInstalled(powerId)) { @@ -125,6 +154,11 @@ void BrightnessFrame::runConnectThread(const bool &openFlag) slider->blockSignals(false); setSliderEnable(true); labelMsg->hide(); + if (getTabletMode()) { + this->setFixedHeight(TABLET_HEIGHT); + } else { + this->setFixedHeight(PC_HEIGHT); + } disconnect(slider,&QSlider::valueChanged,this,0); connect(slider, &QSlider::valueChanged, this, [=](){ qDebug()<value())); }); disconnect(mPowerGSettings,&QGSettings::changed,this,0); connect(mPowerGSettings,&QGSettings::changed,this,[=](QString key){ @@ -166,6 +201,11 @@ void BrightnessFrame::setSliderEnable(const bool &enable) } if (false == enable) { labelMsg->show(); + if (getTabletMode()) { + this->setFixedHeight(TABLET_HEIGHT + 48); + } else { + this->setFixedHeight(PC_HEIGHT + 36); + } slider->blockSignals(true); slider->setValue(0); slider->blockSignals(false); @@ -184,26 +224,6 @@ QString BrightnessFrame::getOutputName() return outputName; } -int BrightnessFrame::getDDCBrighthess() -{ - int times = 40; - QDBusInterface ukccIfc("com.control.center.qt.systemdbus", - "/", - "com.control.center.interface", - QDBusConnection::systemBus()); - QDBusReply reply; - while (--times) { - if (this->edidHash == "" || exitFlag) - return -1; - reply = ukccIfc.call("getDisplayBrightness", this->edidHash, this->i2cBus); - if (reply.isValid() && reply.value() >= 0 && reply.value() <= 100) { - return reply.value(); - } - sleep(2); - } - return -1; -} - void BrightnessFrame::setDDCBrightness(const int &value) { if (this->edidHash == "") diff --git a/plugins/system/display/brightnessFrame.h b/plugins/system/display/brightnessFrame.h index 37c395c..4f4f428 100644 --- a/plugins/system/display/brightnessFrame.h +++ b/plugins/system/display/brightnessFrame.h @@ -5,12 +5,15 @@ #include #include #include -#include "widgets/Uslider/uslider.h" +#include "uslider.h" #include #include -#include "widgets/Label/fixlabel.h" +#include "fixlabel.h" +#include "getBrightnessThread.h" +#include "ukccframe.h" +#include "lightlabel.h" -class BrightnessFrame : public QFrame +class BrightnessFrame : public UkccFrame { Q_OBJECT public: @@ -21,7 +24,6 @@ public: void setOutputEnable(const bool &enable); bool getOutputEnable(); void runConnectThread(const bool &openFlag); - int getDDCBrighthess(); bool getSliderEnable(); void setSliderEnable(const bool &enable); void setDDCBrightness(const int &value); @@ -44,10 +46,9 @@ private: QMutex mLock; bool exitFlag; bool isBattery; - QFuture threadRun; - volatile bool threadRunFlag; - FixLabel *labelMsg = nullptr; + LightLabel *labelMsg = nullptr; QString i2cBus; + GetBrightnessThread *mGetBrightnessThread; }; #endif // BRIGHTNESSFRAME_H diff --git a/plugins/system/display/controlpanel.cpp b/plugins/system/display/controlpanel.cpp index 2744a07..e65d2f0 100644 --- a/plugins/system/display/controlpanel.cpp +++ b/plugins/system/display/controlpanel.cpp @@ -11,13 +11,14 @@ QSize mScaleSize = QSize(); -ControlPanel::ControlPanel(QWidget *parent) : - QFrame(parent), +ControlPanel::ControlPanel(QWidget *parent) + : UkccFrame(parent), mUnifiedOutputCfg(nullptr) { + this->setContainer(true); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); mLayout = new QVBoxLayout(this); - mLayout->setContentsMargins(0, 0, 0, 0); + mLayout->setMargin(0); isWayland(); } @@ -71,6 +72,9 @@ void ControlPanel::addOutput(const KScreen::OutputPtr &output, bool connectChang connect(outputCfg, &OutputConfig::scaleChanged, this, &ControlPanel::scaleChanged); + connect(outputCfg, &OutputConfig::enabledChanged, + this, &ControlPanel::enabledChanged); + connect(outputCfg, &OutputConfig::toSetScreenPos, this, [=](){ Q_EMIT this->toSetScreenPos(output); @@ -162,11 +166,6 @@ void ControlPanel::isWayland() void ControlPanel::setUnifiedOutput(const KScreen::OutputPtr &output) { - Q_FOREACH (OutputConfig *config, mOutputConfigs) { - // 隐藏下面控制 - config->setVisible(false); - } - if (output.isNull()) { mUnifiedOutputCfg->deleteLater(); mUnifiedOutputCfg = nullptr; @@ -181,6 +180,12 @@ void ControlPanel::setUnifiedOutput(const KScreen::OutputPtr &output) mLayout->insertWidget(mLayout->count() - 2, mUnifiedOutputCfg); connect(mUnifiedOutputCfg, &UnifiedOutputConfig::changed, this, &ControlPanel::changed); + connect(mUnifiedOutputCfg, &UnifiedOutputConfig::scaleChanged, + this, &ControlPanel::scaleChanged); + } + Q_FOREACH (OutputConfig *config, mOutputConfigs) { + // 隐藏下面控制 + config->setVisible(false); } } @@ -195,3 +200,18 @@ void ControlPanel::slotOutputConnectedChanged() removeOutput(output->id()); } } + +void ControlPanel::setRestore() +{ + for (OutputConfig *outputCfg : mOutputConfigs) { + if (!outputCfg || !outputCfg->output()) { + continue; + } + if (outputCfg->isVisible()) { + outputCfg->setRestore(); + } + } + if (mUnifiedOutputCfg && mUnifiedOutputCfg->isVisible()) { + mUnifiedOutputCfg->setRestore(); + } +} diff --git a/plugins/system/display/controlpanel.h b/plugins/system/display/controlpanel.h index f2a36a9..345c131 100644 --- a/plugins/system/display/controlpanel.h +++ b/plugins/system/display/controlpanel.h @@ -4,6 +4,7 @@ #include #include +#include "ukccframe.h" class QVBoxLayout; class OutputConfig; @@ -16,7 +17,7 @@ class QComboBox; const QString kSession = "wayland"; -class ControlPanel : public QFrame +class ControlPanel : public UkccFrame { Q_OBJECT @@ -28,6 +29,7 @@ public: void setUnifiedOutput(const KScreen::OutputPtr &output); void activateOutputNoParam(); void changescalemax(const KScreen::OutputPtr &output); + void setRestore(); private: void isWayland(); @@ -38,8 +40,9 @@ public Q_SLOTS: Q_SIGNALS: void changed(); - void scaleChanged(double scale); + void scaleChanged(QSize size); void toSetScreenPos(const KScreen::OutputPtr &output); + void enabledChanged(); private Q_SLOTS: void addOutput(const KScreen::OutputPtr &output, bool connectChanged); diff --git a/plugins/system/display/declarative/qmloutput.cpp b/plugins/system/display/declarative/qmloutput.cpp index f22a33a..24d2830 100644 --- a/plugins/system/display/declarative/qmloutput.cpp +++ b/plugins/system/display/declarative/qmloutput.cpp @@ -75,6 +75,9 @@ void QMLOutput::setOutputPtr(const KScreen::OutputPtr &output) this, &QMLOutput::updateRootProperties); connect(m_output.data(), &KScreen::Output::currentModeIdChanged, this, &QMLOutput::currentModeIdChanged); + connect(m_output.data(), &KScreen::Output::scaleChanged, + this, &QMLOutput::currentModeIdChanged); + } QMLScreen *QMLOutput::screen() const @@ -240,22 +243,10 @@ void QMLOutput::currentModeIdChanged() const float newHeight = currentOutputHeight() * m_screen->outputScale(); setY((m_screen->height() - newHeight) / 2); } else { - if (m_rightDock) { - QMLOutput *rightDock = m_rightDock; - float newWidth = currentOutputWidth() * m_screen->outputScale(); - setX(rightDock->x() - newWidth); - setRightDockedTo(rightDock); - } - if (m_bottomDock) { - QMLOutput *bottomDock = m_bottomDock; - float newHeight = currentOutputHeight() * m_screen->outputScale(); - setY(bottomDock->y() - newHeight); - setBottomDockedTo(bottomDock); - } } - Q_EMIT currentOutputSizeChanged(); + m_screen->setScreenPos(this, false); } @@ -609,6 +600,6 @@ void QMLOutput::updateRootProperties() //qDebug()<<"transformedWidth: "< #include +#include Q_DECLARE_METATYPE(KScreen::OutputPtr) @@ -51,7 +52,6 @@ void QMLScreen::setConfig(const KScreen::ConfigPtr &config) qDeleteAll(m_outputMap); m_outputMap.clear(); m_manuallyMovedOutputs.clear(); - m_bottommost = m_leftmost = m_rightmost = m_topmost = nullptr; m_connectedOutputsCount = 0; m_enabledOutputsCount = 0; @@ -117,6 +117,9 @@ void QMLScreen::addOutput(const KScreen::OutputPtr &output) connect(qmloutput, SIGNAL(clicked()), this, SLOT(setActiveOutput())); + connect(qmloutput, SIGNAL(clicked()), + this, SLOT(getClickedPos())); + connect(qmloutput, SIGNAL(mouseReleased(bool)), this, SLOT(setScreenPos(bool))); @@ -177,6 +180,18 @@ QList QMLScreen::outputs() const return m_outputMap.values(); } +void QMLScreen::getClickedPos() +{ + leftPosList.clear(); + // 应该判断所有显示器的坐标是否变化,移动A屏幕可能只会改变A与B屏幕的相对位置,A本身的屏幕位置可能不变(比如(0, 1680)) + Q_FOREACH (QMLOutput *qmlOutput, m_outputMap) { + if (qmlOutput->output()->isConnected()) { + leftPosList.append(qmlOutput->position().x()); + leftPosList.append(qmlOutput->position().y()); + } + } +} + void QMLScreen::setActiveOutput(QMLOutput *output) { Q_FOREACH (QMLOutput *qmlOutput, m_outputMap) { @@ -235,14 +250,228 @@ void QMLScreen::setScreenCenterPos() } } +struct RectangleDistance QMLScreen::calculateRectangleDistance(QMLOutput *qmlOutput1, QMLOutput *qmlOutput2) +{ + struct RectangleDistance res; + const float x1 = qmlOutput1->x(); + const float y1 = qmlOutput1->y(); + const float w1 = qmlOutput1->width(); + const float h1 = qmlOutput1->height(); + const float x2 = qmlOutput2->x(); + const float y2 = qmlOutput2->y(); + const float w2 = qmlOutput2->width(); + const float h2 = qmlOutput2->height(); + + QPointF C1, C2; + C1.setX(x1 + (w1 / 2)); + C1.setY(y1 + (h1 / 2)); + C2.setX(x2 + (w2 / 2)); + C2.setY(y2 + (h2 / 2)); + + // 分别计算两矩形中心点在X轴和Y轴方向的距离 + float Dx, Dy; + Dx = qFabs(C2.x() - C1.x()); + Dy = qFabs(C2.y() - C1.y()); + //本身就是紧邻在一起的 + if ((fabs(Dx - (w1 + w2)/2) <= 0.001) && (Dy - (h1 + h2)/2 <= 0.001) && (Dy > 0.001)) { + res.m_distance = 0.0; + res.m_type = Recent; + } else if ((fabs(Dy - (h1 + h2)/2) <= 0.001) && (Dx - (w1 + w2)/2 <= 0.001) && (Dx > 0.001)) { + res.m_distance = 0.0; + res.m_type = Recent; + } + //两矩形不相交,在X轴方向有部分重合的两个矩形,最小距离是上矩形的下边线与下矩形的上边线之间的距离 + else if ((Dx < ((w1 + w2)/2)) && (Dy >= ((h1 + h2) /2))) { + res.m_distance = Dy - ((h1 + h2)/2); + res.m_type = Vertical; + } + //两矩形不相交,在Y轴方向有部分重合的两个矩形,最小距离是左矩形的右边线与右矩形的左边线之间的距离 + else if ((Dx >= ((w1 + w2)/2)) && (Dy < ((h1 + h2) /2))) { + res.m_distance = Dx - ((w1 + w2)/2); + res.m_type = Horizontal; + } + //两矩形不相交,在X轴和Y轴方向无重合的两个矩形,最小距离是距离最近的两个顶点之间的距离, + else if ((Dx >= ((w1 + w2)/2)) && (Dy >= ((h1 + h2) /2))) { + float delta_x = Dx - ((w1 + w2)/2); + float delta_y = Dy - ((h1 + h2)/2); + res.m_distance = qSqrt(delta_x * delta_x + delta_y * delta_y); + res.m_type = None; + } + //两矩形相交,最小距离为负值 + else { + float distanceX = qMin(x1 + w1, x2 + w2) - qMax(x1, x2); + float distanceY = qMin(y1 + h1, y2 + h2) - qMax(y1, y2); + if (distanceX < 0 || distanceY < 0) { + qWarning()<<"calculateRectangleDistance error:"<setX(outputRef->x() + outputRef->width()); + } else if (m_type == Vertical) { + if (output->y() > outputRef->y()) { + output->setY(outputRef->y() + outputRef->height()); + } else { + output->setY(outputRef->y() - output->height()); + } + } else if (m_type == None) { + output->setX(outputRef->x() + outputRef->width()); + if (output->y() > outputRef->y()) { + output->setY(outputRef->y() + outputRef->height()); + } else { + output->setY(outputRef->y() - output->height()); + } + } else if (m_type == Recent) { + return; + } +} + +void QMLScreen::setScreenPosMulti(int connectScreenNum) { + int outputOrder[connectScreenNum]; + float output_x[connectScreenNum]; + float distance_d[connectScreenNum][connectScreenNum]; + struct RectangleDistance distance_r[connectScreenNum][connectScreenNum]; + QMLOutput *allConnectedOutput[connectScreenNum]; + + int mm = 0; + Q_FOREACH (QMLOutput *qmlOutput, m_outputMap) { + if (qmlOutput->output()->isConnected()) { + allConnectedOutput[mm] = qmlOutput; + output_x[mm] = qmlOutput->x(); + mm++; + } + } + //横坐标最小(最左边)的显示器为参考,找到该显示器 + outputOrder[0] = std::min_element(output_x, output_x + connectScreenNum) - output_x; + mm = 0; + Q_FOREACH (QMLOutput *qmlOutput, m_outputMap) { + if (!qmlOutput->output()->isConnected()) { + continue; + } + if (qmlOutput != allConnectedOutput[outputOrder[0]] && qmlOutput->output()->isConnected()) { + struct RectangleDistance m_res = calculateRectangleDistance(allConnectedOutput[outputOrder[0]], qmlOutput); + distance_r[0][mm] = m_res; + distance_d[0][mm] = m_res.m_distance; + } else if (qmlOutput == allConnectedOutput[outputOrder[0]]) { + distance_d[0][mm] = 1000000.0; + } + mm++; + } + + float recentData = -1; + outputOrder[1] = std::min_element(distance_d[0], distance_d[0] + connectScreenNum) - distance_d[0]; + recentData = *std::min_element(distance_d[0], distance_d[0] + connectScreenNum); + //紧邻的,不需要做处理 + if (fabs(recentData) <= 0.0001) { + //非紧邻,需要移至紧邻 + } else { + resetOutputPos(allConnectedOutput[outputOrder[1]], distance_r[0][outputOrder[1]].m_type, allConnectedOutput[outputOrder[0]]); + } + //判断剩下的离之前两个哪个矩形更近 + for (mm = 0; mm < connectScreenNum; mm++) { + if (mm != outputOrder[1] && mm != outputOrder[0]) { + //计算与第二个确定矩形的距离 + struct RectangleDistance m_res = calculateRectangleDistance(allConnectedOutput[outputOrder[1]], allConnectedOutput[mm]); + distance_d[1][mm] = m_res.m_distance; + distance_r[1][mm] = m_res; + } + } + + if (connectScreenNum == 2) { + + } else if (connectScreenNum == 3) { + outputOrder[2] = 3 - outputOrder[1] - outputOrder[0]; + if (distance_d[0][outputOrder[2]] < distance_d[1][outputOrder[2]]) { + resetOutputPos(allConnectedOutput[outputOrder[2]], distance_r[0][outputOrder[2]].m_type, allConnectedOutput[outputOrder[0]]); + } else { + resetOutputPos(allConnectedOutput[outputOrder[2]], distance_r[1][outputOrder[2]].m_type, allConnectedOutput[outputOrder[1]]); + } + } else if (connectScreenNum == 4) { + for (mm = 0; mm < connectScreenNum; mm++) { + if (mm != outputOrder[1] && mm != outputOrder[0]) { + outputOrder[2] = mm; + outputOrder[3] = 6 - outputOrder[0] - outputOrder[1] - outputOrder[2]; + break; + } + } + float m_distance[4] = { distance_d[0][outputOrder[2]],distance_d[1][outputOrder[2]], + distance_d[0][outputOrder[3]],distance_d[1][outputOrder[3]] }; + + int tempNum; + //outputOrder[2]就是最近的 + if ((std::min_element(m_distance, m_distance + 4) - m_distance) < 2) { + //lastNum是最近的 + } else { + tempNum = outputOrder[2]; + outputOrder[2] = outputOrder[3]; + outputOrder[3] = tempNum; + } + //离第一个最近 + if (distance_d[0][outputOrder[2]] < distance_d[1][outputOrder[2]]) { + resetOutputPos(allConnectedOutput[outputOrder[2]],distance_r[0][outputOrder[2]].m_type,allConnectedOutput[outputOrder[0]]); + //离第二个最近 + } else { + resetOutputPos(allConnectedOutput[outputOrder[2]],distance_r[1][outputOrder[2]].m_type,allConnectedOutput[outputOrder[1]]); + } + distance_r[2][0] = calculateRectangleDistance(allConnectedOutput[outputOrder[0]], allConnectedOutput[outputOrder[3]]); + distance_r[2][1] = calculateRectangleDistance(allConnectedOutput[outputOrder[1]], allConnectedOutput[outputOrder[3]]); + distance_r[2][2] = calculateRectangleDistance(allConnectedOutput[outputOrder[2]], allConnectedOutput[outputOrder[3]]); + distance_d[2][0] = distance_r[2][0].m_distance; + distance_d[2][1] = distance_r[2][1].m_distance; + distance_d[2][2] = distance_r[2][2].m_distance; + tempNum = std::min_element(distance_d[2], distance_d[2] + 3) - distance_d[2]; + int tempNum2 = tempNum; + if (tempNum == 0) { + tempNum = outputOrder[0]; + } else if (tempNum == 1) { + tempNum = outputOrder[1]; + } else if (tempNum == 2) { + tempNum = outputOrder[2]; + } + resetOutputPos(allConnectedOutput[outputOrder[3]],distance_r[2][tempNum2].m_type,allConnectedOutput[tempNum]); + } +} + void QMLScreen::setScreenPos(QMLOutput *output, bool isReleased) { - QPointF posBefore = output->position(); // 镜像模式下跳过屏幕旋转处理 if (output->isCloneMode()) { return; } - + output->setSize(QSizeF(output->property("saveWidth").toDouble(), output->property("saveHeight").toDouble())); float x1 = 0, y1 = 0; float width1 = 0, height1 = 0; float x2 = 0, y2 = 0; @@ -255,12 +484,13 @@ void QMLScreen::setScreenPos(QMLOutput *output, bool isReleased) int connectedScreen = 0; - QMLOutput *other = NULL; + QMLOutput *other = nullptr; Q_FOREACH (QMLOutput *qmlOutput, m_outputMap) { if (qmlOutput->output()->isConnected()) { connectedScreen++; } if (qmlOutput != output && qmlOutput->output()->isConnected()) { + qmlOutput->setSize(QSizeF(qmlOutput->property("saveWidth").toDouble(), qmlOutput->property("saveHeight").toDouble())); other = qmlOutput; x2 = other->x(); y2 = other->y(); @@ -269,58 +499,77 @@ void QMLScreen::setScreenPos(QMLOutput *output, bool isReleased) } } - // 坐标为负的情况,bug#76350 - if (x1 < 0 || y1 < 0 || x2 < 0 || y2 < 0) { - if (isReleased) - setScreenCenterPos(); - return; - } - - if (connectedScreen < 2) { - setScreenCenterPos(); - return; - } - - if (!((x1 + width1 == x2) - || (y1 == y2 + height2) - || (x1 == x2 + width2) - || (y1 + height1 == y2))) { - if (x1 + width1 < x2) { - output->setX(x2 - width1); - output->setY(y2); - } else if (y1 > y2 + height2) { - output->setX(x2); - output->setY(y2 + height2); - } else if (x1 > x2 + width2) { - output->setX(x2 + width2); - output->setY(y2); - } else if (y1 + height1 < y2) { - output->setX(x2); - output->setY(y2 - height1); + if (connectedScreen == 2 || connectedScreen == 3 || connectedScreen == 4) { + setScreenPosMulti(connectedScreen); + } else { + // 坐标为负的情况,bug#76350 + if (x1 < 0 || y1 < 0 || x2 < 0 || y2 < 0) { + if (isReleased) + setScreenCenterPos(); + return; } - // 矩形是否相交 - if (!(x1 + width1 <= x2 || x2 + width2 <= x1 - || y1 >= y2 +height2 || y2 >= y1 + height1) - && (x1 != x2 || y1 != y2) && other != NULL - && other->output()->isConnected()) { - if ((x1 + width1 > x2) && (x1 < x2)) { + if (connectedScreen < 2) { + setScreenCenterPos(); + return; + } + + if (!((x1 + width1 == x2) + || (y1 == y2 + height2) + || (x1 == x2 + width2) + || (y1 + height1 == y2))) { + if (x1 + width1 < x2) { output->setX(x2 - width1); - } else if ((x1 < x2 + width2) && (x1 + width1 > x2 + width2)) { - output->setX(x2 + width2); - } else if ((y1 + height() > y2) && (y1 < y2 + height2)) { - output->setY(y2 - height1); - } else if ((y1 < y2 + height2) && (y1 + height1 > y2 + height2)) { + output->setY(y2); + } else if (y1 > y2 + height2) { + output->setX(x2); output->setY(y2 + height2); + } else if (x1 > x2 + width2) { + output->setX(x2 + width2); + output->setY(y2); + } else if (y1 + height1 < y2) { + output->setX(x2); + output->setY(y2 - height1); + } + + // 矩形是否相交 + if (!(x1 + width1 <= x2 || x2 + width2 <= x1 + || y1 >= y2 +height2 || y2 >= y1 + height1) + && (x1 != x2 || y1 != y2) && other != nullptr + && other->output()->isConnected()) { + if ((x1 + width1 > x2) && (x1 < x2)) { + output->setX(x2 - width1); + } else if ((x1 < x2 + width2) && (x1 + width1 > x2 + width2)) { + output->setX(x2 + width2); + } else if ((y1 + height() > y2) && (y1 < y2 + height2)) { + output->setY(y2 - height1); + } else if ((y1 < y2 + height2) && (y1 + height1 > y2 + height2)) { + output->setY(y2 + height2); + } } } } - setScreenCenterPos(); - QPointF posAfter = output->position(); - if (isReleased && !(posBefore == posAfter)) { - Q_EMIT released(); + rightPosList.clear(); + Q_FOREACH (QMLOutput *qmlOutput, m_outputMap) { + if (qmlOutput->output()->isConnected()) { + rightPosList.append(qmlOutput->position().x()); + rightPosList.append(qmlOutput->position().y()); + } } + if (isReleased) { + if (leftPosList.size() != rightPosList.size()) { + Q_EMIT released(); + } else { + for (int i = 0; i < leftPosList.size(); ++i) { + if (qFabs(leftPosList.at(i) - rightPosList.at(i)) > 0.001) { + Q_EMIT released(); + break; + } + } + } + } + return; } void QMLScreen::setActiveOutputByCombox(int screenId) @@ -394,49 +643,24 @@ void QMLScreen::qmlOutputMoved(QMLOutput *qmlOutput) if (qmlOutput->isCloneMode()) { return; } + if (qFabs(qmlOutput->property("saveWidth").toDouble() - qmlOutput->width()) > 1.0|| qFabs(qmlOutput->property("saveHeight").toDouble() - qmlOutput->height()) > 1.0) { + return; + } if (!m_manuallyMovedOutputs.contains(qmlOutput)) m_manuallyMovedOutputs.append(qmlOutput); updateCornerOutputs(); - if (m_leftmost) { - m_leftmost->setOutputX(0); - } - if (m_topmost) { - m_topmost->setOutputY(0); - } - - if (qmlOutput == m_leftmost) { - Q_FOREACH (QMLOutput *other, m_outputMap) { - if (other == m_leftmost) { - continue; - } - - if (!other->output()->isConnected() || !other->output()->isEnabled()) { - continue; - } - - other->setOutputX(float(other->x() - m_leftmost->x()) / outputScale()); + Q_FOREACH (QMLOutput *m_qmlOutput, m_outputMap) { + if (!m_qmlOutput->output()->isConnected() || !m_qmlOutput->output()->isEnabled()) { + continue; } - } else if (m_leftmost) { - qmlOutput->setOutputX(float(qmlOutput->x() - m_leftmost->x()) / outputScale()); - } - if (qmlOutput == m_topmost) { - Q_FOREACH (QMLOutput *other, m_outputMap) { - if (other == m_topmost) { - continue; - } - - if (!other->output()->isConnected() || !other->output()->isEnabled()) { - continue; - } - - other->setOutputY(float(other->y() - m_topmost->y()) / outputScale()); - } - } else if (m_topmost) { - qmlOutput->setOutputY(float(qmlOutput->y() - m_topmost->y()) / outputScale()); + int x = qRound((m_qmlOutput->x() - leftX) / outputScale()); + int y = qRound((m_qmlOutput->y() - topY) / outputScale()); + m_qmlOutput->setOutputX(x); + m_qmlOutput->setOutputY(y); } } @@ -451,31 +675,20 @@ void QMLScreen::viewSizeChanged() void QMLScreen::updateCornerOutputs() { - m_leftmost = nullptr; - m_topmost = nullptr; - m_rightmost = nullptr; - m_bottommost = nullptr; + leftX = -1.0; + topY = -1.0; Q_FOREACH (QMLOutput *output, m_outputMap) { if (!output->output()->isConnected() || !output->output()->isEnabled()) { continue; } - QMLOutput *other = m_leftmost; - if (!other || output->x() < other->x()) { - m_leftmost = output; + if (leftX < 0 || leftX > output->x()) { + leftX = output->x(); } - if (!other || output->y() < other->y()) { - m_topmost = output; - } - - if (!other || output->x() + output->width() > other->x() + other->width()) { - m_rightmost = output; - } - - if (!other || output->y() + output->height() > other->y() + other->height()) { - m_bottommost = output; + if (topY < 0 || topY > output->y()) { + topY = output->y(); } } } diff --git a/plugins/system/display/declarative/qmlscreen.h b/plugins/system/display/declarative/qmlscreen.h index a7625fc..ae652f9 100644 --- a/plugins/system/display/declarative/qmlscreen.h +++ b/plugins/system/display/declarative/qmlscreen.h @@ -31,6 +31,22 @@ class Output; class Config; } +namespace QmlScreen { + typedef enum { + Recent = 0, + Horizontal, + Vertical, + None, + All + }type; + + struct RectangleDistance{ + type m_type; + float m_distance; + }; +} +using namespace QmlScreen; + class QMLScreen : public QQuickItem { Q_OBJECT @@ -73,8 +89,11 @@ public: void setActiveOutput(QMLOutput *output); void setScreenPos(QMLOutput *output, bool isReleased); - + void setScreenPosMulti(int connectScreenNum); void setScreenCenterPos(); + struct RectangleDistance calculateRectangleDistance(QMLOutput *qmlOutput1, QMLOutput *qmlOutput2); + void resetOutputPos(QMLOutput *output, type m_type, QMLOutput *outputRef); + public Q_SLOTS: void setActiveOutput() { @@ -86,6 +105,7 @@ public Q_SLOTS: { setScreenPos(qobject_cast(sender()), isReleased); } + void getClickedPos(); Q_SIGNALS: void connectedOutputsCountChanged(); @@ -120,10 +140,10 @@ private: float m_outputScale = 1.0 / 14.0;// 缩放比例 - QMLOutput *m_leftmost = nullptr; - QMLOutput *m_topmost = nullptr; - QMLOutput *m_rightmost = nullptr; - QMLOutput *m_bottommost = nullptr; + QList leftPosList; + QList rightPosList; + qreal leftX = 0.0; + qreal topY = 0.0; }; #endif // QMLSCREEN_H diff --git a/plugins/system/display/display.cpp b/plugins/system/display/display.cpp index 2e372c2..69f26b4 100644 --- a/plugins/system/display/display.cpp +++ b/plugins/system/display/display.cpp @@ -21,7 +21,7 @@ #include "display.h" #include "ui_display.h" -#include "../../../shell/utils/utils.h" +#include "common.h" #include #include @@ -31,12 +31,20 @@ DisplaySet::DisplaySet() : mFirstLoad(true) { +#ifdef MAVIS + pluginName = tr("Screen"); +#else pluginName = tr("Display"); +#endif pluginType = SYSTEM; } DisplaySet::~DisplaySet() { + if (pluginWidget) { + delete pluginWidget; + pluginWidget = nullptr; + } } QWidget *DisplaySet::pluginUi() @@ -70,7 +78,7 @@ const QString DisplaySet::name() const bool DisplaySet::isShowOnHomePage() const { - return true; + return !Common::isWayland(); } QIcon DisplaySet::icon() const diff --git a/plugins/system/display/display.h b/plugins/system/display/display.h index 3359643..96c5b55 100644 --- a/plugins/system/display/display.h +++ b/plugins/system/display/display.h @@ -56,7 +56,7 @@ private: Ui::DisplayWindow *ui; QString pluginName; int pluginType; - Widget *pluginWidget; + Widget *pluginWidget = nullptr; bool mFirstLoad; }; diff --git a/plugins/system/display/display.pro b/plugins/system/display/display.pro index e70cb24..7a03970 100644 --- a/plugins/system/display/display.pro +++ b/plugins/system/display/display.pro @@ -4,6 +4,12 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Uslider/uslider.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ComboBox/combobox.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets core gui quickwidgets quick xml KScreen dbus concurrent TEMPLATE = lib @@ -14,13 +20,14 @@ DESTDIR = ../.. target.path = $${PLUGIN_INSTALL_DIRS} INSTALLS += target -INCLUDEPATH += \ - $$PROJECT_ROOTDIR \ +INCLUDEPATH += $$PROJECT_ROOTDIR \ LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt PKGCONFIG += gsettings-qt \ - kysdk-qtwidgets + kysdk-qtwidgets \ + kysdk-sysinfo \ + kscreen2 SOURCES += \ brightnessFrame.cpp \ @@ -29,8 +36,10 @@ SOURCES += \ declarative/qmloutputcomponent.cpp \ declarative/qmlscreen.cpp \ controlpanel.cpp \ + getBrightnessThread.cpp \ outputconfig.cpp \ resolutionslider.cpp \ + splicedialog.cpp \ unifiedoutputconfig.cpp \ utils.cpp \ widget.cpp \ @@ -44,9 +53,11 @@ HEADERS += \ declarative/qmloutputcomponent.h \ declarative/qmlscreen.h \ controlpanel.h \ + getBrightnessThread.h \ outputconfig.h \ resolutionslider.h \ scalesize.h \ + splicedialog.h \ unifiedoutputconfig.h \ utils.h \ widget.h \ @@ -54,7 +65,8 @@ HEADERS += \ FORMS += \ display.ui \ - displayperformancedialog.ui + displayperformancedialog.ui \ + splicedialog.ui #DISTFILES += \ # qml/main.qml \ diff --git a/plugins/system/display/display.ui b/plugins/system/display/display.ui index bafe551..658c01f 100644 --- a/plugins/system/display/display.ui +++ b/plugins/system/display/display.ui @@ -99,438 +99,14 @@ - - - 0 - - + - - - QFrame::Box + + + 1 - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::NoFrame - - - - 15 - - - - - - 118 - 30 - - - - - 118 - 30 - - - - monitor - - - - - - - - 200 - 36 - - - - - 16777215 - 36 - - - - - - - - - - - - 120 - 36 - - - - - 150 - 36 - - - - - 11 - - - - Qt::NoFocus - - - as main - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - 0 - - - QLayout::SetNoConstraint - - - 0 - - - - - - - - 0 - 1 - - - - - 16777215 - 0 - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 15 - - - 0 - - - 0 - - - - - - 118 - 36 - - - - - 118 - 36 - - - - screen zoom - - - - - - - - 200 - 36 - - - - - 16777215 - 36 - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - true - - - - 0 - 0 - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::NoFrame - - - - - - 6 - - - - - - 118 - 30 - - - - - 16777215 - 30 - - - - open monitor - - - - - - - Qt::Horizontal - - - - 78 - 29 - - - - - - - - - - - - - 15 - - - 6 - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - - 0 - 106 - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 2 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 2 - - - 8 - - - - - - - - - - 0 - - - 0 - - - - - - - 15 - - - 6 - - - - - + @@ -540,424 +116,6 @@ 30 - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - - 118 - 30 - - - - - 16777215 - 30 - - - - follow the sunrise and sunset(17:55-05:04) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - - 118 - 30 - - - - - 16777215 - 30 - - - - custom time - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - - 118 - 30 - - - - - 16777215 - 30 - - - - opening time - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 80 - 36 - - - - - 80 - 36 - - - - - - - - - - - - 80 - 36 - - - - - 80 - 36 - - - - - - - - - - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - closing time - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 80 - 36 - - - - - 80 - 36 - - - - - - - - - - - - 80 - 36 - - - - - 80 - 36 - - - - - - - - - - - - - - - - - 550 - 50 - - - - - 16777215 - 50 - - - - QFrame::Box - - - - - - - - - 118 - 30 - - - - - 16777215 - 30 - - - - color temperature - - - - - - - warm - - - - - - - - 0 - 0 - - - - - - - Qt::Horizontal - - - - - - - cold - - - - - - - - @@ -984,12 +142,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
-
- - Uslider - QSlider -
../../../libukcc/widgets/Uslider/uslider.h
+
titlelabel.h
diff --git a/plugins/system/display/displayperformancedialog.cpp b/plugins/system/display/displayperformancedialog.cpp index 340576f..b1bf29f 100644 --- a/plugins/system/display/displayperformancedialog.cpp +++ b/plugins/system/display/displayperformancedialog.cpp @@ -19,7 +19,7 @@ */ #include "displayperformancedialog.h" #include "ui_displayperformancedialog.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include #include diff --git a/plugins/system/display/displayperformancedialog.ui b/plugins/system/display/displayperformancedialog.ui index f76cd40..a901710 100644 --- a/plugins/system/display/displayperformancedialog.ui +++ b/plugins/system/display/displayperformancedialog.ui @@ -231,8 +231,8 @@ 0 0 - 526 - 564 + 489 + 556
@@ -802,12 +802,12 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
CloseButton QPushButton -
../../../libukcc/widgets/CloseButton/closebutton.h
+
closebutton.h
diff --git a/plugins/system/display/getBrightnessThread.cpp b/plugins/system/display/getBrightnessThread.cpp new file mode 100644 index 0000000..c0cbcc5 --- /dev/null +++ b/plugins/system/display/getBrightnessThread.cpp @@ -0,0 +1,57 @@ +#include "getBrightnessThread.h" +#include +#include +#include + +GetBrightnessThread::GetBrightnessThread(QString edidHash, QString i2cBus) +{ + this->edidHash = edidHash; + this->i2cBus = i2cBus; + this->exitFlag = false; +} + +GetBrightnessThread::~GetBrightnessThread() +{ + +} + +void GetBrightnessThread::run() +{ + int times = 600; + QDBusInterface ukccIfc("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus()); + QDBusReply reply; + while (times) { + //防止调用terminate不会结束线程,锁屏在龙芯架构上出现过 + if (exitFlag) { + return; + } + if (times %10 != 0) { + times--; + msleep(100); + continue; + } + if (this->edidHash == "") { + Q_EMIT getBrightnessFinished(-1); + return; + } + reply = ukccIfc.call("getDisplayBrightness", this->edidHash, this->i2cBus); + if (reply.isValid() && reply.value() >= 0 && reply.value() <= 100) { + Q_EMIT getBrightnessFinished(reply.value()); + return; + } + times--; + msleep(100); + } + Q_EMIT getBrightnessFinished(-1); + return; +} + +void GetBrightnessThread::setExit(bool b) +{ + exitFlag = b; +} + + diff --git a/plugins/system/display/getBrightnessThread.h b/plugins/system/display/getBrightnessThread.h new file mode 100644 index 0000000..b2e0fb4 --- /dev/null +++ b/plugins/system/display/getBrightnessThread.h @@ -0,0 +1,23 @@ +#ifndef GETBRIGHTNESSTHREAD_H +#define GETBRIGHTNESSTHREAD_H +#include + + +class GetBrightnessThread : public QThread{ + Q_OBJECT +public: + GetBrightnessThread(QString edidHash, QString i2cBus); + ~GetBrightnessThread(); + void setExit(bool b); +protected: + void run()override; +private: + QString edidHash; + QString i2cBus; + bool exitFlag; +Q_SIGNALS: + void getBrightnessFinished(int value); +}; + + +#endif // GETBRIGHTNESSTHREAD_H diff --git a/plugins/system/display/outputconfig.cpp b/plugins/system/display/outputconfig.cpp index 5a82b9d..38a30d6 100644 --- a/plugins/system/display/outputconfig.cpp +++ b/plugins/system/display/outputconfig.cpp @@ -2,6 +2,7 @@ #include "resolutionslider.h" #include "utils.h" #include "scalesize.h" +#include "common.h" #include #include @@ -17,28 +18,38 @@ #include #include #include +#include +#include +#include +#include #include #include +#include +#include +#include +#include -#include "widgets/ComboBox/combobox.h" +#include + +#include "combobox.h" double mScaleres = 0; +bool autoScaleChange = false; QList kRadeonRate{59.9402, 29.98}; CONFIG changeItm = INIT; - +using namespace KScreen; OutputConfig::OutputConfig(QWidget *parent) : - QWidget(parent), + UkccFrame(parent), mOutput(nullptr) { - initRadeon(); - initDpiConnection(); + this->setContainer(true); } OutputConfig::OutputConfig(const KScreen::OutputPtr &output, QWidget *parent) : - QWidget(parent) + UkccFrame(parent) { - initDpiConnection(); + this->setContainer(true); setOutput(output); } @@ -46,17 +57,6 @@ OutputConfig::~OutputConfig() { } -QFrame *OutputConfig::setLine(QFrame *frame) -{ - QFrame *line = new QFrame(frame); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - return line; -} - void OutputConfig::setTitle(const QString &title) { mTitle->setText(title); @@ -64,72 +64,60 @@ void OutputConfig::setTitle(const QString &title) void OutputConfig::initUi() { + GetConfigOperation op; + op.exec(); + const ConfigPtr config = op.config(); + initConfig(config); + setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); QVBoxLayout *vbox = new QVBoxLayout(this); - vbox->setContentsMargins(0, 0, 0, 0); -// vbox->setSpacing(2); - vbox->setSpacing(0); + vbox->setMargin(0); + vbox->setSpacing(1); // 分辨率下拉框 mResolution = new ResolutionSlider(mOutput, this); - mResolution->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mResolution->setFixedHeight(36); QLabel *resLabel = new QLabel(this); //~ contents_path /Display/resolution resLabel->setText(tr("resolution")); resLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - resLabel->setFixedSize(118, 36); + resLabel->setFixedWidth(108); QHBoxLayout *resLayout = new QHBoxLayout(); - resLayout->setContentsMargins(14,0,7,0); + resLayout->setContentsMargins(16, 0, 16, 0); resLayout->addWidget(resLabel); resLayout->addWidget(mResolution); + resLayout->setSpacing(16); - - QFrame *resFrame = new QFrame(this); - resFrame->setFrameShape(QFrame::Shape::NoFrame); + UkccFrame *resFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); resFrame->setLayout(resLayout); - - resFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - resFrame->setMinimumWidth(552); - resFrame->setFixedHeight(50); - - QFrame *line1 = setLine(resFrame); - vbox->addWidget(resFrame); - vbox->addWidget(line1); connect(mResolution, &ResolutionSlider::resolutionChanged, this, [=](QSize size, bool emitFlag){ slotResolutionChanged(size, emitFlag); + scaleChanged(size); + Common::buriedSettings(QString("display"), QString("mResolution"), QString("select"), Utils::sizeToString(size)); }); // 方向下拉框 mRotation = new QComboBox(this); - mRotation->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mRotation->setFixedHeight(36); QLabel *rotateLabel = new QLabel(this); //~ contents_path /Display/orientation rotateLabel->setText(tr("orientation")); - rotateLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - rotateLabel->setFixedSize(118, 36); + rotateLabel->setFixedWidth(108); QHBoxLayout *rotateLayout = new QHBoxLayout(); - rotateLayout->setContentsMargins(14,0,7,0); + rotateLayout->setContentsMargins(16, 0, 16, 0); + rotateLayout->setSpacing(16); rotateLayout->addWidget(rotateLabel); rotateLayout->addWidget(mRotation); - QFrame *rotateFrame = new QFrame(this); - rotateFrame->setFrameShape(QFrame::Shape::Box); - rotateFrame->setLayout(rotateLayout); - - rotateFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - rotateFrame->setMinimumWidth(552); - rotateFrame->setFixedHeight(50); + mRotateFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); + mRotateFrame->setLayout(rotateLayout); mRotation->addItem(tr("arrow-up"), KScreen::Output::None); mRotation->addItem(tr("90° arrow-right"), KScreen::Output::Right); @@ -139,75 +127,110 @@ void OutputConfig::initUi() this, &OutputConfig::slotRotationChanged); mRotation->setCurrentIndex(mRotation->findData(mOutput->rotation())); - QFrame *line2 = setLine(rotateFrame); - vbox->addWidget(rotateFrame); - vbox->addWidget(line2); + vbox->addWidget(mRotateFrame); + // 自动旋转 + mAutoRotation = new KSwitchButton(this); + + QLabel *autoRotateLabel = new QLabel(this); + //~ contents_path /Display/auto rotation + autoRotateLabel->setText(tr("auto rotation")); + autoRotateLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + autoRotateLabel->setFixedWidth(108); + + QHBoxLayout *autoRotateLayout = new QHBoxLayout(); + autoRotateLayout->setContentsMargins(16, 0, 16, 0); + autoRotateLayout->setSpacing(16); + autoRotateLayout->addWidget(autoRotateLabel); + autoRotateLayout->addStretch(); + autoRotateLayout->addWidget(mAutoRotation); + + mAutoRotationFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); + mAutoRotationFrame->setLayout(autoRotateLayout); + + vbox->addWidget(mAutoRotationFrame); + mAutoRotationFrame->setVisible(false); + + mStatusManager = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + + if (mStatusManager->isValid()) { + QDBusReply isSupportedAuto = mStatusManager->call("is_supported_autorotation"); + qDebug() << "isSupportedAuto = " << isSupportedAuto; + if (isSupportedAuto) { + mAutoRotationFrame->setVisible(true); + } + QDBusReply isAutoRotation = mStatusManager->call("get_auto_rotation"); + mAutoRotation->setChecked(isAutoRotation); + mRotation->setEnabled(!isAutoRotation); + connect(mStatusManager, SIGNAL(auto_rotation_change_signal(bool)), this, SLOT(rotationDbusSlot(bool))); + connect(mStatusManager, SIGNAL(rotations_change_signal(QString)), this, SLOT(rotationDirectionSlot(QString))); + } + + connect(mAutoRotation, &KSwitchButton::stateChanged, this, [=](bool checked){ + mRotation->setEnabled(!checked); + if (mStatusManager->isValid()) { + mStatusManager->call("set_auto_rotation", checked, "ukcc", "set_auto_rotation"); + } + }); // 刷新率下拉框 mRefreshRate = new QComboBox(this); - mRefreshRate->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mRefreshRate->setFixedHeight(36); QLabel *freshLabel = new QLabel(this); //~ contents_path /Display/frequency freshLabel->setText(tr("frequency")); - freshLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - freshLabel->setFixedSize(118, 36); + freshLabel->setFixedWidth(108); QHBoxLayout *freshLayout = new QHBoxLayout(); - freshLayout->setContentsMargins(14, 0, 7, 0); + freshLayout->setContentsMargins(16, 0, 16, 0); + freshLayout->setSpacing(16); freshLayout->addWidget(freshLabel); freshLayout->addWidget(mRefreshRate); - QFrame *freshFrame = new QFrame(this); - freshFrame->setFrameShape(QFrame::Shape::Box); + UkccFrame *freshFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); freshFrame->setLayout(freshLayout); - - freshFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - freshFrame->setMinimumWidth(550); - freshFrame->setFixedHeight(50); - vbox->addWidget(freshFrame); slotResolutionChanged(mResolution->currentResolution(), true); connect(mRefreshRate, static_cast(&QComboBox::currentIndexChanged), this, &OutputConfig::slotRefreshRateChanged); + initConnection(); + + if (!Common::isOpenkylin()) + return; // 缩放率下拉框 - QFrame *scaleFrame = new QFrame(this); - scaleFrame->setFrameShape(QFrame::Shape::Box); - - QFrame *line3 = setLine(scaleFrame); - - scaleFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - scaleFrame->setMinimumWidth(550); - scaleFrame->setFixedHeight(50); + UkccFrame *scaleFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); QHBoxLayout *scaleLayout = new QHBoxLayout(scaleFrame); - scaleLayout->setContentsMargins(14, 0, 7, 0); + scaleLayout->setContentsMargins(16, 0, 16, 0); + scaleLayout->setSpacing(16); mScaleCombox = new QComboBox(this); mScaleCombox->setObjectName("scaleCombox"); - mScaleCombox->setFixedHeight(36); QLabel *scaleLabel = new QLabel(this); //~ contents_path /Display/screen zoom scaleLabel->setText(tr("screen zoom")); - scaleLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - scaleLabel->setFixedSize(118, 36); + scaleLabel->setFixedWidth(108); scaleLayout->addWidget(scaleLabel); scaleLayout->addWidget(mScaleCombox); - vbox->addWidget(line3); vbox->addWidget(scaleFrame); - connect(mScaleCombox, static_cast(&QComboBox::currentIndexChanged), - this, &OutputConfig::slotScaleChanged); + this, [=](int index){ + slotScaleChanged(index); + }); + connect(mOutput.data(), &KScreen::Output::scaleChanged, + this, &OutputConfig::initScaleItem); + + mScaleCombox->setEnabled(mOutput->isEnabled()); initScaleItem(); - initConnection(); } double OutputConfig::getScreenScale() @@ -229,9 +252,10 @@ void OutputConfig::initConnection() setVisible(false); } }); - - connect(mOutput.data(), &KScreen::Output::scaleChanged, - this, &OutputConfig::initScaleItem); + connect(mOutput.data(), &KScreen::Output::isEnabledChanged, + this, [=]() { + emit enabledChanged(); + }); connect(mOutput.data(), &KScreen::Output::rotationChanged, this, [=]() { @@ -242,14 +266,17 @@ void OutputConfig::initConnection() }); //监听,否则无法处理修改分辨率/刷新率未保存 connect(mOutput.data(), &KScreen::Output::currentModeIdChanged, this, [=]() { - //openkylin的changed()未触发currentModeIdChanged信号 - if (/*!mIsRestore || */!mOutput->currentMode()) { + if (!mIsRestore || !mOutput->currentMode()) { mIsRestore = true; - return; + if (!mSetRestore) { + return; + } } + mSetRestore = false; //分辨率改变时,触发该信号重新加载刷新率,用于修改分辨率之后但未保存 if (mResolution->currentResolution() != mOutput->currentMode()->size()) { mResolution->setResolution(mOutput->currentMode()->size()); + Q_EMIT scaleChanged(mOutput->currentMode()->size()); slotResolutionChanged(mOutput->currentMode()->size(), false); } else { //分辨率未修改,刷新率修改,用于修改刷新率之后但未保存 @@ -271,40 +298,31 @@ void OutputConfig::initConnection() }); } -void OutputConfig::initDpiConnection() -{ - QByteArray id(SCALE_SCHEMAS); - if (QGSettings::isSchemaInstalled(SCALE_SCHEMAS)) { - mDpiSettings = new QGSettings(id, QByteArray(), this); - connect(mDpiSettings, &QGSettings::changed, this, [=](QString key) { - if (!key.compare("scalingFactor", Qt::CaseSensitive)) { - slotDPIChanged(key); - } - - }); - } -} - QString OutputConfig::scaleToString(double scale) { return QString::number(scale * 100) + "%"; } -void OutputConfig::initRadeon() +void OutputConfig::hideComponent() { - QProcess process; - process.start("lspci -v"); - process.waitForFinished(); - QString output = process.readAll(); - output = output.simplified(); - mIsRadeon = output.contains("radeon", Qt::CaseInsensitive); - qDebug() << Q_FUNC_INFO << mIsRadeon; + QDBusInterface ifc("com.kylin.screen.rotation", + "/", + "com.kylin.screen.rotation.interface", + QDBusConnection::systemBus()); + + bool isShowRotation = !(QString(QLatin1String(kdk_system_get_hostCloudPlatform())) == "huawei"); + if (ifc.isValid()) { + QDBusReply res = ifc.call("GetCurrentScreenStatus"); + isShowRotation = (isShowRotation && res.value().isEmpty()); + } + mRotateFrame->setVisible(isShowRotation); } void OutputConfig::setOutput(const KScreen::OutputPtr &output) { mOutput = output; initUi(); + hideComponent(); } KScreen::OutputPtr OutputConfig::output() const @@ -320,7 +338,6 @@ void OutputConfig::slotResolutionChanged(const QSize &size, bool emitFlag) return; } bool mIsModeInit = false; - bool isRadeonRate = false; QString modeID; KScreen::ModePtr selectMode; KScreen::ModePtr currentMode = mOutput->currentMode(); @@ -340,7 +357,10 @@ void OutputConfig::slotResolutionChanged(const QSize &size, bool emitFlag) modes << mode; } } - + //非初始化,则设置选中(用户设置)的mode为该分辨率下刷新率最大的mode + if (!mIsModeInit) { + selectMode = findBestMode(selectMode->size()); + } modeID = selectMode->id(); mRefreshRate->blockSignals(true); mRefreshRate->clear(); @@ -349,7 +369,6 @@ void OutputConfig::slotResolutionChanged(const QSize &size, bool emitFlag) for (int i = 0, total = modes.count(); i < total; ++i) { const KScreen::ModePtr mode = modes.at(i); - isRadeonRate = false; bool alreadyExisted = false; for (int j = 0; j < mRefreshRate->count(); ++j) { if (refreshRateToText(mode->refreshRate()) == mRefreshRate->itemText(j)) { @@ -358,18 +377,13 @@ void OutputConfig::slotResolutionChanged(const QSize &size, bool emitFlag) } } - if ((mIsRadeon && kRadeonRate.contains(mode->refreshRate()))) - isRadeonRate = true; - - if (alreadyExisted == false && !isRadeonRate) { //不添加已经存在的项 + if (alreadyExisted == false ) { //不添加已经存在的项 mRefreshRate->blockSignals(true); mRefreshRate->addItem(refreshRateToText(mode->refreshRate()), mode->id()); mRefreshRate->blockSignals(false); } - // If selected refresh rate is other then what we consider the "Auto" value - // - that is it's not the highest resolution - then select it, otherwise - // we stick with "Auto" + //mode是选中的mode,则设置 if (mode == selectMode && mRefreshRate->count() > 0) { mRefreshRate->blockSignals(true); mRefreshRate->setCurrentIndex(mRefreshRate->count() - 1); @@ -409,23 +423,16 @@ void OutputConfig::slotRotationChanged(int index) mOutput->blockSignals(true); mOutput->setRotation(rotation); mOutput->blockSignals(false); + mOutput.data()->blockSignals(true); changeItm = ORIENTATION; Q_EMIT toSetScreenPos();//要在save之前修正坐标 Q_EMIT changed(); -} - -void OutputConfig::slotRefreshRateChanged(int index) -{ - QString modeId; - modeId = mRefreshRate->itemData(index).toString(); - qDebug() << "(slotRefreshRateChanged)modeId is:" << modeId << endl; - mOutput->blockSignals(true); - mIsRestore = false; - mOutput->setCurrentModeId(modeId); - mOutput->blockSignals(false); - changeItm = FREQUENCY; - Q_EMIT changed(); + Common::buriedSettings(QString("display"), QString("mRotation"), QString("select"), QString::number(index)); + //widget.cpp中收到changed信号会延迟200+1000ms,因此这里相应延迟,避免接收到信号改变导致方向多次修改。 + QTimer::singleShot(1400, this, [=](){ + mOutput.data()->blockSignals(false); + }); } void OutputConfig::slotScaleChanged(int index) @@ -440,18 +447,41 @@ void OutputConfig::slotScaleChanged(int index) Q_EMIT changed(); } -void OutputConfig::slotDPIChanged(QString key) +void OutputConfig::rotationDbusSlot(bool autoRotation) { - double scale = mDpiSettings->get(key).toDouble(); - if (mScaleCombox) { - if (mScaleCombox->findData(scale) == -1) { - mScaleCombox->addItem(scaleToString(scale), scale); - } - mScaleCombox->blockSignals(true); - mScaleCombox->setCurrentText(scaleToString(scale)); - mScaleCombox->blockSignals(false); + mRotation->setEnabled(!autoRotation); + mAutoRotation->blockSignals(true); + mAutoRotation->setChecked(autoRotation); + mAutoRotation->blockSignals(false); +} +void OutputConfig::rotationDirectionSlot(QString rotationDirection) +{ + mRotation->blockSignals(true); + if (rotationDirection.compare("normal") == 0) { + mRotation->setCurrentIndex(KScreen::Output::None); + } else if (rotationDirection.compare("upside-down") == 0) { + mRotation->setCurrentIndex(KScreen::Output::Inverted); + } else if (rotationDirection.compare("left") == 0) { + mRotation->setCurrentIndex(KScreen::Output::Left); + } else if (rotationDirection.compare("right") == 0) { + mRotation->setCurrentIndex(KScreen::Output::Right); } + mRotation->blockSignals(false); +} + +void OutputConfig::slotRefreshRateChanged(int index) +{ + QString modeId; + modeId = mRefreshRate->itemData(index).toString(); + qDebug() << "(slotRefreshRateChanged)modeId is:" << modeId << endl; + mOutput->blockSignals(true); + mIsRestore = false; + mOutput->setCurrentModeId(modeId); + mOutput->blockSignals(false); + changeItm = FREQUENCY; + Q_EMIT changed(); + Common::buriedSettings(QString("display"), QString("mRefreshRate"), QString("select"), mRefreshRate->currentText()); } void OutputConfig::slotEnableWidget() @@ -483,6 +513,8 @@ void OutputConfig::initConfig(const KScreen::ConfigPtr &config) void OutputConfig::initScaleItem() { + if (!Common::isOpenkylin()) + return; mScaleCombox->blockSignals(true); if (!mOutput->currentMode()) return; @@ -513,7 +545,7 @@ void OutputConfig::initScaleItem() } if (mScaleCombox->findData(mOutput->scale()) == -1) { - mOutput->setScale(0.5); + mOutput->setScale(1); } mScaleCombox->setCurrentText(QString::number(mOutput->scale() * 100) + "%"); @@ -526,3 +558,48 @@ QString OutputConfig::refreshRateToText(float refreshRate) rx.setPattern("(\\.){0,1}0+$"); return tr("%1 Hz").arg((QString::number(refreshRate,'f',2)).replace(rx,"")); } + +double OutputConfig::getGlobalData(const OutputPtr &output) +{ + QString hash = mConfig->connectedOutputsHash(); + + QString scaleDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + %QStringLiteral("/kscreen/scale/"); + QFile file(scaleDir % hash); + if (!file.open(QIODevice::ReadOnly)) { + qDebug() << "Failed to open file" << file.fileName(); + return 0; + } + + QByteArray readBy=file.readAll(); + QJsonParseError error; + QJsonDocument readDoc=QJsonDocument::fromJson(readBy,&error); + QJsonArray obj=readDoc.array(); + + for (int i = 0 ; i < obj.size(); i++) { + QJsonObject faObj= obj[i].toObject(); + if (faObj["id"].toString() == output->hashMd5()) { + return faObj["scale"].toDouble(); + } + + } + return 0; +} + +void OutputConfig::setRestore() +{ + mSetRestore = true; +} + +KScreen::ModePtr OutputConfig::findBestMode(const QSize &size) +{ + KScreen::ModePtr m_mode; + float refreshRate = 0; + Q_FOREACH (const KScreen::ModePtr &mode, mOutput->modes()) { + if (mode->size() == size && mode->refreshRate() > refreshRate) { + refreshRate = mode->refreshRate(); + m_mode = mode; + } + } + return m_mode; +} diff --git a/plugins/system/display/outputconfig.h b/plugins/system/display/outputconfig.h index 8b4ddf5..51110d8 100644 --- a/plugins/system/display/outputconfig.h +++ b/plugins/system/display/outputconfig.h @@ -9,6 +9,14 @@ #include +#include + +#include + +#include "kswitchbutton.h" +#include "ukccframe.h" +using namespace kdk; + class QCheckBox; class ResolutionSlider; class QLabel; @@ -18,7 +26,7 @@ namespace Ui { class KScreenWidget; } -class OutputConfig : public QWidget +class OutputConfig : public UkccFrame { Q_OBJECT @@ -27,7 +35,6 @@ public: explicit OutputConfig(const KScreen::OutputPtr &output, QWidget *parent = nullptr); ~OutputConfig() override; - QFrame *setLine(QFrame *frame); virtual void setOutput(const KScreen::OutputPtr &output); KScreen::OutputPtr output() const; @@ -37,18 +44,25 @@ public: void initConfig(const KScreen::ConfigPtr &config); void initScaleItem(); + + double getGlobalData(const KScreen::OutputPtr &output); + void setRestore(); + KScreen::ModePtr findBestMode(const QSize &size); + protected Q_SLOTS: void slotResolutionChanged(const QSize &size, bool emitFlag); void slotRotationChanged(int index); - void slotRefreshRateChanged(int index); void slotScaleChanged(int index); - void slotDPIChanged(QString key); + void rotationDbusSlot(bool autoRotation); + void rotationDirectionSlot(QString rotationDirection); + void slotRefreshRateChanged(int index); void slotEnableWidget(); Q_SIGNALS: void changed(); - void scaleChanged(double scale); + void scaleChanged(QSize size); void toSetScreenPos(); + void enabledChanged(); protected: virtual void initUi(); double getScreenScale(); @@ -56,9 +70,8 @@ protected: private: void initConnection(); - void initDpiConnection(); QString scaleToString(double scale); - void initRadeon(); + void hideComponent(); protected: KScreen::OutputPtr mOutput; @@ -67,20 +80,27 @@ protected: ResolutionSlider *mResolution = nullptr; QComboBox *mRotation = nullptr; + KSwitchButton *mAutoRotation = nullptr; QComboBox *mScale = nullptr; QComboBox *mRefreshRate = nullptr; QComboBox *mMonitor = nullptr; QComboBox *mScaleCombox = nullptr; + UkccFrame *mRotateFrame = nullptr; + UkccFrame *mAutoRotationFrame = nullptr; + bool mShowScaleOption = false; bool mIsWayland = false; bool mIsFirstLoad = true; bool mIsRestore = true; //非restore时不再去修改刷新率/分辨率,避免修改多次导致显示重复 - bool mIsRadeon; + bool needLogout = false; + bool mSetRestore = false; KScreen::ConfigPtr mConfig = nullptr; QGSettings *mDpiSettings = nullptr; + + QDBusInterface *mStatusManager = nullptr; }; #endif // OUTPUTCONFIG_H diff --git a/plugins/system/display/resolutionslider.cpp b/plugins/system/display/resolutionslider.cpp index 28e43d6..ca72acc 100644 --- a/plugins/system/display/resolutionslider.cpp +++ b/plugins/system/display/resolutionslider.cpp @@ -27,10 +27,6 @@ ResolutionSlider::ResolutionSlider(const KScreen::OutputPtr &output, QWidget *pa mExcludeModes.push_back(QSize(1152, 864)); } - //outputconfig与unfiedoutputconfig中已经监听,这里不需要重复监听 -// connect(output.data(), &KScreen::Output::currentModeIdChanged, -// this, &ResolutionSlider::slotOutputModeChanged); - connect(output.data(), &KScreen::Output::modesChanged, this, &ResolutionSlider::init); init(); @@ -42,14 +38,13 @@ ResolutionSlider::~ResolutionSlider() void ResolutionSlider::init() { - this->setMinimumSize(402, 36); - this->setMaximumSize(1677215, 36); + this->setMinimumWidth(402); + this->setMaximumWidth(1677215); mModes.clear(); Q_FOREACH (const KScreen::ModePtr &mode, mOutput->modes()) { if (mModes.contains(mode->size()) || mode->size().width() * mode->size().height() < 1024 * 768 - || mExcludeModes.contains(mode->size()) - || mode->size().width() < 1024) { + || mExcludeModes.contains(mode->size())) { continue; } mModes << mode->size(); @@ -66,17 +61,12 @@ void ResolutionSlider::init() if (!mModes.empty()) { std::reverse(mModes.begin(), mModes.end()); mComboBox = new QComboBox(this); - mComboBox->setMinimumSize(402, 36); - mComboBox->setMaximumSize(1677215, 36); + mComboBox->setMinimumWidth(402); + mComboBox->setMaximumWidth(1677215); int currentModeIndex = -1; int preferredModeIndex = -1; Q_FOREACH (const QSize &size, mModes) { -#ifdef __sw_64__ - if (size.width() < int(1920)) { - continue; - } -#endif mComboBox->addItem(Utils::sizeToString(size)); if (mOutput->currentMode() && (mOutput->currentMode()->size() == size)) { diff --git a/plugins/system/display/scalesize.h b/plugins/system/display/scalesize.h index 105122b..427ada6 100644 --- a/plugins/system/display/scalesize.h +++ b/plugins/system/display/scalesize.h @@ -37,4 +37,6 @@ extern double mScaleres; extern CONFIG changeItm; +extern bool autoScaleChange; + #endif // SCALESIZE_H diff --git a/plugins/system/display/splicedialog.cpp b/plugins/system/display/splicedialog.cpp new file mode 100644 index 0000000..f4702ac --- /dev/null +++ b/plugins/system/display/splicedialog.cpp @@ -0,0 +1,217 @@ +#include "splicedialog.h" +#include "ui_splicedialog.h" +#include + + +SpliceDialog::SpliceDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SpliceDialog) +{ + ui->setupUi(this); + this->setWindowTitle(tr("Splice Screen")); + ui->cancelBtn->setText(tr("Cancel")); + ui->okBtn->setText(tr("Ok")); + setWindowModality(Qt::WindowModal); + ui->widget->setStyleSheet("background-color:palette(window)"); + ui->spliceLabel->setText(tr("Splicing Method")); + + connect(this, &SpliceDialog::screenComboBoxChanged, this, [=](QComboBox *comboBox, int currentIndex){ + bool noneFlag = false; + if (currentIndex != 0) { + for (int var = 0; var < screenFrameList.size(); ++var) { + QComboBox *mComboBox = screenFrameList.at(var)->findChild(); + if (mComboBox != comboBox) { + if (mComboBox->currentIndex() == 0) { + noneFlag = true; + } + if (mComboBox->currentText() == comboBox->currentText()) { + mComboBox->blockSignals(true); + mComboBox->setCurrentIndex(0); + mComboBox->blockSignals(false); + noneFlag = true; + } + } + } + } else { + noneFlag = true; + } + if (!noneFlag) { + ui->okBtn->setEnabled(true); + } else { + ui->okBtn->setEnabled(false); + } + setScreenLabelPos(); + }); + + connect(ui->okBtn, &QPushButton::clicked, this, [=](){ + this->hide(); + Q_EMIT spliceScreenChanged(ui->spliceComboBox->currentText()); + }); + + connect(ui->cancelBtn, &QPushButton::clicked, this, [=](){ + this->hide(); + Q_EMIT finished(0); + }); + + connect(this, &SpliceDialog::finished, this, [=](){ + //各项设置需要恢复之前配置 + }); +} + +SpliceDialog::~SpliceDialog() +{ + delete ui; + ui = nullptr; +} + +void SpliceDialog::getRowsAndColumnsList() +{ + rowsAndColumnsList.clear(); + int connectedOutputNum = mConnectedOutputList.size(); + rowsAndColumnsList.append(QPoint(1, connectedOutputNum)); + for (int i = 2; i < (connectedOutputNum - 1); ++i) { + if (connectedOutputNum % i == 0) { + int j = connectedOutputNum / i; + rowsAndColumnsList.append(QPoint(i,j)); + } + } + rowsAndColumnsList.append(QPoint(connectedOutputNum, 1)); +} + + +void SpliceDialog::initSpliceComboBox() +{ + ui->spliceComboBox->disconnect(); + ui->spliceComboBox->clear(); + getRowsAndColumnsList(); + + for (int var = 0; var < rowsAndColumnsList.size(); ++var) { + QString row = QString::number(rowsAndColumnsList.at(var).x()); + QString column = QString::number(rowsAndColumnsList.at(var).y()); + QString rowName = rowsAndColumnsList.at(var).x() < 2 ? tr("row"):tr("rows"); + QString columnName = rowsAndColumnsList.at(var).y() < 2 ? tr("column"):tr("columns"); + ui->spliceComboBox->addItem(tr("%1 %2, %3 %4").arg(row, rowName, column, columnName),rowsAndColumnsList.at(var)); + } + + connect(ui->spliceComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int selectId) { + spliceComboBoxChanged(selectId); + setScreenLabelPos(); + }); +} + +void SpliceDialog::spliceComboBoxChanged(int selectId) +{ + Q_UNUSED(selectId); + qDeleteAll(screenFrameList); + screenFrameList.clear(); + + QPoint point = ui->spliceComboBox->currentData().toPoint(); + for (int i = 1; i <= point.x(); ++i) { + for (int j = 1; j <= point.y(); ++j) { + createScreenFrame(i, j); + } + } + + for (int var = 0; var < screenFrameList.size(); ++var) { + QComboBox *comboBox = screenFrameList.at(var)->findChild(); + comboBox->blockSignals(true); + comboBox->setCurrentIndex(var + 1); + comboBox->blockSignals(false); + ui->screenFrame->layout()->addWidget(screenFrameList.at(var)); + } + + this->setFixedHeight(332 + screenFrameList.size() * 52); +} + +void SpliceDialog::createScreenFrame(int r, int c) +{ + QString row = QString::number(r); + QString column = QString::number(c); + QString labelString = tr("Row %1, Column %2").arg(row, column); + QFrame *frame = new QFrame(this); + frame->setFixedHeight(52); + QHBoxLayout *layout = new QHBoxLayout(frame); + QLabel *label = new QLabel(frame); + QComboBox *comboBox = new QComboBox(frame); + comboBox->setFixedWidth(284); + layout->setSpacing(24); + layout->setContentsMargins(0,8,0,8); + layout->addWidget(label); + layout->addWidget(comboBox); + label->setText(labelString); + + comboBox->addItem(tr("Select screen"), QPoint(0,0)); + for (KScreen::OutputPtr output : mConnectedOutputList) { + comboBox->addItem(output->name(), QPoint(r, c)); + } + screenFrameList.append(frame); + connect(comboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int selectId) { + Q_EMIT screenComboBoxChanged(comboBox, selectId); + }); +} + +void SpliceDialog::createScreenLabel() +{ + qDeleteAll(screenLabelList); + screenLabelList.clear(); + for (KScreen::OutputPtr output : mConnectedOutputList) { + QLabel *screenLabel = new QLabel(ui->widget); + screenLabel->setStyleSheet("background:palette(button);"); + screenLabel->setText(output->name()); + screenLabel->setAlignment(Qt::AlignCenter); + screenLabelList.append(screenLabel); + } +} + +void SpliceDialog::setScreenLabelPos() +{ + QPoint point = ui->spliceComboBox->currentData().toPoint(); + int rows = point.x(); + int columns = point.y(); + int labelW = 86; + int labelH = 48; + + if (screenLabelList.size() == 4 && rows == 4) { + labelW = labelW/1.3; + labelH = labelH/1.3; + } + + int beginX = (ui->widget->width() - columns*labelW - 2*(columns - 1))/2; + int beginY = (ui->widget->height() - rows*labelH - 2*(rows - 1))/2; + + for (QLabel *screenLabel : screenLabelList) { + bool setPosFlag = false; + for (QFrame *frame : screenFrameList) { + QComboBox *comboBox = frame->findChild(); + if (comboBox->currentText() == screenLabel->text()) { + QPoint pos = comboBox->currentData().toPoint(); + int r = pos.x(); + int c = pos.y(); + if (r == 0 || c == 0) { + continue; + } + screenLabel->setGeometry(beginX + (c - 1)*labelW + (c - 1) * 2, + beginY + (r - 1)*labelH + (r - 1) * 2, + labelW, + labelH); + setPosFlag = true; + screenLabel->setVisible(true); + break; + } + } + if (!setPosFlag) { + screenLabel->setVisible(false); + } + } +} + +void SpliceDialog::init(KScreen::OutputList connectedOutputList) +{ + this->mConnectedOutputList = connectedOutputList; + initSpliceComboBox(); + spliceComboBoxChanged(0); + createScreenLabel(); + setScreenLabelPos(); +} + + diff --git a/plugins/system/display/splicedialog.h b/plugins/system/display/splicedialog.h new file mode 100644 index 0000000..516088b --- /dev/null +++ b/plugins/system/display/splicedialog.h @@ -0,0 +1,42 @@ +#ifndef SPLICEDIALOG_H +#define SPLICEDIALOG_H + +#include +#include "./declarative/qmlscreen.h" +#include +#include +#include + +namespace Ui { +class SpliceDialog; +} + +class SpliceDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SpliceDialog(QWidget *parent = nullptr); + ~SpliceDialog(); + void createScreenFrame(int r, int c); + void spliceComboBoxChanged(int selectId); + void initSpliceComboBox(); + void createScreenLabel(); + void setScreenLabelPos(); + void init(KScreen::OutputList connectedOutputList); + void getRowsAndColumnsList(); + +private: + Ui::SpliceDialog *ui; + QMLScreen *mScreen = nullptr; + KScreen::OutputList mConnectedOutputList; + QList rowsAndColumnsList; + QListscreenFrameList; + QListscreenLabelList; + +Q_SIGNALS: + void screenComboBoxChanged(QComboBox *comboBox, int currentIndex); + void spliceScreenChanged(QString spliceMethodText); +}; + +#endif // SPLICEDIALOG_H diff --git a/plugins/system/display/splicedialog.ui b/plugins/system/display/splicedialog.ui new file mode 100644 index 0000000..1e7b61a --- /dev/null +++ b/plugins/system/display/splicedialog.ui @@ -0,0 +1,290 @@ + + + SpliceDialog + + + + 0 + 0 + 520 + 332 + + + + + 520 + 332 + + + + + 520 + 332 + + + + Dialog + + + + 0 + + + 24 + + + 20 + + + 24 + + + 24 + + + + + + 472 + 160 + + + + + 472 + 160 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + + 0 + 52 + + + + + 16777215 + 52 + + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + 24 + + + 0 + + + 8 + + + 0 + + + 8 + + + + + Splicing Method + + + + + + + + 284 + 0 + + + + + 284 + 16777215 + + + + + + + + + + + + 16777215 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 24 + + + + + + + + + 0 + 36 + + + + + 16777215 + 36 + + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + 16 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 96 + 36 + + + + + 96 + 36 + + + + Cancel + + + + + + + + 96 + 36 + + + + + 96 + 36 + + + + Ok + + + + + + + + + + + diff --git a/plugins/system/display/unifiedoutputconfig.cpp b/plugins/system/display/unifiedoutputconfig.cpp index f1233aa..2bcbef6 100644 --- a/plugins/system/display/unifiedoutputconfig.cpp +++ b/plugins/system/display/unifiedoutputconfig.cpp @@ -2,6 +2,7 @@ #include "resolutionslider.h" #include "scalesize.h" #include "utils.h" +#include "common.h" #include #include @@ -15,10 +16,19 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include +#include +#include +#include +using namespace KScreen; bool operator<(const QSize &s1, const QSize &s2) { @@ -60,14 +70,14 @@ void UnifiedOutputConfig::initUi() { QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setContentsMargins(0, 0, 0, 0); - vbox->setSpacing(0); + vbox->setSpacing(1); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); KScreen::OutputPtr fakeOutput = createFakeOutput(); mResolution = new ResolutionSlider(fakeOutput, this); mResolution->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mResolution->setMinimumSize(402, 36); + mResolution->setMinimumWidth(402); //监听,否则无法处理修改分辨率/刷新率未保存 connect(mOutput.data(), &KScreen::Output::currentModeIdChanged, @@ -79,48 +89,39 @@ void UnifiedOutputConfig::initUi() QLabel *resLabel = new QLabel(this); resLabel->setText(tr("resolution")); resLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - resLabel->setMinimumSize(118, 36); - resLabel->setMaximumSize(118, 36); + resLabel->setFixedWidth(108); QHBoxLayout *resLayout = new QHBoxLayout(); - resLayout->setContentsMargins(14, 0, 7, 0); + resLayout->setContentsMargins(16, 0, 16, 0); resLayout->addWidget(resLabel); resLayout->addWidget(mResolution); + resLayout->setSpacing(16); - QFrame *resFrame = new QFrame(this); - resFrame->setFrameShape(QFrame::Shape::Box); + UkccFrame *resFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); resFrame->setLayout(resLayout); - - resFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - resFrame->setMinimumWidth(552); - resFrame->setFixedHeight(50); - - QFrame *line1 = setLine(resFrame); vbox->addWidget(resFrame); - vbox->addWidget(line1); connect(mResolution, &ResolutionSlider::resolutionChanged, this, [=](QSize size, bool emitFlag){ slotResolutionChanged(size, emitFlag); + emit scaleChanged(size); + Common::buriedSettings(QString("display"), QString("U-mResolution"), QString("select"), Utils::sizeToString(size)); }); // 方向下拉框 mRotation = new QComboBox(this); - - mRotation->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mRotation->setMinimumSize(402, 36); - mRotation->setMaximumSize(16777215, 36); + mRotation->setMinimumWidth(402); + mRotation->setMaximumWidth(16777215); QLabel *rotateLabel = new QLabel(this); rotateLabel->setText(tr("orientation")); rotateLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - rotateLabel->setMinimumSize(118, 36); - rotateLabel->setMaximumSize(118, 36); + rotateLabel->setFixedWidth(108); mRotation->addItem(tr("arrow-up"), KScreen::Output::None); mRotation->addItem(tr("90° arrow-right"), KScreen::Output::Right); - mRotation->addItem(tr("arrow-down"), KScreen::Output::Inverted); mRotation->addItem(tr("90° arrow-left"), KScreen::Output::Left); + mRotation->addItem(tr("arrow-down"), KScreen::Output::Inverted); int index = mRotation->findData(mOutput->rotation()); mRotation->setCurrentIndex(index); @@ -129,48 +130,82 @@ void UnifiedOutputConfig::initUi() this, &UnifiedOutputConfig::slotRotationChangedDerived); QHBoxLayout *roatateLayout = new QHBoxLayout(); - roatateLayout->setContentsMargins(14, 0, 7, 0); + roatateLayout->setContentsMargins(16, 0, 16, 0); roatateLayout->addWidget(rotateLabel); roatateLayout->addWidget(mRotation); + roatateLayout->setSpacing(16); - QFrame *rotateFrame = new QFrame(this); - rotateFrame->setFrameShape(QFrame::Shape::Box); - rotateFrame->setLayout(roatateLayout); + mRotateFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); + mRotateFrame->setLayout(roatateLayout); + vbox->addWidget(mRotateFrame); - rotateFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - rotateFrame->setMinimumWidth(552); - rotateFrame->setFixedHeight(50); + // 自动旋转 + mAutoRotation = new KSwitchButton(this); - QFrame *line2 = setLine(rotateFrame); - vbox->addWidget(rotateFrame); - vbox->addWidget(line2); + QLabel *autoRotateLabel = new QLabel(this); + //~ contents_path /Display/auto rotation + autoRotateLabel->setText(tr("auto rotation")); + autoRotateLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + autoRotateLabel->setFixedWidth(108); + + QHBoxLayout *autoRotateLayout = new QHBoxLayout(); + autoRotateLayout->setContentsMargins(16, 0, 16, 0); + autoRotateLayout->setSpacing(16); + autoRotateLayout->addWidget(autoRotateLabel); + autoRotateLayout->addStretch(); + autoRotateLayout->addWidget(mAutoRotation); + + mAutoRotationFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); + mAutoRotationFrame->setLayout(autoRotateLayout); + + vbox->addWidget(mAutoRotationFrame); + mAutoRotationFrame->setVisible(false); + + mStatusManager = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + + if (mStatusManager->isValid()) { + QDBusReply isSupportedAuto = mStatusManager->call("is_supported_autorotation"); + qDebug() << "isSupportedAuto = " << isSupportedAuto; + if (isSupportedAuto) { + mAutoRotationFrame->setVisible(true); + } + QDBusReply isAutoRotation = mStatusManager->call("get_auto_rotation"); + mAutoRotation->setChecked(isAutoRotation); + mRotation->setEnabled(!isAutoRotation); + connect(mStatusManager, SIGNAL(auto_rotation_change_signal(bool)), this, SLOT(rotationDbusSlot(bool))); + connect(mStatusManager, SIGNAL(rotations_change_signal(QString)), this, SLOT(rotationDirectionSlot(QString))); + } + + connect(mAutoRotation, &KSwitchButton::stateChanged, this, [=](bool checked){ + mRotation->setEnabled(!checked); + if (mStatusManager->isValid()) { + mStatusManager->call("set_auto_rotation", checked, "ukcc", "set_auto_rotation"); + } + }); // 统一输出刷新率下拉框 mRefreshRate = new QComboBox(this); - mRefreshRate->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mRefreshRate->setMinimumSize(402, 36); - mRefreshRate->setMaximumSize(16777215, 36); + mRefreshRate->setMinimumWidth(402); + mRefreshRate->setMaximumWidth(16777215); QLabel *freshLabel = new QLabel(this); freshLabel->setText(tr("frequency")); freshLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - freshLabel->setMinimumSize(118, 36); - freshLabel->setMaximumSize(118, 36); + freshLabel->setFixedWidth(108); QHBoxLayout *freshLayout = new QHBoxLayout(); - freshLayout->setContentsMargins(14, 0, 7, 0); + freshLayout->setContentsMargins(16, 0, 16, 0); + freshLayout->setSpacing(16); freshLayout->addWidget(freshLabel); freshLayout->addWidget(mRefreshRate); - QFrame *freshFrame = new QFrame(this); - freshFrame->setFrameShape(QFrame::Shape::Box); + UkccFrame *freshFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); freshFrame->setLayout(freshLayout); - vbox->addWidget(freshFrame); - freshFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - freshFrame->setMinimumWidth(552); - freshFrame->setFixedHeight(50); slotResolutionChanged(mResolution->currentResolution(), true); connect(mRefreshRate, static_cast(&QComboBox::currentIndexChanged), @@ -187,45 +222,35 @@ void UnifiedOutputConfig::initUi() } }); - // 缩放率下拉框 - QFrame *scaleFrame = new QFrame(this); - scaleFrame->setFrameShape(QFrame::Shape::Box); - - QFrame *line3 = setLine(scaleFrame); - - scaleFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - scaleFrame->setMinimumWidth(550); - scaleFrame->setFixedHeight(50); + if (!Common::isOpenkylin()) + return; + UkccFrame *scaleFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); QHBoxLayout *scaleLayout = new QHBoxLayout(scaleFrame); - scaleLayout->setContentsMargins(14, 0, 7, 0); - + scaleLayout->setContentsMargins(16, 0, 16, 0); + scaleLayout->setSpacing(16); mScaleCombox = new QComboBox(this); mScaleCombox->setObjectName("scaleCombox"); - mScaleCombox->setFixedHeight(36); QLabel *scaleLabel = new QLabel(this); //~ contents_path /Display/screen zoom scaleLabel->setText(tr("screen zoom")); scaleLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - scaleLabel->setFixedSize(118, 36); + scaleLabel->setFixedWidth(108); scaleLayout->addWidget(scaleLabel); scaleLayout->addWidget(mScaleCombox); - vbox->addWidget(line3); vbox->addWidget(scaleFrame); - connect(mScaleCombox, static_cast(&QComboBox::currentIndexChanged), - this, &UnifiedOutputConfig::slotScaleChanged); + connect(mOutput.data(), &KScreen::Output::scaleChanged, + this, &OutputConfig::initScaleItem); + connect(mOutput.data(), &KScreen::Output::currentModeIdChanged, + this, &UnifiedOutputConfig::initScaleItem); +// scaleFrame->hide(); initScaleItem(); - - connect(mScaleCombox, static_cast(&QComboBox::currentIndexChanged), - this, [=](int index){ - slotScaleChanged(index); - }); } KScreen::OutputPtr UnifiedOutputConfig::createFakeOutput() @@ -382,20 +407,6 @@ void UnifiedOutputConfig::slotResolutionChanged(const QSize &size, bool emitFlag } } -void UnifiedOutputConfig::slotScaleChanged(int index) -{ - mScaleCombox->blockSignals(true); - qreal kscreenScale = mScaleCombox->itemData(index).toDouble(); - - Q_FOREACH (const KScreen::OutputPtr &clone, mClones) { - clone->setScale(kscreenScale); - } - - changeItm = SCALE; - Q_EMIT changed(); - mScaleCombox->blockSignals(false); -} - void UnifiedOutputConfig::slotRefreshRateChanged(int index) { Q_FOREACH (const KScreen::OutputPtr &clone, mClones) { @@ -411,6 +422,21 @@ void UnifiedOutputConfig::slotRefreshRateChanged(int index) } changeItm = FREQUENCY; Q_EMIT changed(); + Common::buriedSettings(QString("display"), QString("U-mRefreshRate"), QString("select"), mRefreshRate->currentText()); +} + +void UnifiedOutputConfig::slotScaleChanged(int index) +{ + mScaleCombox->blockSignals(true); + qreal kscreenScale = mScaleCombox->itemData(index).toDouble(); + + Q_FOREACH (const KScreen::OutputPtr &clone, mClones) { + clone->setScale(kscreenScale); + } + + changeItm = SCALE; + Q_EMIT changed(); + mScaleCombox->blockSignals(false); } QString UnifiedOutputConfig::findBestMode(const KScreen::OutputPtr &output, const QSize &size) @@ -440,16 +466,44 @@ void UnifiedOutputConfig::slotRotationChangedDerived(int index) } changeItm = ORIENTATION; Q_EMIT changed(); + Common::buriedSettings(QString("display"), QString("U-mRotation"), QString("select"), QString::number(index)); +} + +void UnifiedOutputConfig::rotationDbusSlot(bool autoRotation) +{ + mRotation->setEnabled(!autoRotation); + mAutoRotation->blockSignals(true); + mAutoRotation->setChecked(autoRotation); + mAutoRotation->blockSignals(false); +} + +void UnifiedOutputConfig::rotationDirectionSlot(QString rotationDirection) +{ + mRotation->blockSignals(true); + if (rotationDirection.compare("normal") == 0) { + mRotation->setCurrentIndex(KScreen::Output::None); + } else if (rotationDirection.compare("upside-down") == 0) { + mRotation->setCurrentIndex(KScreen::Output::Inverted); + } else if (rotationDirection.compare("left") == 0) { + mRotation->setCurrentIndex(KScreen::Output::Left); + } else if (rotationDirection.compare("right") == 0) { + mRotation->setCurrentIndex(KScreen::Output::Right); + } + mRotation->blockSignals(false); } void UnifiedOutputConfig::slotRestoreResoltion() { if (!mIsRestore || !mOutput->currentMode()) { mIsRestore = true; - return; + if (!mSetRestore) { + return; + } } + mSetRestore = false; if (mResolution->currentResolution() != mOutput->currentMode()->size()) { //分辨率改变时,触发该信号重新加载刷新率,用于修改分辨率之后但未保存 mResolution->setResolution(mOutput->currentMode()->size()); //这里面不会触发分辨率改变信号 + Q_EMIT scaleChanged(mOutput->currentMode()->size()); slotResolutionChanged(mOutput->currentMode()->size(), false); } else { //分辨率未修改,刷新率修改,用于修改刷新率之后但未保存 for (int i = 0; i < mRefreshRate->count(); i++) { @@ -496,11 +550,13 @@ bool UnifiedOutputConfig::isCloneMode() void UnifiedOutputConfig::initScaleItem() { + if (!Common::isOpenkylin()) + return; mScaleCombox->blockSignals(true); if (!mOutput->currentMode()) return; QSize scalesize = mOutput->currentMode()->size(); - mScaleCombox->clear(); + mScaleCombox->addItem("100%", 1.0); if (scalesize.width() > 1024 ) { mScaleCombox->addItem("125%", 1.25); @@ -527,7 +583,7 @@ void UnifiedOutputConfig::initScaleItem() if (mScaleCombox->findData(mOutput->scale()) == -1) { Q_FOREACH (const KScreen::OutputPtr &clone, mClones) { - clone->setScale(0.5); + clone->setScale(1); } } @@ -535,6 +591,31 @@ void UnifiedOutputConfig::initScaleItem() mScaleCombox->blockSignals(false); } +double UnifiedOutputConfig::getGlobalData(OutputPtr output) +{ + QString hash = mConfig->connectedOutputsHash(); + + QString scaleDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + %QStringLiteral("/kscreen/scale/"); + QFile file(scaleDir % hash); + if (!file.open(QIODevice::ReadOnly)) { + qDebug() << "Failed to open file" << file.fileName(); + return 0; + } + + QByteArray readBy=file.readAll(); + QJsonParseError error; + QJsonDocument readDoc=QJsonDocument::fromJson(readBy,&error); + QJsonArray obj=readDoc.array(); + + for (int i = 0 ; i < obj.size(); i++) { + QJsonObject faObj= obj[i].toObject(); + if (faObj["id"].toString() == output->hashMd5()) + return faObj["scale"].toDouble(); + } + return 0; +} + QFrame *UnifiedOutputConfig::setLine(QFrame *frame) { QFrame *line = new QFrame(frame); diff --git a/plugins/system/display/unifiedoutputconfig.h b/plugins/system/display/unifiedoutputconfig.h index c3e8d36..da81231 100644 --- a/plugins/system/display/unifiedoutputconfig.h +++ b/plugins/system/display/unifiedoutputconfig.h @@ -17,14 +17,16 @@ public: void setOutput(const KScreen::OutputPtr &output) override; bool isCloneMode(); - void initScaleItem(); + + double getGlobalData(KScreen::OutputPtr output); private Q_SLOTS: void slotResolutionChanged(const QSize &size, bool emitFlag); // 统一输出后调整屏幕方向统一代码 void slotRotationChangedDerived(int index); - + void rotationDbusSlot(bool autoRotation); + void rotationDirectionSlot(QString rotationDirection); void slotRestoreResoltion(); void slotRestoreRatation(); void slotRefreshRateChanged(int index); @@ -40,6 +42,12 @@ private: KScreen::ConfigPtr mConfig; QList mClones; bool mIsRestore; + bool needLogout = false; + QMap mScaleList; + QDBusInterface *mStatusManager = nullptr; + +Q_SIGNALS: + void scaleChanged(QSize size); }; #endif // UNIFIEDOUTPUTCONFIG_H diff --git a/plugins/system/display/utils.cpp b/plugins/system/display/utils.cpp index 39f4ba2..7f5372a 100644 --- a/plugins/system/display/utils.cpp +++ b/plugins/system/display/utils.cpp @@ -3,11 +3,10 @@ #include #include -#include "../../../shell/utils/utils.h" - QString Utils::outputName(const KScreen::OutputPtr &output) { - return output->name(); + if (output) return output->name(); + return QString(); } QString Utils::outputName(const KScreen::Output *output) diff --git a/plugins/system/display/widget.cpp b/plugins/system/display/widget.cpp index 86c09c9..8ed00f8 100644 --- a/plugins/system/display/widget.cpp +++ b/plugins/system/display/widget.cpp @@ -7,7 +7,7 @@ #include "displayperformancedialog.h" #include "colorinfo.h" #include "scalesize.h" -#include "../../../shell/utils/utils.h" +#include "common.h" #include #include @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include @@ -105,23 +107,24 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::DisplayWindow()) { - cpuArchitecture = Utils::getCpuArchitecture(); + cpuArchitecture = Common::getCpuArchitecture(); qRegisterMetaType(); ui->setupUi(this); + initUi(); initNightModeUi(); initAutoBrihgtUI(); + initSpliceFrame(); initDbusComponent(); ui->quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView); ui->quickWidget->setContentsMargins(0, 0, 0, 9); - + spliceDialog = new SpliceDialog(this); qDBusRegisterMetaType(); firstAddOutputName = ""; + connectedOutputNum = 0; initComponent(); setHideModuleInfo(); - initNightUI(); - setTitleLabel(); initGSettings(); setNightComponent(); initUiComponent(); @@ -138,12 +141,21 @@ Widget::Widget(QWidget *parent) : initConnection(); loadQml(); - ui->scaleFrame->hide(); - ui->frame_3->hide(); + if (Common::isOpenkylin()) { + scaleFrame->hide(); + } + mScreenScale = scaleGSettings->get(SCALE_KEY).toDouble(); } Widget::~Widget() { + for (BrightnessFrame *m_frame : BrightnessFrameV) { + if (m_frame) { + delete m_frame; + m_frame = nullptr; + } + } + spliceDialog->deleteLater(); clearOutputIdentifiers(); delete ui; ui = nullptr; @@ -234,6 +246,12 @@ void Widget::setConfig(const KScreen::ConfigPtr &config) slotUnifyOutputs(); } setMulScreenVisiable(); + changescale(); + compareScale(); + if (mIsSCaleRes) { + mIsSCaleRes = false; + showZoomtips(); + } } mFirstLoad = false; @@ -248,73 +266,40 @@ void Widget::initNightModeUi() { ui->verticalLayout->setSpacing(8); mNightModeLabel = new TitleLabel(this); + //~ contents_path /Display/Night Mode mNightModeLabel->setText(tr("Night Mode")); + mNightModeFrame = new SettingGroup(this); - mNightModeFrame = new QFrame(this); - mNightModeFrame->setMinimumSize(550, 0); - mNightModeFrame->setMaximumSize(16777215, 16777215); - mNightModeFrame->setFrameShape(QFrame::Box); - - QVBoxLayout *mNightModeLyt = new QVBoxLayout(mNightModeFrame); - mNightModeLyt->setSpacing(0); - mNightModeLyt->setContentsMargins(8, 0, 0, 0); - - /* Open */ - mOpenFrame = new QFrame(mNightModeFrame); - mOpenFrame->setMinimumSize(550, 60); - mOpenFrame->setMaximumSize(16777215, 60); - mOpenFrame->setFrameShape(QFrame::NoFrame); - QHBoxLayout *mOpenLyt = new QHBoxLayout(mOpenFrame); - mOpenLyt->setSpacing(0); - mOpenLabel = new QLabel(mOpenFrame); - mOpenLabel->setFixedWidth(200); - mOpenLabel->setText(tr("Open")); - mNightModeBtn = new KSwitchButton(mOpenFrame); - mOpenLyt->addWidget(mOpenLabel); - mOpenLyt->addStretch(); - mOpenLyt->addWidget(mNightModeBtn); + /* Open */ + mNightModeWidget = new SwitchWidget(tr("Open")); /* Time Mode */ - mTimeModeFrame = new QFrame(mNightModeFrame); - mTimeModeFrame->setMinimumSize(550, 60); - mTimeModeFrame->setMaximumSize(16777215, 60); - mTimeModeFrame->setFrameShape(QFrame::NoFrame); - QHBoxLayout *mTimeModeLyt = new QHBoxLayout(mTimeModeFrame); - mTimeModeLyt->setSpacing(8); - mTimeModeLabel = new QLabel(mTimeModeFrame); - mTimeModeLabel->setFixedWidth(200); - mTimeModeLabel->setText(tr("Time")); - mTimeModeCombox = new QComboBox(mTimeModeFrame); - mTimeModeCombox->setMinimumWidth(0); - mTimeModeCombox->setMaximumWidth(16777215); - mTimeModeLyt->addWidget(mTimeModeLabel); - mTimeModeLyt->addWidget(mTimeModeCombox); + mTimeModeWidget = new ComboxWidget(tr("Time"), this); + mTimeModeWidget->setTitleFixedWidth(108); /* Custom Time */ - mCustomTimeFrame = new QFrame(mNightModeFrame); - mCustomTimeFrame->setMinimumSize(550, 60); - mCustomTimeFrame->setMaximumSize(16777215, 60); - mCustomTimeFrame->setFrameShape(QFrame::NoFrame); - QHBoxLayout *mCustomTimeLyt = new QHBoxLayout(mCustomTimeFrame); + mCustomTimeWidget = new UkccFrame(this, UkccFrame::BorderRadiusStyle::Around, true); + QHBoxLayout *mCustomTimeLyt = new QHBoxLayout(mCustomTimeWidget); + mCustomTimeLyt->setContentsMargins(16, 0, 16, 0); mCustomTimeLyt->setSpacing(8); - mCustomTimeLabel = new QLabel(mCustomTimeFrame); + mCustomTimeLabel = new QLabel(mCustomTimeWidget); mCustomTimeLabel->setFixedWidth(350); mCustomTimeLabel->setText(tr("Custom Time")); - mOpenTimeHCombox = new QComboBox(mCustomTimeFrame); + mOpenTimeHCombox = new QComboBox(mCustomTimeWidget); mOpenTimeHCombox->setFixedWidth(64); - mQpenTimeMCombox = new QComboBox(mCustomTimeFrame); + mQpenTimeMCombox = new QComboBox(mCustomTimeWidget); mQpenTimeMCombox->setFixedWidth(64); - mCloseTimeHCombox = new QComboBox(mCustomTimeFrame); + mCloseTimeHCombox = new QComboBox(mCustomTimeWidget); mCloseTimeHCombox->setFixedWidth(64); - mCloseTimeMCombox = new QComboBox(mCustomTimeFrame); + mCloseTimeMCombox = new QComboBox(mCustomTimeWidget); mCloseTimeMCombox->setFixedWidth(64); - mLabel_1 = new QLabel(mCustomTimeFrame); + mLabel_1 = new QLabel(mCustomTimeWidget); mLabel_1->setFixedWidth(20); mLabel_1->setText(tr("to")); - QLabel *mLabel_2 = new QLabel(mCustomTimeFrame); + QLabel *mLabel_2 = new QLabel(mCustomTimeWidget); mLabel_2->setFixedWidth(4); mLabel_2->setText(":"); - QLabel *mLabel_3 = new QLabel(mCustomTimeFrame); + QLabel *mLabel_3 = new QLabel(mCustomTimeWidget); mLabel_3->setFixedWidth(4); mLabel_3->setText(":"); mCustomTimeLyt->addWidget(mCustomTimeLabel); @@ -328,52 +313,19 @@ void Widget::initNightModeUi() mCustomTimeLyt->addWidget(mCloseTimeMCombox); /* Color Temperature */ - mTemptFrame = new QFrame(mNightModeFrame); - mTemptFrame->setMinimumSize(550, 60); - mTemptFrame->setMaximumSize(16777215, 60); - mTemptFrame->setFrameShape(QFrame::NoFrame); - QHBoxLayout *mTemptLyt = new QHBoxLayout(mTemptFrame); - mTemptLyt->setSpacing(8); - mTemptLabel = new FixLabel(mTemptFrame); - mTemptLabel->setFixedWidth(200); - mTemptLabel->setText(tr("Color Temperature")); - mWarmLabel = new FixLabel(mTemptFrame); - mWarmLabel->setFixedWidth(64); - mWarmLabel->setText(tr("Warmer")); - mColdLabel = new FixLabel(mTemptFrame); - mColdLabel->setFixedWidth(64); - mColdLabel->setText(tr("Colder")); - mColdLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); - mTemptSlider = new Uslider(mTemptFrame); - mTemptSlider->setMinimumWidth(0); - mTemptSlider->setMinimumWidth(16777215); - mTemptSlider->setOrientation(Qt::Orientation::Horizontal); - mTemptLyt->addWidget(mTemptLabel); - mTemptLyt->addWidget(mWarmLabel); - mTemptLyt->addWidget(mTemptSlider); - mTemptLyt->addWidget(mColdLabel); + mTemptWidget = new SliderWidget(tr("Color Temperature"), false, this); + mTemptWidget->setTitleFixedWidth(100); + mTemptWidget->setLeftText(tr("Warmer")); + mTemptWidget->setRightText(tr("Colder")); - line_1 = setLine(mNightModeFrame); - line_2 = setLine(mNightModeFrame); - line_3 = setLine(mNightModeFrame); - - mNightModeLyt->addWidget(mOpenFrame); - mNightModeLyt->addWidget(line_1); - mNightModeLyt->addWidget(mTimeModeFrame); - mNightModeLyt->addWidget(line_2); - mNightModeLyt->addWidget(mCustomTimeFrame); - mNightModeLyt->addWidget(line_3); - mNightModeLyt->addWidget(mTemptFrame); + mNightModeFrame->addWidget(mNightModeWidget); + mNightModeFrame->addWidget(mTimeModeWidget); + mNightModeFrame->addWidget(mCustomTimeWidget); + mNightModeFrame->addWidget(mTemptWidget); ui->verticalLayout->addWidget(mNightModeLabel); ui->verticalLayout->addWidget(mNightModeFrame); - ui->sunframe->setVisible(false); - ui->customframe->setVisible(false); - ui->temptframe->setVisible(false); - ui->themeFrame->setVisible(false); - ui->nightframe->setVisible(false); - ui->opframe->setVisible(false); - ui->clsframe->setVisible(false); + } void Widget::loadQml() @@ -404,9 +356,9 @@ void Widget::loadQml() void Widget::resetPrimaryCombo() { // Don't emit currentIndexChanged when resetting - bool blocked = ui->primaryCombo->blockSignals(true); - ui->primaryCombo->clear(); - ui->primaryCombo->blockSignals(blocked); + bool blocked = monitorComboBox->blockSignals(true); + monitorComboBox->clear(); + monitorComboBox->blockSignals(blocked); if (!mConfig) { return; @@ -424,11 +376,11 @@ void Widget::addOutputToPrimaryCombo(const KScreen::OutputPtr &output) return; } - ui->primaryCombo->addItem(Utils::outputName(output), output->id()); + monitorComboBox->addItem(Utils::outputName(output), output->id()); if (output->isPrimary() && !mIsWayland) { Q_ASSERT(mConfig); - int lastIndex = ui->primaryCombo->count() - 1; - ui->primaryCombo->setCurrentIndex(lastIndex); + int lastIndex = monitorComboBox->count() - 1; + monitorComboBox->setCurrentIndex(lastIndex); } } @@ -439,11 +391,11 @@ void Widget::slotFocusedOutputChanged(QMLOutput *output) // 读取屏幕点击选择下拉框 Q_ASSERT(mConfig); - int index = output->outputPtr().isNull() ? 0 : ui->primaryCombo->findData(output->outputPtr()->id()); - if (index == -1 || index == ui->primaryCombo->currentIndex()) { + int index = output->outputPtr().isNull() ? 0 : monitorComboBox->findData(output->outputPtr()->id()); + if (index == -1 || index == monitorComboBox->currentIndex()) { return; } - ui->primaryCombo->setCurrentIndex(index); + monitorComboBox->setCurrentIndex(index); } void Widget::slotFocusedOutputChangedNoParam() @@ -542,9 +494,8 @@ void Widget::slotUnifyOutputs() setConfig(mPrevConfig); - ui->primaryCombo->setEnabled(isExtendMode); - ui->showMonitorframe->setVisible(mPrevConfig->connectedOutputs().count() > 1); - ui->zoomFrame->setVisible(isExtendMode); + monitorComboBox->setEnabled(isExtendMode); + openMonitorFrame->setVisible(mPrevConfig->connectedOutputs().count() > 1); } else if (mIscloneMode) { // Clone the current config, so that we can restore it in case user // breaks the cloning @@ -581,11 +532,10 @@ void Widget::slotUnifyOutputs() mScreen->updateOutputsPlacement(); // 关闭开关 - mCloseScreenButton->setEnabled(false); - ui->showMonitorframe->setVisible(false); - ui->zoomFrame->setVisible(false); - ui->primaryCombo->setEnabled(false); - ui->mainScreenButton->setVisible(false); + openMonitorButton->setEnabled(false); + openMonitorFrame->setVisible(false); + monitorComboBox->setEnabled(false); + monitorBtn->setVisible(false); mControlPanel->setUnifiedOutput(base->outputPtr()); } } @@ -640,29 +590,33 @@ KScreen::OutputPtr Widget::findOutput(const KScreen::ConfigPtr &config, const QV void Widget::initComponent() { - mCloseScreenButton = new KSwitchButton(this); - ui->showScreenLayout->addWidget(mCloseScreenButton); - - mMultiScreenFrame = new QFrame(this); - mMultiScreenFrame->setFrameShape(QFrame::Shape::Box); - QHBoxLayout *multiScreenlay = new QHBoxLayout(); mMultiScreenLabel = new QLabel(tr("Multi-screen"), this); - mMultiScreenLabel->setFixedSize(118, 30); + mMultiScreenLabel->setFixedSize(108, 30); mMultiScreenCombox = new QComboBox(this); - +#ifndef MAVIS mMultiScreenCombox->addItem(tr("First Screen")); mMultiScreenCombox->addItem(tr("Vice Screen")); +#endif mMultiScreenCombox->addItem(tr("Extend Screen")); mMultiScreenCombox->addItem(tr("Clone Screen")); - - multiScreenlay->addSpacing(6); +#ifndef BUILD_NO_SPLICE_SCREEN + mMultiScreenCombox->addItem(tr("Splice Screen")); +#endif + multiScreenlay->setContentsMargins(16, 0, 16, 0); + multiScreenlay->setSpacing(16); multiScreenlay->addWidget(mMultiScreenLabel); multiScreenlay->addWidget(mMultiScreenCombox); - mMultiScreenFrame->setLayout(multiScreenlay); - ui->multiscreenLyt->addWidget(mMultiScreenFrame); + mMultiScreenFrame->setLayout(multiScreenlay); + + if (m_StatusDbus->isValid()) { + QDBusReply is_tabletmode = m_StatusDbus->call("get_current_tabletmode"); + if (is_tabletmode) { + mMultiScreenCombox->setEnabled(false); + } + } } void Widget::initDbusComponent() @@ -677,9 +631,17 @@ void Widget::initDbusComponent() "org.ukui.SettingsDaemon.xrandr", QDBusConnection::sessionBus(), this); - QDBusReply reply = mUsdDbus->call("getScreenMode", "ukui-control-center"); - mKdsStatus = reply.value(); - (reply == USD_CLONE_MODE) ? mIscloneMode = true : mIscloneMode = false; + + if (mUsdDbus->isValid()) { + QDBusReply reply = mUsdDbus->call("getScreenMode", "ukui-control-center"); + mKdsStatus = reply.value(); + (reply == USD_CLONE_MODE) ? mIscloneMode = true : mIscloneMode = false; + } + + m_StatusDbus = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); } void Widget::setHideModuleInfo() @@ -691,11 +653,6 @@ void Widget::setHideModuleInfo() // } } -void Widget::setTitleLabel() -{ - ui->primaryLabel->setText(tr("monitor")); -} - void Widget::writeScale(double scale) { if (scale != scaleGSettings->get(SCALE_KEY).toDouble()) { @@ -712,37 +669,23 @@ void Widget::writeScale(double scale) } else { mIsChange = false; } - } else { - return; - } + mIsScaleChanged = false; - mIsScaleChanged = false; + } } void Widget::initGSettings() { - QByteArray id(UKUI_CONTORLCENTER_PANEL_SCHEMAS); - if (QGSettings::isSchemaInstalled(id)) { - mGsettings = new QGSettings(id, QByteArray(), this); - if (mGsettings->keys().contains(THEME_NIGHT_KEY)) { - mThemeButton->setChecked(mGsettings->get(THEME_NIGHT_KEY).toBool()); - } - } else { - qDebug() << Q_FUNC_INFO << "org.ukui.control-center.panel.plugins not install"; - } - QByteArray nightId(SETTINGS_DAEMON_COLOR_SCHEMAS); if(QGSettings::isSchemaInstalled(nightId)) { m_colorSettings = new QGSettings(nightId); - // 暂时解决点击夜间模式闪退问题 - //m_colorSettings = nullptr; if (m_colorSettings) { connect(m_colorSettings, &QGSettings::changed, [=](const QString &key){ if(key == "nightLightTemperature") { int value = m_colorSettings->get(NIGHT_TEMPERATURE_KEY).toInt(); - mTemptSlider->setValue(value); + mTemptWidget->setValue(value); } else if(key == "nightLightScheduleAutomatic" || key == "nightLightEnabled" || key == "nightLightAllday") { setNightModeSetting(); @@ -770,51 +713,33 @@ void Widget::setcomBoxScale() writeScale(scale); } -void Widget::initNightUI() -{ - QHBoxLayout *nightLayout = new QHBoxLayout(ui->nightframe); - //~ contents_path /Display/night mode - nightLabel = new QLabel(tr("night mode"), this); - mNightButton = new KSwitchButton(this); - nightLayout->addWidget(nightLabel); - nightLayout->addStretch(); - nightLayout->addWidget(mNightButton); - - QHBoxLayout *themeLayout = new QHBoxLayout(ui->themeFrame); - mThemeButton = new KSwitchButton(this); - themeLayout->addWidget(new QLabel(tr("Theme follow night mode"))); - themeLayout->addStretch(); - themeLayout->addWidget(mThemeButton); -} - void Widget::initAutoBrihgtUI() { - if (Utils::isTablet()) { + if (Common::isTablet()) { //~ contents_path /Display/Auto Brightness - mAutoBrightLabel = new QLabel(tr("Auto Brightness"), this); - mAutoBrightLabel->setFixedSize(125, 50); + QHBoxLayout *autoBrightLayout = new QHBoxLayout(autoBrightFrame); + QHBoxLayout *backLightLayout = new QHBoxLayout(backLightFrame); + mAutoBrightLabel = new QLabel(tr("Auto Brightness"), autoBrightFrame); + mAutoBrightLabel->setFixedWidth(125); mAutoBrightBtn = new KSwitchButton(this); mBrightHintLabel = new LightLabel(tr("Adjust screen brightness by ambient"), this); - ui->autoBrightnessLayt->addWidget(mAutoBrightLabel); - ui->autoBrightnessLayt->addWidget(mBrightHintLabel); - ui->autoBrightnessLayt->addStretch(); - ui->autoBrightnessLayt->addWidget(mAutoBrightBtn); + autoBrightLayout->addWidget(mAutoBrightLabel); + autoBrightLayout->addWidget(mBrightHintLabel); + autoBrightLayout->addStretch(); + autoBrightLayout->addWidget(mAutoBrightBtn); //~ contents_path /Display/Dynamic light mBackBrightLabel = new QLabel(tr("Dynamic light"), this); - mBackBrightLabel->setFixedSize(125, 50); + mBackBrightLabel->setFixedWidth(125); mBackHintLabel = new LightLabel(tr("Optimize display content to extend battery life"), this); mBackBrightBtn = new KSwitchButton(this); - - QFrame *line = setLine(ui->frame); - ui->backLightLineLyt->addWidget(line); - ui->backBrightLyt->addWidget(mBackBrightLabel); - ui->backBrightLyt->addWidget(mBackHintLabel); - ui->backBrightLyt->addStretch(); - ui->backBrightLyt->addWidget(mBackBrightBtn); + backLightLayout->addWidget(mBackBrightLabel); + backLightLayout->addWidget(mBackHintLabel); + backLightLayout->addStretch(); + backLightLayout->addWidget(mBackBrightBtn); if (QGSettings::isSchemaInstalled(QByteArray(USD_BRIGHT_SCHEMAS))) { mAutoBrightSettings = new QGSettings(QByteArray(USD_BRIGHT_SCHEMAS), QByteArray(), this); @@ -822,6 +747,7 @@ void Widget::initAutoBrihgtUI() mAutoBrightBtn->setChecked(mAutoBrightSettings->get(BRIGHT_KEY).toBool()); connect(mAutoBrightBtn, &KSwitchButton::stateChanged, this, [=](bool status) { mAutoBrightSettings->set(BRIGHT_KEY, status); + Common::buriedSettings(QString("display"), QString("mAutoBrightBtn"), QString("clicked"), Common::boolToString(status)); }); } @@ -829,6 +755,7 @@ void Widget::initAutoBrihgtUI() mBackBrightBtn->setChecked(mAutoBrightSettings->get(DYNAMIC_BRIHT_KEY).toBool()); connect(mBackBrightBtn, &KSwitchButton::stateChanged, this, [=](bool status) { mAutoBrightSettings->set(DYNAMIC_BRIHT_KEY, status); + Common::buriedSettings(QString("display"), QString("mBackBrightBtn"), QString("clicked"), Common::boolToString(status)); }); } @@ -844,27 +771,28 @@ void Widget::initAutoBrihgtUI() } }); } + } else { + configGroup->removeWidget(autoBrightFrame); + configGroup->removeWidget(backLightFrame); + autoBrightFrame->deleteLater(); + backLightFrame->deleteLater(); + autoBrightFrame = nullptr; + backLightFrame = nullptr; } } -QFrame *Widget::setLine(QFrame *frame) -{ - QFrame *line = new QFrame(frame); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - return line; -} - - - bool Widget::isRestoreConfig() { + if (autoScaleChange) { + autoScaleChange = false; + return false; + } int cnt = 15; - int ret = -100; QMessageBox msg(qApp->activeWindow()); + + msg.addButton(tr("Not Save"), QMessageBox::RejectRole); + QPushButton *saveBtn = msg.addButton(tr("Save"), QMessageBox::AcceptRole); + if (mConfigChanged) { QString config_name; switch (changeItm) { @@ -881,15 +809,14 @@ bool Widget::isRestoreConfig() config_name = tr("scale"); break; } - msg.setWindowTitle(tr("Hint")); + msg.setIcon(QMessageBox::Warning); + msg.setText(QString(tr("The screen %1 has been modified, whether to save it ? " "
" - "the settings will be saved after 14 seconds")).arg(config_name)); - msg.addButton(tr("Save"), QMessageBox::RejectRole); - msg.addButton(tr("Not Save"), QMessageBox::AcceptRole); + "the settings will be restore after 14 seconds")).arg(config_name)); QTimer cntDown; - QObject::connect(&cntDown, &QTimer::timeout, [&msg, &cnt, &cntDown, &ret ,&config_name]()->void { + QObject::connect(&cntDown, &QTimer::timeout, [&msg, &cnt, &cntDown ,&config_name]()->void { if (--cnt < 0) { cntDown.stop(); msg.hide(); @@ -897,28 +824,44 @@ bool Widget::isRestoreConfig() } else { msg.setText(QString(tr("The screen %1 has been modified, whether to save it ? " "
" - "the settings will be saved after %2 seconds")).arg(config_name).arg(cnt)); + "the settings will be restore after %2 seconds")).arg(config_name).arg(cnt)); + msg.show(); } }); cntDown.start(1000); - ret = msg.exec(); + msg.exec(); + } else { + if (mIsSCaleRes) { + mIsSCaleRes = false; + showZoomtips(); + } + return false; } - bool res = false; - switch (ret) { - case QMessageBox::AcceptRole: - res = false; - break; - case QMessageBox::RejectRole: - res = true; - break; + + if (msg.clickedButton() == saveBtn) { + //若点击保存后,因分辨率导致缩放发生了变化,则提示注销 + if (mIsSCaleRes) { + mIsSCaleRes = false; + showZoomtips(); + } + return false; + } else { + if (mIsSCaleRes) { + QStringList keys = scaleGSettings->keys(); + if (keys.contains("scalingFactor")) { + scaleGSettings->set(SCALE_KEY,scaleres); + compareScale(); + } + mIsSCaleRes = false; + } + return true; } - return res; } QString Widget::getCpuInfo() { - return Utils::getCpuInfo(); + return Common::getCpuInfo(); } bool Widget::isCloneMode() @@ -958,21 +901,24 @@ bool Widget::isBacklight() return false; } } - QDBusInterface brightnessInterface("org.ukui.upower", - "/", - "org.ukui.upower", - QDBusConnection::sessionBus()); + QDBusInterface brightnessInterface("org.freedesktop.UPower", + "/org/freedesktop/UPower", + "org.freedesktop.DBus.Properties", + QDBusConnection::systemBus()); if (!brightnessInterface.isValid()) { qDebug() << "Create UPower Interface Failed : " << QDBusConnection::systemBus().lastError(); return false; } - QDBusReply reply = brightnessInterface.call("MachineType"); - return !reply.value().compare("book"); + QDBusReply reply = brightnessInterface.call("Get", "org.freedesktop.UPower", "LidIsPresent"); + if (!reply.isValid()) { + qDebug()<<"Get LidIsPresent Failed"; + } + return reply.value().toBool(); } QString Widget::getMonitorType() { - QString monitor = ui->primaryCombo->currentText(); + QString monitor = monitorComboBox->currentText(); QString type; if (monitor.contains("VGA", Qt::CaseInsensitive)) { type = "4"; @@ -984,8 +930,8 @@ QString Widget::getMonitorType() bool Widget::isLaptopScreen() { - int index = ui->primaryCombo->currentIndex(); - KScreen::OutputPtr output = mConfig->output(ui->primaryCombo->itemData(index).toInt()); + int index = monitorComboBox->currentIndex(); + KScreen::OutputPtr output = mConfig->output(monitorComboBox->itemData(index).toInt()); if (output->type() == KScreen::Output::Type::Panel) { return true; } @@ -1033,21 +979,27 @@ void Widget::initMultScreenStatus() QDBusReply reply = mUsdDbus->call("getScreenMode", "ukui-control-center"); int mode = reply.value(); switch (mode) { +#ifndef MAVIS case 0: mMultiScreenCombox->setCurrentIndex(FIRST); break; +#endif case 1: mMultiScreenCombox->setCurrentIndex(CLONE); break; case 2: mMultiScreenCombox->setCurrentIndex(EXTEND); break; +#ifndef MAVIS case 3: mMultiScreenCombox->setCurrentIndex(VICE); break; + //spliceScreen +#endif default: break; } + setSpliceFrameVisiable(false); mMultiScreenCombox->blockSignals(false); } @@ -1055,7 +1007,13 @@ void Widget::updateMultiScreen() { int index = 0; for (const KScreen::OutputPtr output : mConfig->connectedOutputs()) { +#ifndef MAVIS mMultiScreenCombox->setItemText(index++, Utils::outputName(output)); + //避免大于两个屏幕时把扩展、镜像覆盖 + if (index > 1) { + break; + } +#endif } } @@ -1075,8 +1033,8 @@ void Widget::showZoomtips() { int ret; QMessageBox msg(this->topLevelWidget()); - msg.setWindowTitle(tr("Hint")); - msg.setText(tr("The zoom function needs to log out to take effect")); + msg.setIcon(QMessageBox::Warning); + msg.setText(tr("The zoom has been modified, it will take effect after you log off")); msg.addButton(tr("Log out now"), QMessageBox::AcceptRole); msg.addButton(tr("Later"), QMessageBox::RejectRole); @@ -1087,35 +1045,47 @@ void Widget::showZoomtips() system("ukui-session-tools --logout"); break; case QMessageBox::RejectRole: + compareScale(); break; } } +void Widget::compareScale() +{ + for (int index = 0;index < scaleComboBox->count(); index++) { + if (scaleComboBox->itemText(index).contains(tr("(Effective after logout)"))) { + QString str = scaleComboBox->itemText(index); + scaleComboBox->setItemText(index, str.split(" ").at(0)); + break; + } + } + double scale = scaleGSettings->get(SCALE_KEY).toDouble(); + if (scale != qApp->devicePixelRatio()) + scaleComboBox->setItemText(scaleComboBox->currentIndex(), + QString("%1%2").arg(QString::number(scale * 100) + "% ") + .arg(tr("(Effective after logout)"))); +} + +void Widget::outputEnableChanged() +{ + changescale(); + if (mIsSCaleRes) { + mIsSCaleRes = false; + showZoomtips(); + } +} + void Widget::showNightWidget(bool judge) { - mTimeModeFrame->setVisible(judge); - if (mTimeModeCombox->currentIndex() == 2) { - mCustomTimeFrame->setVisible(judge); - line_2->setVisible(judge); + mTimeModeWidget->setVisible(judge); + if (mTimeModeWidget->comboBox()->currentIndex() == 2) { + mCustomTimeWidget->setVisible(judge); } else { - mCustomTimeFrame->setVisible(false); - line_2->setVisible(false); - } + mCustomTimeWidget->setVisible(false); - mTemptFrame->setVisible(judge); - line_1->setVisible(judge); - line_3->setVisible(judge); -} - -void Widget::showCustomWiget(int index) -{ - if (SUN == index) { - ui->opframe->setVisible(false); - ui->clsframe->setVisible(false); - } else if (CUSTOM == index) { - ui->opframe->setVisible(true); - ui->clsframe->setVisible(true); } + mTemptWidget->setVisible(judge); + } void Widget::clearOutputIdentifiers() @@ -1166,8 +1136,9 @@ void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash) showBrightnessFrame(); }); BrightnessFrameV.push_back(frame); - ui->unifyBrightLayout->addWidget(frame); + mbrightnesslayout->addWidget(frame); frame->runConnectThread(openFlag); + configGroup->updateShape(); } } @@ -1183,7 +1154,7 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged) } //bug:124276,特殊判断为笔记本屏幕 - if (output->type() == 14 && Utils::getCpuInfo() == "Phytium,D2000/8 ULP8C" + if (output->type() == 14 && Common::getCpuInfo() == "Phytium,D2000/8 ULP8C" && Utils::outputName(output) == "DP-2" && output->isConnected()) { bool flag = true; for (const KScreen::ModePtr &mode : output->modes()) { @@ -1207,8 +1178,9 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged) QString edidHash = QString::fromLatin1(hash.result().toHex()); QString name = Utils::outputName(output); - qDebug()<<"(outputAdded) displayName:"< edidHash:"<id(); addBrightnessFrame(name, output->isEnabled(), edidHash); + connectedOutputNum++; + checkSpliceFeasibility(); } if (!connectChanged) { @@ -1230,7 +1202,7 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged) if (!mFirstLoad) { QTimer::singleShot(2000, this, [=] { - mainScreenButtonSelect(ui->primaryCombo->currentIndex()); + mainScreenButtonSelect(monitorComboBox->currentIndex()); }); } @@ -1240,6 +1212,8 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged) void Widget::outputRemoved(int outputId, bool connectChanged) { KScreen::OutputPtr output = mConfig->output(outputId); + connectedOutputNum--; + checkSpliceFeasibility(); for (int i = 0; i < BrightnessFrameV.size(); ++i) { if (BrightnessFrameV[i]->getOutputName() == Utils::outputName(output)) { BrightnessFrameV[i]->setOutputEnable(false); @@ -1252,17 +1226,17 @@ void Widget::outputRemoved(int outputId, bool connectChanged) } } - const int index = ui->primaryCombo->findData(outputId); + const int index = monitorComboBox->findData(outputId); if (index != -1) { - if (index == ui->primaryCombo->currentIndex()) { + if (index == monitorComboBox->currentIndex()) { // We'll get the actual primary update signal eventually // Don't emit currentIndexChanged - const bool blocked = ui->primaryCombo->blockSignals(true); - ui->primaryCombo->setCurrentIndex(0); - ui->primaryCombo->blockSignals(blocked); + const bool blocked = monitorComboBox->blockSignals(true); + monitorComboBox->setCurrentIndex(0); + monitorComboBox->blockSignals(blocked); } - ui->primaryCombo->removeItem(index); + monitorComboBox->removeItem(index); } // 检查统一输出-防止移除后没有屏幕可显示 @@ -1273,7 +1247,7 @@ void Widget::outputRemoved(int outputId, bool connectChanged) qmlOutput->setIsCloneMode(false, false); } mIscloneMode = false; - mainScreenButtonSelect(ui->primaryCombo->currentIndex()); + mainScreenButtonSelect(monitorComboBox->currentIndex()); } void Widget::primaryOutputSelected(int index) @@ -1282,7 +1256,7 @@ void Widget::primaryOutputSelected(int index) return; } - const KScreen::OutputPtr newPrimary = index == 0 ? KScreen::OutputPtr() : mConfig->output(ui->primaryCombo->itemData(index).toInt()); + const KScreen::OutputPtr newPrimary = index == 0 ? KScreen::OutputPtr() : mConfig->output(monitorComboBox->itemData(index).toInt()); if (newPrimary == mConfig->primaryOutput()) { return; } @@ -1294,11 +1268,11 @@ void Widget::primaryOutputSelected(int index) void Widget::primaryOutputChanged(const KScreen::OutputPtr &output) { Q_ASSERT(mConfig); - int index = output.isNull() ? 0 : ui->primaryCombo->findData(output->id()); - if (index == -1 || index == ui->primaryCombo->currentIndex()) { + int index = output.isNull() ? 0 : monitorComboBox->findData(output->id()); + if (index == -1 || index == monitorComboBox->currentIndex()) { return; } - ui->primaryCombo->setCurrentIndex(index); + monitorComboBox->setCurrentIndex(index); } void Widget::slotIdentifyButtonClicked(bool checked) @@ -1418,21 +1392,15 @@ QString Widget::getPrimaryWaylandScreen() void Widget::applyNightModeSlot() { - if (((mOpenTimeHCombox->currentIndex() < mCloseTimeHCombox->currentIndex()) - || (mOpenTimeHCombox->currentIndex() == mCloseTimeHCombox->currentIndex() - && mQpenTimeMCombox->currentIndex() <= mCloseTimeMCombox->currentIndex())) - && mTimeModeCombox->currentIndex() == 2 && mNightModeBtn->isChecked()) { - QMessageBox::warning(this, tr("Warning"), - tr("Open time should be earlier than close time!")); - return; - } - - setNightMode(mNightModeBtn->isChecked()); + setNightMode(mNightModeWidget->isChecked()); } void Widget::setMultiScreenSlot(int index) { QString mode; +#ifdef MAVIS + index = index + 2; +#endif switch (index) { case 0: mode = "firstScreenMode"; @@ -1446,9 +1414,15 @@ void Widget::setMultiScreenSlot(int index) case 3: mode = "cloneScreenMode"; break; +#ifndef BUILD_NO_SPLICE_SCREEN + case 4: + spliceDialog->show(); + return; +#endif default: break; } + setSpliceFrameVisiable(false); mUsdDbus->call("setScreenMode", mode, "ukui-control-center"); } @@ -1504,7 +1478,7 @@ void Widget::save() if (!atLeastOneEnabledOutput) { QMessageBox::warning(this, tr("Warning"), tr("please insure at least one output!")); - mCloseScreenButton->setChecked(true); + openMonitorButton->setChecked(true); return; } @@ -1554,12 +1528,11 @@ void Widget::save() qmlOutput->setAllowResetSize(true); } } + if (isRestoreConfig()) { auto *op = new KScreen::SetConfigOperation(mPrevConfig); op->exec(); sync(); - } else { - } }); } @@ -1621,7 +1594,7 @@ bool Widget::writeGlobalPart(const KScreen::OutputPtr &output, QVariantMap &info info[QStringLiteral("metadata")] = metadata(output); info[QStringLiteral("rotation")] = output->rotation(); - // Round scale to four digits + // Round scale to four digits info[QStringLiteral("scale")] = output->scale(); QVariantMap modeInfo; @@ -1706,6 +1679,11 @@ bool Widget::writeFile(const QString &filePath) return true; } +void Widget::changedSlot() +{ + mConfigChanged = true; +} + void Widget::scaleChangedSlot(double scale) { if (scaleGSettings->get(SCALE_KEY).toDouble() != scale) { @@ -1713,15 +1691,9 @@ void Widget::scaleChangedSlot(double scale) } else { mIsScaleChanged = false; } - writeScale(scale); } -void Widget::changedSlot() -{ - mConfigChanged = true; -} - void Widget::propertiesChangedSlot(QString property, QMap propertyMap, QStringList propertyList) { @@ -1735,42 +1707,41 @@ void Widget::propertiesChangedSlot(QString property, QMap pro // 是否禁用主屏按钮 void Widget::mainScreenButtonSelect(int index) { - if (!mConfig || ui->primaryCombo->count() <= 0) { + if (!mConfig || monitorComboBox->count() <= 0) { return; } - const KScreen::OutputPtr newPrimary = mConfig->output(ui->primaryCombo->itemData(index).toInt()); + const KScreen::OutputPtr newPrimary = mConfig->output(monitorComboBox->itemData(index).toInt()); int connectCount = mConfig->connectedOutputs().count(); if (mIsWayland) { if (!getPrimaryWaylandScreen().compare(newPrimary->name(), Qt::CaseInsensitive)) { - ui->mainScreenButton->setEnabled(false); + monitorBtn->setEnabled(false); } else { - ui->mainScreenButton->setEnabled(true); + monitorBtn->setEnabled(true); } } else { - if (newPrimary == mConfig->primaryOutput() || mConfig->primaryOutput().isNull() || !newPrimary->isEnabled()) { - ui->mainScreenButton->setVisible(false); + if (mIscloneMode || newPrimary == mConfig->primaryOutput() || mConfig->primaryOutput().isNull() || !newPrimary->isEnabled()) { + monitorBtn->setVisible(false); } else { - ui->mainScreenButton->setVisible(true); + monitorBtn->setVisible(true); } } if (!newPrimary->isEnabled()) { - ui->scaleCombo->setEnabled(false); + scaleComboBox->setEnabled(false); } else { - ui->scaleCombo->setEnabled(true); + scaleComboBox->setEnabled(true); } // 设置是否勾选 - mCloseScreenButton->setEnabled(true); - ui->showMonitorframe->setVisible(connectCount > 1 && !mIscloneMode); - ui->zoomFrame->setVisible(connectCount > 1 && !mIscloneMode); + openMonitorButton->setEnabled(true); + openMonitorFrame->setVisible(connectCount > 1 && !mIscloneMode); // 初始化时不要发射信号 - mCloseScreenButton->blockSignals(true); - mCloseScreenButton->setChecked(newPrimary->isEnabled()); - mCloseScreenButton->blockSignals(false); + openMonitorButton->blockSignals(true); + openMonitorButton->setChecked(newPrimary->isEnabled()); + openMonitorButton->blockSignals(false); mControlPanel->activateOutput(newPrimary); @@ -1784,16 +1755,16 @@ void Widget::primaryButtonEnable(bool status) if (!mConfig) { return; } - int index = ui->primaryCombo->currentIndex(); - ui->mainScreenButton->setVisible(false); - const KScreen::OutputPtr newPrimary = mConfig->output(ui->primaryCombo->itemData(index).toInt()); + int index = monitorComboBox->currentIndex(); + monitorBtn->setVisible(false); + const KScreen::OutputPtr newPrimary = mConfig->output(monitorComboBox->itemData(index).toInt()); mConfig->setPrimaryOutput(newPrimary); } void Widget::checkOutputScreen(bool judge) { if (judge == true) { - if (mCloseScreenButton->isVisible()) { //扩展模式 + if (openMonitorButton->isVisible()) { //扩展模式 setMultiScreenSlot(EXTEND); } } else { @@ -1806,15 +1777,16 @@ void Widget::checkOutputScreen(bool judge) if (enableOutputNum < 2) { //两个屏幕才允许关闭 QMessageBox::warning(this, tr("Warning"), tr("please insure at least one output!")); - mCloseScreenButton->blockSignals(true); - mCloseScreenButton->setChecked(true); - mCloseScreenButton->blockSignals(false); + openMonitorButton->blockSignals(true); + openMonitorButton->setChecked(true); + openMonitorButton->blockSignals(false); return; } - int index = ui->primaryCombo->currentIndex(); - KScreen::OutputPtr newPrimary = mConfig->output(ui->primaryCombo->itemData(index).toInt()); + int index = monitorComboBox->currentIndex(); + KScreen::OutputPtr newPrimary = mConfig->output(monitorComboBox->itemData(index).toInt()); QString closeOutputName = Utils::outputName(newPrimary); +#ifndef MAVIS if (closeOutputName == mMultiScreenCombox->itemText(0)) { setMultiScreenSlot(VICE); } else if (closeOutputName == mMultiScreenCombox->itemText(1)) { @@ -1822,6 +1794,7 @@ void Widget::checkOutputScreen(bool judge) } else { qDebug()<<"(checkOutputScreen) closeOutputName = "<isValid()) { + QDBusReply is_tabletmode = m_StatusDbus->call("get_current_tabletmode"); + if (is_tabletmode) { + mMultiScreenCombox->setEnabled(false); + } else { + mMultiScreenCombox->setEnabled(true); + } + } } void Widget::initConnection() { - connect(ui->mainScreenButton, &QPushButton::clicked, this, [=](bool status){ + connect(monitorBtn, &QPushButton::clicked, this, [=](bool status){ primaryButtonEnable(status); delayApply(); }); - mControlPanel = new ControlPanel(this); - // Intel隐藏分辨率等调整选项 - if (Utils::isTablet()) { + if (Common::isTablet()) { mControlPanel->setVisible(false); - ui->scaleFrame->setVisible(false); + scaleFrame->setVisible(false); } connect(mControlPanel, &ControlPanel::toSetScreenPos, this, [=](const KScreen::OutputPtr &output){ @@ -1883,21 +1862,23 @@ void Widget::initConnection() changedSlot(); delayApply(); }); - connect(mControlPanel, &ControlPanel::scaleChanged, this, &Widget::scaleChangedSlot); + connect(mControlPanel, &ControlPanel::scaleChanged, this, &Widget::changescale); + connect(mControlPanel, &ControlPanel::enabledChanged, this, &Widget::outputEnableChanged); - ui->controlPanelLayout->addWidget(mControlPanel); - - connect(mCloseScreenButton, &KSwitchButton::stateChanged, + connect(openMonitorButton, &KSwitchButton::stateChanged, this, [=](bool checked) { checkOutputScreen(checked); + changescale(); }); + connect(mOpenTimeHCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=]{ if (m_colorSettings) { m_colorSettings->set(NIGHT_FROM_KEY,QString::number(hour_minute_to_value((mOpenTimeHCombox->currentText()).toInt(),(mQpenTimeMCombox->currentText()).toInt()),'f', 2).toDouble()); } else { applyNightModeSlot(); } + Common::buriedSettings(QString("display"), QString("mOpenTimeHCombox"), QString("select"), mOpenTimeHCombox->currentText()); }); connect(mQpenTimeMCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=]{ @@ -1906,6 +1887,7 @@ void Widget::initConnection() } else { applyNightModeSlot(); } + Common::buriedSettings(QString("display"), QString("mQpenTimeMCombox"), QString("select"), mQpenTimeMCombox->currentText()); }); connect(mCloseTimeHCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=]{ @@ -1914,6 +1896,7 @@ void Widget::initConnection() } else { applyNightModeSlot(); } + Common::buriedSettings(QString("display"), QString("mCloseTimeHCombox"), QString("select"), mCloseTimeHCombox->currentText()); }); connect(mCloseTimeMCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=]{ @@ -1922,19 +1905,21 @@ void Widget::initConnection() } else { applyNightModeSlot(); } + Common::buriedSettings(QString("display"), QString("mCloseTimeMCombox"), QString("select"), mCloseTimeMCombox->currentText()); }); - connect(mTemptSlider, &QSlider::valueChanged, this, [=]{ + connect(mTemptWidget, &SliderWidget::valueChanged, this, [=]{ if (m_colorSettings) { - m_colorSettings->set(NIGHT_TEMPERATURE_KEY,mTemptSlider->value()); + m_colorSettings->set(NIGHT_TEMPERATURE_KEY, mTemptWidget->value()); } else { applyNightModeSlot(); } - + Common::buriedSettings(QString("display"), QString("mTemptWidget"), QString("setting"), QString::number(mTemptWidget->value())); }); connect(mMultiScreenCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index){ setMultiScreenSlot(index); + Common::buriedSettings(QString("display"), QString("mMultiScreenCombox"), QString("select"), QString::number(index)); }); QDBusConnection::sessionBus().connect(QString("org.ukui.SettingsDaemon"), @@ -1958,80 +1943,90 @@ void Widget::initConnection() mApplyShortcut = new QShortcut(QKeySequence("Ctrl+A"), this); connect(mApplyShortcut, SIGNAL(activated()), this, SLOT(save())); - connect(ui->primaryCombo, static_cast(&QComboBox::currentIndexChanged), + connect(monitorComboBox, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { mainScreenButtonSelect(index); showBrightnessFrame(); //当前屏幕框变化的时候,显示,此时不判断 }); - connect(mTimeModeCombox, QOverload::of(&QComboBox::currentIndexChanged),[=](){ - switch (mTimeModeCombox->currentIndex()) { + connect(mTimeModeWidget->comboBox(), QOverload::of(&QComboBox::currentIndexChanged),[=](){ + switch (mTimeModeWidget->comboBox()->currentIndex()) { case 0: - mCustomTimeFrame->hide(); - line_2->hide(); + mCustomTimeWidget->hide(); if (m_colorSettings) { m_colorSettings->set(AllDAY_KEY,true); m_colorSettings->set(AUTO_KEY,false); } break; case 1: - mCustomTimeFrame->hide(); - line_2->hide(); + mCustomTimeWidget->hide(); if (m_colorSettings) { m_colorSettings->set(AUTO_KEY,true); m_colorSettings->set(AllDAY_KEY,false); } break; case 2: - mCustomTimeFrame->setVisible(true); - line_2->setVisible(true); + mCustomTimeWidget->setVisible(true); if (m_colorSettings) { m_colorSettings->set(AUTO_KEY,false); m_colorSettings->set(AllDAY_KEY,false); } break; } + Common::buriedSettings(QString("display"), QString("mTimeModeWidget"), QString("select"), QString::number(mTimeModeWidget->comboBox()->currentIndex())); }); - connect(mNightModeBtn, &KSwitchButton::stateChanged,[=](bool checked){ + connect(mNightModeWidget, &SwitchWidget::stateChanged,[=](bool checked){ showNightWidget(checked); if (m_colorSettings) { m_colorSettings->set(NIGHT_ENABLE_KEY,checked); + mTimeModeWidget->comboBox()->setItemText(1, getSunTime()); } else { applyNightModeSlot(); } - + Common::buriedSettings(QString("display"), QString("mNightModeWidget"), QString("clicked"), Common::boolToString(checked)); }); - connect(ui->scaleCombo, static_cast(&QComboBox::currentIndexChanged), + connect(scaleComboBox, static_cast(&QComboBox::currentIndexChanged), this, [=](int index){ - scaleChangedSlot(ui->scaleCombo->itemData(index).toDouble()); + scaleChangedSlot(scaleComboBox->itemData(index).toDouble()); }); connect(scaleGSettings,&QGSettings::changed,this,[=](QString key){ if (!key.compare("scalingFactor", Qt::CaseSensitive)) { double scale = scaleGSettings->get(key).toDouble(); - if (ui->scaleCombo->findData(scale) == -1) { + if (scaleComboBox->findData(scale) == -1) { scale = 1.0; } - ui->scaleCombo->blockSignals(true); - ui->scaleCombo->setCurrentText(QString::number(scale * 100) + "%"); - ui->scaleCombo->blockSignals(false); + scaleComboBox->blockSignals(true); + scaleComboBox->setCurrentText(QString::number(scale * 100) + "%"); + scaleComboBox->blockSignals(false); } }); -} + connect(spliceDialog, &SpliceDialog::finished, this, [=](int result){ + Q_UNUSED(result); + initMultScreenStatus(); + }); + connect(spliceDialog, &SpliceDialog::spliceScreenChanged, this, [=](QString spliceMethodText){ + //to set sth ... + spliceMethodLabel->setText(spliceMethodText); + setSpliceFrameVisiable(true); + //隐藏亮度条 + mbrightnessFrame->setVisible(false); + }); +} void Widget::setNightComponent() { /* 设置时间模式 */ - mTimeModeStringList << tr("All Day") << tr("Follow the sunrise and sunset") << tr("Custom Time"); - mTimeModeCombox->insertItem(0, mTimeModeStringList.at(0)); - mTimeModeCombox->insertItem(1, mTimeModeStringList.at(1)); - mTimeModeCombox->insertItem(2, mTimeModeStringList.at(2)); + mTimeModeStringList << tr("All Day") << getSunTime() << tr("Custom Time"); + mTimeModeWidget->comboBox()->insertItem(0, mTimeModeStringList.at(0)); + mTimeModeWidget->comboBox()->insertItem(1, mTimeModeStringList.at(1)); + mTimeModeWidget->comboBox()->insertItem(2, mTimeModeStringList.at(2)); - mTemptSlider->setRange(1.1*1000, 6500); - mTemptSlider->setTracking(true); + mTemptWidget->slider()->setRange(1.1*1000, 6500); + mTemptWidget->slider()->setTracking(true); for (int i = 0; i < 24; i++) { mOpenTimeHCombox->addItem(QStringLiteral("%1").arg(i, 2, 10, QLatin1Char('0'))); @@ -2060,20 +2055,20 @@ void Widget::setNightMode(const bool nightMode) mNightConfig["Active"] = false; } else { mNightConfig["Active"] = true; - if (mTimeModeCombox->currentIndex() == 1) { + if (mTimeModeWidget->comboBox()->currentIndex() == 1) { mNightConfig["EveningBeginFixed"] = "17:55:01"; mNightConfig["MorningBeginFixed"] = "06:23:00"; mNightConfig["Mode"] = 2; - } else if (mTimeModeCombox->currentIndex() == 2) { + } else if (mTimeModeWidget->comboBox()->currentIndex() == 2) { mNightConfig["EveningBeginFixed"] = mOpenTimeHCombox->currentText() + ":" + mQpenTimeMCombox->currentText() + ":00"; mNightConfig["MorningBeginFixed"] = mCloseTimeHCombox->currentText() + ":" + mCloseTimeMCombox->currentText() + ":00"; mNightConfig["Mode"] = 2; - } else if (mTimeModeCombox->currentIndex() == 0) { + } else if (mTimeModeWidget->comboBox()->currentIndex() == 0) { mNightConfig["Mode"] = 3; } - mNightConfig["NightTemperature"] = mTemptSlider->value(); + mNightConfig["NightTemperature"] = mTemptWidget->value(); } colorIft.call("setNightColorConfig", mNightConfig); @@ -2085,18 +2080,8 @@ void Widget::initUiComponent() %QStringLiteral("/kscreen/") %QStringLiteral("" /*"configs/"*/); - singleButton = new QButtonGroup(); - singleButton->addButton(ui->sunradioBtn); - singleButton->addButton(ui->customradioBtn); - - singleButton->setId(ui->sunradioBtn, SUN); - singleButton->setId(ui->customradioBtn, CUSTOM); - - MODE value = ui->customradioBtn->isChecked() == SUN ? SUN : CUSTOM; - showNightWidget(mNightButton->isChecked()); - if (mNightButton->isChecked()) { - showCustomWiget(value); - } + mScaleDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + %QStringLiteral("/kscreen/scale/"); mIsBattery = isBacklight(); @@ -2136,18 +2121,24 @@ void Widget::initNightStatus() { QDBusInterface colorIft("org.ukui.KWin", "/ColorCorrect", - "org.ukui.kwin.ColorCorrect", + "org.freedesktop.DBus.Properties", QDBusConnection::sessionBus()); if (colorIft.isValid() && !mIsWayland) { this->mRedshiftIsValid = true; + QDBusReply reply = colorIft.call("Get", "org.ukui.kwin.ColorCorrect", "available"); + if (!reply.value().toBool()) { + mNightModeWidget->setChecked(false); + mNightModeWidget->setEnabled(false); + return; + } } else { qWarning() << "create org.ukui.kwin.ColorCorrect failed"; return; } if (m_colorSettings) { this->mIsNightMode = m_colorSettings->get(NIGHT_ENABLE_KEY).toBool(); - mNightModeBtn->setChecked(this->mIsNightMode); - showNightWidget(mNightModeBtn->isChecked()); + mNightModeWidget->setChecked(this->mIsNightMode); + showNightWidget(mNightModeWidget->isChecked()); setNightModeSetting(); return; } @@ -2175,19 +2166,17 @@ void Widget::initNightStatus() } this->mIsNightMode = mNightConfig["Active"].toBool(); - mNightModeBtn->setChecked(this->mIsNightMode); - showNightWidget(mNightModeBtn->isChecked()); - mTemptSlider->setValue(mNightConfig["CurrentColorTemperature"].toInt()); + mNightModeWidget->setChecked(this->mIsNightMode); + showNightWidget(mNightModeWidget->isChecked()); + mTemptWidget->setValue(mNightConfig["CurrentColorTemperature"].toInt()); if (mNightConfig["EveningBeginFixed"].toString() == "17:55:01" && mNightConfig["Mode"].toInt() == 2) { - mTimeModeCombox->setCurrentIndex(1); - mCustomTimeFrame->hide(); - line_2->hide(); + mTimeModeWidget->comboBox()->setCurrentIndex(1); + mCustomTimeWidget->hide(); } else if (mNightConfig["Mode"].toInt() == 3) { - mTimeModeCombox->setCurrentIndex(0); - mCustomTimeFrame->hide(); - line_2->hide(); + mTimeModeWidget->comboBox()->setCurrentIndex(0); + mCustomTimeWidget->hide(); } else { - mTimeModeCombox->setCurrentIndex(2); + mTimeModeWidget->comboBox()->setCurrentIndex(2); QString openTime = mNightConfig["EveningBeginFixed"].toString(); QString ophour = openTime.split(":").at(0); QString opmin = openTime.split(":").at(1); @@ -2211,34 +2200,18 @@ void Widget::setNightModeSetting() applyNightModeSlot(); return; } - mTimeModeCombox->blockSignals(true); + mTimeModeWidget->comboBox()->blockSignals(true); if (m_colorSettings->get(NIGHT_ENABLE_KEY).toBool()) { - mNightModeBtn->setChecked(true); + mNightModeWidget->setChecked(true); if(m_colorSettings->get(AllDAY_KEY).toBool()) { - mTimeModeCombox->setCurrentIndex(0); + mTimeModeWidget->comboBox()->setCurrentIndex(0); } else if(m_colorSettings->get(AUTO_KEY).toBool()) { - mTimeModeCombox->setCurrentIndex(1); - double openTime = m_colorSettings->get(AUTO_NIGHT_FROM_KEY).toDouble(); - double cltime = m_colorSettings->get(AUTO_NIGHT_TO_KEY).toDouble(); -// qDebug()<<"openTime = "<setChecked(nightArg["Active"].toBool()); } } +QString Widget::getSunTime() +{ + if (m_colorSettings) { + if(m_colorSettings->keys().contains("nightLightScheduleAutomaticFrom") + && m_colorSettings->keys().contains("nightLightScheduleAutomaticTo")) { + double openTime = m_colorSettings->get(AUTO_NIGHT_FROM_KEY).toDouble(); + double cltime = m_colorSettings->get(AUTO_NIGHT_TO_KEY).toDouble(); + int ophour, opmin, clhour, clmin; + value_to_hour_minute(openTime, &ophour, &opmin); + value_to_hour_minute(cltime, &clhour, &clmin); + QVector timevector; + QVector res; + res << ophour << opmin << clhour << clmin; + for (int i : res) + timevector.append(QString("%1%2").arg(i < 10 ? "0" : "").arg(QString::number(i))); + + return QString("%1 (%2)").arg(tr("Follow the sunrise and sunset")) + .arg(QString("%1:%2-%3:%4").arg(timevector.at(0)) + .arg(timevector.at(1)).arg(timevector.at(2)) + .arg(timevector.at(3))); + } + } + return tr("Follow the sunrise and sunset"); +} + /* 总结: 亮度条怎么显示和实际的屏幕状态有关,与按钮选择状态关系不大: * 实际为镜像模式,就显示所有屏幕的亮度(笔记本外显除外,笔记本外显任何情况均隐藏,这里未涉及)。 @@ -2279,33 +2277,18 @@ void Widget::showBrightnessFrame(const int flag) Q_UNUSED(flag); bool allShowFlag = true; allShowFlag = mIscloneMode; - ui->unifyBrightFrame->setFixedHeight(0); if (allShowFlag == true) { //镜像模式/即将成为镜像模式 - int FrameHeight = -2; for (int i = 0; i < BrightnessFrameV.size(); ++i) { if (!BrightnessFrameV[i]->getOutputEnable()) continue; - if (BrightnessFrameV[i]->getSliderEnable()) { - FrameHeight = FrameHeight + 54; - } else { - FrameHeight = FrameHeight + 84; - } BrightnessFrameV[i]->setOutputEnable(true); //~ contents_path /Display/Brightness BrightnessFrameV[i]->setTextLabelName(tr("Brightness") + QString("(") + BrightnessFrameV[i]->getOutputName() + QString(")")); BrightnessFrameV[i]->setVisible(true); } - if (FrameHeight < 0) - FrameHeight = 0; - ui->unifyBrightFrame->setFixedHeight(FrameHeight); } else { for (int i = 0; i < BrightnessFrameV.size(); ++i) { - if (ui->primaryCombo->currentText() == BrightnessFrameV[i]->getOutputName() && BrightnessFrameV[i]->getOutputEnable()) { - if (BrightnessFrameV[i]->getSliderEnable()) { - ui->unifyBrightFrame->setFixedHeight(52); - } else { - ui->unifyBrightFrame->setFixedHeight(82); - } + if (monitorComboBox->currentText() == BrightnessFrameV[i]->getOutputName() && BrightnessFrameV[i]->getOutputEnable()) { BrightnessFrameV[i]->setTextLabelName(tr("Brightness")); BrightnessFrameV[i]->setVisible(true); //不能break,要把其他的frame隐藏 @@ -2314,13 +2297,12 @@ void Widget::showBrightnessFrame(const int flag) } } } - if (ui->unifyBrightFrame->height() > 0) { - ui->unifyBrightFrame->setVisible(true); - ui->frame_5->setVisible(true); + if (mMultiScreenCombox->currentIndex() != SPLICE) { + mbrightnessFrame->setVisible(true); } else { - ui->unifyBrightFrame->setVisible(false); - ui->frame_5->setVisible(false); + mbrightnessFrame->setVisible(false); } + configGroup->updateShape(); } QList Widget::getPreScreenCfg() @@ -2391,55 +2373,58 @@ void Widget::setPreScreenCfg(KScreen::OutputList screens) file.write(QJsonDocument::fromVariant(outputList).toJson()); } -void Widget::changescale() +void Widget::changescale(QSize size) { - if (Utils::isTablet()) + if (Common::isTablet() || Common::isOpenkylin()) return; mScaleSizeRes = QSize(); - for (const KScreen::OutputPtr &output : mConfig->outputs()) { - if (output->isEnabled()) { - // 作判空判断,防止控制面板闪退 - if (output->currentMode()) { - if (mScaleSizeRes == QSize()) { - mScaleSizeRes = output->currentMode()->size(); + if (mIscloneMode && size != QSize()) { + mScaleSizeRes = size; + } else { + for (const KScreen::OutputPtr &output : mConfig->outputs()) { + if (output->isEnabled()) { + // 作判空判断,防止控制面板闪退 + if (output->currentMode()) { + if (mScaleSizeRes == QSize()) { + mScaleSizeRes = output->currentMode()->size(); + } else { + mScaleSizeRes = mScaleSizeRes.width() < output->currentMode()->size().width()?mScaleSizeRes:output->currentMode()->size(); + } } else { - mScaleSizeRes = mScaleSizeRes.width() < output->currentMode()->size().width()?mScaleSizeRes:output->currentMode()->size(); + return; } - } else { - return; } - } } if (mScaleSizeRes != QSize(0,0)) { QSize scalesize = mScaleSizeRes; - ui->scaleCombo->blockSignals(true); - ui->scaleCombo->clear(); - ui->scaleCombo->addItem("100%", 1.0); + scaleComboBox->blockSignals(true); + scaleComboBox->clear(); + scaleComboBox->addItem("100%", 1.0); if (scalesize.width() > 1024 ) { - ui->scaleCombo->addItem("125%", 1.25); + scaleComboBox->addItem("125%", 1.25); } if (scalesize.width() == 1920 ) { - ui->scaleCombo->addItem("150%", 1.5); + scaleComboBox->addItem("150%", 1.5); } if (scalesize.width() > 1920) { - ui->scaleCombo->addItem("150%", 1.5); - ui->scaleCombo->addItem("175%", 1.75); + scaleComboBox->addItem("150%", 1.5); + scaleComboBox->addItem("175%", 1.75); } if (scalesize.width() >= 2160) { - ui->scaleCombo->addItem("200%", 2.0); + scaleComboBox->addItem("200%", 2.0); } if (scalesize.width() > 2560) { - ui->scaleCombo->addItem("225%", 2.25); + scaleComboBox->addItem("225%", 2.25); } if (scalesize.width() > 3072) { - ui->scaleCombo->addItem("250%", 2.5); + scaleComboBox->addItem("250%", 2.5); } if (scalesize.width() > 3840) { - ui->scaleCombo->addItem("275%", 2.75); + scaleComboBox->addItem("275%", 2.75); } double scale; @@ -2447,7 +2432,8 @@ void Widget::changescale() if (keys.contains("scalingFactor")) { scale = scaleGSettings->get(SCALE_KEY).toDouble(); } - if (ui->scaleCombo->findData(scale) == -1) { + + if (scaleComboBox->findData(scale) == -1) { //记录分辨率切换时,新分辨率不存在的缩放率,在用户点击恢复设置时写入 mIsSCaleRes = true; @@ -2457,20 +2443,20 @@ void Widget::changescale() scaleres = scale; scale = 1.0; } - ui->scaleCombo->setCurrentText(QString::number(scale * 100) + "%"); - scaleChangedSlot(scale); - ui->scaleCombo->blockSignals(false); + + scaleComboBox->setCurrentText(QString::number(scale * 100) + "%"); + scaleChangedSlot(scale); + scaleComboBox->blockSignals(false); + mScaleSizeRes = QSize(); } } void Widget::mOutputClicked() { - //openkylin缩略图显示异常 - return; - if (mIscloneMode || mConfig->connectedOutputs().count() < 2) { - return; //镜像模式以及显示器小于2则不检测 - } + if (mIscloneMode || mConfig->connectedOutputs().count() < 2) { + return; //镜像模式以及显示器小于2则不检测 + } QMLOutput *mOutput = qobject_cast(sender()); mOutputClickedName = mOutput->output()->name(); slotIdentifyButtonClicked(true); @@ -2514,7 +2500,7 @@ void Widget::getAllI2Cbus() { I2CbusMap.clear(); //暂时仅D2000机器直接使用i2c - if (!(Utils::getCpuInfo().contains("D2000", Qt::CaseInsensitive))) { + if (!(Common::getCpuInfo().contains("D2000", Qt::CaseInsensitive))) { return; } QMap msg; @@ -2565,3 +2551,173 @@ void Widget::getAllI2Cbus() } return; } + +bool Widget::checkSpliceFeasibility() +{ + //dialog过程中拔插屏幕,该界面隐藏 + if (!spliceDialog->isHidden()) { + spliceDialog->setHidden(true); + } + int connectedNum = mConfig->connectedOutputs().size(); + //避免初始化时多次执行 + if (connectedOutputNum != connectedNum) { + return false; + } + QVector v_resolution; + QListView* view = dynamic_cast(mMultiScreenCombox->view()); + QStandardItemModel* model = dynamic_cast(mMultiScreenCombox->model()); + int spliceRow = mMultiScreenCombox->findText(tr("Splice Screen")); + //两个显示器以上,隐藏第一/第二屏 + if (connectedNum > 2) { + if (view && model) { + view->setRowHidden(0, true); + view->setRowHidden(1, true); + QStandardItem* item_0 = model->item(0); + QStandardItem* item_1 = model->item(0); + item_0->setFlags(item_0->flags() & ~Qt::ItemIsEnabled); + item_1->setFlags(item_1->flags() & ~Qt::ItemIsEnabled); + } + } else { + if (view && model) { + if (view->isRowHidden(0) && view->isRowHidden(1)) { + view->setRowHidden(0, false); + view->setRowHidden(1, false); + QStandardItem* item_0 = model->item(0); + QStandardItem* item_1 = model->item(0); + item_0->setFlags(item_0->flags() & Qt::ItemIsEnabled); + item_1->setFlags(item_1->flags() & Qt::ItemIsEnabled); + } + } + } + +#ifndef BUILD_NO_SPLICE_SCREEN + for (KScreen::OutputPtr output : mConfig->connectedOutputs()) { + for (KScreen::ModePtr mode : output->modes()) { + v_resolution.append(mode->size()); + } + } + + for (int i = 0; i < v_resolution.size(); i++) { + //存在共同的分辨率 + if (v_resolution.count(v_resolution.at(i)) == connectedNum) { + if (view) { + view->setRowHidden(spliceRow, false); + } + if (model) { + QStandardItem* item = model->item(spliceRow); + item->setFlags(item->flags() | Qt::ItemIsEnabled); + } + qDebug()<<"checkSpliceFeasibility size:"<init(mConfig->connectedOutputs()); + return true; + } + } + + if (view) { + view->setRowHidden(spliceRow, true); + } + + if (model) { + QStandardItem* item = model->item(spliceRow); + item->setFlags(item->flags() & ~Qt::ItemIsEnabled); + } +#endif + return false; +} + +void Widget::initSpliceFrame() +{ + QHBoxLayout *layout = new QHBoxLayout(spliceFrame); + layout->setContentsMargins(16, 0, 16, 0); + QLabel *spliceLabel = new QLabel(tr("Splicing Method"), spliceFrame); + spliceMethodLabel = new QLabel(spliceFrame); + QPushButton *changeBtn = new QPushButton(spliceFrame); + changeBtn->setText(tr("Change")); + changeBtn->setFixedWidth(120); + spliceLabel->setFixedSize(118, 30); + spliceMethodLabel->setAlignment(Qt::AlignVCenter); + spliceMethodLabel->setContentsMargins(8,0,8,0); + + layout->addWidget(spliceLabel); + layout->addWidget(spliceMethodLabel); + layout->addWidget(changeBtn); + setSpliceFrameVisiable(false); + connect(changeBtn, &QPushButton::clicked, this, [=](){ + spliceDialog->show(); + }); + return; +} + +void Widget::setSpliceFrameVisiable(bool b) +{ + spliceFrame->setVisible(b); + return; +} + +void Widget::initUi() +{ + modeGroup = new SettingGroup(this); + mMultiScreenFrame = new UkccFrame(modeGroup, UkccFrame::BorderRadiusStyle::Around, true); + spliceFrame = new UkccFrame(modeGroup, UkccFrame::BorderRadiusStyle::Around, true); + configGroup = new SettingGroup(this); + monitorFrame = new UkccFrame(configGroup, UkccFrame::BorderRadiusStyle::Around, true); + monitorLabel = new FixLabel(monitorFrame); + monitorComboBox = new QComboBox(monitorFrame); + monitorBtn = new QPushButton(monitorFrame); + mControlPanel = new ControlPanel(configGroup); + scaleFrame = new UkccFrame(configGroup, UkccFrame::BorderRadiusStyle::Around, true); + scaleLabel = new FixLabel(scaleFrame); + scaleComboBox = new QComboBox(scaleFrame); + openMonitorFrame = new UkccFrame(configGroup, UkccFrame::BorderRadiusStyle::Around, true); + openMonitorLabel = new FixLabel(openMonitorFrame); + openMonitorButton = new KSwitchButton(openMonitorFrame); + autoBrightFrame = new UkccFrame(configGroup, UkccFrame::BorderRadiusStyle::Around, true); + mbrightnessFrame = new UkccFrame(configGroup); + mbrightnesslayout = new QVBoxLayout(mbrightnessFrame); + backLightFrame = new UkccFrame(configGroup, UkccFrame::BorderRadiusStyle::Around, true); + + ui->modeLayout->addWidget(modeGroup); + modeGroup->addWidget(spliceFrame); + modeGroup->addWidget(mMultiScreenFrame); + ui->configLayout->addWidget(configGroup); + configGroup->addWidget(monitorFrame); + configGroup->addWidget(mControlPanel); + configGroup->addWidget(scaleFrame); + configGroup->addWidget(openMonitorFrame); + configGroup->addWidget(autoBrightFrame); + configGroup->addWidget(mbrightnessFrame); + configGroup->addWidget(backLightFrame); + + QHBoxLayout *monitorLayout = new QHBoxLayout(monitorFrame); + monitorLayout->setContentsMargins(16, 0, 16, 0); + monitorLayout->setSpacing(16); + monitorLayout->addWidget(monitorLabel); + monitorLayout->addWidget(monitorComboBox); + monitorLayout->addWidget(monitorBtn); + monitorLabel->setFixedWidth(108); + monitorBtn->setMinimumWidth(130); + monitorBtn->setMaximumWidth(150); + monitorLabel->setText(tr("monitor")); + monitorBtn->setText(tr("as main")); + + QHBoxLayout *scaleLayout = new QHBoxLayout(scaleFrame); + scaleLayout->setContentsMargins(16, 0, 16, 0); + scaleLayout->setSpacing(16); + scaleLayout->addWidget(scaleLabel); + scaleLayout->addWidget(scaleComboBox); + scaleLabel->setFixedWidth(108); + scaleLabel->setText(tr("screen zoom")); + + QHBoxLayout *openMonitorLayout = new QHBoxLayout(openMonitorFrame); + openMonitorLayout->setContentsMargins(16, 0, 16, 0); + openMonitorLabel->setFixedWidth(108); + openMonitorLayout->addWidget(openMonitorLabel); + openMonitorLayout->addStretch(); + + mbrightnessFrame->setContainer(true); + mbrightnesslayout->setMargin(0); + mbrightnesslayout->setSpacing(1); + + openMonitorLayout->addWidget(openMonitorButton); + openMonitorLabel->setText(tr("open monitor")); +} diff --git a/plugins/system/display/widget.h b/plugins/system/display/widget.h index b9a7c5d..e365985 100644 --- a/plugins/system/display/widget.h +++ b/plugins/system/display/widget.h @@ -22,17 +22,24 @@ #include #include #include +#include "splicedialog.h" #include #include "outputconfig.h" #include "brightnessFrame.h" #include "screenConfig.h" -#include "widgets/Label/titlelabel.h" -#include "widgets/Label/fixlabel.h" -#include "widgets/Label/lightlabel.h" -#include "widgets/Uslider/uslider.h" +#include "titlelabel.h" +#include "fixlabel.h" +#include "lightlabel.h" +#include "uslider.h" +#include "switchwidget.h" #include "kswitchbutton.h" +#include "ukccframe.h" +#include "settinggroup.h" +#include "comboxwidget.h" +#include "sliderwidget.h" + using namespace kdk; #define USD_CLONE_MODE 1 @@ -56,10 +63,13 @@ typedef enum { }MODE; typedef enum { +#ifndef MAVIS FIRST, VICE, +#endif EXTEND, CLONE, + SPLICE }MULTISCREEN; namespace KScreen { @@ -104,8 +114,9 @@ public: QList getPreScreenCfg(); void setPreScreenCfg(KScreen::OutputList screens); - void changescale(); + void changescale(QSize size = QSize()); void getAllI2Cbus(); + void initUi(); protected: bool eventFilter(QObject *object, QEvent *event) override; @@ -134,7 +145,6 @@ private Q_SLOTS: void primaryOutputChanged(const KScreen::OutputPtr &output); void showNightWidget(bool judge); - void showCustomWiget(int index); void primaryButtonEnable(bool); // 按钮选择主屏确认按钮 void mainScreenButtonSelect(int index); // 是否禁用设置主屏按钮 @@ -146,6 +156,7 @@ private Q_SLOTS: void setNightModeSetting(); // 通过配置文件设置夜间模式 void nightChangedSlot(QHash nightArg); + QString getSunTime(); // 获取日出日落时间 void callMethod(QRect geometry, QString name);// 设置wayland主屏幕 QString getPrimaryWaylandScreen(); @@ -159,10 +170,10 @@ private Q_SLOTS: public Q_SLOTS: void save(); - void scaleChangedSlot(double scale); void changedSlot(); void propertiesChangedSlot(QString, QMap, QStringList); void mOutputClicked(); + void scaleChangedSlot(double scale); private: void loadQml(); @@ -173,16 +184,13 @@ private: void initComponent(); void initDbusComponent(); void setHideModuleInfo(); - void setTitleLabel(); void writeScale(double scale); void initGSettings(); void setcomBoxScale(); - void initNightUI(); void initAutoBrihgtUI(); - QFrame *setLine(QFrame *frame); void initAdvanceScreen(); - bool isRestoreConfig(); // 是否恢复应用之前的配置 + bool isRestoreConfig(); bool isCloneMode(); bool isBacklight(); bool isBacklightAllInOne(); @@ -202,6 +210,12 @@ private: int updateScreenConfig(); // 获取系统最新配置 void showZoomtips(); // 缩放注销提示框 + void compareScale(); + void outputEnableChanged(); + + bool checkSpliceFeasibility(); + void initSpliceFrame(); + void setSpliceFrameVisiable(bool b); private: Ui::DisplayWindow *ui; @@ -216,22 +230,19 @@ private: KScreen::ConfigPtr mPrevConfig = nullptr; KScreen::OutputPtr res = nullptr; #endif - - ControlPanel *mControlPanel = nullptr; OutputConfig *mOutputConfig = nullptr; // 设置主显示器相关控件 QList mOutputIdentifiers; QTimer *mOutputTimer = nullptr; - QString mCPU; - QString mDir; + QString mCPU; + QString mDir; + QString mScaleDir; + QString mUsdScaleDir; QStringList mPowerKeys; - KSwitchButton *mNightButton = nullptr; - KSwitchButton *mCloseScreenButton = nullptr; KSwitchButton *mUnifyButton = nullptr; - KSwitchButton *mThemeButton = nullptr; KSwitchButton *mNightModeBtn = nullptr; KSwitchButton *mAutoBrightBtn = nullptr; KSwitchButton *mBackBrightBtn = nullptr; @@ -253,26 +264,12 @@ private: LightLabel *mBackHintLabel = nullptr; LightLabel *mBrightHintLabel= nullptr; - QComboBox *mTimeModeCombox = nullptr; QComboBox *mOpenTimeHCombox = nullptr; QComboBox *mQpenTimeMCombox = nullptr; QComboBox *mCloseTimeHCombox = nullptr; QComboBox *mCloseTimeMCombox = nullptr; QComboBox *mMultiScreenCombox = nullptr; - Uslider *mTemptSlider = nullptr; - - QFrame *mMultiScreenFrame = nullptr; - QFrame *mNightModeFrame = nullptr; - QFrame *mOpenFrame = nullptr; - QFrame *mTimeModeFrame = nullptr; - QFrame *mCustomTimeFrame = nullptr; - QFrame *mTemptFrame = nullptr; - QFrame *line_1 = nullptr; - QFrame *line_2 = nullptr; - QFrame *line_3 = nullptr; - - QGSettings *mGsettings = nullptr; QGSettings *scaleGSettings = nullptr; QGSettings *mPowerGSettings = nullptr; QGSettings *m_colorSettings = nullptr; @@ -285,11 +282,14 @@ private: QSharedPointer mUPowerInterface; QSharedPointer mUkccInterface; QDBusInterface *mUsdDbus; + QDBusInterface *m_StatusDbus = nullptr; QHash mNightConfig; double mScreenScale = 1.0; double scaleres = 1.0; + QMap firstChangeScaleList; + double firstChangeScale = 0.0; QSize mScaleSizeRes = QSize(); @@ -323,6 +323,35 @@ private: int mKdsStatus = INT_MIN; QMap I2CbusMap; + SpliceDialog *spliceDialog; + int connectedOutputNum; + QLabel *spliceMethodLabel = nullptr; + +private: + SettingGroup *modeGroup = nullptr; + UkccFrame *mMultiScreenFrame = nullptr; + UkccFrame *spliceFrame = nullptr; + SettingGroup *configGroup = nullptr; + UkccFrame *monitorFrame = nullptr; + FixLabel *monitorLabel = nullptr; + QComboBox *monitorComboBox = nullptr; + QPushButton *monitorBtn = nullptr; + ControlPanel *mControlPanel = nullptr; + UkccFrame *scaleFrame = nullptr; + FixLabel *scaleLabel = nullptr; + QComboBox *scaleComboBox = nullptr; + UkccFrame *openMonitorFrame = nullptr; + FixLabel *openMonitorLabel = nullptr; + KSwitchButton *openMonitorButton = nullptr; + UkccFrame *autoBrightFrame = nullptr; + UkccFrame *mbrightnessFrame = nullptr; + QVBoxLayout *mbrightnesslayout = nullptr; + UkccFrame *backLightFrame = nullptr; + SettingGroup *mNightModeFrame = nullptr; + SwitchWidget *mNightModeWidget = nullptr; + ComboxWidget *mTimeModeWidget = nullptr; + UkccFrame *mCustomTimeWidget = nullptr; + SliderWidget *mTemptWidget = nullptr; }; #endif // WIDGET_H diff --git a/plugins/system/display_hw/brightnessFrame.h b/plugins/system/display_hw/brightnessFrame.h index 3474573..565d52e 100644 --- a/plugins/system/display_hw/brightnessFrame.h +++ b/plugins/system/display_hw/brightnessFrame.h @@ -5,7 +5,7 @@ #include #include #include -#include "widgets/Uslider/uslider.h" +#include "uslider.h" class BrightnessFrame : public QFrame { diff --git a/plugins/system/display_hw/display_hw.cpp b/plugins/system/display_hw/display_hw.cpp index 3aeffa3..bf388f1 100644 --- a/plugins/system/display_hw/display_hw.cpp +++ b/plugins/system/display_hw/display_hw.cpp @@ -21,7 +21,7 @@ #include "display_hw.h" #include "ui_display_hw.h" -#include "../../../shell/utils/utils.h" +#include "common.h" #include #include @@ -71,7 +71,7 @@ const QString DisplaySet::name() const bool DisplaySet::isShowOnHomePage() const { - return Utils::isWayland(); + return Common::isWayland(); } QIcon DisplaySet::icon() const @@ -81,7 +81,7 @@ QIcon DisplaySet::icon() const bool DisplaySet::isEnable() const { - return Utils::isWayland(); + return Common::isWayland(); } void DisplaySet::requestBackend() diff --git a/plugins/system/display_hw/display_hw.pro b/plugins/system/display_hw/display_hw.pro index f7b4814..b1f341d 100644 --- a/plugins/system/display_hw/display_hw.pro +++ b/plugins/system/display_hw/display_hw.pro @@ -4,6 +4,10 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Uslider/uslider.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ComboBox/combobox.pri) QT += widgets core gui quickwidgets quick xml KScreen dbus concurrent KConfigCore TEMPLATE = lib diff --git a/plugins/system/display_hw/display_hw.ui b/plugins/system/display_hw/display_hw.ui index 5b659b4..3d62dce 100644 --- a/plugins/system/display_hw/display_hw.ui +++ b/plugins/system/display_hw/display_hw.ui @@ -918,12 +918,12 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
Uslider QSlider -
../../../libukcc/widgets/Uslider/uslider.h
+
uslider.h
diff --git a/plugins/system/display_hw/displayperformancedialog.cpp b/plugins/system/display_hw/displayperformancedialog.cpp index 8b12a39..bb31e33 100644 --- a/plugins/system/display_hw/displayperformancedialog.cpp +++ b/plugins/system/display_hw/displayperformancedialog.cpp @@ -19,7 +19,7 @@ */ #include "displayperformancedialog.h" #include "ui_displayperformancedialog.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include #include diff --git a/plugins/system/display_hw/outputconfig.cpp b/plugins/system/display_hw/outputconfig.cpp index 3762dd6..b239746 100644 --- a/plugins/system/display_hw/outputconfig.cpp +++ b/plugins/system/display_hw/outputconfig.cpp @@ -19,7 +19,7 @@ #include #include -#include "widgets/ComboBox/combobox.h" +#include "combobox.h" double mScreenScale = 1.0; int changeItm = -1; diff --git a/plugins/system/display_hw/resolutionslider.h b/plugins/system/display_hw/resolutionslider.h index b7ecf08..9f870b7 100644 --- a/plugins/system/display_hw/resolutionslider.h +++ b/plugins/system/display_hw/resolutionslider.h @@ -5,7 +5,7 @@ #include #include -#include "widgets/Uslider/uslider.h" +#include "uslider.h" class QSlider; class QLabel; diff --git a/plugins/system/display_hw/unifiedoutputconfig.cpp b/plugins/system/display_hw/unifiedoutputconfig.cpp index 9c2ef27..1a9c966 100644 --- a/plugins/system/display_hw/unifiedoutputconfig.cpp +++ b/plugins/system/display_hw/unifiedoutputconfig.cpp @@ -116,8 +116,8 @@ void UnifiedOutputConfig::initUi() mRotation->addItem(tr("arrow-up"), KScreen::Output::None); mRotation->addItem(tr("90° arrow-right"), KScreen::Output::Right); - mRotation->addItem(tr("arrow-down"), KScreen::Output::Inverted); mRotation->addItem(tr("90° arrow-left"), KScreen::Output::Left); + mRotation->addItem(tr("arrow-down"), KScreen::Output::Inverted); int index = mRotation->findData(mOutput->rotation()); mRotation->setCurrentIndex(index); diff --git a/plugins/system/display_hw/utils.cpp b/plugins/system/display_hw/utils.cpp index f79cc85..e075c90 100644 --- a/plugins/system/display_hw/utils.cpp +++ b/plugins/system/display_hw/utils.cpp @@ -3,8 +3,6 @@ #include #include -#include "../../../shell/utils/utils.h" - QString Utils::outputName(const KScreen::OutputPtr &output) { return outputName(output.data()); diff --git a/plugins/system/display_hw/widget.cpp b/plugins/system/display_hw/widget.cpp index 0c54f7c..cafacea 100644 --- a/plugins/system/display_hw/widget.cpp +++ b/plugins/system/display_hw/widget.cpp @@ -6,7 +6,7 @@ #include "ui_display_hw.h" #include "displayperformancedialog.h" #include "colorinfo.h" -#include "../../../shell/utils/utils.h" +#include "common.h" #include "../../../shell/mainwindow.h" #include @@ -585,7 +585,7 @@ void Widget::writeScale(double scale) scaleGSettings->set(SCALE_KEY, scale); } cursorSettings.set(CURSOR_SIZE_KEY, cursize); - Utils::setKwinMouseSize(cursize); + Common::setKwinMouseSize(cursize); } } @@ -841,6 +841,36 @@ int Widget::getDDCBrighthess(QString name) return 0; } +int Widget::getDDCBrighthess(QString edidHash, QString i2cBus) { + int times = 600; + QDBusInterface ukccIfc("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus()); + QDBusReply reply; + while (times) { + //防止调用terminate不会结束线程,锁屏在龙芯架构上出现过 + if (exitFlag) { + return -1; + } + if (times %10 != 0) { + times--; + usleep(100000); + continue; + } + if (i2cBus == "") { + return -1; + } + reply = ukccIfc.call("getDisplayBrightness", edidHash, i2cBus); + if (reply.isValid() && reply.value() >= 0 && reply.value() <= 100) { + return reply.value(); + } + times--; + usleep(100000); + } + return -1; +} + int Widget::getLaptopBrightness() const { return mPowerGSettings->get(POWER_KEY).toInt(); @@ -892,7 +922,7 @@ void Widget::clearOutputIdentifiers() mOutputIdentifiers.clear(); } -void Widget::addBrightnessFrame(QString name, bool openFlag, const KScreen::OutputPtr &output) +void Widget::addBrightnessFrame(QString name, bool openFlag, const KScreen::OutputPtr &output, QString i2cBus) { if (mIsBattery && name != "eDP") //笔记本非内置 return; @@ -922,36 +952,67 @@ void Widget::addBrightnessFrame(QString name, bool openFlag, const KScreen::Outp mPowerGSettings->set(POWER_KEY, frame->slider->value()); frame->setTextLableValue(QString::number(mPowerGSettings->get(POWER_KEY).toInt())); }); - } else if(!mIsBattery && output && output->supportBrightness()) { + } else if(!mIsBattery && output) { frame->outputName = name; ui->unifyBrightLayout->addWidget(frame); frame->slider->setValue(10); - QtConcurrent::run([=]{ - int initValue = output->brightness(); - if (initValue == -1 || frame == nullptr) - return; - frame->slider->setValue(initValue); - frame->setTextLableValue(QString::number(initValue)); - connect(frame->slider, &QSlider::valueChanged, this, [=](){ - qDebug()<slider->setEnabled(true); + frame->slider->setValue(initValue); + frame->setTextLableValue(QString::number(initValue)); + connect(frame->slider, &QSlider::valueChanged, this, [=](){ + qDebug()<clone(); QString name = Utils::outputName(output); - addBrightnessFrame(name, output->isEnabled(), output); + QMap::iterator it; + QString outPutI2cBus = ""; + for (it = I2CbusMap.begin(); it != I2CbusMap.end(); it++) { + if (name.contains(it.key(), Qt::CaseInsensitive)) { + outPutI2cBus = it.value(); + break; + } + } + addBrightnessFrame(name, output->isEnabled(), output, outPutI2cBus); // 刷新缩放选项,监听新增显示屏的mode变化 changescale(); if (output->isConnected()) { @@ -1215,6 +1276,24 @@ void Widget::setDDCBrightnessN(int value, QString screenName) } } +void Widget::setDDCBrightnessN(int value, QString edidHash, QString i2cBus) +{ + if (i2cBus == "") + return; + + QDBusInterface ukccIfc("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus()); + + + if (mLock.tryLock()) { + ukccIfc.call("setDisplayBrightness", QString::number(value), edidHash, i2cBus); + mLock.unlock(); + } + +} + void Widget::setScreenKDS(QString kdsConfig) { KScreen::OutputList screens = mConfig->connectedOutputs(); @@ -2081,7 +2160,7 @@ void Widget::initNightStatus() "/ColorCorrect", "org.ukui.kwin.ColorCorrect", QDBusConnection::sessionBus()); - if (colorIft.isValid() && Utils::isExistEffect() && !mIsWayland) { + if (colorIft.isValid() && Common::isExistEffect() && !mIsWayland) { this->mRedshiftIsValid = true; } else { qWarning() << "create org.ukui.kwin.ColorCorrect failed"; @@ -2280,3 +2359,55 @@ void Widget::changescale() } } + +void Widget::getAllI2Cbus() +{ + I2CbusMap.clear(); + QMap msg; + QString cmd = "find /sys/class/drm/card0-*/*/ -name '*i2c-[0-9]*'"; + QProcess process; + process.start("bash", QStringList() <<"-c"<= 5) { + if (!msg.keys().contains(i2cList.at(4))) { + //当不存在时就添加 + msg.insert(i2cList.at(4), resultList.at(i)); + } else { + //已经存在,但是内容更少时也重新替换,drm中文件是嵌套的,可能存在包含关系,故做此处理 + if (msg[i2cList.at(4)].size() > resultList.at(i).size()) { + msg[i2cList.at(4)] = resultList.at(i); + } + } + } + } + QMap::const_iterator it; + for (it = msg.constBegin(); it != msg.constEnd(); ++it) { + qDebug()<<" ----------MAP-MSG--------- "< deleteFrameNameV; //用二级指针判断null出现问题,只想到这种方式排除段错误 BrightnessFrame *currentBrightnessFrame; bool exitFlag = false; - + QMap I2CbusMap; }; diff --git a/plugins/system/notice/notice.cpp b/plugins/system/notice/notice.cpp index b800d3a..af1663f 100644 --- a/plugins/system/notice/notice.cpp +++ b/plugins/system/notice/notice.cpp @@ -21,20 +21,34 @@ #include "appdetail.h" #include "realizenotice.h" #include "noticemenu.h" -#include "widgets/HoverWidget/hoverwidget.h" +#include "hoverwidget.h" #include #include #include #include #include +#include +#include "interface/common.h" #define NOTICE_SCHEMA "org.ukui.control-center.notice" #define NEW_FEATURE_KEY "show-new-feature" #define ENABLE_NOTICE_KEY "enable-notice" #define SHOWON_LOCKSCREEN_KEY "show-on-lockscreen" -#define DESKTOPPATH "/usr/share/applications/" -#define DESKTOPOTHERPAYH "/etc/xdg/autostart/" +#define AUTOSTARTDIR "/etc/xdg/autostart/" + +class ukToolButton : public QToolButton +{ +public: + ukToolButton(QWidget *parent = nullptr): + QToolButton(parent) + { + + } + +protected: + void paintEvent(QPaintEvent *event) override; +}; Notice::Notice() : mFirstLoad(true) { @@ -45,8 +59,6 @@ Notice::Notice() : mFirstLoad(true) Notice::~Notice() { if (!mFirstLoad) { - delete mstringlist; - mstringlist = nullptr; qDeleteAll(vecGsettins); vecGsettins.clear(); } @@ -86,31 +98,22 @@ QWidget *Notice::pluginUi() initUi(pluginWidget); //获取已经存在的动态路径 listChar = listExistsCustomNoticePath(); - mstringlist = new QStringList(); initSearchText(); setupComponent(); setupGSettings(); initNoticeStatus(); + //设置白名单 whitelist.append("kylin-screenshot.desktop"); whitelist.append("peony.desktop"); - whitelist.append("kylin-nm.desktop"); whitelist.append("ukui-flash-disk.desktop"); whitelist.append("ukui-powermanagement-daemon.desktop"); whitelist.append("kylin-system-update.desktop"); whitelist.append("ukui-bluetooth.desktop"); initOriNoticeStatus(); - //监视desktop文件列表 - QFileSystemWatcher *m_fileWatcher=new QFileSystemWatcher; - m_fileWatcher->addPaths(QStringList()<setSpacing(0); mverticalLayout->setContentsMargins(0, 0, 0, 0); - QFrame *notFazeFrame = new QFrame(widget); - initNotFaze(notFazeFrame); - - QWidget *Noticewidget = new QWidget(widget); - Noticewidget->setMinimumSize(QSize(550, 0)); - Noticewidget->setMaximumSize(QSize(16777215, 16777215)); - - QVBoxLayout *NoticeLayout = new QVBoxLayout(Noticewidget); - NoticeLayout->setContentsMargins(0, 0, 0, 0); - NoticeLayout->setSpacing(8); - - mNoticeLabel = new TitleLabel(Noticewidget); - mNotFazeLabel = new TitleLabel(); + mNoticeLabel = new TitleLabel; + mNotFazeLabel = new TitleLabel; + mNoticeLabel->setText(tr("Notice Settings")); mNotFazeLabel->setText(tr("NotFaze Mode")); + UkccFrame *distrubFrame = new UkccFrame(widget); + distrubFrame->setFrameShape(QFrame::NoFrame); LightLabel *notFazeLabel = new LightLabel(tr("(Notification banners, prompts will be hidden, and notification sounds will be muted)")); - QFrame *distrubFrame = new QFrame(widget); - distrubFrame->setMinimumWidth(550); - distrubFrame->setMaximumWidth(16777215); - QHBoxLayout *distrubLyt = new QHBoxLayout(distrubFrame); distrubLyt->setContentsMargins(0, 0, 0, 0); distrubLyt->addWidget(mNotFazeLabel); distrubLyt->addSpacing(4); distrubLyt->addWidget(notFazeLabel, Qt::AlignLeft); - mGetNoticeFrame = new QFrame(Noticewidget); - mGetNoticeFrame->setMinimumSize(QSize(550, 60)); - mGetNoticeFrame->setMaximumSize(QSize(16777215, 60)); - mGetNoticeFrame->setFrameShape(QFrame::Box); + SettingGroup *notFazeFrame = new SettingGroup(widget); + initNotFaze(notFazeFrame); - QHBoxLayout *mGetNoticeLayout = new QHBoxLayout(mGetNoticeFrame); - mGetNoticeLayout->setContentsMargins(16,0,16,0); + mGetNoticeWidget = new SwitchWidget(tr("Get notifications from the app")); + mApplistWidget = new SettingGroup; - mGetNoticeLabel = new QLabel(mGetNoticeFrame); - mGetNoticeLabel->setFixedWidth(550); - enableSwitchBtn = new KSwitchButton(mGetNoticeFrame); - - mGetNoticeLayout->addWidget(mGetNoticeLabel,Qt::AlignLeft); - mGetNoticeLayout->addStretch(); - mGetNoticeLayout->addWidget(enableSwitchBtn); - - mNoticeAppFrame = new QFrame(Noticewidget); - mNoticeAppFrame->setMinimumSize(QSize(550, 0)); - mNoticeAppFrame->setMaximumSize(QSize(16777215, 16777215)); - mNoticeAppFrame->setFrameShape(QFrame::Box); - - applistverticalLayout = new QVBoxLayout(mNoticeAppFrame); - applistverticalLayout->setContentsMargins(0,0,0,0); - applistverticalLayout->setSpacing(0); - - NoticeLayout->addWidget(mNoticeLabel); - NoticeLayout->addWidget(mGetNoticeFrame); - NoticeLayout->addWidget(mNoticeAppFrame); - - if (mDisTrubSettings && mDisTrubSettings->keys().contains(FULLSCREEN_KEY)) { -// mverticalLayout->addLayout(distrubLyt); - mverticalLayout->addWidget(distrubFrame); - mverticalLayout->addSpacing(8); - mverticalLayout->addWidget(notFazeFrame); - mverticalLayout->addSpacing(32); - } else { - distrubFrame->hide(); - notFazeFrame->hide(); - } - mverticalLayout->addWidget(Noticewidget); + mverticalLayout->setSpacing(8); + mverticalLayout->addWidget(distrubFrame); + mverticalLayout->addWidget(notFazeFrame); + mverticalLayout->addSpacing(24); + mverticalLayout->addWidget(mNoticeLabel); + mverticalLayout->addWidget(mGetNoticeWidget); + mverticalLayout->addWidget(mApplistWidget); mverticalLayout->addStretch(); } -void Notice::initNotFaze(QFrame *frame) +void Notice::initNotFaze(SettingGroup *widget) { - frame->setMinimumSize(QSize(550, 0)); - frame->setMaximumSize(QSize(16777215, 16777215)); - frame->setFrameShape(QFrame::Box); - - QVBoxLayout *notFazeLyt = new QVBoxLayout(frame); - notFazeLyt->setContentsMargins(0, 0, 0, 0); - notFazeLyt->setSpacing(0); - - QFrame *line_1 = NoticeMenu::setLine(); - QFrame *line_2 = NoticeMenu::setLine(); - QFrame *line_3 = NoticeMenu::setLine(); - - QFrame *autoOpenFrame = new QFrame(frame); - autoOpenFrame->setMinimumSize(550, 60); - autoOpenFrame->setMaximumSize(16777215, 60); + UkccFrame *autoOpenFrame = new UkccFrame(widget, UkccFrame::BorderRadiusStyle::Around, true); QHBoxLayout *autoLyt = new QHBoxLayout(autoOpenFrame); autoLyt->setContentsMargins(16, 0, 16, 0); QLabel *autoOpenLabel = new QLabel(tr("Automatically turn on"), autoOpenFrame); @@ -243,12 +193,10 @@ void Notice::initNotFaze(QFrame *frame) mOpenTimeHCombox->addItem(QStringLiteral("%1").arg(i, 2, 10, QLatin1Char('0'))); mCloseTimeHCombox->addItem(QStringLiteral("%1").arg(i, 2, 10, QLatin1Char('0'))); } - for (int i = 0; i < 60; i++) { mOpenTimeMCombox->addItem(QStringLiteral("%1").arg(i, 2, 10, QLatin1Char('0'))); mCloseTimeMCombox->addItem(QStringLiteral("%1").arg(i, 2, 10, QLatin1Char('0'))); } - QLabel * label_1 = new QLabel(autoOpenFrame); label_1->setFixedWidth(20); label_1->setText(tr("to")); @@ -259,7 +207,6 @@ void Notice::initNotFaze(QFrame *frame) label_3->setFixedWidth(4); label_3->setText(":"); mAutoOpenSwitchBtn = new KSwitchButton(autoOpenFrame); - autoLyt->addWidget(autoOpenLabel); autoLyt->addStretch(); autoLyt->addWidget(mOpenTimeHCombox); @@ -272,49 +219,21 @@ void Notice::initNotFaze(QFrame *frame) autoLyt->addSpacing(24); autoLyt->addWidget(mAutoOpenSwitchBtn); - QFrame *multiScreenFrame = new QFrame(frame); - mMultiScreenSwitchBtn= new KSwitchButton(); - setFrame(multiScreenFrame, mMultiScreenSwitchBtn, tr("Automatically turn on when multiple screens are connected")); + mMultiScreenWidget = new SwitchWidget(tr("Automatically turn on when multiple screens are connected")); + mFullScreenWidget = new SwitchWidget(tr("Automatically open in full screen mode")); + mAllowAlarmrWidget = new SwitchWidget(tr("Allow automatic alarm reminders in Do Not Disturb mode")); - QFrame *fullScreenFrame = new QFrame(frame); - mFullScreenSwitchBtn= new KSwitchButton(); - setFrame(fullScreenFrame, mFullScreenSwitchBtn, tr("Automatically open in full screen mode")); - - QFrame *allowAlarmrRemindersFrame = new QFrame(frame); - mAllowAlarmrSwitchBtn= new KSwitchButton(); - setFrame(allowAlarmrRemindersFrame, mAllowAlarmrSwitchBtn, tr("Allow automatic alarm reminders in Do Not Disturb mode")); - - notFazeLyt->addWidget(autoOpenFrame); - notFazeLyt->addWidget(line_1); - notFazeLyt->addWidget(multiScreenFrame); - notFazeLyt->addWidget(line_2); - notFazeLyt->addWidget(fullScreenFrame); - notFazeLyt->addWidget(line_3); - notFazeLyt->addWidget(allowAlarmrRemindersFrame); + widget->addWidget(autoOpenFrame); + widget->addWidget(mMultiScreenWidget); + widget->addWidget(mFullScreenWidget); + widget->addWidget(mAllowAlarmrWidget); } -void Notice::setFrame(QFrame *frame, KSwitchButton *btn, QString str) -{ - frame->setMinimumSize(QSize(550, 60)); - frame->setMaximumSize(QSize(16777215, 60)); - frame->setFrameShape(QFrame::NoFrame); - - QHBoxLayout *hLyt = new QHBoxLayout(frame); - hLyt->setContentsMargins(16, 0, 16, 0); - QLabel *label = new QLabel(str, frame); - - hLyt->addWidget(label); - hLyt->addStretch(); - hLyt->addWidget(btn); - -} - - void Notice::initSearchText() { - mNoticeLabel->setText(tr("Notice Settings")); - //~ contents_path /notice/Get notifications from the app - mGetNoticeLabel->setText(tr("Get notifications from the app")); + //~ contents_path /Notice/Notice Settings + //~ contents_path /Notice/Get notifications from the app + //~ contents_path /Notice/NotFaze Mode } void Notice::setupComponent() @@ -339,24 +258,20 @@ void Notice::setupComponent() } if (mDisTrubSettings->keys().contains(PROJECTIONSCREEN_KEY)) - mMultiScreenSwitchBtn->setChecked(mDisTrubSettings->get(PROJECTIONSCREEN_KEY).toBool()); + mMultiScreenWidget->setChecked(mDisTrubSettings->get(PROJECTIONSCREEN_KEY).toBool()); if (mDisTrubSettings->keys().contains(FULLSCREEN_KEY)) - mFullScreenSwitchBtn->setChecked(mDisTrubSettings->get(FULLSCREEN_KEY).toBool()); + mFullScreenWidget->setChecked(mDisTrubSettings->get(FULLSCREEN_KEY).toBool()); if (mDisTrubSettings->keys().contains(ALARMCLOCK_KEY)) - mAllowAlarmrSwitchBtn->setChecked(mDisTrubSettings->get(ALARMCLOCK_KEY).toBool()); + mAllowAlarmrWidget->setChecked(mDisTrubSettings->get(ALARMCLOCK_KEY).toBool()); } } void Notice::setupGSettings() { - connect(mThemeSetting, &QGSettings::changed, [=](const QString &key){ - if (key == "iconThemeName") - loadlist(); - }); - - connect(enableSwitchBtn, &KSwitchButton::stateChanged, [=](bool checked){ + connect(mGetNoticeWidget, &SwitchWidget::stateChanged, [=](bool checked){ + Common::buriedSettings(name(), "whether to get the notification from the app", QString("settings"), checked ? "true" : "false"); nSetting->set(ENABLE_NOTICE_KEY, checked); setHiddenNoticeApp(checked); }); @@ -364,25 +279,29 @@ void Notice::setupGSettings() if (mDisTrubSettings) { if (mDisTrubSettings->keys().contains(AUTOSTART_KEY)) { connect(mAutoOpenSwitchBtn, &KSwitchButton::stateChanged, [=](bool checked) { + Common::buriedSettings(name(), "whether auto turn on do not disturb mode", QString("settings"), checked ? "true" : "false"); mDisTrubSettings->set(AUTOSTART_KEY, checked); setComBoxStatus(checked); }); } if (mDisTrubSettings->keys().contains(PROJECTIONSCREEN_KEY)) { - connect(mMultiScreenSwitchBtn, &KSwitchButton::stateChanged, [=](bool checked) { + connect(mMultiScreenWidget, &SwitchWidget::stateChanged, [=](bool checked) { + Common::buriedSettings(name(), "whether auto turn on do not disturb mode when multi screen connection", QString("settings"), checked ? "true" : "false"); mDisTrubSettings->set(PROJECTIONSCREEN_KEY, checked); }); } if (mDisTrubSettings->keys().contains(FULLSCREEN_KEY)) { - connect(mFullScreenSwitchBtn, &KSwitchButton::stateChanged, [=](bool checked) { + connect(mFullScreenWidget, &SwitchWidget::stateChanged, [=](bool checked) { + Common::buriedSettings(name(), "whether auto turn on do not disturb mode when full screen mode", QString("settings"), checked ? "true" : "false"); mDisTrubSettings->set(FULLSCREEN_KEY, checked); }); } if (mDisTrubSettings->keys().contains(ALARMCLOCK_KEY)) { - connect(mAllowAlarmrSwitchBtn, &KSwitchButton::stateChanged, [=](bool checked) { + connect(mAllowAlarmrWidget, &SwitchWidget::stateChanged, [=](bool checked) { + Common::buriedSettings(name(), "whether allow alarm prompt at not disturb mode", QString("settings"), checked ? "true" : "false"); mDisTrubSettings->set(ALARMCLOCK_KEY, checked); }); } @@ -390,24 +309,28 @@ void Notice::setupGSettings() if (mDisTrubSettings->keys().contains(TIMESTART_KEY) && mDisTrubSettings->keys().contains(TIMEEND_KEY)) { connect(mOpenTimeHCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index){ Q_UNUSED(index); + Common::buriedSettings(name(), "open time(hour) when auto turn on do not disturb mode", QString("settings"), mOpenTimeHCombox->currentText()); mDisTrubSettings->set(TIMESTART_KEY, QString("%1%2%3").arg(mOpenTimeHCombox->currentText()).arg(":").arg(mOpenTimeMCombox->currentText())); qDebug()<get(TIMESTART_KEY).toString(); }); connect(mOpenTimeMCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index){ Q_UNUSED(index); + Common::buriedSettings(name(), "open time(minute) when auto turn on do not disturb mode", QString("settings"), mOpenTimeMCombox->currentText()); mDisTrubSettings->set(TIMESTART_KEY, QString("%1%2%3").arg(mOpenTimeHCombox->currentText()).arg(":").arg(mOpenTimeMCombox->currentText())); qDebug()<get(TIMESTART_KEY).toString(); }); connect(mCloseTimeHCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index){ Q_UNUSED(index); + Common::buriedSettings(name(), "close time(hour) when auto turn on do not disturb mode", QString("settings"), mCloseTimeMCombox->currentText()); mDisTrubSettings->set(TIMEEND_KEY, QString("%1%2%3").arg(mCloseTimeHCombox->currentText()).arg(":").arg(mCloseTimeMCombox->currentText())); qDebug()<get(TIMEEND_KEY).toString(); }); connect(mCloseTimeMCombox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index){ Q_UNUSED(index); + Common::buriedSettings(name(), "close time(minute) when auto turn on do not disturb mode", QString("settings"), mCloseTimeMCombox->currentText()); mDisTrubSettings->set(TIMEEND_KEY, QString("%1%2%3").arg(mCloseTimeHCombox->currentText()).arg(":").arg(mCloseTimeMCombox->currentText())); qDebug()<get(TIMEEND_KEY).toString(); }); @@ -417,54 +340,40 @@ void Notice::setupGSettings() void Notice::initNoticeStatus() { - enableSwitchBtn->blockSignals(true); - enableSwitchBtn->setChecked(nSetting->get(ENABLE_NOTICE_KEY).toBool()); - enableSwitchBtn->blockSignals(false); + mGetNoticeWidget->blockSignals(true); + mGetNoticeWidget->setChecked(nSetting->get(ENABLE_NOTICE_KEY).toBool()); + mGetNoticeWidget->blockSignals(false); -// isCN_env = nSetting->get(IS_CN).toBool(); - mlocale = QLocale::system().name(); - if (mlocale == "zh_CN") { - mEnv = true; - } else { - mEnv = false; - } - setHiddenNoticeApp(enableSwitchBtn->isChecked()); + mEnv = (QLocale::system().name() == "zh_CN" ? true : false); + setHiddenNoticeApp(mGetNoticeWidget->isChecked()); } void Notice::initOriNoticeStatus() { - QDir dir(QString(DESKTOPPATH).toUtf8()); - QDir otherdir(QDir::homePath() + "/.local/share/applications"); - QDir autodir(QString(DESKTOPOTHERPAYH).toUtf8()); + QStringList appsDirs = QStringList(AUTOSTARTDIR) + QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation); - QStringList filters; - filters<clear(); + for (QString path : appsDirs) { + QDir dir(path); + QStringList filters; + filters<setIniCodec("utf-8"); @@ -477,78 +386,50 @@ void Notice::initListUI(QDir dir,QString mpath,QStringList *stringlist) appname_US = desktopFile->value(QString("Desktop Entry/Name")).toString(); delete desktopFile; desktopFile = nullptr; + } else { + return; } - if (not_showin != nullptr) { + if (!not_showin.isEmpty()) { if (not_showin.contains("UKUI")) { continue; } } - if (only_showin != nullptr) { + if (!only_showin.isEmpty()) { if (only_showin.contains("LXQt") || only_showin.contains("KDE")) { continue; } } - if (stringlist->contains(appname)) { + if (mApplist.contains(appname)) { qDebug()<append(appname); - // 构建Widget - QFrame *baseWidget = new QFrame(mNoticeAppFrame); - baseWidget->setMinimumWidth(550); - baseWidget->setMaximumWidth(16777215); - baseWidget->setFixedHeight(60); - baseWidget->setFrameShape(QFrame::Shape::NoFrame); - baseWidget->setAttribute(Qt::WA_DeleteOnClose); + SwitchWidget *baseWidget = new SwitchWidget(mEnv ? appname_CN : appname_US, mApplistWidget); - QPushButton *iconBtn = new QPushButton(baseWidget); + QLabel *iconLabel = new QLabel(baseWidget); + iconLabel->setFixedSize(32, 32); + if (file_name == "ukui-flash-disk.desktop") + icon = "drive-removable-media-usb"; + setAppIcon(iconLabel, icon); + connect(mThemeSetting, &QGSettings::changed, [=](const QString &key){ + if (key == "iconThemeName") + setAppIcon(iconLabel, icon); - iconBtn->setStyleSheet("QPushButton{background-color:transparent;border-radius:4px}" - "QPushButton:hover{background-color: transparent ;color:transparent;}"); - iconBtn->setIconSize(QSize(32, 32)); - iconBtn->setIcon(QIcon::fromTheme(icon, - QIcon(QString("/usr/share/pixmaps/"+icon) - +".png"))); + }); - QHBoxLayout *devHorLayout = new QHBoxLayout(baseWidget); - devHorLayout->setSpacing(8); - devHorLayout->setContentsMargins(16, 0, 16, 0); - - - QLabel *nameLabel = new QLabel(baseWidget); - - QToolButton *setBtn = new QToolButton(baseWidget); - setBtn->setStyleSheet("QToolButton:!checked{background-color: palette(base)}"); + ukToolButton *setBtn = new ukToolButton(baseWidget); setBtn->setProperty("useButtonPalette", true); setBtn->setPopupMode(QToolButton::InstantPopup); - setBtn->setFixedSize(QSize(36, 36)); + setBtn->setFixedWidth(36); setBtn->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); - NoticeMenu *menu = new NoticeMenu(setBtn); setBtn->setMenu(menu); - KSwitchButton *appSwitch = new KSwitchButton(baseWidget); + baseWidget->insertWidget(0, iconLabel); + baseWidget->insertWidget(2, setBtn, 1, Qt::AlignRight); - devHorLayout->addWidget(iconBtn); - devHorLayout->addWidget(nameLabel); - devHorLayout->addStretch(); - devHorLayout->addWidget(setBtn); - devHorLayout->addWidget(appSwitch); - - QFrame *line = new QFrame(pluginWidget); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - applistverticalLayout->addWidget(baseWidget); - applistverticalLayout->addWidget(line); - if (count == whitelist.count()) { - line->hide(); - } + mApplistWidget->addWidget(baseWidget); //创建gsettings对象 if(appname_CN.isEmpty()) { @@ -566,41 +447,37 @@ void Notice::initListUI(QDir dir,QString mpath,QStringList *stringlist) usSettings = new QGSettings(id, uspath.toUtf8().data(), this); QGSettings *settings = nullptr; - if (mEnv) { - settings = cnSettings; - nameLabel->setText(appname_CN); - } else { - settings = usSettings; - nameLabel->setText(appname_US); - } + settings = mEnv ? cnSettings : usSettings; - bool isCheck = settings->get(MESSAGES_KEY).toBool(); - appSwitch->setChecked(isCheck); + baseWidget->setChecked(settings->get(MESSAGES_KEY).toBool()); bool voiceEnable = settings->get(VOICE_KEY).toBool(); bool detailEnable = settings->get(SHOW_DETAIL_KEY).toBool(); bool showEnable = settings->get(SHOW_SCREENLOCK_KEY).toBool(); QString style = settings->get(STYLE_KEY).toString(); - int mode = 0; - if (style == "mutative") { - mode = 0; - } else if (style == "always") { - mode = 1; - } else if (style == "none") { - mode = 2; - } + int mode = 0; + if (style == "mutative") { + mode = 0; + } else if (style == "always") { + mode = 1; + } else if (style == "none") { + mode = 2; + } menu->initStaus(voiceEnable, detailEnable, showEnable, mode); connect(menu, &NoticeMenu::voiceSignals, [=](bool checked) { + Common::buriedSettings(name(), "whether prompt sound during notification", QString("settings"), checked ? "true" : "false"); cnSettings->set(VOICE_KEY, checked); usSettings->set(VOICE_KEY, checked); }); connect(menu, &NoticeMenu::detailSignals, [=](bool checked) { + Common::buriedSettings(name(), "whether to show the message content in the lock screen interface", QString("settings"), checked ? "true" : "false"); cnSettings->set(SHOW_DETAIL_KEY, checked); usSettings->set(SHOW_DETAIL_KEY, checked); }); connect(menu, &NoticeMenu::showSignals, [=](bool checked) { + Common::buriedSettings(name(), "whether to show the notice in the lock screen interface", QString("settings"), checked ? "true" : "false"); cnSettings->set(SHOW_SCREENLOCK_KEY, checked); usSettings->set(SHOW_SCREENLOCK_KEY, checked); }); @@ -613,6 +490,7 @@ void Notice::initListUI(QDir dir,QString mpath,QStringList *stringlist) str = "always"; else if (id == 2) str = "none"; + Common::buriedSettings(name(), "set notice style", QString("settings"), str); cnSettings->set(STYLE_KEY, str); usSettings->set(STYLE_KEY, str); }); @@ -620,37 +498,56 @@ void Notice::initListUI(QDir dir,QString mpath,QStringList *stringlist) connect(cnSettings, &QGSettings::changed, [=](QString key) { if (static_cast(MESSAGES_KEY) == key) { - appSwitch->blockSignals(true); + baseWidget->blockSignals(true); bool judge = cnSettings->get(MESSAGES_KEY).toBool(); if (usSettings->get(MESSAGES_KEY).toBool() != judge) usSettings->set(MESSAGES_KEY, judge); - if (appSwitch->isChecked() != judge) - appSwitch->setChecked(judge); - appSwitch->blockSignals(false); + if (baseWidget->isChecked() != judge) + baseWidget->setChecked(judge); + baseWidget->blockSignals(false); } }); connect(usSettings, &QGSettings::changed, [=](QString key) { if (static_cast(MESSAGES_KEY) == key) { - appSwitch->blockSignals(true); + baseWidget->blockSignals(true); bool judge = usSettings->get(MESSAGES_KEY).toBool(); if (cnSettings->get(MESSAGES_KEY).toBool() != judge) cnSettings->set(MESSAGES_KEY, judge); - if (appSwitch->isChecked() != judge) - appSwitch->setChecked(judge); - appSwitch->blockSignals(false); + if (baseWidget->isChecked() != judge) + baseWidget->setChecked(judge); + baseWidget->blockSignals(false); } }); - connect(appSwitch, &KSwitchButton::stateChanged, [=](bool checked) { + connect(baseWidget, &SwitchWidget::stateChanged, [=](bool checked) { + Common::buriedSettings(name(), appname_US + " whether to start notification", QString("settings"), checked ? "true" : "false"); cnSettings->set(MESSAGES_KEY, checked); usSettings->set(MESSAGES_KEY, checked); }); }} +void Notice::setAppIcon(QLabel *label, const QString &icon) +{ + QFileInfo iconfile(icon); + QPixmap pixmap; + if (!QString(icon).isEmpty()) { + QIcon currenticon + = QIcon::fromTheme(icon, + QIcon(QString("/usr/share/pixmaps/"+icon + +".png"))); + pixmap = currenticon.pixmap(QSize(32, 32)); + } else if (iconfile.exists()) { + pixmap = QPixmap(iconfile.filePath()).scaled(32, 32); + } else { + pixmap = QPixmap(QString(":/img/plugins/autoboot/desktop.png")); + } + label->setPixmap(pixmap); +} + void Notice::setHiddenNoticeApp(bool status) { - mNoticeAppFrame->setVisible(status); + mApplistWidget->setVisible(status); } void Notice::setComBoxStatus(bool status) @@ -661,13 +558,10 @@ void Notice::setComBoxStatus(bool status) mCloseTimeMCombox->setEnabled(status); } -void Notice::loadlist() +void ukToolButton::paintEvent(QPaintEvent *event) { - QLayoutItem *child; - while ((child = applistverticalLayout->takeAt(0)) != nullptr) - { - child->widget()->setParent(nullptr); - delete child; - } - initOriNoticeStatus(); + QPalette paltte; + paltte.setColor(QPalette::Button, paltte.base().color()); + this->setPalette(paltte); + QToolButton::paintEvent(event); } diff --git a/plugins/system/notice/notice.h b/plugins/system/notice/notice.h index f0375c7..c372b88 100644 --- a/plugins/system/notice/notice.h +++ b/plugins/system/notice/notice.h @@ -31,9 +31,11 @@ #include #include -#include "widgets/Label/titlelabel.h" -#include "widgets/Label/lightlabel.h" +#include "titlelabel.h" +#include "lightlabel.h" #include "kswitchbutton.h" +#include "switchwidget.h" +#include "settinggroup.h" using namespace kdk; /* qt会将glib里的signals成员识别为宏,所以取消该宏 @@ -70,14 +72,14 @@ public: bool isEnable() const Q_DECL_OVERRIDE; void initUi(QWidget *widget); - void initNotFaze(QFrame *frame); - void setFrame(QFrame *frame, KSwitchButton *btn, QString str); + void initNotFaze(SettingGroup *widget); void initSearchText(); void setupComponent(); void setupGSettings(); void initNoticeStatus(); void initOriNoticeStatus(); - void initListUI(QDir dir,QString mpath,QStringList *stringlist); + void initListUI(QDir dir,QString path); + void setAppIcon(QLabel *label, const QString &icon); private: @@ -93,17 +95,15 @@ private: TitleLabel *mNotFazeLabel; QLabel *mGetNoticeLabel; - QFrame *mNoticeAppFrame; - QFrame *mGetNoticeFrame; - KSwitchButton *newfeatureSwitchBtn; KSwitchButton *enableSwitchBtn; KSwitchButton *lockscreenSwitchBtn; - KSwitchButton *mAutoOpenSwitchBtn; - KSwitchButton *mMultiScreenSwitchBtn; - KSwitchButton *mFullScreenSwitchBtn; - KSwitchButton *mAllowAlarmrSwitchBtn; + + SwitchWidget *mGetNoticeWidget; + SwitchWidget *mMultiScreenWidget; + SwitchWidget *mFullScreenWidget; + SwitchWidget *mAllowAlarmrWidget; QComboBox *mOpenTimeHCombox; QComboBox *mOpenTimeMCombox; @@ -119,25 +119,16 @@ private: QStringList whitelist; QVector vecGsettins; - QVBoxLayout *applistverticalLayout; + SettingGroup *mApplistWidget; - QStringList *mstringlist; + QStringList mApplist; QList listChar; QStringList mblacklist; bool mFirstLoad; - bool isCN_env; bool mEnv; - QString mlocale; - - int count = 0; - int mcount = 0; - -public slots: - void loadlist(); - }; #endif // NOTICE_H diff --git a/plugins/system/notice/notice.pro b/plugins/system/notice/notice.pro index 1aaa297..d43a6b6 100644 --- a/plugins/system/notice/notice.pro +++ b/plugins/system/notice/notice.pro @@ -2,6 +2,10 @@ QT += widgets #greaterThan(QT_MAJOR_VERSION, 4): QT += widgets include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) TEMPLATE = lib CONFIG += plugin diff --git a/plugins/system/notice/noticemenu.cpp b/plugins/system/notice/noticemenu.cpp index 014492a..9361ea1 100644 --- a/plugins/system/notice/noticemenu.cpp +++ b/plugins/system/notice/noticemenu.cpp @@ -2,7 +2,7 @@ #include "realizenotice.h" #include #include -#include "widgets/Label/fixlabel.h" +#include "fixlabel.h" NoticeMenu::NoticeMenu(QWidget *parent) : QMenu(parent) @@ -87,18 +87,6 @@ void NoticeMenu::initUi() menuLyt->addWidget(noneFrame); menuLyt->addStretch(); - // 隐藏未实现模块 - voiceFrame->hide(); - line_1->hide(); - detailFrame->hide(); - line_2->hide(); - line_3->hide(); - styletitleLabel->hide(); - mutativeFrame->hide(); - alwaysFrame->hide(); - noneFrame->hide(); - setFixedHeight(60); - } void NoticeMenu::setFrame(QFrame *frame, QString str, KSwitchButton *btn) diff --git a/plugins/system/power/power.cpp b/plugins/system/power/power.cpp index e37073a..2c10a9c 100644 --- a/plugins/system/power/power.cpp +++ b/plugins/system/power/power.cpp @@ -141,7 +141,8 @@ QIcon Power::icon() const bool Power::isEnable() const { - return !(QString(QLatin1String(kdk_system_get_hostCloudPlatform())) == "huawei"); + return !(QString(QLatin1String(kdk_system_get_hostCloudPlatform())) == "huawei" || + QString(QLatin1String(kdk_system_get_hostVirtType())) != "none"); } void Power::InitUI(QWidget *widget) @@ -175,6 +176,7 @@ void Power::InitUI(QWidget *widget) mSleepPwdLabel->setFixedSize(550,60); mSleepPwdBtn = new KSwitchButton(mSleepPwdFrame); + mSleepPwdBtn->setObjectName("sleepwaken"); mSleepPwdLayout->addWidget(mSleepPwdLabel); mSleepPwdLayout->addStretch(); @@ -195,6 +197,7 @@ void Power::InitUI(QWidget *widget) mWakenPwdLabel->setFixedSize(550,49); mWakenPwdBtn = new KSwitchButton(mWakenPwdFrame); + mWakenPwdBtn->setObjectName("lockwaken"); mWakenPwdLayout->addWidget(mWakenPwdLabel); mWakenPwdLayout->addStretch(); @@ -216,6 +219,7 @@ void Power::InitUI(QWidget *widget) mPowerKeyLabel->setFixedSize(550,60); mPowerKeyComboBox = new QComboBox(mPowerKeyFrame); + mPowerKeyComboBox->setObjectName("powerkey"); mPowerKeyComboBox->setMinimumWidth(200); mPowerKeyLayout->addWidget(mPowerKeyLabel); @@ -236,6 +240,7 @@ void Power::InitUI(QWidget *widget) mCloseLabel->setFixedSize(550,60); mCloseComboBox = new QComboBox(mCloseFrame); + mCloseComboBox->setObjectName("close"); mCloseComboBox->setMinimumWidth(200); mCloseLayout->addWidget(mCloseLabel); @@ -256,6 +261,7 @@ void Power::InitUI(QWidget *widget) mSleepLabel->setFixedSize(550,59); mSleepComboBox = new QComboBox(mSleepFrame); + mSleepComboBox->setObjectName("sleep"); mSleepComboBox->setMinimumWidth(200); mSleepLayout->addWidget(mSleepLabel); @@ -277,6 +283,7 @@ void Power::InitUI(QWidget *widget) mCloseLidLabel->setFixedSize(550,59); mCloseLidComboBox = new QComboBox(mCloseLidFrame); + mCloseLidComboBox->setObjectName("closelid"); mCloseLidComboBox->setMinimumWidth(200); mCloseLidLayout->addWidget(mCloseLidLabel); @@ -312,6 +319,7 @@ void Power::InitUI(QWidget *widget) mPowerLabel->setFixedSize(550,60); mPowerComboBox = new QComboBox(mPowerFrame); + mPowerComboBox->setObjectName("powermode"); mPowerComboBox->setMinimumWidth(200); mPowerLayout->addWidget(mPowerLabel); @@ -332,6 +340,7 @@ void Power::InitUI(QWidget *widget) mBatteryLabel->setFixedSize(550,59); mBatteryComboBox = new QComboBox(mBatteryFrame); + mBatteryComboBox->setObjectName("batterymode"); mBatteryComboBox->setMinimumWidth(200); mBatteryLayout->addWidget(mBatteryLabel); @@ -366,6 +375,7 @@ void Power::InitUI(QWidget *widget) mDarkenLabel->setFixedSize(550,59); mDarkenComboBox = new QComboBox(mDarkenFrame); + mDarkenComboBox->setObjectName("darken"); mDarkenComboBox->setMinimumWidth(200); mDarkenLayout->addWidget(mDarkenLabel); @@ -389,8 +399,10 @@ void Power::InitUI(QWidget *widget) mLowpowerLayout->setContentsMargins(16, 0, 16, 0); mLowpowerComboBox1 = new QComboBox(mLowpowerFrame); + mLowpowerComboBox1->setObjectName("lowbatterylimit"); mLowpowerComboBox1->setFixedWidth(80); mLowpowerComboBox2 = new QComboBox(mLowpowerFrame); + mLowpowerComboBox2->setObjectName("lowbatterysettings"); mLowpowerComboBox2->setMinimumWidth(200); mLowpowerLayout->setSpacing(8); @@ -415,6 +427,7 @@ void Power::InitUI(QWidget *widget) mNoticeLabel->setFixedSize(550,59); mNoticeComboBox = new QComboBox(mNoticeLFrame); + mNoticeComboBox->setObjectName("noticesettings"); mNoticeComboBox->setMinimumWidth(200); mNoticeLayout->addWidget(mNoticeLabel); @@ -435,6 +448,7 @@ void Power::InitUI(QWidget *widget) mLowSaveLabel->setFixedSize(550,59); mLowSaveBtn = new KSwitchButton(mLowSaveFrame); + mLowSaveBtn->setObjectName("lowbatterysave"); mLowSaveLayout->addWidget(mLowSaveLabel); mLowSaveLayout->addStretch(); @@ -455,6 +469,7 @@ void Power::InitUI(QWidget *widget) mBatterySaveLabel->setFixedSize(550,59); mBatterySaveBtn = new KSwitchButton(mBatterySaveFrame); + mBatterySaveBtn->setObjectName("batterysave"); mBatterySaveLayout->addWidget(mBatterySaveLabel); mBatterySaveLayout->addStretch(); @@ -475,6 +490,7 @@ void Power::InitUI(QWidget *widget) mDisplayTimeLabel->setFixedSize(550,59); mDisplayTimeBtn = new KSwitchButton(mDisplayTimeFrame); + mDisplayTimeBtn->setObjectName("powershowtime"); mDisplayTimeLayout->addWidget(mDisplayTimeLabel); mDisplayTimeLayout->addStretch(); @@ -564,6 +580,10 @@ void Power::resetui() } mBatterySaveFrame->hide(); + mDarkenFrame->hide(); + mDisplayTimeFrame->hide(); + line_8->hide(); + line_11->hide(); line_12->hide(); //不存在盖子隐藏该项 if (!isExitsLid) { @@ -666,14 +686,6 @@ void Power::setupComponent() mBatteryComboBox->insertItem(1, BatteryplanStringList.at(1), "Save Model"); mBatteryComboBox->insertItem(2, BatteryplanStringList.at(2), "Performance Model"); - //变暗 - DarkenStringList << tr("1min") << tr("5min") << tr("10min") << tr("20min") << tr("never"); - mDarkenComboBox->insertItem(0, DarkenStringList.at(0), QVariant::fromValue(1)); - mDarkenComboBox->insertItem(1, DarkenStringList.at(1), QVariant::fromValue(5)); - mDarkenComboBox->insertItem(2, DarkenStringList.at(2), QVariant::fromValue(10)); - mDarkenComboBox->insertItem(3, DarkenStringList.at(3), QVariant::fromValue(20)); - mDarkenComboBox->insertItem(4, DarkenStringList.at(4), QVariant::fromValue(0)); - //低电量时执行 LowpowerStringList << tr("nothing") << tr("blank") << tr("suspend") << tr("shutdown"); mLowpowerComboBox2->insertItem(0, LowpowerStringList.at(0), "nothing"); @@ -700,49 +712,77 @@ void Power::setupComponent() void Power::setupConnect() { connect(mSleepPwdBtn,&KSwitchButton::stateChanged, [=](bool checked){ - screensettings->set(SLEEP_ACTIVATION_ENABLED,checked); + Utils::buriedSettings(name(), "whether password is required for wake-up after sleep", QString("settings"), checked ? "true" : "false"); + screensettings->set(SLEEP_ACTIVATION_ENABLED,checked); }); if (screensettings->keys().contains("closeActivationEnabled")) { connect(mWakenPwdBtn,&KSwitchButton::stateChanged, [=](bool checked){ - screensettings->set(CLOSE_ACTIVATION_ENABLED,checked); + Utils::buriedSettings(name(), "whether password is required for wake-up screen", QString("settings"), checked ? "true" : "false"); + screensettings->set(CLOSE_ACTIVATION_ENABLED,checked); }); } connect(mPowerKeyComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "execute when pressing the power key", QString("settings"), mPowerKeyComboBox->itemData(index).toString()); settings->set(BUTTON_POWER_KEY, mPowerKeyComboBox->itemData(index)); }); connect(mCloseComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { Q_UNUSED(index) + Utils::buriedSettings(name(), "turn off the display after this time period", QString("settings"), mCloseComboBox->currentData().toString()); if (mCloseComboBox->currentData(Qt::UserRole).toInt() == 0) { settings->set(SLEEP_DISPLAY_AC_KEY, -1); - settings->set(SLEEP_DISPLAY_BATT_KEY, -1); + qDebug()<<"sleep-display-ac : "<trySet(SLEEP_DISPLAY_AC_KEY, -1); } else { settings->set(SLEEP_DISPLAY_AC_KEY, QVariant(mCloseComboBox->currentData(Qt::UserRole).toInt() * 60)); + qDebug()<<"sleep-display-ac : "<trySet(SLEEP_DISPLAY_AC_KEY, mCloseComboBox->currentData(Qt::UserRole).toInt() * 60); + } + }); + + connect(mCloseComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Q_UNUSED(index) + if (mCloseComboBox->currentData(Qt::UserRole).toInt() == 0) { + settings->set(SLEEP_DISPLAY_BATT_KEY, -1); + qDebug()<<"sleep-display-battery : "<trySet(SLEEP_DISPLAY_BATT_KEY, -1); + } else { settings->set(SLEEP_DISPLAY_BATT_KEY, QVariant(mCloseComboBox->currentData(Qt::UserRole).toInt() * 60)); + qDebug()<<"sleep-display-battery : "<trySet(SLEEP_DISPLAY_BATT_KEY, mCloseComboBox->currentData(Qt::UserRole).toInt() * 60); + } + }); + + connect(mSleepComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Q_UNUSED(index) + Utils::buriedSettings(name(), "the system go to sleep after this time period", QString("settings"), mSleepComboBox->currentData().toString()); + if (mSleepComboBox->currentData(Qt::UserRole).toInt() == 0) { + settings->set(SLEEP_COMPUTER_AC_KEY, -1); + qDebug()<<"sleep-computer-ac : "<trySet(SLEEP_COMPUTER_AC_KEY, -1); + } else { + settings->set(SLEEP_COMPUTER_AC_KEY, QVariant(mSleepComboBox->currentData(Qt::UserRole).toInt() * 60)); + qDebug()<<"sleep-computer-ac : "<trySet(SLEEP_COMPUTER_AC_KEY, mSleepComboBox->currentData(Qt::UserRole).toInt() * 60); } }); connect(mSleepComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { Q_UNUSED(index) if (mSleepComboBox->currentData(Qt::UserRole).toInt() == 0) { - settings->set(SLEEP_COMPUTER_AC_KEY, -1); settings->set(SLEEP_COMPUTER_BATT_KEY, -1); + qDebug()<<"sleep-computer-battery : "<trySet(SLEEP_COMPUTER_BATT_KEY, -1); } else { - settings->set(SLEEP_COMPUTER_AC_KEY, QVariant(mSleepComboBox->currentData(Qt::UserRole).toInt() * 60)); settings->set(SLEEP_COMPUTER_BATT_KEY, QVariant(mSleepComboBox->currentData(Qt::UserRole).toInt() * 60)); + qDebug()<<"sleep-computer-battery : "<trySet(SLEEP_COMPUTER_BATT_KEY, mSleepComboBox->currentData(Qt::UserRole).toInt() * 60); } - }); connect(mCloseLidComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "execute when the notebook is closed", QString("settings"), mCloseLidComboBox->currentData().toString()); settings->set(BUTTON_LID_AC_KEY, mCloseLidComboBox->itemData(index)); settings->set(BUTTON_LID_BATT_KET, mCloseLidComboBox->itemData(index)); }); if (mKeys.contains("powerPolicyAc") && mKeys.contains("powerPolicyBattery")) { connect(mPowerComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "mode when using power supply", QString("settings"), mPowerComboBox->currentData().toString()); if (index == 0) { settings->set(POWER_POLICY_AC, 1); } else if (index == 1) { @@ -753,6 +793,7 @@ void Power::setupConnect() }); connect(mBatteryComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "mode when using battery supply", QString("settings"), mBatteryComboBox->currentData().toString()); //当开启了 低电量自动开启节能模式 时,在此低电量范围内调整电池计划,则自动关闭 低电量自动开启节能模式 if (!Utils::isWayland() && mKeys.contains("lowBatteryAutoSave")) { if (mLowSaveBtn->isChecked() && getBattery() <= settings->get(PERCENTAGE_LOW).toDouble()) { @@ -771,6 +812,7 @@ void Power::setupConnect() connect(mDarkenComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { Q_UNUSED(index) + Utils::buriedSettings(name(), "reduce screen brightness after this time period", QString("settings"), mBatteryComboBox->currentData().toString()); if (mDarkenComboBox->currentData(Qt::UserRole).toInt() == 0) { settings->set(IDLE_DIM_TIME_KEY, -1); } else { @@ -779,32 +821,26 @@ void Power::setupConnect() }); connect(mLowpowerComboBox1, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "low battery value", QString("settings"), mLowpowerComboBox1->currentData().toString()); settings->set(PER_ACTION_KEY, index + 5); }); connect(mLowpowerComboBox2, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "execute below low battery level", QString("settings"), mLowpowerComboBox2->currentData().toString()); settings->set(ACTION_CRI_BTY, mLowpowerComboBox2->itemData(index)); }); connect(mNoticeComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, [=](int index) { + Utils::buriedSettings(name(), "notify when the power is lower than this value", QString("settings"), mNoticeComboBox->currentData().toString()); settings->set(PERCENTAGE_LOW, (index + 1)*10); }); connect(mLowSaveBtn,&KSwitchButton::stateChanged, [=](bool checked){ - settings->set(LOW_BATTERY_AUTO_SAVE,checked); + Utils::buriedSettings(name(), "whether the saving mode is autoturned on when the battery is low", QString("settings"), checked ? "true" : "false"); + settings->set(LOW_BATTERY_AUTO_SAVE,checked); }); -// connect(mBatterySaveBtn,&KSwitchButton::stateChanged, [=](bool checked){ -// settings->set(ON_BATTERY_AUTO_SAVE,checked); -// }); - - connect(mDisplayTimeBtn,&KSwitchButton::stateChanged, [=](bool checked){ - settings->set(DISPLAY_LEFT_TIME_OF_CHARGE_AND_DISCHARGE,checked); - }); - - connect(settings,&QGSettings::changed,[=](){ - initCustomPlanStatus(); - }); + connect(settings, &QGSettings::changed, this, &Power::initCustomPlanStatus); connect(screensettings,&QGSettings::changed,[=](){ initCustomPlanStatus(); @@ -821,7 +857,6 @@ void Power::initCustomPlanStatus() mCloseLidComboBox->blockSignals(true); mPowerComboBox->blockSignals(true); mBatteryComboBox->blockSignals(true); - mDarkenComboBox->blockSignals(true); mLowpowerComboBox1->blockSignals(true); mLowpowerComboBox2->blockSignals(true); mNoticeComboBox->blockSignals(true); @@ -829,7 +864,6 @@ void Power::initCustomPlanStatus() mWakenPwdBtn->blockSignals(true); mLowSaveBtn->blockSignals(true); mBatterySaveBtn->blockSignals(true); - mDisplayTimeBtn->blockSignals(true); mPowerKeyComboBox->setCurrentIndex(mPowerKeyComboBox->findData(settings->get(BUTTON_POWER_KEY).toString())); if (settings->get(SLEEP_COMPUTER_AC_KEY).toInt() == -1) { @@ -844,12 +878,6 @@ void Power::initCustomPlanStatus() mCloseComboBox->setCurrentIndex(mCloseComboBox->findData(settings->get(SLEEP_DISPLAY_AC_KEY).toInt() / FIXES));; } - if (settings->get(IDLE_DIM_TIME_KEY).toInt() == -1) { - mDarkenComboBox->setCurrentIndex(mDarkenComboBox->findData(0)); - } else { - mDarkenComboBox->setCurrentIndex(mDarkenComboBox->findData(settings->get(IDLE_DIM_TIME_KEY).toInt() / FIXES)); - } - mCloseLidComboBox->setCurrentIndex(mCloseLidComboBox->findData(settings->get(BUTTON_LID_AC_KEY).toString())); if (mKeys.contains("powerPolicyAc") && mKeys.contains("powerPolicyBattery")) { @@ -883,14 +911,11 @@ void Power::initCustomPlanStatus() if (screensettings->keys().contains("closeActivationEnabled")) mWakenPwdBtn->setChecked(screensettings->get(CLOSE_ACTIVATION_ENABLED).toBool()); - if (mKeys.contains("lowBatteryAutoSave") && mKeys.contains("dispalyLeftTimeOfChargeAndDischarge")) { + if (mKeys.contains("lowBatteryAutoSave")) { mLowSaveBtn->setChecked(settings->get(LOW_BATTERY_AUTO_SAVE).toBool()); - mDisplayTimeBtn->setChecked(settings->get(DISPLAY_LEFT_TIME_OF_CHARGE_AND_DISCHARGE).toBool()); } else { mLowSaveFrame->hide(); - mDisplayTimeFrame->hide(); line_10->hide(); - line_11->hide(); } // 信号阻塞解除 @@ -900,7 +925,6 @@ void Power::initCustomPlanStatus() mCloseLidComboBox->blockSignals(false); mPowerComboBox->blockSignals(false); mBatteryComboBox->blockSignals(false); - mDarkenComboBox->blockSignals(false); mLowpowerComboBox1->blockSignals(false); mLowpowerComboBox2->blockSignals(false); mNoticeComboBox->blockSignals(false); @@ -908,8 +932,6 @@ void Power::initCustomPlanStatus() mWakenPwdBtn->blockSignals(false); mLowSaveBtn->blockSignals(false); mBatterySaveBtn->blockSignals(false); - mDisplayTimeBtn->blockSignals(false); - } void Power::isLidPresent() diff --git a/plugins/system/power/power.h b/plugins/system/power/power.h index c9459ec..19baca7 100644 --- a/plugins/system/power/power.h +++ b/plugins/system/power/power.h @@ -32,6 +32,7 @@ #include "shell/interface.h" #include "widgets/Label/titlelabel.h" #include "widgets/ComboxFrame/comboxframe.h" +#include "widgets/Label/fixlabel.h" #include #include "kswitchbutton.h" using namespace kdk; diff --git a/plugins/system/vino/inputpwddialog.cpp b/plugins/system/vino/inputpwddialog.cpp index b798388..2e1f127 100644 --- a/plugins/system/vino/inputpwddialog.cpp +++ b/plugins/system/vino/inputpwddialog.cpp @@ -7,7 +7,7 @@ #include #include #include "sharemain.h" -#include "widgets/Label/fixlabel.h" +#include "fixlabel.h" InputPwdDialog::InputPwdDialog(QGSettings *Keygsettiings,QWidget *parent) : @@ -75,11 +75,11 @@ void InputPwdDialog::setupInit() mLyt_1->addWidget(mpwd); mCancelBtn = new QPushButton(mInputPwdFrame_1); - mCancelBtn->setFixedWidth(96); + mCancelBtn->setMinimumWidth(96); mCancelBtn->setText(tr("Cancel")); mConfirmBtn = new QPushButton(mInputPwdFrame_1); - mConfirmBtn->setFixedWidth(96); + mConfirmBtn->setMinimumWidth(96); mConfirmBtn->setText(tr("Confirm")); mLyt_2->addStretch(); @@ -153,23 +153,27 @@ void InputPwdDialog::initConnect() { bool InputPwdDialog::eventFilter(QObject *wcg, QEvent *event) { //过滤 - if(wcg==mpwd){ - if(event->type() == QEvent::MouseButtonPress){ - if(mpwd->hasFocus()){ - if (mfirstload) { - mpwd->setText(""); - mfirstload = false; - } - } + if(wcg==mpwd){ + if(event->type() == QEvent::MouseButtonPress){ + if(mpwd->hasFocus()){ + if (mfirstload) { + mpwd->setText(""); + mfirstload = false; } } - // 回车键触发确定按钮点击事件 - if (event->type() == QEvent::KeyPress) { - QKeyEvent *mEvent = static_cast(event); - if (mEvent->key() == Qt::Key_Enter || mEvent->key() == Qt::Key_Return) { - emit mConfirmBtn->clicked(); - } + } + } + // 回车键触发确定按钮点击事件 + if (event->type() == QEvent::KeyPress) { + QKeyEvent *mEvent = static_cast(event); + if (mEvent->key() == Qt::Key_Enter || mEvent->key() == Qt::Key_Return) { + if (mConfirmBtn->isEnabled()) { + emit mConfirmBtn->clicked(); + } else { + this->close(); + } + } - } - return QWidget::eventFilter(wcg,event); + } + return QWidget::eventFilter(wcg,event); } diff --git a/plugins/system/vino/sharemain.cpp b/plugins/system/vino/sharemain.cpp index 44319e8..81030f2 100644 --- a/plugins/system/vino/sharemain.cpp +++ b/plugins/system/vino/sharemain.cpp @@ -26,10 +26,11 @@ #include #include #include - #include #include +#include "common.h" + ShareMain::ShareMain(QWidget *parent) : QWidget(parent) { @@ -45,96 +46,27 @@ ShareMain::~ShareMain() void ShareMain::initUI() { - QFrame *mVinoFrame = new QFrame(this); - mVinoFrame->setMinimumSize(550, 0); - mVinoFrame->setMaximumSize(16777215, 16777215); - mVinoFrame->setFrameShape(QFrame::Box); - - QVBoxLayout *mVinoLyt = new QVBoxLayout(mVinoFrame); - mVinoLyt->setContentsMargins(0, 0, 0, 0); - + SettingGroup *mVinoFrame = new SettingGroup; mVinoTitleLabel = new TitleLabel(this); mVinoTitleLabel->setText(tr("Remote Desktop")); - mEnableFrame = new QFrame(this); - setFrame_Noframe(mEnableFrame); - QHBoxLayout *enableHLayout = new QHBoxLayout(); - enableHLayout->setContentsMargins(12, 0, 16, 0); - - mEnableBtn = new KSwitchButton(this); - //~ contents_path /Vino/Allow others to view your desktop - mEnableLabel = new QLabel(tr("Allow others to view your desktop"), this); - enableHLayout->addWidget(mEnableLabel); - enableHLayout->addStretch(); - enableHLayout->addWidget(mEnableBtn); - - mEnableFrame->setLayout(enableHLayout); - - mViewFrame = new QFrame(this); - setFrame_Noframe(mViewFrame); - - QHBoxLayout *viewHLayout = new QHBoxLayout(); - viewHLayout->setContentsMargins(12, 0, 16, 0); - - mViewBtn = new KSwitchButton(this); + mEnableWidget = new SwitchWidget(tr("Allow others to view your desktop")); //~ contents_path /Vino/Allow connection to control screen - mViewLabel = new QLabel(tr("Allow connection to control screen"), this); - viewHLayout->addWidget(mViewLabel); - viewHLayout->addStretch(); - viewHLayout->addWidget(mViewBtn); - - mViewFrame->setLayout(viewHLayout); - - mSecurityFrame = new QFrame(this); - setFrame_Noframe(mSecurityFrame); - - QHBoxLayout *secHLayout = new QHBoxLayout(); - secHLayout->setContentsMargins(12, 0, 16, 0); - - mAccessBtn = new KSwitchButton(this); - //~ contents_path /Vino/You must confirm every visit for this machine - mAccessLabel = new QLabel(tr("You must confirm every visit for this machine"), this); - secHLayout->addWidget(mAccessLabel); - secHLayout->addStretch(); - secHLayout->addWidget(mAccessBtn); - - mSecurityFrame->setLayout(secHLayout); - - mSecurityPwdFrame = new QFrame(this); - setFrame_Noframe(mSecurityPwdFrame); - - QHBoxLayout *pwdHLayout = new QHBoxLayout(); - pwdHLayout->setContentsMargins(12, 0, 16, 0); - - mPwdBtn = new KSwitchButton(this); - //~ contents_path /Vino/Require user to enter this password: - mPwdsLabel = new QLabel(tr("Require user to enter this password: "), this); - + mViewWidget = new SwitchWidget(tr("Allow connection to control screen")); + //~ contents_path /Vino/You must confirm every visit for this machine + mSecurityWidget = new SwitchWidget(tr("You must confirm every visit for this machine")); + //~ contents_path /Vino/Require user to enter this password: + mSecurityPwdWidget = new SwitchWidget(tr("Require user to enter this password: ")); mPwdinputBtn = new QPushButton(this); + mSecurityPwdWidget->insertWidget(1, mPwdinputBtn); - pwdHLayout->addWidget(mPwdsLabel); - pwdHLayout->addWidget(mPwdinputBtn); - pwdHLayout->addStretch(); - pwdHLayout->addWidget(mPwdBtn); - mSecurityPwdFrame->setLayout(pwdHLayout); - - line_1 = setLine(mVinoFrame); - line_2 = setLine(mVinoFrame); - line_3 = setLine(mVinoFrame); - - mVinoLyt->addWidget(mEnableFrame); - mVinoLyt->addWidget(line_1); - mVinoLyt->addWidget(mViewFrame); - mVinoLyt->addWidget(line_2); - mVinoLyt->setSpacing(0); - - mVinoLyt->addWidget(mSecurityFrame); - mVinoLyt->addWidget(line_3); - mVinoLyt->addWidget(mSecurityPwdFrame); + mVinoFrame->addWidget(mEnableWidget); + mVinoFrame->addWidget(mViewWidget); + mVinoFrame->addWidget(mSecurityWidget); + mVinoFrame->addWidget(mSecurityPwdWidget); mVlayout->addWidget(mVinoTitleLabel); - mVlayout->setSpacing(8); mVlayout->addWidget(mVinoFrame); mVlayout->addStretch(); } @@ -147,11 +79,27 @@ void ShareMain::initConnection() initEnableStatus(); - connect(mEnableBtn, &KSwitchButton::stateChanged, this, &ShareMain::enableSlot); - connect(mViewBtn, &KSwitchButton::stateChanged, this, &ShareMain::viewBoxSlot); - connect(mAccessBtn, &KSwitchButton::stateChanged, this, &ShareMain::accessSlot); - connect(mPwdBtn, &KSwitchButton::stateChanged, this, &ShareMain::pwdEnableSlot); - connect(mPwdinputBtn, &QPushButton::clicked, this, &ShareMain::pwdInputSlot); + connect(mEnableWidget, &SwitchWidget::stateChanged, this, [=](bool status) { + Common::buriedSettings(QStringLiteral("Vino"), "whether allow others to connect to your desktop remotely", QString("settings"), status ? "true" : "false"); + enableSlot(status); + }); + connect(mViewWidget, &SwitchWidget::stateChanged, this, [=](bool status) { + Common::buriedSettings(QStringLiteral("Vino"), "whether allow others to control your desktop remotely", QString("settings"), status ? "true" : "false"); + viewBoxSlot(status); + }); + connect(mSecurityWidget, &SwitchWidget::stateChanged, this, [=](bool status) { + Common::buriedSettings(QStringLiteral("Vino"), "whether to confirm each visit for the local mach", QString("settings"), status ? "true" : "false"); + accessSlot(status); + }); + connect(mSecurityPwdWidget, &SwitchWidget::stateChanged, this, [=](bool status) { + Common::buriedSettings(QStringLiteral("Vino"), "whether password verification is required", QString("settings"), status ? "true" : "false"); + pwdEnableSlot(status); + }); + connect(mPwdinputBtn, &QPushButton::clicked, this, [=]() { + Common::buriedSettings(QStringLiteral("Vino"), "set password", QString("clicked")); + pwdInputSlot(); + }); + } } @@ -162,19 +110,19 @@ void ShareMain::initEnableStatus() QString pwd = mVinoGsetting->get(kAuthenticationKey).toString(); secpwd = mVinoGsetting->get(kVncPwdKey).toString(); - mAccessBtn->setChecked(secPwd); - mViewBtn->setChecked(!isShared); + mSecurityWidget->setChecked(secPwd); + mViewWidget->setChecked(!isShared); if (pwd == "vnc") { if (secpwd == "keyring") { - mPwdBtn->setChecked(false); + mSecurityPwdWidget->setChecked(false); mPwdinputBtn->hide(); mVinoGsetting->set(kAuthenticationKey, "none"); } else { - mPwdBtn->setChecked(true); + mSecurityPwdWidget->setChecked(true); mPwdinputBtn->setText(QByteArray::fromBase64(secpwd.toLatin1())); } } else { - mPwdBtn->setChecked(false); + mSecurityPwdWidget->setChecked(false); mPwdinputBtn->setVisible(false); } @@ -189,13 +137,10 @@ void ShareMain::initEnableStatus() void ShareMain::setFrameVisible(bool visible) { - mEnableBtn->setChecked(visible); - mViewFrame->setVisible(visible); - mSecurityFrame->setVisible(visible); - mSecurityPwdFrame->setVisible(visible); - line_1->setVisible(visible); - line_2->setVisible(visible); - line_3->setVisible(visible); + mEnableWidget->setChecked(visible); + mViewWidget->setVisible(visible); + mSecurityWidget->setVisible(visible); + mSecurityPwdWidget->setVisible(visible); } void ShareMain::setVinoService(bool status) @@ -213,24 +158,6 @@ void ShareMain::setVinoService(bool status) } } -void ShareMain::setFrame_Noframe(QFrame *frame) -{ - frame->setMinimumSize(QSize(550, 60)); - frame->setMaximumSize(QSize(16777215, 60)); - frame->setFrameShape(QFrame::NoFrame); -} - -QFrame *ShareMain::setLine(QFrame *frame) -{ - QFrame *line = new QFrame(frame); - line->setMinimumSize(QSize(0, 1)); - line->setMaximumSize(QSize(16777215, 1)); - line->setLineWidth(0); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - return line; -} - void ShareMain::enableSlot(bool status) { setFrameVisible(status); @@ -259,7 +186,7 @@ void ShareMain::pwdEnableSlot(bool status) pwdInputSlot(); mPwdinputBtn->setVisible(status); if (mVinoGsetting->get(kAuthenticationKey).toString() == "none") { - mPwdBtn->setChecked(false); + mSecurityPwdWidget->setChecked(false); } } else { diff --git a/plugins/system/vino/sharemain.h b/plugins/system/vino/sharemain.h index fd43122..3d60b3d 100644 --- a/plugins/system/vino/sharemain.h +++ b/plugins/system/vino/sharemain.h @@ -33,8 +33,11 @@ #include #include #include "inputpwddialog.h" -#include "widgets/Label/titlelabel.h" +#include "titlelabel.h" #include "kswitchbutton.h" +#include "switchwidget.h" +#include "settinggroup.h" +#include "ukccframe.h" using namespace kdk; const QByteArray kVinoSchemas = "org.gnome.Vino"; @@ -59,42 +62,16 @@ public: ~ShareMain(); private: - QFrame *mEnableFrame; - QFrame *mViewFrame; - QFrame *mSecurityFrame; - QFrame *mSecurityPwdFrame; - QFrame *mNoticeWFrame; - QFrame *mNoticeOFrame; - QFrame *mNoticeNFrame; - QFrame *line_1; - QFrame *line_2; - QFrame *line_3; - - KSwitchButton *mEnableBtn; // 允许其他人查看桌面 - KSwitchButton *mViewBtn; // 允许连接控制屏幕 - KSwitchButton *mAccessBtn; // 为本机确认每次访问 - KSwitchButton *mPwdBtn; // 要求用户输入密码 - - QRadioButton *mNoticeWBtn; - QRadioButton *mNoticeOBtn; - QRadioButton *mNoticeNBtn; + SwitchWidget *mEnableWidget; + SwitchWidget *mViewWidget; + SwitchWidget *mSecurityWidget; + SwitchWidget *mSecurityPwdWidget; TitleLabel *mVinoTitleLabel; - QLabel *mEnableLabel; - QLabel *mViewLabel; - QLabel *mAccessLabel; - QLabel *mPwdsLabel; - QLabel *mNoticeTitleLabel; - QLabel *mNoticeWLabel; - QLabel *mNoticeOLabel; - QLabel *mNoticeNLabel; QPushButton *mPwdinputBtn; - QVBoxLayout *mVlayout; - QGSettings *mVinoGsetting; - QString secpwd; private: @@ -105,9 +82,6 @@ private: void setFrameVisible(bool visible); void setVinoService(bool status); - void setFrame_Noframe(QFrame *frame); - QFrame *setLine(QFrame *frame); - private slots: void enableSlot(bool status); void viewBoxSlot(bool status); diff --git a/plugins/system/vino/vino.cpp b/plugins/system/vino/vino.cpp index 2c4705f..ce2cea5 100644 --- a/plugins/system/vino/vino.cpp +++ b/plugins/system/vino/vino.cpp @@ -18,7 +18,9 @@ * */ #include "vino.h" -#include "../../../shell/utils/utils.h" +#include "common.h" + +#include Vino::Vino() : mFirstLoad(true) { @@ -68,5 +70,11 @@ QIcon Vino::icon() const bool Vino::isEnable() const { - return !Utils::isCommunity() && !Utils::isWayland(); + return !Common::isCommunity() && !Common::isWayland() && isExistVino(); } + +bool Vino::isExistVino() const +{ + return QGSettings::isSchemaInstalled(QByteArray("org.gnome.Vino")); +} + diff --git a/plugins/system/vino/vino.h b/plugins/system/vino/vino.h index b153a94..9ee60ef 100644 --- a/plugins/system/vino/vino.h +++ b/plugins/system/vino/vino.h @@ -51,5 +51,8 @@ private: ShareMain* pluginWidget; bool mFirstLoad; +private: + bool isExistVino() const; + }; #endif // VINO_H diff --git a/plugins/system/vino/vino.pro b/plugins/system/vino/vino.pro index f46769d..a0002d0 100644 --- a/plugins/system/vino/vino.pro +++ b/plugins/system/vino/vino.pro @@ -1,4 +1,7 @@ include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets diff --git a/plugins/system/vino_hw/vino_hw.cpp b/plugins/system/vino_hw/vino_hw.cpp index e6b4fdb..2872458 100644 --- a/plugins/system/vino_hw/vino_hw.cpp +++ b/plugins/system/vino_hw/vino_hw.cpp @@ -18,7 +18,7 @@ * */ #include "vino_hw.h" -#include "../../../shell/utils/utils.h" +#include "common.h" Vino::Vino() : mFirstLoad(true) { @@ -69,5 +69,5 @@ QIcon Vino::icon() const bool Vino::isEnable() const { - return Utils::isWayland(); + return Common::isWayland(); } diff --git a/plugins/system/vino_hw/vino_hw.pro b/plugins/system/vino_hw/vino_hw.pro index d452b29..4c7a2e6 100644 --- a/plugins/system/vino_hw/vino_hw.pro +++ b/plugins/system/vino_hw/vino_hw.pro @@ -1,4 +1,5 @@ include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets diff --git a/plugins/time-language/area/addinputmethoddialog.cpp b/plugins/time-language/area/addinputmethoddialog.cpp index 6cad312..06b4f4c 100644 --- a/plugins/time-language/area/addinputmethoddialog.cpp +++ b/plugins/time-language/area/addinputmethoddialog.cpp @@ -35,9 +35,9 @@ AddInputMethodDialog::AddInputMethodDialog(QWidget *parent) : QModelIndexList indexList = ui->tableView->selectionModel()->selectedRows(); QStringList selectedMethodList = {}; for (QModelIndex a : indexList) { - selectedMethodList.append(mode->data(a,Qt::UserRole).toString()); + selectedMethodList.append(mode->data(a, Qt::UserRole).toString()); } - Q_EMIT toAddInputMethod(selectedMethodList); + Q_EMIT inputMethodAdded(selectedMethodList); this->hide(); }); connect(ui->noBtn,&QPushButton::clicked,this,[=]() { diff --git a/plugins/time-language/area/addinputmethoddialog.h b/plugins/time-language/area/addinputmethoddialog.h index 4527387..f34dd12 100644 --- a/plugins/time-language/area/addinputmethoddialog.h +++ b/plugins/time-language/area/addinputmethoddialog.h @@ -25,7 +25,7 @@ private: QStandardItemModel *mode = nullptr; Q_SIGNALS: - void toAddInputMethod(const QStringList inputMethodList); + void inputMethodAdded(const QStringList inputMethodList); }; #endif // ADDINPUTMETHODDIALOG_H diff --git a/plugins/time-language/area/addinputmethoddialog.ui b/plugins/time-language/area/addinputmethoddialog.ui index 04afca3..a450f58 100644 --- a/plugins/time-language/area/addinputmethoddialog.ui +++ b/plugins/time-language/area/addinputmethoddialog.ui @@ -7,9 +7,21 @@ 0 0 472 - 401 + 410
+ + + 472 + 410 + + + + + 472 + 410 + + Dialog diff --git a/plugins/time-language/area/addlanguagedialog.cpp b/plugins/time-language/area/addlanguagedialog.cpp index 01a399d..2eef37a 100644 --- a/plugins/time-language/area/addlanguagedialog.cpp +++ b/plugins/time-language/area/addlanguagedialog.cpp @@ -4,11 +4,6 @@ #include #include -const QList>> AddLanguageDialog::supportedLanguageList { - {"zh_CN", {"简体中文", QObject::tr("简体中文")}}, - {"en", {"English", QObject::tr("English")}} - }; - AddLanguageDialog::AddLanguageDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AddLanguageDialog), @@ -64,14 +59,6 @@ AddLanguageDialog::AddLanguageDialog(QWidget *parent) : }); languageInfo->init(); */ - for (int i = 0; i < supportedLanguageList.count(); ++i) { - QString text = SHOW_LANGUAGE_NAME(supportedLanguageList.at(i).second.first, - supportedLanguageList.at(i).second.second); - mode->appendRow(new QStandardItem(text)); - mode->setData(mode->index(mode->rowCount() - 1, 0), - text + chineseToPinyin(supportedLanguageList.at(i).second.second), - Qt::UserRole); - } initCompleter(); connect(ui->yesBtn,&QPushButton::clicked,this,[=]() { QModelIndexList indexList = ui->tableView->selectionModel()->selectedRows(); @@ -82,6 +69,7 @@ AddLanguageDialog::AddLanguageDialog(QWidget *parent) : Q_EMIT addShowLanguage(selectedLanguageList); this->hide(); }); + connect(ui->noBtn,&QPushButton::clicked,this,[=]() { this->hide(); }); @@ -128,13 +116,8 @@ void AddLanguageDialog::initCompleter() } }); -#if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0) - connect(m_completer, static_cast(&QCompleter::activated), - [=](const QString &text) { -#else connect(m_completer, QOverload::of(&QCompleter::activated), [=](const QString &text) { -#endif Q_UNUSED(text); Q_EMIT mSearchLineEdit->returnPressed(); }); @@ -152,18 +135,14 @@ void AddLanguageDialog::initDict() if (!dict.isEmpty()) { return; } - dict.reserve(25333); - QFile file(kDictFile); - if (!file.open(QIODevice::ReadOnly)) + if (!file.open(QIODevice::ReadOnly)) { return; - + } QByteArray content = file.readAll(); - file.close(); - QTextStream stream(&content, QIODevice::ReadOnly); while (!stream.atEnd()) { @@ -192,16 +171,15 @@ QString AddLanguageDialog::chineseToPinyin(const QString &words) } } result = removeDigital(result); - if (result == "cangyu") { - result = "zangyu"; - } + result.replace("cangyu", "zangyu"); return result; } -QString AddLanguageDialog::removeDigital(QString input) { - if ("" == input) +QString AddLanguageDialog::removeDigital(QString input) +{ + if ("" == input) { return ""; - + } QString value = ""; QByteArray ba = input.toLocal8Bit(); char *data = nullptr; @@ -212,6 +190,13 @@ QString AddLanguageDialog::removeDigital(QString input) { } data++; } - return value; } + +void AddLanguageDialog::addRow(const QString &languageName) +{ + mode->appendRow(new QStandardItem(languageName)); + mode->setData(mode->index(mode->rowCount() - 1, 0), + languageName + chineseToPinyin(languageName), + Qt::UserRole); +} diff --git a/plugins/time-language/area/addlanguagedialog.h b/plugins/time-language/area/addlanguagedialog.h index 5d84894..457378b 100644 --- a/plugins/time-language/area/addlanguagedialog.h +++ b/plugins/time-language/area/addlanguagedialog.h @@ -2,16 +2,14 @@ #define ADDLANGUAGEDIALOG_H #include +#include #include "kwidget.h" #include "ksearchlineedit.h" -//#include "languageinfo.h" -#include - -#define SHOW_LANGUAGE_NAME(a,b) (a + " (" + b + ")") namespace Ui { class AddLanguageDialog; } + using namespace kdk; class AddLanguageDialog : public QDialog @@ -22,6 +20,7 @@ public: explicit AddLanguageDialog(QWidget *parent = nullptr); ~AddLanguageDialog(); void initCompleter(); + void addRow(const QString &languageName); public: static const QList>> supportedLanguageList; diff --git a/plugins/time-language/area/addlanguagedialog.ui b/plugins/time-language/area/addlanguagedialog.ui index 1c36d2b..fb8cca7 100644 --- a/plugins/time-language/area/addlanguagedialog.ui +++ b/plugins/time-language/area/addlanguagedialog.ui @@ -110,97 +110,62 @@ - - - - 0 - 36 - + + + 16 - - - 16777215 - 36 - - - - QFrame::NoFrame - - - QFrame::Raised - - - 0 - - - - 16 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 96 - 36 - - - - - 96 - 36 - - - - No - - - - - - - - 96 - 36 - - - - - 96 - 36 - - - - Yes - - - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 96 + 0 + + + + + 96 + 16777215 + + + + No + + + + + + + + 96 + 0 + + + + + 96 + 16777215 + + + + Yes + + + + diff --git a/plugins/time-language/area/area.cpp b/plugins/time-language/area/area.cpp index 4b7fbc7..2f60301 100644 --- a/plugins/time-language/area/area.cpp +++ b/plugins/time-language/area/area.cpp @@ -18,27 +18,13 @@ * */ #include "area.h" -#include "ui_area.h" - +#include "common.h" #include -#include -#include #include -#include -#include #include -#include "languageframe.h" -//#include "Frame/hlineframe.h" -#include "widgets/Frame/hlineframe.h" -#define PANEL_GSCHEMAL "org.ukui.control-center.panel.plugins" -#define CALENDAR_KEY "calendar" -#define DAY_KEY "firstday" -#define DATE_FORMATE_KEY "date" -#define TIME_KEY "hoursystem" -#define SHOW_LANGUAGE_KEY "showlanguage" - -Area::Area() : mFirstLoad(true) +Area::Area() + : mFirstLoad(true) { pluginName = tr("Area"); pluginType = DATETIME; @@ -46,19 +32,29 @@ Area::Area() : mFirstLoad(true) Area::~Area() { - if (!mFirstLoad) { - delete ui; - ui = nullptr; + if (areaWidget) { + delete areaWidget; + areaWidget = nullptr; + } + if (areaInterface) { + delete areaInterface; + areaInterface = nullptr; } } -void Area::cloudChangedSlot(const QString &key) { - if(key == "area") { - initComponent(); +void Area::cloudChangedSlot(const QString &key) +{ + if(key == QString("area")) { + initCountry(); + initCalendar(); + initFirstDay(); + initDateFormat(); + initTimeFormat(); } } -void Area::connectToServer(){ +void Area::connectToServer() +{ QThread *NetThread = new QThread; MThread *NetWorker = new MThread; NetWorker->moveToThread(NetThread); @@ -68,77 +64,52 @@ void Area::connectToServer(){ NetThread->start(); } -QString Area::plugini18nName() { +QString Area::plugini18nName() +{ return pluginName; } -int Area::pluginTypes() { +int Area::pluginTypes() +{ return pluginType; } -QWidget *Area::pluginUi() { +QWidget *Area::pluginUi() +{ if (mFirstLoad) { + mFirstLoad = false; + areaWidget = new AreaUi; + areaInterface = new QDBusInterface("org.ukui.ukcc.session", + "/Area", + "org.ukui.ukcc.session.Area", + QDBusConnection::sessionBus(), this); - mFirstLoad = false; - - ui = new Ui::Area; - pluginWidget = new QWidget; - pluginWidget->setAttribute(Qt::WA_DeleteOnClose); - ui->setupUi(pluginWidget); - - ui->countrylabel->adjustSize(); - ui->formframe->adjustSize(); - addDialog = new AddLanguageDialog(pluginWidget); - addInputMethodDialog = new AddInputMethodDialog(pluginWidget); - const QByteArray id(PANEL_GSCHEMAL); - - if(QGSettings::isSchemaInstalled(id)) { - m_gsettings = new QGSettings(id, QByteArray(), pluginWidget); - mDateFormat = m_gsettings->get(DATE_FORMATE_KEY).toString(); + if (!areaInterface->isValid()) { + qCritical() << "org.ukui.ukcc.session.Area DBus error:" << areaInterface->lastError(); + } else { + initContent(); + connectToServer(); + if (Common::isTablet()) { + areaWidget->settingForIntel(); + } + QDBusConnection::sessionBus().connect("org.ukui.ukcc.session", + "/Area", + "org.ukui.ukcc.session.Area", + "changed", + this, + SLOT(dataChanged(QString))); } - unsigned int uid = getuid(); - objpath = objpath +"/org/freedesktop/Accounts/User"+QString::number(uid); - - - m_areaInterface = new QDBusInterface("org.freedesktop.Accounts", - objpath, - "org.freedesktop.Accounts.User", - QDBusConnection::systemBus()); - - fcitxDbus = new QDBusInterface("org.fcitx.Fcitx", - "/inputmethod", - "org.fcitx.Fcitx.InputMethod", - QDBusConnection::sessionBus()); - initUI(); - initFormFrame(); - initComponent(); - connectToServer(); - initConnect(); - if (isIntel()) { - settingForIntel(); - } } else { - ui->dateBox->blockSignals(true); - int index = ui->dateBox->currentIndex(); - ui->dateBox->clear(); - - QString currentsecStr; - QDateTime current = QDateTime::currentDateTime(); - currentsecStr = current.toString("yyyy/MM/dd "); - ui->dateBox->addItem(currentsecStr); - currentsecStr = current.toString("yyyy-MM-dd "); - ui->dateBox->addItem(currentsecStr); - - ui->dateBox->setCurrentIndex(index); - ui->dateBox->blockSignals(false); + // 有可能修改了日期,因此重新加载日期格式 + initDateFormat(); } - return pluginWidget; + return areaWidget; } -const QString Area::name() const { +const QString Area::name() const +{ return QStringLiteral("Area"); - } bool Area::isShowOnHomePage() const @@ -156,423 +127,248 @@ bool Area::isEnable() const return true; } -void Area::run_external_app_slot() { - QString cmd = "gnome-language-selector"; - - QProcess process(this); - process.startDetached(cmd); +void Area::dataChanged(QString key) +{ + if (changeKey != key) { + if (key == QString("formatCountry")) { + initCountry(); + } else if (key == QString("calendar")) { + initCalendar(); + } else if (key == QString("firstDay")) { + initFirstDay(); + } else if (key == QString("dateFormat")) { + initDateFormat(); + } else if (key == QString("timeFormat")) { + initTimeFormat(); + } else if (key == QString("showLanguageList") || key == QString("language")) { + initLanguage(); + } else if (key == "iconThemeName") { + areaWidget->reloadLanguageFrameIcon(); + } + } + changeKey = ""; } -void Area::initUI() { - //~ contents_path /Area/Regional Format - ui->titleLabel->setText(tr("Language Format")); - //~ contents_path /Area/system language - ui->title3Label->setText(tr("System Language")); - - ui->summaryLabel->setContentsMargins(16,0,0,0); - ui->summaryLabel->setText(tr("Language for system windows,menus and web pages")); - ui->summaryLabel->setVisible(true); - +void Area::initContent() +{ + initCountry(); + initCalendar(); + initFirstDay(); + initDateFormat(); + initTimeFormat(); initLanguage(); + initAddLanguage(); + initConnect(); +} - AddBtn *addBtn = new AddBtn; - connect(addBtn,&AddBtn::clicked,this,[=](){ - addDialog->show(); - }); - connect(addDialog,&AddLanguageDialog::addShowLanguage,this,[=](QStringList selectedLanguageList){ - for (QString selectedLanguage : selectedLanguageList) { - for (int i = 0; i < AddLanguageDialog::supportedLanguageList.count(); ++i) { - if (selectedLanguage == (SHOW_LANGUAGE_NAME(AddLanguageDialog::supportedLanguageList.at(i).second.first, - AddLanguageDialog::supportedLanguageList.at(i).second.second))) { - if (createLanguageFrame(AddLanguageDialog::supportedLanguageList.at(i).first)) { - if (!showLanguageList.contains(AddLanguageDialog::supportedLanguageList.at(i).first)) { - showLanguageList.append(AddLanguageDialog::supportedLanguageList.at(i).first); - } - if (AddLanguageDialog::supportedLanguageList.at(i).first == "bo_CN") { - bool addMethod = true; - for (QPairmethod : AddInputMethodDialog::inputMethodList_bo_CN) { - if (findInputMethod(method.first)) { - qDebug()<<"Input Method:"<addInputMethod("bo_CN"); - addInputMethodDialog->show(); - } - } - } - } +InteractiveInfo Area::initInteractiveInfo(int orderNum) +{ + InteractiveInfo info; + if (orderNum == AreaUi::COUNTRY) { + info.listKey = QString("formatCountryList"); + info.key = QString("formatCountry"); + info.setkey = QString("setFormatCountry"); + info.list = {{QString("en_US.UTF-8"), tr("English (US)")}, + {QString("zh_CN.UTF-8"), tr("Simplified Chinese (CN)")}, + {QString("bo_CN.UTF-8"), tr("Tibetan (CN)")}}; + } else if (orderNum == AreaUi::CALENDAR) { + info.listKey = QString("calendarList"); + info.key = QString("calendar"); + info.setkey = QString("setCalendar"); + info.list = {{QString("solarlunar"), tr("solar calendar")}, + {QString("lunar"), tr("lunar")}}; + } else if (orderNum == AreaUi::FIRSTDAY) { + info.listKey = QString("firstDayList"); + info.key = QString("firstDay"); + info.setkey = QString("setFirstDay"); + info.list = {{QString("monday"), tr("monday")}, + {QString("sunday"), tr("sunday")}}; + } else if (orderNum == AreaUi::DATEFORMAT) { + info.listKey = QString("dateFormatList"); + info.key = QString("dateFormat"); + info.setkey = QString("setDateFormat"); + info.list = {{QString("cn"), QDateTime::currentDateTime().toString("yyyy/MM/dd")}, + {QString("en"), QDateTime::currentDateTime().toString("yyyy-MM-dd")}}; + } else if (orderNum == AreaUi::TIMEFORMAT) { + info.listKey = QString("timeFormatList"); + info.key = QString("timeFormat"); + info.setkey = QString("setTimeFormat"); + info.list = {{QString("12"), tr("12 Hours")}, + {QString("24"), tr("24 Hours")}}; + } + return info; +} + +void Area::initComboBox(QComboBox *comboBox, InteractiveInfo info) +{ + if (!comboBox) { + return; + } + comboBox->disconnect(); + comboBox->clear(); + QStringList dataList = {}; + for (pairString s : info.list) { + dataList.append(s.first); + } + for (QString s : areaInterface->property(info.listKey.toUtf8().data()).toStringList()) { + bool addFlag = false; + for (int i = 0; i < dataList.size(); ++i) { + if (dataList.at(i) == s) { + comboBox->addItem(info.list.at(i).second, info.list.at(i).first); + addFlag = true; + break; } } - if (m_gsettings->keys().contains(SHOW_LANGUAGE_KEY)) { - m_gsettings->set(SHOW_LANGUAGE_KEY, showLanguageList); + if (!addFlag) { + comboBox->addItem(s, s); } + } + int index = comboBox->findData(areaInterface->property(info.key.toUtf8().data()).toString()); + comboBox->setCurrentIndex(index < 0 ? 0 : index); + connect(comboBox, + static_cast(&QComboBox::currentIndexChanged), + areaWidget, + [=](int num) { + Q_UNUSED(num); + changeKey = info.key; + areaInterface->call(info.setkey.toUtf8().data(), comboBox->currentData().toString()); + Common::buriedSettings(name(), info.setkey, QString("select"), comboBox->currentData().toString()); + if (info.setkey == QString("setFormatCountry")) { + showMessageBox(1); + } }); - ui->addBtnLayout->addWidget(addBtn); +} + +void Area::initCountry() +{ + initComboBox(areaWidget->countryComboBox(), initInteractiveInfo(AreaUi::COUNTRY)); +} + +void Area::initCalendar() +{ + initComboBox(areaWidget->calendarComboBox(), initInteractiveInfo(AreaUi::CALENDAR)); +} + +void Area::initFirstDay() +{ + initComboBox(areaWidget->firstDayComboBox(), initInteractiveInfo(AreaUi::FIRSTDAY)); +} + +void Area::initDateFormat() +{ + initComboBox(areaWidget->dateComboBox(), initInteractiveInfo(AreaUi::DATEFORMAT)); +} + +void Area::initTimeFormat() +{ + initComboBox(areaWidget->timeComboBox(), initInteractiveInfo(AreaUi::TIMEFORMAT)); } void Area::initLanguage() { - if (m_gsettings->keys().contains(SHOW_LANGUAGE_KEY)) { - showLanguageList = m_gsettings->get(SHOW_LANGUAGE_KEY).toStringList(); + areaWidget->clearShowLanguage(); + QStringList showLanguageList = areaInterface->property("showLanguageList" ).toStringList(); + QStringList languageList = areaInterface->property("languageList").toStringList(); + QString currentLanguage = areaInterface->property("language" ).toString(); + if (languageList.contains(currentLanguage)) { + areaWidget->addShowLanguage(currentLanguage, showLanguageName(currentLanguage), true); } + // Gsetting为空,自动设置显示选中的语言 if (showLanguageList.isEmpty()) { - showLanguageList.clear(); - QStringList res = getUserDefaultLanguage(); - QString lang = res.at(1); - if (createLanguageFrame(lang)) { - showLanguageList.append(lang); - } - if (m_gsettings->keys().contains(SHOW_LANGUAGE_KEY)) { - m_gsettings->set(SHOW_LANGUAGE_KEY, showLanguageList); - } + showLanguageList.append(currentLanguage); + changeKey = QString("showLanguageList"); + areaInterface->call("setShowLanguageList", showLanguageList); + areaInterface->blockSignals(false); } else { for (QString language : showLanguageList) { - createLanguageFrame(language); + if (languageList.contains(language) && language != currentLanguage) { + areaWidget->addShowLanguage(language, showLanguageName(language), false); + } } } } -bool Area::createLanguageFrame(QString setLanguageCode) +void Area::initAddLanguage() { - for (QPair> m_lang : AddLanguageDialog::supportedLanguageList) { - if (setLanguageCode == m_lang.first) { - QPairlanguage = m_lang.second; - for (QObject *o : ui->languageFrame->children()) { - if (o->objectName() == LANGUAGE_FRAME_OBJECT_NAME) { - LanguageFrame *f = static_cast(o); - //已经存在 - if (f->getShowName() == SHOW_LANGUAGE_NAME(language.first, - language.second)) { - return false; + if (!areaWidget->addbutton() || !areaWidget->languageDialog()) { + return; + } + QStringList languageList = areaInterface->property("languageList" ).toStringList(); + for (QString s : languageList) { + areaWidget->languageDialog()->addRow(showLanguageName(s)); + } + + connect(areaWidget->addbutton(), &AddButton::clicked, this, [=]() { + areaWidget->languageDialog()->show(); + }); + connect(areaWidget->languageDialog(), &AddLanguageDialog::addShowLanguage, this, [=, languageList](QStringList selectedLanguageList) { + for (QString selectedLanguage : selectedLanguageList) { + for (int i = 0; i < languageList.size(); ++i) { + if (selectedLanguage == showLanguageName(languageList.at(i))) { + QStringList showLanguageList = areaInterface->property("showLanguageList" ).toStringList(); + if (showLanguageList.contains(languageList.at(i))) { + break; } - } - } - LanguageFrame *languageF = new LanguageFrame(SHOW_LANGUAGE_NAME(language.first, - language.second), - ui->languageFrame); - HLineFrame *lineF = new HLineFrame(languageF); - languageF->setHLine(lineF); - QStringList res = getUserDefaultLanguage(); - QString currentLangCode = res.at(1); - if (currentLangCode == setLanguageCode) { - languageF->showSelectedIcon(true); - } - ui->languageFrame->layout()->addWidget(languageF); - ui->languageFrame->layout()->addWidget(lineF); - connect(languageF, &LanguageFrame::clicked, this, [=](){ - for (QObject *o : ui->languageFrame->children()) { - if (o->objectName() == LANGUAGE_FRAME_OBJECT_NAME) { - LanguageFrame *f = static_cast(o); - f->showSelectedIcon(false); + showLanguageList.append(languageList.at(i)); + areaWidget->addShowLanguage(selectedLanguage, selectedLanguage, false); + areaInterface->call("setShowLanguageList", showLanguageList); + if (languageList.at(i) == "bo_CN") { + bool addMethod = true; + for (QPairmethod : AddInputMethodDialog::inputMethodList_bo_CN) { + QDBusReply res = areaInterface->call("isAddedInputMethod", method.first); + if (res.isValid() && res.value()) { + qInfo()<<"Input Method:"<inputMethodDialog()->addInputMethod("bo_CN"); + areaWidget->inputMethodDialog()->show(); + } } + break; } - languageF->showSelectedIcon(true); - m_areaInterface->call("SetLanguage", setLanguageCode); - showMessageBox(2); - }); - connect(languageF,&LanguageFrame::deleted,this,[=](){ - showLanguageList.removeOne(setLanguageCode); - if (m_gsettings->keys().contains(SHOW_LANGUAGE_KEY)) { - m_gsettings->set(SHOW_LANGUAGE_KEY, showLanguageList); - } - }); - return true; - } - } - return false; -} - -void Area::initComponent() { - ui->countrycomboBox->addItem(tr("US")); - ui->countrycomboBox->addItem(tr("CN")); - - QStringList res = getUserDefaultLanguage(); - QString lang = res.at(1); - int langIndex = lang.split(':').at(0) == "zh_CN" ? 1 : 0; - int formatIndex = res.at(0) == "zh_CN.UTF-8" ? 1 : 0; - // ui->langcomboBox->setCurrentIndex(langIndex); - ui->countrycomboBox->setCurrentIndex(formatIndex); - - if (ui->countrycomboBox->currentIndex() == 1) { - ui->dayBox->addItem("星期一"); - ui->dayBox->addItem("星期日"); - } else { - ui->dayBox->addItem("monday"); - ui->dayBox->addItem("sunday"); - } - - initFormComponent(0b1111); -} - -void Area::initFormComponent(int8_t value) -{ - const QStringList list = m_gsettings->keys(); - - if (!list.contains(CALENDAR_KEY) || !list.contains(DAY_KEY) - || !list.contains(DATE_FORMATE_KEY) || !list.contains(TIME_KEY)){ - return ; - } - - if (value >> 0 & 1) { - QString clac = m_gsettings->get(CALENDAR_KEY).toString(); - if (ui->calendarBox->count() <= 1) { - ui->calendarBox->setCurrentIndex(0); - } else { - if ("solarlunar" == clac) { - ui->calendarBox->setCurrentIndex(0); - } else { - ui->calendarBox->setCurrentIndex(1); } } - } - - if (value >> 1 & 1) { - QString day = m_gsettings->get(DAY_KEY).toString(); - if ("monday" == day) { - ui->dayBox->setCurrentIndex(0); - } else { - ui->dayBox->setCurrentIndex(1); + }); + connect(areaWidget->inputMethodDialog(), &AddInputMethodDialog::inputMethodAdded, this, [=](const QStringList methodList) { + for (QString method : methodList) { + qInfo() << "add input method:" << method; + areaInterface->call("changeInputMethod", method, true); } - } - - if (value >> 2 & 1) { - QString dateFormat = m_gsettings->get(DATE_FORMATE_KEY).toString(); - if ("cn" == dateFormat) { - ui->dateBox->setCurrentIndex(0); - } else { - ui->dateBox->setCurrentIndex(1); - } - } - - if (value >> 3 & 1) { - QString hourFormat = m_gsettings->get(TIME_KEY).toString(); - if ("24" == hourFormat) { - ui->timeBox->setCurrentIndex(1); - } else { - ui->timeBox->setCurrentIndex(0); - } - } -} - -void Area::change_area_slot(int index) { - QDBusReply res; - switch (index) { - case 0: - res = m_areaInterface->call("SetFormatsLocale","en_US.UTF-8"); - break; - case 1: - res = m_areaInterface->call("SetFormatsLocale","zh_CN.UTF-8"); - break; - } -} - -void Area::add_lan_btn_slot() { - QString cmd = "gnome-language-selector"; - - QProcess process(this); - process.startDetached(cmd); -} - -QStringList Area::readFile(const QString& filepath) { - QStringList res; - QFile file(filepath); - if(file.exists()) { - if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - qWarning() << "ReadFile() failed to open" << filepath; - return QStringList(); - } - QTextStream textStream(&file); - while(!textStream.atEnd()) { - QString line= textStream.readLine(); - line.remove('\n'); - res< > reply = iproperty.call("GetAll", "org.freedesktop.Accounts.User"); - if (reply.isValid()){ - QMap propertyMap; - propertyMap = reply.value(); - if (propertyMap.keys().contains("FormatsLocale")) { - formats = propertyMap.find("FormatsLocale").value().toString(); - } - if(language.isEmpty() && propertyMap.keys().contains("Language")) { - language = propertyMap.find("Language").value().toString(); - } - } else { - qDebug() << "reply failed"; - } - result.append(formats); - result.append(language); - return result; -} - - -void Area::initFormFrame() -{ - //~ contents_path /Area/Current Region - ui->countrylabel->setText(tr("Current Region")); - //~ contents_path /Area/Calendar - ui->calendarLabel->setText(tr("Calendar")); - //~ contents_path /Area/First Day Of Week - ui->dayLabel->setText(tr("First Day Of Week")); - //~ contents_path /Area/Date - ui->dateLabel->setText(tr("Date")); - //~ contents_path /Area/Time - ui->timelabel->setText(tr("Time")); - - ui->calendarBox->addItem(tr("solar calendar")); - QString locale = QLocale::system().name(); - if ("zh_CN" == locale){ - ui->calendarBox->addItem(tr("lunar")); - } - - QString currentsecStr; - QDateTime current = QDateTime::currentDateTime(); - - currentsecStr = current.toString("yyyy/MM/dd "); - ui->dateBox->addItem(currentsecStr); - - currentsecStr = current.toString("yyyy-MM-dd "); - ui->dateBox->addItem(currentsecStr); - - ui->timeBox->addItem(tr("12 Hours")); - ui->timeBox->addItem(tr("24 Hours")); + }); } void Area::initConnect() { - connect(ui->countrycomboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(change_area_slot(int))); - connect(ui->countrycomboBox, static_cast(&QComboBox::currentIndexChanged), - [=](int index){ - showMessageBox(1); - int dayValue = ui->dayBox->currentIndex(); - ui->dayBox->clear(); - if (index == 1) { - ui->dayBox->addItem("星期一"); - ui->dayBox->addItem("星期日"); - } else { - ui->dayBox->addItem("monday"); - ui->dayBox->addItem("sunday"); - } - ui->dayBox->setCurrentIndex(dayValue); + connect(areaWidget, &AreaUi::languageChanged, this, [=](QString languageCode) { + changeKey = QString("language"); + areaInterface->call("setLanguage", languageCode); + Common::buriedSettings(name(), QString("languageFrame"), QString("clicked"), languageCode); + showMessageBox(2); }); - connect(ui->timeBox, static_cast(&QComboBox::currentIndexChanged), this, [=]() { - bool flag_24; - if (0 == ui->timeBox->currentIndex()) { - flag_24 = false; - } else { - flag_24 = true; - } - timeFormatClicked(flag_24); - }); - - connect(ui->dayBox, static_cast(&QComboBox::currentIndexChanged), - [=]{ - QString dayValue; - if (0 == ui->dayBox->currentIndex()) { - dayValue = "monday"; - } else { - dayValue = "sunday"; - } - writeGsettings(DAY_KEY, dayValue); - }); - - connect(ui->calendarBox, static_cast(&QComboBox::currentIndexChanged), - [=]{ - QString calendarValue; - if ( 0 == ui->calendarBox->currentIndex()) { - calendarValue = "solarlunar"; - } else { - calendarValue = "lunar"; - } - writeGsettings(CALENDAR_KEY, calendarValue); - }); - - connect(ui->dateBox, static_cast(&QComboBox::currentIndexChanged), - [=]{ - QString dateValue; - if ( 0 == ui->dateBox->currentIndex()) { - dateValue = "cn"; - } else { - dateValue = "en"; - } - writeGsettings(DATE_FORMATE_KEY, dateValue); - }); - - connect(m_gsettings, &QGSettings::changed, this, [=] (const QString &key) { - if (key == CALENDAR_KEY ) { - ui->calendarBox->blockSignals(true); - initFormComponent(0b0001); - ui->calendarBox->blockSignals(false); - } else if(key == DAY_KEY ) { - ui->dayBox->blockSignals(true); - initFormComponent(0b0010); - ui->dayBox->blockSignals(false); - } else if(key == DATE_FORMATE_KEY) { - ui->dateBox->blockSignals(true); - initFormComponent(0b0100); - ui->dateBox->blockSignals(false); - } else if(key == TIME_KEY) { - ui->timeBox->blockSignals(true); - initFormComponent(0b1000); - ui->timeBox->blockSignals(false); - } - }); - - connect(addInputMethodDialog, &AddInputMethodDialog::toAddInputMethod,this,[=](const QStringList methodList){ - for (QString method : methodList) { - qDebug()<<"to add input method:"<property("showLanguageList" ).toStringList(); + showLanguageList.removeOne(languageCode); + changeKey = QString("showLanguageList"); + areaInterface->call("setShowLanguageList", showLanguageList); }); } -void Area::writeGsettings(const QString &key, const QString &value) { - if(!m_gsettings) { - return ; - } - - const QStringList list = m_gsettings->keys(); - if (!list.contains(key)) { - return ; - } - m_gsettings->set(key,value); -} - -void Area::timeFormatClicked(bool flag) +QString Area::showLanguageName(QString languageCode) { - if (!m_gsettings) { - qDebug()<<"org.ukui.control-center.panel.plugins not installed"<keys(); - if (keys.contains(TIME_KEY)) { - if (flag == true) { - m_gsettings->set(TIME_KEY, "24"); - } else { - m_gsettings->set(TIME_KEY, "12"); - } + QString languageName = ""; + if (languageCode == "zh_CN") { + languageName = QString("简体中文 ") + QString("(%1)").arg(tr("Simplified Chinese")); + } else if (languageCode == "en") { + languageName = QString("English ") + QString("(%1)").arg(tr("English")); + } else if (languageCode == "bo_CN") { + languageName = QString("བོད་ཡིག ") + QString("(%1)").arg(tr("Tibetan")); + } else { + languageName = QString("languageCode ") + QString("(%1)").arg("languageCode"); } + return languageName; } void Area::showMessageBox(int flag) @@ -600,62 +396,3 @@ void Area::showMessageBox(int flag) } return; } - -void Area::settingForIntel() -{ - ui->languageframe_2->setVisible(false); - ui->firstDayFrame->setVisible(false); - ui->line->setVisible(false); - ui->line_3->setVisible(false); - ui->title3Label->setVisible(false); - ui->summaryLabel->setVisible(false); - ui->frame->setVisible(false); -} - -bool Area::changeInputMethod(QString method, bool add) -{ - QString fileTextString; - QFile mFile(fcitxFilePath); - if (mFile.open(QIODevice::ReadWrite|QIODevice::Text)) { - //把文件所有信息读出来 - QTextStream stream(&mFile); - fileTextString = stream.readAll(); - - if (!fileTextString.contains(method)) { - return false; - } - QString addString = method + ":True"; - QString removeString = method + ":False"; - if (add) { - fileTextString.replace(removeString, addString); - } else { - fileTextString.replace(addString, removeString); - } - stream<call("ReloadConfig"); - } - return true; - } - qDebug()<<" open "< #include #include - -#include "shell/interface.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/ImageUtil/imageutil.h" -#include "shell/utils/mthread.h" - -#include #include #include -#include -#include -#include "widgets/AddBtn/addbtn.h" -#include "addlanguagedialog.h" -#include "addinputmethoddialog.h" -// #include "languageinfo.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 @@ -46,17 +38,16 @@ #undef signals #endif -#include -#include -#include -#include -#include +typedef QPair pairString; +typedef QList > pairStringList; -const QString fcitxFilePath = QDir::homePath() + "/.config/fcitx/profile"; - -namespace Ui { -class Area; -} +typedef struct InteractiveInfo +{ + QString listKey; + QString key; + QString setkey; + pairStringList list; +}InteractiveInfo; class Area : public QObject, CommonInterface { @@ -67,7 +58,6 @@ class Area : public QObject, CommonInterface public: Area(); ~Area(); - QString plugini18nName() Q_DECL_OVERRIDE; int pluginTypes() Q_DECL_OVERRIDE; QWidget * pluginUi() Q_DECL_OVERRIDE; @@ -76,53 +66,36 @@ public: QIcon icon() const Q_DECL_OVERRIDE; bool isEnable() const Q_DECL_OVERRIDE; - void settingForIntel(); - QStringList readFile(const QString& filePath); - bool changeInputMethod(QString method, bool add); - bool findInputMethod(QString method);//true:already exist - -private: - void initUI(); - void initComponent(); - QStringList getUserDefaultLanguage(); - void connectToServer(); - void initFormFrame(); - void initFormComponent(int8_t value); - void initConnect(); - void writeGsettings(const QString &key, const QString &value); - void timeFormatClicked(bool flag); +public: + InteractiveInfo initInteractiveInfo(int orderNum); + void initComboBox(QComboBox *comboBox, InteractiveInfo info); + void initContent(); + void initCountry(); + void initCalendar(); + void initFirstDay(); + void initDateFormat(); + void initTimeFormat(); void initLanguage(); + void initAddLanguage(); + void initConnect(); + void connectToServer(); + QString showLanguageName(QString languageCode); void showMessageBox(const int flag); - bool createLanguageFrame(QString setLanguageCode); //成功创建true,未创建/创建失败false -private: - Ui::Area *ui; - - int pluginType; - - QString objpath; - QString pluginName; - QString hourformat; - QString mDateFormat; - - QWidget * pluginWidget; - - QDBusInterface *m_areaInterface; - QGSettings *m_gsettings = nullptr; - HoverWidget *addWgt; - QDBusInterface *cloudInterface; - - bool mFirstLoad; - AddLanguageDialog *addDialog = nullptr; - QStringList showLanguageList = {}; - QDBusInterface *fcitxDbus = nullptr; - AddInputMethodDialog *addInputMethodDialog = nullptr; +public Q_SLOTS: + void dataChanged(QString key); private slots: - void run_external_app_slot(); - void change_area_slot(int); - void add_lan_btn_slot(); void cloudChangedSlot(const QString &key); + +private: + AreaUi *areaWidget = nullptr; + QDBusConnection *areaInerfaceConnect = nullptr; + QDBusInterface *areaInterface = nullptr; + QString changeKey = ""; + bool mFirstLoad = true; + QString pluginName = ""; + int pluginType = 0; }; #endif // AREA_H diff --git a/plugins/time-language/area/area.pro b/plugins/time-language/area/area.pro index f69bd2d..1ee597a 100644 --- a/plugins/time-language/area/area.pro +++ b/plugins/time-language/area/area.pro @@ -4,6 +4,13 @@ # #------------------------------------------------- include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Frame/frame.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) QT += widgets dbus KWidgetsAddons concurrent @@ -15,7 +22,7 @@ DESTDIR = ../.. target.path = $${PLUGIN_INSTALL_DIRS} INSTALLS += target -LIBS += -L$$[QT_INSTALL_DIRS] -lgsettings-qt +LIBS += -L$$[QT_INSTALL_DIRS] CONFIG += link_pkgconfig INCLUDEPATH += $$PROJECT_ROOTDIR \ @@ -24,7 +31,6 @@ CONFIG += link_pkgconfig \ C++11 PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ - gsettings-qt \ kysdk-qtwidgets #DEFINES += QT_DEPRECATED_WARNINGS @@ -33,6 +39,7 @@ SOURCES += \ addinputmethoddialog.cpp \ addlanguagedialog.cpp \ area.cpp \ + areaui.cpp \ languageframe.cpp # languageinfo.cpp @@ -40,10 +47,10 @@ HEADERS += \ addinputmethoddialog.h \ addlanguagedialog.h \ area.h \ + areaui.h \ languageframe.h # languageinfo.h FORMS += \ addinputmethoddialog.ui \ - addlanguagedialog.ui \ - area.ui + addlanguagedialog.ui diff --git a/plugins/time-language/area/area.ui b/plugins/time-language/area/area.ui index 530ffb1..55e5dca 100644 --- a/plugins/time-language/area/area.ui +++ b/plugins/time-language/area/area.ui @@ -61,470 +61,7 @@ - - - - 0 - 0 - - - - - 550 - 0 - - - - - 16777215 - 16777215 - - - - QFrame::Box - - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 550 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - - 32 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 230 - 0 - - - - - 230 - 16777215 - - - - Current Region - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 32 - - - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - 1 - - - Qt::Horizontal - - - - - - - - 550 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - - 32 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 0 - 0 - - - - - 230 - 50 - - - - - 230 - 50 - - - - Calendar - - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - 0 - - - Qt::Horizontal - - - - - - - - 550 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - - 32 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 0 - 0 - - - - - 230 - 50 - - - - - 230 - 50 - - - - First Day Of The Week - - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 550 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - - 32 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 0 - 0 - - - - - 230 - 50 - - - - - 230 - 50 - - - - Date - - - - - - - - - - - - - - 0 - 1 - - - - - 1116662 - 1 - - - - Qt::Horizontal - - - - - - - - 550 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - - 32 - - - 16 - - - 0 - - - 16 - - - 0 - - - - - - 0 - 0 - - - - - 230 - 50 - - - - - 230 - 50 - - - - Time - - - - - - - - - - - + @@ -591,106 +128,28 @@ - - - QFrame::StyledPanel + + + 1 - - QFrame::Raised + + 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - QFrame::Box - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - 60 - - - - - 16777215 - 60 - - - - QFrame::NoFrame - - - QFrame::Raised - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - + + + + 0 + + + + + + + 0 + + + + @@ -709,20 +168,15 @@ - - FixLabel - QLabel -
../../../libukcc/widgets/Label/fixlabel.h
-
TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
LightLabel QLabel -
../../../libukcc/widgets/Label/lightlabel.h
+
lightlabel.h
diff --git a/plugins/time-language/area/areaui.cpp b/plugins/time-language/area/areaui.cpp new file mode 100644 index 0000000..370cba0 --- /dev/null +++ b/plugins/time-language/area/areaui.cpp @@ -0,0 +1,131 @@ +#include "areaui.h" + +AreaUi::AreaUi(QWidget *parent, Qt::WindowFlags f) + : QWidget(parent, f) +{ + setAttribute(Qt::WA_DeleteOnClose); + uiLayout = new QVBoxLayout(this); + formatLayout = new QVBoxLayout(this); + LanguageLayout = new QVBoxLayout(this); + uiLayout->addLayout(formatLayout); + uiLayout->addLayout(LanguageLayout); + uiLayout->addStretch(); + uiLayout->setSpacing(40); + uiLayout->setMargin(0); + formatLayout->setSpacing(8); + LanguageLayout->setSpacing(1); + formatLayout->setMargin(0); + LanguageLayout->setMargin(0); + initUi(); +} + +AreaUi::~AreaUi() +{ + +} + +void AreaUi::initUi() +{ + initLanguageFormat(); + initSystemLanguage(); +} + +void AreaUi::initLanguageFormat() +{ + formatTitleLabel = new TitleLabel(this); + formatGroup = new SettingGroup(this); + //~ contents_path /Area/Regional Format + countryWidget = new ComboxWidget(tr("Regional Format"), formatGroup, UkccFrame::BorderRadiusStyle::Top); + //~ contents_path /Area/Calendar + calendarWidget = new ComboxWidget(tr("Calendar"), formatGroup, UkccFrame::BorderRadiusStyle::None); + //~ contents_path /Area/First Day Of Week + dayWidget = new ComboxWidget(tr("First Day Of Week"), formatGroup, UkccFrame::BorderRadiusStyle::None); + //~ contents_path /Area/Date + dateWidget = new ComboxWidget(tr("Date"), formatGroup, UkccFrame::BorderRadiusStyle::None); + //~ contents_path /Area/Time + timeWidget = new ComboxWidget(tr("Time"), formatGroup, UkccFrame::BorderRadiusStyle::Bottom); + + formatLayout->addWidget(formatTitleLabel); + formatLayout->addWidget(formatGroup); + formatGroup->insertWidget(COUNTRY, countryWidget); + formatGroup->insertWidget(CALENDAR, calendarWidget); + formatGroup->insertWidget(FIRSTDAY, dayWidget); + formatGroup->insertWidget(DATEFORMAT, dateWidget); + formatGroup->insertWidget(TIMEFORMAT, timeWidget); + //~ contents_path /Area/Language Format + formatTitleLabel->setText(tr("Language Format")); +} + +void AreaUi::initSystemLanguage() +{ + languageTitleLable = new TitleLabel(this); + languageGroup = new SettingGroup(this); + addLanguageBtn = new AddButton(this, UkccFrame::BorderRadiusStyle::Bottom); + addLanguageDialog = new AddLanguageDialog(this); + addInputMehtodDialog = new AddInputMethodDialog(this); + + LanguageLayout->addWidget(languageTitleLable); + LanguageLayout->addSpacerItem(new QSpacerItem(8, 7, QSizePolicy::Fixed, QSizePolicy::Fixed)); + LanguageLayout->addWidget(languageGroup); + LanguageLayout->addWidget(addLanguageBtn); + languageGroup->setOneRadiusStyle(UkccFrame::BorderRadiusStyle::Top); + languageGroup->setLastRadiusStyle(UkccFrame::BorderRadiusStyle::None); + //~ contents_path /Area/System Language + languageTitleLable->setText(tr("System Language")); + addLanguageDialog->setHidden(true); + addInputMehtodDialog->setHidden(true); +} + +void AreaUi::addShowLanguage(QString languageCode, QString languageName, bool selected) +{ + bool isAdded = false; + for (LanguageFrame *f : languageFrameList) { + if (f->getShowName() == languageName) { + isAdded = true; + } + } + if (isAdded) { + return; + } else { + LanguageFrame *languageF = new LanguageFrame(languageName, languageGroup); + languageF->showSelectedIcon(selected); + languageGroup->addWidget(languageF); + languageFrameList.append(languageF); + connect(languageF, &LanguageFrame::clicked, this, [=](){ + Q_EMIT languageChanged(languageCode); + for (LanguageFrame *f : languageFrameList) { + if (f->getShowName() != languageName) { + f->showSelectedIcon(false); + } + } + languageF->showSelectedIcon(true); + }); + connect(languageF, &LanguageFrame::deleted, this, [=]() { + Q_EMIT showLanguageListRemoved(languageCode); + languageGroup->removeWidget(languageF); + languageFrameList.removeOne(languageF); + }); + } +} + +void AreaUi::clearShowLanguage() +{ + qDeleteAll(languageFrameList); + languageFrameList.clear(); +} + +void AreaUi::reloadLanguageFrameIcon() +{ + for (LanguageFrame *f : languageFrameList) { + f->reloadIcon(); + } +} + +void AreaUi::settingForIntel() +{ + countryWidget->hide(); + dayWidget->hide(); + languageTitleLable->hide(); + addLanguageBtn->hide(); + languageGroup->hide(); +} diff --git a/plugins/time-language/area/areaui.h b/plugins/time-language/area/areaui.h new file mode 100644 index 0000000..796bff7 --- /dev/null +++ b/plugins/time-language/area/areaui.h @@ -0,0 +1,127 @@ +#ifndef AREAUI_H +#define AREAUI_H + +#include "languageframe.h" +#include "addlanguagedialog.h" +#include "addinputmethoddialog.h" +#include "libukcc/widgets/Label/titlelabel.h" +#include "addbutton.h" +#include "settinggroup.h" +#include "comboxwidget.h" +#include +#include + +class AreaUi : public QWidget +{ + Q_OBJECT + +public: + enum ComboBoxOrder { + COUNTRY = 0, + CALENDAR, + FIRSTDAY, + DATEFORMAT, + TIMEFORMAT + }; + AreaUi(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); + virtual ~AreaUi(); + void initUi(); + void initLanguageFormat(); + void initSystemLanguage(); + void settingForIntel(); + +public: + inline QComboBox *countryComboBox() + { + if (countryWidget) { + return countryWidget->comboBox(); + } else { + return nullptr; + } + } + + inline QComboBox *calendarComboBox() + { + if (calendarWidget) { + return calendarWidget->comboBox(); + } else { + return nullptr; + } + } + + inline QComboBox *firstDayComboBox() + { + if (dayWidget) { + return dayWidget->comboBox(); + } else { + return nullptr; + } + } + + inline QComboBox *dateComboBox() + { + if (dateWidget) { + return dateWidget->comboBox(); + } else { + return nullptr; + } + } + + inline QComboBox *timeComboBox() + { + if (timeWidget) { + return timeWidget->comboBox(); + } else { + return nullptr; + } + } + + inline AddButton *addbutton() + { + return addLanguageBtn; + } + + inline AddLanguageDialog *languageDialog() + { + return addLanguageDialog; + } + + inline AddInputMethodDialog *inputMethodDialog() + { + return addInputMehtodDialog; + } + + void addShowLanguage(QString languageCode, QString languageName, bool selected = false); + void clearShowLanguage(); + void reloadLanguageFrameIcon(); + +Q_SIGNALS: + void languageChanged(QString languageCode); + void showLanguageListRemoved(QString languageCode); + +private: + QVBoxLayout *uiLayout = nullptr; + QVBoxLayout *formatLayout = nullptr; + QVBoxLayout *LanguageLayout = nullptr; + +private: + TitleLabel *formatTitleLabel = nullptr; + SettingGroup *formatGroup = nullptr; + ComboxWidget *countryWidget = nullptr; + ComboxWidget *calendarWidget = nullptr; + ComboxWidget *dayWidget = nullptr; + ComboxWidget *dateWidget = nullptr; + ComboxWidget *timeWidget = nullptr; + +private: + TitleLabel *languageTitleLable = nullptr; + AddButton *addLanguageBtn = nullptr; + SettingGroup *languageGroup = nullptr; + AddLanguageDialog *addLanguageDialog = nullptr; + AddInputMethodDialog *addInputMehtodDialog = nullptr; + +private: + QList languageFrameList = {}; +}; + +#endif // AREAUI_H diff --git a/plugins/time-language/area/languageframe.cpp b/plugins/time-language/area/languageframe.cpp index c3292b1..43b2963 100644 --- a/plugins/time-language/area/languageframe.cpp +++ b/plugins/time-language/area/languageframe.cpp @@ -4,33 +4,25 @@ #include #include #include +#include "common.h" LanguageFrame::LanguageFrame(QString showName, QWidget *parent) - :QFrame(parent) + :UkccFrame(parent, BorderRadiusStyle::Top, true) { QHBoxLayout *layout = new QHBoxLayout(this); - this->setFixedHeight(60); - this->setFrameShape(QFrame::Box); - this->setMinimumWidth(550); - layout->setContentsMargins(16,0,16,0); + layout->setContentsMargins(16, 0, 16, 0); nameLabel = new QLabel(); nameLabel->setText(showName); selectedIconLabel = new QLabel(); QFrame *frame = new QFrame(this); - frame->setFixedSize(16,16); + frame->setFixedSize(16, 16); QHBoxLayout *frameLayout = new QHBoxLayout(this); frameLayout->setMargin(0); frame->setLayout(frameLayout); - QIcon selectIcon = QIcon::fromTheme("ukui-selected"); + selectIcon = QIcon::fromTheme("ukui-selected"); selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); - const QByteArray id(THEME_QT_SCHEMA); - QGSettings *mQtSettings = new QGSettings(id, QByteArray(), this); - connect(mQtSettings, &QGSettings::changed, this, [=](QString key) { - if (key == "iconThemeName") - selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); - }); selectedIconLabel->setVisible(false); layout->addWidget(nameLabel); @@ -38,7 +30,7 @@ LanguageFrame::LanguageFrame(QString showName, QWidget *parent) layout->addWidget(createToolBtn()); frameLayout->addWidget(selectedIconLabel); layout->addWidget(frame); - this->setObjectName(LANGUAGE_FRAME_OBJECT_NAME); + this->setObjectName("LanguageFrame"); } LanguageFrame::~LanguageFrame() @@ -88,32 +80,28 @@ QToolButton* LanguageFrame::createToolBtn() }); connect(del, &QAction::triggered, this, [=](){ - if (hline) { - hline->deleteLater(); - hline = nullptr; - } Q_EMIT deleted(); this->deleteLater(); }); connect(edit, &QAction::triggered, this, [=](){ QProcess process; - process.startDetached("fcitx-config-gtk3"); + process.startDetached("fcitx5-config-qt"); }); btn->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); btn->setProperty("useButtonPalette", true); - btn->setFixedSize(36,36); + btn->setFixedWidth(36); return btn; } -void LanguageFrame::setHLine(HLineFrame *hline) -{ - this->hline = hline; -} - QString LanguageFrame::getShowName() { return this->nameLabel->text(); } + +void LanguageFrame::reloadIcon() +{ + selectedIconLabel->setPixmap(selectIcon.pixmap(selectIcon.actualSize(QSize(16, 16)))); +} diff --git a/plugins/time-language/area/languageframe.h b/plugins/time-language/area/languageframe.h index 09c3658..ea7551d 100644 --- a/plugins/time-language/area/languageframe.h +++ b/plugins/time-language/area/languageframe.h @@ -1,28 +1,23 @@ #ifndef LANGUAGEFRAME_H #define LANGUAGEFRAME_H -//添加语言功能未完善,所以暂时只考虑中英文的情况切换。 - -#include +#include "ukccframe.h" #include #include -#include #include -#include "widgets/Frame/hlineframe.h" -#define THEME_QT_SCHEMA "org.ukui.style" -#define LANGUAGE_FRAME_OBJECT_NAME "LanguageFrame" -class LanguageFrame : public QFrame +class LanguageFrame : public UkccFrame { Q_OBJECT + public: LanguageFrame(QString showName, QWidget *parent = nullptr); ~LanguageFrame(); void showSelectedIcon(bool flag); bool isSelection(); QToolButton *createToolBtn(); - void setHLine(HLineFrame *hline); QString getShowName(); + void reloadIcon(); private: void mousePressEvent(QMouseEvent *e); @@ -30,12 +25,11 @@ private: private: QLabel *nameLabel = nullptr; QLabel *selectedIconLabel = nullptr; - HLineFrame *hline = nullptr; + QIcon selectIcon; Q_SIGNALS: void clicked(); void deleted(); }; - #endif // LANGUAGEFRAME_H diff --git a/plugins/time-language/datetime/changtime.cpp b/plugins/time-language/datetime/changtime.cpp index a966919..209b0ce 100644 --- a/plugins/time-language/datetime/changtime.cpp +++ b/plugins/time-language/datetime/changtime.cpp @@ -19,7 +19,7 @@ */ #include "changtime.h" #include "ui_changtime.h" -#include "widgets/CloseButton/closebutton.h" +#include "closebutton.h" #include #include diff --git a/plugins/time-language/datetime/changtime.ui b/plugins/time-language/datetime/changtime.ui index 833ab8f..24ddd27 100644 --- a/plugins/time-language/datetime/changtime.ui +++ b/plugins/time-language/datetime/changtime.ui @@ -619,7 +619,7 @@ TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
diff --git a/plugins/time-language/datetime/clock.cpp b/plugins/time-language/datetime/clock.cpp index 7bf3fb2..b059741 100644 --- a/plugins/time-language/datetime/clock.cpp +++ b/plugins/time-language/datetime/clock.cpp @@ -9,6 +9,7 @@ Clock::Clock(QWidget *parent) QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(update())); timer->start(1000); + this->setFixedSize(120, 120); } Clock::~Clock() diff --git a/plugins/time-language/datetime/customCalendar.cpp b/plugins/time-language/datetime/customCalendar.cpp index 353dee8..946b11e 100644 --- a/plugins/time-language/datetime/customCalendar.cpp +++ b/plugins/time-language/datetime/customCalendar.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -26,8 +25,11 @@ CustomCalendarWidget::CustomCalendarWidget(QWidget *parent) this->setMinimumWidth(350); this->setContentsMargins(12,12,12,12); this->setDateEditEnabled(false); - QToolButton *left_button = this->findChild("qt_calendar_prevmonth"); - QToolButton *right_button = this->findChild("qt_calendar_nextmonth"); + left_button = this->findChild("qt_calendar_prevmonth"); + right_button = this->findChild("qt_calendar_nextmonth"); + yearButton = this->findChild("qt_calendar_yearbutton"); + yearEdit = this->findChild ("qt_calendar_yearedit"); + monthButton = this->findChild("qt_calendar_monthbutton"); left_button->setIcon(QIcon::fromTheme("ukui-start-symbolic")); right_button->setIcon(QIcon::fromTheme("ukui-end-symbolic")); } @@ -134,3 +136,19 @@ QPixmap CustomCalendarWidget::drawSymbolicColoredPixmap(const QPixmap &source) } return QPixmap::fromImage(img); } + +void CustomCalendarWidget::resetYearEditWidth() +{ + if (yearEdit && right_button && yearButton) { + yearEdit->setFixedWidth(right_button->x() + right_button->width() - yearButton->x()); + } + return; +} + +bool CustomCalendarWidget::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == this && event->type() == QEvent::Type::Paint) { + resetYearEditWidth(); + } + return QCalendarWidget::eventFilter(watched, event); +} diff --git a/plugins/time-language/datetime/customCalendar.h b/plugins/time-language/datetime/customCalendar.h index f5172f7..d404070 100644 --- a/plugins/time-language/datetime/customCalendar.h +++ b/plugins/time-language/datetime/customCalendar.h @@ -1,9 +1,9 @@ #ifndef CUSTOMCALENDAR_H #define CUSTOMCALENDAR_H -//qcustomcalendarwidget.h - +#include #include +#include class QPushButton; class QLabel; @@ -16,11 +16,21 @@ public: ~CustomCalendarWidget(); QPixmap drawSymbolicColoredPixmap(const QPixmap &source); QPixmap loadSvg(const QString &path, int size); + bool eventFilter(QObject *watched, QEvent *event); + void resetYearEditWidth(); + protected: void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const; void mouseMoveEvent(QMouseEvent *e); void paintEvent(QPaintEvent *event); -// bool even + +private: + QToolButton *yearButton = nullptr; + QToolButton *monthButton = nullptr; + QSpinBox *yearEdit = nullptr; + QToolButton *left_button = nullptr; + QToolButton *right_button = nullptr; + }; diff --git a/plugins/time-language/datetime/dateedit.cpp b/plugins/time-language/datetime/dateedit.cpp index 0151317..8791439 100644 --- a/plugins/time-language/datetime/dateedit.cpp +++ b/plugins/time-language/datetime/dateedit.cpp @@ -8,20 +8,17 @@ #include #include #include +#include QGraphicsDropShadowEffect *shadow_effect; DateEdit::DateEdit(QWidget *parent) : QDateEdit(parent){ this->setButtonSymbols(QAbstractSpinBox::NoButtons); + this->setFixedWidth(150); installEventFilter(this); - this->setStyleSheet("\ QCalendarWidget QWidget#qt_calendar_navigationbar { \ background-color: palette(base);\ } \ - QCalendarWidget QSpinBox { \ - width:70px; \ - selection-background-color: palette(highlight); \ - } \ QCalendarWidget QWidget {alternate-background-color: palette(base);} \ QCalendarWidget QTableView { \ selection-background-color: palette(highlight); \ @@ -30,6 +27,28 @@ DateEdit::DateEdit(QWidget *parent) : QDateEdit(parent){ color: palette(text);\ } \ "); + + m_statusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(), this); + if (m_statusSessionDbus->isValid()) { + QDBusReply is_tabletmode = m_statusSessionDbus->call("get_current_tabletmode"); + mode_change_signal_slots(is_tabletmode.isValid() ? is_tabletmode.value() : false); + connect(m_statusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mode_change_signal_slots(bool))); + } else { + mode_change_signal_slots(false); + qWarning() << "Create com.kylin.statusmanager.interface Interface Failed When : " << QDBusConnection::systemBus().lastError(); + } +} + +void DateEdit::mode_change_signal_slots(bool b) +{ + if (b) { + this->setFixedHeight(48); + } else { + this->setFixedHeight(36); + } } DateEdit::~DateEdit() { diff --git a/plugins/time-language/datetime/dateedit.h b/plugins/time-language/datetime/dateedit.h index 4444646..556eaba 100644 --- a/plugins/time-language/datetime/dateedit.h +++ b/plugins/time-language/datetime/dateedit.h @@ -1,6 +1,7 @@ #ifndef DATEEDIT_H #define DATEEDIT_H #include +#include class DateEdit : public QDateEdit { Q_OBJECT @@ -9,12 +10,15 @@ public : ~DateEdit(); QPixmap loadSvg(const QString &path, int size); QPixmap drawSymbolicColoredPixmap(const QPixmap &source); +private Q_SLOTS: + void mode_change_signal_slots(bool b); protected: void paintEvent(QPaintEvent *e); bool eventFilter(QObject *obj, QEvent *event) override; private: bool hoverFlag = false; bool focusFlag = false; + QDBusInterface *m_statusSessionDbus = nullptr; Q_SIGNALS: void changeDate(); }; diff --git a/plugins/time-language/datetime/datetime.cpp b/plugins/time-language/datetime/datetime.cpp index 314e04a..e08efea 100644 --- a/plugins/time-language/datetime/datetime.cpp +++ b/plugins/time-language/datetime/datetime.cpp @@ -33,15 +33,18 @@ #include #include #include -#include #include #include -#include "widgets/ImageUtil/imageutil.h" #include "clock.h" #include #include -#include "widgets/Frame/hlineframe.h" + +#include "hlineframe.h" +#include "imageutil.h" +#include "common.h" + #include "customCalendar.h" +#include "getsyncres.h" const char kTimezoneDomain[] = "installer-timezones"; const char kDefaultLocale[] = "en_US.UTF-8"; @@ -52,12 +55,16 @@ const QString kenBj = "Asia/Beijing"; #define FORMAT_SCHEMA "org.ukui.control-center.panel.plugins" #define TIME_FORMAT_KEY "hoursystem" #define DATE_KEY "date" -//#define SYNC_TIME_KEY "synctime" #define NTP_KEY "ntp" #define TIMEZONES_KEY "timezones" #define MAX_TIMES 5 -volatile bool syncThreadFlag = false; +#define STYLE_FONT_SCHEMA "org.ukui.style" + +const QStringList linkShanghaiTzList = { + "Asia/Beijing", + "Asia/Urumqi" +}; const QStringList ntpAddressList = { "pool.ntp.org", @@ -76,7 +83,9 @@ const QStringList ntpAddressList = { }; -DateTime::DateTime() : mFirstLoad(true) +DateTime::DateTime() + : mFirstLoad(true), + m_checkedId(0) { pluginName = tr("Date"); pluginType = DATETIME; @@ -84,6 +93,14 @@ DateTime::DateTime() : mFirstLoad(true) DateTime::~DateTime() { + if (syncThread) { + syncThread->disconnect(); + syncThread->terminate(); + syncThread->quit(); + syncThread->wait(); + delete syncThread; + syncThread = nullptr; + } if (!mFirstLoad) { delete ui; delete m_zoneinfo; @@ -117,7 +134,7 @@ QWidget *DateTime::pluginUi() initConnect(); connectToServer(); initTimeShow(); - if (isIntel()) { + if (Common::isTablet()) { settingForIntel(); } } else { @@ -160,11 +177,16 @@ void DateTime::initTitleLabel() ui->titleLabel_2->adjustSize(); //~ contents_path /Date/Other Timezone ui->titleLabel_2->setText(tr("Other Timezone")); - ui->timeClockLable->setObjectName("timeClockLable"); - font.setPixelSize(m_fontSetting->get("systemFontSize").toInt() * 28 / 11); + timeClockLable->setObjectName("timeClockLable"); + if (QLocale::system().amText() == "སྔ་དྲོ་") { + font.setPixelSize(m_fontSetting->get("systemFontSize").toInt() * 20 / 11); + } else { + font.setPixelSize(m_fontSetting->get("systemFontSize").toInt() * 28 / 11); + } font.setWeight(QFont::Medium); font.setBold(true); - ui->timeClockLable->setFont(font); + timeClockLable->setFont(font); + timeClockLable->setAlignment(Qt::AlignVCenter); delete m_fontSetting; m_fontSetting = nullptr; } @@ -174,16 +196,16 @@ void DateTime::initUI() m_formTimeBtn = new KSwitchButton(pluginWidget); //~ contents_path /Date/24-hour clock m_formTimeLabel = new QLabel(tr("24-hour clock"), pluginWidget); - //~ contents_path /Date/Set Time - ui->syncLabel->setText(tr("Set Time")); + syncNetworkRetLabel = new FixLabel(pluginWidget); syncNetworkRetLabel->setStyleSheet("QLabel{color: #D9F82929;}"); - CustomCalendarWidget* calendarWidget = new CustomCalendarWidget; - ui->dateEdit->setCalendarWidget(calendarWidget); m_zoneinfo = new ZoneInfo; m_timezone = new TimeZoneChooser(pluginWidget); m_itimer = new QTimer(this); m_itimer->start(1000); + initCurrentDate(); + ui->showFrame->setOneRadiusStyle(UkccFrame::BorderRadiusStyle::Top); + ui->showFrame->setLastRadiusStyle(UkccFrame::BorderRadiusStyle::None); int timezone_x = pluginWidget->topLevelWidget()->x() + (pluginWidget->topLevelWidget()->width() - 960)/2; int timezone_y = pluginWidget->topLevelWidget()->y() + (pluginWidget->topLevelWidget()->height() - 640)/2; @@ -194,26 +216,17 @@ void DateTime::initUI() ui->frame_7->adjustSize(); - ui->showFrame->adjustSize(); - ui->frame_3->adjustSize(); - ui->frame_3->setObjectName("baseFrame"); - ui->frame_3->setStyleSheet("QFrame#baseFrame{background-color:palette(base);}"); - Clock *m_clock = new Clock(); - //ui->clockFrame->setFrameShape(QFrame::Shape::Box); - ui->clockLayout->addWidget(m_clock); - //~ contents_path /Date/Set Date Manually - ui->timeLabel->setText(tr("Set Date Manually")); for (int m = 0; m < 60; m++) { - ui->minComboBox->addItem(QString::number(m)); + minComboBox->addItem(QString::number(m)); } for (int s = 0; s < 60; s++) { - ui->secComboBox->addItem(QString::number(s)); + secComboBox->addItem(QString::number(s)); } for (int h = 0; h < 24; h++){ - ui->hourComboBox->addItem(QString::number(h)); + hourComboBox->addItem(QString::number(h)); } const QByteArray id(FORMAT_SCHEMA); @@ -239,15 +252,20 @@ void DateTime::initUI() "org.freedesktop.DBus.Properties", QDBusConnection::systemBus(), this); + m_ukccIfc = new QDBusInterface("com.control.center.qt.systemdbus", + "/", + "com.control.center.interface", + QDBusConnection::systemBus()); + initNtp(); } void DateTime::initComponent() { - ui->timeClockLable->setContentsMargins(0,0,0,0); + timeClockLable->setContentsMargins(0,0,0,0); //~ contents_path /Date/Change time zone - ui->chgzonebtn->setText(tr("Change timezone")); + chgzonebtn->setText(tr("Change timezone")); ui->hourFrame->setVisible(false); //移到area里面了 QHBoxLayout *hourLayout = new QHBoxLayout(ui->hourFrame); @@ -255,25 +273,27 @@ void DateTime::initComponent() hourLayout->addWidget(m_formTimeLabel); hourLayout->addWidget(m_formTimeBtn); - ui->radioButton->adjustSize(); - ui->radioButton_2->adjustSize(); + autoRadioButton->adjustSize(); + manualRadioButton->adjustSize(); //~ contents_path /Date/Sync Time - ui->radioButton->setText(tr("Sync Time")); + autoRadioButton->setText(tr("Sync Time")); //~ contents_path /Date/Manual Time - ui->radioButton_2->setText(tr("Manual Time")); - - ui->hintLayout->addWidget(syncNetworkRetLabel); - - QButtonGroup *timeGroupBtn = new QButtonGroup(this); - timeGroupBtn->addButton(ui->radioButton, 0); - timeGroupBtn->addButton(ui->radioButton_2, 1); + manualRadioButton->setText(tr("Manual Time")); + timeGroupBtn = new QButtonGroup(this); + timeGroupBtn->addButton(autoRadioButton, 0); + timeGroupBtn->addButton(manualRadioButton, 1); connect(timeGroupBtn, QOverload::of(&QButtonGroup::buttonClicked), this, [=](int id){ - if (id == 0) { - synctimeFormatSlot(true, true); - } else { - synctimeFormatSlot(false, true); - syncNetworkRetLabel->setText(""); + if (id != m_checkedId) { + m_checkedId = id; + if (id == 0) { + synctimeFormatSlot(true, true); + Common::buriedSettings(name(), autoRadioButton->text(), QString("clicked")); + } else { + synctimeFormatSlot(false, true); + syncNetworkRetLabel->setText(""); + Common::buriedSettings(name(), manualRadioButton->text(), QString("clicked")); + } } }); @@ -287,8 +307,29 @@ void DateTime::initComponent() } else { gmData = QString("(GMT%1:%2)").arg(utcOff, 3, 10, QLatin1Char('0')).arg(utcOff / 60, 2, 10, QLatin1Char('0')); } - ui->dateLabel->setText(timeAndWeek + " " + gmData + " " + localizedTimezone); + dateLabel->setText(timeAndWeek + " " + gmData + " " + localizedTimezone); + const QByteArray styleID(STYLE_FONT_SCHEMA); + if (QGSettings::isSchemaInstalled(styleID)) { + QGSettings *stylesettings = new QGSettings(styleID, QByteArray(), this); + connect(stylesettings , &QGSettings::changed, this, [=](const QString &key) { + if("systemFont" == key || "systemFontSize" == key) { + QString timeAndWeek = getTimeAndWeek(current); + QTimeZone localTimezone = QTimeZone(localZone.toLatin1().data()); + + int utcOff = localTimezone.offsetFromUtc(QDateTime::currentDateTime())/3600; + QString gmData; + if (utcOff >= 0) { + gmData = QString("(GMT+%1:%2)").arg(utcOff, 2, 10, QLatin1Char('0')).arg(utcOff / 60, 2, 10, QLatin1Char('0')); + } else { + gmData = QString("(GMT%1:%2)").arg(utcOff, 3, 10, QLatin1Char('0')).arg(utcOff / 60, 2, 10, QLatin1Char('0')); + } + dateLabel->setText(timeAndWeek + " " + gmData + " " + localizedTimezone); + } + }); + } + + mPreDate = timeAndWeek + " " + gmData + " " + localizedTimezone; QFile tzfile("://zoneUtc"); if (!tzfile.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug("TZ File Open Failed"); @@ -310,15 +351,15 @@ void DateTime::initStatus() // 时区 const QString locale = QLocale::system().name(); QDBusReply tz = m_datetimeiproperties->call("Get", "org.freedesktop.timedate1", "Timezone"); - localizedTimezone = getLocalTimezoneName(tz.value().toString(), locale); localZone = tz.value().toString(); + localizedTimezone = getLocalTimezoneName(getShowtz(localZone), locale); loadHour(); } void DateTime::initTimeShow() { - AddBtn * addTimeBtn = new AddBtn; + addTimeBtn = new AddButton(this->pluginWidget, UkccFrame::BorderRadiusStyle::Around); ui->addLayout->addWidget(addTimeBtn); connect(addTimeBtn,&AddBtn::clicked,this,[=](){ changeZoneFlag = false; @@ -365,11 +406,14 @@ void DateTime::addTimezone(const QString &timezone) void DateTime::newTimeshow(const QString &timezone) { - TimeBtn *timeBtn = new TimeBtn(timezone); - HLineFrame *line = new HLineFrame(); - - ui->showLayout->addWidget(timeBtn); - ui->showLayout->addWidget(line); + TimeBtn *timeBtn = nullptr; + if (linkShanghaiTzList.contains(timezone)) { + timeBtn = new TimeBtn("Asia/Shanghai",timezone); + } else { + timeBtn = new TimeBtn(timezone); + } + addTimeBtn->setRadiusType(UkccFrame::BorderRadiusStyle::Bottom); + ui->showFrame->addWidget(timeBtn); timeBtn->updateTime(m_formTimeBtn->isChecked()); connect(timeBtn->deleteBtn, &QPushButton::clicked, this, [=](){ timezonesList.removeOne(timezone); @@ -377,42 +421,46 @@ void DateTime::newTimeshow(const QString &timezone) m_formatsettings->set(TIMEZONES_KEY, timezonesList); } timeBtn->close(); - line->close(); if (!ui->addFrame->isEnabled() && timezonesList.size() < MAX_TIMES) { ui->addFrame->setEnabled(true); - } + } + if (timezonesList.size() == 0) { + addTimeBtn->setRadiusType(UkccFrame::BorderRadiusStyle::Around); + } + ui->showFrame->removeWidget(timeBtn); + ui->showFrame->updateShape(); }); connect(m_itimer, &QTimer::timeout, this, [=](){ timeBtn->updateTime(m_formTimeBtn->isChecked()); }); + ui->showFrame->updateShape(); } void DateTime::initNtp() { - QLabel *ntpLabel = new QLabel(ui->ntpFrame); - QHBoxLayout *ntpLayout = new QHBoxLayout(ui->ntpFrame); - ntpCombox = new QComboBox(ui->ntpFrame); + QLabel *ntpLabel = new QLabel(ntpFrame); + QHBoxLayout *ntpLayout = new QHBoxLayout(ntpFrame); + ntpCombox = new QComboBox(ntpFrame); ntpLabel->setFixedWidth(135); ntpLayout->setContentsMargins(16,8,16,8); - ui->ntpFrame->setLayout(ntpLayout); + ntpFrame->setLayout(ntpLayout); ntpLayout->addWidget(ntpLabel); ntpLayout->addWidget(ntpCombox); //~ contents_path /Date/Sync Server ntpLabel->setText(tr("Sync Server")); - ntpCombox->setFixedHeight(36); ntpCombox->addItem(tr("Default")); ntpCombox->addItems(ntpAddressList); ntpCombox->addItem(tr("Customize")); /*自定义*/ - QLabel *ntpLabel_2 = new QLabel(ui->ntpFrame_2); - QHBoxLayout *ntpLayout_2 = new QHBoxLayout(ui->ntpFrame_2); + QLabel *ntpLabel_2 = new QLabel(ntpFrame_2); + QHBoxLayout *ntpLayout_2 = new QHBoxLayout(ntpFrame_2); QLineEdit *ntpLineEdit = new QLineEdit(); - QPushButton *saveBtn = new QPushButton(ui->ntpFrame_2); + QPushButton *saveBtn = new QPushButton(ntpFrame_2); ntpLayout_2->setContentsMargins(16,8,26,8); - ntpLineEdit->setParent(ui->ntpFrame_2); + ntpLineEdit->setParent(ntpFrame_2); ntpLabel_2->setText(tr("Server Address")); ntpLayout_2->addWidget(ntpLabel_2); ntpLabel_2->setFixedWidth(135); @@ -448,27 +496,26 @@ void DateTime::initNtp() if (m_formatsettings->keys().contains(NTP_KEY)) m_formatsettings->set(NTP_KEY, setAddr); } + Common::buriedSettings(name(), QString("ntpCombox(Customize)"), QString("setting"), ntpLineEdit->text()); }); - ui->line_2->setVisible(false); const QString ntpFileName = "/etc/systemd/timesyncd.conf.d/kylin.conf"; QFile ntpFile(ntpFileName); if (!ntpFile.exists()) { //默认 ntpCombox->setCurrentIndex(0); - ui->ntpFrame_2->setVisible(false); + ntpFrame_2->setVisible(false); } else { QSettings readFile(ntpFileName, QSettings::IniFormat); QString initAddress = readFile.value("Time/NTP").toString(); for (int i = 0; i < ntpCombox->count(); ++i) { if (initAddress == ntpCombox->itemText(i)) { //是选中的 ntpCombox->setCurrentIndex(i); - ui->ntpFrame_2->setVisible(false); + ntpFrame_2->setVisible(false); break; } else if (i == ntpCombox->count() - 1) { //是自定义的 ntpCombox->setCurrentIndex(i); ntpLineEdit->setText(initAddress); - ui->ntpFrame_2->setVisible(true); - ui->line_2->setVisible(true); + ntpFrame_2->setVisible(true); break; } } @@ -478,44 +525,41 @@ void DateTime::initNtp() connect(ntpCombox, &QComboBox::currentTextChanged, this, [=](){ ntpCombox->hidePopup(); qApp->processEvents(); - ui->line_2->setVisible(false); QString setAddr = ""; // if (m_formatsettings->keys().contains(NTP_KEY)) // setAddr = m_formatsettings->get(NTP_KEY).toString(); 应产品需求,每次重新选择自定义时清空 if (ntpCombox->currentIndex() == (ntpCombox->count() - 1) && setAddr == "") { //自定义且为空 ntpLineEdit->setText(""); - ui->ntpFrame_2->setVisible(true); //需要添加地址并点击保存再授权 - ui->line_2->setVisible(true); + ntpFrame_2->setVisible(true); //需要添加地址并点击保存再授权 } else { if (ntpCombox->currentIndex() == 0) { //默认 setAddr = "default"; - ui->ntpFrame_2->setVisible(false); + ntpFrame_2->setVisible(false); } else if (ntpCombox->currentIndex() != ntpCombox->count() - 1) { //选择系统 setAddr = ntpCombox->currentText(); - ui->ntpFrame_2->setVisible(false); + ntpFrame_2->setVisible(false); } else { //自定义且不为空 - ui->ntpFrame_2->setVisible(true); - ui->line_2->setVisible(true); + ntpFrame_2->setVisible(true); } if (!setNtpAddr(setAddr)) { //失败or不修改 ntpCombox->blockSignals(true); ntpCombox->setCurrentIndex(ntpComboxPreId); ntpCombox->blockSignals(false); if (ntpComboxPreId == ntpCombox->count() - 1) { - ui->ntpFrame_2->setVisible(true); - ui->line_2->setVisible(true); + ntpFrame_2->setVisible(true); ntpLineEdit->blockSignals(true); if (m_formatsettings->keys().contains(NTP_KEY)) //防止未保存的内容一直存在 ntpLineEdit->setText(m_formatsettings->get(NTP_KEY).toString()); ntpLineEdit->blockSignals(false); } else { - ui->ntpFrame_2->setVisible(false); + ntpFrame_2->setVisible(false); } } else { ntpComboxPreId = ntpCombox->currentIndex(); if (m_formatsettings->keys().contains(NTP_KEY)) //防止未保存的内容一直存在 ntpLineEdit->setText(m_formatsettings->get(NTP_KEY).toString()); } + Common::buriedSettings(name(), QString("ntpCombox"), QString("select"), ntpCombox->currentText()); } }); } @@ -551,6 +595,7 @@ bool DateTime::fileIsExits(const QString &filepath) void DateTime::datetimeUpdateSlot() { setCurrentTime(); + QString timeAndWeek = getTimeAndWeek(current); QTimeZone localTimezone = QTimeZone(localZone.toLatin1().data()); @@ -561,7 +606,16 @@ void DateTime::datetimeUpdateSlot() } else { gmData = QString("(GMT%1:%2)").arg(utcOff, 3, 10, QLatin1Char('0')).arg(utcOff / 60, 2, 10, QLatin1Char('0')); } - ui->dateLabel->setText(timeAndWeek + " " + gmData + " " + localizedTimezone); + QString currentDate = timeAndWeek + " " + gmData + " " + localizedTimezone; + + static int widgetWidth = pluginWidget->width(); + if (mPreDate.compare(currentDate) != 0 || abs(widgetWidth - pluginWidget->width()) > 20) { + + widgetWidth = pluginWidget->width(); + mPreDate = currentDate; + + dateLabel->setText(timeAndWeek + " " + gmData + " " + localizedTimezone); + } } void DateTime::changetimeSlot() @@ -591,12 +645,16 @@ void DateTime::changezoneSlot(int flag) m_timezone->show(); QDBusReply tz = m_datetimeiproperties->call("Get", "org.freedesktop.timedate1", "Timezone"); - m_timezone->setMarkedTimeZoneSlot(tz.value().toString()); + m_timezone->setMarkedTimeZoneSlot(getShowtz(tz.value().toString())); } -void DateTime::changezoneSlot(QString zone) +bool DateTime::changezoneSlot(QString zone) { - m_datetimeiface->call("SetTimezone", zone, true); + QDBusMessage retDBus = m_datetimeiface->call("SetTimezone", zone, true); + if (retDBus.type() == QDBusMessage::ErrorMessage) { + return false; + } + return true; } void DateTime::timeFormatClickedSlot(bool flag, bool outChange) @@ -652,20 +710,21 @@ void DateTime::loadHour() if (syncFlag != false) { setNtpFrame(true); - ui->setTimeFrame->setVisible(false); - ui->radioButton->blockSignals(true); - ui->radioButton->setChecked(true); - ui->radioButton->blockSignals(false); + settimeFrame->setVisible(false); + autoRadioButton->blockSignals(true); + autoRadioButton->setChecked(true); + m_checkedId = 0; + autoRadioButton->blockSignals(false); } else { setNtpFrame(false); initSetTime(); - ui->setTimeFrame->setVisible(true); - ui->radioButton_2->blockSignals(true); - ui->radioButton_2->setChecked(true); - ui->radioButton_2->blockSignals(false); + settimeFrame->setVisible(true); + manualRadioButton->blockSignals(true); + manualRadioButton->setChecked(true); + m_checkedId = 1; + manualRadioButton->blockSignals(false); } - } QString DateTime::getTimeAndWeek(const QDateTime timeZone) @@ -696,14 +755,18 @@ void DateTime::setCurrentTime() if (m_formTimeBtn->isChecked()) { currentsecStr = current.toString("hh : mm : ss"); } else { - currentsecStr = current.toString("AP hh: mm : ss"); + if (QLocale::system().amText() == QString("上午") || QLocale::system().amText() == QString("སྔ་དྲོ་")) { + currentsecStr = current.toString("AP hh: mm : ss"); + } else { + currentsecStr = current.toString("hh: mm : ss AP"); + } } - ui->timeClockLable->setText(currentsecStr); + timeClockLable->setText(currentsecStr); } void DateTime::initConnect() { - connect(ui->chgzonebtn, &QPushButton::clicked, this, [=](){ + connect(chgzonebtn, &QPushButton::clicked, this, [=](){ changeZoneFlag = true; changezoneSlot(); }); @@ -714,12 +777,20 @@ void DateTime::initConnect() connect(m_timezone, &TimeZoneChooser::confirmed, this, [this] (const QString &timezone) { if (changeZoneFlag) { - localZone = timezone; - changezoneSlot(timezone); - const QString locale = QLocale::system().name(); - localizedTimezone = m_zoneinfo->getLocalTimezoneName(timezone, locale); + QString setTimezone = timezone; + if (linkShanghaiTzList.contains(timezone)) { + setTimezone = "Asia/Shanghai"; + } + localZone = setTimezone; + if (changezoneSlot(setTimezone)) { + const QString locale = QLocale::system().name(); + localizedTimezone = m_zoneinfo->getLocalTimezoneName(timezone, locale); + m_ukccIfc->call("setShowTimezone", timezone); + } + Common::buriedSettings(name(), QString("setTimezone"), QString("setting"), timezone); } else { addTimezone(timezone); + Common::buriedSettings(name(), QString("addTimezone"), QString("setting"), timezone); } m_timezone->hide(); }); @@ -736,19 +807,19 @@ void DateTime::initConnect() } }); - connect(ui->dateEdit, &DateEdit::changeDate, this, [=]() { + connect(dateEdit, &DateEdit::changeDate, this, [=]() { setTime(); }); - connect(ui->hourComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(hourComboBox, static_cast(&QComboBox::activated), this, [=]() { setTime(); }); - connect(ui->minComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(minComboBox, static_cast(&QComboBox::activated), this, [=]() { setTime(); }); - connect(ui->secComboBox, static_cast(&QComboBox::activated), this, [=]() { + connect(secComboBox, static_cast(&QComboBox::activated), this, [=]() { setTime(); }); @@ -780,25 +851,56 @@ void DateTime::synctimeFormatSlot(bool status,bool outChange) } QDBusMessage retDBus = rsyncWithNetworkSlot(status); + if (retDBus.type() == QDBusMessage::ErrorMessage) { + timeGroupBtn->blockSignals(true); + if (status) { + manualRadioButton->setChecked(true); + m_checkedId = 1; + } else { + autoRadioButton->setChecked(true); + m_checkedId = 0; + } + timeGroupBtn->blockSignals(false); + return; + } if (status != false) { - ui->setTimeFrame->setVisible(false); + settimeFrame->setVisible(false); setNtpFrame(true); if (retDBus.type() == QDBusMessage::ReplyMessage) { - QString successMSG = tr(" "); - QString failMSG = tr("Sync failed"); - CGetSyncRes *syncThread = new CGetSyncRes(this,successMSG,failMSG); - connect(syncThread, &CGetSyncRes::finished, this, [=](){ + if (syncThread) { + syncThread->disconnect(); + syncThread->terminate(); + syncThread->quit(); + syncThread->wait(); + delete syncThread; + syncThread = nullptr; + } + syncThread = new GetSyncRes(this); + connect(syncThread, &GetSyncRes::finished, this, [=](){ syncThread->deleteLater(); - ui->radioButton_2->setEnabled(true); + syncThread = nullptr; + manualRadioButton->setEnabled(true); + }); + connect(syncThread, &GetSyncRes::inSync, this, [=](QPixmap pix) { + syncNetworkRetLabel->setPixmap(pix); + }); + connect(syncThread, &GetSyncRes::syncStatus, this, [=](bool status){ + manualRadioButton->setEnabled(true); + if (status) { + syncNetworkRetLabel->setText(tr(" ")); + syncRTC(); + } else { + syncNetworkRetLabel->setText(tr("Sync failed")); + } }); syncThread->start(); - ui->radioButton_2->setEnabled(false); + manualRadioButton->setEnabled(false); } else { syncNetworkRetLabel->setText(tr("Sync failed")); } } else { initSetTime(); - ui->setTimeFrame->setVisible(true); + settimeFrame->setVisible(true); setNtpFrame(false); } } @@ -843,43 +945,37 @@ bool DateTime::setNtpAddr(QString address) void DateTime::setNtpFrame(bool visiable) { - ui->ntpFrame->setVisible(visiable); + ntpFrame->setVisible(visiable); if (visiable && ntpCombox != nullptr) { - ui->ntpFrame_2->setVisible(ntpCombox->currentIndex() == ntpCombox->count() - 1); + ntpFrame_2->setVisible(ntpCombox->currentIndex() == ntpCombox->count() - 1); } else { - ui->ntpFrame_2->setVisible(visiable); - } - - if (!ui->ntpFrame_2->isHidden()) { - ui->line_2->setVisible(true); - } else { - ui->line_2->setVisible(false); + ntpFrame_2->setVisible(visiable); } } void DateTime::initSetTime() { QDateTime m_time = QDateTime::currentDateTime(); - ui->dateEdit->blockSignals(true); - ui->hourComboBox->blockSignals(true); - ui->minComboBox->blockSignals(true); - ui->secComboBox->blockSignals(true); + dateEdit->blockSignals(true); + hourComboBox->blockSignals(true); + minComboBox->blockSignals(true); + secComboBox->blockSignals(true); - if (!ui->dateEdit->hasFocus()) - ui->dateEdit->setDate(m_time.date()); - ui->hourComboBox->setCurrentIndex(m_time.time().hour()); - ui->minComboBox->setCurrentIndex(m_time.time().minute()); - ui->secComboBox->setCurrentIndex(m_time.time().second()); + if (!dateEdit->hasFocus()) + dateEdit->setDate(m_time.date()); + hourComboBox->setCurrentIndex(m_time.time().hour()); + minComboBox->setCurrentIndex(m_time.time().minute()); + secComboBox->setCurrentIndex(m_time.time().second()); - ui->dateEdit->blockSignals(false); - ui->hourComboBox->blockSignals(false); - ui->minComboBox->blockSignals(false); - ui->secComboBox->blockSignals(false); + dateEdit->blockSignals(false); + hourComboBox->blockSignals(false); + minComboBox->blockSignals(false); + secComboBox->blockSignals(false); } void DateTime::setTime() { - QDate tmpdate(ui->dateEdit->date()); - QTime tmptime(ui->hourComboBox->currentIndex(), ui->minComboBox->currentIndex(),ui->secComboBox->currentIndex()); + QDate tmpdate(dateEdit->date()); + QTime tmptime(hourComboBox->currentIndex(), minComboBox->currentIndex(),secComboBox->currentIndex()); QDateTime setdt(tmpdate,tmptime); m_datetimeiface->call("SetTime", QVariant::fromValue(setdt.toSecsSinceEpoch() * G_TIME_SPAN_SECOND), false, true); @@ -887,33 +983,38 @@ void DateTime::setTime() { } bool DateTime::getSyncStatus() { - return ui->radioButton->isChecked(); + return autoRadioButton->isChecked(); } void DateTime::fillTimeCombox(bool format24) { - QString AMname = "AM "; - QString PMname = "PM "; - int formatIndex = getRegionFormat(); + QString AMname = QLocale::system().amText(); + QString PMname = QLocale::system().pmText(); - if (formatIndex == 1) { - AMname = "上午"; - PMname = "下午"; - } - - ui->hourComboBox->clear(); + hourComboBox->clear(); if (!format24) { - ui->hourComboBox->addItem(AMname + QString::number(12)); - for (int i = 1 ; i <= 11; i++) { - ui->hourComboBox->addItem(AMname + QString::number(i)); - } - ui->hourComboBox->addItem(PMname + QString::number(12)); - for (int i = 1 ; i <= 11; i++) { - ui->hourComboBox->addItem(PMname + QString::number(i)); + if (AMname == QString("上午") || AMname == QString("སྔ་དྲོ་")) { + hourComboBox->addItem(AMname + QString::number(12)); + for (int i = 1 ; i <= 11; i++) { + hourComboBox->addItem(AMname + QString::number(i)); + } + hourComboBox->addItem(PMname + QString::number(12)); + for (int i = 1 ; i <= 11; i++) { + hourComboBox->addItem(PMname + QString::number(i)); + } + } else { + hourComboBox->addItem(QString::number(12) + AMname); + for (int i = 1 ; i <= 11; i++) { + hourComboBox->addItem(QString::number(i) + AMname); + } + hourComboBox->addItem(QString::number(12) + PMname); + for (int i = 1 ; i <= 11; i++) { + hourComboBox->addItem(QString::number(i) + PMname); + } } } else { for (int h = 0; h < 24; h++){ - ui->hourComboBox->addItem(QString::number(h)); + hourComboBox->addItem(QString::number(h)); } } } @@ -950,87 +1051,125 @@ int DateTime::getRegionFormat() void DateTime::settingForIntel() { - ui->chgzonebtn->setVisible(false); - ui->frame_3->setVisible(false); + chgzonebtn -> setVisible(false); + syncFrame -> setVisible(false); + settimeFrame -> setVisible(false); + ntpFrame -> setVisible(false); + ntpFrame_2 -> setVisible(false); ui->TilleFrame->setVisible(false); - ui->frame_7->setVisible(false); + ui->frame_7 ->setVisible(false); + currentDateGroup->setFixedHeight(156); + currentDateGroup->updateShape(); } -CGetSyncRes::CGetSyncRes(DateTime *dataTimeUI,QString successMSG,QString failMSG) +QString DateTime::getShowtz(QString setTz) { - this -> dataTimeUI = dataTimeUI; - this -> successMSG = successMSG; - this -> failMSG = failMSG; -} - -CGetSyncRes::~CGetSyncRes() -{ - -} -void CGetSyncRes::run() -{ - for(qint8 i = 0; i < 80; ++i) { - if (this->dataTimeUI->getSyncStatus() == false) { - this->dataTimeUI->syncNetworkRetLabel->setText(""); - return; - } - struct timex txc = {}; - if (adjtimex(&txc) < 0 || txc.maxerror >= 16000000) { //未能同步时间 - int picNum = i - qFloor(i/8)*8; //限制在0~7 - QString pixName = QString(":/images/loading%1.svg").arg(picNum+10); - QPixmap pix(pixName); - qApp->processEvents(); - this->dataTimeUI->syncNetworkRetLabel->setPixmap(pix); - msleep(70); - continue; - } else { //同步时间成功 - DateTime::syncRTC(); - this->dataTimeUI->syncNetworkRetLabel->setText(successMSG); - return; + QDBusReply showtz = m_ukccIfc->call("getShowTimezone"); + QString m_tz = showtz.value(); + if (!showtz.isValid() || showtz.value() != setTz) { + //showtz 异常,重新设置 + if (!linkShanghaiTzList.contains(showtz) || m_tz.isEmpty()) { + m_tz = setTz; + m_ukccIfc->call("setShowTimezone", setTz); } } - this->dataTimeUI->syncNetworkRetLabel->setText(failMSG); - if (syncThreadFlag == false) { //创建线程一直查时间同步是否成功 - CSyncTime *syncTimeThread = new CSyncTime(this->dataTimeUI,successMSG,failMSG); - connect(syncTimeThread,SIGNAL(finished()),syncTimeThread,SLOT(deleteLater())); - syncTimeThread->start(); - syncThreadFlag = true; - } + return m_tz; +} + +void DateTime::initCurrentDate() +{ + currentDateGroup = new SettingGroup(this->pluginWidget); + UkccFrame *dateFrame = new UkccFrame(currentDateGroup); + Clock *m_clock = new Clock(); + UkccFrame *dateRightFrame = new UkccFrame(dateFrame); + timeClockLable = new FixLabel(dateRightFrame); + UkccFrame *zoneFrame = new UkccFrame(dateRightFrame); + dateLabel = new FixLabel(zoneFrame); + chgzonebtn = new FixButton(zoneFrame); + //~ contents_path /Date/Set Time + syncFrame = new UkccFrame(currentDateGroup, UkccFrame::BorderRadiusStyle::Around, true); + manualRadioButton = new QRadioButton(syncFrame); + autoRadioButton = new QRadioButton(syncFrame); + FixLabel *syncLabel = new FixLabel(syncFrame); + QSpacerItem *iterm_radio = new QSpacerItem(8, 24, QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Fixed); + settimeFrame = new UkccFrame(currentDateGroup, UkccFrame::BorderRadiusStyle::Around, true); + FixLabel *setLabel = new FixLabel(settimeFrame); + QSpacerItem *iterm_1 = new QSpacerItem(8, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Fixed); + dateEdit = new DateEdit(settimeFrame); + CustomCalendarWidget *calendarWidget = new CustomCalendarWidget; + QSpacerItem *iterm_2 = new QSpacerItem(16, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Fixed); + hourComboBox = new QComboBox(settimeFrame); + minComboBox = new QComboBox(settimeFrame); + secComboBox = new QComboBox(settimeFrame); + QLabel *hourMinColonLabel = new QLabel(":", settimeFrame); + QLabel *MinSecColonLabel = new QLabel(":", settimeFrame); + ntpFrame = new UkccFrame(currentDateGroup, UkccFrame::BorderRadiusStyle::Around, true); + ntpFrame_2 = new UkccFrame(currentDateGroup, UkccFrame::BorderRadiusStyle::Around, true); + QHBoxLayout *dateLayout = new QHBoxLayout(dateFrame); + QHBoxLayout *zoneLayout = new QHBoxLayout(zoneFrame); + QHBoxLayout *syncLayout = new QHBoxLayout(syncFrame); + QHBoxLayout *settimeLayout = new QHBoxLayout(settimeFrame); + QVBoxLayout *dateRightLayout = new QVBoxLayout(dateRightFrame); + + currentDateGroup -> addWidget(dateFrame); + currentDateGroup -> addWidget(syncFrame); + currentDateGroup -> addWidget(settimeFrame); + currentDateGroup -> addWidget(ntpFrame); + currentDateGroup -> addWidget(ntpFrame_2); + dateLayout -> addWidget(m_clock); + dateLayout -> addWidget(dateRightFrame); + dateLayout -> addStretch(); + dateRightLayout -> addWidget(timeClockLable); + dateRightLayout -> addWidget(zoneFrame); + zoneLayout -> addWidget(dateLabel); + zoneLayout -> addWidget(chgzonebtn); + zoneLayout -> addStretch(); + syncLayout -> addWidget(syncLabel); + syncLayout -> addWidget(manualRadioButton); + syncLayout -> addSpacerItem(iterm_radio); + syncLayout -> addWidget(autoRadioButton); + syncLayout -> addWidget(syncNetworkRetLabel); + syncLayout -> addStretch(); + settimeLayout -> addWidget(setLabel); + settimeLayout -> addSpacerItem(iterm_1); + settimeLayout -> addWidget(dateEdit); + settimeLayout -> addSpacerItem(iterm_2); + settimeLayout -> addWidget(hourComboBox); + settimeLayout -> addWidget(hourMinColonLabel); + settimeLayout -> addWidget(minComboBox); + settimeLayout -> addWidget(MinSecColonLabel); + settimeLayout -> addWidget(secComboBox); + settimeLayout -> addStretch(); + + dateFrame->setFixedHeight(156); + dateRightFrame->setFixedHeight(102); + chgzonebtn->setMinimumWidth(120); + chgzonebtn->setMaximumWidth(300); + dateLayout->setContentsMargins(16, 0, 0, 0); + settimeLayout->setContentsMargins(16, 0, 0, 0); + dateRightLayout->setMargin(0); + dateLayout->setSpacing(26); + zoneLayout->setMargin(0); + zoneLayout->setSpacing(16); + settimeLayout->setSpacing(0); + syncLayout->setContentsMargins(16, 0, 0, 0); + syncLayout->setSpacing(26); + syncLabel->setFixedWidth(119); + //~ contents_path /Date/Set Time + syncLabel->setText(tr("Set Time")); + //~ contents_path /Date/Set Date Manually + setLabel->setText(tr("Set Date Manually")); + setLabel->setFixedWidth(137); + hourComboBox->setFixedWidth(100); + minComboBox->setFixedWidth(64); + secComboBox->setFixedWidth(64); + hourMinColonLabel->setFixedWidth(16); + MinSecColonLabel->setFixedWidth(16); + hourMinColonLabel->setAlignment(Qt::AlignCenter); + MinSecColonLabel->setAlignment(Qt::AlignCenter); + dateEdit->setCalendarPopup(true); + dateEdit->setCalendarWidget(calendarWidget); + + ui->currentDateLayout->addWidget(currentDateGroup); return; } - -CSyncTime::CSyncTime(DateTime *dataTimeUI,QString successMSG,QString failMSG) -{ - this -> dataTimeUI = dataTimeUI; - this -> successMSG = successMSG; - this -> failMSG = failMSG; -} - -CSyncTime::~CSyncTime() -{ - -} -void CSyncTime::run() -{ - QDBusInterface *r_datetimeiface = new QDBusInterface("org.freedesktop.timedate1", - "/org/freedesktop/timedate1", - "org.freedesktop.timedate1", - QDBusConnection::systemBus(), this); - while (true) { - if (this->dataTimeUI->getSyncStatus() == false) { - syncThreadFlag = false; - delete r_datetimeiface; - return; - } - r_datetimeiface->call("SetNTP", true, true); - struct timex txc = {}; - if (adjtimex(&txc) >= 0 && txc.maxerror < 16000000) { //同步时间成功 - DateTime::syncRTC(); - this->dataTimeUI->syncNetworkRetLabel->setText(successMSG); - syncThreadFlag = false; - delete r_datetimeiface; - return; - } - sleep(2); - } -} diff --git a/plugins/time-language/datetime/datetime.h b/plugins/time-language/datetime/datetime.h index 8a7772d..fb774fb 100644 --- a/plugins/time-language/datetime/datetime.h +++ b/plugins/time-language/datetime/datetime.h @@ -24,7 +24,7 @@ #include "shell/interface.h" #include "changtime.h" -#include "shell/utils/mthread.h" +#include "mthread.h" #include #include @@ -41,14 +41,25 @@ #include #include #include +#include #include "timeBtn.h" -#include "widgets/Label/fixlabel.h" #include "worldMap/timezonechooser.h" #include "worldMap/zoneinfo.h" -#include "widgets/HoverWidget/hoverwidget.h" -#include "widgets/AddBtn/addbtn.h" + +#include "hoverwidget.h" +#include "addbtn.h" +#include "fixlabel.h" #include "kswitchbutton.h" +#include "settinggroup.h" +#include "ukccframe.h" +#include "fixbutton.h" + +#include "radiobuttonwidget.h" +#include "dateedit.h" +#include "addbutton.h" +#include "getsyncres.h" + using namespace kdk; /* qt会将glib里的signals成员识别为宏,所以取消该宏 @@ -68,6 +79,8 @@ namespace Ui { class DateTime; } +class GetSyncRes; + class DateTime : public QObject, CommonInterface { Q_OBJECT @@ -89,13 +102,14 @@ public: void settingForIntel() ; void initTitleLabel(); void initUI(); + void initCurrentDate(); void initNtp(); void initTimeShow(); void initComponent(); void initStatus(); void connectToServer(); bool fileIsExits(const QString& filepath); - static void syncRTC(); + void syncRTC(); void setNtpFrame(bool visiable); void addTimezone(const QString& timezone); void newTimeshow(const QString& timezone); @@ -104,6 +118,7 @@ public: void fillTimeCombox(bool format24 = true); bool getSyncStatus(); int getRegionFormat(); + QString getShowtz(QString setTz); public: FixLabel *syncNetworkRetLabel = nullptr; @@ -142,13 +157,35 @@ private: bool changeZoneFlag = false; QStringList timezonesList; QString localZone; + QButtonGroup *timeGroupBtn = nullptr; + int8_t m_checkedId; + QDBusInterface *m_ukccIfc = nullptr; + + QString mPreDate = nullptr; + FixLabel *timeClockLable = nullptr; + FixLabel *dateLabel = nullptr; + FixButton *chgzonebtn = nullptr; + QRadioButton *manualRadioButton = nullptr; + QRadioButton *autoRadioButton = nullptr; + DateEdit *dateEdit = nullptr; + UkccFrame *ntpFrame = nullptr; + UkccFrame *ntpFrame_2 = nullptr; + QComboBox *hourComboBox = nullptr; + QComboBox *minComboBox = nullptr; + QComboBox *secComboBox = nullptr; + UkccFrame *syncFrame = nullptr; + UkccFrame *settimeFrame = nullptr; + SettingGroup *currentDateGroup = nullptr; + AddButton * addTimeBtn = nullptr; + GetSyncRes *syncThread = nullptr; + Q_SIGNALS: void changed(); private slots: void datetimeUpdateSlot(); void changetimeSlot(); - void changezoneSlot(QString zone); + bool changezoneSlot(QString zone); void timeFormatClickedSlot(bool, bool); void synctimeFormatSlot(bool status,bool outChange); QDBusMessage rsyncWithNetworkSlot(bool status); @@ -167,31 +204,6 @@ public: }; -class CGetSyncRes : public QThread{ - Q_OBJECT -public: - CGetSyncRes(DateTime *dataTimeUI,QString successMSG,QString failMSG); - ~CGetSyncRes(); -protected: - void run()override; -private: - DateTime *dataTimeUI; - QString successMSG; - QString failMSG; - bool changeLableFlag; -}; -class CSyncTime : public QThread{ - Q_OBJECT -public: - CSyncTime(DateTime *dataTimeUI,QString successMSG,QString failMSG); - ~CSyncTime(); -protected: - void run()override; -private: - DateTime *dataTimeUI; - QString successMSG; - QString failMSG; -}; #endif // DATETIME_H diff --git a/plugins/time-language/datetime/datetime.pro b/plugins/time-language/datetime/datetime.pro index 9e34a84..5a2f233 100644 --- a/plugins/time-language/datetime/datetime.pro +++ b/plugins/time-language/datetime/datetime.pro @@ -12,6 +12,17 @@ CONFIG += plugin \ C++11 include(../../../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/AddBtn/addbtn.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/CloseButton/closebutton.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/HoverWidget/hoverwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Frame/frame.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/SettingWidget/settingwidget.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Button/button.pri) + +include($$PROJECT_ROOTDIR/libukcc/interface.pri) TARGET = $$qtLibraryTarget(datetime) DESTDIR = ../.. @@ -37,7 +48,9 @@ SOURCES += \ dateedit.cpp \ datetime.cpp \ changtime.cpp \ + getsyncres.cpp \ timeBtn.cpp \ + worldMap/dotlabel.cpp \ worldMap/popmenu.cpp \ worldMap/zoneinfo.cpp \ worldMap/toolpop.cpp \ @@ -52,7 +65,9 @@ HEADERS += \ dateedit.h \ datetime.h \ changtime.h \ + getsyncres.h \ timeBtn.h \ + worldMap/dotlabel.h \ worldMap/popmenu.h \ worldMap/zoneinfo.h \ worldMap/toolpop.h \ diff --git a/plugins/time-language/datetime/datetime.ui b/plugins/time-language/datetime/datetime.ui index 1b83505..859b056 100644 --- a/plugins/time-language/datetime/datetime.ui +++ b/plugins/time-language/datetime/datetime.ui @@ -7,7 +7,7 @@ 0 0 684 - 653 + 669
@@ -67,820 +67,9 @@ - - - - 0 - 0 - - - - QFrame::Box - - - QFrame::Raised - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 156 - - - - - 16777215 - 156 - - - - QFrame::Box - - - QFrame::Raised - - - - 26 - - - 16 - - - 0 - - - 0 - - - 0 - - - - - - 119 - 119 - - - - - 119 - 119 - - - - QFrame::NoFrame - - - QFrame::Raised - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - 0 - 90 - - - - - 16777215 - 90 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 80 - 48 - - - - - 167000 - 48 - - - - - 24 - 75 - true - - - - - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - 0 - - - - 16 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 80 - 36 - - - - - 167000 - 36 - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 120 - 36 - - - - - 300 - 36 - - - - Change timezone - - - - - - - Qt::Horizontal - - - - 16 - 20 - - - - - - - - - - - - - - - - - - 0 - 0 - - - - QFrame::Box - - - QFrame::Raised - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - true - - - - 552 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - 1 - - - - 26 - - - 17 - - - - - - 119 - 0 - - - - - 119 - 16777215 - - - - TextLabel - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - RadioButton - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - RadioButton - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - 0 - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 0 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - QFrame::Raised - - - - 0 - - - 16 - - - - - - 137 - 0 - - - - - 137 - 16777215 - - - - TextLabel - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 8 - 20 - - - - - - - - - 150 - 36 - - - - - 16777215 - 36 - - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - - 64 - 0 - - - - - - - - - 16 - 0 - - - - - 16 - 16777215 - - - - : - - - Qt::AlignCenter - - - - - - - - 64 - 16777215 - - - - - - - - - 16 - 0 - - - - - 16 - 16777215 - - - - : - - - Qt::AlignCenter - - - - - - - - 64 - 16777215 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 30 - 20 - - - - - - - - - - - - 552 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - 0 - - - - - - - - 552 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - 0 - - - - - - - - 0 - 0 - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - Qt::Horizontal - - - - - - - - 552 - 60 - - - - - 16777215 - 60 - - - - QFrame::Box - - - QFrame::Raised - - - 0 - - - - - - - - - - - + - 2 + 0 @@ -975,7 +164,7 @@ - + 0 @@ -983,7 +172,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Raised @@ -993,7 +182,7 @@ - 0 + 1 0 @@ -1008,7 +197,7 @@ 0 - + 552 @@ -1022,7 +211,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Plain @@ -1046,25 +235,15 @@ 0 - - - - 0 - - - 0 - - - - + - 552 - 60 + 0 + 0 @@ -1074,7 +253,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Plain @@ -1110,6 +289,16 @@ + + + + QFrame::StyledPanel + + + QFrame::Raised + + + @@ -1130,25 +319,22 @@ - - FixLabel - QLabel -
../../../libukcc/widgets/Label/fixlabel.h
-
TitleLabel QLabel -
../../../libukcc/widgets/Label/titlelabel.h
+
titlelabel.h
- FixButton - QPushButton -
../../../libukcc/widgets/Button/fixbutton.h
+ UkccFrame + QFrame +
ukccframe.h
+ 1
- DateEdit - QDateEdit -
dateedit.h
+ SettingGroup + QFrame +
settinggroup.h
+ 1
diff --git a/plugins/time-language/datetime/getsyncres.cpp b/plugins/time-language/datetime/getsyncres.cpp new file mode 100644 index 0000000..fd09bfb --- /dev/null +++ b/plugins/time-language/datetime/getsyncres.cpp @@ -0,0 +1,50 @@ +#include "getsyncres.h" +#include +#include +#include +#include + +GetSyncRes::GetSyncRes(QObject *parent) + : QThread(parent) +{ + +} + +GetSyncRes::~GetSyncRes() +{ + +} +void GetSyncRes::run() +{ + for(int i = 0; i < 300; ++i) { + struct timex txc = {}; + if (adjtimex(&txc) < 0 || txc.maxerror >= 16000000) { //未能同步时间 + int picNum = i - qFloor(i/8)*8; //限制在0~7 + QString pixName = QString(":/images/loading%1.svg").arg(picNum+10); + QPixmap pix(pixName); + Q_EMIT inSync(pix); + msleep(70); + continue; + } else { //同步时间成功 + Q_EMIT syncStatus(true); + return; + } + } + Q_EMIT syncStatus(false); + QDBusInterface *r_datetimeiface = new QDBusInterface("org.freedesktop.timedate1", + "/org/freedesktop/timedate1", + "org.freedesktop.timedate1", + QDBusConnection::systemBus()); + while (true) { + r_datetimeiface->call("SetNTP", true, true); + struct timex txc = {}; + if (adjtimex(&txc) >= 0 && txc.maxerror < 16000000) { //同步时间成功 + Q_EMIT syncStatus(true); + delete r_datetimeiface; + r_datetimeiface = nullptr; + return; + } + sleep(1); + } + return; +} diff --git a/plugins/time-language/datetime/getsyncres.h b/plugins/time-language/datetime/getsyncres.h new file mode 100644 index 0000000..714f4b7 --- /dev/null +++ b/plugins/time-language/datetime/getsyncres.h @@ -0,0 +1,18 @@ +#ifndef GETSYNCRES_H +#define GETSYNCRES_H +#include +#include + +class GetSyncRes : public QThread{ + Q_OBJECT +public: + explicit GetSyncRes(QObject *parent = nullptr); + ~GetSyncRes(); +protected: + void run() override; + +Q_SIGNALS: + void inSync(QPixmap pix); + void syncStatus(bool status); +}; +#endif // GETSYNCRES_H diff --git a/plugins/time-language/datetime/images/map-light.svg b/plugins/time-language/datetime/images/map-light.svg new file mode 100644 index 0000000..c155d48 --- /dev/null +++ b/plugins/time-language/datetime/images/map-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/time-language/datetime/timeBtn.cpp b/plugins/time-language/datetime/timeBtn.cpp index f7bef88..4b77491 100644 --- a/plugins/time-language/datetime/timeBtn.cpp +++ b/plugins/time-language/datetime/timeBtn.cpp @@ -4,9 +4,8 @@ #include #include "datetime.h" -TimeBtn::TimeBtn(const QString &timezone) { +TimeBtn::TimeBtn(const QString &timezone, const QString &kyTimezone) { this->setFixedHeight(80); -// this->adjustSize(); this->setObjectName("TimeBtn"); QHBoxLayout *timeShowLayout = new QHBoxLayout(this); @@ -20,11 +19,10 @@ TimeBtn::TimeBtn(const QString &timezone) { timeLayout->setContentsMargins(18,0,18,0); timeShowLayout->addWidget(timeWid); timeShowLayout->addWidget(deleteBtn); - deleteBtn->setFixedSize(28,28); - deleteBtn->setProperty("isWindowButton", 0x02); - deleteBtn->setProperty("useIconHighlightEffect", 0x08); + deleteBtn->setFixedSize(36, 36); + deleteBtn->setProperty("useButtonPalette", true); deleteBtn->setFlat(true); - deleteBtn->setIcon(QIcon::fromTheme("window-close-symbolic")); + deleteBtn->setIcon(QIcon::fromTheme("edit-delete-symbolic")); deleteBtn->setVisible(false); timeLayout->addStretch(); @@ -42,8 +40,11 @@ TimeBtn::TimeBtn(const QString &timezone) { } else { gmData = QString("(GMT%1:%2)").arg(utcOff, 3, 10, QLatin1Char('0')).arg(utcOff / 60, 2, 10, QLatin1Char('0')); } - labelInfo->setText(DateTime::getLocalTimezoneName(timezone, QLocale::system().name()) + " " + gmData); - + if (kyTimezone.isEmpty()) { + labelInfo->setText(DateTime::getLocalTimezoneName(timezone, QLocale::system().name()) + " " + gmData); + } else { + labelInfo->setText(DateTime::getLocalTimezoneName(kyTimezone, QLocale::system().name()) + " " + gmData); + } QFont font; QGSettings *m_fontSetting = new QGSettings("org.ukui.style"); font.setFamily(m_fontSetting->get("systemFont").toString()); @@ -106,7 +107,11 @@ void TimeBtn::updateTime(bool hour_24) { if (hour_24) { time = thisZoneTime.toString("hh : mm : ss"); } else { - time = thisZoneTime.toString("AP hh: mm : ss"); + if (QLocale::system().amText() == QString("上午") || QLocale::system().amText() == QString("སྔ་དྲོ་")) { + time = thisZoneTime.toString("AP hh: mm : ss"); + } else { + time = thisZoneTime.toString("hh: mm : ss AP"); + } } labelTime->setText(QString("%1 %2 %3").arg(dateLiteral).arg(time).arg(compareLiteral)); diff --git a/plugins/time-language/datetime/timeBtn.h b/plugins/time-language/datetime/timeBtn.h index dd5241a..8669c4c 100644 --- a/plugins/time-language/datetime/timeBtn.h +++ b/plugins/time-language/datetime/timeBtn.h @@ -1,17 +1,18 @@ #ifndef TIMEBTN_H #define TIMEBTN_H #include -#include "widgets/Label/fixlabel.h" -#include "widgets/Label/lightlabel.h" +#include "fixlabel.h" +#include "lightlabel.h" #include #include #include +#include "ukccframe.h" -class TimeBtn : public QLabel +class TimeBtn : public UkccFrame { Q_OBJECT public: - TimeBtn(const QString &timezone); + TimeBtn(const QString &timezone, const QString &kyTimezone = ""); ~TimeBtn(); void updateTime(bool hour_24); QPushButton *deleteBtn = nullptr; diff --git a/plugins/time-language/datetime/tz.qrc b/plugins/time-language/datetime/tz.qrc index a140592..29da9cd 100644 --- a/plugins/time-language/datetime/tz.qrc +++ b/plugins/time-language/datetime/tz.qrc @@ -14,5 +14,6 @@ images/loading15.svg images/loading16.svg images/loading17.svg + images/map-light.svg diff --git a/plugins/time-language/datetime/worldMap/dotlabel.cpp b/plugins/time-language/datetime/worldMap/dotlabel.cpp new file mode 100644 index 0000000..80396de --- /dev/null +++ b/plugins/time-language/datetime/worldMap/dotlabel.cpp @@ -0,0 +1,28 @@ +#include "dotlabel.h" +#include +#include + +Dotlabel::Dotlabel(const QSize &size, QWidget *parent): + mSize(size), + QLabel(parent) +{ + +} + +void Dotlabel::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; + painter.setClipping(true); + painter.setPen(Qt::transparent); + + QPainterPath path; + path.addEllipse(0, 0, mSize.width(), mSize.height()); + painter.setClipPath(path); + + QPalette pal; + painter.setBrush(pal.highlight()); + painter.drawRoundedRect(this->rect(), 0, 0); + + return QLabel::paintEvent(event); +} diff --git a/plugins/time-language/datetime/worldMap/dotlabel.h b/plugins/time-language/datetime/worldMap/dotlabel.h new file mode 100644 index 0000000..4d04cf7 --- /dev/null +++ b/plugins/time-language/datetime/worldMap/dotlabel.h @@ -0,0 +1,21 @@ +#ifndef DOTLABEL_H +#define DOTLABEL_H + +#include +#include +#include + +class Dotlabel : public QLabel +{ + Q_OBJECT +public: + Dotlabel(const QSize &size ,QWidget *parent = nullptr); + +protected: + void paintEvent(QPaintEvent *event); + +private: + QSize mSize; +}; + +#endif // DOTLABEL_H diff --git a/plugins/time-language/datetime/worldMap/timezonechooser.cpp b/plugins/time-language/datetime/worldMap/timezonechooser.cpp index 36d8689..d1a96f8 100644 --- a/plugins/time-language/datetime/worldMap/timezonechooser.cpp +++ b/plugins/time-language/datetime/worldMap/timezonechooser.cpp @@ -15,7 +15,7 @@ #include #include #include -#include "widgets/ImageUtil/imageutil.h" +#include "imageutil.h" const QString kcnBj = "北京"; const QString kenBj = "Asia/Beijing"; @@ -132,21 +132,27 @@ TimeZoneChooser::TimeZoneChooser(QWidget *parent) : QDialog(parent) QTimer::singleShot(0, [this] { QStringList completions; + const QString locale = QLocale::system().name(); // completions << kenBj; // completions << kcnBj; // m_zoneCompletion[kcnBj] = kenBj; + QString zoneBeiJing = "Asia/Beijing"; + QString localizedTimezoneBeiJing = m_zoneinfo->getLocalTimezoneName(zoneBeiJing, locale); + completions << localizedTimezoneBeiJing; + + m_zoneCompletion[localizedTimezoneBeiJing] = zoneBeiJing; for (QString timezone : QTimeZone::availableTimeZoneIds()) { // if ("Asia/Shanghai" == timezone) { // continue; // } completions << timezone; - - const QString locale = QLocale::system().name(); QString localizedTimezone = m_zoneinfo->getLocalTimezoneName(timezone, locale); completions << localizedTimezone; - m_zoneCompletion[localizedTimezone] = timezone; } + if (!completions.contains(zoneBeiJing)) { + completions << zoneBeiJing; + } QCompleter *completer = new QCompleter(completions, m_searchInput); completer->popup()->setAttribute(Qt::WA_InputMethodEnabled); @@ -285,8 +291,6 @@ void TimeZoneChooser::initSize(){ m_map->setFixedSize(MapPictureWidth / scale, MapPictureHeight / scale); - m_cancelBtn->setFixedHeight(36); - m_confirmBtn->setFixedHeight(36); m_cancelBtn->setFixedWidth(120); m_confirmBtn->setFixedWidth(120); } diff --git a/plugins/time-language/datetime/worldMap/timezonemap.cpp b/plugins/time-language/datetime/worldMap/timezonemap.cpp index 18fd076..6100e6a 100644 --- a/plugins/time-language/datetime/worldMap/timezonemap.cpp +++ b/plugins/time-language/datetime/worldMap/timezonemap.cpp @@ -7,7 +7,7 @@ #include #include -const QString timezoneMapFile =":/images/map.svg"; +const QString timezoneMapFile =":/images/map-light.svg"; const QString dotFile = ":/images/indicator.png"; @@ -65,17 +65,14 @@ void TimezoneMap::initUI() { Q_ASSERT(!timezonePixmap.isNull()); backgroundLabel->setPixmap(timezonePixmap); - m_dot = new QLabel(this->parentWidget()); - QPixmap dotPixmap(dotFile); - Q_ASSERT(!dotPixmap.isNull()); - m_dot->setPixmap(dotPixmap.scaled(8,8,Qt::KeepAspectRatio)); - + m_dot = new Dotlabel(QSize(8, 8), this->parentWidget()); m_dot->setFixedSize(8, 8); + m_dot->hide(); m_singleList = new ToolPop(this->parentWidget()); - m_singleList->setFixedHeight(30); + m_singleList->setFixedHeight(36); m_singleList->setMinimumWidth(60); m_singleList->setAttribute(Qt::WA_TransparentForMouseEvents, true); m_singleList->hide(); diff --git a/plugins/time-language/datetime/worldMap/timezonemap.h b/plugins/time-language/datetime/worldMap/timezonemap.h index e7279f3..3a640b3 100644 --- a/plugins/time-language/datetime/worldMap/timezonemap.h +++ b/plugins/time-language/datetime/worldMap/timezonemap.h @@ -12,6 +12,7 @@ #include "poplist.h" #include "toolpop.h" #include "popmenu.h" +#include "dotlabel.h" QDebug& operator<<(QDebug& debug, const ZoneInfo& info); @@ -47,7 +48,7 @@ private: ZoneinfoList m_nearestZones; // 圆点 - QLabel* m_dot = nullptr; + Dotlabel* m_dot = nullptr; ToolPop* m_singleList; PopMenu *m_popmenu; diff --git a/plugins/time-language/datetime/worldMap/toolpop.cpp b/plugins/time-language/datetime/worldMap/toolpop.cpp index 1eaef68..9793425 100644 --- a/plugins/time-language/datetime/worldMap/toolpop.cpp +++ b/plugins/time-language/datetime/worldMap/toolpop.cpp @@ -6,10 +6,8 @@ ToolPop::ToolPop(QWidget* parent) : QLabel (parent) { - this->setAlignment(Qt::AlignCenter); - this->setStyleSheet("margin: 0 15"); - this->setStyleSheet("background-color: #3790FA;border-radius:4px;"); - +// this->setAlignment(Qt::AlignCenter); +// this->setStyleSheet("margin: 0 15"); } void ToolPop::popupSlot(QPoint point) { @@ -23,13 +21,18 @@ void ToolPop::paintEvent(QPaintEvent *event) { painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, true); + painter.setPen(Qt::transparent); + QPalette pal; + painter.setBrush(pal.highlight()); + painter.drawRoundedRect(this->rect(), 4, 4); + QFont font; font.setPixelSize(12); QFontMetrics fontMetrics(font); int labelLen = fontMetrics.width(this->text()); painter.setPen(QPen(Qt::white)); painter.setFont(font); - painter.drawText((this->width() - labelLen) / 2, 16, this->text()); + painter.drawText((this->width() - labelLen) / 2, (this->height() + 10) / 2, this->text()); } diff --git a/plugins/time-language/datetime/worldMap/zoneinfo.cpp b/plugins/time-language/datetime/worldMap/zoneinfo.cpp index 1e4fd55..ce1396d 100644 --- a/plugins/time-language/datetime/worldMap/zoneinfo.cpp +++ b/plugins/time-language/datetime/worldMap/zoneinfo.cpp @@ -52,7 +52,10 @@ double ZoneInfo::convertoPos(const QString &pos, int num) { ZoneinfoList ZoneInfo::getzoneInforList() { ZoneinfoList list; - const QString content(this->readRile(zoneTabFile)); + QString content(this->readRile(zoneTabFile)); + if (!content.contains("Asia/Beijing")){ + content = content + "\n CN +3955+11626 Asia/Beijing China Standard Time \n"; + } for (const QString& line : content.split('\n')) { if(!line.startsWith('#')) { const QStringList details(line.split('\t')); @@ -74,8 +77,6 @@ ZoneinfoList ZoneInfo::getzoneInforList() { // if ("+12128" == coordinate.mid(index)) { // longtitude = convertoPos("+11646", 3); // } - - ZoneInfo_ zoneinfo_ = {details.at(0), details.at(2), latitude, longtitude,0.0}; list.append(zoneinfo_); } diff --git a/registeredQDbus/conf/com.control.center.qt.systemdbus.policy b/registeredQDbus/conf/com.control.center.qt.systemdbus.policy index 73941d4..1ef80d4 100644 --- a/registeredQDbus/conf/com.control.center.qt.systemdbus.policy +++ b/registeredQDbus/conf/com.control.center.qt.systemdbus.policy @@ -11,8 +11,10 @@ UserInfo 帐户信息 + ཐོ་ཁུངས་ཆ་འཕྲིན་ To change the user pwd, you need to authenticate. 需要通过管理员认证后才可以修改用户密码 + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲོད་བརྒྱུད་དགོས་། auth_admin auth_admin @@ -22,8 +24,10 @@ UserInfo 帐户信息 + ཐོ་ཁུངས་ཆ་འཕྲིན་ To create new user, you need to authenticate. 需要通过管理员认证后才可以新建用户 + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་བརྒྱད་དགོས་། auth_admin auth_admin @@ -34,8 +38,10 @@ Ntp server address 时间服务器 + དུས་ཚོད་ཞབས་ཞུ་ཆས་ To change the ntp server address, you need to authenticate. 需要通过管理员认证后才可以修改时间服务器 + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་བརྒྱད་དགོས་། auth_admin auth_admin @@ -46,19 +52,23 @@ login without password 免密登录 + དུས་ཚོད་ཞབས་ཞུ་ཆས་ Change login without password, you need to authenticate. 修改免密登录需要认证 + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་བརྒྱད་དགོས་། - auth_admin - auth_admin - auth_admin + auth_admin_keep + auth_admin_keep + auth_admin_keep auto login 自动登录 + ཐོ་རང་འགོད།་ Change auto login, you need to authenticate. 修改自动登录需要认证 + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་བརྒྱད་དགོས་། auth_admin auth_admin @@ -68,8 +78,10 @@ passwd aging 密码老化时间 + གསང་ཨང་རྒས་འགྱུར་དུས་ཚོད། Change passwd aging, you need to authenticate. 修改密码老化时间需要认证 + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་བརྒྱད་དགོས་། auth_admin auth_admin @@ -79,8 +91,23 @@ set pid 设置PID + གསར་འཛུགས་། To set the pid, you need to authenticate. 需要通过管理员认证后才可以设置PID + དོ་དམ་པ་དཔང་དངོས་བདེན་པ་ཡིན་པའི་ར་སྤྲད་བརྒྱད་དགོས་། + + auth_admin + auth_admin + auth_admin + + + + set pid + Grub 密码 + Grub 密碼 + To set the grub password, you need to authenticate. + 需要通过管理员认证后才可以设置 Grub 密码 + 需要通過管理員認證後才可以設置 Grub 密碼 auth_admin auth_admin diff --git a/registeredQDbus/registeredQDbus.pro b/registeredQDbus/registeredQDbus.pro index c97213a..7e294cf 100644 --- a/registeredQDbus/registeredQDbus.pro +++ b/registeredQDbus/registeredQDbus.pro @@ -34,9 +34,7 @@ INSTALLS += \ HEADERS += \ sysdbusregister.h \ - ../shell/utils/utils.h SOURCES += \ main.cpp \ sysdbusregister.cpp \ - ../shell/utils/utils.cpp diff --git a/registeredQDbus/sysdbusregister.cpp b/registeredQDbus/sysdbusregister.cpp index 6be45f4..0b858f6 100644 --- a/registeredQDbus/sysdbusregister.cpp +++ b/registeredQDbus/sysdbusregister.cpp @@ -30,7 +30,6 @@ #include #include #include -#include "../shell/utils/utils.h" /* qt会将glib里的signals成员识别为宏,所以取消该宏 * 后面如果用到signals时,使用Q_SIGNALS代替即可 @@ -54,7 +53,7 @@ SysdbusRegister::SysdbusRegister() mHibernateSet = new QSettings(mHibernateFile, QSettings::IniFormat, this); mHibernateSet->setIniCodec("UTF-8"); exitFlag = false; - if (Utils::getCpuInfo().contains("D2000", Qt::CaseInsensitive)) { + if (getCpuInfo().contains("D2000", Qt::CaseInsensitive)) { toGetDisplayInfo = false; } else { toGetDisplayInfo = true; @@ -158,26 +157,64 @@ QString SysdbusRegister::getNoPwdLoginStatus(){ return QString(ba); } +void SysdbusRegister::notifyPropertyChanged( const QString& interface, + const QString& propertyName) +{ + QDBusMessage signal = QDBusMessage::createSignal( + "/", + "org.freedesktop.DBus.Properties", + "PropertiesChanged"); + signal << interface; + QVariantMap changedProps; + changedProps.insert(propertyName, property(propertyName.toLatin1().data())); + signal << changedProps; + signal << QStringList(); + QDBusConnection::systemBus().send(signal); +} + +bool SysdbusRegister::NoPwdLoginStatus() const +{ + return NoPwdLogin; +} //设置免密登录状态 -int SysdbusRegister::setNoPwdLoginStatus(bool status,QString username) +bool SysdbusRegister::setNoPwdLoginStatus(bool status,QString username) { //密码校验 QDBusConnection conn = connection(); QDBusMessage msg = message(); if (!authoriyLogin(conn.interface()->servicePid(msg.service()).value())){ - return 0; + return false; } - QString cmd; - if(true == status){ - cmd = QString("gpasswd -a %1 nopasswdlogin").arg(username); - } else{ - cmd = QString("gpasswd -d %1 nopasswdlogin").arg(username); - } - QProcess::execute(cmd); + if (username == nullptr) { + if (status == false) { + QString noPwdLoginUser = getNoPwdLoginStatus(); + qDebug() << "noPwdLoginUser:" << noPwdLoginUser; + QStringList tmp = noPwdLoginUser.split(":", QString::SkipEmptyParts); - return 1; + QString noPasswdUsers = tmp.at(tmp.count()-1); + QStringList noPasswdUsersList = noPasswdUsers.split(",", QString::SkipEmptyParts); + foreach (QString noPasswdUser, noPasswdUsersList) { + noPasswdUser.remove(QChar('\n'), Qt::CaseInsensitive); + qDebug() << "nopasswduser:" << noPasswdUser; + QString cmd = QString("gpasswd -d %1 nopasswdlogin").arg(noPasswdUser);; + QProcess::execute(cmd); + } + } + } else { + QString cmd; + if(true == status){ + cmd = QString("gpasswd -a %1 nopasswdlogin").arg(username); + } else{ + cmd = QString("gpasswd -d %1 nopasswdlogin").arg(username); + } + QProcess::execute(cmd); + } + + NoPwdLogin = status; + notifyPropertyChanged("com.control.center.qt.systemdbus", "NoPwdLoginStatus"); + return true; } // 设置自动登录状态 @@ -412,6 +449,29 @@ bool SysdbusRegister::authoriySetPid(qint64 id) } } +bool SysdbusRegister::authoriyGrub(qint64 id) +{ + _id = id; + + if (_id == 0) + return false; + + PolkitQt1::Authority::Result result; + + result = PolkitQt1::Authority::instance()->checkAuthorizationSync( + "org.control.center.qt.systemdbus.action.grub", + PolkitQt1::UnixProcessSubject(_id), + PolkitQt1::Authority::AllowUserInteraction); + + if (result == PolkitQt1::Authority::No){ + _id = 0; + return false; + } else { + _id = 0; + return true; + } +} + bool SysdbusRegister::authoriyAutoLogin(qint64 id) { _id = id; @@ -467,9 +527,6 @@ void SysdbusRegister::_setI2CBrightness(QString brightness, QString type) { arg << "-f" << "-y" << type << "w7@0x37" << "0x51" << "0x84" << "0x03" << "0x10" << "0x00" << light << c; QProcess *vcpPro = new QProcess(this); -// vcpPro->start(program, arg); -// vcpPro->waitForStarted(); -// vcpPro->waitForFinished(); vcpPro->startDetached(program, arg); } @@ -507,6 +564,37 @@ int SysdbusRegister::_getI2CBrightness(QString type) { return -1; } +QString SysdbusRegister::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(); +} + + int SysdbusRegister::changeRTC() { QString cmd = "hwclock -w"; return system(cmd.toLatin1().data()); @@ -930,3 +1018,78 @@ QString SysdbusRegister::getDmidecodeType() return retString; } +QString SysdbusRegister::getShowTimezone() +{ + QFile file("/etc/.kytimezone"); + QString mTimezone = ""; + if(file.exists()) { + if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream textStream(&file); + mTimezone = textStream.readLine(); + file.close(); + } + } + return mTimezone; +} + +void SysdbusRegister::setShowTimezone(QString timezone) +{ + QString cmd = QString("echo %1 > /etc/.kytimezone").arg(timezone); + system(cmd.toUtf8().data()); + return; +} + +bool SysdbusRegister::copyFile(const QString &srcfile, const QString &dstfile) +{ + return QFile::copy(srcfile, dstfile); +} + +bool SysdbusRegister::setGrupPasswd(QString username, QString passwd, bool status) +{ + //密码校验 + QDBusConnection conn = connection(); + QDBusMessage msg = message(); + + if (!authoriyGrub(conn.interface()->servicePid(msg.service()).value())){ + return false; + } + + QString cmd; + if(true == status){ + cmd = QString("grub-password -u %1 %2 | update-grub").arg(username).arg(passwd); + } else{ + cmd = QString("grub-password -d | update-grub"); + } + + int ret = system(cmd.toLatin1().data()); + if (ret != 0) { + qDebug() << "grub execute failed!"; + return false; + } + + return true; +} + +bool SysdbusRegister::getGrupPasswdStatus() +{ + QByteArray ba = ""; + FILE * fp = NULL; + char cmd[128]; + char buf[1024]; + snprintf(cmd, 128, "cat /etc/grub.d/00_header |grep password_pbkdf2"); + if ((fp = popen(cmd, "r")) != NULL){ + rewind(fp); + fgets(buf, sizeof (buf), fp); + ba.append(buf); + pclose(fp); + fp = NULL; + }else{ + qDebug()<<"popen文件打开失败"< #include #include +#include struct displayInfo { bool _DDC; //是否采用DDC处理,当DDC失败时使用I2C @@ -52,6 +53,7 @@ class SysdbusRegister : public QObject,QDBusContext Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.control.center.interface") + Q_PROPERTY(bool NoPwdLoginStatus READ NoPwdLoginStatus) public: explicit SysdbusRegister(); @@ -62,8 +64,11 @@ public: bool checkAuthorization(qint64 id); bool authoriyLogin(qint64 id); bool authoriySetPid(qint64 id); + bool authoriyGrub(qint64 id); bool authoriyAutoLogin(qint64 id); bool authoriyPasswdAging(qint64 id); + void notifyPropertyChanged(const QString& interface, const QString &propertyName); + bool NoPwdLoginStatus() const; private: QString mHibernateFile; @@ -74,6 +79,7 @@ private: QVector i2c_displayInfo_V; QSettings *aptSettings; qint64 _id; + bool NoPwdLogin; private: bool isSudoGroupNumber(QString uname); @@ -85,6 +91,8 @@ private: // 通过I2C获取外接台式屏幕亮度 int _getI2CBrightness(QString type); + QString getCpuInfo(); + signals: Q_SCRIPTABLE void nameChanged(QString); Q_SCRIPTABLE void computerinfo(QString); @@ -97,7 +105,7 @@ public slots: Q_SCRIPTABLE int setPid(qint64 id); // 设置免密登录状态 - Q_SCRIPTABLE int setNoPwdLoginStatus(bool status,QString username); + Q_SCRIPTABLE bool setNoPwdLoginStatus(bool status,QString username = nullptr); // 获取免密登录状态 Q_SCRIPTABLE QString getNoPwdLoginStatus(); @@ -146,6 +154,22 @@ public slots: //获取设备类型 Q_SCRIPTABLE QString getDmidecodeType(); + + //获取系统时区 + Q_SCRIPTABLE QString getShowTimezone(); + + //设置系统时区 + Q_SCRIPTABLE void setShowTimezone(QString timezone); + + //复制文件 + Q_SCRIPTABLE bool copyFile(const QString &srcfile, const QString &dstfile); + + // 设置 grub 密码 + Q_SCRIPTABLE bool setGrupPasswd(QString username, QString passwd, bool status); + + // 获取 grub 密码是否开启 + Q_SCRIPTABLE bool getGrupPasswdStatus(); + }; #endif // SYSDBUSREGISTER_H diff --git a/registeredSession/area/areainterface.cpp b/registeredSession/area/areainterface.cpp new file mode 100644 index 0000000..20518d2 --- /dev/null +++ b/registeredSession/area/areainterface.cpp @@ -0,0 +1,268 @@ +#include "areainterface.h" +#include +#include + +AreaInterface::AreaInterface() +{ + ukccPanelGsettings = UniversalInterface::self()->ukccPanelGsettings(); + accountInterface = UniversalInterface::self()->accountUserDbus(); + fcitxInterface = UniversalInterface::self()->fcitxInputMethodDbus(); + styleGsettings = UniversalInterface::self()->ukuiStyleGsettings(); + connect(ukccPanelGsettings, &QGSettings::changed, this, [=](QString key) { + if (key == CALENDAR_KEY) { + mCalendar.clear(); + getCalendar(); + Q_EMIT changed("calendar"); + } else if (key == FIRST_DAY_KEY) { + mFirstDay.clear(); + getFirstDay(); + Q_EMIT changed("firstDay"); + } else if (key == DATE_FORMATE_KEY) { + mDateFormat.clear(); + getDateFormat(); + Q_EMIT changed("dateFormat"); + } else if (key == TIME_FORMAT_KEY) { + mTimeFormat.clear(); + getTimeFormat(); + Q_EMIT changed("timeFormat"); + } else if (key == SHOW_LANGUAGE_KEY) { + mShowLanguageList.clear(); + getShowLanguageList(); + Q_EMIT changed("showLanguageList"); + } + }); + + connect(styleGsettings, &QGSettings::changed, this, [=](QString key) { + if (key == "iconThemeName") { + Q_EMIT changed("iconThemeName"); + } + }); +} + +AreaInterface::~AreaInterface() +{ + +} + +const QString AreaInterface::gsettingGet(const QString &key) const +{ + if (ukccPanelGsettings->keys().contains(key)) { + return ukccPanelGsettings->get(key).toString(); + } else { + return ""; + } +} + +void AreaInterface::gsettingSet(const QString &key, const QString &value) +{ + if (ukccPanelGsettings->keys().contains(key)) { + ukccPanelGsettings->set(key, value); + } +} + +const QStringList AreaInterface::getFormatCountryList() +{ + if (mFormatCountryList.isEmpty()) { + mFormatCountryList.append(QString("en_US.UTF-8")); + mFormatCountryList.append(QString("zh_CN.UTF-8")); + mFormatCountryList.append(QString("bo_CN.UTF-8")); + } + return mFormatCountryList; +} + +const QStringList AreaInterface::getCalendarList() +{ + if (mCalendarList.isEmpty()) { + mCalendarList.append(QString("solarlunar")); + QString locale = QLocale::system().name(); + if ("zh_CN" == locale) { + mCalendarList.append(QString("lunar")); + } + } + return mCalendarList; +} + +const QStringList AreaInterface::getFirstDayList() +{ + if (mFirstDayList.isEmpty()) { + mFirstDayList.append("monday"); + mFirstDayList.append("sunday"); + } + return mFirstDayList; +} + +const QStringList AreaInterface::getDateFormatList() +{ + if (mDateFormatList.isEmpty()) { + mDateFormatList.append("cn"); + mDateFormatList.append("en"); + } + return mDateFormatList; +} + +const QStringList AreaInterface::getTimeFormatList() +{ + if (mtimeFormatList.isEmpty()) { + mtimeFormatList.append("12"); + mtimeFormatList.append("24"); + } + return mtimeFormatList; +} + +const QStringList AreaInterface::getShowLanguageList() +{ + if (mShowLanguageList.isEmpty()) { + if (ukccPanelGsettings->keys().contains(SHOW_LANGUAGE_KEY)) { + mShowLanguageList = ukccPanelGsettings->get(SHOW_LANGUAGE_KEY).toStringList(); + } else { + qCritical() << "get SHOW_LANGUAGE_KEY error."; + } + } + return mShowLanguageList; +} + +const QStringList AreaInterface::getLanguageList() +{ + if (mLanguageList.isEmpty()) { + mLanguageList.append("zh_CN"); + mLanguageList.append("en"); + mLanguageList.append("bo_CN"); + } + return mLanguageList; +} + +const QString AreaInterface::getFormatCountry() +{ + if (mFormatCountry.isEmpty()) { + mFormatCountry = accountInterface->property("FormatsLocale").toString(); + } + return mFormatCountry; +} + +const QString AreaInterface::getCalendar() +{ + if (mCalendar.isEmpty()) { + mCalendar = gsettingGet(CALENDAR_KEY); + } + return mCalendar; +} + +const QString AreaInterface::getFirstDay() +{ + if (mFirstDay.isEmpty()) { + mFirstDay = gsettingGet(FIRST_DAY_KEY); + } + return mFirstDay; +} + +const QString AreaInterface::getDateFormat() +{ + if (mDateFormat.isEmpty()) { + mDateFormat = gsettingGet(DATE_FORMATE_KEY); + } + return mDateFormat; +} + +const QString AreaInterface::getTimeFormat() +{ + if (mTimeFormat.isEmpty()) { + mTimeFormat = gsettingGet(TIME_FORMAT_KEY); + } + return mTimeFormat; +} + +const QString AreaInterface::getLanguage() +{ + mLanguage = accountInterface->property("Language").toString(); + return mLanguage; +} + +void AreaInterface::setFormatCountry(const QString &formatCountry) +{ + mFormatCountry = formatCountry; + accountInterface->call("SetFormatsLocale", formatCountry); + Q_EMIT changed("formatCountry"); +} + +void AreaInterface::setCalendar(const QString &calendar) +{ + gsettingSet(CALENDAR_KEY, calendar); +} + +void AreaInterface::setFirstDay(const QString &firstDay) +{ + gsettingSet(FIRST_DAY_KEY, firstDay); +} + +void AreaInterface::setDateFormat(const QString &dateFormat) +{ + gsettingSet(DATE_FORMATE_KEY, dateFormat); +} + +void AreaInterface::setTimeFormat(const QString &timeFormat) +{ + gsettingSet(TIME_FORMAT_KEY, timeFormat); +} + +void AreaInterface::setShowLanguageList(const QStringList &languageList) +{ + if (ukccPanelGsettings->keys().contains(SHOW_LANGUAGE_KEY)) { + ukccPanelGsettings->set(SHOW_LANGUAGE_KEY, languageList); + } else { + qCritical() << "set SHOW_LANGUAGE_KEY error:" << languageList; + } +} + +void AreaInterface::setLanguage(const QString &languageCode) +{ + accountInterface->call("SetLanguage", languageCode); + Q_EMIT changed("language"); +} + +void AreaInterface::reloadInputMethodConfig() +{ + fcitxInterface->call("ReloadConfig"); +} + +void AreaInterface::changeInputMethod(const QString &inputMethod, const bool &add) +{ + QString fileTextString; + QFile configFile(FCITX_CONFIG_FILE); + if (configFile.open(QIODevice::ReadWrite | QIODevice::Text)) { + //把文件所有信息读出来 + QTextStream stream(&configFile); + fileTextString = stream.readAll(); + + if (!fileTextString.contains(inputMethod)) { + return ; + } + QString addString = inputMethod + ":True"; + QString removeString = inputMethod + ":False"; + if (add) { + fileTextString.replace(removeString, addString); + } else { + fileTextString.replace(addString, removeString); + } + stream << fileTextString; + configFile.close(); + reloadInputMethodConfig(); + } +} + +bool AreaInterface::isAddedInputMethod(const QString &inputMethod) +{ + QString fileTextString; + QFile mFile(FCITX_CONFIG_FILE); + if (mFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream stream(&mFile); + fileTextString = stream.readAll(); + QString string = inputMethod + ":True"; + if (fileTextString.contains(string)) { + return true; + } else { + return false; + } + } + qCritical()<<"open "< +#include +#include "../universalinterface.h" + +class AreaInterface : public QObject +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.ukui.ukcc.session.Area") + Q_PROPERTY(QStringList formatCountryList READ getFormatCountryList) + Q_PROPERTY(QStringList calendarList READ getCalendarList) + Q_PROPERTY(QStringList firstDayList READ getFirstDayList) + Q_PROPERTY(QStringList dateFormatList READ getDateFormatList) + Q_PROPERTY(QStringList timeFormatList READ getTimeFormatList) + Q_PROPERTY(QStringList languageList READ getLanguageList) + Q_PROPERTY(QStringList showLanguageList READ getShowLanguageList) + Q_PROPERTY(QString formatCountry READ getFormatCountry) + Q_PROPERTY(QString calendar READ getCalendar) + Q_PROPERTY(QString firstDay READ getFirstDay) + Q_PROPERTY(QString dateFormat READ getDateFormat) + Q_PROPERTY(QString timeFormat READ getTimeFormat) + Q_PROPERTY(QString language READ getLanguage) + +public: + AreaInterface(); + ~AreaInterface(); + +protected: + // 对属性的访问函数 + const QStringList getFormatCountryList(); + const QStringList getCalendarList(); + const QStringList getFirstDayList(); + const QStringList getDateFormatList(); + const QStringList getTimeFormatList(); + const QStringList getLanguageList(); + const QStringList getShowLanguageList(); + const QString getFormatCountry(); + const QString getCalendar(); + const QString getFirstDay(); + const QString getDateFormat(); + const QString getTimeFormat(); + const QString getLanguage(); + +public Q_SLOTS: + /** + * @brief 修改输入法 + * + * @param inputMethodName 输入法名称 + * @param add 添加/移除 + */ + void changeInputMethod(const QString &inputMethod, const bool &add); + + /** + * @brief 查询输入法是否已经添加 + * + * @param inputMethodName 输入法名称 + * @return bool 返回输入法是否已经添加 + */ + bool isAddedInputMethod(const QString &inputMethod); + + // 对属性的设置函数 + void setFormatCountry(const QString &formatCountry); + void setCalendar(const QString &calendar); + void setFirstDay(const QString &firstDay); + void setDateFormat(const QString &dateFormat); + void setTimeFormat(const QString &timeFormat); + void setShowLanguageList(const QStringList &languageList); + void setLanguage(const QString &languageCode); + +Q_SIGNALS: + void changed(QString keyName); + +private: + void reloadInputMethodConfig(); + + // 设置和获取gsetting的string类型的键值 + const QString gsettingGet(const QString &key) const; + void gsettingSet(const QString &key, const QString &value); + +private: + const QString SHOW_LANGUAGE_KEY = QString("showlanguage"); + const QString FCITX_CONFIG_FILE = QDir::homePath() + "/.config/fcitx/profile"; + const QString CALENDAR_KEY = QString("calendar"); + const QString FIRST_DAY_KEY = QString("firstday"); + const QString DATE_FORMATE_KEY = QString("date"); + const QString TIME_FORMAT_KEY = QString("hoursystem"); + +private: + QGSettings *ukccPanelGsettings = nullptr; + QDBusInterface *accountInterface = nullptr; + QDBusInterface *fcitxInterface = nullptr; + QGSettings *styleGsettings = nullptr; +private: + QStringList mFormatCountryList = {}; + QStringList mCalendarList = {}; + QStringList mFirstDayList = {}; + QStringList mDateFormatList = {}; + QStringList mtimeFormatList = {}; + QStringList mShowLanguageList = {}; + QStringList mLanguageList = {}; + QString mLanguage = ""; + QString mFormatCountry = ""; + QString mCalendar = ""; + QString mFirstDay = ""; + QString mDateFormat = ""; + QString mTimeFormat = ""; +}; + +#endif // AREAINTERFACE_H diff --git a/registeredSession/conf/org.ukui.ukcc.session.xml b/registeredSession/conf/org.ukui.ukcc.session.xml index 0c6933b..20571af 100644 --- a/registeredSession/conf/org.ukui.ukcc.session.xml +++ b/registeredSession/conf/org.ukui.ukcc.session.xml @@ -6,6 +6,14 @@ + + + + + + + + @@ -29,5 +37,9 @@ + + + + diff --git a/registeredSession/main.cpp b/registeredSession/main.cpp index ef59510..1ad7dfe 100644 --- a/registeredSession/main.cpp +++ b/registeredSession/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -6,18 +6,24 @@ #include "ukccsessionserver.h" #include "session_adaptor.h" #include "screenStruct.h" +#include "./area/areainterface.h" int main(int argc, char *argv[]) { - QCoreApplication app(argc, argv); - app.setOrganizationName("Kylin Team"); - app.setApplicationName("ukcc-session-service"); + QApplication app(argc, argv); + QCoreApplication::setOrganizationName("Kylin Team"); + QCoreApplication::setApplicationName("ukcc-session-service"); qRegisterMetaType("ScreenConfig"); qDBusRegisterMetaType(); + QTranslator translator; + translator.load("/usr/share/ukui-control-center/shell/res/i18n/" + QLocale::system().name()); + app.installTranslator(&translator); ukccSessionServer service; new InterfaceAdaptor(&service); + AreaInterface *areaInterface = new AreaInterface(); + QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.registerService("org.ukui.ukcc.session")) { qCritical() << "QDbus register service failed reason:" << sessionBus.lastError(); @@ -28,5 +34,13 @@ int main(int argc, char *argv[]) qCritical() << "QDbus register object failed reason:" << sessionBus.lastError(); exit(2); } + + if (!sessionBus.registerObject("/Area", areaInterface, QDBusConnection::ExportAllSlots | + QDBusConnection::ExportAllProperties | + QDBusConnection::ExportAllSignals)) { + qCritical() << "QDbus register object /Area failed reason:" << sessionBus.lastError(); + exit(3); + } + return app.exec(); } diff --git a/registeredSession/registeredSession.pro b/registeredSession/registeredSession.pro index 915a40d..3f2fc0e 100644 --- a/registeredSession/registeredSession.pro +++ b/registeredSession/registeredSession.pro @@ -1,12 +1,17 @@ QT += core dbus QT -= gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent TARGET = ukui-control-center-session TEMPLATE = app CONFIG += c++11 console link_pkgconfig CONFIG -= app_bundle +PKGCONFIG += gio-2.0 \ + kysdk-sysinfo \ + kysdk-diagnostics \ + kysdk-qtwidgets \ + gsettings-qt QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -O2 @@ -16,6 +21,10 @@ QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 -O2 # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS +DEFINES += PLUGIN_INSTALL_DIRS='\\"$$[QT_INSTALL_LIBS]/ukui-control-center\\"' +DEFINES += PLUGIN_INSTALL_UPDATE='\\"$$[QT_INSTALL_LIBS]/ukui-control-center/V2.0\\"' + +LIBS += -L$$[QT_INSTALL_LIBS] DBUS_ADAPTORS += conf/org.ukui.ukcc.session.xml DBUS_INTERFACES += conf/org.ukui.ukcc.session.xml @@ -30,15 +39,19 @@ INSTALLS += inst1 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ + area/areainterface.cpp \ json.cpp \ main.cpp \ - ukccsessionserver.cpp + ukccsessionserver.cpp \ + universalinterface.cpp # Default rules for deployment. target.path = /usr/bin/ !isEmpty(target.path): INSTALLS += target HEADERS += \ + area/areainterface.h \ json.h \ screenStruct.h \ - ukccsessionserver.h + ukccsessionserver.h \ + universalinterface.h diff --git a/registeredSession/ukccsessionserver.cpp b/registeredSession/ukccsessionserver.cpp index b7ba409..072aa8e 100644 --- a/registeredSession/ukccsessionserver.cpp +++ b/registeredSession/ukccsessionserver.cpp @@ -5,8 +5,23 @@ #include #include +const QStringList mavisFilterPathList = {"/Date/Set Time","/Date/24-hour clock", + "/Date/Other Timezone","/Date/Set Date Manually", + "/Date/Change time zone","/Date/Sync Time", + "/Date/Manual Time","/Date/Sync Server", + "/Date/Auto Sync Time","/Date/Network", + "/Mouse/Wheel speed","/Mouse/Double-click interval time", + "/Mouse/Mouse acceleration", "/Theme/Cursor theme", "/Display/resolution", + "/Display/orientation", "/Display/frequency", "/Display/screen zoom", "/Theme/Transparency", + "/Audio/Sound Theme" + }; +const QStringList filterPathList = { "/Display/Auto Brightness", "/Display/Dynamic light" }; + +const QStringList openkylinFilterPathList = {"/Shortcut/Add", "/Shortcut/Customize Shortcut"}; + ukccSessionServer::ukccSessionServer() { mFilePath = QDir::homePath() + "/.config/ukui/ukcc-screenPreCfg.json"; + monitoFileChanged(); } QMap ukccSessionServer::getJsonInfo(const QString &configFile) { @@ -25,8 +40,12 @@ QMap ukccSessionServer::getJsonInfo(const QString &configFile moduleMap.insert(faObj["name"].toString(), faObj["visible"].toVariant()); QJsonArray childNodeAry = faObj["childnode"].toArray(); for (int j = 0; j < childNodeAry.size(); j++) { - moduleMap.insert(childNodeAry.at(j).toObject().value("name").toString(), - childNodeAry.at(j).toObject().value("visible").toVariant()); + QString modeName = childNodeAry.at(j).toObject().value("name").toString(); + QString modeSet = modeName + "Settings"; + QVariant modeVisiable = childNodeAry.at(j).toObject().value("visible").toVariant(); + + moduleMap.insert(modeName, modeVisiable); + moduleMap.insert(modeSet, childNodeAry.at(j).toObject().value(modeSet).toString()); } } } @@ -90,7 +109,7 @@ QVariantMap ukccSessionServer::getModuleHideStatus() { if (name.isEmpty()) { name = qgetenv("USERNAME"); } - QString filename = QDir::homePath() + "/.config/ukui-control-center-security-config.json"; + QString filename = GetSecurityConfigPath(); return getJsonInfo(filename); } @@ -100,7 +119,296 @@ QString ukccSessionServer::GetSecurityConfigPath() { if (name.isEmpty()) { name = qgetenv("USERNAME"); } - QString filename = QDir::homePath() + "/.config/ukui-control-center-security-config.json"; + QString systemFilename = "/usr/share/ukui-control-center/data/ukui-control-center-security-config.json"; + QFile file(systemFilename); + if (file.exists()) { + return systemFilename; + } - return filename; + QString userFilename = QDir::homePath() + "/.config/ukui-control-center-security-config.json"; + + return userFilename; } + +void ukccSessionServer::monitoFileChanged() +{ + QFileSystemWatcher *m_FileWatcher = new QFileSystemWatcher(this); + m_FileWatcher->addPath(GetSecurityConfigPath()); + connect(m_FileWatcher, &QFileSystemWatcher::fileChanged, this, [=](){ + Q_EMIT configChanged(); + }); +} + +QVariantMap ukccSessionServer::getSearchItems() +{ + m_lang = QLocale::system().name(); + + // 加载插件 + LoadPlugin(); +// m_xmlFilePath.insert(QString("/usr/share/ukui-control-center/shell/res/i18n/%1.ts").arg(m_lang)); + + //添加一项空数据,为了防止使用setText输入错误数据时直接跳转到list中正确的第一个页面 + clearSearchData(); + QJsonArray searchItems; + QJsonObject rootobj; + + for (const QString i : m_xmlFilePath) { + + QString xmlPath = i.arg(m_lang); + QFile file(xmlPath); + + if (!file.exists()) { + qWarning() << " [SearchWidget] File not exist"; + continue; + } + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + qWarning() << " [SearchWidget] File open failed"; + continue; + } + + QXmlStreamReader xmlRead(&file); + QXmlStreamReader::TokenType type = QXmlStreamReader::Invalid; + + //遍历XML文件,读取每一行的xml数据都会 + //先进入StartElement读取出<>中的内容; + //再进入Characters读取出中间数据部分; + //最后进入时进入EndElement读取出中的内容 + while (!xmlRead.atEnd()) { + type = xmlRead.readNext(); + switch (type) { + case QXmlStreamReader::StartElement: + m_xmlExplain = xmlRead.name().toString(); + break; + case QXmlStreamReader::Characters: + if (!xmlRead.isWhitespace()) { + if (m_xmlExplain == XML_Source) { // get xml source date + m_searchBoxStruct.translateContent = xmlRead.text().toString(); + } else if (m_xmlExplain == XML_Title) { + if (xmlRead.text().toString() != "") // translation not nullptr can set it + m_searchBoxStruct.translateContent = xmlRead.text().toString(); + } else if (m_xmlExplain == XML_Numerusform) { + if (xmlRead.text().toString() != "") // translation not nullptr can set it + m_searchBoxStruct.translateContent = xmlRead.text().toString(); + } else if (m_xmlExplain == XML_Explain_Path) { + m_searchBoxStruct.fullPagePath = xmlRead.text().toString(); + + // openkylin 过滤掉的搜索项 + if (isOpenkylin() && openkylinFilterPathList.contains(m_searchBoxStruct.fullPagePath)) { + continue; + } + + // 非mavis搜索词过滤 + if (filterPathList.contains(m_searchBoxStruct.fullPagePath)) { + continue; + } + + // follow path module name to get actual module name -> Left module dispaly can support + // mulLanguages + m_searchBoxStruct.actualModuleName = + getModulesName(m_searchBoxStruct.fullPagePath.section('/', 1, 1)); + + // 插件不存在,跳过该插件的搜索项 + if ( m_searchBoxStruct.actualModuleName.isEmpty()) + continue; + + if ((!g_file_test("/usr/sbin/ksc-defender", G_FILE_TEST_EXISTS) && m_searchBoxStruct.fullPagePath.contains("securitycenter",Qt::CaseInsensitive)) + || (!isCommunity() && m_searchBoxStruct.fullPagePath.contains("update")) ){ + break; + } +#ifndef __sw_64__ + if(m_searchBoxStruct.fullPagePath.contains("Change valid",Qt::CaseInsensitive)) { + break; + } +#endif + QJsonObject bodyJson; + bodyJson.insert("plugin", m_searchBoxStruct.fullPagePath.section('/', 1, 1)); + bodyJson.insert("plugin" + m_lang, m_searchBoxStruct.actualModuleName); + bodyJson.insert("subEnglish", m_searchBoxStruct.fullPagePath.section('/', 2, 2)); + bodyJson.insert("sub" + m_lang, m_searchBoxStruct.translateContent); + bodyJson.insert("superordinate", getModuleType(m_searchBoxStruct.fullPagePath.section('/', 1, 1))); + searchItems.append(bodyJson); + clearSearchData(); + } + } else { + // qDebug() << " QXmlStreamReader::Characters with whitespaces."; + } + break; + case QXmlStreamReader::EndElement: +#if DEBUG_XML_SWITCH + qDebug() << " [SearchWidget] -::EndElement: " << xmlRead.name(); +#endif + break; + default: + break; + } + } + m_xmlExplain = ""; + clearSearchData(); + file.close(); + } + rootobj.insert("ukcc", searchItems); + QJsonDocument document; + document.setObject(rootobj); + QByteArray byteArray = document.toJson(QJsonDocument::Indented); + QString strJson(byteArray); + + QVariantMap searchMap = rootobj.toVariantMap(); + + return searchMap; +} + +void ukccSessionServer::clearSearchData() +{ + m_searchBoxStruct.translateContent = ""; + m_searchBoxStruct.actualModuleName = ""; + m_searchBoxStruct.childPageName = ""; + m_searchBoxStruct.fullPagePath = ""; +} + +void ukccSessionServer::LoadPlugin() +{ + QDir pluginsDir = QDir(PLUGIN_INSTALL_DIRS); + qDebug() << pluginsDir; + foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { + determinePlugin(fileName, pluginsDir); + } + QDir updatePluginDir = QDir(PLUGIN_INSTALL_UPDATE); + foreach (QString fileName, updatePluginDir.entryList(QDir::Files)) { + + determinePlugin(fileName, updatePluginDir); + } +} + +void ukccSessionServer::determinePlugin(const QString &fileName, const QDir &dir) +{ + QString pluginPath = dir.absoluteFilePath(fileName); + qInfo() << "loading" << fileName; + if (!fileName.endsWith(".so")) { + return; + } + + QPluginLoader loader(pluginPath); + QObject * plugin = loader.instance(); + if (plugin) { + CommonInterface * pluginInstance = qobject_cast(plugin); + // 插件是否启用 + if (!pluginInstance || !pluginInstance->isEnable() || !fileName.endsWith("so")) { + return; + } + addModulesName(pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->translationPath(), pluginInstance->pluginTypes()); + } else { + //如果加载错误且文件后缀为so,输出错误 + if (fileName.endsWith(".so")) + qDebug() << fileName << "Load Failed: " << loader.errorString() << "\n"; + } +} + +bool ukccSessionServer::isOpenkylin() +{ + QString systemName = QString(QLatin1String(kdk_system_get_systemName())); + if (systemName.compare("openkylin", Qt::CaseInsensitive) == 0) { + return true; + } + return false; +} + +bool ukccSessionServer::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; +} + +void ukccSessionServer::addModulesName(QString moduleName, QString searchName, QString translation, int type) { + QPair data; + data.first = moduleName; + data.second = searchName; + QPair, int> pluginNameAndtype; + pluginNameAndtype.first = data; + pluginNameAndtype.second = type; + m_moduleNameList.append(pluginNameAndtype); + + if (!translation.isEmpty()) { + m_xmlFilePath.insert(translation); + } +} + +QString ukccSessionServer::getModulesName(QString name, bool state) +{ + QString strResult = ""; + + for (auto it : m_moduleNameList) { + if (state) { //true : follow first search second (use pathName translate to actual moduleName) + if (it.first.first == name) { + strResult = it.first.second; + break; + } + } else { //false : follow second search first (use actual moduleName translate to pathName) + if (it.first.second == name) { + strResult = it.first.first; + break; + } + } + } + + return strResult; +} + +QString ukccSessionServer::getModuleType(QString name) +{ + int moduleType = TOTALMODULES; + + for (auto it : m_moduleNameList) { + if (it.first.first == name) { + moduleType = it.second; + break; + } + } + QString pluginType = ""; + switch (moduleType) { + case SYSTEM: + pluginType = "system"; + break; + case ACCOUNT: + pluginType = "account"; + break; + case DEVICES: + pluginType = "devices"; + break; + case NETWORK: + pluginType = "network"; + break; + case PERSONALIZED: + pluginType = "personalized"; + break; + case DATETIME: + pluginType = "datetime"; + break; + case UPDATE: + pluginType = "update"; + break; + case SECURITY: + pluginType = "security"; + break; + case APPLICATION: + pluginType = "application"; + break; + case SEARCH_F: + pluginType = "search"; + break; + case TOTALMODULES: + pluginType = "Specified"; + break; + default: + break; + } + return pluginType; +} + diff --git a/registeredSession/ukccsessionserver.h b/registeredSession/ukccsessionserver.h index c4b08e8..a65bce0 100644 --- a/registeredSession/ukccsessionserver.h +++ b/registeredSession/ukccsessionserver.h @@ -11,13 +11,29 @@ #include #include #include +#include +#include +#include +#include +#include #include "json.h" #include "screenStruct.h" +#include "../shell/interface.h" + using QtJson::JsonObject; using QtJson::JsonArray; +const QString XML_Source = "source"; +const QString XML_Title = "translation"; +const QString XML_Numerusform = "numerusform"; +const QString XML_Explain_Path = "extra-contents_path"; + +extern "C" { +#include +} + class ukccSessionServer : public QObject { Q_OBJECT @@ -27,20 +43,44 @@ public: private: QMap getJsonInfo(const QString &confFile); + void monitoFileChanged(); + void clearSearchData(); + bool isOpenkylin(); + bool isCommunity(); + void addModulesName(QString moduleName, QString searchName, QString translation, int type); + QString getModulesName(QString name, bool state = true); + QString getModuleType(QString name); + void LoadPlugin(); + void determinePlugin(const QString &fileName, const QDir &dir); private: QString mScreenMode; QVariantList mPreScreenCfg; QString mFilePath; + struct SearchBoxStruct { + QString translateContent; + QString actualModuleName; + QString childPageName; + QString fullPagePath; + }; + SearchBoxStruct m_searchBoxStruct; + QString m_xmlExplain; + QString m_lang; + QList, int>> m_moduleNameList; + QSet m_xmlFilePath; + Q_SIGNALS: void configChanged(); void screenChanged(QString status); + void searchItemsAdd(QVariantMap addItems); + void searchItemsDelete(QVariantMap deleteItems); public Q_SLOTS: void exitService(); void ReloadSecurityConfig(); QVariantMap getModuleHideStatus(); + QVariantMap getSearchItems(); QString GetSecurityConfigPath(); QString getScreenMode(); void setScreenMode(QString screenMode); diff --git a/registeredSession/universalinterface.cpp b/registeredSession/universalinterface.cpp new file mode 100644 index 0000000..0e6861b --- /dev/null +++ b/registeredSession/universalinterface.cpp @@ -0,0 +1,87 @@ +#include "universalinterface.h" +#include + +static UniversalInterface *s_globalInstance = nullptr; + +UniversalInterface* UniversalInterface::self() +{ + if (!s_globalInstance) { + s_globalInstance = new UniversalInterface(); + } + return s_globalInstance; +} + +UniversalInterface::UniversalInterface() +{ + +} + +UniversalInterface::~UniversalInterface() +{ + if (s_globalInstance) { + delete s_globalInstance; + s_globalInstance = nullptr; + } + if (mUkccPanelGsettings) { + delete mUkccPanelGsettings; + mUkccPanelGsettings = nullptr; + } + if (mUkuiStyleGsettings) { + delete mUkuiStyleGsettings; + mUkuiStyleGsettings = nullptr; + } + if (mAccountUserDbus) { + delete mAccountUserDbus; + mAccountUserDbus = nullptr; + } + if (mFcitxInputMethodDbus) { + delete mFcitxInputMethodDbus; + mFcitxInputMethodDbus = nullptr; + } +} + +QGSettings* UniversalInterface::ukccPanelGsettings() +{ + if (!mUkccPanelGsettings) { + const QByteArray id(UKCC_ID); + if (QGSettings::isSchemaInstalled(id)) { + mUkccPanelGsettings = new QGSettings(id, QByteArray()); + } + } + return mUkccPanelGsettings; +} + +QGSettings* UniversalInterface::ukuiStyleGsettings() +{ + if (!mUkuiStyleGsettings) { + const QByteArray id(UKUI_STYLE_ID); + if (QGSettings::isSchemaInstalled(id)) { + mUkuiStyleGsettings = new QGSettings(id, QByteArray()); + } + } + return mUkuiStyleGsettings; +} + +QDBusInterface* UniversalInterface::accountUserDbus() +{ + if (!mAccountUserDbus) { + unsigned int uid = getuid(); + QString objpath = QString("/org/freedesktop/Accounts/User") + QString::number(uid); + mAccountUserDbus = new QDBusInterface("org.freedesktop.Accounts", + objpath, + "org.freedesktop.Accounts.User", + QDBusConnection::systemBus()); + } + return mAccountUserDbus; +} + +QDBusInterface* UniversalInterface::fcitxInputMethodDbus() +{ + if (!mFcitxInputMethodDbus) { + mFcitxInputMethodDbus = new QDBusInterface("org.fcitx.Fcitx", + "/inputmethod", + "org.fcitx.Fcitx.InputMethod", + QDBusConnection::sessionBus()); + } + return mFcitxInputMethodDbus; +} diff --git a/registeredSession/universalinterface.h b/registeredSession/universalinterface.h new file mode 100644 index 0000000..3b26758 --- /dev/null +++ b/registeredSession/universalinterface.h @@ -0,0 +1,59 @@ +#ifndef UNIVERSALINTERFACE_H +#define UNIVERSALINTERFACE_H +#include +#include +#include + +class UniversalInterface +{ +public: + UniversalInterface(); + ~UniversalInterface(); + + /** + * @brief 获取通用接口类的实例 + * + * @return UniversalInterface + */ + static UniversalInterface *self(); + + /** + * @brief 获取org.ukui.control-center.panel.plugins的gsetting + * + * @return QGSettings + */ + QGSettings *ukccPanelGsettings(); + + /** + * @brief 获取org.ukui.style的gsetting + * + * @return QGSettings + */ + QGSettings *ukuiStyleGsettings(); + + /** + * @brief 获取当前用户的org.freedesktop.Accounts.User接口 + * + * @return QDBusInterface + */ + QDBusInterface *accountUserDbus(); + + /** + * @brief 获取org.fcitx.Fcitx.InputMethod接口 + * + * @return QDBusInterface + */ + QDBusInterface *fcitxInputMethodDbus(); + +private: + const QByteArray UKCC_ID = QByteArray("org.ukui.control-center.panel.plugins"); + const QByteArray UKUI_STYLE_ID = QByteArray("org.ukui.style"); + +private: + QGSettings *mUkccPanelGsettings = nullptr; + QGSettings *mUkuiStyleGsettings = nullptr; + QDBusInterface *mAccountUserDbus = nullptr; + QDBusInterface *mFcitxInputMethodDbus = nullptr; +}; + +#endif // UNIVERSALINTERFACE_H diff --git a/shell/customstyle.cpp b/shell/customstyle.cpp index 0e70cb3..c58e458 100644 --- a/shell/customstyle.cpp +++ b/shell/customstyle.cpp @@ -22,19 +22,19 @@ void InternalStyle::drawControl(QStyle::ControlElement element, const QStyleOpti case CE_ShapedFrame: { //return proxy()->drawPrimitive(PE_Frame, option, painter, widget); QStyleOptionFrame frame = *qstyleoption_cast(option); + frame.lineWidth = 0; QFrame::Shape shape = frame.frameShape; switch (shape) { case QFrame::Box: { // Draw four rounded corners - painter->save(); painter->setRenderHint(QPainter::Antialiasing, true); painter->setBrush(option->palette.color(QPalette::Base)); + painter->setPen(Qt::transparent); -// painter->setOpacity(0.45); - painter->drawRoundedRect(widget->rect(), 6, 6); + QRect rect = widget->rect(); + painter->drawRoundedRect(rect.x() + 1, rect.y() + 1, rect.width() - 2, rect.height() - 2, 6, 6); painter->restore(); - qobject_cast< QFrame *>(const_cast(widget))->setLineWidth(0); return; } case QFrame::HLine: { @@ -129,7 +129,7 @@ void InternalStyle::polish(QPalette &pal) void InternalStyle::polish(QWidget *widget) { QProxyStyle::polish(widget); - if (qobject_cast(widget) && !qobject_cast(widget)) { + if (qobject_cast(widget) && !qobject_cast(widget)) { QPalette paltte = widget->palette(); paltte.setColor(QPalette::Window, paltte.base().color()); widget->setPalette(paltte); diff --git a/shell/homepagewidget.cpp b/shell/homepagewidget.cpp index 692e260..10c9f1c 100644 --- a/shell/homepagewidget.cpp +++ b/shell/homepagewidget.cpp @@ -34,9 +34,9 @@ #include "mainwindow.h" #include "utils/keyvalueconverter.h" #include "utils/functionselect.h" -#include "./utils/utils.h" -#include "widgets/FlowLayout/flowlayout.h" -#include "widgets/Label/tristatelabel.h" +#include "interface/common.h" +#include "flowlayout.h" +#include "tristatelabel.h" #define STYLE_FONT_SCHEMA "org.ukui.style" @@ -47,7 +47,6 @@ HomePageWidget::HomePageWidget(QWidget *parent) : ui(new Ui::HomePageWidget) { qApp->installEventFilter(this); -// this->setAutoFillBackground(true); ui->setupUi(this); // 获取主窗口 this->setParent(parent); @@ -57,7 +56,6 @@ HomePageWidget::HomePageWidget(QWidget *parent) : initUI(); ui->scrollArea->viewport()->setAttribute(Qt::WA_TranslucentBackground); ui->scrollArea->setStyleSheet("QScrollArea{background-color: transparent;}"); - ui->scrollArea->viewport()->setStyleSheet("background-color: transparent;"); ui->scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove", false); ui->scrollArea->verticalScrollBar()->setVisible(false); @@ -72,7 +70,7 @@ HomePageWidget::~HomePageWidget() void HomePageWidget::initUI() { FlowLayout * flowLayout = new FlowLayout(ui->widget_2, true, 0); flowLayout->setContentsMargins(70, 0, 70, 0); - mModuleMap = Utils::getModuleHideStatus(); + mModuleMap = Common::getModuleHideStatus(); //构建枚举键值转换对象 KeyValueConverter * kvConverter = new KeyValueConverter(); //继承QObject,No Delete @@ -92,18 +90,18 @@ void HomePageWidget::initUI() { QString modulenameString = kvConverter->keycodeTokeystring(moduleIndex).toLower(); QString modulenamei18nString = kvConverter->keycodeTokeyi18nstring(moduleIndex); if ((mModuleMap.keys().contains(modulenameString) && !mModuleMap[modulenameString].toBool()) - || (Utils::isTablet() && KexcludeModule.contains(modulenameString))) { + || (Common::isTablet() && KexcludeModule.contains(modulenameString))) { continue; } // pangw无安全模块-不显示 社区无更新和安全-不显示 - if (((modulenameString == "security" || modulenameString == "update") && Utils::isCommunity()) || - (modulenameString == "security" && Utils::isWayland())) { + if (((modulenameString == "security" || modulenameString == "update") + && (Common::isCommunity() || Common::isWayland()))) { continue; } - // openkylin 无安全和更新模块 - if (modulenameString == "security" || modulenameString == "update") { + // 下属无插件,不显示 + if (FunctionSelect::funcinfoListHomePage[moduleIndex].size() == 0) { continue; } @@ -254,9 +252,7 @@ void HomePageWidget::initUI() { QString firstFunc; QList tmpList = FunctionSelect::funcinfoListHomePage[moduleIndex]; for (FuncInfo tmpStruct : tmpList) { - QString sysVersion = "/etc/apt/ota_version"; - QFile file(sysVersion); - bool isIntel = file.exists(); + bool isIntel = Common::isTablet(); if ((isIntel && tmpStruct.namei18nString == "User Info") || (!isIntel && tmpStruct.namei18nString == "User Info Intel")) { @@ -275,6 +271,7 @@ void HomePageWidget::initUI() { if (moduleMap.keys().contains(tmpStruct.namei18nString)) { if (mModuleMap.isEmpty() || mModuleMap[tmpStruct.nameString.toLower()].toBool()) { firstFunc = tmpStruct.namei18nString; + Common::buriedSettings(tmpStruct.nameString, nullptr, "clicked"); //跳转 pmainWindow->functionBtnClicked(moduleMap.value(firstFunc)); break; @@ -304,7 +301,7 @@ void HomePageWidget::initUI() { flowLayout->addWidget(baseWidget); } - connect(moduleSignalMapper, SIGNAL(mapped(QObject*)), pmainWindow, SLOT(functionBtnClicked(QObject*))); + connect(moduleSignalMapper, SIGNAL(mapped(QObject*)), pmainWindow, SLOT(pluginBtnClicked(QObject*))); } QGSettings *HomePageWidget::setGsettingsPath(QList list , QString name) diff --git a/shell/interface.h b/shell/interface.h index b01f4f7..6b3a0ee 100644 --- a/shell/interface.h +++ b/shell/interface.h @@ -23,6 +23,7 @@ #include #include #include +#include class QString; class QWidget; @@ -39,6 +40,7 @@ enum FunType { SECURITY, APPLICATION, SEARCH_F, + CURRENCY, //NOTICEANDTASKS, TOTALMODULES, }; @@ -54,16 +56,10 @@ public: virtual bool isEnable() const = 0; // 插件是否启用 virtual const QString name() const = 0; // 模块名称 virtual QString translationPath() const { // 获取多语言文件路径,用于搜索 - return QStringLiteral(":/i18n/%1.ts"); + return QStringLiteral("/usr/share/ukui-control-center/shell/res/i18n/%1.ts"); } - QPushButton *pluginBtn = nullptr; + QStandardItem *pluginBtn = nullptr; - bool isIntel() const - { - QString sysVersion = "/etc/apt/ota_version"; - QFile file(sysVersion); - return file.exists(); - } virtual void plugin_leave() { return ; } diff --git a/shell/main.cpp b/shell/main.cpp index 3820a56..cf35279 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -43,7 +43,7 @@ #include "framelessExtended/framelesshandle.h" #include "customstyle.h" -#include "utils/utils.h" +#include "interface/common.h" #include "utils/xatom-helper.h" const QString KLong = "Loongson"; @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - if (Utils::getCpuInfo().startsWith(KLong, Qt::CaseInsensitive)) { + if (Common::getCpuInfo().startsWith(KLong, Qt::CaseInsensitive)) { QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); } @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } else { //控制面板是否被禁用 - if (Utils::isTablet()) { + if (Common::isTablet()) { QString m_initPath = QString("%1/%2/%3").arg(QDir::homePath()).arg(".cache/ukui-menu").arg("ukui-menu.ini"); QSettings settings(m_initPath, QSettings::IniFormat); settings.beginGroup("application"); @@ -119,11 +119,10 @@ int main(int argc, char *argv[]) parser.addOption(moduleOption_p); parser.process(a); - const QString &reqModule = parser.value(moduleOption); - MainWindow w; mainWindow = &w; -// Utils::centerToScreen(&w); + if (!Common::isOpenkylin()) + Common::centerToScreen(&w); w.setAttribute(Qt::WA_TranslucentBackground); @@ -137,4 +136,3 @@ int main(int argc, char *argv[]) return a.exec(); } } - diff --git a/shell/mainwindow.cpp b/shell/mainwindow.cpp index 1ae6c7f..45bc948 100644 --- a/shell/mainwindow.cpp +++ b/shell/mainwindow.cpp @@ -21,10 +21,9 @@ #include "ui_mainwindow.h" #include "utils/keyvalueconverter.h" #include "utils/functionselect.h" -#include "utils/utils.h" -#include "widgets/ImageUtil/imageutil.h" +#include "interface/common.h" +#include "imageutil.h" #include "ukccabout.h" -#include "devicesmonitor.h" #include #include @@ -46,10 +45,10 @@ #include #include "component/leftwidgetitem.h" #include "iconbutton.h" -#include "widgets/Label/lightlabel.h" +#include "lightlabel.h" +#include "../../shell/customstyle.h" -#define STYLE_FONT_SCHEMA "org.ukui.style" -#define THEME_QT_SCHEMA "org.ukui.style" +#define THEME_QT_SCHEMA "org.ukui.style" #ifdef WITHKYSEC #include @@ -77,7 +76,6 @@ extern "C" { const int dbWitdth = 50; extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); - MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), @@ -85,11 +83,10 @@ MainWindow::MainWindow(QWidget *parent) : { mate_mixer_init(); qApp->installEventFilter(this); + qApp->setStyle(new InternalStyle("ukui")); is_ExitPower = isExitsPower(); - connect(WindowManager::self(),&WindowManager::windowAdded,this,[=](const WindowId& windowId){ - /*注意: - * 最新创建的窗体被设置为操作窗体,此demo中每个按钮对应一个接口函数调用,所有接口函数操作的窗口都是该最新创建的窗体 - */ + if (Common::isOpenkylin()) { + connect(WindowManager::self(),&WindowManager::windowAdded,this,[=](const WindowId& windowId){ if (getpid() == WindowManager::getPid(windowId)) { m_listWinIds.append(windowId); } @@ -99,6 +96,8 @@ MainWindow::MainWindow(QWidget *parent) : m_listWinIds.removeOne(windowId); } }); + } + initUI(); hideComponent(); } @@ -113,12 +112,13 @@ MainWindow::~MainWindow() for (it = moduleMap.constBegin(); it != moduleMap.constEnd(); ++it) { CommonInterface *pluginInstance = qobject_cast(it.value()); if (pluginInstance) { + qInfo()<<"~exit && delete-plugin:"<name(); delete pluginInstance; pluginInstance = nullptr; } } } - + qInfo()<<"~exit ukui-control-center"; delete ui; ui = nullptr; } @@ -139,12 +139,15 @@ void MainWindow::bootOptionsFilter(QString opt, bool firstIn) { } } } + if (!isExitsModule) { //避免无限循环的风险 - if (Utils::isTablet() && firstIn) { - bootOptionsFilter("userinfointel", false); + if (Common::isTablet()) { + if (firstIn) { + bootOptionsFilter("userinfointel", false); + } + backBtn->hide(); } - backBtn->hide(); return ; } @@ -173,7 +176,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) { } } if (watched == scrollArea) { - if (!Utils::isTablet()) { + if (!Common::isTablet()) { if (event->type() == QEvent::Enter) { scrollArea->verticalScrollBar()->setVisible(true); } else if (event->type() == QEvent::Leave) { @@ -229,7 +232,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) { } else if (watched == homepageWidget) { if (event->type() == QEvent::Paint) { QTimer::singleShot(1, this, [=]() { - if (!Utils::isTablet()) { + if (!Common::isTablet()) { m_searchWidget->setFixedWidth(350 > mOptionBtn->x() - titleLabel->x() - titleLabel->width() ? (mOptionBtn->x() - m_searchWidget->x() - 16) : 350); } }); @@ -248,26 +251,29 @@ void MainWindow::keyPressEvent(QKeyEvent *event) void MainWindow::initUI() { ui->setupUi(this); - QRect screenSize = Utils::sizeOnCursor(); + QRect screenSize = Common::sizeOnCursor(); this->setMinimumSize(978, 630); if (screenSize.width() > 1440) this->resize(1160,720); - m_ModuleMap = Utils::getModuleHideStatus(); + m_ModuleMap = Common::getModuleHideStatus(); const QByteArray id("org.ukui.style"); m_fontSetting = new QGSettings(id, QByteArray(), this); connect(m_fontSetting, &QGSettings::changed, this, [=](QString key) { - if ("systemFont" == key || "systemFontSize" ==key) { - changeSearchSlot(); + if ("systemFont" == key || "systemFontSize" == key) { QFont font = this->font(); int width = font.pointSize(); for (auto widget : qApp->allWidgets()) { QString className(widget->metaObject()->className()); if (widget->objectName() == "timeClockLable") { QFont fontTime; - fontTime.setBold(true); fontTime.setWeight(QFont::Medium); - fontTime.setPixelSize(font.pointSize() * 28 / 11); + fontTime.setBold(true); + if (QLocale::system().amText() == "སྔ་དྲོ་") { + fontTime.setPixelSize(m_fontSetting->get("systemFontSize").toInt() * 20 / 11); + } else { + fontTime.setPixelSize(font.pointSize() * 28 / 11); + } widget->setFont(fontTime); } else if(widget->objectName() == "DateTime_Info") { QFont fontTitle; @@ -292,7 +298,8 @@ void MainWindow::initUI() { kvConverter = new KeyValueConverter(); //继承QObject,No Delete //加载插件 - loadPlugins(); + loadPlugins(); + connect(minBtn, SIGNAL(clicked()), this, SLOT(showMinimized())); connect(maxBtn, &QPushButton::clicked, this, [=] { @@ -315,7 +322,9 @@ void MainWindow::initUI() { mTitleIcon->setHidden(true); ui->leftsidebarWidget->setVisible(true); //左上角显示字符/返回按钮 - backBtn->setVisible(true); + if (!is_tabletmode) { + backBtn->setVisible(true); + } ui->stackedWidget->status = false; ui->titleWidget->status = false; } else { //首页部分组件样式 @@ -356,8 +365,10 @@ void MainWindow::initUI() { }); connect(modulepageWidget, &ModulePageWidget::hScrollBarShow, this, [=]() { QTimer::singleShot(1, this, [=]() { - if (m_searchWidget->width() > backBtn->x() - mOptionBtn->x()) { - m_searchWidget->setFixedWidth(mOptionBtn->x() - backBtn->x() - mOptionBtn->width() - 16); + if (!Common::isTablet()) { + if (m_searchWidget->width() > backBtn->x() - mOptionBtn->x()) { + m_searchWidget->setFixedWidth(mOptionBtn->x() - backBtn->x() - mOptionBtn->width() - 16); + } } }); }); @@ -390,16 +401,31 @@ void MainWindow::initUI() { }); } } + + //监听平板模式切换 + m_statusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", + "/", + "com.kylin.statusmanager.interface", + QDBusConnection::sessionBus(),this); + if (m_statusSessionDbus->isValid()) { + QDBusReply tabletmode = m_statusSessionDbus->call("get_current_tabletmode"); + is_tabletmode = tabletmode; + mainWindow_statusDbusSlot(is_tabletmode); + connect(m_statusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mainWindow_statusDbusSlot(bool))); + + } else { + qDebug() << "Create statusmanager Interface Failed When : " << QDBusConnection::systemBus().lastError(); + } } void MainWindow::initTileBar() { - QLabel *logoSetLabel = new QLabel(this); + mLogoSetLabel = new QLabel(this); QLabel *textSetLable = new QLabel(this); - ui->leftTopWidget->layout()->addWidget(logoSetLabel); + ui->leftTopWidget->layout()->addWidget(mLogoSetLabel); ui->leftTopWidget->layout()->addWidget(textSetLable); - logoSetLabel->setFixedSize(24,24); - logoSetLabel->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(24,24).toImage())); + mLogoSetLabel->setFixedSize(24,24); + mLogoSetLabel->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(24,24).toImage())); const QByteArray id(THEME_QT_SCHEMA); QGSettings *mQtSettings = new QGSettings(id, QByteArray(), this); @@ -409,7 +435,7 @@ void MainWindow::initTileBar() { titleLayout = new QHBoxLayout(ui->titleWidget); ui->titleWidget->setLayout(titleLayout); ui->titleWidget->setObjectName("titleWidget"); - titleLayout->setContentsMargins(8, 4, 4, 0); + titleLayout->setContentsMargins(8, 2, 5, 2); titleLayout->setSpacing(0); m_searchWidget = new SearchWidget(this); m_searchWidget->setFocusPolicy(Qt::ClickFocus); @@ -428,9 +454,12 @@ void MainWindow::initTileBar() { queryWidLayout->setSpacing(0); m_queryWid->setLayout(queryWidLayout); - QIcon searchIcon = QIcon::fromTheme("edit-find-symbolic"); + QIcon searchIcon = QIcon::fromTheme("search-symbolic"); m_queryIcon = new QLabel(this); - m_queryIcon->setPixmap(searchIcon.pixmap(searchIcon.actualSize(QSize(16, 16)))); + m_queryIcon->setScaledContents(true); + m_queryIcon->setPixmap(searchIcon.pixmap(QSize(16, 16))); + m_queryIcon->setFixedSize(QSize(16, 16)); + m_queryIcon->setProperty("useIconHighlightEffect",0x02); m_queryText = new QLabel(this); @@ -456,9 +485,9 @@ void MainWindow::initTileBar() { mTitleIcon = new QLabel(this); titleLabel = new QLabel(tr("Settings"), this); - backBtn->setFixedSize(30, 30); + backBtn->setFixedSize(36, 36); mOptionBtn->setFixedSize(30, 30); - if (Utils::isTablet()) { + if (Common::isTablet()) { minBtn->setFixedSize(48, 48); maxBtn->setFixedSize(48, 48); closeBtn->setFixedSize(48, 48); @@ -478,41 +507,19 @@ void MainWindow::initTileBar() { minBtn->setToolTip(tr("Minimize")); maxBtn->setToolTip(tr("Maximize")); closeBtn->setToolTip(tr("Close")); - - if (Utils::isTablet()) { - //监听平板模式切换 - m_statusSessionDbus = new QDBusInterface("com.kylin.statusmanager.interface", - "/", - "com.kylin.statusmanager.interface", - QDBusConnection::sessionBus(),this); - if (m_statusSessionDbus->isValid()) { - is_tabletmode = m_statusSessionDbus->call("get_current_tabletmode"); - if (is_tabletmode) { - minBtn->hide(); - maxBtn->hide(); - closeBtn->hide(); - } else { - minBtn->show(); - maxBtn->show(); - closeBtn->show(); - } - connect(m_statusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(mainWindow_statusDbusSlot(bool))); - } else { - qDebug() << "Create statusmanager Interface Failed When : " << QDBusConnection::systemBus().lastError(); - } - } - - QIcon titleIcon = QIcon::fromTheme("ukui-control-center"); - mTitleIcon->setPixmap(titleIcon.pixmap(titleIcon.actualSize(QSize(24, 24)))); + m_titleIcon = QIcon::fromTheme("ukui-control-center"); + mTitleIcon->setPixmap(m_titleIcon.pixmap(m_titleIcon.actualSize(QSize(24, 24)))); connect(mQtSettings, &QGSettings::changed, this, [=](QString key) { if (key == "iconThemeName") { - logoSetLabel->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(24,24).toImage())); + mLogoSetLabel->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(24,24).toImage())); mTitleIcon->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(24,24).toImage())); } + if (key == "styleName") { + qApp->setStyle(new InternalStyle("ukui")); + } }); - changeSearchSlot(); m_searchWidget->setFixedWidth(350); titleLayout->addWidget(mTitleIcon); @@ -542,15 +549,55 @@ void MainWindow::animationFinishedSlot() void MainWindow::mainWindow_statusDbusSlot(bool tablet_mode) { - if(tablet_mode){ - minBtn->hide(); + is_tabletmode = tablet_mode; + if (tablet_mode) { + + ui->leftTopWidget->layout()->setContentsMargins(16, 0, 0, 0); + ui->leftTopWidget->setFixedHeight(64); + ui->titleWidget->setFixedHeight(64); + mLogoSetLabel->setFixedSize(32,32); + mLogoSetLabel->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(32,32).toImage())); + + mTitleIcon->setFixedSize(32, 32); + mTitleIcon->setPixmap(m_titleIcon.pixmap(m_titleIcon.actualSize(QSize(32, 32)))); + + titleLayout->setContentsMargins(16, 0, 8, 0); + + if (ui->stackedWidget->currentIndex() == -1 || ui->stackedWidget->currentIndex() == 0) { + this->bootOptionsFilter("userinfo", true); + } + backBtn->hide(); + + mOptionBtn->setFixedSize(48, 48); + minBtn->setFixedSize(48, 48); maxBtn->hide(); - closeBtn->hide(); + closeBtn->setFixedSize(48, 48); + + m_searchWidget->setFixedHeight(40); } else { - minBtn->show(); + ui->leftTopWidget->layout()->setContentsMargins(8, 0, 0, 0); + ui->leftTopWidget->setFixedHeight(40); + ui->titleWidget->setFixedHeight(40); + mLogoSetLabel->setFixedSize(24,24); + mLogoSetLabel->setPixmap(QPixmap::fromImage(QIcon::fromTheme("ukui-control-center").pixmap(24,24).toImage())); + + mTitleIcon->setFixedSize(24, 24); + mTitleIcon->setPixmap(m_titleIcon.pixmap(m_titleIcon.actualSize(QSize(24, 24)))); + + titleLayout->setContentsMargins(8, 2, 5, 2); + if (ui->stackedWidget->currentIndex() == 1) { + backBtn->show(); + } + + mOptionBtn->setFixedSize(30, 30); + minBtn->setFixedSize(30, 30); maxBtn->show(); - closeBtn->show(); + closeBtn->setFixedSize(30, 30); + + m_searchWidget->setFixedHeight(36); } + emit tabletModeChanged(tablet_mode); + qApp->setStyle(new InternalStyle("ukui")); } void MainWindow::onF1ButtonClicked() { @@ -577,12 +624,12 @@ void MainWindow::initUkccAbout() { connect(ukccExit, SIGNAL(triggered()), this, SLOT(close())); - connect(ukccAbout, &QAction::triggered, this, [=] { + connect(ukccAbout, &QAction::triggered, this, [=] { KAboutDialog *ukcc = new KAboutDialog(this); ukcc->setAppIcon(QIcon::fromTheme("ukui-control-center")); ukcc->setAppName(tr("Settings")); - ukcc->setAppVersion(Utils::getUkccVersion()); - ukcc->setAppSupport(""); + ukcc->setAppVersion(Common::getUkccVersion()); + ukcc->setAppSupport(Common::isOpenkylin() ? "" : ukcc->appSupport()); ukcc->exec(); }); @@ -610,73 +657,86 @@ void MainWindow::setBtnLayout(QPushButton * &pBtn) { pBtn->setLayout(baseVerLayout); } -void MainWindow::loadPlugins(){ +void MainWindow::loadPlugins() +{ for (int index = 0; index < TOTALMODULES; index++){ QMap pluginsMaps; modulesList.append(pluginsMaps); } - static bool installed = (QCoreApplication::applicationDirPath() == QDir(("/usr/bin")).canonicalPath()); - - if (installed) + bool installed = (QCoreApplication::applicationDirPath() == QDir(("/usr/bin")).canonicalPath()); + if (installed) { pluginsDir = QDir(PLUGIN_INSTALL_DIRS); - else { + } else { pluginsDir = QDir(qApp->applicationDirPath() + "/plugins"); } + loadUpdatePlugins(); + foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { - - //三权分立开启 -#ifdef WITHKYSEC - if (!kysec_is_disabled() && kysec_get_3adm_status() && (getuid() || geteuid())){ - //时间和日期 | 用户帐户 | 电源管理 |网络连接 |网络代理 - if (fileName.contains("datetime") || fileName.contains("userinfo") || fileName.contains("power") || \ - fileName.contains("netconnect") || fileName.contains("proxy") || fileName.contains("update") || \ - fileName.contains("upgrade") || fileName.contains("backup") || fileName.contains("vino") || - fileName.contains("printer") || fileName.contains("bluetooth", Qt::CaseInsensitive) || fileName.contains("mobilehotspot", Qt::CaseInsensitive) || - fileName.contains("vpn") || fileName.contains("autoboot") || fileName.contains("wlanconnect") || - fileName.contains("projection") || fileName.contains("area")) - continue; - } -#endif - qDebug() << "Scan Plugin: " << fileName; - if (!fileName.endsWith(".so") || - ("libpower.so" == fileName && !is_ExitPower)) { - continue; - } -#ifdef __sw_64__ - if ("libpower.so" == fileName) { - continue; - } -#endif - - QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); - QObject * plugin = loader.instance(); - if (plugin) { - CommonInterface * pluginInstance = qobject_cast(plugin); - // 插件是否启用 - if (!pluginInstance || !pluginInstance->isEnable() || !fileName.endsWith("so")) { - continue; - } - - modulesList[pluginInstance->pluginTypes()].insert(pluginInstance->plugini18nName(), plugin); - - qDebug() << "Load Plugin :" << kvConverter->keycodeTokeyi18nstring(pluginInstance->pluginTypes()) << "->" << pluginInstance->plugini18nName() ; - - m_searchWidget->addModulesName(pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->translationPath()); - - int moduletypeInt = pluginInstance->pluginTypes(); - if (!moduleIndexList.contains(moduletypeInt)) - moduleIndexList.append(moduletypeInt); - } else { - //如果加载错误且文件后缀为so,输出错误 - if (fileName.endsWith(".so")) - qDebug() << fileName << "Load Failed: " << loader.errorString() << "\n"; + if (!m_updatePlugins.contains(fileName)) { + determinePlugin(fileName, pluginsDir); } } m_searchWidget->setLanguage(QLocale::system().name()); } +void MainWindow::loadUpdatePlugins() +{ + updatePluginDir = QDir(PLUGIN_INSTALL_UPDATE); + foreach (QString fileName, updatePluginDir.entryList(QDir::Files)) { + m_updatePlugins.append(fileName); + determinePlugin(fileName, updatePluginDir); + } +} + +void MainWindow::determinePlugin(const QString &fileName, const QDir &dir) +{ + QString pluginPath = dir.absoluteFilePath(fileName); + //三权分立开启 +#ifdef WITHKYSEC + if (!kysec_is_disabled() && kysec_get_3adm_status() && (getuid() || geteuid())){ + //时间和日期 | 用户帐户 | 电源管理 |网络连接 |网络代理 + if (fileName.contains("datetime") || fileName.contains("userinfo") || fileName.contains("power") || \ + fileName.contains("netconnect") || fileName.contains("proxy") || fileName.contains("update") || \ + fileName.contains("upgrade") || fileName.contains("backup") || fileName.contains("vino") || + fileName.contains("printer") || fileName.contains("bluetooth", Qt::CaseInsensitive) || fileName.contains("mobilehotspot", Qt::CaseInsensitive) || + fileName.contains("vpn") || fileName.contains("autoboot") || fileName.contains("wlanconnect") || + fileName.contains("projection") || fileName.contains("area")) + return; + } +#endif + qDebug() << "Scan Plugin: " << fileName; + if (!fileName.endsWith(".so") || + ("libpower.so" == fileName && !is_ExitPower)) { + return; + } + + QPluginLoader loader(pluginPath); + QObject * plugin = loader.instance(); + if (plugin) { + CommonInterface * pluginInstance = qobject_cast(plugin); + // 插件是否启用 + if (!pluginInstance || !pluginInstance->isEnable() || !fileName.endsWith("so")) { + return; + } + + modulesList[pluginInstance->pluginTypes()].insert(pluginInstance->plugini18nName(), plugin); + + qDebug() << "Load Plugin :" << kvConverter->keycodeTokeyi18nstring(pluginInstance->pluginTypes()) << "->" << pluginInstance->plugini18nName() ; + + m_searchWidget->addModulesName(pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->translationPath()); + + int moduletypeInt = pluginInstance->pluginTypes(); + if (!moduleIndexList.contains(moduletypeInt)) + moduleIndexList.append(moduletypeInt); + } else { + //如果加载错误且文件后缀为so,输出错误 + if (fileName.endsWith(".so")) + qDebug() << fileName << "Load Failed: " << loader.errorString() << "\n"; + } +} + void MainWindow::loadSpecifiedPlugin(QString pluginFullName) { QPluginLoader loader(pluginFullName); @@ -697,54 +757,24 @@ void MainWindow::loadSpecifiedPlugin(QString pluginFullName) } } -void MainWindow::initLeftsideBar(){ - - leftBtnGroup = new QButtonGroup(); - leftMicBtnGroup = new QButtonGroup(); - - scrollArea = new QScrollArea(ui->leftBotWidget); - scrollArea->horizontalScrollBar()->setVisible(false); - // scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - - QWidget *menuWidget = new QWidget(this); - QVBoxLayout *menuLayout = new QVBoxLayout(menuWidget); - menuLayout->setContentsMargins(8,0,0,8); - menuLayout->setSpacing(4); - - scrollArea->viewport()->setAttribute(Qt::WA_TranslucentBackground); - scrollArea->setStyleSheet("QScrollArea{background-color: transparent;}"); - scrollArea->viewport()->setStyleSheet("background-color: transparent;"); - scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove", false); - if (!Utils::isTablet()) { - scrollArea->verticalScrollBar()->setVisible(false); - } +void MainWindow::initLeftsideBar() +{ + scrollArea = new KNavigationBar(ui->leftBotWidget); connect(this,&MainWindow::specifiedPluginLoaded,this,[=](CommonInterface * pluginInstance){ int type = TOTALMODULES; - QWidget *typeWidget = new QWidget(menuWidget); - QHBoxLayout *typeLayout = new QHBoxLayout(typeWidget); - LightLabel *typeLabel = new LightLabel(typeWidget); - typeLayout->setContentsMargins(18,20,0,0); - typeLayout->addWidget(typeLabel); - typeLabel->setText(tr("Specified")); - menuLayout->addWidget(typeWidget); + QString typeName = tr("Specified"); - QPushButton *pluginBtn = buildLeftsideBtn(pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->icon()); - leftBtnGroup->addButton(pluginBtn, type); - pluginBtn->setProperty("useButtonPalette", true); + QStandardItem *specifiedPlugin = new QStandardItem(pluginInstance->icon(), pluginInstance->plugini18nName()); + QList secondList; + secondList << specifiedPlugin; + specifiedPlugin->setData(type, Qt::UserRole+1); + specifiedPlugin->setData(pluginInstance->plugini18nName(), Qt::UserRole+2); + scrollArea->addGroupItems(secondList, typeName); - QHBoxLayout *pluginLayout = new QHBoxLayout(); - menuLayout->addLayout(pluginLayout); - pluginLayout->setContentsMargins(0, 0, 0, 0); - pluginLayout->addWidget(pluginBtn); - pluginInstance->pluginBtn = pluginBtn; - connect(pluginBtn, &QPushButton::clicked, this, [=](){ - modulepageWidget->refreshPluginWidget(pluginInstance); - }); + pluginInstance->pluginBtn = specifiedPlugin; }); - - for(int type = 0; type < TOTALMODULES; type++) { //循环构建左侧边栏一级菜单按钮 if (moduleIndexList.contains(type)){ @@ -757,23 +787,12 @@ void MainWindow::initLeftsideBar(){ } } - QWidget *typeWidget = new QWidget(menuWidget); - QHBoxLayout *typeLayout = new QHBoxLayout(typeWidget); - LightLabel *typeLabel = new LightLabel(typeWidget); - if (type != 0) { - typeLayout->setContentsMargins(18,20,0,0); - } else { - typeLayout->setContentsMargins(18,10,0,0); - } - typeLayout->addWidget(typeLabel); - typeLabel->setText(mnamei18nString); - menuLayout->addWidget(typeWidget); - QMap moduleMap; moduleMap = this->exportModule(type); QVariantMap mModuleMap; - mModuleMap = Utils::getModuleHideStatus(); + mModuleMap = Common::getModuleHideStatus(); + QList secondList; QList functionStructList = FunctionSelect::funcinfoList[type]; for (int funcIndex = 0; funcIndex < functionStructList.size(); funcIndex++) { FuncInfo single = functionStructList.at(funcIndex); @@ -788,58 +807,66 @@ void MainWindow::initLeftsideBar(){ } } // intel与sp1做区分 - if ((Utils::isTablet() && single.nameString == "Userinfo") - || (!Utils::isTablet() && single.nameString == "Userinfointel")) { + if ((Common::isTablet() && single.nameString == "Userinfo") + || (!Common::isTablet() && single.nameString == "Userinfointel")) { continue; } //填充左侧菜单 CommonInterface * pluginInstance = qobject_cast(moduleMap.value(single.namei18nString)); - QPushButton *pluginBtn = buildLeftsideBtn(single.nameString, single.namei18nString, pluginInstance->icon()); - pluginBtn->setFlat(true); - leftBtnGroup->addButton(pluginBtn, type); - pluginBtn->setProperty("useButtonPalette", true); - - QHBoxLayout *pluginLayout = new QHBoxLayout(); - menuLayout->addLayout(pluginLayout); - pluginLayout->setContentsMargins(0, 0, 0, 0); -// pluginBtn->setStyleSheet("QPushButton:checked{background-color: palette(highlight);border-radius: 6px;}"); - - pluginLayout->addWidget(pluginBtn); - pluginInstance->pluginBtn = pluginBtn; + QStandardItem *pluginItem = new QStandardItem(pluginInstance->icon(), single.namei18nString); + secondList << pluginItem; + pluginItem->setData(type, Qt::UserRole+1); + pluginItem->setData(single.namei18nString, Qt::UserRole+2); + pluginInstance->pluginBtn = pluginItem; // 初始化插件状态 QGSettings *msettings = nullptr; + int row = scrollArea->model()->rowCount() + secondList.count(); if (homepageWidget->vecGsettins.contains(single.nameString)) { msettings = homepageWidget->vecGsettins[single.nameString]; if (msettings) { - pluginBtn->setVisible(msettings->get(SHOW_KEY).toBool()); - m_searchWidget->hiddenSearchItem(QLocale::system().name() == "zh_CN" ? single.namei18nString : single.nameString , msettings->get(SHOW_KEY).toBool()); + QTimer::singleShot(1, this, [=]() { + scrollArea->listview()->setRowHidden(row, !msettings->get(SHOW_KEY).toBool()); + m_searchWidget->hiddenSearchItem(single.namei18nString, msettings->get(SHOW_KEY).toBool()); + }); } } - // 监听该插件是否启用 if (msettings) { connect(msettings , &QGSettings::changed,[=](QString key){ if (key == SHOW_KEY) { - if ( !msettings->get(SHOW_KEY).toBool() && pluginBtn->isChecked()) { + if (!msettings->get(SHOW_KEY).toBool() && pluginItem->checkState() == Qt::Checked) { ui->stackedWidget->setCurrentIndex(0); } - pluginBtn->setVisible( msettings->get(SHOW_KEY).toBool()); - m_searchWidget->hiddenSearchItem(QLocale::system().name() == "zh_CN" ? single.namei18nString : single.nameString , msettings->get(SHOW_KEY).toBool()); + scrollArea->listview()->setRowHidden(row, !msettings->get(SHOW_KEY).toBool()); + m_searchWidget->hiddenSearchItem(single.namei18nString, msettings->get(SHOW_KEY).toBool()); } else { - m_searchWidget->hiddenSearchItem(QLocale::system().name() == "zh_CN" ? single.namei18nString : single.nameString , msettings->get(SHOW_KEY).toBool()); + m_searchWidget->hiddenSearchItem(single.namei18nString, msettings->get(SHOW_KEY).toBool()); } }); } - - connect(pluginBtn, &QPushButton::clicked, this, [=](){ - modulepageWidget->refreshPluginWidget(pluginInstance); - }); } + scrollArea->addGroupItems(secondList, mnamei18nString); } } - menuLayout->addStretch(); - scrollArea->setWidget(menuWidget); + + connect(scrollArea->listview(), &QListView::clicked, this, [=](const QModelIndex &index){ + QMap moduleMap; + moduleMap = this->exportModule(index.data(Qt::UserRole+1).toInt()); + qDebug() << "moduleMap = " << moduleMap; + qDebug() << "index = " << index.data(Qt::UserRole+2).toString(); + QString moduleName = index.data(Qt::UserRole+2).toString(); + + scrollArea->listview()->setCurrentIndex(index); + CommonInterface * pluginInstance = qobject_cast(moduleMap.value(moduleName)); + if (pluginInstance) { + modulepageWidget->refreshPluginWidget(pluginInstance); + + // 埋点点击左侧导航插件 + Common::buriedSettings(pluginInstance->name(), nullptr, QString("clicked")); + } + + }); ui->leftBotLayout->addWidget(scrollArea); } @@ -849,7 +876,7 @@ QPushButton * MainWindow::buildLeftsideBtn(QString bname,QString tipName, QIcon QPushButton * leftsidebarBtn = new QPushButton(); leftsidebarBtn->setAttribute(Qt::WA_DeleteOnClose); leftsidebarBtn->setCheckable(true); - if (Utils::isTablet()) { + if (Common::isTablet()) { leftsidebarBtn->setFixedSize(230,48); } else { leftsidebarBtn->setFixedSize(230,40); //一级菜单按钮显示的宽度 @@ -897,7 +924,7 @@ QPushButton * MainWindow::buildLeftsideBtn(QString bname,QString tipName, QIcon } else { textLabel->setText(tipName); } - const QByteArray styleID(STYLE_FONT_SCHEMA); + const QByteArray styleID(THEME_QT_SCHEMA); QGSettings *stylesettings = new QGSettings(styleID, QByteArray(), this); connect(stylesettings,&QGSettings::changed,[=](QString key) { @@ -1073,15 +1100,9 @@ void MainWindow::initStyleSheet() { closeBtn->setIcon(QIcon::fromTheme("window-close-symbolic")); } -void MainWindow::changeSearchSlot() { -// int fontSize = m_fontSetting->get("system-font-size").toInt(); -// m_searchWidget->setFixedHeight((fontSize - 11) * 2 + 32); -} - void MainWindow::showGuide(QString pluName) { QString service_name = "com.kylinUserGuide.hotel_" + QString::number(getuid()); - qDebug()< MainWindow::exportModule(int type) { return emptyMaps; } -void MainWindow::functionBtnClicked(QObject *plugin) { +void MainWindow::pluginBtnClicked(QObject *plugin) { + + CommonInterface * pluginInstance = qobject_cast(plugin); + Common::buriedSettings(pluginInstance->name(), nullptr, "clicked"); + + functionBtnClicked(plugin); +} + +void MainWindow::functionBtnClicked(QObject *plugin, QString jumpText) { if (!scrollArea) return; ui->stackedWidget->setCurrentIndex(1); - modulepageWidget->switchPage(plugin); + modulepageWidget->switchPage(plugin, true, jumpText); CommonInterface * pluginInstance = qobject_cast(plugin); - int value = pluginInstance->pluginBtn->pos().y() + pluginInstance->pluginBtn->height() - scrollArea->verticalScrollBar()->pageStep(); + scrollArea->listview()->setCurrentIndex(pluginInstance->pluginBtn->index()); + QRect size = scrollArea->listview()->visualRect(scrollArea->listview()->currentIndex()); + qDebug() << "size.y() = " <height()/2" << scrollArea->height()/2; + int value = size.y() + size.height() - scrollArea->height(); value = value + scrollArea->height()/2; //尽量让选中的显示在中间位置 if (value <= 0) { scrollArea->verticalScrollBar()->setValue(0); @@ -1156,25 +1188,25 @@ void MainWindow::functionBtnClicked(QObject *plugin) { void MainWindow::sltMessageReceived(const QString &msg) { QString platform = QGuiApplication::platformName(); - if(platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) { - if (!m_listWinIds.isEmpty()) { - WindowManager::activateWindow(m_listWinIds.back()); - } - } else { - KWindowSystem::forceActiveWindow(this->winId()); + if(platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive)) { + if (!m_listWinIds.isEmpty()) { + WindowManager::activateWindow(m_listWinIds.back()); } + } else { + KWindowSystem::forceActiveWindow(this->winId()); + } this->show(); - bootOptionsFilter(msg); + bootOptionsFilter(msg, false); } -void MainWindow::switchPage(QString moduleName, QString jumpMoudle) { +void MainWindow::switchPage(QString moduleName, QString jumpMoudle, QString jumpText) { for (int i = 0; i < modulesList.length(); i++) { auto modules = modulesList.at(i); //开始跳转 if (modules.keys().contains(moduleName)) { if (m_ModuleMap.isEmpty() || m_ModuleMap[jumpMoudle.toLower()].toBool()) { - functionBtnClicked(modules.value(moduleName)); + functionBtnClicked(modules.value(moduleName), jumpText); return ; } } diff --git a/shell/mainwindow.h b/shell/mainwindow.h index 32cc720..0063807 100644 --- a/shell/mainwindow.h +++ b/shell/mainwindow.h @@ -35,14 +35,14 @@ #include #include +#include "kaboutdialog.h" #include "interface.h" #include "homepagewidget.h" #include "modulepagewidget.h" #include "searchwidget.h" -#include "kaboutdialog.h" +#include "knavigationbar.h" #include "windowmanager/windowmanager.h" - class QLabel; class QPushButton; class QButtonGroup; @@ -84,6 +84,7 @@ private: QButtonGroup * leftMicBtnGroup; // QDir pluginsDir; + QDir updatePluginDir; QList moduleIndexList; QList> modulesList; @@ -97,6 +98,8 @@ private: QPushButton *closeBtn; QLabel *titleLabel; QLabel *mTitleIcon; + QIcon m_titleIcon; + QLabel *mLogoSetLabel; QTimer *timer; QLabel *m_queryIcon; QLabel *m_queryText = nullptr; @@ -104,17 +107,19 @@ private: QWidget *m_queryWid = nullptr; bool m_isSearching = false; QString m_searchKeyWords; + QStringList m_updatePlugins; QVariantMap m_ModuleMap; QGSettings *m_fontSetting; - bool is_ExitBluetooth = false; bool is_ExitPower = false; QHBoxLayout *titleLayout; - QScrollArea *scrollArea = nullptr; + KNavigationBar *scrollArea = nullptr; QPoint queryWidCenterPos = QPoint(0,0); QDBusInterface *m_statusSessionDbus; - QDBusReply is_tabletmode; + bool is_tabletmode; + bool isTabletMode = false; + QList m_listWinIds; private: @@ -122,6 +127,8 @@ private: void initTileBar(); void setBtnLayout(QPushButton * &pBtn); void loadPlugins(); + void loadUpdatePlugins(); + void determinePlugin(const QString& fileName, const QDir& dir); void loadSpecifiedPlugin(QString pluginFullName); void initLeftsideBar(); QPushButton * buildLeftsideBtn(QString bname, QString tipName, QIcon icon); @@ -136,9 +143,10 @@ private: void reLoadText(); public slots: - void functionBtnClicked(QObject * plugin); + void pluginBtnClicked(QObject * plugin); + void functionBtnClicked(QObject * plugin, QString jumpText = ""); void sltMessageReceived(const QString &msg); - void switchPage(QString moduleName, QString jumpMoudle); + void switchPage(QString moduleName, QString jumpMoudle, QString jumpText = ""); void animationFinishedSlot(); void mainWindow_statusDbusSlot(bool tablet_mode); void initUkccAbout(); @@ -147,7 +155,7 @@ public slots: Q_SIGNALS: void posChanged(); void specifiedPluginLoaded(CommonInterface *pluginInstance); - + void tabletModeChanged(bool isTablet); }; #endif // MAINWINDOW_H diff --git a/shell/mainwindow.ui b/shell/mainwindow.ui index 8dd1b1e..bb81cad 100644 --- a/shell/mainwindow.ui +++ b/shell/mainwindow.ui @@ -90,10 +90,10 @@ 8
- 8 + 0 - 4 + 0 8 @@ -136,7 +136,11 @@ 0 - + + + 8 + + diff --git a/shell/modulepagewidget.cpp b/shell/modulepagewidget.cpp index 0465a58..b06d9c3 100644 --- a/shell/modulepagewidget.cpp +++ b/shell/modulepagewidget.cpp @@ -27,7 +27,7 @@ #include "interface.h" #include "utils/keyvalueconverter.h" #include "utils/functionselect.h" -#include "utils/utils.h" +#include "interface/common.h" #include "component/leftwidgetitem.h" #include "component/leftmenulist.h" #include @@ -77,26 +77,52 @@ void ModulePageWidget::initUI() { ui->scrollArea->verticalScrollBar()->setProperty("drawScrollBarGroove", false); } -void ModulePageWidget::switchPage(QObject *plugin, bool recorded){ - +void ModulePageWidget::switchPage(QObject *plugin, bool recorded, QString jumpText){ + Q_UNUSED(recorded); CommonInterface * pluginInstance = qobject_cast(plugin); refreshPluginWidget(pluginInstance); + if (jumpText.isEmpty() || !pluginwidget) { + return; + } + for (QLabel *o : pluginwidget->findChildren()) { + if (o->text() == jumpText) { + QPoint pos = o->mapTo(ui->scrollArea->widget(), o->pos()); + int widgetHeight = ui->scrollArea->widget()->height(); + int areaHeight = ui->scrollArea->height(); + if (pluginInstance->name() == "Theme") { + pos.setY(pos.y()/2); + } + int maxNum = widgetHeight - areaHeight; + int value = pos.y() + o->height() - areaHeight; + value = value + areaHeight/2; //尽量让选中的显示在中间位置 + if (value <= 0) { + ui->scrollArea->verticalScrollBar()->setValue(0); + } else if (value > maxNum){ + ui->scrollArea->verticalScrollBar()->setValue(maxNum); + } else { + ui->scrollArea->verticalScrollBar()->setValue(value); + } + return; + } + } } void ModulePageWidget::refreshPluginWidget(CommonInterface *plu){ if (plu->pluginBtn) { - plu->pluginBtn->setChecked(true); + plu->pluginBtn->setCheckState(Qt::Checked); } prePlugin = currentPlugin; if (prePlugin) { + qInfo()<<"plugin_leave(): "<name(); prePlugin->plugin_leave(); } currentPlugin = plu; ui->scrollArea->takeWidget(); delete(ui->scrollArea->widget()); - QWidget *pluginwidget = plu->pluginUi(); - pluginwidget->setContentsMargins(40,0,20,40); + pluginwidget = plu->pluginUi(); + qInfo()<<"pluginUi(): "<name(); + pluginwidget->setContentsMargins(24,0,4,40); ui->scrollArea->setWidget(pluginwidget); mCurrentPluName = plu->name(); diff --git a/shell/modulepagewidget.h b/shell/modulepagewidget.h index b8b14a0..4c454b7 100644 --- a/shell/modulepagewidget.h +++ b/shell/modulepagewidget.h @@ -44,7 +44,7 @@ public: public: void initUI(); - void switchPage(QObject * plugin, bool recorded = true); + void switchPage(QObject * plugin, bool recorded = true, QString jumpText = ""); void refreshPluginWidget(CommonInterface * plu); void pluginLeave(); @@ -58,6 +58,7 @@ private: MainWindow * pmainWindow; CommonInterface * prePlugin = nullptr; CommonInterface * currentPlugin = nullptr; + QWidget *pluginwidget = nullptr; private: bool flagBit; @@ -65,8 +66,6 @@ private: Q_SIGNALS: void hScrollBarShow(); void hScrollBarHide(); - - }; #endif // MODULEPAGEWIDGET_H diff --git a/shell/res/homepage/kylin-settings-currency.png b/shell/res/homepage/kylin-settings-currency.png new file mode 100644 index 0000000..57e193f Binary files /dev/null and b/shell/res/homepage/kylin-settings-currency.png differ diff --git a/shell/res/i18n/bo_CN.ts b/shell/res/i18n/bo_CN.ts index fbdc8be..c3f10a6 100644 --- a/shell/res/i18n/bo_CN.ts +++ b/shell/res/i18n/bo_CN.ts @@ -4,212 +4,230 @@ About - + System Summary ལམ་ལུགས་ཕྱོགས་བསྡོམས། - + + Kernel ནང་སྙིང་། /About/Kernel - + + CPU CPU /About/CPU - + + Memory དྲན་ཤེས་ /About/Memory - - + + Disk ཁབ་ལེན་གྱི་ཁབ་ལེན་ - + About and Support - + འབྲེལ་ཡོད་དང་རྒྱབ་སྐྱོར་ - - + Version Number པར་གཞིའི་ཨང་གྲངས། - InterVersion - ཕན་ཚུན་བརྗེ་རེས་བྱེད་པ། + ཕན་ཚུན་བརྗེ་རེས་བྱེད་པ། - + Patch Version པར་གཞི་ཆུང་ཆུང་། - + HostName གཙོ་སྐྱོང་བྱེད་མཁན་གྱི་མིང - + Privacy and agreement སྒེར་གྱི་གསང་དོན་དང་གྲོས་མཐུན - + Send optional diagnostic data བསལ་འདེམས་ཀྱི་བརྟག་དཔྱད་གཞི་གྲངས་སྐུར་སྐྱེལ་བྱ་དགོས། - + By sending us diagnostic data, improve the system experience and solve your problems faster ང་ཚོར་ནད་གཞི་བརྟག་དཔྱད་ཀྱི་གཞི་གྲངས་བསྐུར་ནས་མ་ལག་གི་ཉམས་མྱོང་ལེགས་བཅོས་བྱས་ཏེ་ཁྱོད་ཀྱི་གནད་དོན་ཐག་གཅོད - Copyright © 2009-%1 KylinSoft. All rights reserved. - པར་དབང ©་2009-%1 KylinSoft. སོར་ཉར་བྱས་པའི་ཁེ་དབང་ཡོད་ཚད། + པར་དབང ©་2009-%1 KylinSoft. སོར་ཉར་བྱས་པའི་ཁེ་དབང་ཡོད་ཚད། - + <<Protocol>> <<Protocol>> - + and དེ་བཞིན་དེ་བཞིན་ - + <<Privacy>> <<Privacy>> - + Support རྒྱབ་སྐྱོར། - + Wechat code scanning obtains HP professional technical support འཕྲིན་ཕྲན་ཨང་གྲངས་ལ་ཞིབ་བཤེར་བྱས་ནས་HPཆམ་ལས་ལག་རྩལ་གྱི་རྒྱབ་སྐྱོར་ཐོབ། - + See more about Kylin Tianqi edu platform See more about ཅིན་ལིན་ཐེན་ཆིའི་eduསྟེ་སྟེགས་བུ། - + Learn more HP user manual>> སྔར་ལས་ལྷག་པའི་སྒོ་ནས་HPབེད་སྤྱོད་བྱེད་མཁན>> - + See user manual>> སྤྱོད་མཁན་གྱི་ལག་དེབ་ལ་གཟིགས>> - + + Version པར་གཞི། /About/version - + + Desktop ཅོག་ཙེའི་སྟེང་གི /About/Desktop - + + User སྤྱོད་མཁན། /About/User - + Status གནས་ཚུལ་གྱི་གནས་ /About/Status - + Serial གོ་རིམ་ལྟར་ན། - + DateRes དུས་ཚོད་ཀྱི་དུས་ཚོད། - - + + Openkylin + + + + + KylinSoft + + + + + Extend དུས་འགྱངས་བྱ་དགོས - - - + + + avaliable འགན་འཁྲི་འཁུར་དགོས། - - + + expired དུས་བཀག་ཐིམ་པ། - + The system needs to be restarted to set the HostName, whether to reboot མ་ལག་འདི་བསྐྱར་དུ་འགོ་ཚུགས་ནས་གཙོ་སྐྱོང་བྱེད་མཁན་གྱི་མིང་གཏན་འཁེལ་བྱ་དགོས། - + Reboot Now ད་ལྟ་བསྐྱར་དུ་ལས་ཀ་བྱེད་དགོས། - + Reboot Later རྗེས་སུ་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་བསྐྱར་ - - + + Active འཁྲུག་ཆ་དོད་པོ་ - + About འབྲེལ་ཡོད་ཀྱི་སྐོར། - - + + Copyright © 2009-%1 %2. All rights reserved. + + + + + Inactivated འགུལ་སྐྱོད་མ་བྱས་པ། - + Trial expiration time འདྲི་གཅོད་དུས་ཚོད་ཐིམ་པའི་དུས་ཚོད། - + Activated སྐུལ་སློང་བྱས་པ། @@ -284,54 +302,62 @@ AddBtn - + + Add + ཁ་སྣོན་བརྒྱབ་པ། + + + + AddButton + + Add ཁ་སྣོན་བརྒྱབ་པ། AddInputMethodDialog - - - Dialog - གླེང་མོལ། - + Dialog + གླེང་མོལ། + + + Select the input method to add - + ནང་འཇུག་བྱེད་ཐབས་བདམས་ནས་ཁ་སྣོན་བྱེད་དགོས། - + No - མིན། + མིན། - + Yes - རེད། + རེད། keyboard - + མཐེབ་གཞོང་། Tibetan - + བོད་ཡིག With ASCII numbers - + ཨེ་ཤེ་ཡ་དང་ཞི་རྒྱ་ཆེ་མོ་ཁུལ Input Method - + ནང་འཇུག་བྱེད་ཐབས། @@ -342,22 +368,22 @@ གླེང་མོལ། - + No མིན། - + Yes རེད། - + Add Language ཁ་སྣོན་བྱས་པའི་སྐད་ཆ - + Search འཚོལ་ཞིབ། @@ -365,204 +391,281 @@ AptProxyDialog - Set Apt Proxy - Apt Proxyབཙུགས་པ། + Apt Proxyབཙུགས་པ། - Server Address - ཞབས་ཞུའི་ས་གནས། + ཞབས་ཞུའི་ས་གནས། - Port - གྲུ་ཁ། + གྲུ་ཁ། - Cancel - ཕྱིར་འཐེན། + ཕྱིར་འཐེན། - Confirm - གཏན་འཁེལ་བྱ་དགོས། + གཏན་འཁེལ་བྱ་དགོས། Area - - + Area ས་ཁོངས། - - Language Format - སྐད་ཆའི་རྣམ་གཞག + སྐད་ཆའི་རྣམ་གཞག /Area/Regional Format - - Current Region - མིག་སྔའི་ས་ཁོངས། + མིག་སྔའི་ས་ཁོངས། + /Area/Current Region + + + Regional Format + དུས་ཚོད།དུས་ཚོད།དངུལ་ལོར་གྱི་རྣམ་པ། /Area/Current Region - - Calendar - ལོ་ཐོ། + ལོ་ཐོ། /Area/Calendar - First Day Of The Week - གཟའ་འཁོར་གཅིག་གི་ཉིན་དང་པོ། + གཟའ་འཁོར་གཅིག་གི་ཉིན་དང་པོ། - - Date - དུས་ཚོད། + དུས་ཚོད། /Area/Date - - Time - དུས་ཚོད། + དུས་ཚོད། /Area/Time - - System Language - མ་ལག་གི་སྐད་ཆ། + མ་ལག་གི་སྐད་ཆ། /Area/system language - + lunar ཟླ་བའི་གོ་ལ། - TextLabel - ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར + ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར + + + Language for system windows,menus and web pages + མ་ལག་གི་སྒེའུ་ཁུང་དང་། ཟས་ཐོ། དྲ་ངོས་བཅས་ཀྱི་སྐད་ཆ། + + + US + ཨ་རི། + + + CN + CN + + + + English (US) + དབྱིན་ཡིག (ཨ་མེ་རི་ཀ།) + + + + Simplified Chinese (CN) + བསྡུས་གཟུགས་རྒྱ་ཡིག་ (ཀྲུང་གོ།) - Language for system windows,menus and web pages - མ་ལག་གི་སྒེའུ་ཁུང་དང་། ཟས་ཐོ། དྲ་ངོས་བཅས་ཀྱི་སྐད་ཆ། + Tibetan (CN) + བོད་ཡིག (ཀྲུང་གོ།) - - US - ཨ་རི། + + monday + གཟའ་ཟླ་བ། - - CN - CN + + sunday + གཟའ་ཉི་མ། - First Day Of Week - གཟའ་འཁོར་གཅིག་གི་ཉིན་དང་པོ། + གཟའ་འཁོར་གཅིག་གི་ཉིན་དང་པོ། /Area/First Day Of Week - + 12 Hours ཆུ་ཚོད་12 - + 24 Hours ཆུ་ཚོད་24རིང་། - + Settings + སྒྲིག་བཀོད། + + + 简体中文 + བསྡུས་གཟུགས་རྒྱ་ཡིག་ + + + + English + དབྱིན་སྐད། + + + བོད་ཡིག + བོད་ཡིག + + + + Simplified Chinese + བསྡུས་གཟུགས་རྒྱ་ཡིག་ + + + + Tibetan + བོད་ཡིག + + + Modify the current region need to logout to take effect, whether to logout? ད་ལྟའི་ས་ཁོངས་ལ་བཟོ་བཅོས་བརྒྱབ་ན་ད་གཟོད་ནུས་པ་ཐོན་ཐུབ། ཐོ་འགོད་བྱེད་དགོས་སམ། - + Logout later རྗེས་སུ་ཐོ་འགོད་བྱེད་པ། - + Logout now ད་ལྟ་ཐོ་འགོད་བྱེད་བཞིན་ཡོད། - + Modify the first language need to reboot to take effect, whether to reboot? སྐད་རིགས་དང་པོར་བཟོ་བཅོས་བརྒྱབ་ན་ད་གཟོད་ནུས་པ་ཐོན་ཐུབ། བསྐྱར་དུ་ཐོན་ཐུབ་མིན་ལ་བཟོ་བཅོས་རྒྱག་དགོས་སམ། - + Reboot later རྗེས་སུ་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་བསྐྱར་ - + Reboot now ད་ལྟ་བསྐྱར་དུ་འཁོར་བ། - + solar calendar ཉི་མའི་ལོ་ཐོ། + + AreaUi + + + Regional Format + དུས་ཚོད།དུས་ཚོད།དངུལ་ལོར་གྱི་རྣམ་པ། + /Area/Regional Format + + + + Calendar + ལོ་ཐོ། + /Area/Calendar + + + + First Day Of Week + གཟའ་འཁོར་གཅིག་གི་ཉིན་དང་པོ། + /Area/First Day Of Week + + + + Date + དུས་ཚོད། + /Area/Date + + + + Time + དུས་ཚོད། + /Area/Time + + + + Language Format + སྐད་ཆའི་རྣམ་གཞག + /Area/Language Format + + + + System Language + མ་ལག་གི་སྐད་ཆ། + /Area/System Language + + AutoBoot - + Desktop files(*.desktop) Desktop files (*.desktop) - + select autoboot desktop རང་འགུལ་གྱིས་མདུན་ངོས་སུ་བདམས་པ་རེད། - + Select བདམས་ཐོན་བྱུང་བ། - + Cancel ཕྱིར་འཐེན། - Add - ཁ་སྣོན་བརྒྱབ་པ། - /autoboot/Add + ཁ་སྣོན་བརྒྱབ་པ། + /Autoboot/Add - + Autoboot Settings རང་འགུལ་གྱིས་སྒྲིག་བཀོད་སྒྲིག་བྱེད་པ། /autoboot/Autoboot Settings - + Auto Boot རང་འགུལ་གྱིས་ལྷམ་ཡུ་རིང - + Delete བསུབ་པ། @@ -571,8 +674,7 @@ Backup - - + Backup རྗེས་གྲབས་དཔུང་ཁག @@ -585,14 +687,14 @@ you can restore them to ensure the integrity of your system. - + Begin backup རྗེས་གྲབས་ལས་དོན་སྤེལ་འགོ་ཚུགས /Backup/Begin backup - + Restore སླར་གསོ་བྱེད་པ། @@ -603,23 +705,28 @@ you can restore them to ensure the integrity of your system. - + Begin restore སླར་གསོ་བྱེད་འགོ་ཚུགས། /Backup/Begin restore - + + Backup Restore + + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. ཡིག་ཆ་དེ་སྒུལ་ཤུགས་གཞན་དག་ལ་རྒྱབ་སྐྱོར་བྱས་ནས་འབྱུང་ཁུངས་ཀྱི་ཡིག་ཆ་བོར་བརླག་ཏུ་སོང་བ་དང་། གཏོར་བརླག་ཐེབས་པའམ་ཡང་ན་བསུབ་རྗེས་སླར་གསོ་བྱས་ཏེ་མ་ལག་གི་ཆ་ཚང་རང་བཞིན་ལ་ཁག་ཐེག་བྱེད་དགོས། - + View the backup list and restore the backup file to the system རྗེས་གྲབས་རེའུ་མིག་ལ་ལྟ་ཞིབ་བྱས་ནས་རྗེས་གྲབས་ཡིག་ཆ་མ་ལག་ནང་དུ་སླར་གསོ་བྱེད་དགོས། - + Backup and Restore རྗེས་གྲབས་དང་སླར་གསོ་བྱེད་དགོས། @@ -646,7 +753,7 @@ you can restore them to ensure the integrity of your system. BrightnessFrame - + Failed to get the brightness information of this monitor ལྟ་ཞིབ་ཚད་ལེན་འཕྲུལ་ཆས་འདིའི་གསལ་ཚད་ཀྱི་ཆ་འཕྲིན་ཐོབ་མ་ཐུབ། @@ -903,7 +1010,7 @@ you can restore them to ensure the integrity of your system. Change Pwd - Pwdལ་འགྱུར་ལྡོག་གཏོང་དགོས། + ལ་འགྱུར་ལྡོག་གཏོང་དགོས། @@ -1026,63 +1133,63 @@ you can restore them to ensure the integrity of your system. ChangeUserLogo - + User logo སྤྱོད་མཁན་གྱི་མཚོན་རྟགས། - + System Logos མ་ལག་གི་མཚོན་རྟགས། - + Select Local Logo ས་གནས་དེ་གའི་མཚོན་རྟགས་ - - + + Cancel ཕྱིར་འཐེན། - + Confirm གཏན་འཁེལ་བྱ་དགོས། - + select custom face file ཡུལ་སྲོལ་གོམས་གཤིས་ཀྱི་ངོ་གདོང་ཡིག་ཆ - + Select བདམས་ཐོན་བྱུང་བ། - + Position: གོ་གནས་ནི། - + FileName: ཡིག་ཆའི་མིང་ནི། - + FileType: ཡིག་ཆའི་རིགས་དབྱིབས་ནི། - + Warning ཐ་ཚིག་སྒྲོག་པ། - + The avatar is larger than 1M, please choose again པར་དབང་དེ་1Mལས་ཆེ་བ་དང་། ཡང་བསྐྱར་གདམ་ག་གནང་རོགས། @@ -1100,27 +1207,27 @@ you can restore them to ensure the integrity of your system. སྤྱོད་མཁན་གྱི་མིང་། - + NickName མིང་འདོགས་མིང་། - + nickName already in use. བཀོལ་སྤྱོད་བྱེད་བཞིན་པའི་མཚང་མིང་། - + Cancel ཕྱིར་འཐེན། - + Confirm གཏན་འཁེལ་བྱ་དགོས། - + The length must be 1~%1 characters! རིང་ཚད་ནི་ངེས་པར་དུ་1%1 ཡི་ཡི་གེ་ཡིན་དགོས། @@ -1128,71 +1235,83 @@ you can restore them to ensure the integrity of your system. ChangeUserPwd - + Change password གསང་གྲངས་བརྗེ་བ། - - - + + + Current Pwd - མིག་སྔའི་Pwd + མིག་སྔའི་ - - - - + + + + New Pwd - Pwdགསར་པ། + གསར་པ། - - - - + + + + Sure Pwd - གཏན་འཁེལ་བྱས་པའི་Pwd + གཏན་འཁེལ་བྱས་པའི་ - + Cancel ཕྱིར་འཐེན། - + + + Confirm གཏན་འཁེལ་བྱ་དགོས། - - + + Inconsistency with pwd pwdདང་གཅིག་མཐུན་མིན་པ། - + + Same with old pwd + + + + + Pwd Changed Succes + Pwdསྟེང་གི་འགྱུར་ལྡོག་གི་སུའུ་ཝེ་ཨེད་ + + + Authentication failed, input authtok again! བདེན་དཔང་ར་སྤྲོད་བྱེད་མ་ཐུབ་པར་ཡང་བསྐྱར་ནང་འཇུག་བྱེད་དགོས། - + Contains illegal characters! དེའི་ནང་དུ་ཁྲིམས་འགལ་གྱི་མི་སྣ་འདུས་ཡོད། - + current pwd cannot be empty! ད་ལྟའི་pwdནི་སྟོང་པ་ཡིན་མི་སྲིད། - + new pwd cannot be empty! གསར་དུ་བཏོ་བ་ནི་སྟོང་བ་ཡིན་མི་སྲིད། - + sure pwd cannot be empty! pwdནི་སྟོང་བ་ཡིན་མི་སྲིད་པ་ཐག་གིས་ཆོད། @@ -1546,7 +1665,7 @@ change system settings Pwd - Pwd + ལམ་ཡིག @@ -1659,7 +1778,7 @@ change system settings custom - + ཡུལ་སྲོལ་གོམས་གཤིས། @@ -1683,136 +1802,129 @@ change system settings ད་ལྟའི་དུས་ཚོད། - - + Change timezone དུས་ཚོད་བསྒྱུར་བཅོས་བྱ་དགོས། /Date/Change time zone - - TextLabel - ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར + ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར - - RadioButton - ཀུན་ཁྱབ་རླུང་འཕྲིན་ལས་ཁུངས། + ཀུན་ཁྱབ་རླུང་འཕྲིན་ལས་ཁུངས། - - : - : + : - + titleLabel ཁ་བྱང་ལ་པེ་ཨར། - + Date དུས་ཚོད། - + Current Date ད་ལྟའི་དུས་ཚོད། /Date/Current Date - + Other Timezone དུས་ཚོད་གཞན་དག /Date/Other Timezone - + 24-hour clock ཆུ་ཚོད་24རིང་གི་ཆུ་ཚོད་འཁོར་ལོ། /Date/24-hour clock - + Set Time དུས་ཚོད་གཏན་འཁེལ་བྱ་ /Date/Set Time - + Set Date Manually ལག་པས་དུས་ཚོད་གཏན་འཁེལ་བྱ་དགོས། /Date/Set Date Manually - + Sync Time དུས་ཚོད་གཅིག་མཐུན་ཡོང་བ /Date/Sync Time - + Manual Time ལག་ཤེས་དུས་ཚོད། /Date/Manual Time - + Sync Server དུས་མཉམ་ཞབས་ཞུའི་ཡོ་བྱད /Date/Sync Server - + Default ཁ་ཆད་དང་འགལ་ - + Customize ཡུལ་སྲོལ་གོམས་གཤིས་ - + Server Address ཞབས་ཞུའི་ས་གནས། - + Required བླང་བྱ་བཏོན་པ། - + Save གྲོན་ཆུང་བྱེད་དགོས། - + change time དུས་ཚོད་བསྒྱུར་བཅོས་བྱ་དགོས - + Add Timezone དུས་ཚོད་ཀྱི་ཁྱབ་ཁུལ་ཁ་སྣོན - + Change Timezone དུས་ཚོད་བསྒྱུར་བཅོས་བྱ་དགོས། - + - - + + Sync failed དུས་མཉམ་དུ་ཕམ་ཉེས་བྱུང་བ། @@ -1820,71 +1932,65 @@ change system settings DefaultApp - + Default App ཁ་ཆད་དང་འགལ་བའི་ - + No program available ད་ཡོད་ཀྱི་གོ་རིམ་མེད་ - + Choose default app ཁ་ཆད་དང་འགལ་བའི་ཉེར་ - + Reset default apps to system recommended apps མ་ལག་གིས་འོས་སྦྱོར་བྱས་པའི་ཉེར་སྤྱོད་གོ་རིམ་ཁྲོད་དུ་ཁ་ཆད་ - + Reset བསྐྱར་དུ་བཀོད་སྒྲིག་བྱེད་པ - + Browser བཤེར་ཆས། - /Defaultapp/Browser - + Mail སྦྲག་རྫས། - /Defaultapp/Mail - + Image Viewer པར་རིས་ལྟ་མཁན། - /Defaultapp/Image Viewer - + Audio Player སྒྲ་ཕབ་འཕྲུལ་ཆས། - /Defaultapp/Audio Player - + Video Player བརྙན་ཕབ་འཕྲུལ་འཁོར། - /Defaultapp/Video Player - + Text Editor ཡི་གེའི་རྩོམ་སྒྲིག་པ། - /Defaultapp/Text Editor DefaultAppWindow - + Select Default Application ཁ་ཆད་དང་འགལ་བའི་ཉེར་སྤྱོད @@ -1964,32 +2070,32 @@ change system settings DeleteUserExists - + Delete user ' བེད་སྤྱོད་བྱེད་མཁན་བསུབ་པ' - + '? And: '? ད་དུང་འདི་ལྟ་སྟེ། - + Keep desktop, files, favorites, music of the user སྤྱོད་མཁན་གྱི་ཅོག་ཙེ་དང་། ཡིག་ཆ། དགའ་ཕྱོགས། རོལ་དབྱངས་བཅས་ཉར་ཚགས་ཡག་པོ་བྱེད་དགོས། - + Delete whole data belong user གཞི་གྲངས་ཧྲིལ་པོ་བེད་སྤྱོད་བྱེད་མཁན་ལ་དབང་བ - + Cancel ཕྱིར་འཐེན། - + Confirm གཏན་འཁེལ་བྱ་དགོས། @@ -2152,7 +2258,12 @@ change system settings DisplaySet - + + Screen + བརྙན་ཤེལ། + + + Display འགྲེམས་སྟོན། @@ -2173,13 +2284,11 @@ change system settings འགྲེམས་སྟོན། - monitor ལྟ་ཞིབ་ཡོ་བྱད། - open monitor སྒོ་འབྱེད་ལྟ་ཞིབ་ཡོ་བྱད @@ -2195,55 +2304,46 @@ change system settings མེ་ལོང་འགྲེམས་སྟོན། - as main གཙོ་བོར་འཛིན་དགོས། - screen zoom བརྙན་ཤེལ་ཆེ་རུ་གཏོང་བ། - follow the sunrise and sunset(17:55-05:04) ཉི་མ་ཤར་བ་དང་ཉི་མ་ནུབ་པའི་རྗེས་སུ་འབྲངས་པ། (17:55-05:04) - custom time གོམས་སྲོལ་གྱི་དུས་ཚོད། - opening time སྒོ་འབྱེད་པའི་དུས་ཚོད། - closing time སྒོ་རྒྱག་པའི་དུས་ཚོད། - color temperature ཁ་དོག་གི་དྲོད་ཚད། - warm དྲོ་སྐྱིད་ལྡན་པ། - cold གྲང་ངར་ཆེ་བ། @@ -2283,6 +2383,16 @@ change system settings Reset to default བསྐྱར་དུ་ཁ་ཆད་དང་འགལ་བའི་གནས་ + + + Small + ཆུང་བ། + + + + Large + ཆེ་བ་ + HostNameDialog @@ -2297,17 +2407,17 @@ change system settings གཙོ་སྐྱོང་བྱེད་མཁན་གྱི་མིང - + Must be 1-64 characters long ངེས་པར་དུ་ཡི་གེ་1-64ཡི་རིང་ཚད་ - + Cancel ཕྱིར་འཐེན། - + Confirm གཏན་འཁེལ་བྱ་དགོས། @@ -2429,70 +2539,74 @@ change system settings KeyboardControl - Keyboard - མཐེབ་གཞོང་། + མཐེབ་གཞོང་། KeyboardMain - + + Keyboard + མཐེབ་གཞོང་། + + + Key board settings གཙོ་གནད་པང་ལེབ་ཀྱི་སྒྲིག་བཀོད། - + Input settings ནང་འཇུག་གི་སྒྲིག་བཀོད། /Keyboard/Input settings - + Key repeat ལྡེ་མིག་བསྐྱར་ཟློས་བྱེད་པ /Keyboard/Key repeat - + Delay འགོར་འགྱངས་བྱས་པ /Keyboard/Delay - + Short མདོར་ན། - + Long རིང་བ། - + Speed མྱུར་ཚད། /Keyboard/Speed - + Slow དལ་མོ།དལ་མོ། - + Fast མགྱོགས་མྱུར། - + Input test ནང་འཇུག་ཚོད་ལྟ། /Keyboard/Input test - + Key tips འགག་རྩའི་མན་ངག /Keyboard/Key tips @@ -2501,12 +2615,12 @@ change system settings LanguageFrame - + Input Settings ནང་འཇུག་གི་སྒྲིག་བཀོད། - + Delete བསུབ་པ། @@ -2562,70 +2676,71 @@ change system settings MainWindow - + Normal རྒྱུན་ལྡན་གྱི་གནས་ - - + + Maximize ཚད་གཞི་མཐོ་ཤོས་ཀྱི་སྒོ་ནས - - - + + + + Settings སྒྲིག་བཀོད། - + Search འཚོལ་ཞིབ། - + Main menu ཟས་ཐོ་གཙོ་བོ། - + Minimize ཉུང་དུ་གཏོང་གང་ཐུབ་བྱ་དགོས། - + Close སྒོ་རྒྱག་པ། - + Help རོགས་རམ་བྱེད་པ། - + About འབྲེལ་ཡོད་ཀྱི་སྐོར། - + Exit ཕྱིར་འཐེན་བྱེད་པ། - + Specified གཏན་འབེབས་བྱས་པ། - + Warning ཐ་ཚིག་སྒྲོག་པ། - + This function has been controlled འགན་ནུས་འདི་ཚོད་འཛིན་བྱས་ཟིན། @@ -2751,143 +2866,143 @@ change system settings MouseControl - Mouse - བྱི་བ། + བྱི་བ། MouseUI - + + Mouse བྱི་བ། - + Pointer ཕྱོགས་སྟོན་འཁོར་ལོ། - + Cursor དམོད་ཚིག - + Dominant hand དབང་སྒྱུར་གྱི་གོ་གནས་ /Mouse/Dominant hand - + Left hand ལག་པ་གཡོན་པ། - + Right hand ལག་པ་གཡས་པ། - + Scroll direction ཁ་ཕྱོགས་ལ་ཁ་ཕྱོགས་པ། /Mouse/Scroll direction - + Forward མདུན་དུ་སྐྱོད་པ - + Reverse ལྡོག་ཕྱོགས་སུ་འགྱུར་ - + Wheel speed འཁོར་ལོའི་མྱུར་ཚད། /Mouse/Wheel speed - - - + + + + Slow དལ་མོ།དལ་མོ། - - - + + + + Fast མགྱོགས་མྱུར། - + Double-click interval time ལྡབ་འགྱུར་གྱིས་བར་མཚམས་ཀྱི་དུས་ཚོད། /Mouse/Double-click interval time - Short - མདོར་ན། + མདོར་ན། - Long - རིང་བ། + རིང་བ། - + Pointer speed ཕྱོགས་སྟོན་འཁོར་ལོ་མགྱོགས་ཚད། /Mouse/Pointer speed - + Mouse acceleration བྱི་བའི་མགྱོགས་ཚད། /Mouse/Mouse acceleration - + Show pointer position when pressing ctrl ctrl མནན་དུས་ཕྱོགས་སྟོན་གྱི་གནས་བབ་མངོན་པར་བྱེད་དགོས། /Mouse/Show pointer position when pressing ctrl - + Pointer size ཕྱོགས་སྟོན་འཁོར་ལོ་ཆེ་ཆུང་། /Mouse/Pointer size - + Small(recommend) ཆུང་བ་(འོས་སྦྱོར)། - + Medium འབྲིང་བ། - + Large ཆེ་བ། - + Blinking cursor in text area ཡི་གེའི་ཁྱབ་ཁོངས་སུ་འོད་ཆེམ་ཆེམ་བྱེད་པ། /Mouse/Blinking cursor in text area - + Cursor speed ཀྱག་ཀྱོག་གི་མྱུར་ཚད། /Mouse/Cursor speed @@ -2896,7 +3011,7 @@ change system settings MyLabel - + double-click to test ཚད་ལེན་ཚོད་ལྟ་ཐེངས་གཉིས་བྱས་པ། @@ -2904,53 +3019,52 @@ change system settings Notice - + NotFaze Mode མི་དམངས་ཀྱི་དཔེ་དབྱིབས་མིན་པ། - + (Notification banners, prompts will be hidden, and notification sounds will be muted) (བརྡ་ཐོ་གཏོང་བའི་འཕྲེད་འགེལ་སྦྱར་ཡིག་དང་། བརྡ་གཏོང་ཡི་གེ་སྦས་སྐུང་བྱས་ནས་བརྡ་ཁྱབ་ཀྱི་སྒྲ་གྲགས་ཡོང་། ) - + Automatically turn on རང་འགུལ་གྱིས་ཁ་ཕྱེ་བ། - + to དེ་ལྟར་བྱས་ན་ - + Automatically turn on when multiple screens are connected བརྙན་ཤེལ་མང་པོ་སྦྲེལ་མཐུད་བྱེད་སྐབས་རང་འགུལ་གྱིས་ཁ་ཕྱེ་བ། - + Automatically open in full screen mode བརྙན་ཤེལ་ཧྲིལ་པོའི་རྣམ་པའི་ཐོག་ནས་རང་འགུལ་གྱིས་སྒོ་ - + Allow automatic alarm reminders in Do Not Disturb mode རང་འགུལ་གྱིས་ཉེན་བརྡ་གཏོང་བའི་དྲན་སྐུལ་བྱེད་སྟངས་ལ་སུན་པོ་བཟོ་མི་རུང་། - + Notice Settings བརྡ་ཐོའི་སྒྲིག་བཀོད། - + Get notifications from the app ཉེར་སྤྱོད་གོ་རིམ་ཁྲོད་ནས་བརྡ་ཐོ་གཏོང་དགོས། - /notice/Get notifications from the app - + Notice བརྡ་ཐོ། @@ -3004,62 +3118,68 @@ change system settings OutputConfig - + resolution གྲོས་ཆོད། /Display/resolution - + orientation ཁ་ཕྱོགས་ /Display/orientation - + arrow-up མདའ་འཕེན་པ། - + 90° arrow-right 90°མདའ་གཡས་ཕྱོགས་པ། - + arrow-down མདའ་མོ་མར་ཕབ་པ། - + + auto rotation + + /Display/auto rotation + + + frequency ཐེངས་གྲངས། /Display/frequency - + 90° arrow-left 90°མདའ་གཡོན་ཕྱོགས་སུ་ཡོད། - + auto རང་འགུལ་གྱིས་རླངས་ - + screen zoom བརྙན་ཤེལ་ཆེ་རུ་གཏོང་བ། /Display/screen zoom - + @@ -3091,7 +3211,7 @@ change system settings - + GetCode ཨང་ཀི་ཐོབ་པ། @@ -3106,56 +3226,56 @@ change system settings བསྒྲུབ་རྒྱུ་ཁས་ལེན་ - + confirm ངོས་འཛིན་བྱས་པ། - + commit བསྒྲུབ་རྒྱུ་ཁས་ལེན་ - + Mobile number acquisition failed སྒུལ་བདེའི་ཨང་གྲངས་ཉོ་སྒྲུབ་བྱེད་པར་ཕམ་ - - + + Recapture ཕྱིར་འཕྲོག་ལེན་བྱེད་པ། - - - - + + + + Network connection failure, please check དྲ་སྦྲེལ་ལ་སྐྱོན་ཤོར་བས་ཞིབ་བཤེར་གནང་རོགས། - + Phone is lock,try again in an hour ཁ་པར་ལ་ཟྭ་བརྒྱབ་ནས་དུས་ཚོད་གཅིག་འགོར་རྗེས་ཡང་བསྐྱར་ཚོད་ལྟ་ - + Phone code is wrong ཁ་པར་ཨང་གྲངས་ནོར་སོང་། - + Current login expired,using wechat code! ད་ལྟའི་ཐོ་འགོད་དུས་ཚོད་ཐིམ་ནས་འཕྲིན་ཕྲན་གྱི་ཚབ་རྟགས་བཀོལ་སྤྱོད་བྱས། - + Unknown error, please try again later ནོར་འཁྲུལ་མི་ཤེས་པས་ཕྱིས་སུ་ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག་ - + Please use the correct wechat scan code ཡང་དག་པའི་འཕྲིན་ཕྲན་ཞིབ་བཤེར་གྱི་ཚབ་རྟགས་བཀོལ་རོགས། @@ -3163,252 +3283,188 @@ change system settings Power - Power - སྟོབས་ཤུགས། + སྟོབས་ཤུགས། + + + Require password when sleep + གཉིད་ཉལ་སྐབས་གསང་གྲངས་དགོས་ - - - never - གཏན་ནས་བྱེད་མི་ + གཏན་ནས་བྱེད་མི་ - - Require password when sleep/hibernation - གཉིད་ཉལ་སྐབས་གསང་གྲངས་དགོས་པའི་བླང་བྱ་བཏོན་ཡོད། + གཉིད་ཉལ་སྐབས་གསང་གྲངས་དགོས་པའི་བླང་བྱ་བཏོན་ཡོད། - - Password required when waking up the screen - བརྙན་ཤེལ་གཉིད་ལས་སད་སྐབས་མཁོ་བའི་གསང་གྲངས། + བརྙན་ཤེལ་གཉིད་ལས་སད་སྐབས་མཁོ་བའི་གསང་གྲངས། - Press the power button - སྒུལ་ཤུགས་ཀྱི་མཐེབ་གཅུས་ + སྒུལ་ཤུགས་ཀྱི་མཐེབ་གཅུས་ - - Time to close display - འགྲེམས་སྟོན་མཇུག་སྒྲིལ་བའི་དུས་ཚོད། + འགྲེམས་སྟོན་མཇུག་སྒྲིལ་བའི་དུས་ཚོད། - - Time to sleep - གཉིད་ཉལ་བའི་དུས་ཚོད། + གཉིད་ཉལ་བའི་དུས་ཚོད། - - Notebook cover - ཟིན་བྲིས་ཀྱི་ཁེབས་རས། + ཟིན་བྲིས་ཀྱི་ཁེབས་རས། - - - Using power - དབང་ཆ་བེད་སྤྱོད་བྱ་དགོས། + དབང་ཆ་བེད་སྤྱོད་བྱ་དགོས། - Using battery - གློག་སྨན་བཀོལ་སྤྱོད་བྱེད་པ། + གློག་སྨན་བཀོལ་སྤྱོད་བྱེད་པ། - - Time to darken - མུན་ནག་ཏུ་འགྱུར་བའི་དུས་ཚོད། + མུན་ནག་ཏུ་འགྱུར་བའི་དུས་ཚོད། - - Battery level is lower than - གློག་གཡིས་ཀྱི་ཆུ་ཚད་ལས་དམའ་བ། + གློག་གཡིས་ཀྱི་ཆུ་ཚད་ལས་དམའ་བ། - Run - འཁོར་སྐྱོད་བྱེད་བཞིན་ + འཁོར་སྐྱོད་བྱེད་བཞིན་ - - Low battery notification - གློག་གཡིས་ཀྱི་བརྡ་ཐོ་དམའ་བ། + གློག་གཡིས་ཀྱི་བརྡ་ཐོ་དམའ་བ། - Automatically run saving mode when low battery - གློག་གཡིས་དམའ་བའི་དུས་སུ་རང་འགུལ་གྱིས་གྲོན་ཆུང་བྱེད་ཐབས་ + གློག་གཡིས་དམའ་བའི་དུས་སུ་རང་འགུལ་གྱིས་གྲོན་ཆུང་བྱེད་ཐབས་ - Automatically run saving mode when the low battery - གློག་སྨན་དམའ་བའི་སྐབས་སུ་རང་འགུལ་གྱིས་གྲོན་ཆུང་བྱེད་སྟངས་འཁོར་སྐྱོད་ + གློག་སྨན་དམའ་བའི་སྐབས་སུ་རང་འགུལ་གྱིས་གྲོན་ཆུང་བྱེད་སྟངས་འཁོར་སྐྱོད་ - - Automatically run saving mode when using battery - གློག་གཡིས་བཀོལ་སྤྱོད་བྱེད་སྐབས་རང་འགུལ་གྱིས་གྲོན་ཆུང་བྱེད་སྟངས་བཀོལ + གློག་གཡིས་བཀོལ་སྤྱོད་བྱེད་སྐབས་རང་འགུལ་གྱིས་གྲོན་ཆུང་བྱེད་སྟངས་བཀོལ - - Display remaining charging time and usage time - དེ་བྱིངས་ཀྱི་གློག་གསོག་དུས་ཚོད་དང་བཀོལ་སྤྱོད་ཀྱི་དུས་ཚོད་མངོན་པར་བྱས་ཡོད། + དེ་བྱིངས་ཀྱི་གློག་གསོག་དུས་ཚོད་དང་བཀོལ་སྤྱོད་ཀྱི་དུས་ཚོད་མངོན་པར་བྱས་ཡོད། - General - སྤྱིར་བཏང་གི་གནས + སྤྱིར་བཏང་གི་གནས /Power/General - Select Powerplan - སྒུལ་ཤུགས་འཆར་གཞི་བདམས་པ། + སྒུལ་ཤུགས་འཆར་གཞི་བདམས་པ། /Power/Select Powerplan - Battery saving plan - གློག་གཡིས་གྲོན་ཆུང་གི་འཆར་ + གློག་གཡིས་གྲོན་ཆུང་གི་འཆར་ /Power/Battery saving plan - - nothing - ཅི་ཡང་མ་རེད། + ཅི་ཡང་མ་རེད། - - blank - སྟོང་ཆ། + སྟོང་ཆ། - - - suspend - ལས་མཚམས་བཞག་པ། + ལས་མཚམས་བཞག་པ། - - - hibernate - མངལ་གནས་སུ་སྦས་པ། + མངལ་གནས་སུ་སྦས་པ། - interactive - ཕན་ཚུན་སྐུལ་འདེད་ + ཕན་ཚུན་སྐུལ་འདེད་ - - 5min - 5min + 5min - - - 10min - 10min + 10min - - 15min - 15min + 15min - - 30min - 30min + 30min - - 1h - 1hh + 1hh - - 2h - 2h + 2h - 3h - 3h + 3h - - Balance Model - དོ་མཉམ་གྱི་དཔེ་དབྱིབས། + དོ་མཉམ་གྱི་དཔེ་དབྱིབས། - - Save Model - གསོག་འཇོག་བྱེད་སྟངས། + གསོག་འཇོག་བྱེད་སྟངས། - - Performance Model - གྲུབ་འབྲས་ཀྱི་དཔེ་དབྱིབས། + གྲུབ་འབྲས་ཀྱི་དཔེ་དབྱིབས། - 1min - 1min + 1min - 20min - 20min + 20min - - - shutdown - ལས་མཚམས་བཞག་པ། + ལས་མཚམས་བཞག་པ། Printer - + Printer དཔར་འདེབས་འཕྲུལ་འཁོར། - - Printers And Scanners - པར་འདེབས་འཕྲུལ་འཁོར་དང་བཤེར་ཆས། + + Printers + པར་འདེབས་འཕྲུལ་འཁོར། + + + Printers And Scanners + པར་འདེབས་འཕྲུལ་འཁོར་དང་བཤེར་ཆས། - Add - ཁ་སྣོན་བརྒྱབ་པ། + ཁ་སྣོན་བརྒྱབ་པ། /Printer/Add @@ -3638,125 +3694,98 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Proxy - Auto url - རླངས་འཁོར་གྱི་དྲ་ཚིགས། + རླངས་འཁོར་གྱི་དྲ་ཚིགས། /Proxy/Auto url - Http Proxy - Http Proxy + Http Proxy /Proxy/Http Proxy - - - - Port - གྲུ་ཁ། + གྲུ་ཁ། - Start using - བཀོལ་སྤྱོད་བྱེད་འགོ་ཚུགས། + བཀོལ་སྤྱོད་བྱེད་འགོ་ཚུགས། - Proxy mode - ཚབ་བྱེད་དཔེ་དབྱིབས། + ཚབ་བྱེད་དཔེ་དབྱིབས། - Auto - རང་འགུལ་གྱིས་རླངས་ + རང་འགུལ་གྱིས་རླངས་ - Manual - ལག་དེབ། + ལག་དེབ། - System Proxy - མ་ལག་གི་ཚབ་བྱེད་ + མ་ལག་གི་ཚབ་བྱེད་ - Https Proxy - Https Proxy + Https Proxy /Proxy/Https Proxy - Ftp Proxy - Ftp Proxy + Ftp Proxy /Proxy/Ftp Proxy - Socks Proxy - རྐང་འབོབ་ཀྱི་ཚབ་བྱེད་མི་སྣ། + རྐང་འབོབ་ཀྱི་ཚབ་བྱེད་མི་སྣ། /Proxy/Socks Proxy - List of ignored hosts. more than one entry, please separate with english semicolon(;) - སྣང་མེད་དུ་བཞག་པའི་བདག་པོའི་མིང་ཐོ། འཇུག་སྒོ་གཅིག་ལས་བརྒལ་ན་དབྱིན་ཡིག་གི་ཕྱེད་ཀ་དང་ཁ་གྱེས་རོགས། (;) + སྣང་མེད་དུ་བཞག་པའི་བདག་པོའི་མིང་ཐོ། འཇུག་སྒོ་གཅིག་ལས་བརྒལ་ན་དབྱིན་ཡིག་གི་ཕྱེད་ཀ་དང་ཁ་གྱེས་རོགས། (;) - Apt Proxy - Apt Proxy + Apt ལས་ཚབ་ /Proxy/Apt Proxy - Open - སྒོ་ཕྱེ་བ། + སྒོ་ཕྱེ་བ། - Server Address : - ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་གནས་ཡུལ + ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་གནས་ཡུལ - Port : - གྲུ་ཁ། + གྲུ་ཁ། - Edit - རྩོམ་སྒྲིག + རྩོམ་སྒྲིག - The apt proxy has been turned off and needs to be restarted to take effect - ངོ་ཚབ་ཀྱི་སྒོ་བརྒྱབ་ཟིན་པས་ཡང་བསྐྱར་ནུས་པ་ཐོན་པར་བྱ་དགོས། + ངོ་ཚབ་ཀྱི་སྒོ་བརྒྱབ་ཟིན་པས་ཡང་བསྐྱར་ནུས་པ་ཐོན་པར་བྱ་དགོས། - - Reboot Later - རྗེས་སུ་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་བསྐྱར་ + རྗེས་སུ་ཡང་བསྐྱར་ཐེངས་གཅིག་ལ་བསྐྱར་ - - Reboot Now - ད་ལྟ་བསྐྱར་དུ་ལས་ཀ་བྱེད་དགོས། + ད་ལྟ་བསྐྱར་དུ་ལས་ཀ་བྱེད་དགོས། - The system needs to be restarted to set the Apt proxy, whether to reboot - མ་ལག་འདི་བསྐྱར་དུ་འགོ་ཚུགས་ནས་Aptཡི་ཚབ་བྱེད་འཕྲུལ་ཆས་གཏན་འཁེལ་བྱེད་དགོས་པ་དང་། བསྐྱར་དུ་འགོ་འཛུགས་དགོས་མིན་ + མ་ལག་འདི་བསྐྱར་དུ་འགོ་ཚུགས་ནས་Aptཡི་ཚབ་བྱེད་འཕྲུལ་ཆས་གཏན་འཁེལ་བྱེད་དགོས་པ་དང་། བསྐྱར་དུ་འགོ་འཛུགས་དགོས་མིན་ - Proxy - ཚབ་བྱེད་མི་སྣ། + ཚབ་བྱེད་མི་སྣ། @@ -3832,7 +3861,7 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག ཉིན་མོ། - + User Info སྤྱོད་མཁན་གྱི་ཆ་འཕྲིན། @@ -3904,106 +3933,103 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག ཟླ་བ་བཅུ་གཉིས་ - - + + min length %1 རིང་ཐུང་གི་ཚད་ནི་1 - - + + min digit num %1 min digit num %1 - - + + min upper num %1 min སྟེང་གི་num%1 - - + + min lower num %1 min དམའ་རིམ་num %1 - - + + min other num %1 གཏེར་ཁ་གཞན་དག%1 - - + + min char class %1 གཏེར་ཁ་སྔོག་འདོན་འཛིན་གྲྭ་%1 - - + + max repeat %1 ཆེས་ཆེ་བའི་བསྐྱར་ཟློས་ཀྱི་ཚད་གཞི་ནི་1 - - + + max class repeat %1 ཆེས་ཆེ་བའི་འཛིན་གྲྭ་བསྐྱར་ཟློས་བྱས་ན་%1 - - + + max sequence %1 ཚད་གཞི་མཐོ་ཤོས་ཀྱི་གོ་རིམ་བརྒྱ་ཆ་1 - + ukui-control-center is already running! ཝུའུ་ཁི་ལན་གྱི་ཚོད་འཛིན་ལྟེ་གནས་འཁོར་སྐྱོད་བྱེད་བཞིན་ཡོད། - + ukui-control-center is disabled! ཝུའུ་ཁི་ལན་གྱི་ཚོད་འཛིན་ལྟེ་གནས་ནི་དབང་པོ་སྐྱོན་ཅན་ཡིན། - + ukui-control-center ཝུའུ་ཁི་ལན་གྱི་ཚོད་འཛིན་ལྟེ་གནས། - 简体中文 - 简体中文 + 简体中文 - English - དབྱིན་སྐད། + དབྱིན་སྐད། - བོད་ཡིག - བོད་ཡིག + བོད་ཡིག @@ -4011,12 +4037,12 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག མགྱོགས་ལམ་གཏན་འཁེལ་བྱ་དགོས། - + Edit Shortcut མགྱོགས་ལམ་རྩོམ་སྒྲིག་བྱེད་པ། - + Programs are not allowed to be added. གོ་རིམ་ཁ་སྣོན་བྱས་མི་ཆོག @@ -4038,138 +4064,157 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Screenlock - + Screenlock བརྙན་ཤེལ་གྱི་སྒོ་བརྒྱབ་པ + Screenlock Interface བརྙན་ཤེལ་གྱི་འབྲེལ་མཐུད། + /Screenlock/Screenlock Interface - - + Show message on lock screen ཟྭ་ངོས་སུ་ཆ་འཕྲིན་མངོན་པར་བྱས་ཡོད། - - + Show picture of screenlock on screenlogin བརྙན་ཤེལ་སྟེང་གི་བརྙན་ཤེལ་གྱི་པར་རིས་འགྲེམས་སྟོན་བྱས། /Screenlock/Show picture of screenlock on screenlogin - - + + Related Settings + འབྲེལ་ལྡན་སྒྲིག་འགོད་ + + + + Monitor Off + སྒོ་རྒྱག་འཆར་ཆས་ + + + + + Set + ཉི་ནུབ + + + + Screensaver + བརྙན་ཡོལ་སྲུང་སྐྱོབ་ + + Lock screen when screensaver boot - བརྙན་ཤེལ་གྱི་ལྷམ་ཡུ་རིང་གི་དུས་སུ་བརྙན་ཤེལ་ལ་ཟྭ་རྒྱག + བརྙན་ཤེལ་གྱི་ལྷམ་ཡུ་རིང་གི་དུས་སུ་བརྙན་ཤེལ་ལ་ཟྭ་རྒྱག /Screenlock/Lock screen when screensaver boot - + Lock screen delay བརྙན་ཤེལ་གྱི་དུས་ཚོད་འགོར་འགྱངས - - + + Browse ལྟ་ཀློག་བྱེད་པ། /Screenlock/Browse - - + + Online Picture དྲ་ཐོག་པར་རིས། /Screenlock/Online Picture - - + + Reset To Default བསྐྱར་དུ་ཁ་ཆད་དང་འགལ་བའི་གནས་ /Screenlock/Reset To Default - + 1min 1min - + 5min 5min - + 10min 10min - + 30min 30min - + 45min 45min - + 1hour 1hour - + 2hour 2hour - + 3hour 3hour - + Never གཏན་ནས་བྱེད་མི་ - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Wallpaper files (*.jpg *.jpeg *.bmp *.dib *.png *.jfif *jpe *.gif *.tif *.tiff *wdp) - + select custom wallpaper file ཡུལ་སྲོལ་གོམས་གཤིས་ཀྱི་གྱང་ཤོག་ཡིག་ཆ་བདམས་པ - + Select བདམས་ཐོན་བྱུང་བ། - + Position: གོ་གནས་ནི། - + FileName: ཡིག་ཆའི་མིང་ནི། - + FileType: ཡིག་ཆའི་རིགས་དབྱིབས་ནི། - + Cancel ཕྱིར་འཐེན། @@ -4178,174 +4223,188 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Screensaver - + Screensaver བརྙན་ཤེལ་གྱི་བརྙན་ཤེལ་འཕྲུལ་ཆས། - - + Idle time སྒྱིད་ལུག་གི་དུས་ཚོད། /Screensaver/Idle time - + Lock screen when activating screensaver བརྙན་ཤེལ་ལ་སྐུལ་སློང་བྱེད་སྐབས་བརྙན་ཤེལ་ལ་ཟྭ་རྒྱག་པ། - - + Screensaver program བརྙན་ཤེལ་གྱི་འཆར་གཞི། /Screensaver/Screensaver program - + View ལྟ་ཚུལ། - + UKUI UKUI - + Blank_Only Blank_Only - + Customize ཡུལ་སྲོལ་གོམས་གཤིས་ - - + + 5min 5min - - + + 10min 10min - + 15min 15min - - + + 30min 30min - + 1hour 1hour - + Never གཏན་ནས་བྱེད་མི་ - + Screensaver source བརྙན་ཤེལ་གྱི་འབྱུང་ཁུངས། - - + + Select བདམས་ཐོན་བྱུང་བ། - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) Wallpaper files (*.jpg *.jpeg *.bmp *.dib *.png *.jfif *jpe *.gif *.tif *.tiff *.svg) - + select custom screensaver dir ཡུལ་སྲོལ་གོམས་གཤིས་ཀྱི་བརྙན་ཤེལ་གྲོན་ཆུང་བྱེད་མཁན་བདམས་པ་ - + Position: གོ་གནས་ནི། - + FileName: ཡིག་ཆའི་མིང་ནི། - + FileType: ཡིག་ཆའི་རིགས་དབྱིབས་ནི། - + Cancel ཕྱིར་འཐེན། - + Switching time བརྗེ་རེས་བྱེད་པའི་དུས་ཚོད། - + 1min 1min - + Ordinal སྲོལ་ཡིག - + Random སྐབས་བསྟུན་རང་བཞིན། - + Random switching སྐབས་བསྟུན་གྱིས་བརྗེ་རེས་བྱེད་པ - + Text(up to 30 characters): ཡི་གེ(ཆེས་མང་ན་ཡི་གེ་30ཡོད་པ་གཤམ་གསལ། ) - + Show rest time ངལ་གསོའི་དུས་ཚོད་མངོན་པ། - + + Lock screen when screensaver boot + བརྙན་ཤེལ་གྱི་ལྷམ་ཡུ་རིང་གི་དུས་སུ་བརྙན་ཤེལ་ལ་ཟྭ་རྒྱག + + + Text position ཡི་གེའི་གོ་གནས། - + Centered ལྟེ་བར་འཛིན་པ། - + Randow(Bubble text) ལན་ཏུའོ་(ལྦུ་བ་ཅན་གྱི་ཡི་གེ) + + SearchWidget + + + + + + No search results + འཚོལ་ཞིབ་བྱས་འབྲས་མེད་པ། + + ShareMain @@ -4446,19 +4505,18 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག 确认退出程序! - + Remote Desktop རྒྱང་རིང་གི་ཅོག་ཙེ། - + Allow others to view your desktop མི་གཞན་གྱིས་ཁྱོད་ཀྱི་ཅོག་ཙེའི་སྟེང་གི་ཅོག་ཙེ - /Vino/Allow others to view your desktop - + Allow connection to control screen འབྲེལ་མཐུད་བྱས་ནས་བརྙན་ཤེལ་ཚོད་འཛིན་བྱེད་དུ /Vino/Allow connection to control screen @@ -4469,13 +4527,13 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག བདེ་འཇགས། - + You must confirm every visit for this machine ཁྱེད་ཚོས་ངེས་པར་དུ་འཕྲུལ་ཆས་འདིའི་འཚམས་འདྲི་ཚང་མ་གཏན་འཁེལ /Vino/You must confirm every visit for this machine - + Require user to enter this password: སྤྱོད་མཁན་གྱིས་གསང་གྲངས་འདིའི་ནང་དུ་འཇུག་དགོས་པའི་བླང་བྱ་ @@ -4486,50 +4544,120 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Shortcut - - + + System Shortcut མ་ལག་གི་མྱུར་ལམ། /Shortcut/System Shortcut - + Custom Shortcut འགག་སྒོའི་མྱུར་ལམ། - + Shortcut མྱུར་བགྲོད་གཞུང་ལམ། - + Add ཁ་སྣོན་བརྒྱབ་པ། /Shortcut/Add - + Customize Shortcut མགྱོགས་ལམ་གཏན་འཁེལ་བྱ་དགོས། /Shortcut/Customize Shortcut - + Edit རྩོམ་སྒྲིག - + Delete བསུབ་པ། - + or ཡང་ན་དེ་ལྟར་ + + SpliceDialog + + + Dialog + གླེང་མོལ། + + + TextLabel + ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར + + + + Splice Screen + + + + + + Cancel + ཕྱིར་འཐེན། + + + + + Ok + + + + + + Splicing Method + + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + + + + + Row %1, Column %2 + + + + + Select screen + + + StatusDialog @@ -4546,13 +4674,13 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Theme - + Window Theme སྒེའུ་ཁུང་གི་བརྗོད་བྱ་གཙོ /Theme/Window Theme - + Icon theme མཚོན་རྟགས་ཀྱི་བརྗོད་བྱ་གཙོ་ /Theme/Icon theme @@ -4562,7 +4690,7 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག ཚོད་འཛིན་གྱི་བརྗོད་བྱ་ - + Cursor theme བརྗོད་བྱ་གཙོ་བོ། /Theme/Cursor theme @@ -4574,14 +4702,14 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག - + Performance mode གྲུབ་འབྲས་ཐོབ་སྟངས། /Theme/Performance mode - + Transparency ཕྱི་གསལ་ནང་གསལ། /Theme/Transparency @@ -4592,144 +4720,178 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག བསྐྱར་དུ་ཁ་ཆད་དང་འགལ་བའི་གནས་ - - + + Theme བརྗོད་བྱ་གཙོ་བོ། - Default - ཁ་ཆད་དང་འགལ་ + ཁ་ཆད་དང་འགལ་ - + Light འོད་སྣང་། - + Dark མུན་ནག - + Auto - རང་འགུལ་གྱིས་རླངས་ + རང་འགུལ་གྱིས་རླངས་ - + Corlor - + ཁུ་རུའི་རིགས། - + Other - + དེ་མིན། - - + + Set - གཏན་འཁེལ་བྱ་དགོས། + གཏན་འཁེལ་བྱ་དགོས། - + Wallpaper - + གྱང་ཤོག - + Beep - + སྦྲང་མ། - + Blue-Crystal ཁ་དོག་སྔོན་པོའི་ཆུ་ཤེལ་ - - + + Light-Seeking འོད་ཟེར་འཚོལ་བ། - + DMZ-Black - DMZ-Black + DMZ-ནག་པོ - + DMZ-White - DMZ-White + DMZ-མི་དཀར - + Dark-Sense མུན་ནག་གི་ཚོར་སྣང་། - - + + + basic གཞི་རྩའི་ཆ་ནས - + Classic གནའ་གཞུང་། - + classic - + གནའ་གཞུང་། - + HeYin ཧའེ་དབྱིན། - + hp hp - + ukui ཝུའུ་ཁི་ལན་གྱིས་བཤད་རྒྱུར - + + daybreakBlue + ཉི་མ་ཤར་བའི་པུའུ་ལའེ་ + + + + jamPurple + ཤིང་ཏོག་བསྣུར་མ། + + + + magenta + མེ་དམར། + + + + sunRed + ཉི་མ་ཤར་བ། + + + + sunsetOrange + ཉི་མ་ནུབ་པའི་ཨོ་ལན་ཀེ་ལན། + + + + dustGold + གད་སྙིགས་བླུགས་སྣ་ཚོགས། + + + + polarGreen + གླིང་སྣེའི་ཀེ་ལིན། + + default - ཁ་ཆད་དང་འགལ་ + ཁ་ཆད་དང་འགལ་ TimeBtn - + Tomorrow སང་ཉིན། - + Yesterday ཁ་སང་། - + Today དེ་རིང་། - + %1 hours earlier than local ས་གནས་དེ་གའི་ཆུ་ཚོད་1ལས་སྔ་བ་ཡོད། - + %1 hours later than local ས་གནས་དེ་གའི་ཆུ་ཚོད་1ལས་ཆུ་ཚོད་1འ @@ -4752,12 +4914,12 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག དུས་ཚོད་བསྒྱུར་བཅོས་བྱ་དགོས། - + Search Timezone དུས་ཚོད་འཚོལ་ཞིབ་བྱེད་པའི་དུས་ - + To select a time zone, please click where near you on the map and select a city from the nearest city དུས་ཚོད་ཀྱི་ས་ཁོངས་འདེམས་དགོས་ན། ས་བཀྲའི་སྟེང་གི་ཉེ་འདབས་ཀྱི་ས་ཆ་གང་དུ་སོང་ནས་ཆེས་ཉེ་བའི་གྲོང་ཁྱེར་ནས་གྲོང་ཁྱེར་ཞིག་འདེམས་རོགས། @@ -4856,18 +5018,18 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག UkccAbout - - + + Settings སྒྲིག་བཀོད། - + Version: པར་གཞི་འདི་ལྟ་སྟེ། - + Service and Support: ཞབས་ཞུ་དང་རྒྱབ་སྐྱོར་བྱ་རྒྱུ་སྟེ། @@ -4875,49 +5037,61 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག UnifiedOutputConfig - + resolution གྲོས་ཆོད། - + orientation ཁ་ཕྱོགས་ - + arrow-up མདའ་འཕེན་པ། - + 90° arrow-right 90°མདའ་གཡས་ཕྱོགས་པ། - - + + arrow-down མདའ་མོ་མར་ཕབ་པ། - + 90° arrow-left 90°མདའ་གཡོན་ཕྱོགས་སུ་ཡོད། - + + auto rotation + + /Display/auto rotation + + + frequency ཐེངས་གྲངས། - + + screen zoom + བརྙན་ཤེལ་ཆེ་རུ་གཏོང་བ། + /Display/screen zoom + + + auto @@ -4933,18 +5107,14 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག - Password གསང་གྲངས། - /Userinfo/Password - - + Type རིགས་དབྱིབས་ - /Userinfo/Type @@ -4958,15 +5128,12 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག - Login no passwd ཐོ་འགོད་བྱས་མེད་པའི་ལམ་ཡིག - /Userinfo/Login no passwd - enable autoLogin - རང་འགུལ་གྱིས་རང་འགུལ་གྱིས་རང་འགུལ + རང་འགུལ་གྱིས་རང་འགུལ་གྱིས་རང་འགུལ /Userinfo/enable autoLogin @@ -4975,92 +5142,102 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག སྤྱོད་མཁན་གཞན་དག - + root རྩ་བ། - + CurrentUser གློག་སྒུལ་འཕྲུལ་འཁོར། + /Userinfo/CurrentUser - + OthersUser - དེ་མིན་ད་དུང་User + དེ་མིན་ད་དུང + /Userinfo/OthersUser - + Passwd ཕར་འགྲོ་ཚུར་འོང་བྱེད་མཁན། - + Groups ཚོ་ཆུང་། - + LoginWithoutPwd - LoginWithoutPwd + གསང་རྟགས + /Userinfo/LoginWithoutPwd - + AutoLoginOnBoot རང་འགུལ་གྱིས་རང་འགུལ་གྱིས་རང་འགུལ་གྱིས་རང་འགུལ་གྱིས + /Userinfo/AutoLoginOnBoot - + + Add + ཁ་སྣོན་བརྒྱབ་པ། + /Userinfo/Add + + + Warning ཐ་ཚིག་སྒྲོག་པ། - + The user is logged in, please delete the user after logging out སྤྱོད་མཁན་གྱིས་ཐོ་འགོད་བྱས་ཚར་རྗེས་སྤྱོད་མཁན་བསུབ་རོགས། - + The account type of “%1” has been modified, will take effect after logout, whether to logout? "%1"ཡི་རྩིས་ཐོའི་རིགས་ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཐོ་འགོད་བྱས་རྗེས་ནུས་པ་འཐོན་རྒྱུ་ཡིན་ནམ། - + logout later རྗེས་སུ་ཐོ་འགོད་བྱེད་པ། - + logout now ད་ལྟ་ཐོ་འགོད་བྱེད་བཞིན་ཡོད། - + Hint གསལ་འདེབས་བྱེད་པ - + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? མ་ལག་འདིས་སྤྱོད་མཁན་གཅིག་གིས་རང་འགུལ་གྱིས་ཐོ་འགོད་བྱེད་དུ་འཇུག་པ་རེད། ཁ་ཕྱེ་རྗེས་སྤྱོད་མཁན་གཞན་དག་གི་རང་འགུལ་ཐོ་འགོད་ཀྱི་སྒོ་རྒྱག་རྒྱུ་རེད། ཁ་ཕྱེ་བ་ཡིན་ནམ། - + Trun on ཐེ་ལུན་གྱིས་བཤད་རྒྱུར། - + Close on སྒོ་རྒྱག་པ། - + Standard ཚད་གཞི། - + Admin སྲིད་འཛིན་དོ་དམ། @@ -5069,7 +5246,7 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག UserInfoIntel - + Current User མིག་སྔའི་སྤྱོད་མཁན། /UserinfoIntel/Current User @@ -5081,10 +5258,10 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག - - + + Change pwd - pwd བརྗེ་བ། + བརྗེ་བ། /UserinfoIntel/Change pwd @@ -5109,61 +5286,61 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག - + Other Users སྤྱོད་མཁན་གཞན་དག /UserinfoIntel/Other Users - + User Info Intel User Info Intel - + Change Tel གློག་འཕྲིན་བརྗེ་བ། /UserinfoIntel/Change Tel - + Delete user སྤྱོད་མཁན་བསུབ་པ། /UserinfoIntel/Delete user - + Change user name སྤྱོད་མཁན་གྱི་མིང་བསྒྱུར་དགོས། /UserinfoIntel/Change user name - + standard user ཚད་ལྡན་སྤྱོད་མཁན། - + administrator དོ་དམ་པ། - + root རྩ་བ། - + Add new user སྤྱོད་མཁན་གསར་པ་ཁ་སྣོན་ - + set pwd - གཏན་འཁེལ་བྱས་པའི་pwd + གཏན་འཁེལ་བྱས་པའི - + Change བསྒྱུར་བཅོས་བྱ་དགོས། @@ -5171,27 +5348,27 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག UtilsForUserinfo - + Passwd ཕར་འགྲོ་ཚུར་འོང་བྱེད་མཁན། - + Type རིགས་དབྱིབས་ - + Del ཏེ་ཨར། - + Standard ཚད་གཞི། - + Admin སྲིད་འཛིན་དོ་དམ། @@ -5199,7 +5376,7 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Vino - + Vino ཝེ་ནོ་ཡིས་བཤད་རྒྱུར། @@ -5208,134 +5385,138 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Vpn - Vpn - Vpn + Vpn + + + Add a vpn connection + vpnས སྦྲེལ་མཐུད་ཁ་སྣོན་བྱས་པ། + /Vpn/Add a vpn connection - VPN - VPN + VPN Wallpaper + Desktop Background ཅོག་ཙེའི་རྒྱབ་ལྗོངས། + /Wallpaper/Desktop Background - + Mode དཔེ་དབྱིབས་ - - + + Browse ལྟ་ཀློག་བྱེད་པ། /Wallpaper/Browse - - + + Online Picture དྲ་ཐོག་པར་རིས། /Wallpaper/Online Picture - - + + Reset To Default བསྐྱར་དུ་ཁ་ཆད་དང་འགལ་བའི་གནས་ /Wallpaper/Reset To Default - - + + Cancel ཕྱིར་འཐེན། - - - + + Background རྒྱབ་ལྗོངས། - + picture པར་རིས། - + color ཁ་དོག - + wallpaper གྱང་ཤོག - + centered ལྟེ་བར་བཟུང་བ། - + scaled གཞི་ཁྱོན་ལྡན་པ། - + stretched བརྐྱངས་པ། - + zoom ཆེ་རུ་གཏོང་བ། - + spanned ཁྱབ་ཁོངས་ལས་བརྒལ་བ། - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Wallpaper files (*.jpg *.jpeg *.bmp *.dib *.png *.jfif *jpe *.gif *.tif *.tiff *wdp) - - + + select custom wallpaper file ཡུལ་སྲོལ་གོམས་གཤིས་ཀྱི་གྱང་ཤོག་ཡིག་ཆ་བདམས་པ - - + + Select བདམས་ཐོན་བྱུང་བ། - - + + Position: གོ་གནས་ནི། - - + + FileName: ཡིག་ཆའི་མིང་ནི། - - + + FileType: ཡིག་ཆའི་རིགས་དབྱིབས་ནི། @@ -5343,12 +5524,18 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག Widget - + night mode མཚན་མོའི་རྣམ་པ། - /Display/night mode + /display/night mode + + as main + གཙོ་བོར་འཛིན་དགོས། + + + screen zoom བརྙན་ཤེལ་ཆེ་རུ་གཏོང་བ། @@ -5371,7 +5558,7 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག བརྙན་ཤེལ་གྱི་%1ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཉར་ཚགས་བྱེད་དགོས་སམ། <br/> <font style= 'color:#626c6e'>དུས་ཚོད་སྐར་ཆ་29ཡི་རྗེས་སུ་སྒྲིག་བཀོད་ཉར་ཚགས་བྱེད་རྒྱུ་རེད། </font> - + Warnning ཉེན་བརྡ་གཏོང་བ། @@ -5381,212 +5568,254 @@ II.Javaལག་རྩལ་གྱི་ཚད་བཀག ཆ་འཕྲིན། - + Night Mode མཚན་མོའི་རྣམ་པ། + /Display/Night Mode - + Open སྒོ་ཕྱེ་བ། - + Time དུས་ཚོད། - - + + Custom Time གོམས་སྲོལ་གྱི་དུས་ཚོད། - + to དེ་ལྟར་བྱས་ན་ - + Color Temperature ཁ་དོག་གི་དྲོད་ཚད། - + Warmer སྔར་ལས་དྲོ་བ། - + Colder གྲང་ངར་ཆེ་བ། - + Multi-screen བརྙན་ཤེལ་མང་པོ། - + First Screen བརྙན་ཤེལ་དང་པོ། - + Vice Screen བརྙན་ཤེལ་གཞོན་པ། - + Extend Screen བརྙན་ཤེལ་རིང་དུ་གཏོང་ - + Clone Screen ཁུ་ལོན་གྱི་བརྙན་ཤེལ། - + + + Splice Screen + + + + + The zoom has been modified, it will take effect after you log off + + + + monitor ལྟ་ཞིབ་ཡོ་བྱད། /display/monitor - + + open monitor + སྒོ་འབྱེད་ལྟ་ཞིབ་ཡོ་བྱད + + Theme follow night mode བརྗོད་བྱ་གཙོ་བོ་ནི་མཚན་མོའི་རྣམ་ - + Auto Brightness རང་འགུལ་གྱི་འོད་ཟེར་ - + Adjust screen brightness by ambient ཁོར་ཡུག་གིས་བརྙན་ཤེལ་གྱི་གསལ་ཚད་སྙོམས་སྒྲིག་བྱེད་པ། - + Dynamic light འགུལ་རྣམ་གྱི་འོད་སྣང་། /Display/Dynamic light - + Optimize display content to extend battery life འགྲེམས་སྟོན་གྱི་ནང་དོན་ལེགས་སུ་བཏང་ནས་གློག་གཡིས་ཀྱི་ཚེ་ཚད་ཇེ་ - + resolution གྲོས་ཆོད། - + orientation ཁ་ཕྱོགས་ - + frequency ཐེངས་གྲངས། - - + + scale + གཞི་ཁྱོན། + + Hint གསལ་འདེབས་བྱེད་པ - - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> - བརྙན་ཤེལ་གྱི་%1ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཉར་ཚགས་བྱེད་དགོས་སམ། <br/> <font style= 'color:#626c6e'>དུས་ཚོད་སྐར་ཆ་14ཡི་རྗེས་སུ་སྒྲིག་བཀོད་ཉར་ཚགས་བྱེད་རྒྱུ་རེད། </font> + + Splicing Method + - + + Change + བསྒྱུར་བཅོས་བྱ་དགོས། + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> + བརྙན་ཤེལ་གྱི་%1ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཉར་ཚགས་བྱེད་དགོས་སམ། <br/> <font style= 'color:#626c6e'>དུས་ཚོད་སྐར་ཆ་14ཡི་རྗེས་སུ་སྒྲིག་བཀོད་ཉར་ཚགས་བྱེད་རྒྱུ་རེད། </font> + + + Save གྲོན་ཆུང་བྱེད་དགོས། - + Not Save ཉར་ཚགས་མི་བྱེད་པ། - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> བརྙན་ཤེལ་གྱི་%1ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཉར་ཚགས་བྱེད་དགོས་སམ། <br/> <font style= 'color:#626c6e'>སྒྲིག་བཀོད་དེ་%2秒</font>ཡི་རྗེས་སུ་ཉར་ཚགས་བྱེད་རྒྱུ་རེད། - The zoom function needs to log out to take effect - ཆེ་རུ་གཏོང་བའི་ནུས་པ་ཐོ་འགོད་བྱས་ནས་ནུས་པ་ཐོན་པར་བྱ་དགོས། + ཆེ་རུ་གཏོང་བའི་ནུས་པ་ཐོ་འགོད་བྱས་ནས་ནུས་པ་ཐོན་པར་བྱ་དགོས། - + Log out now ད་ལྟ་ཕྱིར་འཐེན་བྱ་དགོས། - + Later རྗེས་སུ། - - + + + (Effective after logout) + + + + Open time should be earlier than close time! སྒོ་འབྱེད་པའི་དུས་ཚོད་ནི་ཉེ་བའི་དུས་ཚོད་ལས་སྔ་བ་རེད། - + All Day ཉིན་གང་བོར། - + + Follow the sunrise and sunset ཉི་མ་ཤར་བ་དང་ཉི་མ་ནུབ་པའི་རྗེས་སུ་ - - - - + + + + Brightness འོད་ཆེམ་ཆེམ་དུ་འཕྲོ + /Display/Brightness - - - + + + please insure at least one output! མ་མཐར་ཡང་ཐོན་ཚད་གཅིག་ལ་ཉེན་ཁ་བཟོ་རོགས། - - - - - - + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + བརྙན་ཤེལ་གྱི་%1ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཉར་ཚགས་བྱེད་དགོས་སམ། <br/> <font style= 'color:#626c6e'>དུས་ཚོད་སྐར་ཆ་14ཡི་རྗེས་སུ་སྒྲིག་བཀོད་ཉར་ཚགས་བྱེད་རྒྱུ་རེད། </font> + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> + བརྙན་ཤེལ་གྱི་%1ལ་བཟོ་བཅོས་བརྒྱབ་ཟིན་པས་ཉར་ཚགས་བྱེད་དགོས་སམ། <br/> <font style= 'color:#626c6e'>སྒྲིག་བཀོད་དེ་%2秒</font>ཡི་རྗེས་སུ་ཉར་ཚགས་བྱེད་རྒྱུ་རེད། + + + + + + + Warning ཐ་ཚིག་སྒྲོག་པ། - - + + Sorry, your configuration could not be applied. Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. དགོངས་པ་མ་ཚོམ། ཁྱེད་ཚོའི་བཀོད་སྒྲིག་བཀོལ་སྤྱོད་བྱེད་ཐབས་མེད། @@ -5596,44 +5825,44 @@ Common reasons are that the overall screen size is too big, or you enabled more addShortcutDialog - + Dialog གླེང་མོལ། - + Exec ཨེ་ཤེ་ཡ་དང་ཞི་བདེ - + Name མིང་། - - + + TextLabel ཡི་གེ་ལ་པེར་གྱིས་བཤད་རྒྱུར - + Key ལྡེ་མིག - + Save གྲོན་ཆུང་བྱེད་དགོས། - + Open སྒོ་ཕྱེ་བ། - - + + Cancel ཕྱིར་འཐེན། @@ -5643,60 +5872,60 @@ Common reasons are that the overall screen size is too big, or you enabled more མགྱོགས་ལམ་ཁ་སྣོན་བྱས་པ། - + Please enter a shortcut མྱུར་བགྲོད་གཞུང་ལམ་ནང་དུ་འཛུལ་རོགས། - + Desktop files(*.desktop) Desktop files (*.desktop) - + select desktop ཅོག་ཙེའི་སྟེང་ནས་གདམ་ - - - + + + Invalid application གོ་མི་ཆོད་པའི་ཉེར་སྤྱོད། - - - + + + Shortcut conflict མྱུར་བགྲོད་གདོང་གཏུག - - - + + + Invalid shortcut གོ་མི་ཆོད་པའི་མྱུར་བགྲོད་གཞུང་ལམ། - - - + + + Name repetition མིང་བསྐྱར་ཟློས་བྱེད་པ། - + Unknown error ཤེས་མེད་པའི་ནོར་འཁྲུལ། - + Shortcut cannot be empty མྱུར་ལམ་ནི་སྟོང་བ་ཡིན་མི་སྲིད། - + Name cannot be empty མིང་སྟོང་པ་ཡིན་མི་སྲིད། @@ -5716,12 +5945,12 @@ Common reasons are that the overall screen size is too big, or you enabled more GID: - GID: + སྤྱོད་མཁན་: GNum: - GNum: + ཁོངས་མི།: @@ -5738,20 +5967,20 @@ Common reasons are that the overall screen size is too big, or you enabled more - + Tips གསལ་འདེབས་བྱེད་ཐབས། - + Invalid Id! གོ་མི་ཆོད་པའི་ཐོབ་ཐང་ལག་ཁྱེར་ - + OK འགྲིགས། diff --git a/shell/res/i18n/en.ts b/shell/res/i18n/en.ts new file mode 100644 index 0000000..cf6adf3 --- /dev/null +++ b/shell/res/i18n/en.ts @@ -0,0 +1,5460 @@ + + + + + About + + + About and Support + + + + + About + + + + + System Summary + + + + + Privacy and agreement + + + + + Support + + + + + + Version + + /About/version + + + + Version Number + + + + + Patch Version + + + + + HostName + + + + + + Kernel + + /About/Kernel + + + + + CPU + + /About/CPU + + + + + Memory + + /About/Memory + + + + + Disk + + + + + + Desktop + + /About/Desktop + + + + + User + + /About/User + + + + Copyright © 2009-%1 %2. All rights reserved. + + + + + Send optional diagnostic data + + + + + By sending us diagnostic data, improve the system experience and solve your problems faster + + + + + <<Protocol>> + + + + + and + + + + + <<Privacy>> + + + + + Wechat code scanning obtains HP professional technical support + + + + + See more about Kylin Tianqi edu platform + + + + + Learn more HP user manual>> + + + + + See user manual>> + + + + + Status + + /About/Status + + + + Serial + + + + + DateRes + + + + + Openkylin + + + + + KylinSoft + + + + + + Inactivated + + + + + Trial expiration time + + + + + + Active + + + + + Activated + + + + + + Extend + + + + + + + avaliable + + + + + + expired + + + + + The system needs to be restarted to set the HostName, whether to reboot + + + + + Reboot Now + + + + + Reboot Later + + + + + AddAutoBoot + + + + Name + + + + + + Exec + + + + + + Comment + + + + + Add autoboot program + + + + + Open + + + + + + Cancel + + + + + Certain + + + + + Desktop files(*.desktop) + + + + + select autoboot desktop + + + + + Select + + + + + desktop file not allowed add + + + + + desktop file not exist + + + + + AddBtn + + + Add + + + + + AddButton + + + Add + + + + + AddInputMethodDialog + + + Dialog + + + + + Select the input method to add + + + + + No + + + + + Yes + + + + + + keyboard + + + + + + Tibetan + + + + + With ASCII numbers + + + + + Input Method + + + + + AddLanguageDialog + + + Dialog + + + + + No + + + + + Yes + + + + + Add Language + + + + + Search + + + + + Area + + + Area + + + + + English (US) + + + + + Simplified Chinese (CN) + + + + + Tibetan (CN) + + + + + solar calendar + + + + + lunar + + + + + monday + + + + + sunday + + + + + 12 Hours + + + + + 24 Hours + + + + + Simplified Chinese + + + + + English + + + + + Tibetan + + + + + Modify the current region need to logout to take effect, whether to logout? + + + + + Logout later + + + + + Logout now + + + + + Modify the first language need to reboot to take effect, whether to reboot? + + + + + Reboot later + + + + + Reboot now + + + + + AreaUi + + + Regional Format + + /Area/Regional Format + + + + Calendar + + /Area/Calendar + + + + First Day Of Week + + /Area/First Day Of Week + + + + Date + + /Area/Date + + + + Time + + /Area/Time + + + + Language Format + + /Area/Language Format + + + + System Language + + /Area/System Language + + + + AutoBoot + + + Auto Boot + + + + + Delete + + + + + Desktop files(*.desktop) + + + + + select autoboot desktop + + + + + Select + + + + + Cancel + + + + + Autoboot Settings + + /autoboot/Autoboot Settings + + + + Backup + + + + Backup + + + + + Back up your files to other drives, and when the original files are lost, damaged, or deleted, +you can restore them to ensure the integrity of your system. + + + + + + Begin backup + + /Backup/Begin backup + + + + + Restore + + + + + View a list of backed-upfiles to backed up files to the system + + + + + + Begin restore + + /Backup/Begin restore + + + + Backup Restore + + + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. + + + + + View the backup list and restore the backup file to the system + + + + + Backup and Restore + + + + + All data stored on the computer will be permanently erased,and the system will revert to + its original factory state when this operation is completed. + + + + + + Clear and restore + + /Backup/Clear and restore + + + + System Recovery + + + + + BrightnessFrame + + + Failed to get the brightness information of this monitor + + + + + ChangeFaceIntelDialog + + + + Change User Face + + /UserinfoIntel/Change User Face + + + + History + + + + + System + + + + + + Cancel + + + + + Confirm + + + + + select custom face file + + + + + Select + + + + + Position: + + + + + FileName: + + + + + FileType: + + + + + Warning + + + + + The avatar is larger than 2M, please choose again + + + + + ChangeGroupIntelDialog + + + Dialog + + + + + User Group Settings + + + + + User groups available in the system + + + + + Add user group + + + + + ChangePhoneIntelDialog + + + Dialog + + + + + changephone + + + + + Please input old phone num + + + + + + + TextLabel + + + + + GetVerifyCode + + + + + submit + + + + + Change Phone + + + + + Phone number + + + + + SMS verification code + + + + + Please input old phone number + + + + + Next + + + + + + Please enter new mobile number + + + + + + Submit + + + + + changed success + + + + + + You have successfully modified your phone + + + + + + Recapture + + + + + + + Network connection failure, please check + + + + + + GetCode + + + + + + + Phone is lock,try again in an hour + + + + + + + Phone code is wrong + + + + + Current login expired,using wechat code! + + + + + + + Unknown error, please try again later + + + + + Phone can not same + + + + + + finished + + + + + + Phone number already in used! + + + + + ChangePinIntelDialog + + + Dialog + + + + + Change Password + + + + + ChangePwdIntelDialog + + + Change Pwd + + + + + Cancel + + + + + Confirm + + + + + General Pwd + + + + + Old Password + + + + + + New Password + + + + + + New Password Identify + + + + + + Please set different pwd! + + + + + + Inconsistency with pwd + + + + + Old pwd is wrong! + + + + + New pwd is too similar with old pwd! + + + + + Check old pwd failed because of unknown reason! + + + + + Password length needs to more than %1 character! + + + + + Password length needs to less than %1 character! + + + + + Password cannot be made up entirely by Numbers! + + + + + ChangeTypeIntelDialog + + + Change Account Type + + + + + standard user + + + + + Standard users can use most software, but cannot install software and change system settings + + + + + administrator + + + + + Administrators can make any changes they need + + + + + Make sure that there is at least one administrator on the computer + + + + + Cancel + + + + + Confirm + + + + + ChangeUserLogo + + + User logo + + + + + System Logos + + + + + Select Local Logo + + + + + + Cancel + + + + + Confirm + + + + + select custom face file + + + + + Select + + + + + Position: + + + + + FileName: + + + + + FileType: + + + + + Warning + + + + + The avatar is larger than 1M, please choose again + + + + + ChangeUserNickname + + + Set Nickname + + + + + UserName + + + + + NickName + + + + + nickName already in use. + + + + + Cancel + + + + + Confirm + + + + + The length must be 1~%1 characters! + + + + + ChangeUserPwd + + + Change password + + + + + + + Current Pwd + + + + + + + + New Pwd + + + + + + + + Sure Pwd + + + + + Cancel + + + + + + + Confirm + + + + + + Inconsistency with pwd + + + + + Same with old pwd + + + + + Pwd Changed Succes + + + + + Authentication failed, input authtok again! + + + + + Contains illegal characters! + + + + + current pwd cannot be empty! + + + + + new pwd cannot be empty! + + + + + sure pwd cannot be empty! + + + + + ChangeUserType + + + UserType + + + + + Select account type (Ensure have admin on system): + + + + + administrator + + + + + standard user + + + + + change system settings, install and upgrade software. + + + + + use most software, cannot change system settings. + + + + + Note: Effective After Logout!!! + + + + + Confirm + + + + + Cancel + + + + + ChangeValidIntelDialog + + + Dialog + + + + + Password Validity Setting + + + + + Current passwd validity: + + + + + Adjust date to: + + + + + Cancel + + + + + Certain + + + + + ChangtimeDialog + + + time + + + + + year + + + + + month + + + + + day + + + + + ColorDialog + + + Dialog + + + + + 选择自定义颜色 + + + + + HEX + + + + + RGB + + + + + Cancel + + + + + OK + + + + + Custom color + + + + + CreateGroupDialog + + + Add New Group + + + + + Add user group + + + + + Name + + + + + Id + + + + + Cancel + + + + + Confirm + + + + + CreateGroupIntelDialog + + + Dialog + + + + + Add New Group + + + + + Group Name + + + + + Group Id + + + + + Group Members + + + + + Cancel + + + + + Certain + + + + + CreateUserIntelDialog + + + Add New Account + + + + + Account Type + + + + + standard user + + + + + Standard users can use most software, but cannot install the software and +change system settings + + + + + administrator + + + + + Administrators can make any changes they need + + + + + Cancel + + + + + Confirm + + + + + UserName + + + + + Password + + + + + Password Identify + + + + + + Inconsistency with pwd + + + + + Password length needs to more than %1 character! + + + + + Password length needs to less than %1 character! + + + + + The user name cannot be empty + + + + + The first character must be lowercase letters! + + + + + User name can not contain capital letters! + + + + + The user name is already in use, please use a different one. + + + + + User name length need to less than %1 letters! + + + + + The user name can only be composed of letters, numbers and underline! + + + + + The username is configured, please change the username + + + + + CreateUserNew + + + CreateUserNew + + + + + UserName + + + + + NickName + + + + + HostName + + + + + Pwd + + + + + SurePwd + + + + + + + + Required + + + + + verification + + + + + Select Type + + + + + Administrator + + + + + Users can make any changes they need + + + + + Standard User + + + + + Users cannot change system settings + + + + + Cancel + + + + + Confirm + + + + + + Inconsistency with pwd + + + + + + The nick name cannot be empty + + + + + nickName already in use. + + + + + nickName length must less than %1 letters! + + + + + Username's folder exists, change another one + + + + + Name corresponds to group already exists. + + + + + Contains illegal characters! + + + + + Username's length must be between 1 and %1 characters! + + + + + new pwd cannot be empty! + + + + + sure pwd cannot be empty! + + + + + CustomGlobalTheme + + + custom + + + + + CustomLineEdit + + + New Shortcut... + + + + + DateTime + + + DateTime + + + + + current date + + + + + titleLabel + + + + + Date + + + + + Current Date + + /Date/Current Date + + + + Other Timezone + + /Date/Other Timezone + + + + 24-hour clock + + /Date/24-hour clock + + + + Change timezone + + /Date/Change time zone + + + + Sync Time + + /Date/Sync Time + + + + Manual Time + + /Date/Manual Time + + + + Sync Server + + /Date/Sync Server + + + + Default + + + + + Customize + + + + + Server Address + + + + + Required + + + + + Save + + + + + change time + + + + + Add Timezone + + + + + Change Timezone + + + + + + + + + + + Sync failed + + + + + Set Time + + /Date/Set Time + + + + Set Date Manually + + /Date/Set Date Manually + + + + DefaultApp + + + Default App + + + + + No program available + + + + + Choose default app + + + + + Browser + + + + + Mail + + + + + Image Viewer + + + + + Audio Player + + + + + Video Player + + + + + Text Editor + + + + + Reset default apps to system recommended apps + + + + + Reset + + + + + DefaultAppWindow + + + Select Default Application + + + + + DefineGroupItemIntel + + + Edit + + + + + Delete + + + + + DefineShortcutItem + + + Delete + + + + + DelGroupIntelDialog + + + Dialog + + + + + TextLabel + + + + + Cancel + + + + + RemoveFile + + + + + Remind + + + + + DelUserIntelDialog + + + Delete + + + + + Define + + + + + Cancel + + + + + Delete the user, belonging to the user's desktop documents, favorites, music, pictures and video folder will be deleted! + + + + + DeleteUserExists + + + Delete user ' + + + + + '? And: + + + + + Keep desktop, files, favorites, music of the user + + + + + Delete whole data belong user + + + + + Cancel + + + + + Confirm + + + + + DigitalAuthIntelDialog + + + + + Enter Old Password + + + + + Forget Password? + + + + + + + + + Input New Password + + + + + Input Password + + + + + The password input is error + + + + + Confirm New Password + + + + + The password input is inconsistent + + + + + New password can not be consistent of old password + + + + + + Password Change Failed + + + + + DigitalPhoneIntelDialog + + + Please Enter Edu OS Password + + + + + The password input is error + + + + + DisplayPerformanceDialog + + + + Dialog + + + + + + Display Advanced Settings + + + + + + Performance + + + + + + Applicable to machine with discrete graphics, which can accelerate the rendering of 3D graphics. + + + + + + (Note: not support connect graphical with xmanager on windows.) + + + + + + Compatible + + + + + + Applicable to machine with integrated graphics, there is no 3D graphics acceleration. + + + + + + (Note: need connect graphical with xmanager on windows, use this option.) + + + + + + Automatic + + + + + + Auto select according to environment, delay the login time (about 0.5 sec). + + + + + + Threshold: + + + + + + Apply + + + + + + Reset + + + + + + (Note: select this option to use 3D graphics acceleration and xmanager.) + + + + + DisplaySet + + + Screen + + + + + + Display + + + + + DisplayWindow + + + + Form + + + + + + Display + + + + + monitor + + + + + as main + + + + + screen zoom + + + + + open monitor + + + + + Advanced + + + + + Mirror Display + + + + + follow the sunrise and sunset(17:55-05:04) + + + + + custom time + + + + + opening time + + + + + closing time + + + + + color temperature + + + + + warm + + + + + cold + + + + + Fonts + + + + Fonts + + + + + + Font size + + /Fonts/Font size + + + + + Fonts select + + /Fonts/Fonts select + + + + + Mono font + + /Fonts/Mono font + + + + Reset to default + + + + + Small + + + + + Large + + + + + HostNameDialog + + + Set HostName + + + + + HostName + + + + + Must be 1-64 characters long + + + + + Cancel + + + + + Confirm + + + + + InputPwdDialog + + + Set + + + + + Set Password + + + + + Must be 1-8 characters long + + + + + Cancel + + + + + Confirm + + + + + KbdLayoutManager + + + C + + + + + L + + + + + Variant + + + + + Add + + + + + Add Layout + + + + + Del + + + + + KeyValueConverter + + + System + + + + + Devices + + + + + Network + + + + + Personalized + + + + + Account + + + + + Datetime + + + + + Update + + + + + Security + + + + + Application + + + + + Investigation + + + + + KeyboardMain + + + Keyboard + + + + + Key board settings + + + + + Input settings + + /Keyboard/Input settings + + + + Key repeat + + /Keyboard/Key repeat + + + + Delay + + /Keyboard/Delay + + + + Short + + + + + Long + + + + + Speed + + /Keyboard/Speed + + + + Slow + + + + + Fast + + + + + Input test + + /Keyboard/Input test + + + + Key tips + + /Keyboard/Key tips + + + + LanguageFrame + + + Input Settings + + + + + Delete + + + + + LayoutManager + + + Dialog + + + + + Manager Keyboard Layout + + + + + Language + + + + + Country + + + + + Variant + + + + + Layout installed + + + + + Preview + + + + + Cancel + + + + + Install + + + + + MainWindow + + + Normal + + + + + + Maximize + + + + + + + + Settings + + + + + Search + + + + + Main menu + + + + + Minimize + + + + + Close + + + + + Help + + + + + About + + + + + Exit + + + + + Specified + + + + + Warning + + + + + This function has been controlled + + + + + MessageBox + + + Form + + + + + Attention + + + + + It takes effect after logging off + + + + + Logout Now + + + + + + Cancel + + + + + Reboot Now + + + + + This cleanup and restore need to be done after the system restarts, whether to restart and restore immediately? + + + + + System Backup Tips + + + + + MessageBoxDialog + + + Dialog + + + + + Message + + + + + You do not have administrator rights! + + + + + Factory Settings cannot be restored! + + + + + OK + + + + + MessageBoxPower + + + System Recovery + + + + + The battery is low,please connect the power + + + + + Keep the power connection, or the power is more than 25%. + + + + + Remind in 30 minutes + + + + + Got it + + + + + MessageBoxPowerIntel + + + Nothing has been entered, re-enter + + + + + Remind in 30 minutes + + + + + Got it + + + + + MouseUI + + + + Mouse + + + + + Pointer + + + + + Cursor + + + + + Dominant hand + + /Mouse/Dominant hand + + + + Left hand + + + + + Right hand + + + + + Scroll direction + + /Mouse/Scroll direction + + + + Forward + + + + + Reverse + + + + + Wheel speed + + /Mouse/Wheel speed + + + + + + + Slow + + + + + + + + Fast + + + + + Double-click interval time + + /Mouse/Double-click interval time + + + + Pointer speed + + /Mouse/Pointer speed + + + + Mouse acceleration + + /Mouse/Mouse acceleration + + + + Show pointer position when pressing ctrl + + /Mouse/Show pointer position when pressing ctrl + + + + Pointer size + + /Mouse/Pointer size + + + + Small(recommend) + + + + + Medium + + + + + Large + + + + + Blinking cursor in text area + + /Mouse/Blinking cursor in text area + + + + Cursor speed + + /Mouse/Cursor speed + + + + MyLabel + + + double-click to test + + + + + Notice + + + Notice + + + + + Notice Settings + + + + + NotFaze Mode + + + + + (Notification banners, prompts will be hidden, and notification sounds will be muted) + + + + + Get notifications from the app + + + + + Automatically turn on + + + + + to + + + + + Automatically turn on when multiple screens are connected + + + + + Automatically open in full screen mode + + + + + Allow automatic alarm reminders in Do Not Disturb mode + + + + + NoticeMenu + + + Beep sound when notified + + + + + Show message on screenlock + + + + + Show noticfication on screenlock + + + + + Notification Style + + + + + Banner: Appears in the upper right corner of the screen, and disappears automatically + + + + + Tip:It will be kept on the screen until it is closed + + + + + None:Notifications will not be displayed on the screen, but will go to the notification center + + + + + NumbersButtonIntel + + + clean + + + + + OutputConfig + + + resolution + + /Display/resolution + + + + + orientation + + /Display/orientation + + + + + arrow-up + + + + + + 90° arrow-right + + + + + + 90° arrow-left + + + + + + arrow-down + + + + + auto rotation + + /Display/auto rotation + + + + + frequency + + /Display/frequency + + + + screen zoom + + /Display/screen zoom + + + + auto + + + + + + + + %1 Hz + + + + + PhoneAuthIntelDialog + + + Wechat Auth + + + + + Phone Auth + + + + + Phone number + + + + + SMS verification code + + + + + + GetCode + + + + + Return + + + + + Commit + + + + + confirm + + + + + commit + + + + + Mobile number acquisition failed + + + + + + Recapture + + + + + + + + Network connection failure, please check + + + + + Phone is lock,try again in an hour + + + + + Phone code is wrong + + + + + Current login expired,using wechat code! + + + + + Unknown error, please try again later + + + + + Please use the correct wechat scan code + + + + + Printer + + + Printer + + + + + Printers + + + + + PrivacyDialog + + + Set + + + + + End User License Agreement and Privacy Policy Statement of Kylin + + + + + Dear users of Kylin operating system and relevant products, + This agreement describes your rights, obligations and prerequisites for your use of this product. Please read the clauses of the Agreement and the supplementary license (hereinafter collectively referred to as “the Agreement”) and the privacy policy statement for Kylin operating system (hereinafter referred to as “the Statement”). + “This product” in the Agreement and the Statement refers to “Kylin operating system software product” developed, produced and released by Kylinsoft Co., Ltd. and used for handling the office work or building the information infrastructure for enterprises and governments. “We” refers to Kylinsoft Co., Ltd. “You” refers to the users who pay the license fee and use the Kylin operating system and relevant products. + +End User License Agreement of Kylin +Release date of the version: July 30, 2021 +Effective date of the version: July 30, 2021 + The Agreement shall include the following content: + I. User license + II. Java technology limitations + III. Cookies and other technologies + IV. Intellectual property clause + V. Open source code + VI. The third-party software/services + VII. Escape clause + VIII. Integrity and severability of the Agreement + IX. Applicable law and dispute settlement + + I. User license + According to the number of users who have paid for this product and the types of computer hardware, we shall grant the non-exclusive and non-transferable license to you, and shall only allow the licensed unit and the employees signing the labor contracts with the unit to use the attached software (hereinafter referred to as “the Software”) and documents as well as any error correction provided by Kylinsoft. + 1. User license for educational institutions + In the case of observing the clauses and conditions of the Agreement, if you are an educational institution, your institution shall be allowed to use the attached unmodified binary format software and only for internal use. “For internal use” here refers to that the licensed unit and the employees signing the labor contracts with the unit as well as the students enrolled by your institution can use this product. + 2. Use of the font software + Font software refers to the software pre-installed in the product and generating font styles. You cannot separate the font software from the Software and cannot modify the font software in an attempt to add any function that such font software, as a part of this product, does not have when it is delivered to you, or you cannot embed the font software in the files provided as a commercial product for any fee or other remuneration, or cannot use it in equipment where this product is not installed. If you use the font software for other commercial purposes such as external publicity, please contact and negotiate with the font copyright manufacture to obtain the permissions for your relevant acts. + + II. Java technology limitations + You cannot change the “Java Platform Interface” (referred to as “JPI”, that is, the classes in the “java” package or any sub-package of the “java” package), whether by creating additional classes in JPI or by other means to add or change the classes in JPI. If you create an additional class as well as one or multiple relevant APIs, and they (i) expand the functions of Java platform; And (ii) may be used by the third-party software developers to develop additional software that may call the above additional APIs, you must immediately publish the accurate description of such APIs widely for free use by all developers. You cannot create or authorize other licensees to create additional classes, interfaces or sub-packages marked as “java”, “javax” and “sun” in any way, or similar agreements specified by Sun in any naming agreements. See the appropriate version of the Java Runtime Environment Binary Code License (located at http://jdk.java.net at present) to understand the availability of runtime code jointly distributed with Java mini programs and applications. + + III. Cookies and other technologies + In order to help us better understand and serve the users, our website, online services and applications may use the “Cookie” technology. Such Cookies are used to store the network traffic entering and exiting the system and the traffic generated due to detection errors, so they must be set. We shall understand how you interact with our website and online services by using such Cookies. + If you want to disable the Cookie and use the Firefox browser, you may set it in Privacy and Security Center of Firefox. If your use other browsers, please consult the specific schemes from the relevant suppliers. + In accordance with Article 76, paragraph 5 of the Network Security Law of the People's Republic of China, personal information refers to all kinds of information recorded in electronic or other ways, which can identify the natural persons’ personal identity separately or combined with other information, including but not limited to the natural person’s name, date of birth, identity certificate number, personal biological identification information, address and telephone number, etc. If Cookies contain the above information, or the combined information of non-personal information and other personal information collected through Cookie, for the purpose of this privacy policy, we shall regard the combined information as personal privacy information, and shall provide the corresponding security protection measures for your personal information by referring to Kylin Privacy Policy Statement. + + IV. Intellectual property clause + 1. Trademarks and Logos + This product shall be protected by the copyright law, trademark law and other laws and international intellectual property conventions. Title to the product and all associated intellectual property rights are retained by us or its licensors. No right, title or interest in any trademark, service mark, logo or trade name of us or its licensors is granted under the Agreement. Any use of Kylinsoft marked by you shall be in favor of Kylinsoft, and without our consent, you shall not arbitrarily use any trademark or sign of Kylinsoft. + 2. Duplication, modification and distribution + If the Agreement remains valid for all duplicates, you may and must duplicate, modify and distribute software observing GNU GPL-GNU General Public License agreement among the Kylin operating system software products in accordance with GNU GPL-GNU General Public License, and must duplicate, modify and distribute other Kylin operating system software products not observing GNU GPL-GNU General Public License agreement in accordance with relevant laws and other license agreements, but no derivative release version based on the Kylin operating system software products can use any of our trademarks or any other signs without our written consent. + Special notes: Such duplication, modification and distribution shall not include any software, to which GNU GPL-GNU General Public License does not apply, in this product, such as the software store, input method software, font library software and third-party applications contained by the Kylin operating system software products. You shall not duplicate, modify (including decompilation or reverse engineering) or distribute the above software unless prohibited by applicable laws. + + V. Open source code + For any open source codes contained in this product, any clause of the Agreement shall not limit, constrain or otherwise influence any of your corresponding rights or obligations under any applicable open source code license or all kinds of conditions you shall observe. + + VI. The third-party software/services + The third-party software/services referred to in the Agreement refer to relevant software/services developed by other organizations or individuals other than the Kylin operating system manufacturer. This product may contain or be bundled with the third-party software/services to which the separate license agreements are attached. When you use any third-party software/services with separate license agreements, you shall be bound by such separate license agreements. + We shall not have any right to control the third-party software/services in these products and shall not expressly or implicitly ensure or guarantee the legality, accuracy, effectiveness or security of the acts of their providers or users. + + VII. Escape clause + 1. Limited warranty + We guarantee to you that within ninety (90) days from the date when you purchase or obtain this product in other legal ways (subject to the date of the sales contract), the storage medium (if any) of this product shall not be involved in any defects in materials or technology when it is normally used. All compensation available to you and our entire liability under this limited warranty will be for us to choose to replace this product media or refund the fee paid for this product. + 2. Disclaimer + In addition to the above limited warranty, the Software is provided “as is” without any express or implied condition statement and warranty, including any implied warranty of merchantability, suitability for a particular purpose or non-infringement, except that this disclaimer is deemed to be legally invalid. + 3. Limitation of responsibility + To the extent permitted by law, under any circumstances, no matter what theory of liability is adopted, no matter how it is caused, for any loss of income, profit or data caused by or related to the use or inability to use the Software, or for special indirect consequential incidental or punitive damages, neither we nor its licensors shall be liable (even if we have been informed of the possibility of such damages). According to the Agreement, in any case, whether in contract tort (including negligence) or otherwise, our liability to you will not exceed the amount you pay for the Software. The above limitations will apply even if the above warranty fails of its essential purpose. + + VIII.Integrity and severability of the Agreement + 1. The integrity of the Agreement + The Agreement is an entire agreement on the product use concluded by us with you. It shall replace all oral or written contact information, suggestions, representations and guarantees inconsistent with the Agreement previous or in the same period. During the period of the Agreement, in case of any conflict clauses or additional clauses in the relevant quotations, orders or receipts or in other correspondences regarding the content of the Agreement between the parties, the Agreement shall prevail. No modification of the Agreement will be binding, unless in writing and signed by an authorized representative of each party. + 2. Severability of the Agreement + If any provision of the Agreement is deemed to be unenforceable, the deletion of the corresponding provision will still be effective, unless the deletion will hinder the realization of the fundamental purpose of the parties (in which case, the Agreement will be terminated immediately). + + IX. Applicable law and dispute settlement + 1. Application of governing laws + Any dispute settlement (including but not limited to litigation and arbitration) related to the Agreement shall be governed by the laws of the People’s Republic of China. The legal rules of any other countries and regions shall not apply. + 2. Termination + If the Software becomes or, in the opinion of either party, may become the subject of any claim for intellectual property infringement, either party may terminate the Agreement immediately. + The Agreement is effective until termination. You may terminate the Agreement at any time, but you must destroy all originals and duplicates of the Software. The Agreement will terminate immediately without notice from us if you fail to comply with any provision of the Agreement. At the time of termination, you must destroy all originals and duplicates of such software, and shall be legally liable for not observing the Agreement. + The Agreement shall be in both Chinese and English, and in case of ambiguity between any content above, the Chinese version shall prevail. + + Privacy Policy Statement of Kylin Operating System/n Release date of the version: July 30, 2021 + Effective date of the version: July 30, 2021 + + We attach great importance to personal information and privacy protection. In order to guarantee the legal, reasonable and appropriate collection, storage and use of your personal privacy information and the transmission and storage in the safe and controllable circumstances, we hereby formulate this Statement. We shall provide your personal information with corresponding security protection measures according to the legal requirements and mature security standards in the industry. + + The Statement shall include the following content: + I. Collection and use your personal information + II. How to store and protect your personal information + III. How to manage your personal information + IV. Privacy of the third-party software/services + V. Minors’ use of the products + VI. How to update this Statement + VII. How to contact us + + I. How to collect and use your personal information + 1. The collection of personal information + We shall collect the relevant information when you use this product mainly to provide you with higher-quality products, more usability and better services. Part of information collected shall be provided by you directly, and other information shall be collected by us through your interaction with the product as well as your use and experience of the product. We shall not actively collect and deal with your personal information unless we have obtained your express consent according to the applicable legal stipulations. + 1) The licensing mechanism for this product allows you to apply for the formal license of the product in accordance with the contract and relevant agreements after you send a machine code to the commercial personnel of Kylinsoft, and the machine code is generated through encryption and conversion according to the information of the computer used by you, such as network card, firmware and motherboard. This machine code shall not directly contain the specific information of the equipment, such as network card, firmware and motherboard, of the computer used by you. + 2) Server of the software store of this product shall connect it according to the CPU type information and IP address of the computer used by you; at the same time, we shall collect the relevant information of your use of the software store of this product, including but not limited to the time of opening the software store, interaction between the pages, search content and downloaded content. The relevant information collected is generally recorded in the log of server system of software store, and the specific storage position may change due to different service scenarios. + 3) Upgrading and updating of this product shall be connected according to the IP address of the computer used by you, so that you can upgrade and update the system; + 4) Your personal information, such as E-mail address, telephone number and name, shall be collected due to business contacts and technical services. + 5) The biological characteristic management tool support system components of this product shall use the biological characteristics for authentication, including fingerprint, finger vein, iris and voiceprint. The biological characteristic information input by you shall be stored in the local computer, and for such part of information, we shall only receive the verification results but shall not collect or upload it. If you do not need to use the biological characteristics for the system authentication, you may disable this function in the biological characteristic management tool. + 6) This product shall provide the recording function. When you use the recording function of this product, we shall only store the audio content when you use the recording in the local computer but shall not collect or upload the content. + 7) The service and support functions of this product shall collect the information provided by you for us, such as log, E-mail, telephone and name, so as to make it convenient to provide the technical services, and we shall properly keep your personal information. + 8) In the upgrading process of this product, if we need to collect additional personal information of yours, we shall timely update this part of content. + 2. Use of personal information + We shall strictly observe the stipulations of laws and regulations and agreements with you to use the information collected for the following purposes. In case of exceeding the scope of following purposes, we shall explain to you again and obtain your consent. + 1) The needs such as product licensing mechanism, use of software store, system updating and maintenance, biological identification and online services shall be involved; + 2) We shall utilize the relevant information to assist in promoting the product security, reliability and sustainable service; + 3) We shall directly utilize the information collected (such as the E-mail address and telephone provided by you) to communicate with you directly, for example, business contact, technical support or follow-up service visit; + 4) We shall utilize the data collected to improve the current usability of the product, promote the product’s user experience (such as the personalized recommendation of software store) and repair the product defects, etc.; + 5) We shall use the user behavior data collected for data analysis. For example, we shall use the information collected to analyze and form the urban thermodynamic chart or industrial insight report excluding any personal information. We may make the information excluding identity identification content upon the statistics and processing public and share it with our partners, to understand how the users use our services or make the public understand the overall use trend of our services; + 6) We may use your relevant information and provide you with the advertising more related to you on relevant websites and in applications andother channels; + 7) In order to follow the relevant requirements of relevant laws and regulations, departmental regulations and rules and governmental instructions. + 3. Information sharing and provision + We shall not share or transfer your personal information to any third party, except for the following circumstances: + 1) After obtaining your clear consent, we shall share your personal information with the third parities; + 2) In order to achieve the purpose of external processing, we may share your personal information with the related companies or other third-party partners (the third-party service providers, contractors, agents and application developers). We shall protect your information security by means like encryption and anonymization; + 3) We shall not publicly disclose the personal information collected. If we must disclose it publicly, we shall notify you of the purpose of such public disclosure, type of information disclosed and the sensitive information that may be involved, and obtain your consent; + 4) With the continuous development of our business, we may carry out the transactions, such as merger, acquisition and asset transfer, and we shall notify you of the relevant circumstances, and continue to protect or require the new controller to continue to protect your personal information according to laws and regulations and the standards no lower than that required by this Statement; + 5) If we use your personal information beyond the purpose claimed at the time of collection and the directly or reasonably associated scope, we shall notify you again and obtain your consent before using your personal information. + 4. Exceptions with authorized consent + 1) It is directly related to national security, national defense security and other national interests; + 2) It is directly related to public safety, public health and public knowledge and other major public interests; + 3) It is directly related to crime investigation, prosecution, judgment and execution of judgment; + 4) It aims to safeguard the life, property and other major legal rights and interests of you or others but it is impossible to obtain your own consent; + 5) The personal information collected is disclosed to the public by yourself; + 6) Personal information collected from legally publicly disclosed information, such as legal news reports, government information disclosure and other channels; + 7) It is necessary to sign and perform of the contract according to your requirement; + 8) It is necessary to maintain the safe and stable operation of the provided products or services, including finding and handling any fault of products or services; + 9) It is necessary to carry out statistical or academic research for public interest, and when the results of academic research or description are provided, the personal information contained in the results is de-identified; + 10) Other circumstances specified in the laws and regulations. + + II. How to store and protect personal information + 1. Information storage place + We shall store the personal information collected and generated in China within the territory of China in accordance with laws and regulations. + 2. Information storage duration + Generally speaking, we shall retain your personal information for the time necessary to achieve the purpose or for the shortest term stipulated by laws and regulations. Information recorded in the log shall be kept for a specified period and be automatically deleted according to the configuration. + When operation of our product or services stops, we shall notify you in the forms such as notification and announcement, delete your personal information or conduct anonymization within a reasonable period and immediately stop the activities collecting the personal information. + 3. How to protect the information + We shall strive to provide guarantee for the users’ information security, to prevent the loss, improper use, unauthorized access or disclosure of the information. + We shall use the security protection measures within the reasonable security level to protect the information security. For example, we shall protect your system account and password by means like encryption. + We shall establish the special management systems, processes and organizations to protect the information security. For example, we shall strictly restrict the scope of personnel who access to the information, and require them to observe the confidentiality obligation. + 4. Emergency response plan + In case of security incidents, such as personal information disclosure, we shall start the emergency response plan according to law, to prevent the security incidents from spreading, and shall notify you of the situation of the security incidents, the possible influence of the incidents on you and the remedial measures we will take, in the form of pushing the notifications and announcements. We will also report the disposition of the personal information security events according to the laws, regulations and regulatory requirements. + + III. How to manage your personal information + If you worry about the personal information disclosure caused by using this product, you may consider suspending or not using the relevant functions involving the personal information, such as the formal license of the product, application store, system updating and upgrading and biological identification, according to the personal and business needs. + Please pay attention to the personal privacy protection at the time of using the third-party software/services in this product. + + IV. Privacy of the third-party software/services + + The third-party software/services referred to in the Agreement refer to relevant software/services developed by other organizations or individuals other than the Kylin operating system manufacturer. + When you install or use the third-party software/services in this product, the privacy protection and legal responsibility of the third-party software/services shall be independently borne by the third-party software/services. Please carefully read and examine the privacy statement or clauses corresponding to the third-party software/services, and pay attention to the personal privacy protection. + + V. Minors’ use of the products + If you are a minor, you shall obtain your guardian’s consent on your use of this product and the relevant service clauses. Except for the information required by the product, we shall not deliberately require the minors to provide more data. With the guardians’ consent or authorization, the accounts created by the minors shall be deemed to be the same as any other accounts. We have formulated special information processing rules to protect the personal information security of minors using this product. The guardians shall also take the appropriate preventive measures to protect the minors and supervise their use of this product. + + VI. How to update this Statement + We may update this Statement at any time, and shall display the updated statement to you through the product installation process or the company’s website at the time of updating. After such updates take effect, if you use such services or any software permitted according to such clauses, you shall be deemed to agree on the new clauses. If you disagree on the new clauses, then you must stop using this product, and please close the accountcreated by you in this product; if you are a guardian, please help your minor child to close the account created by him/her in this product. + + VII. How to contact us + If you have any question, or any complaints or opinions on this Statement, you may seek advice through our customer service hotline 400-089-1870, or the official website (www.kylinos.cn), or “service and support” application in this product. You may also contact us by E-mail (market@kylinos.cn). + We shall timely and properly deal with them. Generally, a reply will be made within 15 working days. + The Statement shall take effect from the date of updating. The Statement shall be in Chinese and English at the same time and in case of any ambiguity of any clause above, the Chinese version shall prevail. + Last date of updating: November 1, 2021 + +Address: + Building 3, Xin’an Entrepreneurship Plaza, Tanggu Marine Science and Technology Park, Binhai High-tech Zone, Tianjin (300450) + Silver Valley Tower, No. 9, North Forth Ring West Road, Haidian District, Beijing (100190) + Building T3, Fuxing World Financial Center, No. 303, Section 1 of Furong Middle Road, Kaifu District, Changsha City (410000) + Digital Entertainment Building, No. 1028, Panyu Road, Xuhui District, Shanghai (200030) +Tel.: + Tianjin (022) 58955650 Beijing (010) 51659955 + Changsha (0731) 88280170 Shanghai (021) 51098866 +Fax: + Tianjin (022) 58955651 Beijing (010) 62800607 + Changsha (0731) 88280166 Shanghai (021) 51062866 + + Company website: www.kylinos.cn + E-mail: support@kylinos.cn + + + + + Kylinsoft Co., Ltd. + + + + + QObject + + + January + + + + + February + + + + + March + + + + + April + + + + + + May + + + + + June + + + + + July + + + + + August + + + + + September + + + + + October + + + + + Novermber + + + + + December + + + + + Customize Shortcut + + + + + Edit Shortcut + + + + + Programs are not allowed to be added. + + + + + User Info + + + + + + min length %1 + + + + + + + min digit num %1 + + + + + + + min upper num %1 + + + + + + + min lower num %1 + + + + + + + min other num %1 + + + + + + + min char class %1 + + + + + + + max repeat %1 + + + + + + + max class repeat %1 + + + + + + + max sequence %1 + + + + + + xxx客户端 + + + + + + Never + + + + + Unknown + + + + + Year + + + + + Jan + + + + + Feb + + + + + Mar + + + + + Apr + + + + + Jun + + + + + Jul + + + + + Aug + + + + + Sep + + + + + Oct + + + + + Nov + + + + + Dec + + + + + Day + + + + + ukui-control-center is already running! + + + + + ukui-control-center is disabled! + + + + + ukui-control-center + + + + + ResolutionSlider + + + No available resolutions + + + + + Screenlock + + + + Screenlock + + + + + + Screenlock Interface + + /Screenlock/Screenlock Interface + + + + + Browse + + /Screenlock/Browse + + + + + Online Picture + + /Screenlock/Online Picture + + + + + Reset To Default + + /Screenlock/Reset To Default + + + + Related Settings + + + + + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) + + + + + select custom wallpaper file + + + + + Select + + + + + Position: + + + + + FileName: + + + + + FileType: + + + + + Cancel + + + + + 1min + + + + + 5min + + + + + 10min + + + + + 30min + + + + + 45min + + + + + 1hour + + + + + 2hour + + + + + 3hour + + + + + Never + + + + + Show message on lock screen + + + + + Show picture of screenlock on screenlogin + + /Screenlock/Show picture of screenlock on screenlogin + + + + Monitor Off + + + + + Screensaver + + + + + Lock screen delay + + + + + + Set + + + + + Screensaver + + + + Screensaver + + + + + Lock screen when activating screensaver + + + + + View + + + + + UKUI + + + + + Blank_Only + + + + + Customize + + + + + + 5min + + + + + + 10min + + + + + 15min + + + + + + 30min + + + + + 1hour + + + + + Never + + + + + Screensaver source + + + + + + Select + + + + + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) + + + + + select custom screensaver dir + + + + + Position: + + + + + FileName: + + + + + FileType: + + + + + Cancel + + + + + Switching time + + + + + 1min + + + + + Ordinal + + + + + Random + + + + + Random switching + + + + + Text(up to 30 characters): + + + + + Show rest time + + + + + Lock screen when screensaver boot + + + + + Text position + + + + + Centered + + + + + Randow(Bubble text) + + + + + Idle time + + /Screensaver/Idle time + + + + Screensaver program + + /Screensaver/Screensaver program + + + + SearchWidget + + + + + + No search results + + + + + ShareMain + + + Remote Desktop + + + + + + Allow others to view your desktop + + + + + Allow connection to control screen + + /Vino/Allow connection to control screen + + + + You must confirm every visit for this machine + + /Vino/You must confirm every visit for this machine + + + + + Require user to enter this password: + + /Vino/Require user to enter this password: + + + + Warning + + + + + please select an output + + + + + Input Password + + + + + Password + + + + + + Password length must be less than or equal to 8 + + + + + + Password can not be blank + + + + + Share + + + + + Security + + + + + Output + + + + + Input + + + + + Point + + + + + Keyboard + + + + + Clipboard + + + + + Close + + + + + ViewOnly + + + + + Client Setting + + + + + Client Number + + + + + Client IP: + + + + + 退出程序 + + + + + 确认退出程序! + + + + + Shortcut + + + + + System Shortcut + + /Shortcut/System Shortcut + + + + Custom Shortcut + + + + + Shortcut + + + + + Add + + /Shortcut/Add + + + + Customize Shortcut + + /Shortcut/Customize Shortcut + + + + Edit + + + + + Delete + + + + + or + + + + + SpliceDialog + + + Dialog + + + + + + Splicing Method + + + + + + Cancel + + + + + + Ok + + + + + Splice Screen + + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + + + + + Row %1, Column %2 + + + + + Select screen + + + + + StatusDialog + + + About + + + + + Activation Code + + + + + Theme + + + Effect setting + + + + + + Performance mode + + /Theme/Performance mode + + + + + Transparency + + /Theme/Transparency + + + + Reset to default + + + + + + Theme + + + + + Light + + + + + Dark + + + + + Auto + + + + + Window Theme + + /Theme/Window Theme + + + + Icon theme + + /Theme/Icon theme + + + + Cursor theme + + /Theme/Cursor theme + + + + Corlor + + + + + Other + + + + + + Set + + + + + Wallpaper + + + + + Beep + + + + + Blue-Crystal + + + + + + Light-Seeking + + + + + DMZ-Black + + + + + DMZ-White + + + + + Dark-Sense + + + + + + + basic + + + + + classic + + + + + Classic + + + + + HeYin + + + + + hp + + + + + ukui + + + + + daybreakBlue + + + + + jamPurple + + + + + magenta + + + + + sunRed + + + + + sunsetOrange + + + + + dustGold + + + + + polarGreen + + + + + TimeBtn + + + Tomorrow + + + + + Yesterday + + + + + Today + + + + + %1 hours earlier than local + + + + + %1 hours later than local + + + + + TimeZoneChooser + + + Cancel + + + + + Confirm + + + + + Change Timezone + + + + + Search Timezone + + + + + To select a time zone, please click where near you on the map and select a city from the nearest city + + + + + TrialDialog + + + Set + + + + + Yinhe Kylin OS(Trail Version) Disclaimer + + + + + Dear customer: + Thank you for trying Yinhe Kylin OS(trail version)! This version is free for users who only try out, no commercial purpose is permitted. The trail period lasts one year and it starts from the ex-warehouse time of the OS. No after-sales service is provided during the trail stage. If any security problems occurred when user put important files or do any commercial usage in system, all consequences are taken by users. Kylin software Co., Ltd. take no legal risk in trail version. + During trail stage,if you want any technology surpport or activate the system, please buy“Yinhe Kylin Operating System”official version or authorization by contacting 400-089-1870. + + + + + Kylin software Co., Ltd. + + + + + UkccAbout + + + + Settings + + + + + Version: + + + + + Service and Support: + + + + + UnifiedOutputConfig + + + + resolution + + + + + + orientation + + + + + + arrow-up + + + + + + 90° arrow-right + + + + + + 90° arrow-left + + + + + + arrow-down + + + + + auto rotation + + /Display/auto rotation + + + + + frequency + + + + + screen zoom + + /Display/screen zoom + + + + + + auto + + + + + UserInfo + + + Current User + + + + + Password + + + + + + Type + + + + + Group + + + + + Login no passwd + + + + + Automatic login at boot + + + + + Other Users + + + + + CurrentUser + + /Userinfo/CurrentUser + + + + OthersUser + + /Userinfo/OthersUser + + + + Add + + /Userinfo/Add + + + + Passwd + + + + + Groups + + + + + LoginWithoutPwd + + /Userinfo/LoginWithoutPwd + + + + AutoLoginOnBoot + + /Userinfo/AutoLoginOnBoot + + + + Warning + + + + + The user is logged in, please delete the user after logging out + + + + + The account type of “%1” has been modified, will take effect after logout, whether to logout? + + + + + logout later + + + + + logout now + + + + + Hint + + + + + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? + + + + + Trun on + + + + + Close on + + + + + Standard + + + + + Admin + + + + + root + + + + + UserInfoIntel + + + + Current User + + /UserinfoIntel/Current User + + + + Change phone + + + + + + + Change pwd + + /UserinfoIntel/Change pwd + + + + User group + + + + + Del user + + + + + system reboot + + + + + Unclosed apps start after a restart + + + + + + Other Users + + /UserinfoIntel/Other Users + + + + User Info Intel + + + + + Change Tel + + /UserinfoIntel/Change Tel + + + + Delete user + + /UserinfoIntel/Delete user + + + + Change user name + + /UserinfoIntel/Change user name + + + + standard user + + + + + administrator + + + + + root + + + + + Add new user + + + + + set pwd + + + + + Change + + + + + UtilsForUserinfo + + + Passwd + + + + + Type + + + + + Del + + + + + Standard + + + + + Admin + + + + + Vino + + + + Vino + + + + + Wallpaper + + + + Desktop Background + + /Wallpaper/Desktop Background + + + + + Browse + + /Wallpaper/Browse + + + + + Online Picture + + /Wallpaper/Online Picture + + + + + Reset To Default + + /Wallpaper/Reset To Default + + + + + Background + + + + + picture + + + + + color + + + + + scaled + + + + + wallpaper + + + + + centered + + + + + stretched + + + + + zoom + + + + + spanned + + + + + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) + + + + + + select custom wallpaper file + + + + + + Select + + + + + + Position: + + + + + + FileName: + + + + + + FileType: + + + + + + Cancel + + + + + Mode + + + + + Widget + + + Night Mode + + /Display/Night Mode + + + + Open + + + + + Time + + + + + + Custom Time + + + + + to + + + + + Color Temperature + + + + + Warmer + + + + + Colder + + + + + Multi-screen + + + + + First Screen + + + + + Vice Screen + + + + + Extend Screen + + + + + Clone Screen + + + + + + Splice Screen + + + + + Auto Brightness + + + + + Adjust screen brightness by ambient + + + + + Dynamic light + + /Display/Dynamic light + + + + Optimize display content to extend battery life + + + + + + Not Save + + + + + + Save + + + + + + resolution + + + + + + orientation + + + + + + frequency + + + + + scale + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> + + + + + The zoom has been modified, it will take effect after you log off + + + + + Log out now + + + + + Later + + + + + + (Effective after logout) + + + + + + + + + Warning + + + + + + + please insure at least one output! + + + + + + Sorry, your configuration could not be applied. +Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. + + + + + All Day + + + + + + Follow the sunrise and sunset + + + + + + + + Brightness + + /Display/Brightness + + + + Splicing Method + + + + + Change + + + + + + monitor + + /display/monitor + + + + as main + + + + + + screen zoom + + /display/screen zoom + + + + open monitor + + + + + Information + + + + + Some applications need to be logouted to take effect + + + + + Mirror Display + + /display/unify output + + + + night mode + + /display/night mode + + + + Theme follow night mode + + + + + Hint + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 29 seconds</font> + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> + + + + + Open time should be earlier than close time! + + + + + Warnning + + + + + addShortcutDialog + + + Dialog + + + + + Exec + + + + + Open + + + + + Name + + + + + + TextLabel + + + + + Key + + + + + + Cancel + + + + + Save + + + + + Add Shortcut + + + + + Please enter a shortcut + + + + + Desktop files(*.desktop) + + + + + select desktop + + + + + + + Invalid application + + + + + + + Shortcut conflict + + + + + + + Invalid shortcut + + + + + + + Name repetition + + + + + Unknown error + + + + + Shortcut cannot be empty + + + + + Name cannot be empty + + + + + changeUserGroup + + + user group + + + + + Group: + + + + + GID: + + + + + GNum: + + + + + + Cancel + + + + + + Confirm + + + + + + + Tips + + + + + + Invalid Id! + + + + + + + OK + + + + + Invalid Group Name! + + + + + Whether delete the group: “%1” ? + + + + + which will make some file components in the file system invalid! + + + + + changtimedialog + + + Dialog + + + + + current date + + + + + time + + + + + year + + + + + month + + + + + day + + + + + cancel + + + + + confirm + + + + diff --git a/shell/res/i18n/kk.ts b/shell/res/i18n/kk.ts index e29dc3e..2bb4cb3 100644 --- a/shell/res/i18n/kk.ts +++ b/shell/res/i18n/kk.ts @@ -4,94 +4,101 @@ About - + System Summary Жүйелік жиынтық - + Support Қолдау - - + Version Number Нұсқа нөмірі - + Status Күйі /About/Status - + DateRes DateRes - + Wechat code scanning obtains HP professional technical support Wechat кодын сканерлеу HP кәсіби техникалық қолдауға ие болды - + HostName Хост атауы - + See more about Kylin Tianqi edu platform Килин Тяньци эду платформасы туралы толығырақ қараңыз - + <<Protocol>> <<Protocol>> - - InterVersion - ИнтерВерсия + + About and Support + - + InterVersion + ИнтерВерсия + + + + Patch Version + + + + Privacy and agreement Құпиялылық және келісім - + Send optional diagnostic data Қосымша диагностикалық деректерді жіберу - + By sending us diagnostic data, improve the system experience and solve your problems faster Бізге диагностикалық деректерді жібере отырып, жүйе тәжірибесін жетілдіріп, мәселелерді тезірек шешіңіз - Copyright © 2009-%1 KylinSoft. All rights reserved. - Авторлық құқық © 2009-% 1 KylinSoft. Барлық құқықтар сақталған. + Авторлық құқық © 2009-% 1 KylinSoft. Барлық құқықтар сақталған. - + and және - + <<Privacy>> <<Privacy>> - + Learn more HP user manual>> HP пайдаланушы нұсқаулығы туралы қосымша ақпарат алыңыз>> - + See user manual>> Пайдаланушы нұсқаулығын қараңыз>> @@ -100,34 +107,49 @@ 未激活(试用期) - + Trial expiration time Сынақ мерзімінің өту уақыты - - + + expired мерзімі өтіп кеткен - - + + Extend Кеңейту - + + Copyright © 2009-%1 %2. All rights reserved. + + + + + Openkylin + + + + + KylinSoft + + + + The system needs to be restarted to set the HostName, whether to reboot HostName бағдарламасын қайта жүктеу керек пе, соны орнату үшін жүйені қайта іске қосу қажет - + Reboot Now Қазір қайта жүктеу - + Reboot Later Кейінірек қайта жүктеу @@ -140,9 +162,9 @@ 延长服务 - - - + + + avaliable қол жетімді @@ -159,7 +181,8 @@ 版权所有2009-2021@kylinos保留所有权利 - + + Version Нұсқасы /About/version @@ -177,37 +200,42 @@ 版权所有 © 2009-2021 麒麟软件 保留所有权利。 - + + Kernel Кернель /About/Kernel - + + CPU CPU /About/CPU - + + Memory Жады /About/Memory - - + + Disk Диск - + + Desktop Жұмыс үстелі /About/Desktop - + + User Пайдаланушы /About/User @@ -221,7 +249,7 @@ 有效期 - + Serial Сериялық @@ -234,8 +262,8 @@ 序列号 - - + + Active Белсенді @@ -252,7 +280,7 @@ 关于 - + About Шамамен @@ -269,13 +297,13 @@ 可用 - - + + Inactivated Белсендірілмеген - + Activated Белсендірілген @@ -417,11 +445,92 @@ AddBtn - + Add Қосу + + AddButton + + + Add + Қосу + + + + AddInputMethodDialog + + + Dialog + + + + + Select the input method to add + + + + + No + + + + + Yes + + + + + + keyboard + 键盘 + + + + + Tibetan + + + + + With ASCII numbers + + + + + Input Method + + + + + AddLanguageDialog + + + Dialog + + + + + No + + + + + Yes + + + + + Add Language + + + + + Search + + + AddNetBtn @@ -598,87 +707,70 @@ AptProxyDialog - Set Apt Proxy - Apt проксиін орнату + Apt проксиін орнату - Server Address - Сервер адресі + Сервер адресі - Port - Порт + Порт - Cancel - Болдырмау + Болдырмау - Confirm - Растау + Растау Area - - + Area Аумақ Regional Format 区域格式 - - - - - Current Region - Ағымдағы аймақ /Area/Current Region - - First Day Of The Week - Аптаның бірінші күні + Current Region + Ағымдағы аймақ + /Area/Current Region + + + First Day Of The Week + Аптаның бірінші күні - - Calendar - Күнтізбе + Күнтізбе /Area/Calendar - - Language Format - Тіл пішімі + Тіл пішімі /Area/Regional Format - - Date - Күні + Күні /Area/Date - - Time - Уақыт + Уақыт /Area/Time - TextLabel - TextLabel + TextLabel Area showing time currency format @@ -689,7 +781,7 @@ 区域格式数据 - + lunar Айдың @@ -714,73 +806,74 @@ 显示日期、时间、货币格式的区域 - US - АҚШ + АҚШ - Language for system windows,menus and web pages - Жүйелік терезелерге, мәзірлерге және веб-беттерге арналған тіл + Жүйелік терезелерге, мәзірлерге және веб-беттерге арналған тіл Add main language 添加首语言 - - System Language - Жүйелік тіл + Жүйелік тіл /Area/system language + Simplified Chinese - 简体中文 + 简体中文 - First Day Of Week - Аптаның бірінші күні + Аптаның бірінші күні /Area/First Day Of Week - + 12 Hours 12 сағат - + 24 Hours 24 сағат - + + Tibetan + + + + Modify the current region need to logout to take effect, whether to logout? Жүйеге кіру керек пе, жоқ па, ағымдағы аймақты өзгерту қажет пе? - + Logout later Logout кейінірек - + Logout now Енді жүйеге кіру - + Modify the first language need to reboot to take effect, whether to reboot? Қайта жүктеу керек пе, күшіне ену үшін бірінші тілді өзгерту керек пе? - + Reboot later Кейінірек қайта жүктеу - + Reboot now Енді қайта жүктеу @@ -821,9 +914,8 @@ 显示语言 - CN - CN + CN Need to cancel to take effect @@ -846,8 +938,9 @@ 区域格式数据 + English - English + English Chinese @@ -858,17 +951,34 @@ 添加首语言 - + solar calendar күн күнтізбесі + monday - 星期一 + 星期一 + + English (US) + + + + + Simplified Chinese (CN) + + + + + Tibetan (CN) + + + + sunday - 星期天 + 星期天 change data format @@ -882,6 +992,51 @@ 请输入手机号码 + + AreaUi + + + Regional Format + 区域格式 + /Area/Regional Format + + + + Calendar + Күнтізбе + /Area/Calendar + + + + First Day Of Week + Аптаның бірінші күні + /Area/First Day Of Week + + + + Date + + /Area/Date + + + + Time + Уақыт + /Area/Time + + + + Language Format + Тіл пішімі + /Area/Language Format + + + + System Language + Жүйелік тіл + /Area/System Language + + Audio @@ -892,33 +1047,32 @@ AutoBoot - + Desktop files(*.desktop) Жұмыс үстелі файлдары(*.жұмыс үстелі) - + select autoboot desktop жұмыс үстелін автоматты түрде жүктеу пәрменін таңдаңыз - + Select Таңдау - + Cancel Болдырмау - Add - Қосу - /autoboot/Add + Қосу + /Autoboot/Add - + Autoboot Settings Автоматты түрде жүктеу параметрлері /autoboot/Autoboot Settings @@ -936,7 +1090,7 @@ 开机启动 - + Auto Boot Авто жүктеу @@ -949,7 +1103,7 @@ 当前状态 - + Delete Өшіру @@ -958,8 +1112,7 @@ Backup - - + Backup Сақтық көшірме @@ -982,14 +1135,14 @@ you can restore them to ensure the integrity of your system. - + Begin backup Сақтық көшірмені бастау /Backup/Begin backup - + Restore Қалпына келтіру @@ -1004,7 +1157,7 @@ you can restore them to ensure the integrity of your system. - + Begin restore Қалпына келтіруді бастау /Backup/Begin restore @@ -1019,14 +1172,14 @@ you can restore them to ensure the integrity of your system. 将永久抹掉存储在计算机的所有数据,且无法撤销此操作。抹掉完成后系统将恢复至最初始出厂状态 - + All data stored on the computer will be permanently erased,and the system will revert to its original factory state when this operation is completed. Компьютерде сақталған барлық деректер біржолата өшіріліп, жүйеге қайта оралады осы операция аяқталғанда оның бастапқы зауыттық күйі. - + Clear and restore Тазалау және қалпына келтіру @@ -1038,17 +1191,22 @@ you can restore them to ensure the integrity of your system. Жүйені қалпына келтіру - + + Backup Restore + + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. Файлдарыңызды басқа дискілерге сақтық көшірмелеңіз және жүйенің тұтастығын қамтамасыз ету үшін бастапқы файлдар жоғалған, бүлінген немесе жойылған кезде оларды қалпына келтіріңіз. - + View the backup list and restore the backup file to the system Сақтық көшірмелер тізімін қарап шығу және сақтық көшірме файлын жүйеге қалпына келтіру - + Backup and Restore Резервтік көшірме және қалпына келтіру @@ -1472,7 +1630,7 @@ Please authenticate yourself to continue BrightnessFrame - + Failed to get the brightness information of this monitor Бұл монитордың жарықтық туралы ақпараты алынбады @@ -1558,63 +1716,65 @@ Please authenticate yourself to continue ChangeFaceIntelDialog - + + Change User Face Пайдаланушы бетін өзгерту + /UserinfoIntel/Change User Face - + History Журнал - + System Жүйе - - + + Cancel Болдырмау - + Confirm Растау - + select custom face file реттелетін бет файлын таңдау - + Select Таңдау - + Position: Лауазымы: - + FileName: Файл атауы: - + FileType: РаÐ1/2аÐ1/2а - + Warning Ескерту - + The avatar is larger than 2M, please choose again Аватар 2М-ден үлкен, қайта таңдауыңызды сұраймыз @@ -1645,59 +1805,48 @@ Please authenticate yourself to continue ChangeGroupDialog - Dialog - Диалог + Диалог - User Group Settings - Пайдаланушы тобының параметрлері + Пайдаланушы тобының параметрлері User groups available in the system 系统中可用的用户组 - Cancel - Болдырмау + Болдырмау Add new user 添加新用户 - User group - Пайдаланушы тобы + Пайдаланушы тобы - Add user group - Пайдаланушы тобын қосу + Пайдаланушы тобын қосу - - Tips - Кеңестер + Кеңестер - Invalid Id! - Жарамсыз идентификатор! + Жарамсыз идентификатор! - - OK - ЖАҚСЫ + ЖАҚСЫ - Invalid Group Name! - Жарамсыз топтың атауы! + Жарамсыз топтың атауы! @@ -1763,107 +1912,107 @@ Please authenticate yourself to continue Телефонды өзгерту - + Phone number Телефон нөмірі - + SMS verification code SMS тексеру коды - + Please input old phone number Ескі телефон нөмірін енгізуіңізді сұраймын - + Next Келесі - - + + Please enter new mobile number Жаңа ұялы телефон нөмірін енгізіңіз - - + + Submit Жіберу - + changed success өзгертілген сәттілік - - + + You have successfully modified your phone Телефоныңызды сәтті өзгерттіңіз - - + + Recapture Қайта басып алу - - - + + + Network connection failure, please check Желі қосылымының істен шығуы, тексеруіңізді сұраймыз - - + + GetCode GetCode - - - + + + Phone is lock,try again in an hour Телефон құлыпталып, бір сағаттан кейін қайталап көріңіз - - - + + + Phone code is wrong Телефон коды дұрыс емес - + Current login expired,using wechat code! Ағымдағы кіру мерзімі өтіп, wechat кодын пайдаланып! - - - + + + Unknown error, please try again later Белгісіз қате, кейінірек қайталап көріңіз - + Phone can not same Телефон бірдей бола алмайды - - + + finished аяқталды - - + + Phone number already in used! Бұрыннан пайдаланылған телефон нөмірі! @@ -2166,7 +2315,7 @@ Please authenticate yourself to continue ChangeUserLogo - + System Logos Жүйелік логотиптер @@ -2175,58 +2324,58 @@ Please authenticate yourself to continue 本地头像 - + User logo Пайдаланушы логотипі - + Select Local Logo Жергілікті логотипті таңдау - - + + Cancel Болдырмау - + Confirm Растау - + select custom face file реттелетін бет файлын таңдау - + Select Таңдау - + Position: Лауазымы: - + FileName: Файл атауы: - + FileType: РаÐ1/2аÐ1/2а - + Warning Ескерту - + The avatar is larger than 1M, please choose again Аватар 1М-ден үлкен, қайта таңдауыңызды сұраймыз @@ -2275,17 +2424,17 @@ Please authenticate yourself to continue UserName - + NickName Лақап аты - + nickName already in use. лақап аты бұрыннан қолданыла тұр. - + The length must be 1~%1 characters! Ұзындығы 1×% 1 таңбалы болуы керек! @@ -2302,12 +2451,12 @@ Please authenticate yourself to continue 计算机名 - + Cancel Болдырмау - + Confirm Растау @@ -2315,71 +2464,83 @@ Please authenticate yourself to continue ChangeUserPwd - + Change password Құпия сөзді өзгерту - - - + + + Current Pwd Ағымдағы Pwd - - - - + + + + New Pwd Жаңа Pwd - - - - + + + + Sure Pwd Sure Pwd - + Cancel Болдырмау - + + + Confirm Растау - - + + Inconsistency with pwd Pwd сәйкессіздігі - + + Same with old pwd + 与旧密码相同 + + + + Pwd Changed Succes + + + + Authentication failed, input authtok again! Аутентификация сәтсіз аяқталды, қайтадан authtok енгізу! - + Contains illegal characters! Онда заңсыз таңбалар бар! - + current pwd cannot be empty! ағымдағы pwd бос бола алмайды! - + new pwd cannot be empty! жаңа pwd бос бола алмайды! - + sure pwd cannot be empty! pwd бос бола алмайтынына көз жеткізіңіз! @@ -2387,47 +2548,47 @@ Please authenticate yourself to continue ChangeUserType - + UserType Пайдаланушытипі - + administrator әкімші - + standard user стандартты пайдаланушы - + Select account type (Ensure have admin on system): Тіркелгі түрін таңдаңыз (Жүйеде әкімшінің болуын қамтамасыз ету): - + change system settings, install and upgrade software. жүйе параметрлерін өзгерту, бағдарламалық жасақтаманы орнату және жаңарту. - + use most software, cannot change system settings. бағдарламалық жасақтаманың көпшілігін пайдаланады, жүйе параметрлерін өзгерте алмайды. - + Note: Effective After Logout!!! Ескерту: Журналға кіргеннен кейін тиімді!!! - + Confirm Растау - + Cancel Болдырмау @@ -2583,29 +2744,32 @@ Please authenticate yourself to continue CreateGroupDialog - Dialog - Диалог + Диалог - + Add New Group Жаңа топты қосу - + Name Атауы - + Id Идентифика- лық - + + Confirm + + + Members - Мүшелер + Мүшелер Group Name @@ -2620,17 +2784,16 @@ Please authenticate yourself to continue 组成员 - + Cancel Болдырмау - Certain - Белгілі бір + Белгілі бір - + Add user group Пайдаланушы тобын қосу @@ -3023,38 +3186,38 @@ change system settings - + Inconsistency with pwd Pwd сәйкессіздігі - - + + The nick name cannot be empty Ник атауы бос бола алмайды - + nickName already in use. лақап аты бұрыннан қолданыла тұр. - + nickName length must less than %1 letters! лақап атының ұзындығы% 1 әріптен кем болуы керек! - + Username's length must be between 1 and %1 characters! Пайдаланушы атының ұзындығы 1 және% 1 таңбалары арасында болуы керек! - + new pwd cannot be empty! жаңа pwd бос бола алмайды! - + sure pwd cannot be empty! pwd бос бола алмайтынына көз жеткізіңіз! @@ -3083,7 +3246,7 @@ change system settings 该用户名已存在,请更改。 - + Name corresponds to group already exists. Атауы бұрыннан бар топқа сәйкес келеді. @@ -3096,16 +3259,24 @@ change system settings 用户名仅能包含字母,数字及下划线 - + Username's folder exists, change another one Пайдаланушы аты қалтасы бар, басқасын өзгертіңіз - + Contains illegal characters! Онда заңсыз таңбалар бар! + + CustomGlobalTheme + + + custom + + + CustomLineEdit @@ -3182,32 +3353,25 @@ change system settings ағымдағы күн - - + Change timezone Уақыт белдеуін өзгерту /Date/Change time zone - - TextLabel - TextLabel + TextLabel - - RadioButton - RadioButton + RadioButton - - : - : + : - + titleLabel титулЛабель @@ -3252,18 +3416,24 @@ change system settings 时间日期 - + Date Күні - + + Current Date + + /Date/Current Date + + + Other Timezone Басқа уақыт белдеуі /Date/Other Timezone - + 24-hour clock Тәулік бойы жұмыс сағаты /Date/24-hour clock @@ -3281,13 +3451,13 @@ change system settings 添加时区,最多添加5个 - + Sync Server Синхрондау сервері /Date/Sync Server - + Add Timezone Уақыт белдеуін қосу @@ -3296,13 +3466,13 @@ change system settings 删除 - + Manual Time Қолмен жұмыс істейтін уақыт /Date/Manual Time - + Sync Time Синхрондау уақыты /Date/Sync Time @@ -3322,55 +3492,55 @@ change system settings /Date/Network - + Set Time Уақытты орнату /Date/Set Time - + Set Date Manually Күнді қолмен орнату /Date/Set Date Manually - + Default Әдетті - + Customize Реттеу - + Server Address Сервер адресі - + Required Міндетті - + Save Сақтау - + Change Timezone Уақыт белдеуін өзгерту - + - - + + Sync failed Синхрондау жаңылысы @@ -3387,7 +3557,7 @@ change system settings 同步网络时间 - + change time өзгерту уақыты @@ -3403,56 +3573,65 @@ change system settings 默认应用 - + Default App Әдепкі бағдарлама - + No program available Бағдарлама қол жетімді емес - + + Choose default app + + + + + Reset default apps to system recommended apps + + + + + Reset + + + + Browser Браузер - /Defaultapp/Browser - + Mail Пошта - /Defaultapp/Mail - + Image Viewer Кескінді қарау құралы - /Defaultapp/Image Viewer - + Audio Player Дыбыс ойнатқышы - /Defaultapp/Audio Player - + Video Player Бейне ойнатқыш - /Defaultapp/Video Player - + Text Editor Мәтін өңдегіші - /Defaultapp/Text Editor DefaultAppWindow - + Select Default Application Әдепкі қолданба параметрін таңдау @@ -3488,14 +3667,12 @@ change system settings DefineGroupItem - Edit - Өңдеу + Өңдеу - Del - Дель + Дель Delete @@ -3526,9 +3703,8 @@ change system settings DelGroupDialog - Dialog - Диалог + Диалог Are you sure to delete this group, @@ -3537,25 +3713,20 @@ in the file system invalid! 确定删除此用户组? 这将使得文件系统\n中的某些文件组件ID无效! - Are you sure to delete the group: - Топты міндетті түрде жоясыз ба: + Топты міндетті түрде жоясыз ба: - - which will make some file components in the file system invalid! - бұл файл жүйесіндегі кейбір файл компоненттерін жарамсыз етеді! + бұл файл жүйесіндегі кейбір файл компоненттерін жарамсыз етеді! - Delete - Өшіру + Өшіру - Cancel - Болдырмау + Болдырмау RemoveFile @@ -3573,9 +3744,8 @@ in the file system invalid! 中的某些文件组件ID无效! - Delete user group - Пайдаланушы тобын жою + Пайдаланушы тобын жою Are you sure to delete the group, which will make some file components in the file system invalid! @@ -3669,7 +3839,7 @@ folder will be deleted! Болдырмау - + Delete the user, belonging to the user's desktop documents, favorites, music, pictures and video folder will be deleted! Пайдаланушының жұмыс үстелі құжаттарына жататын пайдаланушыны жойыңыз, таңдаулылар, музыка, суреттер мен бейне қалта жойылады! @@ -3677,17 +3847,17 @@ folder will be deleted! DeleteUserExists - + Delete user ' Пайдаланушыны жою' - + '? And: '? және: - + Keep desktop, files, favorites, music of the user Пайдаланушының жұмыс үстелін, файлдарын, таңдаулыларын, музыкасын сақтау @@ -3696,17 +3866,17 @@ folder will be deleted! 保留用户家目录 - + Cancel Болдырмау - + Confirm Растау - + Delete whole data belong user Барлық деректерді жою пайдаланушыға тиесілі @@ -4189,7 +4359,12 @@ folder will be deleted! 显示器 - + + Screen + + + + Display Дисплей @@ -4198,7 +4373,6 @@ folder will be deleted! DisplayWindow - monitor монитор @@ -4216,7 +4390,6 @@ folder will be deleted! 统一输出 - open monitor ашық монитор @@ -4234,13 +4407,11 @@ folder will be deleted! Дисплей - as main негізгі ретінде - screen zoom экранды ұлғайту @@ -4263,43 +4434,36 @@ folder will be deleted! - follow the sunrise and sunset(17:55-05:04) күн шығысы мен күн батқаннан кейін жүріңіз (17:55-05:04) - custom time реттелетін уақыт - opening time ашылу уақыты - closing time жабылу уақыты - color temperature түс температурасы - warm жылы - cold суық @@ -4317,59 +4481,48 @@ folder will be deleted! EditGroupDialog - Dialog - Диалог + Диалог - Cancel - Болдырмау + Болдырмау - Certain - Белгілі бір + Белгілі бір - Edit User Group - Пайдаланушы тобын өңдеу + Пайдаланушы тобын өңдеу - Name - Атауы + Атауы - Id - Идентифика- лық + Идентифика- лық - Members - Мүшелер + Мүшелер - Tips - Кеңестер + Кеңестер - Invalid Id! - Жарамсыз идентификатор! + Жарамсыз идентификатор! - OK - ЖАҚСЫ + ЖАҚСЫ - Edit user group - Пайдаланушы тобын өңдеу + Пайдаланушы тобын өңдеу @@ -4651,6 +4804,16 @@ folder will be deleted! Thanks For Using The ukcc 欢迎使用设置 + + + Small + + + + + Large + + FrameItem @@ -4747,17 +4910,17 @@ folder will be deleted! Хост атауы - + Must be 1-64 characters long Ұзындығы 1-64 таңба болуы тиіс - + Cancel Болдырмау - + Confirm Растау @@ -5137,15 +5300,14 @@ folder will be deleted! 键盘 - Keyboard - Пернетақта + Пернетақта KeyboardMain - + Key board settings Негізгі тақта параметрлері @@ -5154,57 +5316,62 @@ folder will be deleted! 输入法设置 - + + Keyboard + + + + Input settings Енгізу параметрлері /Keyboard/Input settings - + Key repeat Кілтті қайталау /Keyboard/Key repeat - + Delay Кідіріс /Keyboard/Delay - + Short Қысқа - + Long Ұзын - + Speed Жылдамдық /Keyboard/Speed - + Slow Баяу - + Fast Жылдам - + Input test Енгізуді тексеру /Keyboard/Input test - + Key tips Негізгі кеңестер /Keyboard/Key tips @@ -5229,6 +5396,19 @@ folder will be deleted! 布局预览 + + LanguageFrame + + + Input Settings + 输入法设置 + + + + Delete + + + LayoutManager @@ -5650,7 +5830,7 @@ Please retry or relogin! - + Cloud ID desktop message @@ -5700,7 +5880,7 @@ Please retry or relogin! MainWindow - + Search Іздеу @@ -5709,19 +5889,20 @@ Please retry or relogin! 设置 - - - + + + + Settings Параметрлер - + Main menu Негізгі мәзір - + Minimize Кішірейту @@ -5730,47 +5911,52 @@ Please retry or relogin! 最大化/正常 - + Normal Қалыпты - - + + Maximize Барынша көбейту - + Close Жабу - + Help Анықтама - + About Шамамен - + Exit Шығу + + + Specified + + ukcc 控制面板 - + Warning Ескерту - + This function has been controlled Бұл функция бақыланды @@ -6062,9 +6248,8 @@ Please retry or relogin! 鼠标 - Mouse - Тышқан + Тышқан Lefthand @@ -6090,119 +6275,136 @@ Please retry or relogin! MouseUI - + + Mouse Тышқан - + Pointer Меңзер - + Cursor Курсор - + Dominant hand Доминантты қол /Mouse/Dominant hand - + Left hand Сол қол - + Right hand Оң қол - + + Scroll direction + + /Mouse/Scroll direction + + + + Forward + + + + + Reverse + + + + Wheel speed Доңғалақ жылдамдығы /Mouse/Wheel speed - - - + + + + Slow Баяу - - - + + + + Fast Жылдам - + Double-click interval time Интервал уақытын екі рет басу /Mouse/Double-click interval time - Short - Қысқа + Қысқа - Long - Ұзын + Ұзын - + Pointer speed Көрсеткіш жылдамдығы /Mouse/Pointer speed - + Mouse acceleration Тінтуір үдеуі /Mouse/Mouse acceleration - + Show pointer position when pressing ctrl Ctrl пернесін басқанда көрсеткіш орнын көрсету /Mouse/Show pointer position when pressing ctrl - + Pointer size Көрсеткіш өлшемі /Mouse/Pointer size - + Small(recommend) Кішкентай(ұсыным) - + Medium Орташа - + Large Үлкен - + Blinking cursor in text area Мәтін аймағындағы жыпылықтату курсоры /Mouse/Blinking cursor in text area - + Cursor speed Курсор жылдамдығы /Mouse/Cursor speed @@ -6211,7 +6413,7 @@ Please retry or relogin! MyLabel - + double-click to test тексеру үшін екі рет басу @@ -6393,7 +6595,42 @@ Please retry or relogin! Notice - + + NotFaze Mode + + + + + (Notification banners, prompts will be hidden, and notification sounds will be muted) + + + + + Automatically turn on + + + + + to + to + + + + Automatically turn on when multiple screens are connected + + + + + Automatically open in full screen mode + + + + + Allow automatic alarm reminders in Do Not Disturb mode + + + + Notice Settings Ескерту параметрлері @@ -6410,10 +6647,9 @@ Please retry or relogin! 系统版本更新后显示新增内容 - + Get notifications from the app Бағдарламадан хабарландырулар алу - /notice/Get notifications from the app Show notifications on the lock screen @@ -6428,11 +6664,49 @@ Please retry or relogin! 通知 - + Notice Хабарлама + + NoticeMenu + + + Beep sound when notified + + + + + Show message on screenlock + + + + + Show noticfication on screenlock + + + + + Notification Style + + + + + Banner: Appears in the upper right corner of the screen, and disappears automatically + + + + + Tip:It will be kept on the screen until it is closed + + + + + None:Notifications will not be displayed on the screen, but will go to the notification center + + + NumbersButtonIntel @@ -6444,32 +6718,32 @@ Please retry or relogin! OutputConfig - + resolution ажыратымдылығы /Display/resolution - + orientation бағдарлау /Display/orientation - + arrow-up көрсеткі - + 90° arrow-right 90° жебе оң жақтан - + arrow-down көрсеткісі төмен @@ -6483,13 +6757,19 @@ Please retry or relogin! 部分程序需要注销生效 - + 90° arrow-left 90° жебе-солға - + + auto rotation + + /Display/auto rotation + + + frequency жиілік @@ -6500,18 +6780,18 @@ Please retry or relogin! 刷新率 - + auto авто - + screen zoom экранды ұлғайту /Display/screen zoom - + @@ -6574,7 +6854,7 @@ Please retry or relogin! - + GetCode GetCode @@ -6593,56 +6873,56 @@ Please retry or relogin! Жаңылыс - + confirm растау - + commit iс-әрекет - + Mobile number acquisition failed Ұялы телефон нөмірін сатып алу сәтсіз аяқталды - - + + Recapture Қайта басып алу - - - - + + + + Network connection failure, please check Желі қосылымының істен шығуы, тексеруіңізді сұраймыз - + Phone is lock,try again in an hour Телефон құлыпталып, бір сағаттан кейін қайталап көріңіз - + Phone code is wrong Телефон коды дұрыс емес - + Current login expired,using wechat code! Ағымдағы кіру мерзімі өтіп, wechat кодын пайдаланып! - + Unknown error, please try again later Белгісіз қате, кейінірек қайталап көріңіз - + Please use the correct wechat scan code Дұрыс wechat сканерлеу кодын пайдалануыңызды сұраймын @@ -6654,16 +6934,12 @@ Please retry or relogin! 电源计划 - - Balance (suggest) - Баланс (ұсыныс) + Баланс (ұсыныс) - - Saving - Сақтау + Сақтау Minimize performance @@ -6675,20 +6951,16 @@ Please retry or relogin! - - Autobalance energy and performance with available hardware - Қолда бар аппараттық құралдары бар энергияны және өнімділікті автобананстау + Қолда бар аппараттық құралдары бар энергияны және өнімділікті автобананстау Custom 自定义 - - Users develop personalized power plans - Пайдаланушылар дербестендірілген қуат жоспарларын әзірлейді + Пайдаланушылар дербестендірілген қуат жоспарларын әзірлейді Power supply @@ -6743,9 +7015,8 @@ Please retry or relogin! 电源 - Power - Қуат + Қуат Change PC sleep time after %1 min: @@ -6764,11 +7035,8 @@ Please retry or relogin! 系统%1分钟后进入空闲状态并于%2分钟后关闭显示器: - - - never - ешқашан + ешқашан 10 min @@ -6803,230 +7071,163 @@ Please retry or relogin! 5分钟 - - Require password when sleep/hibernation - Ұйқы/хибернация кезінде парольді талап ету + Ұйқы/хибернация кезінде парольді талап ету - - Password required when waking up the screen - Экраннан оянғанда қажетті құпия сөз + Экраннан оянғанда қажетті құпия сөз - Press the power button - Қуат түймешігі + Қуат түймешігі - - Time to close display - Дисплейді жабу уақыты + Дисплейді жабу уақыты - - Time to sleep - Ұйықтау уақыты + Ұйықтау уақыты - - Notebook cover - Жазу кітапшасының мұқабасы + Жазу кітапшасының мұқабасы - - - Using power - Қуатты пайдалану + Қуатты пайдалану - Using battery - Батареяны пайдалану + Батареяны пайдалану - - Time to darken - Қараңғылауға арналған уақыт + Қараңғылауға арналған уақыт - - Battery level is lower than - Аккумуляторлық батареялардың деңгейі төмен + Аккумуляторлық батареялардың деңгейі төмен - Run - Іске қосу + Іске қосу - - Low battery notification - Батареяның төмен хабарландыруы + Батареяның төмен хабарландыруы - Automatically run saving mode when low battery - Батарея төмен болғанда сақтау режимін автоматты түрде іске қосу + Батарея төмен болғанда сақтау режимін автоматты түрде іске қосу - Automatically run saving mode when the low battery - Батареяның төмендігі кезінде сақтау режимін автоматты түрде іске қосу + Батареяның төмендігі кезінде сақтау режимін автоматты түрде іске қосу - - Automatically run saving mode when using battery - Батареяны пайдалану кезінде сақтау режимін автоматты түрде іске қосу + Батареяны пайдалану кезінде сақтау режимін автоматты түрде іске қосу - - Display remaining charging time and usage time - Зарядтаудың қалған уақытын және пайдалану уақытын көрсету + Зарядтаудың қалған уақытын және пайдалану уақытын көрсету - General - Жалпы + Жалпы /Power/General - Select Powerplan - Powerplan бағдарламасын таңдау + Powerplan бағдарламасын таңдау /Power/Select Powerplan - Battery saving plan - Батареяны сақтау жоспары + Батареяны сақтау жоспары /Power/Battery saving plan - - nothing - ештеңе жоқ + ештеңе жоқ - - blank - бос + бос - - - suspend - тоқтата тұру + тоқтата тұру - - - hibernate - Хибернате + Хибернате - interactive - интерактивті + интерактивті - - 5min - 5 мин + 5 мин - - Performance Model - Өнімділік үлгісі + Өнімділік үлгісі - 20min - 20 мин + 20 мин 10minn 10分钟 - - 15min - 15 мин + 15 мин - - 30min - 30 мин + 30 мин - - 1h - 1h + 1h - - 2h - 2h + 2h - - - 10min - 10 мин + 10 мин - 3h - 3h + 3h - - Balance Model - Баланс үлгісі + Баланс үлгісі - - Save Model - Үлгіні сақтау + Үлгіні сақтау - 1min - 1 мин + 1 мин 3min 3分钟 - - - shutdown - өшіру + өшіру always @@ -7080,19 +7281,22 @@ Please retry or relogin! 打印机 - + Printer Принтер - - Printers And Scanners - Принтерлер мен сканерлер + + Printers + + + + Printers And Scanners + Принтерлер мен сканерлер - Add - Қосу + Қосу /Printer/Add @@ -8092,9 +8296,8 @@ E-mail: support@kylinos.cn 开启自动代理 - Auto url - Авто url + Авто url /Proxy/Auto url @@ -8107,50 +8310,40 @@ E-mail: support@kylinos.cn 开启手动代理 - Http Proxy - Http проксиі + Http проксиі /Proxy/Http Proxy - - - - Port - Порт + Порт Cetification 认证 - System Proxy - Жүйелік прокси + Жүйелік прокси - Https Proxy - Https Proxy + Https Proxy /Proxy/Https Proxy - Ftp Proxy - Ftp проксиі + Ftp проксиі /Proxy/Ftp Proxy - Socks Proxy - Шұлық прокси + Шұлық прокси /Proxy/Socks Proxy - List of ignored hosts. more than one entry, please separate with english semicolon(;) - Еленбеген хосттардың тізімі. бірнеше жазба, ағылшынша semicloon(;) + Еленбеген хосттардың тізімі. бірнеше жазба, ағылшынша semicloon(;) Enable Authentication @@ -8165,81 +8358,65 @@ E-mail: support@kylinos.cn 密码 - Apt Proxy - Apt проксиі + Apt проксиі /Proxy/Apt Proxy - Open - Ашу + Ашу - Server Address : - Сервер адресі: + Сервер адресі: - Port : - Порт: + Порт: - Edit - Өңдеу + Өңдеу - The apt proxy has been turned off and needs to be restarted to take effect - Apt проксиі өшірілді және күшіне енуі үшін қайта іске қосу қажет + Apt проксиі өшірілді және күшіне енуі үшін қайта іске қосу қажет - The system needs to be restarted to set the Apt proxy, whether to reboot - Apt проксиін қайта жүктеу керек пе, соны орнату үшін жүйені қайта іске қосу қажет + Apt проксиін қайта жүктеу керек пе, соны орнату үшін жүйені қайта іске қосу қажет - - Reboot Now - Қазір қайта жүктеу + Қазір қайта жүктеу - Start using - Пайдалануды бастау + Пайдалануды бастау - Proxy mode - Прокси режимі + Прокси режимі - Auto - Авто + Авто - Manual - Қолмен + Қолмен - - Reboot Later - Кейінірек қайта жүктеу + Кейінірек қайта жүктеу proxy 代理 - Proxy - Прокси + Прокси @@ -8443,7 +8620,7 @@ E-mail: support@kylinos.cn Таңбашаны реттеу - + Edit Shortcut Таңбашаны өңдеу @@ -8573,7 +8750,7 @@ E-mail: support@kylinos.cn 远程桌面 - + User Info Пайдаланушы ақпараты @@ -8822,12 +8999,17 @@ E-mail: support@kylinos.cn Күн - + + ukui-control-center is disabled! + + + + ukui-control-center орталықтың басқару орталығы - + ukui-control-center is already running! ukui-control-center қазірдің өзінде жұмыс істеп тұр! @@ -8968,72 +9150,72 @@ E-mail: support@kylinos.cn 连接失败,尝试重新连接 - - + + min length %1 % 1 мин ұзындығы - - + + min digit num %1 % 1 деген санның таңбасы - - + + min upper num %1 min жоғарғы num% 1 - - + + min lower num %1 % 1 дегеннің төменгі сан - - + + min other num %1 % 1 басқа num - - + + min char class %1 % 1 дегеннің min char класы - - + + max repeat %1 % 1 дегеннің max қайталануы - - + + max class repeat %1 max класының қайталануы% 1 - - + + max sequence %1 % 1 дегеннің макс тізбектілігі @@ -9053,10 +9235,14 @@ E-mail: support@kylinos.cn XXX 客户端 - + Programs are not allowed to be added. Бағдарламаларды қосуға жол берілмейді. + + English + English + RegDialog @@ -9109,55 +9295,63 @@ E-mail: support@kylinos.cn Screenlock - + Screenlock Скриншот + Screenlock Interface Screenlock интерфейсі + /Screenlock/Screenlock Interface - - + Show message on lock screen Құлыптау экранында хабарды көрсету - - + + Browse Шолу /Screenlock/Browse - - + + Online Picture Онлайн сурет /Screenlock/Online Picture - - + + Reset To Default Әдепкіге ысыру /Screenlock/Reset To Default + + + Related Settings + + + + TextLabel + TextLabel + Screenlock Set 锁屏设置 - - Lock screen when screensaver boot - Скриншотты жүктеу кезінде экранды құлыптау + Скриншотты жүктеу кезінде экранды құлыптау /Screenlock/Lock screen when screensaver boot - + Lock screen delay Экранның кідіруі @@ -9178,8 +9372,7 @@ E-mail: support@kylinos.cn 浏览本地壁纸 - - + Show picture of screenlock on screenlogin Скриншот суретін скриншотта көрсету /Screenlock/Show picture of screenlock on screenlogin @@ -9201,56 +9394,48 @@ E-mail: support@kylinos.cn 图片 - + Never Ешқашан - 1m - 1 м + 1 м - 5m - 5 м + 5 м - 10m - 10 м + 10 м - 30m - 30 м + 30 м - 45m - 45 м + 45 м - 1h - 1h + 1h 1.5h 1.5h - 3h - 3h + 3h - 2h - 2h + 2h - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Тұсқағаз файлдары(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -9259,53 +9444,108 @@ E-mail: support@kylinos.cn 所有文件(*.*) - + + 1min + 1 мин + + + + 5min + 5 мин + + + + 10min + 1 мин {10m?} + + + + 30min + 30 мин + + + + 45min + 1 мин {45m?} + + + + 1hour + 1 нөсер + + + + 2hour + 1 нөсер {2h?} + + + + 3hour + 1 нөсер {3h?} + + + select custom wallpaper file реттелетін тұсқағаздар файлын таңдау - + Select Таңдау - + Position: Лауазымы: - + FileName: Файл атауы: - + FileType: РаÐ1/2аÐ1/2а - + Cancel Болдырмау + + + Monitor Off + + + + + Screensaver + + + + + + Set + + Screensaver - + Screensaver Скриншотшы - - + Idle time Бос уақыт /Screensaver/Idle time - + Lock screen when activating screensaver Экран қорғаушыны белсендіргенде экранды құлыптау @@ -9314,8 +9554,7 @@ E-mail: support@kylinos.cn 开启屏保 - - + Screensaver program Скриншотшы бағдарламасы /Screensaver/Screensaver program @@ -9329,8 +9568,9 @@ E-mail: support@kylinos.cn 分钟 + Lock screen when screensaver boot - 激活屏保时锁定屏幕 + 激活屏保时锁定屏幕 screensaver @@ -9341,121 +9581,121 @@ E-mail: support@kylinos.cn 默认屏保 - + View Көрініс - + Text(up to 30 characters): Мәтін (30 таңбаға дейін): - + Show rest time Демалыс уақытын көрсету - + UKUI УКУИ - + Blank_Only Blank_Only - + Customize Реттеу - - + + 5min 5 мин - - + + 10min 10 мин - + 15min 15 мин - - + + 30min 30 мин - + 1hour 1 нөсер - + Screensaver source Скриншот көзі - - + + Select Таңдау - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) Тұсқағаз файлдары(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) - + select custom screensaver dir реттелетін скриншот дирін таңдаңыз - + Position: Лауазымы: - + FileName: Файл атауы: - + FileType: РаÐ1/2аÐ1/2а - + Cancel Болдырмау - + Switching time Ауыстырып қосу уақыты - + 1min 1 мин - + Ordinal Ординал - + Random switching Кездейсоқ ауыстырып қосу @@ -9468,17 +9708,17 @@ E-mail: support@kylinos.cn 输入文本,最多30个字符 - + Text position Мәтін орны - + Centered Орталықтандырылған - + Randow(Bubble text) Randow(Көпіршікті мәтін) @@ -9515,12 +9755,12 @@ E-mail: support@kylinos.cn 3h - + Random Кездейсоқ - + Never Ешқашан @@ -9634,6 +9874,14 @@ E-mail: support@kylinos.cn Touchpad 触控板 + + + + + + No search results + + SecurityCenter @@ -9839,19 +10087,18 @@ E-mail: support@kylinos.cn 确认退出程序! - + Remote Desktop Қашықтағы үстел - + Allow others to view your desktop Басқаларға жұмыс үстелін көруге рұқсат беру - /Vino/Allow others to view your desktop - + Allow connection to control screen Қосылымды басқару экранына рұқсат ету /Vino/Allow connection to control screen @@ -9862,13 +10109,13 @@ E-mail: support@kylinos.cn Қауіпсіздік - + You must confirm every visit for this machine Осы машинаға әрбір келуді растау керек /Vino/You must confirm every visit for this machine - + Require user to enter this password: Пайдаланушыдан осы құпия сөзді енгізуді талап ету: @@ -9895,8 +10142,8 @@ E-mail: support@kylinos.cn Shortcut - - + + System Shortcut Жүйелік пернелер тіркесімі /Shortcut/System Shortcut @@ -9906,12 +10153,12 @@ E-mail: support@kylinos.cn 显示全部快捷键 - + Custom Shortcut Реттелетін пернелер тіркесімі - + Customize Shortcut Таңбашаны реттеу /Shortcut/Customize Shortcut @@ -9921,23 +10168,23 @@ E-mail: support@kylinos.cn 添加自定义快捷键 - + Add Қосу /Shortcut/Add - + Edit Өңдеу - + Delete Өшіру - + or немесе @@ -9954,7 +10201,7 @@ E-mail: support@kylinos.cn 快捷键 - + Shortcut Пернелер тіркесімі @@ -9986,13 +10233,88 @@ E-mail: support@kylinos.cn 桌面 + + SpliceDialog + + + Dialog + + + + TextLabel + TextLabel + + + + Splice Screen + + + + + + Cancel + + + + + + Ok + 确定 + + + + + Splicing Method + + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + + + + + Row %1, Column %2 + + + + + Select screen + + + StatusDialog - + About Шамамен + + + Activation Code + + SuccessDiaolog @@ -10407,58 +10729,91 @@ E-mail: support@kylinos.cn /Theme/Theme Mode - + + Theme Тақырып - Default - Әдетті + Әдетті - + Light Жарық - + Dark Қараңғы - + + Auto + Авто + + + + Corlor + + + + + Other + 其他 + + + + + Set + + + + + Wallpaper + + + + + Beep + + + + Blue-Crystal Көк кристалл - - + + Light-Seeking Жарық іздеу - + DMZ-Black DMZ- Black - + DMZ-White DMZ-White - + Dark-Sense Күңгірт-түйсік - + + + basic негізгі - + Classic Классикалық @@ -10471,63 +10826,98 @@ E-mail: support@kylinos.cn 时尚 - + hp hp - + ukui укуи - + HeYin Хайн - + + classic + + + + + daybreakBlue + + + + + jamPurple + + + + + magenta + + + + + sunRed + + + + + sunsetOrange + + + + + dustGold + + + + + polarGreen + + + default - әдепкі + әдепкі Middle - - + Window Theme Терезе тақырыбы /Theme/Window Theme - - + Icon theme Белгіше тақырыбы /Theme/Icon theme - Control theme - Басқару тақырыбы + Басқару тақырыбы - - + Cursor theme Курсор тақырыбы /Theme/Cursor theme - + Effect setting Әсер параметрі - - + + Transparency Мөлдірлік /Theme/Transparency @@ -10537,8 +10927,8 @@ E-mail: support@kylinos.cn 透明特效 - - + + Performance mode Өнімділік режимі /Theme/Performance mode @@ -10556,7 +10946,7 @@ E-mail: support@kylinos.cn - + Reset to default Әдепкіге ысыру @@ -10568,27 +10958,27 @@ E-mail: support@kylinos.cn TimeBtn - + Tomorrow Ертең - + Yesterday Кеше - + Today Бүгін - + %1 hours earlier than local % 1 сағат бұрын жергілікті - + %1 hours later than local % 1 сағаттан кейін жергілікті @@ -10610,7 +11000,7 @@ E-mail: support@kylinos.cn 更改时区 - + Search Timezone Іздеу уақытының белдеуі @@ -10619,7 +11009,7 @@ E-mail: support@kylinos.cn 搜索时区 - + To select a time zone, please click where near you on the map and select a city from the nearest city Уақыт белдеуін таңдау үшін картадағы сізге жақын жерді басып, ең жақын қаладан қаланы таңдауыңызды сұраймыз @@ -10703,9 +11093,8 @@ E-mail: support@kylinos.cn 触控板 - Touchpad - Сенсорлық тақта + Сенсорлық тақта Disable rolling @@ -10739,18 +11128,16 @@ E-mail: support@kylinos.cn TouchpadUI - Touchpad Setting - Сенсорлық тақта параметрі + Сенсорлық тақта параметрі No touchpad found 未发现触控板设备 - Disable touchpad when using the mouse - Тінтуірді пайдаланғанда сенсорлық алаңды өшіру + Тінтуірді пайдаланғанда сенсорлық алаңды өшіру /Touchpad/Disable touchpad when using the mouse @@ -10759,59 +11146,49 @@ E-mail: support@kylinos.cn /Touchpad/Cursor Speed - Slow - Баяу + Баяу - Fast - Жылдам + Жылдам - Disable touchpad when typing - Теру кезінде сенсорлық алаңды өшіру + Теру кезінде сенсорлық алаңды өшіру /Touchpad/Disable touchpad when typing - Touch and click on the touchpad - Сенсорлық тақтаға жанасу және басу + Сенсорлық тақтаға жанасу және басу /Touchpad/Touch and click on the touchpad - Scroll bar slides with finger - Штрих-слайдтарды саусақпен айналдыру + Штрих-слайдтарды саусақпен айналдыру /Touchpad/Scroll bar slides with finger - Scrolling area - Айналдыру аймағы + Айналдыру аймағы /Touchpad/Scrolling area - Disable scrolling - Айналдыруды өшіру + Айналдыруды өшіру - Edge scrolling - Жиек айналдыру + Жиек айналдыру - Pointer Speed - Көрсеткіш жылдамдығы + Көрсеткіш жылдамдығы /Touchpad/Pointer Speed - Two-finger scrolling in the middle area - Ортаңғы аймақта екі саусақты айналдыру + Ортаңғы аймақта екі саусақты айналдыру @@ -10856,8 +11233,8 @@ E-mail: support@kylinos.cn UkccAbout - - + + Settings Параметрлер @@ -10866,12 +11243,12 @@ E-mail: support@kylinos.cn 控制面板 - + Version: Нұсқасы: - + Service and Support: Қызмет көрсету және қолдау: @@ -11130,53 +11507,65 @@ E-mail: support@kylinos.cn UnifiedOutputConfig - + resolution ажыратымдылығы - + orientation бағдарлау - + arrow-up көрсеткі - + 90° arrow-right 90° жебе оң жақтан - - + + arrow-down көрсеткісі төмен - + 90° arrow-left 90° жебе-солға - + + auto rotation + + /Display/auto rotation + + + frequency жиілік + + + screen zoom + экранды ұлғайту + /Display/screen zoom + refresh rate 刷新率 - + auto @@ -11266,12 +11655,12 @@ E-mail: support@kylinos.cn 管理员用户 - + root түбір - + Hint Тұспал @@ -11280,32 +11669,32 @@ E-mail: support@kylinos.cn 更改账户类型需要注销后生效,是否注销? - + The account type of “%1” has been modified, will take effect after logout, whether to logout? "% 1" тіркелгі түрі өзгертілген, журналға кіргеннен кейін күшіне енеді ме? - + logout later кейінірек кіру - + logout now енді жүйеге кіру - + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? Жүйе тек бір пайдаланушыға автоматты түрде кіруге мүмкіндік береді. Ол қосылғаннан кейін басқа пайдаланушылардың автоматты кіруі өшіріледі. Ол қосылды ма? - + Trun on Трун - + Close on Жабу@ action: inmenu @@ -11322,12 +11711,12 @@ E-mail: support@kylinos.cn 验证 - + Standard Стандарт - + Admin Әкімші @@ -11336,42 +11725,52 @@ E-mail: support@kylinos.cn 删除 - + CurrentUser CurrentUser + /Userinfo/CurrentUser - + OthersUser Басқалар + /Userinfo/OthersUser - + + Add + + /Userinfo/Add + + + Passwd Пассвд - + Groups Топтар - + AutoLoginOnBoot AutoLoginOnBoot + /Userinfo/AutoLoginOnBoot LoginWithoutPwd LoginWithoutPwd + /Userinfo/LoginWithoutPwd - + Warning Ескерту - + The user is logged in, please delete the user after logging out Пайдаланушы кірді, журналға кіргеннен кейін пайдаланушыны жоюыңызды сұраймыз @@ -11403,18 +11802,14 @@ E-mail: support@kylinos.cn - Password Пароль - /Userinfo/Password - - + Type Түрі - /Userinfo/Type Valid @@ -11427,15 +11822,12 @@ E-mail: support@kylinos.cn - Login no passwd Passwd жоқ кіру - /Userinfo/Login no passwd - enable autoLogin - автологтауды қосу + автологтауды қосу /Userinfo/enable autoLogin @@ -11481,10 +11873,10 @@ E-mail: support@kylinos.cn UserInfoIntel - + Current User Ағымдағы пайдаланушы - /Userinfo/Current User + /UserinfoIntel/Current User @@ -11493,11 +11885,11 @@ E-mail: support@kylinos.cn - - + + Change pwd pwd- ді өзгерту - /Userinfo/Change pwd + /UserinfoIntel/Change pwd @@ -11521,45 +11913,51 @@ E-mail: support@kylinos.cn - + Other Users Басқа пайдаланушылар - /Userinfo/Other Users + /UserinfoIntel/Other Users - + User Info Intel User Info Intel - + Change Tel Телді өзгерту - /Userinfo/Change Tel + /UserinfoIntel/Change Tel - + Delete user Пайдаланушыны жою - /Userinfo/Delete user + /UserinfoIntel/Delete user - + + Change user name + + /UserinfoIntel/Change user name + + + standard user стандартты пайдаланушы - + administrator әкімші - + root түбір - + Add new user Жаңа пайдаланушыны қосу @@ -11577,27 +11975,27 @@ E-mail: support@kylinos.cn UtilsForUserinfo - + Passwd Пассвд - + Type Түрі - + Del Дель - + Standard Стандарт - + Admin Әкімші @@ -11605,7 +12003,7 @@ E-mail: support@kylinos.cn Vino - + Vino Вино @@ -11627,38 +12025,38 @@ E-mail: support@kylinos.cn VPN - Vpn - Впн + Впн - VPN - VPN + VPN Wallpaper + Desktop Background Үстел аясы + /Wallpaper/Desktop Background - + Mode Режім - - + + Online Picture Онлайн сурет /Wallpaper/Online Picture - - + + Reset To Default Әдепкіге ысыру /Wallpaper/Reset To Default @@ -11672,8 +12070,8 @@ E-mail: support@kylinos.cn 图片放置方式 - - + + Browse Шолу /Wallpaper/Browse @@ -11703,19 +12101,18 @@ E-mail: support@kylinos.cn 背景 - - - + + Background Аясы - + picture сурет - + color түсі @@ -11728,35 +12125,37 @@ E-mail: support@kylinos.cn 自定义颜色 - + wallpaper тұсқағаздар - + centered ортасы - + scaled масштабталған - + stretched созылыңқы + zoom - 缩放 + 缩放 + spanned - 适合宽度 + 适合宽度 - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Тұсқағаз файлдары(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -11765,38 +12164,38 @@ E-mail: support@kylinos.cn 所有文件(*.*) - - + + select custom wallpaper file реттелетін тұсқағаздар файлын таңдау - - + + Select Таңдау - - + + Position: Лауазымы: - - + + FileName: Файл атауы: - - + + FileType: РаÐ1/2аÐ1/2а - - + + Cancel Болдырмау @@ -11812,10 +12211,10 @@ E-mail: support@kylinos.cn 统一输出 - + night mode түнгі режим - /Display/night mode + /display/night mode @@ -11823,99 +12222,162 @@ E-mail: support@kylinos.cn Күшіне ену үшін кейбір бағдарламаларды тіркеу қажет - + Night Mode Түнгі режим + /Display/Night Mode - + Open Ашу - + Time Уақыт - - + + Custom Time Реттелетін уақыт - + to to - + Color Temperature Түс температурасы - + Warmer Вармер - + Colder Суық - + Multi-screen Көп экранды - + First Screen Бірінші экран - + Clone Screen Клон экраны - + + + Splice Screen + + + + Auto Brightness Авто жарықтық - + Adjust screen brightness by ambient Экран жарықтығын қоршаған орта бойынша реттеу - - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> - % 1 экраны өзгертілген, оны сақтау керек пе? <br/> <font style= 'color:#626c6e'>параметрлер 14 секундтан кейін сақталады</font> + + Dynamic light + + /Display/Dynamic light + + + + Optimize display content to extend battery life + + + + + scale + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> + + + + + The zoom has been modified, it will take effect after you log off + + + + + + (Effective after logout) + + + + + Splicing Method + + + + + Change + Өзгерту + + + + as main + негізгі ретінде + + + + open monitor + ашық монитор + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> + % 1 экраны өзгертілген, оны сақтау керек пе? <br/> <font style= 'color:#626c6e'>параметрлер 14 секундтан кейін сақталады</font> - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> % 1 экраны өзгертілген, оны сақтау керек пе? <br/> <font style= 'color:#626c6e'>параметрлер% 2 секундтан кейін сақталады</font> - + + Follow the sunrise and sunset Күннің шығысы мен күн батуын бақылау - + Extend Screen Экранды кеңейту - + Vice Screen Вице-экран - + monitor монитор @@ -11927,32 +12389,29 @@ E-mail: support@kylinos.cn Ақпарат - Theme follow night mode Тақырып түнгі режимде жүреді - + resolution ажыратымдылығы - + orientation бағдарлау - + frequency жиілік - - Hint Тұспал @@ -11963,13 +12422,13 @@ the settings will be saved after 14 seconds 是否保留当前修改的配置?将在14秒后自动保存配置 - + Save Сақтау - + Not Save Сақтамау @@ -11980,22 +12439,21 @@ the settings will be saved after %1 seconds 是否保留当前修改的配置?将在%1秒后自动保存配置 - The zoom function needs to log out to take effect - Ұлғайту функциясының күшіне енуі үшін кіру қажет + Ұлғайту функциясының күшіне енуі үшін кіру қажет - + Log out now Енді журналға кіріңіз - + Later Кейінірек - + All Day Күні бойы @@ -12004,12 +12462,13 @@ the settings will be saved after %1 seconds 跟随日出日落(17:55-06:23) - - - - + + + + Brightness Жарықтық + /Display/Brightness After modifying the resolution or refresh rate, due to compatibility issues between the display device and the graphics card, the display may be abnormal or unable to display @@ -12032,6 +12491,7 @@ If something goes wrong, the settings will be restored after 9 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在9秒后还原设置 + screen zoom экранды ұлғайту @@ -12067,7 +12527,7 @@ the settings will be saved after %1 seconds 修改分辨率或刷新率后,由于显示设备与 显卡兼容性问题,有可能显示不正常。系统将在%1秒后保存配置 - + Warnning Уорнинг @@ -12077,19 +12537,18 @@ If something goes wrong, the settings will be restored after %1 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在%1秒后还原设置 - - - + + + please insure at least one output! кем дегенде бір шығысты сақтандыруыңызды сұраймын! - - - - - + + + + Warning Ескерту @@ -12102,8 +12561,7 @@ If something goes wrong, the settings will be restored after %1 seconds 屏幕分辨率已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在%1秒后自动保存。</font> - - + Open time should be earlier than close time! Ашық уақыт жақын уақыттан ерте болуы керек! @@ -12112,8 +12570,8 @@ If something goes wrong, the settings will be restored after %1 seconds 早晨时刻应早于晚上的时刻! - - + + Sorry, your configuration could not be applied. Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. Кешіріңіз, конфигурацияңыз қолданылмады. @@ -12187,7 +12645,7 @@ Common reasons are that the overall screen size is too big, or you enabled more addShortcutDialog - + Dialog Диалог @@ -12200,28 +12658,28 @@ Common reasons are that the overall screen size is too big, or you enabled more 快捷键程序 - + Exec Эксек - + Open Ашу - + Name Атауы - + Key Кілт - - + + TextLabel TextLabel @@ -12230,13 +12688,13 @@ Common reasons are that the overall screen size is too big, or you enabled more 无效的可执行程序,请重新选择 - - + + Cancel Болдырмау - + Save Сақтау @@ -12270,60 +12728,60 @@ Common reasons are that the overall screen size is too big, or you enabled more Пернелер тіркесімін қосу - + Please enter a shortcut Пернелер тіркесімін енгізіңіз - + Desktop files(*.desktop) Жұмыс үстелі файлдары(*.жұмыс үстелі) - + select desktop жұмыс үстелін таңдау - - - + + + Invalid application Қолданба жарамсыз - - - + + + Shortcut conflict Пернелер тіркесімі қайшылық - - - + + + Invalid shortcut Жарамсыз пернелер тіркесімі - - - + + + Name repetition Атауды қайталау - + Unknown error Беймәлім қате - + Shortcut cannot be empty Пернелер тіркесімі бос болмады - + Name cannot be empty Атауы бос бола алмайды @@ -12335,6 +12793,76 @@ Common reasons are that the overall screen size is too big, or you enabled more 请输入手机号码 + + changeUserGroup + + + user group + + + + + Group: + + + + + GID: + + + + + GNum: + + + + + + Cancel + + + + + + Confirm + + + + + + + Tips + Кеңестер + + + + + Invalid Id! + Жарамсыз идентификатор! + + + + + + OK + + + + + Invalid Group Name! + Жарамсыз топтың атауы! + + + + Whether delete the group: “%1” ? + + + + + which will make some file components in the file system invalid! + бұл файл жүйесіндегі кейбір файл компоненттерін жарамсыз етеді! + + changtimedialog diff --git a/shell/res/i18n/ky.ts b/shell/res/i18n/ky.ts index 7798a4f..554dec5 100644 --- a/shell/res/i18n/ky.ts +++ b/shell/res/i18n/ky.ts @@ -4,94 +4,101 @@ About - + System Summary Системанын корутундусу - + Support Колдоо - - + Version Number Версия номери - + Status Абалы /About/Status - + DateRes Датарес - + Wechat code scanning obtains HP professional technical support Wechat кодун сканерлеу HP кесиптик техникалык колдоо алат - + HostName ХостНаме - + See more about Kylin Tianqi edu platform Кайлин Тяньци эду платформасы жөнүндө көбүрөөк көрүү - + <<Protocol>> <<Protocol>> - - InterVersion - ИнтерВерсия + + About and Support + - + InterVersion + ИнтерВерсия + + + + Patch Version + + + + Privacy and agreement Купуялуулук жана макулдашуу - + Send optional diagnostic data Кошумча диагностикалык маалыматтарды жөнөтүү - + By sending us diagnostic data, improve the system experience and solve your problems faster бизге диагностикалык маалыматтарды жөнөтүү менен, система тажрыйбасын жакшыртуу жана көйгөйлөрдү тезирээк чечүү - Copyright © 2009-%1 KylinSoft. All rights reserved. - Автордук укук © 2009-%1 КайлинСофт. Бардык укуктар корголгон. + Автордук укук © 2009-%1 КайлинСофт. Бардык укуктар корголгон. - + and жана - + <<Privacy>> <<Privacy>> - + Learn more HP user manual>> Көбүрөөк HP колдонуучу колдонмо билүү>> - + See user manual>> Колдонуучу колдонмону караңыз>> @@ -100,34 +107,49 @@ 未激活(试用期) - + Trial expiration time Сыноонун мөөнөтү аяктады - - + + expired мөөнөтү аяктады - - + + Extend Кеңейтүү - + + Copyright © 2009-%1 %2. All rights reserved. + + + + + Openkylin + + + + + KylinSoft + + + + The system needs to be restarted to set the HostName, whether to reboot ХостНамды орнотуу үчүн системаны кайра иштетүү зарыл, кайра жүктөө керекпи? - + Reboot Now Азыр кайра жүктөө - + Reboot Later Кийинчерээк кайра жүктөө @@ -140,9 +162,9 @@ 延长服务 - - - + + + avaliable баа жеткис @@ -159,7 +181,8 @@ 版权所有2009-2021@kylinos保留所有权利 - + + Version Версиясы /About/version @@ -177,37 +200,42 @@ 版权所有 © 2009-2021 麒麟软件 保留所有权利。 - + + Kernel Кернель /About/Kernel - + + CPU КПУ /About/CPU - + + Memory Эс тутум /About/Memory - - + + Disk Диск - + + Desktop Иш столу /About/Desktop - + + User Колдонуучу /About/User @@ -221,7 +249,7 @@ 有效期 - + Serial Сериялык @@ -234,8 +262,8 @@ 序列号 - - + + Active Активдүү @@ -252,7 +280,7 @@ 关于 - + About Жөнүндө @@ -269,13 +297,13 @@ 可用 - - + + Inactivated Активдештирилди - + Activated Активдештирилген @@ -417,11 +445,92 @@ AddBtn - + Add Кошуу + + AddButton + + + Add + Кошуу + + + + AddInputMethodDialog + + + Dialog + + + + + Select the input method to add + + + + + No + + + + + Yes + + + + + + keyboard + 键盘 + + + + + Tibetan + + + + + With ASCII numbers + + + + + Input Method + + + + + AddLanguageDialog + + + Dialog + + + + + No + + + + + Yes + + + + + Add Language + + + + + Search + + + AddNetBtn @@ -598,87 +707,70 @@ AptProxyDialog - Set Apt Proxy - Апт проксисин орнотуу + Апт проксисин орнотуу - Server Address - Сервердин дареги + Сервердин дареги - Port - Порт + Порт - Cancel - Жокко чыгаруу + Жокко чыгаруу - Confirm - Ырастоосу + Ырастоосу Area - - + Area Аймак Regional Format 区域格式 - - - - - Current Region - Учурдагы аймак /Area/Current Region - - First Day Of The Week - Жуманын биринчи күнү + Current Region + Учурдагы аймак + /Area/Current Region + + + First Day Of The Week + Жуманын биринчи күнү - - Calendar - Календар + Календар /Area/Calendar - - Language Format - Тил форматы + Тил форматы /Area/Regional Format - - Date - Датасы + Датасы /Area/Date - - Time - Убакыт + Убакыт /Area/Time - TextLabel - ТекстЛабель + ТекстЛабель Area showing time currency format @@ -689,7 +781,7 @@ 区域格式数据 - + lunar Ай @@ -714,73 +806,74 @@ 显示日期、时间、货币格式的区域 - US - АКШ + АКШ - Language for system windows,menus and web pages - Системалык терезелер,менюлар жана веб-барактар үчүн тил + Системалык терезелер,менюлар жана веб-барактар үчүн тил Add main language 添加首语言 - - System Language - Система тили + Система тили /Area/system language + Simplified Chinese - 简体中文 + 简体中文 - First Day Of Week - Жуманын биринчи күнү + Жуманын биринчи күнү /Area/First Day Of Week - + 12 Hours 12 саат - + 24 Hours 24 саат - + + Tibetan + + + + Modify the current region need to logout to take effect, whether to logout? Учурдагы аймакты өзгөртүү күчүнө кирүү үчүн, кирүү керекпи? - + Logout later Кийинчерээк кирүү - + Logout now Азыр кирүү - + Modify the first language need to reboot to take effect, whether to reboot? Биринчи тилди өзгөртүү күчүнө кирүү үчүн кайра жүктөө керекпи, кайра жүктөө керекпи? - + Reboot later Кийинчерээк кайра жүктөө - + Reboot now Азыр кайра жүктөө @@ -821,9 +914,8 @@ 显示语言 - CN - CN + CN Need to cancel to take effect @@ -846,8 +938,9 @@ 区域格式数据 + English - English + English Chinese @@ -858,17 +951,34 @@ 添加首语言 - + solar calendar күн календары + monday - 星期一 + 星期一 + + English (US) + + + + + Simplified Chinese (CN) + + + + + Tibetan (CN) + + + + sunday - 星期天 + 星期天 change data format @@ -882,6 +992,51 @@ 请输入手机号码 + + AreaUi + + + Regional Format + 区域格式 + /Area/Regional Format + + + + Calendar + Календар + /Area/Calendar + + + + First Day Of Week + Жуманын биринчи күнү + /Area/First Day Of Week + + + + Date + + /Area/Date + + + + Time + Убакыт + /Area/Time + + + + Language Format + Тил форматы + /Area/Language Format + + + + System Language + Система тили + /Area/System Language + + Audio @@ -892,33 +1047,32 @@ AutoBoot - + Desktop files(*.desktop) Иш столунун файлдары (*.desktop) - + select autoboot desktop автобут иш столун тандоо - + Select Тандоо - + Cancel Жокко чыгаруу - Add - Кошуу - /autoboot/Add + Кошуу + /Autoboot/Add - + Autoboot Settings Автобут параметрлери /autoboot/Autoboot Settings @@ -936,7 +1090,7 @@ 开机启动 - + Auto Boot Авто жүктөө @@ -949,7 +1103,7 @@ 当前状态 - + Delete Жоготуу @@ -958,8 +1112,7 @@ Backup - - + Backup Резервдик @@ -982,14 +1135,14 @@ you can restore them to ensure the integrity of your system. - + Begin backup Резервдик жардамды баштоо /Backup/Begin backup - + Restore Калыбына келтирүү @@ -1004,7 +1157,7 @@ you can restore them to ensure the integrity of your system. - + Begin restore Калыбына келтирүү баштоо /Backup/Begin restore @@ -1019,14 +1172,14 @@ you can restore them to ensure the integrity of your system. 将永久抹掉存储在计算机的所有数据,且无法撤销此操作。抹掉完成后系统将恢复至最初始出厂状态 - + All data stored on the computer will be permanently erased,and the system will revert to its original factory state when this operation is completed. Компьютерде сакталган бардык маалыматтар биротоло өчүрүлөт, система кайра кайтат бул операция аяктаганда, анын баштапкы фабрика абалы. - + Clear and restore Тазалоо жана калыбына келтирүү @@ -1038,17 +1191,22 @@ you can restore them to ensure the integrity of your system. Системаны калыбына келтирүү - + + Backup Restore + + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. Файлдарыңызды башка дисктерге кайтарып, системанын бүтүндүгүн камсыз кылуу үчүн булак файлдары жоготулганда, зыянга учураганда же жоготулганда калыбына келтириңиз. - + View the backup list and restore the backup file to the system Резервдик тизменин резервдик тизмесин көрүү жана резервдик файлды системага калыбына келтирүү - + Backup and Restore Резервдик жана калыбына келтирүү @@ -1472,7 +1630,7 @@ Please authenticate yourself to continue BrightnessFrame - + Failed to get the brightness information of this monitor Бул монитордун жарыктыгы тууралуу маалыматты ала алган жок @@ -1558,63 +1716,65 @@ Please authenticate yourself to continue ChangeFaceIntelDialog - + + Change User Face Колдонуучунун жүзүн өзгөртүү + /UserinfoIntel/Change User Face - + History Тарых - + System Система - - + + Cancel Жокко чыгаруу - + Confirm Ырастоосу - + select custom face file колдонуучунун бет файлын тандоо - + Select Тандоо - + Position: Позиция: - + FileName: Файл Аты: - + FileType: FileType: - + Warning Эскертүү - + The avatar is larger than 2M, please choose again Аватар 2М чоңураак, сураныч, кайрадан тандап алыңыз @@ -1645,59 +1805,48 @@ Please authenticate yourself to continue ChangeGroupDialog - Dialog - Диалог + Диалог - User Group Settings - Колдонуучулар тобунун параметрлери + Колдонуучулар тобунун параметрлери User groups available in the system 系统中可用的用户组 - Cancel - Жокко чыгаруу + Жокко чыгаруу Add new user 添加新用户 - User group - Колдонуучу тобу + Колдонуучу тобу - Add user group - Колдонуучу тобун кошуу + Колдонуучу тобун кошуу - - Tips - Кеңештер + Кеңештер - Invalid Id! - Жараксыз идентификация! + Жараксыз идентификация! - - OK - МАКУЛ + МАКУЛ - Invalid Group Name! - Жараксыз Топтун аты! + Жараксыз Топтун аты! @@ -1763,107 +1912,107 @@ Please authenticate yourself to continue Телефонду өзгөртүү - + Phone number Телефон номери - + SMS verification code СМС текшерүү коду - + Please input old phone number Эски телефон номерин киргизүүнү суранабыз - + Next Кийинки - - + + Please enter new mobile number Жаңы мобилдик номерди киргизиңиз - - + + Submit Тапшыруу - + changed success ийгилик өзгөрдү - - + + You have successfully modified your phone Телефонуңузду ийгиликтүү өзгөрттүңөр - - + + Recapture Кайра басып алуу - - - + + + Network connection failure, please check Тармактык туташуу катасы, текшерүү - - + + GetCode GetCode - - - + + + Phone is lock,try again in an hour Телефон кулпу болуп саналат,бир сааттын ичинде кайра аракет - - - + + + Phone code is wrong Телефон коду туура эмес - + Current login expired,using wechat code! Учурдагы кирүү мөөнөтү өтүп, вечат кодун колдонуу менен! - - - + + + Unknown error, please try again later Белгисиз ката, сураныч, кийин кайра аракет - + Phone can not same Телефон бирдей болушу мүмкүн эмес - - + + finished аяктады - - + + Phone number already in used! Колдонулган телефон номери! @@ -2166,7 +2315,7 @@ Please authenticate yourself to continue ChangeUserLogo - + System Logos Системалык логотиптер @@ -2175,58 +2324,58 @@ Please authenticate yourself to continue 本地头像 - + User logo Колдонуучу логотипи - + Select Local Logo Жергиликтүү логотип тандоо - - + + Cancel Жокко чыгаруу - + Confirm Ырастоосу - + select custom face file колдонуучунун бет файлын тандоо - + Select Тандоо - + Position: Позиция: - + FileName: Файл Аты: - + FileType: FileType: - + Warning Эскертүү - + The avatar is larger than 1M, please choose again Аватар 1М чоңураак, сураныч, кайрадан тандап алыңыз @@ -2275,17 +2424,17 @@ Please authenticate yourself to continue UserName - + NickName НикНаме - + nickName already in use. никНаме буга чейин колдонулуп жатат. - + The length must be 1~%1 characters! узундугу 1~1 символдор болушу керек! @@ -2302,12 +2451,12 @@ Please authenticate yourself to continue 计算机名 - + Cancel Жокко чыгаруу - + Confirm Ырастоосу @@ -2315,71 +2464,83 @@ Please authenticate yourself to continue ChangeUserPwd - + Change password Сырсөздү өзгөртүү - - - + + + Current Pwd Учурдагы Pwd - - - - + + + + New Pwd Жаңы Pwd - - - - + + + + Sure Pwd Албетте, Pwd - + Cancel Жокко чыгаруу - + + + Confirm Ырастоосу - - + + Inconsistency with pwd Pwd менен дал келбестик - + + Same with old pwd + 与旧密码相同 + + + + Pwd Changed Succes + + + + Authentication failed, input authtok again! Аутентификация ишке ашпады, кайра киргизүү аутток! - + Contains illegal characters! Мыйзамсыз символдорду камтыйт! - + current pwd cannot be empty! учурдагы pwd бош болушу мүмкүн эмес! - + new pwd cannot be empty! жаңы pwd бош болушу мүмкүн эмес! - + sure pwd cannot be empty! албетте, pwd бош болушу мүмкүн эмес! @@ -2387,47 +2548,47 @@ Please authenticate yourself to continue ChangeUserType - + UserType UserType - + administrator администратор - + standard user стандарттык колдонуучу - + Select account type (Ensure have admin on system): Эсеп түрүн тандоо (Системада админдин болушун камсыз кылуу): - + change system settings, install and upgrade software. система параметрлерин өзгөртүү, орнотуу жана программалык камсыздоону жогорулатуу. - + use most software, cannot change system settings. программалык камсыздоонун көбүн колдонуу системалык параметрлерди өзгөртө албайт. - + Note: Effective After Logout!!! Эскертүү: Кирүү кийин натыйжалуу!!! - + Confirm Ырастоосу - + Cancel Жокко чыгаруу @@ -2583,29 +2744,32 @@ Please authenticate yourself to continue CreateGroupDialog - Dialog - Диалог + Диалог - + Add New Group Жаңы топту кошуу - + Name Аты-жөнү - + Id Идентификация - + + Confirm + + + Members - Мүчөлөрү + Мүчөлөрү Group Name @@ -2620,17 +2784,16 @@ Please authenticate yourself to continue 组成员 - + Cancel Жокко чыгаруу - Certain - Албетте + Албетте - + Add user group Колдонуучу тобун кошуу @@ -3023,38 +3186,38 @@ change system settings - + Inconsistency with pwd Pwd менен дал келбестик - - + + The nick name cannot be empty Ник аты бош болушу мүмкүн эмес - + nickName already in use. никНаме буга чейин колдонулуп жатат. - + nickName length must less than %1 letters! никНам узундугу %1 тамгадан аз болушу керек! - + Username's length must be between 1 and %1 characters! Username узундугу 1 жана %1 символдор ортосунда болушу керек! - + new pwd cannot be empty! жаңы pwd бош болушу мүмкүн эмес! - + sure pwd cannot be empty! албетте, pwd бош болушу мүмкүн эмес! @@ -3083,7 +3246,7 @@ change system settings 该用户名已存在,请更改。 - + Name corresponds to group already exists. Аты-жөнү буга чейин бар топко дал келет. @@ -3096,16 +3259,24 @@ change system settings 用户名仅能包含字母,数字及下划线 - + Username's folder exists, change another one Колдонуучунун папкасы бар, башкасын өзгөртүү - + Contains illegal characters! Мыйзамсыз символдорду камтыйт! + + CustomGlobalTheme + + + custom + + + CustomLineEdit @@ -3182,32 +3353,25 @@ change system settings учурдагы дата - - + Change timezone Убакыт зонаны өзгөртүү /Date/Change time zone - - TextLabel - ТекстЛабель + ТекстЛабель - - RadioButton - РадиоБуттон + РадиоБуттон - - : - : + : - + titleLabel аталышы Лабель @@ -3252,18 +3416,24 @@ change system settings 时间日期 - + Date Датасы - + + Current Date + + /Date/Current Date + + + Other Timezone Башка Таймзон /Date/Other Timezone - + 24-hour clock 24 сааттык саат /Date/24-hour clock @@ -3281,13 +3451,13 @@ change system settings 添加时区,最多添加5个 - + Sync Server Серверди синхрондоо /Date/Sync Server - + Add Timezone Таймзонду кошуу @@ -3296,13 +3466,13 @@ change system settings 删除 - + Manual Time Колдонмо убакыт /Date/Manual Time - + Sync Time Убакытты синхрондоо /Date/Sync Time @@ -3322,55 +3492,55 @@ change system settings /Date/Network - + Set Time Убакытты белгилөө /Date/Set Time - + Set Date Manually Датаны кол менен белгилөө /Date/Set Date Manually - + Default Дефолт - + Customize Жекелештирүү - + Server Address Сервердин дареги - + Required Талап кылынат - + Save Сактоо - + Change Timezone Таймзонду өзгөртүү - + - - + + Sync failed Синхрондоо ишке ашпады @@ -3387,7 +3557,7 @@ change system settings 同步网络时间 - + change time убакытты өзгөртүү @@ -3403,56 +3573,65 @@ change system settings 默认应用 - + Default App Дефолт тиркеме - + No program available Программа жеткиликтүү эмес - + + Choose default app + + + + + Reset default apps to system recommended apps + + + + + Reset + + + + Browser Браузер - /Defaultapp/Browser - + Mail Почта - /Defaultapp/Mail - + Image Viewer Сүрөт көрүүчү - /Defaultapp/Image Viewer - + Audio Player Аудио ойноткуч - /Defaultapp/Audio Player - + Video Player Видео ойноткуч - /Defaultapp/Video Player - + Text Editor Текст редактору - /Defaultapp/Text Editor DefaultAppWindow - + Select Default Application Демейде иштемени тандоо @@ -3488,14 +3667,12 @@ change system settings DefineGroupItem - Edit - Оңдоо + Оңдоо - Del - Дель + Дель Delete @@ -3526,9 +3703,8 @@ change system settings DelGroupDialog - Dialog - Диалог + Диалог Are you sure to delete this group, @@ -3537,25 +3713,20 @@ in the file system invalid! 确定删除此用户组? 这将使得文件系统\n中的某些文件组件ID无效! - Are you sure to delete the group: - Сиз топту жоготууга сөзсүз: + Сиз топту жоготууга сөзсүз: - - which will make some file components in the file system invalid! - файл системасындагы кээ бир файл компоненттерин жараксыз кылат! + файл системасындагы кээ бир файл компоненттерин жараксыз кылат! - Delete - Жоготуу + Жоготуу - Cancel - Жокко чыгаруу + Жокко чыгаруу RemoveFile @@ -3573,9 +3744,8 @@ in the file system invalid! 中的某些文件组件ID无效! - Delete user group - Колдонуучу тобун жоготуу + Колдонуучу тобун жоготуу Are you sure to delete the group, which will make some file components in the file system invalid! @@ -3669,7 +3839,7 @@ folder will be deleted! Жокко чыгаруу - + Delete the user, belonging to the user's desktop documents, favorites, music, pictures and video folder will be deleted! Колдонуучунун иш столунун документтерине, жактыруусуна, музыкасына, сүрөттөрүнө жана видео папкасына таандык колдонуучуну жоготуу! @@ -3677,17 +3847,17 @@ folder will be deleted! DeleteUserExists - + Delete user ' Колдонуучуну жоготуу ' - + '? And: '? Ал эми: - + Keep desktop, files, favorites, music of the user Иш столун, файлдарды, жактырган, колдонуучунун музыкасын сактоо @@ -3696,17 +3866,17 @@ folder will be deleted! 保留用户家目录 - + Cancel Жокко чыгаруу - + Confirm Ырастоосу - + Delete whole data belong user Бардык маалыматтарды жоготуу колдонуучуга таандык @@ -4189,7 +4359,12 @@ folder will be deleted! 显示器 - + + Screen + + + + Display Дисплей @@ -4198,7 +4373,6 @@ folder will be deleted! DisplayWindow - monitor монитор @@ -4216,7 +4390,6 @@ folder will be deleted! 统一输出 - open monitor ачык монитор @@ -4234,13 +4407,11 @@ folder will be deleted! Дисплей - as main негизги катары - screen zoom экранды чоңойтуу @@ -4263,43 +4434,36 @@ folder will be deleted! - follow the sunrise and sunset(17:55-05:04) күн чыгыш жана күн баткандан кийин (17:55-05:04) - custom time колдонуу убактысы - opening time ачылыш убактысы - closing time жабуу убактысы - color temperature түс температурасы - warm жылуу - cold муздак @@ -4317,59 +4481,48 @@ folder will be deleted! EditGroupDialog - Dialog - Диалог + Диалог - Cancel - Жокко чыгаруу + Жокко чыгаруу - Certain - Албетте + Албетте - Edit User Group - Колдонуучу тобун оңдоо + Колдонуучу тобун оңдоо - Name - Аты-жөнү + Аты-жөнү - Id - Идентификация + Идентификация - Members - Мүчөлөрү + Мүчөлөрү - Tips - Кеңештер + Кеңештер - Invalid Id! - Жараксыз идентификация! + Жараксыз идентификация! - OK - МАКУЛ + МАКУЛ - Edit user group - Колдонуучу тобун оңдоо + Колдонуучу тобун оңдоо @@ -4651,6 +4804,16 @@ folder will be deleted! Thanks For Using The ukcc 欢迎使用设置 + + + Small + + + + + Large + + FrameItem @@ -4747,17 +4910,17 @@ folder will be deleted! ХостНаме - + Must be 1-64 characters long 1-64 символдор узун болушу керек - + Cancel Жокко чыгаруу - + Confirm Ырастоосу @@ -5137,15 +5300,14 @@ folder will be deleted! 键盘 - Keyboard - Алиптергич + Алиптергич KeyboardMain - + Key board settings Негизги такта параметрлери @@ -5154,57 +5316,62 @@ folder will be deleted! 输入法设置 - + + Keyboard + + + + Input settings Киргизүү параметрлери /Keyboard/Input settings - + Key repeat Негизги кайталоо /Keyboard/Key repeat - + Delay Кечиктирүү /Keyboard/Delay - + Short Кыска - + Long Лонг - + Speed Ылдамдык /Keyboard/Speed - + Slow Жай - + Fast Орозо - + Input test Кирүү тести /Keyboard/Input test - + Key tips Негизги кеңештер /Keyboard/Key tips @@ -5229,6 +5396,19 @@ folder will be deleted! 布局预览 + + LanguageFrame + + + Input Settings + 输入法设置 + + + + Delete + + + LayoutManager @@ -5650,7 +5830,7 @@ Please retry or relogin! - + Cloud ID desktop message @@ -5700,7 +5880,7 @@ Please retry or relogin! MainWindow - + Search Издөө @@ -5709,19 +5889,20 @@ Please retry or relogin! 设置 - - - + + + + Settings Параметрлер - + Main menu Негизги меню - + Minimize Минималдуу @@ -5730,47 +5911,52 @@ Please retry or relogin! 最大化/正常 - + Normal Нормалдуу - - + + Maximize Максималдуу - + Close Жабуу - + Help Жардам - + About Жөнүндө - + Exit Чыгуу + + + Specified + + ukcc 控制面板 - + Warning Эскертүү - + This function has been controlled Бул функция көзөмөлдөлдү @@ -6062,9 +6248,8 @@ Please retry or relogin! 鼠标 - Mouse - Чычкан + Чычкан Lefthand @@ -6090,119 +6275,136 @@ Please retry or relogin! MouseUI - + + Mouse Чычкан - + Pointer Көрсөткүч - + Cursor Курсор - + Dominant hand Басымдуу колу /Mouse/Dominant hand - + Left hand Сол колу - + Right hand Оң колу - + + Scroll direction + + /Mouse/Scroll direction + + + + Forward + + + + + Reverse + + + + Wheel speed Дөңгөлөк ылдамдыгы /Mouse/Wheel speed - - - + + + + Slow Жай - - - + + + + Fast Орозо - + Double-click interval time Эки чыкылдатуу аралыгы убакыт /Mouse/Double-click interval time - Short - Кыска + Кыска - Long - Лонг + Лонг - + Pointer speed Көрсөткүч ылдамдыгы /Mouse/Pointer speed - + Mouse acceleration Чычкан тездетүү /Mouse/Mouse acceleration - + Show pointer position when pressing ctrl Ктрлды басуу учурунда көрсөткүч позициясын көрсөтүү /Mouse/Show pointer position when pressing ctrl - + Pointer size Көрсөткүч өлчөмү /Mouse/Pointer size - + Small(recommend) Чакан (сунуш) - + Medium Орто - + Large Чоң - + Blinking cursor in text area Тексттик аймакта курсорду жыпылыктоо /Mouse/Blinking cursor in text area - + Cursor speed Курсор ылдамдыгы /Mouse/Cursor speed @@ -6211,7 +6413,7 @@ Please retry or relogin! MyLabel - + double-click to test тестирлөө үчүн эки жолу чыкылдатуу @@ -6393,7 +6595,42 @@ Please retry or relogin! Notice - + + NotFaze Mode + + + + + (Notification banners, prompts will be hidden, and notification sounds will be muted) + + + + + Automatically turn on + + + + + to + чейин + + + + Automatically turn on when multiple screens are connected + + + + + Automatically open in full screen mode + + + + + Allow automatic alarm reminders in Do Not Disturb mode + + + + Notice Settings Эскертүү параметрлери @@ -6410,10 +6647,9 @@ Please retry or relogin! 系统版本更新后显示新增内容 - + Get notifications from the app Тиркемеден эскертүүлөрдү алуу - /notice/Get notifications from the app Show notifications on the lock screen @@ -6428,11 +6664,49 @@ Please retry or relogin! 通知 - + Notice Эскертүү + + NoticeMenu + + + Beep sound when notified + + + + + Show message on screenlock + + + + + Show noticfication on screenlock + + + + + Notification Style + + + + + Banner: Appears in the upper right corner of the screen, and disappears automatically + + + + + Tip:It will be kept on the screen until it is closed + + + + + None:Notifications will not be displayed on the screen, but will go to the notification center + + + NumbersButtonIntel @@ -6444,32 +6718,32 @@ Please retry or relogin! OutputConfig - + resolution резолюция /Display/resolution - + orientation багыты /Display/orientation - + arrow-up жебе - + 90° arrow-right 90 ° жебе-оң - + arrow-down жебе-төмөн @@ -6483,13 +6757,19 @@ Please retry or relogin! 部分程序需要注销生效 - + 90° arrow-left 90 ° жебе-сол - + + auto rotation + + /Display/auto rotation + + + frequency жыштыгы @@ -6500,18 +6780,18 @@ Please retry or relogin! 刷新率 - + auto авто - + screen zoom экранды чоңойтуу /Display/screen zoom - + @@ -6574,7 +6854,7 @@ Please retry or relogin! - + GetCode GetCode @@ -6593,56 +6873,56 @@ Please retry or relogin! Милдеттенме - + confirm ырастоосу - + commit милдеттенме - + Mobile number acquisition failed Мобилдик номерди сатып алуу ишке ашпады - - + + Recapture Кайра басып алуу - - - - + + + + Network connection failure, please check Тармактык туташуу катасы, текшерүү - + Phone is lock,try again in an hour Телефон кулпу болуп саналат,бир сааттын ичинде кайра аракет - + Phone code is wrong Телефон коду туура эмес - + Current login expired,using wechat code! Учурдагы кирүү мөөнөтү өтүп, вечат кодун колдонуу менен! - + Unknown error, please try again later Белгисиз ката, сураныч, кийин кайра аракет - + Please use the correct wechat scan code Сураныч, туура вечат сканерлеу кодун колдонуу @@ -6654,16 +6934,12 @@ Please retry or relogin! 电源计划 - - Balance (suggest) - Баланс (сунуш) + Баланс (сунуш) - - Saving - Үнөмдөө + Үнөмдөө Minimize performance @@ -6675,20 +6951,16 @@ Please retry or relogin! - - Autobalance energy and performance with available hardware - жеткиликтүү аппараттык менен автобаланстык энергия жана аткаруу + жеткиликтүү аппараттык менен автобаланстык энергия жана аткаруу Custom 自定义 - - Users develop personalized power plans - Колдонуучулар жекелештирилген электр пландарын иштеп чыгуу + Колдонуучулар жекелештирилген электр пландарын иштеп чыгуу Power supply @@ -6743,9 +7015,8 @@ Please retry or relogin! 电源 - Power - Күч + Күч Change PC sleep time after %1 min: @@ -6764,11 +7035,8 @@ Please retry or relogin! 系统%1分钟后进入空闲状态并于%2分钟后关闭显示器: - - - never - эч качан + эч качан 10 min @@ -6803,230 +7071,163 @@ Please retry or relogin! 5分钟 - - Require password when sleep/hibernation - уйку / уктап жатканда сырсөз талап + уйку / уктап жатканда сырсөз талап - - Password required when waking up the screen - Экранды ойгонгондо сырсөз талап кылынат + Экранды ойгонгондо сырсөз талап кылынат - Press the power button - Кубат баскычты басуу + Кубат баскычты басуу - - Time to close display - Дисплейди жабуу убактысы + Дисплейди жабуу убактысы - - Time to sleep - Уктай турган убак + Уктай турган убак - - Notebook cover - Дәптер мукабасы + Дәптер мукабасы - - - Using power - Күч колдонуу + Күч колдонуу - Using battery - Батареяны колдонуу + Батареяны колдонуу - - Time to darken - Караңгылоо убактысы + Караңгылоо убактысы - - Battery level is lower than - Батареянын деңгээли төмөндөйт + Батареянын деңгээли төмөндөйт - Run - Чуркоо + Чуркоо - - Low battery notification - Батареянын аз эскертүүсү + Батареянын аз эскертүүсү - Automatically run saving mode when low battery - Батареясы төмөн болгондо, үнөмдөө режимин автоматтык түрдө иштетүү + Батареясы төмөн болгондо, үнөмдөө режимин автоматтык түрдө иштетүү - Automatically run saving mode when the low battery - Батареясы төмөн болгондо, үнөмдөө режимин автоматтык түрдө иштетүү + Батареясы төмөн болгондо, үнөмдөө режимин автоматтык түрдө иштетүү - - Automatically run saving mode when using battery - Батареяны колдонууда үнөмдөө режимин автоматтык түрдө иштетүү + Батареяны колдонууда үнөмдөө режимин автоматтык түрдө иштетүү - - Display remaining charging time and usage time - Заряддоо убактысын жана пайдалануу убактысын чагылдыруу + Заряддоо убактысын жана пайдалануу убактысын чагылдыруу - General - Жалпы + Жалпы /Power/General - Select Powerplan - Powerplan тандоо + Powerplan тандоо /Power/Select Powerplan - Battery saving plan - Батареяны сактоо планы + Батареяны сактоо планы /Power/Battery saving plan - - nothing - эч нерсе + эч нерсе - - blank - бош + бош - - - suspend - токтотуу + токтотуу - - - hibernate - уктоо + уктоо - interactive - интерактивдүү + интерактивдүү - - 5min - 5мин + 5мин - - Performance Model - Аткаруу модели + Аткаруу модели - 20min - 20мин + 20мин 10minn 10分钟 - - 15min - 15мин + 15мин - - 30min - 30мин + 30мин - - 1h - + - - 2h - + - - - 10min - 10мин + 10мин - 3h - 3h + 3h - - Balance Model - Баланс модели + Баланс модели - - Save Model - Моделди сактоо + Моделди сактоо - 1min - 1мин + 1мин 3min 3分钟 - - - shutdown - өчүрүү + өчүрүү always @@ -7080,19 +7281,22 @@ Please retry or relogin! 打印机 - + Printer Принтер - - Printers And Scanners - Принтерлер жана сканерлер + + Printers + + + + Printers And Scanners + Принтерлер жана сканерлер - Add - Кошуу + Кошуу /Printer/Add @@ -8092,9 +8296,8 @@ E-mail: support@kylinos.cn 开启自动代理 - Auto url - Авто урл + Авто урл /Proxy/Auto url @@ -8107,50 +8310,40 @@ E-mail: support@kylinos.cn 开启手动代理 - Http Proxy - Http Proxy + Http Proxy /Proxy/Http Proxy - - - - Port - Порт + Порт Cetification 认证 - System Proxy - Система прокси + Система прокси - Https Proxy - Https Proxy + Https Proxy /Proxy/Https Proxy - Ftp Proxy - Ftp Proxy + Ftp Proxy /Proxy/Ftp Proxy - Socks Proxy - Шұлык прокси + Шұлык прокси /Proxy/Socks Proxy - List of ignored hosts. more than one entry, please separate with english semicolon(;) - Эске алынбаган хосттардын тизмеси. бирден көп кирүү, англис жарым жабдуулары менен бөлүнүп суранабыз (;) + Эске алынбаган хосттардын тизмеси. бирден көп кирүү, англис жарым жабдуулары менен бөлүнүп суранабыз (;) Enable Authentication @@ -8165,81 +8358,65 @@ E-mail: support@kylinos.cn 密码 - Apt Proxy - Апт Прокси + Апт Прокси /Proxy/Apt Proxy - Open - Ачуу + Ачуу - Server Address : - Сервердин дареги : + Сервердин дареги : - Port : - Порт : + Порт : - Edit - Оңдоо + Оңдоо - The apt proxy has been turned off and needs to be restarted to take effect - Апт прокси өчүрүлгөн жана күчүнө кирүү үчүн кайра иштетүү керек + Апт прокси өчүрүлгөн жана күчүнө кирүү үчүн кайра иштетүү керек - The system needs to be restarted to set the Apt proxy, whether to reboot - Системаны кайра жүктөө үчүн Апт проксисин орнотуу үчүн кайра иштетүү зарыл + Системаны кайра жүктөө үчүн Апт проксисин орнотуу үчүн кайра иштетүү зарыл - - Reboot Now - Азыр кайра жүктөө + Азыр кайра жүктөө - Start using - Колдонууну баштоо + Колдонууну баштоо - Proxy mode - Прокси режими + Прокси режими - Auto - Авто + Авто - Manual - Колдонмо + Колдонмо - - Reboot Later - Кийинчерээк кайра жүктөө + Кийинчерээк кайра жүктөө proxy 代理 - Proxy - Прокси + Прокси @@ -8443,7 +8620,7 @@ E-mail: support@kylinos.cn Кыска жолду жекелештирүү - + Edit Shortcut Шоркутту оңдоо @@ -8573,7 +8750,7 @@ E-mail: support@kylinos.cn 远程桌面 - + User Info Колдонуучу Инфо @@ -8822,12 +8999,17 @@ E-mail: support@kylinos.cn Күн - + + ukui-control-center is disabled! + + + + ukui-control-center укуи-башкаруу-борбору - + ukui-control-center is already running! укуи-башкаруу-борбору буга чейин иштеп жатат! @@ -8968,72 +9150,72 @@ E-mail: support@kylinos.cn 连接失败,尝试重新连接 - - + + min length %1 мин узундугу %1 - - + + min digit num %1 мин сандык сан %1 - - + + min upper num %1 мин жогорку нум %1 - - + + min lower num %1 мүн төмөнкү нум %1 - - + + min other num %1 мин башка нум %1 - - + + min char class %1 мүн шар класс %1 - - + + max repeat %1 макс кайталоо %1 - - + + max class repeat %1 макс классы %1 кайталоо - - + + max sequence %1 %1 макс ырааттуулугу @@ -9053,10 +9235,14 @@ E-mail: support@kylinos.cn xxx客户端 - + Programs are not allowed to be added. Программаларды кошууга уруксат берилбейт. + + English + English + RegDialog @@ -9109,55 +9295,63 @@ E-mail: support@kylinos.cn Screenlock - + Screenlock Экрандын кулпулоо + Screenlock Interface Экран кулпулоо интерфейси + /Screenlock/Screenlock Interface - - + Show message on lock screen Билдирүүлөрдү кулпулоо экранында көрсөтүү - - + + Browse Браузер /Screenlock/Browse - - + + Online Picture Онлайн сүрөт /Screenlock/Online Picture - - + + Reset To Default Дефолтко калыбына келтирүү /Screenlock/Reset To Default + + + Related Settings + + + + TextLabel + ТекстЛабель + Screenlock Set 锁屏设置 - - Lock screen when screensaver boot - Экранды которуу учурунда экранды кулпулоо + Экранды которуу учурунда экранды кулпулоо /Screenlock/Lock screen when screensaver boot - + Lock screen delay Экранды кечиктирүү @@ -9178,8 +9372,7 @@ E-mail: support@kylinos.cn 浏览本地壁纸 - - + Show picture of screenlock on screenlogin Экранлогдо сценарийдин сүрөтүн көрсөтүү /Screenlock/Show picture of screenlock on screenlogin @@ -9201,56 +9394,48 @@ E-mail: support@kylinos.cn 图片 - + Never Эч качан - 1m - + - 5m - + - 10m - 10м + 10м - 30m - 30м + 30м - 45m - 45м + 45м - 1h - + 1.5h 1.5h - 3h - 3h + 3h - 2h - + - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Wallpaper файлдары (*.jpg *.jpeg *.bmp *.dib *.png *.jfif *jpe *.gif *.tif *.tiff *.wdp) @@ -9259,53 +9444,108 @@ E-mail: support@kylinos.cn 所有文件(*.*) - + + 1min + 1мин + + + + 5min + 5мин + + + + 10min + 1мин {10m?} + + + + 30min + 30мин + + + + 45min + 1мин {45m?} + + + + 1hour + 1хур + + + + 2hour + 1хур {2h?} + + + + 3hour + 1хур {3h?} + + + select custom wallpaper file колдонуучунун дубал кагаз файлын тандоо - + Select Тандоо - + Position: Позиция: - + FileName: Файл Аты: - + FileType: FileType: - + Cancel Жокко чыгаруу + + + Monitor Off + + + + + Screensaver + + + + + + Set + + Screensaver - + Screensaver Экрандар - - + Idle time Бош убакыт /Screensaver/Idle time - + Lock screen when activating screensaver Экран сактагычты активдештирүүдө экранды кулпулоо @@ -9314,8 +9554,7 @@ E-mail: support@kylinos.cn 开启屏保 - - + Screensaver program Экрандар программасы /Screensaver/Screensaver program @@ -9329,8 +9568,9 @@ E-mail: support@kylinos.cn 分钟 + Lock screen when screensaver boot - 激活屏保时锁定屏幕 + 激活屏保时锁定屏幕 screensaver @@ -9341,121 +9581,121 @@ E-mail: support@kylinos.cn 默认屏保 - + View Көрүү - + Text(up to 30 characters): Текст (30 тамгага чейин): - + Show rest time Эс алуу убактысын көрсөтүү - + UKUI УКУИ - + Blank_Only Blank_Only - + Customize Жекелештирүү - - + + 5min 5мин - - + + 10min 10мин - + 15min 15мин - - + + 30min 30мин - + 1hour 1хур - + Screensaver source Экрандар булагы - - + + Select Тандоо - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) Wallpaper файлдары (*.jpg *.jpeg *.bmp *.dib *.png *.jfif *jpe *.gif *.tif *.tiff *.wdp *.svg) - + select custom screensaver dir колдонуучунун экранды тандап алуу - + Position: Позиция: - + FileName: Файл Аты: - + FileType: FileType: - + Cancel Жокко чыгаруу - + Switching time Убакытты алмаштыруу - + 1min 1мин - + Ordinal Ординал - + Random switching Кокусунан которуу @@ -9468,17 +9708,17 @@ E-mail: support@kylinos.cn 输入文本,最多30个字符 - + Text position Тексттик позиция - + Centered Борбордоштурулган - + Randow(Bubble text) Рандоу (Көпірчүк тексти) @@ -9515,12 +9755,12 @@ E-mail: support@kylinos.cn 3h - + Random Кокусунан - + Never Эч качан @@ -9634,6 +9874,14 @@ E-mail: support@kylinos.cn Touchpad 触控板 + + + + + + No search results + + SecurityCenter @@ -9839,19 +10087,18 @@ E-mail: support@kylinos.cn 确认退出程序! - + Remote Desktop Алыскы иш столу - + Allow others to view your desktop Башкаларга иш столуңузду көрүүгө мүмкүнчүлүк бергиле - /Vino/Allow others to view your desktop - + Allow connection to control screen Экранды башкаруу үчүн туташуу мүмкүндүк берет /Vino/Allow connection to control screen @@ -9862,13 +10109,13 @@ E-mail: support@kylinos.cn Коопсуздук - + You must confirm every visit for this machine Сиз бул машина үчүн ар бир иш сапарын ырасташы керек /Vino/You must confirm every visit for this machine - + Require user to enter this password: Колдонуучудан бул сырсөздү киргизүүнү талап кылуу: @@ -9895,8 +10142,8 @@ E-mail: support@kylinos.cn Shortcut - - + + System Shortcut Система кыска жол /Shortcut/System Shortcut @@ -9906,12 +10153,12 @@ E-mail: support@kylinos.cn 显示全部快捷键 - + Custom Shortcut Колдонуучунун кыска жолу - + Customize Shortcut Кыска жолду жекелештирүү /Shortcut/Customize Shortcut @@ -9921,23 +10168,23 @@ E-mail: support@kylinos.cn 添加自定义快捷键 - + Add Кошуу /Shortcut/Add - + Edit Оңдоо - + Delete Жоготуу - + or же @@ -9954,7 +10201,7 @@ E-mail: support@kylinos.cn 快捷键 - + Shortcut Шоркут @@ -9986,13 +10233,88 @@ E-mail: support@kylinos.cn 桌面 + + SpliceDialog + + + Dialog + + + + TextLabel + ТекстЛабель + + + + Splice Screen + + + + + + Cancel + + + + + + Ok + 确定 + + + + + Splicing Method + + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + + + + + Row %1, Column %2 + + + + + Select screen + + + StatusDialog - + About Жөнүндө + + + Activation Code + + SuccessDiaolog @@ -10407,58 +10729,91 @@ E-mail: support@kylinos.cn /Theme/Theme Mode - + + Theme Тема - Default - Дефолт + Дефолт - + Light Жарык - + Dark Караңгы - + + Auto + Авто + + + + Corlor + + + + + Other + 其他 + + + + + Set + + + + + Wallpaper + + + + + Beep + + + + Blue-Crystal Көк-Кристалл - - + + Light-Seeking Жарык издөө - + DMZ-Black ДМЗ-Блэк - + DMZ-White ДМЗ-Уайт - + Dark-Sense Караңгы-сезүү - + + + basic негизги - + Classic Классикалык @@ -10471,63 +10826,98 @@ E-mail: support@kylinos.cn 时尚 - + hp Hp - + ukui укуи - + HeYin Хейн - + + classic + + + + + daybreakBlue + + + + + jamPurple + + + + + magenta + + + + + sunRed + + + + + sunsetOrange + + + + + dustGold + + + + + polarGreen + + + default - дефолт + дефолт Middle - - + Window Theme Терезе темасы /Theme/Window Theme - - + Icon theme Икон темасы /Theme/Icon theme - Control theme - Теманы башкаруу + Теманы башкаруу - - + Cursor theme Курсор темасы /Theme/Cursor theme - + Effect setting Эффект орнотуу - - + + Transparency Ачыктык /Theme/Transparency @@ -10537,8 +10927,8 @@ E-mail: support@kylinos.cn 透明特效 - - + + Performance mode Аткаруу режими /Theme/Performance mode @@ -10556,7 +10946,7 @@ E-mail: support@kylinos.cn - + Reset to default Дефолтко калыбына келтирүү @@ -10568,27 +10958,27 @@ E-mail: support@kylinos.cn TimeBtn - + Tomorrow Эртең - + Yesterday Кеше - + Today Бүгүн - + %1 hours earlier than local %1 саат мурун жергиликтүү - + %1 hours later than local %1 сааттан кийин жергиликтүү @@ -10610,7 +11000,7 @@ E-mail: support@kylinos.cn 更改时区 - + Search Timezone Издөө Убакыт зонасы @@ -10619,7 +11009,7 @@ E-mail: support@kylinos.cn 搜索时区 - + To select a time zone, please click where near you on the map and select a city from the nearest city Убакыт белдеуин тандоо үчүн, картада силерге жакын жерде чыкылдатып, жакынкы шаардан шаар тандап алыңыз @@ -10703,9 +11093,8 @@ E-mail: support@kylinos.cn 触控板 - Touchpad - Touchpad + Touchpad Disable rolling @@ -10739,18 +11128,16 @@ E-mail: support@kylinos.cn TouchpadUI - Touchpad Setting - Touchpad орнотуу + Touchpad орнотуу No touchpad found 未发现触控板设备 - Disable touchpad when using the mouse - Чычканды колдонууда сенсордук тактаны өчүрүү + Чычканды колдонууда сенсордук тактаны өчүрүү /Touchpad/Disable touchpad when using the mouse @@ -10759,59 +11146,49 @@ E-mail: support@kylinos.cn /Touchpad/Cursor Speed - Slow - Жай + Жай - Fast - Орозо + Орозо - Disable touchpad when typing - Терүү учурунда сенсордук тактаны өчүрүү + Терүү учурунда сенсордук тактаны өчүрүү /Touchpad/Disable touchpad when typing - Touch and click on the touchpad - Тийүү жана сенсордук тактаны басуу + Тийүү жана сенсордук тактаны басуу /Touchpad/Touch and click on the touchpad - Scroll bar slides with finger - манжа менен жылдыруу тилкеси слайддар + манжа менен жылдыруу тилкеси слайддар /Touchpad/Scroll bar slides with finger - Scrolling area - Жылдыруу аянты + Жылдыруу аянты /Touchpad/Scrolling area - Disable scrolling - Жылдыруу өчүрүлөт + Жылдыруу өчүрүлөт - Edge scrolling - Чет жылдыруу + Чет жылдыруу - Pointer Speed - Көрсөткүч ылдамдыгы + Көрсөткүч ылдамдыгы /Touchpad/Pointer Speed - Two-finger scrolling in the middle area - Орто аймакта эки манжа жылдыруу + Орто аймакта эки манжа жылдыруу @@ -10856,8 +11233,8 @@ E-mail: support@kylinos.cn UkccAbout - - + + Settings Параметрлер @@ -10866,12 +11243,12 @@ E-mail: support@kylinos.cn 控制面板 - + Version: Версиясы: - + Service and Support: Кызмат жана колдоо: @@ -11130,53 +11507,65 @@ E-mail: support@kylinos.cn UnifiedOutputConfig - + resolution резолюция - + orientation багыты - + arrow-up жебе - + 90° arrow-right 90 ° жебе-оң - - + + arrow-down жебе-төмөн - + 90° arrow-left 90 ° жебе-сол - + + auto rotation + + /Display/auto rotation + + + frequency жыштыгы + + + screen zoom + экранды чоңойтуу + /Display/screen zoom + refresh rate 刷新率 - + auto @@ -11266,12 +11655,12 @@ E-mail: support@kylinos.cn 管理员用户 - + root тамыры - + Hint Хинт @@ -11280,32 +11669,32 @@ E-mail: support@kylinos.cn 更改账户类型需要注销后生效,是否注销? - + The account type of “%1” has been modified, will take effect after logout, whether to logout? "%1" эсеп түрү өзгөртүлүп берилди, кирүүдөн кийин күчүнө кирет, кирүү болобу? - + logout later Кийинчерээк кирүү - + logout now Азыр кирүү - + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? Система бир колдонуучуга автоматтык түрдө кирүүгө гана мүмкүндүк берет. Өчүрүлгөндөн кийин, башка колдонуучулардын автоматтык кирүү өчүрүлөт. Күйгүзүлөбү? - + Trun on Трун боюнча - + Close on Жабуу @@ -11322,12 +11711,12 @@ E-mail: support@kylinos.cn 验证 - + Standard Стандарт - + Admin Админ @@ -11336,42 +11725,52 @@ E-mail: support@kylinos.cn 删除 - + CurrentUser CurrentUser + /Userinfo/CurrentUser - + OthersUser Башкалар + /Userinfo/OthersUser - + + Add + + /Userinfo/Add + + + Passwd Сырсөз - + Groups Топтор - + AutoLoginOnBoot AutoLoginOnBoot + /Userinfo/AutoLoginOnBoot LoginWithoutPwd LoginWithoutPwd + /Userinfo/LoginWithoutPwd - + Warning Эскертүү - + The user is logged in, please delete the user after logging out Колдонуучуга кирүү, системага киргенден кийин колдонуучуну жоготуу @@ -11403,18 +11802,14 @@ E-mail: support@kylinos.cn - Password Сырсөз - /Userinfo/Password - - + Type Түрү - /Userinfo/Type Valid @@ -11427,15 +11822,12 @@ E-mail: support@kylinos.cn - Login no passwd Кирүү эч кандай сырсөз жок - /Userinfo/Login no passwd - enable autoLogin - autoLogin-ге кирүүгө мүмкүндүк берет + autoLogin-ге кирүүгө мүмкүндүк берет /Userinfo/enable autoLogin @@ -11481,10 +11873,10 @@ E-mail: support@kylinos.cn UserInfoIntel - + Current User Учурдагы колдонуучу - /Userinfo/Current User + /UserinfoIntel/Current User @@ -11493,11 +11885,11 @@ E-mail: support@kylinos.cn - - + + Change pwd Pwd өзгөртүү - /Userinfo/Change pwd + /UserinfoIntel/Change pwd @@ -11521,45 +11913,51 @@ E-mail: support@kylinos.cn - + Other Users Башка колдонуучулар - /Userinfo/Other Users + /UserinfoIntel/Other Users - + User Info Intel Колдонуучу Info Intel - + Change Tel Тельди өзгөртүү - /Userinfo/Change Tel + /UserinfoIntel/Change Tel - + Delete user Колдонуучуну жоготуу - /Userinfo/Delete user + /UserinfoIntel/Delete user - + + Change user name + + /UserinfoIntel/Change user name + + + standard user стандарттык колдонуучу - + administrator администратор - + root тамыры - + Add new user Жаңы колдонуучуну кошуу @@ -11577,27 +11975,27 @@ E-mail: support@kylinos.cn UtilsForUserinfo - + Passwd Сырсөз - + Type Түрү - + Del Дель - + Standard Стандарт - + Admin Админ @@ -11605,7 +12003,7 @@ E-mail: support@kylinos.cn Vino - + Vino Вино @@ -11627,38 +12025,38 @@ E-mail: support@kylinos.cn VPN - Vpn - Впн + Впн - VPN - ВПН + ВПН Wallpaper + Desktop Background Иш столунун фону + /Wallpaper/Desktop Background - + Mode Режим - - + + Online Picture Онлайн сүрөт /Wallpaper/Online Picture - - + + Reset To Default Дефолтко калыбына келтирүү /Wallpaper/Reset To Default @@ -11672,8 +12070,8 @@ E-mail: support@kylinos.cn 图片放置方式 - - + + Browse Браузер /Wallpaper/Browse @@ -11703,19 +12101,18 @@ E-mail: support@kylinos.cn 背景 - - - + + Background Фон - + picture сүрөт - + color түс @@ -11728,35 +12125,37 @@ E-mail: support@kylinos.cn 自定义颜色 - + wallpaper дубал кагазы - + centered борбордоштурулган - + scaled масштабдалган - + stretched созулган + zoom - 缩放 + 缩放 + spanned - 适合宽度 + 适合宽度 - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Wallpaper файлдары (*.jpg *.jpeg *.bmp *.dib *.png *.jfif *jpe *.gif *.tif *.tiff *.wdp) @@ -11765,38 +12164,38 @@ E-mail: support@kylinos.cn 所有文件(*.*) - - + + select custom wallpaper file колдонуучунун дубал кагаз файлын тандоо - - + + Select Тандоо - - + + Position: Позиция: - - + + FileName: Файл Аты: - - + + FileType: FileType: - - + + Cancel Жокко чыгаруу @@ -11812,10 +12211,10 @@ E-mail: support@kylinos.cn 统一输出 - + night mode түнкү режим - /Display/night mode + /display/night mode @@ -11823,99 +12222,162 @@ E-mail: support@kylinos.cn Күчүнө кирүү үчүн айрым иштемелерди есептен чыгаруу зарыл - + Night Mode Түнкү режим + /Display/Night Mode - + Open Ачуу - + Time Убакыт - - + + Custom Time Колдонуу убактысы - + to чейин - + Color Temperature Түс температурасы - + Warmer Жылуураак - + Colder Муздак - + Multi-screen Көп экран - + First Screen Биринчи экран - + Clone Screen Клон экраны - + + + Splice Screen + + + + Auto Brightness Авто жарыктык - + Adjust screen brightness by ambient Экрандын жарыктыгын айлана - чөйрөгө ылайыкташтыруу - - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> - %1 экраны өзгөртүлүп берилдиби ? <br/> <font style= 'color:#626c6e'>параметрлер 14 секунд өткөндөн кийин сакталат </font> + + Dynamic light + + /Display/Dynamic light + + + + Optimize display content to extend battery life + + + + + scale + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> + + + + + The zoom has been modified, it will take effect after you log off + + + + + + (Effective after logout) + + + + + Splicing Method + + + + + Change + Өзгөртүү + + + + as main + негизги катары + + + + open monitor + ачык монитор + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> + %1 экраны өзгөртүлүп берилдиби ? <br/> <font style= 'color:#626c6e'>параметрлер 14 секунд өткөндөн кийин сакталат </font> - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> %1 экраны өзгөртүлүп берилдиби ? <br/> <font style= 'color:#626c6e'>параметрлер %2 секунд өткөндөн кийин сакталат </font> - + + Follow the sunrise and sunset Күндүн чыгышын жана күн батканды ээрчигиле - + Extend Screen Экранды кеңейтүү - + Vice Screen Вице-экран - + monitor монитор @@ -11927,32 +12389,29 @@ E-mail: support@kylinos.cn Маалымат - Theme follow night mode Тема түнкү режимге кармануу - + resolution резолюция - + orientation багыты - + frequency жыштыгы - - Hint Хинт @@ -11963,13 +12422,13 @@ the settings will be saved after 14 seconds 是否保留当前修改的配置?将在14秒后自动保存配置 - + Save Сактоо - + Not Save Сакталбайт @@ -11980,22 +12439,21 @@ the settings will be saved after %1 seconds 是否保留当前修改的配置?将在%1秒后自动保存配置 - The zoom function needs to log out to take effect - Чоңойтуу милдети күчүнө кирүү керек + Чоңойтуу милдети күчүнө кирүү керек - + Log out now Азыр кирүү - + Later Кийинчерээк - + All Day Күнү бою @@ -12004,12 +12462,13 @@ the settings will be saved after %1 seconds 跟随日出日落(17:55-06:23) - - - - + + + + Brightness Жарыктык + /Display/Brightness After modifying the resolution or refresh rate, due to compatibility issues between the display device and the graphics card, the display may be abnormal or unable to display @@ -12032,6 +12491,7 @@ If something goes wrong, the settings will be restored after 9 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在9秒后还原设置 + screen zoom экранды чоңойтуу @@ -12067,7 +12527,7 @@ the settings will be saved after %1 seconds 修改分辨率或刷新率后,由于显示设备与 显卡兼容性问题,有可能显示不正常。系统将在%1秒后保存配置 - + Warnning Уорнинг @@ -12077,19 +12537,18 @@ If something goes wrong, the settings will be restored after %1 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在%1秒后还原设置 - - - + + + please insure at least one output! сураныч, жок эле дегенде, бир чыгарууну камсыздандыруу! - - - - - + + + + Warning Эскертүү @@ -12102,8 +12561,7 @@ If something goes wrong, the settings will be restored after %1 seconds 屏幕分辨率已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在%1秒后自动保存。</font> - - + Open time should be earlier than close time! Ачык убакыт жакын убакытка караганда эрте болушу керек! @@ -12112,8 +12570,8 @@ If something goes wrong, the settings will be restored after %1 seconds 早晨时刻应早于晚上的时刻! - - + + Sorry, your configuration could not be applied. Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. Өкүнүчтүүсү, сиздин конфигурацияңызды колдонууга болбоду. @@ -12187,7 +12645,7 @@ Common reasons are that the overall screen size is too big, or you enabled more addShortcutDialog - + Dialog Диалог @@ -12200,28 +12658,28 @@ Common reasons are that the overall screen size is too big, or you enabled more 快捷键程序 - + Exec Экземпляр - + Open Ачуу - + Name Аты-жөнү - + Key Ачкыч - - + + TextLabel ТекстЛабель @@ -12230,13 +12688,13 @@ Common reasons are that the overall screen size is too big, or you enabled more 无效的可执行程序,请重新选择 - - + + Cancel Жокко чыгаруу - + Save Сактоо @@ -12270,60 +12728,60 @@ Common reasons are that the overall screen size is too big, or you enabled more Кыска жолду кошуу - + Please enter a shortcut Сураныч, кыска жолго киргиле - + Desktop files(*.desktop) Иш столунун файлдары (*.desktop) - + select desktop иш столун тандоо - - - + + + Invalid application Жараксыз колдонмо - - - + + + Shortcut conflict Кыска жол чыр-чатак - - - + + + Invalid shortcut Жараксыз кыска жол - - - + + + Name repetition Аты-жөнүн кайталоо - + Unknown error Белгисиз ката - + Shortcut cannot be empty Кыска жол бош болушу мүмкүн эмес - + Name cannot be empty Аты бош болушу мүмкүн эмес @@ -12335,6 +12793,76 @@ Common reasons are that the overall screen size is too big, or you enabled more 请输入手机号码 + + changeUserGroup + + + user group + + + + + Group: + + + + + GID: + + + + + GNum: + + + + + + Cancel + + + + + + Confirm + + + + + + + Tips + Кеңештер + + + + + Invalid Id! + Жараксыз идентификация! + + + + + + OK + + + + + Invalid Group Name! + Жараксыз Топтун аты! + + + + Whether delete the group: “%1” ? + + + + + which will make some file components in the file system invalid! + файл системасындагы кээ бир файл компоненттерин жараксыз кылат! + + changtimedialog diff --git a/shell/res/i18n/tr.ts b/shell/res/i18n/tr.ts index 7ea160d..ee00776 100644 --- a/shell/res/i18n/tr.ts +++ b/shell/res/i18n/tr.ts @@ -4,131 +4,147 @@ About - + System Summary Sistem Özeti - + Support - - + Version Number - + Status Durum /About/Status - + DateRes - + Wechat code scanning obtains HP professional technical support - + See more about Kylin Tianqi edu platform - + <<Protocol>> - - InterVersion + + About and Support - + + Patch Version + + + + HostName - + Privacy and agreement - + Send optional diagnostic data - + By sending us diagnostic data, improve the system experience and solve your problems faster - + and - + <<Privacy>> - + Learn more HP user manual>> - + See user manual>> - - Not activated (trial period) + + Openkylin - + + KylinSoft + + + + Trial expiration time - + + expired - + + Extend - + + Copyright © 2009-%1 %2. All rights reserved. + + + + The system needs to be restarted to set the HostName, whether to reboot - + Reboot Now - + Reboot Later - - - + + + avaliable @@ -146,48 +162,49 @@ Telif Hakkı 2009-2020 @ Kylinos Tüm hakları saklıdır {2009-2021 ?} - + + Version /About/version - - Copyright © 2009-2021 KylinSoft. All rights reserved. - - - - + + Kernel Çekirdek: /About/Kernel - + + CPU CPU: /About/CPU - + + Memory Hafıza: /About/Memory - - + + Disk Disk: - + + Desktop Masaüstü: /About/Desktop - + + User Kullanıcı: /About/User @@ -197,7 +214,7 @@ Aktif Durum - + Serial @@ -206,8 +223,8 @@ Servis Seri No - - + + Active Aktif @@ -237,12 +254,13 @@ Uygun - + + Inactivated Aktif değil - + Activated Aktif @@ -380,10 +398,90 @@ AddBtn - - + Add - Ekle + Ekle + + + + AddButton + + + Add + Ekle + + + + AddInputMethodDialog + + + Dialog + + + + + Select the input method to add + + + + + No + + + + + Yes + + + + + + keyboard + Klavye + + + + + Tibetan + + + + + With ASCII numbers + + + + + Input Method + + + + + AddLanguageDialog + + + Dialog + + + + + No + + + + + Yes + + + + + Add Language + + + + + Search + Ara @@ -419,91 +517,25 @@ AptProxyDialog - - Set Apt Proxy - - - - - Server Address - - - - Port - Port + Port - Cancel - İptal + İptal - Confirm - Onayla + Onayla Area - - + Area Alan - - - - Current Region - - /Area/Current Region - - - - First Day Of The Week - - - - - - Calendar - - /Area/Calendar - - - - - Language Format - - /Area/Regional Format - - - - - Date - - /Area/Date - - - - - Time - - /Area/Time - - - - - System Language - - /Area/system language - - - - TextLabel - - Area showing time currency format Zaman para birimi biçimini gösteren alan @@ -513,7 +545,7 @@ Bölgesel format verileri - + lunar Ay takvimi @@ -539,9 +571,8 @@ Zaman Biçimi Düzeni - US - ABD + ABD format of area @@ -586,9 +617,8 @@ Sistem Dili - CN - CN + CN Need to cancel to take effect @@ -599,8 +629,9 @@ Etkili olması için oturumu kapatmanız gerekiyor + English - İngilizce + İngilizce Chinese @@ -611,68 +642,82 @@ Ana dil ekle - - Language for system windows,menus and web pages - - - - - First Day Of Week - - /Area/First Day Of Week - - - + solar calendar Güneş Takvimi - + monday Pazartesi - + + English (US) + + + + + Simplified Chinese (CN) + + + + + Tibetan (CN) + + + + sunday Pazar - + 12 Hours - + 24 Hours - + + Simplified Chinese + + + + + Tibetan + + + + Modify the current region need to logout to take effect, whether to logout? - + Logout later - + Logout now - + Modify the first language need to reboot to take effect, whether to reboot? - + Reboot later - + Reboot now @@ -688,6 +733,51 @@ Telefonla kaydolun + + AreaUi + + + Regional Format + + /Area/Regional Format + + + + Calendar + + /Area/Calendar + + + + First Day Of Week + + /Area/First Day Of Week + + + + Date + + /Area/Date + + + + Time + + /Area/Time + + + + Language Format + + /Area/Language Format + + + + System Language + + /Area/System Language + + Audio @@ -698,13 +788,32 @@ AutoBoot - - Add - Ekle - /autoboot/Add + + Desktop files(*.desktop) + - + + select autoboot desktop + otomatik önyükleme masaüstü seç + + + + Select + + + + + Cancel + İptal + + + Add + Ekle + /Autoboot/Add + + + Autoboot Settings Otomatik Açılış Ayarları /autoboot/Autoboot Settings @@ -722,7 +831,7 @@ Oto. başlat - + Auto Boot Oto. Başlat @@ -735,7 +844,7 @@ Durum - + Delete Sil @@ -744,8 +853,7 @@ Backup - - + Backup Yedekle @@ -764,14 +872,14 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. - + Begin backup Yedekleme Başlat /Backup/Begin backup - + Restore Geri Yükle @@ -786,7 +894,7 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. - + Begin restore Yükleme Başlat /Backup/Begin restore @@ -796,13 +904,13 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. Yedekleme - + All data stored on the computer will be permanently erased,and the system will revert to its original factory state when this operation is completed. - + Clear and restore @@ -814,17 +922,22 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. - + + Backup Restore + + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. - + View the backup list and restore the backup file to the system - + Backup and Restore @@ -884,7 +997,7 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. BrightnessFrame - + Failed to get the brightness information of this monitor @@ -962,63 +1075,65 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. ChangeFaceIntelDialog - + + Change User Face Kullanıcı Logosunu Değiştir + /UserinfoIntel/Change User Face - + History - + System Sistem - - + + Cancel İptal - + Confirm Onayla - + select custom face file Özel yüz dosyası seç - + Select - + Position: Konum: - + FileName: Dosya Adı: - + FileType: - + Warning Uyarı - + The avatar is larger than 2M, please choose again Avatar 2M'den büyük, lütfen başka seçin @@ -1033,19 +1148,12 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. ChangeGroupDialog - - Dialog - - - - User Group Settings - Kullanıcı Grubu Ayarları + Kullanıcı Grubu Ayarları - Cancel - İptal + İptal User groups available in the system @@ -1056,36 +1164,16 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. Yeni Kullanıcı Ekle - User group - Kullanıcı Grubu + Kullanıcı Grubu - Add user group - Kullanıcı grubu ekle + Kullanıcı grubu ekle - - - Tips - - - - - Invalid Id! - - - - - OK - Tamam - - - - Invalid Group Name! - + Tamam @@ -1151,107 +1239,107 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. - + Phone number - + SMS verification code - + Please input old phone number - + Next - - - - Please enter new mobile number - - + Please enter new mobile number + + + + + Submit - + changed success - - + + You have successfully modified your phone - - + + Recapture - - - + + + Network connection failure, please check - - + + GetCode - - - + + + Phone is lock,try again in an hour - - - + + + Phone code is wrong - + Current login expired,using wechat code! - - - + + + Unknown error, please try again later - + Phone can not same - - + + finished - - + + Phone number already in used! Telefon numarası zaten kullanılıyor! @@ -1506,58 +1594,63 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. ChangeUserLogo - + System Logos - - Local Logo + + User logo - - + + Select Local Logo + + + + + Cancel İptal - + Confirm Onayla - + select custom face file Özel yüz dosyası seç - + Select - + Position: Konum: - + FileName: Dosya Adı: - + FileType: - + Warning Uyarı - + The avatar is larger than 1M, please choose again Avatar 2M'den büyük, lütfen başka seçin {1M?} @@ -1576,37 +1669,37 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. ChangeUserNickname - + Set Nickname - + UserName Kullanıcı Adı - + NickName - + nickName already in use. - - nickName length must less than %1 letters! + + The length must be 1~%1 characters! - + Cancel İptal - + Confirm Onayla @@ -1614,59 +1707,86 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. ChangeUserPwd - + Change password - - - + + + Current Pwd - - - - + + + + New Pwd - - - - + + + + Sure Pwd - + Cancel İptal - + + + Confirm Onayla - - + + Inconsistency with pwd - + + Same with old pwd + + + + + Pwd Changed Succes + + + + Authentication failed, input authtok again! - + Contains illegal characters! Uygun olmayan karakterler içeriyor! + + + current pwd cannot be empty! + + + + + new pwd cannot be empty! + + + + + sure pwd cannot be empty! + + ChangeUserType @@ -1675,11 +1795,6 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. UserType - - - Ensure that must have admin on system - - administrator @@ -1690,28 +1805,33 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. standard user + + + Select account type (Ensure have admin on system): + + - Users can make any changes they need + change system settings, install and upgrade software. - Users cannot change system settings + use most software, cannot change system settings. - + Note: Effective After Logout!!! - + Confirm Onayla - + Cancel İptal @@ -1876,28 +1996,27 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. CreateGroupDialog - Dialog - - - - Add New Group Yeni Grup Ekle - + Name İsim - + Id Id - + + Confirm + Onayla + + Members - Üyeler + Üyeler Group Name @@ -1912,17 +2031,16 @@ sisteminizin bütünlüğünü sağlamak için bunları geri yükleyebilirsiniz. Grup Üyeleri - + Cancel İptal - Certain - Belirli + Belirli - + Add user group Kullanıcı grubu ekle @@ -2192,132 +2310,148 @@ sistem ayarlarını değiştir CreateUserNew - + CreateUserNew - + UserName Kullanıcı Adı - + NickName - + + HostName + + + + Pwd - + SurePwd - + + + + + Required + + + + + verification + + + + Select Type - + Administrator - + Users can make any changes they need - + Standard User - + Users cannot change system settings - + Cancel İptal - + Confirm Onayla - - + + Inconsistency with pwd - + + The nick name cannot be empty - + nickName already in use. - + nickName length must less than %1 letters! - + + Username's length must be between 1 and %1 characters! + + + + + new pwd cannot be empty! + + + + + sure pwd cannot be empty! + + + The user name cannot be empty - Kullanıcı adı boş olamaz + Kullanıcı adı boş olamaz - - Must be begin with lower letters! - - - - - Can not contain capital letters! - - - - - Name already in use. - - - - + Name corresponds to group already exists. - - Name length must less than %1 letters! - - - - - Can only contain letters,digits,underline! - - - - + Username's folder exists, change another one - + Contains illegal characters! Uygun olmayan karakterler içeriyor! + + CustomGlobalTheme + + + custom + + + CustomLineEdit @@ -2390,32 +2524,13 @@ sistem ayarlarını değiştir Şimdiki tarih - - + Change timezone /Date/Change time zone - - - TextLabel - - - - - - RadioButton - - - - - - : - - - - + titleLabel @@ -2451,48 +2566,54 @@ sistem ayarlarını değiştir Tarih Saat - + Date - + + Current Date + + /Date/Current Date + + + Other Timezone /Date/Other Timezone - + 24-hour clock 24 saat biçimi /Date/24-hour clock - + Set Time /Date/Set Time - + Set Date Manually /Date/Set Date Manually - + Sync Time /Date/Sync Time - + Manual Time /Date/Manual Time - + Add Timezone @@ -2506,54 +2627,54 @@ sistem ayarlarını değiştir /Date/Network - + Sync Server /Date/Sync Server - + Default Varsayılan - + Customize - + Server Address - + Required - + Save - + change time Saati değiştir - + Change Timezone Zaman Dilimini Değiştir - + - - + + Sync failed @@ -2569,56 +2690,65 @@ sistem ayarlarını değiştir Varsayılan Uygulama - + Default App Varsayılan Uygulama - + No program available - + + Choose default app + + + + + Reset default apps to system recommended apps + + + + + Reset + Sıfırla + + + Browser Web Tarayıcı: - /Defaultapp/Browser - + Mail E-Posta: - /Defaultapp/Mail - + Image Viewer Resim Görüntüleyici: - /Defaultapp/Image Viewer - + Audio Player Ses Oynatıcı: - /Defaultapp/Audio Player - + Video Player Video Oynatıcı: - /Defaultapp/Video Player - + Text Editor Metin Düzenleyici: - /Defaultapp/Text Editor DefaultAppWindow - + Select Default Application Varsayılan Uygulama Seç @@ -2654,14 +2784,12 @@ sistem ayarlarını değiştir DefineGroupItem - Edit - Düzenle + Düzenle - Delete - Sil + Sil @@ -2687,11 +2815,6 @@ sistem ayarlarını değiştir DelGroupDialog - - - Dialog - - Are you sure to delete this group, which will make some file components @@ -2701,25 +2824,12 @@ bazı dosya bileşenleri oluşturacak dosya sisteminde geçersiz! - - Are you sure to delete the group: - - - - - - which will make some file components in the file system invalid! - - - - Delete - Sil + Sil - Cancel - İptal + İptal RemoveFile @@ -2737,11 +2847,6 @@ in the file system invalid! bazı dosya bileşenleri oluşturacak dosya sisteminde geçersiz! - - - Delete user group - - DelGroupIntelDialog @@ -2814,7 +2919,7 @@ folder will be deleted! İptal - + Delete the user, belonging to the user's desktop documents, favorites, music, pictures and video folder will be deleted! @@ -2833,7 +2938,7 @@ folder will be deleted! - Keep user's home folder + Keep desktop, files, favorites, music of the user @@ -3273,7 +3378,12 @@ folder will be deleted! Ekran - + + Screen + + + + Display Ekran @@ -3288,7 +3398,6 @@ folder will be deleted! - monitor Ekran: @@ -3306,7 +3415,6 @@ folder will be deleted! Çıktıyı Birleştir - open monitor Monitörü Aç @@ -3318,13 +3426,11 @@ folder will be deleted! Ekran - as main - screen zoom Ekran Yakınlaştırma: @@ -3347,43 +3453,36 @@ folder will be deleted! Açık - follow the sunrise and sunset(17:55-05:04) Gün doğumunu ve gün batımını takip et(17:55-05:04) - custom time Özel zaman - opening time Açılış zamanı - closing time Kapanış zamanı - color temperature Renk Sıcaklığı - warm Ilık - cold Soğuk @@ -3401,59 +3500,32 @@ folder will be deleted! EditGroupDialog - - Dialog - - - - Cancel - İptal + İptal - Certain - Belirli + Belirli - Edit User Group - Kullanıcı Grubunu Düzenle + Kullanıcı Grubunu Düzenle - Name - İsim + İsim - Id - Id + Id - Members - Üyeler + Üyeler - - Tips - - - - - Invalid Id! - - - - OK - Tamam - - - - Edit user group - + Tamam @@ -3649,33 +3721,33 @@ folder will be deleted! Fonts - + Fonts Yazı Tipi - - + + Fonts select Font Seç /Fonts/Fonts select - + Font size Font Boyutu /Fonts/Font size - - + + Mono font /Fonts/Mono font - + Reset to default Varsayılana Sıfırla @@ -3739,6 +3811,16 @@ folder will be deleted! Thanks For Using The ukcc Denetim Merkezini kullandığınız için teşekkürler + + + Small + + + + + Large + Büyük + FrameItem @@ -3796,12 +3878,17 @@ folder will be deleted! - + + Must be 1-64 characters long + + + + Cancel İptal - + Confirm Onayla @@ -3819,26 +3906,20 @@ folder will be deleted! - + + Must be 1-8 characters long + + + + Cancel İptal - + Confirm Onayla - - - - Password can not be blank - - - - - less than or equal to 8 - - ItemList @@ -3938,14 +4019,12 @@ folder will be deleted! KbPreviewFrame - No preview found - Önizleme bulunamadı + Önizleme bulunamadı - Unable to open Preview ! - Önizleme açılamıyor! + Önizleme açılamıyor! @@ -3971,19 +4050,18 @@ folder will be deleted! Ekle - + Add Layout Düzen Ekle - + Del Sil - Keyboard Preview - Klavye Önizleme + Klavye Önizleme @@ -4067,8 +4145,12 @@ folder will be deleted! + Investigation + + + Search - Ara + Ara Messages @@ -4161,70 +4243,74 @@ folder will be deleted! Klavye - Keyboard - Klavye + Klavye KeyboardMain - + + Keyboard + Klavye + + + Key board settings - + Input settings /Keyboard/Input settings - + Key repeat /Keyboard/Key repeat - + Delay Gecikme /Keyboard/Delay - + Short Kısa - + Long Uzun - + Speed Hız /Keyboard/Speed - + Slow Yavaş - + Fast Hızlı - + Input test /Keyboard/Input test - + Key tips /Keyboard/Key tips @@ -4233,21 +4319,29 @@ folder will be deleted! KeyboardPainter - Close - Kapat + Kapat - - Keyboard layout levels - Klavye düzeni seviyeleri + Klavye düzeni seviyeleri - - Level %1, %2 - Seviye %1, %2 + Seviye %1, %2 + + + + LanguageFrame + + + Input Settings + + + + + Delete + Sil @@ -4636,7 +4730,7 @@ Lütfen giriş için tekrar deneyin! MainWindow - + Search Ara @@ -4645,58 +4739,70 @@ Lütfen giriş için tekrar deneyin! Denetim Merkezi - - - + + + + Settings - + Main menu - + Minimize - - Maximize/Normal + + Normal - + + + Maximize + + + + Close Kapat - + Help - + About Hakkında - + Exit Çıkış + + + Specified + + ukcc Denetim Merkezi - + Warning Uyarı - + This function has been controlled @@ -4937,9 +5043,8 @@ Lütfen giriş için tekrar deneyin! Fare - Mouse - Fare + Fare Lefthand @@ -4965,119 +5070,136 @@ Lütfen giriş için tekrar deneyin! MouseUI - + + Mouse Fare - + Pointer - + Cursor - + Dominant hand /Mouse/Dominant hand - + Left hand - + Right hand - + + Scroll direction + + /Mouse/Scroll direction + + + + Forward + + + + + Reverse + + + + Wheel speed /Mouse/Wheel speed - - - + + + + Slow Yavaş - - - + + + + Fast Hızlı - + Double-click interval time /Mouse/Double-click interval time - Short - Kısa + Kısa - Long - Uzun + Uzun - + Pointer speed /Mouse/Pointer speed - + Mouse acceleration /Mouse/Mouse acceleration - + Show pointer position when pressing ctrl /Mouse/Show pointer position when pressing ctrl - + Pointer size İşaretçi Boyutu /Mouse/Pointer size - + Small(recommend) - + Medium Orta - + Large Büyük - + Blinking cursor in text area /Mouse/Blinking cursor in text area - + Cursor speed İmleç Hızı /Mouse/Cursor speed @@ -5086,7 +5208,7 @@ Lütfen giriş için tekrar deneyin! MyLabel - + double-click to test @@ -5161,7 +5283,42 @@ Lütfen giriş için tekrar deneyin! Notice - + + NotFaze Mode + + + + + (Notification banners, prompts will be hidden, and notification sounds will be muted) + + + + + Automatically turn on + + + + + to + + + + + Automatically turn on when multiple screens are connected + + + + + Automatically open in full screen mode + + + + + Allow automatic alarm reminders in Do Not Disturb mode + + + + Notice Settings Bildirim Ayarları @@ -5175,10 +5332,9 @@ Lütfen giriş için tekrar deneyin! Sistem yükseltmesinden sonra yeni özelliği göster - + Get notifications from the app Uygulamalardan Bildirim Al - /notice/Get notifications from the app Show notifications on the lock screen @@ -5193,11 +5349,49 @@ Lütfen giriş için tekrar deneyin! Bildirim - + Notice Bildirim + + NoticeMenu + + + Beep sound when notified + + + + + Show message on screenlock + + + + + Show noticfication on screenlock + + + + + Notification Style + + + + + Banner: Appears in the upper right corner of the screen, and disappears automatically + + + + + Tip:It will be kept on the screen until it is closed + + + + + None:Notifications will not be displayed on the screen, but will go to the notification center + + + NumbersButtonIntel @@ -5209,39 +5403,45 @@ Lütfen giriş için tekrar deneyin! OutputConfig - + resolution Çözünürlük: /Display/resolution - - + + orientation Yönlendirme: /Display/orientation - - + + arrow-up Yukarı - - + + 90° arrow-right 90° Sağa - - + + arrow-down Aşağı - - + + auto rotation + + /Display/auto rotation + + + + frequency /Display/frequency @@ -5251,8 +5451,8 @@ Lütfen giriş için tekrar deneyin! Bazı uygulamaların aktif olması için oturum açılması gerekir - - + + 90° arrow-left 90° sola @@ -5261,7 +5461,7 @@ Lütfen giriş için tekrar deneyin! Yenileme Hızı: - + auto Otomatik @@ -5278,15 +5478,16 @@ Lütfen giriş için tekrar deneyin! %300 - + screen zoom Ekran Yakınlaştırma: /Display/screen zoom - - - + + + + %1 Hz @@ -5346,7 +5547,7 @@ Lütfen giriş için tekrar deneyin! - + GetCode @@ -5365,56 +5566,56 @@ Lütfen giriş için tekrar deneyin! - + confirm - + commit - + Mobile number acquisition failed - - + + Recapture - - - - + + + + Network connection failure, please check - + Phone is lock,try again in an hour - + Phone code is wrong - + Current login expired,using wechat code! - + Unknown error, please try again later - + Please use the correct wechat scan code @@ -5426,16 +5627,12 @@ Lütfen giriş için tekrar deneyin! Güç Yönetimini Ayarla - - Balance (suggest) - Dengeli (Önerilen) + Dengeli (Önerilen) - - Saving - Kaydediliyor + Kaydediliyor Minimize performance @@ -5447,10 +5644,8 @@ Lütfen giriş için tekrar deneyin! - - Autobalance energy and performance with available hardware - Mevcut donanım ile enerji ve performansı otomatik olarak dengeleme + Mevcut donanım ile enerji ve performansı otomatik olarak dengeleme Custom @@ -5458,10 +5653,8 @@ Lütfen giriş için tekrar deneyin! /power/Custom - - Users develop personalized power plans - Kullanıcılar kişiselleştirilmiş güç planları geliştirir + Kullanıcılar kişiselleştirilmiş güç planları geliştirir Power supply @@ -5516,16 +5709,12 @@ Lütfen giriş için tekrar deneyin! Güç - Power - Güç + Güç - - - never - Asla + Asla 10 min @@ -5560,222 +5749,36 @@ Lütfen giriş için tekrar deneyin! 5 dk - - - Require password when sleep/hibernation - - - - - - Password required when waking up the screen - - - - - Press the power button - - - - - - Time to close display - - - - - - Time to sleep - - - - - - Notebook cover - - - - - - - Using power - - - - - Using battery - - - - - - Time to darken - - - - - - Battery level is lower than - - - - - Run - - - - - - Low battery notification - - - - - Automatically run saving mode when low battery - - - - - Automatically run saving mode when the low battery - - - - - - Automatically run saving mode when using battery - - - - - - Display remaining charging time and usage time - - - - - General - - /Power/General - - - - Select Powerplan - - /Power/Select Powerplan - - - - Battery saving plan - - /Power/Battery saving plan - - - - nothing - Hiçbiri + Hiçbiri - - blank - Boş + Boş - - - suspend - Askıya Al + Askıya Al - - - hibernate - Beklemeye Al + Beklemeye Al - - interactive - - - - - - 5min - - - - - - - 10min - - - - - - 15min - - - - - - 30min - - - - - 1h - 1 sa + 1 sa - - 2h - 3 sa {2h?} + 3 sa {2h?} - 3h - 3 sa + 3 sa - - - Balance Model - - - - - - Save Model - - - - - - Performance Model - - - - - 1min - - - - - 20min - - - - - - shutdown - Kapat + Kapat always @@ -5810,19 +5813,18 @@ Lütfen giriş için tekrar deneyin! Yazıcı - + Printer Yazıcı - - Printers And Scanners + + Printers - Add - Ekle + Ekle /Printer/Add @@ -5839,199 +5841,181 @@ Lütfen giriş için tekrar deneyin! - - Dear users of Kylin operating system and relevant products, - - Please read the clauses of the Agreement and the supplementary license (hereinafter collectively referred to as “the Agreement”) and the privacy policy statement for Kylin operating system (hereinafter referred to as “the Statement”). When you click the next step to confirm your complete understanding of the content, it shall indicate that you have accepted the clauses of the Agreement, and the Agreement shall take effect immediately and be legally binding on you and the Company. - “This product” in the Agreement and the Statement refers to “Kylin operating system software product” developed, produced and released by Kylinsoft Co., Ltd. and used for handling the office work or building the information infrastructure for enterprises and governments. “We” refers to Kylinsoft Co., Ltd. “You” refers to the users who pay the license fee and use the Kylin operating system and relevant products. + + Dear users of Kylin operating system and relevant products, + This agreement describes your rights, obligations and prerequisites for your use of this product. Please read the clauses of the Agreement and the supplementary license (hereinafter collectively referred to as “the Agreement”) and the privacy policy statement for Kylin operating system (hereinafter referred to as “the Statement”). + “This product” in the Agreement and the Statement refers to “Kylin operating system software product” developed, produced and released by Kylinsoft Co., Ltd. and used for handling the office work or building the information infrastructure for enterprises and governments. “We” refers to Kylinsoft Co., Ltd. “You” refers to the users who pay the license fee and use the Kylin operating system and relevant products. End User License Agreement of Kylin Release date of the version: July 30, 2021 -Effective date of the version: July 30, 2021 - -The Agreement shall include the following content: -I. User license -II. Java technology limitations -III. Cookies and other technologies -IV. Intellectual property clause -V. Open source code -VI. The third-party software/services -VII. Escape clause -VIII. Integrity and severability of the Agreement -IX. Applicable law and dispute settlement - - I. User license - - According to the number of users who have paid for this product and the types of computer hardware, we shall grant the non-exclusive and non-transferable license to you, and shall only allow the licensed unit and the employees signing the labor contracts with the unit to use the attached software (hereinafter referred to as “the Software”) and documents as well as any error correction provided by Kylinsoft. - 1. User license for educational institutions - In the case of observing the clauses and conditions of the Agreement, if you are an educational institution, your institution shall be allowed to use the attached unmodified binary format software and only for internal use. “For internal use” here refers to that the licensed unit and the employees signing the labor contracts with the unit as well as the students enrolled by your institution can use this product. - 2. Use of the font software - Font software refers to the software pre-installed in the product and generating font styles. You cannot separate the font software from the Software and cannot modify the font software in an attempt to add any function that such font software, as a part of this product, does not have when it is delivered to you, or you cannot embed the font software in the files provided as a commercial product for any fee or other remuneration, or cannot use it in equipment where this product is not installed. If you use the font software for other commercial purposes such as external publicity, please contact and negotiate with the font copyright manufacture to obtain the permissions for your relevant acts. - - II. Java technology limitations - - You cannot change the “Java Platform Interface” (referred to as “JPI”, that is, the classes in the “java” package or any sub-package of the “java” package), whether by creating additional classes in JPI or by other means to add or change the classes in JPI. If you create an additional class as well as one or multiple relevant APIs, and they (i) expand the functions of Java platform; And (ii) may be used by the third-party software developers to develop additional software that may call the above additional APIs, you must immediately publish the accurate description of such APIs widely for free use by all developers. You cannot create or authorize other licensees to create additional classes, interfaces or sub-packages marked as “java”, “javax” and “sun” in any way, or similar agreements specified by Sun in any naming agreements. See the appropriate version of the Java Runtime Environment Binary Code License (located at http://jdk.java.net at present) to understand the availability of runtime code jointly distributed with Java mini programs and applications. - - III. Cookies and other technologies - - In order to help us better understand and serve the users, our website, online services and applications may use the “Cookie” technology. Such Cookies are used to store the network traffic entering and exiting the system and the traffic generated due to detection errors, so they must be set. We shall understand how you interact with our website and online services by using such Cookies. - If you want to disable the Cookie and use the Firefox browser, you may set it in Privacy and Security Center of Firefox. If your use other browsers, please consult the specific schemes from the relevant suppliers. - In accordance with Article 76, paragraph 5 of the Network Security Law of the People's Republic of China, personal information refers to all kinds of information recorded in electronic or other ways, which can identify the natural persons’ personal identity separately or combined with other information, including but not limited to the natural person’s name, date of birth, identity certificate number, personal biological identification information, address and telephone number, etc. If Cookies contain the above information, or the combined information of non-personal information and other personal information collected through Cookie, for the purpose of this privacy policy, we shall regard the combined information as personal privacy information, and shall provide the corresponding security protection measures for your personal information by referring to Kylin Privacy Policy Statement. - - IV. Intellectual property clause - - 1. Trademarks and Logos - This product shall be protected by the copyright law, trademark law and other laws and international intellectual property conventions. Title to the product and all associated intellectual property rights are retained by us or its licensors. No right, title or interest in any trademark, service mark, logo or trade name of us or its licensors is granted under the Agreement. Any use of Kylinsoft marked by you shall be in favor of Kylinsoft, and without our consent, you shall not arbitrarily use any trademark or sign of Kylinsoft. - 2. Duplication, modification and distribution - If the Agreement remains valid for all duplicates, you may and must duplicate, modify and distribute software observing GNU GPL-GNU General Public License agreement among the Kylin operating system software products in accordance with GNU GPL-GNU General Public License, and must duplicate, modify and distribute other Kylin operating system software products not observing GNU GPL-GNU General Public License agreement in accordance with relevant laws and other license agreements, but no derivative release version based on the Kylin operating system software products can use any of our trademarks or any other signs without our written consent. - Special notes: Such duplication, modification and distribution shall not include any software, to which GNU GPL-GNU General Public License does not apply, in this product, such as the software store, input method software, font library software and third-party applications contained by the Kylin operating system software products. You shall not duplicate, modify (including decompilation or reverse engineering) or distribute the above software unless prohibited by applicable laws. - - V. Open source code - - For any open source codes contained in this product, any clause of the Agreement shall not limit, constrain or otherwise influence any of your corresponding rights or obligations under any applicable open source code license or all kinds of conditions you shall observe. - - VI. The third-party software/services - - The third-party software/services referred to in the Agreement refer to relevant software/services developed by other organizations or individuals other than the Kylin operating system manufacturer. This product may contain or be bundled with the third-party software/services to which the separate license agreements are attached. When you use any third-party software/services with separate license agreements, you shall be bound by such separate license agreements. - We shall not have any right to control the third-party software/services in these products and shall not expressly or implicitly ensure or guarantee the legality, accuracy, effectiveness or security of the acts of their providers or users. - - VII. Escape clause - - 1. Limited warranty - We guarantee to you that within ninety (90) days from the date when you purchase or obtain this product in other legal ways (subject to the date of the sales contract), the storage medium (if any) of this product shall not be involved in any defects in materials or technology when it is normally used. All compensation available to you and our entire liability under this limited warranty will be for us to choose to replace this product media or refund the fee paid for this product. - 2. Disclaimer - In addition to the above limited warranty, the Software is provided “as is” without any express or implied condition statement and warranty, including any implied warranty of merchantability, suitability for a particular purpose or non-infringement, except that this disclaimer is deemed to be legally invalid. - 3. Limitation of responsibility - To the extent permitted by law, under any circumstances, no matter what theory of liability is adopted, no matter how it is caused, for any loss of income, profit or data caused by or related to the use or inability to use the Software, or for special indirect consequential incidental or punitive damages, neither we nor its licensors shall be liable (even if we have been informed of the possibility of such damages). According to the Agreement, in any case, whether in contract tort (including negligence) or otherwise, our liability to you will not exceed the amount you pay for the Software. The above limitations will apply even if the above warranty fails of its essential purpose. - - VIII. Integrity and severability of the Agreement - - 1. The integrity of the Agreement - The Agreement is an entire agreement on the product use concluded by us with you. It shall replace all oral or written contact information, suggestions, representations and guarantees inconsistent with the Agreement previous or in the same period. During the period of the Agreement, in case of any conflict clauses or additional clauses in the relevant quotations, orders or receipts or in other correspondences regarding the content of the Agreement between the parties, the Agreement shall prevail. No modification of the Agreement will be binding, unless in writing and signed by an authorized representative of each party. - 2. Severability of the Agreement - If any provision of the Agreement is deemed to be unenforceable, the deletion of the corresponding provision will still be effective, unless the deletion will hinder the realization of the fundamental purpose of the parties (in which case, the Agreement will be terminated immediately). - - IX. Applicable law and dispute settlement - - 1. Application of governing laws - Any dispute settlement (including but not limited to litigation and arbitration) related to the Agreement shall be governed by the laws of the People’s Republic of China. The legal rules of any other countries and regions shall not apply. - 2. Termination - If the Software becomes or, in the opinion of either party, may become the subject of any claim for intellectual property infringement, either party may terminate the Agreement immediately. - The Agreement is effective until termination. You may terminate the Agreement at any time, but you must destroy all originals and duplicates of the Software. The Agreement will terminate immediately without notice from us if you fail to comply with any provision of the Agreement. At the time of termination, you must destroy all originals and duplicates of such software, and shall be legally liable for not observing the Agreement. - - The Agreement shall be in both Chinese and English, and in case of ambiguity between any content above, the Chinese version shall prevail. - -Privacy Policy Statement of Kylin Operating System -Release date of the version: July 30, 2021 Effective date of the version: July 30, 2021 + The Agreement shall include the following content: + I. User license + II. Java technology limitations + III. Cookies and other technologies + IV. Intellectual property clause + V. Open source code + VI. The third-party software/services + VII. Escape clause + VIII. Integrity and severability of the Agreement + IX. Applicable law and dispute settlement -We attach great importance to personal information and privacy protection. In order to guarantee the legal, reasonable and appropriate collection, storage and use of your personal privacy information and the transmission and storage in the safe and controllable circumstances, we hereby formulate this Statement. We shall provide your personal information with corresponding security protection measures according to the legal requirements and mature security standards in the industry. - The Statement shall include the following content: - I. Collection and use your personal information - II. How to store and protect your personal information - III. How to manage your personal information - IV. Privacy of the third-party software/services - V. Minors’ use of the products - VI. How to update this Statement - VII. How to contact us + I. User license + According to the number of users who have paid for this product and the types of computer hardware, we shall grant the non-exclusive and non-transferable license to you, and shall only allow the licensed unit and the employees signing the labor contracts with the unit to use the attached software (hereinafter referred to as “the Software”) and documents as well as any error correction provided by Kylinsoft. + 1. User license for educational institutions + In the case of observing the clauses and conditions of the Agreement, if you are an educational institution, your institution shall be allowed to use the attached unmodified binary format software and only for internal use. “For internal use” here refers to that the licensed unit and the employees signing the labor contracts with the unit as well as the students enrolled by your institution can use this product. + 2. Use of the font software + Font software refers to the software pre-installed in the product and generating font styles. You cannot separate the font software from the Software and cannot modify the font software in an attempt to add any function that such font software, as a part of this product, does not have when it is delivered to you, or you cannot embed the font software in the files provided as a commercial product for any fee or other remuneration, or cannot use it in equipment where this product is not installed. If you use the font software for other commercial purposes such as external publicity, please contact and negotiate with the font copyright manufacture to obtain the permissions for your relevant acts. - I. How to collect and use your personal information + II. Java technology limitations + You cannot change the “Java Platform Interface” (referred to as “JPI”, that is, the classes in the “java” package or any sub-package of the “java” package), whether by creating additional classes in JPI or by other means to add or change the classes in JPI. If you create an additional class as well as one or multiple relevant APIs, and they (i) expand the functions of Java platform; And (ii) may be used by the third-party software developers to develop additional software that may call the above additional APIs, you must immediately publish the accurate description of such APIs widely for free use by all developers. You cannot create or authorize other licensees to create additional classes, interfaces or sub-packages marked as “java”, “javax” and “sun” in any way, or similar agreements specified by Sun in any naming agreements. See the appropriate version of the Java Runtime Environment Binary Code License (located at http://jdk.java.net at present) to understand the availability of runtime code jointly distributed with Java mini programs and applications. - 1. The collection of personal information - We shall collect the relevant information when you use this product mainly to provide you with higher-quality products, more usability and better services. Part of information collected shall be provided by you directly, and other information shall be collected by us through your interaction with the product as well as your use and experience of the product. We shall not actively collect and deal with your personal information unless we have obtained your express consent according to the applicable legal stipulations. - 1) The licensing mechanism for this product allows you to apply for the formal license of the product in accordance with the contract and relevant agreements after you send a machine code to the commercial personnel of Kylinsoft, and the machine code is generated through encryption and conversion according to the information of the computer used by you, such as network card, firmware and motherboard. This machine code shall not directly contain the specific information of the equipment, such as network card, firmware and motherboard, of the computer used by you. - 2) Server of the software store of this product shall connect it according to the CPU type information and IP address of the computer used by you; at the same time, we shall collect the relevant information of your use of the software store of this product, including but not limited to the time of opening the software store, interaction between the pages, search content and downloaded content. The relevant information collected is generally recorded in the log of server system of software store, and the specific storage position may change due to different service scenarios. - 3) Upgrading and updating of this product shall be connected according to the IP address of the computer used by you, so that you can upgrade and update the system; - 4) Your personal information, such as E-mail address, telephone number and name, shall be collected due to business contacts and technical services. - 5) The biological characteristic management tool support system components of this product shall use the biological characteristics for authentication, including fingerprint, finger vein, iris and voiceprint. The biological characteristic information input by you shall be stored in the local computer, and for such part of information, we shall only receive the verification results but shall not collect or upload it. If you do not need to use the biological characteristics for the system authentication, you may disable this function in the biological characteristic management tool. - 6) This product shall provide the recording function. When you use the recording function of this product, we shall only store the audio content when you use the recording in the local computer but shall not collect or upload the content. - 7) The service and support functions of this product shall collect the information provided by you for us, such as log, E-mail, telephone and name, so as to make it convenient to provide the technical services, and we shall properly keep your personal information. - 8) In the upgrading process of this product, if we need to collect additional personal information of yours, we shall timely update this part of content. + III. Cookies and other technologies + In order to help us better understand and serve the users, our website, online services and applications may use the “Cookie” technology. Such Cookies are used to store the network traffic entering and exiting the system and the traffic generated due to detection errors, so they must be set. We shall understand how you interact with our website and online services by using such Cookies. + If you want to disable the Cookie and use the Firefox browser, you may set it in Privacy and Security Center of Firefox. If your use other browsers, please consult the specific schemes from the relevant suppliers. + In accordance with Article 76, paragraph 5 of the Network Security Law of the People's Republic of China, personal information refers to all kinds of information recorded in electronic or other ways, which can identify the natural persons’ personal identity separately or combined with other information, including but not limited to the natural person’s name, date of birth, identity certificate number, personal biological identification information, address and telephone number, etc. If Cookies contain the above information, or the combined information of non-personal information and other personal information collected through Cookie, for the purpose of this privacy policy, we shall regard the combined information as personal privacy information, and shall provide the corresponding security protection measures for your personal information by referring to Kylin Privacy Policy Statement. - 2. Use of personal information - We shall strictly observe the stipulations of laws and regulations and agreements with you to use the information collected for the following purposes. In case of exceeding the scope of following purposes, we shall explain to you again and obtain your consent. - 1) The needs such as product licensing mechanism, use of software store, system updating and maintenance, biological identification and online services shall be involved; - 2) We shall utilize the relevant information to assist in promoting the product security, reliability and sustainable service; - 3) We shall directly utilize the information collected (such as the E-mail address and telephone provided by you) to communicate with you directly, for example, business contact, technical support or follow-up service visit; - 4) We shall utilize the data collected to improve the current usability of the product, promote the product’s user experience (such as the personalized recommendation of software store) and repair the product defects, etc.; - 5) We shall use the user behavior data collected for data analysis. For example, we shall use the information collected to analyze and form the urban thermodynamic chart or industrial insight report excluding any personal information. We may make the information excluding identity identification content upon the statistics and processing public and share it with our partners, to understand how the users use our services or make the public understand the overall use trend of our services; - 6) We may use your relevant information and provide you with the advertising more related to you on relevant websites and in applications and other channels; - 7) In order to follow the relevant requirements of relevant laws and regulations, departmental regulations and rules and governmental instructions. + IV. Intellectual property clause + 1. Trademarks and Logos + This product shall be protected by the copyright law, trademark law and other laws and international intellectual property conventions. Title to the product and all associated intellectual property rights are retained by us or its licensors. No right, title or interest in any trademark, service mark, logo or trade name of us or its licensors is granted under the Agreement. Any use of Kylinsoft marked by you shall be in favor of Kylinsoft, and without our consent, you shall not arbitrarily use any trademark or sign of Kylinsoft. + 2. Duplication, modification and distribution + If the Agreement remains valid for all duplicates, you may and must duplicate, modify and distribute software observing GNU GPL-GNU General Public License agreement among the Kylin operating system software products in accordance with GNU GPL-GNU General Public License, and must duplicate, modify and distribute other Kylin operating system software products not observing GNU GPL-GNU General Public License agreement in accordance with relevant laws and other license agreements, but no derivative release version based on the Kylin operating system software products can use any of our trademarks or any other signs without our written consent. + Special notes: Such duplication, modification and distribution shall not include any software, to which GNU GPL-GNU General Public License does not apply, in this product, such as the software store, input method software, font library software and third-party applications contained by the Kylin operating system software products. You shall not duplicate, modify (including decompilation or reverse engineering) or distribute the above software unless prohibited by applicable laws. - 3. Information sharing and provision - We shall not share or transfer your personal information to any third party, except for the following circumstances: - 1) After obtaining your clear consent, we shall share your personal information with the third parities; - 2) In order to achieve the purpose of external processing, we may share your personal information with the related companies or other third-party partners (the third-party service providers, contractors, agents and application developers). We shall protect your information security by means like encryption and anonymization; - 3) We shall not publicly disclose the personal information collected. If we must disclose it publicly, we shall notify you of the purpose of such public disclosure, type of information disclosed and the sensitive information that may be involved, and obtain your consent; - 4) With the continuous development of our business, we may carry out the transactions, such as merger, acquisition and asset transfer, and we shall notify you of the relevant circumstances, and continue to protect or require the new controller to continue to protect your personal information according to laws and regulations and the standards no lower than that required by this Statement; - 5) If we use your personal information beyond the purpose claimed at the time of collection and the directly or reasonably associated scope, we shall notify you again and obtain your consent before using your personal information. + V. Open source code + For any open source codes contained in this product, any clause of the Agreement shall not limit, constrain or otherwise influence any of your corresponding rights or obligations under any applicable open source code license or all kinds of conditions you shall observe. - 4. Exceptions with authorized consent - 1) It is directly related to national security, national defense security and other national interests; - 2) It is directly related to public safety, public health and public knowledge and other major public interests; - 3) It is directly related to crime investigation, prosecution, judgment and execution of judgment; - 4) It aims to safeguard the life, property and other major legal rights and interests of you or others but it is impossible to obtain your own consent; - 5) The personal information collected is disclosed to the public by yourself; - 6) Personal information collected from legally publicly disclosed information, such as legal news reports, government information disclosure and other channels; - 7) It is necessary to sign and perform of the contract according to your requirement; - 8) It is necessary to maintain the safe and stable operation of the provided products or services, including finding and handling any fault of products or services; - 9) It is necessary to carry out statistical or academic research for public interest, and when the results of academic research or description are provided, the personal information contained in the results is de-identified; - 10) Other circumstances specified in the laws and regulations. + VI. The third-party software/services + The third-party software/services referred to in the Agreement refer to relevant software/services developed by other organizations or individuals other than the Kylin operating system manufacturer. This product may contain or be bundled with the third-party software/services to which the separate license agreements are attached. When you use any third-party software/services with separate license agreements, you shall be bound by such separate license agreements. + We shall not have any right to control the third-party software/services in these products and shall not expressly or implicitly ensure or guarantee the legality, accuracy, effectiveness or security of the acts of their providers or users. - II. How to store and protect personal information + VII. Escape clause + 1. Limited warranty + We guarantee to you that within ninety (90) days from the date when you purchase or obtain this product in other legal ways (subject to the date of the sales contract), the storage medium (if any) of this product shall not be involved in any defects in materials or technology when it is normally used. All compensation available to you and our entire liability under this limited warranty will be for us to choose to replace this product media or refund the fee paid for this product. + 2. Disclaimer + In addition to the above limited warranty, the Software is provided “as is” without any express or implied condition statement and warranty, including any implied warranty of merchantability, suitability for a particular purpose or non-infringement, except that this disclaimer is deemed to be legally invalid. + 3. Limitation of responsibility + To the extent permitted by law, under any circumstances, no matter what theory of liability is adopted, no matter how it is caused, for any loss of income, profit or data caused by or related to the use or inability to use the Software, or for special indirect consequential incidental or punitive damages, neither we nor its licensors shall be liable (even if we have been informed of the possibility of such damages). According to the Agreement, in any case, whether in contract tort (including negligence) or otherwise, our liability to you will not exceed the amount you pay for the Software. The above limitations will apply even if the above warranty fails of its essential purpose. - 1. Information storage place - We shall store the personal information collected and generated in China within the territory of China in accordance with laws and regulations. - 2. Information storage duration - Generally speaking, we shall retain your personal information for the time necessary to achieve the purpose or for the shortest term stipulated by laws and regulations. Information recorded in the log shall be kept for a specified period and be automatically deleted according to the configuration. - When operation of our product or services stops, we shall notify you in the forms such as notification and announcement, delete your personal information or conduct anonymization within a reasonable period and immediately stop the activities collecting the personal information. - 3. How to protect the information - We shall strive to provide guarantee for the users’ information security, to prevent the loss, improper use, unauthorized access or disclosure of the information. - We shall use the security protection measures within the reasonable security level to protect the information security. For example, we shall protect your system account and password by means like encryption. - We shall establish the special management systems, processes and organizations to protect the information security. For example, we shall strictly restrict the scope of personnel who access to the information, and require them to observe the confidentiality obligation. - 4. Emergency response plan - In case of security incidents, such as personal information disclosure, we shall start the emergency response plan according to law, to prevent the security incidents from spreading, and shall notify you of the situation of the security incidents, the possible influence of the incidents on you and the remedial measures we will take, in the form of pushing the notifications and announcements. We will also report the disposition of the personal information security events according to the laws, regulations and regulatory requirements. + VIII.Integrity and severability of the Agreement + 1. The integrity of the Agreement + The Agreement is an entire agreement on the product use concluded by us with you. It shall replace all oral or written contact information, suggestions, representations and guarantees inconsistent with the Agreement previous or in the same period. During the period of the Agreement, in case of any conflict clauses or additional clauses in the relevant quotations, orders or receipts or in other correspondences regarding the content of the Agreement between the parties, the Agreement shall prevail. No modification of the Agreement will be binding, unless in writing and signed by an authorized representative of each party. + 2. Severability of the Agreement + If any provision of the Agreement is deemed to be unenforceable, the deletion of the corresponding provision will still be effective, unless the deletion will hinder the realization of the fundamental purpose of the parties (in which case, the Agreement will be terminated immediately). - III. How to manage your personal information + IX. Applicable law and dispute settlement + 1. Application of governing laws + Any dispute settlement (including but not limited to litigation and arbitration) related to the Agreement shall be governed by the laws of the People’s Republic of China. The legal rules of any other countries and regions shall not apply. + 2. Termination + If the Software becomes or, in the opinion of either party, may become the subject of any claim for intellectual property infringement, either party may terminate the Agreement immediately. + The Agreement is effective until termination. You may terminate the Agreement at any time, but you must destroy all originals and duplicates of the Software. The Agreement will terminate immediately without notice from us if you fail to comply with any provision of the Agreement. At the time of termination, you must destroy all originals and duplicates of such software, and shall be legally liable for not observing the Agreement. + The Agreement shall be in both Chinese and English, and in case of ambiguity between any content above, the Chinese version shall prevail. - If you worry about the personal information disclosure caused by using this product, you may consider suspending or not using the relevant functions involving the personal information, such as the formal license of the product, application store, system updating and upgrading and biological identification, according to the personal and business needs. - Please pay attention to the personal privacy protection at the time of using the third-party software/services in this product. + Privacy Policy Statement of Kylin Operating System/n Release date of the version: July 30, 2021 + Effective date of the version: July 30, 2021 - IV. Privacy of the third-party software/services + We attach great importance to personal information and privacy protection. In order to guarantee the legal, reasonable and appropriate collection, storage and use of your personal privacy information and the transmission and storage in the safe and controllable circumstances, we hereby formulate this Statement. We shall provide your personal information with corresponding security protection measures according to the legal requirements and mature security standards in the industry. - The third-party software/services referred to in the Agreement refer to relevant software/services developed by other organizations or individuals other than the Kylin operating system manufacturer. - When you install or use the third-party software/services in this product, the privacy protection and legal responsibility of the third-party software/services shall be independently borne by the third-party software/services. Please carefully read and examine the privacy statement or clauses corresponding to the third-party software/services, and pay attention to the personal privacy protection. + The Statement shall include the following content: + I. Collection and use your personal information + II. How to store and protect your personal information + III. How to manage your personal information + IV. Privacy of the third-party software/services + V. Minors’ use of the products + VI. How to update this Statement + VII. How to contact us - V. Minors’ use of the products + I. How to collect and use your personal information + 1. The collection of personal information + We shall collect the relevant information when you use this product mainly to provide you with higher-quality products, more usability and better services. Part of information collected shall be provided by you directly, and other information shall be collected by us through your interaction with the product as well as your use and experience of the product. We shall not actively collect and deal with your personal information unless we have obtained your express consent according to the applicable legal stipulations. + 1) The licensing mechanism for this product allows you to apply for the formal license of the product in accordance with the contract and relevant agreements after you send a machine code to the commercial personnel of Kylinsoft, and the machine code is generated through encryption and conversion according to the information of the computer used by you, such as network card, firmware and motherboard. This machine code shall not directly contain the specific information of the equipment, such as network card, firmware and motherboard, of the computer used by you. + 2) Server of the software store of this product shall connect it according to the CPU type information and IP address of the computer used by you; at the same time, we shall collect the relevant information of your use of the software store of this product, including but not limited to the time of opening the software store, interaction between the pages, search content and downloaded content. The relevant information collected is generally recorded in the log of server system of software store, and the specific storage position may change due to different service scenarios. + 3) Upgrading and updating of this product shall be connected according to the IP address of the computer used by you, so that you can upgrade and update the system; + 4) Your personal information, such as E-mail address, telephone number and name, shall be collected due to business contacts and technical services. + 5) The biological characteristic management tool support system components of this product shall use the biological characteristics for authentication, including fingerprint, finger vein, iris and voiceprint. The biological characteristic information input by you shall be stored in the local computer, and for such part of information, we shall only receive the verification results but shall not collect or upload it. If you do not need to use the biological characteristics for the system authentication, you may disable this function in the biological characteristic management tool. + 6) This product shall provide the recording function. When you use the recording function of this product, we shall only store the audio content when you use the recording in the local computer but shall not collect or upload the content. + 7) The service and support functions of this product shall collect the information provided by you for us, such as log, E-mail, telephone and name, so as to make it convenient to provide the technical services, and we shall properly keep your personal information. + 8) In the upgrading process of this product, if we need to collect additional personal information of yours, we shall timely update this part of content. + 2. Use of personal information + We shall strictly observe the stipulations of laws and regulations and agreements with you to use the information collected for the following purposes. In case of exceeding the scope of following purposes, we shall explain to you again and obtain your consent. + 1) The needs such as product licensing mechanism, use of software store, system updating and maintenance, biological identification and online services shall be involved; + 2) We shall utilize the relevant information to assist in promoting the product security, reliability and sustainable service; + 3) We shall directly utilize the information collected (such as the E-mail address and telephone provided by you) to communicate with you directly, for example, business contact, technical support or follow-up service visit; + 4) We shall utilize the data collected to improve the current usability of the product, promote the product’s user experience (such as the personalized recommendation of software store) and repair the product defects, etc.; + 5) We shall use the user behavior data collected for data analysis. For example, we shall use the information collected to analyze and form the urban thermodynamic chart or industrial insight report excluding any personal information. We may make the information excluding identity identification content upon the statistics and processing public and share it with our partners, to understand how the users use our services or make the public understand the overall use trend of our services; + 6) We may use your relevant information and provide you with the advertising more related to you on relevant websites and in applications andother channels; + 7) In order to follow the relevant requirements of relevant laws and regulations, departmental regulations and rules and governmental instructions. + 3. Information sharing and provision + We shall not share or transfer your personal information to any third party, except for the following circumstances: + 1) After obtaining your clear consent, we shall share your personal information with the third parities; + 2) In order to achieve the purpose of external processing, we may share your personal information with the related companies or other third-party partners (the third-party service providers, contractors, agents and application developers). We shall protect your information security by means like encryption and anonymization; + 3) We shall not publicly disclose the personal information collected. If we must disclose it publicly, we shall notify you of the purpose of such public disclosure, type of information disclosed and the sensitive information that may be involved, and obtain your consent; + 4) With the continuous development of our business, we may carry out the transactions, such as merger, acquisition and asset transfer, and we shall notify you of the relevant circumstances, and continue to protect or require the new controller to continue to protect your personal information according to laws and regulations and the standards no lower than that required by this Statement; + 5) If we use your personal information beyond the purpose claimed at the time of collection and the directly or reasonably associated scope, we shall notify you again and obtain your consent before using your personal information. + 4. Exceptions with authorized consent + 1) It is directly related to national security, national defense security and other national interests; + 2) It is directly related to public safety, public health and public knowledge and other major public interests; + 3) It is directly related to crime investigation, prosecution, judgment and execution of judgment; + 4) It aims to safeguard the life, property and other major legal rights and interests of you or others but it is impossible to obtain your own consent; + 5) The personal information collected is disclosed to the public by yourself; + 6) Personal information collected from legally publicly disclosed information, such as legal news reports, government information disclosure and other channels; + 7) It is necessary to sign and perform of the contract according to your requirement; + 8) It is necessary to maintain the safe and stable operation of the provided products or services, including finding and handling any fault of products or services; + 9) It is necessary to carry out statistical or academic research for public interest, and when the results of academic research or description are provided, the personal information contained in the results is de-identified; + 10) Other circumstances specified in the laws and regulations. - If you are a minor, you shall obtain your guardian’s consent on your use of this product and the relevant service clauses. Except for the information required by the product, we shall not deliberately require the minors to provide more data. With the guardians’ consent or authorization, the accounts created by the minors shall be deemed to be the same as any other accounts. We have formulated special information processing rules to protect the personal information security of minors using this product. The guardians shall also take the appropriate preventive measures to protect the minors and supervise their use of this product. + II. How to store and protect personal information + 1. Information storage place + We shall store the personal information collected and generated in China within the territory of China in accordance with laws and regulations. + 2. Information storage duration + Generally speaking, we shall retain your personal information for the time necessary to achieve the purpose or for the shortest term stipulated by laws and regulations. Information recorded in the log shall be kept for a specified period and be automatically deleted according to the configuration. + When operation of our product or services stops, we shall notify you in the forms such as notification and announcement, delete your personal information or conduct anonymization within a reasonable period and immediately stop the activities collecting the personal information. + 3. How to protect the information + We shall strive to provide guarantee for the users’ information security, to prevent the loss, improper use, unauthorized access or disclosure of the information. + We shall use the security protection measures within the reasonable security level to protect the information security. For example, we shall protect your system account and password by means like encryption. + We shall establish the special management systems, processes and organizations to protect the information security. For example, we shall strictly restrict the scope of personnel who access to the information, and require them to observe the confidentiality obligation. + 4. Emergency response plan + In case of security incidents, such as personal information disclosure, we shall start the emergency response plan according to law, to prevent the security incidents from spreading, and shall notify you of the situation of the security incidents, the possible influence of the incidents on you and the remedial measures we will take, in the form of pushing the notifications and announcements. We will also report the disposition of the personal information security events according to the laws, regulations and regulatory requirements. - VI. How to update this Statement + III. How to manage your personal information + If you worry about the personal information disclosure caused by using this product, you may consider suspending or not using the relevant functions involving the personal information, such as the formal license of the product, application store, system updating and upgrading and biological identification, according to the personal and business needs. + Please pay attention to the personal privacy protection at the time of using the third-party software/services in this product. - We may update this Statement at any time, and shall display the updated statement to you through the product installation process or the company’s website at the time of updating. After such updates take effect, if you use such services or any software permitted according to such clauses, you shall be deemed to agree on the new clauses. If you disagree on the new clauses, then you must stop using this product, and please close the account created by you in this product; if you are a guardian, please help your minor child to close the account created by him/her in this product. + IV. Privacy of the third-party software/services - VII. How to contact us + The third-party software/services referred to in the Agreement refer to relevant software/services developed by other organizations or individuals other than the Kylin operating system manufacturer. + When you install or use the third-party software/services in this product, the privacy protection and legal responsibility of the third-party software/services shall be independently borne by the third-party software/services. Please carefully read and examine the privacy statement or clauses corresponding to the third-party software/services, and pay attention to the personal privacy protection. - If you have any question, or any complaints or opinions on this Statement, you may seek advice through our customer service hotline 400-089-1870, or the official website (www.kylinos.cn), or “service and support” application in this product. You may also contact us by E-mail (market@kylinos.cn). - We shall timely and properly deal with them. Generally, a reply will be made within 15 working days. - The Statement shall take effect from the date of updating. The Statement shall be in Chinese and English at the same time and in case of any ambiguity of any clause above, the Chinese version shall prevail. - Last date of updating: November 1, 2021 + V. Minors’ use of the products + If you are a minor, you shall obtain your guardian’s consent on your use of this product and the relevant service clauses. Except for the information required by the product, we shall not deliberately require the minors to provide more data. With the guardians’ consent or authorization, the accounts created by the minors shall be deemed to be the same as any other accounts. We have formulated special information processing rules to protect the personal information security of minors using this product. The guardians shall also take the appropriate preventive measures to protect the minors and supervise their use of this product. -Address: Building 3, Xin’an Entrepreneurship Plaza, Tanggu Marine Science and Technology Park, Binhai High-tech Zone, Tianjin (300450) - Silver Valley Tower, No. 9, North Forth Ring West Road, Haidian District, Beijing (100190) - Building T3, Fuxing World Financial Center, No. 303, Section 1 of Furong Middle Road, Kaifu District, Changsha City (410000) - Digital Entertainment Building, No. 1028, Panyu Road, Xuhui District, Shanghai (200030) -Tel.: Tianjin (022) 58955650 Beijing (010) 51659955 - Changsha (0731) 88280170 Shanghai (021) 51098866 -Fax: Tianjin (022) 58955651 Beijing (010) 62800607 - Changsha (0731) 88280166 Shanghai (021) 51062866 + VI. How to update this Statement + We may update this Statement at any time, and shall display the updated statement to you through the product installation process or the company’s website at the time of updating. After such updates take effect, if you use such services or any software permitted according to such clauses, you shall be deemed to agree on the new clauses. If you disagree on the new clauses, then you must stop using this product, and please close the accountcreated by you in this product; if you are a guardian, please help your minor child to close the account created by him/her in this product. -Company website: www.kylinos.cn -E-mail: support@kylinos.cn + VII. How to contact us + If you have any question, or any complaints or opinions on this Statement, you may seek advice through our customer service hotline 400-089-1870, or the official website (www.kylinos.cn), or “service and support” application in this product. You may also contact us by E-mail (market@kylinos.cn). + We shall timely and properly deal with them. Generally, a reply will be made within 15 working days. + The Statement shall take effect from the date of updating. The Statement shall be in Chinese and English at the same time and in case of any ambiguity of any clause above, the Chinese version shall prevail. + Last date of updating: November 1, 2021 + +Address: + Building 3, Xin’an Entrepreneurship Plaza, Tanggu Marine Science and Technology Park, Binhai High-tech Zone, Tianjin (300450) + Silver Valley Tower, No. 9, North Forth Ring West Road, Haidian District, Beijing (100190) + Building T3, Fuxing World Financial Center, No. 303, Section 1 of Furong Middle Road, Kaifu District, Changsha City (410000) + Digital Entertainment Building, No. 1028, Panyu Road, Xuhui District, Shanghai (200030) +Tel.: + Tianjin (022) 58955650 Beijing (010) 51659955 + Changsha (0731) 88280170 Shanghai (021) 51098866 +Fax: + Tianjin (022) 58955651 Beijing (010) 62800607 + Changsha (0731) 88280166 Shanghai (021) 51062866 + + Company website: www.kylinos.cn + E-mail: support@kylinos.cn - + Kylinsoft Co., Ltd. @@ -6039,9 +6023,8 @@ E-mail: support@kylinos.cn Proxy - Auto Proxy - Otomatik + Otomatik /Proxy/Auto Proxy @@ -6050,15 +6033,13 @@ E-mail: support@kylinos.cn /proxy/Auto proxy - Auto url - Oto URL + Oto URL /Proxy/Auto url - Manual Proxy - Elle + Elle /Proxy/Manual Proxy @@ -6067,122 +6048,56 @@ E-mail: support@kylinos.cn /proxy/Manual proxy - Http Proxy - HTTP Proxy + HTTP Proxy /Proxy/Http Proxy - - - - Port - Port + Port Cetification Sertifika - - System Proxy - - - - Https Proxy - HTTPS Proxy + HTTPS Proxy /Proxy/Https Proxy - Ftp Proxy - Ftp Proxy + Ftp Proxy /Proxy/Ftp Proxy - Socks Proxy - Socks Proxy + Socks Proxy /Proxy/Socks Proxy - List of ignored hosts. more than one entry, please separate with english semicolon(;) - Yok sayılan ana bilgisayarların listesi. birden fazla giriş için (;) ile ayırın + Yok sayılan ana bilgisayarların listesi. birden fazla giriş için (;) ile ayırın - - Enable Authentication - - - - - User Name - - - - Password - Parola + Parola - - Apt Proxy - - /Proxy/Apt Proxy - - - Open - + - - Server Address : - - - - - Port : - - - - Edit - Düzenle - - - - The apt proxy has been turned off and needs to be restarted to take effect - - - - - The system needs to be restarted to set the Apt proxy, whether to reboot - - - - - - Reboot Later - - - - - - Reboot Now - + Düzenle proxy Ağ Vekili - Proxy - Ağ Vekili + Ağ Vekili @@ -6316,65 +6231,16 @@ E-mail: support@kylinos.cn Varsayılan Simge - - blue-crystal - - - - - dark-sense - - - - - DMZ-Black - - - - - DMZ-White - - - - basic - Temel + Temel - classical - Klasik + Klasik - - default - Varsayılan - - - - fashion - - - - - hp - - - - - ukui - - - - - lightseeking - - - - - HeYin - + Varsayılan @@ -6382,12 +6248,12 @@ E-mail: support@kylinos.cn Bilinmeyen - + Customize Shortcut - + Edit Shortcut @@ -6472,8 +6338,9 @@ E-mail: support@kylinos.cn Bağlan + User Info - Kullanıcı Bilgisi + Kullanıcı Bilgisi Security Center @@ -6536,72 +6403,72 @@ E-mail: support@kylinos.cn Deneyim planı - - + + min length %1 En az uzunluk %1 - - + + min digit num %1 En az basamak sayısı %1 - - + + min upper num %1 En az üst sayı %1 - - + + min lower num %1 En az alt sayı %1 - - + + min other num %1 En az diğer sayı %1 - - + + min char class %1 En az karakter sınıfı %1 - - + + max repeat %1 En fazla tekrar %1 - - + + max class repeat %1 En fazla sınıf tekrarı %1 - - + + max sequence %1 En fazla dizi %1 @@ -6658,8 +6525,8 @@ E-mail: support@kylinos.cn Nis - + May May @@ -6759,12 +6626,17 @@ E-mail: support@kylinos.cn Gün - + ukui-control-center is already running! Ukui Denetim Merkezi zaten çalışıyor! - + + ukui-control-center is disabled! + + + + ukui-control-center @@ -6781,6 +6653,15 @@ dosya sisteminde geçersiz! xxx客户端 + + English + İngilizce + + + + Programs are not allowed to be added. + + RegDialog @@ -6833,49 +6714,59 @@ dosya sisteminde geçersiz! Screenlock - + Screenlock Ekran kilidi + Screenlock Interface Ekran Kilidi Arayüzü + /Screenlock/Screenlock Interface - - + + Show message on lock screen + + + + + Browse /Screenlock/Browse - - + + Online Picture /Screenlock/Online Picture - - + + Reset To Default /Screenlock/Reset To Default + + + Related Settings + + Screenlock Set Ekran Kilidi Ayarı - - Lock screen when screensaver boot - Ekran koruyucu açıldığında ekranı kilitle + Ekran koruyucu açıldığında ekranı kilitle /Screenlock/Lock screen when screensaver boot - + Lock screen delay Ekran kilidi gecikmesi @@ -6896,8 +6787,7 @@ dosya sisteminde geçersiz! Bilgisayardan Ekle - - + Show picture of screenlock on screenlogin Ekran girişinde ekran kilidinin resmini göster /Screenlock/Show picture of screenlock on screenlogin @@ -6919,57 +6809,48 @@ dosya sisteminde geçersiz! Resim - + Never Asla - 5m - 5 dk + 5 dk - 10m - 10 dk + 10 dk - 30m - 30 dk + 30 dk - 45m - 45 dk + 45 dk - 1m - 1 dk + 1 dk - 1h - 1 sa + 1 sa - 1.5h - 1.5 sa + 1.5 sa - 3h - 3 sa + 3 sa - 2h - 3 sa {2h?} + 3 sa {2h?} - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Duvarkağıdı Dosyaları(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -6978,53 +6859,108 @@ dosya sisteminde geçersiz! Tüm Dosyalar(*.*) - + + 1min + + + + + 5min + + + + + 10min + + + + + 30min + + + + + 45min + + + + + 1hour + + + + + 2hour + + + + + 3hour + + + + select custom wallpaper file Özel duvar kağıdı dosyasını seç - + Select - + Position: Konum: - + FileName: Dosya Adı: - + FileType: - + Cancel İptal + + + Monitor Off + + + + + Screensaver + + + + + + Set + Ayarla + Screensaver - + Screensaver Ekran Koruyucu - - + Idle time /Screensaver/Idle time - + Lock screen when activating screensaver @@ -7034,8 +6970,7 @@ dosya sisteminde geçersiz! /screensaver/Enable screensaver - - + Screensaver program Ekran Koruyucu Programı /Screensaver/Screensaver program @@ -7050,8 +6985,9 @@ dosya sisteminde geçersiz! Dk + Lock screen when screensaver boot - Ekran koruyucu açıldığında ekranı kilitle + Ekran koruyucu açıldığında ekranı kilitle screensaver @@ -7062,146 +6998,146 @@ dosya sisteminde geçersiz! Ukui Varsayılanı - + View - + Text(up to 30 characters): - + Show rest time - + UKUI - + Blank_Only Sadece Kalın - + Customize - - + + 5min - - + + 10min - - + + 30min - + 15min - + 1hour - + Screensaver source - - + + Select - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) - + select custom screensaver dir - + Position: Konum: - + FileName: Dosya Adı: - + FileType: - + Cancel İptal - + Switching time - + 1min - + Ordinal - + Random switching - + Text position - + Centered - + Randow(Bubble text) - + Random Rasgele - + Never Asla @@ -7271,6 +7207,14 @@ dosya sisteminde geçersiz! Touchpad Dokunmatik Yüzey + + + + + + No search results + + SecurityCenter @@ -7428,19 +7372,18 @@ dosya sisteminde geçersiz! - + Remote Desktop - + Allow others to view your desktop Başkalarının masaüstünüzü görüntülemesine izin verin - /Vino/Allow others to view your desktop - + Allow connection to control screen /Vino/Allow connection to control screen @@ -7451,13 +7394,13 @@ dosya sisteminde geçersiz! Güvenlik - + You must confirm every visit for this machine Bu makine için her ziyareti onaylamalısınız /Vino/You must confirm every visit for this machine - + Require user to enter this password: Kullanıcının bu şifreyi girmesini zorunlu kılın: @@ -7468,8 +7411,8 @@ dosya sisteminde geçersiz! Shortcut - - + + System Shortcut Sistem Kısayolları /Shortcut/System Shortcut @@ -7479,12 +7422,12 @@ dosya sisteminde geçersiz! Tüm Kısayolları Göster - + Custom Shortcut Özel Kısayollar - + Customize Shortcut /Shortcut/Customize Shortcut @@ -7495,23 +7438,23 @@ dosya sisteminde geçersiz! /shortcut/Add custom shortcut - + Add Ekle /Shortcut/Add - + Edit Düzenle - + Delete Sil - + or @@ -7528,7 +7471,7 @@ dosya sisteminde geçersiz! Kısayol - + Shortcut Kısayol @@ -7556,6 +7499,85 @@ dosya sisteminde geçersiz! Masaüstü + + SpliceDialog + + + Dialog + + + + + Splice Screen + + + + + + Cancel + İptal + + + + + Ok + Tamam + + + + + Splicing Method + + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + + + + + Row %1, Column %2 + + + + + Select screen + + + + + StatusDialog + + + About + Hakkında + + + + Activation Code + + + SuccessDiaolog @@ -7693,22 +7715,150 @@ dosya sisteminde geçersiz! /Theme/Theme Mode - + + Theme Tema - Default - Varsayılan + Varsayılan - + + Auto + + + + + Corlor + + + + + Other + + + + + + Set + Ayarla + + + + Wallpaper + + + + + Beep + + + + + Blue-Crystal + + + + + + Light-Seeking + + + + + DMZ-Black + + + + + DMZ-White + + + + + Dark-Sense + + + + + + + basic + Temel + + + + classic + + + + + Classic + + + + + HeYin + + + + + hp + + + + + ukui + + + + + daybreakBlue + + + + + jamPurple + + + + + magenta + + + + + sunRed + + + + + sunsetOrange + + + + + dustGold + + + + + polarGreen + + + + default + Varsayılan + + + Light Açık - + Dark Koyu @@ -7717,39 +7867,35 @@ dosya sisteminde geçersiz! Orta - - + Window Theme /Theme/Window Theme - - + Icon theme Simge Teması /Theme/Icon theme - Control theme - Kontrol Teması + Kontrol Teması - - + Cursor theme İmleç Teması /Theme/Cursor theme - + Effect setting Efekt Ayarları - - + + Transparency Şeffaflık /Theme/Transparency @@ -7759,8 +7905,8 @@ dosya sisteminde geçersiz! Şeffaflık Etkileri - - + + Performance mode Performans Modu /Theme/Performance mode @@ -7778,7 +7924,7 @@ dosya sisteminde geçersiz! Yüksek - + Reset to default Varsayılana Dön @@ -7818,27 +7964,26 @@ dosya sisteminde geçersiz! TimeZoneChooser - + Cancel İptal - + Confirm Onayla - Change time zone - Zaman dilimini değiştir + Zaman dilimini değiştir - + Search Timezone - + To select a time zone, please click where near you on the map and select a city from the nearest city @@ -7851,7 +7996,7 @@ dosya sisteminde geçersiz! Dilimi Değiştir - + Change Timezone Zaman Dilimini Değiştir @@ -7895,9 +8040,8 @@ dosya sisteminde geçersiz! Dokunmatik Yüzey - Touchpad - Dokunmatik Yüzey + Dokunmatik Yüzey Disable rolling @@ -7922,75 +8066,17 @@ dosya sisteminde geçersiz! TouchpadUI - - - Touchpad Setting - - No touchpad found Dokunmatik yüzey bulunamadı - - Disable touchpad when using the mouse - - /Touchpad/Disable touchpad when using the mouse - - - Slow - Yavaş + Yavaş - Fast - Hızlı - - - - Disable touchpad when typing - - /Touchpad/Disable touchpad when typing - - - - Touch and click on the touchpad - - /Touchpad/Touch and click on the touchpad - - - - Scroll bar slides with finger - - /Touchpad/Scroll bar slides with finger - - - - Scrolling area - - /Touchpad/Scrolling area - - - - Disable scrolling - - - - - Edge scrolling - - - - - Pointer Speed - - /Touchpad/Pointer Speed - - - - Two-finger scrolling in the middle area - + Hızlı @@ -8008,20 +8094,15 @@ dosya sisteminde geçersiz! Dear customer: - Thank you for trying Yinhe Kylin OS(trail version)! This version is free for users who only try out, no commercial purpose is permitted. The trail period lasts one year and it starts from the ex-warehouse time of the OS. No after-sales service is provided during the trail stage. If any security problems occurred when user put important files or do any commercial usage in system, all consequences are taken by users. Kylin software Co., Ltd. take no legal risk in trail version. - During trail stage,if you want any technology surpport or activate the system, please buy“Yinhe Kylin Operating System”official version or authorization by contacting 400-089-1870. + Thank you for trying Yinhe Kylin OS(trail version)! This version is free for users who only try out, no commercial purpose is permitted. The trail period lasts one year and it starts from the ex-warehouse time of the OS. No after-sales service is provided during the trail stage. If any security problems occurred when user put important files or do any commercial usage in system, all consequences are taken by users. Kylin software Co., Ltd. take no legal risk in trail version. + During trail stage,if you want any technology surpport or activate the system, please buy“Yinhe Kylin Operating System”official version or authorization by contacting 400-089-1870. - + Kylin software Co., Ltd. - - - www.Kylinos.cn - - UkccAbout @@ -8030,23 +8111,18 @@ dosya sisteminde geçersiz! Denetim Merkezi - - + + Settings - + Version: - - The control panel provides a friendly graphical user interface to manage common configuration items of the operating system. System configuration provides system, equipment, personalization, network, account, time and date, account, time and date, update, notification and operation module operations. - - - - + Service and Support: @@ -8269,63 +8345,67 @@ dosya sisteminde geçersiz! UnifiedOutputConfig - - + + resolution Çözünürlük: - - + + orientation Uyumluluk - - + + arrow-up Yukarı - - + + 90° arrow-right 90° sağa - - + + arrow-down Aşağı - - + + 90° arrow-left 90° sola - - + + auto rotation + + /Display/auto rotation + + + + frequency - - - - - %1 Hz - + + screen zoom + Ekran Yakınlaştırma: + /Display/screen zoom refresh rate Yenileme Oranı - - - + + + auto Oto @@ -8369,9 +8449,8 @@ dosya sisteminde geçersiz! Kullanıcı - User Info - Kullanıcı Bilgisi + Kullanıcı Bilgisi standard user @@ -8382,7 +8461,7 @@ dosya sisteminde geçersiz! Yönetici - + root Root @@ -8391,12 +8470,12 @@ dosya sisteminde geçersiz! Sil - + Standard - + Admin @@ -8405,62 +8484,87 @@ dosya sisteminde geçersiz! Sil - + CurrentUser + /Userinfo/CurrentUser OthersUser + /Userinfo/OthersUser - + Passwd - + Groups - + LoginWithoutPwd + /Userinfo/LoginWithoutPwd - + AutoLoginOnBoot + /Userinfo/AutoLoginOnBoot - + + Add + Ekle + /Userinfo/Add + + + Warning Uyarı - + The user is logged in, please delete the user after logging out - + + The account type of “%1” has been modified, will take effect after logout, whether to logout? + + + + + logout later + + + + + logout now + + + + Hint - + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? - + Trun on - + Close on @@ -8492,18 +8596,14 @@ dosya sisteminde geçersiz! - Password Parola - /Userinfo/Password - - + Type - /Userinfo/Type @@ -8512,15 +8612,12 @@ dosya sisteminde geçersiz! - Login no passwd Şifresiz giriş - /Userinfo/Login no passwd - enable autoLogin - Otomatik giriş + Otomatik giriş /Userinfo/enable autoLogin @@ -8546,95 +8643,101 @@ dosya sisteminde geçersiz! UserInfoIntel - + Current User Mevcut Kullanıcı - /Userinfo/Current User + /UserinfoIntel/Current User - + Change phone - - - + + + Change pwd Parola Değiştir - /Userinfo/Change pwd + /UserinfoIntel/Change pwd - + User group Kullanıcı Grubu - + Del user - + system reboot - + Unclosed apps start after a restart - - + + Other Users Diğer Kullanıcılar - /Userinfo/Other Users + /UserinfoIntel/Other Users - + User Info Intel - + Change Tel - /Userinfo/Change Tel + /UserinfoIntel/Change Tel - + Delete user - /Userinfo/Delete user + /UserinfoIntel/Delete user - + + Change user name + + /UserinfoIntel/Change user name + + + standard user - + administrator Yönetici - + root Root - + Add new user Yeni Kullanıcı Ekle - + set pwd - + Change @@ -8642,27 +8745,27 @@ dosya sisteminde geçersiz! UtilsForUserinfo - + Passwd - + Type - + Del Sil - + Standard - + Admin @@ -8670,7 +8773,7 @@ dosya sisteminde geçersiz! Vino - + Vino @@ -8679,14 +8782,12 @@ dosya sisteminde geçersiz! Vpn - Add Vpn Connect - Vpn Bağlantısı Ekle + Vpn Bağlantısı Ekle - Add vpn connect - Vpn Bağlantısı Ekle + Vpn Bağlantısı Ekle /Vpn/Add vpn connect @@ -8694,40 +8795,41 @@ dosya sisteminde geçersiz! VPN - Vpn - VPN + VPN Wallpaper + Desktop Background Masaüstü Arkaplanı + /Wallpaper/Desktop Background - + Mode - - + + Browse /Wallpaper/Browse - - + + Online Picture /Wallpaper/Online Picture - - + + Reset To Default /Wallpaper/Reset To Default @@ -8773,19 +8875,18 @@ dosya sisteminde geçersiz! Arkaplan - - - + + Background Arkaplan - + picture Resim - + color Renk @@ -8798,35 +8899,37 @@ dosya sisteminde geçersiz! Özel Renk - + wallpaper Duvar Kağıdı - + centered Ortalanmış - + scaled Döşe - + stretched Uzatılmış + zoom - Yakınlaştır + Yakınlaştır + spanned - Yayılmış + Yayılmış - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) Duvarkağıdı Dosyaları(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -8835,38 +8938,38 @@ dosya sisteminde geçersiz! Tüm Dosyalar(*.*) - - + + select custom wallpaper file Özel duvar kağıdı dosyasını seç - - + + Select Seç - - + + Position: Konum: - - + + FileName: Dosya Adı: - - + + FileType: Dosya Türü: - - + + Cancel İptal @@ -8882,15 +8985,21 @@ dosya sisteminde geçersiz! Çıktıyı Birleştir - + night mode Gece Modu - /Display/night mode + /display/night mode + + as main + + + + screen zoom - Ekran Yakınlaştırma: + Ekran Yakınlaştırma: /display/screen zoom @@ -8905,94 +9014,110 @@ dosya sisteminde geçersiz! /display/unify output - - After modifying the resolution or refresh rate, due to compatibility issues between the display device and the graphics card, the display may be abnormal or unable to display -the settings will be saved after 29 seconds + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 29 seconds</font> - - Save Config - - - - - Restore Config - - - - + Warnning - + Night Mode + /Display/Night Mode - + Open - + Time - - + + Custom Time - + to - + Color Temperature - + Warmer - + Colder - + Multi-screen - + First Screen - + Clone Screen - + + The zoom has been modified, it will take effect after you log off + + + + + + (Effective after logout) + + + + + Splicing Method + + + + + Change + + + + + open monitor + Monitörü Aç + + + Extend Screen - + Vice Screen - + monitor Ekran: @@ -9004,120 +9129,150 @@ the settings will be saved after 29 seconds - Theme follow night mode - - - + Hint - + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + + + + + Save - + + Not Save - - After modifying the resolution or refresh rate, due to compatibility issues between the display device and the graphics card, the display may be abnormal or unable to display -the settings will be saved after %1 seconds + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> - + All Day - - Follow the sunrise and sunset(17:55-06:23) - - - - - - - + + + + Brightness + /Display/Brightness - - + + + please insure at least one output! Lütfen en az bir çıktı alın! - + + + Splice Screen + + + + + Auto Brightness + + + + + Adjust screen brightness by ambient + + + + + Dynamic light + + /Display/Dynamic light + + + + Optimize display content to extend battery life + + + + + resolution Çözünürlük: - + + orientation - + + frequency - - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> + + scale - + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> - - The zoom function needs to log out to take effect - - - - + Log out now - + Later - - - - - + + + + + Warning Uyarı - - + Open time should be earlier than close time! + + + + Follow the sunrise and sunset + + Morning time should be earlier than evening time! Sabah vakti akşam saatinden daha erken olmalı! - - + + Sorry, your configuration could not be applied. Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. Maalesef, yapılandırmanız uygulanamadı. @@ -9161,7 +9316,7 @@ Genel nedenler, toplam ekran boyutunun çok büyük olması veya GPU'nuz ta addShortcutDialog - + Dialog @@ -9174,27 +9329,28 @@ Genel nedenler, toplam ekran boyutunun çok büyük olması veya GPU'nuz ta Kısayol komutu - + Exec - + Open - + Name İsim - + Key - + + TextLabel @@ -9203,13 +9359,13 @@ Genel nedenler, toplam ekran boyutunun çok büyük olması veya GPU'nuz ta Geçersiz yürütülebilir dosya, lütfen tekrar girin - - + + Cancel İptal - + Save @@ -9222,58 +9378,68 @@ Genel nedenler, toplam ekran boyutunun çok büyük olması veya GPU'nuz ta Özel kısayol ekle - + Add Shortcut Kısayol Ekle - + Please enter a shortcut - + Desktop files(*.desktop) - + select desktop Masaüstü seç - - - + + + Invalid application - - - + + + Shortcut conflict - - - + + + Invalid shortcut - - - + + + Name repetition - + Unknown error + + + Shortcut cannot be empty + + + + + Name cannot be empty + + area_code_lineedit @@ -9282,6 +9448,76 @@ Genel nedenler, toplam ekran boyutunun çok büyük olması veya GPU'nuz ta Telefonla Kaydolun + + changeUserGroup + + + user group + + + + + Group: + + + + + GID: + + + + + GNum: + + + + + + Cancel + İptal + + + + + Confirm + Onayla + + + + + + Tips + + + + + + Invalid Id! + + + + + + + OK + Tamam + + + + Invalid Group Name! + + + + + Whether delete the group: “%1” ? + + + + + which will make some file components in the file system invalid! + + + changtimedialog diff --git a/shell/res/i18n/ug.ts b/shell/res/i18n/ug.ts index ee109fe..6698d68 100644 --- a/shell/res/i18n/ug.ts +++ b/shell/res/i18n/ug.ts @@ -4,94 +4,101 @@ About - + System Summary سىستېما خۇلاسە - + Support قوللاش - - + Version Number نەشر نومۇرى - + Status ھالەت /About/Status - + DateRes DateRes - + Wechat code scanning obtains HP professional technical support ئۈندىدار كودىنى سىكاننېرلاش HP كەسپىي تېخنىكا جەھەتتىن قوللاشقا ئېرىشتى - + HostName HostName - + See more about Kylin Tianqi edu platform Kylin Tianqi edu سۇپىسى ھەققىدە تەپسىلى مەلۇمات - + <<Protocol>> <<Protocol>> - - InterVersion - InterVersion + + About and Support + - + InterVersion + InterVersion + + + + Patch Version + + + + Privacy and agreement مەخپىيەتلىك ۋە كېلىشىم - + Send optional diagnostic data ئىختىيارىي دىياگنوز سانلىق مەلۇماتى يوللاش - + By sending us diagnostic data, improve the system experience and solve your problems faster دىياگنوز سانلىق مەلۇماتىنى بىزگە يوللاش ئارقىلىق، سىستېما تەجرىبىسىنى يۇقىرى كۆتۈرۈپ، مەسىلىلەرنى تېخىمۇ تېز ھەل قىلىش - Copyright © 2009-%1 KylinSoft. All rights reserved. - Copyright © 2009-%1 KylinSoft. بارلىق ھوقۇق ماقامى. + Copyright © 2009-%1 KylinSoft. بارلىق ھوقۇق ماقامى. - + and ۋە - + <<Privacy>> <<Privacy>> - + Learn more HP user manual>> HP ئىشلەتكۈچى قوللانمىسىنى تېخىمۇ كۆپ بىلىۋېلىڭ>> - + See user manual>> قوللانما قوللانمىسىغا قاراڭ>> @@ -100,34 +107,49 @@ 未激活(试用期) - + Trial expiration time سىناپ ئىشلىتىش مۇددىتى - - + + expired ۋاقتى ئۆتۈپ كەتكەن - - + + Extend ئۇزارتىش - + + Copyright © 2009-%1 %2. All rights reserved. + + + + + Openkylin + + + + + KylinSoft + + + + The system needs to be restarted to set the HostName, whether to reboot HostName نى بەلگىلەش ئۈچۈن سىستېمىنى قايتا قوزغىتىش كېرەك، قايتا قوزغىتىش كېرەكمۇ يوق - + Reboot Now ھازىر قايتا قوزغىتىڭ - + Reboot Later كېيىن قايتا قوزغىتىڭ @@ -140,9 +162,9 @@ 延长服务 - - - + + + avaliable ئىناۋەتسىز @@ -159,7 +181,8 @@ 版权所有2009-2021@kylinos保留所有权利 - + + Version نەشرى /About/version @@ -177,37 +200,42 @@ 版权所有 © 2009-2021 麒麟软件 保留所有权利。 - + + Kernel Kernel /About/Kernel - + + CPU CPU /About/CPU - + + Memory ئىچكى ساقلىغۇچ /About/Memory - - + + Disk دىسكاز - + + Desktop ئۈستەلئۈستى /About/Desktop - + + User ئىشلەتكۈچى /About/User @@ -221,7 +249,7 @@ 有效期 - + Serial قاتار @@ -234,8 +262,8 @@ 序列号 - - + + Active ئاكتىپ @@ -252,7 +280,7 @@ 关于 - + About ھەققىدە @@ -269,13 +297,13 @@ 可用 - - + + Inactivated مۇلازمەتكە ئۇچرىدى - + Activated قوزغىتىلدى @@ -417,11 +445,92 @@ AddBtn - + Add قوش + + AddButton + + + Add + + + + + AddInputMethodDialog + + + Dialog + + + + + Select the input method to add + + + + + No + + + + + Yes + + + + + + keyboard + 键盘 + + + + + Tibetan + + + + + With ASCII numbers + + + + + Input Method + + + + + AddLanguageDialog + + + Dialog + + + + + No + + + + + Yes + + + + + Add Language + + + + + Search + + + AddNetBtn @@ -598,87 +707,70 @@ AptProxyDialog - Set Apt Proxy - Apt Proxy نى بەلگىلەش + Apt Proxy نى بەلگىلەش - Server Address - مۇلازىمىتېر ئادرېسى + مۇلازىمىتېر ئادرېسى - Port - پورت + پورت - Cancel - ئەمەلدىن قالدۇرۇش + ئەمەلدىن قالدۇرۇش - Confirm - جەزىملەشتۈرۈش + جەزىملەشتۈرۈش Area - - + Area رايون تەۋەلىكى Regional Format 区域格式 - - - - - Current Region - ھازىرقى رايون /Area/Current Region - - First Day Of The Week - ھەپتىنىڭ بىرىنچى كۈنى + Current Region + ھازىرقى رايون + /Area/Current Region + + + First Day Of The Week + ھەپتىنىڭ بىرىنچى كۈنى - - Calendar - كالېندار + كالېندار /Area/Calendar - - Language Format - تىل شەكلى + تىل شەكلى /Area/Regional Format - - Date - چېسلا + چېسلا /Area/Date - - Time - ۋاقتىدا + ۋاقتىدا /Area/Time - TextLabel - TextLabel + TextLabel Area showing time currency format @@ -689,7 +781,7 @@ 区域格式数据 - + lunar ئاي @@ -714,73 +806,74 @@ 显示日期、时间、货币格式的区域 - US - ئامېرىكا + ئامېرىكا - Language for system windows,menus and web pages - سىستېما windows،تىزىملىك ۋە تور بەتلەر ئۈچۈن تىل + سىستېما windows،تىزىملىك ۋە تور بەتلەر ئۈچۈن تىل Add main language 添加首语言 - - System Language - سىستېما تىلى + سىستېما تىلى /Area/system language + Simplified Chinese - 简体中文 + 简体中文 - First Day Of Week - ھەپتىنىڭ بىرىنچى كۈنى + ھەپتىنىڭ بىرىنچى كۈنى /Area/First Day Of Week - + 12 Hours 12 سائەت - + 24 Hours 24 سائەت - + + Tibetan + + + + Modify the current region need to logout to take effect, whether to logout? ھازىرقى رايونلارنى ئۆزگەرتىشكە توغرا كەلسە، ئۈنۈمىنى كۆرسىتىش كېرەكمۇ- يوق؟ - + Logout later كېيىن چېكىنىش - + Logout now ھازىر چېكىنىش - + Modify the first language need to reboot to take effect, whether to reboot? 1. تىلنى ئۆزگەرتىش ئارقىلىق قايتىدىن قوزغىتىلىشقا توغرا كېلىدۇ، قايتىدىن قوزغىلىش كېرەكمۇ-يوق؟ - + Reboot later كېيىن قايتا قوزغىتىڭ - + Reboot now ھازىر قايتا قوزغىتىڭ @@ -821,9 +914,8 @@ 显示语言 - CN - CN + CN Need to cancel to take effect @@ -846,8 +938,9 @@ 区域格式数据 + English - English + English Chinese @@ -858,17 +951,34 @@ 添加首语言 - + solar calendar قۇياش كالېندارى + monday - 星期一 + 星期一 + + English (US) + + + + + Simplified Chinese (CN) + + + + + Tibetan (CN) + + + + sunday - 星期天 + 星期天 change data format @@ -882,6 +992,51 @@ 请输入手机号码 + + AreaUi + + + Regional Format + 区域格式 + /Area/Regional Format + + + + Calendar + كالېندار + /Area/Calendar + + + + First Day Of Week + ھەپتىنىڭ بىرىنچى كۈنى + /Area/First Day Of Week + + + + Date + + /Area/Date + + + + Time + ۋاقتىدا + /Area/Time + + + + Language Format + تىل شەكلى + /Area/Language Format + + + + System Language + سىستېما تىلى + /Area/System Language + + Audio @@ -892,33 +1047,32 @@ AutoBoot - + Desktop files(*.desktop) ئۈستەل يۈزى ھۆججەتلىرى(*.desktop) - + select autoboot desktop ئاپتوماتىك قوزغىتىدىغان ئۈستەل يۈزىنى تاللاش - + Select تاللاش - + Cancel ئەمەلدىن قالدۇرۇش - Add - قوش - /autoboot/Add + قوش + /Autoboot/Add - + Autoboot Settings Autoboot تەڭشەكلىرى /autoboot/Autoboot Settings @@ -936,7 +1090,7 @@ 开机启动 - + Auto Boot ئاپتوماتىك ئۆتۈك @@ -949,7 +1103,7 @@ 当前状态 - + Delete ئۆچۈر @@ -958,8 +1112,7 @@ Backup - - + Backup زاپاسلاش @@ -982,14 +1135,14 @@ you can restore them to ensure the integrity of your system. - + Begin backup زاپاسلاشنى باشلاش /Backup/Begin backup - + Restore ئەسلىگە كەلتۈرۈش @@ -1004,7 +1157,7 @@ you can restore them to ensure the integrity of your system. - + Begin restore ئەسلىگە كەلتۈرۈشنى باشلاش /Backup/Begin restore @@ -1019,14 +1172,14 @@ you can restore them to ensure the integrity of your system. 将永久抹掉存储在计算机的所有数据,且无法撤销此操作。抹掉完成后系统将恢复至最初始出厂状态 - + All data stored on the computer will be permanently erased,and the system will revert to its original factory state when this operation is completed. كومپىيۇتېردا ساقلانغان بارلىق سانلىق مەلۇماتلار مەڭگۈلۈك ئۆچۈپ، سىستېما قايتىدىن بۇ مەشغۇلات تاماملانغاندا ئۇنىڭ ئەسلىدىكى زاۋۇت ھالىتى - + Clear and restore ئايدىڭلاشتۇرۇش ۋە ئەسلىگە كەلتۈرۈش @@ -1038,17 +1191,22 @@ you can restore them to ensure the integrity of your system. سىستېما ئەسلىگە كەلتۈرۈش - + + Backup Restore + + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. ھۆججەتلىرىڭىزنى باشقا قوزغاتقۇچلارغا زاپاسلاپ، مەنبە ھۆججەتلىرى يوقاپ كەتكەندە، بۇزۇلغاندا ياكى ئۆچۈرۈلگەندە سىستېمىنىڭ پۈتۈنلۈكىگە كاپالەتلىك قىلىڭ. - + View the backup list and restore the backup file to the system زاپاس تىزىملىكنى كۆرۈش ۋە زاپاس ھۆججەتنى سىستېمىغا ئەسلىگە كەلتۈرۈش - + Backup and Restore زاپاسلاش ۋە ئەسلىگە كەلتۈرۈش @@ -1472,7 +1630,7 @@ Please authenticate yourself to continue BrightnessFrame - + Failed to get the brightness information of this monitor بۇ كۆزەتكۈچىنىڭ يورۇقلۇق ئۇچۇرىغا ئېرىشەلمىدى @@ -1558,63 +1716,65 @@ Please authenticate yourself to continue ChangeFaceIntelDialog - + + Change User Face ئىشلەتكۈچى چىرايىنى ئۆزگەرتىش + /UserinfoIntel/Change User Face - + History تارىخ - مەدەنىيەت - + System سىستېما - - + + Cancel ئەمەلدىن قالدۇرۇش - + Confirm جەزىملەشتۈرۈش - + select custom face file خاس يۈز ھۆججىتىنى تاللاش - + Select تاللاش - + Position: ئورنى: - + FileName: ھۆججەت نامى: - + FileType: FileType: - + Warning دىققەت - + The avatar is larger than 2M, please choose again باش سۈرەت 2M دىن چوڭ، قايتا تاللاڭ @@ -1645,59 +1805,48 @@ Please authenticate yourself to continue ChangeGroupDialog - Dialog - دىئالوگ + دىئالوگ - User Group Settings - ئىشلەتكۈچى گۇرۇپپا تەڭشەكلىرى + ئىشلەتكۈچى گۇرۇپپا تەڭشەكلىرى User groups available in the system 系统中可用的用户组 - Cancel - ئەمەلدىن قالدۇرۇش + ئەمەلدىن قالدۇرۇش Add new user 添加新用户 - User group - ئابونتلار توپى + ئابونتلار توپى - Add user group - ئابونتلار گۇرۇپپىسى قوشۇش + ئابونتلار گۇرۇپپىسى قوشۇش - - Tips - ئەسكەرتىش + ئەسكەرتىش - Invalid Id! - ئىناۋەتسىز كىملىك! + ئىناۋەتسىز كىملىك! - - OK - ماقۇل + ماقۇل - Invalid Group Name! - ئىناۋەتسىز توپ نامى! + ئىناۋەتسىز توپ نامى! @@ -1763,107 +1912,107 @@ Please authenticate yourself to continue تېلېفون ئالماشتۇرۇش - + Phone number تېلېفۇن نۇمۇرى - + SMS verification code SMS دەلىللەش كودى - + Please input old phone number كونا تېلېفون نومۇرىنى كىرگۈزۈڭ - + Next كېيىنكى - - + + Please enter new mobile number يېڭى يانفون نومۇرىنى كىرگۈزۈڭ - - + + Submit تاپشۇرماق - + changed success مۇۋەپپىقىيەتنى ئۆزگەرتتى - - + + You have successfully modified your phone يانفونىڭىزنى مۇۋەپپەقىيەتلىك ئۆزگەرتتىڭىز - - + + Recapture قايتا تۇتۇلۇش - - - + + + Network connection failure, please check تور ئۇلاشتا كاشىلا كۆرۈلسە، تەكشۈرۈپ كۆرۈڭ - - + + GetCode GetCode - - - + + + Phone is lock,try again in an hour تېلېفون قۇلۇپلۇق، بىر سائەتتىن كېيىن قايتا سىناپ بېقىڭ - - - + + + Phone code is wrong تېلېفون نومۇرى خاتا - + Current login expired,using wechat code! نۆۋەتتىكى كىرىش ۋاقتى ئۆتۈپ كەتتى،ئۈندىدار كودى ئارقىلىق! - - - + + + Unknown error, please try again later نامەلۇم خاتالىق، سەل تۇرۇپ قايتا سىناپ بېقىڭ - + Phone can not same تېلېفون بىلەن ئوخشاش بولمايدۇ - - + + finished تۈگىدى - - + + Phone number already in used! تېلېفون نومۇرى بۇرۇن ئىشلىتىلىپ بولغان! @@ -2166,7 +2315,7 @@ Please authenticate yourself to continue ChangeUserLogo - + System Logos سىستېما Logos @@ -2175,58 +2324,58 @@ Please authenticate yourself to continue 本地头像 - + User logo ئىشلەتكۈچى logoى - + Select Local Logo يەرلىك تۇغنى تاللاش - - + + Cancel ئەمەلدىن قالدۇرۇش - + Confirm جەزىملەشتۈرۈش - + select custom face file خاس يۈز ھۆججىتىنى تاللاش - + Select تاللاش - + Position: ئورنى: - + FileName: ھۆججەت نامى: - + FileType: FileType: - + Warning دىققەت - + The avatar is larger than 1M, please choose again باش سۈرەت 1M دىن چوڭ، قايتا تاللاڭ @@ -2275,17 +2424,17 @@ Please authenticate yourself to continue ئىشلەتكۈچى نامى - + NickName تەخەللۇسلار - + nickName already in use. تور نامى ئىشلىتىلىپ بولغان. - + The length must be 1~%1 characters! ئۇزۇنلۇقى چوقۇم 1 ~٪ 1 ھەرپ بولۇشى كېرەك! @@ -2302,12 +2451,12 @@ Please authenticate yourself to continue 计算机名 - + Cancel ئەمەلدىن قالدۇرۇش - + Confirm جەزىملەشتۈرۈش @@ -2315,71 +2464,83 @@ Please authenticate yourself to continue ChangeUserPwd - + Change password پارولنى ئۆزگەرتىش - - - + + + Current Pwd نۆۋەتتىكى Pwd - - - - + + + + New Pwd يېڭى پ ك ك - - - - + + + + Sure Pwd ئەلۋەتتە Pwd - + Cancel ئەمەلدىن قالدۇرۇش - + + + Confirm جەزىملەشتۈرۈش - - + + Inconsistency with pwd pwd بىلەن ماس كەلمەسلىك - + + Same with old pwd + 与旧密码相同 + + + + Pwd Changed Succes + + + + Authentication failed, input authtok again! دەلىللەش مەغلۇپ بولدى، authtok نى قايتا كىرگۈزۈڭ! - + Contains illegal characters! قانۇنسىز شەخسلەرنى ئۆز ئىچىگە ئالىدۇ! - + current pwd cannot be empty! نۆۋەتتىكى pwd نى بىكار قىلغىلى بولمايدۇ! - + new pwd cannot be empty! يېڭى pwd قۇرۇق بولالمايدۇ! - + sure pwd cannot be empty! pwd چوقۇم قۇرۇق بولمايدۇ! @@ -2387,47 +2548,47 @@ Please authenticate yourself to continue ChangeUserType - + UserType UserType - + administrator باشقۇرغۇچى - + standard user ئۆلچەملىك ئىشلەتكۈچى - + Select account type (Ensure have admin on system): ھېسابات تۈرىنى تاللاڭ (سىستېمىدا admin بولۇشىغا كاپالەتلىك قىلىش): - + change system settings, install and upgrade software. سىستېما تەڭشەكلىرىنى ئۆزگەرتىش، قاچىلاش ۋە يېڭىلاش دېتالى. - + use most software, cannot change system settings. كۆپ قىسىم يۇمشاق دېتاللارنى ئىشلىتىدۇ، سىستېما تەڭشەكلىرىنى ئۆزگەرتەلمەيدۇ. - + Note: Effective After Logout!!! ئەسكەرتىش: چېكىنگەندىن كېيىن ئۈنۈملۈك!!! - + Confirm جەزىملەشتۈرۈش - + Cancel ئەمەلدىن قالدۇرۇش @@ -2583,29 +2744,32 @@ Please authenticate yourself to continue CreateGroupDialog - Dialog - دىئالوگ + دىئالوگ - + Add New Group يېڭى گۇرۇپپا قوشۇش - + Name ئىسىم-فامىلىسى - + Id كىملىك - + + Confirm + + + Members - ئەزالار + ئەزالار Group Name @@ -2620,17 +2784,16 @@ Please authenticate yourself to continue 组成员 - + Cancel ئەمەلدىن قالدۇرۇش - Certain - چۇقۇم + چۇقۇم - + Add user group ئابونتلار گۇرۇپپىسى قوشۇش @@ -3023,38 +3186,38 @@ change system settings - + Inconsistency with pwd pwd بىلەن ماس كەلمەسلىك - - + + The nick name cannot be empty تەخەللۇس نامىنى بوش قويۇشقا بولمايدۇ - + nickName already in use. تور نامى ئىشلىتىلىپ بولغان. - + nickName length must less than %1 letters! تور نامىنىڭ ئۇزۇنلۇقى چوقۇم ٪1 ھەرپتىن ئاز بولۇشى كېرەك! - + Username's length must be between 1 and %1 characters! ئىشلەتكۈچى نامىنىڭ ئۇزۇنلۇقى چوقۇم ٪1 بىلەن ٪1 ھەرپ ئارىلىقىدا بولۇشى كېرەك! - + new pwd cannot be empty! يېڭى pwd قۇرۇق بولالمايدۇ! - + sure pwd cannot be empty! pwd چوقۇم قۇرۇق بولمايدۇ! @@ -3083,7 +3246,7 @@ change system settings 该用户名已存在,请更改。 - + Name corresponds to group already exists. ئىسىم ئاللىقاچان مەۋجۇت بولۇپ بولغان توپقا ماس كېلىدىغان . @@ -3096,16 +3259,24 @@ change system settings 用户名仅能包含字母,数字及下划线 - + Username's folder exists, change another one ئىشلەتكۈچى نامىنىڭ ھۆججەت قىسقۇچى مەۋجۇت، باشقا بىرسىنى ئالماشتۇر - + Contains illegal characters! قانۇنسىز شەخسلەرنى ئۆز ئىچىگە ئالىدۇ! + + CustomGlobalTheme + + + custom + + + CustomLineEdit @@ -3182,32 +3353,25 @@ change system settings نۆۋەتتىكى چېسلا - - + Change timezone ۋاقىت رايونىنى ئۆزگەرتىش /Date/Change time zone - - TextLabel - TextLabel + TextLabel - - RadioButton - RadioButton + RadioButton - - : - : + : - + titleLabel titleLabel @@ -3252,18 +3416,24 @@ change system settings 时间日期 - + Date چېسلا - + + Current Date + + /Date/Current Date + + + Other Timezone باشقا ۋاقىت رايونى /Date/Other Timezone - + 24-hour clock 24 سائەتلىك سائەت /Date/24-hour clock @@ -3281,13 +3451,13 @@ change system settings 添加时区,最多添加5个 - + Sync Server ماس قەدەمدە مۇلازىمىتېر /Date/Sync Server - + Add Timezone ۋاقىت رايونى قوشۇش @@ -3296,13 +3466,13 @@ change system settings 删除 - + Manual Time قوللانما ۋاقتى /Date/Manual Time - + Sync Time ماس قەدەم ۋاقتى /Date/Sync Time @@ -3322,55 +3492,55 @@ change system settings /Date/Network - + Set Time بەلگىلەنگەن ۋاقىت /Date/Set Time - + Set Date Manually ۋاقتىنى قولدا بەلگىلەش /Date/Set Date Manually - + Default كۆڭۈلدىكى سۆز - + Customize خاسلاشتۇرۇش - + Server Address مۇلازىمىتېر ئادرېسى - + Required تەلەپ قىلىنىدۇ - + Save ساقلاش - + Change Timezone ۋاقىت رايونىنى ئۆزگەرتىش - + - - + + Sync failed ماس قەدەمدە مەغلۇپ بولدى @@ -3387,7 +3557,7 @@ change system settings 同步网络时间 - + change time ئۆزگەرتىش ۋاقتى @@ -3403,56 +3573,65 @@ change system settings 默认应用 - + Default App كۆڭۈلدىكى ئەپ - + No program available پروگرامما يوق - + + Choose default app + + + + + Reset default apps to system recommended apps + + + + + Reset + + + + Browser تور كۆرگۈچ - /Defaultapp/Browser - + Mail پوچتا يوللانمىسى - /Defaultapp/Mail - + Image Viewer رەسىم كۆرگۈ - /Defaultapp/Image Viewer - + Audio Player ئۈن قويغۇچ - /Defaultapp/Audio Player - + Video Player سىن قويغۇچ - /Defaultapp/Video Player - + Text Editor تېكىست تەھرىرلىگۈچ - /Defaultapp/Text Editor DefaultAppWindow - + Select Default Application كۆڭۈلدىكى ئىلتىماسنى تاللاڭ @@ -3488,14 +3667,12 @@ change system settings DefineGroupItem - Edit - تەھرىرلەش + تەھرىرلەش - Del - Del + Del Delete @@ -3526,9 +3703,8 @@ change system settings DelGroupDialog - Dialog - دىئالوگ + دىئالوگ Are you sure to delete this group, @@ -3537,25 +3713,20 @@ in the file system invalid! 确定删除此用户组? 这将使得文件系统\n中的某些文件组件ID无效! - Are you sure to delete the group: - توپنى چوقۇم ئۆچۈرەمسىز: + توپنى چوقۇم ئۆچۈرەمسىز: - - which will make some file components in the file system invalid! - بۇ ھۆججەت سىستېمىسىدىكى بەزى ھۆججەت دېتاللىرىنى ئىناۋەتسىز قىلىدۇ! + بۇ ھۆججەت سىستېمىسىدىكى بەزى ھۆججەت دېتاللىرىنى ئىناۋەتسىز قىلىدۇ! - Delete - ئۆچۈر + ئۆچۈر - Cancel - ئەمەلدىن قالدۇرۇش + ئەمەلدىن قالدۇرۇش RemoveFile @@ -3573,9 +3744,8 @@ in the file system invalid! 中的某些文件组件ID无效! - Delete user group - ئىشلەتكۈچى توپىنى ئۆچۈرۈش + ئىشلەتكۈچى توپىنى ئۆچۈرۈش Are you sure to delete the group, which will make some file components in the file system invalid! @@ -3669,7 +3839,7 @@ folder will be deleted! ئەمەلدىن قالدۇرۇش - + Delete the user, belonging to the user's desktop documents, favorites, music, pictures and video folder will be deleted! ئابونتنى ئۆچۈرۈپ تاشلاڭ، ئىشلەتكۈچىنىڭ ئۈستەلئۈستى ھۆججەتلىرىگە تەۋە، ياخشى كۆرىدىغانلار، مۇزىكا، رەسىم ۋە سىن ھۆججەت قىسقۇچى ئۆچۈرۈلىدۇ! @@ -3677,17 +3847,17 @@ folder will be deleted! DeleteUserExists - + Delete user ' ئىشلەتكۈچىنى ئۆچۈرۈش ' - + '? And: '? يەنە: - + Keep desktop, files, favorites, music of the user ئۈستەل يۈزى، ھۆججەت، ئامراقلار، ئابونتلارنىڭ مۇزىكىسىنى ساقلاش @@ -3696,17 +3866,17 @@ folder will be deleted! 保留用户家目录 - + Cancel ئەمەلدىن قالدۇرۇش - + Confirm جەزىملەشتۈرۈش - + Delete whole data belong user پۈتۈن سانلىق مەلۇماتنى ئۆچۈرۈش ئىشلەتكۈچىگە تەۋە @@ -4189,7 +4359,12 @@ folder will be deleted! 显示器 - + + Screen + + + + Display كۆرسىتىش @@ -4198,7 +4373,6 @@ folder will be deleted! DisplayWindow - monitor كۆزەتكۈچى @@ -4216,7 +4390,6 @@ folder will be deleted! 统一输出 - open monitor ئوچۇق كۆزەتكۈچ @@ -4234,13 +4407,11 @@ folder will be deleted! كۆرسىتىش - as main ئاساسلىقى - screen zoom ئېكراننى چوڭايت @@ -4263,43 +4434,36 @@ folder will be deleted! - follow the sunrise and sunset(17:55-05:04) كۈن چىقىش ۋە كۈن پېتىشقا ئەگىشىپ مېڭىش (17:55-05:04) - custom time ئۆرپ- ئادەت ۋاقتى - opening time ئېچىلىش ۋاقتى - closing time يېپىلىش ۋاقتى - color temperature رەڭ تېمپېراتۇرىسى - warm ئىللىقلىق - cold سوغۇق @@ -4317,59 +4481,48 @@ folder will be deleted! EditGroupDialog - Dialog - دىئالوگ + دىئالوگ - Cancel - ئەمەلدىن قالدۇرۇش + ئەمەلدىن قالدۇرۇش - Certain - چۇقۇم + چۇقۇم - Edit User Group - ئىشلەتكۈچىلەر گۇرۇپپىسىنى تەھرىرلەش + ئىشلەتكۈچىلەر گۇرۇپپىسىنى تەھرىرلەش - Name - ئىسىم-فامىلىسى + ئىسىم-فامىلىسى - Id - كىملىك + كىملىك - Members - ئەزالار + ئەزالار - Tips - ئەسكەرتىش + ئەسكەرتىش - Invalid Id! - ئىناۋەتسىز كىملىك! + ئىناۋەتسىز كىملىك! - OK - ماقۇل + ماقۇل - Edit user group - ئىشلەتكۈچى گۇرۇپپىسىنى تەھرىرلەش + ئىشلەتكۈچى گۇرۇپپىسىنى تەھرىرلەش @@ -4651,6 +4804,16 @@ folder will be deleted! Thanks For Using The ukcc 欢迎使用设置 + + + Small + + + + + Large + + FrameItem @@ -4747,17 +4910,17 @@ folder will be deleted! HostName - + Must be 1-64 characters long چوقۇم ئۇزۇنلۇقى 1-64 ھەرپ - + Cancel ئەمەلدىن قالدۇرۇش - + Confirm جەزىملەشتۈرۈش @@ -5137,15 +5300,14 @@ folder will be deleted! 键盘 - Keyboard - كۇنۇپكا تاختىسى + كۇنۇپكا تاختىسى KeyboardMain - + Key board settings ئاچقۇچلۇق تاختا تەڭشەكلىرى @@ -5154,57 +5316,62 @@ folder will be deleted! 输入法设置 - + + Keyboard + + + + Input settings كىرگۈزۈش تەڭشەكلىرى /Keyboard/Input settings - + Key repeat ئاچقۇچ تەكرارلاش /Keyboard/Key repeat - + Delay كېچىكتۈرۈش /Keyboard/Delay - + Short قىسقا - + Long ئۇزۇن - + Speed سۈرئەت /Keyboard/Speed - + Slow ئاستا - + Fast روزا - + Input test كىرگۈزۈش سىنىقى /Keyboard/Input test - + Key tips ئاچقۇچلۇق ئەسكەرتىش /Keyboard/Key tips @@ -5229,6 +5396,19 @@ folder will be deleted! 布局预览 + + LanguageFrame + + + Input Settings + 输入法设置 + + + + Delete + + + LayoutManager @@ -5650,7 +5830,7 @@ Please retry or relogin! - + Cloud ID desktop message @@ -5700,7 +5880,7 @@ Please retry or relogin! MainWindow - + Search ئىزدە @@ -5709,19 +5889,20 @@ Please retry or relogin! 设置 - - - + + + + Settings تەڭشەكلەر - + Main menu ئاساسلىق تىزىملىك - + Minimize كىچىكلىتىش @@ -5730,47 +5911,52 @@ Please retry or relogin! 最大化/正常 - + Normal نورمال - - + + Maximize ئەڭ چوڭ چەككە - + Close ياپ - + Help ياردەم - + About ھەققىدە - + Exit چىقىش ئېغىزى + + + Specified + + ukcc 控制面板 - + Warning دىققەت - + This function has been controlled بۇ فۇنكسىيە كونترول قىلىندى @@ -6062,9 +6248,8 @@ Please retry or relogin! 鼠标 - Mouse - مائۇس + مائۇس Lefthand @@ -6090,119 +6275,136 @@ Please retry or relogin! MouseUI - + + Mouse مائۇس - + Pointer كۆرسەتكۈچى - + Cursor بۈگۈر - + Dominant hand ھۆكۈمرانلىق قول /Mouse/Dominant hand - + Left hand سول قول - + Right hand ئوڭ قول - + + Scroll direction + + /Mouse/Scroll direction + + + + Forward + + + + + Reverse + + + + Wheel speed چاق سۈرئىتى /Mouse/Wheel speed - - - + + + + Slow ئاستا - - - + + + + Fast روزا - + Double-click interval time قوش چېكىلىش ئارىلىقىدىكى ۋاقىت /Mouse/Double-click interval time - Short - قىسقا + قىسقا - Long - ئۇزۇن + ئۇزۇن - + Pointer speed نۇقتا تېزلىكى /Mouse/Pointer speed - + Mouse acceleration مائۇس تىزلەتمىسى /Mouse/Mouse acceleration - + Show pointer position when pressing ctrl ctrl باسقاندا كۆرسەتكۈچى ئورنىنى كۆرسىتىش /Mouse/Show pointer position when pressing ctrl - + Pointer size نۇقتا چوڭلۇقى /Mouse/Pointer size - + Small(recommend) كىچىك(تەۋسىيە) - + Medium ئوتتۇراھال - + Large چوڭ - + Blinking cursor in text area تېكىست رايونىدا كۆزنى يۇمۇپ ئاچقۇچە كەرە /Mouse/Blinking cursor in text area - + Cursor speed ئىملا تېزلىكى /Mouse/Cursor speed @@ -6211,7 +6413,7 @@ Please retry or relogin! MyLabel - + double-click to test قوش چېكىپ سىناش @@ -6393,7 +6595,42 @@ Please retry or relogin! Notice - + + NotFaze Mode + + + + + (Notification banners, prompts will be hidden, and notification sounds will be muted) + + + + + Automatically turn on + + + + + to + تو + + + + Automatically turn on when multiple screens are connected + + + + + Automatically open in full screen mode + + + + + Allow automatic alarm reminders in Do Not Disturb mode + + + + Notice Settings ئۇقتۇرۇش تەڭشەكلىرى @@ -6410,10 +6647,9 @@ Please retry or relogin! 系统版本更新后显示新增内容 - + Get notifications from the app ئەپتىن ئۇقتۇرۇش ئېلىش - /notice/Get notifications from the app Show notifications on the lock screen @@ -6428,11 +6664,49 @@ Please retry or relogin! 通知 - + Notice ئۇقتۇرۇش + + NoticeMenu + + + Beep sound when notified + + + + + Show message on screenlock + + + + + Show noticfication on screenlock + + + + + Notification Style + + + + + Banner: Appears in the upper right corner of the screen, and disappears automatically + + + + + Tip:It will be kept on the screen until it is closed + + + + + None:Notifications will not be displayed on the screen, but will go to the notification center + + + NumbersButtonIntel @@ -6444,32 +6718,32 @@ Please retry or relogin! OutputConfig - + resolution ئېنىقلىما /Display/resolution - + orientation يۆلىنىش /Display/orientation - + arrow-up ئوقيا ئېتىش - + 90° arrow-right 90° ئوقيا ئوڭ - + arrow-down ئوقيا ئېتىش @@ -6483,13 +6757,19 @@ Please retry or relogin! 部分程序需要注销生效 - + 90° arrow-left 90° ئوقيا سول - + + auto rotation + + /Display/auto rotation + + + frequency چاستوتىسى @@ -6500,18 +6780,18 @@ Please retry or relogin! 刷新率 - + auto ئاپتو - + screen zoom ئېكراننى چوڭايت /Display/screen zoom - + @@ -6574,7 +6854,7 @@ Please retry or relogin! - + GetCode GetCode @@ -6593,56 +6873,56 @@ Please retry or relogin! ئىش قىلىش - + confirm جەزىملەشتۈرۈش - + commit ئىش قىلىش - + Mobile number acquisition failed كۆچمە نومۇر ئېلىش مەغلۇپ بولدى - - + + Recapture قايتا تۇتۇلۇش - - - - + + + + Network connection failure, please check تور ئۇلاشتا كاشىلا كۆرۈلسە، تەكشۈرۈپ كۆرۈڭ - + Phone is lock,try again in an hour تېلېفون قۇلۇپلۇق، بىر سائەتتىن كېيىن قايتا سىناپ بېقىڭ - + Phone code is wrong تېلېفون نومۇرى خاتا - + Current login expired,using wechat code! نۆۋەتتىكى كىرىش ۋاقتى ئۆتۈپ كەتتى،ئۈندىدار كودى ئارقىلىق! - + Unknown error, please try again later نامەلۇم خاتالىق، سەل تۇرۇپ قايتا سىناپ بېقىڭ - + Please use the correct wechat scan code توغرا ئۈندىداردىكى سىكاننىرلاش كودىنى ئىشلىتىڭ @@ -6654,16 +6934,12 @@ Please retry or relogin! 电源计划 - - Balance (suggest) - تەڭپۇڭلۇق (تەۋسىيە) + تەڭپۇڭلۇق (تەۋسىيە) - - Saving - ساقلاۋاتىدۇ + ساقلاۋاتىدۇ Minimize performance @@ -6675,20 +6951,16 @@ Please retry or relogin! - - Autobalance energy and performance with available hardware - ئىشلىتىشكە بولىدىغان قاتتىق دېتال ئارقىلىق ئاپتوماتىك تەڭپۇڭلۇق ئېنېرگىيەسى ۋە ئىقتىدارى + ئىشلىتىشكە بولىدىغان قاتتىق دېتال ئارقىلىق ئاپتوماتىك تەڭپۇڭلۇق ئېنېرگىيەسى ۋە ئىقتىدارى Custom 自定义 - - Users develop personalized power plans - ئابونتلار شەخسىي ھوقۇق پىلانى تۈزۈپ چىقىش + ئابونتلار شەخسىي ھوقۇق پىلانى تۈزۈپ چىقىش Power supply @@ -6743,9 +7015,8 @@ Please retry or relogin! 电源 - Power - ھوقۇق + ھوقۇق Change PC sleep time after %1 min: @@ -6764,11 +7035,8 @@ Please retry or relogin! 系统%1分钟后进入空闲状态并于%2分钟后关闭显示器: - - - never - مەڭگۈ + مەڭگۈ 10 min @@ -6803,230 +7071,163 @@ Please retry or relogin! 5分钟 - - Require password when sleep/hibernation - ئۇيقۇ/ئۇيقۇ ھالىتىدە مەخپىي نومۇر تەلەپ قىلىش + ئۇيقۇ/ئۇيقۇ ھالىتىدە مەخپىي نومۇر تەلەپ قىلىش - - Password required when waking up the screen - ئېكراننى ئويغىتىشتا زۆرۈر بولغان پارول + ئېكراننى ئويغىتىشتا زۆرۈر بولغان پارول - Press the power button - توك كۇنۇپكىسىنى بېسىش + توك كۇنۇپكىسىنى بېسىش - - Time to close display - كۆرسىتىشنى تاقاش ۋاقتى + كۆرسىتىشنى تاقاش ۋاقتى - - Time to sleep - ئۇخلاش ۋاقتى + ئۇخلاش ۋاقتى - - Notebook cover - خاتىرە كومپىيۇتېر مۇقاۋىسى + خاتىرە كومپىيۇتېر مۇقاۋىسى - - - Using power - توك ئىشلىتىش + توك ئىشلىتىش - Using battery - باتارېيە ئىشلىتىش + باتارېيە ئىشلىتىش - - Time to darken - قاراڭغۇلۇققا پاتىدىغان ۋاقىت + قاراڭغۇلۇققا پاتىدىغان ۋاقىت - - Battery level is lower than - باتارېيە دەرىجىسى ئۇنىڭدىن تۆۋەن + باتارېيە دەرىجىسى ئۇنىڭدىن تۆۋەن - Run - يۈگۈرۈش + يۈگۈرۈش - - Low battery notification - باتارېيە مىقدارى تۆۋەن بولۇش ئۇقتۇرۇشى + باتارېيە مىقدارى تۆۋەن بولۇش ئۇقتۇرۇشى - Automatically run saving mode when low battery - باتارېيە ئاز بولغاندا تېجەش ھالىتىنى ئاپتوماتىك ئىجرا قىلىش + باتارېيە ئاز بولغاندا تېجەش ھالىتىنى ئاپتوماتىك ئىجرا قىلىش - Automatically run saving mode when the low battery - باتارىيە تۆۋەن بولغاندا تىجەش ھالىتىنى ئاپتوماتىك ئىجرا قىلىش + باتارىيە تۆۋەن بولغاندا تىجەش ھالىتىنى ئاپتوماتىك ئىجرا قىلىش - - Automatically run saving mode when using battery - باتارىيە ئىشلەتكەندە تېجەش ھالىتىنى ئاپتوماتىك ئىجرا قىلىش + باتارىيە ئىشلەتكەندە تېجەش ھالىتىنى ئاپتوماتىك ئىجرا قىلىش - - Display remaining charging time and usage time - ئېشىپ قالغان توك قاچىلاش ۋاقتى ۋە ئىشلىتىش ۋاقتىنى كۆرسىتىش + ئېشىپ قالغان توك قاچىلاش ۋاقتى ۋە ئىشلىتىش ۋاقتىنى كۆرسىتىش - General - ارينا + ارينا /Power/General - Select Powerplan - Powerplan تاللاش + Powerplan تاللاش /Power/Select Powerplan - Battery saving plan - باتارېيە تېجەش پىلانى + باتارېيە تېجەش پىلانى /Power/Battery saving plan - - nothing - ھېچنېمە + ھېچنېمە - - blank - قۇرۇق + قۇرۇق - - - suspend - توختىتىپ قويۇش + توختىتىپ قويۇش - - - hibernate - hibernate + hibernate - interactive - ئۆز ئارا تەسىرلىشىش + ئۆز ئارا تەسىرلىشىش - - 5min - 5min + 5min - - Performance Model - ئىقتىدار ئۈلگىسى + ئىقتىدار ئۈلگىسى - 20min - 20min + 20min 10minn 10分钟 - - 15min - 15min + 15min - - 30min - 30min + 30min - - 1h - + - - 2h - + - - - 10min - 10min + 10min - 3h - + - - Balance Model - تەڭپۇڭلۇق مودېلى + تەڭپۇڭلۇق مودېلى - - Save Model - مودېلنى ساقلاش + مودېلنى ساقلاش - 1min - 1min + 1min 3min 3分钟 - - - shutdown - تاقاش + تاقاش always @@ -7080,19 +7281,22 @@ Please retry or relogin! 打印机 - + Printer پرىنتېرلاش - - Printers And Scanners - پرىنتېرلاش ۋە سىكاننېرلاش + + Printers + + + + Printers And Scanners + پرىنتېرلاش ۋە سىكاننېرلاش - Add - قوش + قوش /Printer/Add @@ -8092,9 +8296,8 @@ E-mail: support@kylinos.cn 开启自动代理 - Auto url - ئاپتوماتىك تور ئادرېسى + ئاپتوماتىك تور ئادرېسى /Proxy/Auto url @@ -8107,50 +8310,40 @@ E-mail: support@kylinos.cn 开启手动代理 - Http Proxy - Http Proxy + Http Proxy /Proxy/Http Proxy - - - - Port - پورت + پورت Cetification 认证 - System Proxy - سىستېما Proxy + سىستېما Proxy - Https Proxy - Https Proxy + Https Proxy /Proxy/Https Proxy - Ftp Proxy - Ftp Proxy + Ftp Proxy /Proxy/Ftp Proxy - Socks Proxy - پايپاق Proxy + پايپاق Proxy /Proxy/Socks Proxy - List of ignored hosts. more than one entry, please separate with english semicolon(;) - سەل قارالغان رىياسەتچىلەر تىزىملىكى بىردىن ئارتۇق كىرگۈزۈڭ، ئىنگىلىزچە يېرىمكول (;) + سەل قارالغان رىياسەتچىلەر تىزىملىكى بىردىن ئارتۇق كىرگۈزۈڭ، ئىنگىلىزچە يېرىمكول (;) Enable Authentication @@ -8165,81 +8358,65 @@ E-mail: support@kylinos.cn 密码 - Apt Proxy - Apt Proxy + Apt Proxy /Proxy/Apt Proxy - Open - ئېچىش + ئېچىش - Server Address : - مۇلازىمىتېر ئادرېسى : + مۇلازىمىتېر ئادرېسى : - Port : - پورتى : + پورتى : - Edit - تەھرىرلەش + تەھرىرلەش - The apt proxy has been turned off and needs to be restarted to take effect - apt proxy نى ئېتىۋەتتى، كۈچكە ئىگە بولۇش ئۈچۈن قايتا قوزغىتىش كېرەك + apt proxy نى ئېتىۋەتتى، كۈچكە ئىگە بولۇش ئۈچۈن قايتا قوزغىتىش كېرەك - The system needs to be restarted to set the Apt proxy, whether to reboot - Apt proxy نى بەلگىلەش ئۈچۈن سىستېمىنى قايتا قوزغىتىش كېرەك، قايتا قوزغىتىش كېرەكمۇ يوق + Apt proxy نى بەلگىلەش ئۈچۈن سىستېمىنى قايتا قوزغىتىش كېرەك، قايتا قوزغىتىش كېرەكمۇ يوق - - Reboot Now - ھازىر قايتا قوزغىتىڭ + ھازىر قايتا قوزغىتىڭ - Start using - ئىشلىتىشنى باشلاڭ + ئىشلىتىشنى باشلاڭ - Proxy mode - Proxy ھالىتى + Proxy ھالىتى - Auto - ئاپتۇماتىك + ئاپتۇماتىك - Manual - قوللانما + قوللانما - - Reboot Later - كېيىن قايتا قوزغىتىڭ + كېيىن قايتا قوزغىتىڭ proxy 代理 - Proxy - Proxy + Proxy @@ -8443,7 +8620,7 @@ E-mail: support@kylinos.cn قىسقا يولنى تەڭشەش - + Edit Shortcut قىسقارتىلما يولنى تەھرىرلەش @@ -8573,7 +8750,7 @@ E-mail: support@kylinos.cn 远程桌面 - + User Info ئىشلەتكۈچى ئۇچۇرى @@ -8822,12 +8999,17 @@ E-mail: support@kylinos.cn كۈن - + + ukui-control-center is disabled! + + + + ukui-control-center ئۇكۇي-كونترول-مەركىزى - + ukui-control-center is already running! ئۇكۇي كونتىرول قىلىش مەركىزى ئاللىقاچان يۈگرەيدۇ! @@ -8968,72 +9150,72 @@ E-mail: support@kylinos.cn 连接失败,尝试重新连接 - - + + min length %1 min ئۇزۇنلۇقى ٪1 - - + + min digit num %1 مىڭ خانىلىق num ٪1 - - + + min upper num %1 min ئۈستۈنكى num ٪1 - - + + min lower num %1 min تۆۋەن num ٪1 - - + + min other num %1 min باشقا num ٪1 - - + + min char class %1 min char سىنىپى ٪1 - - + + max repeat %1 max قايتا تەكرارلاش ٪1 - - + + max class repeat %1 ئەڭ چوڭ دەرىس تەكرارلاش ٪1 - - + + max sequence %1 ئەڭ چوڭ تەرتىپ ٪1 @@ -9053,10 +9235,14 @@ E-mail: support@kylinos.cn xxx兏兏兏端 - + Programs are not allowed to be added. پروگراممىلارنىڭ قوشۇلۇشىغا يول قويۇلمايدۇ. + + English + English + RegDialog @@ -9109,55 +9295,63 @@ E-mail: support@kylinos.cn Screenlock - + Screenlock ئېكران قۇلۇپى + Screenlock Interface ئېكران قۇلۇپى ئارايۈز + /Screenlock/Screenlock Interface - - + Show message on lock screen قۇلۇپ ئېكرانىدا ئۇچۇر كۆرسىتىش - - + + Browse كۆرۈش /Screenlock/Browse - - + + Online Picture توردا رەسىم /Screenlock/Online Picture - - + + Reset To Default سۈكۈتكە قايتاي /Screenlock/Reset To Default + + + Related Settings + + + + TextLabel + TextLabel + Screenlock Set 锁屏设置 - - Lock screen when screensaver boot - ئېكراننى كۆزنەك تاقاشتا ئېكراننى قۇلۇپلاش + ئېكراننى كۆزنەك تاقاشتا ئېكراننى قۇلۇپلاش /Screenlock/Lock screen when screensaver boot - + Lock screen delay قۇلۇپ ئېكرانى كېچىكتۈرۈش @@ -9178,8 +9372,7 @@ E-mail: support@kylinos.cn 浏览本地壁纸 - - + Show picture of screenlock on screenlogin screenlogin دا ئېكران قۇلۇپىنىڭ سۈرىتىنى كۆرسىتىش پروگراممىسى /Screenlock/Show picture of screenlock on screenlogin @@ -9201,56 +9394,48 @@ E-mail: support@kylinos.cn 图片 - + Never مەڭگۈ - 1m - + - 5m - + - 10m - 10م + 10م - 30m - 30م + 30م - 45m - 45م + 45م - 1h - + 1.5h 1.5h - 3h - + - 2h - + - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) تام قەغىزى ھۆججەتلىرى(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -9259,53 +9444,108 @@ E-mail: support@kylinos.cn 所有文件(*.*) - + + 1min + 1min + + + + 5min + 5min + + + + 10min + 10min + + + + 30min + 30min + + + + 45min + 1min {45m?} + + + + 1hour + 1ھۇدا + + + + 2hour + 1ھۇدا {2h?} + + + + 3hour + 1ھۇدا {3h?} + + + select custom wallpaper file خاس تام قەغىزى ھۆججىتىنى تاللاش - + Select تاللاش - + Position: ئورنى: - + FileName: ھۆججەت نامى: - + FileType: FileType: - + Cancel ئەمەلدىن قالدۇرۇش + + + Monitor Off + + + + + Screensaver + + + + + + Set + + Screensaver - + Screensaver ئېكران كۆرگەزمىچى - - + Idle time بىكار ۋاقتى /Screensaver/Idle time - + Lock screen when activating screensaver ئېكران ئېكرانىنى قوزغىتىپ تۇرغاندا ئېكراننى قۇلۇپلاش @@ -9314,8 +9554,7 @@ E-mail: support@kylinos.cn 开启屏保 - - + Screensaver program ئېكران ئېكرانى پروگراممىسى /Screensaver/Screensaver program @@ -9329,8 +9568,9 @@ E-mail: support@kylinos.cn 分钟 + Lock screen when screensaver boot - 激活屏保时锁定屏幕 + 激活屏保时锁定屏幕 screensaver @@ -9341,121 +9581,121 @@ E-mail: support@kylinos.cn 默认屏保 - + View كۆرۈش - + Text(up to 30 characters): تېكىست(ئەڭ كۆپ بولغاندا 30 ھەرپ): - + Show rest time ئارام ئېلىش ۋاقتىنى كۆرسىتىش - + UKUI UKUI - + Blank_Only Blank_Only - + Customize خاسلاشتۇرۇش - - + + 5min 5min - - + + 10min 10min - + 15min 15min - - + + 30min 30min - + 1hour 1ھۇدا - + Screensaver source ئېكران يۈزى مەنبەسى - - + + Select تاللاش - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) تام قەغىزى ھۆججەتلىرى(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) - + select custom screensaver dir خاس ئېكران كۆرگۈچ dir نى تاللاش - + Position: ئورنى: - + FileName: ھۆججەت نامى: - + FileType: FileType: - + Cancel ئەمەلدىن قالدۇرۇش - + Switching time ئالماشتۇرۇش ۋاقتى - + 1min 1min - + Ordinal ئوردىدا - + Random switching خالىغانچە ئالماشتۇرۇش @@ -9468,17 +9708,17 @@ E-mail: support@kylinos.cn 输入文本,最多30个字符 - + Text position تېكىست ئورنى - + Centered مەركەز قىلىنغان - + Randow(Bubble text) رانۋېر (كۆپۈكچە تېكىست) @@ -9515,12 +9755,12 @@ E-mail: support@kylinos.cn 3h - + Random ئىختىيارىي - + Never مەڭگۈ @@ -9634,6 +9874,14 @@ E-mail: support@kylinos.cn Touchpad 触控板 + + + + + + No search results + + SecurityCenter @@ -9839,19 +10087,18 @@ E-mail: support@kylinos.cn 确认退出程序! - + Remote Desktop يىراق ئۈستەلئۈستى - + Allow others to view your desktop باشقىلارنىڭ ئۈستەلئۈستىڭىزنى كۆرۈشىگە يول قويۇش - /Vino/Allow others to view your desktop - + Allow connection to control screen ئۇلاش ئارقىلىق ئېكراننى كونتىرول قىلىش /Vino/Allow connection to control screen @@ -9862,13 +10109,13 @@ E-mail: support@kylinos.cn بىخەتەرلىك - + You must confirm every visit for this machine سىز چوقۇم بۇ ماشىنىنىڭ ھەر بىر زىيارەتنى جەزملەشتۈرۈشىڭىز كېرەك. /Vino/You must confirm every visit for this machine - + Require user to enter this password: ئىشلەتكۈچىدىن بۇ مەخپىي شىفىرنى كىرگۈزۈشنى تەلەپ قىلىش: @@ -9895,8 +10142,8 @@ E-mail: support@kylinos.cn Shortcut - - + + System Shortcut سىستېما قىسقارتىش يولى /Shortcut/System Shortcut @@ -9906,12 +10153,12 @@ E-mail: support@kylinos.cn 显示全部快捷键 - + Custom Shortcut ئىختىيارى قىسقا يول - + Customize Shortcut قىسقا يولنى تەڭشەش /Shortcut/Customize Shortcut @@ -9921,23 +10168,23 @@ E-mail: support@kylinos.cn 添加自定义快捷键 - + Add قوش /Shortcut/Add - + Edit تەھرىرلەش - + Delete ئۆچۈر - + or ياكى @@ -9954,7 +10201,7 @@ E-mail: support@kylinos.cn 快捷键 - + Shortcut قىسقا يول @@ -9986,13 +10233,88 @@ E-mail: support@kylinos.cn 桌面 + + SpliceDialog + + + Dialog + + + + TextLabel + TextLabel + + + + Splice Screen + + + + + + Cancel + + + + + + Ok + 确定 + + + + + Splicing Method + + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + + + + + Row %1, Column %2 + + + + + Select screen + + + StatusDialog - + About ھەققىدە + + + Activation Code + + SuccessDiaolog @@ -10407,58 +10729,91 @@ E-mail: support@kylinos.cn /Theme/Theme Mode - + + Theme ئۇسلۇب - Default - كۆڭۈلدىكى سۆز + كۆڭۈلدىكى سۆز - + Light نۇر - + Dark قاراڭغۇلۇق - + + Auto + ئاپتۇماتىك + + + + Corlor + + + + + Other + 其他 + + + + + Set + + + + + Wallpaper + + + + + Beep + + + + Blue-Crystal كۆك كىرىستال - - + + Light-Seeking يورۇقلۇق ئىزدەيمەن - + DMZ-Black DMZ-Black - + DMZ-White DMZ-White - + Dark-Sense زۇلمەتلىك سەزگۈ - + + + basic ئاساسىي - + Classic نادىر ناخشا – فىلىم @@ -10471,63 +10826,98 @@ E-mail: support@kylinos.cn 时尚 - + hp hp - + ukui زۇكۇي - + HeYin خېيىن - + + classic + + + + + daybreakBlue + + + + + jamPurple + + + + + magenta + + + + + sunRed + + + + + sunsetOrange + + + + + dustGold + + + + + polarGreen + + + default - كۆڭۈلدىكىدەك + كۆڭۈلدىكىدەك Middle - - + Window Theme كۆزنەك ئۇسلۇبى /Theme/Window Theme - - + Icon theme سىنبەلگىلىك ئۇسلۇب /Theme/Icon theme - Control theme - ئۇسلۇبنى كونترول قىلىش + ئۇسلۇبنى كونترول قىلىش - - + Cursor theme Cursor ئۇسلۇبى /Theme/Cursor theme - + Effect setting ئۈنۈم تەڭشىكى - - + + Transparency سۈزۈكلۈك /Theme/Transparency @@ -10537,8 +10927,8 @@ E-mail: support@kylinos.cn 透明特效 - - + + Performance mode ئىجرا قىلىش شەكلى /Theme/Performance mode @@ -10556,7 +10946,7 @@ E-mail: support@kylinos.cn - + Reset to default كۆڭۈلدىكى ھالىتىگە قايتاي @@ -10568,27 +10958,27 @@ E-mail: support@kylinos.cn TimeBtn - + Tomorrow ئەتە - + Yesterday تۈنۈگۈن - + Today تارىخ-بۈگۈن - + %1 hours earlier than local يەرلىكتىن ٪1 سائەت بۇرۇن - + %1 hours later than local يەرلىكتىن ٪1 سائەت كېيىن @@ -10610,7 +11000,7 @@ E-mail: support@kylinos.cn 更改时区 - + Search Timezone ئىزدە ۋاقىت رايونى @@ -10619,7 +11009,7 @@ E-mail: support@kylinos.cn 搜索时区 - + To select a time zone, please click where near you on the map and select a city from the nearest city ۋاقىت رايونىنى تاللاش ئۈچۈن خەرىتىدىكى ئۆزىڭىزنىڭ يېنىدىكى يەرنى چېكىپ، ئەڭ يېقىن شەھەردىن شەھەر تاللاڭ @@ -10703,9 +11093,8 @@ E-mail: support@kylinos.cn 触控板 - Touchpad - Touchpad + Touchpad Disable rolling @@ -10739,18 +11128,16 @@ E-mail: support@kylinos.cn TouchpadUI - Touchpad Setting - Touchpad تەڭشىكى + Touchpad تەڭشىكى No touchpad found 未发现触控板设备 - Disable touchpad when using the mouse - مائۇسنى ئىشلەتكەندە Touchpad نى ئىشلىتىشنى بىكار قىلىش + مائۇسنى ئىشلەتكەندە Touchpad نى ئىشلىتىشنى بىكار قىلىش /Touchpad/Disable touchpad when using the mouse @@ -10759,59 +11146,49 @@ E-mail: support@kylinos.cn /Touchpad/Cursor Speed - Slow - ئاستا + ئاستا - Fast - روزا + روزا - Disable touchpad when typing - خەت يازغاندا touchpad نى ئىچىشنى بىكار قىلىش + خەت يازغاندا touchpad نى ئىچىشنى بىكار قىلىش /Touchpad/Disable touchpad when typing - Touch and click on the touchpad - touchpad نى چېكىش ۋە چېكىش + touchpad نى چېكىش ۋە چېكىش /Touchpad/Touch and click on the touchpad - Scroll bar slides with finger - بارماق بىلەن سىيرىلما تاختا سىيرىلما + بارماق بىلەن سىيرىلما تاختا سىيرىلما /Touchpad/Scroll bar slides with finger - Scrolling area - سىيرىلما رايونى + سىيرىلما رايونى /Touchpad/Scrolling area - Disable scrolling - سىيرىلما دىسكىلارنى بىكار قىلىش + سىيرىلما دىسكىلارنى بىكار قىلىش - Edge scrolling - گىرۋىكىگە سىيرىلما + گىرۋىكىگە سىيرىلما - Pointer Speed - نۇقتا تېزلىكى + نۇقتا تېزلىكى /Touchpad/Pointer Speed - Two-finger scrolling in the middle area - ئوتتۇرا رايوندا ئىككى بارماق بىلەن سىيرىلما + ئوتتۇرا رايوندا ئىككى بارماق بىلەن سىيرىلما @@ -10856,8 +11233,8 @@ E-mail: support@kylinos.cn UkccAbout - - + + Settings تەڭشەكلەر @@ -10866,12 +11243,12 @@ E-mail: support@kylinos.cn 控制面板 - + Version: نەشرى: - + Service and Support: مۇلازىمەت ۋە قوللاش: @@ -11130,53 +11507,65 @@ E-mail: support@kylinos.cn UnifiedOutputConfig - + resolution ئېنىقلىما - + orientation يۆلىنىش - + arrow-up ئوقيا ئېتىش - + 90° arrow-right 90° ئوقيا ئوڭ - - + + arrow-down ئوقيا ئېتىش - + 90° arrow-left 90° ئوقيا سول - + + auto rotation + + /Display/auto rotation + + + frequency چاستوتىسى + + + screen zoom + ئېكراننى چوڭايت + /Display/screen zoom + refresh rate 刷新率 - + auto @@ -11266,12 +11655,12 @@ E-mail: support@kylinos.cn 管理员用户 - + root يىلتىز - + Hint ئەسكەرتىش @@ -11280,32 +11669,32 @@ E-mail: support@kylinos.cn 更改账户类型需要注销后生效,是否注销? - + The account type of “%1” has been modified, will take effect after logout, whether to logout? «٪1» نىڭ ھېسابات تىپى ئۆزگەرتىلدى، چېكىنگەندىن كېيىن كۈچكە ئىگە بولامدۇ- يوق؟ - + logout later كېيىن چېكىنىش - + logout now ھازىر چېكىنىش - + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? سىستېما پەقەت بىرلا ئابونتنىڭ ئاپتوماتىك كىرەلىشىگە يول قويىدۇ. ئېچىۋېتىلگەندىن كېيىن باشقا ئابونتلارنىڭ ئاپتوماتىك كىرىشى ئۆچۈرۈلىدۇ. ئېچىلىپ كەتتىمۇ؟ - + Trun on Trun on - + Close on يېپىش @@ -11322,12 +11711,12 @@ E-mail: support@kylinos.cn 验证 - + Standard ئۆلچەم - + Admin admin @@ -11336,42 +11725,52 @@ E-mail: support@kylinos.cn 删除 - + CurrentUser CurrentUser + /Userinfo/CurrentUser - + OthersUser OthersUser + /Userinfo/OthersUser - + + Add + + /Userinfo/Add + + + Passwd Passwd - + Groups گۇرۇپپىلار - + AutoLoginOnBoot AutoLoginOnBoot + /Userinfo/AutoLoginOnBoot LoginWithoutPwd كىرىشWithoutPwd + /Userinfo/LoginWithoutPwd - + Warning دىققەت - + The user is logged in, please delete the user after logging out ئابۇنت تىزىملىتىپ كىردى، تىزىملىتىپ كىرگەندىن كېيىن ئابونتنى ئۆچۈرۈڭ @@ -11403,18 +11802,14 @@ E-mail: support@kylinos.cn - Password ئىم - /Userinfo/Password - - + Type تۈرى - /Userinfo/Type Valid @@ -11427,15 +11822,12 @@ E-mail: support@kylinos.cn - Login no passwd كىرىش يوق passwd - /Userinfo/Login no passwd - enable autoLogin - autoLogin نى قوزغىتىش + autoLogin نى قوزغىتىش /Userinfo/enable autoLogin @@ -11481,10 +11873,10 @@ E-mail: support@kylinos.cn UserInfoIntel - + Current User نۆۋەتتىكى ئىشلەتكۈچى - /Userinfo/Current User + /UserinfoIntel/Current User @@ -11493,11 +11885,11 @@ E-mail: support@kylinos.cn - - + + Change pwd pwd نى ئۆزگەرتىش - /Userinfo/Change pwd + /UserinfoIntel/Change pwd @@ -11521,45 +11913,51 @@ E-mail: support@kylinos.cn - + Other Users باشقا ئىشلەتكۈچىلەر - /Userinfo/Other Users + /UserinfoIntel/Other Users - + User Info Intel User Info Intel - + Change Tel Tel نى ئۆزگەرتىش - /Userinfo/Change Tel + /UserinfoIntel/Change Tel - + Delete user ئىشلەتكۈچىنى ئۆچۈرۈش - /Userinfo/Delete user + /UserinfoIntel/Delete user - + + Change user name + + /UserinfoIntel/Change user name + + + standard user ئۆلچەملىك ئىشلەتكۈچى - + administrator باشقۇرغۇچى - + root يىلتىز - + Add new user يېڭى ئىشلەتكۈچى قوشۇش @@ -11577,27 +11975,27 @@ E-mail: support@kylinos.cn UtilsForUserinfo - + Passwd Passwd - + Type تۈرى - + Del Del - + Standard ئۆلچەم - + Admin admin @@ -11605,7 +12003,7 @@ E-mail: support@kylinos.cn Vino - + Vino Vino @@ -11627,38 +12025,38 @@ E-mail: support@kylinos.cn VPN - Vpn - VPN + VPN - VPN - VPN + VPN Wallpaper + Desktop Background ئۈستەلئۈستى ئارقا كۆرۈنۈشى + /Wallpaper/Desktop Background - + Mode مودى - - + + Online Picture توردا رەسىم /Wallpaper/Online Picture - - + + Reset To Default سۈكۈتكە قايتاي /Wallpaper/Reset To Default @@ -11672,8 +12070,8 @@ E-mail: support@kylinos.cn 图片放置方式 - - + + Browse كۆرۈش /Wallpaper/Browse @@ -11703,19 +12101,18 @@ E-mail: support@kylinos.cn 背景 - - - + + Background تەگلىك - + picture رەسىم - + color رەڭ @@ -11728,35 +12125,37 @@ E-mail: support@kylinos.cn 自定义颜色 - + wallpaper تام قەغىزى - + centered مەركەز قىلىنغان - + scaled كۆلەملەشكەن - + stretched سوزۇلغان + zoom - 缩放 + 缩放 + spanned - 适合宽度 + 适合宽度 - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) تام قەغىزى ھۆججەتلىرى(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -11765,38 +12164,38 @@ E-mail: support@kylinos.cn 所有文件(*.*) - - + + select custom wallpaper file خاس تام قەغىزى ھۆججىتىنى تاللاش - - + + Select تاللاش - - + + Position: ئورنى: - - + + FileName: ھۆججەت نامى: - - + + FileType: FileType: - - + + Cancel ئەمەلدىن قالدۇرۇش @@ -11812,10 +12211,10 @@ E-mail: support@kylinos.cn 统一输出 - + night mode تۈن ھالىتى - /Display/night mode + /display/night mode @@ -11823,99 +12222,162 @@ E-mail: support@kylinos.cn بىر قىسىم قوللىنىشچان پروگراممىلارنىڭ ئۈنۈمگە ئىھتىياجى بار - + Night Mode تۈن ھالىتى + /Display/Night Mode - + Open ئېچىش - + Time ۋاقتىدا - - + + Custom Time تاموژنا ۋاقتى - + to تو - + Color Temperature رەڭ تېمپېراتۇرىسى - + Warmer تېخىمۇ ئىللىق - + Colder سوغوق - + Multi-screen كۆپ ئېكرانلىق - + First Screen بىرىنچى ئېكران - + Clone Screen كىلون ئېكرانى - + + + Splice Screen + + + + Auto Brightness ئاپتۇماتىك يورۇقلۇق - + Adjust screen brightness by ambient Ambient ئارقىلىق ئېكراننىڭ يورۇقلۇقىنى تەڭشەش - - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> - ٪1 نىڭ ئېكرانى ئۆزگەرتىلدى، ساقلاش كېرەكمۇ يوق ؟ <br/> <font style= 'color:#626c6e'>تەڭشەكلەر 14 سېكۇنتتىن كېيىن ساقلىنىدۇ</font> + + Dynamic light + + /Display/Dynamic light + + + + Optimize display content to extend battery life + + + + + scale + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> + + + + + The zoom has been modified, it will take effect after you log off + + + + + + (Effective after logout) + + + + + Splicing Method + + + + + Change + ئۆزگەرتىش + + + + as main + ئاساسلىقى + + + + open monitor + ئوچۇق كۆزەتكۈچ + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> + ٪1 نىڭ ئېكرانى ئۆزگەرتىلدى، ساقلاش كېرەكمۇ يوق ؟ <br/> <font style= 'color:#626c6e'>تەڭشەكلەر 14 سېكۇنتتىن كېيىن ساقلىنىدۇ</font> - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> ٪1 نىڭ ئېكرانى ئۆزگەرتىلدى، ساقلاش كېرەكمۇ يوق ؟ <br/> <font style= 'color:#626c6e'>تەڭشەكلەر ٪2 سېكۇنتتىن كېيىن ساقلىنىدۇ</font> - + + Follow the sunrise and sunset كۈن چىقىش ۋە كۈن پېتىشقا ئەگىشىپ - + Extend Screen ئېكراننى ئۇزارتىش - + Vice Screen مۇئاۋىن ئېكران - + monitor كۆزەتكۈچى @@ -11927,32 +12389,29 @@ E-mail: support@kylinos.cn ئۇچۇر-خەۋەر - Theme follow night mode ئۇسلۇب كېچىلىك ھالىتىگە ئەگىشىش - + resolution ئېنىقلىما - + orientation يۆلىنىش - + frequency چاستوتىسى - - Hint ئەسكەرتىش @@ -11963,13 +12422,13 @@ the settings will be saved after 14 seconds 是否保留当前修改的配置?将在14秒后自动保存配置 - + Save ساقلاش - + Not Save ساقلاش ئەمەس @@ -11980,22 +12439,21 @@ the settings will be saved after %1 seconds 是否保留当前修改的配置?将在%1秒后自动保存配置 - The zoom function needs to log out to take effect - چوڭايتما ئىقتىدارى چېكىنىپ ئۈنۈمگە ئىھتىياجلىق + چوڭايتما ئىقتىدارى چېكىنىپ ئۈنۈمگە ئىھتىياجلىق - + Log out now ھازىر چېكىن - + Later كېيىنچە - + All Day كۈن بويى @@ -12004,12 +12462,13 @@ the settings will be saved after %1 seconds 跟随日出日落(17:55-06:23) - - - - + + + + Brightness يورۇقلۇق + /Display/Brightness After modifying the resolution or refresh rate, due to compatibility issues between the display device and the graphics card, the display may be abnormal or unable to display @@ -12032,6 +12491,7 @@ If something goes wrong, the settings will be restored after 9 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在9秒后还原设置 + screen zoom ئېكراننى چوڭايت @@ -12067,7 +12527,7 @@ the settings will be saved after %1 seconds 修改分辨率或刷新率后,由于显示设备与 显卡兼容性问题,有可能显示不正常。系统将在%1秒后保存配置 - + Warnning ئاگاھلاندۇرۇش @@ -12077,19 +12537,18 @@ If something goes wrong, the settings will be restored after %1 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在%1秒后还原设置 - - - + + + please insure at least one output! ئەڭ ئاز بولغاندىمۇ بىر مالنى سۇغۇرتىغا ئالدۇرۇڭ! - - - - - + + + + Warning دىققەت @@ -12102,8 +12561,7 @@ If something goes wrong, the settings will be restored after %1 seconds 屏幕分辨率已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在%1秒后自动保存。</font> - - + Open time should be earlier than close time! ئېچىۋېتىش ۋاقتى يېقىن ۋاقىتتىن بالدۇر بولۇشى كېرەك! @@ -12112,8 +12570,8 @@ If something goes wrong, the settings will be restored after %1 seconds 早晨时刻应早于晚上的时刻! - - + + Sorry, your configuration could not be applied. Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. كەچۈرۈڭ، سەپلىمىسىڭىز قوللىنىلمىدى. @@ -12187,7 +12645,7 @@ Common reasons are that the overall screen size is too big, or you enabled more addShortcutDialog - + Dialog @@ -12200,28 +12658,28 @@ Common reasons are that the overall screen size is too big, or you enabled more 快捷键程序 - + Exec Exec - + Open ئېچىش - + Name ئىسىم-فامىلىسى - + Key ئاچقۇچ - - + + TextLabel TextLabel @@ -12230,13 +12688,13 @@ Common reasons are that the overall screen size is too big, or you enabled more 无效的可执行程序,请重新选择 - - + + Cancel ئەمەلدىن قالدۇرۇش - + Save ساقلاش @@ -12270,60 +12728,60 @@ Common reasons are that the overall screen size is too big, or you enabled more قىسقارتىش قوشۇش - + Please enter a shortcut بىر قىسقا يولنى كىرگۈزۈڭ - + Desktop files(*.desktop) ئۈستەل يۈزى ھۆججەتلىرى(*.desktop) - + select desktop ئۈستەلئۈستى تاللاش - - - + + + Invalid application ئىناۋەتسىز ئىلتىماس - - - + + + Shortcut conflict قىسقا يول توقۇنۇشى - - - + + + Invalid shortcut ئىناۋەتسىز قىسقا يول - - - + + + Name repetition ئىسىم قايتا تەكرارلاش - + Unknown error نامەلۇم خاتالىق - + Shortcut cannot be empty قىسقا يولنى بوش قويۇشقا بولمايدۇ - + Name cannot be empty ئىسىمنى بوش قويۇشقا بولمايدۇ @@ -12335,6 +12793,76 @@ Common reasons are that the overall screen size is too big, or you enabled more 请输入手机号码 + + changeUserGroup + + + user group + + + + + Group: + + + + + GID: + + + + + GNum: + + + + + + Cancel + + + + + + Confirm + + + + + + + Tips + ئەسكەرتىش + + + + + Invalid Id! + ئىناۋەتسىز كىملىك! + + + + + + OK + + + + + Invalid Group Name! + ئىناۋەتسىز توپ نامى! + + + + Whether delete the group: “%1” ? + + + + + which will make some file components in the file system invalid! + بۇ ھۆججەت سىستېمىسىدىكى بەزى ھۆججەت دېتاللىرىنى ئىناۋەتسىز قىلىدۇ! + + changtimedialog diff --git a/shell/res/i18n/zh_CN.ts b/shell/res/i18n/zh_CN.ts index 607de43..d4f80a3 100644 --- a/shell/res/i18n/zh_CN.ts +++ b/shell/res/i18n/zh_CN.ts @@ -4,104 +4,101 @@ About - + System Summary 系统概述 - + Support 支持 - - + Version Number 版本号 - + Status 系统状态 /About/Status - + DateRes 服务到期时间 - + Wechat code scanning obtains HP professional technical support 微信扫码获得HP专业技术支持 - + HostName 计算机名 - + See more about Kylin Tianqi edu platform 查看麒麟天启教育平台更多信息 - + <<Protocol>> 《试用免责协议》 - + About and Support 关于与支持 - InterVersion - 内部版本 + 内部版本 - + Patch Version 系统补丁版本号 - + Privacy and agreement 隐私和协议 - + Send optional diagnostic data 发送可选诊断数据 - + By sending us diagnostic data, improve the system experience and solve your problems faster 通过向我们发送诊断数据,提升系统体验以及更快的解决你的问题 - Copyright © 2009-%1 KylinSoft. All rights reserved. - 版权所有 ©%1 openkylin 保留所有权利。 + 版权所有 © 2009-%1 麒麟软件 保留所有权利。 - + and - + <<Privacy>> 《用户隐私协议》 - + Learn more HP user manual>> 了解更多 Hp用户手册>> - + See user manual>> 查看用户手册 @@ -110,34 +107,49 @@ 未激活(试用期) - + Trial expiration time 试用到期时间 - - + + expired 已过期 - - + + Extend 延长服务 - + + Copyright © 2009-%1 %2. All rights reserved. + + + + + Openkylin + + + + + KylinSoft + + + + The system needs to be restarted to set the HostName, whether to reboot 计算机名已被修改,需要重启系统才可正常使用。建议立即重启系统! - + Reboot Now 立即重启 - + Reboot Later 稍后重启 @@ -150,9 +162,9 @@ 延长服务 - - - + + + avaliable 可用 @@ -169,7 +181,8 @@ 版权所有2009-2021@kylinos保留所有权利 - + + Version 版本名称 /About/version @@ -187,37 +200,42 @@ 版权所有 © 2009-2021 麒麟软件 保留所有权利。 - + + Kernel 内核 /About/Kernel - + + CPU CPU /About/CPU - + + Memory 内存 /About/Memory - - + + Disk 硬盘 - + + Desktop 桌面 /About/Desktop - + + User 用户名 /About/User @@ -231,7 +249,7 @@ 有效期 - + Serial 序列号 @@ -244,8 +262,8 @@ 序列号 - - + + Active 激活 @@ -262,7 +280,7 @@ 关于 - + About 关于 @@ -279,13 +297,13 @@ 可用 - - + + Inactivated 未激活 - + Activated 已激活 @@ -427,7 +445,15 @@ AddBtn - + + Add + 添加 + + + + AddButton + + Add 添加 @@ -435,22 +461,22 @@ AddInputMethodDialog - + Dialog - + Select the input method to add 选择要添加的输入法 - + No 取消 - + Yes 添加 @@ -485,22 +511,22 @@ - + Yes 添加 - + No 取消 - + Add Language 添加语言 - + Search 输入你想找的内容 @@ -681,88 +707,67 @@ AptProxyDialog - Set Apt Proxy - 设置APT代理 + 设置APT代理 - Server Address - 服务器地址 + 服务器地址 - Port - 端口 + 端口 - Cancel - 取消 + 取消 - Confirm - 确定 + 确定 Area - - + Area 区域语言 Regional Format - 区域格式 - - - - - Current Region - 显示日期、时间和货币格式的区域 + 显示日期、时间和货币格式 /Area/Current Region - - First Day Of The Week - 一周的第一天 + Current Region + 显示日期、时间和货币格式的区域 + /Area/Current Region + + + First Day Of The Week + 一周的第一天 - - Calendar - 日历 + 日历 /Area/Calendar - - Language Format - 语言格式 + 语言格式 /Area/Regional Format - - Date - 日期 + 日期 /Area/Date - - Time - 时间 + 时间 /Area/Time - - - TextLabel - - Area showing time currency format 显示日期、货币、时间、货币格式的区域 @@ -772,7 +777,7 @@ 区域格式数据 - + lunar 农历 @@ -797,73 +802,101 @@ 显示日期、时间、货币格式的区域 - US - 美国 + 美国 - Language for system windows,menus and web pages - 显示在系统窗口、菜单和网页的语言 + 显示在系统窗口、菜单和网页的语言 Add main language 添加首语言 - - System Language - 系统语言 + 系统语言 /Area/system language + Simplified Chinese - 简体中文 + 简体中文 + + + + English (US) + 英文 (美国) + + + + Simplified Chinese (CN) + 简体中文 (中国) + + + + Tibetan (CN) + 藏文 (中国) - First Day Of Week - 一周的第一天 + 一周的第一天 /Area/First Day Of Week - + 12 Hours 12小时制 - + 24 Hours 24小时制 - + Settings + 设置 + + + 简体中文 + 简体中文 + + + བོད་ཡིག + 藏语 + + + + Tibetan + 藏语 + + + Modify the current region need to logout to take effect, whether to logout? 修改当前区域需要注销后生效,是否注销? - + Logout later 稍后注销 - + Logout now 立即注销 - + Modify the first language need to reboot to take effect, whether to reboot? 修改首选语言需要重启后生效,是否重启? - + Reboot later 稍后重启 - + Reboot now 立即重启 @@ -904,9 +937,8 @@ 显示语言 - CN - 中国 + 中国 Need to cancel to take effect @@ -929,8 +961,9 @@ 区域格式数据 + English - English + 英语 Chinese @@ -941,17 +974,31 @@ 添加首语言 - + solar calendar 公历 + monday - 星期一 + 星期一 + English (US) + 英文 (美国) + + + Simplified Chinese (CN) + 简体中文 (中国) + + + Tibetan (CN) + 藏文 (中国) + + + sunday - 星期天 + 星期天 change data format @@ -965,6 +1012,51 @@ 请输入手机号码 + + AreaUi + + + Regional Format + 显示日期、时间和货币格式 + /Area/Regional Format + + + + Calendar + 日历 + /Area/Calendar + + + + First Day Of Week + 一周的第一天 + /Area/First Day Of Week + + + + Date + 日期 + /Area/Date + + + + Time + 时间 + /Area/Time + + + + Language Format + 语言格式 + /Area/Language Format + + + + System Language + 系统语言 + /Area/System Language + + Audio @@ -975,33 +1067,32 @@ AutoBoot - + Desktop files(*.desktop) 桌面文件(*.desktop) - + select autoboot desktop 选择自启动程序 - + Select 选择 - + Cancel 取消 - Add - 添加 - /autoboot/Add + 添加 + /Autoboot/Add - + Autoboot Settings 开机启动设置 /autoboot/Autoboot Settings @@ -1019,7 +1110,7 @@ 开机启动 - + Auto Boot 开机启动 @@ -1032,7 +1123,7 @@ 当前状态 - + Delete 删除 @@ -1041,8 +1132,7 @@ Backup - - + Backup 备份 @@ -1064,14 +1154,14 @@ you can restore them to ensure the integrity of your system. - + Begin backup 开始备份 /Backup/Begin backup - + Restore 还原 @@ -1086,7 +1176,7 @@ you can restore them to ensure the integrity of your system. - + Begin restore 开始还原 /Backup/Begin restore @@ -1120,17 +1210,22 @@ you can restore them to ensure the integrity of your system. 系统还原 - + + Backup Restore + 备份还原 + + + Back up your files to other drives and restore them when the source files are lost, damaged, or deleted to ensure the integrity of the system. 将您的文件备份到其他驱动器,当源文件丢失、受损、删除时还原它们,保证系统的完整性。 - + View the backup list and restore the backup file to the system 查看备份列表,将备份文件还原至系统。 - + Backup and Restore 备份还原 @@ -1551,10 +1646,39 @@ Please authenticate yourself to continue 设备名称的长度不超过 %1 个字符! + + Boot + + + Boot + 系统启动 + + + + boot + 系统启动 + + + + Grub verify + Grub 验证 + /Boot/Grub verify + + + + Password required for Grub editing after enabling + 启用后在Grub编辑需要密码 + + + + Reset password + 重置密码 + + BrightnessFrame - + Failed to get the brightness information of this monitor 未能获得该显示器的亮度信息 @@ -2348,17 +2472,17 @@ Please authenticate yourself to continue 用户名 - + NickName 用户昵称 - + nickName already in use. 该用户昵称已存在。 - + The length must be 1~%1 characters! 长度必须为 1~%1 个字符 @@ -2375,12 +2499,12 @@ Please authenticate yourself to continue 计算机名 - + Cancel 取消 - + Confirm 确定 @@ -2388,76 +2512,83 @@ Please authenticate yourself to continue ChangeUserPwd - + Change password 修改密码 - - - + + + Current Pwd 当前密码 - - - - + + + + New Pwd 新密码 - - - - + + + + Sure Pwd 确认新密码 - + Cancel 取消 - + + + Confirm 确定 - - + + Inconsistency with pwd 与新密码不同 - + Same with old pwd 与旧密码相同 - + + Pwd Changed Succes + 密码修改成功 + + + Authentication failed, input authtok again! 密码输入错误,重新输入! - + Contains illegal characters! 含有非法字符! - + current pwd cannot be empty! 当前密码不能为空! - + new pwd cannot be empty! 新密码不能为空! - + sure pwd cannot be empty! 确认密码不能为空! @@ -3269,32 +3400,13 @@ change system settings 当前时间 - - + Change timezone 修改时区 /Date/Change time zone - - - TextLabel - - - - - - RadioButton - - - - - - : - - - - + titleLabel @@ -3339,24 +3451,24 @@ change system settings 时间日期 - + Date 时间和日期 - + Current Date 当前时间 /Date/Current Date - + Other Timezone 其他时区时间 /Date/Other Timezone - + 24-hour clock 24小时制 /Date/24-hour clock @@ -3374,13 +3486,13 @@ change system settings 添加时区,最多添加5个 - + Sync Server 同步服务器 /Date/Sync Server - + Add Timezone 添加时区 @@ -3389,13 +3501,13 @@ change system settings 删除 - + Manual Time 手动设置时间 /Date/Manual Time - + Sync Time 自动同步时间 /Date/Sync Time @@ -3415,55 +3527,55 @@ change system settings /Date/Network - + Set Time 设置时间 /Date/Set Time - + Set Date Manually 手动设置日期 /Date/Set Date Manually - + Default 系统默认 - + Customize 自定义 - + Server Address 服务器地址 - + Required 必需 - + Save 确定 - + Change Timezone 修改时区 - + - - + + Sync failed 同步失败 @@ -3480,7 +3592,7 @@ change system settings 同步网络时间 - + change time 更改时间 @@ -3496,71 +3608,65 @@ change system settings 默认应用 - + Default App 默认应用 - + No program available 无可用程序 - + Choose default app 选择默认应用 - + Reset default apps to system recommended apps 将默认应用重置为系统推荐应用 - + Reset 重置 - + Browser 浏览器 - /Defaultapp/Browser - + Mail 电子邮件 - /Defaultapp/Mail - + Image Viewer 图像查看器 - /Defaultapp/Image Viewer - + Audio Player 音频播放器 - /Defaultapp/Audio Player - + Video Player 视频播放器 - /Defaultapp/Video Player - + Text Editor 文档编辑器 - /Defaultapp/Text Editor DefaultAppWindow - + Select Default Application 默认应用 @@ -3776,17 +3882,17 @@ folder will be deleted! DeleteUserExists - + Delete user ' 是否删除用户“ - + '? And: ”?并执行: - + Keep desktop, files, favorites, music of the user 保留该用户下所属的桌面、文件、收藏夹、音乐等数据 @@ -3795,17 +3901,17 @@ folder will be deleted! 保留用户家目录 - + Cancel 取消 - + Confirm 删除 - + Delete whole data belong user 删除该用户所有数据 @@ -4288,7 +4394,12 @@ folder will be deleted! 显示器 - + + Screen + 屏幕 + + + Display 显示器 @@ -4297,7 +4408,6 @@ folder will be deleted! DisplayWindow - monitor 显示器 @@ -4315,7 +4425,6 @@ folder will be deleted! 统一输出 - open monitor 打开显示器 @@ -4333,13 +4442,11 @@ folder will be deleted! 显示器 - as main 设为主屏 - screen zoom 缩放屏幕 @@ -4362,43 +4469,36 @@ folder will be deleted! - follow the sunrise and sunset(17:55-05:04) 跟随日落日出(17:55-05:04) - custom time 自定义时间 - opening time 开启时间 - closing time 关闭时间 - color temperature 色温 - warm - cold @@ -4739,6 +4839,16 @@ folder will be deleted! Thanks For Using The ukcc 欢迎使用设置 + + + Small + + + + + Large + + FrameItem @@ -4811,6 +4921,56 @@ folder will be deleted! 手势 + + GrubVerify + + + Grub verify + Grub 验证 + + + + User: + 用户: + + + + Pwd + 密码 + + + + Sure Pwd + 确认密码 + + + + Cancel + 取消 + + + + Confirm + 确定 + + + + + Inconsistency with pwd + 两次输入不一致 + + + + + pwd cannot be empty! + 密码不能为空! + + + + sure pwd cannot be empty! + 确认密码不能为空! + + HistoryUpdateListWig @@ -4835,17 +4995,17 @@ folder will be deleted! 计算机名 - + Must be 1-64 characters long 长度必须为1-64个字符 - + Cancel 取消 - + Confirm 确定 @@ -5125,6 +5285,11 @@ folder will be deleted! Investigation 搜索 + + + currency + 通用 + Search 搜索 @@ -5225,15 +5390,14 @@ folder will be deleted! 键盘 - Keyboard - 键盘 + 键盘 KeyboardMain - + Key board settings 键盘设置 @@ -5242,57 +5406,62 @@ folder will be deleted! 输入法设置 - + + Keyboard + 键盘 + + + Input settings 输入法设置 /Keyboard/Input settings - + Key repeat 按键重复 /Keyboard/Key repeat - + Delay 延迟 /Keyboard/Delay - + Short - + Long - + Speed 速度 /Keyboard/Speed - + Slow - + Fast - + Input test 输入测试 /Keyboard/Input test - + Key tips 按键提示 /Keyboard/Key tips @@ -5320,12 +5489,12 @@ folder will be deleted! LanguageFrame - + Delete 移除 - + Input Settings 输入法设置 @@ -5801,7 +5970,7 @@ Please retry or relogin! MainWindow - + Search 搜索 @@ -5810,19 +5979,20 @@ Please retry or relogin! 设置 - - - + + + + Settings 设置 - + Main menu 主菜单 - + Minimize 最小化 @@ -5831,38 +6001,38 @@ Please retry or relogin! 最大化/正常 - + Normal 还原 - - + + Maximize 最大化 - + Close 关闭 - + Help 帮助 - + About 关于 - + Exit 退出 - + Specified 指定插件 @@ -5871,12 +6041,12 @@ Please retry or relogin! 控制面板 - + Warning 警告 - + This function has been controlled 该功能已被管控 @@ -6168,9 +6338,8 @@ Please retry or relogin! 鼠标 - Mouse - 鼠标 + 鼠标 Lefthand @@ -6196,135 +6365,136 @@ Please retry or relogin! MouseUI - + + Mouse 鼠标 - + Pointer 指针 - + Cursor 光标 - + Dominant hand 鼠标主按钮 /Mouse/Dominant hand - + Left hand 左键 - + Right hand 右键 - + Scroll direction 滚动方向 /Mouse/Scroll direction - + Forward 正向 - + Reverse 反向 - + Wheel speed 滚轮速度 /Mouse/Wheel speed - - - + + + + Slow - - - + + + + Fast - + Double-click interval time 双击间隔时长 /Mouse/Double-click interval time - Short - + - Long - + - + Pointer speed 指针速度 /Mouse/Pointer speed - + Mouse acceleration 鼠标加速 /Mouse/Mouse acceleration - + Show pointer position when pressing ctrl 按Ctrl键时显示指针位置 /Mouse/Show pointer position when pressing ctrl - + Pointer size 指针大小 /Mouse/Pointer size - + Small(recommend) 小(推荐) - + Medium - + Large - + Blinking cursor in text area 文本区域光标闪烁 /Mouse/Blinking cursor in text area - + Cursor speed 光标速度 /Mouse/Cursor speed @@ -6333,7 +6503,7 @@ Please retry or relogin! MyLabel - + double-click to test 双击测试 @@ -6515,42 +6685,42 @@ Please retry or relogin! Notice - + NotFaze Mode 勿扰模式 - + (Notification banners, prompts will be hidden, and notification sounds will be muted) (通知横幅、提示将会隐藏,通知声音将会静音) - + Automatically turn on 自动开启 - + to - + Automatically turn on when multiple screens are connected 多屏连接时自动开启 - + Automatically open in full screen mode 全屏模式下自动开启 - + Allow automatic alarm reminders in Do Not Disturb mode 勿扰模式下允许闹钟提示 - + Notice Settings 通知 @@ -6567,10 +6737,9 @@ Please retry or relogin! 系统版本更新后显示新增内容 - + Get notifications from the app 获取来自应用的通知 - /notice/Get notifications from the app Show notifications on the lock screen @@ -6585,7 +6754,7 @@ Please retry or relogin! 通知 - + Notice 通知 @@ -6639,32 +6808,32 @@ Please retry or relogin! OutputConfig - + resolution 分辨率 /Display/resolution - + orientation 方向 /Display/orientation - + arrow-up 不旋转 - + 90° arrow-right 90° 顺时针 - + arrow-down 上下颠倒 @@ -6678,13 +6847,19 @@ Please retry or relogin! 部分程序需要注销生效 - + 90° arrow-left 90° 逆时针 - + + auto rotation + 自动旋转 + /Display/auto rotation + + + frequency 刷新率 @@ -6695,18 +6870,18 @@ Please retry or relogin! 刷新率 - + auto 自动 - + screen zoom 缩放屏幕 /Display/screen zoom - + @@ -6930,9 +7105,8 @@ Please retry or relogin! 电源 - Power - 电源 + 电源 Change PC sleep time after %1 min: @@ -6951,11 +7125,8 @@ Please retry or relogin! 系统%1分钟后进入空闲状态并于%2分钟后关闭显示器: - - - never - 从不 + 从不 10 min @@ -6994,230 +7165,163 @@ Please retry or relogin! 睡眠/休眠唤醒时需要密码 - - Require password when sleep - 睡眠后唤醒需要密码 + 睡眠后唤醒需要密码 - - Password required when waking up the screen - 唤醒屏幕时需要密码 + 唤醒屏幕时需要密码 - Press the power button - 按电源键时执行 + 按电源键时执行 - - Time to close display - 此时间段后关闭显示器 + 此时间段后关闭显示器 - - Time to sleep - 此时间段后系统进入睡眠 + 此时间段后系统进入睡眠 - - Notebook cover - 笔记本合盖时执行 + 笔记本合盖时执行 - - - Using power - 使用电源时 + 使用电源时 - Using battery - 使用电池时 + 使用电池时 - - Time to darken - 此时间段后降低屏幕亮度 + 此时间段后降低屏幕亮度 - - Battery level is lower than - 电量低于 + 电量低于 - Run - 时执行 + 时执行 - - Low battery notification - 低电量时通知 + 低电量时通知 - Automatically run saving mode when low battery - 低电量时自动开启节能模式 + 低电量时自动开启节能模式 - Automatically run saving mode when the low battery - 低电量时自动开启节能模式 + 低电量时自动开启节能模式 - - Automatically run saving mode when using battery - 使用电池时自动开启节能模式 + 使用电池时自动开启节能模式 - - Display remaining charging time and usage time - 显示剩余充电时间和剩余使用时间 + 显示剩余充电时间和剩余使用时间 - General - 通用 + 通用 /Power/General - Select Powerplan - 电源计划 + 电源计划 /Power/Select Powerplan - Battery saving plan - 电池节能计划 + 电池节能计划 /Power/Battery saving plan - - nothing - 无操作 + 无操作 - - blank - 关闭显示器 + 关闭显示器 - - - suspend - 睡眠 + 睡眠 - - - hibernate - 休眠 + 休眠 - interactive - 询问 + 询问 - - 5min - 5分钟 + 5分钟 - - Performance Model - 性能模式 + 性能模式 - 20min - 20分钟 + 20分钟 10minn 10分钟 - - 15min - 15分钟 + 15分钟 - - 30min - 30分钟 + 30分钟 - - 1h - 1小时 + 1小时 - - 2h - 2小时 + 2小时 - - - 10min - 10分钟 + 10分钟 - 3h - 3小时 + 3小时 - - Balance Model - 平衡模式 + 平衡模式 - - Save Model - 节能模式 + 节能模式 - 1min - 1分钟 + 1分钟 3min 3分钟 - - - shutdown - 关机 + 关机 always @@ -7271,19 +7375,23 @@ Please retry or relogin! 打印机 - + Printer 打印机 - - Printers And Scanners - 打印机和扫描仪 + + Printers + 打印机 + 打印机 + + + Printers And Scanners + 打印机和扫描仪 - Add - 添加 + 添加 /Printer/Add @@ -8439,9 +8547,8 @@ E-mail: support@kylinos.cn 开启自动代理 - Auto url - 配置URL + 配置URL /Proxy/Auto url @@ -8454,50 +8561,40 @@ E-mail: support@kylinos.cn 开启手动代理 - Http Proxy - HTTP代理 + HTTP代理 /Proxy/Http Proxy - - - - Port - 端口 + 端口 Cetification 认证 - System Proxy - 系统代理 + 系统代理 - Https Proxy - HTTPS代理 + HTTPS代理 /Proxy/Https Proxy - Ftp Proxy - FTP代理 + FTP代理 /Proxy/Ftp Proxy - Socks Proxy - SOCKS代理 + SOCKS代理 /Proxy/Socks Proxy - List of ignored hosts. more than one entry, please separate with english semicolon(;) - 忽略的主机列表,请使用英文分号(;) + 忽略的主机列表,请使用英文分号(;) Enable Authentication @@ -8512,81 +8609,65 @@ E-mail: support@kylinos.cn 密码 - Apt Proxy - APT代理 + APT代理 /Proxy/Apt Proxy - Open - 开启 + 开启 - Server Address : - 服务器地址: + 服务器地址: - Port : - 端口: + 端口: - Edit - 编辑 + 编辑 - The apt proxy has been turned off and needs to be restarted to take effect - apt代理功能已关闭 需重启后生效 + apt代理功能已关闭 需重启后生效 - The system needs to be restarted to set the Apt proxy, whether to reboot - 设置APT代理需要重启系统后生效,是否重启系统 + 设置APT代理需要重启系统后生效,是否重启系统 - - Reboot Now - 立即重启 + 立即重启 - Start using - 启用 + 启用 - Proxy mode - 代理类型 + 代理类型 - Auto - 自动 + 自动 - Manual - 手动 + 手动 - - Reboot Later - 稍后重启 + 稍后重启 proxy 代理 - Proxy - 代理 + 代理 @@ -8790,7 +8871,7 @@ E-mail: support@kylinos.cn 自定义快捷键 - + Edit Shortcut 编辑快捷键 @@ -8920,7 +9001,7 @@ E-mail: support@kylinos.cn 远程桌面 - + User Info 帐户信息 @@ -9320,63 +9401,63 @@ E-mail: support@kylinos.cn 连接失败,尝试重新连接 - + min length %1 - + min digit num %1 - + min upper num %1 - + min lower num %1 - + min other num %1 - + min char class %1 - + max repeat %1 - + max class repeat %1 - + max sequence %1 @@ -9396,19 +9477,17 @@ E-mail: support@kylinos.cn - + Programs are not allowed to be added. 该程序不允许添加。 - 简体中文 - 简体中文 + 简体中文 - English - 英语 + 英语 བོད་ཡིག @@ -9466,42 +9545,48 @@ E-mail: support@kylinos.cn Screenlock - + Screenlock 锁屏 + Screenlock Interface 锁屏界面 + /Screenlock/Screenlock Interface - - + Show message on lock screen 锁屏时显示消息 - - + + Browse 浏览 /Screenlock/Browse - - + + Online Picture 线上图片 /Screenlock/Online Picture - - + + Reset To Default 恢复默认 /Screenlock/Reset To Default + + + Related Settings + 相关设置 + Screenlock Set 锁屏设置 @@ -9511,7 +9596,7 @@ E-mail: support@kylinos.cn 激活屏保时锁定屏幕 - + Lock screen delay 此时间段后锁屏 @@ -9532,10 +9617,9 @@ E-mail: support@kylinos.cn 浏览本地壁纸 - - + Show picture of screenlock on screenlogin - 显示锁屏壁纸在登录页面 + 在登录界面显示锁屏壁纸 /Screenlock/Show picture of screenlock on screenlogin @@ -9555,7 +9639,7 @@ E-mail: support@kylinos.cn 图片 - + Never 从不 @@ -9596,7 +9680,7 @@ E-mail: support@kylinos.cn 2h - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) 图片文件(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -9605,75 +9689,91 @@ E-mail: support@kylinos.cn 所有文件(*.*) - + 1min 1分钟 - + 5min 5分钟 - + 10min 10分钟 - + 30min 30分钟 - + 45min 45分钟 - + 1hour 1小时 - + 2hour 2小时 - + 3hour 3小时 - + select custom wallpaper file 选择自定义壁纸文件 - + Select 选择 - + Position: 位置: - + FileName: 文件名: - + FileType: 文件类型: - + Cancel 取消 + + + Monitor Off + 关闭显示器 + + + + Screensaver + 屏幕保护 + + + + + Set + 去设置 + Screensaver @@ -9684,14 +9784,13 @@ E-mail: support@kylinos.cn 屏保 - - + Idle time 此时间段后开启屏保 /Screensaver/Idle time - + Lock screen when activating screensaver 激活屏保时锁住屏幕 @@ -9700,8 +9799,7 @@ E-mail: support@kylinos.cn 开启屏保 - - + Screensaver program 屏幕保护程序 /Screensaver/Screensaver program @@ -9715,7 +9813,7 @@ E-mail: support@kylinos.cn 分钟 - + Lock screen when screensaver boot 激活屏保时锁定屏幕 @@ -9728,121 +9826,121 @@ E-mail: support@kylinos.cn 默认屏保 - + View 预览 - + Text(up to 30 characters): 屏保文本(最多30个字): - + Show rest time 显示休息时间 - + UKUI UKUI - + Blank_Only 黑屏 - + Customize 自定义 - - + + 5min 5分钟 - - + + 10min 10分钟 - + 15min 15分钟 - - + + 30min 30分钟 - + 1hour 1小时 - + Screensaver source 屏保来源 - - + + Select 选择 - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) 壁纸文件(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp *.svg) - + select custom screensaver dir 选择自定义屏保路径 - + Position: 位置: - + FileName: 文件名: - + FileType: 文件类型: - + Cancel 取消 - + Switching time 切换频率 - + 1min 1分钟 - + Ordinal 按顺序 - + Random switching 随机切换 @@ -9855,17 +9953,17 @@ E-mail: support@kylinos.cn 输入文本,最多30个字符 - + Text position 文本位置 - + Centered 居中 - + Randow(Bubble text) 随机(气泡文本) @@ -9902,12 +10000,12 @@ E-mail: support@kylinos.cn 3h - + Random 随机 - + Never 从不 @@ -10021,6 +10119,14 @@ E-mail: support@kylinos.cn Touchpad 触控板 + + + + + + No search results + 无搜索结果 + SecurityCenter @@ -10226,19 +10332,18 @@ E-mail: support@kylinos.cn - + Remote Desktop 远程桌面 - + Allow others to view your desktop 允许其他人远程连接您的桌面 - /Vino/Allow others to view your desktop - + Allow connection to control screen 允许其他人远程连接您的桌面并控制您的屏幕 /Vino/Allow connection to control screen @@ -10249,13 +10354,13 @@ E-mail: support@kylinos.cn 安全 - + You must confirm every visit for this machine 您必须为本机机器确认每次访问 /Vino/You must confirm every visit for this machine - + Require user to enter this password: 要求用户输入此密码: @@ -10282,8 +10387,8 @@ E-mail: support@kylinos.cn Shortcut - - + + System Shortcut 系统快捷键 /Shortcut/System Shortcut @@ -10293,12 +10398,12 @@ E-mail: support@kylinos.cn 显示全部快捷键 - + Custom Shortcut 自定义快捷键 - + Customize Shortcut 自定义快捷键 /Shortcut/Customize Shortcut @@ -10308,23 +10413,23 @@ E-mail: support@kylinos.cn 添加自定义快捷键 - + Add 添加 /Shortcut/Add - + Edit 编辑 - + Delete 删除 - + or @@ -10341,7 +10446,7 @@ E-mail: support@kylinos.cn 快捷键 - + Shortcut 快捷键 @@ -10373,6 +10478,72 @@ E-mail: support@kylinos.cn 桌面 + + SpliceDialog + + + Dialog + + + + + Splice Screen + 拼接屏 + + + + + Cancel + 取消 + + + + + Ok + 确定 + + + + + Splicing Method + 拼接方式 + + + + row + + + + + rows + + + + + column + + + + + columns + + + + + %1 %2, %3 %4 + %1%2%3%4 + + + + Row %1, Column %2 + %1行%2列 + + + + Select screen + 选择显示屏幕 + + StatusDialog @@ -10798,93 +10969,93 @@ E-mail: support@kylinos.cn 主题模式 - - + + Theme 主题 - Default - 默认 + 深浅 - + Light 浅色 - + Dark 深色 - + Auto 自动 - + Corlor 强调色 - + Other 相关设置 - + Set 去设置 - + Wallpaper 桌面壁纸 - + Beep 提示音 - + Blue-Crystal - 蓝水晶 + 典蓝 - - + + Light-Seeking - 寻光 + - + DMZ-Black DMZ-黑 - + DMZ-White - DMZ-白 + 印白 - + Dark-Sense - 黑色质感 + 耀黑 - - + + + basic 基础 - + Classic - 启典 + Origins-Tracing @@ -10895,77 +11066,76 @@ E-mail: support@kylinos.cn 时尚 - + hp 惠普 - + ukui 寻光 - + HeYin - 和印 + - + classic 经典 - + daybreakBlue 蓝色 - + jamPurple 紫色 - + magenta 玫红色 - + sunRed 红色 - + sunsetOrange 橙色 - + dustGold 黄色 - + polarGreen 绿色 - default - 默认 + 默认 Middle - + Window Theme 窗口外观 /Theme/Window Theme - + Icon theme 图标 /Theme/Icon theme @@ -10975,7 +11145,7 @@ E-mail: support@kylinos.cn 控件主题 - + Cursor theme 光标 /Theme/Cursor theme @@ -10987,7 +11157,7 @@ E-mail: support@kylinos.cn - + Transparency 透明度 /Theme/Transparency @@ -10998,7 +11168,7 @@ E-mail: support@kylinos.cn - + Performance mode 特效模式 /Theme/Performance mode @@ -11028,27 +11198,27 @@ E-mail: support@kylinos.cn TimeBtn - + Tomorrow 明天 - + Yesterday 昨天 - + Today 今天 - + %1 hours earlier than local 比本地早%1小时 - + %1 hours later than local 比本地晚%1小时 @@ -11205,16 +11375,6 @@ E-mail: support@kylinos.cn No touchpad found 未发现触控板设备 - - Disable touchpad when using the mouse - 插入鼠标时禁用触控板 - /Touchpad/Disable touchpad when using the mouse - - - Cursor Speed - 光标速度 - /Touchpad/Cursor Speed - Slow @@ -11223,26 +11383,6 @@ E-mail: support@kylinos.cn Fast - - Disable touchpad when typing - 打字时禁用触控板 - /Touchpad/Disable touchpad when typing - - - Touch and click on the touchpad - 触控板轻触点击 - /Touchpad/Touch and click on the touchpad - - - Scroll bar slides with finger - 滚动条跟随手指滑动 - /Touchpad/Scroll bar slides with finger - - - Scrolling area - 滚动区域 - /Touchpad/Scrolling area - Disable scrolling 禁止滚动 @@ -11251,11 +11391,6 @@ E-mail: support@kylinos.cn Edge scrolling 边界滚动 - - Pointer Speed - 指针速度 - /Touchpad/Pointer Speed - Two-finger scrolling in the middle area 中间区域滚动 @@ -11303,8 +11438,8 @@ E-mail: support@kylinos.cn UkccAbout - - + + Settings 设置 @@ -11313,12 +11448,12 @@ E-mail: support@kylinos.cn 控制面板 - + Version: 版本: - + Service and Support: 服务与支持团队: @@ -11577,49 +11712,55 @@ E-mail: support@kylinos.cn UnifiedOutputConfig - + resolution 分辨率 - + orientation 方向 - + arrow-up 不旋转 - + 90° arrow-right 90°顺时针 - - + + arrow-down 上下颠倒 - + 90° arrow-left 90°逆时针 - + + auto rotation + 自动旋转 + /Display/auto rotation + + + frequency 刷新率 - + screen zoom 缩放屏幕 /Display/screen zoom @@ -11629,7 +11770,7 @@ E-mail: support@kylinos.cn 刷新率 - + auto @@ -11719,12 +11860,12 @@ E-mail: support@kylinos.cn 管理员用户 - + root Root - + Hint 提示 @@ -11733,32 +11874,32 @@ E-mail: support@kylinos.cn 更改账户类型需要注销后生效,是否注销? - + The account type of “%1” has been modified, will take effect after logout, whether to logout? “%1”帐户类型已被修改,将在注销系统后生效。是否注销系统? - + logout later 稍后注销 - + logout now 立即注销 - + The system only allows one user to log in automatically.After it is turned on, the automatic login of other users will be turned off.Is it turned on? 系统只允许一个用户自动登录,开启后将关闭其他用户的自动登录,是否开启? - + Trun on 开启 - + Close on 取消 @@ -11775,12 +11916,12 @@ E-mail: support@kylinos.cn 验证 - + Standard 标准用户 - + Admin 管理员 @@ -11789,42 +11930,52 @@ E-mail: support@kylinos.cn 删除 - + CurrentUser 当前用户 + /Userinfo/CurrentUser - + OthersUser 其他用户 + /Userinfo/OthersUser - + + Add + 添加 + /Userinfo/Add + + + Passwd 修改密码 - + Groups 用户组 - + AutoLoginOnBoot 开机自动登录 + /Userinfo/AutoLoginOnBoot - + LoginWithoutPwd 免密登录 + /Userinfo/LoginWithoutPwd - + Warning 警告 - + The user is logged in, please delete the user after logging out 用户已经登录,请注销后删除用户 @@ -11856,18 +12007,14 @@ E-mail: support@kylinos.cn - Password 修改密码 - /Userinfo/Password - - + Type 帐户类型 - /Userinfo/Type Valid @@ -11880,16 +12027,8 @@ E-mail: support@kylinos.cn - Login no passwd 免密登录 - /Userinfo/Login no passwd - - - - enable autoLogin - 开机自动登录 - /Userinfo/enable autoLogin @@ -12036,27 +12175,27 @@ E-mail: support@kylinos.cn UtilsForUserinfo - + Passwd 修改密码 - + Type 帐户类型 - + Del 删除 - + Standard 标准用户 - + Admin 管理员 @@ -12064,7 +12203,7 @@ E-mail: support@kylinos.cn Vino - + Vino 远程桌面 @@ -12086,38 +12225,43 @@ E-mail: support@kylinos.cn VPN - Vpn - VPN + VPN + + + Add a vpn connection + 添加vpn连接 + /Vpn/Add a vpn connection - VPN - VPN + VPN Wallpaper + Desktop Background 桌面背景 + /Wallpaper/Desktop Background - + Mode 显示方式 - - + + Online Picture 线上图片 /Wallpaper/Online Picture - - + + Reset To Default 恢复默认 /Wallpaper/Reset To Default @@ -12131,8 +12275,8 @@ E-mail: support@kylinos.cn 图片放置方式 - - + + Browse 浏览 /Wallpaper/Browse @@ -12162,19 +12306,18 @@ E-mail: support@kylinos.cn 背景 - - - + + Background 背景 - + picture 图片 - + color 颜色 @@ -12187,37 +12330,37 @@ E-mail: support@kylinos.cn 自定义颜色 - + wallpaper 平铺 - + centered 居中 - + scaled 填充 - + stretched 拉伸 - + zoom 适应 - + spanned 跨区 - + Wallpaper files(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) 图片文件(*.jpg *.jpeg *.bmp *.dib *.png *.jfif *.jpe *.gif *.tif *.tiff *.wdp) @@ -12226,38 +12369,38 @@ E-mail: support@kylinos.cn 所有文件(*.*) - - + + select custom wallpaper file 选择自定义壁纸文件 - - + + Select 选择 - - + + Position: 位置: - - + + FileName: 文件名: - - + + FileType: 文件类型: - - + + Cancel 取消 @@ -12273,10 +12416,10 @@ E-mail: support@kylinos.cn 统一输出 - + night mode 色温 - /Display/night mode + /display/night mode @@ -12284,116 +12427,162 @@ E-mail: support@kylinos.cn 部分程序需要注销生效 - + Night Mode 色温 + /Display/Night Mode - + Open 打开 - + Time 时间 - - + + Custom Time 自定义 - + to - + Color Temperature 屏幕色温 - + Warmer 较暖 - + Colder 较冷 - + Multi-screen 多屏显示 - + First Screen 第一屏 - + Clone Screen 镜像 - - Auto Brightness - 自动调整亮度 - /Display/Auto Brightness + + + Splice Screen + 拼接屏 - + + Auto Brightness + 自动调整亮度 + + + Adjust screen brightness by ambient 通过感应周围环境亮度,自动调整屏幕亮度 - + Dynamic light 动态背光 /Display/Dynamic light - + Optimize display content to extend battery life 通过优化显示内容来延长电池寿命 - + scale 缩放率 - - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> - 屏幕%1已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在14秒后自动保存。</font> + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after 14 seconds</font> + 屏幕%1已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在14秒后恢复配置</font> + + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be restore after %2 seconds</font> + 屏幕%1已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在%2秒后恢复配置</font> + + + + The zoom has been modified, it will take effect after you log off + 屏幕缩放已被修改,需要注销后生效。 + + + + + (Effective after logout) + (在注销后生效) + + + + Splicing Method + 拼接方式 + + + + Change + 修改 + + + + as main + 设为主屏 + + + + open monitor + 打开显示器 + + + The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after 14 seconds</font> + 屏幕%1已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在14秒后自动保存。</font> - The screen %1 has been modified, whether to save it ? <br/><font style= 'color:#626c6e'>the settings will be saved after %2 seconds</font> 屏幕%1已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在%2秒后自动保存。</font> - + + Follow the sunrise and sunset 跟随日出日落 - + Extend Screen 扩展 - + Vice Screen 其他屏 - + monitor 显示器 @@ -12405,32 +12594,29 @@ E-mail: support@kylinos.cn 信息 - Theme follow night mode 主题跟随夜间模式变化 - + resolution 分辨率 - + orientation 方向 - + frequency 刷新率 - - Hint 提示 @@ -12441,13 +12627,13 @@ the settings will be saved after 14 seconds 是否保留当前修改的配置?将在14秒后自动保存配置 - + Save 保存 - + Not Save 不保存 @@ -12458,22 +12644,21 @@ the settings will be saved after %1 seconds 是否保留当前修改的配置?将在%1秒后自动保存配置 - The zoom function needs to log out to take effect - 修改系统缩放后需要注销生效,是否注销? + 修改系统缩放后需要注销生效,是否注销? - + Log out now 立即注销 - + Later 稍后注销 - + All Day 全天 @@ -12482,10 +12667,10 @@ the settings will be saved after %1 seconds 跟随日出日落(17:55-06:23) - - - - + + + + Brightness 亮度 /Display/Brightness @@ -12511,6 +12696,7 @@ If something goes wrong, the settings will be restored after 9 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在9秒后还原设置 + screen zoom 缩放屏幕 @@ -12546,7 +12732,7 @@ the settings will be saved after %1 seconds 修改分辨率或刷新率后,由于显示设备与 显卡兼容性问题,有可能显示不正常。系统将在%1秒后保存配置 - + Warnning 警告 @@ -12556,19 +12742,18 @@ If something goes wrong, the settings will be restored after %1 seconds 修改分辨率或刷新率后,由于显示设备与显卡存在兼容性问题,有可能显示不正常或者无法显示.如果出现异常,系统将在%1秒后还原设置 - - - + + + please insure at least one output! 请确保至少开启一个屏幕! - - - - - - + + + + + Warning 警告 @@ -12581,8 +12766,7 @@ If something goes wrong, the settings will be restored after %1 seconds 屏幕分辨率已修改,是否保存?<br/><font style= 'color:#626c6e'>系统将在%1秒后自动保存。</font> - - + Open time should be earlier than close time! 开启时间必须大于关闭时间! @@ -12591,8 +12775,8 @@ If something goes wrong, the settings will be restored after %1 seconds 早晨时刻应早于晚上的时刻! - - + + Sorry, your configuration could not be applied. Common reasons are that the overall screen size is too big, or you enabled more displays than supported by your GPU. 抱歉,配置不能应用. @@ -12665,7 +12849,7 @@ Common reasons are that the overall screen size is too big, or you enabled more addShortcutDialog - + Dialog @@ -12678,28 +12862,28 @@ Common reasons are that the overall screen size is too big, or you enabled more 快捷键程序 - + Exec 程序 - + Open 选择 - + Name 名称 - + Key 按键 - - + + TextLabel @@ -12708,13 +12892,13 @@ Common reasons are that the overall screen size is too big, or you enabled more 无效的可执行程序,请重新选择 - - + + Cancel 取消 - + Save 确定 @@ -12748,60 +12932,60 @@ Common reasons are that the overall screen size is too big, or you enabled more 添加快捷键 - + Please enter a shortcut 请输入快捷键 - + Desktop files(*.desktop) 桌面文件(*.desktop) - + select desktop 选择桌面 - - - + + + Invalid application 此应用不可用 - - - + + + Shortcut conflict 此快捷键组合已被占用 - - - + + + Invalid shortcut 此快捷键组合不可用 - - - + + + Name repetition 此快捷键名称重复 - + Unknown error 未知错误 - + Shortcut cannot be empty 快捷键不能为空 - + Name cannot be empty 名称不能为空 @@ -12850,20 +13034,20 @@ Common reasons are that the overall screen size is too big, or you enabled more - + Tips 提示 - + Invalid Id! 无效组ID! - + OK 确定 diff --git a/shell/res/plugins/theme/default.png b/shell/res/plugins/theme/default.png index e30ce1c..f5e7ebe 100644 Binary files a/shell/res/plugins/theme/default.png and b/shell/res/plugins/theme/default.png differ diff --git a/shell/res/resfile.qrc b/shell/res/resfile.qrc index 07adb9f..2a3ca99 100644 --- a/shell/res/resfile.qrc +++ b/shell/res/resfile.qrc @@ -136,6 +136,7 @@ homepage/kylin-settings-datetime.png plugins/theme/opacity-currency.svg plugins/theme/opaque-light.svg + homepage/kylin-settings-currency.png global.qss @@ -150,5 +151,6 @@ i18n/kk.ts i18n/ky.ts i18n/ug.ts + i18n/bo_CN.ts diff --git a/shell/res/search.xml b/shell/res/search.xml index 7383e37..74aece1 100644 --- a/shell/res/search.xml +++ b/shell/res/search.xml @@ -8,6 +8,9 @@ 系统概述 about System Summary + རྒྱུད་ཁོངས་ + སྐོར་ + ལམ་ལུགས་ཕྱོགས་བསྡོམས། xitong @@ -18,6 +21,9 @@ 分辨率 display Resolution + རྒྱུད་ཁོངས་ + མངོན་པ་ + ཤན་འབྱེད་ཕྱོད་ xitong @@ -28,6 +34,9 @@ 方向 display orientation + རྒྱུད་ཁོངས་ + མངོན་པ་ + ཁ་ཕྱོགས། xitong @@ -38,6 +47,9 @@ 刷新率 display frequency + རྒྱུད་ཁོངས་ + མངོན་པ་ + གསར་འདོན་ཕྱོད་ xitong @@ -48,6 +60,9 @@ 缩放屏幕 display Screen Zoom + རྒྱུད་ཁོངས་ + མངོན་པ་ + བརྙན་ཡོལ་རྐྱོང་སྐུམ་ xitong @@ -58,6 +73,9 @@ 亮度 display Brightness + རྒྱུད་ཁོངས་ + མངོན་པ་ + གསལ་ཚད་ xitong @@ -68,6 +86,9 @@ 夜间模式 display Night Mode + རྒྱུད་ཁོངས་ + མངོན་པ་ + མཚན་མོའི་མ་དཔེ་ xitong @@ -78,6 +99,9 @@ 获取来自应用和其他发送者的通知 notice Get notifications from the app + རྒྱུད་ཁོངས་ + བརྡ་ཐོ་ + ཉེར་སྤྱད་གོ་རིམ་ཁྲོད་ནས་བརྡ་ཐོ་གཏོང་དགོས། xitong @@ -88,6 +112,9 @@ 平衡 power Balance + རྒྱུད་ཁོངས་ + གློག་ཁུངས་ + དོ་མཉམ། xitong @@ -98,6 +125,9 @@ 节能 power Saving + རྒྱུད་ཁོངས་ + གློག་ཁུངས་ + ནུས་ཁུངས་གྲོན་ཆུང་ xitong @@ -108,26 +138,61 @@ 自定义 power Custom + རྒྱུད་ཁོངས་ + གློག་ཁུངས་ + མཚན་ཉིད་རང་འཇོག་ xitong - zhuomiangongxiang - zidingyi + yuanchengzhuomian + ninbixuweibbenjijiqiquerenmeicifangwen 系统 - 桌面共享 - 共享 + 远程桌面 + 您必须为本机机器确认每次访问 vino - Remote + You must confirm every visit for this machine + རྒྱུད་ཁོངས་ + ཝེ་ནོ་ཡིས་བཤད་རྒྱར། + ཁྱེད་ཚོས་ངེས་པར་དུ་འཕྲུལ་ཆས་འདིའི་འཚམས་འདྲི་ཚང་མ་གཏན་འཁེལ xitong - zhuomiangongxiang + yuanchengzhuomian yunxuqitarenyuanchenglianjienindezhuomian 系统 - 桌面共享 + 远程桌面 允许其他人远程连接您的桌面 vino Allow others to view your desktop + རྒྱུད་ཁོངས་ + ཝེ་ནོ་ཡིས་བཤད་རྒྱར། + མི་གཞན་གྱིས་ཁྱོད་ཀྱི་ཅོག་ཙེའི་སྟེང་གི་ཅོག་ཙེ + + + xitong + yuanchengzhuomian + yunxuqitarenyuanchenglianjienindezhuomianbingkongzhinindepingmu + 系统 + 远程桌面 + 允许其他人远程连接您的桌面并控制您的屏幕 + vino + Allow connection to control screen + རྒྱུད་ཁོངས་ + ཝེ་ནོ་ཡིས་བཤད་རྒྱར། + འབྲེལ་མཐུད་བྱས་ནས་བརྙན་ཤེལ་ཚོད་འཛིན་བྱེད་དུ + + + xitong + yuanchengzhuomian + yaoqiuyonghushurucimima: + 系统 + 远程桌面 + 要求用户输入此密码: + vino + Require user to enter this password: + རྒྱུད་ཁོངས་ + ཝེ་ནོ་ཡིས་བཤད་རྒྱར། + སྤྱོད་མཁན་གྱིས་གསང་གྲངས་འདིའི་ནང་དུ་འཇུག་དགོས་པའི་བླང་བྱ་ xitong @@ -138,6 +203,9 @@ 选择输出设备 audio Output Device + རྒྱུད་ཁོངས་ + སྒྲ། + ཕྱིར་འདོན་སྒྲིག་ཆས་འདེམས་པ། xitong @@ -148,6 +216,9 @@ 主音量大小 audio Master Volume + རྒྱུད་ཁོངས་ + སྒྲ། + སྒྲ་ཚད་གཙོ་བོའི་ཆེ་ཆུང་ xitong @@ -158,6 +229,9 @@ 声道平衡 audio Channel Balance + རྒྱུད་ཁོངས་ + སྒྲ། + སྒྲ་ལམ་དོ་མཉམ་ xitong @@ -168,6 +242,9 @@ 选择输入设备 audio Input Device + རྒྱུད་ཁོངས་ + སྒྲ། + བདམས་པའི་ནང་འཇུག་སྒྲིག་ཆས། xitong @@ -178,6 +255,9 @@ 音量大小 audio Volume + རྒྱུད་ཁོངས་ + སྒྲ། + སྒྲ་ཚད་ཆེ་ཆུང་ xitong @@ -188,6 +268,9 @@ 输入反馈 audio Input Level + རྒྱུད་ཁོངས་ + སྒྲ། + ནང་འདྲེན་ལྡོག་སྐྱེལ། xitong @@ -198,6 +281,9 @@ 系统音效 audio System Sound + རྒྱུད་ཁོངས་ + སྒྲ། + རྒྱུད་ཁོངས་སྒྲ་ནུས་ xitong @@ -208,6 +294,9 @@ 开机 audio Startup Music + རྒྱུད་ཁོངས་ + སྒྲ། + པར་ལེན་བྱེད་འགོ་ཚུགས་པ་ xitong @@ -218,6 +307,9 @@ 关机 audio Poweroff Music + རྒྱུད་ཁོངས་ + སྒྲ། + ཁ་རྒྱག xitong @@ -228,6 +320,9 @@ 注销 audio Logout Music + རྒྱུད་ཁོངས་ + སྒྲ། + ཐོ་ཁོངས་ནས་སུབ་པ། xitong @@ -238,6 +333,9 @@ 唤醒 audio Wakeup Music + རྒྱུད་ཁོངས་ + སྒྲ། + རྨོངས་གཉིད་ལས་སད་པ་ xitong @@ -248,6 +346,9 @@ 提示音量开关 audio Beep Switch + རྒྱུད་ཁོངས་ + སྒྲ། + དྲན་སྐུལ་སྒྲ་ཚད་བསད་སྤར། xitong @@ -258,6 +359,9 @@ 系统音效主题 audio Sound Theme + རྒྱུད་ཁོངས་ + སྒྲ། + རྒྱུད་ཁོངས་སྒྲ་ནུས་བརྗོད་བྱ་གཙོ་བོ་ xitong @@ -268,6 +372,9 @@ 通知提示 audio Alert Sound + རྒྱུད་ཁོངས་ + སྒྲ། + བརྡ་སྦྱོར་གསལ་འདེབས། xitong @@ -278,6 +385,9 @@ 音量调节 audio Volume Change + རྒྱུད་ཁོངས་ + སྒྲ། + སྒྲ་ཚད་འཚམ་སྒྲིག་ xitong @@ -288,36 +398,113 @@ 开启投屏 Projection open Projection + རྒྱུད་ཁོངས་ + ཡོལ་བ་འབྱེད་པ་ + སྒོ་ཕྱེ་ནས་བརྙན་གཏོང་བ། xitong - chumoping + chumojiaozhun xianshiqi 系统 - 触摸屏 + 触摸校准 显示器 - touchscreen + touchcalibrate monitor + རྒྱུད་ཁོངས་ + རེག་དག་བཅོས་ + འཆར་ཆས་ xitong - chumoping + chumojiaozhun chumopingbiaoshi 系统 - 触摸屏 + 触摸校准 触摸屏标识 - touchscreen + touchcalibrate touch id + རྒྱུད་ཁོངས་ + རེག་དག་བཅོས་ + ཐུག་རེག་ཡོལ་ངོས་མཚོན་རྟགས། xitong - chumoping + chumojiaozhun chumoshebei 系统 - 触摸屏 + 触摸校准 触摸设备 - touchscreen + touchcalibrate input device + རྒྱུད་ཁོངས་ + རེག་དག་བཅོས་ + རེག་ཆས་ + + + shebei + pingbanyuchumoping + chumopingshoushi + 设备 + 平板与触摸屏 + 触摸屏手势 + touchscreen + touchscreen gesture + སྒྲིག་ཆས། + ཐུག་རེག་ཡོལ་བ་ + རེག་ཤེལ་ལག་བརྡ་ + + + shebei + pingbanyuchumoping + gengduoshoushi + 设备 + 平板与触摸屏 + 更多手势 + touchscreen + more gesture + སྒྲིག་ཆས། + ཐུག་རེག་ཡོལ་བ་ + དེ་བས་མང་བའི་ལག་བརྡ། + + + shebei + pingbanyuchumoping + pingbanmoshi + 设备 + 平板与触摸屏 + 平板模式 + touchscreen + Tablet Mode + སྒྲིག་ཆས། + ཐུག་རེག་ཡོལ་བ་ + ངོས་ལེབ་རྣམ་པ་ + + + shebei + duopingxietong + toupingdaocidiannao + 设备 + 多屏协同 + 投屏到此电脑 + projection + projection to the pc + སྒྲིག་ཆས། + ཡོལ་མང་མཐུན་སྦྱོར་ + བརྙན་ངོས་སུ་བཞག་ནས་གློག་ཀླད་འདིར་ཐོན། + + + shebei + duopingxietong + lianjiedaowuxianxianshiqi + 设备 + 多屏协同 + 连接到无线显示器 + projection + projection to the pc + སྒྲིག་ཆས། + ཡོལ་མང་མཐུན་སྦྱོར་ + འབྲེལ་མཐུད་སྐུད་མེད་འཆར་ཆས་། shebei @@ -328,6 +515,9 @@ 在任务栏上显示蓝牙图标 Bluetooth Show icon on taskbar + སྒྲིག་ཆས། + སོ་སྔོན་ + ལས་འགན་སྒྲོམ་བུའི་ཐོག་ལན་ཡ་རིས་རྟགས་ལས་མངོན་པར་གཞིགས་ན་། shebei @@ -338,6 +528,9 @@ 可被附近的蓝牙设备发现 Bluetooth Discoverable by nearby Bluetooth devices + སྒྲིག་ཆས། + སོ་སྔོན་ + འོན་ཀྱང་ཉེ་འགྲམ་གྱི་ལན་ཡ་སྒྲིག་ཆས་ཀྱིས་ཤེས། shebei @@ -348,6 +541,9 @@ 蓝牙设备 Bluetooth Other Devices + སྒྲིག་ཆས། + སོ་སྔོན་ + སོ་སྔོན་སྒྲིག་ཆས་ shebei @@ -358,6 +554,9 @@ 通用设置 keyboard General settings + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + ཀུན་སྤྱོད་སྒྲིག་འགོད་ shebei @@ -368,6 +567,9 @@ 启用按键重复设置 keyboard Enable Repeat Key + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + མཐེབ་བསྐྱར་སྒྲིག་སྤྱོད་ shebei @@ -378,6 +580,9 @@ 延迟 keyboard Delay + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + ཕྱིར་འགྱངས་ shebei @@ -388,6 +593,9 @@ 速度 keyboard Speed + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + མྱུར་ཚད། shebei @@ -398,6 +606,9 @@ 输入字符测试重复效果 keyboard Test Repetition Effect + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + ནང་འདྲེན་ཡིག་རྟགས་ཚོད་ལེན་བསྐྱར་ཟློས། shebei @@ -408,6 +619,9 @@ 启用按键提示 keyboard Tip of Keyboard + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + མཐེབ་གནོན་སྣེ་སྟོན་ shebei @@ -418,6 +632,9 @@ 输入法设置 keyboard Input settings + སྒྲིག་ཆས། + མཐེབ་གཞོང་། + འཇུག་ཐབས་སྒྲིག་འགོད། shebei @@ -428,16 +645,22 @@ 鼠标键设置 mouse Mouse button settings + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ཙིག་མཐེབ་སྒྲིག་འགོད། shebei shubiao - guanyongshou + zhuanniu 设备 鼠标 - 惯用手 + 主按钮 mouse - Hand Habit + Dominant hand + སྒྲིག་ཆས། + ཙིག་རྟགས་ + མཐེབ་གནོན་གཙོ་བོ་ shebei @@ -448,6 +671,9 @@ 鼠标滚轮速度 mouse Wheel Speed + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ཙིག་རྟགས་ཀྱི་འཁོར་ལོའི་འགྲོས་ཚད། shebei @@ -458,6 +684,9 @@ 鼠标双击间隔时长 mouse Doubleclick Delay + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ཙིག་རྟགས་ཉིས་རྡེབ་བར་ཆོད་དུས་ཚོད་རིང་བ་། shebei @@ -468,6 +697,9 @@ 指针设置 mouse Pointer set + སྒྲིག་ཆས། + ཙིག་རྟགས་ + སྟོན་ཁབ་སྒྲིག་འགོད། shebei @@ -478,6 +710,9 @@ 速度 mouse speed + སྒྲིག་ཆས། + ཙིག་རྟགས་ + འགྲོས་ཚད། shebei @@ -488,6 +723,9 @@ 鼠标加速 mouse Acceleration + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ཙིག་རྟགས་འགྲོས་སྣོན་ shebei @@ -498,6 +736,9 @@ 按Ctrl键显示指针位置 mouse Visibility + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ctrl མནན་དུས་ཕྱོགས་སྟོན་གྱི་གནས་བབ་མངོན་པར་བྱེད་དགོས། shebei @@ -508,6 +749,9 @@ 指针大小 mouse Pointer Size + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ཕྱོགས་སྟོན་འཁོར་ལོ་ཆེ་ཆུང་། shebei @@ -518,6 +762,9 @@ 光标设置 mouse Cursor set + སྒྲིག་ཆས། + ཙིག་རྟགས་ + འོད་རྟགས་སྒྲིག་འགོད། shebei @@ -528,6 +775,9 @@ 启用文本区域的光标闪烁 mouse Enable Flashing on Text Area + སྒྲིག་ཆས། + ཙིག་རྟགས་ + ཡིག་དེབ་ཁུལ་གྱི་འོད་རྟགས་འཚེར་བ། shebei @@ -538,6 +788,9 @@ 光标速度 mouse Cursor Speed + སྒྲིག་ཆས། + ཙིག་རྟགས་ + འོད་རྟགས་འགྲོས་ཚད་ shebei @@ -548,6 +801,9 @@ 添加打印机和扫描仪 printer Add Printers And Scanners + སྒྲིག་ཆས། + པར་འཁོར་ + པར་འཁོར་དང་བཤར་འབེབས་ཆས་ཁ་སྣོན་བྱེད་པ་ shebei @@ -558,6 +814,9 @@ 打开文件管理器 shortcut open file manager + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + ཡིག་ཆ་ཁ་འབྱེད་དོ་དམ་ཆས་ shebei @@ -568,6 +827,9 @@ 锁住屏幕 shortcut Lock Screen + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + སྒྲོག་བཀག་བརྙན་ཡོལ་། shebei @@ -578,6 +840,9 @@ 截图 shortcut screenshot + མྱུར་མཐེབ་ + མྱུར་མཐེབ་ + བཅད་རིས་ shebei @@ -588,6 +853,9 @@ 打开终端 shortcut Open terminal + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + ཕྱེ་བའི་མཐའ་སྣེ་ shebei @@ -598,6 +866,9 @@ 打开控制面板 shortcut Open control center + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + ཚོད་འཛིན་ངོས་པང་ཁ་ཕྱེ། shebei @@ -608,6 +879,9 @@ 显示全局搜索 shortcut Show global search + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + ཁྱོན་ཡོངས་འཆར་བཤེར་འཚོལ་ shebei @@ -618,6 +892,9 @@ 展开侧边栏 shortcut Expand sidebar + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + གཞོགས་འགྲམ་སྡེ་སྤེལ་བ། shebei @@ -628,6 +905,9 @@ 打开系统监视器 shortcut Turn on the system monitor + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + རྒྱུད་ཁོངས་ལྟ་ཞིབ་ཆས་ཁ་འབྱེད་ shebei @@ -638,6 +918,9 @@ 打开工作区 shortcut Open workspace + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + ལས་ཀའི་ཁུལ་ཁ་ཕྱེ། shebei @@ -648,6 +931,9 @@ 截取窗口的截图 shortcut Screenshot of the capture window + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + བཅད་ལེན་སྒེའུ་ཁུང་གི་བཅད་རིས་ shebei @@ -658,16 +944,87 @@ 自定义快捷键 shortcut Customize Shortcut + སྒྲིག་ཆས། + མྱུར་མཐེབ་ + མཚན་ཉིད་རང་འཇོག་མྱུར་མཐེབ། shebei - chumoban + chukongban charushubiaoshijinyongchumoban 设备 - 触摸板 + 触控板 插入鼠标时禁用触摸板 touchpad Disable touchpad when using the mouse + སྒྲིག་ཆས། + རེག་པང་ + ཙིག་རྟགས་བར་འཇུག་སྐབས་རེག་པང་བེད་སྤྱོད་བྱས་མི་ཆོག་། + + + shebei + chukongban + zhizhensudu + 设备 + 触控板 + 指针速度 + touchpad + pointer speed + སྒྲིག་ཆས། + རེག་པང་ + སྟོན་ཁབ་འགྲོས་ཚད་ + + + shebei + chukongban + dazishijinyongchukongban + 设备 + 触控板 + 打字时禁用触控板 + touchpad + disable touchpad when typing + སྒྲིག་ཆས། + རེག་པང་ + ཡི་གེ་བརྟག་དུས་སྤྱོད་མི་ཆོག་པའི་འཕྲད་ཚོད་འཛིན་པང་། + + + shebei + chukongban + chukongbanqingchudianji + 设备 + 触控板 + 触控板轻触点击 + touchpad + touch and click on the touchpad + སྒྲིག་ཆས། + རེག་པང་ + འཕྲད་འཛིན་པང་ཡང་རེག་གནོན་ + + + shebei + chukongban + gundongtiaogensuishouzhihuadong + 设备 + 触控板 + 滚动条跟随手指滑动 + touchpad + scroll bar slides with finges + སྒྲིག་ཆས། + རེག་པང་ + འགྲིལ་དོན་ཚན་དང་མཉམ་དུ་མཛུབ་མོ་འདྲེད་། + + + shebei + chukongban + gundongquyu + 设备 + 触控板 + 滚动区域 + touchpad + scrolling area + སྒྲིག་ཆས། + རེག་པང་ + འགྲིལ་མཚམས་ wangluo @@ -678,6 +1035,9 @@ 自动设置代理 proxy Auto set proxy + དྲ་རྒྱ། + ལས་ཚབ་ + རང་འཛུགས་ལས་ཚབ་ wangluo @@ -688,6 +1048,9 @@ 开启自动代理 proxy Auto Proxy + དྲ་རྒྱ། + ལས་ཚབ་ + རང་འགུལ་ལས་ཚབ་ཕྱེ་ wangluo @@ -698,6 +1061,9 @@ 手动设置代理 proxy Manual set proxy + དྲ་རྒྱ། + ལས་ཚབ་ + ལག་སྒུལ་ལས་ཚབ་འཛུགས་པ་ wangluo @@ -708,6 +1074,9 @@ 开启手动代理 proxy Manual Proxy + དྲ་རྒྱ། + ལས་ཚབ་ + ལག་སྒུལ་ལས་ཚབ་ཁ་ཕྱེ་བ། wangluo @@ -718,26 +1087,74 @@ 添加VPN连接 vpn Add Vpn Connection + དྲ་རྒྱ། + VPN + VPNཁ་སྣོན་འབྲེལ་མཐུད་ wangluo - wangluolianjie - wangluozhuangtai + youxianwangluo + kaiqi 网络 - 网络连接 - 网络状态 + 有线网络 + 开启 netconnect - Netconnect Status + open + དྲ་རྒྱ། + སྐུད་ཡོད་བརྙན་འཕྲིན་དྲ་བ། + སྒོ་ཕྱེ་བ། wangluo - wangluolianjie - keyongwangluo + youxianwangluo + gaojishezhi 网络 - 网络连接 - 可用网络 + 有线网络 + 高级设置 netconnect - Available Network + Advanced settings + དྲ་རྒྱ། + སྐུད་ཡོད་བརྙན་འཕྲིན་དྲ་བ། + སྔོན་ཐོན་གྱི་སྒྲག་བཀོད། + + + wangluo + yidongredian + kaiqi + 网络 + 移动热点 + 开启 + mobilehotspot + open + དྲ་རྒྱ། + སྒུལ་བདེའི་ཧའོ་ཚི་ཀུང་སི། + སྒོ་ཕྱེ་བ། + + + wangluo + wuxianjuyuwang + kaiqi + 网络 + 无线局域网 + 开启 + wlanconnect + open + དྲ་རྒྱ། + ཝུའུ་ལན་འབྲེལ་མཐུད། + སྒོ་ཕྱེ་བ། + + + wangluo + wuxianjuyuwang + wangka + 网络 + 无线局域网 + 网卡 + wlanconnect + card + དྲ་རྒྱ། + ཝུའུ་ལན་འབྲེལ་མཐུད། + བྱང་བུ། gexinghua @@ -748,6 +1165,9 @@ 字体大小 fonts Fonts Size + རང་གཤིས་ཅན། + ཡིག་གཟུགས། + ཡིག་གཟུགས་ཆེ་ཆུང་ gexinghua @@ -758,6 +1178,9 @@ 字体选择 fonts Fonts Select + རང་གཤིས་ཅན། + ཡིག་གཟུགས། + ཡིག་གཟུགས་གདམ་གསེས། gexinghua @@ -768,6 +1191,9 @@ 等宽字体 fonts Mono font + རང་གཤིས་ཅན། + ཡིག་གཟུགས། + ཞེང་མཚུངས་ཡིག་གཟུགས། gexinghua @@ -778,6 +1204,9 @@ 锁屏界面 screenlock Screenlock Interface + རང་གཤིས་ཅན། + སྒྲོག་ཡོལ། + སྒྲོག་ཡོལ་མཐུད་མཚམས་ gexinghua @@ -788,6 +1217,9 @@ 锁屏设置 screenlock Screenlock + རང་གཤིས་ཅན། + སྒྲོག་ཡོལ། + སྒྲོག་ཡོལ་སྒྲིག་འགོད། gexinghua @@ -798,6 +1230,9 @@ 显示锁屏壁纸在登录页面 screenlock Show Picture of Screenlock on Screenlogin + རང་གཤིས་ཅན། + སྒྲོག་ཡོལ། + འཆར་ངོས་ཀྱི་རྩིག་ཤོག་གིས་དྲ་ངོས་སུ་ཐོ་འགོད་བྱེད་བཞིན་འདུག gexinghua @@ -808,6 +1243,9 @@ 激活屏保时锁定屏幕 screenlock Lock Screen on Screensaver Boot + རང་གཤིས་ཅན། + སྒྲོག་ཡོལ། + གྲུང་སྐུལ་ཡོལ་སྲུང་སྐབས་དམིགས་འཛིན་བརྙན་ཡོལ་ gexinghua @@ -818,6 +1256,9 @@ 选择锁屏背景 screenlock Select Screenlock + རང་གཤིས་ཅན། + སྒྲོག་ཡོལ། + སྒྲོག་ཡོལ་བདམས་རྒྱབ་ལྗོངས་། gexinghua @@ -828,6 +1269,9 @@ 屏幕保护程序 screensaver Select Screenlock + རང་གཤིས་ཅན། + སྒྲིབ་སྲུང་ + བརྙན་ཡོལ་སྲུང་སྐྱོབ་བྱ་རིམ། gexinghua @@ -838,6 +1282,9 @@ 显示休息时间 screensaver Show rest time + རང་གཤིས་ཅན། + སྒྲིབ་སྲུང་ + ལས་མངོན་པར་གཞིགས་ན་།ངལ་གསོའི་དུས་ཚོད་ gexinghua @@ -848,6 +1295,9 @@ 此时间段后开启屏保 screensaver Idle time + རང་གཤིས་ཅན། + སྒྲིབ་སྲུང་ + དུས་ཚོད་འདིའི་རྗེས་ནས་མགོ་བརྩམས་།ཡོལ་ངོས་ཀྱི་འགན་བཅོལ་བྱེད་ལམ་གསར་པའི་། gexinghua @@ -858,6 +1308,9 @@ 主题模式 theme Theme Mode + རང་གཤིས་ཅན། + བརྗོད་བྱ་གཙོ་བོ། + བརྗོད་དོན་གཙོ་བོའི་རྣམ་པ། gexinghua @@ -868,6 +1321,9 @@ 图标主题 theme Icon Theme + རང་གཤིས་ཅན། + བརྗོད་བྱ་གཙོ་བོ། + རིས་རྟགས་བརྗོད་བྱ་གཙོ་བོ་ gexinghua @@ -878,6 +1334,9 @@ 光标主题 theme Cursor Theme + རང་གཤིས་ཅན། + བརྗོད་བྱ་གཙོ་བོ། + འོད་རྟགས་བརྗོད་བྱ་གཙོ་བོ་ gexinghua @@ -888,6 +1347,9 @@ 效果设置 theme Effect setting + རང་གཤིས་ཅན། + བརྗོད་བྱ་གཙོ་བོ། + ཕན་འབྲས་སྒྲིག་འགོད། gexinghua @@ -898,6 +1360,9 @@ 特效模式 theme Performance Mode + རང་གཤིས་ཅན། + བརྗོད་བྱ་གཙོ་བོ། + གྲུབ་འབྲས་ཀྱི་དཔེ་དབྱིབས། gexinghua @@ -908,6 +1373,9 @@ 透明度 theme Transparency + རང་གཤིས་ཅན། + བརྗོད་བྱ་གཙོ་བོ། + ཕྱི་གསལ་ནང་གསལ། gexinghua @@ -918,6 +1386,9 @@ 桌面背景 wallpaper Wallpaper + རང་གཤིས་ཅན། + རྒྱབ་ལྗོངས། + གྱང་ཤོག gexinghua @@ -928,6 +1399,9 @@ 选择背景形式 wallpaper Background Mode + རང་གཤིས་ཅན། + རྒྱབ་ལྗོངས། + རྒྱབ་ལྗོངས་རྣམ་པ་འདེམས་པ། zhanghu @@ -936,8 +1410,11 @@ 账户 云账户 同步您的设置 - networkaccount + Cloud Account Sync your settings + ཐོ་ཁོངས་ + སྤྲིན་པའི་རྩིས་ཁྲ་ + དུས་མཉམ་དུ་ཁྱེད་རང་གི་བཀོད་སྒྲིག་། zhanghu @@ -946,8 +1423,11 @@ 账户 云账户 自动同步 - networkaccount + Cloud Account Auto sync + ཐོ་ཁོངས་ + སྤྲིན་པའི་རྩིས་ཁྲ་ + རང་འགུལ་གོམ་མཉམ། zhanghu @@ -958,6 +1438,9 @@ 当前用户 userinfo CurrentUser + ཐོ་ཁོངས་ + ཐོ་ཁུངས་ཆ་འཕྲིན་ + མིག་སྔའི་སྤྱོད་མཁན་ zhanghu @@ -968,6 +1451,9 @@ 免密登录 userinfo Login without Password + ཐོ་ཁོངས་ + ཐོ་ཁུངས་ཆ་འཕྲིན་ + གསང་བའི་ཐོ་འགོད། zhanghu @@ -978,6 +1464,9 @@ 开机自动登录 userinfo Auto Login + ཐོ་ཁོངས་ + ཐོ་ཁུངས་ཆ་འཕྲིན་ + ཐོག་པར་ལེན་བྱེད་འགོ་ཚུགས་པ་།རང་འགུལ་ཐོ་འཇུག་ zhanghu @@ -988,6 +1477,9 @@ 其他用户 userinfo OthersUser + ཐོ་ཁོངས་ + ཐོ་ཁུངས་ཆ་འཕྲིན་ + སྤྱོད་མཁན་གཞན་དག་ zhanghu @@ -998,6 +1490,9 @@ 添加新用户 userinfo Add new user + ཐོ་ཁོངས་ + ཐོ་ཁུངས་ཆ་འཕྲིན་ + སྤྱོད་མཁན་གསར་པ་ཁ་སྣོན་ shijianyuyan @@ -1008,6 +1503,9 @@ 当前区域 area Current Area + དུས་ཚོད་སྐད་བརྡ་ + ཁུལ་ཁོངས་སྐད་བརྡ་ + མིག་སྔའི་མཚམས་ཁོངས། shijianyuyan @@ -1018,6 +1516,9 @@ 显示日期、时间、货币格式的区域 area display format area + དུས་ཚོད་སྐད་བརྡ་ + ཁུལ་ཁོངས་སྐད་བརྡ་ + ཚེས་གྲངས་དང་།དུས་ཚོད།དངུལ་ལོར་གྱི་རྣམ་གཞག་མངོན་པའི་ས་ཁོངས་ shijianyuyan @@ -1028,6 +1529,9 @@ 区域格式数据 area Regional Format Data + དུས་ཚོད་སྐད་བརྡ་ + ཁུལ་ཁོངས་སྐད་བརྡ་ + ཁུལ་ཁོངས་རྣམ་གཞག་གཞི་གྲངས། shijianyuyan @@ -1038,6 +1542,9 @@ 首选语言 area first language + དུས་ཚོད་སྐད་བརྡ་ + ཁུལ་ཁོངས་སྐད་བརྡ་ + སྔོན་འདེམས་སྐད་བརྡ་ shijianyuyan @@ -1048,6 +1555,9 @@ 显示语言 area system language + དུས་ཚོད་སྐད་བརྡ་ + ཁུལ་ཁོངས་སྐད་བརྡ་ + འཆར་བའི་སྐད་བརྡ། shijianyuyan @@ -1058,67 +1568,166 @@ 添加首语言 area Add Main Language + དུས་ཚོད་སྐད་བརྡ་ + ཁུལ་ཁོངས་སྐད་བརྡ་ + མགོ་སྣོན་སྐད་བརྡ། shijianyuyan shijianheriqi dangqianshijian 时间语言 - 时间日期 + 时间和日期 当前时间 Date current date + དུས་ཚོད་སྐད་བརྡ་ + དུས་ཚོད་ཚེས་གྲངས། + མིག་སྔའི་དུས་ཚོད། shijianyuyan shijianheriqi xiaoshizhi 时间语言 - 时间日期 + 时间和日期 24小时制 Date 24-hour Clock + དུས་ཚོད་སྐད་བརྡ་ + དུས་ཚོད་ཚེས་གྲངས། + ཆུ་ཚོད་24ཡི་ལམ་ལུགས། shijianyuyan shijianheriqi tongbuwangluoshijian 时间语言 - 时间日期 + 时间和日期 同步网络时间 Date Sync Network Time + དུས་ཚོད་སྐད་བརྡ་ + དུས་ཚོད་ཚེས་གྲངས། + གོམ་མཉམ་དྲ་རྒྱའི་དུས་ཚོད། shijianyuyan shijianheriqi shijianfuwuqi 时间语言 - 时间日期 + 时间和日期 时间服务器 Date Sever + དུས་ཚོད་སྐད་བརྡ་ + དུས་ཚོད་ཚེས་གྲངས། + དུས་ཚོད་ཞབས་ཞུ་ཆས་ shijianyuyan shijianheriqi qitashiqu 时间语言 - 时间日期 + 时间和日期 其他时区 Date Other Timezone + དུས་ཚོད་སྐད་བརྡ་ + དུས་ཚོད་ཚེས་གྲངས། + དུས་ཁུལ་གཞན་དག་ shijianyuyan shijianheriqi tianjiashiqu 时间语言 - 时间日期 + 时间和日期 添加时区 Date Add Timezone - + དུས་ཚོད་སྐད་བརྡ་ + དུས་ཚོད་ཚེས་གྲངས། + སྣོན་དུས་ཁུལ། + + + gengxin + beifen + kaishibeifen + 更新 + 备份 + 开始备份 + Backup + Backup + གསར་སྒྱུར་ + གྲབས་ཉར་ + གྲབས་ཉར་མགོ་བརྩམས་། + + + gengxin + beifen + kaishihuanyuan + 更新 + 备份 + 开始还原 + Backup + Restore + གསར་སྒྱུར་ + གྲབས་ཉར་ + སོར་ལོག་མགོ་བརྩམས་། + + + gengxin + gengxin + chakangengxinlishi + 更新 + 更新 + 查看更新历史 + upgrade + View history + གསར་སྒྱུར་ + གསར་སྒྱུར་ + ལོ་རྒྱུས་གསར་སྒྱུར་ལ་ལྟ་ཞིབ་ + + + gengxin + gengxin + gengxinshezhi + 更新 + 更新 + 更新设置 + upgrade + Update Settings + གསར་སྒྱུར་ + གསར་སྒྱུར་ + གསར་སྒྱུར་སྒྲིག་འགོད། + + + gengxin + gengxin + yunxutongzhikegengxindeyingyong + 更新 + 更新 + 允许通知可更新的应用 + upgrade + Allowed to renewable notice + གསར་སྒྱུར་ + གསར་སྒྱུར་ + བརྡ་སྦྱོར་བྱས་ཆོག་གསར་སྒྱུར་བྱེད་པའི་ཉེར་སྤྱོད་ + + + gengxin + gengxin + zidongxiazaiheanzhuanggengxin + 更新 + 更新 + 自动下载和安装更新 + upgrade + Automatically download and install updates + གསར་སྒྱུར་ + གསར་སྒྱུར་ + རང་འགུལ་ཕབ་ལེན་དང་སྒྲིག་སྦྱོར་གསར་སྒྱུར་ + yingyong kaijiqidong @@ -1128,6 +1737,9 @@ 添加自启动程序 autoboot Add autoboot program + ཉེར་སྤྱོད། + པར་ལེན་བྱེད་འགོ་ཚུགས་པ་ + རང་སློང་བྱ་རིམ་སྣོན་པ། yingyong @@ -1138,6 +1750,9 @@ 浏览器 defaultapp Browser + ཉེར་སྤྱོད། + སོར་བཞག་ཉེར་སྤྱོད། + བཤར་ཆས་ yingyong @@ -1148,6 +1763,9 @@ 电子邮件 defaultapp Mail + ཉེར་སྤྱོད། + སོར་བཞག་ཉེར་སྤྱོད། + གློག་རྡུལ་སྦྲག་རྫས། yingyong @@ -1158,6 +1776,9 @@ 图像查看器 defaultapp Image Viewer + ཉེར་སྤྱོད། + སོར་བཞག་ཉེར་སྤྱོད། + བརྙན་རིས་ལྟ་ཆས། yingyong @@ -1168,6 +1789,9 @@ 音乐播放器 defaultapp Audio Player + ཉེར་སྤྱོད། + སོར་བཞག་ཉེར་སྤྱོད། + རོལ་དབྱངས་གཏོང་ཆས་ yingyong @@ -1178,6 +1802,9 @@ 视频播放器 defaultapp Video Player + ཉེར་སྤྱོད། + སོར་བཞག་ཉེར་སྤྱོད། + བརྙན་ཟློས་གཏོང་ཆས་ yingyong @@ -1188,45 +1815,60 @@ 文档编辑器 defaultapp Text Editor + ཉེར་སྤྱོད། + སོར་བཞག་ཉེར་སྤྱོད། + ཡིག་ཚགས་རྩོམ་སྒྲིག་ཆས་ + + + anquan + anquanzhongxin + dakaianquanzhongxin + 安全 + 安全中心 + 打开安全中心 + securitycenter + Run Security Center + བདེ་འཇགས་ + བདེ་འཇགས་ལྟེ་གནས། + བདེ་འཇགས་ལྟེ་གནས་ཁ་ཕྱེ། sousuo - sousuo + quanjusousuo chuangjiansuoyin 搜索 - 搜索 + 全局搜索 创建索引 search Create index + བཤེར་འཚོལ་ + བཤེར་འཚོལ་ + གསལ་བང་གསར་བཟོ་ sousuo - sousuo - pingbiwenjianjia + quanjusousuo + paichudewenjianjia 搜索 - 搜索 - 屏蔽文件夹 + 全局搜索 + 排除的文件夹 search Block Folders + བཤེར་འཚོལ་ + བཤེར་འཚོལ་ + སྒྲིབ་ཡོལ་ཡིག་ཁུག་ sousuo - sousuo - sousuoyinqing - 搜索 - 搜索 - 搜索引擎 - search - Web Engine - - - sousuo - sousuo + quanjusousuo morenhulianwangsousuoyinqing 搜索 - 搜索 + 全局搜索 默认互联网搜索引擎 search Default web searching engine + བཤེར་འཚོལ་ + བཤེར་འཚོལ་ + སོར་བཞག་དྲ་སྦྲེལ་བཤེར་འཚོལ་སྒུལ་བྱེད་འཕྲུལ་ཆས་ diff --git a/shell/searchwidget.cpp b/shell/searchwidget.cpp index 4e89c68..7156ad3 100644 --- a/shell/searchwidget.cpp +++ b/shell/searchwidget.cpp @@ -11,7 +11,6 @@ #include #include #include -#include extern "C" { #include @@ -29,6 +28,8 @@ const QStringList mavisFilterPathList = {"/Date/Set Time","/Date/24-hour clock", }; const QStringList filterPathList = { "/Display/Auto Brightness", "/Display/Dynamic light" }; +const QStringList openkylinFilterPathList = {"/Shortcut/Add", "/Shortcut/Customize Shortcut"}; + class ukCompleter : public QCompleter { @@ -42,6 +43,101 @@ public: bool eventFilter(QObject *o, QEvent *e) override; }; +ListViewDelegate::ListViewDelegate(QObject *parent):QStyledItemDelegate(parent) +{ + const QByteArray style_id("org.ukui.style"); + mgsetting = new QGSettings(style_id, QByteArray(), this); +} + + +void ListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + QRect rect; + rect.setX(option.rect.x()); + rect.setY(option.rect.y()); + rect.setWidth(option.rect.width()); + rect.setHeight(option.rect.height()); + + const qreal radius = 6; + QPainterPath path; + path.moveTo(rect.topRight() - QPointF(radius, 0)); + path.lineTo(rect.topLeft() + QPointF(radius, 0)); + path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius)); + path.lineTo(rect.bottomLeft() + QPointF(0, -radius)); + path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0)); + path.lineTo(rect.bottomRight() - QPointF(radius, 0)); + path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius)); + path.lineTo(rect.topRight() + QPointF(0, radius)); + path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0)); + + painter->setRenderHint(QPainter::Antialiasing); + QColor color = Qt::transparent; + QColor fontColor = qApp->palette().color(QPalette::ButtonText); + + bool g_themeFlag = false; + if(mgsetting && mgsetting->keys().contains("styleName")) { + QString styleName = mgsetting->get("styleName").toString(); + if(styleName == "ukui-dark" || styleName == "ukui-black") { + g_themeFlag = true; + } else { + g_themeFlag = false; + } + } + + if(!g_themeFlag){ + if(!(option.state & QStyle::State_Enabled)) { + color=QColor("#FFB3B3B3"); + } else if(((option.state & QStyle::State_HasFocus) || (option.state & QStyle::State_Selected)|| (option.state & QStyle::State_MouseOver))) { + if(option.state.testFlag(QStyle::State_HasFocus) && option.state.testFlag(QStyle::State_Selected)) {//QStyle::State_Enabled + color = option.palette.highlight().color(); + } else if((option.state & QStyle::State_MouseOver)) { + color = option.palette.highlight().color(); + fontColor = QColor(255,255,255); + } else { + color = option.palette.windowText().color(); + color.setAlphaF(0.05); + } + painter->save(); + painter->setPen(QPen(Qt::NoPen)); + painter->setBrush(color); + painter->drawPath(path); + painter->restore(); + } + } else { + + if(!(option.state & QStyle::State_Enabled)) { + color=QColor("#FFB3B3B3"); + } else if(((option.state & QStyle::State_HasFocus) || (option.state & QStyle::State_Selected)|| (option.state & QStyle::State_MouseOver))) { + if(option.state.testFlag(QStyle::State_HasFocus) && option.state.testFlag(QStyle::State_Selected)) { //QStyle::State_Enabled + color = option.palette.highlight().color(); + } else if((option.state & QStyle::State_MouseOver)) { + color = option.palette.highlight().color(); + fontColor = QColor(255,255,255); + } else { + color = option.palette.windowText().color(); + color.setAlphaF(0.15); + } + painter->save(); + painter->setPen(QPen(Qt::NoPen)); + painter->setBrush(color); + painter->drawPath(path); + painter->restore(); + } + } + QPen pen; + pen.setWidth(1); + pen.setColor(fontColor); + painter->setPen(pen); + auto str = index.model()->data(index,Qt::DisplayRole).toString(); + painter->drawText(rect.adjusted(12,0,0,0),Qt::AlignLeft|Qt::AlignVCenter,str); +} + +QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + return QSize(option.widget->width(),36); +} + + SearchWidget::SearchWidget(QWidget *parent) : QLineEdit(parent) , m_xmlExplain("") @@ -50,9 +146,11 @@ SearchWidget::SearchWidget(QWidget *parent) , m_bIstextEdited(false) { initExcludeSearch(); - m_model = new QStandardItemModel(this); m_completer = new ukCompleter(m_model, this); + QAbstractItemView *popup = m_completer->popup(); + m_pListViewDelegate = new ListViewDelegate(popup); + popup->setItemDelegate(m_pListViewDelegate); m_completer->popup()->setAttribute(Qt::WA_InputMethodEnabled); m_completer->setFilterMode(Qt::MatchContains);//设置QCompleter支持匹配字符搜索 m_completer->setCaseSensitivity(Qt::CaseInsensitive);//这个属性可设置进行匹配时的大小写敏感性 @@ -60,7 +158,6 @@ SearchWidget::SearchWidget(QWidget *parent) this->setCompleter(m_completer); m_completer->setWrapAround(false); m_completer->installEventFilter(this); - isExitBluetooth(); connect(this, &QLineEdit::textEdited, this, [ = ] { if (text() != "") { @@ -72,6 +169,27 @@ SearchWidget::SearchWidget(QWidget *parent) connect(this, &QLineEdit::textChanged, this, [ = ] { QString retValue = text(); + + + if (popup->model()->rowCount() == 0) { + m_model->appendRow(new QStandardItem(tr("No search results"))); + m_model->setData(m_model->index(m_model->rowCount() - 1, 0), text(), Qt::UserRole); + + } else { + if (m_model->data(m_model->index(m_model->rowCount() - 1, 0)) == tr("No search results")) { + while (m_model->data(m_model->index(m_model->rowCount() - 1, 0)) == tr("No search results")) { + m_model->clearItemData(m_model->index(m_model->rowCount() - 1, 0)); + m_model->removeRow(m_model->rowCount() - 1); + } + if (popup->model()->rowCount() == 0) { + m_model->appendRow(new QStandardItem(tr("No search results"))); + m_model->setData(m_model->index(m_model->rowCount() - 1, 0), text(), Qt::UserRole); + + } + } + + } + if (m_bIstextEdited) { m_bIstextEdited = false; return ; @@ -143,8 +261,12 @@ bool SearchWidget::jumpContentPathWidget(QString path) { #endif //the data.actualModuleName had translate to All lowercase qDebug() <<" actulaModuleName is:" << data.translateContent << " " << m_EnterNewPagelist[i].fullPagePath << m_EnterNewPagelist[i].fullPagePath.section('/', 1, 1); - Q_EMIT notifyModuleSearch(data.translateContent, m_EnterNewPagelist[i].fullPagePath.section('/', 1, 1));//fullPagePath need delete moduleName + Q_EMIT notifyModuleSearch(data.translateContent, m_EnterNewPagelist[i].fullPagePath.section('/', 1, 1), data.fullPagePath);//fullPagePath need delete moduleName bResult = true; + + // 埋点搜索插件 + Common::buriedSettings(m_EnterNewPagelist[i].fullPagePath, nullptr, QString("search")); + break; } } @@ -236,7 +358,12 @@ void SearchWidget::loadxml() { } else if (m_xmlExplain == XML_Explain_Path) { m_searchBoxStruct.fullPagePath = xmlRead.text().toString(); // mavis过滤掉的搜索项 - if ((Utils::isTablet() && mavisFilterPathList.contains(m_searchBoxStruct.fullPagePath)) || mExcludeList.contains(m_searchBoxStruct.fullPagePath)) { + if ((Common::isTablet() && mavisFilterPathList.contains(m_searchBoxStruct.fullPagePath)) || mExcludeList.contains(m_searchBoxStruct.fullPagePath)) { + continue; + } + + // openkylin 过滤掉的搜索项 + if (Common::isOpenkylin() && openkylinFilterPathList.contains(m_searchBoxStruct.fullPagePath)) { continue; } @@ -263,8 +390,7 @@ void SearchWidget::loadxml() { } if ((!g_file_test("/usr/sbin/ksc-defender", G_FILE_TEST_EXISTS) && m_searchBoxStruct.fullPagePath.contains("securitycenter",Qt::CaseInsensitive)) - || (!mIsExitBluetooth && m_searchBoxStruct.fullPagePath.contains("bluetooth",Qt::CaseInsensitive)) - || (!Utils::isCommunity() && m_searchBoxStruct.fullPagePath.contains("update")) ) { + || (!Common::isCommunity() && m_searchBoxStruct.fullPagePath.contains("update")) ) { break; } #ifndef __sw_64__ @@ -522,39 +648,26 @@ void SearchWidget::hiddenSearchItem(QString name, bool show) } void SearchWidget::initExcludeSearch() { - if (!Utils::isExistEffect()) { + if (!Common::isExistEffect()) { mExcludeList << "/Theme/Performance mode" << "/Theme/Transparency"; } - if (!Utils::isExitBattery()) { + if (!Common::isExitBattery()) { mExcludeList << "/Power/Battery saving plan"; } - if (Utils::isWayland() || !Utils::isExistEffect()) { + if (Common::isWayland() || !Common::isExistEffect()) { mExcludeList << "/Display/night mode"; } - if (!Utils::isTablet()) { + if (!Common::isTablet()) { mExcludeList << "/UserinfoIntel/Change Tel" << "/Display/Dynamic light"; } } -void SearchWidget::isExitBluetooth() -{ - QProcess process; - process.start("rfkill list"); - process.waitForFinished(); - QByteArray output = process.readAllStandardOutput(); - QString str_output = output; - bool isDevice = str_output.contains(QString("hci"), Qt::CaseInsensitive); - bool isAddress = true; - - mIsExitBluetooth = (isDevice && isAddress); -} - void SearchWidget::setLanguage(QString type) { m_lang = type; - if (type == "zh_CN" || type == "zh_HK" || type == "zh_TW") { + if (type == "zh_CN" || type == "zh_HK" || type == "zh_TW" || type == "bo_CN") { m_bIsChinese = true; m_completer->setCompletionRole(Qt::UserRole); //设置ItemDataRole } else { diff --git a/shell/searchwidget.h b/shell/searchwidget.h index c006bae..90a8fbc 100644 --- a/shell/searchwidget.h +++ b/shell/searchwidget.h @@ -1,7 +1,7 @@ #ifndef SEARCHWIDGET_H #define SEARCHWIDGET_H -#include "./utils/utils.h" +#include "interface/common.h" #include #include @@ -16,12 +16,30 @@ #include #include #include +#include +#include +#include + +#include const QString XML_Source = "source"; const QString XML_Title = "translation"; const QString XML_Numerusform = "numerusform"; const QString XML_Explain_Path = "extra-contents_path"; +class ListViewDelegate:public QStyledItemDelegate +{ +public: + ListViewDelegate(QObject*parent); + +protected: + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; + +private: + QGSettings *mgsetting = nullptr; +}; + class SearchWidget : public QLineEdit { Q_OBJECT @@ -51,7 +69,7 @@ private Q_SLOTS: void onCompleterActivated(QString value); Q_SIGNALS: - void notifyModuleSearch(QString, QString); + void notifyModuleSearch(QString, QString, QString); private: void loadxml(); @@ -63,7 +81,6 @@ private: void appendChineseData(SearchBoxStruct data); void clearSearchData(); void initExcludeSearch(); - void isExitBluetooth(); private: QStandardItemModel *m_model; @@ -82,7 +99,7 @@ private: QList m_TxtList; QStringList mExcludeList; - bool mIsExitBluetooth = false; int count; + ListViewDelegate *m_pListViewDelegate; }; #endif // SEARCHWIDGET_H diff --git a/shell/shell.pro b/shell/shell.pro index e367931..95ccb83 100644 --- a/shell/shell.pro +++ b/shell/shell.pro @@ -17,16 +17,19 @@ DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 include(../env.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/Label/label.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/FlowLayout/flowlayout.pri) +include($$PROJECT_ROOTDIR/libukcc/widgets/ImageUtil/imageutil.pri) +include($$PROJECT_ROOTDIR/libukcc/interface.pri) DEFINES += PLUGIN_INSTALL_DIRS='\\"$${PLUGIN_INSTALL_DIRS}\\"' +DEFINES += PLUGIN_INSTALL_UPDATE='\\"$${PLUGIN_INSTALL_UPDATE}\\"' LIBS += -L$$[QT_INSTALL_LIBS] -lX11 -lgsettings-qt -lXi -ldconf !contains(QMAKE_HOST.arch, sw_64){ LIBS += -L$$[QT_INSTALL_LIBS] -lukui-log4qt } -DEFINES+=KYDEBUG - -#LIBS += -L$$[QT_INSTALL_LIBS] -lkylinssoclient +DEFINES+= KYDEBUG ##加载gio库和gio-unix库,用于处理desktop文件 CONFIG += link_pkgconfig \ @@ -34,9 +37,12 @@ CONFIG += link_pkgconfig \ PKGCONFIG += gio-2.0 \ gio-unix-2.0 \ gsettings-qt \ - kysdk-waylandhelper \ libmatemixer \ - kysdk-qtwidgets + kysdk-waylandhelper \ + kysdk-diagnostics \ + kysdk-sysinfo \ + kysdk-qtwidgets \ + kysdk-waylandhelper desktop.files += ukui-control-center.desktop desktop.path = /usr/share/applications @@ -47,8 +53,11 @@ schemes.path = /usr/share/glib-2.0/schemas/ face.files += $$PROJECT_ROOTDIR/data/faces/ face.path = /usr/share/ukui/ -mo.files += $$PROJECT_ROOTDIR/data/installer-timezones.mo -mo.path = /usr/share/locale/zh_CN/LC_MESSAGES/ +moZH.files += $$PROJECT_ROOTDIR/data/zh_CN/installer-timezones.mo +moZH.path = /usr/share/locale/zh_CN/LC_MESSAGES/ + +moBO.files += $$PROJECT_ROOTDIR/data/bo_CN/installer-timezones.mo +moBO.path = /usr/share/locale/bo_CN/LC_MESSAGES/ guideCN.files += $$PROJECT_ROOTDIR/data/zh_CN/ guideCN.path += /usr/share/kylin-user-guide/data/guide/ukui-control-center/ @@ -67,7 +76,8 @@ INSTALLS += \ desktop \ schemes \ face \ - mo \ + moZH \ + moBO \ guideCN \ imageformats \ guideEN \ @@ -95,21 +105,17 @@ SOURCES += \ searchwidget.cpp \ titlewidget.cpp \ ukccabout.cpp \ - utils/devicesmonitor.cpp \ - utils/keyvalueconverter.cpp \ component/leftwidgetitem.cpp \ - utils/functionselect.cpp \ qtsingleapplication/qtsingleapplication.cpp \ qtsingleapplication/qtlocalpeer.cpp \ - utils/utils.cpp \ - utils/mthread.cpp \ + utils/functionselect.cpp \ + utils/keyvalueconverter.cpp \ utils/xatom-helper.cpp HEADERS += \ iconbutton.h \ component/leftmenulist.h \ customstyle.h \ - devicesmonitor.h \ leftsidebarwidget.h \ mainwindow.h \ interface.h \ @@ -125,14 +131,12 @@ HEADERS += \ searchwidget.h \ titlewidget.h \ ukccabout.h \ - utils/keyvalueconverter.h \ component/leftwidgetitem.h \ - utils/functionselect.h \ qtsingleapplication/qtsingleapplication_copy.h \ qtsingleapplication/qtsingleapplication.h \ qtsingleapplication/qtlocalpeer.h \ - utils/utils.h \ - utils/mthread.h \ + utils/functionselect.h \ + utils/keyvalueconverter.h \ utils/xatom-helper.h FORMS += \ diff --git a/shell/ukccabout.cpp b/shell/ukccabout.cpp index 1ce198b..b8100be 100644 --- a/shell/ukccabout.cpp +++ b/shell/ukccabout.cpp @@ -18,7 +18,8 @@ * */ #include "ukccabout.h" -#include "../utils/xatom-helper.h" +#include "xatom-helper.h" +#include "interface/common.h" #include #include @@ -32,6 +33,7 @@ UkccAbout::UkccAbout(QWidget *parent) setFixedSize(420, 344); setWindowTitle(tr("Settings")); initUI(); + hideComponent(); } bool UkccAbout::eventFilter(QObject *watch, QEvent *event) @@ -81,9 +83,6 @@ void UkccAbout::initUI() { Lyt_2->addWidget(mTipLabel_2); Lyt_2->addStretch(); - mTipLabel_1->hide(); - mTipLabel_2->hide(); - Lyt->addWidget(mIconLabel, 0, Qt::AlignHCenter); Lyt->addSpacing(8); Lyt->addWidget(mAppLabel, 0, Qt::AlignHCenter); @@ -92,6 +91,14 @@ void UkccAbout::initUI() { Lyt->addStretch(); } +void UkccAbout::hideComponent() +{ +#ifdef OPENKYLIN + mTipLabel_1->hide(); + mTipLabel_2->hide(); +#endif +} + QString UkccAbout::getUkccVersion() { FILE *pp = NULL; char *line = NULL; diff --git a/shell/ukccabout.h b/shell/ukccabout.h index 6094214..4749952 100644 --- a/shell/ukccabout.h +++ b/shell/ukccabout.h @@ -27,9 +27,10 @@ #include #include #include +#include -#include "widgets/Label/fixlabel.h" -#include "widgets/Label/lightlabel.h" +#include "fixlabel.h" +#include "lightlabel.h" class UkccAbout : public QDialog { @@ -50,6 +51,7 @@ private: private: void initUI(); + void hideComponent(); QString getUkccVersion(); signals: diff --git a/shell/ukui-control-center.desktop b/shell/ukui-control-center.desktop index 66d1f96..4b592e3 100644 --- a/shell/ukui-control-center.desktop +++ b/shell/ukui-control-center.desktop @@ -3,11 +3,12 @@ Name=Settings Name[zh_CN]=设置 Name[zh_HK]=设置 Name[zh_TW]=设置 +Name[bo_CN]=གསར་འཛུགས་ Name[tr]=Denetim Merkezi Comment=UKUI控制面板 Comment[tr]=UKUI Kontrol Merkezi Icon=ukui-control-center -Exec=ukui-control-center +Exec=/usr/bin/ukui-control-center Terminal=false Type=Application StartupNotify=true diff --git a/shell/utils/functionselect.cpp b/shell/utils/functionselect.cpp index f624da4..67cb6cd 100644 --- a/shell/utils/functionselect.cpp +++ b/shell/utils/functionselect.cpp @@ -47,8 +47,10 @@ QList FunctionSelect::updatePluginName; QList FunctionSelect::securityPluginName; QList FunctionSelect::appPluginName; QList FunctionSelect::searchPluginName; +QList FunctionSelect::currencyPluginName; -//FuncInfo FunctionSelect::displayStruct; +QList systemList, deviceList, networkList, personaliseList, accountList, + datetimeList, updateList, securityList, applicationList, searchList, currencyList; FunctionSelect::FunctionSelect() { @@ -61,61 +63,27 @@ FunctionSelect::~FunctionSelect() void FunctionSelect::loadHomeModule() { - QList systemList, deviceList, networkList, personaliseList, accountList, - datetimeList, updateList, securityList, applicationList, searchList; + QStringList updatePlugins; + QDir updatePluginDir, pluginsDir; bool installed = (QCoreApplication::applicationDirPath() == QDir(("/usr/bin")).canonicalPath()); - QDir pluginsDir; - if (installed) + if (installed) { pluginsDir = QDir(PLUGIN_INSTALL_DIRS); - else { + updatePluginDir = QDir(PLUGIN_INSTALL_UPDATE); + } else { pluginsDir = QDir(qApp->applicationDirPath() + "/plugins"); } + foreach (QString fileName, updatePluginDir.entryList(QDir::Files)) { + determineModule(fileName, updatePluginDir); + updatePlugins.append(fileName); + } + foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { - if (fileName.endsWith(".so")) { - QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); - QObject * plugin = loader.instance(); - if (plugin) { - CommonInterface * pluginInstance = qobject_cast(plugin); - if (!pluginInstance) - continue; - switch (pluginInstance->pluginTypes()) { - case FunType::SYSTEM: - loadModule(systemList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), systemPluginName); - break; - case FunType::DEVICES: - loadModule(deviceList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), devicePluginName); - break; - case FunType::NETWORK: - loadModule(networkList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), networkPluginName); - break; - case FunType::PERSONALIZED: - loadModule(personaliseList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), personalPluginName); - break; - case FunType::ACCOUNT: - loadModule(accountList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), accountPluginName); - break; - case FunType::DATETIME: - loadModule(datetimeList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), datePluginName); - break; - case FunType::UPDATE: - loadModule(updateList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), updatePluginName); - break; - case FunType::SECURITY: - loadModule(securityList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), securityPluginName); - break; - case FunType::APPLICATION: - loadModule(applicationList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), appPluginName); - break; - case FunType::SEARCH_F: - loadModule(searchList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), searchPluginName); - break; - default: - break; - } - } + if (!updatePlugins.contains(fileName)) { + determineModule(fileName, pluginsDir); } } + funcinfoListHomePage.append(accountList); funcinfoListHomePage.append(systemList); funcinfoListHomePage.append(deviceList); @@ -126,6 +94,7 @@ void FunctionSelect::loadHomeModule() funcinfoListHomePage.append(securityList); funcinfoListHomePage.append(applicationList); funcinfoListHomePage.append(searchList); + funcinfoListHomePage.append(currencyList); funcinfoList = funcinfoListHomePage; } @@ -170,6 +139,57 @@ void FunctionSelect::loadModule(QList &systemList, QString name, QStri } } +void FunctionSelect::determineModule(const QString &fileName, const QDir &pluginsDir) +{ + if (fileName.endsWith(".so")) { + QString pluginPath = pluginsDir.absoluteFilePath(fileName); + QPluginLoader loader(pluginPath); + QObject * plugin = loader.instance(); + if (plugin) { + CommonInterface * pluginInstance = qobject_cast(plugin); + if (!pluginInstance) + return; + switch (pluginInstance->pluginTypes()) { + case FunType::SYSTEM: + loadModule(systemList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), systemPluginName); + break; + case FunType::DEVICES: + loadModule(deviceList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), devicePluginName); + break; + case FunType::NETWORK: + loadModule(networkList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), networkPluginName); + break; + case FunType::PERSONALIZED: + loadModule(personaliseList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), personalPluginName); + break; + case FunType::ACCOUNT: + loadModule(accountList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), accountPluginName); + break; + case FunType::DATETIME: + loadModule(datetimeList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), datePluginName); + break; + case FunType::UPDATE: + loadModule(updateList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), updatePluginName); + break; + case FunType::SECURITY: + loadModule(securityList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), securityPluginName); + break; + case FunType::APPLICATION: + loadModule(applicationList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), appPluginName); + break; + case FunType::SEARCH_F: + loadModule(searchList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), searchPluginName); + break; + case FunType::CURRENCY: + loadModule(currencyList, pluginInstance->name(), pluginInstance->plugini18nName(), pluginInstance->pluginTypes(), pluginInstance->isShowOnHomePage(), pluginInstance->isEnable(), currencyPluginName); + break; + default: + break; + } + } + } +} + void FunctionSelect::initValue(){ initPluginName(); loadHomeModule(); @@ -262,4 +282,6 @@ void FunctionSelect::initPluginName() appPluginName.insert(1, "defaultapp"); searchPluginName.insert(0, "Search"); + + currencyPluginName.insert(0, "Boot"); } diff --git a/shell/utils/functionselect.h b/shell/utils/functionselect.h index 6ac117e..00222c0 100644 --- a/shell/utils/functionselect.h +++ b/shell/utils/functionselect.h @@ -67,6 +67,7 @@ public: static QList securityPluginName; static QList appPluginName; static QList searchPluginName; + static QList currencyPluginName; static void initValue(); static void initPluginName(); @@ -77,6 +78,8 @@ public: static QList listExistsCustomNoticePath(const char* dir); //获取动态路径 static void loadModule(QList &systemList, QString name, QString i18nName, int type, bool isShow, bool isEnable, QList pluginName); +private: + static void determineModule(const QString& fileName, const QDir& dir); }; #endif // FUNCTIONSELECT_H diff --git a/shell/utils/keyvalueconverter.cpp b/shell/utils/keyvalueconverter.cpp index 8603be1..5953eae 100644 --- a/shell/utils/keyvalueconverter.cpp +++ b/shell/utils/keyvalueconverter.cpp @@ -72,6 +72,9 @@ QString KeyValueConverter::keycodeTokeyi18nstring(int code){ case SEARCH_F: nameString = tr("Investigation"); break; + case CURRENCY: + nameString = tr("currency"); + break; default: break; } diff --git a/shell/utils/keyvalueconverter.h b/shell/utils/keyvalueconverter.h index 887a4dd..6fe14c9 100644 --- a/shell/utils/keyvalueconverter.h +++ b/shell/utils/keyvalueconverter.h @@ -23,7 +23,6 @@ #include #include - class KeyValueConverter : public QObject { Q_OBJECT @@ -51,6 +50,7 @@ public: SECURITY, APPLICATION, SEARCH_F, + CURRENCY, //NOTICEANDTASKS, TOTALMODULES, }; diff --git a/ukui-control-center.pro b/ukui-control-center.pro index 9f2988e..3f6775b 100644 --- a/ukui-control-center.pro +++ b/ukui-control-center.pro @@ -35,18 +35,21 @@ isEmpty(PREFIX) { qm_files.path = $${PREFIX}/share/ukui-control-center/shell/res/i18n/ qm_files.files = shell/res/i18n/*.qm +ts_files.path = $${PREFIX}/share/ukui-control-center/shell/res/i18n/ +ts_files.files = shell/res/i18n/*.ts + + search_file.path = $${PREFIX}/share/ukui-control-center/shell/res/ search_file.files = shell/res/search.xml INCLUDEPATH += /usr/lib/gcc/aarch64-linux-gnu/9/include/ INSTALLS += qm_files \ + ts_files \ search_file HEADERS += \ - shell/utils/mthread.h \ shell/utils/xatom-helper.h SOURCES += \ - shell/utils/mthread.cpp \ shell/utils/xatom-helper.cpp