rschroll / beru

The Basic Epub Reader for Ubuntu
http://rschroll.github.io/beru/
GNU General Public License v3.0
24 stars 12 forks source link

Refresh Library #21

Closed rschroll closed 10 years ago

rschroll commented 11 years ago

As we mentioned in #20, Beru won't notice books added to the library directory while it's running. This isn't a big deal, but it would be pretty easy to add a "Refresh" button to the LocalBooks page.

Alternatively, we could watch that directory for files being added or removed and update the list automatically.

rschroll commented 10 years ago

There is a QFileSystemWatcher that could do some of what we want, but when watching directories, it doesn't seem to tell you which file therein changed. It's also not recursive, so we'd have to set up a watch for every subdirectory of the Books directory (see #30).

So I think the better solution is either to poll occasionally or put a "Refresh" button in the toolbar. Any thoughts, @stuartlangridge?

stuartlangridge commented 10 years ago

Arguing both sides of this:

I think that there are nice benefits in it being magic -- that is, that new books "Just Appear" when added. So I suggest adding a watch for every subdirectory. That's so much nicer than having to manually punch a button.

On the other hand, it's disconcerting to have things happen by magic. In particular, people often don't expect something to notice a change automatically, because they've been conditioned by the fact that almost every app does not. So they'll go searching for a "refresh" button without even looking to see if it happened automatically. It's the autocondimenting phenomenon applied to UI. That argues for an explicit refresh button in the toolbar.

rschroll commented 10 years ago

I've gone with a manual refresh right now, since it was five lines of code or so. Issue #37 will track an automatic solution.