aboutsummaryrefslogtreecommitdiffstats
path: root/src/statusbar.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-21 02:57:20 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-21 02:57:20 +0800
commitc2beffd03405e6db4295afd6c2982388b808cb2e (patch)
tree819e50881626c5109ccdba5abb158585a3ca148b /src/statusbar.c
parent822ca51797e05edbe42b80f1a33a70a7327d732e (diff)
downloadgsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar
gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.gz
gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.bz2
gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.lz
gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.xz
gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.tar.zst
gsoc2013-epiphany-c2beffd03405e6db4295afd6c2982388b808cb2e.zip
Merge eog-menu-api branch
2003-01-20 Marco Pesenti Gritti <marco@it.gnome.org> * Merge eog-menu-api branch
Diffstat (limited to 'src/statusbar.c')
-rwxr-xr-xsrc/statusbar.c159
1 files changed, 21 insertions, 138 deletions
diff --git a/src/statusbar.c b/src/statusbar.c
index 8ac84cfb9..8ff6b4402 100755
--- a/src/statusbar.c
+++ b/src/statusbar.c
@@ -18,7 +18,6 @@
#include "statusbar.h"
#include "ephy-stock-icons.h"
-#include "ephy-bonobo-extensions.h"
#include <string.h>
#include <time.h>
@@ -27,45 +26,22 @@
#include <gtk/gtkimage.h>
#include <gtk/gtkframe.h>
#include <gtk/gtktooltips.h>
-#include <bonobo/bonobo-window.h>
-#include <bonobo/bonobo-control.h>
static void statusbar_class_init (StatusbarClass *klass);
static void statusbar_init (Statusbar *t);
static void statusbar_finalize (GObject *object);
-static void
-statusbar_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void
-statusbar_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void
-statusbar_set_window (Statusbar *t, EphyWindow *window);
-
-enum
-{
- PROP_0,
- PROP_EPHY_WINDOW
-};
static GObjectClass *parent_class = NULL;
struct StatusbarPrivate
{
- EphyWindow *window;
- BonoboUIComponent *ui_component;
GtkWidget *security_icon;
GtkWidget *progress;
GtkTooltips *tooltips;
GtkWidget *security_evbox;
- gboolean visibility;
};
-GType
+GType
statusbar_get_type (void)
{
static GType statusbar_type = 0;
@@ -85,7 +61,7 @@ statusbar_get_type (void)
(GInstanceInitFunc) statusbar_init
};
- statusbar_type = g_type_register_static (G_TYPE_OBJECT,
+ statusbar_type = g_type_register_static (GTK_TYPE_STATUSBAR,
"Statusbar",
&our_info, 0);
}
@@ -102,55 +78,12 @@ statusbar_class_init (StatusbarClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = statusbar_finalize;
- object_class->set_property = statusbar_set_property;
- object_class->get_property = statusbar_get_property;
-
- g_object_class_install_property (object_class,
- PROP_EPHY_WINDOW,
- g_param_spec_object ("EphyWindow",
- "EphyWindow",
- "Parent window",
- EPHY_WINDOW_TYPE,
- G_PARAM_READWRITE));
-}
-
-static void
-statusbar_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- Statusbar *s = STATUSBAR (object);
-
- switch (prop_id)
- {
- case PROP_EPHY_WINDOW:
- statusbar_set_window (s, g_value_get_object (value));
- break;
- }
-}
-
-static void
-statusbar_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- Statusbar *s = STATUSBAR (object);
-
- switch (prop_id)
- {
- case PROP_EPHY_WINDOW:
- g_value_set_object (value, s->priv->window);
- break;
- }
}
static void
create_statusbar_security_icon (Statusbar *s)
{
GtkWidget *security_frame;
- BonoboControl *control;
security_frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (security_frame),
@@ -162,61 +95,38 @@ create_statusbar_security_icon (Statusbar *s)
GTK_WIDGET (s->priv->security_evbox));
gtk_container_add (GTK_CONTAINER (s->priv->security_evbox),
GTK_WIDGET (s->priv->security_icon));
- /*
- g_signal_connect (G_OBJECT (security_eventbox),
- "button_release_event",
- GTK_SIGNAL_FUNC
- (security_icon_button_release_cb), t);
- */
-
- control = bonobo_control_new (security_frame);
- bonobo_ui_component_object_set (s->priv->ui_component,
- "/status/SecurityIconWrapper",
- BONOBO_OBJREF (control),
- NULL);
- bonobo_object_unref (control);
statusbar_set_security_state (s, FALSE, NULL);
gtk_widget_show_all (security_frame);
+
+ gtk_box_pack_start (GTK_BOX (s),
+ GTK_WIDGET (security_frame),
+ FALSE, TRUE, 0);
}
static void
create_statusbar_progress (Statusbar *s)
{
- BonoboControl *control;
-
s->priv->progress = gtk_progress_bar_new ();
-
- control = bonobo_control_new (s->priv->progress);
- bonobo_ui_component_object_set (s->priv->ui_component,
- "/status/ProgressWrapper",
- BONOBO_OBJREF (control),
- NULL);
-
gtk_widget_show_all (s->priv->progress);
-}
-
-static void
-statusbar_set_window (Statusbar *s, EphyWindow *window)
-{
- g_return_if_fail (s->priv->window == NULL);
- s->priv->window = window;
- s->priv->ui_component = BONOBO_UI_COMPONENT
- (s->priv->window->ui_component);
-
- create_statusbar_progress (s);
- create_statusbar_security_icon (s);
+ gtk_box_pack_start (GTK_BOX (s),
+ GTK_WIDGET (s->priv->progress),
+ FALSE, TRUE, 0);
}
static void
statusbar_init (Statusbar *t)
{
t->priv = g_new0 (StatusbarPrivate, 1);
- t->priv->visibility = TRUE;
t->priv->tooltips = gtk_tooltips_new ();
+
+ gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (t), FALSE);
+
+ create_statusbar_progress (t);
+ create_statusbar_security_icon (t);
}
static void
@@ -238,34 +148,18 @@ statusbar_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
-Statusbar *
-statusbar_new (EphyWindow *window)
+GtkWidget *
+statusbar_new (void)
{
- Statusbar *t;
-
- t = STATUSBAR (g_object_new (STATUSBAR_TYPE,
- "EphyWindow", window,
- NULL));
+ GtkWidget *t;
- g_return_val_if_fail (t->priv != NULL, NULL);
+ t = GTK_WIDGET (g_object_new (STATUSBAR_TYPE,
+ NULL));
return t;
}
void
-statusbar_set_visibility (Statusbar *t,
- gboolean visibility)
-{
- if (visibility == t->priv->visibility) return;
-
- t->priv->visibility = visibility;
-
- ephy_bonobo_set_hidden (BONOBO_UI_COMPONENT(t->priv->ui_component),
- "/status",
- !visibility);
-}
-
-void
statusbar_set_security_state (Statusbar *t,
gboolean state,
const char *tooltip)
@@ -302,20 +196,9 @@ void
statusbar_set_message (Statusbar *s,
const char *message)
{
- g_return_if_fail (BONOBO_IS_UI_COMPONENT(s->priv->ui_component));
g_return_if_fail (message != NULL);
- /* Bonobo doesnt like 0 length messages */
- if (g_utf8_strlen (message, -1) == 0)
- {
- message = " ";
- }
-
- if (bonobo_ui_component_get_container (s->priv->ui_component)) /* should not do this here... */
- {
- bonobo_ui_component_set_status (s->priv->ui_component,
- message,
- NULL);
- }
+ gtk_statusbar_pop (GTK_STATUSBAR (s), 0);
+ gtk_statusbar_push (GTK_STATUSBAR (s), 0, message);
}