Development :  K-Meleon Forum
K-Meleon development related discussions. 
Save As/Save Link As difference (Andrew or devs please read)
Posted by: asmpgmr
Date: February 24, 2003 01:02AM

Bug 297 and to some degree bug 202 are caused by differences in the handling of Save As from Save Link As and Save Image As. In BrowserView.cpp the latter two functions (OnSaveLinkAs and OnSaveImageAs) have simpler code which ultimately call a function URISaveAs. Why can't the function OnFileSaveAs be implemented similarly ? In Netscape 4.x, Mozilla, and Opera, the save as function (Ctrl-S) uses the filename NOT the page title in the save as dialog and the file type is derived from the extension. Currently K-Meleon's Save As functionality is uninituitive and inconsistent with Save Link As and Save Image As, both of which work as expected. As it stands now whenever I want to save a page I either have to go back to get the link to the page or use the global history so I can use Save Link As which is a very inconvenient way of working.

Note I'm an assembly language and C programmer not a C++ programmer so this may not be quite correct but it should be close to what's needed. It's based on the existing OnSaveLinkAs/OnSaveImageAs functions and uses code from OnViewSource to get the current URL into variable currentURI which is passed to URISaveAs. This code is much simpler than what's there now which doesn't work as expected.


void CBrowserView:surprised smileynFileSaveAs()
{

// Try to get the file name part from the URL
// To do that we first construct an obj which supports
// nsIRUI interface. Makes it easy to extract portions
// of a URL like the filename, scheme etc. + We'll also
// use it while saving this link to a file
nsresult rv = NS_OK;
nsCOMPtr<nsIURI> currentURI;
rv = mWebNav->GetCurrentURI(getter_AddRefs(currentURI));
if(NS_FAILED(rv) || !currentURI)
return;

URISaveAs(currentURI);
}

Options: ReplyQuote
Re: Save As/Save Link As difference (Andrew or devs please read)
Posted by: Andrew
Date: February 24, 2003 03:26AM

asmpgmr,

Did you include that in the relevant bugs?

We've been discussing this among the developers to try and work out a method that is consistent and provides the most user-friendly results. Your input on this is appreciated.

Options: ReplyQuote
Re: Save As/Save Link As difference (Andrew or devs please read)
Posted by: asmpgmr
Date: February 24, 2003 03:50AM

Andrew,

I posted it in bug 297. As for it being consistent and user-friendly, the current functionality is neither. Considering that I have to use a workaround and am trying to come up with a way via macros to make Ctrl-S use Save Link As, this is not user-friendly. What would be wrong with implementing it the way I proposed which would be consistent with Save Link As/Save Image As and also consistent with the way Netscape 4.x, Mozilla, and Opera handle it ?

Options: ReplyQuote
Re: Save As/Save Link As difference (Andrew or devs please read)
Posted by: Andrew
Date: February 24, 2003 10:31AM

asmpgmr,

Thanks for including that info. We are working towards the same goal. Your proposal may be the way to resolve this to meet our goals. I just wanted you to know that we have been discussing it.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.