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

List:       kde-commits
Subject:    extragear/graphics/gwenview
From:       Aurélien Gâteau <aurelien.gateau () free ! fr>
Date:       2005-07-31 23:04:01
Message-ID: 1122851041.623341.27605.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 441795 by gateau:

When right clicking on files from the folder KPart, show Konqueror popup menu
instead of Gwenview.


 M  +2 -0      NEWS  
 M  +4 -2      gvcore/fileviewstack.h  
 M  +25 -4     gvdirpart/gvdirpart.cpp  


--- trunk/extragear/graphics/gwenview/NEWS #441794:441795
@@ -11,6 +11,8 @@
 - Fixes:
  - In the thumbnail view, make sure we always show folder and archive
    filenames, even if the filename is not shown for images.
+ - When right clicking on files from the folder KPart, show Konqueror popup
+   menu instead of Gwenview.
 
 2005.07.17 - v1.2.91
 - New features:
--- trunk/extragear/graphics/gwenview/gvcore/fileviewstack.h #441794:441795
@@ -175,6 +175,8 @@
 	void shownFileItemRefreshed(const KFileItem*);
 	void sortingChanged();
 
+protected slots:
+	virtual void openContextMenu(const QPoint& pos);
 
 private slots:
 	void delayedDirListerCompleted();
@@ -187,8 +189,8 @@
 
 	void slotViewDoubleClicked();
 	
-	// Context menu
-	void openContextMenu(const QPoint& pos);
+	// These two methods forward the context menu requests from either view to
+	// openContextMenu(const QPoint&);
 	void openContextMenu(KListView*, QListViewItem*, const QPoint&);
 	void openContextMenu(QIconViewItem*,const QPoint&);
 
--- trunk/extragear/graphics/gwenview/gvdirpart/gvdirpart.cpp #441794:441795
@@ -59,9 +59,9 @@
 const char CONFIG_VIEW_GROUP[]="GwenviewPart View";
 
 
-class GVDirPartView : public ImageView {
+class GVDirPartImageView : public ImageView {
 public:
-	GVDirPartView(QWidget* parent, Document* document, KActionCollection* \
actionCollection, GVDirPartBrowserExtension* browserExtension) \
+	GVDirPartImageView(QWidget* parent, Document* document, KActionCollection* \
actionCollection, GVDirPartBrowserExtension* browserExtension)  : ImageView(parent, \
document, actionCollection), mBrowserExtension(browserExtension)  {}
 
@@ -75,6 +75,27 @@
 };
 
 
+class GVDirPartFileView : public FileViewStack {
+public:
+	GVDirPartFileView(QWidget* parent, KActionCollection* actionCollection, \
GVDirPartBrowserExtension* browserExtension) +	: FileViewStack(parent, \
actionCollection) +	, mBrowserExtension(browserExtension) {}
+
+protected:
+	virtual void openContextMenu(const QPoint& pos) {
+		const KFileItemList* items=currentFileView()->selectedItems();
+		if (items->count()==0) {
+			emit mBrowserExtension->popupMenu(pos, dirURL(), 0);
+		} else {
+			emit mBrowserExtension->popupMenu(pos, *items);
+		}
+	}
+
+private:
+	GVDirPartBrowserExtension* mBrowserExtension;
+};
+
+
 //Factory Code
 typedef KParts::GenericFactory<GVDirPart> GVDirFactory;
 K_EXPORT_COMPONENT_FACTORY( libgvdirpart /*library name*/, GVDirFactory )
@@ -93,8 +114,8 @@
 
 	// Create the widgets
 	mDocument = new Document(this);
-	mFilesView = new FileViewStack(mSplitter, actionCollection());
-	mImageView = new GVDirPartView(mSplitter, mDocument, actionCollection(), \
mBrowserExtension); +	mFilesView = new GVDirPartFileView(mSplitter, \
actionCollection(), mBrowserExtension); +	mImageView = new \
GVDirPartImageView(mSplitter, mDocument, actionCollection(), mBrowserExtension);  
 	mSlideShow = new SlideShow(mDocument);
 


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

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