[empathy: 1/3] Make EmpathyDebugDialog be a GtkWindow subclass rather than a GtkDialog.



commit 5b06953566c13a940f69933868541e4a43200e90
Author: Xavier Claessens <xclaesse gmail com>
Date:   Fri Aug 21 14:39:03 2009 +0200

    Make EmpathyDebugDialog be a GtkWindow subclass rather than a GtkDialog.
    
    This is because:
    1) There are no actions, so it's not a dialog
    2) We want to hide the seperator for the action area
    3) To be able to maximize the window

 src/empathy-debug-dialog.c |    8 +++++---
 src/empathy-debug-dialog.h |    4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-debug-dialog.c b/src/empathy-debug-dialog.c
index 9d047ba..caf57de 100644
--- a/src/empathy-debug-dialog.c
+++ b/src/empathy-debug-dialog.c
@@ -39,7 +39,7 @@
 #include "empathy-debug-dialog.h"
 
 G_DEFINE_TYPE (EmpathyDebugDialog, empathy_debug_dialog,
-    GTK_TYPE_DIALOG)
+    GTK_TYPE_WINDOW)
 
 enum
 {
@@ -212,7 +212,7 @@ debug_dialog_set_toolbar_sensitivity (EmpathyDebugDialog *debug_dialog,
     gboolean sensitive)
 {
   EmpathyDebugDialogPriv *priv = GET_PRIV (debug_dialog);
-  GtkWidget *vbox = gtk_dialog_get_content_area (GTK_DIALOG (debug_dialog));
+  GtkWidget *vbox = gtk_bin_get_child (GTK_BIN (debug_dialog));
 
   gtk_widget_set_sensitive (GTK_WIDGET (priv->save_button), sensitive);
   gtk_widget_set_sensitive (GTK_WIDGET (priv->copy_button), sensitive);
@@ -948,7 +948,9 @@ debug_dialog_constructor (GType type,
   gtk_window_set_title (GTK_WINDOW (object), _("Debug Window"));
   gtk_window_set_default_size (GTK_WINDOW (object), 800, 400);
 
-  vbox = gtk_dialog_get_content_area (GTK_DIALOG (object));
+  vbox = gtk_vbox_new (FALSE, 0);
+  gtk_container_add (GTK_CONTAINER (object), vbox);
+  gtk_widget_show (vbox);
 
   toolbar = gtk_toolbar_new ();
   gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH_HORIZ);
diff --git a/src/empathy-debug-dialog.h b/src/empathy-debug-dialog.h
index 5d98fa0..903fa53 100644
--- a/src/empathy-debug-dialog.h
+++ b/src/empathy-debug-dialog.h
@@ -45,13 +45,13 @@ typedef struct _EmpathyDebugDialogClass EmpathyDebugDialogClass;
 
 struct _EmpathyDebugDialog
 {
-  GtkDialog parent;
+  GtkWindow parent;
   gpointer priv;
 };
 
 struct _EmpathyDebugDialogClass
 {
-  GtkDialogClass parent_class;
+  GtkWindowClass parent_class;
 };
 
 GType empathy_debug_dialog_get_type (void) G_GNUC_CONST;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]