version 0.4.5

This commit is contained in:
Kovid Goyal 2007-09-29 15:41:29 +00:00
parent 7f5deb489d
commit cb89867576
5 changed files with 28 additions and 7 deletions

View File

@ -13,7 +13,7 @@
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
''' E-book management software'''
__version__ = "0.4.4"
__version__ = "0.4.5"
__docformat__ = "epytext"
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
__appname__ = 'libprs500'

View File

@ -654,7 +654,7 @@ class SearchBox(QLineEdit):
self.initial_state = True
self.default_palette = QApplication.palette(self)
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.timer = None
self.clear_to_help()
@ -666,9 +666,9 @@ class SearchBox(QLineEdit):
self.setPalette(self.default_palette)
def clear_to_help(self):
self.setText(self.help_text)
self.home(False)
self.setPalette(self.gray)
self.setText(self.help_text)
self.home(False)
self.initial_state = True
def keyPressEvent(self, event):

View File

@ -149,7 +149,6 @@ class _Canvas(QGraphicsRectItem):
def layout_image_block(self, ib, x, y):
mw, mh = self.max_x - x, self.max_y - y
print self, mw, mh
if ib.width > mw or ib.height > mh:
ib.resize(mw, mh)
if self.current_y + ib.height > self.max_y-y and self.current_y > 5:

View File

@ -82,12 +82,16 @@ class Main(MainWindow, Ui_MainWindow):
self.action_next_page.setShortcuts(QKeySequence.MoveToNextPage)
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_previous_page, SIGNAL('triggered(bool)'), self.previous)
QObject.connect(self.action_back, SIGNAL('triggered(bool)'), self.back)
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.slider, SIGNAL('valueChanged(int)'), self.go_to_page)
self.next_button.setDefaultAction(self.action_next_page)
self.previous_button.setDefaultAction(self.action_previous_page)
self.back_button.setDefaultAction(self.action_back)
@ -162,6 +166,12 @@ class Main(MainWindow, Ui_MainWindow):
def next(self, triggered):
self.document.next()
def next_match(self, triggered):
try:
self.document.next_match()
except StopIteration:
pass
def previous(self, triggered):
self.document.previous()
@ -234,4 +244,4 @@ def main(args=sys.argv, logger=None):
if __name__ == '__main__':
sys.exit(main())

View File

@ -134,7 +134,14 @@
</widget>
</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>
</layout>
</widget>
@ -243,6 +250,11 @@
<string>Forward</string>
</property>
</action>
<action name="action_next_match" >
<property name="text" >
<string>Next match</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>