~stub/ubuntu/precise/calibre/devel

« back to all changes in this revision

Viewing changes to src/calibre/gui2/actions/choose_library.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-04-12 11:29:25 UTC
  • mfrom: (42.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110412112925-c7171kt2bb5rmft4
Tags: 0.7.50+dfsg-2
* debian/control: Build with libpodofo-dev to enable PDF metadata.
  (Closes: #619632)
* debian/control: Add libboost1.42-dev build dependency. Apparently it is
  needed in some setups. (Closes: #619807)
* debian/rules: Call dh_sip to generate a proper sip API dependency, to
  prevent crashes like #616372 for partial upgrades.
* debian/control: Bump python-qt4 dependency to >= 4.8.3-2, which reportedly
  fixes crashes on startup. (Closes: #619701, #620125)

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
            return
238
238
        self.stats.rename(location, newloc)
239
239
        self.build_menus()
 
240
        self.gui.iactions['Copy To Library'].build_menus()
240
241
 
241
242
    def delete_requested(self, name, location):
242
243
        loc = location.replace('/', os.sep)
253
254
                pass
254
255
        self.stats.remove(location)
255
256
        self.build_menus()
 
257
        self.gui.iactions['Copy To Library'].build_menus()
256
258
 
257
259
    def backup_status(self, location):
258
260
        dirty_text = 'no'
329
331
                    ' libraries.')%loc, show=True)
330
332
            self.stats.remove(location)
331
333
            self.build_menus()
 
334
            self.gui.iactions['Copy To Library'].build_menus()
332
335
            return
333
336
 
334
337
        prefs['library_path'] = loc
352
355
                print
353
356
        print 'before:', self.before_mem
354
357
        print 'after:', memory()/1024**2
 
358
        print
355
359
        self.dbref = self.before_mem = None
356
360
 
357
361
 
371
375
        if not self.change_library_allowed():
372
376
            return
373
377
        from calibre.gui2.dialogs.choose_library import ChooseLibrary
 
378
        self.gui.library_view.save_state()
374
379
        db = self.gui.library_view.model().db
375
 
        c = ChooseLibrary(db, self.gui.library_moved, self.gui)
 
380
        location = self.stats.canonicalize_path(db.library_path)
 
381
        self.pre_choose_dialog_location = location
 
382
        c = ChooseLibrary(db, self.choose_library_callback, self.gui)
376
383
        c.exec_()
 
384
        self.choose_dialog_library_renamed = getattr(c, 'library_renamed', False)
 
385
 
 
386
    def choose_library_callback(self, newloc, copy_structure=False):
 
387
        self.gui.library_moved(newloc, copy_structure=copy_structure)
 
388
        if getattr(self, 'choose_dialog_library_renamed', False):
 
389
            self.stats.rename(self.pre_choose_dialog_location, prefs['library_path'])
 
390
        self.build_menus()
 
391
        self.gui.iactions['Copy To Library'].build_menus()
377
392
 
378
393
    def change_library_allowed(self):
379
394
        if os.environ.get('CALIBRE_OVERRIDE_DATABASE_PATH', None):