close-cd: #I72LYV, 解決音乐选项下拉框缺少退出功能问题

This commit is contained in:
yushuoqi 2023-06-07 17:56:28 +08:00
parent 828356ac1b
commit a84ed5c67a
11 changed files with 146 additions and 45 deletions

35
UI/globalsignal.cpp Normal file
View File

@ -0,0 +1,35 @@
#include "globalsignal.h"
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include <QtDBus/QDBusConnection>
GlobalUserSignal* GlobalUserSignal::instance = new GlobalUserSignal;
GlobalUserSignal *GlobalUserSignal::getInstance()
{
return instance;
}
void GlobalUserSignal::exitApp()
{
emit sigExit();
}
void GlobalUserSignal::deleteAllHistoryPlaylistMessageBox()
{
emit sigDeleteAllHistoryPlaylistMessageBox();
}
void GlobalUserSignal::hideSearchResult()
{
emit sigHideSearchResult();
}
void GlobalUserSignal::repaintLeftSidebarWidget()
{
emit sigRepaintLeftSidebarWidget();
}
GlobalUserSignal::GlobalUserSignal(QObject *parent) : QObject(parent)
{
}

39
UI/globalsignal.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef GLOBALSIGNAL_H
#define GLOBALSIGNAL_H
#include <QObject>
/** ******************************
*
*********************************/
class GlobalUserSignal : public QObject
{
Q_OBJECT
public:
static GlobalUserSignal* getInstance();
bool historyButtonIsShow = false;
void exitApp(); // 退出
void deleteAllHistoryPlaylistMessageBox(); // 显示历史列表删除对话框
void hideSearchResult(); // 隐藏搜索列表
void repaintLeftSidebarWidget(); // 刷新左侧歌单
//signals:
Q_SIGNALS:
void sigExit();
void sigDeleteAllHistoryPlaylistMessageBox();
void sigHideSearchResult();
void sigRepaintLeftSidebarWidget();
private:
explicit GlobalUserSignal(QObject *parent = nullptr);
static GlobalUserSignal* instance;
};
#define g_user_signal GlobalUserSignal::getInstance()
#endif // GLOBALSIGNAL_H

View File

@ -4,6 +4,7 @@
#include "UI/base/xatom-helper.h"
#include "ukuistylehelper/ukuistylehelper.h"
#include "windowmanager/windowmanager.h"
#include "UI/globalsignal.h"
#include "UIControl/global/global.h"
@ -700,6 +701,7 @@ void Widget::allConnect()
connect(m_titleBar->miniBtn,&QPushButton::clicked,this,&Widget::slotShowMiniWidget);
connect(m_titleBar->closeBtn,&QPushButton::clicked,this,&Widget::slotClose);
connect(g_user_signal, &GlobalUserSignal::sigExit, this, &Widget::slotClose);
connect(m_quitWindow, &QShortcut::activated, this, &Widget::slotClose);
connect(m_titleBar->minimumBtn,&QPushButton::clicked,this,&Widget::slotShowMinimized);
connect(m_titleBar->maximumBtn,&QPushButton::clicked,this,&Widget::slotShowMaximized);

View File

@ -2,6 +2,7 @@
#include "UI/mainwidget.h"
#include "UI/base/xatom-helper.h"
#include "UIControl/global/global.h"
#include "UI/globalsignal.h"
#include "ukuistylehelper/ukuistylehelper.h"
#include "windowmanager/windowmanager.h"
@ -45,11 +46,10 @@ void menuModule::initAction(){
actionHelp->setText(tr("Help"));
QAction *actionAbout = new QAction(m_menu);
actionAbout->setText(tr("About"));
QAction *actionQuit = new QAction(m_menu);
// actionQuit->setText(tr("Quit"));
// actions<<actionTheme<<actionHelp<<actionAbout<<actionQuit;
QAction *actionExit = new QAction(m_menu);
actionExit->setText(tr("Exit"));
// actions<<actionTheme<<actionHelp<<actionAbout; //隐藏关于主题颜色的设置,默认跟随主题,不随着用户操作更改。
actions<<actionHelp<<actionAbout;
actions<<actionHelp<< actionAbout << actionExit;
m_menu->addActions(actions);
// 互斥按钮组
QMenu *themeMenu = new QMenu;
@ -143,8 +143,8 @@ void menuModule::triggerMenu(QAction *act){
QString str = act->text();
if(tr("Quit") == str){
Q_EMIT menuModuleClose();
if(tr("Exit") == str){
g_user_signal->exitApp();
}else if(tr("About") == str){
aboutAction();
}else if(tr("Help") == str){

View File

@ -37,7 +37,6 @@ public:
} themeStatus;
Q_SIGNALS:
void menuModuleClose();
void menuModuleSetThemeStyle(QString);
public:
QToolButton *menuButton = nullptr;

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
kylin-music (1.1.0.47-ok6~0721) yangtze; urgency=medium
* [BUG]
- close-cd: #I72LYV, 解決音乐选项下拉框缺少退出功能问题
* 其他: 无
-- yushuoqi <yushuoqi@kylinos.cn> Wed, 07 Jun 2023 17:55:02 +0800
kylin-music (1.1.0.47-ok6~0720) yangtze; urgency=medium
* [BUG]

View File

@ -82,6 +82,7 @@ SOURCES += \
UI/base/mylabel.cpp \
UI/base/widgetstyle.cpp \
UI/dbusadapter.cpp \
UI/globalsignal.cpp \
UI/mainwidget.cpp \
UI/player/miniwidget.cpp \
UI/player/musicslider.cpp \
@ -122,6 +123,7 @@ HEADERS += \
UI/base/mylabel.h \
UI/base/widgetstyle.h \
UI/dbusadapter.h \
UI/globalsignal.h \
UI/mainwidget.h \
UI/player/miniwidget.h \
UI/player/musicslider.h \

Binary file not shown.

View File

@ -467,6 +467,14 @@
<source>kylin-music</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TitleBar</name>
@ -538,7 +546,7 @@
</message>
<message>
<source>Quit</source>
<translation> </translation>
<translation type="vanished"> </translation>
</message>
<message>
<source>Music Player</source>
@ -576,6 +584,10 @@
<source>Menu</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Exit</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>miniWidget</name>

Binary file not shown.

View File

@ -484,9 +484,9 @@
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="259"/>
<location filename="../UI/tableview/tableone.cpp" line="1096"/>
<location filename="../UI/tableview/tableone.cpp" line="1137"/>
<location filename="../UI/tableview/tableone.cpp" line="1209"/>
<location filename="../UI/tableview/tableone.cpp" line="1093"/>
<location filename="../UI/tableview/tableone.cpp" line="1134"/>
<location filename="../UI/tableview/tableone.cpp" line="1206"/>
<source>Song List</source>
<translation></translation>
</message>
@ -529,18 +529,18 @@
<location filename="../UI/tableview/tableone.cpp" line="261"/>
<location filename="../UI/tableview/tableone.cpp" line="344"/>
<location filename="../UI/tableview/tableone.cpp" line="699"/>
<location filename="../UI/tableview/tableone.cpp" line="1098"/>
<location filename="../UI/tableview/tableone.cpp" line="1139"/>
<location filename="../UI/tableview/tableone.cpp" line="1095"/>
<location filename="../UI/tableview/tableone.cpp" line="1136"/>
<source>I Love</source>
<translation></translation>
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="263"/>
<location filename="../UI/tableview/tableone.cpp" line="1100"/>
<location filename="../UI/tableview/tableone.cpp" line="1141"/>
<location filename="../UI/tableview/tableone.cpp" line="1186"/>
<location filename="../UI/tableview/tableone.cpp" line="1235"/>
<location filename="../UI/tableview/tableone.cpp" line="1264"/>
<location filename="../UI/tableview/tableone.cpp" line="1097"/>
<location filename="../UI/tableview/tableone.cpp" line="1138"/>
<location filename="../UI/tableview/tableone.cpp" line="1183"/>
<location filename="../UI/tableview/tableone.cpp" line="1232"/>
<location filename="../UI/tableview/tableone.cpp" line="1261"/>
<source>Search Result</source>
<translation></translation>
</message>
@ -571,9 +571,9 @@
<location filename="../UI/tableview/tableone.cpp" line="729"/>
<location filename="../UI/tableview/tableone.cpp" line="805"/>
<location filename="../UI/tableview/tableone.cpp" line="931"/>
<location filename="../UI/tableview/tableone.cpp" line="944"/>
<location filename="../UI/tableview/tableone.cpp" line="955"/>
<location filename="../UI/tableview/tableone.cpp" line="963"/>
<location filename="../UI/tableview/tableone.cpp" line="942"/>
<location filename="../UI/tableview/tableone.cpp" line="953"/>
<location filename="../UI/tableview/tableone.cpp" line="960"/>
<source>kylin-music</source>
<translation></translation>
</message>
@ -582,10 +582,8 @@
<location filename="../UI/tableview/tableone.cpp" line="396"/>
<location filename="../UI/tableview/tableone.cpp" line="523"/>
<location filename="../UI/tableview/tableone.cpp" line="624"/>
<location filename="../UI/tableview/tableone.cpp" line="932"/>
<location filename="../UI/tableview/tableone.cpp" line="945"/>
<location filename="../UI/tableview/tableone.cpp" line="956"/>
<location filename="../UI/tableview/tableone.cpp" line="964"/>
<location filename="../UI/tableview/tableone.cpp" line="943"/>
<location filename="../UI/tableview/tableone.cpp" line="961"/>
<source>Yes</source>
<translation></translation>
</message>
@ -615,12 +613,12 @@
<translation></translation>
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="962"/>
<location filename="../UI/tableview/tableone.cpp" line="959"/>
<source>Repeat add</source>
<translation></translation>
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="998"/>
<location filename="../UI/tableview/tableone.cpp" line="995"/>
<source>path does not exist</source>
<translation></translation>
</message>
@ -630,12 +628,12 @@
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="930"/>
<location filename="../UI/tableview/tableone.cpp" line="954"/>
<location filename="../UI/tableview/tableone.cpp" line="952"/>
<source>Success add %1 songs</source>
<translation>%1</translation>
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="943"/>
<location filename="../UI/tableview/tableone.cpp" line="941"/>
<source>Add failed</source>
<translation></translation>
</message>
@ -659,9 +657,9 @@
<location filename="../UI/tableview/tableone.cpp" line="521"/>
<location filename="../UI/tableview/tableone.cpp" line="622"/>
<location filename="../UI/tableview/tableone.cpp" line="930"/>
<location filename="../UI/tableview/tableone.cpp" line="943"/>
<location filename="../UI/tableview/tableone.cpp" line="954"/>
<location filename="../UI/tableview/tableone.cpp" line="962"/>
<location filename="../UI/tableview/tableone.cpp" line="941"/>
<location filename="../UI/tableview/tableone.cpp" line="952"/>
<location filename="../UI/tableview/tableone.cpp" line="959"/>
<source>Prompt information</source>
<translation></translation>
</message>
@ -678,7 +676,7 @@
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../UI/tableview/tableone.cpp" line="1034"/>
<location filename="../UI/tableview/tableone.cpp" line="1031"/>
<source> songs</source>
<translation> </translation>
</message>
@ -732,7 +730,7 @@
<context>
<name>Widget</name>
<message>
<location filename="../UI/mainwidget.cpp" line="598"/>
<location filename="../UI/mainwidget.cpp" line="599"/>
<source>Music Player</source>
<translation></translation>
</message>
@ -741,19 +739,19 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../UI/mainwidget.cpp" line="846"/>
<location filename="../UI/mainwidget.cpp" line="1045"/>
<location filename="../UI/mainwidget.cpp" line="848"/>
<location filename="../UI/mainwidget.cpp" line="1047"/>
<source>reduction</source>
<translation></translation>
</message>
<message>
<location filename="../UI/mainwidget.cpp" line="852"/>
<location filename="../UI/mainwidget.cpp" line="1037"/>
<location filename="../UI/mainwidget.cpp" line="854"/>
<location filename="../UI/mainwidget.cpp" line="1039"/>
<source>maximize</source>
<translation></translation>
</message>
<message>
<location filename="../UI/mainwidget.cpp" line="1171"/>
<location filename="../UI/mainwidget.cpp" line="1173"/>
<source>Prompt information</source>
<translation></translation>
</message>
@ -761,27 +759,33 @@
<context>
<name>menuModule</name>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="31"/>
<location filename="../UI/titlebar/menumodule.cpp" line="32"/>
<source>Menu</source>
<translation></translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="43"/>
<location filename="../UI/titlebar/menumodule.cpp" line="44"/>
<source>Theme</source>
<translation></translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="45"/>
<location filename="../UI/titlebar/menumodule.cpp" line="46"/>
<location filename="../UI/titlebar/menumodule.cpp" line="150"/>
<source>Help</source>
<translation></translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="47"/>
<location filename="../UI/titlebar/menumodule.cpp" line="48"/>
<location filename="../UI/titlebar/menumodule.cpp" line="148"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="50"/>
<location filename="../UI/titlebar/menumodule.cpp" line="146"/>
<source>Exit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="57"/>
<source>Auto</source>
@ -798,9 +802,8 @@
<translation></translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="146"/>
<source>Quit</source>
<translation>退</translation>
<translation type="vanished">退</translation>
</message>
<message>
<location filename="../UI/titlebar/menumodule.cpp" line="254"/>