Opened 14 years ago

Closed 6 years ago

#5026 closed bug (fixed)

List of folders keeps growing (easy)

Reported by: humdinger Owned by: jscipione
Priority: normal Milestone: R1
Component: Preferences/Backgrounds Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev34158.

When you invoke the Backgrounds add-on on a folder, or if you want to set a folder-background by invoking Backgrounds' drop-down menu "Other folder...", the folder gets added to the bottom of the drop-down menu.

It's like a recent folders list. Only, the list keeps growing with every selected folder. I think showing the number of folders defined with the "Recent Folders" setting, that's currently inside the Deskbar Preferences would be a good idea. No need for an awkward "Clean Folder List" menu item.

Maybe also a "Recent Folders" heading like in the "Favorites" menu of Save file dialogs.

Change History (15)

comment:1 by korli, 14 years ago

Owner: changed from korli to nobody

comment:2 by pulkomandy, 9 years ago

Summary: List of folders keeps growingList of folders keeps growing (easy)

comment:3 by closequarters, 6 years ago

Hello everyone, new to contributing to Haiku, but trying to pick something that seemed reasonably straightforward. This ticket seemed to fit the bill. After reviewing the code for the Backgrounds pref app and the Deskbar I think I have an idea how to fix this. My plan here is to load the Deskbar settings file using DeskbarUtils::GetDeskbarSettingsDirectory() as the starting path, retrieve the "recent files" setting, and then ensure that whenever the fWorkspaceMenu is added to in BackgroundView that I limit the total number of folder-specific entries in the menu to the same number in the Deskbar setting.

I've noticed there's a bunch of other tickets related to the Backgrounds pref app, I'm wondering if maybe someone was hoping to solve them all in one go and maybe that's why this ticket wasn't picked up yet? This ticket is quite old but I'm happy to work it if it's still valid. Thanks. (PS- I'll also sign up for the mailing lists etc but I wanted to start by making sure no one else was actively working this ticket)

comment:4 by pulkomandy, 6 years ago

Hi,

As far as I know no one is currently working on the Backgrounds preferences. I think it's just that most people found other things more important for now. Your help is welcome and it looks like an easy place to start contributing.

Your approach looks correct. Maybe there should be an easier way for apps to retrieve the setting, but let's start with loading the settings file using DeskbarUtils and we'll see later on how to improve on this.

comment:6 by Janus, 6 years ago

I think if that setting is not universal there isn't a good reason to use that value in Background. Every app chooses that value and as korli point out Tracker has that settings but is not modifiable (I think the settings window had a FilePanel item in the past) now the value is stuck at 10.

Last edited 6 years ago by Janus (previous) (diff)

comment:7 by closequarters, 6 years ago

I'm perfectly happy having a constant "recent folders setting" value in the Backgrounds preflet, instead of pulling in the setting from the Deskbar. That certainly makes this ticket a lot simpler! I'll go with that approach unless anyone has objections. Seems like korli and janus are onboard.

comment:8 by closequarters, 6 years ago

Patch ready for code review: https://review.haiku-os.org/c/haiku/+/285 This is my first Haiku patch, so I'm sure I've missed something style wise, but I'm looking forward to feedback.

comment:9 by closequarters, 6 years ago

For the record, we settled on a constant value of 10 recent folders, which is defined within the Backgrounds preferences app itself. There are no references to Tracker or Deskbar in the patch for the ticket.

I did not add the "Recent folders" decorated file separator as suggested in the ticket description. While it would be possible to pull it in from the Tracker code (and I succeeded in doing so during my development), I was advised by my code reviewers on Gerrit not to make that change as part of this ticket.

Finally, my patch is nearly accepted on Gerrit. Would it be possible to assign me as owner of this ticket? I do not have rights to change ticket status or ownership. I would appreciate being the resolver on record.

comment:10 by pulkomandy, 6 years ago

It is not possible to assign tickets to people who did not get commit access yet. You will be credited for your changes by being author of the git commit (and a mention in the monthly activity report, once the changes are merged). Sorry about this.

comment:11 by waddlesplash, 6 years ago

Resolution: fixed
Status: newclosed

Merged as hrev52033. Thanks!

comment:12 by jscipione, 6 years ago

Resolution: fixed
Status: closedreopened

Reopening to fix the one missing piece of this which is to connect up the recent folders setting. The rest is all good. See https://review.haiku-os.org/#/c/haiku/+/320/ for more details.

comment:13 by jscipione, 6 years ago

Owner: changed from nobody to jscipione
Status: reopenedin-progress

comment:14 by closequarters, 6 years ago

Can we close this again? The change proposed really has nothing to do with fixing the Backgrounds preflet folders growing. My change did indeed prevent the folder list from growing without end. If we want to update Backgrounds again so that we pull the "recent folder count" from somewhere else, that's fine by me but I think it should be a separate ticket

comment:15 by waddlesplash, 6 years ago

Resolution: fixed
Status: in-progressclosed

Indeed.

Note: See TracTickets for help on using tickets.