diff -u -r ../galeon-0.10.6/src/galeon-wrapper.cpp ./src/galeon-wrapper.cpp
--- ../galeon-0.10.6/src/galeon-wrapper.cpp Fri May 11 18:24:25 2001
+++ ./src/galeon-wrapper.cpp Thu Jun 7 20:36:58 2001
@@ -447,6 +447,8 @@
nsresult GaleonWrapper::GetKeyEventContext (nsIDOMKeyEvent *keyEvent, WrapperKeyEventInfo *info)
{
PRBool mod_key;
+ PRUint32 charcode;
+ PRUint32 keycode;
nsresult res;
/* if we are in a text area do not process keys */
@@ -474,8 +476,24 @@
* still access the menus and other
* alt functions. */
keyEvent->GetAltKey (&mod_key);
- if (!mod_key)
- return NS_ERROR_FAILURE;
+ if (!mod_key){
+ /* These nested ifs are really getting messy */
+ keyEvent->GetCharCode(&charcode);
+ if(charcode==0){
+ keyEvent->GetKeyCode(&keycode);
+ if(
+ keycode!=NS_VK_GOBACK &&
+ keycode!=NS_VK_FWD &&
+ keycode!=NS_VK_STOP &&
+ keycode!=NS_VK_REFRESH &&
+ keycode!=NS_VK_SEARCH &&
+ keycode!=NS_VK_FAV
+ )
+ return NS_ERROR_FAILURE;
+ } else {
+ return NS_ERROR_FAILURE;
+ }
+ }
}
}
}
diff -u -r ../galeon-0.10.6/src/galeon.h ./src/galeon.h
--- ../galeon-0.10.6/src/galeon.h Wed May 9 13:28:34 2001
+++ ./src/galeon.h Thu Jun 7 22:20:56 2001
@@ -311,6 +311,7 @@
void window_close (GaleonWindow *window);
void window_go_home (GaleonWindow *window, gboolean new_embed,
gboolean new_window);
+void window_go_search (GaleonWindow *window);
void window_set_layer (GtkWidget *widget);
void window_set_encoding_menu (GaleonWindow *window, GList *charset_titles);
void window_reload_all (GaleonWindow *window);
diff -u -r ../galeon-0.10.6/src/galeon_types.h ./src/galeon_types.h
--- ../galeon-0.10.6/src/galeon_types.h Fri May 11 18:18:10 2001
+++ ./src/galeon_types.h Thu Jun 7 19:32:40 2001
@@ -336,6 +336,13 @@
DOM_VK_PLUS = 43,
DOM_VK_MINUS = 45,
+ DOM_VK_GOBACK = 0xA0,
+ DOM_VK_FWD = 0xA1,
+ DOM_VK_STOP = 0xA2,
+ DOM_VK_REFRESH = 0xA3,
+ DOM_VK_SEARCH = 0xA4,
+ DOM_VK_FAV = 0xA5,
+
DOM_VK_LEFT_2 = 65361, /* added */
DOM_VK_KP_RIGHT = 65363, /* added */
DOM_VK_KP_LEFT = 65430 /* added */
diff -u -r ../galeon-0.10.6/src/history.c ./src/history.c
--- ../galeon-0.10.6/src/history.c Fri May 11 05:28:13 2001
+++ ./src/history.c Thu Jun 7 22:32:03 2001
@@ -647,7 +647,7 @@
}
/** Where does the recent menu start? */
-#define GO_RECENT_POS 13
+#define GO_RECENT_POS 14
/**
* Clears the recent menu
diff -u -r ../galeon-0.10.6/src/main.c ./src/main.c
--- ../galeon-0.10.6/src/main.c Fri May 11 18:59:30 2001
+++ ./src/main.c Thu Jun 7 23:09:52 2001
@@ -369,8 +369,15 @@
}
if (browser_cnt == 0) {
+ gchar *url;
+ if (viewstate == VIEWSTATE_NONE)
+ /* Its kinda pointless to reload the same url in existing window */
+ /* So if they specify no URLS and -x then load the homepage */
+ url = gnome_config_get_string("/galeon/General/startpage=www.gnome.org");
+ else
+ url = "";
Galeon_Browser_loadurl(galeon_browser_client,
- "",
+ url,
/*!existing*/viewstate,
&ev);
browser_cnt++;
diff -u -r ../galeon-0.10.6/src/menu_callbacks.c ./src/menu_callbacks.c
--- ../galeon-0.10.6/src/menu_callbacks.c Fri May 11 18:29:18 2001
+++ ./src/menu_callbacks.c Thu Jun 7 22:17:30 2001
@@ -379,6 +379,17 @@
}
/**
+ * window_menu_search_page_activate_cb: search page menu item activated
+ */
+void
+window_menu_search_page_activate_cb (GtkMenuItem *menuitem,
+ GaleonWindow *window)
+{
+ return_if_not_window (window);
+ window_go_search (window);
+}
+
+/**
* window_menu_show_temp_bookmarks_activate_cb: show temp bookmarks window
*/
void
diff -u -r ../galeon-0.10.6/src/menubar.c ./src/menubar.c
--- ../galeon-0.10.6/src/menubar.c Fri May 11 18:28:56 2001
+++ ./src/menubar.c Thu Jun 7 22:43:08 2001
@@ -329,6 +329,10 @@
window_menu_home_page_activate_cb, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_HOME,
GDK_Home, GDK_CONTROL_MASK, NULL },
+ { GNOME_APP_UI_ITEM, N_("S_earch page"), NULL,
+ window_menu_search_page_activate_cb, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL,
+ GDK_s, GDK_CONTROL_MASK, NULL },
{ GNOME_APP_UI_ITEM, N_("_Stop"), NULL,
window_menu_stop_activate_cb, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_STOP,
diff -u -r ../galeon-0.10.6/src/menubar.h ./src/menubar.h
--- ../galeon-0.10.6/src/menubar.h Fri May 11 18:34:43 2001
+++ ./src/menubar.h Thu Jun 7 22:20:05 2001
@@ -109,6 +109,8 @@
GaleonWindow *window);
void window_menu_home_page_activate_cb (GtkMenuItem *menuitem,
GaleonWindow *window);
+void window_menu_search_page_activate_cb (GtkMenuItem *menuitem,
+ GaleonWindow *window);
void window_menu_find_activate_cb (GtkMenuItem *menuitem,
GaleonWindow *window);
void window_menu_select_dir_activate_cb (GtkMenuItem *menuitem,
diff -u -r ../galeon-0.10.6/src/mozcallbacks.c ./src/mozcallbacks.c
--- ../galeon-0.10.6/src/mozcallbacks.c Fri May 11 18:36:02 2001
+++ ./src/mozcallbacks.c Fri Jun 8 00:54:19 2001
@@ -553,6 +553,12 @@
switch (info->button)
{
+ case 6:
+ gtk_moz_embed_go_back (embed->mozEmbed);
+ break;
+ case 7:
+ gtk_moz_embed_go_forward (embed->mozEmbed);
+ break;
case 3:
if (gnome_config_get_int("/galeon/Mouse/right_button_action")
== 2)
@@ -833,6 +839,32 @@
break;
case DOM_VK_F1:
info->key = GDK_F1;
+ break;
+ case DOM_VK_GOBACK:
+ gtk_moz_embed_go_back(embed->mozEmbed);
+ handled = TRUE;
+ break;
+ case DOM_VK_FWD:
+ gtk_moz_embed_go_forward(embed->mozEmbed);
+ handled = TRUE;
+ break;
+ case DOM_VK_STOP:
+ gtk_moz_embed_stop_load(embed->mozEmbed);
+ handled = TRUE;
+ break;
+ case DOM_VK_REFRESH:
+ embed_reload (window->active_embed);
+ handled = TRUE;
+ break;
+ case DOM_VK_SEARCH:
+ window_go_search(window);
+ handled = TRUE;
+ break;
+ case DOM_VK_FAV:
+ /* There has got to be a better way to do this */
+ /* This just makes the key look like alt+o later on. */
+ info->key = GDK_o;
+ state |= GDK_MOD1_MASK;
break;
default:
break;
diff -u -r ../galeon-0.10.6/src/prefs.c ./src/prefs.c
--- ../galeon-0.10.6/src/prefs.c Wed May 9 09:20:42 2001
+++ ./src/prefs.c Thu Jun 7 22:07:40 2001
@@ -52,6 +52,7 @@
GtkWidget *location_optionmenu;
GtkWidget *toolbar_optionmenu;
GtkWidget *startpage_entry;
+ GtkWidget *searchpage_entry;
GtkWidget *startpage_optionmenu;
GtkWidget *new_optionmenu;
GtkWidget *bookmarks_optionmenu;
@@ -630,6 +631,7 @@
/* set each of the general configuration options */
gnome_config_push_prefix ("/galeon/General/");
set_config_from_editable (pw.startpage_entry, "startpage");
+ set_config_from_editable (pw.searchpage_entry, "searchpage");
set_config_from_optionmenu (pw.startpage_optionmenu, "startpage_type");
set_config_from_optionmenu (pw.new_optionmenu, "newpage_type");
set_config_from_optionmenu (pw.bookmarks_optionmenu, "bookmark_title");
@@ -861,6 +863,8 @@
gnome_config_push_prefix ("/galeon/General/");
set_editable_from_config (pw.startpage_entry,
"startpage=www.gnome.org");
+ set_editable_from_config (pw.searchpage_entry,
+ "searchpage=www.google.com");
set_optionmenu_from_config (pw.startpage_optionmenu,
"startpage_type=0");
set_optionmenu_from_config (pw.new_optionmenu, "newpage_type=0");
@@ -1310,6 +1314,7 @@
location_optionmenu: Q("location_optionmenu"),
toolbar_optionmenu: Q("toolbar_optionmenu"),
startpage_entry: Q("startpage_entry"),
+searchpage_entry: Q("searchpage_entry"),
startpage_optionmenu: Q("startpage_optionmenu"),
new_optionmenu: Q("new_optionmenu"),
bookmarks_optionmenu: Q("bookmarks_optionmenu"),
diff -u -r ../galeon-0.10.6/src/prefs_callbacks.c ./src/prefs_callbacks.c
--- ../galeon-0.10.6/src/prefs_callbacks.c Fri May 11 18:38:23 2001
+++ ./src/prefs_callbacks.c Thu Jun 7 22:39:55 2001
@@ -52,6 +52,8 @@
GtkWidget *prefs);
void prefs_homepage_current_button_clicked_cb (GtkButton *button,
GtkWidget *prefs);
+void prefs_searchpage_current_button_clicked_cb (GtkButton *button,
+ GtkWidget *prefs);
void prefs_lang_add_button_clicked_cb (GtkButton *button, GtkWidget *prefs);
void prefs_lang_remove_button_clicked_cb (GtkButton *button, GtkWidget *prefs);
void prefs_lang_up_button_clicked_cb (GtkButton *button, GtkWidget *prefs);
@@ -447,6 +449,21 @@
url = history_get_last_url();
entry = glade_lookup_widget(GTK_WIDGET(button), "startpage_entry");
+ gtk_entry_set_text(GTK_ENTRY(entry), url);
+ g_free(url);
+}
+
+/**
+ * prefs_searchpage_current_button_clicked_cb: set searchpage URL to current page
+ */
+void
+prefs_searchpage_current_button_clicked_cb (GtkButton *button, GtkWidget *prefs)
+{
+ GtkWidget *entry;
+ gchar *url;
+
+ url = history_get_last_url();
+ entry = glade_lookup_widget(GTK_WIDGET(button), "searchpage_entry");
gtk_entry_set_text(GTK_ENTRY(entry), url);
g_free(url);
}
diff -u -r ../galeon-0.10.6/src/window.c ./src/window.c
--- ../galeon-0.10.6/src/window.c Fri May 11 18:39:13 2001
+++ ./src/window.c Thu Jun 7 22:19:18 2001
@@ -722,6 +722,27 @@
}
/**
+ * window_go_search:
+ */
+void
+window_go_search(GaleonWindow *window)
+{
+ gchar *searchpage;
+
+ searchpage = gnome_config_get_string
+ ("/galeon/General/searchpage=www.google.com");
+
+ if (searchpage != NULL && strlen(searchpage) != 0){
+ window_load_url (window, searchpage);
+ } else {
+ gnome_error_dialog (_("You must specify a Search Page "
+ "in the Preferences dialog!"));
+ }
+
+ g_free(searchpage);
+}
+
+/**
* Request that the widget be placed above or below the Gnome panels
*/
void
diff -u -r ../galeon-0.10.6/ui/galeon.glade ./ui/galeon.glade
--- ../galeon-0.10.6/ui/galeon.glade Sat May 5 16:03:36 2001
+++ ./ui/galeon.glade Thu Jun 7 22:40:57 2001
@@ -376,6 +376,102 @@
GtkFrame
+ frame60
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ False
+ False
+
+
+
+ GtkVBox
+ vbox97
+ 5
+ False
+ 5
+
+
+ GtkHBox
+ hbox66
+ False
+ 5
+
+ 0
+ True
+ True
+
+
+
+ GtkLabel
+ label1033
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ searchpage_entry
+
+ 0
+ False
+ False
+
+
+
+
+ GtkEntry
+ searchpage_entry
+ True
+ True
+ True
+ 0
+
+
+ 0
+ True
+ True
+
+
+
+
+
+ GtkHButtonBox
+ hbuttonbox11
+ GTK_BUTTONBOX_END
+ 5
+ 85
+ 27
+ 7
+ 0
+
+ 0
+ True
+ True
+
+
+
+ GtkButton
+ searchpage_current_button
+ True
+ True
+
+ clicked
+ prefs_searchpage_current_button_clicked_cb
+ Thu, 07 Sep 2000 17:11:36 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+
+
+
+
+
+ GtkFrame
frame6
5