fix(ukcc-plugin):解决无法通过控制面板搜索到通知插件内容的问题

This commit is contained in:
iaom 2024-01-26 10:42:24 +08:00
parent 9f84e6c9a7
commit 243252a437
5 changed files with 89 additions and 72 deletions

View File

@ -24,11 +24,8 @@ include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
include_directories(../libukui-notification/notification-settings)
include_directories(../libukui-notification)
file(GLOB TS_FILES "${PROJECT_SOURCE_DIR}/notification-ukcc-plugin/translations/*.ts")
qt5_add_translation(QM_FILES ${TS_FILES})
#set(QM_FILES ${QM_FILES} PARENT_SCOPE)
add_custom_target(translations ALL DEPENDS ${QM_FILES})
file(GLOB TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts)
qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES})
add_library(notification-ukcc-plugin SHARED
${notification-ukcc-plugin_LIB_SRCS}

View File

@ -145,7 +145,8 @@ void Notice::initUi(QWidget *widget)
m_noticeLabel = new TitleLabel(Noticewidget);
m_notFazeLabel = new TitleLabel();
m_notFazeLabel->setText(tr("NotFaze Mode"));
//~ contents_path /Notice/Do not disturb mode Mode
m_notFazeLabel->setText(tr("Do not disturb mode"));
LightLabel *notFazeLabel = new LightLabel(tr("(Notification banners, prompts will be hidden, and notification sounds will be muted)"));
QFrame *distrubFrame = new QFrame(widget);
@ -221,6 +222,7 @@ void Notice::initNotFaze(QFrame *frame)
autoOpenFrame->setMaximumSize(16777215, 60);
QHBoxLayout *autoLyt = new QHBoxLayout(autoOpenFrame);
autoLyt->setContentsMargins(16, 0, 16, 0);
//~ contents_path /Notice/Do not disturb mode Mode/Automatically turn on
QLabel *autoOpenLabel = new QLabel(tr("Automatically turn on"), autoOpenFrame);
m_openTimeHComboBox = new QComboBox(autoOpenFrame);
m_openTimeHComboBox->setObjectName("opentimehour");
@ -271,16 +273,19 @@ void Notice::initNotFaze(QFrame *frame)
QFrame *multiScreenFrame = new QFrame(frame);
m_multiScreenSwitchBtn= new KSwitchButton();
m_multiScreenSwitchBtn->setObjectName("multiscreen");
//~ contents_path /Notice/Do not disturb mode/Automatically turn on when multiple screens are connected
setFrame(multiScreenFrame, m_multiScreenSwitchBtn, tr("Automatically turn on when multiple screens are connected"));
QFrame *fullScreenFrame = new QFrame(frame);
m_fullScreenSwitchBtn= new KSwitchButton();
m_fullScreenSwitchBtn->setObjectName("fullscreen");
//~ contents_path /Notice/Do not disturb mode/Automatically open in full screen mode
setFrame(fullScreenFrame, m_fullScreenSwitchBtn, tr("Automatically open in full screen mode"));
QFrame *allowAlarmrRemindersFrame = new QFrame(frame);
m_allowAlarmSwitchBtn= new KSwitchButton();
m_allowAlarmSwitchBtn->setObjectName("allowAlarmr");
//~ contents_path /Notice/Do not disturb mode/Allow automatic alarm reminders in Do Not Disturb mode
setFrame(allowAlarmrRemindersFrame, m_allowAlarmSwitchBtn, tr("Allow automatic alarm reminders in Do Not Disturb mode"));
notFazeLyt->addWidget(autoOpenFrame);

View File

@ -4,52 +4,61 @@
<context>
<name>Notice</name>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="35"/>
<location filename="../notification-ukcc-plugin.cpp" line="52"/>
<source>Notice</source>
<translation></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="126"/>
<source>NotFaze Mode</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="128"/>
<location filename="../notification-ukcc-plugin.cpp" line="149"/>
<source>Do not disturb mode</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode Mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="151"/>
<source>(Notification banners, prompts will be hidden, and notification sounds will be muted)</source>
<translation>( )</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="202"/>
<location filename="../notification-ukcc-plugin.cpp" line="226"/>
<source>Automatically turn on</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode Mode/Automatically turn on</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="227"/>
<location filename="../notification-ukcc-plugin.cpp" line="251"/>
<source>to</source>
<translation></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="252"/>
<location filename="../notification-ukcc-plugin.cpp" line="277"/>
<source>Automatically turn on when multiple screens are connected</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode/Automatically turn on when multiple screens are connected</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="257"/>
<location filename="../notification-ukcc-plugin.cpp" line="283"/>
<source>Automatically open in full screen mode</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode/Automatically open in full screen mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="262"/>
<location filename="../notification-ukcc-plugin.cpp" line="289"/>
<source>Allow automatic alarm reminders in Do Not Disturb mode</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode/Allow automatic alarm reminders in Do Not Disturb mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="292"/>
<location filename="../notification-ukcc-plugin.cpp" line="318"/>
<source>Notice Settings</source>
<translation></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="294"/>
<location filename="../notification-ukcc-plugin.cpp" line="320"/>
<source>Get notifications from the app</source>
<translation></translation>
<extra-contents_path>/notice/Get notifications from the app</extra-contents_path>
@ -58,39 +67,35 @@
<context>
<name>NoticeMenu</name>
<message>
<location filename="../noticemenu.cpp" line="86"/>
<location filename="../notice-menu.cpp" line="104"/>
<source>Beep sound when notified</source>
<translation></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="92"/>
<location filename="../notice-menu.cpp" line="110"/>
<source>Show message on screenlock</source>
<translation></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="98"/>
<location filename="../notice-menu.cpp" line="116"/>
<source>Show noticfication on screenlock</source>
<translation></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="102"/>
<source>Notification Style</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="110"/>
<source>Banner: Appears in the upper right corner of the screen, and disappears automatically</source>
<translation> </translation>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="115"/>
<source>Tip:It will be kept on the screen until it is closed</source>
<translation> </translation>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="120"/>
<source>None:Notifications will not be displayed on the screen, but will go to the notification center</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
</TS>

View File

@ -4,52 +4,61 @@
<context>
<name>Notice</name>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="35"/>
<location filename="../notification-ukcc-plugin.cpp" line="52"/>
<source>Notice</source>
<translation>Notice</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="126"/>
<source>NotFaze Mode</source>
<translation>NotFaze Mode</translation>
<translation type="vanished">NotFaze Mode</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="128"/>
<location filename="../notification-ukcc-plugin.cpp" line="149"/>
<source>Do not disturb mode</source>
<translation type="unfinished"></translation>
<extra-contents_path>/Notice/Do not disturb mode Mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="151"/>
<source>(Notification banners, prompts will be hidden, and notification sounds will be muted)</source>
<translation>(Notification banners, prompts will be hidden, and notification sounds will be muted)</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="202"/>
<location filename="../notification-ukcc-plugin.cpp" line="226"/>
<source>Automatically turn on</source>
<translation>Automatically turn on</translation>
<extra-contents_path>/Notice/Do not disturb mode Mode/Automatically turn on</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="227"/>
<location filename="../notification-ukcc-plugin.cpp" line="251"/>
<source>to</source>
<translation>to</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="252"/>
<location filename="../notification-ukcc-plugin.cpp" line="277"/>
<source>Automatically turn on when multiple screens are connected</source>
<translation>Automatically turn on when multiple screens are connected</translation>
<extra-contents_path>/Notice/Do not disturb mode/Automatically turn on when multiple screens are connected</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="257"/>
<location filename="../notification-ukcc-plugin.cpp" line="283"/>
<source>Automatically open in full screen mode</source>
<translation>Automatically open in full screen mode</translation>
<extra-contents_path>/Notice/Do not disturb mode/Automatically open in full screen mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="262"/>
<location filename="../notification-ukcc-plugin.cpp" line="289"/>
<source>Allow automatic alarm reminders in Do Not Disturb mode</source>
<translation>Allow automatic alarm reminders in Do Not Disturb mode</translation>
<extra-contents_path>/Notice/Do not disturb mode/Allow automatic alarm reminders in Do Not Disturb mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="292"/>
<location filename="../notification-ukcc-plugin.cpp" line="318"/>
<source>Notice Settings</source>
<translation>Notice Settings</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="294"/>
<location filename="../notification-ukcc-plugin.cpp" line="320"/>
<source>Get notifications from the app</source>
<translation>Get notifications from the app</translation>
<extra-contents_path>/notice/Get notifications from the app</extra-contents_path>
@ -58,39 +67,35 @@
<context>
<name>NoticeMenu</name>
<message>
<location filename="../noticemenu.cpp" line="86"/>
<location filename="../notice-menu.cpp" line="104"/>
<source>Beep sound when notified</source>
<translation>Beep sound when notified</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="92"/>
<location filename="../notice-menu.cpp" line="110"/>
<source>Show message on screenlock</source>
<translation>Show message on screenlock</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="98"/>
<location filename="../notice-menu.cpp" line="116"/>
<source>Show noticfication on screenlock</source>
<translation>Show noticfication on screenlock</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="102"/>
<source>Notification Style</source>
<translation>Notification Style</translation>
<translation type="vanished">Notification Style</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="110"/>
<source>Banner: Appears in the upper right corner of the screen, and disappears automatically</source>
<translation>Banner: Appears in the upper right corner of the screen, and disappears automatically</translation>
<translation type="vanished">Banner: Appears in the upper right corner of the screen, and disappears automatically</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="115"/>
<source>Tip:It will be kept on the screen until it is closed</source>
<translation>Tip:It will be kept on the screen until it is closed</translation>
<translation type="vanished">Tip:It will be kept on the screen until it is closed</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="120"/>
<source>None:Notifications will not be displayed on the screen, but will go to the notification center</source>
<translation>None:Notifications will not be displayed on the screen, but will go to the notification center</translation>
<translation type="vanished">None:Notifications will not be displayed on the screen, but will go to the notification center</translation>
</message>
</context>
</TS>

View File

@ -4,52 +4,61 @@
<context>
<name>Notice</name>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="35"/>
<location filename="../notification-ukcc-plugin.cpp" line="52"/>
<source>Notice</source>
<translation></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="126"/>
<source>NotFaze Mode</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="128"/>
<location filename="../notification-ukcc-plugin.cpp" line="149"/>
<source>Do not disturb mode</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode Mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="151"/>
<source>(Notification banners, prompts will be hidden, and notification sounds will be muted)</source>
<translation>()</translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="202"/>
<location filename="../notification-ukcc-plugin.cpp" line="226"/>
<source>Automatically turn on</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode Mode/Automatically turn on</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="227"/>
<location filename="../notification-ukcc-plugin.cpp" line="251"/>
<source>to</source>
<translation></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="252"/>
<location filename="../notification-ukcc-plugin.cpp" line="277"/>
<source>Automatically turn on when multiple screens are connected</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode/Automatically turn on when multiple screens are connected</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="257"/>
<location filename="../notification-ukcc-plugin.cpp" line="283"/>
<source>Automatically open in full screen mode</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode/Automatically open in full screen mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="262"/>
<location filename="../notification-ukcc-plugin.cpp" line="289"/>
<source>Allow automatic alarm reminders in Do Not Disturb mode</source>
<translation></translation>
<extra-contents_path>/Notice/Do not disturb mode/Allow automatic alarm reminders in Do Not Disturb mode</extra-contents_path>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="292"/>
<location filename="../notification-ukcc-plugin.cpp" line="318"/>
<source>Notice Settings</source>
<translation></translation>
</message>
<message>
<location filename="../notification-ukcc-plugin.cpp" line="294"/>
<location filename="../notification-ukcc-plugin.cpp" line="320"/>
<source>Get notifications from the app</source>
<translation></translation>
<extra-contents_path>/notice/Get notifications from the app</extra-contents_path>
@ -58,39 +67,35 @@
<context>
<name>NoticeMenu</name>
<message>
<location filename="../noticemenu.cpp" line="86"/>
<location filename="../notice-menu.cpp" line="104"/>
<source>Beep sound when notified</source>
<translation></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="92"/>
<location filename="../notice-menu.cpp" line="110"/>
<source>Show message on screenlock</source>
<translation></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="98"/>
<location filename="../notice-menu.cpp" line="116"/>
<source>Show noticfication on screenlock</source>
<translation></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="102"/>
<source>Notification Style</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="110"/>
<source>Banner: Appears in the upper right corner of the screen, and disappears automatically</source>
<translation>横幅:显示在屏幕右上角</translation>
<translation type="vanished">横幅:显示在屏幕右上角</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="115"/>
<source>Tip:It will be kept on the screen until it is closed</source>
<translation>提示:会保留在屏幕上</translation>
<translation type="vanished">提示:会保留在屏幕上</translation>
</message>
<message>
<location filename="../noticemenu.cpp" line="120"/>
<source>None:Notifications will not be displayed on the screen, but will go to the notification center</source>
<translation>:通知不会显示在屏幕上</translation>
<translation type="vanished">:通知不会显示在屏幕上</translation>
</message>
</context>
</TS>