General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Pages: Previous1234
Current Page: 4 of 4
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 16, 2003 03:08PM

In Mozilla this is exclusively a URL bar feature:
http://www.mozilla.org/docs/end-user/keywords.html

Having it be global affects stuff that doesn't need and shouldn't have nickname lookup - history URLs now go through this, bookmark/favorites/hotlist URLs (from the menu or editor) now go through this, URL strings in the code now go through this. My nickname lookup implementation is correct and my proposed implementation for the go button does what it should do, process the URL the same as if enter was pressed. My implementation also matches Ulf's proposal which he posted to the mailing list as a macro. His macro which uses pluginmsgex to call findnick and gsub to handle the %s substitution can be used for any other needs though I really don't see what else would be needed. Maybe such a macro should be added to the default macros.cfg (along with some other useful macros) but global changes should not be made to the code.

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 16, 2003 03:32PM

Here's Ulf's macro, I think sub should be used instead of gsub since only one %s is handled by Mozilla. Also favorites currently doesn't have findnick support.

$input = "";
$fullpage = "";

parse_input {
$i = index($input, " ");
$nick = ($i != -1 ? substr($input, 0, $i) : $input);
$param = ($i != -1 ? substr($input, $i+1) : "");

$page = "";
$page == "" ? ($page = pluginmsgex( "bookmarks", "FindNick", $nick, STRING )) : 0;
$page == "" ? ($page = pluginmsgex( "favorites", "FindNick", $nick, STRING )) : 0;
$page == "" ? ($page = pluginmsgex( "hotlist", "FindNick", $nick, STRING )) : 0;

$fullpage = ($page == "" ? $input : gsub( "%s", $param, $page ));
}

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 12:20AM

asmpgmr:

OK, here is what I have now:

BrowserView.cpp:
-------------------------
void CBrowserView::OnNewUrlEnteredInUrlBar()
{
char *p, *q, *r;
char nickUrl[INTERNET_MAX_URL_LENGTH];
char custUrl[INTERNET_MAX_URL_LENGTH];

nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
if(!focus) return;

focus->Activate();

mpBrowserFrame->m_wndUrlBar.EditChanged(FALSE);

// Get the currently entered URL
CString strUrl;
mpBrowserFrame->m_wndUrlBar.GetEnteredURL(strUrl);

// Add what was just entered into the MRU list
mpBrowserFrame->m_wndUrlBar.AddURLToList(strUrl);

if(IsViewSourceUrl(strUrl)) {
OpenViewSourceWindow(strUrl.GetBuffer(0));
return;
}

else {
// Check for a nickname
*nickUrl = 0;
p = strUrl.GetBuffer(0); // get entered URL
p = SkipWhiteSpace(p); // skip any leading spaces
q = strchr(p, ' '); // look for a space

if (q) // if more than one word
*q = 0; // terminate first word

theApp.plugins.SendMessage("bookmarks", "* FindNick", "FindNick", (long)p, (long)&nickUrl);

if (q) // if more than one word
*q = ' '; // restore space

if (*nickUrl != 0) {
r = strstr(nickUrl, "%s"); // look for %s
if (r) { // if found
*r = 0; // terminate string up to %s
strcpy(custUrl, nickUrl); // copy string before %s
if (q) // if more than one word
strcat(custUrl, q+1); // copy second word
strcat(custUrl, r+2); // copy string after %s
strUrl = custUrl;
}
else
strUrl = nickUrl;
}
else {
theApp.plugins.SendMessage("hotlist", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (*nickUrl != 0)
strUrl = nickUrl;
}

// Navigate to that URL
OpenURL(strUrl.GetBuffer(0));
}
}


// ...

void CBrowserView::OnFileOpen()
{
char *lpszFilter =
"HTML Files Only (*.htm;*.html)|*.htm;*.html|"
"All Files (*.*)|*.*||";

CFileDialog cf(TRUE, NULL, NULL, OFN_NOVALIDATE | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, lpszFilter, this);
cf.m_ofn.lpstrTitle = "Select a file or type in a URL";

if(cf.DoModal() == IDOK) {
CString strFullPath = cf.GetPathName(); // Will be like: c:\tmp\junk.htm

FILE *test = fopen(strFullPath, "r");

if (!test) {
// if the file doesn't exist, they probably typed a url...
// so chop off the path (for some reason GetFileName doesn't work for us...
strFullPath = strFullPath.Mid(strFullPath.ReverseFind('\\')+1);

// for nicks and quicksearches mpBrowserFrame->m_wndUrlBar.SetWindowText(strFullPath.GetBuffer(0));
OnNewUrlEnteredInUrlBar();
return;
}
else
fclose(test);

OpenURL(strFullPath);
}
}


Now Ctrl-O is consistant, but its not running through the nick / quicksearch code for every single url.

Then in Plugins.cpp:
-----------------------------
char* EvalURL(char* pURLNick)
{
char *p, *q, *r;
char nickUrl[INTERNET_MAX_URL_LENGTH];
char custUrl[INTERNET_MAX_URL_LENGTH];

// Get the currently entered Nick / URL
CString strUrl;
strUrl = pURLNick;

// Check for a nickname
*nickUrl = 0;
p = strUrl.GetBuffer(0); // get entered Nick / URL
p = SkipWhiteSpace(p); // skip any leading spaces
q = strchr(p, ' '); // look for a space

if (q) // if more than one word
*q = 0; // terminate first word

theApp.plugins.SendMessage("bookmarks", "* FindNick", "FindNick", (long)p, (long)&nickUrl);

if (q) // if more than one word
*q = ' '; // restore space

if (*nickUrl != 0) {
r = strstr(nickUrl, "%s"); // look for %s
if (r) { // if found
*r = 0; // terminate string up to %s
strcpy(custUrl, nickUrl); // copy string before %s
if (q) // if more than one word
strcat(custUrl, q+1); // copy second word
strcat(custUrl, r+2); // copy string after %s
strUrl = custUrl;
}
else
strUrl = nickUrl;
}
else {
theApp.plugins.SendMessage("hotlist", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (*nickUrl != 0)
strUrl = nickUrl;
}
// Return that URL
return (char*)strUrl.GetBuffer(0);
}


Then in macros\macros.cpp:
-----------------------------------------
CMD(nick) {
if (nparam != 1) { // nick( $0 )
parseError(WRONGARGS, "nick", data, 1, nparam);
return "";
}
char* theURL;
theURL = kFuncs->EvalURL((char*)params[0].c_str());
std::string retval;

if(theURL) {
retval = protectString( theURL );
return retval;
}
else
retval = protectString( (char*)params[0].c_str() );
return retval;
}


Thus, the macros can use nicks & quicksearch without a big macro that most people don't understand. What was before,

open_new{
$loc = prompt("URL:", "Open New Window", "");
$loc == "" ? 0 : opennew($loc);
}

Can now be:

open_new{
$nick = prompt("URL:", "Open New Window", "");
$nick == "" ? 0 : $loc = nick($nick);
$loc == "" ? 0 : opennew($loc);
}


Sound good?


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 12:28AM

Actually in macros.cpp it should be:

CMD(nick) {
if (nparam != 1) { // nick( $0 )
parseError(WRONGARGS, "nick", data, 1, nparam);
return "";
}
char* theURL;
theURL = kFuncs->EvalURL((char*)params[0].c_str());
std::string retval;
retval = protectString( theURL );
return retval;
}

EvalURL is returning what was passed if it is not a nick, so there is no need for the if...else.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 17, 2003 12:49AM

MonkeeSage,

The order of the OnNewUrlEnteredInUrlBar code isn't the same as it was.

I forgot the Ctrl-O thing was there since most people don't use it. I agree with you that it should be consistent with the URL bar but I don't think the OnFileOpen code should modify what's in the URL bar. I could make the nickname lookup code a subroutine.

I still think the ID_PROCESS_URL command would be useful for people like jsnj who use the mouse more than the keyboard and want a go button.

I definitely don't think an extra copy of the routine should be added to Plugins.cpp when it can already be done with macros. Some variant of Ulf's routine should be added to the default macros.cfg for anyone to call. Why have the macro language if stuff is going to be duplicated in the main program ? I'm against having multiple copies of the same code unless there's a performance reason for it.

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 17, 2003 02:27AM

This should do it, I made the nickname code a subroutine OpenUrlWithNicknameLookup which takes a CString and returns void, call it in OnNewUrlEnteredInUrlBar and in OnFileOpen (instead of OpenURL)


void CBrowserView::OpenUrlWithNicknameLookup(CString strUrl)
{
char *p, *q, *r;
char nickUrl[INTERNET_MAX_URL_LENGTH];
char custUrl[INTERNET_MAX_URL_LENGTH];

// Check for a nickname
*nickUrl = 0;
p = strUrl.GetBuffer(0); // get entered URL
p = SkipWhiteSpace(p); // skip any leading spaces
q = strchr(p, ' '); // look for a space

// look for bookmarks nickname
if (q) // if more than one word
*q = 0; // terminate first word
theApp.plugins.SendMessage("bookmarks", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (q) // if more than one word
*q = ' '; // restore space
if (*nickUrl != 0) { // if nickname found
r = strstr(nickUrl, "%s"); // look for %s
if (r) { // if %s found
*r = 0; // terminate string up to %s
strcpy(custUrl, nickUrl); // copy string before %s
if (q) // if more than one word
strcat(custUrl, q+1); // copy second word
strcat(custUrl, r+2); // copy string after %s
OpenURL(custUrl); // open custom URL with substitution
}
else // no %s
OpenURL(nickUrl); // open custom URL
}
else {
// look for favorites nickname
// if (q) // if more than one word
// *q = 0; // terminate first word
// theApp.plugins.SendMessage("favorites", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
// if (q) // if more than one word
// *q = ' '; // restore space
// if (*nickUrl != 0) { // if nickname found
// r = strstr(nickUrl, "%s"); // look for %s
// if (r) { // if %s found
// *r = 0; // terminate string up to %s
// strcpy(custUrl, nickUrl); // copy string before %s
// if (q) // if more than one word
// strcat(custUrl, q+1); // copy second word
// strcat(custUrl, r+2); // copy string after %s
// OpenURL(custUrl); // open custom URL with substitution
// }
// else // no %s
// OpenURL(nickUrl); // open custom URL
// }
// else {
// look for hotlist nickname (no %s support)
if (q) // if more than one word
*q = 0; // terminate first word
theApp.plugins.SendMessage("hotlist", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (q) // if more than one word
*q = ' '; // restore space
if (*nickUrl != 0) // if nickname found
OpenURL(nickUrl); // open custom URL
else {
// no nickname, normal URL or view-source
if(IsViewSourceUrl(strUrl))
OpenViewSourceWindow(strUrl.GetBuffer(0));
else
// Navigate to that URL
OpenURL(strUrl.GetBuffer(0));
}
// }
}
}

void CBrowserView::OnNewUrlEnteredInUrlBar()
{
mpBrowserFrame->m_wndUrlBar.EditChanged(FALSE);

nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
if(focus)
focus->Activate();

// Get the currently entered URL
CString strUrl;
mpBrowserFrame->m_wndUrlBar.GetEnteredURL(strUrl);

OpenUrlWithNicknameLookup(strUrl);

// Add what was just entered into the UrlBar
mpBrowserFrame->m_wndUrlBar.AddURLToList(strUrl);
}

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 03:42AM

asmpgmr:

One more revision and I think everyone is happy.

BrowserView.cpp:
[See notes 1 & 2]
-------------------------
void CBrowserView::OnNewUrlEnteredInUrlBar()
{
nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
if(!focus) return;

focus->Activate();

mpBrowserFrame->m_wndUrlBar.EditChanged(FALSE);

// Get the currently entered URL
CString strUrl;
mpBrowserFrame->m_wndUrlBar.GetEnteredURL(strUrl);

// Add what was just entered into the UrlBar
mpBrowserFrame->m_wndUrlBar.AddURLToList(strUrl);

if(IsViewSourceUrl(strUrl)) {
OpenViewSourceWindow(strUrl.GetBuffer(0));
return;
}
else {
strUrl = NicknameLookup((char*)strUrl.GetBuffer(0));

// Navigate to that URL
OpenURL(strUrl.GetBuffer(0));
}
}

// ...

char* CBrowserView::NicknameLookup(char* pUrl)
{
char *p, *q, *r;
char nickUrl[INTERNET_MAX_URL_LENGTH];
char custUrl[INTERNET_MAX_URL_LENGTH];

CString strUrl;
strUrl = pUrl;

// Check for a nickname
*nickUrl = 0;
p = strUrl.GetBuffer(0); // get entered URL
p = SkipWhiteSpace(p); // skip any leading spaces
q = strchr(p, ' '); // look for a space

if (q) // if more than one word
*q = 0; // terminate first word

theApp.plugins.SendMessage("bookmarks", "* FindNick", "FindNick", (long)p, (long)&nickUrl);

if (q) // if more than one word
*q = ' '; // restore space

if (*nickUrl != 0) {
r = strstr(nickUrl, "%s"); // look for %s
if (r) { // if found
*r = 0; // terminate string up to %s
strcpy(custUrl, nickUrl); // copy string before %s
if (q) // if more than one word
strcat(custUrl, q+1); // copy second word
strcat(custUrl, r+2); // copy string after %s
strUrl = custUrl;
}
else
strUrl = nickUrl;
}
else {
theApp.plugins.SendMessage("hotlist", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (*nickUrl != 0)
strUrl = nickUrl;
}

return (char*)strUrl.GetBuffer(0);
}

// ...

void CBrowserView::OnFileOpen()
{
char *lpszFilter =
"HTML Files Only (*.htm;*.html)|*.htm;*.html|"
"All Files (*.*)|*.*||";

CFileDialog cf(TRUE, NULL, NULL, OFN_NOVALIDATE | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, lpszFilter, this);
cf.m_ofn.lpstrTitle = "Select a file or type in a URL";

if(cf.DoModal() == IDOK) {
CString strFullPath = cf.GetPathName(); // Will be like: c:\tmp\junk.htm

FILE *test = fopen(strFullPath, "r");

if (!test) {
// if the file doesn't exist, they probably typed a url...
// so chop off the path (for some reason GetFileName doesn't work for us...
strFullPath = strFullPath.Mid(strFullPath.ReverseFind('\\')+1);
strFullPath = NicknameLookup((char*)strFullPath.GetBuffer(0));
}
else
fclose(test);

OpenURL(strFullPath);
}
}


BrowserView.h:
[See note 3]
---------------------
char* CBrowserView::NicknameLookup(char* pUrl);


Plugins.cpp:
-----------------
char* EvalURL(char* pURLNick)
{
CBrowserFrame *mainFrame;
mainFrame = theApp.m_pMostRecentBrowserFrame;
pURLNick = mainFrame->m_wndBrowserView.NicknameLookup(pURLNick);

// Return that URL
return pURLNick;
}


Notes:
---------
1. In OnNewUrlEnteredInUrlBar, we have to add what was entered first, beause of setting strUrl in:

strUrl = NicknameLookup((char*)strUrl.GetBuffer(0));

Otherwise we'll add the return of NicknameLookup, not what was entered.

2. Made NicknameLookup return only once at the end of the function. If ther was no nick / quicksearch found then it returns what was passed to it (e.g., a regular url).

3. Declare it with full scope (CBrowserView:smiling smiley, to allow for access from kmeleonFunctions (Plugins.cpp, EvalURL).


Only one instance of the lookup code, accessable from Ctrl-O, Url bar & via macro. Seems like everyone gets to have their cake and eat it too unless I'm missing something. smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 04:04AM

Actually...

char* CBrowserView::NicknameLookup(char* pUrl)
{
char *p, *q, *r;
char nickUrl[INTERNET_MAX_URL_LENGTH];
char custUrl[INTERNET_MAX_URL_LENGTH];

// Check for a nickname
*nickUrl = 0;
p = pUrl; // get entered URL
p = SkipWhiteSpace(p); // skip any leading spaces
q = strchr(p, ' '); // look for a space

if (q) // if more than one word
*q = 0; // terminate first word

theApp.plugins.SendMessage("bookmarks", "* FindNick", "FindNick", (long)p, (long)&nickUrl);

if (q) // if more than one word
*q = ' '; // restore space

if (*nickUrl != 0) {
r = strstr(nickUrl, "%s"); // look for %s
if (r) { // if found
*r = 0; // terminate string up to %s
strcpy(custUrl, nickUrl); // copy string before %s
if (q) // if more than one word
strcat(custUrl, q+1); // copy second word
strcat(custUrl, r+2); // copy string after %s
pUrl = custUrl;
}
else
pUrl = nickUrl;
}
else {
theApp.plugins.SendMessage("hotlist", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (*nickUrl != 0)
pUrl = nickUrl;
}

return pUrl;
}


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 05:07AM

jsnj:

Ps. Your macro now is:

go_button {
$oldclip = getclipboard();
id(ID_SELECT_URL);
id(ID_EDIT_COPY);
$theurl = getclipboard();
setclipboard($oldclip);
$loc = nick($theurl);
open($loc);
}


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 05:17AM

All builds are updated.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: jsnj
Date: April 17, 2003 09:24AM

I can no longer edit macros.cfg through K-Meleon's preferences-configs. The other files I can. I usually don't try to since I edit from a macro that brings up the actual files through metapad so I don't know how long this has been the case. I'm wondering if it's something weird going on in my settings or if you also can't edit the macros file through KM.

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 17, 2003 02:15PM

I don't have any problems editing macros.cfg but then I'm not using a build with any of these changes. For crying out loud please put everything back to the way it was, everything was working. The plugins change is absolutely NOT needed, this can already be done with macros, why reinvent the wheel ???? This is exactly why I don't like making changes for every little request, it leads to bloat which ultimately leads to bugs.

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 17, 2003 04:19PM

Try these changes out and if there are no bugs or other issues then please no more changes, additions, or deletions to this code. These changes should satisfy both allowing file open to use nickname lookup and the go button to use it as well with minimum impact on the code.


Part 1 - Allow file open (Ctrl-O) dialog to use nickname lookup

BrowserView.cpp
---------------

void CBrowserView::OpenUrlWithNicknameLookup(CString strUrl)
{
char *p, *q, *r;
char nickUrl[INTERNET_MAX_URL_LENGTH];
char custUrl[INTERNET_MAX_URL_LENGTH];

// Check for a nickname
*nickUrl = 0;
p = strUrl.GetBuffer(0); // get entered URL
p = SkipWhiteSpace(p); // skip any leading spaces
q = strchr(p, ' '); // look for a space

// look for bookmarks nickname
if (q) // if more than one word
*q = 0; // terminate first word
theApp.plugins.SendMessage("bookmarks", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (q) // if more than one word
*q = ' '; // restore space
if (*nickUrl != 0) { // if nickname found
r = strstr(nickUrl, "%s"); // look for %s
if (r) { // if %s found
*r = 0; // terminate string up to %s
strcpy(custUrl, nickUrl); // copy string before %s
if (q) // if more than one word
strcat(custUrl, q+1); // copy second word
strcat(custUrl, r+2); // copy string after %s
OpenURL(custUrl); // open custom URL with substitution
}
else // no %s
OpenURL(nickUrl); // open custom URL
}
else {
// look for favorites nickname
// if (q) // if more than one word
// *q = 0; // terminate first word
// theApp.plugins.SendMessage("favorites", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
// if (q) // if more than one word
// *q = ' '; // restore space
// if (*nickUrl != 0) { // if nickname found
// r = strstr(nickUrl, "%s"); // look for %s
// if (r) { // if %s found
// *r = 0; // terminate string up to %s
// strcpy(custUrl, nickUrl); // copy string before %s
// if (q) // if more than one word
// strcat(custUrl, q+1); // copy second word
// strcat(custUrl, r+2); // copy string after %s
// OpenURL(custUrl); // open custom URL with substitution
// }
// else // no %s
// OpenURL(nickUrl); // open custom URL
// }
// else {
// look for hotlist nickname (no %s support)
if (q) // if more than one word
*q = 0; // terminate first word
theApp.plugins.SendMessage("hotlist", "* FindNick", "FindNick", (long)p, (long)&nickUrl);
if (q) // if more than one word
*q = ' '; // restore space
if (*nickUrl != 0) // if nickname found
OpenURL(nickUrl); // open custom URL
else {
// no nickname, normal URL or view-source
if(IsViewSourceUrl(strUrl))
OpenViewSourceWindow(strUrl.GetBuffer(0));
else
// Navigate to that URL
OpenURL(strUrl.GetBuffer(0));
}
// }
}
}


void CBrowserView::OnNewUrlEnteredInUrlBar()
{
mpBrowserFrame->m_wndUrlBar.EditChanged(FALSE);

nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
if(focus)
focus->Activate();

// Get the currently entered URL
CString strUrl;
mpBrowserFrame->m_wndUrlBar.GetEnteredURL(strUrl);

OpenUrlWithNicknameLookup(strUrl);

// Add what was just entered into the UrlBar
mpBrowserFrame->m_wndUrlBar.AddURLToList(strUrl);
}


void CBrowserView::OnFileOpen()
{
char *lpszFilter =
"HTML Files Only (*.htm;*.html)|*.htm;*.html|"
"All Files (*.*)|*.*||";

CFileDialog cf(TRUE, NULL, NULL, OFN_NOVALIDATE | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, lpszFilter, this);
cf.m_ofn.lpstrTitle = "Select a file or type in a URL";

if(cf.DoModal() == IDOK) {
CString strFullPath = cf.GetPathName(); // Will be like: c:\tmp\junk.htm

FILE *test = fopen(strFullPath, "r");

if (!test) {
// if the file doesn't exist, they probably typed a url...
// so chop off the path (for some reason GetFileName doesn't work for us...
strFullPath = strFullPath.Mid(strFullPath.ReverseFind('\\')+1);
}
else {
fclose(test);
}
OpenUrlWithNicknameLookup(strFullPath);
}
}


Part 2 - Add ID_PROCESS_URL command for toolbar go button

BrowserView.cpp
---------------

ON_COMMAND(ID_PROCESS_URL, OnNewUrlEnteredInUrlBar)


defineMap.cpp
-------------

DEFINEMAP_ADD(ID_PROCESS_URL)


resource.h
----------

#define ID_PROCESS_URL 32820

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: jsnj
Date: April 17, 2003 05:01PM

It's just something weird with my settings. I just tried the sp1 exe and got the same thing.

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 07:23PM

asmpgmr:

For crying out loud please put everything back to the way it was, everything was working.

Everything is working.


The plugins change is absolutely NOT needed, this can already be done with macros, why reinvent the wheel ????

Well the open, opennew and and openbg commands are also not needed, since you can do the same with messages to the layers plugin. Come to think of it, prompt is not needed either, you can just go edit the macro by hand each time instead using a prompt. Actually, the whole macros aren't needed since you can do everything in CPP and just recompile any time there is a change. But should I get rid of the whole macros plugin? No. The point of macros is to give the end user easy access to some of more useful CPP commands, and in keeping with that ideal, I have given them access to nickname lookups and quicksearches.


This is exactly why I don't like making changes for every little request, it leads to bloat which ultimately leads to bugs.

Show me either one (bloat or bugs) and I'll fix them. With the last code I posted there is no bloat or bugs that I'm aware of.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: asmpgmr
Date: April 17, 2003 08:43PM

I'm not posting code changes to have them altered for the purpose of making things "easier to use". My goal is to fix bugs, add new browser functionality, clean stuff up, and make existing features work consistently, NOT helping end users with stuff they think is too hard to use.

As for the macros, for starters the open functions have nothing to do with the bloody layers plugins. I can think of many things that could be added to the macros plugins but just because you can do a thing doesn't mean you should. The macros language isn't meant to be a full-fledged script language. Continually adding stuff for every request ultimately leads to bloat and bigger code means more chances for bugs. Look at all of the changes already just for a single go button request.

As for nicknames in macros, why is this needed anyway ? You have this in the URL bar and in the file open dialog and my change makes the go button work with minimal code impact, only a table entry and the ID string is added. What more do you want ? In a macro there's no reason not to use the actual URL and you have variables and the findnick stuff is already accessible.

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 09:22PM

asmpgmr:

I'm not posting code changes to have them altered for the purpose of making things "easier to use". My goal is to fix bugs, add new browser functionality, clean stuff up, and make existing features work consistently, NOT helping end users with stuff they think is too hard to use.

I'm not making custom builds to make you happy, I'm making them to make me happy. If you like them, I'm glad, you've certainly contributed alot to them; but any additions you don't like, if they don't cause bloat or bugs, you're going to have to deal with or patch out or simply stop use my builds.

The original programmers could say the same thing to you that you just said. They didn't code the app to have their code altered for the purpose of making things "easier to use"--you have a Url bar, you have a keyboard, and you have your memory; why should you go klugding things up with a nickname lookup in the first place?

The answer is, obviously, for the extra functionality. And so at that point I say, yes extra functionality is good, let's make it accessable everywhere. As long as I don't add any bloat of bugs in the process, I really don't see why you would care.


...I can think of many things that could be added to the macros plugins but just because you can do a thing doesn't mean you should. The macros language isn't meant to be a full-fledged script language. Continually adding stuff for every request ultimately leads to bloat and bigger code means more chances for bugs. Look at all of the changes already just for a single go button request.

Or for a windowed history list? Except, as I recall, you liked those changes alot and helped debug it. Or your nickname lookup code in the Url bar?


As for nicknames in macros, why is this needed anyway ? You have this in the URL bar and in the file open dialog and my change makes the go button work with minimal code impact, only a table entry and the ID string is added. What more do you want ? In a macro there's no reason not to use the actual URL and you have variables and the findnick stuff is already accessible.

I'm using the nick() macro command in three places. I replaced the default search button with macros(new_search) and have Ctrl-Shift-N bound to macros(open_new_layer); in those macros it is used on the return value of a prompt and then its return is passed to the opennew / open command. And thirdly in the go button macro.

It can also be used to bind accels to nicks with a two-line macro, e.g.,

myfavoritesite{
$theurl = nick("mfs");
opennew($theurl);
}

LWIN 1 = macros(myfavoritesite)

It can also be used for more complex stuff, like, you have a site, http://site.com/ with a manual for fixing microwaves, http://site.com/microman.asp?p=1, p=1 is your page number...

You can make a quicksearch, http://site.com/microman.asp?p=%s, snd nickname it mm...

microman{
$n = prompt("Page Num:","Microwave Manual", "");
$theurl = nick("mm ".$n);
opennew($theurl);
}

&c.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 09:28PM

As a practical example of the latter mentioned use, here is a real macro / accel that can be used:

Bookmark: http://kmeleon.sourceforge.net/bugs/viewbug.php?bugid=%s
Nick: kbugs

kbugs{
$n = prompt("Bug Num:","K-Meleon Bugs", "");
$theurl = nick("kbugs ".$n);
opennew($theurl);
}

CTRL SHIFT K


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 09:29PM

CTRL SHIFT K = macros(kbugs)

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: MonkeeSage
Date: April 17, 2003 09:55PM

Here's my current usage:

toolbars.cfg:
-----------------

Search {
#ID_NAV_SEARCH
macros(new_search)
Search the web
hottool.bmp[5]
coldtool.bmp[5]
deadtool.bmp[5]
}


macros.cfg:
-----------------
new_search{
$e = prompt("Search Engine:","Select A Search Engine", "");
$e == "" ? $e = "g " : $e = $e . " ";
$n = prompt("Search Terms:","Search The Web", "");
$n == "" ? 0 : $theurl = nick($e . $n);
$n == "" ? 0 : opennew($theurl);
}

kbugs{
$n = prompt("Bug Number:","K-Meleon Bugs", "");
$n == "" ? 0 : $theurl = nick("kbugs ".$n);
$n == "" ? 0 : opennew($theurl);
}

open_new{
$nick = prompt("URL:", "Open New Window", "");
$nick == "" ? 0 : $loc = nick($nick);
$nick == "" ? 0 : opennew($loc);
}

open_new_layer{
$nick = prompt("URL:", "Open New Layer", "");
$nick == "" ? 0 : $loc = nick($nick);
$nick == "" ? 0 : pluginmsg("layers", "OpenURL", $loc);
}


accels.cfg:
---------------
CTRL SHIFT K = macros(kbugs)
CTRL SHIFT N = macros(open_new_layer)
CTRL SHIFT S = macros(new_search)


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Mozi-Meleon
Posted by: jerofont
Date: April 29, 2003 04:52PM

I've downloaded and installed MonkeeSage version of K-Meleon with the Mozilla 1.4b code.... I'm very happy with it cause it corrects some bugs which I used to have with K-Meleon 0.7.1, even with service pack.

Though, I'm having one problem with status bar, which is not the one mentioned above in a reply. it concerns the progress bar : it doesn't work at all. I wonderes why and found that in the changes of your build : MonkeeSage :

"Added XP Visual Style Manifest as an internal resource, no more need for an external .Manifest file "

I guess it could be a problem with it. I'm using non-MS-XP-styles to customize my desktop, but the problem isn't here, cause, the progress bar doesn't "progress", even with windows standard Luna style...

A solution to my problem?

Options: ReplyQuote
Pages: Previous1234
Current Page: 4 of 4


K-Meleon forum is powered by Phorum.