Bug 96190 - ability to close drop target via context menu
Summary: ability to close drop target via context menu
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-02 23:56 UTC by _
Modified: 2005-03-05 18:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ 2005-01-02 23:56:44 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Linux

The ability to close the drop target via the drop target's context menu would be helpful.
Comment 1 Pino Toscano 2005-03-05 18:16:06 UTC
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()));


Comment 2 Pino Toscano 2005-03-05 18:30:26 UTC
CVS commit by pino: 

Backporting the implementation of wishlist #96190: ability to close drop target via context menu
I can close it, now.

BUGS: 96190


  M +3 -1      docking.cpp   1.27.2.2
  M +8 -2      droptarget.cpp   1.25.2.1
  M +3 -2      droptarget.h   1.10.8.1
  M +1 -1      kmainwidget.cpp   1.114.2.1


--- kdenetwork/kget/docking.cpp  #1.27.2.1:1.27.2.2
@@ -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.25.2.1
@@ -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.10.8.1
@@ -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.114:1.114.2.1
@@ -208,5 +208,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()));