[kde-runtime] phonon/kcm: Remove runtime backend switching.
Harald Sitter
sitter at kde.org
Wed Aug 24 13:52:27 BST 2011
Git commit 2f7865531623be58fa9fe5a0a29c117169ef3feb by Harald Sitter.
Committed on 24/08/2011 at 14:48.
Pushed by sitter into branch 'master'.
Remove runtime backend switching.
It was decided long ago that it is not worth the effort.
No currently maintained backend actually supports it, so that
Phonon git master actually stops trying to switch altogether.
Through this change the KCM will stop making Phonon switch
at runtime from 4.8 onwards and instead present a nice
KMessageWidget informing the user that they will need to
login again to apply the changes.
This will prevent backend change related crashes (in KDE >=
4.8) neverminding the version of Phonon.
CCBUG: 210427
CCMAIL: kde-multimedia at kde.org
M +14 -7 phonon/kcm/backendselection.cpp
M +88 -84 phonon/kcm/backendselection.ui
http://commits.kde.org/kde-runtime/2f7865531623be58fa9fe5a0a29c117169ef3feb
diff --git a/phonon/kcm/backendselection.cpp b/phonon/kcm/backendselection.cpp
index 96eaa20..fe2617d 100644
--- a/phonon/kcm/backendselection.cpp
+++ b/phonon/kcm/backendselection.cpp
@@ -37,6 +37,14 @@ BackendSelection::BackendSelection(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
+
+ m_messageWidget->setShown(false);
+ m_messageWidget->setCloseButtonVisible(false);
+ m_messageWidget->setMessageType(KMessageWidget::Information);
+ m_messageWidget->setText(i18nc("@info User changed Phonon backend",
+ "To apply the backend change you will have "
+ "to log out and back in again."));
+
m_down->setIcon(KIcon("go-down"));
m_up->setIcon(KIcon("go-up"));
m_comment->setWordWrap(true);
@@ -141,13 +149,12 @@ void BackendSelection::save()
}
}
- // be very conservative with this signal as it interrupts all playback:
- if (offers != services) {
- KServiceTypeProfile::writeServiceTypeProfile("PhononBackend", services);
-
- QDBusMessage signal = QDBusMessage::createSignal("/", "org.kde.Phonon.Factory", "phononBackendChanged");
- QDBusConnection::sessionBus().send(signal);
- }
+ // If the user changed the backend order, show a message that they need to
+ // log out and back in again to apply the change. This is because runtime
+ // backend switching was considered not worth the effort to actually
+ // maintain it (across backends).
+ if (offers != services)
+ m_messageWidget->animatedShow();
}
void BackendSelection::defaults()
diff --git a/phonon/kcm/backendselection.ui b/phonon/kcm/backendselection.ui
index d94bc42..5f078ca 100644
--- a/phonon/kcm/backendselection.ui
+++ b/phonon/kcm/backendselection.ui
@@ -1,8 +1,9 @@
-<ui version="4.0" >
- <author>Matthias Kretz <kretz at kde.org></author>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <author>Matthias Kretz <kretz at kde.org></author>
<class>BackendSelection</class>
- <widget class="QWidget" name="BackendSelection" >
- <property name="geometry" >
+ <widget class="QWidget" name="BackendSelection">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -10,77 +11,75 @@
<height>362</height>
</rect>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <layout class="QGridLayout" >
- <property name="margin" >
+ <item row="2" column="0">
+ <layout class="QGridLayout">
+ <property name="margin">
<number>0</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" colspan="3" >
- <widget class="QListWidget" name="m_select" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
+ <item row="0" column="0" colspan="3">
+ <widget class="QListWidget" name="m_select">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="toolTip" >
+ <property name="toolTip">
<string>A list of Phonon Backends found on your system. The order here determines the order Phonon will use them in.</string>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>A list of Phonon Backends found on your system. The order here determines the order Phonon will use them in.</string>
</property>
- <property name="dragEnabled" >
+ <property name="dragEnabled">
<bool>true</bool>
</property>
- <property name="dragDropMode" >
+ <property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QToolButton" name="m_up" >
- <property name="enabled" >
+ <item row="1" column="1">
+ <widget class="QToolButton" name="m_up">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Prefer</string>
</property>
- <property name="toolButtonStyle" >
+ <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
- <item row="1" column="2" >
- <widget class="QToolButton" name="m_down" >
- <property name="enabled" >
+ <item row="1" column="2">
+ <widget class="QToolButton" name="m_down">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Defer</string>
</property>
- <property name="toolButtonStyle" >
+ <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
- <item row="1" column="0" >
+ <item row="1" column="0">
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>81</width>
<height>20</height>
@@ -90,58 +89,54 @@
</item>
</layout>
</item>
- <item row="1" column="0" >
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
+ <item row="3" column="0">
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>9</number>
+ </property>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QLabel" name="m_icon" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <widget class="QLabel" name="m_icon">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text" >
+ <property name="text">
<string/>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="m_name" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
+ <widget class="QLabel" name="m_name">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text" >
+ <property name="text">
<string/>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
</widget>
@@ -149,54 +144,54 @@
</layout>
</item>
<item>
- <widget class="Line" name="line1" >
- <property name="frameShape" >
+ <widget class="Line" name="line1">
+ <property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="m_comment" >
- <property name="text" >
+ <widget class="QLabel" name="m_comment">
+ <property name="text">
<string/>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="m_website" >
- <property name="text" >
+ <widget class="QLabel" name="m_website">
+ <property name="text">
<string/>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="m_version" >
- <property name="text" >
+ <widget class="QLabel" name="m_version">
+ <property name="text">
<string/>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeType" >
+ <property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
@@ -207,22 +202,31 @@
</layout>
</widget>
</item>
- <item rowspan="2" row="0" column="1" >
- <widget class="QStackedWidget" name="stackedWidget" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>5</vsizetype>
+ <item row="2" column="1" rowspan="2">
+ <widget class="QStackedWidget" name="stackedWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <widget class="QWidget" name="page" />
- <widget class="QWidget" name="page_2" />
+ <widget class="QWidget" name="page"/>
+ <widget class="QWidget" name="page_2"/>
</widget>
</item>
+ <item row="1" column="0" colspan="2">
+ <widget class="KMessageWidget" name="m_messageWidget" native="true"/>
+ </item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>KMessageWidget</class>
+ <extends>QWidget</extends>
+ <header location="global">KDE/KMessageWidget</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>
More information about the kde-multimedia
mailing list