Commit 90890244 authored by Sandro Andrade's avatar Sandro Andrade

Revert the use of plugin-based config pages

parent b9d3d5e0
......@@ -32,7 +32,6 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
Widgets
Quick
# Gui
)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
......@@ -44,7 +43,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
WidgetsAddons
KIO
Crash
TextEditor
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......
......@@ -22,17 +22,12 @@
#include "mainwindow.h"
#include <interfaces/icore.h>
#include <interfaces/iplugin.h>
#include <interfaces/iplugincontroller.h>
#include "core.h"
#include "minuet_version.h"
#include <KMessageBox>
#include <KConfigDialog>
#include <KActionCollection>
#include <KTextEditor/ConfigPage>
#include <QTimer>
#include <QPointer>
......@@ -88,13 +83,7 @@ void MainWindow::settingsConfigure()
m_settingsMidi.setupUi(midiSettingsDialog);
m_settingsMidi.kcfg_midiOutputPort->setVisible(false);
m_settingsMidi.cboMidiOutputPort->setCurrentIndex(m_settingsMidi.cboMidiOutputPort->findText(MinuetSettings::midiOutputPort()));
dialog->addPage(midiSettingsDialog, i18n("General"), QStringLiteral("go-home"));
foreach (Minuet::IPlugin *plugin, Minuet::ICore::self()->pluginController()->loadedPlugins().values())
foreach (KTextEditor::ConfigPage *configPage, plugin->configPages()) {
KPageWidgetItem *item = dialog->addPage(configPage, configPage->name());
item->setIcon(configPage->icon());
}
dialog->addPage(midiSettingsDialog, i18n("MIDI"), QStringLiteral("media-playback-start"));
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->exec();
......
......@@ -75,10 +75,5 @@ bool PluginController::initialize(Core *core)
return true;
}
IPluginController::InfoToPluginMap PluginController::loadedPlugins() const
{
return m_loadedPlugins;
}
}
......@@ -25,10 +25,13 @@
#include <interfaces/iplugincontroller.h>
#include <KPluginMetaData>
namespace Minuet
{
class Core;
class IPlugin;
class PluginController : public IPluginController
{
......@@ -40,11 +43,10 @@ public:
bool initialize(Core *core);
virtual InfoToPluginMap loadedPlugins() const;
private:
QVector<KPluginMetaData> m_plugins;
typedef QHash<KPluginMetaData, IPlugin *> InfoToPluginMap;
InfoToPluginMap m_loadedPlugins;
};
......
......@@ -17,7 +17,6 @@ generate_export_header(minuetinterfaces EXPORT_FILE_NAME minuetinterfacesexport.
target_link_libraries(minuetinterfaces
Qt5::Core
Qt5::Quick
KF5::TextEditor
)
install(TARGETS
......
......@@ -34,11 +34,6 @@ IPlugin::~IPlugin()
{
}
QList<KTextEditor::ConfigPage *> IPlugin::configPages() const
{
return m_configPages;
}
}
#include "moc_iplugin.cpp"
......@@ -27,10 +27,6 @@
#include <QObject>
namespace KTextEditor {
class ConfigPage;
}
namespace Minuet {
class MINUETINTERFACES_EXPORT IPlugin : public QObject
......@@ -40,12 +36,8 @@ class MINUETINTERFACES_EXPORT IPlugin : public QObject
public:
~IPlugin() override;
virtual QList<KTextEditor::ConfigPage *> configPages() const;
protected:
explicit IPlugin(QObject *parent = 0);
QList<KTextEditor::ConfigPage *> m_configPages;
};
}
......
......@@ -25,15 +25,11 @@
#include "minuetinterfacesexport.h"
#include <KPluginMetaData>
#include <QObject>
namespace Minuet
{
class IPlugin;
class MINUETINTERFACES_EXPORT IPluginController : public QObject
{
Q_OBJECT
......@@ -41,9 +37,6 @@ class MINUETINTERFACES_EXPORT IPluginController : public QObject
public:
~IPluginController() override;
typedef QHash<KPluginMetaData, IPlugin *> InfoToPluginMap;
virtual InfoToPluginMap loadedPlugins() const = 0;
protected:
explicit IPluginController(QObject *parent = 0);
};
......
set(fluidsynthsoundbackend_PLUGIN_SRCS
fluidsynthsoundbackend.cpp
fluidsynthconfigpage.cpp
)
ki18n_wrap_ui(fluidsynthsoundbackend_PLUGIN_SRCS
fluidsynthsettings.ui
)
add_library(minuetfluidsynthsoundbackend MODULE ${fluidsynthsoundbackend_PLUGIN_SRCS})
target_link_libraries(minuetfluidsynthsoundbackend
Qt5::Core
KF5::TextEditor
Minuet::Interfaces
fluidsynth
)
......
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#include "fluidsynthconfigpage.h"
FluidSynthConfigPage::FluidSynthConfigPage(QWidget *parent)
: KTextEditor::ConfigPage(parent)
{
m_settings.setupUi(parent);
}
QIcon FluidSynthConfigPage::icon() const
{
return QIcon::fromTheme(QStringLiteral("media-playback-start"));
}
QString FluidSynthConfigPage::name() const
{
return QStringLiteral("FluidSynth");
}
void FluidSynthConfigPage::apply()
{
}
void FluidSynthConfigPage::defaults()
{
}
void FluidSynthConfigPage::reset()
{
}
#include "moc_fluidsynthconfigpage.cpp"
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef MINUET_FLUIDSYNTHCONFIGPAGE_H
#define MINUET_FLUIDSYNTHCONFIGPAGE_H
#include <KTextEditor/ConfigPage>
#include "ui_fluidsynthsettings.h"
class FluidSynthConfigPage : public KTextEditor::ConfigPage
{
Q_OBJECT
public:
explicit FluidSynthConfigPage(QWidget *parent = 0);
virtual QIcon icon() const override;
virtual QString name() const override;
public Q_SLOTS:
virtual void apply() override;
virtual void defaults() override;
virtual void reset() override;
private:
Ui::FluidSynthSettings m_settings;
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FluidSynthSettings</class>
<widget class="QWidget" name="FluidSynthSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>374</width>
<height>200</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="timidityLabel">
<property name="text">
<string>TiMidity++ location:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_timidityLocation"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="timidityParametersLabel">
<property name="text">
<string>TiMidity++ parameters:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KLineEdit" name="kcfg_timidityParameters"/>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>109</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="midiOutputPortLabel">
<property name="text">
<string>MIDI output port:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cboMidiOutputPort"/>
</item>
<item row="3" column="1">
<widget class="KLineEdit" name="kcfg_midiOutputPort"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local">kcolorbutton.h</include>
</includes>
<resources/>
<connections>
<connection>
<sender>cboMidiOutputPort</sender>
<signal>currentTextChanged(QString)</signal>
<receiver>kcfg_midiOutputPort</receiver>
<slot>setText(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>175</x>
<y>96</y>
</hint>
<hint type="destinationlabel">
<x>183</x>
<y>143</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -29,8 +29,6 @@
#include <functional>
#include "fluidsynthconfigpage.h"
unsigned int FluidSynthSoundBackend::m_initialTime = 0;
FluidSynthSoundBackend::FluidSynthSoundBackend(QObject *parent)
......@@ -41,8 +39,6 @@ FluidSynthSoundBackend::FluidSynthSoundBackend(QObject *parent)
{
m_tempo = 120;
m_configPages << new FluidSynthConfigPage(new QWidget);
m_settings = new_fluid_settings();
fluid_settings_setstr(m_settings, "synth.reverb.active", "no");
fluid_settings_setstr(m_settings, "synth.chorus.active", "no");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment