mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Add first run disclaimer.
This commit is contained in:
parent
364729d28f
commit
cafd67924e
@ -10,6 +10,7 @@ from functools import partial
|
|||||||
|
|
||||||
from PyQt4.Qt import QMenu
|
from PyQt4.Qt import QMenu
|
||||||
|
|
||||||
|
from calibre.gui2 import JSONConfig
|
||||||
from calibre.gui2.actions import InterfaceAction
|
from calibre.gui2.actions import InterfaceAction
|
||||||
|
|
||||||
class StoreAction(InterfaceAction):
|
class StoreAction(InterfaceAction):
|
||||||
@ -18,6 +19,8 @@ class StoreAction(InterfaceAction):
|
|||||||
action_spec = (_('Get books'), 'store.png', None, None)
|
action_spec = (_('Get books'), 'store.png', None, None)
|
||||||
|
|
||||||
def genesis(self):
|
def genesis(self):
|
||||||
|
self.config = JSONConfig('store_action')
|
||||||
|
|
||||||
self.qaction.triggered.connect(self.search)
|
self.qaction.triggered.connect(self.search)
|
||||||
self.store_menu = QMenu()
|
self.store_menu = QMenu()
|
||||||
self.load_menu()
|
self.load_menu()
|
||||||
@ -31,9 +34,30 @@ class StoreAction(InterfaceAction):
|
|||||||
self.qaction.setMenu(self.store_menu)
|
self.qaction.setMenu(self.store_menu)
|
||||||
|
|
||||||
def search(self):
|
def search(self):
|
||||||
|
self.first_run_check()
|
||||||
from calibre.gui2.store.search import SearchDialog
|
from calibre.gui2.store.search import SearchDialog
|
||||||
sd = SearchDialog(self.gui.istores, self.gui)
|
sd = SearchDialog(self.gui.istores, self.gui)
|
||||||
sd.exec_()
|
sd.exec_()
|
||||||
|
|
||||||
def open_store(self, store_plugin):
|
def open_store(self, store_plugin):
|
||||||
|
self.first_run_check()
|
||||||
store_plugin.open(self.gui)
|
store_plugin.open(self.gui)
|
||||||
|
|
||||||
|
def first_run_check(self):
|
||||||
|
if self.config.get('first_run', True):
|
||||||
|
self.config['first_run'] = False
|
||||||
|
from calibre.gui2 import info_dialog
|
||||||
|
info_dialog(self.gui, _('Get Books Disclaimer'),
|
||||||
|
_('<p>Calibre helps you find books to read by connecting you with outside stores. '
|
||||||
|
'The stores are a variety of big, independent, free, and public domain sources.</p>'
|
||||||
|
'<p>Using the integrated search you can easily find what store has the book you\'re '
|
||||||
|
'looking for. It will also give you a price, DRM status as well as a lot of '
|
||||||
|
'other useful information.</p>'
|
||||||
|
'<p>All transaction (paid or otherwise) are handled between you and the store. '
|
||||||
|
'Calibre is not part of this process and any issues related to a purchase need to '
|
||||||
|
'be directed to the actual store. Be sure to double check that any books you get '
|
||||||
|
'will work with you device. Double check for format and '
|
||||||
|
'<a href="http://en.wikipedia.org/wiki/Digital_rights_management">DRM</a> '
|
||||||
|
'restrictions.</p>'),
|
||||||
|
show=True, show_copy_button=False)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user