gnome-utils r8030 - in trunk: . gnome-screenshot po
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-utils r8030 - in trunk: . gnome-screenshot po
- Date: Thu, 28 Aug 2008 16:57:53 +0000 (UTC)
Author: cosimoc
Date: Thu Aug 28 16:57:53 2008
New Revision: 8030
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=8030&view=rev
Log:
2008-08-28 Cosimo Cecchi <cosimoc gnome org>
* Makefile.am:
* gnome-screenshot.c: (main):
* gnome-screenshot.glade:
* gnome-screenshot.ui:
* screenshot-dialog.c: (screenshot_dialog_new),
(screenshot_dialog_enable_dnd), (screenshot_dialog_get_toplevel):
* screenshot-dialog.h:
Drop libglade dependency. Use GtkBuilder instead (#549700).
Added:
trunk/gnome-screenshot/gnome-screenshot.ui
Removed:
trunk/gnome-screenshot/gnome-screenshot.glade
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/gnome-screenshot/ChangeLog
trunk/gnome-screenshot/Makefile.am
trunk/gnome-screenshot/gnome-screenshot.c
trunk/gnome-screenshot/screenshot-dialog.c
trunk/gnome-screenshot/screenshot-dialog.h
trunk/po/ChangeLog
trunk/po/POTFILES.in
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Aug 28 16:57:53 2008
@@ -145,8 +145,7 @@
PKG_CHECK_MODULES(SCREENSHOT, gio-2.0 >= $GLIB_REQUIRED dnl
gtk+-2.0 >= $GTK_REQUIRED dnl
- libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED dnl
- libglade-2.0 >= $LIBGLADE_REQUIRED)
+ libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
AC_SUBST(SCREENSHOT_CFLAGS)
AC_SUBST(SCREENSHOT_LIBS)
Modified: trunk/gnome-screenshot/Makefile.am
==============================================================================
--- trunk/gnome-screenshot/Makefile.am (original)
+++ trunk/gnome-screenshot/Makefile.am Thu Aug 28 16:57:53 2008
@@ -13,7 +13,7 @@
-I$(srcdir) \
$(STANDARD_PROPERTIES_CFLAGS) \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -DGLADEDIR=\""$(gladedir)"\" \
+ -DUIDIR=\""$(uidir)"\" \
$(SCREENSHOT_CFLAGS) \
$(NULL)
@@ -47,15 +47,15 @@
gnome_screenshot_DATA = $(gnome_screenshot_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
-gladedir = $(datadir)/gnome-screenshot/glade
-glade_DATA = \
- gnome-screenshot.glade \
+uidir = $(datadir)/gnome-screenshot
+ui_DATA = \
+ gnome-screenshot.ui \
$(NULL)
EXTRA_DIST = \
- $(glade_DATA) \
$(schemas_in_files) \
$(gnome_screenshot_in_files) \
+ $(ui_DATA) \
$(NULL)
schemasdir = $(GCONF_SCHEMA_FILE_DIR)
Modified: trunk/gnome-screenshot/gnome-screenshot.c
==============================================================================
--- trunk/gnome-screenshot/gnome-screenshot.c (original)
+++ trunk/gnome-screenshot/gnome-screenshot.c Thu Aug 28 16:57:53 2008
@@ -27,7 +27,6 @@
#include <config.h>
#include <gnome.h>
#include <gconf/gconf-client.h>
-#include <glade/glade.h>
#include <gdk/gdkx.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -1119,7 +1118,6 @@
GNOME_PARAM_GOPTION_CONTEXT, context,
GNOME_PROGRAM_STANDARD_PROPERTIES,
NULL);
- glade_gnome_init();
gtk_window_set_default_icon_name (SCREENSHOOTER_ICON);
screenshooter_init_stock_icons ();
Added: trunk/gnome-screenshot/gnome-screenshot.ui
==============================================================================
--- (empty file)
+++ trunk/gnome-screenshot/gnome-screenshot.ui Thu Aug 28 16:57:53 2008
@@ -0,0 +1,241 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkDialog" id="toplevel">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Save Screenshot</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">False</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="has_separator">False</property>
+ <signal handler="on_toplevel_key_press_event" last_modification_time="Thu, 21 Oct 2004 13:29:25 GMT" name="key_press_event"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="help_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="ok_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-save</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox3">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkAspectFrame" id="aspect_frame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="ratio">1</property>
+ <property name="obey_child">True</property>
+ <child>
+ <object class="GtkDrawingArea" id="preview_darea">
+ <property name="visible">True</property>
+ <signal handler="on_preview_expose_event" name="expose_event"/>
+ <signal handler="on_preview_configure_event" name="configure_event"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Name:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">filename_entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Save in _folder:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="filename_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"/>
+ <property name="has_frame">True</property>
+ <property name="invisible_char" translatable="yes">*</property>
+ <property name="activates_default">True</property>
+ <property name="width_chars">24</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="file_chooser_box">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-11">help_button</action-widget>
+ <action-widget response="-6">cancel_button</action-widget>
+ <action-widget response="-5">ok_button</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Modified: trunk/gnome-screenshot/screenshot-dialog.c
==============================================================================
--- trunk/gnome-screenshot/screenshot-dialog.c (original)
+++ trunk/gnome-screenshot/screenshot-dialog.c Thu Aug 28 16:57:53 2008
@@ -25,7 +25,6 @@
#include "screenshot-save.h"
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
-#include <glade/glade.h>
#include <gio/gio.h>
enum {
@@ -43,7 +42,7 @@
struct ScreenshotDialog
{
- GladeXML *xml;
+ GtkBuilder *ui;
GdkPixbuf *screenshot;
GdkPixbuf *preview_image;
GtkWidget *save_widget;
@@ -215,6 +214,7 @@
gint pos;
GFile *tmp_file;
GFile *parent_file;
+ guint res;
tmp_file = g_file_new_for_uri (initial_uri);
parent_file = g_file_get_parent (tmp_file);
@@ -226,33 +226,36 @@
dialog = g_new0 (ScreenshotDialog, 1);
- dialog->xml = glade_xml_new (GLADEDIR "/gnome-screenshot.glade", NULL, NULL);
+ dialog-> ui = gtk_builder_new ();
+ res = gtk_builder_add_from_file (dialog->ui, UIDIR "/gnome-screenshot.ui", NULL);
dialog->screenshot = screenshot;
- if (dialog->xml == NULL)
+ if (res == 0)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- _("Glade file for the screenshot program is missing.\n"
+ _("UI definition file for the screenshot program is missing.\n"
"Please check your installation of gnome-utils"));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
exit (1);
}
+ gtk_builder_set_translation_domain (dialog->ui, GETTEXT_PACKAGE);
+
width = gdk_pixbuf_get_width (screenshot);
height = gdk_pixbuf_get_height (screenshot);
width /= 5;
height /= 5;
- toplevel = glade_xml_get_widget (dialog->xml, "toplevel");
- aspect_frame = glade_xml_get_widget (dialog->xml, "aspect_frame");
- preview_darea = glade_xml_get_widget (dialog->xml, "preview_darea");
- dialog->filename_entry = glade_xml_get_widget (dialog->xml, "filename_entry");
- file_chooser_box = glade_xml_get_widget (dialog->xml, "file_chooser_box");
+ toplevel = GTK_WIDGET (gtk_builder_get_object (dialog->ui, "toplevel"));
+ aspect_frame = GTK_WIDGET (gtk_builder_get_object (dialog->ui, "aspect_frame"));
+ preview_darea = GTK_WIDGET (gtk_builder_get_object (dialog->ui, "preview_darea"));
+ dialog->filename_entry = GTK_WIDGET (gtk_builder_get_object (dialog->ui, "filename_entry"));
+ file_chooser_box = GTK_WIDGET (gtk_builder_get_object (dialog->ui, "file_chooser_box"));
dialog->save_widget = gtk_file_chooser_button_new (_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog->save_widget), FALSE);
@@ -317,7 +320,7 @@
g_return_if_fail (dialog != NULL);
- preview_darea = glade_xml_get_widget (dialog->xml, "preview_darea");
+ preview_darea = GTK_WIDGET (gtk_builder_get_object (dialog->ui, "preview_darea"));
gtk_drag_source_set (preview_darea,
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
drag_types, G_N_ELEMENTS (drag_types),
@@ -327,7 +330,7 @@
GtkWidget *
screenshot_dialog_get_toplevel (ScreenshotDialog *dialog)
{
- return glade_xml_get_widget (dialog->xml, "toplevel");
+ return GTK_WIDGET (gtk_builder_get_object (dialog->ui, "toplevel"));
}
char *
Modified: trunk/gnome-screenshot/screenshot-dialog.h
==============================================================================
--- trunk/gnome-screenshot/screenshot-dialog.h (original)
+++ trunk/gnome-screenshot/screenshot-dialog.h Thu Aug 28 16:57:53 2008
@@ -21,7 +21,6 @@
#define __SCREENSHOT_DIALOG_H__
#include <gtk/gtk.h>
-#include <glade/glade.h>
typedef struct ScreenshotDialog ScreenshotDialog;
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Thu Aug 28 16:57:53 2008
@@ -52,7 +52,7 @@
gnome-dictionary/src/main.c
gnome-screenshot/gnome-screenshot.c
gnome-screenshot/gnome-screenshot.desktop.in
-gnome-screenshot/gnome-screenshot.glade
+[type: gettext/glade]gnome-screenshot/gnome-screenshot.ui
gnome-screenshot/gnome-screenshot.schemas.in
gnome-screenshot/screenshot-dialog.c
gnome-screenshot/screenshot-save.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]