/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: Curtis Hovey
  • Date: 2012-02-28 13:52:00 UTC
  • mfrom: (776.2.12 ui-factory)
  • Revision ID: sinzui.is@verizon.net-20120228135200-xzqb6qhtzck01doo
Merged GtkUIFactory additions and tweaks.

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
289
288
            self._check_local.hide()
290
289
            return
291
290
        if have_dbus:
292
 
            try:
293
 
                bus = dbus.SystemBus()
294
 
            except dbus.DBusException:
295
 
                trace.mutter("DBus system bus not available")
296
 
                self._check_local.show()
297
 
                return
 
291
            bus = dbus.SystemBus()
298
292
            try:
299
293
                proxy_obj = bus.get_object('org.freedesktop.NetworkManager',
300
294
                                           '/org/freedesktop/NetworkManager')
560
554
                                             Gtk.CellRendererText(), text=3))
561
555
 
562
556
    def _construct_diff_view(self):
 
557
        from bzrlib.plugins.gtk.diff import DiffView
 
558
 
563
559
        # TODO: jam 2007-10-30 The diff label is currently disabled. If we
564
560
        #       decide that we really don't ever want to display it, we should
565
561
        #       actually remove it, and other references to it, along with the
574
570
        self._add_to_right_table(self._diff_view, 4, True)
575
571
        self._diff_view.show()
576
572
 
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
573
    def _construct_file_message(self):
584
574
        scroller = Gtk.ScrolledWindow()
585
575
        scroller.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
592
582
        self._file_message_text_view.modify_font(Pango.FontDescription("Monospace"))
593
583
        self._file_message_text_view.set_wrap_mode(Gtk.WrapMode.WORD)
594
584
        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
585
        self._file_message_text_view.show()
598
586
 
599
587
        self._file_message_expander = Gtk.Expander(