r11055 - in /desktop/unstable/epiphany-browser/debian: changelog patches/09_download_dialog.patch

joss at users.alioth.debian.org joss at users.alioth.debian.org
Fri May 18 22:48:11 UTC 2007


Author: joss
Date: Fri May 18 22:48:10 2007
New Revision: 11055

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=11055
Log:
* 09_download_dialog.patch: still kill the download dialog, but 
  reinstate the distinction between download and save for security 
  reasons (closes: #424765). Also improve the preferences dialog to 
  make insensitive the download folder selection when necessary.

Modified:
    desktop/unstable/epiphany-browser/debian/changelog
    desktop/unstable/epiphany-browser/debian/patches/09_download_dialog.patch

Modified: desktop/unstable/epiphany-browser/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/epiphany-browser/debian/changelog?rev=11055&op=diff
==============================================================================
--- desktop/unstable/epiphany-browser/debian/changelog (original)
+++ desktop/unstable/epiphany-browser/debian/changelog Fri May 18 22:48:10 2007
@@ -1,3 +1,12 @@
+epiphany-browser (2.18.1-3) unstable; urgency=low
+
+  * 09_download_dialog.patch: still kill the download dialog, but 
+    reinstate the distinction between download and save for security 
+    reasons (closes: #424765). Also improve the preferences dialog to 
+    make insensitive the download folder selection when necessary.
+
+ -- Josselin Mouette <joss at debian.org>  Sat, 19 May 2007 00:03:32 +0200
+
 epiphany-browser (2.18.1-2) unstable; urgency=low
 
   [ Josselin Mouette ]

Modified: desktop/unstable/epiphany-browser/debian/patches/09_download_dialog.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/epiphany-browser/debian/patches/09_download_dialog.patch?rev=11055&op=diff
==============================================================================
--- desktop/unstable/epiphany-browser/debian/patches/09_download_dialog.patch (original)
+++ desktop/unstable/epiphany-browser/debian/patches/09_download_dialog.patch Fri May 18 22:48:10 2007
@@ -1,185 +1,40 @@
-Index: src/window-commands.c
+Index: embed/mozilla/ContentHandler.cpp
 ===================================================================
---- src/window-commands.c.orig	2007-03-06 12:31:28.000000000 +0000
-+++ src/window-commands.c	2007-03-11 21:01:52.000000000 +0000
-@@ -296,7 +296,7 @@
- 	ephy_embed_persist_set_flags
- 		(persist, EPHY_EMBED_PERSIST_MAINDOC | EPHY_EMBED_PERSIST_ASK_DESTINATION);
- 	ephy_embed_persist_set_persist_key
--		(persist, CONF_STATE_SAVE_DIR);
-+		(persist, CONF_STATE_DOWNLOAD_DIR);
+--- embed/mozilla/ContentHandler.cpp.orig	2007-03-11 20:59:09.000000000 +0100
++++ embed/mozilla/ContentHandler.cpp	2007-05-19 00:25:47.362311750 +0200
+@@ -336,8 +336,11 @@
  
- 	ephy_embed_persist_save (persist);
+ 	gtk_dialog_add_button (GTK_DIALOG (dialog),
+ 			       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+-	gtk_dialog_add_button (GTK_DIALOG (dialog),
+-			       action_label, mAction);
++	if (mAction != CONTENT_ACTION_NONE)
++	{
++		gtk_dialog_add_button (GTK_DIALOG (dialog),
++				       action_label, mAction);
++	}
  
-Index: src/ephy-tab.c
-===================================================================
---- src/ephy-tab.c.orig	2007-03-06 12:31:28.000000000 +0000
-+++ src/ephy-tab.c	2007-03-11 21:01:52.000000000 +0000
-@@ -2008,7 +2008,7 @@
- 	/* shift+click saves the link target */
- 	else if (is_link && is_left_click && with_shift)
- 	{
--		handled = save_property_url (embed, event, "link", CONF_STATE_SAVE_DIR);
-+		handled = save_property_url (embed, event, "link", CONF_STATE_DOWNLOAD_DIR);
- 	}
- 	/* shift+click saves the non-link image
- 	 * Note: pressing enter to submit a form synthesizes a mouse click event
-Index: src/popup-commands.c
-===================================================================
---- src/popup-commands.c.orig	2007-03-06 12:31:28.000000000 +0000
-+++ src/popup-commands.c	2007-03-11 21:01:52.000000000 +0000
-@@ -235,7 +235,7 @@
- 		(persist, EPHY_EMBED_PERSIST_FROM_CACHE |
- 			  (ask_dest ? EPHY_EMBED_PERSIST_ASK_DESTINATION : 0));
- 	ephy_embed_persist_set_persist_key
--		(persist, CONF_STATE_SAVE_DIR);
-+		(persist, CONF_STATE_DOWNLOAD_DIR);
- 	ephy_embed_persist_set_source (persist, location);
- 
- 	g_signal_connect (persist, "completed",
-Index: lib/ephy-file-helpers.c
-===================================================================
---- lib/ephy-file-helpers.c.orig	2007-03-06 12:31:55.000000000 +0000
-+++ lib/ephy-file-helpers.c	2007-03-11 21:01:52.000000000 +0000
-@@ -120,11 +120,11 @@
- }
- 
- char *
--ephy_file_get_downloads_dir (void)
-+ephy_file_get_downloads_dir_for_key (const char *key)
- {
- 	char *download_dir, *expanded;
- 
--	download_dir = eel_gconf_get_string (CONF_STATE_DOWNLOAD_DIR);
-+	download_dir = eel_gconf_get_string (key);
- 
- 	if (download_dir && strcmp (download_dir, "Downloads") == 0)
- 	{
-@@ -162,6 +162,12 @@
- }
- 
- char *
-+ephy_file_get_downloads_dir (void)
-+{
-+	return ephy_file_get_downloads_dir_for_key (CONF_STATE_DOWNLOAD_DIR);
-+}
-+
-+char *
- ephy_file_desktop_dir (void)
- {
- 	char *downloads_dir;
-Index: lib/ephy-file-helpers.h
-===================================================================
---- lib/ephy-file-helpers.h.orig	2007-03-06 12:31:55.000000000 +0000
-+++ lib/ephy-file-helpers.h	2007-03-11 21:01:52.000000000 +0000
-@@ -56,6 +56,8 @@
- 
- char       *ephy_file_downloads_dir      (void);
- 
-+char	   *ephy_file_get_downloads_dir_for_key	 (const char *key);
-+
- char	   *ephy_file_get_downloads_dir	 (void);
- 
- char       *ephy_file_desktop_dir	 (void);
-Index: lib/ephy-prefs.h
-===================================================================
---- lib/ephy-prefs.h.orig	2007-03-11 21:01:46.000000000 +0000
-+++ lib/ephy-prefs.h	2007-03-11 21:01:52.000000000 +0000
-@@ -43,7 +43,6 @@
- #define CONF_GECKO_ENABLE_PANGO			"/apps/epiphany/web/enable_pango"
- 
- /* Directories */
--#define CONF_STATE_SAVE_DIR		"/apps/epiphany/directories/save"
- #define CONF_STATE_SAVE_IMAGE_DIR	"/apps/epiphany/directories/saveimage"
- #define CONF_STATE_OPEN_DIR		"/apps/epiphany/directories/open"
- #define CONF_STATE_DOWNLOAD_DIR		"/apps/epiphany/directories/downloads_folder"
-Index: lib/ephy-file-chooser.c
-===================================================================
---- lib/ephy-file-chooser.c.orig	2007-03-06 12:31:55.000000000 +0000
-+++ lib/ephy-file-chooser.c	2007-03-11 21:01:52.000000000 +0000
-@@ -143,23 +143,11 @@
- 
- 	dialog->priv->persist_key = g_strdup (key);
- 
--	dir = eel_gconf_get_string (key);
-+	dir = ephy_file_get_downloads_dir_for_key (key);
- 	if (dir != NULL)
- 	{
--		converted = g_filename_from_utf8
--			(dir, -1, NULL, NULL, NULL);
--
--		if (converted != NULL)
--		{
--			expanded = gnome_vfs_expand_initial_tilde (converted);
--
--			gtk_file_chooser_set_current_folder
--				(GTK_FILE_CHOOSER (dialog), expanded);
--
--			g_free (expanded);
--			g_free (converted);
--		}
--
-+		gtk_file_chooser_set_current_folder
-+			(GTK_FILE_CHOOSER (dialog), dir);
- 		g_free (dir);
+ 	gtk_window_set_icon_name (GTK_WINDOW (dialog), EPHY_STOCK_EPHY);
+  
+@@ -385,20 +388,16 @@
  	}
  
-Index: data/epiphany.schemas.in
-===================================================================
---- data/epiphany.schemas.in.orig	2007-03-11 21:01:46.000000000 +0000
-+++ data/epiphany.schemas.in	2007-03-11 21:01:52.000000000 +0000
-@@ -357,15 +357,6 @@
-         </locale>
-       </schema>
-       <schema>
--        <key>/schemas/apps/epiphany/directories/save</key>
--        <applyto>/apps/epiphany/directories/save</applyto>
--        <owner>epiphany</owner>
--        <type>string</type>
--        <default>~</default>
--        <locale name="C">
--        </locale>
--      </schema>
--      <schema>
-         <key>/schemas/apps/epiphany/directories/saveimage</key>
-         <applyto>/apps/epiphany/directories/saveimage</applyto>
-         <owner>epiphany</owner>
-Index: embed/mozilla/ContentHandler.cpp
-===================================================================
---- embed/mozilla/ContentHandler.cpp.orig	2007-03-06 12:32:01.000000000 +0000
-+++ embed/mozilla/ContentHandler.cpp	2007-03-11 21:01:52.000000000 +0000
-@@ -158,7 +158,7 @@
- 
- 	dialog = ephy_file_chooser_new (_("Save"), parentWindow,
- 					GTK_FILE_CHOOSER_ACTION_SAVE,
--					CONF_STATE_SAVE_DIR,
-+					CONF_STATE_DOWNLOAD_DIR,
- 					EPHY_FILE_FILTER_ALL);
- 	gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
- 	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), defaultFile.get());
-@@ -386,19 +386,25 @@
- 
  	if (auto_downloads)
- 	{
+-	{
 -		mAction = CONTENT_ACTION_OPEN;
-+		if (mHelperApp)
-+			mAction = CONTENT_ACTION_OPEN;
-+		else
-+			mAction = CONTENT_ACTION_DOWNLOAD;
- 	}
+-	}
++		mAction = mHelperApp ? CONTENT_ACTION_OPEN : CONTENT_ACTION_DOWNLOAD;
  	else
- 	{
+-	{
 -		mAction = CONTENT_ACTION_OPEN_TMP;
-+		if (mHelperApp)
-+			mAction = CONTENT_ACTION_OPEN_TMP;
-+		else
-+			mAction = CONTENT_ACTION_SAVEAS;
- 	}
+-	}
++		mAction = mHelperApp ? CONTENT_ACTION_OPEN_TMP : CONTENT_ACTION_SAVEAS;
  
 -	if (!mHelperApp || mPermission != EPHY_MIME_PERMISSION_SAFE)
 +	if (mPermission != EPHY_MIME_PERMISSION_SAFE)
  	{
- 		mAction = CONTENT_ACTION_DOWNLOAD;
+-		mAction = CONTENT_ACTION_DOWNLOAD;
++		mAction = auto_downloads ? CONTENT_ACTION_DOWNLOAD : CONTENT_ACTION_NONE;
 +		MIMEConfirmAction ();
  	}
 -
@@ -188,16 +43,105 @@
  	{
  		MIMEConfirmAction ();
  	}
-Index: embed/mozilla/EphyHeaderSniffer.cpp
+Index: data/glade/prefs-dialog.glade
 ===================================================================
---- embed/mozilla/EphyHeaderSniffer.cpp.orig	2007-03-06 12:32:02.000000000 +0000
-+++ embed/mozilla/EphyHeaderSniffer.cpp	2007-03-11 21:01:52.000000000 +0000
-@@ -406,7 +406,7 @@
- 		dialog = ephy_file_chooser_new (title ? title: _("Save"),
- 						GTK_WIDGET (window),
- 						GTK_FILE_CHOOSER_ACTION_SAVE,
--						key ? key : CONF_STATE_SAVE_DIR,
-+						key ? key : CONF_STATE_DOWNLOAD_DIR,
- 						EPHY_FILE_FILTER_ALL_SUPPORTED);
- 		gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
+--- data/glade/prefs-dialog.glade.orig	2007-05-18 23:29:25.330948000 +0200
++++ data/glade/prefs-dialog.glade	2007-05-18 23:24:27.732349250 +0200
+@@ -302,6 +302,25 @@
+ 			      <property name="spacing">6</property>
  
+ 			      <child>
++				<widget class="GtkCheckButton" id="automatic_downloads_checkbutton">
++				  <property name="visible">True</property>
++				  <property name="can_focus">True</property>
++				  <property name="label" translatable="yes">A_utomatically download and open files</property>
++				  <property name="use_underline">True</property>
++				  <property name="relief">GTK_RELIEF_NORMAL</property>
++				  <property name="focus_on_click">True</property>
++				  <property name="active">False</property>
++				  <property name="inconsistent">False</property>
++				  <property name="draw_indicator">True</property>
++				</widget>
++				<packing>
++				  <property name="padding">0</property>
++				  <property name="expand">False</property>
++				  <property name="fill">False</property>
++				</packing>
++			      </child>
++
++			      <child>
+ 				<widget class="GtkHBox" id="download_button_hbox">
+ 				  <property name="visible">True</property>
+ 				  <property name="homogeneous">False</property>
+@@ -342,25 +361,6 @@
+ 				  <property name="fill">True</property>
+ 				</packing>
+ 			      </child>
+-
+-			      <child>
+-				<widget class="GtkCheckButton" id="automatic_downloads_checkbutton">
+-				  <property name="visible">True</property>
+-				  <property name="can_focus">True</property>
+-				  <property name="label" translatable="yes">A_utomatically download and open files</property>
+-				  <property name="use_underline">True</property>
+-				  <property name="relief">GTK_RELIEF_NORMAL</property>
+-				  <property name="focus_on_click">True</property>
+-				  <property name="active">False</property>
+-				  <property name="inconsistent">False</property>
+-				  <property name="draw_indicator">True</property>
+-				</widget>
+-				<packing>
+-				  <property name="padding">0</property>
+-				  <property name="expand">False</property>
+-				  <property name="fill">False</property>
+-				</packing>
+-			      </child>
+ 			    </widget>
+ 			  </child>
+ 			</widget>
+Index: src/prefs-dialog.c
+===================================================================
+--- src/prefs-dialog.c.orig	2007-05-18 23:35:13.624715000 +0200
++++ src/prefs-dialog.c	2007-05-18 23:55:19.372069500 +0200
+@@ -390,6 +390,13 @@
+ }
+ 
+ static void
++automatic_downloads_toggled (GtkToggleButton *button,
++			     GtkWidget *widget)
++{
++	g_object_set (widget, "sensitive", gtk_toggle_button_get_active (button), NULL);
++}
++
++static void
+ setup_font_combo (EphyDialog *dialog,
+ 		  const char *type,
+ 		  const char *code,
+@@ -1524,6 +1531,7 @@
+ 	EphyDialog *dialog = EPHY_DIALOG (pd);
+ 	EphyEncodings *encodings;
+ 	GtkWidget *window, *curr_button, *blank_button;
++	GtkWidget *automatic_downloads_checkbutton, *download_button_hbox;
+ 	GtkWidget *clear_cache_button, *font_prefs_button;
+ 	GtkWidget *css_checkbox, *css_edit_box, *css_edit_button, *css_container;
+ 	gboolean sensitive;
+@@ -1544,6 +1552,8 @@
+ 		 properties[WINDOW_PROP].id, &window,
+ 		 properties[HOMEPAGE_CURRENT_PROP].id, &curr_button,
+ 		 properties[HOMEPAGE_BLANK_PROP].id, &blank_button,
++		 properties[AUTO_OPEN_PROP].id, &automatic_downloads_checkbutton,
++		 properties[DOWNLOAD_PATH_HBOX_PROP].id, &download_button_hbox,
+ 		 properties[FONT_PREFS_BUTTON_PROP].id, &font_prefs_button,
+ 		 properties[CSS_CHECKBOX_PROP].id, &css_checkbox,
+ 		 properties[CSS_EDIT_BOX_PROP].id, &css_edit_box,
+@@ -1567,6 +1577,10 @@
+ 	gtk_widget_set_sensitive (curr_button, sensitive);
+ 	gtk_widget_set_sensitive (blank_button, sensitive);
+ 
++	automatic_downloads_toggled (GTK_TOGGLE_BUTTON (automatic_downloads_checkbutton), download_button_hbox);
++	g_signal_connect (automatic_downloads_checkbutton, "toggled",
++			  G_CALLBACK (automatic_downloads_toggled), download_button_hbox);
++
+ 	g_signal_connect (font_prefs_button, "clicked",
+ 			  G_CALLBACK (font_prefs_button_clicked_cb), dialog);
+ 




More information about the pkg-gnome-commits mailing list