2007-05-21 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Mon, 21 May 2007 13:18:03 +0000 (13:18 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Mon, 21 May 2007 13:18:03 +0000 (13:18 +0000)
* src/modest-tny-account-store.c: (modest_tny_account_store_alert):
        Show a OK/Cancel dialog if the error is a question, though we still do not
        know anything more about what we are asking the user.
        * src/widgets/modest-folder-view.c: (on_drag_data_received):
        Fix an uninitialized variable (helper). This is a logic error, however.

pmo-trunk-r1939

ChangeLog2
src/modest-tny-account-store.c
src/widgets/modest-folder-view.c

index 0af99b9..1a30c15 100644 (file)
@@ -1,3 +1,11 @@
+2007-05-21  Murray Cumming  <murrayc@murrayc.com>
+
+       * src/modest-tny-account-store.c: (modest_tny_account_store_alert):
+       Show a OK/Cancel dialog if the error is a question, though we still do not 
+       know anything more about what we are asking the user.
+       * src/widgets/modest-folder-view.c: (on_drag_data_received):
+       Fix an uninitialized variable (helper). This is a logic error, however.
+
 2007-05-21  Christian Kellner  <ckellner@openismus.com>
        
        * src/modest-search.h:
index 3364c4d..ce95798 100644 (file)
@@ -681,11 +681,19 @@ modest_tny_account_store_alert (TnyAccountStore *self, TnyAlertType type,
        if (!prompt)
                return FALSE;
 
-       gboolean retval = FALSE;
 #ifdef MODEST_PLATFORM_MAEMO
        /* The Tinymail documentation says that we should show Yes and No buttons, 
-        * but these never seem to be questions: */
-        GtkWidget *dialog = GTK_WIDGET (hildon_note_new_information (NULL, prompt));
+        * when it is a question.
+        * Obviously, we need tinymail to use more specific error codes instead,
+        * so we know what buttons to show. */
+        GtkWidget *dialog = NULL;
+        if (question) {
+               dialog = GTK_WIDGET (hildon_note_new_confirmation (NULL, 
+                       prompt));
+        } else {
+               dialog = GTK_WIDGET (hildon_note_new_information (NULL, 
+                       prompt));
+        }
 #else
 
        GtkMessageType gtktype = GTK_MESSAGE_ERROR;
@@ -707,24 +715,20 @@ modest_tny_account_store_alert (TnyAccountStore *self, TnyAlertType type,
                gtktype, GTK_BUTTONS_YES_NO, prompt);
 #endif /* #ifdef MODEST_PLATFORM_MAEMO */
 
-       if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES)
-               retval = TRUE;
-
-#ifdef MODEST_PLATFORM_MAEMO
-       /* FIXME: for mameo, assume it's ok; thus, we can get passed
-        * SSL cert notes etc.
-        */
-       retval = TRUE;
-#endif /*MODEST_PLATFORM_MAEMO*/
+       gboolean retval = TRUE;
+       const int response = gtk_dialog_run (GTK_DIALOG (dialog));
+       if (question) {
+               retval = (response == GTK_RESPONSE_YES) ||
+                                (response == GTK_RESPONSE_OK); 
+       }
 
-       
        gtk_widget_destroy (dialog);
        
        /* TODO: Don't free this when we no longer strdup the message for testers. */
        g_free (prompt);
 
 
-       
+       printf("DEBUG: %s: returning %d\n", __FUNCTION__, retval);
        return retval;
 }
 
index 4f12ab5..d7a872d 100644 (file)
@@ -1086,7 +1086,7 @@ on_drag_data_received (GtkWidget *widget,
        GtkTreePath *source_row, *dest_row;
        GtkTreeViewDropPosition pos;
        gboolean success = FALSE, delete_source = FALSE;
-       DndHelper *helper;
+       DndHelper *helper = NULL; 
 
        /* Do not allow further process */
        g_signal_stop_emission_by_name (widget, "drag-data-received");
@@ -1102,7 +1102,8 @@ on_drag_data_received (GtkWidget *widget,
                   won't longer exist. We can not wait for the end of
                   the operation, because the operation won't start if
                   the folder is in use */
-               if (helper->delete_source && source_widget == widget)
+               /* TODO: helper was not instantiated before here: */
+               if (helper && helper->delete_source && source_widget == widget)
                        g_signal_emit (G_OBJECT (widget), 
                                       signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0, NULL, TRUE);
        }