[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/base/konq-plugins/domtreeviewer
From:       Pino Toscano <pino () kde ! org>
Date:       2008-02-29 14:22:09
Message-ID: 1204294929.596752.23536.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 780590 by pino:

Make the ElementEditDialog more KDE-ish (use KDialog and its standard buttons, etc).


 M  +1 -1      CMakeLists.txt  
 M  +19 -9     domtreeview.cpp  
 M  +0 -8      domtreeview.h  
 D             elementeditdialog.ui  
 A             elementeditwidget.ui   elementeditdialog.ui#780586


--- trunk/extragear/base/konq-plugins/domtreeviewer/CMakeLists.txt #780589:780590
@@ -12,7 +12,7 @@
    domtreecommands.cpp 
    signalreceiver.cpp )
 
-kde4_add_ui_files(domtreeviewerplugin_PART_SRCS domtreeviewbase.ui texteditwidget.ui \
elementeditdialog.ui attributeeditwidget.ui messagedialog.ui) \
+kde4_add_ui_files(domtreeviewerplugin_PART_SRCS domtreeviewbase.ui texteditwidget.ui \
elementeditwidget.ui attributeeditwidget.ui messagedialog.ui)  
 kde4_add_plugin(domtreeviewerplugin WITH_PREFIX ${domtreeviewerplugin_PART_SRCS})
 
--- trunk/extragear/base/konq-plugins/domtreeviewer/domtreeview.cpp #780589:780590
@@ -21,6 +21,7 @@
 
 #include "signalreceiver.h"
 #include "ui_attributeeditwidget.h"
+#include "ui_elementeditwidget.h"
 #include "ui_texteditwidget.h"
 
 #include <assert.h>
@@ -60,17 +61,26 @@
 
 using namespace domtreeviewer;
 
-ElementEditDialog::ElementEditDialog( QWidget *parent )
-: QDialog( parent )
+class ElementEditDialog : public KDialog, public Ui::ElementEditWidget
 {
-    setupUi( this );
-    connect(insChildBtn, SIGNAL(clicked()), this, SLOT(accept()));
-    connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
-    connect(elemName, SIGNAL(returnPressed()), this, SLOT(accept()));
-    connect(insBeforeBtn, SIGNAL(clicked()), this, SLOT(accept()));
-}
+public:
+    ElementEditDialog(QWidget *parent)
+        : KDialog(parent)
+    {
+        setupUi(mainWidget());
 
+        setWindowTitle(i18n("Edit Element"));
+        setButtons(User1 | User2 | Cancel);
+        setButtonText(User1, i18n("&Append as Child"));
+        setButtonText(User2, i18n("Insert &Before Current"));
 
+        connect(this, SIGNAL(cancelClicked()), this, SLOT(reject()));
+        connect(this, SIGNAL(user1Clicked()), this, SLOT(accept()));
+        connect(this, SIGNAL(user2Clicked()), this, SLOT(accept()));
+    }
+};
+
+
 class TextEditDialog : public KDialog, public Ui::TextEditWidget
 {
 public:
@@ -912,7 +922,7 @@
   {
     ElementEditDialog dlg(this);
     dlg.setModal(true);
-    connect(dlg.insBeforeBtn, SIGNAL(clicked()), &addBefore, SLOT(slot()));
+    connect(dlg.button(KDialog::User2), SIGNAL(clicked()), &addBefore, \
SLOT(slot()));  
     // ### activate when namespaces are supported
     dlg.elemNamespace->setEnabled(false);
--- trunk/extragear/base/konq-plugins/domtreeviewer/domtreeview.h #780589:780590
@@ -24,7 +24,6 @@
 #include <dom/dom_node.h>
 
 #include "ui_domtreeviewbase.h"
-#include "ui_elementeditdialog.h"
 
 namespace DOM {
   class Element;
@@ -40,13 +39,6 @@
 class KFindDialog;
 class KHTMLPart;
 
-class ElementEditDialog : public QDialog, public Ui::ElementEditDialog
-{
-public:
-  ElementEditDialog( QWidget *parent );
-};
-
-
 class DOMTreeViewBase : public QWidget, public Ui::DOMTreeViewBase
 {
 public:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic