diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch) | |
tree | 2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp | |
download | tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp')
-rw-r--r-- | konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp b/konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp new file mode 100644 index 0000000..3555a84 --- /dev/null +++ b/konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp @@ -0,0 +1,56 @@ +#include "plugin_domtreeviewer.h" +#include "domtreewindow.h" +#include "domtreeview.h" + +#include <kaction.h> +#include <kinstance.h> +#include <klibloader.h> + +#include <kdebug.h> +#include <klocale.h> +#include <kgenericfactory.h> + +#include <khtml_part.h> + +typedef KGenericFactory<PluginDomtreeviewer> DomtreeviewerFactory; +K_EXPORT_COMPONENT_FACTORY( libdomtreeviewerplugin, DomtreeviewerFactory( "domtreeviewer" ) ) + +PluginDomtreeviewer::PluginDomtreeviewer( QObject* parent, const char* name, + const QStringList & ) + : Plugin( parent, name ), m_dialog( 0 ) +{ + (void) new KAction( i18n("Show &DOM Tree"), + "domtreeviewer", 0, + this, SLOT(slotShowDOMTree()), + actionCollection(), "viewdomtree" ); +} + +PluginDomtreeviewer::~PluginDomtreeviewer() +{ + kdDebug(90180) << k_funcinfo << endl; + delete m_dialog; +} + +void PluginDomtreeviewer::slotShowDOMTree() +{ + if ( m_dialog ) + { + delete m_dialog; + Q_ASSERT((DOMTreeWindow *)m_dialog == (DOMTreeWindow *)0); + } + if (KHTMLPart *part = ::qt_cast<KHTMLPart *>(parent())) + { + m_dialog = new DOMTreeWindow(this); + connect( m_dialog, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); + m_dialog->view()->setHtmlPart(part); + m_dialog->show(); + } +} + +void PluginDomtreeviewer::slotDestroyed() +{ + kdDebug(90180) << k_funcinfo << endl; + m_dialog = 0; +} + +#include <plugin_domtreeviewer.moc> |