]> spindle.queued.net Git - midori/commitdiff
Add add-download signal to MidoriBrowser
authorChristian Dywan <christian@twotoasts.de>
Sun, 22 Mar 2009 14:24:40 +0000 (15:24 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 22 Mar 2009 14:24:40 +0000 (15:24 +0100)
midori/midori-browser.c

index aa1b1483fbed0424c6ef7f00d7b2be963d45930b..2b103dc1310b02b54b6f7486f0552d67d72a04dc 100644 (file)
@@ -120,6 +120,7 @@ enum
     REMOVE_TAB,
     ACTIVATE_ACTION,
     CONTEXT_READY,
+    ADD_DOWNLOAD,
     QUIT,
 
     LAST_SIGNAL
@@ -1007,6 +1008,7 @@ midori_view_download_requested_cb (GtkWidget*      view,
                                    WebKitDownload* download,
                                    MidoriBrowser*  browser)
 {
+    g_signal_emit (browser, signals[ADD_DOWNLOAD], 0, download);
     if (!webkit_download_get_destination_uri (download))
     {
         gchar* folder;
@@ -1262,6 +1264,33 @@ midori_browser_class_init (MidoriBrowserClass* class)
         G_TYPE_NONE, 1,
         G_TYPE_POINTER);
 
+    /**
+     * MidoriView::add-download:
+     * @view: the object on which the signal is emitted
+     * @download: a new download
+     *
+     * Emitted when a new download was accepted and is
+     * about to start, before the browser adds items
+     * to the transferbar.
+     *
+     * Emitting this signal manually is equal to a
+     * user initiating and confirming a download
+     *
+     * Note: This requires WebKitGTK 1.1.3.
+     *
+     * Since: 0.1.5
+     */
+    signals[ADD_DOWNLOAD] = g_signal_new (
+        "add-download",
+        G_TYPE_FROM_CLASS (class),
+        (GSignalFlags)(G_SIGNAL_RUN_LAST),
+        0,
+        0,
+        NULL,
+        g_cclosure_marshal_VOID__OBJECT,
+        G_TYPE_NONE, 1,
+        G_TYPE_OBJECT);
+
     signals[QUIT] = g_signal_new (
         "quit",
         G_TYPE_FROM_CLASS (class),