After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 105639 - You can't remove/manage the files in "Actions->open recents"
You can't remove/manage the files in "Actions->open recents"
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
2.5.x
Other other
: High normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 139484 144395 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-02-09 14:36 UTC by sherw
Modified: 2015-03-24 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for HEAD to add a Clear Recent menu item to Open Recent menu (1.77 KB, patch)
2003-11-26 20:49 UTC, William Jon McCann
none Details | Review
updated patch to make menu insensitive when recent list is empty (2.36 KB, patch)
2003-11-27 03:27 UTC, William Jon McCann
none Details | Review
Updated patch to remove icon and ChangeLog since it gets out of sync too fast (1.85 KB, patch)
2004-01-22 22:51 UTC, William Jon McCann
none Details | Review
updated patch with a confirmation dialog (2.89 KB, patch)
2004-01-23 16:38 UTC, William Jon McCann
none Details | Review
screenshot of confirmation dialog (16.61 KB, image/png)
2004-01-23 16:39 UTC, William Jon McCann
  Details
updated patch to use cancel/clear buttons (3.19 KB, patch)
2004-01-27 18:50 UTC, William Jon McCann
none Details | Review
screenshot of new buttons (17.25 KB, image/png)
2004-01-27 18:50 UTC, William Jon McCann
  Details
updated patch to use C_lear and set default response (3.82 KB, patch)
2004-02-04 19:27 UTC, William Jon McCann
none Details | Review
updated patch in response to comments (2.86 KB, patch)
2004-02-20 20:05 UTC, William Jon McCann
none Details | Review
updated patch (4.16 KB, patch)
2004-05-27 19:26 UTC, William Jon McCann
needs-work Details | Review
updated patch (4.78 KB, patch)
2004-06-02 19:23 UTC, William Jon McCann
none Details | Review

Description sherw 2003-02-09 14:36:52 UTC
There is no way to clean the history in the "Open recents" menu.
Comment 1 William Jon McCann 2003-11-26 20:49:34 UTC
Created attachment 21840 [details] [review]
Patch for HEAD to add a Clear Recent menu item to Open Recent menu
Comment 2 William Jon McCann 2003-11-26 20:51:59 UTC
This is an important privacy issue for many users.  Is this ok to commit?
Comment 3 Vincent Untz 2003-11-26 23:52:35 UTC
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.
Comment 4 William Jon McCann 2003-11-27 03:27:09 UTC
Created attachment 21853 [details] [review]
updated patch to make menu insensitive when recent list is empty
Comment 5 Elros Cyriatan 2003-12-07 01:17:29 UTC
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.)
Comment 6 William Jon McCann 2004-01-22 22:51:36 UTC
Created attachment 23652 [details] [review]
Updated patch to remove icon and ChangeLog since it gets out of sync too fast
Comment 7 William Jon McCann 2004-01-22 22:55:12 UTC
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.
Comment 8 Vincent Untz 2004-01-22 23:01:32 UTC
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?
Comment 9 Calum Benson 2004-01-23 14:39:32 UTC
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 :)
Comment 10 William Jon McCann 2004-01-23 16:38:43 UTC
Created attachment 23678 [details] [review]
updated patch with a confirmation dialog
Comment 11 William Jon McCann 2004-01-23 16:39:49 UTC
Created attachment 23679 [details]
screenshot of confirmation dialog
Comment 12 Calum Benson 2004-01-27 17:52:21 UTC
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".
Comment 13 William Jon McCann 2004-01-27 18:50:13 UTC
Created attachment 23817 [details] [review]
updated patch to use cancel/clear buttons
Comment 14 William Jon McCann 2004-01-27 18:50:49 UTC
Created attachment 23818 [details]
screenshot of new buttons
Comment 15 William Jon McCann 2004-01-27 18:53:12 UTC
The Cancel and Clear stock buttons both seem to use _C.
Comment 16 Calum Benson 2004-01-29 14:16:39 UTC
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.
Comment 17 William Jon McCann 2004-02-04 19:27:28 UTC
Created attachment 24068 [details] [review]
updated patch to use C_lear and set default response
Comment 18 Mark McLoughlin 2004-02-13 17:09:50 UTC
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?
Comment 19 William Jon McCann 2004-02-20 20:05:39 UTC
Created attachment 24617 [details] [review]
updated patch in response to comments
Comment 20 William Jon McCann 2004-02-20 20:17:40 UTC
>"<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.
Comment 21 Mark McLoughlin 2004-04-14 16:42:32 UTC
*** Bug 139484 has been marked as a duplicate of this bug. ***
Comment 22 William Jon McCann 2004-05-27 19:26:24 UTC
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.
Comment 23 Mark McLoughlin 2004-06-02 12:43:57 UTC
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 ..
      
Comment 24 William Jon McCann 2004-06-02 19:23:29 UTC
Created attachment 28279 [details] [review]
updated patch

Changed to make dialog non-modal and ensure that only one can be open at a
time.
Comment 25 Mark McLoughlin 2004-07-18 09:32:32 UTC
*** Bug 144395 has been marked as a duplicate of this bug. ***
Comment 26 Mark McLoughlin 2004-07-20 07:26:02 UTC
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.