[Kget] [Bug 96190] ability to close drop target via context menu

Pino Toscano toscano.pino at tiscali.it
Sat Mar 5 18:16:08 CET 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=96190         




------- Additional Comments From toscano.pino tiscali it  2005-03-05 18:16 -------
CVS commit by pino: 

Plugging the Show/Hide Drop Target action to drop target popup menu and to tray icon popup menu.
This should implement wishlist #96190: ability to close drop target via context menu

CCBUGS: 96190


  M +3 -1      docking.cpp   1.29
  M +8 -2      droptarget.cpp   1.26
  M +3 -2      droptarget.h   1.11
  M +1 -1      kmainwidget.cpp   1.116


--- kdenetwork/kget/docking.cpp  #1.28:1.29
 @ -47,4 +47,6  @ DockWidget::DockWidget(KMainWidget * _pa
     // popup menu for right mouse button
     KPopupMenu *popupMenu = contextMenu();
+    parent->action("drop_target")->plug(popupMenu);
+    popupMenu->insertSeparator();
     parent->m_paPreferences->plug(popupMenu);
 

--- kdenetwork/kget/droptarget.cpp  #1.25:1.26
 @ -27,8 +27,10  @
 #include <qpainter.h>
 
+#include <kaction.h>
 #include <kapplication.h>
 #include <kconfig.h>
 #include <kiconloader.h>
 #include <kglobalsettings.h>
+#include <kmainwindow.h>
 #include <kwin.h>
 #include <klocale.h>
 @ -49,5 +51,5  @
 #include "droptarget.h"
 
-DropTarget::DropTarget():QWidget()
+DropTarget::DropTarget(KMainWindow * mainWin):QWidget()
 {
     int x = ksettings.dropPosition.x();
 @ -92,4 +94,8  @ DropTarget::DropTarget():QWidget()
 
     pop_sticky = popupMenu->insertItem(i18n("Sticky"), this, SLOT(toggleSticky()));
+    popupMenu->insertSeparator();
+    mainWin->action("drop_target")->plug(popupMenu);
+    popupMenu->insertSeparator();
+    
     popupMenu->setItemChecked(pop_sticky, b_sticky);
     kmain->m_paPreferences->plug(popupMenu);

--- kdenetwork/kget/droptarget.h  #1.10:1.11
 @ -34,4 +34,5  @
 class KPopupMenu;
 class KMainWidget;
+class KMainWindow;
 
 class DropTarget:public QWidget
 @ -40,5 +41,5  @ Q_OBJECT 
 
 public:
-    DropTarget();
+    DropTarget(KMainWindow *);
     ~DropTarget();
 

--- kdenetwork/kget/kmainwidget.cpp  #1.115:1.116
 @ -210,5 +210,5  @ KMainWidget::KMainWidget(bool bStartDock
 
     // Setup special windows
-    kdrop = new DropTarget();
+    kdrop = new DropTarget(this);
     kdock = new DockWidget(this);
     connect(kdock, SIGNAL(quitSelected()), SLOT(slotQuit()));



More information about the Kget mailing list