GNOME Bugzilla – Bug 148314
quick way to clear all privacy information
Last modified: 2007-12-27 21:56:46 UTC
It would be a very nice feature to have a button or a menu option to immediately clear history, cookies, cache and passwords - like the <a href="http://extensionroom.mozdev.org/more-info/x">Firefox extension</a>.
Related to bug 117950.
Mass reassigning of Epiphany bugs to epiphany-maint@b.g.o
chpe, how about in Personal Data, having a "Clear All" button (with a confirmation alert)?
Hello! Saw just this enhancement while searching for my idea: a "Clear all private data" option! Could we see it assigned for next release?
(In reply to comment #4) > Saw just this enhancement while searching for my idea: a "Clear all private > data" option! > > Could we see it assigned for next release? Thank you for your interest in Epiphany! Because of scarce developer manpower and the fact that the UI freeze for for GNOME 2.20 is already in effect, it is very unlikely that this enhancement request will be implemented for the next release. However, patches will be gladly accepted. :)
Hello! I am not able to patch Epiphany but I think this request is very simple... If someone could add a patch for that for next release, a lot of persons would appreciate I think ;) This thing is really interesting...
Having had a look at the bug where one wanted to be able to import some settings from other browser (at least the passwords from Firefox, it seems), would it make sense to have a new tab in this dialog, before “Cookies” and “Passwords” with the following options: “Clear all personal data”, “Import x from y”, etc.? I'm willing to implement the personal data clearing, but I'd like to know where I should put the button in the interface. ;-) Oh, and in case one wants to browse the web anonymously (or so) for a given session, one can use the “--private-instance” commandline option.
Put the button where you want, if there is one :) Otherwise take a look at firefox ;)
I guess each tab could have a "Clear All" button. Or a "Clear" dialogue button next to "Close", but I think clearing cookies is used way more often than clearing the passwords... Automatically clearing all data on exit is covered by a different bug #.
Why not do like firefox? Clear all button and choose what you want: browse history, download history, search history, cache, cookies, passwords, sessions...
Created attachment 95362 [details] [review] Add a “Remove all” button on each tab of the Personal Data Manager Some remarks: - I chose to implement a button on each tab. - I chose to name it “Remove all”, since there's already a “Remove” one. - I chose the “gtk-delete” icon, which sounds more “aggressive” than the “gtk-remove” one (which is already used). Since the translation is still different, I used a translatable label, and I implemented the icon addition at runtime (not in the glade file). - The password manager might offer a new function to clear all of its contents, so as to be able to do the same as for the cookie manager: ephy_cookie_manager_clear (manager); Would a patch against the password manager be accepted, embedding the code I'm posting here? If so, I'll open another bug once I've got reviews on this patch.
I forgot to mention that I could have avoided one indirection level (and sometimes one variable or two), but I tried to stick with the style of the other functions, to keep some kind of likeness WRT the current single-shot remove functions. [And I just can't format correctly my list items on bugzilla (yet), sorry about that…]
I also think removing the ecisting clearing methods into 1 full clearing option would be good too :) Could we have this bug accepted? ^.^
I understand your request, but I'd like to get some (maintainer) feedback on my patch first. And given the separation between Personal Data and Preferences > Privacy (where cache settings and clearing belong), the best I could think of right now would be adding another button between “Help” and “Close” to do cookies+passwords cleaning at the same time. Also, if you want to be able to clear your passwords quickly, either you can accept to do two more clicks (one of the tab, the other on the “remove all” button), or you can choose not to store them when you're prompted. :p
+/* Is it OK to have it called *_cb although it is not really called by + sending an explicit signal? See below. */ static void +action_treemodel_n_rows_changed_cb (PdmActionInfo *action) I'd call it update_remove_all_sensitivity or something like that. +static void +pdm_dialog_password_remove_all (PdmActionInfo *info, + gpointer data) I'd rather move this into the backend, implementing a new ephy_password_manager_remove_all function. (And you don't need the extra selection handling here either.) + gtk_button_set_image (GTK_BUTTON (cookies_remove_all_button), + gtk_image_new_from_stock (GTK_STOCK_DELETE, + GTK_ICON_SIZE_BUTTON)); + + gtk_button_set_image (GTK_BUTTON (passwords_remove_all_button), + gtk_image_new_from_stock (GTK_STOCK_DELETE, + GTK_ICON_SIZE_BUTTON)); Can't you set these in the glade file itself?
Created attachment 95401 [details] [review] Updated patch, see comments > I'd call it update_remove_all_sensitivity or something like that. Done. +static void +pdm_dialog_password_remove_all (PdmActionInfo *info, + gpointer data) > I'd rather move this into the backend, implementing a new > ephy_password_manager_remove_all function. Done. Not added to the Iface, though. As far as I understand it, that might be cleaner and more efficient, but since this is not a critical function, calling “list” and “remove” shouldn't harm, and that reuses already-there code instead of duplicating it. + gtk_button_set_image (GTK_BUTTON (cookies_remove_all_button), + gtk_image_new_from_stock (GTK_STOCK_DELETE, + GTK_ICON_SIZE_BUTTON)); + + gtk_button_set_image (GTK_BUTTON (passwords_remove_all_button), + gtk_image_new_from_stock (GTK_STOCK_DELETE, + GTK_ICON_SIZE_BUTTON)); > Can't you set these in the glade file itself? I must confess I didn't find how to do so (I'm missing the name of the property to set), although I tried a lot of things. I also tried and use glade itself, but there's nothing to do the label + image addition, so I guess one has to use a container, put a GtkImage and a GtkButton inside, handle spacing and so on. The above solution might be a simpler one, but I would welcome any hint (neither Google or Glade documentation helped :/). As a side note, it might be interested to see whether it's possible to refresh the content of the Personal Data window when it is opened while a password is being added. That would have helped a bit while testing my code, at least.
@Cyril: if you open epiphany.glade file in Glade2 (the use Glade3 with Epiphany is discouraged afaik, because it modifies the whole glade file when you save) you can add a button and set properties from there, including setting of a stock icon "gtk-delete" upon the button.
@Cosimo: I only have Glade3 available in Debian/unstable. And (at least in this version), the edit type is *either* Label *or* Stock, but I can't specify a given stock icon while still being able to use a different label, which I need here. Maybe that wasn't like that in Glade2? If that's the case, an XML sample would be appreciated.
Here's a quick diff [1] that adds "Remove All" button for cookies in epiphany.glade with stock-delete icon (@Cybil: it's the same one i sent you on IRC but I'm also porting it here for reference) http://anarki.lilik.it/media/my/glade-epiphany-example.diff
Created attachment 95427 [details] [review] UI-modifications in the glade file Thanks, that's what I “feared”: GtkAlignment+GtkHBox have to be explicitly added. :) Here is yet-another-patch, including all UI-related stuff in the glade file.
Can someone make a screen? I don't have the time to compile... Could wee see it for next gnome release if the patch works?
Created attachment 95430 [details] Screenshot: Remove all cookies Same button (almost) at the same place for the passwords. Given the schedule: http://live.gnome.org/TwoPointNineteen I fear it won't be included for the next release.
It is a bit better than now... Otherwise adding a history tab with also a clear all button would be appreciated, i think! Can't we have this simple button included?
(In reply to comment #17) > @Cyril: if you open epiphany.glade file in Glade2 (the use Glade3 with Epiphany > is discouraged afaik, because it modifies the whole glade file when you save) Indeed glade-3 cannot be used for Epiphany (or anything using a SCM) until bug 422823 is fixed.
(In reply to comment #16) > As a side note, it might be interested to see whether it's possible to refresh > the content of the Personal Data window when it is opened while a password is > being added. That would have helped a bit while testing my code, at least. I think it does that, the password manager backend emits the passwords-changed signal and the PDM updates itself. + * ephy_password_manager_remove_all: + * @manager: the #EphyPasswordManager + * + * Removes all password entries from the passwords database. + **/ +void +ephy_password_manager_remove_all (EphyPasswordManager *manager) It's fine for this patch, but please file a follow-up bug to make remove_all a function on the iface, implemented in the backends. + <property name="label" translatable="yes">Remove all</property> "Remove _All" (capitalisation & mnemonic) With these fixed, and using the glade diff from comment 19 instead of this patch, ok to commit. Thanks!
Follow-up for the Iface: #476411.
Bug #476411 is fixed now, so you can use the ephy_password_manager_remove_all_passwords for this.
Created attachment 98599 [details] [review] cookies removal in glade file
Created attachment 98600 [details] [review] passwords removal in glade file
Created attachment 98602 [details] [review] Mark the labels translatable
Created attachment 98604 [details] [review] [4/5] Make the PDM dialog use them (Oops, forgot to N/5 the others…)
Created attachment 98609 [details] [review] [5/5] Trim whitespaces in PDM If it is OK to commit them all, shall I commit them as one single commit? Christian: In reply to #25, it does not, I just tried and that's not the case. I didn't investigate yet, though.
"Remove all“ buttons added in r7652, for both cookies and passwords. That doesn't address exactly this bug, though.
Created attachment 100902 [details] [review] [1/2] patch to epiphany.glade to include a Clear All button Modify epiphany.glade to add a Clear All... button to PDM-Dialog.
Created attachment 100903 [details] [review] [2/2] Adds a new Clear All dialog to PDM Dialog Adds a new Clear All dialog to PDM Dialog. Screenshot following.
Created attachment 100904 [details] screenshot of the clear all dialog Screenshot of the Clear all dialog in all her sexiness :P
The "Clear all" dialogue isn't using the right HIG spacings. Just make it a GtkMessageDialog and pack the extra buttons in their vbox into GTK_MESSAGE_DIALOG(dialog)->label->parent.
Created attachment 100958 [details] [review] Updated Clear All dialog patch. Updated patch. The clear all dialog is now a GtkMessageDialog as for Chpe's last comment.
Created attachment 100959 [details] updated screenshot Updated screenshot.
Created attachment 100997 [details] [review] Clear All dialog patch v3 Updated according to Chpe comments on IRC (regarding the hseparator and the type of the message dialog, now it is a question).
Created attachment 100998 [details] Screenshot v3 Updated screenshot.
First off, sorry for my late comments, but I still have some. - 'Clean' on the button label should probably be 'Clear' - To the casual observer, I don't think it's obvious what the difference is between 'Remove All' and 'Clear All...'. The different icon (broom vs. trashcan) seems to indicate some kind of difference ("what's in the trashcan can still be brought back?") which in reality doesn't exist. - Pressing the button 'Clear All...' and then having to tick 4 checkboxes and an approval button before everything is really gone, is counter-intuitive. Also, it makes no sense that the Clear approval button isn't disabled when nothing is checked. - I expect _Cookies to clash with the _Cancel accelerator key for instance - 'Cache' is called 'Temporary Files' elsewhere in Epiphany - A secondary text is missing Suggestions: - Merge Remove All and Clear All (for bonus points, pre-check the box of the personal data that the currently visible tab shows) - A 'Clear' button for the cache is already present in the Preferences window's Privacy tab. That button could also be made to show the Clear All dialog. - Rename 'Cache' to 'Temporary Files' - Add a Help button that pops up Yelp at a documentation page explaining what the dialog does. (consult with the docs team if necessary) - Remove the colon after 'clear' and add secondary text like: 'You are about to clear personal data that is stored about the web pages you have visited. Before proceeding, check the types of information that you want to remove:' - Check if the accelerator keys don't clash I guess that's enough for now ;)
Created attachment 101111 [details] [review] [1/4] Removes the "Remove All" buttons and adds "Clean All" buttons. data/glade/epiphany.glade | 226 +++++++++++++++------------------------------ 1 files changed, 75 insertions(+), 151 deletions(-)
Created attachment 101112 [details] [review] [2/4] Clear All dialog v4 (with Help button and secondary text) + make it public. src/pdm-dialog.c | 463 ++++++++++++++++++++++++++++++++++-------------------- src/pdm-dialog.h | 13 ++ 2 files changed, 305 insertions(+), 171 deletions(-)
Created attachment 101113 [details] [review] [3/4] Link to pdm-dialog.c to show the Clear All dialog when clearing the cache. src/prefs-dialog.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)
Created attachment 101114 [details] [review] [4/4] Adds a section to the help explaining the usage of the Clear All dialog help/C/epiphany.xml | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
(git-send-bugzilla rocks!) Attached patches do what Reinout proposed. Also, maybe if these are accepted we can commit everything but the help and ask the Doc team to write a better help entry than what I wrote if necessary.
Patch 2/4: + window = ephy_dialog_get_control + (EPHY_DIALOG (checkbuttons->dialog), + properties[PROP_WINDOW].id); + ephy_gui_help (GTK_WINDOW (window), "epiphany", "clearing-personal-data"); Just use |dialog|. + /* If current toggle is active, increment and return early */ + if (gtk_toggle_button_get_active (toggle)) + { + data->num_checked++; + if (GTK_WIDGET_IS_SENSITIVE (data->clear_button) == FALSE) + { + gtk_widget_set_sensitive (data->clear_button, TRUE); + } + return; + } + else + { + data->num_checked--; + if (data->num_checked == 0) + { + /* There are no checkbuttons toggled, set the button unsensitive */ + if (GTK_WIDGET_IS_SENSITIVE (data->clear_button) == TRUE) + { + gtk_widget_set_sensitive (data->clear_button, FALSE); + } + return; + } + } Much too complicated. Do it like this: if (gtk_toggle_button_get_active (button)) num++; else num--; gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_CLEAR, data->num_checked == 0); Also then you don't need to store the clear_button and can just put all the buttons in the gtk_dialog_add_buttons call directly, below. + g_slice_free (PdmClearAllDialogButtons, checkbuttons); Put that in the GDestroyNotify to "response" signal, see below. + gtk_window_set_title (GTK_WINDOW (dialog), _("Clear all personal data")); Use titlecase for the string. + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_HELP, + GTK_RESPONSE_HELP, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + NULL); + clear_button = gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CLEAR, + GTK_RESPONSE_OK); Won't this give the buttons the wrong order (Help, Cancel, Clear instead of Help, Clear, Cancel)? + g_object_set (G_OBJECT (GTK_MESSAGE_DIALOG (dialog)->label), + "selectable", FALSE, NULL); Why? (And if we really needed that, there's gtk_label_set_selectable). + alignment = gtk_alignment_new (0.5, 0.5, 1, 1); + g_object_set (G_OBJECT (alignment), + "left-padding", 12, NULL); + gtk_container_add (GTK_CONTAINER (alignment), vbox); + + gtk_container_add (GTK_CONTAINER (GTK_MESSAGE_DIALOG (dialog)->label->parent), + alignment); + gtk_widget_show (alignment); What's that for? Just put the vbox directly there: gtk_box_pack_start (GTK_BOX (GTK_MESSAGE_DIALOG (dialog)->label->parent), vbox, FALSE, FALSE, 0); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), + _("<small><i><b>Note:</b> You cannot undo this action. " + "The data you are choosing to clear " + "will be deleted forever.</i></small>")); + g_object_set (G_OBJECT (label), + "xpad", 6, NULL); gtk_misc_set_padding(). + gtk_widget_set_size_request (label, 330, -1); That shouldn't be necessary. + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), + label); It's a box, use gtk_box_pack_start/end. + g_signal_connect (dialog, "response", + G_CALLBACK (clear_all_dialog_response_cb), + checkbuttons); g_signal_connect_data, since you need to free |data| somewhere (response is not guaranteed to be called, e.g. when closed with the X in the window border).
Created attachment 101366 [details] [review] [2/4] Clear all dialog updated according to chpe comments Thanks for the review Christian. I fixed what you suggested, but two things: - According to HIG [1], the right order for buttons should be Help, Cancel, Clear, so I left it that way. - I need the gtk_widget_size_request for the label because otherwise it will not wrap properly (too early)...I added a comment explaining that in the code. Also, I modified the checkbuttons label to use sentence capitalization to respect HIG. [1] http://library.gnome.org/devel/hig-book/stable/windows-utility.html.en
+ gtk_widget_show (dialog); Don't show the dialogue before you've put all the content in it (i.e. move this to the end of the function), and use gtk_window_present(). With that fixed, oktc. Thanks!
Committed with that change, closing as FIXED. ------------------------------------------------------------------------ r7793 | cosimoc | 2007-12-21 09:55:25 +0100 (ven, 21 dic 2007) | 3 lines Adds a "Clear All" dialog to clear all the privacy information, and a help section explaining its usage. Close bug #148314.
I also sent a mail to doc-list and i18n-list to notify them for these changes, and asking if they want to review/improve the help entry.
Comments on the help page: + &fr; let you clear all your personal data it remembered in an easy way. 1. "let" should be "lets". 2. The word "it" is dangling, because there's nothing for it to refer to. 3. "remembered in an easy way" is either a non-sequitur (as opposed to remembered in a hard way?) or offensive (if it was easy I wouldn't have needed to look in the help), and it's not clear which. + The Clear All dialog, which can be accessed by clicking on the 4. I don't care about accessing a dialog, I care about clearing the stuff that the browser has remembered. Tell me how to do that instead. + <guibutton>Clear All...</guibutton> on the bottom right corner of the + Personal Data Manager, let you specify the items of your personal data you want 5. "let" should be "lets". + to clean. For details see: <xref linkend="managing-cookies"/>, 6. It's not about "cleaning" stuff, it's about clearing/deleting it. + <xref linkend="managing-passwords"/> and <xref linkend="overview-of-history"/>. + Note that the operation is not undoable, and by clicking on <guibutton>Clear</guibutton> + you will lose all the personal data of the selected kind. 7. "Note that" is a redundant phrase. (If something's not noteworthy, it shouldn't be in the help in the first place.) I suggest rewriting this help as three sentences: the first mentioning *why* you might want to clear private data, the second describing how to do it (just where the button is, no need to discuss the contents of the dialog itself), and the third explaining that it won't affect any accounts on the Web sites themselves. Comments on the UI: It doesn't make sense to have a "Clear All..." button, that lets you clear history and cache entries as well as cookies and passwords, accessed from a window that refers only to cookies and passwords. It is also fairly likely that you want to access the function in a hurry, and making it a secondary dialog defeats this. I suggest making it a menu item instead, like it is in Firefox, Safari, and Opera.