- */
- text += "
";
- } else {
- text += '<' + nodeName;
-
- QString attributes;
- DOM::Attr attr;
- const DOM::NamedNodeMap attrs = element.attributes();
- unsigned long lmap = attrs.length();
- for (uint j = 0; j < lmap; j++) {
- attr = static_cast(attrs.item(j));
- attributes += " " + attr.name().string() + "=\"" + attr.value().string() + "\"";
- }
- if (!(attributes.isEmpty())) {
- text += ' ';
- }
-
- text += attributes.simplified();
-
- if (element.firstChild().isNull()) {
- text += "/>";
- } else {
- text += '>';
- }
- }
- } else {
- text = strIndent + pNode.nodeValue().string();
- }
-
- kDebug(90180) << text;
- if (!(text.isEmpty())) {
- (*m_textStream) << text << endl;
- }
-
- DOM::Node child = pNode.firstChild();
- while (!child.isNull()) {
- saveRecursive(child, indent + 2);
- child = child.nextSibling();
- }
-
- if (!(element.isNull()) && (!(element.firstChild().isNull()))) {
- if (nodeName.at(0) == '-') {
- text = strIndent + "
";
- } else {
- text = strIndent + "" + pNode.nodeName().string() + '>';
- }
- kDebug(90180) << text;
- (*m_textStream) << text << endl;
- }
-}
-#endif
-
-void DOMTreeView::updateIncrDecreaseButton()
-{
-#if 0
- m_decreaseButton->setEnabled((m_expansionDepth > 0));
- m_increaseButton->setEnabled((m_expansionDepth < m_maxDepth));
-#endif
-}
-
-void DOMTreeView::refresh()
-{
- if (!part) {
- return;
- }
- scroll_ofs_x = m_listView->horizontalScrollBar()->value();
- scroll_ofs_y = m_listView->verticalScrollBar()->value();
-
- m_listView->setUpdatesEnabled(false);
- slotShowTree(part->document());
-
- QTimer::singleShot(0, this, SLOT(slotRestoreScrollOffset()));
- _refreshed = true;
-}
-
-void DOMTreeView::increaseExpansionDepth()
-{
- if (!part) {
- return;
- }
- if (m_expansionDepth < m_maxDepth) {
- ++m_expansionDepth;
- adjustDepth();
- updateIncrDecreaseButton();
- } else {
- QApplication::beep();
- }
-}
-
-void DOMTreeView::decreaseExpansionDepth()
-{
- if (!part) {
- return;
- }
- if (m_expansionDepth > 0) {
- --m_expansionDepth;
- adjustDepth();
- updateIncrDecreaseButton();
- } else {
- QApplication::beep();
- }
-}
-
-void DOMTreeView::adjustDepth()
-{
- // get current item in a hypersmart way
- DOMListViewItem *cur_node_item = m_itemdict.value(infoNode.handle(), nullptr);
- if (!cur_node_item) {
- cur_node_item = static_cast
(m_listView->currentItem());
- }
-
- for (int i = 0; i < m_listView->topLevelItemCount(); ++i) {
- QTreeWidgetItem *topLevelItem = m_listView->topLevelItem(i);
- adjustDepthRecursively(topLevelItem, 0);
- }
-
- // make current item visible again if possible
- if (cur_node_item) {
- m_listView->scrollToItem(cur_node_item);
- }
-
-}
-
-void DOMTreeView::adjustDepthRecursively(QTreeWidgetItem *curItem, uint currDepth)
-{
- if (!curItem) {
- return;
- }
-
- m_listView->setItemExpanded(curItem, m_expansionDepth > currDepth);
-
- for (int cp = 0; cp < curItem->childCount(); ++cp) {
- adjustDepthRecursively(curItem->child(cp), currDepth + 1);
- }
-}
-
-void DOMTreeView::setMessage(const QString &msg)
-{
- messageLine->setText(msg);
- messageLinePane->show();
-}
-
-void DOMTreeView::hideMessageLine()
-{
- messageLinePane->hide();
-}
-
-void DOMTreeView::moveToParent()
-{
- // This is a hypersmart algorithm.
- // If infoNode is defined, go to the parent of infoNode, otherwise, go
- // to the parent of the tree view's current item.
- // Hope this isn't too smart.
-
- DOM::Node cur = infoNode;
- if (cur.isNull() && m_listView->currentItem()) {
- cur = static_cast(m_listView->currentItem())->node();
- }
-
- if (cur.isNull()) {
- return;
- }
-
- cur = cur.parentNode();
- activateNode(cur);
-}
-
-void DOMTreeView::showDOMTreeContextMenu(const QPoint &pos)
-{
- QMenu *ctx = mainWindow()->domTreeViewContextMenu();
- Q_ASSERT(ctx);
- ctx->popup(m_listView->mapToGlobal(pos));
-}
-
-void DOMTreeView::slotPureToggled(bool b)
-{
- m_bPure = b;
- refresh();
-}
-
-void DOMTreeView::slotShowAttributesToggled(bool b)
-{
- m_bShowAttributes = b;
- refresh();
-}
-
-void DOMTreeView::slotHighlightHTMLToggled(bool b)
-{
- m_bHighlightHTML = b;
- refresh();
-}
-
-void DOMTreeView::deleteNodes()
-{
-// kDebug(90180) ;
-
- DOM::Node last;
- MultiCommand *cmd = new MultiCommand(i18n("Delete Nodes"));
- QTreeWidgetItemIterator it(m_listView, QTreeWidgetItemIterator::Selected);
- for (; *it; ++it) {
- DOMListViewItem *item = static_cast(*it);
-// kDebug(90180) << " item->node " << item->node().nodeName().string() << " clos " << item->isClosing();
- if (item->isClosing()) {
- continue;
- }
-
- // don't regard node more than once
- if (item->node() == last) {
- continue;
- }
-
- // check for selected parent
- bool has_selected_parent = false;
- for (QTreeWidgetItem *p = item->parent(); p; p = p->parent()) {
- if (p->isSelected()) {
- has_selected_parent = true;
- break;
- }
- }
- if (has_selected_parent) {
- continue;
- }
-
-// kDebug(90180) << " item->node " << item->node().nodeName().string() << ": schedule for removal";
- // remove this node if it isn't already recursively removed by its parent
- cmd->addCommand(new RemoveNodeCommand(item->node(), item->node().parentNode(), item->node().nextSibling()));
- last = item->node();
- }
- mainWindow()->executeAndAddCommand(cmd);
-}
-
-void DOMTreeView::disconnectFromTornDownPart()
-{
- if (!part) {
- return;
- }
-
- m_listView->clear();
- initializeOptionsFromNode(DOM::Node());
-
- // remove all references to nodes
- infoNode = DOM::Node(); // ### have this handled by dedicated info node panel method
- current_node = DOM::Node();
- active_node_rule = DOM::CSSRule();
- stylesheet = DOM::CSSStyleSheet();
-}
-
-void DOMTreeView::connectToPart()
-{
- if (part) {
- connect(part, SIGNAL(nodeActivated(DOM::Node)), this,
- SLOT(activateNode(DOM::Node)));
- connect(part, SIGNAL(completed()), this, SLOT(refresh()));
-
- if (!part->document().isNull()) {
- connectToDocument();
- } else {
- // TODO: regularly poll for a document? wait for a signal?
- }
- } else {
- slotShowTree(DOM::Node());
- }
-
- updateIncrDecreaseButton();
-}
-
-void DOMTreeView::connectToDocument()
-{
- assert(part);
- assert(!part->document().isNull());
-
- {
- // insert a style rule to indicate activated nodes
- try {
- kDebug(90180) << "(1) part.document: " << part->document().handle();
- stylesheet = part->document().implementation().createCSSStyleSheet("-domtreeviewer-style", "screen");
- kDebug(90180) << "(2)";
- stylesheet.insertRule(":focus { outline: medium #f00 solid }", 0);
- // ### for testing only
-// stylesheet.insertRule("body { background: #f0f !important }", 1);
- kDebug(90180) << "(3)";
- active_node_rule = stylesheet.cssRules().item(0);
- kDebug(90180) << "(4)";
- part->document().addStyleSheet(stylesheet);
- kDebug(90180) << "(5)";
- } catch (DOM::CSSException &ex) {
- kDebug(90180) << "CSS Exception " << ex.code;
- } catch (DOM::DOMException &ex) {
- kDebug(90180) << "DOM Exception " << ex.code;
- }
- }
-
- slotShowTree(part->document());
- updateIncrDecreaseButton();
-}
-
-void DOMTreeView::disconnectFromActivePart()
-{
- if (!part) {
- return;
- }
-
- // remove style sheet
- try {
- part->document().removeStyleSheet(stylesheet);
- } catch (DOM::CSSException &ex) {
- kDebug(90180) << "CSS Exception " << ex.code;
- } catch (DOM::DOMException &ex) {
- kDebug(90180) << "DOM Exception " << ex.code;
- }
-
-}
-
-void DOMTreeView::slotSetHtmlPartDelayed()
-{
- connectToPart();
- emit htmlPartChanged(part);
-}
-
-void DOMTreeView::slotRestoreScrollOffset()
-{
- m_listView->setUpdatesEnabled(true);
- m_listView->horizontalScrollBar()->setValue(scroll_ofs_x);
- m_listView->verticalScrollBar()->setValue(scroll_ofs_y);
-}
-
-void DOMTreeView::slotAddElementDlg()
-{
- DOMListViewItem *item = static_cast(m_listView->currentItem());
- if (!item) {
- return;
- }
-
- QString qname;
- QString namespc;
- SignalReceiver addBefore;
-
- {
- ElementEditDialog dlg(this);
- dlg.setModal(true);
- connect(dlg.button(KDialog::User2), SIGNAL(clicked()), &addBefore, SLOT(slot()));
-
- // ### activate when namespaces are supported
- dlg.elemNamespace->setEnabled(false);
-
- if (dlg.exec() != QDialog::Accepted) {
- return;
- }
-
- qname = dlg.elemName->text();
- namespc = dlg.elemNamespace->currentText();
- }
-
- DOM::Node curNode = item->node();
-
- try {
- DOM::Node parent = addBefore() ? curNode.parentNode() : curNode;
- DOM::Node after = addBefore() ? curNode : nullptr;
-
- // ### take namespace into account
- DOM::Node newNode = curNode.ownerDocument().createElement(qname);
-
- ManipulationCommand *cmd = new InsertNodeCommand(newNode, parent, after);
- mainWindow()->executeAndAddCommand(cmd);
-
- if (cmd->isValid()) {
- activateNode(newNode);
- }
-
- } catch (DOM::DOMException &ex) {
- mainWindow()->addMessage(ex.code, domErrorMessage(ex.code));
- }
-}
-
-void DOMTreeView::slotAddTextDlg()
-{
- DOMListViewItem *item = static_cast(m_listView->currentItem());
- if (!item) {
- return;
- }
-
- QString text;
- SignalReceiver addBefore;
-
- {
- TextEditDialog dlg(this);
- dlg.setModal(true);
- connect(dlg.button(KDialog::User2), SIGNAL(clicked()), &addBefore, SLOT(slot()));
-
- if (dlg.exec() != QDialog::Accepted) {
- return;
- }
-
- text = dlg.textPane->toPlainText();
- }
-
- DOM::Node curNode = item->node();
-
- try {
- DOM::Node parent = addBefore() ? curNode.parentNode() : curNode;
- DOM::Node after = addBefore() ? curNode : nullptr;
-
- DOM::Node newNode = curNode.ownerDocument().createTextNode(text);
-
- ManipulationCommand *cmd = new InsertNodeCommand(newNode, parent, after);
- mainWindow()->executeAndAddCommand(cmd);
-
- if (cmd->isValid()) {
- activateNode(newNode);
- }
-
- } catch (DOM::DOMException &ex) {
- mainWindow()->addMessage(ex.code, domErrorMessage(ex.code));
- }
-}
-
-// == DOM Node info panel =============================================
-
-static QString *clickToAdd;
-
-/**
- * List view item for attribute list.
- */
-class AttributeListItem : public QTreeWidgetItem
-{
- typedef QTreeWidgetItem super;
-
- bool _new;
-
-public:
- AttributeListItem(QTreeWidget *parent, QTreeWidgetItem *prev)
- : super(parent, prev), _new(true)
- {
- if (!clickToAdd) {
- clickToAdd = new QString(i18n(""));
- }
- setText(0, *clickToAdd);
- QColor c = QApplication::palette().color(QPalette::Disabled,
- QPalette::Text);
- setForeground(0, c);
- setFirstColumnSpanned(true);
- }
-
- AttributeListItem(const QString &attrName, const QString &attrValue,
- QTreeWidget *parent, QTreeWidgetItem *prev)
- : super(parent, prev), _new(false)
- {
- setText(0, attrName);
- setText(1, attrValue);
- }
-
- bool isNew() const
- {
- return _new;
- }
- void setNew(bool s)
- {
- _new = s;
- }
-
- bool operator<(const QTreeWidgetItem &other) const override
- {
- // Keep the "Add" item at the end
- if (_new) {
- return false;
- }
- if (static_cast(other).isNew()) {
- return true;
- }
- return QTreeWidgetItem::operator<(other);
- }
-};
-
-void DOMTreeView::initDOMNodeInfo()
-{
- connect(m_listView, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
- SLOT(initializeOptionsFromListItem(QTreeWidgetItem*)));
-
- connect(nodeAttributes, SIGNAL(itemRenamed(QTreeWidgetItem*,QString,int)),
- SLOT(slotItemRenamed(QTreeWidgetItem*,QString,int)));
- connect(nodeAttributes, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
- SLOT(slotEditAttribute(QTreeWidgetItem*,int)));
- nodeAttributes->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(nodeAttributes, SIGNAL(customContextMenuRequested(QPoint)),
- SLOT(showInfoPanelContextMenu(QPoint)));
-
- connect(applyContent, SIGNAL(clicked()), SLOT(slotApplyContent()));
-
- ManipulationCommand::connect(SIGNAL(nodeChanged(DOM::Node)), this, SLOT(initializeOptionsFromNode(DOM::Node)));
-
- // ### nodeAttributes->setRenameable(0, true);
- // ### nodeAttributes->setRenameable(1, true);
-
- nodeInfoStack->setCurrentIndex(EmptyPanel);
-
- installEventFilter(nodeAttributes);
-}
-
-void DOMTreeView::initializeOptionsFromNode(const DOM::Node &node)
-{
- infoNode = node;
-
- nodeName->clear();
- nodeType->clear();
- nodeNamespace->clear();
- nodeValue->clear();
-
- if (node.isNull()) {
- nodeInfoStack->setCurrentIndex(EmptyPanel);
- return;
- }
-
- nodeName->setText(node.nodeName().string());
- nodeType->setText(QString::number(node.nodeType()));
- nodeNamespace->setText(node.namespaceURI().string());
-// nodeValue->setText(node.value().string());
-
- initializeStyleSheetsFromDocument(node.ownerDocument());
-
- DOM::Element element = node;
- if (!element.isNull()) {
- initializeOptionsFromElement(element);
- return;
- }
-
- DOM::CharacterData cdata = node;
- if (!cdata.isNull()) {
- initializeOptionsFromCData(cdata);
- return;
- }
-
- // Fallback
- nodeInfoStack->setCurrentIndex(EmptyPanel);
-}
-
-void DOMTreeView::initializeOptionsFromListItem(QTreeWidgetItem *item)
-{
- const DOMListViewItem *cur_item = static_cast(item);
-
-// kDebug(90180) << "cur_item: " << cur_item;
- initializeOptionsFromNode(cur_item ? cur_item->node() : DOM::Node());
-}
-
-void DOMTreeView::initializeOptionsFromElement(const DOM::Element &element)
-{
- initializeDOMInfoFromElement(element);
- initializeCSSInfoFromElement(element);
-}
-
-void DOMTreeView::initializeDOMInfoFromElement(const DOM::Element &element)
-{
- QTreeWidgetItem *last = nullptr;
- nodeAttributes->clear();
-
- DOM::NamedNodeMap attrs = element.attributes();
- unsigned long lmap = attrs.length();
- for (unsigned int j = 0; j < lmap; j++) {
- DOM::Attr attr = attrs.item(j);
-// kDebug(90180) << attr.name().string() << "=" << attr.value().string();
- QTreeWidgetItem *item = new AttributeListItem(attr.name().string(),
- attr.value().string(),
- nodeAttributes, last);
- last = item;
- }
-
- // append new item
- last = new AttributeListItem(nodeAttributes, last);
-
- nodeAttributes->sortByColumn(0, Qt::AscendingOrder);
-
- nodeInfoStack->setCurrentIndex(ElementPanel);
-}
-
-void DOMTreeView::initializeCSSInfoFromElement(const DOM::Element &element)
-{
- DOM::Document doc = element.ownerDocument();
- DOM::AbstractView view = doc.defaultView();
- DOM::CSSStyleDeclaration styleDecl = view.getComputedStyle(element,
- DOM::DOMString());
-
- unsigned long l = styleDecl.length();
- cssProperties->clear();
- cssProperties->setEnabled(true);
- QList items;
- for (unsigned long i = 0; i < l; ++i) {
- DOM::DOMString name = styleDecl.item(i);
- DOM::DOMString value = styleDecl.getPropertyValue(name);
-
- QStringList values;
- values.append(name.string());
- values.append(value.string());
- items.append(new QTreeWidgetItem(static_cast(nullptr), values));
- }
-
- cssProperties->insertTopLevelItems(0, items);
- cssProperties->resizeColumnToContents(0);
-}
-
-void DOMTreeView::initializeStyleSheetsFromDocument(const DOM::Document &doc)
-{
- styleSheetsTree->clear();
- styleSheetsTree->setEnabled(true);
-
- DOM::StyleSheetList sheets = doc.styleSheets();
- unsigned long l = sheets.length();
- for (unsigned long i = 0; i < l; ++i) {
- DOM::StyleSheet sheet = sheets.item(i);
- // some info about the sheet itself
- QString str = "type=\"" + sheet.type().string() + "\"";
- if (!sheet.href().isEmpty()) {
- str += " href=\"" + sheet.href().string() + "\"";
- }
- if (!sheet.title().isEmpty()) {
- str += " title=\"" + sheet.title().string() + "\"";
- }
- if (sheet.disabled()) {
- str += QLatin1String(" disabled");
- }
- QStringList strList = QStringList(str);
- QTreeWidgetItem *topLevel = new QTreeWidgetItem(strList);
- styleSheetsTree->addTopLevelItem(topLevel);
-
- // list the content
- DOM::CSSStyleSheet cssSheet(sheet);
- if (!cssSheet.isNull()) {
- DOM::CSSRuleList cssRules = cssSheet.cssRules();
- unsigned long numRules = cssRules.length();
- for (unsigned long r = 0; r < numRules; ++r) {
- DOM::CSSRule rule = cssRules.item(r);
- QString cssText = rule.cssText().string();
- (void)new QTreeWidgetItem(topLevel, QStringList(cssText));
- }
- }
- }
-}
-
-void DOMTreeView::initializeOptionsFromCData(const DOM::CharacterData &cdata)
-{
- initializeDOMInfoFromCData(cdata);
- initializeCSSInfoFromCData(cdata);
-}
-
-void DOMTreeView::initializeDOMInfoFromCData(const DOM::CharacterData &cdata)
-{
- contentEditor->setText(cdata.data().string());
-
- DOM::Text text = cdata;
- contentEditor->setEnabled(!text.isNull());
-
- nodeInfoStack->setCurrentIndex(CDataPanel);
-}
-
-void DOMTreeView::initializeCSSInfoFromCData(const DOM::CharacterData &)
-{
- cssProperties->clear();
- cssProperties->setEnabled(false);
-}
-
-void DOMTreeView::slotItemRenamed(QTreeWidgetItem *lvi, const QString &str, int col)
-{
- AttributeListItem *item = static_cast(lvi);
-
- DOM::Element element = infoNode;
- if (element.isNull()) {
- return; // Should never happen
- }
-
- switch (col) {
- case 0: {
- ManipulationCommand *cmd;
-// kDebug(90180) << "col 0: " << element.nodeName() << " isNew: " << item->isNew();
- if (item->isNew()) {
- cmd = new AddAttributeCommand(element, str, item->text(1));
- item->setNew(false);
- } else {
- cmd = new RenameAttributeCommand(element, item->text(0), str);
- }
-
- mainWindow()->executeAndAddCommand(cmd);
- break;
- }
- case 1: {
- if (item->isNew()) {
- lvi->setText(1, QString());
- break;
- }
-
- ChangeAttributeValueCommand *cmd = new ChangeAttributeValueCommand(
- element, item->text(0), str);
- mainWindow()->executeAndAddCommand(cmd);
- break;
- }
- }
-}
-
-void DOMTreeView::slotEditAttribute(QTreeWidgetItem *lvi, int col)
-{
- if (!lvi) {
- return;
- }
-
- QString attrName;
- QString attrValue;
- bool newItem = static_cast(lvi)->isNew();
- int res = 0;
-
- {
- AttributeEditDialog dlg(this);
- dlg.setModal(true);
- if (!newItem) {
- dlg.attrName->setText(lvi->text(0));
- dlg.attrValue->setText(lvi->text(1));
- }
- if (col == 0) {
- dlg.attrName->setFocus();
- dlg.attrName->selectAll();
- } else {
- dlg.attrValue->setFocus();
- dlg.attrValue->selectAll();
- }
-
- res = dlg.exec();
-
- attrName = dlg.attrName->text();
- attrValue = dlg.attrValue->toPlainText();
- }
-
-// kDebug(90180) << "name=" << attrName << " value=" << attrValue;
-
- if (res == QDialog::Accepted) do {
- if (attrName.isEmpty()) {
- break;
- }
-
- if (lvi->text(0) != attrName) {
- // hack: set value to assign attribute/value pair in one go
- lvi->setText(1, attrValue);
-
- slotItemRenamed(lvi, attrName, 0);
- // Reget, item may have been changed
- QList il = nodeAttributes->findItems(attrName,
- Qt::MatchExactly,
- 0);
- assert(il.count() == 1);
- lvi = il.at(0);
- }
-
- if (lvi && lvi->text(1) != attrValue) {
- slotItemRenamed(lvi, attrValue, 1);
- }
-
- } while (false) /*end if*/;
-}
-
-void DOMTreeView::slotApplyContent()
-{
- DOM::CharacterData cdata = infoNode;
-
- if (cdata.isNull()) {
- return;
- }
-
- ManipulationCommand *cmd = new ChangeCDataCommand(cdata, contentEditor->toPlainText());
- mainWindow()->executeAndAddCommand(cmd);
-}
-
-void DOMTreeView::showInfoPanelContextMenu(const QPoint &pos)
-{
- QMenu *ctx = mainWindow()->infoPanelAttrContextMenu();
- Q_ASSERT(ctx);
- ctx->popup(nodeAttributes->mapToGlobal(pos));
-}
-
-void DOMTreeView::copyAttributes()
-{
- // TODO implement me
-}
-
-void DOMTreeView::cutAttributes()
-{
- // TODO implement me
-}
-
-void DOMTreeView::pasteAttributes()
-{
- // TODO implement me
-}
-
-void DOMTreeView::deleteAttributes()
-{
- MultiCommand *cmd = new MultiCommand(i18n("Delete Attributes"));
- QTreeWidgetItemIterator it(nodeAttributes, QTreeWidgetItemIterator::Selected);
- for (; *it; ++it) {
- AttributeListItem *item = static_cast(*it);
- if (item->isNew()) {
- continue;
- }
-
- cmd->addCommand(new RemoveAttributeCommand(infoNode, item->text(0)));
- }
- mainWindow()->executeAndAddCommand(cmd);
-}
-
diff --git a/plugins/domtreeviewer/domtreeviewbase.ui b/plugins/domtreeviewer/domtreeviewbase.ui
deleted file mode 100644
--- a/plugins/domtreeviewer/domtreeviewbase.ui
+++ /dev/null
@@ -1,406 +0,0 @@
-
- DOMTreeViewBase
-
-
-
- 0
- 0
- 663
- 583
-
-
-
-
- 600
- 380
-
-
-
- DOM Tree Viewer
-
-
- -
-
-
- QFrame::Panel
-
-
- QFrame::Plain
-
-
-
- 0
-
-
- 1
-
-
-
-
-
-
- 75
- true
-
-
-
- false
-
-
- true
-
-
-
- -
-
-
-
- 10
-
-
-
- &List
-
-
- true
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Fixed
-
-
-
- 10
- 20
-
-
-
-
- -
-
-
-
- 10
-
-
-
- H&ide
-
-
- true
-
-
-
-
-
-
- -
-
-
- true
-
-
- true
-
-
- true
-
-
-
- DOM Tree
-
-
-
-
- -
-
-
- 0
-
-
-
- DOM Node
-
-
-
-
-
-
- 0
-
-
-
-
-
- Node &value:
-
-
- false
-
-
- nodeValue
-
-
-
- -
-
-
- Node &type:
-
-
- false
-
-
- nodeType
-
-
-
- -
-
-
- Namespace &URI:
-
-
- false
-
-
- nodeNamespace
-
-
-
- -
-
-
- Node &name:
-
-
- false
-
-
- nodeName
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
- -
-
-
- true
-
-
- true
-
-
-
-
-
- -
-
-
-
-
- 0
-
-
-
-
-
- Qt::StrongFocus
-
-
- false
-
-
- true
-
-
-
- Name
-
-
-
-
- Value
-
-
-
-
-
-
-
-
-
- 0
-
-
- 0
-
- -
-
-
- false
-
-
- true
-
-
-
- -
-
-
- 0
-
-
-
-
-
- Appl&y
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Expanding
-
-
-
- 81
- 20
-
-
-
-
-
-
-
-
-
-
-
-
-
- nodeInfoStack
-
-
-
- Computed Style
-
-
- -
-
-
- false
-
-
- false
-
-
- true
-
-
- 2
-
-
-
- Property
-
-
-
-
- Value
-
-
-
-
-
-
-
-
- Stylesheets
-
-
- -
-
-
- false
-
-
- true
-
-
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
- KLineEdit
- QLineEdit
-
-
-
- KTextEdit
- QTextEdit
-
-
-
-
- m_listView
- nodeName
- nodeNamespace
- nodeType
- nodeValue
- contentEditor
- applyContent
- nodeAttributes
-
-
- klineedit.h
- ktextedit.h
-
-
-
-
diff --git a/plugins/domtreeviewer/domtreeviewerui.rc b/plugins/domtreeviewer/domtreeviewerui.rc
deleted file mode 100644
--- a/plugins/domtreeviewer/domtreeviewerui.rc
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-Main Toolbar
-
-Tree Toolbar
-
-
-
-
-
-
-
-
-
diff --git a/plugins/domtreeviewer/domtreewindow.h b/plugins/domtreeviewer/domtreewindow.h
deleted file mode 100644
--- a/plugins/domtreeviewer/domtreewindow.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/* This file is part of the KDE project
- *
- * Copyright (C) 2005 Leo Savernik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef domtreewindow_H
-#define domtreewindow_H
-
-#include
-
-#include
-
-namespace domtreeviewer
-{
-class ManipulationCommand;
-}
-
-namespace KParts
-{
-class Part;
-class PartManager;
-}
-
-class DOMTreeView;
-class PluginDomtreeviewer;
-
-class QAction;
-class KConfig;
-class KUndoStack;
-class KHTMLPart;
-class MessageDialog;
-
-class QMenu;
-
-/**
- * This class serves as the main window for DOM Tree Viewer. It handles the
- * menus, toolbars, and status bars.
- *
- * @short Main window class
- * @author Leo Savernik
- */
-class DOMTreeWindow : public KXmlGuiWindow
-{
- Q_OBJECT
-public:
- /**
- * Default Constructor
- */
- DOMTreeWindow(PluginDomtreeviewer *plugin);
-
- /**
- * Default Destructor
- */
- ~DOMTreeWindow() override;
-
- /**
- * returns the dom tree view
- */
- DOMTreeView *view() const
- {
- return m_view;
- }
-
- /**
- * returns the command history
- */
- KUndoStack *commandHistory() const
- {
- return m_commandHistory;
- }
-
- /**
- * creates and returns the context menu for the list info panel
- */
- QMenu *createInfoPanelAttrContextMenu();
-
- /**
- * returns the context menu for the list info panel
- */
- QMenu *infoPanelAttrContextMenu()
- {
- return infopanel_ctx;
- }
-
- /**
- * creates and returns the context menu for the DOM tree view
- */
- QMenu *createDOMTreeViewContextMenu();
-
- /**
- * returns the context menu for the DOM tree view
- */
- QMenu *domTreeViewContextMenu()
- {
- return domtree_ctx;
- }
-
- /**
- * Executes the given command and adds it to the history.
- *
- * If the command could not be executed, it will not be added.
- */
- void executeAndAddCommand(domtreeviewer::ManipulationCommand *);
-
- /**
- * Returns the config object for this plugin.
- */
- KConfig *config() const
- {
- return _config;
- }
-
- /** returns the attribute delete action */
- QAction *deleteAttributeAction() const
- {
- return del_attr;
- }
- /** returns the node delete action */
- QAction *deleteNodeAction() const
- {
- return del_tree;
- }
-
-public slots:
- /**
- * Adds a log message
- * @param id message id
- * @param msg message text
- */
- void addMessage(int id, const QString &msg);
-
- /**
- * Displays the message log window.
- */
- void showMessageLog();
-
-protected:
- /**
- * Overridden virtuals for Qt drag 'n drop (XDND)
- */
- void dragEnterEvent(QDragEnterEvent *event) override;
- void dropEvent(QDropEvent *event) override;
-protected:
- /**
- * This function is called when it is time for the app to save its
- * properties for session management purposes.
- */
- void saveProperties(KConfigGroup &) override;
-
- /**
- * This function is called when this app is restored. The KConfig
- * object points to the session management config file that was saved
- * with @ref saveProperties
- */
- void readProperties(const KConfigGroup &) override;
-
-private slots:
- void slotCut();
- void slotCopy();
- void slotPaste();
- //void slotUndo();
- //void slotRedo();
- void slotFind();
- void optionsConfigureToolbars();
- void optionsPreferences();
- void newToolbarConfig();
-
- void changeStatusbar(const QString &text);
- void changeCaption(const QString &text);
-
- void slotHtmlPartChanged(KHTMLPart *);
- void slotActivePartChanged(KParts::Part *);
- void slotPartRemoved(KParts::Part *);
- void slotClosePart();
-
-private:
- void setupAccel();
- void setupActions();
-
-private:
- PluginDomtreeviewer *m_plugin;
- DOMTreeView *m_view;
- MessageDialog *msgdlg;
-
- KUndoStack *m_commandHistory;
- QMenu *infopanel_ctx;
- QMenu *domtree_ctx;
- KConfig *_config;
-
- QAction *del_tree, *del_attr;
-
- QPointer part_manager;
-};
-
-#endif // domtreewindow_H
diff --git a/plugins/domtreeviewer/domtreewindow.cpp b/plugins/domtreeviewer/domtreewindow.cpp
deleted file mode 100644
--- a/plugins/domtreeviewer/domtreewindow.cpp
+++ /dev/null
@@ -1,430 +0,0 @@
-/* This file is part of the KDE project
- *
- * Copyright (C) 2005 Leo Savernik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "domtreewindow.h"
-#include "domtreeview.h"
-#include "domtreecommands.h"
-#include "plugin_domtreeviewer.h"
-#include "ui_messagedialog.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-//KDELibs4Support
-#include
-#include
-
-
-class MessageDialog : public KDialog, public Ui::MessageDialog
-{
-public:
- MessageDialog(QWidget *parent)
- : KDialog(parent)
- {
- setupUi(mainWidget());
-
- setWindowTitle(i18nc("@title:window", "Message Log"));
- setButtons(Close | User1);
- setButtonGuiItem(User1, KStandardGuiItem::clear());
-
- QPalette pal = messagePane->palette();
- pal.setColor(messagePane->backgroundRole(), palette().color(QPalette::Active, QPalette::Base));
- messagePane->setPalette(pal);
-
- connect(this, &KDialog::closeClicked, this, &QWidget::close);
- connect(this, SIGNAL(user1Clicked()), messagePane, SLOT(clear()));
- }
-
- void addMessage(const QString &msg)
- {
- messagePane->append(msg);
- }
-};
-
-using domtreeviewer::ManipulationCommand;
-
-DOMTreeWindow::DOMTreeWindow(PluginDomtreeviewer *plugin)
- : KXmlGuiWindow(nullptr),
- m_plugin(plugin), m_view(new DOMTreeView(this))
-{
- setObjectName(QStringLiteral("DOMTreeWindow"));
- part_manager = nullptr;
-
- // set configuration object
- _config = new KConfig(QStringLiteral("domtreeviewerrc"));
-
- // accept dnd
- setAcceptDrops(true);
-
- // tell the KXmlGuiWindow that this is indeed the main widget
- setCentralWidget(m_view);
-
- // message window dialog
- msgdlg = new MessageDialog(nullptr);
-// msgdlg->show();
-
- // then, setup our actions
- setupActions();
-
- // Add typical actions and save size/toolbars/statusbar
- setupGUI(ToolBar | Keys | StatusBar | Save | Create, KStandardDirs::locate("data", QStringLiteral("domtreeviewer/domtreeviewerui.rc")));
-
- // allow the view to change the statusbar and caption
-#if 0
- connect(m_view, SIGNAL(signalChangeStatusbar(QString)),
- this, SLOT(changeStatusbar(QString)));
- connect(m_view, SIGNAL(signalChangeCaption(QString)),
- this, SLOT(changeCaption(QString)));
-#endif
- connect(view(), SIGNAL(htmlPartChanged(KHTMLPart*)),
- SLOT(slotHtmlPartChanged(KHTMLPart*)));
-
- ManipulationCommand::connect(SIGNAL(error(int,QString)),
- this, SLOT(addMessage(int,QString)));
-
- infopanel_ctx = createInfoPanelAttrContextMenu();
- domtree_ctx = createDOMTreeViewContextMenu();
-
-}
-
-DOMTreeWindow::~DOMTreeWindow()
-{
- kDebug(90180) << this;
- delete m_commandHistory;
- delete msgdlg;
- delete _config;
-}
-
-void DOMTreeWindow::executeAndAddCommand(ManipulationCommand *cmd)
-{
- m_commandHistory->push(cmd); // calls cmd->redo()
- if (!cmd->isValid()) {
- cmd->undo();
- // TODO: ideally, remove the command from m_commandHistory, but I don't see how to do that.
- } else {
- view()->hideMessageLine();
- }
-}
-
-void DOMTreeWindow::setupActions()
-{
- KStandardAction::close(this, SLOT(close()), actionCollection());
-
- KStandardAction::cut(this, &DOMTreeWindow::slotCut, actionCollection())->setEnabled(false);
- KStandardAction::copy(this, &DOMTreeWindow::slotCopy, actionCollection())->setEnabled(false);
- KStandardAction::paste(this, &DOMTreeWindow::slotPaste, actionCollection())->setEnabled(false);
-
- m_commandHistory = new KUndoStack;
-
- QAction *undoAction = m_commandHistory->createUndoAction(actionCollection());
- connect(undoAction, SIGNAL(triggered()), m_commandHistory, SLOT(undo()));
- QAction *redoAction = m_commandHistory->createRedoAction(actionCollection());
- connect(redoAction, SIGNAL(triggered()), m_commandHistory, SLOT(redo()));
-
- KStandardAction::find(this, SLOT(slotFind()), actionCollection());
-
- KStandardAction::redisplay(m_view, SLOT(refresh()), actionCollection());
-
- // Show/hide options
- QAction *pure = actionCollection()->addAction(QStringLiteral("show_dom_pure"));
- pure->setText(i18n("Pure DOM Tree"));
- pure->setCheckable(true);
- pure->setChecked(true);
- connect(pure, SIGNAL(toggled(bool)), m_view, SLOT(slotPureToggled(bool)));
-
- QAction *attr = actionCollection()->addAction(QStringLiteral("show_dom_attributes"));
- attr->setText(i18n("Show DOM Attributes"));
- attr->setCheckable(true);
- attr->setChecked(true);
- connect(attr, SIGNAL(toggled(bool)),
- m_view, SLOT(slotShowAttributesToggled(bool)));
-
- QAction *highlight = actionCollection()->addAction(QStringLiteral("show_highlight_html"));
- highlight->setText(i18n("Highlight HTML"));
- highlight->setCheckable(true);
- highlight->setChecked(true);
- connect(highlight, SIGNAL(toggled(bool)),
- m_view, SLOT(slotHighlightHTMLToggled(bool)));
-
- // toggle manipulation dialog
- QAction *a = actionCollection()->addAction(QStringLiteral("show_msg_dlg"));
- a->setText(i18n("Show Message Log"));
- actionCollection()->setDefaultShortcut(a, Qt::CTRL + Qt::Key_E);
- connect(a, SIGNAL(triggered()), this, SLOT(showMessageLog()));
-
-// KAction *custom = new KAction(i18n("Cus&tom Menuitem"), 0,
-// this, SLOT(optionsPreferences()),
-// actionCollection(), "custom_action");
-
- // actions for the dom tree list view toolbar
- QAction *tree = KStandardAction::up(view(), SLOT(moveToParent()), actionCollection());
- actionCollection()->addAction(QStringLiteral("tree_up"), tree);
- QAction *tree_inc_level = actionCollection()->addAction(QStringLiteral("tree_inc_level"));
- tree_inc_level->setText(i18n("Expand"));
- tree_inc_level->setIcon(QIcon::fromTheme(QStringLiteral("arrow-right")));
- actionCollection()->setDefaultShortcut(tree_inc_level, QKeySequence(Qt::CTRL + Qt::Key_Greater));
- tree_inc_level->setToolTip(i18n("Increase expansion level"));
- connect(tree_inc_level, SIGNAL(triggered()), view(), SLOT(increaseExpansionDepth()));
- QAction *tree_dec_level = actionCollection()->addAction(QStringLiteral("tree_dec_level"));
- tree_dec_level->setText(i18n("Collapse"));
- tree_dec_level->setIcon(QIcon::fromTheme(QStringLiteral("arrow-left")));
- actionCollection()->setDefaultShortcut(tree_dec_level, QKeySequence(Qt::CTRL + Qt::Key_Less));
- tree_dec_level->setToolTip(i18n("Decrease expansion level"));
- connect(tree_dec_level, SIGNAL(triggered()), view(), SLOT(decreaseExpansionDepth()));
-
- // actions for the dom tree list view context menu
-
- del_tree = actionCollection()->addAction(QStringLiteral("tree_delete"));
- del_tree->setText(i18n("&Delete"));
- del_tree->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
- actionCollection()->setDefaultShortcut(del_tree, QKeySequence(Qt::Key_Delete));
- del_tree->setToolTip(i18n("Delete nodes"));
- del_tree->setShortcutContext(Qt::WidgetShortcut);
- view()->m_listView->addAction(del_tree);
- connect(del_tree, SIGNAL(triggered()), view(), SLOT(deleteNodes()));
- QAction *new_elem = actionCollection()->addAction(QStringLiteral("tree_add_element"));
- new_elem->setText(i18n("New &Element..."));
- new_elem->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
- connect(new_elem, SIGNAL(triggered()), view(), SLOT(slotAddElementDlg()));
- QAction *new_text = actionCollection()->addAction(QStringLiteral("tree_add_text"));
- new_text->setText(i18n("New &Text Node..."));
- new_text->setIcon(QIcon::fromTheme(QStringLiteral("draw-text")));
- connect(new_text, SIGNAL(triggered()), view(), SLOT(slotAddTextDlg()));
-
- // actions for the info panel attribute list context menu
- del_attr = actionCollection()->addAction(QStringLiteral("attr_delete"));
- del_attr->setText(i18n("&Delete"));
- del_attr->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
- actionCollection()->setDefaultShortcut(del_attr, QKeySequence(Qt::Key_Delete));
- del_attr->setToolTip(i18n("Delete attributes"));
- del_attr->setShortcutContext(Qt::WidgetShortcut);
- view()->nodeAttributes->addAction(del_attr);
- connect(del_attr, SIGNAL(triggered()), view(), SLOT(deleteAttributes()));
-
-}
-
-QMenu *DOMTreeWindow::createInfoPanelAttrContextMenu()
-{
- QWidget *w = factory()->container(QStringLiteral("infopanelattr_context"), this);
- Q_ASSERT(w);
- return static_cast(w);
-}
-
-QMenu *DOMTreeWindow::createDOMTreeViewContextMenu()
-{
- QWidget *w = factory()->container(QStringLiteral("domtree_context"), this);
- Q_ASSERT(w);
- return static_cast(w);
-}
-
-void DOMTreeWindow::saveProperties(KConfigGroup &config)
-{
- // the 'config' object points to the session managed
- // config file. anything you write here will be available
- // later when this app is restored
-
-#if 0
- if (!m_view->currentURL().isNull()) {
- config.writePathEntry("lastURL", m_view->currentURL());
-#endif
- }
-
- void DOMTreeWindow::readProperties(const KConfigGroup & config) {
- // the 'config' object points to the session managed
- // config file. this function is automatically called whenever
- // the app is being restored. read in here whatever you wrote
- // in 'saveProperties'
-
-#if 0
- QString url = config.readPathEntry("lastURL", QString());
-
- if (!url.isEmpty()) {
- m_view->openUrl(KUrl::fromPathOrUrl(url));
- }
-#endif
- }
-
- void DOMTreeWindow::dragEnterEvent(QDragEnterEvent * event) {
- // accept uri drops only
- event->setAccepted(event->mimeData()->hasUrls());
- }
-
- void DOMTreeWindow::dropEvent(QDropEvent * event) {
- // this is a very simplistic implementation of a drop event. we
- // will only accept a dropped URL. the Qt dnd code can do *much*
- // much more, so please read the docs there
-
- // see if we can decode a URI.. if not, just ignore it
- QList urls = event->mimeData()->urls();
- if (!urls.isEmpty()) {
- // okay, we have a URI.. process it
- const QUrl &url = urls.first();
-#if 0
- // load in the file
- load(url);
-#endif
- }
- }
-
- void DOMTreeWindow::addMessage(int msg_id, const QString & msg) {
- QDateTime t(QDateTime::currentDateTime());
- QString fullmsg = t.toString();
- fullmsg += ':';
-
- if (msg_id != 0) {
- fullmsg += " (" + QString::number(msg_id) + ") ";
- }
- fullmsg += msg;
-
- if (msgdlg) {
- msgdlg->addMessage(fullmsg);
- }
- view()->setMessage(msg);
- kWarning() << fullmsg;
- }
- void DOMTreeWindow::slotCut() {
- // TODO implement
- }
-
- void DOMTreeWindow::slotCopy() {
- // TODO implement
- }
-
- void DOMTreeWindow::slotPaste() {
- // TODO implement
- }
-
- void DOMTreeWindow::slotFind() {
- view()->slotFindClicked();
- }
-
- void DOMTreeWindow::showMessageLog() {
- msgdlg->show();
- msgdlg->raise();
- msgdlg->activateWindow();
- }
-
- void DOMTreeWindow::optionsConfigureToolbars() {
- // use the standard toolbar editor
- KConfigGroup autoSaveGrp = config()->group(autoSaveGroup());
- saveMainWindowSettings(autoSaveGrp);
- KEditToolBar dlg(actionCollection());
- connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(newToolbarConfig()));
- dlg.exec();
- }
-
- void DOMTreeWindow::newToolbarConfig() {
- // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor.
- // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.)
- createGUI(KStandardDirs::locate("data", QStringLiteral("domtreeviewer/domtreeviewerui.rc")));
- applyMainWindowSettings(config()->group(autoSaveGroup()));
- }
-
- void DOMTreeWindow::optionsPreferences() {
-#if 0
- // popup some sort of preference dialog, here
- DOMTreeWindowPreferences dlg;
- if (dlg.exec()) {
- // redo your settings
- }
-#endif
- }
-
- void DOMTreeWindow::changeStatusbar(const QString & text) {
- // display the text on the statusbar
- statusBar()->showMessage(text);
- }
-
- void DOMTreeWindow::changeCaption(const QString & text) {
- // display the text on the caption
- setCaption(text);
- }
-
- void DOMTreeWindow::slotHtmlPartChanged(KHTMLPart * p) {
- kDebug(90180) << p;
-
- if (p) {
- // set up manager connections
- if (part_manager) {
- disconnect(part_manager);
- }
-
- part_manager = p->manager();
-
- connect(part_manager, SIGNAL(activePartChanged(KParts::Part*)),
- SLOT(slotActivePartChanged(KParts::Part*)));
- connect(part_manager, SIGNAL(partRemoved(KParts::Part*)),
- SLOT(slotPartRemoved(KParts::Part*)));
-
- // set up browser extension connections
- connect(p, SIGNAL(docCreated()), SLOT(slotClosePart()));
- }
- }
-
- void DOMTreeWindow::slotActivePartChanged(KParts::Part * p) {
- kDebug(90180) << p;
- if (p == view()->htmlPart()) {
- return;
- }
-
- m_commandHistory->clear();
- view()->disconnectFromTornDownPart();
- view()->setHtmlPart(qobject_cast(p));
- }
-
- void DOMTreeWindow::slotPartRemoved(KParts::Part * p) {
- kDebug(90180) << p;
- if (p != view()->htmlPart()) {
- return;
- }
-
- m_commandHistory->clear();
- view()->disconnectFromTornDownPart();
- view()->setHtmlPart(nullptr);
- }
-
- void DOMTreeWindow::slotClosePart() {
- kDebug(90180);
- view()->disconnectFromTornDownPart();
- view()->connectToPart();
- }
-
diff --git a/plugins/domtreeviewer/elementeditwidget.ui b/plugins/domtreeviewer/elementeditwidget.ui
deleted file mode 100644
--- a/plugins/domtreeviewer/elementeditwidget.ui
+++ /dev/null
@@ -1,100 +0,0 @@
-
- ElementEditWidget
-
-
-
- 0
- 0
- 469
- 58
-
-
-
-
- 0
-
- -
-
-
- 0
-
-
-
-
-
- Element &name:
-
-
- false
-
-
- elemName
-
-
-
- -
-
-
-
-
- -
-
-
- 0
-
-
-
-
-
- Element &namespace:
-
-
- false
-
-
- elemNamespace
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- true
-
-
- false
-
-
- false
-
-
-
-
-
-
-
-
-
-
- KComboBox
- QComboBox
-
-
-
- KLineEdit
- QLineEdit
-
-
-
-
- klineedit.h
- kcombobox.h
- klineedit.h
-
-
-
-
diff --git a/plugins/domtreeviewer/messagedialog.ui b/plugins/domtreeviewer/messagedialog.ui
deleted file mode 100644
--- a/plugins/domtreeviewer/messagedialog.ui
+++ /dev/null
@@ -1,44 +0,0 @@
-
- MessageDialog
-
-
-
- 0
- 0
- 511
- 282
-
-
-
-
- 0
-
- -
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
- KTextEdit
- QTextEdit
-
-
-
-
- ktextedit.h
-
-
-
-
diff --git a/plugins/domtreeviewer/plugin_domtreeviewer.h b/plugins/domtreeviewer/plugin_domtreeviewer.h
deleted file mode 100644
--- a/plugins/domtreeviewer/plugin_domtreeviewer.h
+++ /dev/null
@@ -1,24 +0,0 @@
-
-#ifndef __plugin_domtreeviewer_h
-#define __plugin_domtreeviewer_h
-
-#include
-
-class DOMTreeWindow;
-
-class PluginDomtreeviewer : public KParts::Plugin
-{
- Q_OBJECT
-public:
- PluginDomtreeviewer(QObject *parent,
- const QVariantList &);
- ~PluginDomtreeviewer() override;
-
-public slots:
- void slotShowDOMTree();
- void slotDestroyed();
-private:
- DOMTreeWindow *m_dialog;
-};
-
-#endif
diff --git a/plugins/domtreeviewer/plugin_domtreeviewer.cpp b/plugins/domtreeviewer/plugin_domtreeviewer.cpp
deleted file mode 100644
--- a/plugins/domtreeviewer/plugin_domtreeviewer.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "plugin_domtreeviewer.h"
-#include "domtreewindow.h"
-#include "domtreeview.h"
-
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-//KDELibs4Support
-
-
-K_PLUGIN_FACTORY(DomtreeviewerFactory, registerPlugin();)
-
-PluginDomtreeviewer::PluginDomtreeviewer(QObject *parent,
- const QVariantList &)
- : Plugin(parent), m_dialog(nullptr)
-{
- QAction *a = actionCollection()->addAction(QStringLiteral("viewdomtree"));
-
- a->setText(i18n("Show &DOM Tree"));
- a->setIcon(QIcon::fromTheme(QStringLiteral("view-web-browser-dom-tree")));
- connect(a, SIGNAL(triggered()), this, SLOT(slotShowDOMTree()));
-}
-
-PluginDomtreeviewer::~PluginDomtreeviewer()
-{
- kDebug(90180);
- delete m_dialog;
-}
-
-void PluginDomtreeviewer::slotShowDOMTree()
-{
- if (m_dialog) {
- delete m_dialog;
- Q_ASSERT((DOMTreeWindow *)m_dialog == (DOMTreeWindow *)nullptr);
- }
- if (KHTMLPart *part = qobject_cast(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()
-{
- kDebug(90180);
- m_dialog = nullptr;
-}
-
-#include
diff --git a/plugins/domtreeviewer/plugin_domtreeviewer.desktop b/plugins/domtreeviewer/plugin_domtreeviewer.desktop
deleted file mode 100644
--- a/plugins/domtreeviewer/plugin_domtreeviewer.desktop
+++ /dev/null
@@ -1,137 +0,0 @@
-[Desktop Entry]
-X-KDE-Library=domtreeviewer
-X-KDE-PluginInfo-Author=The Kafka Team, Andreas Schlapbach
-X-KDE-PluginInfo-Email=kde-kafka@master.kde.org, schlpbch@iam.unibe.ch
-X-KDE-PluginInfo-Name=domtreeviewer
-X-KDE-PluginInfo-Version=3.3
-X-KDE-PluginInfo-Website=
-X-KDE-PluginInfo-Category=Tools
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=false
-Name=DOM Tree Viewer
-Name[ar]=عارض شجرة DOM
-Name[ast]=Visor d'árboles DOM
-Name[bg]=Преглед на дървото на DOM
-Name[bs]=Prikazivač DOM stabla
-Name[ca]=Visor d'arbres DOM
-Name[ca@valencia]=Visor d'arbres DOM
-Name[cs]=Prohlížeč DOM stromu
-Name[da]=DOM-træviser
-Name[de]=Ansicht für DOM-Baum
-Name[el]=Προβολέας δέντρου DOM
-Name[en_GB]=DOM Tree Viewer
-Name[es]=Visor del árbol DOM
-Name[et]=DOM-puu näitaja
-Name[eu]=DOM zuhaitz-ikustailea
-Name[fi]=DOM-puunäkymä
-Name[fr]=Afficheur d'arborescence « DOM »
-Name[ga]=Amharcán Crainn DOM
-Name[gl]=Visor da árbore DOM
-Name[he]=מציג עץ DOM
-Name[hne]=डाम ट्री प्रदर्सक
-Name[hr]=Preglednik DOM stabla
-Name[hu]=DOM-fa-megjelenítő
-Name[ia]=Visor de arbore DOM
-Name[id]=Penampil Hierarki DOM
-Name[is]=DOM greinaskoðari
-Name[it]=Visore albero DOM
-Name[ja]=DOM ツリービューア
-Name[kk]=DOM бұтағының көрнісі
-Name[km]=កម្មវិធីមើលមែកធាង DOM
-Name[ko]=DOM 트리 뷰어
-Name[ku]=DOM Nîşanderê Wekî Dar
-Name[lt]=DOM medžio žiūryklė
-Name[lv]=DOM koka rādītājs
-Name[mr]=DOM ट्री प्रदर्शक
-Name[ms]=Pemapar Pepohon DOM
-Name[nb]=DOM trevisning
-Name[nds]=DOM-Boom-Kieker
-Name[nl]=DOM-boomstructuurweergave
-Name[nn]=DOM-trevising
-Name[pa]=DOM ਲੜੀ ਦਰਸ਼ਕ
-Name[pl]=Przeglądarka drzewa DOM
-Name[pt]=Visualizador da Árvore DOM
-Name[pt_BR]=Visualizador de árvore DOM
-Name[ro]=Vizualizor arbore DOM
-Name[ru]=Просмотр дерева DOM
-Name[sk]=Prehliadač DOM stromu
-Name[sl]=Pregledovalnik dreves DOM
-Name[sr]=Приказивач ДОМ стабла
-Name[sr@ijekavian]=Приказивач ДОМ стабла
-Name[sr@ijekavianlatin]=Prikazivač DOM stabla
-Name[sr@latin]=Prikazivač DOM stabla
-Name[sv]=DOM-trädvisning
-Name[tg]=Нишонгари дарахти DOM
-Name[th]=เครื่องมือดูโมเดล DOM ในแบบผังต้นไม้
-Name[tr]=DOM Ağacı Görüntüleyicisi
-Name[ug]=DOM شاخسىمان كۆرگۈچ
-Name[uk]=Перегляд дерева DOM
-Name[wa]=Håyneu d' coxhlaedje DOM
-Name[x-test]=xxDOM Tree Viewerxx
-Name[zh_CN]=DOM 树查看器
-Name[zh_TW]=DOM 樹狀檢視器
-Comment=View the DOM tree of the current page
-Comment[ar]=يعرض شجرة DOM للصفحة الحالية
-Comment[ast]=Visualiza l'árbole DOM de la páxina actual
-Comment[bg]=Преглед на дървото на DOM за текущата страница
-Comment[bs]=Prikazuje DOM stablo trenutne stranice
-Comment[ca]=Visualitza l'arbre DOM de la pàgina actual
-Comment[ca@valencia]=Visualitza l'arbre DOM de la pàgina actual
-Comment[cs]=Prohlédne DOM strom současné stránky
-Comment[da]=Vis DOM-træ af den aktuelle side
-Comment[de]=DOM-Baum der aktuellen Webseite anzeigen
-Comment[el]=Εμφάνιση του δέντρου DOM της τρέχουσας σελίδας
-Comment[en_GB]=View the DOM tree of the current page
-Comment[es]=Ver el árbol DOM de la página actual
-Comment[et]=Näitab aktiivse lehekülje DOM-puud
-Comment[eu]=Ikusi uneko orriaren DOM zuhaitza
-Comment[fi]=Katso sivun DOM-puuta
-Comment[fr]=Affiche l'arborescence « DOM » de la page actuelle
-Comment[ga]=Féach ar chrann DOM an leathanaigh reatha
-Comment[gl]=Mostra a árbore DOM da páxina actual
-Comment[he]=הצג את עץ ה־DOM של הדף הנוכחי
-Comment[hne]=अभी हाल के पेज के डाम ट्री देखव
-Comment[hr]=Pogledaj DOM stablo trenutne stranice
-Comment[hu]=Az aktuális oldal DOM–fájának megjelenítése
-Comment[ia]=Vide le arbore DOM del pagina currente
-Comment[id]=Tampilan hierarki DOM halaman saat ini
-Comment[is]=Skoða DOM uppbyggingu síðunnar
-Comment[it]=Visualizza l'albero DOM della pagina corrente
-Comment[ja]=現在のページの DOM ツリーを表示します
-Comment[kk]=Назардағы беттегі DOM бұтағының көрінісі
-Comment[km]=មើលមែកធាង DOM នៃទំព័របច្ចុប្បន្ន
-Comment[ko]=현재 페이지의 DOM 트리 보기
-Comment[ku]=Rûpela heyî bi DOM dîtina wekî dar bibîne
-Comment[lt]=Parodyti dabartinio puslapio DOM medį
-Comment[lv]=Parāda aktīvās lapas DOM koku
-Comment[mr]=वर्तमान पानाचे DOM ट्री बघा
-Comment[nb]=Vis DOM-treet til gjeldende side
-Comment[nds]=Den DOM-Boom vun de aktuelle Siet ankieken
-Comment[nl]=Bekijk de DOM-structuur van de huidige pagina
-Comment[nn]=Vis DOM-treet til den gjeldande sida
-Comment[pa]=ਮੌਜੂਦਾ ਪੇਜ਼ ਦੀ DOM ਲੜੀ ਵੇਖੋ
-Comment[pl]=Zobacz drzewo DOM dla bieżącej strony
-Comment[pt]=Vê a árvore DOM da página actual
-Comment[pt_BR]=Visualizar a árvore DOM da página atual
-Comment[ro]=Vizualizează arborele DOM al paginii curente
-Comment[ru]=Смотреть дерево DOM текущей страницы
-Comment[sk]=Prezrie DOM strom súčasnej stránky
-Comment[sl]=Oglejte si drevo DOM trenutne spletne strani
-Comment[sr]=Приказује ДОМ стабло тренутне странице
-Comment[sr@ijekavian]=Приказује ДОМ стабло тренутне странице
-Comment[sr@ijekavianlatin]=Prikazuje DOM stablo trenutne stranice
-Comment[sr@latin]=Prikazuje DOM stablo trenutne stranice
-Comment[sv]=Visar DOM-trädet för den aktuella sidan
-Comment[tg]=Намоиши дарахти DOM дар саҳифаи ҷорӣ
-Comment[th]=ดูผังต้นไม้โมเดล DOM ของหน้าเว็บปัจจุบัน
-Comment[tr]=Yürürlükteki sayfanın DOM ağacını göster
-Comment[ug]=نۆۋەتتىكى بەتنىڭ DOM ساخسىمان كۆرۈنۈشى
-Comment[uk]=Переглянути дерево DOM поточної сторінки
-Comment[wa]=Vey li coxhlaedje DOM del pådje do moumint
-Comment[x-test]=xxView the DOM tree of the current pagexx
-Comment[zh_CN]=查看当前页面的 DOM 树
-Comment[zh_TW]=檢視目前頁面的 DOM 樹狀圖
-Icon=view-web-browser-dom-tree
-X-KDE-ParentApp=konqueror
-DocPath=konq-plugins/domtreeviewer/index.html
diff --git a/plugins/domtreeviewer/plugin_domtreeviewer.rc b/plugins/domtreeviewer/plugin_domtreeviewer.rc
deleted file mode 100644
--- a/plugins/domtreeviewer/plugin_domtreeviewer.rc
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-Extra Toolbar
-
-
-
diff --git a/plugins/domtreeviewer/signalreceiver.h b/plugins/domtreeviewer/signalreceiver.h
deleted file mode 100644
--- a/plugins/domtreeviewer/signalreceiver.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This file is part of the KDE project
- *
- * Copyright (C) 2005 Leo Savernik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef KONQ_PLUGIN_SIGNALRECEIVER_H
-#define KONQ_PLUGIN_SIGNALRECEIVER_H
-
-#include
-
-/**
- * \brief Class for receiving signals.
- *
- * This is a convenience class for receiving signals when it is not worth
- * the effort, or overly complicated to introduce a dedicated slot.
- *
- * Use as follows:
- * \code
- * SignalReceiver sr;
- * sr.connect(some_obj, SIGNAL(someSignal()), SLOT(slot()));
- * ...
- * if (sr.receivedSignal()) { // yes, signal was received
- * }
- * \endcode
- *
- * It is not possible to discriminate between different signals. Hence,
- * use different signal receiver instances for different signals.
- * @author Leo Savernik
- */
-class SignalReceiver : public QObject
-{
- Q_OBJECT
-
-public:
- explicit SignalReceiver(QObject *parent = nullptr);
- ~SignalReceiver() override;
-
- /** returns true if any signal has been received */
- bool signalReceived() const
- {
- return rcvd;
- }
-
- /** returns true if any signal has been received */
- bool operator()() const
- {
- return rcvd;
- }
-
-public slots:
- /** connect a signal to this slot to receive it */
- void slot();
-
-private:
- bool rcvd;
-};
-
-#endif // KONQ_PLUGIN_SIGNALRECEIVER_H
diff --git a/plugins/domtreeviewer/signalreceiver.cpp b/plugins/domtreeviewer/signalreceiver.cpp
deleted file mode 100644
--- a/plugins/domtreeviewer/signalreceiver.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of the KDE project
- *
- * Copyright (C) 2005 Leo Savernik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "signalreceiver.h"
-
-SignalReceiver::SignalReceiver(QObject *parent)
- : QObject(parent), rcvd(false)
-{
-}
-
-SignalReceiver::~SignalReceiver()
-{
-}
-
-void SignalReceiver::slot()
-{
- rcvd = true;
-}
-
diff --git a/plugins/domtreeviewer/texteditwidget.ui b/plugins/domtreeviewer/texteditwidget.ui
deleted file mode 100644
--- a/plugins/domtreeviewer/texteditwidget.ui
+++ /dev/null
@@ -1,57 +0,0 @@
-
- TextEditWidget
-
-
-
- 0
- 0
- 469
- 117
-
-
-
-
- 0
-
- -
-
-
- Edit &text for text node:
-
-
- false
-
-
- textPane
-
-
-
- -
-
-
- true
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
- KTextEdit
- QTextEdit
-
-
-
-
- ktextedit.h
-
-
-
-