aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Ui/qsui/qsuitabwidget.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-05-07 20:22:42 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-05-07 20:22:42 +0000
commit05c99c2e3fdf670827bb3a15c750bc9ea0b02e04 (patch)
tree1acbffb522b95a6a40c5e67734cc6887fb76da81 /src/plugins/Ui/qsui/qsuitabwidget.cpp
parentd510cd1cc8f4ace93ae4e62cc9b8b913c9aab133 (diff)
downloadqmmp-05c99c2e3fdf670827bb3a15c750bc9ea0b02e04.tar.gz
qmmp-05c99c2e3fdf670827bb3a15c750bc9ea0b02e04.tar.bz2
qmmp-05c99c2e3fdf670827bb3a15c750bc9ea0b02e04.zip
enabled hotkey plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7949 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/qsui/qsuitabwidget.cpp')
0 files changed, 0 insertions, 0 deletions
f='#n120'>120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
/***************************************************************************
 *   Copyright (C) 2010-2013 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   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) any later version.                                   *
 *                                                                         *
 *   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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/

#include <QSettings>
#include <QDir>
#include <qmmp/inputsourcefactory.h>
#include <qmmp/inputsource.h>
#include <qmmp/decoderfactory.h>
#include <qmmp/outputfactory.h>
#include <qmmp/visualfactory.h>
#include <qmmp/effectfactory.h>
#include <qmmp/effect.h>
#include <qmmp/soundcore.h>
#include <qmmp/enginefactory.h>
#include <qmmp/abstractengine.h>
#include <qmmpui/generalfactory.h>
#include <qmmpui/general.h>
#include <qmmpui/uihelper.h>
#include <qmmpui/filedialogfactory.h>
#include <qmmpui/filedialog.h>
#include <qmmpui/uiloader.h>
#include "radioitemdelegate_p.h"
#include "pluginitem_p.h"

PluginItem::PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), TRANSPORT)
{
    setCheckState(0, InputSource::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
}


PluginItem::PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), DECODER)
{
    setCheckState(0, Decoder::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
}

PluginItem::PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), ENGINE)
{
    setCheckState(0, AbstractEngine::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
}

PluginItem::PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), EFFECT)
{
    setCheckState(0, Effect::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
}

PluginItem::PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), VISUAL)
{
    setCheckState(0, Visual::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
}

PluginItem::PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), GENERAL)
{
    setCheckState(0, General::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
}

PluginItem::PluginItem(QTreeWidgetItem *parent, OutputFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), OUTPUT)
{
    setCheckState(0, (Output::currentFactory() == factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = factory->properties().hasSettings;
    m_factory = factory;
    setData(0, RadioButtonRole, true);
}

PluginItem::PluginItem(QTreeWidgetItem *parent, FileDialogFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), FILE_DIALOG)
{
    setCheckState(0, FileDialog::isEnabled(factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = false;
    m_factory = factory;
    setData(0, RadioButtonRole, true);
}

PluginItem::PluginItem(QTreeWidgetItem *parent, UiFactory *factory, const QString &path)
    : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), USER_INTERFACE)
{
    setCheckState(0, (UiLoader::selected() == factory) ? Qt::Checked : Qt::Unchecked);
    m_has_about = factory->properties().hasAbout;
    m_has_config = false;
    m_factory = factory;
    setData(0, RadioButtonRole, true);
}

PluginItem::~PluginItem()
{}

bool PluginItem::hasAbout() const
{
    return m_has_about;
}
bool PluginItem::hasSettings() const
{
    return m_has_config;
}

void PluginItem::showAbout(QWidget *parent)
{
    switch(type())
    {
    case PluginItem::TRANSPORT:
        static_cast<InputSourceFactory *>(m_factory)->showAbout(parent);
        break;
    case PluginItem::DECODER:
        static_cast<DecoderFactory *>(m_factory)->showAbout(parent);
        break;
    case PluginItem::ENGINE:
        static_cast<EngineFactory *>(m_factory)->showAbout(parent);