~sneakypete81/zim/pyzim

« back to all changes in this revision

Viewing changes to zim/gui/pageview.py

  • Committer: sneakypete81
  • Date: 2010-01-29 19:45:11 UTC
  • Revision ID: sneakypete81@gmail.com-20100129194511-ymebq19vk0947aan
backed out changes in rev 193

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        BULLET, CHECKED_BOX, UNCHECKED_BOX, XCHECKED_BOX
28
28
from zim.gui.widgets import Dialog, FileDialog, ErrorDialog, \
29
29
        Button, IconButton, BrowserTreeView, InputEntry
30
 
from zim.gui.applications import OpenWithMenu, get_application
 
30
from zim.gui.applications import OpenWithMenu
31
31
from zim.gui.clipboard import Clipboard, \
32
32
        PARSETREE_ACCEPT_TARGETS, parsetree_from_selectiondata
33
33
 
1744
1744
                if not buffer.get_has_selection():
1745
1745
                        iter = self.get_iter_at_pointer()
1746
1746
                        if event.button == 1:
1747
 
                                self.click_link(iter) or buffer.toggle_checkbox(iter)                                                                   
 
1747
                                self.click_link(iter) or buffer.toggle_checkbox(iter)
1748
1748
                        elif event.button == 3:
1749
1749
                                buffer.toggle_checkbox(iter, XCHECKED_BOX)
1750
1750
                return cont # continue emit ?
2826
2826
                                self.ui.open_url(href)
2827
2827
                except Exception, error:
2828
2828
                        ErrorDialog(self.ui, error).run()
2829
 
                            
2830
 
        def do_image_double_clicked(self, file):
2831
 
                '''Handler for the image-double-clicked signal
2832
 
                Currently only hooked up to "Open" context menu item, since
2833
 
                double-click events don't seem to work.         
2834
 
                '''
2835
 
                get_application('startfile').spawn([file])
2836
2829
 
2837
2830
        def do_populate_popup(self, menu):
2838
2831
                buffer = self.view.get_buffer()
2936
2929
                                'activate', lambda o: self.do_link_clicked(link, new_window=True))
2937
2930
                        menu.prepend(item)
2938
2931
 
2939
 
                elif type == 'image':
2940
 
                        item = gtk.MenuItem(_('_Open'))
2941
 
                        if file and file.exists():
2942
 
                                item.connect_object(
2943
 
                                        'activate', PageView.do_image_double_clicked, self, file)
2944
 
                        else: 
2945
 
                                item.set_sensitive(False)
2946
 
                        menu.prepend(item)
2947
 
 
2948
 
                elif link:
2949
 
                        item = gtk.MenuItem(_('_Open'))
 
2932
                if type != 'image' and link:
2950
2933
                                # T: menu item to open a link or file
2951
2934
                        if file and not file.exists():
2952
2935
                                item.set_sensitive(False)