aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-14 02:22:35 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-14 02:22:35 +0800
commit1730a037daf5c370cc61bf8babd5c40fd816ef8a (patch)
treef41f5f0fbd65bdec6cca4683ec9671442863f876
parent704e1716a071203b9eb81be8f525eab008d2f547 (diff)
downloadgsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.tar
gsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.tar.gz
gsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.tar.bz2
gsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.tar.lz
gsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.tar.xz
gsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.tar.zst
gsoc2013-epiphany-1730a037daf5c370cc61bf8babd5c40fd816ef8a.zip
Revert api change. So we keep 2.2 compatibility.
2003-05-13 Marco Pesenti Gritti <marco@it.gnome.org> * embed/mozilla/ExternalProtocolService.cpp: Revert api change. So we keep 2.2 compatibility. * lib/widgets/ephy-location-entry.c: (ephy_location_entry_class_init), (location_focus_out_cb), (ephy_location_entry_activate_cb): * lib/widgets/ephy-location-entry.h: Add a finished callback to know when the user finished using location. * src/bookmarks/ephy-bookmarks.c: (history_site_visited_cb), (ephy_bookmarks_set_icon): Remove unused vars. Bad xan. * src/toolbar.c: (location_finished_cb), (toolbar_activate_location): Show the toolbar on ctrl+l, hide it again when the user finished to edit (focus out/activate)
-rw-r--r--ChangeLog25
-rw-r--r--embed/mozilla/ExternalProtocolService.cpp6
-rw-r--r--lib/widgets/ephy-location-entry.c14
-rw-r--r--lib/widgets/ephy-location-entry.h1
-rwxr-xr-xsrc/toolbar.c22
5 files changed, 65 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 73db45125..438cdb675 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2003-05-13 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * embed/mozilla/ExternalProtocolService.cpp:
+
+ Revert api change. So we keep 2.2 compatibility.
+
+ * lib/widgets/ephy-location-entry.c:
+ (ephy_location_entry_class_init), (location_focus_out_cb),
+ (ephy_location_entry_activate_cb):
+ * lib/widgets/ephy-location-entry.h:
+
+ Add a finished callback to know when the user finished
+ using location.
+
+ * src/bookmarks/ephy-bookmarks.c: (history_site_visited_cb),
+ (ephy_bookmarks_set_icon):
+
+ Remove unused vars. Bad xan.
+
+ * src/toolbar.c: (location_finished_cb),
+ (toolbar_activate_location):
+
+ Show the toolbar on ctrl+l, hide it again when the user
+ finished to edit (focus out/activate)
+
2003-05-13 David Bordoley <bordoley@msu.edu>
* src/bookmarks/ephy-new-bookmark.c: (duplicate_dialog_construct),
diff --git a/embed/mozilla/ExternalProtocolService.cpp b/embed/mozilla/ExternalProtocolService.cpp
index e5213c971..9d9a7368c 100644
--- a/embed/mozilla/ExternalProtocolService.cpp
+++ b/embed/mozilla/ExternalProtocolService.cpp
@@ -19,7 +19,7 @@
#include <gtk/gtk.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <libgnome/gnome-url.h>
#include <nsString.h>
#include <nsXPIDLString.h>
@@ -100,7 +100,7 @@ NS_IMETHODIMP GExternalProtocolService::LoadUrl(nsIURI *aURL)
char *result = eel_gconf_get_string(key.get());
if (result)
{
- gnome_vfs_url_show(cSpec.get());
+ gnome_url_show(cSpec.get(), NULL);
g_free (result);
return NS_OK;
}
@@ -141,7 +141,7 @@ NS_IMETHODIMP GExternalProtocolService::LoadUrl(nsIURI *aURL)
if (ret == 0)
{
- gnome_vfs_url_show(cSpec.get());
+ gnome_url_show(cSpec.get(), NULL);
return NS_OK;
}
else
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 15bcac979..0db0694ee 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -95,6 +95,7 @@ static gpointer gtk_hbox_class;
*/
enum EphyLocationEntrySignalsEnum {
ACTIVATED,
+ FINISHED,
LAST_SIGNAL
};
static gint EphyLocationEntrySignals[LAST_SIGNAL];
@@ -123,6 +124,15 @@ ephy_location_entry_class_init (EphyLocationEntryClass *klass)
2,
G_TYPE_STRING,
G_TYPE_STRING);
+ EphyLocationEntrySignals[FINISHED] = g_signal_new (
+ "finished", G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST | G_SIGNAL_RUN_CLEANUP,
+ G_STRUCT_OFFSET (EphyLocationEntryClass, finished),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0,
+ G_TYPE_NONE);
}
static gboolean
@@ -130,6 +140,8 @@ location_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, EphyLocationEntr
{
w->priv->editing = FALSE;
+ g_signal_emit (w, EphyLocationEntrySignals[FINISHED], 0);
+
return FALSE;
}
@@ -435,6 +447,8 @@ ephy_location_entry_activate_cb (GtkEntry *entry, EphyLocationEntry *w)
w->priv->editing = FALSE;
g_signal_emit (w, EphyLocationEntrySignals[ACTIVATED], 0, target, content);
+ g_signal_emit (w, EphyLocationEntrySignals[FINISHED], 0);
+
g_free (content);
}
diff --git a/lib/widgets/ephy-location-entry.h b/lib/widgets/ephy-location-entry.h
index 5a7014bae..1b9f37f25 100644
--- a/lib/widgets/ephy-location-entry.h
+++ b/lib/widgets/ephy-location-entry.h
@@ -52,6 +52,7 @@ struct _EphyLocationEntryClass
void (*activated) (EphyLocationEntry *w,
const char *content,
const char *target);
+ void (*finished) (EphyLocationEntry *w);
};
/* Remember: fields are public read-only */
diff --git a/src/toolbar.c b/src/toolbar.c
index 01f265a75..89c4e165d 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -36,6 +36,7 @@
#include "ephy-debug.h"
#include "ephy-new-bookmark.h"
#include "ephy-stock-icons.h"
+#include "eggtoolbar.h"
#include <string.h>
@@ -565,11 +566,22 @@ toolbar_edit_location (Toolbar *t)
(EPHY_LOCATION_ENTRY(location));
}
+static void
+location_finished_cb (GtkWidget *location, GtkWidget *toolbar)
+{
+ gtk_widget_hide (toolbar);
+
+ g_signal_handlers_disconnect_by_func (G_OBJECT (location),
+ G_CALLBACK (location_finished_cb),
+ toolbar);
+}
+
void
toolbar_activate_location (Toolbar *t)
{
EggAction *action;
GtkWidget *location;
+ GtkWidget *location_tb;
action = egg_action_group_get_action
(t->priv->action_group, "Location");
@@ -577,6 +589,16 @@ toolbar_activate_location (Toolbar *t)
(EPHY_LOCATION_ACTION (action));
g_return_if_fail (location != NULL);
+ location_tb = gtk_widget_get_ancestor (location, EGG_TYPE_TOOLBAR);
+ g_return_if_fail (location_tb != NULL);
+
+ if (!GTK_WIDGET_VISIBLE (location_tb))
+ {
+ g_signal_connect (location, "finished",
+ G_CALLBACK (location_finished_cb), location_tb);
+ gtk_widget_show (location_tb);
+ }
+
ephy_location_entry_activate
(EPHY_LOCATION_ENTRY(location));
}