update to upstream version 3.0.4-1
This commit is contained in:
parent
db1e57f629
commit
347f50014b
@ -1,48 +0,0 @@
|
||||
From e4350a375389f7a4484c890b1e1413bcd1a00b4a Mon Sep 17 00:00:00 2001
|
||||
From: myshow <296570182@qq.com>
|
||||
Date: Mon, 7 Dec 2020 15:50:18 +0800
|
||||
Subject: [PATCH] fix-vol-icon-bug
|
||||
|
||||
---
|
||||
.../ukmedia_device_volume_widget.cpp | 4 ++--
|
||||
.../ukui-volume-control-applet-qt.pro | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_volume_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_volume_widget.cpp
|
||||
index 90ee766..94a01fb 100644
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_volume_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_volume_widget.cpp
|
||||
@@ -82,7 +82,7 @@ void UkmediaDeviceWidget::noInputWidgetInit()
|
||||
//设置输入输出音量图标
|
||||
outputDeviceBtn->setFixedSize(iconSize);
|
||||
outputDeviceBtn->setIconSize(iconSize);
|
||||
-#if (QT_VERSION <= QT_VERSION_CHECK(5,6,1))
|
||||
+#if (QT_VERSION <= QT_VERSION_CHECK(5,12,1))
|
||||
outputDeviceBtn->setIcon(QIcon("/usr/share/icons/ukui-icon-theme-classical/scalable/devices/audio-card.svg"));
|
||||
#elif (QT_VERSION > QT_VERSION_CHECK(5,6,1))
|
||||
outputDeviceBtn->setIcon(QIcon("/usr/share/ukui-media/img/audiocard.svg"));
|
||||
@@ -132,7 +132,7 @@ void UkmediaDeviceWidget::inputWidgetShow()
|
||||
//设置输入输出音量图标
|
||||
inputDeviceBtn->setFixedSize(iconSize);
|
||||
inputDeviceBtn->setIconSize(iconSize);
|
||||
-#if (QT_VERSION <= QT_VERSION_CHECK(5,6,1))
|
||||
+#if (QT_VERSION <= QT_VERSION_CHECK(5,12,1))
|
||||
inputDeviceBtn->setIcon(QIcon("/usr/share/icons/ukui-icon-theme-classical/scalable/devices/audio-input-microphone.svg"));
|
||||
#elif (QT_VERSION > QT_VERSION_CHECK(5,6,1))
|
||||
inputDeviceBtn->setIcon(QIcon("/usr/share/ukui-media/img/audio-input-microphone.svg"));
|
||||
diff --git a/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro b/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
index edf8db9..728edd9 100644
|
||||
--- a/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
+++ b/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
@@ -70,7 +70,7 @@ TRANSLATIONS += \
|
||||
translations/tr.ts \
|
||||
translations/bo.ts
|
||||
|
||||
-system("lrelease translations/*.ts")
|
||||
+system("lrelease-qt5 translations/*.ts")
|
||||
|
||||
qm_file.files = translations/*.qm
|
||||
qm_file.path = $${PREFIX}/translations/
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
From 9505c2aa17d0914afe73abfab2cdb7f4febc99ef Mon Sep 17 00:00:00 2001
|
||||
From: pei-jiankang <peijiankang@kylinos.cn>
|
||||
Date: Mon, 27 Sep 2021 17:08:43 +0800
|
||||
Subject: [PATCH] repair the kylin-recorder volume dispaly error in kylin-media
|
||||
|
||||
---
|
||||
.../ukmedia_device_switch_widget.cpp | 30 ++++++++++++-------
|
||||
1 file changed, 20 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index 2cd9612..04c5beb 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -1391,12 +1391,14 @@ void DeviceSwitchWidget::add_stream (DeviceSwitchWidget *w, MateMixerStream *str
|
||||
MateMixerAppInfo *m_pAppInfo = mate_mixer_stream_control_get_app_info(w->control);
|
||||
if (m_pAppInfo != nullptr) {
|
||||
const gchar *m_pAppName = mate_mixer_app_info_get_name(m_pAppInfo);
|
||||
- if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
- strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]")) {
|
||||
- if G_UNLIKELY (w->control == nullptr)
|
||||
- return;
|
||||
- add_application_control (w, w->control,m_pStreamControlName);
|
||||
- }
|
||||
+ if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
+ strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]") && \
|
||||
+ strcmp(m_pAppName,"Ukui Volume Control App") && !strstr(m_pAppName,"QtPulseAudio") && strcmp(m_pAppName,"ukuimedia-volume-control") != 0 && \
|
||||
+ !strstr(m_pAppName,"ukui-settings-daemon")) {
|
||||
+ if G_UNLIKELY (w->control == nullptr)
|
||||
+ return;
|
||||
+ add_application_control (w, w->control,m_pStreamControlName);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
return;
|
||||
@@ -1506,10 +1508,18 @@ void DeviceSwitchWidget::on_stream_control_added (MateMixerStream *stream,const
|
||||
MateMixerAppInfo *m_pAppInfo = mate_mixer_stream_control_get_app_info(w->control);
|
||||
if (m_pAppInfo != nullptr) {
|
||||
const gchar *m_pAppName = mate_mixer_app_info_get_name(m_pAppInfo);
|
||||
- if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
- strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]")) {
|
||||
- if G_UNLIKELY (w->control == nullptr)
|
||||
- return;
|
||||
+ const gchar *appIconName = mate_mixer_app_info_get_icon(m_pAppInfo);
|
||||
+ if (appIconName && strstr(appIconName,"recording")) {
|
||||
+ m_pAppName = "kylin-recorder";
|
||||
+ appIconName = "kylin-recorder";
|
||||
+ }
|
||||
+
|
||||
+ if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
+ strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]") && \
|
||||
+ strcmp(m_pAppName,"Ukui Volume Control App") && !strstr(m_pAppName,"QtPulseAudio") && strcmp(m_pAppName,"ukuimedia-volume-control") != 0 && \
|
||||
+ !strstr(m_pAppName,"ukui-settings-daemon")) {
|
||||
+ if G_UNLIKELY (w->control == nullptr)
|
||||
+ return;
|
||||
|
||||
role = mate_mixer_stream_control_get_role (w->control);
|
||||
if (role == MATE_MIXER_STREAM_CONTROL_ROLE_APPLICATION) {
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 4fe3f75353853d7671e93bf036badf7935cccc1f Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Thu, 8 Jul 2021 17:48:05 +0800
|
||||
Subject: [PATCH] Fix the right menu without frosted glass issue
|
||||
|
||||
---
|
||||
ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index 2cd9612..e2714a2 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -453,7 +453,7 @@ DeviceSwitchWidget::DeviceSwitchWidget(QWidget *parent) : QWidget (parent)
|
||||
*/
|
||||
void DeviceSwitchWidget::systemTrayMenuInit()
|
||||
{
|
||||
- menu = new QMenu();
|
||||
+ menu = new QMenu(this);
|
||||
qDebug() << "new menu";
|
||||
// menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
// menu->setAttribute();
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,457 +0,0 @@
|
||||
From dc3f42535741a6c8749953e73e77b3f983733faa Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Fri, 9 Jul 2021 10:30:19 +0800
|
||||
Subject: [PATCH] Add a detection mechanism when PulseAudio exits abnormally
|
||||
|
||||
---
|
||||
ukui-volume-control-applet-qt/main.cpp | 9 ++
|
||||
.../translations/bo.ts | 51 ++++++++---
|
||||
.../translations/zh_CN.ts | 49 +++++++----
|
||||
.../ukmedia_device_switch_widget.cpp | 87 ++++++++++++++++++-
|
||||
.../ukmedia_device_switch_widget.h | 23 +++++
|
||||
.../ukui-volume-control-applet-qt.pro | 4 +-
|
||||
6 files changed, 191 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/main.cpp b/ukui-volume-control-applet-qt/main.cpp
|
||||
index c02a842..9d33691 100755
|
||||
--- a/ukui-volume-control-applet-qt/main.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/main.cpp
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QDir>
|
||||
#include <KWindowEffects>
|
||||
#include <QMessageBox>
|
||||
+#include <QLibraryInfo>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
/*! The ukui-media is the media of UKUI.
|
||||
@@ -91,6 +92,14 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
+ #ifndef QT_NO_TRANSLATION
|
||||
+ QString translatorFileName = QLatin1String("qt_");
|
||||
+ translatorFileName += QLocale::system().name();
|
||||
+ QTranslator *pTranslator = new QTranslator();
|
||||
+ if (pTranslator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
+ app.installTranslator(pTranslator);
|
||||
+ #endif
|
||||
+
|
||||
//加载qm文件
|
||||
QTranslator translator;
|
||||
translator.load("/usr/share/ukui-media/translations/" + QLocale::system().name());
|
||||
diff --git a/ukui-volume-control-applet-qt/translations/bo.ts b/ukui-volume-control-applet-qt/translations/bo.ts
|
||||
index 9950f86..a3ab02e 100755
|
||||
--- a/ukui-volume-control-applet-qt/translations/bo.ts
|
||||
+++ b/ukui-volume-control-applet-qt/translations/bo.ts
|
||||
@@ -17,52 +17,70 @@
|
||||
<context>
|
||||
<name>DeviceSwitchWidget</name>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="213"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="281"/>
|
||||
<source>Go Into Mini Mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="167"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="235"/>
|
||||
<source>Output volume control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="169"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="172"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="237"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="240"/>
|
||||
<source>Mute</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="170"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="173"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="238"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="241"/>
|
||||
<source>Sound preference(S)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="1234"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="1309"/>
|
||||
<source>Device Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="1235"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="1310"/>
|
||||
<source>Application Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2495"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2502"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2757"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2765"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2193"/>
|
||||
+ <source>Error</source>
|
||||
+ <translation type="unfinished"></translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2193"/>
|
||||
+ <source>Unable to connect to the sound system, please check whether the pulseaudio service is running!</source>
|
||||
+ <translation type="unfinished"></translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2632"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2639"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2949"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2957"/>
|
||||
<source>Speaker (Realtek Audio)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2498"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2761"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2635"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2953"/>
|
||||
<source>Headphone</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
+<context>
|
||||
+ <name>QObject</name>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="167"/>
|
||||
+ <source>PulseAudio Volume Control</source>
|
||||
+ <translation type="unfinished"></translation>
|
||||
+ </message>
|
||||
+</context>
|
||||
<context>
|
||||
<name>UkmediaDeviceWidget</name>
|
||||
<message>
|
||||
@@ -93,6 +111,11 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaMiniMasterVolumeWidget</name>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_mini_master_volume_widget.cpp" line="47"/>
|
||||
+ <source>Speaker (Realtek Audio)</source>
|
||||
+ <translation type="unfinished"></translation>
|
||||
+ </message>
|
||||
<message>
|
||||
<location filename="../ukmedia_mini_master_volume_widget.cpp" line="115"/>
|
||||
<source>Go Into Full Mode</source>
|
||||
diff --git a/ukui-volume-control-applet-qt/translations/zh_CN.ts b/ukui-volume-control-applet-qt/translations/zh_CN.ts
|
||||
index f72e0dc..5d82d82 100755
|
||||
--- a/ukui-volume-control-applet-qt/translations/zh_CN.ts
|
||||
+++ b/ukui-volume-control-applet-qt/translations/zh_CN.ts
|
||||
@@ -17,52 +17,70 @@
|
||||
<context>
|
||||
<name>DeviceSwitchWidget</name>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="213"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="281"/>
|
||||
<source>Go Into Mini Mode</source>
|
||||
<translation>进入Mini模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="167"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="235"/>
|
||||
<source>Output volume control</source>
|
||||
<translation>输出音量控制</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="169"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="172"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="237"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="240"/>
|
||||
<source>Mute</source>
|
||||
<translation>静音</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="170"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="173"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="238"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="241"/>
|
||||
<source>Sound preference(S)</source>
|
||||
<translation>声音首选项</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="1234"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="1309"/>
|
||||
<source>Device Volume</source>
|
||||
<translation>设备音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="1235"/>
|
||||
- <source>Application Volume</source>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="1310"/>
|
||||
+ <source>Application Volume</source>
|
||||
<translation>应用音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2495"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2502"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2757"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2765"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2193"/>
|
||||
+ <source>Error</source>
|
||||
+ <translation>错误</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2193"/>
|
||||
+ <source>Unable to connect to the sound system, please check whether the pulseaudio service is running!</source>
|
||||
+ <translation>无法连接到系统声音,请检查pulseaudio服务是否正在运行!</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2632"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2639"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2949"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2957"/>
|
||||
<source>Speaker (Realtek Audio)</source>
|
||||
<translation>扬声器(Realtek Audio)</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2498"/>
|
||||
- <location filename="../ukmedia_device_switch_widget.cpp" line="2761"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2635"/>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="2953"/>
|
||||
<source>Headphone</source>
|
||||
<translation>模拟耳机</translation>
|
||||
</message>
|
||||
</context>
|
||||
+<context>
|
||||
+ <name>QObject</name>
|
||||
+ <message>
|
||||
+ <location filename="../ukmedia_device_switch_widget.cpp" line="167"/>
|
||||
+ <source>PulseAudio Volume Control</source>
|
||||
+ <translation></translation>
|
||||
+ </message>
|
||||
+</context>
|
||||
<context>
|
||||
<name>UkmediaDeviceWidget</name>
|
||||
<message>
|
||||
@@ -94,6 +112,7 @@
|
||||
<context>
|
||||
<name>UkmediaMiniMasterVolumeWidget</name>
|
||||
<message>
|
||||
+ <location filename="../ukmedia_mini_master_volume_widget.cpp" line="47"/>
|
||||
<source>Speaker (Realtek Audio)</source>
|
||||
<translation type="vanished">扬声器(Realtek Audio)</translation>
|
||||
</message>
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index e2714a2..cb10ae2 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -151,8 +151,71 @@ void DeviceSwitchWidget::hideWindow()
|
||||
// isShow = true;
|
||||
}
|
||||
|
||||
+gboolean DeviceSwitchWidget::connect_to_pulse(gpointer userdata)
|
||||
+{
|
||||
+ //连接到pulseaudio
|
||||
+ pa_glib_mainloop *m = pa_glib_mainloop_new(g_main_context_default());
|
||||
+ DeviceSwitchWidget *w = static_cast<DeviceSwitchWidget*>(userdata);
|
||||
+ w->api = pa_glib_mainloop_get_api(m);
|
||||
+
|
||||
+ pa_proplist *proplist = pa_proplist_new();
|
||||
+ pa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, QObject::tr("PulseAudio Volume Control").toUtf8().constData());
|
||||
+ pa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "org.PulseAudio.pavucontrol");
|
||||
+ pa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "audio-card");
|
||||
+ pa_proplist_sets(proplist, PA_PROP_APPLICATION_VERSION, "PACKAGE_VERSION");
|
||||
+ w->m_paContext = pa_context_new_with_proplist(w->api, nullptr, proplist);
|
||||
+ g_assert(w->m_paContext);
|
||||
+
|
||||
+ pa_proplist_free(proplist);
|
||||
+// qDebug() <<"123123" << pa_context_connect(m_paContext, nullptr, PA_CONTEXT_NOFAIL, nullptr) ;
|
||||
+
|
||||
+ pa_context_set_state_callback(w->m_paContext, context_state_callback, w);
|
||||
+ if (pa_context_connect(w->m_paContext, nullptr, PA_CONTEXT_NOFAIL, nullptr) < 0) {
|
||||
+ if (pa_context_errno(w->m_paContext) == PA_ERR_INVALID) {
|
||||
+// w->setConnectingMessage(QObject::tr("Connection to PulseAudio failed. Automatic retry in 5s\n\n"
|
||||
+// "In this case this is likely because PULSE_SERVER in the Environment/X11 Root Window Properties\n"
|
||||
+// "or default-server in client.conf is misconfigured.\n"
|
||||
+// "This situation can also arrise when PulseAudio crashed and left stale details in the X11 Root Window.\n"
|
||||
+// "If this is the case, then PulseAudio should autospawn again, or if this is not configured you should\n"
|
||||
+// "run start-pulseaudio-x11 manually.").toUtf8().constData());
|
||||
+ qDebug() << "连接pulseaudio error";
|
||||
+ }
|
||||
+ else {
|
||||
+ g_timeout_add_seconds(5,connect_to_pulse,w);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+void DeviceSwitchWidget::context_state_callback(pa_context *c, void *userdata) {
|
||||
+ DeviceSwitchWidget *w = static_cast<DeviceSwitchWidget*>(userdata);
|
||||
+ g_assert(c);
|
||||
+
|
||||
+ switch (pa_context_get_state(c)) {
|
||||
+ case PA_CONTEXT_UNCONNECTED:
|
||||
+ case PA_CONTEXT_CONNECTING:
|
||||
+ case PA_CONTEXT_AUTHORIZING:
|
||||
+ case PA_CONTEXT_SETTING_NAME:
|
||||
+ break;
|
||||
+
|
||||
+ case PA_CONTEXT_READY: {
|
||||
+ pa_operation *o;
|
||||
+ break;
|
||||
+ }
|
||||
+ case PA_CONTEXT_FAILED:
|
||||
+ w->pulseDisconnectMseeageBox();
|
||||
+ break;
|
||||
+ case PA_CONTEXT_TERMINATED:
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
DeviceSwitchWidget::DeviceSwitchWidget(QWidget *parent) : QWidget (parent)
|
||||
{
|
||||
+ connect_to_pulse(this);
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
setWindowFlags(Qt::WindowStaysOnTopHint|Qt::Popup);
|
||||
mThemeName = UKUI_THEME_WHITE;
|
||||
@@ -255,6 +318,7 @@ DeviceSwitchWidget::DeviceSwitchWidget(QWidget *parent) : QWidget (parent)
|
||||
if G_UNLIKELY (mate_mixer_context_open(context) == FALSE) {
|
||||
g_warning ("Failed to connect to a sound system**********************");
|
||||
}
|
||||
+
|
||||
appWidget->setFixedSize(358,320);
|
||||
devWidget->setFixedSize(358,320);
|
||||
|
||||
@@ -453,7 +517,7 @@ DeviceSwitchWidget::DeviceSwitchWidget(QWidget *parent) : QWidget (parent)
|
||||
*/
|
||||
void DeviceSwitchWidget::systemTrayMenuInit()
|
||||
{
|
||||
- menu = new QMenu(this);
|
||||
+ menu = new QMenu();
|
||||
qDebug() << "new menu";
|
||||
// menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
// menu->setAttribute();
|
||||
@@ -1278,6 +1342,7 @@ void DeviceSwitchWidget::on_context_state_notify (MateMixerContext *context,GPar
|
||||
}
|
||||
else if (state == MATE_MIXER_STATE_FAILED) {
|
||||
g_warning("Failed to connect a sound system");
|
||||
+ qDebug() << "Failed to connect a sound system";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2088,6 +2153,12 @@ void DeviceSwitchWidget::app_volume_mute (MateMixerStreamControl *control, QStri
|
||||
Q_EMIT w->appvolume_mute_change_mastervolume_status();*/
|
||||
}
|
||||
|
||||
+void DeviceSwitchWidget::pulseDisconnectMseeageBox()
|
||||
+{
|
||||
+ QMessageBox::critical(NULL, tr("Error"), tr("Unable to connect to the sound system, please check whether the pulseaudio service is running!"), QMessageBox::Abort);
|
||||
+ exit(-1);
|
||||
+}
|
||||
+
|
||||
/*!
|
||||
* \brief
|
||||
* \details
|
||||
@@ -2095,6 +2166,17 @@ void DeviceSwitchWidget::app_volume_mute (MateMixerStreamControl *control, QStri
|
||||
*/
|
||||
void DeviceSwitchWidget::set_context(DeviceSwitchWidget *w,MateMixerContext *context)
|
||||
{
|
||||
+ MateMixerStream *pOutputStream = mate_mixer_context_get_default_output_stream(context);
|
||||
+ MateMixerState state = mate_mixer_context_get_state(context);
|
||||
+ if (pOutputStream != nullptr) {
|
||||
+ w->pulseDisconnectMseeageBox();
|
||||
+ }
|
||||
+ qDebug() << "output stream" << mate_mixer_stream_get_name(pOutputStream) << state;
|
||||
+ g_signal_connect (G_OBJECT (context),
|
||||
+ "stream-added",
|
||||
+ G_CALLBACK (on_context_stream_added),
|
||||
+ w);
|
||||
+
|
||||
g_signal_connect (G_OBJECT (context),
|
||||
"stream-removed",
|
||||
G_CALLBACK (on_context_stream_removed),
|
||||
@@ -2439,8 +2521,9 @@ void DeviceSwitchWidget::update_icon_output (DeviceSwitchWidget *w,MateMixerCont
|
||||
if (QGSettings::isSchemaInstalled(UKUI_VOLUME_BRIGHTNESS_GSETTING_ID)) {
|
||||
if (w->m_pVolumeSetting->keys().contains("volumesize")) {
|
||||
w->m_pVolumeSetting->set(UKUI_VOLUME_KEY,value);
|
||||
- }
|
||||
+ }
|
||||
}
|
||||
+ qDebug() << "update icon output" << value << state << mate_mixer_stream_control_get_name(control);
|
||||
if (state) {
|
||||
systemTrayIcon = "audio-volume-muted-symbolic";
|
||||
audioIconStr = "audio-volume-muted-symbolic";
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h
|
||||
index 71be9b9..5881b47 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <QMenu>
|
||||
#include <QCheckBox>
|
||||
#include <QWidgetAction>
|
||||
+#include <QMessageBox>
|
||||
#include <QFrame>
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <QtDBus/QDBusMessage>
|
||||
@@ -46,6 +47,11 @@ extern "C" {
|
||||
#include <gio/gio.h>
|
||||
#include <dconf/dconf.h>
|
||||
#include <canberra.h>
|
||||
+#include <glib/gmain.h>
|
||||
+#include <pulse/ext-stream-restore.h>
|
||||
+#include <pulse/glib-mainloop.h>
|
||||
+#include <pulse/error.h>
|
||||
+#include <pulse/subscribe.h>
|
||||
}
|
||||
|
||||
#define SOUND_MODE_SCRIPTS "/usr/share/ukui-media/scripts/detection_output_mode.sh"
|
||||
@@ -101,7 +107,11 @@ class DeviceSwitchWidget:public QWidget
|
||||
public:
|
||||
DeviceSwitchWidget(QWidget *parent = nullptr);
|
||||
~DeviceSwitchWidget();
|
||||
+
|
||||
+ static gboolean connect_to_pulse(gpointer userdata);
|
||||
+ static void context_state_callback(pa_context *c, void *userdata);
|
||||
void get_window_nameAndid();
|
||||
+ void pulseDisconnectMseeageBox();
|
||||
QList<char *> listExistsPath();
|
||||
QString findFreePath();
|
||||
void addValue(QString name,QString filename);
|
||||
@@ -259,6 +269,19 @@ private:
|
||||
bool firstEnterSystem = true;
|
||||
ca_context *caContext;
|
||||
|
||||
+ bool setOutputVolume = false;
|
||||
+ bool setInputVolume = false;
|
||||
+
|
||||
+ QByteArray role;
|
||||
+ QByteArray device;
|
||||
+ pa_channel_map channelMap;
|
||||
+ pa_cvolume volume;
|
||||
+ pa_context* m_paContext ;
|
||||
+ pa_mainloop_api* api;
|
||||
+ pa_ext_stream_restore_info info;
|
||||
+
|
||||
+
|
||||
+
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
bool event(QEvent *event);//重写窗口事件
|
||||
diff --git a/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro b/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
index 728edd9..b7ae512 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
+++ b/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
@@ -36,7 +36,9 @@ PKGCONFIG += \
|
||||
Qt5Multimedia \
|
||||
dconf \
|
||||
x11 \
|
||||
- libcanberra
|
||||
+ libcanberra \
|
||||
+ libpulse \
|
||||
+ libpulse-mainloop-glib
|
||||
# libwnck-1.0
|
||||
|
||||
HEADERS += \
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
From a225388518665daf7efe1bf61c9dade6791e052a Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Fri, 9 Jul 2021 14:11:43 +0800
|
||||
Subject: [PATCH] update gsetting
|
||||
|
||||
---
|
||||
debian/ukui-media.install | 1 +
|
||||
.../data/org.ukui.sound.gschema.xml | 34 +++++++++++++++++++
|
||||
2 files changed, 35 insertions(+)
|
||||
create mode 100644 ukui-volume-control-applet-qt/data/org.ukui.sound.gschema.xml
|
||||
|
||||
diff --git a/debian/ukui-media.install b/debian/ukui-media.install
|
||||
index 732059a..aef87ac 100755
|
||||
--- a/debian/ukui-media.install
|
||||
+++ b/debian/ukui-media.install
|
||||
@@ -5,6 +5,7 @@ ukui-volume-control-applet-qt/translations/*.qm usr/share/ukui-media/translation
|
||||
ukui-volume-control-applet-qt/data/img/* /usr/share/ukui-media/img
|
||||
ukui-volume-control-applet-qt/data/qss/* /usr/share/ukui-media/qss
|
||||
ukui-volume-control-applet-qt/data/sounds/*.ogg /usr/share/sounds
|
||||
+ukui-volume-control-applet-qt/data/org.ukui.sound.gschema.xml /usr/share/glib-2.0/schemas
|
||||
#ukui-volume-control-applet-qt/data/sounds/ukui-new-sound.xml /usr/share/ukui-media/sounds
|
||||
scripts/detection_output_mode.sh /usr/share/ukui-media/scripts
|
||||
data/org.ukui.media.sound.gschema.xml /usr/share/glib-2.0/schemas
|
||||
diff --git a/ukui-volume-control-applet-qt/data/org.ukui.sound.gschema.xml b/ukui-volume-control-applet-qt/data/org.ukui.sound.gschema.xml
|
||||
new file mode 100644
|
||||
index 0000000..e812892
|
||||
--- /dev/null
|
||||
+++ b/ukui-volume-control-applet-qt/data/org.ukui.sound.gschema.xml
|
||||
@@ -0,0 +1,34 @@
|
||||
+<schemalist gettext-domain="mate-desktop">
|
||||
+ <schema id="org.ukui.sound" path="/org/ukui/sound/">
|
||||
+ <key name="default-mixer-device" type="s">
|
||||
+ <default>''</default>
|
||||
+ <summary>Default mixer device</summary>
|
||||
+ <description>The default mixer device used by the multimedia key bindings.</description>
|
||||
+ </key>
|
||||
+ <key name="default-mixer-tracks" type="as">
|
||||
+ <default>[]</default>
|
||||
+ <summary>Default mixer tracks</summary>
|
||||
+ <description>The default mixer tracks used by the multimedia key bindings.</description>
|
||||
+ </key>
|
||||
+ <key name="enable-esd" type="b">
|
||||
+ <default>false</default>
|
||||
+ <summary>Enable ESD</summary>
|
||||
+ <description>Enable sound server startup.</description>
|
||||
+ </key>
|
||||
+ <key name="event-sounds" type="b">
|
||||
+ <default>false</default>
|
||||
+ <summary>Sounds for events</summary>
|
||||
+ <description>Whether to play sounds on user events.</description>
|
||||
+ </key>
|
||||
+ <key name="theme-name" type="s">
|
||||
+ <default>'ukui'</default>
|
||||
+ <summary>Sound theme name</summary>
|
||||
+ <description>The XDG sound theme to use for event sounds.</description>
|
||||
+ </key>
|
||||
+ <key name="input-feedback-sounds" type="b">
|
||||
+ <default>false</default>
|
||||
+ <summary>Input feedback sounds</summary>
|
||||
+ <description>Whether to play sounds on input events.</description>
|
||||
+ </key>
|
||||
+ </schema>
|
||||
+</schemalist>
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
From cee36cfdcea26d4eced49bfab0af311687393720 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Mon, 12 Jul 2021 14:59:03 +0800
|
||||
Subject: [PATCH] Solve the problem of adjusting animation freeze
|
||||
|
||||
---
|
||||
.../ukmedia_device_switch_widget.cpp | 11 +++++++++--
|
||||
.../ukmedia_device_switch_widget.h | 3 ++-
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index cb10ae2..3a262a3 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -411,13 +411,13 @@ DeviceSwitchWidget::DeviceSwitchWidget(QWidget *parent) : QWidget (parent)
|
||||
* \details
|
||||
* 完整模式下,应用音量节面,当滑动条值改变时更改系统音量
|
||||
*/
|
||||
- connect(appWidget->systemVolumeSlider,SIGNAL(valueChanged(int)),this,SLOT(advancedSystemSliderChangedSlot(int)));
|
||||
+ // connect(appWidget->systemVolumeSlider,SIGNAL(valueChanged(int)),this,SLOT( advancedSystemSliderChangedSlot(int)));
|
||||
/*!
|
||||
* \brief
|
||||
* \details
|
||||
* 完整模式下,系统音量界面,当滑动条值改变时更改系统音量
|
||||
*/
|
||||
- connect(devWidget->outputDeviceSlider,SIGNAL(valueChanged(int)),this,SLOT(outputDeviceSliderChangedSlot(int)));
|
||||
+ // connect(devWidget->outputDeviceSlider,SIGNAL(valueChanged(int)),this,SLOT(outputDeviceSliderChangedSlot(int)));
|
||||
/*!
|
||||
* \brief
|
||||
* \details
|
||||
@@ -2507,6 +2507,7 @@ void DeviceSwitchWidget::update_icon_output (DeviceSwitchWidget *w,MateMixerCont
|
||||
QSlider *slider1 = w->miniWidget->findChild<QSlider *>(w->outputControlName);
|
||||
if (slider1 == nullptr)
|
||||
return;
|
||||
+ w->setVolume = true;
|
||||
w->devWidget->outputDeviceSlider->setValue(value);
|
||||
// w->miniWidget->masterVolumeSlider->setValue(value);
|
||||
w->appWidget->systemVolumeSlider->setValue(value);
|
||||
@@ -2734,6 +2735,11 @@ void DeviceSwitchWidget::on_control_mute_notify (MateMixerStreamControl *control
|
||||
void DeviceSwitchWidget::on_stream_control_volume_notify (MateMixerStreamControl *control,GParamSpec *pspec,DeviceSwitchWidget *w)
|
||||
{
|
||||
Q_UNUSED(pspec);
|
||||
+ if (w->setVolume == true) {
|
||||
+ w->setVolume = false;
|
||||
+ qDebug() << "123123123123123";
|
||||
+ return;
|
||||
+ }
|
||||
MateMixerStreamControlFlags flags;
|
||||
gboolean muted = FALSE;
|
||||
gdouble decibel = 0.0;
|
||||
@@ -2782,6 +2788,7 @@ void DeviceSwitchWidget::on_stream_control_volume_notify (MateMixerStreamControl
|
||||
ca_context_create(&context);
|
||||
int value = int(volume*100/65536.0 + 0.5);
|
||||
if (direction == MATE_MIXER_DIRECTION_OUTPUT) {
|
||||
+ w->setVolume = true;
|
||||
w->devWidget->outputDeviceSlider->setValue(value);
|
||||
w->appWidget->systemVolumeSlider->setValue(value);
|
||||
w->miniWidget->masterVolumeSlider->setValue(value);
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h
|
||||
index 5881b47..2c9b778 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.h
|
||||
@@ -268,7 +268,8 @@ private:
|
||||
QString mThemeName;
|
||||
bool firstEnterSystem = true;
|
||||
ca_context *caContext;
|
||||
-
|
||||
+
|
||||
+ bool setVolume = false;
|
||||
bool setOutputVolume = false;
|
||||
bool setInputVolume = false;
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 5fa785ef7b49d10edcd1c48e943bd74a6c2aa475 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Mon, 12 Jul 2021 17:03:29 +0800
|
||||
Subject: [PATCH] fix the slider to adjust the microphone volume
|
||||
|
||||
---
|
||||
.../ukmedia_device_switch_widget.cpp | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index 3a262a3..b8dc5f5 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -1416,6 +1416,15 @@ void DeviceSwitchWidget::add_stream (DeviceSwitchWidget *w, MateMixerStream *str
|
||||
MateMixerStreamControl *c = mate_mixer_stream_get_default_control(stream);
|
||||
update_input_settings (w,c);
|
||||
}
|
||||
+ else {
|
||||
+ mate_mixer_context_set_default_input_stream(w->context,stream);
|
||||
+ qDebug() << "add stream set input stream 1" << mate_mixer_stream_get_name(stream);
|
||||
+ bar_set_stream (w, stream);
|
||||
+ name = mate_mixer_stream_get_name (stream);
|
||||
+ label = mate_mixer_stream_get_label (stream);
|
||||
+ qDebug() << "add stream set input stream" << name;
|
||||
+ w->input_stream_list->append(name);
|
||||
+ }
|
||||
}
|
||||
else if (direction == MATE_MIXER_DIRECTION_OUTPUT) {
|
||||
MateMixerStream *output;
|
||||
@@ -2441,7 +2450,8 @@ void DeviceSwitchWidget::update_icon_input (DeviceSwitchWidget *w,MateMixerStrea
|
||||
* control for the icon */
|
||||
control = input;
|
||||
}
|
||||
- show = TRUE;
|
||||
+ //show = true;
|
||||
+
|
||||
break;
|
||||
}
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
From 4ded5d08faa69e9dc90679ece13935b4b846574b Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Tue, 13 Jul 2021 10:30:27 +0800
|
||||
Subject: [PATCH] fix probabilistic crash when keyboard keys are mute
|
||||
|
||||
---
|
||||
.../ukmedia_device_switch_widget.cpp | 14 ++++++++++++--
|
||||
.../ukui-volume-control-applet-qt.pro | 2 +-
|
||||
2 files changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index b8dc5f5..2e7ebbd 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -1466,7 +1466,9 @@ void DeviceSwitchWidget::add_stream (DeviceSwitchWidget *w, MateMixerStream *str
|
||||
if (m_pAppInfo != nullptr) {
|
||||
const gchar *m_pAppName = mate_mixer_app_info_get_name(m_pAppInfo);
|
||||
if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
- strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]")) {
|
||||
+ strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]") && \
|
||||
+ strcmp(m_pAppName,"Ukui Volume Control App") && !strstr(m_pAppName,"QtPulseAudio") && strcmp(m_pAppName,"ukuimedia-volume-control") != 0 && \
|
||||
+ !strstr(m_pAppName,"ukui-settings-daemon")) {
|
||||
if G_UNLIKELY (w->control == nullptr)
|
||||
return;
|
||||
add_application_control (w, w->control,m_pStreamControlName);
|
||||
@@ -1580,8 +1582,16 @@ void DeviceSwitchWidget::on_stream_control_added (MateMixerStream *stream,const
|
||||
MateMixerAppInfo *m_pAppInfo = mate_mixer_stream_control_get_app_info(w->control);
|
||||
if (m_pAppInfo != nullptr) {
|
||||
const gchar *m_pAppName = mate_mixer_app_info_get_name(m_pAppInfo);
|
||||
+ const gchar *appIconName = mate_mixer_app_info_get_icon(m_pAppInfo);
|
||||
+ if (appIconName && strstr(appIconName,"recording")) {
|
||||
+ m_pAppName = "kylin-recorder";
|
||||
+ appIconName = "kylin-recorder";
|
||||
+ }
|
||||
+
|
||||
if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
- strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]")) {
|
||||
+ strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]") && \
|
||||
+ strcmp(m_pAppName,"Ukui Volume Control App") && !strstr(m_pAppName,"QtPulseAudio") && strcmp(m_pAppName,"ukuimedia-volume-control") != 0 && \
|
||||
+ !strstr(m_pAppName,"ukui-settings-daemon")) {
|
||||
if G_UNLIKELY (w->control == nullptr)
|
||||
return;
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro b/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
index b7ae512..5a8ff3c 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
+++ b/ukui-volume-control-applet-qt/ukui-volume-control-applet-qt.pro
|
||||
@@ -1,4 +1,4 @@
|
||||
-######################################################################
|
||||
+F######################################################################
|
||||
# Automatically generated by qmake (3.1) Fri Oct 11 17:35:00 2019
|
||||
######################################################################
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,138 +0,0 @@
|
||||
From 57d53f1253d960fe90e16dcf4b38692ec69fa122 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Wed, 14 Jul 2021 10:15:09 +0800
|
||||
Subject: [PATCH] Set the app name and icon for Kirin Recording
|
||||
|
||||
---
|
||||
.../ukmedia_device_switch_widget.cpp | 46 ++++++++++++++++---
|
||||
1 file changed, 40 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index 2e7ebbd..c074675 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -1465,12 +1465,18 @@ void DeviceSwitchWidget::add_stream (DeviceSwitchWidget *w, MateMixerStream *str
|
||||
MateMixerAppInfo *m_pAppInfo = mate_mixer_stream_control_get_app_info(w->control);
|
||||
if (m_pAppInfo != nullptr) {
|
||||
const gchar *m_pAppName = mate_mixer_app_info_get_name(m_pAppInfo);
|
||||
- if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
+ const gchar *app_icon_name = mate_mixer_app_info_get_icon(m_pAppInfo);
|
||||
+ if (strstr(app_icon_name,"recording")) {
|
||||
+ m_pAppName = "kylin-recorder";
|
||||
+ app_icon_name = "kylin-recorder";
|
||||
+ }
|
||||
+
|
||||
+ if (strcmp(m_pAppName,"ukui-session") != 0 && strcmp(m_pAppName,"ukui-volume-control-applet-qt") != 0 && strcmp(m_pAppName,"Volume Control") && \
|
||||
strcmp(m_pAppName,"ALSA plug-in [mate-screenshot]") && strcmp(m_pAppName,"ALSA plug-in [ukui-volume-control-applet-qt]") && \
|
||||
strcmp(m_pAppName,"Ukui Volume Control App") && !strstr(m_pAppName,"QtPulseAudio") && strcmp(m_pAppName,"ukuimedia-volume-control") != 0 && \
|
||||
!strstr(m_pAppName,"ukui-settings-daemon")) {
|
||||
if G_UNLIKELY (w->control == nullptr)
|
||||
- return;
|
||||
+ return;
|
||||
add_application_control (w, w->control,m_pStreamControlName);
|
||||
}
|
||||
}
|
||||
@@ -1532,7 +1538,7 @@ void DeviceSwitchWidget::add_application_control (DeviceSwitchWidget *w, MateMix
|
||||
!g_strcmp0 (app_id, "org.PulseAudio.pavucontrol"))
|
||||
return;
|
||||
|
||||
- QString app_icon_name = mate_mixer_app_info_get_icon(info);
|
||||
+ const gchar *app_icon_name = mate_mixer_app_info_get_icon(info);
|
||||
app_name = mate_mixer_app_info_get_name (info);
|
||||
w->stream_control_list->append(name);
|
||||
qDebug() << "add application control ,app name :" << app_name ;
|
||||
@@ -1545,6 +1551,10 @@ void DeviceSwitchWidget::add_application_control (DeviceSwitchWidget *w, MateMix
|
||||
if (app_name == nullptr) {
|
||||
return;
|
||||
}
|
||||
+ if (strstr(app_icon_name,"recording")) {
|
||||
+ app_name = "kylin-recorder";
|
||||
+ app_icon_name = "kylin-recorder";
|
||||
+ }
|
||||
//添加应用添加到应用音量中
|
||||
add_app_to_appwidget(w,app_name,app_icon_name,control);
|
||||
|
||||
@@ -1778,6 +1788,13 @@ void DeviceSwitchWidget::add_app_to_appwidget(DeviceSwitchWidget *w,const gchar
|
||||
else if (strcmp(app_name,"Clock") == 0) {
|
||||
app_icon_name = "ukui-clock";
|
||||
}
|
||||
+ else if (strcmp(app_name,"wechat") == 0) {
|
||||
+ qDebug() << "0000000000000000000";
|
||||
+ app_icon_name = "electronic-wechat";
|
||||
+ }
|
||||
+ else if (strcmp(app_name,"Firefox") == 0) {
|
||||
+ app_icon_name = "firefox";
|
||||
+ }
|
||||
|
||||
iconName.append(app_icon_name);
|
||||
iconName.append(".desktop");
|
||||
@@ -1785,7 +1802,8 @@ void DeviceSwitchWidget::add_app_to_appwidget(DeviceSwitchWidget *w,const gchar
|
||||
QString pAppIcon = w->getAppIcon(iconName);
|
||||
|
||||
w->appWidget->app_volume_list->append(app_icon_name);
|
||||
- qDebug() << "应用名为:" << pAppName << "desktop 名:" << iconName << "app icon name" << app_icon_name << "app name " << app_name;
|
||||
+ qDebug() << "应用名为:" << pAppName << "desktop 名:" << iconName << "app icon name" << app_icon_name << "app name " << app_name << mate_mixer_stream_control_get_volume(control) << mate_mixer_stream_control_get_mute(control);
|
||||
+
|
||||
//widget显示应用音量
|
||||
QWidget *app_widget = new QWidget(w->appWidget->displayAppVolumeWidget);
|
||||
app_widget->setFixedSize(306,60);
|
||||
@@ -1972,6 +1990,7 @@ void DeviceSwitchWidget::add_app_to_appwidget(DeviceSwitchWidget *w,const gchar
|
||||
else if (w->mThemeName == UKUI_THEME_BLACK || w->mThemeName == "ukui-black" || w->mThemeName == "ukui-default") {
|
||||
btn->setIcon(QIcon(w->drawLightColoredPixmap((QIcon::fromTheme(audioIconStr).pixmap(iconSize)))));
|
||||
}
|
||||
+ qDebug() << "应用音量更改" << audioIconStr;
|
||||
Q_EMIT w->app_name_signal(appSliderStr);
|
||||
});
|
||||
/*应用音量同步*/
|
||||
@@ -2059,7 +2078,9 @@ void DeviceSwitchWidget::add_app_to_appwidget(DeviceSwitchWidget *w,const gchar
|
||||
btn->setIcon(QIcon(w->drawLightColoredPixmap((QIcon::fromTheme(audioIconStr).pixmap(iconSize)))));
|
||||
}
|
||||
|
||||
- QPalette paleteBtn = btn->palette();
|
||||
+ qDebug() << "系统音量改变" << volume << muteButtonStr;
|
||||
+
|
||||
+ QPalette paleteBtn = btn->palette();
|
||||
paleteBtn.setColor(QPalette::Highlight,Qt::transparent);
|
||||
paleteBtn.setBrush(QPalette::Button,QBrush(QColor(1,1,1,0)));
|
||||
btn->setPalette(paleteBtn);
|
||||
@@ -2128,6 +2149,9 @@ void DeviceSwitchWidget::update_app_volume(MateMixerStreamControl *control, QStr
|
||||
else if (volume > 66) {
|
||||
sliderMuteButtonStr = "audio-volume-high-symbolic";
|
||||
}
|
||||
+
|
||||
+ qDebug() << "应用音量图标更改:" << sliderMuteButtonStr;
|
||||
+
|
||||
QSize iconSize(24,24);
|
||||
if ( w->mThemeName == "ukui-white" || w->mThemeName == "ukui-light") {
|
||||
btn->setIcon(QIcon(w->drawDarkColoredPixmap((QIcon::fromTheme(sliderMuteButtonStr).pixmap(iconSize)))));
|
||||
@@ -2150,9 +2174,10 @@ void DeviceSwitchWidget::app_volume_mute (MateMixerStreamControl *control, QStri
|
||||
MateMixerAppInfo *app_info = mate_mixer_stream_control_get_app_info(control);
|
||||
if (app_info == nullptr)
|
||||
return;
|
||||
- /*bool is_mute = mate_mixer_stream_control_get_mute(control);*/
|
||||
+ bool is_mute = mate_mixer_stream_control_get_mute(control);
|
||||
int volume = mate_mixer_stream_control_get_volume(control);
|
||||
volume = volume*100/65536.0+0.5;
|
||||
+ qDebug() << "应用音量静音通知" << is_mute;
|
||||
/*if (is_mute) {
|
||||
w->appWidget->appMuteBtn->setIcon(QIcon("/usr/share/ukui-media/img/audio-volume-muted.svg"));
|
||||
}
|
||||
@@ -2745,6 +2770,15 @@ void DeviceSwitchWidget::on_control_mute_notify (MateMixerStreamControl *control
|
||||
else if (direction == MATE_MIXER_DIRECTION_INPUT) {
|
||||
w->updateMicrophoneIcon(volume,mute);
|
||||
}
|
||||
+ if (QGSettings::isSchemaInstalled(UKUI_VOLUME_BRIGHTNESS_GSETTING_ID)) {
|
||||
+ if (w->m_pVolumeSetting->keys().contains("soundstate")) {
|
||||
+ w->m_pVolumeSetting->blockSignals(true);
|
||||
+// w->m_pVolumeSetting->set(UKUI_VOLUME_STATE,mute);
|
||||
+ w->m_pVolumeSetting->blockSignals(false);
|
||||
+ }
|
||||
+ }
|
||||
+ w->themeChangeIcons();
|
||||
+ Q_EMIT w->system_muted_signal(mute);
|
||||
}
|
||||
|
||||
/*!
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From 1fabf63c4d7d3269120c56229f11d519ef6bc8f8 Mon Sep 17 00:00:00 2001
|
||||
From: pei-jiankang <peijiankang@kylinos.cn>
|
||||
Date: Sun, 26 Sep 2021 14:54:39 +0800
|
||||
Subject: [PATCH] repair the input device is not find of recorder
|
||||
|
||||
---
|
||||
.../ukmedia_device_switch_widget.cpp | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
index c074675..8307fc1 100755
|
||||
--- a/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
+++ b/ukui-volume-control-applet-qt/ukmedia_device_switch_widget.cpp
|
||||
@@ -1416,15 +1416,15 @@ void DeviceSwitchWidget::add_stream (DeviceSwitchWidget *w, MateMixerStream *str
|
||||
MateMixerStreamControl *c = mate_mixer_stream_get_default_control(stream);
|
||||
update_input_settings (w,c);
|
||||
}
|
||||
- else {
|
||||
- mate_mixer_context_set_default_input_stream(w->context,stream);
|
||||
- qDebug() << "add stream set input stream 1" << mate_mixer_stream_get_name(stream);
|
||||
- bar_set_stream (w, stream);
|
||||
- name = mate_mixer_stream_get_name (stream);
|
||||
- label = mate_mixer_stream_get_label (stream);
|
||||
- qDebug() << "add stream set input stream" << name;
|
||||
- w->input_stream_list->append(name);
|
||||
- }
|
||||
+ // else {
|
||||
+ // mate_mixer_context_set_default_input_stream(w->context,stream);
|
||||
+ // qDebug() << "add stream set input stream 1" << mate_mixer_stream_get_name(stream);
|
||||
+ // bar_set_stream (w, stream);
|
||||
+ // name = mate_mixer_stream_get_name (stream);
|
||||
+ // label = mate_mixer_stream_get_label (stream);
|
||||
+ // qDebug() << "add stream set input stream" << name;
|
||||
+ // w->input_stream_list->append(name);
|
||||
+ // }
|
||||
}
|
||||
else if (direction == MATE_MIXER_DIRECTION_OUTPUT) {
|
||||
MateMixerStream *output;
|
||||
--
|
||||
2.30.0
|
||||
|
||||
Binary file not shown.
BIN
ukui-media-3.0.4.tar.gz
Normal file
BIN
ukui-media-3.0.4.tar.gz
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
Name: ukui-media
|
||||
Version: 3.0.2
|
||||
Release: 12
|
||||
Version: 3.0.4
|
||||
Release: 1
|
||||
Summary: UKUI media utilities
|
||||
License: GPL-2+ GPL-3+ LGPL-2+ BSD-3-Clause
|
||||
URL: http://www.ukui.org
|
||||
@ -26,22 +26,15 @@ BuildRequires: qt5-qtmultimedia-devel
|
||||
BuildRequires: qt5-qtmultimedia
|
||||
BuildRequires: kf5-kwindowsystem-devel
|
||||
BuildRequires: qt5-qttools-devel
|
||||
BuildRequires: alsa-lib-devel
|
||||
BuildRequires: pulseaudio-libs-devel
|
||||
|
||||
Requires: mate-desktop-libs >= 1.18
|
||||
Requires: ukui-media-common = %{version}
|
||||
|
||||
|
||||
Recommends: alsa-utils sound-theme-freedesktop
|
||||
|
||||
patch0: 0001-fix-vol-icon-bug.patch
|
||||
#patch1: 0002-Fix-the-right-menu-without-frosted-glass-issue.patch
|
||||
#patch2: 0003-Add-a-detection-mechanism-when-PulseAudio-exits-abno.patch
|
||||
#patch3: 0004-update-gsetting.patch
|
||||
#patch4: 0005-Solve-the-problem-of-adjusting-animation-freeze.patch
|
||||
#patch5: 0006-fix-the-slider-to-adjust-the-microphone-volume.patch
|
||||
#patch6: 0007-fix-probabilistic-crash-when-keyboard-keys-are-mute.patch
|
||||
#patch7: 0008-Set-the-app-name-and-icon-for-Kirin-Recording.patch
|
||||
#patch8: 0009-repair-the-input-device-is-not-find-of-recorder.patch
|
||||
patch1: 0001-repair-the-kylin-recorder-volume-dispaly-error-in-ky.patch
|
||||
%description
|
||||
A simple and lightweight screensaver written by Qt5.
|
||||
The screensaver supports biometric auhentication which is
|
||||
@ -58,15 +51,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
#%%patch2 -p1
|
||||
#%%patch3 -p1
|
||||
#%%patch4 -p1
|
||||
#%%patch5 -p1
|
||||
#%%patch6 -p1
|
||||
#%%patch7 -p1
|
||||
#%%patch8 -p1
|
||||
|
||||
%build
|
||||
./autogen.sh --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
|
||||
@ -75,7 +59,7 @@ make
|
||||
cd %{_builddir}/%{name}-%{version}/ukui-volume-control-applet-qt
|
||||
mkdir build && cd build
|
||||
qmake-qt5 ..
|
||||
make
|
||||
make -j32
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -92,8 +76,8 @@ cp -r %{_builddir}/%{name}-%{version}/ukui-volume-control-applet-qt/data/img/* %
|
||||
mkdir -p %{buildroot}/usr/share/ukui-media/qss
|
||||
cp -r %{_builddir}/%{name}-%{version}/ukui-volume-control-applet-qt/data/qss/* %{buildroot}/usr/share/ukui-media/qss/
|
||||
|
||||
mkdir -p %{buildroot}/usr/share/sounds
|
||||
cp -r %{_builddir}/%{name}-%{version}/ukui-volume-control-applet-qt/data/sounds/*.ogg %{buildroot}/usr/share/sounds
|
||||
cp -r %{_builddir}/%{name}-%{version}/ukui-volume-control-applet-qt/data/sounds/ukui-new-sound.xml %{buildroot}/usr/share/ukui-media/sounds
|
||||
|
||||
mkdir -p %{buildroot}/usr/share/ukui-media/scripts
|
||||
cp -r %{_builddir}/%{name}-%{version}/scripts/detection_output_mode.sh %{buildroot}/usr/share/ukui-media/scripts
|
||||
@ -123,11 +107,14 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/
|
||||
%{_datadir}/locale/
|
||||
%{_datadir}/man/*
|
||||
%{_datadir}/ukui-media/icons
|
||||
%{_datadir}/ukui-media/sounds/
|
||||
%{_datadir}/sounds/*
|
||||
%{_datadir}/glib-2.0/
|
||||
/lib/systemd/system/ukui-media-control-mute-led.service
|
||||
|
||||
%changelog
|
||||
* Fri Feb 25 2022 huayadong<huayadong@kylinos.cn> - 3.0.4-1
|
||||
- update to upstream version 3.0.4-1
|
||||
|
||||
* Mon Sep 26 2021 peijiankang<peijiankang@kylinos.cn> - 3.0.2-12
|
||||
- repair the kylin recorder volume dispaly error in ky
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user