]> spindle.queued.net Git - midori/commitdiff
Implement the 'open' button in the download dialog
authorChristian Dywan <christian@twotoasts.de>
Sat, 21 Mar 2009 09:46:25 +0000 (10:46 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 21 Mar 2009 09:46:25 +0000 (10:46 +0100)
midori/midori-browser.c

index 2af041def86b4059c9ecc744d71a00e75bf5a9f6..b06a1dcb6a3c52c822c13af42dbdafba3153766c 100644 (file)
@@ -916,6 +916,8 @@ midori_browser_download_notify_status_cb (WebKitDownload* download,
             GtkWidget* icon;
             icon = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
             gtk_button_set_image (GTK_BUTTON (button), icon);
+            if (g_object_get_data (G_OBJECT (download), "open"))
+                gtk_button_clicked (GTK_BUTTON (button));
             break;
         }
         case WEBKIT_DOWNLOAD_STATUS_CANCELLED:
@@ -1036,9 +1038,10 @@ midori_view_download_requested_cb (GtkWidget*      view,
         GTK_STOCK_CANCEL, 2,
         GTK_STOCK_OPEN, 3,
         NULL);
-    gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), 3, FALSE);
     switch (gtk_dialog_run (GTK_DIALOG (dialog)))
     {
+        case 3:
+            g_object_set_data (G_OBJECT (download), "open", (gpointer)1);
         case 1:
             gtk_widget_destroy (dialog);
             if (!webkit_download_get_destination_uri (download))
@@ -1057,11 +1060,6 @@ midori_view_download_requested_cb (GtkWidget*      view,
             return TRUE;
         case 2:
             break;
-        case 3:
-        {
-            /* FIXME: Implement open */
-            break;
-        }
     }
 
     gtk_widget_destroy (dialog);