ekiga r7074 - in trunk: . lib/engine/gui/gtk-frontend lib/gui src/gui
- From: jschamp svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r7074 - in trunk: . lib/engine/gui/gtk-frontend lib/gui src/gui
- Date: Tue, 23 Sep 2008 18:50:59 +0000 (UTC)
Author: jschamp
Date: Tue Sep 23 18:50:59 2008
New Revision: 7074
URL: http://svn.gnome.org/viewvc/ekiga?rev=7074&view=rev
Log:
Fixed previous commit, fixed commit from rev 7018, fixed GmWindow
Modified:
trunk/ChangeLog
trunk/lib/engine/gui/gtk-frontend/addressbook-window.cpp
trunk/lib/engine/gui/gtk-frontend/chat-window.cpp
trunk/lib/gui/gmwindow.c
trunk/lib/gui/gmwindow.h
trunk/src/gui/main.cpp
Modified: trunk/lib/engine/gui/gtk-frontend/addressbook-window.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/addressbook-window.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/addressbook-window.cpp Tue Sep 23 18:50:59 2008
@@ -658,9 +658,6 @@
gtk_window_set_icon_name (GTK_WINDOW (self), GM_ICON_ADDRESSBOOK);
- g_signal_connect (G_OBJECT (self), "delete-event",
- G_CALLBACK (gtk_widget_hide_on_delete), NULL);
-
/* Start building the window */
vbox = gtk_vbox_new (FALSE, 2);
Modified: trunk/lib/engine/gui/gtk-frontend/chat-window.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/chat-window.cpp (original)
+++ trunk/lib/engine/gui/gtk-frontend/chat-window.cpp Tue Sep 23 18:50:59 2008
@@ -477,9 +477,6 @@
result->priv = new ChatWindowPrivate (core);
- g_signal_connect (G_OBJECT (result), "delete-event",
- G_CALLBACK (gtk_widget_hide_on_delete), NULL);
-
result->priv->notebook = gtk_notebook_new ();
gtk_container_add (GTK_CONTAINER (result), result->priv->notebook);
gtk_widget_show (result->priv->notebook);
Modified: trunk/lib/gui/gmwindow.c
==============================================================================
--- trunk/lib/gui/gmwindow.c (original)
+++ trunk/lib/gui/gmwindow.c Tue Sep 23 18:50:59 2008
@@ -52,6 +52,7 @@
{
GtkAccelGroup *accel;
gboolean hide_on_esc;
+ gboolean hide_on_delete;
const gchar *key;
int x;
int y;
@@ -59,7 +60,11 @@
int height;
};
-enum { GM_WINDOW_KEY = 1, GM_HIDE_ON_ESC = 2 };
+enum {
+ GM_WINDOW_KEY = 1,
+ GM_HIDE_ON_ESC = 2,
+ GM_HIDE_ON_DELETE = 3
+};
static GObjectClass *parent_class = NULL;
@@ -128,6 +133,10 @@
g_value_set_boolean (value, self->priv->hide_on_esc);
break;
+ case GM_HIDE_ON_DELETE:
+ g_value_set_boolean (value, self->priv->hide_on_delete);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, spec);
break;
@@ -164,6 +173,10 @@
g_cclosure_new_swap (G_CALLBACK (gtk_widget_hide), (gpointer) self, NULL));
break;
+ case GM_HIDE_ON_DELETE:
+ self->priv->hide_on_delete = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, spec);
break;
@@ -194,6 +207,10 @@
spec = g_param_spec_boolean ("hide_on_esc", "Hide on Escape", "Hide on Escape",
TRUE, (GParamFlags) G_PARAM_READWRITE);
g_object_class_install_property (gobject_class, GM_HIDE_ON_ESC, spec);
+
+ spec = g_param_spec_boolean ("hide_on_delete", "Hide on delete-event", "Hide on delete-event (or just relay the event)",
+ TRUE, (GParamFlags) G_PARAM_READWRITE);
+ g_object_class_install_property (gobject_class, GM_HIDE_ON_DELETE, spec);
}
@@ -209,6 +226,7 @@
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GM_WINDOW_TYPE, GmWindowPrivate);
self->priv->key = g_strdup ("");
self->priv->hide_on_esc = TRUE;
+ self->priv->hide_on_delete = TRUE;
self->priv->accel = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (self), self->priv->accel);
@@ -266,8 +284,16 @@
gm_window_delete_event (GtkWidget *w,
G_GNUC_UNUSED gpointer data)
{
- gtk_widget_hide (w);
- return FALSE;
+ GmWindow* self = NULL;
+
+ self = GM_WINDOW (w);
+
+ if (self->priv->hide_on_delete) {
+ gtk_widget_hide (w);
+ return TRUE;
+ } else {
+ return FALSE;
+ }
}
@@ -451,3 +477,23 @@
g_free (size);
g_strfreev (couple);
}
+
+void
+gm_window_set_hide_on_delete (GmWindow *window,
+ gboolean hide_on_delete)
+{
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (IS_GM_WINDOW (window));
+
+ g_object_set (GM_WINDOW (window), "hide_on_delete", hide_on_delete, NULL);
+}
+
+gboolean
+gm_window_get_hide_on_delete (GmWindow *window)
+{
+ g_return_val_if_fail (window != NULL, FALSE);
+ g_return_val_if_fail (IS_GM_WINDOW (window), FALSE);
+
+ return window->priv->hide_on_delete;
+}
+
Modified: trunk/lib/gui/gmwindow.h
==============================================================================
--- trunk/lib/gui/gmwindow.h (original)
+++ trunk/lib/gui/gmwindow.h Tue Sep 23 18:50:59 2008
@@ -114,6 +114,18 @@
int *x,
int *y);
+/** Set if the GmWindow should hide on a delete-event or just relay the event
+ * @param window is the GmWindow
+ * @param hode_on_delete TRUE to just hide, FALSE to relay
+ */
+void gm_window_set_hide_on_delete (GmWindow *window,
+ gboolean hide_on_delete);
+
+/** Check if the GmWindow will hide or event-relay on a delete-event
+ * @param window is the GmWindow
+ */
+gboolean gm_window_get_hide_on_delete (GmWindow *window);
+
G_END_DECLS
#endif
Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp (original)
+++ trunk/src/gui/main.cpp Tue Sep 23 18:50:59 2008
@@ -2848,10 +2848,10 @@
statusicon = GTK_STATUS_ICON (GnomeMeeting::Process ()->GetStatusicon ());
mw = gm_mw_get_mw (GTK_WIDGET (main_window));
+ /* Hide in any case, but quit program when we don't have a status menu */
+ gtk_widget_hide (GTK_WIDGET (data));
if (!gtk_status_icon_is_embedded (GTK_STATUS_ICON (statusicon)))
quit_callback (NULL, data);
- else
- gtk_widget_hide (GTK_WIDGET (data));
return (TRUE);
}
@@ -4039,6 +4039,7 @@
/* The Top-level window */
window = gm_window_new_with_key (USER_INTERFACE_KEY "main_window");
+ gm_window_set_hide_on_delete (GM_WINDOW (window), FALSE);
gtk_window_set_title (GTK_WINDOW (window),
_("Ekiga"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]