Konqueror Context Specific Popup Menu

David Faure dfaure at klaralvdalens-datakonsult.se
Wed Sep 17 17:31:28 BST 2003


On Wednesday 17 September 2003 17:56, Sashmit Bhaduri wrote:
> On Wednesday 17 September 2003 11:02 am, David Faure wrote:
> > What about comparing the URL of the view with the URL of what we're
> > clicking upon? I think KonqPopupMenu does this already... Yes, that's the
> > currentDir bool (should be named "click on background", aka the view URL
> > itself, don't mind the "dir" in the name). Or am I missing the purpose
> > here?
> 
> Ahhh.. I was trying to do it with this earlier, and it didn't work. It does 
> now. See the new (much simplier libkonq patch). Back/forward is kept on 
> images. 

The comment implies something about HTML frames..... Did you test your
patch on a site with frames?
I think this is where the heart of the problem is. From a Konqueror point of view
there's no way to distinguish between
* right-click on a frame, so the URL is different from the view's URL (which is the frameset URL)
and 
* right-click on an image, so here as well, the URL is different from the view's URL.

Maybe it's time to actually include hints in the popupMenu signal (the one
in KParts::BrowserExtension), to be able to control what Konqueror should show.
This is the only way KHTMLPart can say "this URL I'm giving you, is for me
a 'view URL', since it's in a frame", or "this URL is an object in the page".
Hard to express in a generic way, to find a good name :}

Given that the popupMenu variant with URLArgs in it is very recent, I suggest
to add an enum to that one, which can include values among
ShowNavigationItems (for up/back/forward)
ShowReload (for reload, currently we only set it over HTTP)

Make sure to then fix the connect() in khtmlimage, let's not repeat errors from the past :)
(the other connect to fix is in KonqView IIRC)

> Also included is fixed khtml patch is to put back image submenu to it's 
> correct place.

Shouldn't d->m_paStopAnimations be set to 0 when the action isn't constructed?
[can you add -p to your diff options, so that it's easier to see which method is being modified?]

Hmm, I see that this isn't done for d->m_paSaveLinkAs and d->m_paCopyLinkLocation either...
Do we never use those member vars?

> Also, do you think that "Add to bookmarks" should be there in the popup menu 
> of non-http pages? People often do bookmark non-http sites in konqueror (ftp 
> sites, network, even local folders etc... ), but I don't think it's used 
> nearly as much as bookmarking http sites. I think it can be summed up by the 
> fact that looking In your bookmark file, how many http sites do you have in 
> relation to non-http sites? 
True. And the feature is still there, only in the menu. I'd be fine with that.
Add ShowAddBookmark in the above enum values?
This will allow to move some of the logic to the right place - i.e. the part
requesting the menu.

> There are already http-specific actions like reload. 
Yeah, that's a hack, see above :)

-- 
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions




More information about the kfm-devel mailing list