~jaap.karssenberg/zim/pyzim-0.43-backports

« back to all changes in this revision

Viewing changes to zim/gui/pageview.py

  • Committer: Jaap Karssenberg
  • Date: 2010-01-17 18:15:48 UTC
  • Revision ID: pardus@cpan.org-20100117181548-znbf7jiswarc35gh
* Fixed issue with remove_link while some other text is selected
* Trigger Find after Search for simple queries
* Allow selecting multiple tags in Task List plugin
* Improved color highlighting in Task list
* Allow negative query in task list, like "not @waiting"

Show diffs side-by-side

added added

removed removed

Lines of Context:
1407
1407
                '''
1408
1408
                return bool(self.get_selection_bounds())
1409
1409
 
 
1410
        def iter_in_selection(self, iter):
 
1411
                '''Returns True if 'iter' is within the current selection'''
 
1412
                bounds = self.get_selection_bounds()
 
1413
                return bounds \
 
1414
                        and bounds[0].compare(iter) <= 0 \
 
1415
                        and bounds[1].compare(iter) >= 0
 
1416
                # not using iter.in_range to be inclusive of bounds
 
1417
 
1410
1418
        def copy_clipboard(self, clipboard):
1411
1419
                bounds = self.get_selection_bounds()
1412
1420
                if bounds:
2860
2868
        def remove_link(self, iter=None):
2861
2869
                buffer = self.view.get_buffer()
2862
2870
 
2863
 
                if not buffer.get_has_selection():
 
2871
                if not buffer.get_has_selection() \
 
2872
                or not buffer.iter_in_selection(iter):
2864
2873
                        if iter:
2865
2874
                                buffer.place_cursor(iter)
2866
2875
                        buffer.select_link()