mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
version 0.4.5
This commit is contained in:
parent
7f5deb489d
commit
cb89867576
@ -13,7 +13,7 @@
|
|||||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
''' E-book management software'''
|
''' E-book management software'''
|
||||||
__version__ = "0.4.4"
|
__version__ = "0.4.5"
|
||||||
__docformat__ = "epytext"
|
__docformat__ = "epytext"
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
__appname__ = 'libprs500'
|
__appname__ = 'libprs500'
|
||||||
|
@ -654,7 +654,7 @@ class SearchBox(QLineEdit):
|
|||||||
self.initial_state = True
|
self.initial_state = True
|
||||||
self.default_palette = QApplication.palette(self)
|
self.default_palette = QApplication.palette(self)
|
||||||
self.gray = QPalette(self.default_palette)
|
self.gray = QPalette(self.default_palette)
|
||||||
self.gray.setBrush(QPalette.Text, QBrush(QColor('lightgray')))
|
self.gray.setBrush(QPalette.Text, QBrush(QColor('gray')))
|
||||||
self.prev_search = ''
|
self.prev_search = ''
|
||||||
self.timer = None
|
self.timer = None
|
||||||
self.clear_to_help()
|
self.clear_to_help()
|
||||||
@ -666,9 +666,9 @@ class SearchBox(QLineEdit):
|
|||||||
self.setPalette(self.default_palette)
|
self.setPalette(self.default_palette)
|
||||||
|
|
||||||
def clear_to_help(self):
|
def clear_to_help(self):
|
||||||
self.setText(self.help_text)
|
|
||||||
self.home(False)
|
|
||||||
self.setPalette(self.gray)
|
self.setPalette(self.gray)
|
||||||
|
self.setText(self.help_text)
|
||||||
|
self.home(False)
|
||||||
self.initial_state = True
|
self.initial_state = True
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
|
@ -149,7 +149,6 @@ class _Canvas(QGraphicsRectItem):
|
|||||||
|
|
||||||
def layout_image_block(self, ib, x, y):
|
def layout_image_block(self, ib, x, y):
|
||||||
mw, mh = self.max_x - x, self.max_y - y
|
mw, mh = self.max_x - x, self.max_y - y
|
||||||
print self, mw, mh
|
|
||||||
if ib.width > mw or ib.height > mh:
|
if ib.width > mw or ib.height > mh:
|
||||||
ib.resize(mw, mh)
|
ib.resize(mw, mh)
|
||||||
if self.current_y + ib.height > self.max_y-y and self.current_y > 5:
|
if self.current_y + ib.height > self.max_y-y and self.current_y > 5:
|
||||||
|
@ -82,12 +82,16 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
self.action_next_page.setShortcuts(QKeySequence.MoveToNextPage)
|
self.action_next_page.setShortcuts(QKeySequence.MoveToNextPage)
|
||||||
self.action_previous_page.setShortcuts(QKeySequence.MoveToPreviousPage)
|
self.action_previous_page.setShortcuts(QKeySequence.MoveToPreviousPage)
|
||||||
|
self.action_next_match.setShortcuts(QKeySequence.FindNext)
|
||||||
|
self.addAction(self.action_next_match)
|
||||||
QObject.connect(self.action_next_page, SIGNAL('triggered(bool)'), self.next)
|
QObject.connect(self.action_next_page, SIGNAL('triggered(bool)'), self.next)
|
||||||
QObject.connect(self.action_previous_page, SIGNAL('triggered(bool)'), self.previous)
|
QObject.connect(self.action_previous_page, SIGNAL('triggered(bool)'), self.previous)
|
||||||
QObject.connect(self.action_back, SIGNAL('triggered(bool)'), self.back)
|
QObject.connect(self.action_back, SIGNAL('triggered(bool)'), self.back)
|
||||||
QObject.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward)
|
QObject.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward)
|
||||||
|
QObject.connect(self.action_next_match, SIGNAL('triggered(bool)'), self.next_match)
|
||||||
QObject.connect(self.spin_box, SIGNAL('valueChanged(int)'), self.go_to_page)
|
QObject.connect(self.spin_box, SIGNAL('valueChanged(int)'), self.go_to_page)
|
||||||
QObject.connect(self.slider, SIGNAL('valueChanged(int)'), self.go_to_page)
|
QObject.connect(self.slider, SIGNAL('valueChanged(int)'), self.go_to_page)
|
||||||
|
|
||||||
self.next_button.setDefaultAction(self.action_next_page)
|
self.next_button.setDefaultAction(self.action_next_page)
|
||||||
self.previous_button.setDefaultAction(self.action_previous_page)
|
self.previous_button.setDefaultAction(self.action_previous_page)
|
||||||
self.back_button.setDefaultAction(self.action_back)
|
self.back_button.setDefaultAction(self.action_back)
|
||||||
@ -162,6 +166,12 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def next(self, triggered):
|
def next(self, triggered):
|
||||||
self.document.next()
|
self.document.next()
|
||||||
|
|
||||||
|
def next_match(self, triggered):
|
||||||
|
try:
|
||||||
|
self.document.next_match()
|
||||||
|
except StopIteration:
|
||||||
|
pass
|
||||||
|
|
||||||
def previous(self, triggered):
|
def previous(self, triggered):
|
||||||
self.document.previous()
|
self.document.previous()
|
||||||
@ -234,4 +244,4 @@ def main(args=sys.argv, logger=None):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +134,14 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="SearchBox" name="search" />
|
<widget class="SearchBox" name="search" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -243,6 +250,11 @@
|
|||||||
<string>Forward</string>
|
<string>Forward</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="action_next_match" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Next match</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user