signal khtml->world for on screen keyboards

Joseph Wenninger jowenn at kde.org
Sun Aug 10 22:52:21 BST 2003


Hi

Am Son, 2003-08-10 um 15.10 schrieb David Faure:
> On Friday 08 August 2003 16:00, Joseph Wenninger wrote:
....
> 
> The name of the signal is related to what to do with it, which is wrong.
> IMHO it should be named after the reason why (or "time when") it's emitted.
> A name like editableWidgetFocused() or so would be more generic.

It's a littlebit confusing with the internal but public methods
editableWidget(Focused|Blurred)(QWidget *) functions, but the attached
patch uses editableWidget(Focused|Blurred)() now.

> Don't you need a signal from editableWidgetBlurred() as well?

In my case the keyboard is closed with a button on the keyboard itself,
but the attached patch implements he blurred signal too now

Kind regards
Joseph Wenninger
-------------- next part --------------
? khtmlShowOnScreenKeyboardAction.diff
? khtmlShowOnScreenKeyboardAction2.diff
Index: khtml_ext.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_ext.cpp,v
retrieving revision 1.69
diff -u -3 -p -r1.69 khtml_ext.cpp
--- khtml_ext.cpp	25 Jun 2003 22:32:13 -0000	1.69
+++ khtml_ext.cpp	10 Aug 2003 20:13:11 -0000
@@ -81,6 +81,7 @@ void KHTMLPartBrowserExtension::editable
 
         m_connectedToClipboard = true;
     }
+    editableWidgetFocused();
 }
 
 void KHTMLPartBrowserExtension::editableWidgetBlurred( QWidget *widget )
@@ -106,13 +107,20 @@ void KHTMLPartBrowserExtension::editable
 
         m_connectedToClipboard = false;
     }
+    editableWidgetBlurred();
 }
 
 void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *proxy )
 {
     if ( m_extensionProxy )
+    {
         disconnect( m_extensionProxy, SIGNAL( enableAction( const char *, bool ) ),
                     this, SLOT( extensionProxyActionEnabled( const char *, bool ) ) );
+        disconnect( m_extensionProxy, SIGNAL( editableWidgetFocused() ),
+                    this, SLOT( extensionProxyEditableWidgetFocused() ) );
+        disconnect( m_extensionProxy, SIGNAL( editableWidgetBlurred() ),
+                    this, SLOT( extensionProxyEditableWidgetBlurred() ) );
+    }
 
     m_extensionProxy = proxy;
 
@@ -120,6 +128,10 @@ void KHTMLPartBrowserExtension::setExten
     {
         connect( m_extensionProxy, SIGNAL( enableAction( const char *, bool ) ),
                  this, SLOT( extensionProxyActionEnabled( const char *, bool ) ) );
+        connect( m_extensionProxy, SIGNAL( editableWidgetFocused() ),
+                    this, SLOT( extensionProxyEditableWidgetFocused() ) );
+        connect( m_extensionProxy, SIGNAL( editableWidgetBlurred() ),
+                    this, SLOT( extensionProxyeditableWidgetBlurred() ) );
 
         enableAction( "cut", m_extensionProxy->isActionEnabled( "cut" ) );
         enableAction( "copy", m_extensionProxy->isActionEnabled( "copy" ) );
@@ -236,6 +248,14 @@ void KHTMLPartBrowserExtension::updateEd
 
     enableAction( "copy", hasSelection );
     enableAction( "cut", hasSelection );
+}
+
+void KHTMLPartBrowserExtension::extensionProxyEditableWidgetFocused() {
+	editableWidgetFocused();
+}
+
+void KHTMLPartBrowserExtension::extensionProxyEditableWidgetBlurred() {
+	editableWidgetBlurred();
 }
 
 void KHTMLPartBrowserExtension::extensionProxyActionEnabled( const char *action, bool enable )
Index: khtml_ext.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_ext.h,v
retrieving revision 1.21
diff -u -3 -p -r1.21 khtml_ext.h
--- khtml_ext.h	28 Nov 2002 06:49:20 -0000	1.21
+++ khtml_ext.h	10 Aug 2003 20:13:11 -0000
@@ -46,7 +46,12 @@ public slots:
 private slots:
     // connected to a frame's browserextensions enableAction signal
     void extensionProxyActionEnabled( const char *action, bool enable );
+    void extensionProxyEditableWidgetFocused();
+    void extensionProxyEditableWidgetBlurred();
 
+signals:
+    void editableWidgetFocused();
+    void editableWidgetBlurred();
 private:
     void callExtensionProxyMethod( const char *method );
 


More information about the kfm-devel mailing list