fix logic
[personal-kdelibs.git] / khtml / khtmladaptorpart.cpp
blobb3dc69b2d2d56878fe6708e0a176c59a555b229b
1 /*
2 * This file is part of the KDE libraries
3 * Copyright (C) 2007 Harri Porten (porten@kde.org)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 #include "khtmladaptorpart.h"
22 #include <kjs/object.h>
23 #include <QLabel>
24 #include <klocale.h>
25 AdaptorView::AdaptorView(QWidget* wparent, QObject* parent,
26 const QStringList& /*args*/)
27 : KParts::ReadOnlyPart(parent)
29 QLabel *placeHolder = new QLabel(i18n("Inactive"), wparent);
30 placeHolder->setAlignment(Qt::AlignCenter);
31 placeHolder->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
33 KParts::Part::setWidget(placeHolder);
36 bool AdaptorView::openFile()
38 return true;
41 void AdaptorView::initScripting(KJS::ExecState * /*exec*/)
45 KJS::JSObject* AdaptorView::scriptObject()
47 return new KJS::JSObject();
50 K_EXPORT_COMPONENT_FACTORY (khtmladaptorpart, KHTMLAdaptorPartFactory)
52 KHTMLAdaptorPartFactory::KHTMLAdaptorPartFactory()
56 KParts::Part* KHTMLAdaptorPartFactory::createPartObject(QWidget* wparent,
57 QObject* parent,
58 const char* /*className*/,
59 const QStringList& args)
61 return new AdaptorView(wparent, parent, args);
64 #include "moc_khtmladaptorpart.cpp"