Bugzilla – Attachment 203582 Details for
Bug 230478
main-menu: pointless thumbnailing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Avoid switching pages twice
0001-Use-toggled-rather-than-clicked-on-the-page-sele.patch (text/plain), 5.28 KB, created by
Federico Mena Quintero
on 2008-03-24 17:26:05 UTC
(
hide
)
Description:
Avoid switching pages twice
Filename:
MIME Type:
Creator:
Federico Mena Quintero
Created:
2008-03-24 17:26:05 UTC
Size:
5.28 KB
patch
obsolete
>From 720dc4a3b2bfb5e8521c3a1990fa2d7d4171131c Mon Sep 17 00:00:00 2001 >From: Federico Mena Quintero <federico@gnu.org> >Date: Wed, 19 Dec 2007 15:43:07 -0600 >Subject: [PATCH] Use 'toggled' rather than 'clicked' on the page selector buttons > 2007-12-19 Federico Mena Quintero <federico@novell.com> > > * main-menu/src/main-menu-ui.c (page_button_toggled_cb): Renamed > from page_button_clicked_cb. See if the button is actually > active, to avoid switching pages twice every time one of the page > selectors is clicked. > (create_file_section): Connect to "toggled" on the page selector buttons. > >Signed-off-by: Federico Mena Quintero <federico@gnu.org> >--- > ChangeLog | 8 ++++++++ > libslab/document-tile.c | 18 ++++++++++++++++++ > main-menu/src/main-menu-ui.c | 11 ++++++----- > 3 files changed, 32 insertions(+), 5 deletions(-) > >diff --git a/ChangeLog b/ChangeLog >index 97a0585..1d462b1 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,11 @@ >+2007-12-19 Federico Mena Quintero <federico@novell.com> >+ >+ * main-menu/src/main-menu-ui.c (page_button_toggled_cb): Renamed >+ from page_button_clicked_cb. See if the button is actually >+ active, to avoid switching pages twice every time one of the page >+ selectors is clicked. >+ (create_file_section): Connect to "toggled" on the page selector buttons. >+ > 2007-12-17 Federico Mena Quintero <federico@novell.com> > > * main-menu/src/main-menu-ui.c (panel_button_clicked_cb): Use GTK+ >diff --git a/libslab/document-tile.c b/libslab/document-tile.c >index b246fc8..76a2c32 100644 >--- a/libslab/document-tile.c >+++ b/libslab/document-tile.c >@@ -108,6 +108,16 @@ static void document_tile_class_init (DocumentTileClass *this_class) > g_type_class_add_private (this_class, sizeof (DocumentTilePrivate)); > } > >+static void >+show_cb (GtkWidget *widget, gpointer data) >+{ >+ DocumentTile *tile; >+ >+ tile = DOCUMENT_TILE (widget); >+ >+ printf ("Tile for %s shown\n", TILE (tile)->uri); >+} >+ > GtkWidget * > document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified) > { >@@ -164,6 +174,9 @@ document_tile_new (const gchar *in_uri, const gchar *mime_type, time_t modified) > "nameplate-header", header, "nameplate-subheader", subheader, > "nameplate-tooltip", tooltip_text, "context-menu", context_menu, NULL); > >+ g_signal_connect (this, "show", >+ G_CALLBACK (show_cb), NULL); >+ > g_free (uri); > if (tooltip_text) > g_free (tooltip_text); >@@ -415,6 +428,7 @@ load_image (DocumentTile *tile) > > gchar *icon_id = NULL; > gboolean free_icon_id = TRUE; >+ const char *uri; > > if (! priv->mime_type || ! strstr (TILE (tile)->uri, "file://")) { > icon_id = "gnome-fs-regular"; >@@ -426,6 +440,8 @@ load_image (DocumentTile *tile) > if (! thumbnail_factory) > thumbnail_factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL); > >+ uri = TILE (tile)->uri; >+ > thumb_path = gnome_thumbnail_factory_lookup (thumbnail_factory, TILE (tile)->uri, priv->modified); > > if (!thumb_path) { >@@ -433,6 +449,7 @@ load_image (DocumentTile *tile) > gnome_thumbnail_factory_can_thumbnail ( > thumbnail_factory, TILE (tile)->uri, priv->mime_type, priv->modified) > ) { >+ printf ("THUMBNAILING %s\n", uri); > thumb = gnome_thumbnail_factory_generate_thumbnail ( > thumbnail_factory, TILE (tile)->uri, priv->mime_type); > >@@ -460,6 +477,7 @@ load_image (DocumentTile *tile) > > exit: > >+ printf ("Loading image thumbnail for %s\n", uri); > priv->image_is_broken = slab_load_image ( > GTK_IMAGE (NAMEPLATE_TILE (tile)->image), GTK_ICON_SIZE_DND, icon_id); > >diff --git a/main-menu/src/main-menu-ui.c b/main-menu/src/main-menu-ui.c >index bf585ef..a81df6c 100644 >--- a/main-menu/src/main-menu-ui.c >+++ b/main-menu/src/main-menu-ui.c >@@ -193,7 +193,7 @@ static void slab_window_map_event_cb (GtkWidget *, GdkEvent *, gpoi > static void slab_window_unmap_event_cb (GtkWidget *, GdkEvent *, gpointer); > static gboolean slab_window_grab_broken_cb (GtkWidget *, GdkEvent *, gpointer); > static void search_entry_activate_cb (GtkEntry *, gpointer); >-static void page_button_clicked_cb (GtkButton *, gpointer); >+static void page_button_toggled_cb (GtkToggleButton *, gpointer); > static void tile_table_notify_cb (GObject *, GParamSpec *, gpointer); > static void gtk_table_notify_cb (GObject *, GParamSpec *, gpointer); > static void tile_action_triggered_cb (Tile *, TileEvent *, TileAction *, gpointer); >@@ -623,8 +623,8 @@ create_file_section (MainMenuUI *this) > G_OBJECT (priv->page_selectors [i]), "page-type", GINT_TO_POINTER (i)); > > g_signal_connect ( >- G_OBJECT (priv->page_selectors [i]), "clicked", >- G_CALLBACK (page_button_clicked_cb), this); >+ G_OBJECT (priv->page_selectors [i]), "toggled", >+ G_CALLBACK (page_button_toggled_cb), this); > } > > priv->current_page_gconf_mntr_id = libslab_gconf_notify_add ( >@@ -1974,12 +1974,13 @@ search_entry_activate_cb (GtkEntry *entry, gpointer user_data) > } > > static void >-page_button_clicked_cb (GtkButton *button, gpointer user_data) >+page_button_toggled_cb (GtkToggleButton *button, gpointer user_data) > { > MainMenuUIPrivate *priv = PRIVATE (user_data); >- > gint page_type; > >+ if (!gtk_toggle_button_get_active (button)) >+ return; > > page_type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "page-type")); > >-- >1.5.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 230478
:
203582
|
203583
|
203584
|
203585
|
203586
|
206381