mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
55ff5e7de2
@ -1752,7 +1752,7 @@
|
|||||||
sodipodi:cy="93.331604"
|
sodipodi:cy="93.331604"
|
||||||
sodipodi:cx="-166.53223"
|
sodipodi:cx="-166.53223"
|
||||||
id="path6082"
|
id="path6082"
|
||||||
style="opacity:1;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.08779998;stroke-opacity:1;filter:url(#filter6074)"
|
style="opacity:1;fill:url(#radialGradient6084);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.08779998;stroke-opacity:1;filter:url(#filter6074)"
|
||||||
sodipodi:type="arc" /></clipPath><radialGradient
|
sodipodi:type="arc" /></clipPath><radialGradient
|
||||||
inkscape:collect="always"
|
inkscape:collect="always"
|
||||||
xlink:href="#linearGradient5990"
|
xlink:href="#linearGradient5990"
|
||||||
@ -2513,7 +2513,7 @@
|
|||||||
transform="matrix(-1.7332269,0,0,1.7332269,-228.13814,-101.76485)"
|
transform="matrix(-1.7332269,0,0,1.7332269,-228.13814,-101.76485)"
|
||||||
clip-path="none" /><path
|
clip-path="none" /><path
|
||||||
sodipodi:type="arc"
|
sodipodi:type="arc"
|
||||||
style="opacity:1;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.08779998;stroke-opacity:1;filter:url(#filter6074)"
|
style="opacity:1;fill:url(#radialGradient6084);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.08779998;stroke-opacity:1;filter:url(#filter6074)"
|
||||||
id="path3915"
|
id="path3915"
|
||||||
sodipodi:cx="-166.53223"
|
sodipodi:cx="-166.53223"
|
||||||
sodipodi:cy="93.331604"
|
sodipodi:cy="93.331604"
|
||||||
@ -2901,22 +2901,8 @@
|
|||||||
id="g133">
|
id="g133">
|
||||||
<defs
|
<defs
|
||||||
id="defs135" />
|
id="defs135" />
|
||||||
<use
|
|
||||||
|
|
||||||
id="use138"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="121"
|
|
||||||
height="120" />
|
|
||||||
<clipPath
|
<clipPath
|
||||||
id="XMLID_215_">
|
id="XMLID_215_">
|
||||||
<use
|
|
||||||
|
|
||||||
id="use141"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="121"
|
|
||||||
height="120" />
|
|
||||||
</clipPath>
|
</clipPath>
|
||||||
<g
|
<g
|
||||||
clip-path="url(#XMLID_215_)"
|
clip-path="url(#XMLID_215_)"
|
||||||
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
269
resources/images/help.svg
Normal file
269
resources/images/help.svg
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://web.resource.org/cc/"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.0"
|
||||||
|
id="Livello_1"
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
viewBox="0 0 139 139"
|
||||||
|
overflow="visible"
|
||||||
|
enable-background="new 0 0 139 139"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:version="0.32"
|
||||||
|
inkscape:version="0.45+devel"
|
||||||
|
sodipodi:docname="system-help.svgz"
|
||||||
|
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
|
||||||
|
style="overflow:visible"><metadata
|
||||||
|
id="metadata3164"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs3162"><filter
|
||||||
|
inkscape:collect="always"
|
||||||
|
x="-0.132641"
|
||||||
|
width="1.265282"
|
||||||
|
y="-0.34752154"
|
||||||
|
height="1.6950431"
|
||||||
|
id="filter3547"><feGaussianBlur
|
||||||
|
inkscape:collect="always"
|
||||||
|
stdDeviation="2.7512044"
|
||||||
|
id="feGaussianBlur3549" /></filter><filter
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="filter5097"><feGaussianBlur
|
||||||
|
inkscape:collect="always"
|
||||||
|
stdDeviation="2.32"
|
||||||
|
id="feGaussianBlur5099" /></filter><filter
|
||||||
|
inkscape:collect="always"
|
||||||
|
x="-0.143268"
|
||||||
|
width="1.286536"
|
||||||
|
y="-0.072184406"
|
||||||
|
height="1.1443688"
|
||||||
|
id="filter5125"><feGaussianBlur
|
||||||
|
inkscape:collect="always"
|
||||||
|
stdDeviation="1.91024"
|
||||||
|
id="feGaussianBlur5127" /></filter></defs><sodipodi:namedview
|
||||||
|
inkscape:window-height="697"
|
||||||
|
inkscape:window-width="1024"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
guidetolerance="10.0"
|
||||||
|
gridtolerance="10.0"
|
||||||
|
objecttolerance="10.0"
|
||||||
|
borderopacity="1.0"
|
||||||
|
bordercolor="#666666"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
id="base"
|
||||||
|
inkscape:zoom="2.9352518"
|
||||||
|
inkscape:cx="99.496726"
|
||||||
|
inkscape:cy="69.329657"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:current-layer="Livello_1"
|
||||||
|
height="128px"
|
||||||
|
width="128px" />
|
||||||
|
<filter
|
||||||
|
id="AI_Sfocatura_4">
|
||||||
|
<feGaussianBlur
|
||||||
|
stdDeviation="4"
|
||||||
|
id="feGaussianBlur3096" />
|
||||||
|
</filter>
|
||||||
|
<filter
|
||||||
|
id="AI_Sfocatura_2">
|
||||||
|
<feGaussianBlur
|
||||||
|
stdDeviation="2"
|
||||||
|
id="feGaussianBlur3099" />
|
||||||
|
</filter>
|
||||||
|
<radialGradient
|
||||||
|
id="XMLID_12_"
|
||||||
|
cx="69.600098"
|
||||||
|
cy="69.576698"
|
||||||
|
r="58"
|
||||||
|
gradientTransform="matrix(1,0,0,-0.1823,0,134.8566)"
|
||||||
|
gradientUnits="userSpaceOnUse">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#000000"
|
||||||
|
id="stop3102" />
|
||||||
|
<stop
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#000000;stop-opacity:0;"
|
||||||
|
id="stop3104" />
|
||||||
|
</radialGradient>
|
||||||
|
<circle
|
||||||
|
sodipodi:ry="58"
|
||||||
|
sodipodi:rx="58"
|
||||||
|
sodipodi:cy="69.599998"
|
||||||
|
sodipodi:cx="69.599998"
|
||||||
|
style="opacity:0.7;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter5097)"
|
||||||
|
id="circle5091"
|
||||||
|
r="58"
|
||||||
|
cy="69.599998"
|
||||||
|
cx="69.599998"
|
||||||
|
transform="matrix(1.0859375,0,0,1.0859375,-3.9093733,-8.2531233)" /><ellipse
|
||||||
|
cx="69.599998"
|
||||||
|
cy="122.173"
|
||||||
|
rx="58"
|
||||||
|
ry="10.573"
|
||||||
|
id="ellipse3106"
|
||||||
|
style="opacity:0.6;fill:url(#XMLID_12_)"
|
||||||
|
sodipodi:cx="69.599998"
|
||||||
|
sodipodi:cy="122.173"
|
||||||
|
sodipodi:rx="58"
|
||||||
|
sodipodi:ry="10.573"
|
||||||
|
transform="translate(-9.9998474e-2,1.9102535)" />
|
||||||
|
|
||||||
|
<radialGradient
|
||||||
|
id="XMLID_13_"
|
||||||
|
cx="69.600098"
|
||||||
|
cy="69.600098"
|
||||||
|
r="58"
|
||||||
|
gradientUnits="userSpaceOnUse">
|
||||||
|
<stop
|
||||||
|
offset="0.6154"
|
||||||
|
style="stop-color:#EEEEEE"
|
||||||
|
id="stop3113" />
|
||||||
|
<stop
|
||||||
|
offset="0.8225"
|
||||||
|
style="stop-color:#DDDDDD"
|
||||||
|
id="stop3115" />
|
||||||
|
<stop
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#FFFFFF"
|
||||||
|
id="stop3117" />
|
||||||
|
</radialGradient>
|
||||||
|
<circle
|
||||||
|
cx="69.599998"
|
||||||
|
cy="69.599998"
|
||||||
|
r="58"
|
||||||
|
id="circle3119"
|
||||||
|
style="fill:url(#XMLID_13_)"
|
||||||
|
sodipodi:cx="69.599998"
|
||||||
|
sodipodi:cy="69.599998"
|
||||||
|
sodipodi:rx="58"
|
||||||
|
sodipodi:ry="58"
|
||||||
|
transform="matrix(1.0859375,0,0,1.0859375,-3.9093733,-8.2531233)" />
|
||||||
|
<linearGradient
|
||||||
|
id="XMLID_14_"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="27.6001"
|
||||||
|
y1="69.600098"
|
||||||
|
x2="111.6001"
|
||||||
|
y2="69.600098"
|
||||||
|
gradientTransform="matrix(1.0859375,0,0,1.0859375,-3.9093733,-8.2531233)">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#2A94EC"
|
||||||
|
id="stop3122" />
|
||||||
|
<stop
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#0057AE"
|
||||||
|
id="stop3124" />
|
||||||
|
</linearGradient>
|
||||||
|
<path
|
||||||
|
d="M 26.062502,67.328127 C 26.062502,92.477355 46.522651,112.9375 71.671877,112.9375 C 96.821104,112.9375 117.28125,92.477355 117.28125,67.328127 C 117.28125,42.178901 96.821104,21.718753 71.671877,21.718753 C 46.522651,21.718753 26.062502,42.178901 26.062502,67.328127 z"
|
||||||
|
id="path3126"
|
||||||
|
style="fill:url(#XMLID_14_)" />
|
||||||
|
<g
|
||||||
|
id="circle22111"
|
||||||
|
cy="92"
|
||||||
|
rx="36"
|
||||||
|
ry="36"
|
||||||
|
cx="343.99899"
|
||||||
|
enable-background="new "
|
||||||
|
style="opacity:0.3;filter:url(#filter3547)"
|
||||||
|
transform="matrix(1.0859375,0,0,1.0859375,-3.9093733,-8.2531233)">
|
||||||
|
<path
|
||||||
|
d="M 77.041,104.759 C 63.767,106.115 50.122,103.11 46.565,98.042 C 43.007,92.976 50.885,87.768 64.16,86.41 C 77.434,85.054 91.079,88.058 94.637,93.126 C 98.193,98.194 90.315,103.401 77.041,104.759 z"
|
||||||
|
id="path3129"
|
||||||
|
style="fill:#a8dde0" />
|
||||||
|
</g>
|
||||||
|
<linearGradient
|
||||||
|
id="circle16776_1_"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="135.5601"
|
||||||
|
y1="417.66461"
|
||||||
|
x2="161.87621"
|
||||||
|
y2="417.66461"
|
||||||
|
gradientTransform="matrix(0,1.7280523,1.7280523,0,-650.07477,-218.71693)">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#FFFFFF"
|
||||||
|
id="stop3132" />
|
||||||
|
<stop
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;"
|
||||||
|
id="stop3134" />
|
||||||
|
</linearGradient>
|
||||||
|
<path
|
||||||
|
id="circle16776"
|
||||||
|
enable-background="new "
|
||||||
|
d="M 71.671877,24.06655 C 50.288682,24.06655 32.41958,38.77123 28.113838,58.349597 C 36.698174,66.142284 52.986151,54.358777 71.671877,54.358777 C 90.357604,54.358777 106.64666,66.142284 115.22991,58.349597 C 110.92417,38.77123 93.056158,24.06655 71.671877,24.06655 z"
|
||||||
|
style="opacity:0.8;fill:url(#circle16776_1_)" />
|
||||||
|
<g
|
||||||
|
id="g3137"
|
||||||
|
transform="matrix(1.0859375,0,0,1.0859375,-3.9093733,-8.2531233)">
|
||||||
|
<defs
|
||||||
|
id="defs3139"><path
|
||||||
|
id="XMLID_10_"
|
||||||
|
d="M 27.6,69.6 C 27.6,92.759 46.441,111.6 69.6,111.6 C 92.759,111.6 111.6,92.759 111.6,69.6 C 111.6,46.441 92.759,27.6 69.6,27.6 C 46.441,27.6 27.6,46.441 27.6,69.6 z" /></defs>
|
||||||
|
<clipPath
|
||||||
|
id="XMLID_6_">
|
||||||
|
<use
|
||||||
|
xlink:href="#XMLID_10_"
|
||||||
|
id="use3143"
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="139"
|
||||||
|
height="139" />
|
||||||
|
</clipPath>
|
||||||
|
<g
|
||||||
|
clip-path="url(#XMLID_6_)"
|
||||||
|
id="g3145"
|
||||||
|
style="filter:url(#AI_Sfocatura_2)">
|
||||||
|
<path
|
||||||
|
d="M 27.6,69.6 C 27.6,92.759 46.441,111.6 69.6,111.6 C 92.759,111.6 111.6,92.759 111.6,69.6 C 111.6,46.441 92.759,27.6 69.6,27.6 C 46.441,27.6 27.6,46.441 27.6,69.6 z"
|
||||||
|
id="path3147"
|
||||||
|
style="fill:none;stroke:#00316e;stroke-width:2" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<g
|
||||||
|
transform="matrix(1.0859375,0,0,1.1113796,-3.201342,-9.3177223)"
|
||||||
|
id="g5119"
|
||||||
|
style="fill:#00316e;filter:url(#filter5125)"><path
|
||||||
|
style="fill:#00316e"
|
||||||
|
d="M 63.37,80.089 L 63.192,77.746 C 63.012,73.148 64.44,68.462 68.451,63.684 C 71.304,60.26 73.62,57.286 73.62,54.221 C 73.62,51.157 71.571,48.994 67.202,48.903 C 64.173,48.903 60.696,49.895 58.289,51.517 L 55.348,41.784 C 58.556,39.89 63.815,38.088 70.233,38.088 C 81.91,38.088 87.348,44.668 87.348,52.058 C 87.348,58.997 83.069,63.415 79.681,67.289 C 76.472,70.894 75.046,74.41 75.135,78.466 L 75.135,80.088 L 63.37,80.088 L 63.37,80.089 z"
|
||||||
|
id="path5121" /><circle
|
||||||
|
style="fill:#00316e"
|
||||||
|
sodipodi:ry="8"
|
||||||
|
sodipodi:rx="8"
|
||||||
|
sodipodi:cy="93.599998"
|
||||||
|
sodipodi:cx="69.599998"
|
||||||
|
cx="69.599998"
|
||||||
|
cy="93.599998"
|
||||||
|
r="8"
|
||||||
|
id="circle5123" /></g><g
|
||||||
|
id="g5101"
|
||||||
|
transform="matrix(1.0859375,0,0,1.0859375,-3.201342,-8.2531233)"><path
|
||||||
|
id="path3157"
|
||||||
|
d="M 63.37,80.089 L 63.192,77.746 C 63.012,73.148 64.44,68.462 68.451,63.684 C 71.304,60.26 73.62,57.286 73.62,54.221 C 73.62,51.157 71.571,48.994 67.202,48.903 C 64.173,48.903 60.696,49.895 58.289,51.517 L 55.348,41.784 C 58.556,39.89 63.815,38.088 70.233,38.088 C 81.91,38.088 87.348,44.668 87.348,52.058 C 87.348,58.997 83.069,63.415 79.681,67.289 C 76.472,70.894 75.046,74.41 75.135,78.466 L 75.135,80.088 L 63.37,80.088 L 63.37,80.089 z"
|
||||||
|
style="fill:#ffffff" /><circle
|
||||||
|
id="circle3159"
|
||||||
|
r="8"
|
||||||
|
cy="93.599998"
|
||||||
|
cx="69.599998"
|
||||||
|
sodipodi:cx="69.599998"
|
||||||
|
sodipodi:cy="93.599998"
|
||||||
|
sodipodi:rx="8"
|
||||||
|
sodipodi:ry="8"
|
||||||
|
style="fill:#ffffff" /></g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 8.4 KiB |
@ -31,13 +31,19 @@ class AdvancedUserRecipe1278063072(BasicNewsRecipe):
|
|||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
feeds = []
|
feeds = []
|
||||||
for title, url in [
|
for title, url in [
|
||||||
('Editorial', 'http://news.singtao.ca/toronto/editorial.html'),
|
('Editorial',
|
||||||
('Toronto \xe5\x9f\x8e\xe5\xb8\x82/\xe7\xa4\xbe\xe5\x8d\x80', 'http://news.singtao.ca/toronto/city.html'),
|
'http://news.singtao.ca/toronto/editorial.html'),
|
||||||
('Canada \xe5\x8a\xa0\xe5\x9c\x8b', 'http://news.singtao.ca/toronto/canada.html'),
|
('Toronto \xe5\x9f\x8e\xe5\xb8\x82/\xe7\xa4\xbe\xe5\x8d\x80'.decode('utf-8'),
|
||||||
('Entertainment', 'http://news.singtao.ca/toronto/entertainment.html'),
|
'http://news.singtao.ca/toronto/city.html'),
|
||||||
('World', 'http://news.singtao.ca/toronto/world.html'),
|
('Canada \xe5\x8a\xa0\xe5\x9c\x8b'.decode('utf-8'),
|
||||||
('Finance \xe5\x9c\x8b\xe9\x9a\x9b\xe8\xb2\xa1\xe7\xb6\x93', 'http://news.singtao.ca/toronto/finance.html'),
|
'http://news.singtao.ca/toronto/canada.html'),
|
||||||
('Sports', 'http://news.singtao.ca/toronto/sports.html'),
|
('Entertainment',
|
||||||
|
'http://news.singtao.ca/toronto/entertainment.html'),
|
||||||
|
('World',
|
||||||
|
'http://news.singtao.ca/toronto/world.html'),
|
||||||
|
('Finance \xe5\x9c\x8b\xe9\x9a\x9b\xe8\xb2\xa1\xe7\xb6\x93'.decode('utf-8'),
|
||||||
|
'http://news.singtao.ca/toronto/finance.html'),
|
||||||
|
('Sports', 'http://news.singtao.ca/toronto/sports.html'),
|
||||||
]:
|
]:
|
||||||
articles = self.parse_section(url)
|
articles = self.parse_section(url)
|
||||||
if articles:
|
if articles:
|
||||||
|
@ -67,6 +67,13 @@ if pictureflow is not None:
|
|||||||
ans = ''
|
ans = ''
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
def subtitle(self, index):
|
||||||
|
try:
|
||||||
|
return u'\u2605'*self.model.rating(index)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return ''
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.dataChanged.emit()
|
self.dataChanged.emit()
|
||||||
|
|
||||||
|
@ -759,10 +759,8 @@ class DeviceMixin(object): # {{{
|
|||||||
self.refresh_ondevice_info (device_connected = True, reset_only = True)
|
self.refresh_ondevice_info (device_connected = True, reset_only = True)
|
||||||
else:
|
else:
|
||||||
self.device_connected = None
|
self.device_connected = None
|
||||||
|
self.status_bar.device_disconnected()
|
||||||
self.location_view.model().update_devices()
|
self.location_view.model().update_devices()
|
||||||
self.vanity.setText(self.vanity_template%\
|
|
||||||
dict(version=self.latest_version, device=' '))
|
|
||||||
self.device_info = ' '
|
|
||||||
if self.current_view() != self.library_view:
|
if self.current_view() != self.library_view:
|
||||||
self.book_details.reset_info()
|
self.book_details.reset_info()
|
||||||
self.location_view.setCurrentIndex(self.location_view.model().index(0))
|
self.location_view.setCurrentIndex(self.location_view.model().index(0))
|
||||||
@ -776,10 +774,7 @@ class DeviceMixin(object): # {{{
|
|||||||
return self.device_job_exception(job)
|
return self.device_job_exception(job)
|
||||||
info, cp, fs = job.result
|
info, cp, fs = job.result
|
||||||
self.location_view.model().update_devices(cp, fs)
|
self.location_view.model().update_devices(cp, fs)
|
||||||
self.device_info = _('Connected ')+info[0]
|
self.status_bar.device_connected(info[0])
|
||||||
self.vanity.setText(self.vanity_template%\
|
|
||||||
dict(version=self.latest_version, device=self.device_info))
|
|
||||||
|
|
||||||
self.device_manager.books(Dispatcher(self.metadata_downloaded))
|
self.device_manager.books(Dispatcher(self.metadata_downloaded))
|
||||||
|
|
||||||
def metadata_downloaded(self, job):
|
def metadata_downloaded(self, job):
|
||||||
|
@ -495,6 +495,7 @@ class ConfigDialog(ResizableDialog, Ui_Dialog):
|
|||||||
li = i
|
li = i
|
||||||
self.opt_gui_layout.setCurrentIndex(li)
|
self.opt_gui_layout.setCurrentIndex(li)
|
||||||
self.opt_disable_animations.setChecked(config['disable_animations'])
|
self.opt_disable_animations.setChecked(config['disable_animations'])
|
||||||
|
self.opt_show_donate_button.setChecked(config['show_donate_button'])
|
||||||
|
|
||||||
def check_port_value(self, *args):
|
def check_port_value(self, *args):
|
||||||
port = self.port.value()
|
port = self.port.value()
|
||||||
@ -871,6 +872,7 @@ class ConfigDialog(ResizableDialog, Ui_Dialog):
|
|||||||
config['overwrite_author_title_metadata'] = self.opt_overwrite_author_title_metadata.isChecked()
|
config['overwrite_author_title_metadata'] = self.opt_overwrite_author_title_metadata.isChecked()
|
||||||
config['enforce_cpu_limit'] = bool(self.opt_enforce_cpu_limit.isChecked())
|
config['enforce_cpu_limit'] = bool(self.opt_enforce_cpu_limit.isChecked())
|
||||||
config['disable_animations'] = bool(self.opt_disable_animations.isChecked())
|
config['disable_animations'] = bool(self.opt_disable_animations.isChecked())
|
||||||
|
config['show_donate_button'] = bool(self.opt_show_donate_button.isChecked())
|
||||||
gprefs['show_splash_screen'] = bool(self.show_splash_screen.isChecked())
|
gprefs['show_splash_screen'] = bool(self.show_splash_screen.isChecked())
|
||||||
fmts = []
|
fmts = []
|
||||||
for i in range(self.viewer.count()):
|
for i in range(self.viewer.count()):
|
||||||
|
@ -356,7 +356,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="show_splash_screen">
|
<widget class="QCheckBox" name="show_splash_screen">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show &splash screen at startup</string>
|
<string>Show &splash screen at startup</string>
|
||||||
@ -665,6 +665,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QCheckBox" name="opt_show_donate_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show &donate button (restart)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page_6">
|
<widget class="QWidget" name="page_6">
|
||||||
|
@ -5,22 +5,22 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import functools
|
import functools, sys, os
|
||||||
|
|
||||||
from PyQt4.Qt import QMenu, Qt, pyqtSignal, QToolButton, QIcon, QStackedWidget, \
|
from PyQt4.Qt import QMenu, Qt, pyqtSignal, QToolButton, QIcon, QStackedWidget, \
|
||||||
QSize, QSizePolicy, QStatusBar
|
QSize, QSizePolicy, QStatusBar, QUrl, QLabel, QFont
|
||||||
|
|
||||||
from calibre.utils.config import prefs
|
from calibre.utils.config import prefs
|
||||||
from calibre.ebooks import BOOK_EXTENSIONS
|
from calibre.ebooks import BOOK_EXTENSIONS
|
||||||
from calibre.constants import isosx, __appname__, preferred_encoding
|
from calibre.constants import isosx, __appname__, preferred_encoding, \
|
||||||
from calibre.gui2 import config, is_widescreen
|
__version__
|
||||||
|
from calibre.gui2 import config, is_widescreen, open_url
|
||||||
from calibre.gui2.library.views import BooksView, DeviceBooksView
|
from calibre.gui2.library.views import BooksView, DeviceBooksView
|
||||||
from calibre.gui2.widgets import Splitter
|
from calibre.gui2.widgets import Splitter
|
||||||
from calibre.gui2.tag_view import TagBrowserWidget
|
from calibre.gui2.tag_view import TagBrowserWidget
|
||||||
from calibre.gui2.book_details import BookDetails
|
from calibre.gui2.book_details import BookDetails
|
||||||
from calibre.gui2.notify import get_notifier
|
from calibre.gui2.notify import get_notifier
|
||||||
|
|
||||||
|
|
||||||
_keep_refs = []
|
_keep_refs = []
|
||||||
|
|
||||||
def partial(*args, **kwargs):
|
def partial(*args, **kwargs):
|
||||||
@ -48,6 +48,7 @@ class SaveMenu(QMenu): # {{{
|
|||||||
class ToolbarMixin(object): # {{{
|
class ToolbarMixin(object): # {{{
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
self.action_help.triggered.connect(self.show_help)
|
||||||
md = QMenu()
|
md = QMenu()
|
||||||
md.addAction(_('Edit metadata individually'),
|
md.addAction(_('Edit metadata individually'),
|
||||||
partial(self.edit_metadata, False, bulk=False))
|
partial(self.edit_metadata, False, bulk=False))
|
||||||
@ -182,9 +183,13 @@ class ToolbarMixin(object): # {{{
|
|||||||
for ch in self.tool_bar.children():
|
for ch in self.tool_bar.children():
|
||||||
if isinstance(ch, QToolButton):
|
if isinstance(ch, QToolButton):
|
||||||
ch.setCursor(Qt.PointingHandCursor)
|
ch.setCursor(Qt.PointingHandCursor)
|
||||||
|
ch.setStatusTip(ch.toolTip())
|
||||||
|
|
||||||
self.tool_bar.contextMenuEvent = self.no_op
|
self.tool_bar.contextMenuEvent = self.no_op
|
||||||
|
|
||||||
|
def show_help(self, *args):
|
||||||
|
open_url(QUrl('http://calibre-ebook.com/user_manual'))
|
||||||
|
|
||||||
def read_toolbar_settings(self):
|
def read_toolbar_settings(self):
|
||||||
self.tool_bar.setIconSize(config['toolbar_icon_size'])
|
self.tool_bar.setIconSize(config['toolbar_icon_size'])
|
||||||
self.tool_bar.setToolButtonStyle(
|
self.tool_bar.setToolButtonStyle(
|
||||||
@ -362,12 +367,50 @@ class Stack(QStackedWidget): # {{{
|
|||||||
|
|
||||||
class StatusBar(QStatusBar): # {{{
|
class StatusBar(QStatusBar): # {{{
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
QStatusBar.__init__(self, parent)
|
||||||
|
self.default_message = __appname__ + ' ' + _('version') + ' ' + \
|
||||||
|
self.get_version() + ' ' + _('created by Kovid Goyal')
|
||||||
|
self.device_string = ''
|
||||||
|
self.update_label = QLabel('')
|
||||||
|
self.update_label.setOpenExternalLinks(True)
|
||||||
|
self.addPermanentWidget(self.update_label)
|
||||||
|
self.update_label.setVisible(False)
|
||||||
|
self._font = QFont()
|
||||||
|
self._font.setBold(True)
|
||||||
|
self.setFont(self._font)
|
||||||
|
|
||||||
def initialize(self, systray=None):
|
def initialize(self, systray=None):
|
||||||
self.systray = systray
|
self.systray = systray
|
||||||
self.notifier = get_notifier(systray)
|
self.notifier = get_notifier(systray)
|
||||||
|
self.messageChanged.connect(self.message_changed,
|
||||||
|
type=Qt.QueuedConnection)
|
||||||
|
self.message_changed('')
|
||||||
|
|
||||||
|
def device_connected(self, devname):
|
||||||
|
self.device_string = _('Connected ') + devname
|
||||||
|
self.clearMessage()
|
||||||
|
|
||||||
|
def device_disconnected(self):
|
||||||
|
self.device_string = ''
|
||||||
|
self.clearMessage()
|
||||||
|
|
||||||
|
def new_version_available(self, ver, url):
|
||||||
|
msg = (u'<span style="color:red; font-weight: bold">%s: <a href="%s">%s<a></span>') % (
|
||||||
|
_('Update found'), url, ver)
|
||||||
|
self.update_label.setText(msg)
|
||||||
|
self.update_label.setCursor(Qt.PointingHandCursor)
|
||||||
|
self.update_label.setVisible(True)
|
||||||
|
|
||||||
|
def get_version(self):
|
||||||
|
dv = os.environ.get('CALIBRE_DEVELOP_FROM', None)
|
||||||
|
v = __version__
|
||||||
|
if getattr(sys, 'frozen', False) and dv and os.path.abspath(dv) in sys.path:
|
||||||
|
v += '*'
|
||||||
|
return v
|
||||||
|
|
||||||
def show_message(self, msg, timeout=0):
|
def show_message(self, msg, timeout=0):
|
||||||
QStatusBar.showMessage(self, msg, timeout)
|
self.showMessage(msg, timeout)
|
||||||
if self.notifier is not None and not config['disable_tray_notification']:
|
if self.notifier is not None and not config['disable_tray_notification']:
|
||||||
if isosx and isinstance(msg, unicode):
|
if isosx and isinstance(msg, unicode):
|
||||||
try:
|
try:
|
||||||
@ -377,7 +420,15 @@ class StatusBar(QStatusBar): # {{{
|
|||||||
self.notifier(msg)
|
self.notifier(msg)
|
||||||
|
|
||||||
def clear_message(self):
|
def clear_message(self):
|
||||||
QStatusBar.clearMessage(self)
|
self.clearMessage()
|
||||||
|
|
||||||
|
def message_changed(self, msg):
|
||||||
|
if not msg or msg.isEmpty() or msg.isNull():
|
||||||
|
extra = ''
|
||||||
|
if self.device_string:
|
||||||
|
extra = ' ..::.. ' + self.device_string
|
||||||
|
self.showMessage(self.default_message + extra)
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
@ -492,6 +492,11 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
def title(self, row_number):
|
def title(self, row_number):
|
||||||
return self.db.title(row_number)
|
return self.db.title(row_number)
|
||||||
|
|
||||||
|
def rating(self, row_number):
|
||||||
|
ans = self.db.rating(row_number)
|
||||||
|
ans = ans/2 if ans else 0
|
||||||
|
return int(ans)
|
||||||
|
|
||||||
def cover(self, row_number):
|
def cover(self, row_number):
|
||||||
data = None
|
data = None
|
||||||
try:
|
try:
|
||||||
|
@ -96,10 +96,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="donate_button">
|
<widget class="ThrobbingButton" name="donate_button">
|
||||||
<property name="cursor">
|
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
@ -107,45 +104,13 @@
|
|||||||
<iconset resource="../../../resources/images.qrc">
|
<iconset resource="../../../resources/images.qrc">
|
||||||
<normaloff>:/images/donate.svg</normaloff>:/images/donate.svg</iconset>
|
<normaloff>:/images/donate.svg</normaloff>:/images/donate.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>64</width>
|
|
||||||
<height>64</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="autoRaise">
|
<property name="autoRaise">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3"/>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="vanity">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>90</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
@ -259,7 +224,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Choose saved search or enter name for new saved search</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumContentsLength">
|
<property name="minimumContentsLength">
|
||||||
<number>15</number>
|
<number>15</number>
|
||||||
@ -353,6 +318,8 @@
|
|||||||
<addaction name="action_save"/>
|
<addaction name="action_save"/>
|
||||||
<addaction name="action_del"/>
|
<addaction name="action_del"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="action_help"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="action_preferences"/>
|
<addaction name="action_preferences"/>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="action_add">
|
<action name="action_add">
|
||||||
@ -544,6 +511,21 @@
|
|||||||
<string>Ctrl+P</string>
|
<string>Ctrl+P</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="action_help">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources/images.qrc">
|
||||||
|
<normaloff>:/images/help.svg</normaloff>:/images/help.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Help</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Browse the calibre User Manual</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>F1</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
@ -561,6 +543,11 @@
|
|||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>calibre.gui2.search_box</header>
|
<header>calibre.gui2.search_box</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ThrobbingButton</class>
|
||||||
|
<extends>QToolButton</extends>
|
||||||
|
<header>calibre/gui2/throbber.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../resources/images.qrc"/>
|
<include location="../../../resources/images.qrc"/>
|
||||||
|
@ -706,9 +706,12 @@ void PictureFlowPrivate::render()
|
|||||||
painter.setPen(Qt::white);
|
painter.setPen(Qt::white);
|
||||||
//painter.setPen(QColor(255,255,255,127));
|
//painter.setPen(QColor(255,255,255,127));
|
||||||
|
|
||||||
if (centerIndex < slideCount() && centerIndex > -1)
|
if (centerIndex < slideCount() && centerIndex > -1) {
|
||||||
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2-fontSize*3),
|
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2-fontSize*4),
|
||||||
Qt::AlignCenter, slideImages->caption(centerIndex));
|
Qt::AlignCenter, slideImages->caption(centerIndex));
|
||||||
|
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2-fontSize*2),
|
||||||
|
Qt::AlignCenter, slideImages->subtitle(centerIndex));
|
||||||
|
}
|
||||||
|
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
||||||
@ -759,15 +762,22 @@ void PictureFlowPrivate::render()
|
|||||||
int sc = slideCount();
|
int sc = slideCount();
|
||||||
|
|
||||||
painter.setPen(QColor(255,255,255, (255-fade) ));
|
painter.setPen(QColor(255,255,255, (255-fade) ));
|
||||||
if (leftTextIndex < sc && leftTextIndex > -1)
|
if (leftTextIndex < sc && leftTextIndex > -1) {
|
||||||
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2 - fontSize*3),
|
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2 - fontSize*4),
|
||||||
Qt::AlignCenter, slideImages->caption(leftTextIndex));
|
Qt::AlignCenter, slideImages->caption(leftTextIndex));
|
||||||
|
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2 - fontSize*2),
|
||||||
|
Qt::AlignCenter, slideImages->subtitle(leftTextIndex));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
painter.setPen(QColor(255,255,255, fade));
|
painter.setPen(QColor(255,255,255, fade));
|
||||||
if (leftTextIndex+1 < sc && leftTextIndex > -2)
|
if (leftTextIndex+1 < sc && leftTextIndex > -2) {
|
||||||
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2 - fontSize*3),
|
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2 - fontSize*4),
|
||||||
Qt::AlignCenter, slideImages->caption(leftTextIndex+1));
|
Qt::AlignCenter, slideImages->caption(leftTextIndex+1));
|
||||||
|
painter.drawText( QRect(0,0, buffer.width(), buffer.height()*2 - fontSize*2),
|
||||||
|
Qt::AlignCenter, slideImages->subtitle(leftTextIndex+1));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
painter.end();
|
painter.end();
|
||||||
}
|
}
|
||||||
@ -1372,5 +1382,6 @@ void PictureFlow::emitcurrentChanged(int index) { emit currentChanged(index); }
|
|||||||
int FlowImages::count() { return 0; }
|
int FlowImages::count() { return 0; }
|
||||||
QImage FlowImages::image(int index) { index=0; return QImage(); }
|
QImage FlowImages::image(int index) { index=0; return QImage(); }
|
||||||
QString FlowImages::caption(int index) {index=0; return QString(); }
|
QString FlowImages::caption(int index) {index=0; return QString(); }
|
||||||
|
QString FlowImages::subtitle(int index) {index=0; return QString(); }
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
|
@ -67,6 +67,7 @@ public:
|
|||||||
virtual int count();
|
virtual int count();
|
||||||
virtual QImage image(int index);
|
virtual QImage image(int index);
|
||||||
virtual QString caption(int index);
|
virtual QString caption(int index);
|
||||||
|
virtual QString subtitle(int index);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dataChanged();
|
void dataChanged();
|
||||||
|
@ -16,6 +16,7 @@ public:
|
|||||||
virtual int count();
|
virtual int count();
|
||||||
virtual QImage image(int index);
|
virtual QImage image(int index);
|
||||||
virtual QString caption(int index);
|
virtual QString caption(int index);
|
||||||
|
virtual QString subtitle(int index);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dataChanged();
|
void dataChanged();
|
||||||
|
@ -6,6 +6,8 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from PyQt4.Qt import QComboBox, Qt, QLineEdit, QStringList, pyqtSlot, \
|
from PyQt4.Qt import QComboBox, Qt, QLineEdit, QStringList, pyqtSlot, \
|
||||||
pyqtSignal, SIGNAL, QObject, QDialog, QCompleter, \
|
pyqtSignal, SIGNAL, QObject, QDialog, QCompleter, \
|
||||||
QAction, QKeySequence
|
QAction, QKeySequence
|
||||||
@ -368,6 +370,10 @@ class SearchBoxMixin(object):
|
|||||||
self.action_focus_search.triggered.connect(lambda x:
|
self.action_focus_search.triggered.connect(lambda x:
|
||||||
self.search.setFocus(Qt.OtherFocusReason))
|
self.search.setFocus(Qt.OtherFocusReason))
|
||||||
self.addAction(self.action_focus_search)
|
self.addAction(self.action_focus_search)
|
||||||
|
self.search.setStatusTip(re.sub(r'<\w+>', ' ',
|
||||||
|
unicode(self.search.toolTip())))
|
||||||
|
self.advanced_search_button.setStatusTip(self.advanced_search_button.toolTip())
|
||||||
|
self.clear_button.setStatusTip(self.clear_button.toolTip())
|
||||||
|
|
||||||
def search_box_cleared(self):
|
def search_box_cleared(self):
|
||||||
self.tags_view.clear()
|
self.tags_view.clear()
|
||||||
@ -396,6 +402,12 @@ class SavedSearchBoxMixin(object):
|
|||||||
self.saved_search.delete_search_button_clicked)
|
self.saved_search.delete_search_button_clicked)
|
||||||
self.connect(self.copy_search_button, SIGNAL('clicked()'),
|
self.connect(self.copy_search_button, SIGNAL('clicked()'),
|
||||||
self.saved_search.copy_search_button_clicked)
|
self.saved_search.copy_search_button_clicked)
|
||||||
|
self.saved_search.setToolTip(
|
||||||
|
_('Choose saved search or enter name for new saved search'))
|
||||||
|
self.saved_search.setStatusTip(self.saved_search.toolTip())
|
||||||
|
for x in ('copy', 'save', 'delete'):
|
||||||
|
b = getattr(self, x+'_search_button')
|
||||||
|
b.setStatusTip(b.toolTip())
|
||||||
|
|
||||||
|
|
||||||
def saved_searches_changed(self):
|
def saved_searches_changed(self):
|
||||||
|
@ -11,6 +11,7 @@ class SearchRestrictionMixin(object):
|
|||||||
self.library_view.model().count_changed_signal.connect(self.restriction_count_changed)
|
self.library_view.model().count_changed_signal.connect(self.restriction_count_changed)
|
||||||
self.search_restriction.setSizeAdjustPolicy(self.search_restriction.AdjustToMinimumContentsLengthWithIcon)
|
self.search_restriction.setSizeAdjustPolicy(self.search_restriction.AdjustToMinimumContentsLengthWithIcon)
|
||||||
self.search_restriction.setMinimumContentsLength(10)
|
self.search_restriction.setMinimumContentsLength(10)
|
||||||
|
self.search_restriction.setStatusTip(self.search_restriction.toolTip())
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Adding and deleting books while restricted creates a complexity. When added,
|
Adding and deleting books while restricted creates a complexity. When added,
|
||||||
|
@ -768,6 +768,9 @@ class TagBrowserWidget(QWidget): # {{{
|
|||||||
for x in (_('Sort by name'), _('Sort by popularity'),
|
for x in (_('Sort by name'), _('Sort by popularity'),
|
||||||
_('Sort by average rating')):
|
_('Sort by average rating')):
|
||||||
parent.sort_by.addItem(x)
|
parent.sort_by.addItem(x)
|
||||||
|
parent.sort_by.setToolTip(
|
||||||
|
_('Set the sort order for entries in the Tag Browser'))
|
||||||
|
parent.sort_by.setStatusTip(parent.sort_by.toolTip())
|
||||||
parent.sort_by.setCurrentIndex(0)
|
parent.sort_by.setCurrentIndex(0)
|
||||||
self._layout.addWidget(parent.sort_by)
|
self._layout.addWidget(parent.sort_by)
|
||||||
|
|
||||||
@ -776,9 +779,16 @@ class TagBrowserWidget(QWidget): # {{{
|
|||||||
parent.tag_match.addItem(x)
|
parent.tag_match.addItem(x)
|
||||||
parent.tag_match.setCurrentIndex(0)
|
parent.tag_match.setCurrentIndex(0)
|
||||||
self._layout.addWidget(parent.tag_match)
|
self._layout.addWidget(parent.tag_match)
|
||||||
|
parent.tag_match.setToolTip(
|
||||||
|
_('When selecting multiple entries in the Tag Browser '
|
||||||
|
'match any or all of them'))
|
||||||
|
parent.tag_match.setStatusTip(parent.tag_match.toolTip())
|
||||||
|
|
||||||
parent.edit_categories = QPushButton(_('Manage &user categories'), parent)
|
parent.edit_categories = QPushButton(_('Manage &user categories'), parent)
|
||||||
self._layout.addWidget(parent.edit_categories)
|
self._layout.addWidget(parent.edit_categories)
|
||||||
|
parent.edit_categories.setToolTip(
|
||||||
|
_('Add your own categories to the Tag Browser'))
|
||||||
|
parent.edit_categories.setStatusTip(parent.edit_categories.toolTip())
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
70
src/calibre/gui2/throbber.py
Normal file
70
src/calibre/gui2/throbber.py
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt4.Qt import QToolButton, QSize, QPropertyAnimation, Qt, \
|
||||||
|
QMetaObject
|
||||||
|
|
||||||
|
from calibre.gui2 import config
|
||||||
|
|
||||||
|
class ThrobbingButton(QToolButton):
|
||||||
|
|
||||||
|
def __init__(self, *args):
|
||||||
|
QToolButton.__init__(self, *args)
|
||||||
|
self.animation = QPropertyAnimation(self, 'iconSize', self)
|
||||||
|
self.animation.setDuration(60/72.*1000)
|
||||||
|
self.animation.setLoopCount(4)
|
||||||
|
self.normal_icon_size = QSize(64, 64)
|
||||||
|
self.animation.valueChanged.connect(self.value_changed)
|
||||||
|
self.setCursor(Qt.PointingHandCursor)
|
||||||
|
self.animation.finished.connect(self.animation_finished)
|
||||||
|
|
||||||
|
def set_normal_icon_size(self, w, h):
|
||||||
|
self.normal_icon_size = QSize(w, h)
|
||||||
|
self.setIconSize(self.normal_icon_size)
|
||||||
|
self.setMinimumSize(self.sizeHint())
|
||||||
|
|
||||||
|
def animation_finished(self):
|
||||||
|
self.setIconSize(self.normal_icon_size)
|
||||||
|
|
||||||
|
def enterEvent(self, ev):
|
||||||
|
self.start_animation()
|
||||||
|
|
||||||
|
def leaveEvent(self, ev):
|
||||||
|
self.stop_animation()
|
||||||
|
|
||||||
|
def value_changed(self, val):
|
||||||
|
self.update()
|
||||||
|
|
||||||
|
def start_animation(self):
|
||||||
|
if config['disable_animations']: return
|
||||||
|
if self.animation.state() != self.animation.Stopped or not self.isVisible():
|
||||||
|
return
|
||||||
|
size = self.normal_icon_size.width()
|
||||||
|
smaller = int(0.7 * size)
|
||||||
|
self.animation.setStartValue(QSize(smaller, smaller))
|
||||||
|
self.animation.setEndValue(self.normal_icon_size)
|
||||||
|
QMetaObject.invokeMethod(self.animation, 'start', Qt.QueuedConnection)
|
||||||
|
|
||||||
|
def stop_animation(self):
|
||||||
|
self.animation.stop()
|
||||||
|
self.animation_finished()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
from PyQt4.Qt import QApplication, QWidget, QHBoxLayout, QIcon
|
||||||
|
app = QApplication([])
|
||||||
|
w = QWidget()
|
||||||
|
w.setLayout(QHBoxLayout())
|
||||||
|
b = ThrobbingButton()
|
||||||
|
b.setIcon(QIcon(I('donate.svg')))
|
||||||
|
w.layout().addWidget(b)
|
||||||
|
w.show()
|
||||||
|
b.set_normal_icon_size(64, 64)
|
||||||
|
b.start_animation()
|
||||||
|
|
||||||
|
app.exec_()
|
@ -19,7 +19,7 @@ from PyQt4.Qt import Qt, SIGNAL, QObject, QTimer, \
|
|||||||
QMessageBox, QHelpEvent
|
QMessageBox, QHelpEvent
|
||||||
|
|
||||||
from calibre import prints, patheq
|
from calibre import prints, patheq
|
||||||
from calibre.constants import __version__, __appname__, isosx
|
from calibre.constants import __appname__, isosx
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
from calibre.utils.config import prefs, dynamic
|
from calibre.utils.config import prefs, dynamic
|
||||||
from calibre.utils.ipc.server import Server
|
from calibre.utils.ipc.server import Server
|
||||||
@ -163,6 +163,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceMixin, ToolbarMixin, # {{{
|
|||||||
self.donate_action = self.system_tray_menu.addAction(
|
self.donate_action = self.system_tray_menu.addAction(
|
||||||
QIcon(I('donate.svg')), _('&Donate to support calibre'))
|
QIcon(I('donate.svg')), _('&Donate to support calibre'))
|
||||||
self.donate_button.setDefaultAction(self.donate_action)
|
self.donate_button.setDefaultAction(self.donate_action)
|
||||||
|
self.donate_button.setStatusTip(self.donate_button.toolTip())
|
||||||
self.eject_action = self.system_tray_menu.addAction(
|
self.eject_action = self.system_tray_menu.addAction(
|
||||||
QIcon(I('eject.svg')), _('&Eject connected device'))
|
QIcon(I('eject.svg')), _('&Eject connected device'))
|
||||||
self.eject_action.setEnabled(False)
|
self.eject_action.setEnabled(False)
|
||||||
@ -202,18 +203,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceMixin, ToolbarMixin, # {{{
|
|||||||
self.device_manager.umount_device)
|
self.device_manager.umount_device)
|
||||||
self.eject_action.triggered.connect(self.device_manager.umount_device)
|
self.eject_action.triggered.connect(self.device_manager.umount_device)
|
||||||
|
|
||||||
####################### Vanity ########################
|
#################### Update notification ###################
|
||||||
self.vanity_template = _('<p>For help see the: <a href="%s">User Manual</a>'
|
|
||||||
'<br>')%'http://calibre-ebook.com/user_manual'
|
|
||||||
dv = os.environ.get('CALIBRE_DEVELOP_FROM', None)
|
|
||||||
v = __version__
|
|
||||||
if getattr(sys, 'frozen', False) and dv and os.path.abspath(dv) in sys.path:
|
|
||||||
v += '*'
|
|
||||||
self.vanity_template += _('<b>%s</b>: %s by <b>Kovid Goyal '
|
|
||||||
'%%(version)s</b><br>%%(device)s</p>')%(__appname__, v)
|
|
||||||
self.latest_version = ' '
|
|
||||||
self.vanity.setText(self.vanity_template%dict(version=' ', device=' '))
|
|
||||||
self.device_info = ' '
|
|
||||||
UpdateMixin.__init__(self, opts)
|
UpdateMixin.__init__(self, opts)
|
||||||
|
|
||||||
####################### Setup Toolbar #####################
|
####################### Setup Toolbar #####################
|
||||||
@ -291,6 +281,8 @@ class Main(MainWindow, Ui_MainWindow, DeviceMixin, ToolbarMixin, # {{{
|
|||||||
|
|
||||||
self.read_settings()
|
self.read_settings()
|
||||||
self.finalize_layout()
|
self.finalize_layout()
|
||||||
|
self.donate_button.set_normal_icon_size(64, 64)
|
||||||
|
self.donate_button.start_animation()
|
||||||
|
|
||||||
def resizeEvent(self, ev):
|
def resizeEvent(self, ev):
|
||||||
MainWindow.resizeEvent(self, ev)
|
MainWindow.resizeEvent(self, ev)
|
||||||
|
@ -49,12 +49,8 @@ class UpdateMixin(object):
|
|||||||
def update_found(self, version):
|
def update_found(self, version):
|
||||||
os = 'windows' if iswindows else 'osx' if isosx else 'linux'
|
os = 'windows' if iswindows else 'osx' if isosx else 'linux'
|
||||||
url = 'http://calibre-ebook.com/download_%s'%os
|
url = 'http://calibre-ebook.com/download_%s'%os
|
||||||
self.latest_version = '<br>' + _('<span style="color:red; font-weight:bold">'
|
self.status_bar.new_version_available(version, url)
|
||||||
'Latest version: <a href="%s">%s</a></span>')%(url, version)
|
|
||||||
self.vanity.setText(self.vanity_template%\
|
|
||||||
(dict(version=self.latest_version,
|
|
||||||
device=self.device_info)))
|
|
||||||
self.vanity.update()
|
|
||||||
if config.get('new_version_notification') and \
|
if config.get('new_version_notification') and \
|
||||||
dynamic.get('update to version %s'%version, True):
|
dynamic.get('update to version %s'%version, True):
|
||||||
if question_dialog(self, _('Update available'),
|
if question_dialog(self, _('Update available'),
|
||||||
|
@ -298,6 +298,14 @@ class LocationModel(QAbstractListModel):
|
|||||||
row = 3
|
row = 3
|
||||||
return row
|
return row
|
||||||
|
|
||||||
|
def get_tooltip(self, row, drow):
|
||||||
|
ans = self.tooltips[row]
|
||||||
|
if row > 0:
|
||||||
|
fs = self.free[drow-1]
|
||||||
|
if fs > -1:
|
||||||
|
ans += '\n\n%s '%(human_readable(fs)) + _('free')
|
||||||
|
return ans
|
||||||
|
|
||||||
def data(self, index, role):
|
def data(self, index, role):
|
||||||
row = index.row()
|
row = index.row()
|
||||||
drow = self.get_device_row(row)
|
drow = self.get_device_row(row)
|
||||||
@ -308,12 +316,8 @@ class LocationModel(QAbstractListModel):
|
|||||||
data = QVariant(text)
|
data = QVariant(text)
|
||||||
elif role == Qt.DecorationRole:
|
elif role == Qt.DecorationRole:
|
||||||
data = self.icons[drow]
|
data = self.icons[drow]
|
||||||
elif role == Qt.ToolTipRole:
|
elif role in (Qt.ToolTipRole, Qt.StatusTipRole):
|
||||||
ans = self.tooltips[row]
|
ans = self.get_tooltip(row, drow)
|
||||||
if row > 0:
|
|
||||||
fs = self.free[drow-1]
|
|
||||||
if fs > -1:
|
|
||||||
ans += '\n\n%s '%(human_readable(fs)) + _('free')
|
|
||||||
data = QVariant(ans)
|
data = QVariant(ans)
|
||||||
elif role == Qt.SizeHintRole:
|
elif role == Qt.SizeHintRole:
|
||||||
data = QVariant(QSize(155, 90))
|
data = QVariant(QSize(155, 90))
|
||||||
@ -1011,12 +1015,14 @@ class LayoutButton(QToolButton):
|
|||||||
label =_('Show')
|
label =_('Show')
|
||||||
self.setText(label + ' ' + self.label)
|
self.setText(label + ' ' + self.label)
|
||||||
self.setToolTip(self.text())
|
self.setToolTip(self.text())
|
||||||
|
self.setStatusTip(self.text())
|
||||||
|
|
||||||
def set_state_to_hide(self, *args):
|
def set_state_to_hide(self, *args):
|
||||||
self.setChecked(True)
|
self.setChecked(True)
|
||||||
label = _('Hide')
|
label = _('Hide')
|
||||||
self.setText(label + ' ' + self.label)
|
self.setText(label + ' ' + self.label)
|
||||||
self.setToolTip(self.text())
|
self.setToolTip(self.text())
|
||||||
|
self.setStatusTip(self.text())
|
||||||
|
|
||||||
def update_state(self, *args):
|
def update_state(self, *args):
|
||||||
if self.splitter.is_side_index_hidden:
|
if self.splitter.is_side_index_hidden:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user