diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,9 +192,5 @@ add_subdirectory(kaccess) endif() install(FILES org.kde.plasmashell.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) -if (${ECM_VERSION} STRGREATER "5.58.0") - install(FILES plasma-desktop.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) -else() - install(FILES plasma-desktop.categories DESTINATION ${KDE_INSTALL_CONFDIR}) -endif() + feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/doc/kcontrol/CMakeLists.txt b/doc/kcontrol/CMakeLists.txt --- a/doc/kcontrol/CMakeLists.txt +++ b/doc/kcontrol/CMakeLists.txt @@ -27,6 +27,5 @@ ecm_optional_add_subdirectory(componentchooser) ecm_optional_add_subdirectory(kded) ecm_optional_add_subdirectory(solid-device-automounter) -ecm_optional_add_subdirectory(phonon) ecm_optional_add_subdirectory(workspaceoptions) diff --git a/doc/kcontrol/phonon/CMakeLists.txt b/doc/kcontrol/phonon/CMakeLists.txt deleted file mode 100644 --- a/doc/kcontrol/phonon/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -########### install files ############### -kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kcontrol/phonon) diff --git a/doc/kcontrol/phonon/index.docbook b/doc/kcontrol/phonon/index.docbook deleted file mode 100644 --- a/doc/kcontrol/phonon/index.docbook +++ /dev/null @@ -1,93 +0,0 @@ - - - -]> -
-Audio and Video Settings - - -MatthiasKretz - - - -2013-12-05 -&kde; 4.12 - - -KDE -Systemsettings -hardware -multimedia -sound -video -backend - - - - -This &systemsettings; module allows you to configure the sound and video device -preference and the backends used by Phonon. - - - -Device Preference tab - -On the left you are presented a tree list with various categories of playback and recording. -For each category you may choose what device you wish to use. -The Audio Playback and Audio Recording -items define the default ordering of devices which can be overridden by -each sub items. -Clicking the Apply Device List To button shows a dialog -which enables you to copy the selected setting from one category to many others. -Highlight a category and the available devices for this category are displayed in the -list on the right. The order in this list determines the preference of the output and capture -devices. If for some reason the first device cannot be used Phonon will try to use the second, &etc; -Use the Prefer and Defer buttons to change the order -and the Test button to play a test sound on the selected device. - - - -Audio Hardware Setup tab - -The various drop down boxes in this tab allow full control over all cards that are attached -to the system. - - -Hardware -Select the Sound Card and an available -Profile to be used. - - -Device Configuration -Select the Sound Device and a Connector. - - -Speaker Placement and Testing or Input Levels - -For a playback device: The buttons on this pane allow you to test each speaker separately. - -For a recording device: A slider shows the Input Levels -of the selected Connector. - - - - - - - - - -Backend tab - -On the left side of this module a list of Phonon backends found on your system is shown. -The order here determines the order Phonon will use the backends. -Use the Prefer and Defer buttons -to change this order. - - - - - -
diff --git a/kcms/CMakeLists.txt b/kcms/CMakeLists.txt --- a/kcms/CMakeLists.txt +++ b/kcms/CMakeLists.txt @@ -44,7 +44,6 @@ add_subdirectory(kded) add_subdirectory(formats) add_subdirectory(notifications) -add_subdirectory(phonon) add_subdirectory(runners) add_subdirectory(spellchecking) add_subdirectory(qtquicksettings) diff --git a/kcms/phonon/CMakeLists.txt b/kcms/phonon/CMakeLists.txt deleted file mode 100644 --- a/kcms/phonon/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -find_package(Phonon4Qt5 4.6.60 NO_MODULE) -include_directories(BEFORE ${PHONON_INCLUDES}) -add_definitions(-DPHONON_LIB_SONAME=\"${PHONON_LIB_SONAME}\") -# KI18N Translation Domain for this library -add_definitions(-DTRANSLATION_DOMAIN=\"kcm5_phonon\") - - -set(kcmphonon_SRCS main.cpp devicepreference.cpp backendselection.cpp) -ki18n_wrap_ui(kcmphonon_SRCS devicepreference.ui backendselection.ui) -set(kcmphonon_LIBS - KF5::ConfigWidgets - KF5::I18n - KF5::IconThemes - KF5::KCMUtils - KF5::KIOWidgets - ${PHONON_LIBRARY}) - -ecm_qt_declare_logging_category(kcmphonon_SRCS HEADER phonon_debug.h IDENTIFIER KCM_PHONON_LOG CATEGORY_NAME org.kde.kcm.phonon) - -add_library(kcm_phonon MODULE ${kcmphonon_SRCS}) -target_link_libraries(kcm_phonon ${kcmphonon_LIBS} KF5::ConfigWidgets) - -install(TARGETS kcm_phonon DESTINATION ${KDE_INSTALL_PLUGINDIR} ) - -########### install files ############### -install( FILES kcm_phonon.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) -install(FILES listview-background.png DESTINATION ${KDE_INSTALL_DATADIR}/kcm_phonon) diff --git a/kcms/phonon/Messages.sh b/kcms/phonon/Messages.sh deleted file mode 100644 --- a/kcms/phonon/Messages.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/bin/env bash -$EXTRACTRC *.ui >> rc.cpp -find . -type d | fgrep -v '.svn' | sed -e 's,$,/,' > dirs -msh=`find . -name Messages.sh` -for dir in $msh; do - dir=`dirname $dir` - if test "$dir" != "."; then - egrep -v "^$dir" dirs > dirs.new && mv dirs.new dirs - fi -done -fgrep -v "/tests" dirs > dirs.new && mv dirs.new dirs -dirs=`cat dirs` -find $dirs -maxdepth 1 -name "*.cpp" -print > files -find $dirs -maxdepth 1 -name "*.cc" -print >> files -find $dirs -maxdepth 1 -name "*.h" -print >> files -$XGETTEXT --files-from=files -o $podir/kcm5_phonon.pot -rm -f dirs -rm -f files diff --git a/kcms/phonon/backendselection.h b/kcms/phonon/backendselection.h deleted file mode 100644 --- a/kcms/phonon/backendselection.h +++ /dev/null @@ -1,73 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2004-2007 Matthias Kretz - Copyright (C) 2011-2014 Harald Sitter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) version 3. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef BACKENDSELECTION_H -#define BACKENDSELECTION_H - -#include "ui_backendselection.h" - -#include -#include - - -struct BackendDescriptor { - explicit BackendDescriptor(const QString &path = QString()); - - bool isValid; - - QString iid; - - QString name; - QString icon; - QString version; - QString website; - int preference; - - QString pluginPath; - - /** Implemented for qSort(QList) */ - bool operator <(const BackendDescriptor &rhs) const; -}; - -class BackendSelection : public QWidget, private Ui::BackendSelection -{ - Q_OBJECT -public: - explicit BackendSelection(QWidget *parent = nullptr); - - void load(); - void save(); - void defaults(); - -private Q_SLOTS: - void selectionChanged(); - void up(); - void down(); - void openWebsite(const QString &url); - -Q_SIGNALS: - void changed(); - -private: - QHash m_backends; - int m_emptyPage; -}; - -#endif // BACKENDSELECTION_H diff --git a/kcms/phonon/backendselection.cpp b/kcms/phonon/backendselection.cpp deleted file mode 100644 --- a/kcms/phonon/backendselection.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2004-2007 Matthias Kretz - Copyright (C) 2011-2014 Harald Sitter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) version 3. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "backendselection.h" - -#include -#include -#include -#include - -#include "phonon_debug.h" -#include -#include -#include -#include -#include - -BackendDescriptor::BackendDescriptor(const QString &path) - : isValid(false) -{ - QPluginLoader loader(path); - - iid = loader.metaData().value(QLatin1Literal("IID")).toString(); - - const QJsonObject metaData = loader.metaData().value(QLatin1Literal("MetaData")).toObject(); - name = metaData.value(QLatin1Literal("Name")).toString(); - icon = metaData.value(QLatin1Literal("Icon")).toString(); - version = metaData.value(QLatin1Literal("Version")).toString(); - website = metaData.value(QLatin1Literal("Website")).toString(); - preference = metaData.value(QLatin1Literal("InitialPreference")).toDouble(); - - pluginPath = path; - - if (name.isEmpty()) - name = QFileInfo(path).baseName(); - - if (iid.isEmpty()) - return; // Not valid. - - isValid = true; -} - -bool BackendDescriptor::operator <(const BackendDescriptor &rhs) const -{ - return this->preference < rhs.preference; -} - -BackendSelection::BackendSelection(QWidget *parent) - : QWidget(parent) -{ - setupUi(this); - - m_messageWidget->setVisible(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(QIcon::fromTheme(QStringLiteral("go-down"))); - m_up->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); - m_comment->setWordWrap(true); - - m_emptyPage = stackedWidget->addWidget(new QWidget()); - - connect(m_select, &QListWidget::itemSelectionChanged, this, &BackendSelection::selectionChanged); - connect(m_up, &QToolButton::clicked, this, &BackendSelection::up); - connect(m_down, &QToolButton::clicked, this, &BackendSelection::down); -} - -void BackendSelection::load() -{ - // NOTE: for phonon5 this should move into the library in some form. - m_backends.clear(); - - // Read already configured order. - QList iidPreference; - QSettings settings("kde.org", "libphonon"); - const int size = settings.beginReadArray("Backends"); - qCDebug(KCM_PHONON_LOG) << settings.fileName(); - for (int i = 0; i < size; ++i) { - settings.setArrayIndex(i); - iidPreference.append(settings.value(QLatin1String("iid")).toString()); - } - settings.endArray(); - - const QLatin1Literal suffix("/" PHONON_LIB_SONAME "_backend/"); - const QStringList paths = QCoreApplication::libraryPaths(); - qCDebug(KCM_PHONON_LOG) << "libpaths" << paths; - - QList backendList; - - foreach (const QString &path, paths) { - const QString libPath = path + suffix; - const QDir dir(libPath); - if (!dir.exists()) { - qCDebug(KCM_PHONON_LOG) << Q_FUNC_INFO << dir.absolutePath() << "does not exist"; - continue; - } - - const QStringList plugins(dir.entryList(QDir::Files)); - - for (const QString &plugin : plugins) { - BackendDescriptor bd = BackendDescriptor(libPath + plugin); - if (bd.isValid) { - int preference = iidPreference.indexOf(bd.iid); - if (preference != -1) - bd.preference = preference; - backendList.append(bd); - } - } - - std::sort(backendList.begin(), backendList.end()); - } - - /// -------------- LOAD - - m_select->clear(); - - foreach (const struct BackendDescriptor &bd, backendList) { - m_select->addItem(bd.name); - m_backends.insert(bd.name, bd); - } - m_select->item(0)->setSelected(true); -} - -void BackendSelection::save() -{ - qCDebug(KCM_PHONON_LOG) << Q_FUNC_INFO; - qCDebug(KCM_PHONON_LOG) << "~~~~~~~~~~~~~~"; - QSettings settings("kde.org", "libphonon"); - settings.beginWriteArray("Backends", m_select->count()); - for (int i = 0; i < m_select->count(); ++i) { - settings.setArrayIndex(i); - const QListWidgetItem *item = m_select->item(i); - const BackendDescriptor backend = m_backends.value(item->text()); - settings.setValue("iid", backend.iid); - } - settings.endArray(); - settings.sync(); - - qCDebug(KCM_PHONON_LOG) << settings.fileName(); -} - -void BackendSelection::defaults() -{ - load(); -} - -void BackendSelection::selectionChanged() -{ - qCDebug(KCM_PHONON_LOG) << "qooooooooo"; - if (m_select->selectedItems().isEmpty()) { - m_up->setEnabled(false); - m_down->setEnabled(false); - } else { - const QListWidgetItem *const item = m_select->selectedItems().first(); - m_up->setEnabled(m_select->row(item) > 0); - m_down->setEnabled(m_select->row(item) < m_select->count() - 1); - BackendDescriptor backend = m_backends[item->text()]; - - // Have some icon other than "unknown" for backends which don't install an icon. - QIcon icon = QIcon::fromTheme(backend.icon); - if (icon.isNull()) { - QPixmap iconPixmap = KIconLoader::global()->loadIcon("preferences-desktop-sound", KIconLoader::NoGroup, 128); - m_icon->setPixmap(iconPixmap); - } else { - m_icon->setPixmap(icon.pixmap(128, 128)); - } - - m_name->setText(backend.name); - m_website->setText(QString("%1").arg(backend.website)); - connect(m_website, &QLabel::linkActivated, this, &BackendSelection::openWebsite, Qt::UniqueConnection); - m_version->setText(backend.version); - } -} - -void BackendSelection::openWebsite(const QString &url) -{ - new KRun(QUrl(url), window()); -} - -void BackendSelection::up() -{ - QList selectedList = m_select->selectedItems(); - foreach (QListWidgetItem *selected, selectedList) { - const int row = m_select->row(selected); - if (row > 0) { - QListWidgetItem *taken = m_select->takeItem(row - 1); - m_select->insertItem(row, taken); - emit changed(); - selectionChanged(); - } - } -} - -void BackendSelection::down() -{ - QList selectedList = m_select->selectedItems(); - foreach (QListWidgetItem *selected, selectedList) { - const int row = m_select->row(selected); - if (row + 1 < m_select->count()) { - QListWidgetItem *taken = m_select->takeItem(row + 1); - m_select->insertItem(row, taken); - emit changed(); - selectionChanged(); - } - } -} - diff --git a/kcms/phonon/backendselection.ui b/kcms/phonon/backendselection.ui deleted file mode 100644 --- a/kcms/phonon/backendselection.ui +++ /dev/null @@ -1,232 +0,0 @@ - - - Matthias Kretz <kretz@kde.org> - BackendSelection - - - - 0 - 0 - 510 - 362 - - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - - 0 - 0 - - - - A list of Phonon Backends found on your system. The order here determines the order Phonon will use them in. - - - A list of Phonon Backends found on your system. The order here determines the order Phonon will use them in. - - - true - - - QAbstractItemView::InternalMove - - - - - - - false - - - Prefer - - - Qt::ToolButtonTextBesideIcon - - - - - - - false - - - Defer - - - Qt::ToolButtonTextBesideIcon - - - - - - - Qt::Horizontal - - - - 81 - 20 - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 6 - - - 9 - - - - - 6 - - - 0 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - Qt::AlignVCenter - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - - - - Qt::AlignVCenter - - - - - - - - - - - - - - - - - Qt::AlignVCenter - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - - - KMessageWidget - QWidget -
KMessageWidget
- 1 -
-
- - -
diff --git a/kcms/phonon/devicepreference.h b/kcms/phonon/devicepreference.h deleted file mode 100644 --- a/kcms/phonon/devicepreference.h +++ /dev/null @@ -1,95 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006-2008 Matthias Kretz - Copyright (C) 2011 Casian Andrei - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) version 3. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef DEVICEPREFERENCE_H_STUPID_UIC -#define DEVICEPREFERENCE_H_STUPID_UIC - -#include "ui_devicepreference.h" - -#include -#include - -#include -#include - -namespace Phonon { - -class MediaObject; -class AudioOutput; -class VideoWidget; - -class DevicePreference : public QWidget, private Ui::DevicePreference -{ - Q_OBJECT -public: - explicit DevicePreference(QWidget *parent = nullptr); - ~DevicePreference() override; - - void load(); - void save(); - void defaults(); - void pulseAudioEnabled(); - -Q_SIGNALS: - void changed(); - -protected: - void changeEvent(QEvent *) override; - -private Q_SLOTS: - void on_preferButton_clicked(); - void on_deferButton_clicked(); - void on_showAdvancedDevicesCheckBox_toggled(); - void on_applyPreferencesButton_clicked(); - void on_testPlaybackButton_toggled(bool down); - void updateButtonsEnabled(); - void updateDeviceList(); - void updateAudioOutputDevices(); - void updateAudioCaptureDevices(); - void updateVideoCaptureDevices(); - -private: - enum DeviceType {dtInvalidDevice, dtAudioOutput, dtAudioCapture, dtVideoCapture}; - -private: - template void removeDevice(const ObjectDescription &deviceToRemove, - QMap *> *modelMap); - void loadCategoryDevices(); - QList availableAudioOutputDevices() const; - QList availableAudioCaptureDevices() const; - QList availableVideoCaptureDevices() const; - DeviceType shownModelType() const; - -private: - QMap m_audioOutputModel; - QMap m_audioCaptureModel; - QMap m_videoCaptureModel; - QStandardItemModel m_categoryModel; - QStandardItemModel m_headerModel; - DeviceType m_testingType; - - MediaObject *m_media; - AudioOutput *m_audioOutput; - VideoWidget *m_videoWidget; -}; - -} // namespace Phonon - -#endif // DEVICEPREFERENCE_H_STUPID_UIC diff --git a/kcms/phonon/devicepreference.cpp b/kcms/phonon/devicepreference.cpp deleted file mode 100644 --- a/kcms/phonon/devicepreference.cpp +++ /dev/null @@ -1,993 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006-2008 Matthias Kretz - Copyright (C) 2011 Casian Andrei - Copyright (C) 2014 Harald Sitter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) version 3. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "devicepreference.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifndef METATYPE_QLIST_INT_DEFINED -#define METATYPE_QLIST_INT_DEFINED -// Want this exactly once, see phonondefs_p.h kcm/devicepreference.cpp -Q_DECLARE_METATYPE(QList) -#endif - -namespace Phonon { - -/* - * Lists of categories for every device type - */ -static const Category audioOutCategories[] = { - NoCategory, - NotificationCategory, - MusicCategory, - VideoCategory, - CommunicationCategory, - GameCategory, - AccessibilityCategory, -}; - -static const CaptureCategory audioCapCategories[] = { - NoCaptureCategory, - CommunicationCaptureCategory, - RecordingCaptureCategory, - ControlCaptureCategory -}; - -static const CaptureCategory videoCapCategories[] = { - NoCaptureCategory, - CommunicationCaptureCategory, - RecordingCaptureCategory, -}; - -static const int audioOutCategoriesCount = sizeof(audioOutCategories) / sizeof(Category); -static const int audioCapCategoriesCount = sizeof(audioCapCategories) / sizeof(CaptureCategory); -static const int videoCapCategoriesCount = sizeof(videoCapCategories) / sizeof(CaptureCategory); - -void operator++(Category &c) -{ - c = static_cast(1 + static_cast(c)); - //Q_ASSERT(c <= LastCategory); -} - -class CategoryItem : public QStandardItem { -public: - CategoryItem(Category cat) - : QStandardItem(), - m_cat(cat), - m_odtype(AudioOutputDeviceType) - { - if (cat == NoCategory) { - setText(i18n("Audio Playback")); - } else { - setText(categoryToString(cat)); - } - } - - CategoryItem(CaptureCategory cat, ObjectDescriptionType t = AudioCaptureDeviceType) - : QStandardItem(), - m_capcat(cat), - m_odtype(t) - { - if (cat == NoCaptureCategory) { - switch(t) { - case AudioCaptureDeviceType: - setText(i18n("Audio Recording")); - break; - case VideoCaptureDeviceType: - setText(i18n("Video Recording")); - break; - default: - setText(i18n("Invalid")); - } - } else { - setText(categoryToString(cat)); - } - } - - int type() const override { return 1001; } - Category category() const { return m_cat; } - CaptureCategory captureCategory() const { return m_capcat; } - ObjectDescriptionType odtype() const { return m_odtype; } - -private: - Category m_cat; - CaptureCategory m_capcat; - ObjectDescriptionType m_odtype; -}; - -/** - * Need this to change the colors of the ListView if the Palette changed. With CSS set this won't - * change automatically - */ -void DevicePreference::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - if (e->type() == QEvent::PaletteChange) { - deviceList->setStyleSheet(deviceList->styleSheet()); - } -} - -DevicePreference::DevicePreference(QWidget *parent) - : QWidget(parent), - m_headerModel(0, 1, nullptr), - m_media(nullptr), m_audioOutput(nullptr), m_videoWidget(nullptr) -{ - setupUi(this); - - // Setup the buttons - testPlaybackButton->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start"))); - testPlaybackButton->setEnabled(false); - testPlaybackButton->setToolTip(i18n("Test the selected device")); - deferButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); - preferButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); - - // Configure the device list - deviceList->setDragDropMode(QAbstractItemView::InternalMove); - deviceList->setStyleSheet(QStringLiteral("QTreeView {" - "background-color: palette(base);" - "background-image: url(%1);" - "background-position: bottom left;" - "background-attachment: fixed;" - "background-repeat: no-repeat;" - "background-clip: padding;" - "}") - .arg(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kcm_phonon/listview-background.png"))); - deviceList->setAlternatingRowColors(false); - - // The root item for the categories - QStandardItem *parentItem = m_categoryModel.invisibleRootItem(); - - // Audio Output Parent - QStandardItem *aOutputItem = new CategoryItem(NoCategory); - m_audioOutputModel[NoCategory] = new AudioOutputDeviceModel(this); - aOutputItem->setEditable(false); - aOutputItem->setToolTip(i18n("Defines the default ordering of devices which can be overridden by individual categories.")); - parentItem->appendRow(aOutputItem); - - // Audio Capture Parent - QStandardItem *aCaptureItem = new CategoryItem(NoCaptureCategory, AudioCaptureDeviceType); - m_audioCaptureModel[NoCaptureCategory] = new AudioCaptureDeviceModel(this); - aCaptureItem->setEditable(false); - aCaptureItem->setToolTip(i18n("Defines the default ordering of devices which can be overridden by individual categories.")); - parentItem->appendRow(aCaptureItem); - - // Video Capture Parent - QStandardItem *vCaptureItem = new CategoryItem(NoCaptureCategory, VideoCaptureDeviceType); - m_videoCaptureModel[NoCaptureCategory] = new VideoCaptureDeviceModel(this); - vCaptureItem->setEditable(false); - vCaptureItem->setToolTip(i18n("Defines the default ordering of devices which can be overridden by individual categories.")); - parentItem->appendRow(vCaptureItem); - - // Audio Output Children - parentItem = aOutputItem; - for (int i = 1; i < audioOutCategoriesCount; ++i) { // i == 1 to skip NoCategory - m_audioOutputModel[audioOutCategories[i]] = new AudioOutputDeviceModel(this); - QStandardItem *item = new CategoryItem(audioOutCategories[i]); - item->setEditable(false); - parentItem->appendRow(item); - } - - // Audio Capture Children - parentItem = aCaptureItem; - for (int i = 1; i < audioCapCategoriesCount; ++i) { // i == 1 to skip NoCategory - m_audioCaptureModel[audioCapCategories[i]] = new AudioCaptureDeviceModel(this); - QStandardItem *item = new CategoryItem(audioCapCategories[i], AudioCaptureDeviceType); - item->setEditable(false); - parentItem->appendRow(item); - } - - // Video Capture Children - parentItem = vCaptureItem; - for (int i = 1; i < videoCapCategoriesCount; ++i) { // i == 1 to skip NoCategory - m_videoCaptureModel[videoCapCategories[i]] = new VideoCaptureDeviceModel(this); - QStandardItem *item = new CategoryItem(videoCapCategories[i], VideoCaptureDeviceType); - item->setEditable(false); - parentItem->appendRow(item); - } - - // Configure the category tree - categoryTree->setModel(&m_categoryModel); - if (categoryTree->header()) { - categoryTree->header()->hide(); - } - categoryTree->expandAll(); - - connect(categoryTree->selectionModel(), SIGNAL(currentChanged(const QModelIndex &,const QModelIndex &)), - SLOT(updateDeviceList())); - - // Connect all model data change signals to the changed slot - for (int i = -1; i <= LastCategory; ++i) { - connect(m_audioOutputModel[i], SIGNAL(rowsInserted(QModelIndex, int, int)), this, SIGNAL(changed())); - connect(m_audioOutputModel[i], SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SIGNAL(changed())); - connect(m_audioOutputModel[i], SIGNAL(layoutChanged()), this, SIGNAL(changed())); - connect(m_audioOutputModel[i], SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SIGNAL(changed())); - if (m_audioCaptureModel.contains(i)) { - connect(m_audioCaptureModel[i], SIGNAL(rowsInserted(QModelIndex, int, int)), this, SIGNAL(changed())); - connect(m_audioCaptureModel[i], SIGNAL(rowsRemoved(QModelIndex , int, int)), this, SIGNAL(changed())); - connect(m_audioCaptureModel[i], SIGNAL(layoutChanged()), this, SIGNAL(changed())); - connect(m_audioCaptureModel[i], SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SIGNAL(changed())); - } - if (m_videoCaptureModel.contains(i)) { - connect(m_videoCaptureModel[i], SIGNAL(rowsInserted(QModelIndex, int, int)), this, SIGNAL(changed())); - connect(m_videoCaptureModel[i], SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SIGNAL(changed())); - connect(m_videoCaptureModel[i], SIGNAL(layoutChanged()), this, SIGNAL(changed())); - connect(m_videoCaptureModel[i], SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SIGNAL(changed())); - } - } - - connect(showAdvancedDevicesCheckBox, &QCheckBox::stateChanged, this, &DevicePreference::changed); - - // Connect the signals from Phonon that notify changes in the device lists - connect(BackendCapabilities::notifier(), SIGNAL(availableAudioOutputDevicesChanged()), SLOT(updateAudioOutputDevices())); - connect(BackendCapabilities::notifier(), SIGNAL(availableAudioCaptureDevicesChanged()), SLOT(updateAudioCaptureDevices())); - connect(BackendCapabilities::notifier(), SIGNAL(availableVideoCaptureDevicesChanged()), SLOT(updateVideoCaptureDevices())); - connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), SLOT(updateAudioOutputDevices())); - connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), SLOT(updateAudioCaptureDevices())); - connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), SLOT(updateVideoCaptureDevices())); - - if (!categoryTree->currentIndex().isValid()) { - categoryTree->setCurrentIndex(m_categoryModel.index(0, 0).child(1, 0)); - } -} - -DevicePreference::~DevicePreference() -{ - // Ensure that the video widget is destroyed, if it remains active - delete m_videoWidget; -} - -void DevicePreference::updateDeviceList() -{ - // Temporarily disconnect the device list selection model - if (deviceList->selectionModel()) { - disconnect(deviceList->selectionModel(), - SIGNAL(currentRowChanged(const QModelIndex &,const QModelIndex &)), - this, SLOT(updateButtonsEnabled())); - } - - // Get the current selected category item - QStandardItem *currentItem = m_categoryModel.itemFromIndex(categoryTree->currentIndex()); - if (currentItem && currentItem->type() == 1001) { - CategoryItem *catItem = static_cast(currentItem); - bool cap = catItem->odtype() != AudioOutputDeviceType; - const Category cat = catItem->category(); - const CaptureCategory capcat = catItem->captureCategory(); - - // Update the device list, by setting it's model to the one for the corresponding category - switch (catItem->odtype()) { - case AudioOutputDeviceType: - deviceList->setModel(m_audioOutputModel[cat]); - break; - case AudioCaptureDeviceType: - deviceList->setModel(m_audioCaptureModel[capcat]); - break; - case VideoCaptureDeviceType: - deviceList->setModel(m_videoCaptureModel[capcat]); - break; - default: ; - } - - // Update the header - if (cap ? capcat == NoCaptureCategory : cat == NoCategory) { - switch (catItem->odtype()) { - case AudioOutputDeviceType: - m_headerModel.setHeaderData(0, Qt::Horizontal, i18n("Default Audio Playback Device Preference"), Qt::DisplayRole); - break; - case AudioCaptureDeviceType: - m_headerModel.setHeaderData(0, Qt::Horizontal, i18n("Default Audio Recording Device Preference"), Qt::DisplayRole); - break; - case VideoCaptureDeviceType: - m_headerModel.setHeaderData(0, Qt::Horizontal, i18n("Default Video Recording Device Preference"), Qt::DisplayRole); - break; - default: ; - } - } else { - switch (catItem->odtype()) { - case AudioOutputDeviceType: - m_headerModel.setHeaderData(0, Qt::Horizontal, i18n("Audio Playback Device Preference for the '%1' Category", - categoryToString(cat)), Qt::DisplayRole); - break; - case AudioCaptureDeviceType: - m_headerModel.setHeaderData(0, Qt::Horizontal, i18n("Audio Recording Device Preference for the '%1' Category", - categoryToString(capcat)), Qt::DisplayRole); - break; - case VideoCaptureDeviceType: - m_headerModel.setHeaderData(0, Qt::Horizontal, i18n("Video Recording Device Preference for the '%1' Category", - categoryToString(capcat)), Qt::DisplayRole); - break; - default: ; - } - } - } else { - // No valid category selected - m_headerModel.setHeaderData(0, Qt::Horizontal, QString(), Qt::DisplayRole); - deviceList->setModel(nullptr); - } - - // Update the header, the buttons enabled state - deviceList->header()->setModel(&m_headerModel); - updateButtonsEnabled(); - - // Reconnect the device list selection model - if (deviceList->selectionModel()) { - connect(deviceList->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &,const QModelIndex &)), - this, SLOT(updateButtonsEnabled())); - } - - deviceList->resizeColumnToContents(0); -} - -void DevicePreference::updateAudioCaptureDevices() -{ - const QList list = availableAudioCaptureDevices(); - QHash hash; - foreach (const AudioCaptureDevice &dev, list) { - hash.insert(dev.index(), dev); - } - - for (int catIndex = 0; catIndex < audioCapCategoriesCount; ++ catIndex) { - const int i = audioCapCategories[catIndex]; - AudioCaptureDeviceModel *model = m_audioCaptureModel.value(i); - Q_ASSERT(model); - - QHash hashCopy(hash); - QList orderedList; - - if (model->rowCount() > 0) { - QList order = model->tupleIndexOrder(); - foreach (int idx, order) { - if (hashCopy.contains(idx)) { - orderedList << hashCopy.take(idx); - } - } - - if (hashCopy.size() > 1) { - // keep the order of the original list - foreach (const AudioCaptureDevice &dev, list) { - if (hashCopy.contains(dev.index())) { - orderedList << hashCopy.take(dev.index()); - } - } - } else if (hashCopy.size() == 1) { - orderedList += hashCopy.values(); - } - - model->setModelData(orderedList); - } else { - model->setModelData(list); - } - } - - deviceList->resizeColumnToContents(0); -} - -void DevicePreference::updateVideoCaptureDevices() -{ - const QList list = availableVideoCaptureDevices(); - QHash hash; - foreach (const VideoCaptureDevice &dev, list) { - hash.insert(dev.index(), dev); - } - - for (int catIndex = 0; catIndex < videoCapCategoriesCount; ++ catIndex) { - const int i = videoCapCategories[catIndex]; - VideoCaptureDeviceModel *model = m_videoCaptureModel.value(i); - Q_ASSERT(model); - - QHash hashCopy(hash); - QList orderedList; - - if (model->rowCount() > 0) { - QList order = model->tupleIndexOrder(); - foreach (int idx, order) { - if (hashCopy.contains(idx)) { - orderedList << hashCopy.take(idx); - } - } - - if (hashCopy.size() > 1) { - // keep the order of the original list - foreach (const VideoCaptureDevice &dev, list) { - if (hashCopy.contains(dev.index())) { - orderedList << hashCopy.take(dev.index()); - } - } - } else if (hashCopy.size() == 1) { - orderedList += hashCopy.values(); - } - - model->setModelData(orderedList); - } else { - model->setModelData(list); - } - } - - deviceList->resizeColumnToContents(0); -} - -void DevicePreference::updateAudioOutputDevices() -{ - const QList list = availableAudioOutputDevices(); - QHash hash; - foreach (const AudioOutputDevice &dev, list) { - hash.insert(dev.index(), dev); - } - - for (int catIndex = 0; catIndex < audioOutCategoriesCount; ++ catIndex) { - const int i = audioOutCategories[catIndex]; - AudioOutputDeviceModel *model = m_audioOutputModel.value(i); - Q_ASSERT(model); - - QHash hashCopy(hash); - QList orderedList; - - if (model->rowCount() > 0) { - QList order = model->tupleIndexOrder(); - foreach (int idx, order) { - if (hashCopy.contains(idx)) { - orderedList << hashCopy.take(idx); - } - } - - if (hashCopy.size() > 1) { - // keep the order of the original list - foreach (const AudioOutputDevice &dev, list) { - if (hashCopy.contains(dev.index())) { - orderedList << hashCopy.take(dev.index()); - } - } - } else if (hashCopy.size() == 1) { - orderedList += hashCopy.values(); - } - - model->setModelData(orderedList); - } else { - model->setModelData(list); - } - } - - deviceList->resizeColumnToContents(0); -} - -QList DevicePreference::availableAudioOutputDevices() const -{ - return BackendCapabilities::availableAudioOutputDevices(); -} - -QList DevicePreference::availableAudioCaptureDevices() const -{ -#ifndef PHONON_NO_AUDIOCAPTURE - return BackendCapabilities::availableAudioCaptureDevices(); -#else - return QList(); -#endif -} - -QList DevicePreference::availableVideoCaptureDevices() const -{ -#ifndef PHONON_NO_VIDEOCAPTURE - return BackendCapabilities::availableVideoCaptureDevices(); -#else - return QList(); -#endif -} - -void DevicePreference::load() -{ - showAdvancedDevicesCheckBox->setChecked(!GlobalConfig().hideAdvancedDevices()); - loadCategoryDevices(); -} - -void DevicePreference::loadCategoryDevices() -{ - // "Load" the settings from the backend. - for (int i = 0; i < audioOutCategoriesCount; ++ i) { - const Category cat = audioOutCategories[i]; - QList list; - const QList deviceIndexes = GlobalConfig().audioOutputDeviceListFor(cat); - foreach (int i, deviceIndexes) { - list.append(AudioOutputDevice::fromIndex(i)); - } - - m_audioOutputModel[cat]->setModelData(list); - } - -#ifndef PHONON_NO_AUDIOCAPTURE - for (int i = 0; i < audioCapCategoriesCount; ++ i) { - const CaptureCategory cat = audioCapCategories[i]; - QList list; - const QList deviceIndexes = GlobalConfig().audioCaptureDeviceListFor(cat); - foreach (int i, deviceIndexes) { - list.append(AudioCaptureDevice::fromIndex(i)); - } - - m_audioCaptureModel[cat]->setModelData(list); - } -#endif - -#ifndef PHONON_NO_VIDEOCAPTURE - for (int i = 0; i < videoCapCategoriesCount; ++ i) { - const CaptureCategory cat = videoCapCategories[i]; - QList list; - const QList deviceIndexes = GlobalConfig().videoCaptureDeviceListFor(cat); - foreach (int i, deviceIndexes) { - list.append(VideoCaptureDevice::fromIndex(i)); - } - - m_videoCaptureModel[cat]->setModelData(list); - } -#endif - - deviceList->resizeColumnToContents(0); -} - -void DevicePreference::save() -{ - for (int i = 0; i < audioOutCategoriesCount; ++i) { - const Category cat = audioOutCategories[i]; - Q_ASSERT(m_audioOutputModel.value(cat)); - const QList order = m_audioOutputModel.value(cat)->tupleIndexOrder(); - GlobalConfig().setAudioOutputDeviceListFor(cat, order); - } - -#ifndef PHONON_NO_AUDIOCAPTURE - for (int i = 0; i < audioCapCategoriesCount; ++i) { - const CaptureCategory cat = audioCapCategories[i]; - Q_ASSERT(m_audioCaptureModel.value(cat)); - const QList order = m_audioCaptureModel.value(cat)->tupleIndexOrder(); - GlobalConfig().setAudioCaptureDeviceListFor(cat, order); - } -#endif - -#ifndef PHONON_NO_VIDEOCAPTURE - for (int i = 0; i < videoCapCategoriesCount; ++i) { - const CaptureCategory cat = videoCapCategories[i]; - Q_ASSERT(m_videoCaptureModel.value(cat)); - const QList order = m_videoCaptureModel.value(cat)->tupleIndexOrder(); - GlobalConfig().setVideoCaptureDeviceListFor(cat, order); - } -#endif -} - -void DevicePreference::defaults() -{ - { - const QList list = availableAudioOutputDevices(); - for (int i = 0; i < audioOutCategoriesCount; ++i) { - m_audioOutputModel[audioOutCategories[i]]->setModelData(list); - } - } - { - const QList list = availableAudioCaptureDevices(); - for (int i = 0; i < audioCapCategoriesCount; ++i) { - m_audioCaptureModel[audioCapCategories[i]]->setModelData(list); - } - } - { - const QList list = availableVideoCaptureDevices(); - for (int i = 0; i < videoCapCategoriesCount; ++i) { - m_videoCaptureModel[videoCapCategories[i]]->setModelData(list); - } - } - - /* - * Save this list (that contains even hidden devices) to GlobaConfig, and then - * load them back. All devices that should be hidden will be hidden - */ - save(); - loadCategoryDevices(); - - deviceList->resizeColumnToContents(0); -} - -void DevicePreference::pulseAudioEnabled() -{ - showAdvancedDevicesContainer->removeItem(showAdvancedDevicesSpacer); - delete showAdvancedDevicesSpacer; - showAdvancedDevicesCheckBox->setVisible(false); -} - -void DevicePreference::on_preferButton_clicked() -{ - QAbstractItemModel *model = deviceList->model(); - { - AudioOutputDeviceModel *deviceModel = dynamic_cast(model); - if (deviceModel) { - deviceModel->moveUp(deviceList->currentIndex()); - updateButtonsEnabled(); - emit changed(); - } - } - { - AudioCaptureDeviceModel *deviceModel = dynamic_cast(model); - if (deviceModel) { - deviceModel->moveUp(deviceList->currentIndex()); - updateButtonsEnabled(); - emit changed(); - } - } - { - VideoCaptureDeviceModel *deviceModel = dynamic_cast(model); - if (deviceModel) { - deviceModel->moveUp(deviceList->currentIndex()); - updateButtonsEnabled(); - emit changed(); - } - } -} - -void DevicePreference::on_deferButton_clicked() -{ - QAbstractItemModel *model = deviceList->model(); - { - AudioOutputDeviceModel *deviceModel = dynamic_cast(model); - if (deviceModel) { - deviceModel->moveDown(deviceList->currentIndex()); - updateButtonsEnabled(); - emit changed(); - } - } - { - AudioCaptureDeviceModel *deviceModel = dynamic_cast(model); - if (deviceModel) { - deviceModel->moveDown(deviceList->currentIndex()); - updateButtonsEnabled(); - emit changed(); - } - } - { - VideoCaptureDeviceModel *deviceModel = dynamic_cast(model); - if (deviceModel) { - deviceModel->moveDown(deviceList->currentIndex()); - updateButtonsEnabled(); - emit changed(); - } - } -} - - -DevicePreference::DeviceType DevicePreference::shownModelType() const -{ - const QStandardItem *item = m_categoryModel.itemFromIndex(categoryTree->currentIndex()); - if (!item) - return dtInvalidDevice; - Q_ASSERT(item->type() == 1001); - - const CategoryItem *catItem = static_cast(item); - if (!catItem) - return dtInvalidDevice; - - switch (catItem->odtype()) { - case AudioOutputDeviceType: - return dtAudioOutput; - case AudioCaptureDeviceType: - return dtAudioCapture; - case VideoCaptureDeviceType: - return dtVideoCapture; - default: - return dtInvalidDevice; - } -} - -void DevicePreference::on_applyPreferencesButton_clicked() -{ - const QModelIndex idx = categoryTree->currentIndex(); - const QStandardItem *item = m_categoryModel.itemFromIndex(idx); - if (!item) - return; - Q_ASSERT(item->type() == 1001); - - const CategoryItem *catItem = static_cast(item); - - QList aoPreferredList; - QList acPreferredList; - QList vcPreferredList; - const Category *categoryList = nullptr; - const CaptureCategory *capCategoryList = nullptr; - int categoryListCount; - int catIndex; - bool cap = false; - - switch (catItem->odtype()) { - case AudioOutputDeviceType: - aoPreferredList = m_audioOutputModel.value(catItem->category())->modelData(); - categoryList = audioOutCategories; - categoryListCount = audioOutCategoriesCount; - cap = false; - break; - - case AudioCaptureDeviceType: - acPreferredList = m_audioCaptureModel.value(catItem->captureCategory())->modelData(); - capCategoryList = audioCapCategories; - categoryListCount = audioCapCategoriesCount; - cap = true; - break; - - case VideoCaptureDeviceType: - vcPreferredList = m_videoCaptureModel.value(catItem->captureCategory())->modelData(); - capCategoryList = videoCapCategories; - categoryListCount = videoCapCategoriesCount; - cap = true; - break; - - default: - return; - } - - QPointer dialog = new QDialog(this); - - QLabel *label = new QLabel(dialog); - label->setText(i18n("Apply the currently shown device preference list to the following other " - "audio playback categories:")); - label->setWordWrap(true); - - QListWidget *list = new QListWidget(dialog); - - for (catIndex = 0; catIndex < categoryListCount; catIndex ++) { - Category cat = cap ? NoCategory : categoryList[catIndex]; - CaptureCategory capcat = cap ? capCategoryList[catIndex] : NoCaptureCategory; - - QListWidgetItem *item = nullptr; - if (cap) { - if (capcat == NoCaptureCategory) { - item = new QListWidgetItem(i18n("Default/Unspecified Category"), list, capcat); - } else { - item = new QListWidgetItem(categoryToString(capcat), list, capcat); - } - } else { - if (cat == NoCategory) { - item = new QListWidgetItem(i18n("Default/Unspecified Category"), list, cat); - } else { - item = new QListWidgetItem(categoryToString(cat), list, cat); - } - } - - item->setCheckState(Qt::Checked); - if (cat == catItem->category()) { - item->setFlags(item->flags() & ~Qt::ItemIsEnabled); - } - } - - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok - | QDialogButtonBox::Cancel, dialog); - connect(buttonBox, &QDialogButtonBox::accepted, dialog.data(), &QDialog::accept); - connect(buttonBox, &QDialogButtonBox::rejected, dialog.data(), &QDialog::reject); - - QVBoxLayout *layout = new QVBoxLayout(dialog); - layout->addWidget(label); - layout->addWidget(list); - layout->addWidget(buttonBox); - - switch (dialog->exec()) { - case QDialog::Accepted: - for (catIndex = 0; catIndex < categoryListCount; catIndex ++) { - Category cat = cap ? NoCategory : categoryList[catIndex]; - CaptureCategory capcat = cap ? capCategoryList[catIndex] : NoCaptureCategory; - - if (cap ? capcat != catItem->captureCategory() : cat != catItem->category()) { - QListWidgetItem *item = list->item(catIndex); - Q_ASSERT(item->type() == cap ? (int) capcat : (int) cat); - if (item->checkState() == Qt::Checked) { - switch (catItem->odtype()) { - case AudioOutputDeviceType: - m_audioOutputModel.value(cat)->setModelData(aoPreferredList); - break; - - case AudioCaptureDeviceType: - m_audioCaptureModel.value(capcat)->setModelData(acPreferredList); - break; - - case VideoCaptureDeviceType: - m_videoCaptureModel.value(capcat)->setModelData(vcPreferredList); - break; - - default: ; - } - } - } - } - - emit changed(); - break; - - case QDialog::Rejected: - // nothing to do - break; - } - - delete dialog; -} - -void DevicePreference::on_showAdvancedDevicesCheckBox_toggled() -{ - // In order to get the right list from the backend, we need to update the settings now - // before calling availableAudio{Output,Capture}Devices() - GlobalConfig().setHideAdvancedDevices(!showAdvancedDevicesCheckBox->isChecked()); - loadCategoryDevices(); -} - -void DevicePreference::on_testPlaybackButton_toggled(bool down) -{ - if (down) { - QModelIndex idx = deviceList->currentIndex(); - if (!idx.isValid()) { - return; - } - - // Shouldn't happen, but better to be on the safe side - if (m_testingType != dtInvalidDevice) { - delete m_media; - m_media = nullptr; - delete m_audioOutput; - m_audioOutput = nullptr; - delete m_videoWidget; - m_videoWidget = nullptr; - } - - // Setup the Phonon objects according to the testing type - m_testingType = shownModelType(); - switch (m_testingType) { - case dtAudioOutput: { - // Create an audio output with the selected device - m_media = new MediaObject(this); - const AudioOutputDeviceModel *model = static_cast(idx.model()); - const AudioOutputDevice &device = model->modelData(idx); - m_audioOutput = new AudioOutput(this); - if (!m_audioOutput->setOutputDevice(device)) { - KMessageBox::error(this, i18n("Failed to set the selected audio output device")); - break; - } - - // Just to be very sure that nothing messes our test sound up - m_audioOutput->setVolume(1.0); - m_audioOutput->setMuted(false); - - createPath(m_media, m_audioOutput); - static QUrl testUrl = QUrl::fromLocalFile(QStandardPaths::locate( - QStandardPaths::GenericDataLocation, - QStringLiteral("sounds/Oxygen-Sys-Log-In.ogg"))); - m_media->setCurrentSource(testUrl); - connect(m_media, &MediaObject::finished, testPlaybackButton, &QToolButton::toggle); - - break; - } - -#ifndef PHONON_NO_AUDIOCAPTURE - case dtAudioCapture: { - // Create a media object and an audio output - m_media = new MediaObject(this); - m_audioOutput = new AudioOutput(NoCategory, this); - - // Just to be very sure that nothing messes our test sound up - m_audioOutput->setVolume(1.0); - m_audioOutput->setMuted(false); - - // Try to create a path - if (!createPath(m_media, m_audioOutput).isValid()) { - KMessageBox::error(this, i18n("Your backend may not support audio recording")); - break; - } - - // Determine the selected device - const AudioCaptureDeviceModel *model = static_cast(idx.model()); - const AudioCaptureDevice &device = model->modelData(idx); - m_media->setCurrentSource(device); - - break; - } -#endif - -#ifndef PHONON_NO_VIDEOCAPTURE - case dtVideoCapture: { - // Create a media object and a video output - m_media = new MediaObject(this); - m_videoWidget = new VideoWidget(nullptr); - - // Try to create a path - if (!createPath(m_media, m_videoWidget).isValid()) { - KMessageBox::error(this, i18n("Your backend may not support video recording")); - break; - } - - // Determine the selected device - const VideoCaptureDeviceModel *model = static_cast(idx.model()); - const VideoCaptureDevice &device = model->modelData(idx); - m_media->setCurrentSource(device); - - // Set up the testing video widget - m_videoWidget->setWindowTitle(i18n("Testing %1", device.name())); - m_videoWidget->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint); - if (device.property("icon").canConvert(QVariant::String)) - m_videoWidget->setWindowIcon(QIcon::fromTheme(device.property("icon").toString())); - m_videoWidget->move(QCursor::pos() - QPoint(250, 295)); - m_videoWidget->resize(320, 240); - m_videoWidget->show(); - - break; - } -#endif - - default: - return; - } - - m_media->play(); - } else { - // Uninitialize the Phonon objects according to the testing type - switch (m_testingType) { - case dtAudioOutput: - disconnect(m_media, &MediaObject::finished, testPlaybackButton, &QToolButton::toggle); - delete m_media; - delete m_audioOutput; - break; - - case dtAudioCapture: - delete m_media; - delete m_audioOutput; - break; - - case dtVideoCapture: - delete m_media; - delete m_videoWidget; - break; - - default: - return; - } - - m_media = nullptr; - m_videoWidget = nullptr; - m_audioOutput = nullptr; - m_testingType = dtInvalidDevice; - } -} - -void DevicePreference::updateButtonsEnabled() -{ - if (deviceList->model()) { - QModelIndex idx = deviceList->currentIndex(); - preferButton->setEnabled(idx.isValid() && idx.row() > 0); - deferButton->setEnabled(idx.isValid() && idx.row() < deviceList->model()->rowCount() - 1); - testPlaybackButton->setEnabled(idx.isValid() && (idx.flags() & Qt::ItemIsEnabled)); - } else { - preferButton->setEnabled(false); - deferButton->setEnabled(false); - testPlaybackButton->setEnabled(false); - } -} - -} // Phonon namespace - -#include "moc_devicepreference.cpp" diff --git a/kcms/phonon/devicepreference.ui b/kcms/phonon/devicepreference.ui deleted file mode 100644 --- a/kcms/phonon/devicepreference.ui +++ /dev/null @@ -1,219 +0,0 @@ - - - Matthias Kretz <kretz@kde.org> - DevicePreference - - - - 0 - 0 - 600 - 400 - - - - - - - - - - 0 - 0 - - - - Qt::CustomContextMenu - - - Various categories of media use cases. For each category, you may choose what device you prefer to be used by the Phonon applications. - - - Various categories of media use cases. For each category, you may choose what device you prefer to be used by the Phonon applications. - - - false - - - - - - - 0 - - - - - Show advanced devices - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 0 - 20 - - - - - - - - - - 0 - - - - - Use the currently shown device list for more categories. - - - Use the currently shown device list for more categories. - - - Apply Device List To... - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 0 - 20 - - - - - - - - - - - - true - - - Devices found on your system, suitable for the selected category. Choose the device that you wish to be used by the applications. - - - The order determines the preference of the devices. If for some reason the first device cannot be used Phonon will try to use the second, and so on. - - - Qt::ScrollBarAsNeeded - - - true - - - QAbstractItemView::InternalMove - - - QAbstractItemView::SelectRows - - - - 32 - 32 - - - - Qt::ElideNone - - - QAbstractItemView::ScrollPerPixel - - - QAbstractItemView::ScrollPerPixel - - - false - - - false - - - - - - - - - Qt::Horizontal - - - - 16 - 29 - - - - - - - - Test - - - true - - - Qt::ToolButtonTextBesideIcon - - - - - - - false - - - prefer the selected device - - - Prefer - - - Qt::ToolButtonTextBesideIcon - - - - - - - false - - - no preference for the selected device - - - Defer - - - Qt::ToolButtonTextBesideIcon - - - - - - - - - - diff --git a/kcms/phonon/kcm_phonon.desktop b/kcms/phonon/kcm_phonon.desktop deleted file mode 100644 --- a/kcms/phonon/kcm_phonon.desktop +++ /dev/null @@ -1,160 +0,0 @@ -[Desktop Entry] -Exec=kcmshell5 kcm_phonon -Icon=preferences-desktop-sound -Type=Service -X-KDE-ServiceTypes=KCModule - -X-KDE-Library=kcm_phonon -X-KDE-FactoryName=kcm_phonon -X-KDE-ParentApp=kcontrol -X-KDE-System-Settings-Parent-Category=audio-and-video -X-DocPath=kcontrol/phonon/index.html - -Name=Audio and Video -Name[ar]=الصّوت والفيديو -Name[bs]=Audio i video -Name[ca]=Àudio i vídeo -Name[ca@valencia]=Àudio i vídeo -Name[cs]=Audio a video -Name[da]=Lyd og video -Name[de]=Audio und Video -Name[el]=Ήχος και βίντεο -Name[en_GB]=Audio and Video -Name[es]=Audio y vídeo -Name[et]=Heli ja video -Name[eu]=Audioa eta bideoa -Name[fi]=Ääni ja video -Name[fr]=Audio et vidéo -Name[gl]=Son e vídeo -Name[he]=שמע ווידאו -Name[hu]=Hang és videó -Name[id]=Audio dan Video -Name[is]=Hljóð og mynd -Name[it]=Audio e video -Name[ja]=オーディオとビデオ -Name[ko]=오디오 및 비디오 -Name[lt]=Garsas ir vaizdas -Name[mr]=ऑडिओ व व्हिडिओ -Name[nb]=Lyd og video -Name[nds]=Video un Klang -Name[nl]=Audio en video -Name[nn]=Lyd og video -Name[pa]=ਆਡੀਓ ਅਤੇ ਵੀਡੀਓ -Name[pl]=Dźwięk i obraz -Name[pt]=Áudio e Vídeo -Name[pt_BR]=Áudio e vídeo -Name[ru]=Звук и видео -Name[sk]=Zvuk a video -Name[sl]=Zvok in video -Name[sr]=Аудио и видео -Name[sr@ijekavian]=Аудио и видео -Name[sr@ijekavianlatin]=Audio i video -Name[sr@latin]=Audio i video -Name[sv]=Ljud- och video -Name[tr]=Ses ve Video -Name[uk]=Звук та відео -Name[x-test]=xxAudio and Videoxx -Name[zh_CN]=音频和视频 -Name[zh_TW]=音效和視訊 -Comment=Phonon Audio and Video -Comment[ar]=صوت وفيديو فنون -Comment[bs]=Audio i Video fonona -Comment[ca]=Àudio i vídeo del Phonon -Comment[ca@valencia]=Àudio i vídeo del Phonon -Comment[cs]=Audio a video - Phonon -Comment[da]=Phonon lyd og video -Comment[de]=Phonon - Audio und Video -Comment[el]=Ήχος και βίντεο Phonon -Comment[en_GB]=Phonon Audio and Video -Comment[es]=Audio y vídeo de Phonon -Comment[et]=Phononi heli ja video -Comment[eu]=Phonon audioa eta bideoa -Comment[fi]=Phononin ääni ja video -Comment[fr]=Audio et vidéo de Phonon -Comment[gl]=Son e vídeo de Phonon -Comment[he]=שמע ווידאו של Phonon -Comment[hu]=Phonon hang és videó -Comment[id]=Phonon Audio dan Video -Comment[is]=Phonon hljóð og mynd -Comment[it]=Audio e video di Phonon -Comment[ja]=Phonon オーディオとビデオ -Comment[ko]=Phonon 오디오 및 비디오 -Comment[lt]=Phonon audio ir video -Comment[mr]=फोनोन ऑडिओ व व्हिडिओ -Comment[nb]=Phonon lyd og video -Comment[nds]=Phonon-Instellen för Video un Klang -Comment[nl]=Phonon audio en video -Comment[nn]=Phonon lyd og video -Comment[pa]=ਫੋਨੋਨ ਆਡੀਓ ਅਤੇ ਵੀਡੀਓ -Comment[pl]=Phonon - dźwięk i obraz -Comment[pt]=Áudio e Vídeo do Phonon -Comment[pt_BR]=Áudio e vídeo do Phonon -Comment[ru]=Настройка мультимедийной платформы Phonon -Comment[sk]=Zvuk a video Phonon -Comment[sl]=Phonon: zvok in video -Comment[sr]=Аудио и видео са Фононом -Comment[sr@ijekavian]=Аудио и видео са Фононом -Comment[sr@ijekavianlatin]=Audio i video sa Phononom -Comment[sr@latin]=Audio i video sa Phononom -Comment[sv]=Phonon ljud- och video -Comment[tr]=Phonon Ses ve Görüntü -Comment[uk]=Звук та відео Phonon -Comment[x-test]=xxPhonon Audio and Videoxx -Comment[zh_CN]=Phonon 音频和视频 -Comment[zh_TW]=Phonon 音效和視訊 -X-KDE-Keywords=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine -X-KDE-Keywords[bg]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,Звук,Видео,Изход,Устройство,Уведомление,Музика,Общуване,Медия -X-KDE-Keywords[bn]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine -X-KDE-Keywords[bs]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,zvuk,izlaz,uređaj,informacija,muzika,komunikacija,mediji -X-KDE-Keywords[ca]=So,Phonon,Àudio,Vídeo,Sortida,Dispositiu,Notificació,Música,Comunicació,Suport,NMM,GStreamer,Xine -X-KDE-Keywords[ca@valencia]=So,Phonon,Àudio,Vídeo,Eixida,Dispositiu,Notificació,Música,Comunicació,Suport,NMM,GStreamer,Xine -X-KDE-Keywords[cs]=Zvuk,Phonon,Audio,Video,Výstup,Zařízení,Upozornění,Hudba,Komunikace,Média,NMM,GStreamer,Xine -X-KDE-Keywords[da]=Lyd,Phonon,Audio,Video,Output,Enhed,Bekendtgørelse,Musik,Kommunikation,Medie,NMM,GStreamer,Xine,VLC -X-KDE-Keywords[de]=Klänge,Sound,Phonon,Audio,Video,Ausgabe,Gerät,Benachrichtigung,Notification,Musik,Kommunikation,Media,NMM,GStreamer,Xine -X-KDE-Keywords[el]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine -X-KDE-Keywords[en_GB]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine -X-KDE-Keywords[eo]=Sono,Phonon,Sono,Video,Eligo,Aparato,Atentigo,Muziko,Komunikado,Aŭdvido,NMM,GStreamer,Xine -X-KDE-Keywords[es]=Sonido,Phonom,Audio,Video,Salida,Dispositivo,Notificación,Música,Comunicación,Media,NMM,GStreamer,Xine -X-KDE-Keywords[et]=heli,Phonon,audio,video,väljund,seade,märguanne,muusika,suhtlemine,meedia,NMM,GStreamer,Xine -X-KDE-Keywords[eu]=Soinua,Phonon,Audioa,Bideoa,Irteera,Gailua,Jakinarazpena,Musika,Komunikazioa,Media,NMM,GStreamer,Xine -X-KDE-Keywords[fi]=Ääni,Phonon,Audio,Video,Ulostulo,Lähtö,Tuloste,Laite,Huomautukset,Huomautus,Ilmoitukset,Ilmoitus,Musiikki,Viestintä,Media,NMM,GStreamer,Xine -X-KDE-Keywords[fr]=son, phonon, audio, vidéo, sortie, périphérique, notification, musique, communication, média, NMM, GStreamer, Xine -X-KDE-Keywords[ga]=Fuaim,Phonon,Fís,Aschur,Gléas,Fógairt,Fógra,Ceol,Cumarsáid,Meán,Meáin,NMM,GStreamer,Xine -X-KDE-Keywords[gl]=Son,Phonon,Audio,Vídeo,Saída,Dispositivo,Notificación,Música,Comunicación,Medio,NMM,GStreamer,Xine -X-KDE-Keywords[hi]=ध्वनि, फ़ोनॉन, श्रव्य, वीडियो, आउटपुट, डिवाइस, अधिसूचना, संगीत, संचार,मीडिया, NMM, GStreamer, Xine -X-KDE-Keywords[hu]=Hang,Phonon,Hang,Videó,Kimenet,Eszköz,Értesítés,Zene,Kommunikáció,Média,NMM,GStreamer,Xine -X-KDE-Keywords[ia]=Sono,Phonon,Audio,Video,Exito,Dispositivo,Notification,Musica,Communication,Medios,NMM,GStreamer,Xine -X-KDE-Keywords[id]=Suara,Phonon,Audio,Video,Output,Perangkat,Notifikasi,Musik,Komunikasi,Media,NMM,GStreamer,Xine -X-KDE-Keywords[is]=Hljóð,Phonon,Audio,Vídeó,Úttak,Tæki,Tilkynningar,Tónlist,Samskipti,Miðlar,NMM,GStreamer,Xine -X-KDE-Keywords[it]=suono,Phonon,audio,video,output,dispositivo,notifica,musica,comunicazione,media,NMM,GStreamer,Xine -X-KDE-Keywords[kk]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine -X-KDE-Keywords[km]=សំឡេង Phonon អូឌីយ៉ូ វីដេអូ លទ្ធផល ឧបករណ៍ ការ​ជូនដំណឹង តន្ត្រី ការ​ទាក់ទង មេឌៀ NMM GStreamer Xine -X-KDE-Keywords[ko]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,소리,사운드,오디오,비디오,동영상,음악,출력,장치,알림,대화,미디어 -X-KDE-Keywords[lv]=skaņa,phonon,audio,video,izvade,ierīce,paziņojums,mūzika,saziņa,mēdiji,NMM,GStreamer,Xine -X-KDE-Keywords[mr]=Sound,फोनॉन,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine -X-KDE-Keywords[nb]=Lyd,Phonon,Audio,Video,Utgang,Enhet,Varsling,Musikk,Kommunikasjon,Media,NMM,GStreamer,Xine -X-KDE-Keywords[nds]=Klang,Phonon,Audio,Video,Utgaav,Reedschap,Bescheed,Musik,Kommunikatschoon,Mediendatei,NMM,GStreamer,Xine -X-KDE-Keywords[nl]=Geluid,Phonon,audio,video,uitvoer,apparaat,melding,muziek,communicatie,medium,NMM,GStreamer,Xine -X-KDE-Keywords[nn]=lyd,Phonon,audio,lyd,video,film,utdata,utgang,eining,varsling,musikk,kommunikasjon,media,NMM,GStreamer,Xine -X-KDE-Keywords[pa]=ਸਾਊਂਡ,ਫੋਨੋਨ,ਆਡੀਓ,ਵਿਡੀਓ,ਵੀਡਿਓ,ਆਉਟਪੁੱਟ,ਜੰਤਰ,ਨੋਟੀਫਿਕੇਸ਼ਨ,ਸੂਚਨਾ,ਸੰਗੀਤ,ਮਿਊਜ਼ਕ,ਕਮਿਊਨੀਕੇਸ਼ਨ,ਸੰਚਾਰ, ਮੀਡਿਆ,NMM,ਜੀਸਟਰੀਮਰ,ਜ਼ਾਇਨ -X-KDE-Keywords[pl]=Dźwięk,Phonon,Audio,Video,Wyjście,Urządzenie,Powiadomienia,Muzyka,Komunikacja,Multimedia,NMM,GStreamer,Xine -X-KDE-Keywords[pt]=Som,Phonon,Áudio,Vídeo,Saída,Dispositivo,Notificação,Música,Comunicações,Multimédia,NMM,GStreamer,Xine -X-KDE-Keywords[pt_BR]=Som,Phonon,Áudio,Vídeo,Saída,Dispositivo,Notificação,Música,Comunicações,Multimídia,NMM,GStreamer,Xine -X-KDE-Keywords[ro]=sunet,phonon,audio,video,ieșire,dispozitiv,notificare,muzică,comunicare,media,NMM,GStreamer,Xine -X-KDE-Keywords[ru]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,звук,аудио,видео,вывод,устройство,уведомления,музыка,связь,общение,медиа -X-KDE-Keywords[sk]=Zvuk,Phonon,Audio,Video,Output,Zariadenie,Notifikácia,Hudba,Komunikácia,Mádia,NMM,GStreamer,Xine -X-KDE-Keywords[sl]=zvok,phonon,audio,video,predvajanje,naprava,naprave,obvestila,glasba,komunikacija,igre,snemanje,predstavnost,nmm,gstreamer,xine,vlc -X-KDE-Keywords[sr]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,звук,Фонон,аудио,видео,излаз,уређај,обавештење,музика,комуникација,медија,НММ,Гстример,Ксин -X-KDE-Keywords[sr@ijekavian]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,звук,Фонон,аудио,видео,излаз,уређај,обавештење,музика,комуникација,медија,НММ,Гстример,Ксин -X-KDE-Keywords[sr@ijekavianlatin]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,zvuk,Phonon,audio,video,izlaz,uređaj,obaveštenje,muzika,komunikacija,medija,NMM,GStreamer,Xine -X-KDE-Keywords[sr@latin]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,zvuk,Phonon,audio,video,izlaz,uređaj,obaveštenje,muzika,komunikacija,medija,NMM,GStreamer,Xine -X-KDE-Keywords[sv]=Ljud,Phonon,Video,Utgång,Enhet,Underrättelse,Musik,Kommunikation,Media,NMM,GStreamer,Xine -X-KDE-Keywords[tg]=Овоз,Phonon,Аудио,Видео,Барориш,Дастгоҳ,Огоҳӣ,Мусиқӣ,Паёмнависӣ,Медиа,NMM,GStreamer,Xine -X-KDE-Keywords[tr]=Ses,Phonon,Ses,Video,Çıkış,Aygıt,Bildirim,Müzik,İletişim,Ortam,NMM,GStreamer,Xine -X-KDE-Keywords[ug]=ئاۋاز،Phonon،ئۈن،سىن،چىقىرىش،ئۈسكۈنە،ئۇقتۇرۇش،مۇزىكا،ئالاقە،ۋاسىتە،NMM،GStreamer،Xine -X-KDE-Keywords[uk]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,звук,фонон,аудіо,відео,виведення,показ,відтворення,пристрій,сповіщення,музика,спілкування,мультимедіа -X-KDE-Keywords[vi]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,âm thanh,phim ảnh,thiết bị,thông báo,nhạc,giao tiếp, phương tiện -X-KDE-Keywords[wa]=Son,Phonon,Odio,Videyo,rexhowe,éndjin,notifiaedje,muzike,comunicåcion,media,NMM,GStreamer,Xine -X-KDE-Keywords[x-test]=xxSoundxx,xxPhononxx,xxAudioxx,xxVideoxx,xxOutputxx,xxDevicexx,xxNotificationxx,xxMusicxx,xxCommunicationxx,xxMediaxx,xxNMMxx,xxGStreamerxx,xxXinexx -X-KDE-Keywords[zh_CN]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine,声音,音效,视频,输出,设备,提醒,音乐,通信,媒体 -X-KDE-Keywords[zh_TW]=Sound,Phonon,Audio,Video,Output,Device,Notification,Music,Communication,Media,NMM,GStreamer,Xine diff --git a/kcms/phonon/listview-background.png b/kcms/phonon/listview-background.png deleted file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) version 3. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef MAIN_H -#define MAIN_H - -#include - -namespace Phonon { -class DevicePreference; -} -class BackendSelection; - -class QTabWidget; - -class PhononKcm : public KCModule -{ - Q_OBJECT -public: - PhononKcm(QWidget *parent, const QVariantList &); - - void load() override; - void save() override; - void defaults() override; - -private: - QTabWidget* m_tabs; - Phonon::DevicePreference *m_devicePreferenceWidget; - BackendSelection *m_backendSelection; -}; - -#endif // MAIN_H diff --git a/kcms/phonon/main.cpp b/kcms/phonon/main.cpp deleted file mode 100644 --- a/kcms/phonon/main.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006-2007 Matthias Kretz - Copyright (C) 2010 Colin Guthrie - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) version 3. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "main.h" - -#include - -#include -#include -#include - -#include "backendselection.h" -#include "devicepreference.h" - -#include "config-workspace.h" - -K_PLUGIN_FACTORY(PhononKcmFactory, registerPlugin();) - -PhononKcm::PhononKcm(QWidget *parent, const QVariantList &args) - : KCModule(parent, args) -{ - KAboutData *about = new KAboutData( - "kcm_phonon", i18n("Phonon Configuration Module"), - WORKSPACE_VERSION_STRING, QString(), KAboutLicense::GPL, - i18n("Copyright 2006 Matthias Kretz")); - about->addAuthor(i18n("Matthias Kretz"), QString(), "kretz@kde.org"); - about->addAuthor(i18n("Colin Guthrie"), QString(), "colin@mageia.org"); - setAboutData(about); - - setLayout(new QHBoxLayout); - layout()->setContentsMargins(0, 0, 0, 0); - layout()->setSpacing(0); - - m_tabs = new QTabWidget(this); - layout()->addWidget(m_tabs); - - m_devicePreferenceWidget = new Phonon::DevicePreference(this); - m_tabs->addTab(m_devicePreferenceWidget, i18n("Device Preference")); - m_backendSelection = new BackendSelection(this); - m_tabs->addTab(m_backendSelection, i18n("Backend")); - - load(); - connect(m_backendSelection, SIGNAL(changed()), SLOT(changed())); - connect(m_devicePreferenceWidget, SIGNAL(changed()), SLOT(changed())); - - setButtons( KCModule::Default|KCModule::Apply|KCModule::Help ); -} - -void PhononKcm::load() -{ - m_devicePreferenceWidget->load(); - m_backendSelection->load(); -} - -void PhononKcm::save() -{ - m_devicePreferenceWidget->save(); - m_backendSelection->save(); -} - -void PhononKcm::defaults() -{ - m_devicePreferenceWidget->defaults(); - m_backendSelection->defaults(); -} - -#include "main.moc" diff --git a/plasma-desktop.categories b/plasma-desktop.categories deleted file mode 100644 --- a/plasma-desktop.categories +++ /dev/null @@ -1 +0,0 @@ -org.kde.kcm.phonon kcm module phonon IDENTIFIER [KCM_PHONON_LOG]