コード例 #1
0
    def __init__(self, plugin, config = None):
        """Constructor."""
        self._config = config

        Localization.setup()

        gtk.Dialog.__init__(self,
                            _("Settings"),
                            None,
                            gtk.DIALOG_DESTROY_WITH_PARENT)

        self.set_resizable(False)

        close_button = self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
        close_button.grab_default()
        close_button.connect_object("clicked", gtk.Widget.destroy, self)

        main_box = gtk.VBox(False, 0)
        main_box.set_border_width(12)

        title_label = gtk.Label()
        title_label.set_markup(
            '<b>' + _("Actions to perform upon saving:") + '</b>')
        title_label.set_alignment(0, 0)

        config_box = gtk.VBox(False, 6)
        config_box.set_border_width(6)

        checkbox_label = _("_Strip trailing whitespace on every line")
        whitespace_checkbox = gtk.CheckButton(checkbox_label)
        whitespace_checkbox.connect('clicked',
                                    self.update_setting,
                                    'remove_whitespace')
        whitespace_checkbox.set_active(
            self._config.get_bool('remove_whitespace'))

        checkbox_label = _("_Remove newlines at the end of document")
        newlines_checkbox = gtk.CheckButton(checkbox_label)
        newlines_checkbox.connect('clicked',
                                  self.update_setting,
                                  'remove_newlines')
        newlines_checkbox.set_active(self._config.get_bool('remove_newlines'))

        config_box.pack_start(whitespace_checkbox, True, True, 0)
        config_box.pack_start(newlines_checkbox, True, True, 0)

        main_box.pack_start(title_label, True, True, 0)
        main_box.pack_start(config_box, True, True, 0)

        self.vbox.pack_start(main_box, True, True, 0)

        self.show_all()
コード例 #2
0
ファイル: window_helper.py プロジェクト: AceOfDiamond/gmate
    def __init__(self, window):
        """Constructor."""
        self._window = window
        self._views = {}

        self._action_group = None
        self._ui_id = None
        self._accel_group = None

        Localization.setup()

        self._insert_menu()
        self._setup_supplementary_accelerators()

        for view in self._window.get_views():
            self._initialize_viewhelper(view)

        self._tab_add_handler = self._window.connect('tab-added',
                                                     self._on_tab_added)
        self._tab_remove_handler = self._window.connect('tab-removed',
                                                        self._on_tab_removed)
コード例 #3
0
    def __init__(self, window):
        """Constructor."""
        self._window = window
        self._views = {}

        self._action_group = None
        self._ui_id = None
        self._accel_group = None

        Localization.setup()

        self._insert_menu()
        self._setup_supplementary_accelerators()

        for view in self._window.get_views():
            self._initialize_viewhelper(view)

        self._tab_add_handler = self._window.connect('tab-added',
                                                     self._on_tab_added)
        self._tab_remove_handler = self._window.connect(
            'tab-removed', self._on_tab_removed)
コード例 #4
0
 def test_not_dying_when_calling(self):
     try:
         Localization.setup()
     except:
         self.fail("Localization.setup did raise an error")
コード例 #5
0
 def test_not_dying_when_calling(self):
     try:
         Localization.setup()
     except:
         self.fail('Localization.setup did raise an error')
コード例 #6
0
 def __init__(self, window):
     """Constructor."""
     self._window = window
     self._action_group = None
     Localization.setup()
     self._insert_menu()
コード例 #7
0
ファイル: window_helper.py プロジェクト: AceOfDiamond/gmate
 def __init__(self, window):
     """Constructor."""
     self._window = window
     self._action_group = None
     Localization.setup()
     self._insert_menu()