/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 commit.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-29 14:04:24 UTC
  • mto: This revision was merged to the branch mainline in revision 781.
  • Revision ID: jelmer@samba.org-20120229140424-1gi07xr2y932u15r
Cope with dbus session bus not being available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    tsort,
31
31
    )
32
32
from bzrlib.plugins.gtk.dialog import question_dialog
33
 
from bzrlib.plugins.gtk.diff import DiffView
34
33
from bzrlib.plugins.gtk.errors import show_bzr_error
35
34
from bzrlib.plugins.gtk.i18n import _i18n
36
35
from bzrlib.plugins.gtk.commitmsgs import SavedCommitMessagesManager
560
559
                                             Gtk.CellRendererText(), text=3))
561
560
 
562
561
    def _construct_diff_view(self):
 
562
        from bzrlib.plugins.gtk.diff import DiffView
 
563
 
563
564
        # TODO: jam 2007-10-30 The diff label is currently disabled. If we
564
565
        #       decide that we really don't ever want to display it, we should
565
566
        #       actually remove it, and other references to it, along with the
574
575
        self._add_to_right_table(self._diff_view, 4, True)
575
576
        self._diff_view.show()
576
577
 
577
 
    @staticmethod
578
 
    def get_line_height(widget):
579
 
        pango_layout = widget.create_pango_layout("X");
580
 
        ink_rectangle, logical_rectangle = pango_layout.get_pixel_extents()
581
 
        return logical_rectangle.height
582
 
 
583
578
    def _construct_file_message(self):
584
579
        scroller = Gtk.ScrolledWindow()
585
580
        scroller.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
592
587
        self._file_message_text_view.modify_font(Pango.FontDescription("Monospace"))
593
588
        self._file_message_text_view.set_wrap_mode(Gtk.WrapMode.WORD)
594
589
        self._file_message_text_view.set_accepts_tab(False)
595
 
        line_height = self.get_line_height(self._file_message_text_view)
596
 
        self._file_message_text_view.set_size_request(-1, line_height * 2)
597
590
        self._file_message_text_view.show()
598
591
 
599
592
        self._file_message_expander = Gtk.Expander(