[gnome-utils] screenshot: Use accessor functions instead direct access
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils] screenshot: Use accessor functions instead direct access
- Date: Wed, 20 Oct 2010 16:53:26 +0000 (UTC)
commit 1aff4e7e7b8542c3501e042f75ad0c3d131598e9
Author: Javier Jardón <jjardon gnome org>
Date: Sat Oct 9 16:32:24 2010 +0200
screenshot: Use accessor functions instead direct access
gnome-screenshot/screenshot-dialog.c | 10 ++++++----
gnome-screenshot/screenshot-utils.c | 15 ++++++++++-----
gnome-screenshot/screenshot-xfer.c | 2 +-
3 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/gnome-screenshot/screenshot-dialog.c b/gnome-screenshot/screenshot-dialog.c
index 154d90c..5ac8e1d 100644
--- a/gnome-screenshot/screenshot-dialog.c
+++ b/gnome-screenshot/screenshot-dialog.c
@@ -84,8 +84,8 @@ on_preview_expose_event (GtkWidget *drawing_area,
gtk_icon_source_set_pixbuf (source, dialog->preview_image);
gtk_icon_source_set_size (source, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_icon_source_set_size_wildcarded (source, FALSE);
-
- pixbuf = gtk_style_render_icon (drawing_area->style,
+
+ pixbuf = gtk_style_render_icon (gtk_widget_get_style (drawing_area),
source,
gtk_widget_get_direction (drawing_area),
gtk_widget_get_state (drawing_area),
@@ -380,20 +380,22 @@ screenshot_dialog_set_busy (ScreenshotDialog *dialog,
gboolean busy)
{
GtkWidget *toplevel;
+ GdkWindow *window;
toplevel = screenshot_dialog_get_toplevel (dialog);
+ window = gtk_widget_get_window (toplevel);
if (busy)
{
GdkCursor *cursor;
/* Change cursor to busy */
cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (toplevel->window, cursor);
+ gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor);
}
else
{
- gdk_window_set_cursor (toplevel->window, NULL);
+ gdk_window_set_cursor (window, NULL);
}
gtk_widget_set_sensitive (toplevel, ! busy);
diff --git a/gnome-screenshot/screenshot-utils.c b/gnome-screenshot/screenshot-utils.c
index f794283..52a1b61 100644
--- a/gnome-screenshot/screenshot-utils.c
+++ b/gnome-screenshot/screenshot-utils.c
@@ -894,7 +894,8 @@ screenshot_show_error_dialog (GtkWindow *parent,
const gchar *detail)
{
GtkWidget *dialog;
-
+ GtkWindowGroup *group;
+
g_return_if_fail ((parent == NULL) || (GTK_IS_WINDOW (parent)));
g_return_if_fail (message != NULL);
@@ -908,10 +909,14 @@ screenshot_show_error_dialog (GtkWindow *parent,
if (detail)
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", detail);
-
- if (parent && parent->group)
- gtk_window_group_add_window (parent->group, GTK_WINDOW (dialog));
-
+
+ if (parent)
+ {
+ group = gtk_window_get_group (parent);
+ if (group != NULL)
+ gtk_window_group_add_window (group, GTK_WINDOW (dialog));
+ }
+
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
diff --git a/gnome-screenshot/screenshot-xfer.c b/gnome-screenshot/screenshot-xfer.c
index 5fa1b98..bbbe789 100644
--- a/gnome-screenshot/screenshot-xfer.c
+++ b/gnome-screenshot/screenshot-xfer.c
@@ -119,7 +119,7 @@ transfer_progress_dialog_new (TransferJob *job)
GTK_BUTTONS_CANCEL,
_("Saving file..."));
widget = gtk_progress_bar_new ();
- gtk_box_pack_start (GTK_BOX (GTK_MESSAGE_DIALOG (gdialog)->label->parent),
+ gtk_box_pack_start (GTK_BOX (gtk_message_dialog_get_message_area GTK_MESSAGE_DIALOG (gdialog)),
widget, FALSE, 0, 0);
gtk_widget_show (widget);
dialog->progress_bar = widget;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]