/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/frontend/gtk/commit.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-03 10:14:44 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060803101444-4c62b2b5023c134a
Implemented Diff window; added menu.py (was missing from last commit)

2006-08-03  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/commit.py: change TextView font to Monospace
    * olive/frontend/gtk/diff.py: implemented diff window

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    import gtk
26
26
    import gtk.glade
27
27
    import gobject
 
28
    import pango
28
29
except:
29
30
    sys.exit(1)
30
31
 
31
 
from bzrlib.delta import compare_trees
 
32
import bzrlib
 
33
 
 
34
if bzrlib.version_info[1] < 9:
 
35
    # function deprecated after 0.9
 
36
    from bzrlib.delta import compare_trees
 
37
 
32
38
import bzrlib.errors as errors
33
39
from bzrlib.workingtree import WorkingTree
34
40
 
38
44
    """ Display Commit dialog and perform the needed actions. """
39
45
    def __init__(self, gladefile, comm):
40
46
        """ Initialize the Commit dialog. """
41
 
        import bzrlib
42
 
        
43
47
        self.gladefile = gladefile
44
48
        self.glade = gtk.glade.XML(self.gladefile, 'window_commit')
45
49
        
86
90
        
87
91
        # Some additional widgets
88
92
        self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
 
93
        self.textview = self.glade.get_widget('textview_commit')
89
94
    
90
95
    def display(self):
91
96
        """ Display the Push dialog. """
97
102
                # we have a checkout, so the local commit checkbox must appear
98
103
                self.checkbutton_local.show()
99
104
            
 
105
            self.textview.modify_font(pango.FontDescription("Monospace"))
100
106
            self.window.show()
101
107
            
102
108
    
145
151
        return
146
152
    
147
153
    def commit(self, widget):
148
 
        textview = self.glade.get_widget('textview_commit')
149
 
        textbuffer = textview.get_buffer()
 
154
        textbuffer = self.textview.get_buffer()
150
155
        start, end = textbuffer.get_bounds()
151
156
        message = textbuffer.get_text(start, end)
152
157