Revision: 1901
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1901&view=rev
Author:   Sikon
Date:     2008-01-02 11:23:23 -0800 (Wed, 02 Jan 2008)

Log Message:
-----------
Redesigned confirmation window

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog
    gtkpod/trunk/data/gtkpod.glade
    gtkpod/trunk/src/confirmation.c

Modified: gtkpod/trunk/ChangeLog
===================================================================
--- gtkpod/trunk/ChangeLog      2008-01-02 17:00:05 UTC (rev 1900)
+++ gtkpod/trunk/ChangeLog      2008-01-02 19:23:23 UTC (rev 1901)
@@ -19,6 +19,12 @@
   * src/fileselection.c:
   
     Use the stock GTK directory selection dialog. Code cleanup.
+       
+  * src/confirmation.c:
+  * data/gtkpod.glade:
+  
+    Redesigned confirmation window to use GtkTreeView, as well as for
+       HIG compliance.
 
 2008-01-01 Matvey Kozhev <sikon at users.sourceforge.net>
 

Modified: gtkpod/trunk/data/gtkpod.glade
===================================================================
--- gtkpod/trunk/data/gtkpod.glade      2008-01-02 17:00:05 UTC (rev 1900)
+++ gtkpod/trunk/data/gtkpod.glade      2008-01-02 19:23:23 UTC (rev 1901)
@@ -3614,100 +3614,126 @@
     </child>
   </widget>
   <widget class="GtkDialog" id="confirm_dialog">
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes"> </property>
     <property name="icon">gtkpod-icon-48.png</property>
     <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
     <child internal-child="vbox">
       <widget class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
+        <property name="spacing">1</property>
         <child>
-          <widget class="GtkVBox" id="vbox6">
+          <widget class="GtkHBox" id="hbox169">
             <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+            <property name="border_width">6</property>
+            <property name="spacing">12</property>
             <child>
-              <widget class="GtkLabel" id="label">
+              <widget class="GtkImage" id="image18">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
                 <property name="yalign">0</property>
-                <property name="label" translatable="yes">label21</property>
-                <property name="wrap">True</property>
-                <property name="selectable">True</property>
+                <property name="stock">gtk-dialog-warning</property>
+                <property name="icon_size">6</property>
               </widget>
               <packing>
                 <property name="expand">False</property>
-                <property name="padding">6</property>
+                <property name="fill">False</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkVBox" id="vbox7">
+              <widget class="GtkVBox" id="vbox6">
                 <property name="visible">True</property>
+                <property name="spacing">6</property>
                 <child>
+                  <widget class="GtkLabel" id="label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="xalign">0</property>
+                    <property name="yalign">0</property>
+                    <property name="label" 
translatable="yes">label21</property>
+                    <property name="wrap">True</property>
+                    <property name="selectable">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
                   <widget class="GtkScrolledWindow" id="scroller">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property 
name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property 
name="hscrollbar_policy">GTK_POLICY_NEVER</property>
                     <property 
name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                     <property name="shadow_type">GTK_SHADOW_IN</property>
                     <child>
-                      <widget class="GtkTextView" id="text">
+                      <widget class="GtkTreeView" id="tree">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="wrap_mode">GTK_WRAP_WORD</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="headers_visible">False</property>
+                        <property name="headers_clickable">True</property>
+                        <property name="rules_hint">True</property>
+                        <signal name="size_allocate" 
handler="on_confirm_tree_size_allocate"/>
                       </widget>
                     </child>
                   </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHBox" id="option_hbox">
-                <property name="visible">True</property>
-                <property name="homogeneous">True</property>
                 <child>
-                  <widget class="GtkVBox" id="option_vbox">
+                  <widget class="GtkHBox" id="option_hbox">
                     <property name="visible">True</property>
+                    <property name="homogeneous">True</property>
                     <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <widget class="GtkCheckButton" id="never_again">
+                      <widget class="GtkVBox" id="option_vbox">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="label" translatable="yes">Never show 
this dialogue again</property>
-                        <property name="use_underline">True</property>
-                        <property name="response_id">0</property>
-                        <property name="draw_indicator">True</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <widget class="GtkCheckButton" id="never_again">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="label" translatable="yes">Never 
show this dialogue again</property>
+                            <property name="use_underline">True</property>
+                            <property name="response_id">0</property>
+                            <property name="draw_indicator">True</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="pack_type">GTK_PACK_END</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="pack_type">GTK_PACK_END</property>
-                        <property name="position">2</property>
                       </packing>
                     </child>
                   </widget>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
               </widget>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
+                <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <placeholder/>
-            </child>
           </widget>
-          <packing>
-            <property name="position">2</property>
-          </packing>
         </child>
         <child internal-child="action_area">
           <widget class="GtkHButtonBox" id="dialog-action_area1">
@@ -3753,6 +3779,7 @@
           <packing>
             <property name="expand">False</property>
             <property name="pack_type">GTK_PACK_END</property>
+            <property name="position">1</property>
           </packing>
         </child>
       </widget>
@@ -16841,6 +16868,7 @@
                   <widget class="GtkLabel" id="input_box_label">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">&lt;span 
weight='bold' size='larger'&gt;Message&lt;/span&gt;
 
 The quick brown fox jumps over the lazy dog.</property>

Modified: gtkpod/trunk/src/confirmation.c
===================================================================
--- gtkpod/trunk/src/confirmation.c     2008-01-02 17:00:05 UTC (rev 1900)
+++ gtkpod/trunk/src/confirmation.c     2008-01-02 19:23:23 UTC (rev 1901)
@@ -211,6 +211,30 @@
     }
 }
 
+static void confirm_append_text (GladeXML *xml, const gchar *text)
+{
+       int i;
+       gchar **strings = g_strsplit (text, "\n", 0);
+       GtkTreeIter iter;
+       GtkAdjustment *adjustment;
+       GtkWidget *w = gtkpod_xml_get_widget (xml, "tree");
+       GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model 
(GTK_TREE_VIEW (w)));
+       
+       for (i = 0; strings[i]; i++)
+       {
+               if (strings[i][0])
+               {
+                       gtk_list_store_append (store, &iter);
+                       gtk_list_store_set (store, &iter, 0, strings[i], -1);
+               }
+       }
+       
+       w = gtkpod_xml_get_widget (xml, "scroller");
+       adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW 
(w));
+       gtk_adjustment_set_value (adjustment, adjustment->upper - 
adjustment->page_size);
+       
+       g_strfreev (strings);
+}
 
 /* gtkpod_confirmation(): open a confirmation window with the
    information given. If "OK" is clicked, ok_handler() is called,
@@ -296,68 +320,60 @@
     ConfData *cd;
     gint defx, defy;
     GladeXML *confirm_xml;
+       GtkListStore *store;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *renderer;
+       gchar *full_label;
 
     if (id_hash == NULL)
     {  /* initialize hash table to store IDs */
-       id_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal,
-                                             NULL, g_free);
+               id_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+                                                         NULL, g_free);
     }
+       
     if (id >= 0)
     {
-       if ((cd = g_hash_table_lookup (id_hash, GINT_TO_POINTER(id))))
-       { /* window with same ID already open -- add @text and return
-          * */
-           if (text && *text &&
-               cd->window && ((w = gtkpod_xml_get_widget (cd->window_xml, 
"text"))))
-           {
-               GtkTextIter ti;
-               GtkTextBuffer *tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
-               if (!tb)
-               {   /* text buffer doesn't exist yet */
-                   GtkWidget *w1;
-                   tb = gtk_text_buffer_new(NULL);
-                   gtk_text_view_set_buffer(GTK_TEXT_VIEW(w), tb);
-                   gtk_text_view_set_editable(GTK_TEXT_VIEW(w), FALSE);
-                   gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(w), FALSE);
-                   if ((w1 =  gtkpod_xml_get_widget (cd->window_xml, 
"scroller")))
-                       gtk_widget_show (w1);
-                   cd->scrolled = TRUE;
+               if ((cd = g_hash_table_lookup (id_hash, GINT_TO_POINTER(id))))
+               { /* window with same ID already open -- add @text and return
+                  * */
+                       if (text && *text && cd->window)
+                       {
+                               confirm_append_text (cd->window_xml, text);
+                       }
+                       return GTK_RESPONSE_REJECT;
                }
-               /* append new text to the end */
-               gtk_text_buffer_get_end_iter (tb, &ti);
-               gtk_text_buffer_insert (tb, &ti, text, -1);
-               /* scroll window such that new text is visible */
-               gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (w),
-                                    gtk_text_buffer_get_insert (tb));
-           }
-           return GTK_RESPONSE_REJECT;
-       }
     }
     else /* find free ID */
     {
-       id = 0;
-       do
-       {
-           --id;
-           cd = g_hash_table_lookup (id_hash, GINT_TO_POINTER(id));
-       } while (cd != NULL);
+               id = 0;
+               
+               do
+               {
+                       --id;
+                       cd = g_hash_table_lookup (id_hash, GINT_TO_POINTER(id));
+               } while (cd != NULL);
     }
 
     if (!confirm_again)
-    { /* This question was supposed to be asked "never again" ("don't
-        confirm again" -- so we just call the ok_handler */
-       if (ok_handler && !modal)
-           ok_handler (user_data1, user_data2);
-       if (!modal)  return GTK_RESPONSE_ACCEPT;
-       else         return GTK_RESPONSE_OK;
+    {
+               /* This question was supposed to be asked "never again" ("don't
+               confirm again" -- so we just call the ok_handler */
+               if (ok_handler && !modal)
+                       ok_handler (user_data1, user_data2);
+               
+               if (!modal) 
+                       return GTK_RESPONSE_ACCEPT;
+               
+               return GTK_RESPONSE_OK;
     }
 
     /* window = create_confirm_dialog (); */
     confirm_xml = gtkpod_xml_new (xml_file, "confirm_dialog");
     window = gtkpod_xml_get_widget (confirm_xml, "confirm_dialog");
-
+       glade_xml_signal_autoconnect (confirm_xml);
+       
     /* insert ID into hash table */
-    cd = g_malloc (sizeof (ConfData));
+    cd = g_new (ConfData, 1);
     cd->window = window;
     cd->window_xml = confirm_xml;
     cd->option1_key = g_strdup(option1_key);
@@ -369,117 +385,111 @@
     cd->user_data1 = user_data1;
     cd->user_data2 = user_data2;
     g_hash_table_insert (id_hash, GINT_TO_POINTER(id), cd);
+       
+       full_label = g_markup_printf_escaped ("<span weight='bold' 
size='larger'>%s</span>\n\n%s",
+                                                                               
  title ? title : _("Confirmation"), label ? label : "");
 
-    /* Set title */
-    if (title)
-       gtk_window_set_title (GTK_WINDOW(window), title);
-    else
-       gtk_window_set_title (GTK_WINDOW(window), _("Confirmation Dialogue"));
-
     /* Set label */
-    w = gtkpod_xml_get_widget (confirm_xml, "label");
-    if (label)
-    {
-       gtk_widget_show (w);
-       gtk_label_set_text(GTK_LABEL(w), label);
-    }
-    else
-    {
-       gtk_widget_hide (w);
-    }
+       w = gtkpod_xml_get_widget (confirm_xml, "label");
+       gtk_label_set_markup (GTK_LABEL(w), full_label);
+    g_free (full_label);
 
     /* Set text */
-    w = gtkpod_xml_get_widget (confirm_xml, "text");
-    if (text)
+    w = gtkpod_xml_get_widget (confirm_xml, "tree");
+       store = gtk_list_store_new (1, G_TYPE_STRING);
+       gtk_tree_view_set_model (GTK_TREE_VIEW (w), GTK_TREE_MODEL (store));
+       g_object_unref (store);
+
+    column = gtk_tree_view_column_new ();
+    renderer = gtk_cell_renderer_text_new ();
+
+       gtk_tree_view_column_pack_start (column, renderer, TRUE);
+    gtk_tree_view_column_set_attributes (column, renderer, "text", 0, NULL);
+       g_object_set_data (G_OBJECT (w), "renderer", renderer);
+
+    gtk_tree_view_append_column (GTK_TREE_VIEW (w), column);
+
+       if (text)
     {
-       if (w)
-       {
-           GtkTextBuffer *tb = gtk_text_buffer_new(NULL);
-           gtk_text_buffer_set_text(tb, text, strlen(text));
-           gtk_text_view_set_buffer(GTK_TEXT_VIEW(w), tb);
-           gtk_text_view_set_editable(GTK_TEXT_VIEW(w), FALSE);
-           gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(w), FALSE);
+               confirm_append_text (cd->window_xml, text);
+               defx = prefs_get_int("size_conf_sw.x");
+               defy = prefs_get_int("size_conf_sw.y");
        }
-       cd->scrolled = TRUE;
-       defx = prefs_get_int("size_conf_sw.x");
-       defy = prefs_get_int("size_conf_sw.y");
-    }
     else
-    { /* no text -> hide widget */
-       if ((w = gtkpod_xml_get_widget (confirm_xml, "scroller")))
-           gtk_widget_hide (w);
-       cd->scrolled = FALSE;
-       defx = prefs_get_int("size_conf.x");
-       defy = prefs_get_int("size_conf.y");
+    {
+               /* no text -> hide widget */
+               if ((w = gtkpod_xml_get_widget (confirm_xml, "scroller")))
+                       gtk_widget_hide (w);
+               
+               cd->scrolled = FALSE;
+               defx = prefs_get_int("size_conf.x");
+               defy = prefs_get_int("size_conf.y");
     }
+       
     gtk_window_set_default_size (GTK_WINDOW (window), defx, defy);
 
     /* Set "Option 1" checkbox */
     w = gtkpod_xml_get_widget (confirm_xml, "option_vbox");
+       
     if (w && option1_key && option1_text)
     {
-       gboolean state, invert;
-       GtkWidget *option1_button =
-           gtk_check_button_new_with_mnemonic (option1_text);
+               gboolean state, invert;
+               GtkWidget *option1_button =
+                       gtk_check_button_new_with_mnemonic (option1_text);
 
-       if ((option1_state==CONF_STATE_INVERT_TRUE) ||
-           (option1_state==CONF_STATE_TRUE))  state = TRUE;
-       else                                   state = FALSE;
-       if ((option1_state==CONF_STATE_INVERT_FALSE) ||
-           (option1_state==CONF_STATE_INVERT_TRUE))  invert = TRUE;
-       else                                          invert = FALSE;
-       cd->option1_invert = invert;
+               state = ((option1_state==CONF_STATE_INVERT_TRUE) || 
(option1_state==CONF_STATE_TRUE));
+               invert = ((option1_state==CONF_STATE_INVERT_FALSE) || 
(option1_state==CONF_STATE_INVERT_TRUE));
+               cd->option1_invert = invert;
 
-       gtk_widget_show (option1_button);
-       gtk_box_pack_start (GTK_BOX (w), option1_button, FALSE, FALSE, 0);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option1_button),
-                                    state);
-       g_signal_connect ((gpointer)option1_button,
-                         "toggled",
-                         G_CALLBACK (on_option1_toggled),
-                         GINT_TO_POINTER(id));
+               gtk_widget_show (option1_button);
+               gtk_box_pack_start (GTK_BOX (w), option1_button, FALSE, FALSE, 
0);
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option1_button),
+                                                state);
+               g_signal_connect ((gpointer)option1_button,
+                                 "toggled",
+                                 G_CALLBACK (on_option1_toggled),
+                                 GINT_TO_POINTER(id));
     }
 
     /* Set "Option 2" checkbox */
     w = gtkpod_xml_get_widget (confirm_xml, "option_vbox");
     if (w && option2_key && option2_text)
     {
-       gboolean state, invert;
-       GtkWidget *option2_button =
-           gtk_check_button_new_with_mnemonic (option2_text);
+               gboolean state, invert;
+               GtkWidget *option2_button =
+                       gtk_check_button_new_with_mnemonic (option2_text);
 
-       if ((option2_state==CONF_STATE_INVERT_TRUE) ||
-           (option2_state==CONF_STATE_TRUE))  state = TRUE;
-       else                                   state = FALSE;
-       if ((option2_state==CONF_STATE_INVERT_FALSE) ||
-           (option2_state==CONF_STATE_INVERT_TRUE))  invert = TRUE;
-       else                                          invert = FALSE;
-       cd->option2_invert = invert;
+               state = ((option2_state==CONF_STATE_INVERT_TRUE) || 
(option2_state==CONF_STATE_TRUE));
+               invert = ((option2_state==CONF_STATE_INVERT_FALSE) || 
(option2_state==CONF_STATE_INVERT_TRUE));
+               cd->option2_invert = invert;
 
-       gtk_widget_show (option2_button);
-       gtk_box_pack_start (GTK_BOX (w), option2_button, FALSE, FALSE, 0);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option2_button),
-                                    state);
-       g_signal_connect ((gpointer)option2_button,
-                         "toggled",
-                         G_CALLBACK (on_option2_toggled),
-                         GINT_TO_POINTER(id));
+               gtk_widget_show (option2_button);
+               gtk_box_pack_start (GTK_BOX (w), option2_button, FALSE, FALSE, 
0);
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option2_button),
+                                                state);
+               g_signal_connect ((gpointer)option2_button,
+                                 "toggled",
+                                 G_CALLBACK (on_option2_toggled),
+                                 GINT_TO_POINTER(id));
     }
 
     /* Set "Never Again" checkbox */
     w = gtkpod_xml_get_widget (confirm_xml, "never_again");
+       
     if (w && confirm_again_key)
-    { /* connect signal */
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
-                                    !confirm_again);
-       g_signal_connect ((gpointer)w,
-                         "toggled",
-                         G_CALLBACK (on_never_again_toggled),
-                         GINT_TO_POINTER(id));
+    {
+               /* connect signal */
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
+                                                !confirm_again);
+               g_signal_connect ((gpointer)w,
+                                 "toggled",
+                                 G_CALLBACK (on_never_again_toggled),
+                                 GINT_TO_POINTER(id));
     }
     else if (w)
-    { /* hide "never again" button */
-       gtk_widget_hide (w);
+    {
+               /* hide "never again" button */
+               gtk_widget_hide (w);
     }
 
     /* Hide and set "default" button that can be activated by pressing
@@ -487,25 +497,31 @@
     /* Hide or default CANCEL button */
     if ((w = gtkpod_xml_get_widget (confirm_xml, "cancel")))
     {
-       GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
-       gtk_widget_grab_default (w);
-       if (!cancel_handler)  gtk_widget_hide (w);
+               GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+               gtk_widget_grab_default (w);
+               
+               if (!cancel_handler)
+                       gtk_widget_hide (w);
     }
 
     /* Hide or default APPLY button */
     if ((w = gtkpod_xml_get_widget (confirm_xml, "apply")))
     {
-       GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
-       gtk_widget_grab_default (w);
-       if (!apply_handler)   gtk_widget_hide (w);
+               GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+               gtk_widget_grab_default (w);
+               
+               if (!apply_handler)
+                       gtk_widget_hide (w);
     }
 
     /* Hide or default OK button */
     if ((w = gtkpod_xml_get_widget (confirm_xml, "ok")))
     {
-       GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
-       gtk_widget_grab_default (w);
-       if (!ok_handler)     gtk_widget_hide (w);
+               GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+               gtk_widget_grab_default (w);
+               
+               if (!ok_handler)
+                       gtk_widget_hide (w);
     }
 
     /* Connect Close window */
@@ -516,31 +532,39 @@
 
     if (modal)
     {
-       /* use gtk_dialog_run() to block the application */
-       gint response = gtk_dialog_run (GTK_DIALOG (window));
-       /* cleanup hash, store window size */
-       cleanup (GINT_TO_POINTER(id));
-       switch (response)
-       {
-       case GTK_RESPONSE_OK:
-       case GTK_RESPONSE_APPLY:
-           return response;
-       default:
-           return GTK_RESPONSE_CANCEL;
-       }
+               /* use gtk_dialog_run() to block the application */
+               gint response = gtk_dialog_run (GTK_DIALOG (window));
+               /* cleanup hash, store window size */
+               cleanup (GINT_TO_POINTER(id));
+               
+               switch (response)
+               {
+               case GTK_RESPONSE_OK:
+               case GTK_RESPONSE_APPLY:
+                       return response;
+               default:
+                       return GTK_RESPONSE_CANCEL;
+               }
     }
     else
     {
-       /* Make sure we catch the response */
-       g_signal_connect (GTK_OBJECT (window),
-                         "response",
-                         G_CALLBACK (on_response),
-                         GINT_TO_POINTER(id));
-       gtk_widget_show (window);
-       return GTK_RESPONSE_ACCEPT;
+               /* Make sure we catch the response */
+               g_signal_connect (GTK_OBJECT (window),
+                                 "response",
+                                 G_CALLBACK (on_response),
+                                 GINT_TO_POINTER(id));
+               gtk_widget_show (window);
+               
+               return GTK_RESPONSE_ACCEPT;
     }
 }
 
+G_MODULE_EXPORT void on_confirm_tree_size_allocate (GtkWidget *sender, 
GtkAllocation *allocation, gpointer e)
+{
+       GtkCellRenderer *renderer = GTK_CELL_RENDERER (g_object_get_data 
(G_OBJECT (sender), "renderer"));
+       g_object_set (renderer, "wrap-width", allocation->width, NULL);
+}
+
 gint gtkpod_confirmation_simple (GtkWindow *parent,
                                                                 GtkMessageType 
icon,
                                                                 const gchar 
*primary_text,


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to