Hello, Like I said before, I started with something easy. I have added a new widget GtkAboutDialog and touched a little bit the others dialogs so it will not show those extra buttonbox "spaces" but I not sure that is the appropriate behavior.
Can anyone take o quick look at it? I know its a stupid patch but I need someone to tell me if i am going well or not. :D -- Juan Pablo <[EMAIL PROTECTED]>
<<attachment: aboutdialog.png>>
Index: src/glade-gtk.c =================================================================== RCS file: /cvs/gnome/glade3/src/glade-gtk.c,v retrieving revision 1.63 diff -u -r1.63 glade-gtk.c --- src/glade-gtk.c 10 Apr 2005 06:31:04 -0000 1.63 +++ src/glade-gtk.c 21 Apr 2005 00:18:16 -0000 @@ -1301,6 +1301,48 @@ gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); } +/** + * glade_gtk_about_dialog_post_create: + * @object: + * + * TODO: write me + */ +void GLADEGTK_API +glade_gtk_about_dialog_post_create (GObject *object) +{ + GtkWidget *about = GTK_WIDGET (object); + GladeWidget *glade_widget; + GladeProperty *pname; + const gchar *pname_str; + + g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); + + glade_widget = glade_widget_get_from_gobject (about); + pname = glade_widget_get_property (glade_widget, "name"); + + /* Ops!!! I do not know what happen */ + if (pname == NULL) return; + + /* If there is no program`s name set, this will put something to show in glade. */ + pname_str = g_value_get_string(pname->value); + if (pname_str == NULL || strcmp(pname_str, "") == 0) { + GladeProject *project = glade_widget_get_project (glade_widget); + gchar *suffix, *new_pname_str; + + /* Get project name */ + new_pname_str = g_strdup(project->name); + + /* I do not want the suffix :D */ + suffix = g_strrstr(new_pname_str, ".glade"); + if (suffix != NULL) *suffix = '\0'; + + /* Set the program`s name */ + g_value_set_string(pname->value, new_pname_str); + gtk_about_dialog_set_name (GTK_ABOUT_DIALOG(about), new_pname_str); + g_free (new_pname_str); + } +} + /* ------------------------ Replace child functions ------------------------ */ /** * glade_gtk_container_replace_child: @@ -1444,9 +1486,11 @@ { g_return_if_fail (GTK_IS_DIALOG (dialog)); - /* add a placeholder in the vbox */ - gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), + /* add a placeholder in the vbox if it is not an AboutDialog */ + if (! GTK_IS_ABOUT_DIALOG(dialog)) + gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), glade_placeholder_new ()); + } /** Index: widgets/gtk+.xml =================================================================== RCS file: /cvs/gnome/glade3/widgets/gtk+.xml,v retrieving revision 1.3 diff -u -r1.3 gtk+.xml --- widgets/gtk+.xml 10 Apr 2005 06:31:05 -0000 1.3 +++ widgets/gtk+.xml 21 Apr 2005 00:18:22 -0000 @@ -441,14 +441,20 @@ --> <!-- Gtk+ Dialogs --> - <glade-widget-class name="GtkColorSelectionDialog" generic-name="colorselectiondialog" title="Color Selection Dialog"/> - + <glade-widget-class name="GtkColorSelectionDialog" generic-name="colorselectiondialog" title="Color Selection Dialog"> + <post-create-function>empty</post-create-function> + </glade-widget-class> + <glade-widget-class name="GtkFileChooserDialog" generic-name="filechooserdialog" title="File Chooser Dialog"/> - - <glade-widget-class name="GtkFontSelectionDialog" generic-name="fontselectiondialog" title="Font Selection Dialog"/> - - <glade-widget-class name="GtkInputDialog" generic-name="inputdialog" title="Input Dialog"/> - + + <glade-widget-class name="GtkFontSelectionDialog" generic-name="fontselectiondialog" title="Font Selection Dialog"> + <post-create-function>empty</post-create-function> + </glade-widget-class> + + <glade-widget-class name="GtkInputDialog" generic-name="inputdialog" title="Input Dialog"> + <post-create-function>empty</post-create-function> + </glade-widget-class> + <glade-widget-class name="GtkMessageDialog" generic-name="messagedialog" title="Message Dialog"> <post-create-function>glade_gtk_message_dialog_post_create</post-create-function> @@ -466,6 +472,15 @@ <property common="True" id="can-focus"/> </properties> </glade-widget-class> + <glade-widget-class name="GtkAboutDialog" generic-name="aboutdialog" title="About Dialog"> + <post-create-function>glade_gtk_about_dialog_post_create</post-create-function> + <fill-empty-function>ignore</fill-empty-function> + <properties> + <property id="name" name="Program name" default=""> + <tooltip>The name of the program</tooltip> + </property> + </properties> + </glade-widget-class> <!-- Gtk+ Obsolete --> <glade-widget-class name="GtkRuler"> @@ -545,6 +560,7 @@ <glade-widget-class-ref name="GtkFontSelectionDialog"/> <glade-widget-class-ref name="GtkInputDialog"/> <glade-widget-class-ref name="GtkMessageDialog"/> + <glade-widget-class-ref name="GtkAboutDialog"/> </glade-widget-group> <glade-widget-group name="gtk-obsolete" title="Gtk+ Obsolete">