- remove AppletBrowser-the-wrapper-class
- change AppletBrowserWindow to be AppletBrowser svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=717959
This commit is contained in:
parent
7ec22e70a1
commit
a64cea3758
@ -17,8 +17,7 @@ set(plasma_LIB_SRCS
|
|||||||
abstractrunner.cpp
|
abstractrunner.cpp
|
||||||
animator.cpp
|
animator.cpp
|
||||||
applet.cpp
|
applet.cpp
|
||||||
appletbrowser.cpp
|
appletbrowser/appletbrowser.cpp
|
||||||
appletbrowser/appletbrowserwindow.cpp
|
|
||||||
appletbrowser/kcategorizeditemsview.cpp
|
appletbrowser/kcategorizeditemsview.cpp
|
||||||
appletbrowser/kcategorizeditemsviewdelegate.cpp
|
appletbrowser/kcategorizeditemsviewdelegate.cpp
|
||||||
appletbrowser/kcategorizeditemsviewmodels.cpp
|
appletbrowser/kcategorizeditemsviewmodels.cpp
|
||||||
@ -103,7 +102,7 @@ set(plasma_LIB_INCLUDES
|
|||||||
abstractrunner.h
|
abstractrunner.h
|
||||||
animator.h
|
animator.h
|
||||||
applet.h
|
applet.h
|
||||||
appletbrowser.h
|
appletbrowser/appletbrowser.h
|
||||||
configxml.h
|
configxml.h
|
||||||
containment.h
|
containment.h
|
||||||
corona.h
|
corona.h
|
||||||
|
@ -1,90 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 (or,
|
|
||||||
* at your option, any later version) as published by the Free Software
|
|
||||||
* Foundation
|
|
||||||
*
|
|
||||||
* 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 Library 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 <appletbrowser.h>
|
|
||||||
#include <appletbrowser/appletbrowserwindow_p.h>
|
|
||||||
|
|
||||||
#include <corona.h>
|
|
||||||
#include <containment.h>
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
class AppletBrowser::Private
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Private(AppletBrowser *parent, Corona *c)
|
|
||||||
: q(parent), corona(c), containment(NULL), m_window(NULL)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Private(AppletBrowser *parent, Containment *c)
|
|
||||||
: q(parent), corona(NULL), containment(c), m_window(NULL)
|
|
||||||
{}
|
|
||||||
|
|
||||||
~Private()
|
|
||||||
{
|
|
||||||
delete m_window;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppletBrowserWindow *window() {
|
|
||||||
if (!m_window) {
|
|
||||||
if (corona) {
|
|
||||||
m_window = new AppletBrowserWindow(corona);
|
|
||||||
} else {
|
|
||||||
m_window = new AppletBrowserWindow(containment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return m_window;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppletBrowser *q;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Containment *containment;
|
|
||||||
Corona *corona;
|
|
||||||
AppletBrowserWindow *m_window;
|
|
||||||
};
|
|
||||||
|
|
||||||
AppletBrowser::AppletBrowser(Corona * corona)
|
|
||||||
: d(new Private(this, corona))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AppletBrowser::AppletBrowser(Containment * containment)
|
|
||||||
: d(new Private(this, containment))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AppletBrowser::~AppletBrowser()
|
|
||||||
{
|
|
||||||
delete d;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppletBrowser::show()
|
|
||||||
{
|
|
||||||
d->window()->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppletBrowser::hide()
|
|
||||||
{
|
|
||||||
d->window()->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 (or,
|
|
||||||
* at your option, any later version) as published by the Free Software
|
|
||||||
* Foundation
|
|
||||||
*
|
|
||||||
* 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 Library 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PLASMA_APPLET_BROWSER_H
|
|
||||||
#define PLASMA_APPLET_BROWSER_H
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
class Corona;
|
|
||||||
class Containment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for applet browser
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class AppletBrowser
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit AppletBrowser(Corona * corona);
|
|
||||||
explicit AppletBrowser(Containment * corona);
|
|
||||||
virtual ~AppletBrowser();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays the applet browser window
|
|
||||||
*/
|
|
||||||
void show();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hides the applet browser window
|
|
||||||
*/
|
|
||||||
void hide();
|
|
||||||
|
|
||||||
private:
|
|
||||||
class Private;
|
|
||||||
Private * const d;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
||||||
|
|
||||||
#endif // PLASMA_APPLET_BROWSER_H
|
|
@ -17,7 +17,7 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "appletbrowserwindow_p.h"
|
#include "appletbrowser.h"
|
||||||
|
|
||||||
#include <KAction>
|
#include <KAction>
|
||||||
#include <KStandardAction>
|
#include <KStandardAction>
|
||||||
@ -31,10 +31,10 @@
|
|||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
class AppletBrowserWindow::Private
|
class AppletBrowser::Private
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private(Corona* co, Containment* cont, AppletBrowserWindow* q)
|
Private(Corona* co, Containment* cont, AppletBrowser* q)
|
||||||
: corona(co),
|
: corona(co),
|
||||||
containment(cont),
|
containment(cont),
|
||||||
appletList(0),
|
appletList(0),
|
||||||
@ -51,21 +51,21 @@ public:
|
|||||||
KCategorizedItemsViewModels::DefaultFilterModel filterModel;
|
KCategorizedItemsViewModels::DefaultFilterModel filterModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
AppletBrowserWindow::AppletBrowserWindow(Plasma::Corona * corona, QWidget * parent, Qt::WindowFlags f)
|
AppletBrowser::AppletBrowser(Plasma::Corona * corona, QWidget * parent, Qt::WindowFlags f)
|
||||||
: KDialog(parent, f),
|
: KDialog(parent, f),
|
||||||
d(new Private(corona, 0, this))
|
d(new Private(corona, 0, this))
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
AppletBrowserWindow::AppletBrowserWindow(Plasma::Containment * containment, QWidget * parent, Qt::WindowFlags f)
|
AppletBrowser::AppletBrowser(Plasma::Containment * containment, QWidget * parent, Qt::WindowFlags f)
|
||||||
: KDialog(parent, f),
|
: KDialog(parent, f),
|
||||||
d(new Private(0, containment, this))
|
d(new Private(0, containment, this))
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppletBrowserWindow::init()
|
void AppletBrowser::init()
|
||||||
{
|
{
|
||||||
d->appletList = new KCategorizedItemsView(this);
|
d->appletList = new KCategorizedItemsView(this);
|
||||||
setMainWidget(d->appletList);
|
setMainWidget(d->appletList);
|
||||||
@ -111,11 +111,11 @@ void AppletBrowserWindow::init()
|
|||||||
d->appletList->setItemModel(&d->itemModel);
|
d->appletList->setItemModel(&d->itemModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppletBrowserWindow::~AppletBrowserWindow()
|
AppletBrowser::~AppletBrowser()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppletBrowserWindow::addApplet()
|
void AppletBrowser::addApplet()
|
||||||
{
|
{
|
||||||
kDebug() << "Button ADD clicked";
|
kDebug() << "Button ADD clicked";
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ void AppletBrowserWindow::addApplet()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppletBrowserWindow::downloadApplets()
|
void AppletBrowser::downloadApplets()
|
||||||
{
|
{
|
||||||
//TODO: implement
|
//TODO: implement
|
||||||
kDebug() << "GHNS button clicked";
|
kDebug() << "GHNS button clicked";
|
||||||
@ -141,4 +141,4 @@ void AppletBrowserWindow::downloadApplets()
|
|||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
|
||||||
#include "appletbrowserwindow_p.moc"
|
#include "appletbrowser.moc"
|
@ -28,13 +28,13 @@ namespace Plasma
|
|||||||
class Corona;
|
class Corona;
|
||||||
class Containment;
|
class Containment;
|
||||||
|
|
||||||
class AppletBrowserWindow: public KDialog
|
class AppletBrowser: public KDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AppletBrowserWindow(Plasma::Corona *corona, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
explicit AppletBrowser(Plasma::Corona *corona, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||||
explicit AppletBrowserWindow(Plasma::Containment *containment, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
explicit AppletBrowser(Plasma::Containment *containment, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||||
virtual ~AppletBrowserWindow();
|
virtual ~AppletBrowser();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void addApplet();
|
void addApplet();
|
@ -49,7 +49,7 @@
|
|||||||
#include "ksmserver_interface.h"
|
#include "ksmserver_interface.h"
|
||||||
#include "screensaver_interface.h"
|
#include "screensaver_interface.h"
|
||||||
|
|
||||||
#include "appletbrowser.h"
|
#include "appletbrowser/appletbrowser.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user