]> git.sur5r.net Git - glabels/commitdiff
The widget should now correctly use the page size "id" when interacting through its...
authorJim Evins <evins@snaught.com>
Mon, 23 Jun 2003 03:48:51 +0000 (03:48 +0000)
committerJim Evins <evins@snaught.com>
Mon, 23 Jun 2003 03:48:51 +0000 (03:48 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@264 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/wdgt-media-select.c
glabels2/src/wdgt-media-select.h

index fec3aa5c2b2bc562b6b2d62e047c61c0df0c4579..ff7376b89da2821551c4471f3b36a197232972e8 100644 (file)
@@ -478,11 +478,19 @@ gl_wdgt_media_select_set_name (glWdgtMediaSelect *media_select,
 gchar *
 gl_wdgt_media_select_get_page_size (glWdgtMediaSelect *media_select)
 {
+       gchar *page_size_name, *page_size_id;
+
        gl_debug (DEBUG_MEDIA_SELECT, "");
 
-       return
+       page_size_name =
            gtk_editable_get_chars (GTK_EDITABLE
                                    (media_select->page_size_entry), 0, -1);
+
+       page_size_id = gl_paper_lookup_id_from_name (page_size_name);
+
+       g_free (page_size_name);
+
+       return page_size_id;
 }
 
 /****************************************************************************/
@@ -490,12 +498,15 @@ gl_wdgt_media_select_get_page_size (glWdgtMediaSelect *media_select)
 /****************************************************************************/
 void
 gl_wdgt_media_select_set_page_size (glWdgtMediaSelect *media_select,
-                                   gchar             *page_size)
+                                   gchar             *page_size_id)
 {
-       gint pos;
+       gint   pos;
+       gchar *page_size_name;
 
        gl_debug (DEBUG_MEDIA_SELECT, "START");
 
+       page_size_name = gl_paper_lookup_name_from_id (page_size_id);
+
        g_signal_handlers_block_by_func (G_OBJECT(media_select->page_size_entry),
                                        G_CALLBACK(page_size_entry_changed_cb),
                                        media_select);
@@ -507,7 +518,9 @@ gl_wdgt_media_select_set_page_size (glWdgtMediaSelect *media_select,
 
        pos = 0;
        gtk_editable_insert_text (GTK_EDITABLE (media_select->page_size_entry),
-                                 page_size, strlen (page_size), &pos);
+                                 page_size_name, strlen (page_size_name), &pos);
+
+       g_free (page_size_name);
 
        gl_debug (DEBUG_MEDIA_SELECT, "END");
 }
index 122fede2e90b0af9abb367a1853d28f6f5b44884..7505e4c8f97e5b60c0a3764b121d986c865d516e 100644 (file)
@@ -74,7 +74,7 @@ void       gl_wdgt_media_select_set_name      (glWdgtMediaSelect *media_select,
 gchar     *gl_wdgt_media_select_get_page_size (glWdgtMediaSelect *media_select);
 
 void       gl_wdgt_media_select_set_page_size (glWdgtMediaSelect *media_select,
-                                              gchar             *page_size);
+                                              gchar             *page_size_id);
 
 G_END_DECLS