From 5b815653a800a278e8733d1d4edbfb89cb6e03b9 Mon Sep 17 00:00:00 2001 From: peijiankang Date: Thu, 8 Jun 2023 09:34:56 +0800 Subject: [PATCH] add share information of peony-share --- peony-share/SwitchButton/switchbutton.cpp | 17 +++++++++++++++++ peony-share/peony-share.pro | 2 ++ .../translations/peony-share-extension_cs.ts | 13 +++++++++++++ .../translations/peony-share-extension_tr.ts | 13 +++++++++++++ .../translations/peony-share-extension_zh_CN.ts | 13 +++++++++++++ 5 files changed, 58 insertions(+) diff --git a/peony-share/SwitchButton/switchbutton.cpp b/peony-share/SwitchButton/switchbutton.cpp index d21970d..38bb00a 100644 --- a/peony-share/SwitchButton/switchbutton.cpp +++ b/peony-share/SwitchButton/switchbutton.cpp @@ -20,6 +20,8 @@ #include "switchbutton.h" #include +#include +#include #define THEME_QT_SCHEMA "org.ukui.style" #define THEME_GTK_SCHEMA "org.mate.interface" #define TIMER_INTERVAL 5 //每隔5ms动画移动一次 @@ -204,6 +206,21 @@ void SwitchButton::mousePressEvent(QMouseEvent *){ mEndX = 0; return ; }else{ + QProcess tempProcess; + QString cmd = QString("groups"); + tempProcess.start(cmd); + tempProcess.waitForFinished(); + + QString result = tempProcess.readAllStandardOutput().data(); + tempProcess.close(); + bool bFail = false; + bFail= result.contains("usershares"); + + if(!bFail) + { + QMessageBox::information(this,tr("infomation"),tr("user no group usershares, please log off and try agagin")); + return; + } checked = !checked; Q_EMIT checkedChanged(checked); diff --git a/peony-share/peony-share.pro b/peony-share/peony-share.pro index 9474deb..55f35a5 100644 --- a/peony-share/peony-share.pro +++ b/peony-share/peony-share.pro @@ -27,6 +27,8 @@ TRANSLATIONS += translations/peony-share-extension_cs.ts \ translations/peony-share-extension_tr.ts \ translations/peony-share-extension_zh_CN.ts +system("lrelease-qt5 translations/*.ts") + RESOURCES += resources.qrc target.path = $$[QT_INSTALL_LIBS]/peony-extensions diff --git a/peony-share/translations/peony-share-extension_cs.ts b/peony-share/translations/peony-share-extension_cs.ts index a2c1812..f4c69c1 100644 --- a/peony-share/translations/peony-share-extension_cs.ts +++ b/peony-share/translations/peony-share-extension_cs.ts @@ -74,4 +74,17 @@ Komentář: + + SwitchButton + + + infomation + Informace o připomenutí + + + + user no group usershares, please log off and try agagin + Tento uživatel není ve skupině usershares a musí se odhlásit a zkusit sdílet znovu + + diff --git a/peony-share/translations/peony-share-extension_tr.ts b/peony-share/translations/peony-share-extension_tr.ts index 0c9c652..de95916 100644 --- a/peony-share/translations/peony-share-extension_tr.ts +++ b/peony-share/translations/peony-share-extension_tr.ts @@ -74,4 +74,17 @@ Yorum yap: + + SwitchButton + + + infomation + Hatırlatma Bilgisi + + + + user no group usershares, please log off and try agagin + Bu kullanıcı usershares kullanıcı grubunda değil ve çıkıp tekrar paylaşmaya çalışmalı + + diff --git a/peony-share/translations/peony-share-extension_zh_CN.ts b/peony-share/translations/peony-share-extension_zh_CN.ts index 2b52463..0f64c7c 100644 --- a/peony-share/translations/peony-share-extension_zh_CN.ts +++ b/peony-share/translations/peony-share-extension_zh_CN.ts @@ -74,4 +74,17 @@ 注释: + + SwitchButton + + + infomation + 提示信息 + + + + user no group usershares, please log off and try agagin + 此用户不在usershares用户组中,需要注销后重新尝试共享功能 + + -- 2.33.0