GNOME Bugzilla – Bug 105639
You can't remove/manage the files in "Actions->open recents"
Last modified: 2015-03-24 13:00:45 UTC
There is no way to clean the history in the "Open recents" menu.
Created attachment 21840 [details] [review] Patch for HEAD to add a Clear Recent menu item to Open Recent menu
This is an important privacy issue for many users. Is this ok to commit?
The question is "how do we want to manage the recent stuff?". Usability people: is it ok to add a "Clear recent" menu item below the recent files? William: one slight improvement you could make is to set the menu item insensitive when there's no recent files. Or hide it. I don't know what's best.
Created attachment 21853 [details] [review] updated patch to make menu insensitive when recent list is empty
FYI: I just posted an enhancement bug which is a bit related to this bug, it's bug #128712. (That bug is more general, and suggests to make it possible to turn off all `Recent Files' functionality.)
Created attachment 23652 [details] [review] Updated patch to remove icon and ChangeLog since it gets out of sync too fast
OS X has this feature. I think it is really important for privacy and security issues. There is currently no user visible way to clear this menu. However, I suspect that it is too late for this to go in now.
I'd really like the usability people to tell us what they think. Is it ok to add a "Clear Recent Documents" menu item in the Actions->Recent Documents menu? Or is there some better way to do it?
Well, personally I'd be happy enough to see it right there on the menu (this is also how the Mac does it), but I'd probably like to see a confirmation alert in case I hit it by mistake. The only other place I can think that it might go would be as a button in the Panel Preferences window, but that's so little-used and buried so deep into the main menu these days that I doubt anyone would ever find it :) (Much like on XP, where you have to right-click the Start menu, select Properties, go to the Start Menu tab and click the Clear button...) Note: if we want this to go in for 2.6 we probably still have time to claim that it's a ui-review bug :)
Created attachment 23678 [details] [review] updated patch with a confirmation dialog
Created attachment 23679 [details] screenshot of confirmation dialog
Eek, Yes and No buttons :) The HIG says to use buttons that match the actions in the alert, so in this case the buttons should be "Cancel" and "Clear".
Created attachment 23817 [details] [review] updated patch to use cancel/clear buttons
Created attachment 23818 [details] screenshot of new buttons
The Cancel and Clear stock buttons both seem to use _C.
Yeah, that's a bummer, would be good if you could do something about that. (Ideally, change _Clear to C_lear). Also, from the screenshot it looks as though Cancel is the default button... in confirmation alerts like this it's usually better to make the 'yes I really meant it' button the default, as 99% of the time you really did mean it, and you're not really going to do any unrecoverable damage even if you do confirm by mistake.
Created attachment 24068 [details] [review] updated patch to use C_lear and set default response
Jon: + Apologies for taking so long to get to this. I think we need to punt this until 2.8 now. + Using diff -p makes reviewing patches a tad easier +static void +panel_recent_menu_activate_cb (GtkMenuItem *menu_item, gpointer ... +{ + EggRecentModel *model = (EggRecentModel *)data; + Might as well make the second argument an EggRecentModel as you've already casted the function pointer + Put each function argument in the prototype on a separate line + submenu = gtk_menu_item_get_submenu (menu_item); + if (recent_list == NULL) { + gtk_widget_set_sensitive (submenu, FALSE); + } else { + gtk_widget_set_sensitive (submenu, TRUE); + } + You should be setting the menu item as insensitive rather than the sub-menu, surely ? + The rest of the panel code generally doesn't use redundant braces or explicit NULL checks: if (recent_list) gtk_widget_set_sensitive (menu_item, TRUE); else gtk_widget_set_sensitive (menu_item, FALSE); + GtkWidget *dialog; + gint response; + Line up the variable names and use int/char instead of gint/gchar "<span size=\"larger\" weight=\"bold\">%s</span>\n\n<span>%s</span>" + Why not: "<big><b>%s</b></big>\n\n%s" + gtk_label_set_use_markup + (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label), TRUE); + Why not use gtk_message_dialog_new_with_markup() ? The label member is private. + gtk_window_stick (GTK_WINDOW (dialog)); + Why do you want the window stuck? + Also, I'd stick in some newlines in the code to create the dialog rather than having everything jumbled up together. Try and split the code into related sections + if (response != GTK_RESPONSE_ACCEPT) + return; + egg_recent_model_clear (model); + This is cleaner: if (response == GTK_RESPONSE_ACCEPT) egg_recent_model_clear (model); + g_signal_connect (G_OBJECT (menu_item), "activate", + G_CALLBACK (panel_recent_menu_activate_cb), + model); + Doing this in "activate" is all wrong - you'd be much better to connect to the model's "changed signal". That's what a model is for, after all. + No need for the G_OBJECT cast + menu_item = gtk_separator_menu_item_new (); + gtk_menu_append (menu, menu_item); + You're going to want to make sure this separator is hidden if the list is empty. + setup_stock_menu_item (menu_item, + panel_menu_icon_get_size (), + NULL, + _("Clear Recent Documents"), + Would using the "clear" stock icon not be good here?
Created attachment 24617 [details] [review] updated patch in response to comments
>"<span size=\"larger\" weight=\"bold\">%s</span>\n\n<span>%s</span>" > > + Why not: > >"<big><b>%s</b></big>\n\n%s" I guess this was just my bias from XHTML coding where span+style is preferred to non-structural tags. That doesn't really apply here so I have changed this to your shorter version. Actually, it would be great if all we had to do is: <span class="primary-text">%s</span><span class="secondary-text">%s</span> And then define a GNOME wide stylesheet. > + Why do you want the window stuck? I was thinking that since this dialog blocks the panel the user should be prompted on all displays so the panel doesn't appear nonresponsive. > + You're going to want to make sure this separator is hidden if the list is empty. I don't think that is necessary since the menu is effectively disabled by desensitizing the parent menu item. > + Would using the "clear" stock icon not be good here? Oops, my first patch had it. Must have removed it to see how it looked and forgot.
*** Bug 139484 has been marked as a duplicate of this bug. ***
Created attachment 28099 [details] [review] updated patch Updated to add icon to Clear button. I'm still not sure if sticking the window is the right thing to do.
No, we shouldn't make the window sticky - the dialog just shouldn't be modal. We should connect to the response handler and clear the recent files from there. Would also be good to ensure we can only have one of the dialogs open at a time - i.e. static GtkWidget *clear_recent_dialog = NULL; if (clear_recent_dialog) { gtk_window_set_screen (GTK_WINDOW (clear_recent_dialog), gtk_widget_get_screen (menuitem)); gtk_window_present (GTK_WINDOW (clear_recent_dialog)); return; } clear_recent_dialog = gtk_dialog_new ..
Created attachment 28279 [details] [review] updated patch Changed to make dialog non-modal and ensure that only one can be open at a time.
*** Bug 144395 has been marked as a duplicate of this bug. ***
Okay, I fixed up some minor things and committed: 2004-07-20 Mark McLoughlin <mark@skynet.ie> Patch from William Jon McCann <mccann@jhu.edu> in bug #105639. * panel-recent.c (clear_dialog_response): (clear_dialog_destroy): (recent_documents_clear_cb): (panel_recent_append_documents_menu): Add item to Recent Documents menu to clear the history. (panel_recent_model_changed_cb): Make the menu insensitive if no recent items are available. * panel-stock-icons.[ch]: add a new "clear" stock icon just so we can have a different mnemonic from GTK_STOCK_CLEAR. Suck.