commit ec702bed718e714406bdf32d5a49a5617fd13ba9 Author: phantomjinx <p.g.richard...@phantomjinx.co.uk> Date: Mon Feb 21 13:23:52 2011 +0000
Migrate photo editor glade to gtkbuilder .gitignore | 2 +- plugins/photo_editor/Makefile.am | 2 +- plugins/photo_editor/display_photo.c | 44 +++--- plugins/photo_editor/display_photo.h | 2 +- .../{photo_editor.glade => photo_editor.xml} | 200 +++++++------------- po/POTFILES.in | 2 +- po/POTFILES.skip | 2 +- 7 files changed, 95 insertions(+), 159 deletions(-) --- diff --git a/.gitignore b/.gitignore index 17edc0e..0e929e8 100644 --- a/.gitignore +++ b/.gitignore @@ -86,7 +86,7 @@ version /data/glade/cover_display.xml /data/glade/playlist_display_toolbar.xml /data/glade/core_prefs.xml -/data/glade/photo_editor.glade +/data/glade/photo_editor.xml /data/glade/media_player.xml /data/glade/playlist_display.xml /data/glade/mserv.xml diff --git a/plugins/photo_editor/Makefile.am b/plugins/photo_editor/Makefile.am index e5f7839..78ed391 100644 --- a/plugins/photo_editor/Makefile.am +++ b/plugins/photo_editor/Makefile.am @@ -7,7 +7,7 @@ photo_editor_ui_DATA = $(plugin_name).ui # Plugin Glade file photo_editor_gladedir = $(gtkpod_glade_dir) -photo_editor_glade_DATA = $(plugin_name).glade +photo_editor_glade_DATA = $(plugin_name).xml # Plugin Icon file photo_editor_pixmapsdir = $(gtkpod_image_dir) diff --git a/plugins/photo_editor/display_photo.c b/plugins/photo_editor/display_photo.c index 58e47da..322c792 100644 --- a/plugins/photo_editor/display_photo.c +++ b/plugins/photo_editor/display_photo.c @@ -97,31 +97,31 @@ static void create_photo_editor() { photo_editor = g_malloc0(sizeof(GPhoto)); - gchar *glade_path = g_build_filename(get_glade_dir(), "photo_editor.glade", NULL); - photo_editor->xml = gtkpod_xml_new(glade_path, "photo_window"); + gchar *glade_path = g_build_filename(get_glade_dir(), "photo_editor.xml", NULL); + photo_editor->builder = gtkpod_builder_xml_new(glade_path); g_free(glade_path); - photo_window = gtkpod_xml_get_widget(photo_editor->xml, "photo_window"); - photo_editor->photo_album_window = gtkpod_xml_get_widget(photo_editor->xml, "photo_album_window"); - photo_editor->photo_thumb_window = gtkpod_xml_get_widget(photo_editor->xml, "photo_thumbnail_window"); - photo_editor->photo_preview_image_event_box = gtkpod_xml_get_widget(photo_editor->xml, "photo_preview_image_event_box"); - photo_editor->photo_preview_image = GTK_IMAGE (gtkpod_xml_get_widget (photo_editor->xml, "photo_preview_image")); + photo_window = gtkpod_builder_xml_get_widget(photo_editor->builder, "photo_window"); + photo_editor->photo_album_window = gtkpod_builder_xml_get_widget(photo_editor->builder, "photo_album_window"); + photo_editor->photo_thumb_window = gtkpod_builder_xml_get_widget(photo_editor->builder, "photo_thumbnail_window"); + photo_editor->photo_preview_image_event_box = gtkpod_builder_xml_get_widget(photo_editor->builder, "photo_preview_image_event_box"); + photo_editor->photo_preview_image = GTK_IMAGE (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_preview_image")); photo_editor->add_album_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_add_album_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_add_album_menuItem")); photo_editor->add_image_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_add_image_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_add_image_menuItem")); photo_editor->add_image_dir_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_add_image_dir_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_add_image_dir_menuItem")); photo_editor->remove_album_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_remove_album_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_remove_album_menuItem")); photo_editor->remove_image_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_remove_image_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_remove_image_menuItem")); photo_editor->view_full_size_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_view_full_size_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_view_full_size_menuItem")); photo_editor->rename_album_menuItem - = GTK_MENU_ITEM (gtkpod_xml_get_widget (photo_editor->xml, "photo_rename_album_menuItem")); + = GTK_MENU_ITEM (gtkpod_builder_xml_get_widget (photo_editor->builder, "photo_rename_album_menuItem")); - photo_editor->photo_viewport = gtkpod_xml_get_widget(photo_editor->xml, "photo_viewport"); + photo_editor->photo_viewport = gtkpod_builder_xml_get_widget(photo_editor->builder, "photo_viewport"); g_object_ref(photo_editor->photo_album_window); g_object_ref(photo_editor->photo_thumb_window); g_object_ref(photo_editor->photo_preview_image); @@ -927,17 +927,17 @@ static void gphoto_display_image_dialog (GdkPixbuf *image) GtkWidget *dialog; GtkWidget *drawarea; GtkWidget *res_label; - GladeXML *xml; + GtkBuilder *builder; GdkPixbuf *scaled = NULL; gchar *text; - gchar *glade_path = g_build_filename(get_glade_dir(), "photo_editor.glade", NULL); - xml = gtkpod_xml_new(glade_path, "gphoto_preview_dialog"); + gchar *glade_path = g_build_filename(get_glade_dir(), "photo_editor.xml", NULL); + builder = gtkpod_builder_xml_new(glade_path); g_free(glade_path); - dialog = gtkpod_xml_get_widget (xml, "gphoto_preview_dialog"); - drawarea = gtkpod_xml_get_widget (xml, "gphoto_preview_dialog_drawarea"); - res_label = gtkpod_xml_get_widget (xml, "gphoto_preview_dialog_res_lbl"); + dialog = gtkpod_builder_xml_get_widget (builder, "gphoto_preview_dialog"); + drawarea = gtkpod_builder_xml_get_widget (builder, "gphoto_preview_dialog_drawarea"); + res_label = gtkpod_builder_xml_get_widget (builder, "gphoto_preview_dialog_res_lbl"); g_return_if_fail (dialog); g_return_if_fail (drawarea); g_return_if_fail (res_label); @@ -989,7 +989,7 @@ static void gphoto_display_image_dialog (GdkPixbuf *image) g_object_unref (scaled); gtk_widget_destroy (GTK_WIDGET (dialog)); - g_object_unref(xml); + g_object_unref(builder); } /** diff --git a/plugins/photo_editor/display_photo.h b/plugins/photo_editor/display_photo.h index 06d9f8e..b5b5b96 100644 --- a/plugins/photo_editor/display_photo.h +++ b/plugins/photo_editor/display_photo.h @@ -55,7 +55,7 @@ struct _GPhoto { - GladeXML *xml; /* XML info */ + GtkBuilder *builder; /* XML info */ GtkWidget *window; /* pointer to gphoto window */ iTunesDB *itdb; /* pointer to the original itdb */ PhotoDB *photodb; /* pointer to photo db */ diff --git a/plugins/photo_editor/photo_editor.glade b/plugins/photo_editor/photo_editor.xml similarity index 60% rename from plugins/photo_editor/photo_editor.glade rename to plugins/photo_editor/photo_editor.xml index 18214a4..9ba86eb 100644 --- a/plugins/photo_editor/photo_editor.glade +++ b/plugins/photo_editor/photo_editor.xml @@ -1,188 +1,126 @@ <?xml version="1.0"?> -<glade-interface> - <!-- interface-requires gtk+ 2.6 --> +<interface> + <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy toplevel-contextual --> - <widget class="GtkWindow" id="photo_window"> - <property name="visible">True</property> + <object class="GtkWindow" id="photo_window"> <property name="title" translatable="yes">Photo Window</property> <child> - <widget class="GtkViewport" id="photo_viewport"> + <object class="GtkViewport" id="photo_viewport"> <property name="visible">True</property> <property name="border_width">5</property> <property name="shadow_type">etched-out</property> <child> - <widget class="GtkHPaned" id="hpaned1"> + <object class="GtkHPaned" id="hpaned1"> <property name="visible">True</property> <property name="can_focus">True</property> <child> - <widget class="GtkVBox" id="vbox185"> + <object class="GtkVBox" id="vbox185"> <property name="visible">True</property> <property name="orientation">vertical</property> <child> - <widget class="GtkMenuBar" id="menubar1"> + <object class="GtkMenuBar" id="menubar1"> <property name="visible">True</property> <child> - <widget class="GtkImageMenuItem" id="photo_album_menuItem"> + <object class="GtkImageMenuItem" id="photo_album_menuItem"> <property name="label" translatable="yes">_Album</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <signal name="activate" handler="on_photo_album_menuItem_activate"/> - <child> - <widget class="GtkMenu" id="photo_album_menuItem_menu"> + <child type="submenu"> + <object class="GtkMenu" id="photo_album_menuItem_menu"> <child> - <widget class="GtkImageMenuItem" id="photo_add_album_menuItem"> + <object class="GtkImageMenuItem" id="photo_add_album_menuItem"> <property name="label" translatable="yes">_Add Album</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image4"> - <property name="visible">True</property> - <property name="stock">gtk-add</property> - </widget> - </child> - </widget> + </object> </child> <child> - <widget class="GtkImageMenuItem" id="photo_remove_album_menuItem"> + <object class="GtkImageMenuItem" id="photo_remove_album_menuItem"> <property name="label" translatable="yes">_Remove Album</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image5"> - <property name="visible">True</property> - <property name="stock">gtk-remove</property> - </widget> - </child> - </widget> + </object> </child> <child> - <widget class="GtkImageMenuItem" id="photo_rename_album_menuItem"> + <object class="GtkImageMenuItem" id="photo_rename_album_menuItem"> <property name="label" translatable="yes">R_ename Album</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image6"> - <property name="visible">True</property> - <property name="stock">gtk-edit</property> - </widget> - </child> - </widget> + </object> </child> - </widget> + </object> </child> - <child internal-child="image"> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="stock">photo-editor-toolbar-album</property> - </widget> - </child> - </widget> + </object> </child> <child> - <widget class="GtkImageMenuItem" id="photo_photos_menuitem"> + <object class="GtkImageMenuItem" id="photo_photos_menuitem"> <property name="label" translatable="yes">_Photos</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> - <child> - <widget class="GtkMenu" id="photo_photos_menuitem_menu"> + <child type="submenu"> + <object class="GtkMenu" id="photo_photos_menuitem_menu"> <child> - <widget class="GtkImageMenuItem" id="photo_add_image_menuItem"> + <object class="GtkImageMenuItem" id="photo_add_image_menuItem"> <property name="label" translatable="yes">_Add Image</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image7"> - <property name="visible">True</property> - <property name="stock">gtk-add</property> - </widget> - </child> - </widget> + </object> </child> <child> - <widget class="GtkImageMenuItem" id="photo_add_image_dir_menuItem"> + <object class="GtkImageMenuItem" id="photo_add_image_dir_menuItem"> <property name="label" translatable="yes">Add Image_s</property> <property name="visible">True</property> - <property name="tooltip" translatable="yes">Add Images from a Directory</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image8"> - <property name="visible">True</property> - <property name="stock">gtk-add</property> - </widget> - </child> - </widget> + </object> </child> <child> - <widget class="GtkImageMenuItem" id="photo_remove_image_menuItem"> + <object class="GtkImageMenuItem" id="photo_remove_image_menuItem"> <property name="label" translatable="yes">_Remove Images</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image9"> - <property name="visible">True</property> - <property name="stock">gtk-remove</property> - </widget> - </child> - </widget> + </object> </child> - </widget> - </child> - <child internal-child="image"> - <widget class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="stock">photo-editor-toolbar-photos</property> - </widget> + </object> </child> - </widget> + </object> </child> <child> - <widget class="GtkImageMenuItem" id="photo_zoom_menuitem"> + <object class="GtkImageMenuItem" id="photo_zoom_menuitem"> <property name="label" translatable="yes">_Zoom</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> - <child> - <widget class="GtkMenu" id="photo_zoom_menuitem_menu"> + <child type="submenu"> + <object class="GtkMenu" id="photo_zoom_menuitem_menu"> <child> - <widget class="GtkImageMenuItem" id="photo_view_full_size_menuItem"> + <object class="GtkImageMenuItem" id="photo_view_full_size_menuItem"> <property name="label" translatable="yes">_View Full Size</property> <property name="visible">True</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <property name="always_show_image">True</property> - <child internal-child="image"> - <widget class="GtkImage" id="image10"> - <property name="visible">True</property> - <property name="stock">gtk-fullscreen</property> - </widget> - </child> - </widget> + </object> </child> - </widget> - </child> - <child internal-child="image"> - <widget class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="stock">gtk-zoom-in</property> - </widget> + </object> </child> - </widget> + </object> </child> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> @@ -190,7 +128,7 @@ </packing> </child> <child> - <widget class="GtkScrolledWindow" id="photo_album_window"> + <object class="GtkScrolledWindow" id="photo_album_window"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">automatic</property> @@ -199,24 +137,24 @@ <child> <placeholder/> </child> - </widget> + </object> <packing> <property name="padding">1</property> <property name="position">1</property> </packing> </child> <child> - <widget class="GtkEventBox" id="photo_preview_image_event_box"> + <object class="GtkEventBox" id="photo_preview_image_event_box"> <property name="visible">True</property> <child> - <widget class="GtkImage" id="photo_preview_image"> + <object class="GtkImage" id="photo_preview_image"> <property name="width_request">250</property> <property name="height_request">176</property> <property name="visible">True</property> <property name="stock">gtk-missing-image</property> - </widget> + </object> </child> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> @@ -224,14 +162,14 @@ <property name="position">2</property> </packing> </child> - </widget> + </object> <packing> <property name="resize">False</property> <property name="shrink">False</property> </packing> </child> <child> - <widget class="GtkScrolledWindow" id="photo_thumbnail_window"> + <object class="GtkScrolledWindow" id="photo_thumbnail_window"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">automatic</property> @@ -239,50 +177,47 @@ <child> <placeholder/> </child> - </widget> + </object> <packing> <property name="resize">True</property> <property name="shrink">True</property> </packing> </child> - </widget> + </object> </child> - </widget> + </object> </child> - </widget> - <widget class="GtkDialog" id="gphoto_preview_dialog"> - <property name="visible">True</property> - <property name="type">popup</property> + </object> + <object class="GtkDialog" id="gphoto_preview_dialog"> <property name="title" translatable="yes">Photo Image</property> <property name="modal">True</property> <property name="window_position">center-always</property> + <property name="destroy_with_parent">True</property> <property name="icon_name">gtk-dialog-info</property> <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox4"> + <object class="GtkVBox" id="dialog-vbox4"> <property name="visible">True</property> <property name="orientation">vertical</property> <child> - <widget class="GtkVBox" id="gphoto_preview_dialog_vbox"> + <object class="GtkVBox" id="gphoto_preview_dialog_vbox"> <property name="visible">True</property> <property name="orientation">vertical</property> <child> - <widget class="GtkDrawingArea" id="gphoto_preview_dialog_drawarea"> - <property name="visible">True</property> - </widget> + <object class="GtkDrawingArea" id="gphoto_preview_dialog_drawarea"/> <packing> <property name="position">0</property> </packing> </child> <child> - <widget class="GtkLabel" id="gphoto_preview_dialog_res_lbl"> - <property name="visible">True</property> + <object class="GtkLabel" id="gphoto_preview_dialog_res_lbl"> <property name="ypad">6</property> <property name="label"><b>Placeholder for image information</b></property> <property name="use_markup">True</property> <property name="justify">center</property> <property name="wrap">True</property> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> @@ -290,39 +225,40 @@ <property name="position">1</property> </packing> </child> - </widget> + </object> <packing> <property name="position">2</property> </packing> </child> <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area4"> - <property name="visible">True</property> + <object class="GtkHButtonBox" id="dialog-action_area4"> <property name="layout_style">end</property> <child> - <widget class="GtkButton" id="okbutton3"> + <object class="GtkButton" id="okbutton3"> <property name="label">gtk-close</property> - <property name="response_id">-5</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> <property name="receives_default">False</property> <property name="use_stock">True</property> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">0</property> </packing> </child> - </widget> + </object> <packing> <property name="expand">False</property> <property name="pack_type">end</property> <property name="position">0</property> </packing> </child> - </widget> + </object> </child> - </widget> -</glade-interface> + <action-widgets> + <action-widget response="-5">okbutton3</action-widget> + </action-widgets> + </object> +</interface> diff --git a/po/POTFILES.in b/po/POTFILES.in index ff3ac32..f2307e8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -80,7 +80,7 @@ plugins/mserv/mserv.c [type: gettext/glade]plugins/mserv/mserv.xml plugins/mserv/plugin.c plugins/photo_editor/display_photo.c -plugins/photo_editor/photo_editor.glade +[type: gettext/glade]plugins/photo_editor/photo_editor.xml plugins/photo_editor/photo_editor_context_menu.c [type: gettext/ini]plugins/photo_editor/photo_editor.plugin.in plugins/photo_editor/plugin.c diff --git a/po/POTFILES.skip b/po/POTFILES.skip index ec1c602..87a1f3a 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -5,7 +5,7 @@ data/glade/details_editor.xml data/glade/exporter.xml data/glade/media_player.xml data/glade/mserv.xml -data/glade/photo_editor.glade +data/glade/photo_editor.xml data/glade/playlist_display.xml data/glade/repository_editor.xml data/glade/sorttab_display.xml ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2