mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
version 0.4.56
This commit is contained in:
parent
941de96559
commit
b6231d5750
@ -134,9 +134,10 @@ _check_symlinks_prescript()
|
||||
for dep in deps:
|
||||
match = re.search(r'(Qt\w+?)\.framework', dep)
|
||||
if not match:
|
||||
print dep
|
||||
raise Exception('a')
|
||||
continue
|
||||
match = re.search(r'(phonon)\.framework', dep)
|
||||
if not match:
|
||||
print dep
|
||||
raise Exception('Unknown Qt dependency')
|
||||
module = match.group(1)
|
||||
newpath = fp + '%s.framework/Versions/Current/%s'%(module, module)
|
||||
cmd = ' '.join(['install_name_tool', '-change', dep, newpath, path])
|
||||
@ -188,9 +189,7 @@ _check_symlinks_prescript()
|
||||
|
||||
|
||||
def run(self):
|
||||
plugin_files = self.build_plugins()
|
||||
py2app.run(self)
|
||||
self.add_qt_plugins()
|
||||
resource_dir = os.path.join(self.dist_dir,
|
||||
APPNAME + '.app', 'Contents', 'Resources')
|
||||
frameworks_dir = os.path.join(os.path.dirname(resource_dir), 'Frameworks')
|
||||
@ -208,6 +207,8 @@ _check_symlinks_prescript()
|
||||
f.close()
|
||||
os.chmod(path, stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH|stat.S_IREAD\
|
||||
|stat.S_IWUSR|stat.S_IROTH|stat.S_IRGRP)
|
||||
self.add_qt_plugins()
|
||||
plugin_files = self.build_plugins()
|
||||
|
||||
print
|
||||
print 'Adding clit'
|
||||
@ -219,8 +220,12 @@ _check_symlinks_prescript()
|
||||
print 'Adding pdftohtml'
|
||||
os.link(os.path.expanduser('~/pdftohtml'), os.path.join(frameworks_dir, 'pdftohtml'))
|
||||
print 'Adding plugins'
|
||||
module_dir = os.path.join(resource_dir, 'lib', 'python2.5', 'lib-dynload')
|
||||
for src, dest in plugin_files:
|
||||
os.link(src, os.path.join(frameworks_dir, dest))
|
||||
if 'dylib' in dest:
|
||||
os.link(src, os.path.join(frameworks_dir, dest))
|
||||
else:
|
||||
os.link(src, os.path.join(module_dir, dest))
|
||||
print
|
||||
print 'Installing prescipt'
|
||||
sf = [os.path.basename(s) for s in all_names]
|
||||
@ -264,7 +269,8 @@ def main():
|
||||
'argv_emulation' : True,
|
||||
'iconfile' : 'icons/library.icns',
|
||||
'frameworks': ['libusb.dylib', 'libunrar.dylib'],
|
||||
'includes' : ['sip', 'pkg_resources', 'PyQt4.QtSvg',
|
||||
'includes' : ['sip', 'pkg_resources', 'PyQt4.QtXml',
|
||||
'PyQt4.QtSvg',
|
||||
'mechanize', 'ClientForm', 'usbobserver',
|
||||
'genshi', 'calibre.web.feeds.recipes.*',
|
||||
'IPython.Extensions.*', 'pydoc'],
|
||||
@ -284,7 +290,7 @@ def main():
|
||||
setup_requires = ['py2app'],
|
||||
)
|
||||
if auto:
|
||||
subprocess.call(('sudo', 'shutdown', '-h', '+1'))
|
||||
subprocess.call(('sudo', 'shutdown', '-h', '+2'))
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -1,7 +1,7 @@
|
||||
''' E-book management software'''
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
__version__ = '0.4.55'
|
||||
__version__ = '0.4.56'
|
||||
__docformat__ = "epytext"
|
||||
__author__ = "Kovid Goyal <kovid at kovidgoyal.net>"
|
||||
__appname__ = 'calibre'
|
||||
|
@ -13,6 +13,7 @@ from calibre.gui2 import qstring_to_unicode, error_dialog, question_dialog
|
||||
from calibre.gui2.widgets import PythonHighlighter
|
||||
from calibre.utils import sendmail
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre import isosx
|
||||
|
||||
class UserProfiles(QDialog, Ui_Dialog):
|
||||
|
||||
@ -69,7 +70,7 @@ class UserProfiles(QDialog, Ui_Dialog):
|
||||
pt.close()
|
||||
sendmail(subject='Recipe for '+title,
|
||||
attachments=[pt.name],
|
||||
body='The attached file: %s is a recipe to download %s.'%(os.path.basename(pt.name), title))
|
||||
body=_('Save the text below into a file named recipe.py and send the file to your friends, to allow them to use this recipe.') if isosx else _('The attached file: %s is a recipe to download %s.')%(os.path.basename(pt.name), title))
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ makefile = pyqtconfig.QtGuiModuleMakefile (
|
||||
# ".dll" extension on Windows).
|
||||
makefile.extra_lib_dirs = ['../../.build', '..\\..\\release', '../../']
|
||||
makefile.extra_libs = ['pictureflow0' if 'win' in sys.platform and 'darwin' not in sys.platform else "pictureflow"]
|
||||
makefile.extra_cflags = ['-arch i386', '-arch ppc']
|
||||
makefile.extra_cflags = ['-arch i386', '-arch ppc'] if 'darwin' in sys.platform else []
|
||||
makefile.extra_cxxflags = makefile.extra_cflags
|
||||
if 'linux' in sys.platform:
|
||||
makefile.extra_lflags = ['-Wl,--rpath=.']
|
||||
|
@ -85,7 +85,7 @@ class LocationDelegate(QAbstractItemDelegate):
|
||||
def __init__(self):
|
||||
QAbstractItemDelegate.__init__(self)
|
||||
self.icon_rect = QRect(0, 10, 150, 45)
|
||||
self.buffer = 0
|
||||
self.buffer = 5
|
||||
|
||||
def get_rects(self, index, option):
|
||||
row = index.row()
|
||||
@ -100,33 +100,21 @@ class LocationDelegate(QAbstractItemDelegate):
|
||||
return irect.united(trect).size()
|
||||
|
||||
def paint(self, painter, option, index):
|
||||
selected = bool(option.state & QStyle.State_Selected)
|
||||
active = bool(option.state & QStyle.State_Active)
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
font.setPointSize(8)
|
||||
mode = QIcon.Active if active else QIcon.Selected if selected else QIcon.Normal
|
||||
font.setPointSize(9)
|
||||
icon = QIcon(index.model().data(index, Qt.DecorationRole))
|
||||
highlight = getattr(index.model(), 'highlight_row', -1) == index.row()
|
||||
text = index.model().data(index, Qt.DisplayRole).toString()
|
||||
painter.save()
|
||||
irect, trect = self.get_rects(index, option)
|
||||
|
||||
mode = QIcon.Normal
|
||||
if highlight:
|
||||
font.setItalic(True)
|
||||
font.setBold(True)
|
||||
mode = QIcon.Active
|
||||
|
||||
painter.setFont(font)
|
||||
icon.paint(painter, irect, Qt.AlignHCenter|Qt.AlignTop, mode, QIcon.On)
|
||||
if selected:
|
||||
brect = painter.drawText(QRectF(trect), Qt.AlignTop|Qt.AlignHCenter, text)
|
||||
brect.adjust(-3, -0, 3, 0)
|
||||
painter.fillRect(brect, option.palette.highlight())
|
||||
painter.save()
|
||||
painter.setPen(Qt.DotLine)
|
||||
painter.drawRect(brect)
|
||||
painter.restore()
|
||||
painter.setBrush(option.palette.highlightedText())
|
||||
else:
|
||||
painter.setBrush(option.palette.text())
|
||||
|
||||
painter.drawText(QRectF(trect), Qt.AlignTop|Qt.AlignHCenter, text)
|
||||
painter.restore()
|
||||
|
||||
@ -140,7 +128,12 @@ class LocationModel(QAbstractListModel):
|
||||
_('Reader\n%s available'),
|
||||
_('Card\n%s available')]
|
||||
self.free = [-1, -1]
|
||||
self.highlight_row = 0
|
||||
self.highlight_row = 0
|
||||
self.tooltips = [
|
||||
_('Click to see the list of books available on your computer'),
|
||||
_('Click to see the list of books in the main memory of your reader'),
|
||||
_('Click to see the list of books on the storage card in your reader')
|
||||
]
|
||||
|
||||
def rowCount(self, parent):
|
||||
return 1 + sum([1 for i in self.free if i >= 0])
|
||||
@ -154,6 +147,8 @@ class LocationModel(QAbstractListModel):
|
||||
data = QVariant(text)
|
||||
elif role == Qt.DecorationRole:
|
||||
data = self.icons[row]
|
||||
elif role == Qt.ToolTipRole:
|
||||
return QVariant(self.tooltips[row])
|
||||
return data
|
||||
|
||||
def headerData(self, section, orientation, role):
|
||||
@ -178,7 +173,8 @@ class LocationView(QListView):
|
||||
self.reset()
|
||||
QObject.connect(self.selectionModel(), SIGNAL('currentChanged(QModelIndex, QModelIndex)'), self.current_changed)
|
||||
self.delegate = LocationDelegate()
|
||||
self.setItemDelegate(self.delegate)
|
||||
self.setItemDelegate(self.delegate)
|
||||
self.setCursor(Qt.PointingHandCursor)
|
||||
|
||||
def current_changed(self, current, previous):
|
||||
i = current.row()
|
||||
|
@ -39,6 +39,8 @@ def source_files():
|
||||
|
||||
|
||||
def update_po_files(tarball):
|
||||
if not os.getcwd().endswith('translations'):
|
||||
os.chdir('translations')
|
||||
tf = tarfile.open(tarball, 'r:gz')
|
||||
next = tf.next()
|
||||
while next is not None:
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: it\n"
|
||||
"POT-Creation-Date: 2008-05-18 08:42+PDT\n"
|
||||
"PO-Revision-Date: 2008-05-03 22:51+0200\n"
|
||||
"PO-Revision-Date: 2008-05-19 22:51+0200\n"
|
||||
"Last-Translator: Iacopo Benesperi <iacchi@iacchi.org>\n"
|
||||
"Language-Team: italiano\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -531,7 +531,7 @@ msgstr ""
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/lrs/convert_from.py:243
|
||||
msgid "Could not read from thumbnail file:"
|
||||
msgstr ""
|
||||
msgstr "Impossibile leggere dal file della miniatura:"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/lrs/convert_from.py:263
|
||||
msgid ""
|
||||
@ -1782,7 +1782,7 @@ msgstr "Aggiungi il tag a quelli disponibili e applicalo al libro corrente"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles.py:64
|
||||
msgid "No recipe selected"
|
||||
msgstr ""
|
||||
msgstr "Nessuna formula selezionata"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles.py:84
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles.py:94
|
||||
@ -1843,11 +1843,11 @@ msgstr "Esiste già una formula personalizzata di nome %s. Sovrascriverla?"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles.py:185
|
||||
msgid "Choose a recipe file"
|
||||
msgstr ""
|
||||
msgstr "Scegliere un file di formula"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles.py:185
|
||||
msgid "Recipes"
|
||||
msgstr ""
|
||||
msgstr "Formule"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:194
|
||||
msgid "Add custom news source"
|
||||
@ -1867,11 +1867,11 @@ msgstr "Rimuo&vi formula"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:198
|
||||
msgid "&Share recipe"
|
||||
msgstr ""
|
||||
msgstr "Condi&vidi formula"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:199
|
||||
msgid "&Load recipe from file"
|
||||
msgstr ""
|
||||
msgstr "Carica formula &da file"
|
||||
|
||||
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:201
|
||||
msgid ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user