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

List:       kde-core-devel
Subject:    Re: [PATCH] Disable Klipper Actions by Default
From:       Roberto Selbach Teixeira <maragato () conectiva ! com>
Date:       2002-08-22 14:05:14
[Download RAW message or body]

On Wednesday 21 August 2002 17:18, Carsten Pfeiffer wrote:
> On Monday 19 August 2002 16:02, Yenar Calentaure wrote:
>
> Hi,
>
> I'm a bit late for the discussion, but I didn't have any time, earlier.

Me too, but...

> I still think this automatic popup is a nice feature and if such a "Disable
> this Popup" would be available, those people annoyed by it, would find it
> easily.

How about somthing like this patch? It adds a "Disable this Popup" option to 
the menu. Also, just in case someone clicks it by accident, it also tells the 
user where the actions can be reenabled later. This could also be a 'YesNo' 
but I think that would be redundant.

	Roberto.

-- 
maragato@conectiva.com | roberto@kde.org | roberto@teixeira.net
["klipper-actions.diff" (text/x-diff)]

Index: toplevel.cpp
===================================================================
RCS file: /home/kde/kdebase/klipper/toplevel.cpp,v
retrieving revision 1.103
diff -u -3 -p -r1.103 toplevel.cpp
--- toplevel.cpp	2002/08/19 02:13:46	1.103
+++ toplevel.cpp	2002/08/22 14:04:26
@@ -404,6 +404,14 @@ void TopLevel::saveSession()
   }
 }
 
+void TopLevel::disableURLGrabber()
+{
+   KMessageBox:KMessageBox::information( 0L,
+                   i18n( "You can enable URL actions later by right-clicking on the \
+                         Klipper icon and selecting 'Enable Actions'" ) );
+
+   setURLGrabberEnabled( false );
+}
 
 void TopLevel::slotConfigure()
 {
@@ -468,6 +476,8 @@ void TopLevel::slotRepeatAction()
 	myURLGrabber = new URLGrabber( m_config );
 	connect( myURLGrabber, SIGNAL( sigPopup( QPopupMenu * )),
 		 SLOT( showPopupMenu( QPopupMenu * )) );
+	connect( myURLGrabber, SIGNAL( sigDisablePopup() ),
+			this, SLOT( disableURLGrabber() ) );
     }
 
     myURLGrabber->invokeAction( m_lastString );
@@ -494,6 +504,8 @@ void TopLevel::setURLGrabberEnabled( boo
             myURLGrabber = new URLGrabber( m_config );
             connect( myURLGrabber, SIGNAL( sigPopup( QPopupMenu * )),
                      SLOT( showPopupMenu( QPopupMenu * )) );
+	    connect( myURLGrabber, SIGNAL( sigDisablePopup() ),
+                     this, SLOT( disableURLGrabber() ) );
         }
     }
 }
Index: toplevel.h
===================================================================
RCS file: /home/kde/kdebase/klipper/toplevel.h,v
retrieving revision 1.34
diff -u -3 -p -r1.34 toplevel.h
--- toplevel.h	2002/08/09 11:23:57	1.34
+++ toplevel.h	2002/08/22 14:04:26
@@ -82,6 +82,7 @@ protected slots:
     void slotRepeatAction();
     void setURLGrabberEnabled( bool );
     void toggleURLGrabber();
+    void disableURLGrabber();
 
 private slots:
     void newClipData();
Index: urlgrabber.cpp
===================================================================
RCS file: /home/kde/kdebase/klipper/urlgrabber.cpp,v
retrieving revision 1.32
diff -u -3 -p -r1.32 urlgrabber.cpp
--- urlgrabber.cpp	2002/06/29 15:05:20	1.32
+++ urlgrabber.cpp	2002/08/22 14:04:26
@@ -32,6 +32,7 @@
 
 #define URL_EDIT_ITEM 10
 #define DO_NOTHING_ITEM 11
+#define DISABLE_POPUP 12
 
 URLGrabber::URLGrabber( KConfig* config )
  : m_config( config )
@@ -166,6 +167,7 @@ void URLGrabber::actionMenu( bool wm_cla
 
         // add an edit-possibility
         myMenu->insertSeparator();
+        myMenu->insertItem( i18n( "Disable this popup" ), DISABLE_POPUP );
         myMenu->insertSeparator();
         myMenu->insertItem( SmallIcon("edit"), i18n("&Edit Contents..."),
                             URL_EDIT_ITEM );
@@ -190,6 +192,9 @@ void URLGrabber::slotItemSelected( int i
     case URL_EDIT_ITEM:
         editData();
         break;
+    case DISABLE_POPUP:
+	emit sigDisablePopup();
+	break;
     default:
         ClipCommand *command = myCommandMapper.find( id );
         if ( !command )
Index: urlgrabber.h
===================================================================
RCS file: /home/kde/kdebase/klipper/urlgrabber.h,v
retrieving revision 1.13
diff -u -3 -p -r1.13 urlgrabber.h
--- urlgrabber.h	2002/01/24 08:46:13	1.13
+++ urlgrabber.h	2002/08/22 14:04:26
@@ -87,6 +87,7 @@ private slots:
 
 signals:
     void sigPopup( QPopupMenu * );
+    void sigDisablePopup();
 
 };
 


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

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