Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-09-2011, 12:41 PM   #1
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Change in removing library

I noticed that 0.8.8 introduced this change:
  • Remove the delete library functionality from calibre, instead you can now remove a library, so calibre will forget about it, but you have to delete the files manually
What was the design decision behind this change?
Halo is offline   Reply With Quote
Old 07-09-2011, 12:48 PM   #2
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 4,987
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
Moved

EDIT: Misunderstood. Moved back

Last edited by chaley; 07-09-2011 at 01:12 PM.
chaley is offline   Reply With Quote
Old 07-09-2011, 12:49 PM   #3
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 4,987
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
See http://www.mobileread.com/forums/sho...d.php?t=131999 for the trigger.
chaley is offline   Reply With Quote
Old 07-09-2011, 01:09 PM   #4
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Quote:
Originally Posted by chaley View Post
Great, that's what I thought it was. This is the wrong solution to this problem and I'd like to write some code to fix it properly. I think it's a simple fix and can be an easy hack for me to get involved with more calibre development.

The problem here is that calibre needs to own the folder where the files reside. The fix is simple. When creating a new library, calibre should prompt for the library name in addition to the location that it already asks for. Then it should create a sub-directory with the library name and use that for the library.

This is the correct course of action because it (1) prevents the user from pointing calibre at an existing directory with files in it and (2) does the right thing for the user by creating an empty directory and saves them work. Not removing the files when removing the library places more work on the user. The user should not do work that the computer can do. The computer should serve the user.

I looked in calibre/src/calibre/gui2/dialogs and choose_library.ui which appears to be the GUI details for that dialog. Is there a tool for editing this dialog or is one expected to edit it by hand?
Halo is offline   Reply With Quote
Old 07-09-2011, 01:12 PM   #5
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Also, what is the best way to find where this change was made in bzr? I would like to reverse the change in my branch so I can experiment with this in my checkout.
Halo is offline   Reply With Quote
Old 07-09-2011, 01:16 PM   #6
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,770
Karma: 12516053
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Halo View Post
(1) prevents the user from pointing calibre at an existing directory with files in it
I believe this is currently a behavior of calibre.

Quote:
Originally Posted by Halo View Post
Not removing the files when removing the library places more work on the user. The user should not do work that the computer can do.
I think leaving the "removed library" on the drive and just removing the entries from calibre is a reasonable approach but I wouldn't mind seeing what you come up with.
DoctorOhh is offline   Reply With Quote
Old 07-09-2011, 01:20 PM   #7
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 637
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
@Halo

I like your solution.

(Users could of course add their own files, (photos, music etc.), to this sub-folder AFTER its initial creation and these would then get deleted, but this seems a lot less likely).
Agama is offline   Reply With Quote
Old 07-09-2011, 01:22 PM   #8
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,226
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
BOINC did something like that.
The initial install created a 'User' BOINC which Owned the 'project' folders.

The User GUI was granted access via the BOINC task-manager process.
theducks is online now   Reply With Quote
Old 07-09-2011, 01:23 PM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,770
Karma: 12516053
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Currently calibre forces you to choose an empty folder to create a new library. This behavior has been around for quite a while.

Edit:
Quote:
Release: 0.7.21 [01 Oct, 2010]

Bug Fixes

Welcome wizard: Prevent the user from choosing a non empty folder as her calibre library
Interesting that this was in place 8 months before the user mentioned in the link deleted his desktop. With the current remove library change any other bombs waiting to go off are averted.

Last edited by DoctorOhh; 07-09-2011 at 01:30 PM.
DoctorOhh is offline   Reply With Quote
Old 07-09-2011, 01:25 PM   #10
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 4,987
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
Calibre already insists that destination folder for a library be empty. How does adding a subfolder make it better? I end up with a folder with exactly one thing in it, another folder. Of course, you might be suggesting that the containing folder be arbitrary, but then you run into other problems such as name collisions.

One consequence: it would lengthen the fixed part of the path thereby shortening the variable part, something that will make people unhappy.
chaley is offline   Reply With Quote
Old 07-09-2011, 01:30 PM   #11
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 4,987
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Halo View Post
Also, what is the best way to find where this change was made in bzr? I would like to reverse the change in my branch so I can experiment with this in my checkout.
Don't remember the bzr revision, but the code is in delete_requested in choose_library.py (line 253).
chaley is offline   Reply With Quote
Old 07-09-2011, 01:36 PM   #12
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 637
Karma: 436517
Join Date: Jul 2010
Location: UK
Device: PRS-300, PW2
Quote:
Originally Posted by chaley View Post
Calibre already insists that destination folder for a library be empty.
Good point.

I guess it's one of the 'problems' with rapidly developing software: deciding how much 'redundant' code to keep just to cope with situations which could only arise under older versions.
Agama is offline   Reply With Quote
Old 07-09-2011, 02:17 PM   #13
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Quote:
Originally Posted by chaley View Post
Calibre already insists that destination folder for a library be empty. How does adding a subfolder make it better?
Oh, I didn't realize this. I see it in choose_library.py now. I'm glad this safety mechanism is there.

OK, so assume that I didn't know about the empty subfolder requirement. I thought that calibre would still let you pick any folder at all. This still requires the user to create an empty folder using their operating system tools (shell, Windows explorer, Mac Finder, whatever). I think it would be a nice touch if calibre took care of the folder creation for the user. Let it create that empty folder based on a library name supplied by the user.

Here's a mockup of how I would change the Choose Library dialog:



The user selects where they want their library to be stored and enters a name for the library. Calibre creates an empty folder with the library name at the location and stores its files there. Come to think of it, why is the "new location" field blank? It would help to populate that with either (1) the basename of the currently open library or (2) the value of $HOME.

If it helps to know where I am coming from, I'm thinking of how I can make a program like calibre easier for my mom to use by adding some polish. She's not very computer literate, and come to think of it neither are many of the computer users that I deal with day-to-day.
Attached Thumbnails
Click image for larger version

Name:	Choose Library Mockup.png
Views:	183
Size:	35.6 KB
ID:	74069  
Halo is offline   Reply With Quote
Old 07-09-2011, 03:04 PM   #14
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 4,987
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
I think your idea has merit. Go for it.

Be careful of the meaning of "new location" when you are changing libraries vs creating a library. In one case it is a library, but in the other it is a folder that will contain the library. I think you need to work through how I the user know what is what.

Using the "mom test" isn't bad. If she understands *without your help*, then you probably have something.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to change Library settings? Serena enTourage eDGe 4 06-08-2011 08:14 AM
Can you change the library while a reader is connected? Kirtai Calibre 2 09-17-2010 07:38 PM
Calibre 0.7.13 - Change library bug ? zzmijarevic Calibre 9 08-08-2010 01:57 PM
Removing Deleted Files / Refresh the Library pragmortal Calibre 4 09-23-2009 04:51 AM
Change library path? Slite Calibre 2 09-30-2008 10:52 AM


All times are GMT -4. The time now is 12:01 PM.


MobileRead.com is a privately owned, operated and funded community.