1
/***************************************************************************
2
* Copyright (C) 2010 by Kai Dombrowe <just89@gmx.de> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18
***************************************************************************/
22
#include "videopage.h"
25
#include <joschycore/manager.h>
26
#include <joschycore/plugininfo.h>
27
#include <joschycore/abstractprovider.h>
30
#include <kmessagebox.h>
34
#include <QtCore/QFile>
37
VideoPage::VideoPage(QWidget *parent)
38
: QWizardPage(parent), m_provider(0)
43
registerField("Video*", videoRequester, "text", SIGNAL(textChanged(QString)));
44
registerField("Title*", titleEdit);
45
registerField("Description*", descriptionEdit, "plainText", SIGNAL(textChanged()));
46
registerField("Category*", categoryCombo, "currentText", SIGNAL(currentIndexChanged(QString)));
47
registerField("Tags*", tagBox, "items", SIGNAL(changed()));
49
connect(descriptionEdit, SIGNAL(textChanged()), this, SLOT(descriptionChanged()));
51
descriptionEdit->setCheckSpellingEnabled(true);
56
VideoPage::~VideoPage()
60
Joschy::Manager::self()->unloadProvider(m_provider);
66
void VideoPage::initializePage()
70
Joschy::Manager::self()->unloadProvider(m_provider);
74
Joschy::AbstractProvider *plugin = Joschy::Manager::self()->createProvider(field("Provider").toString(),
78
KMessageBox::error(this, i18n("Cannot load: %1", field("Provider").toString()));
84
categorysChanged(plugin->categorys());
85
connect(m_provider, SIGNAL(categorysChanged(QStringList)), this,
86
SLOT(categorysChanged(QStringList)));
91
void VideoPage::categorysChanged(const QStringList &categorys)
94
categoryCombo->clear();
95
categoryCombo->addItems(categorys);
100
void VideoPage::descriptionChanged()
103
QString text = descriptionEdit->toPlainText();
104
if (text.length() > 5000) {
106
descriptionEdit->setText(text);
113
#include "videopage.moc"