diff options
| author | 2011-03-25 00:19:16 +0000 | |
|---|---|---|
| committer | 2011-03-25 00:19:16 +0000 | |
| commit | 98d25196380f7a0369e47fbe833e6fb1b3746552 (patch) | |
| tree | 25c91e77d44b71ebf0744c81153096dc3a9ced53 /src/modules/addon | |
| parent | Add addons web interface, Addonize newsticker etc... (diff) | |
| download | KVIrc-98d25196380f7a0369e47fbe833e6fb1b3746552.tar.gz KVIrc-98d25196380f7a0369e47fbe833e6fb1b3746552.tar.bz2 KVIrc-98d25196380f7a0369e47fbe833e6fb1b3746552.zip | |
Add a web interface for the addons
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5692 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/addon')
| -rw-r--r-- | src/modules/addon/AddonManagementDialog.cpp | 26 | ||||
| -rw-r--r-- | src/modules/addon/AddonManagementDialog.h | 8 | ||||
| -rw-r--r-- | src/modules/addon/CMakeLists.txt | 8 |
3 files changed, 39 insertions, 3 deletions
diff --git a/src/modules/addon/AddonManagementDialog.cpp b/src/modules/addon/AddonManagementDialog.cpp index efa91d2b4..dfcf4ed1c 100644 --- a/src/modules/addon/AddonManagementDialog.cpp +++ b/src/modules/addon/AddonManagementDialog.cpp @@ -55,6 +55,10 @@ #include <QDir> #include <QAbstractTextDocumentLayout> +#ifdef COMPILE_WEBKIT_SUPPORT + #include "WebAddonInterfaceDialog.h" +#endif //COMPILE_WEBKIT_SUPPORT + AddonManagementDialog * AddonManagementDialog::m_pInstance = 0; extern QRect g_rectManagementDialogGeometry; @@ -78,12 +82,18 @@ AddonListViewItem::AddonListViewItem(KviTalListWidget *v,KviKvsScriptAddon * a) setText(t); QPixmap * p = a->icon(); - if (p) setIcon(*p); + if (p) + setIcon(*p); + + + } AddonListViewItem::~AddonListViewItem() { delete m_pAddon; + + } AddonManagementDialog::AddonManagementDialog(QWidget * p) @@ -93,6 +103,10 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) setObjectName("Addon manager"); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Addons))); +#ifdef COMPILE_WEBKIT_SUPPORT + m_pWebInterfaceDialog = NULL; +#endif //COMPILE_WEBKIT_SUPPORT + m_pInstance = this; QGridLayout * g = new QGridLayout(this); @@ -191,6 +205,10 @@ AddonManagementDialog::~AddonManagementDialog() { g_rectManagementDialogGeometry = QRect(pos().x(),pos().y(),size().width(),size().height()); m_pInstance = 0; +#ifdef COMPILE_WEBKIT_SUPPORT + if(m_pWebInterfaceDialog) + delete m_pWebInterfaceDialog; +#endif //COMPILE_WEBKIT_SUPPORT } void AddonManagementDialog::fillListView() @@ -268,8 +286,14 @@ void AddonManagementDialog::uninstallScript() void AddonManagementDialog::getMoreScripts() { +#ifdef COMPILE_WEBKIT_SUPPORT + if(m_pWebInterfaceDialog) + return; + m_pWebInterfaceDialog = new WebAddonInterfaceDialog(); +#else //!COMPILE_WEBKIT_SUPPORT // If change this introducing not-fixed text, remember to escape this using KviQString::escapeKvs()! KviKvsScript::run("openurl http://www.kvirc.net/?id=addons&version=" KVI_VERSION "." KVI_SOURCES_DATE,g_pActiveWindow); +#endif //!COMPILE_WEBKIT_SUPPORT } void AddonManagementDialog::installScript() diff --git a/src/modules/addon/AddonManagementDialog.h b/src/modules/addon/AddonManagementDialog.h index 392ad6257..e21635085 100644 --- a/src/modules/addon/AddonManagementDialog.h +++ b/src/modules/addon/AddonManagementDialog.h @@ -34,6 +34,7 @@ #include <QListWidget> #include <QItemDelegate> #include <QToolButton> +#include <QPointer> class QPixmap; class KviKvsScriptAddon; @@ -53,6 +54,10 @@ public: KviKvsScriptAddon * addon(){ return m_pAddon; }; }; +#ifdef COMPILE_WEBKIT_SUPPORT + class WebAddonInterfaceDialog; +#endif //COMPILE_WEBKIT_SUPPORT + class AddonManagementDialog : public QWidget { @@ -68,6 +73,9 @@ protected: QToolButton * m_pHelpButton; QToolButton * m_pPackButton; QToolButton * m_pUninstallButton; +#ifdef COMPILE_WEBKIT_SUPPORT + WebAddonInterfaceDialog * m_pWebInterfaceDialog; +#endif //COMPILE_WEBKIT_SUPPORT public: static AddonManagementDialog * instance(){ return m_pInstance; }; static void display(bool bTopLevel); diff --git a/src/modules/addon/CMakeLists.txt b/src/modules/addon/CMakeLists.txt index df508e37e..9c6e8b60b 100644 --- a/src/modules/addon/CMakeLists.txt +++ b/src/modules/addon/CMakeLists.txt @@ -1,15 +1,19 @@ # CMakeLists for src/modules/addon -SET(kviaddon_MOC_HDRS +SET( + kviaddon_MOC_HDRS AddonManagementDialog.h PackAddonDialog.h + WebAddonInterfaceDialog.h ) -SET(kviaddon_SRCS +SET( + kviaddon_SRCS libkviaddon.cpp AddonManagementDialog.cpp PackAddonDialog.cpp AddonFunctions.cpp + WebAddonInterfaceDialog.cpp ) # After this call, files will be moc'ed to moc_kvi_*.cpp |
