Ejemplo n.º 1
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'sessions', _('Sessions'))
		self._tab_options = application.tab_options

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._session_store = gtk.ListStore(str, str, int)

		self._treeview = gtk.TreeView()
		self._treeview.set_model(self._session_store)
		self._treeview.set_rules_hint(True)

		cell_name = gtk.CellRendererText()
		cell_name.set_property('editable', True)
		cell_name.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_name.connect('edited', self._handle_edited_name, 0)

		col_name = gtk.TreeViewColumn(_('Name'), cell_name, text=0)
		col_name.set_min_width(200)
		col_name.set_resizable(True)

		self._treeview.append_column(col_name)
		container.add(self._treeview)

		# create controls
		button_box = gtk.HBox(False, 5)

		button_add = gtk.Button(stock=gtk.STOCK_ADD)
		button_add.connect('clicked', self._handle_add_session)

		button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
		button_delete.connect('clicked', self._handle_delete_session)

		image_up = gtk.Image()
		image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

		button_move_up = gtk.Button(label=None)
		button_move_up.add(image_up)
		button_move_up.set_tooltip_text(_('Move Up'))
		button_move_up.connect('clicked', self._handle_move_session, -1)

		image_down = gtk.Image()
		image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

		button_move_down = gtk.Button(label=None)
		button_move_down.add(image_down)
		button_move_down.set_tooltip_text(_('Move Down'))
		button_move_down.connect('clicked', self._handle_move_session, 1)

		# pack ui
		button_box.pack_start(button_add, False, False, 0)
		button_box.pack_start(button_delete, False, False, 0)
		button_box.pack_end(button_move_down, False, False, 0)
		button_box.pack_end(button_move_up, False, False, 0)

		self.pack_start(container, True, True, 0)
		self.pack_start(button_box, False, False, 0)
Ejemplo n.º 2
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'operation',
                              _('Operation'))

        # create frames
        frame_general = gtk.Frame(_('General'))
        vbox_general = gtk.VBox(False, 0)
        vbox_general.set_border_width(5)

        frame_mounts = gtk.Frame(_('Mounts'))
        vbox_mounts = gtk.VBox(False, 0)
        vbox_mounts.set_border_width(5)

        frame_confirmations = gtk.Frame(_('Confirmation'))
        vbox_confirmations = gtk.VBox(False, 0)
        vbox_confirmations.set_border_width(5)

        # create components
        self._checkbox_trash_files = gtk.CheckButton(
            _('Delete items to trashcan'))
        self._checkbox_reserve_size = gtk.CheckButton(
            _('Reserve free space on copy/move'))
        self._checkbox_automount_on_start = gtk.CheckButton(
            _('Automount drives on start up'))
        self._checkbox_automount_on_insert = gtk.CheckButton(
            _('Automount removable drives when inserted'))
        self._checkbox_confirm_delete = gtk.CheckButton(
            _('Show confirmation dialog before deleting items'))

        self._checkbox_trash_files.connect('toggled', self._parent.enable_save)
        self._checkbox_reserve_size.connect('toggled',
                                            self._parent.enable_save)
        self._checkbox_automount_on_start.connect('toggled',
                                                  self._parent.enable_save)
        self._checkbox_automount_on_insert.connect('toggled',
                                                   self._parent.enable_save)
        self._checkbox_confirm_delete.connect('toggled',
                                              self._confirm_delete_toggle)

        # pack user interface
        vbox_general.pack_start(self._checkbox_trash_files, False, False, 0)
        vbox_general.pack_start(self._checkbox_reserve_size, False, False, 0)

        vbox_mounts.pack_start(self._checkbox_automount_on_start, False, False,
                               0)
        vbox_mounts.pack_start(self._checkbox_automount_on_insert, False,
                               False, 0)

        vbox_confirmations.pack_start(self._checkbox_confirm_delete, False,
                                      False, 0)

        frame_general.add(vbox_general)
        frame_mounts.add(vbox_mounts)
        frame_confirmations.add(vbox_confirmations)

        self.pack_start(frame_general, False, False, 0)
        self.pack_start(frame_mounts, False, False, 0)
        self.pack_start(frame_confirmations, False, False, 0)
Ejemplo n.º 3
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'accelerators',
                              _('Associations'))

        # create interface
        container = gtk.ScrolledWindow()
        container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        container.set_shadow_type(gtk.SHADOW_IN)

        self._associations = gtk.TreeStore(str, str)
        self._list = gtk.TreeView(model=self._associations)
        self._list.set_rules_hint(True)
        self._list.set_headers_visible(False)

        cell_title = gtk.CellRendererText()
        cell_command = gtk.CellRendererText()

        col_title = gtk.TreeViewColumn(None, cell_title, text=0)
        col_title.set_min_width(200)
        col_title.set_resizable(True)

        col_command = gtk.TreeViewColumn(None, cell_command, text=1)
        col_command.set_resizable(True)
        col_command.set_expand(True)

        self._list.append_column(col_title)
        self._list.append_column(col_command)

        # create add menu
        self._add_menu = gtk.Menu()

        item_add_mime_type = gtk.MenuItem(label=_('Add mime type'))
        item_add_mime_type.connect('activate', self.__add_mime_type)

        item_add_application = gtk.MenuItem(
            label=_('Add application to mime type'))
        item_add_application.connect('activate', self.__add_application)

        self._add_menu.append(item_add_mime_type)
        self._add_menu.append(item_add_application)

        self._add_menu.show_all()

        # create controls
        hbox_controls = gtk.HBox(homogeneous=False, spacing=5)

        button_add = gtk.Button(stock=gtk.STOCK_ADD)
        button_add.connect('clicked', self.__button_add_clicked)

        # pack interface
        container.add(self._list)

        hbox_controls.pack_start(button_add, False, False, 0)

        self.pack_start(container, True, True, 0)
        self.pack_end(hbox_controls, False, False, 0)
Ejemplo n.º 4
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'accelerators', _('Associations'))

		# create interface
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._associations = gtk.TreeStore(str, str)
		self._list = gtk.TreeView(model=self._associations)
		self._list.set_rules_hint(True)
		self._list.set_headers_visible(False)

		cell_title = gtk.CellRendererText()
		cell_command = gtk.CellRendererText()

		col_title = gtk.TreeViewColumn(None, cell_title, text=0)
		col_title.set_min_width(200)
		col_title.set_resizable(True)

		col_command = gtk.TreeViewColumn(None, cell_command, text=1)
		col_command.set_resizable(True)
		col_command.set_expand(True)

		self._list.append_column(col_title)
		self._list.append_column(col_command)

		# create add menu
		self._add_menu = gtk.Menu()

		item_add_mime_type = gtk.MenuItem(label=_('Add mime type'))
		item_add_mime_type.connect('activate', self.__add_mime_type)

		item_add_application = gtk.MenuItem(label=_('Add application to mime type'))
		item_add_application.connect('activate', self.__add_application)

		self._add_menu.append(item_add_mime_type)
		self._add_menu.append(item_add_application)

		self._add_menu.show_all()

		# create controls
		hbox_controls = gtk.HBox(homogeneous=False, spacing=5)

		button_add = gtk.Button(stock=gtk.STOCK_ADD)
		button_add.connect('clicked', self.__button_add_clicked)

		# pack interface
		container.add(self._list)

		hbox_controls.pack_start(button_add, False, False, 0)

		self.pack_start(container, True, True, 0)
		self.pack_end(hbox_controls, False, False, 0)
Ejemplo n.º 5
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'operation', _('Operation'))

		# create frames
		frame_general = gtk.Frame(_('General'))
		vbox_general = gtk.VBox(False, 0)
		vbox_general.set_border_width(5)

		frame_mounts = gtk.Frame(_('Mounts'))
		vbox_mounts = gtk.VBox(False, 0)
		vbox_mounts.set_border_width(5)

		frame_confirmations = gtk.Frame(_('Confirmation'))
		vbox_confirmations = gtk.VBox(False, 0)
		vbox_confirmations.set_border_width(5)

		# create components
		self._checkbox_trash_files = gtk.CheckButton(_('Delete items to trashcan'))
		self._checkbox_reserve_size = gtk.CheckButton(_('Reserve free space on copy/move'))
		self._checkbox_automount_on_start = gtk.CheckButton(_('Automount drives on start up'))
		self._checkbox_automount_on_insert = gtk.CheckButton(_('Automount removable drives when inserted'))
		self._checkbox_confirm_delete = gtk.CheckButton(_('Show confirmation dialog before deleting items'))

		self._checkbox_trash_files.connect('toggled', self._parent.enable_save)
		self._checkbox_reserve_size.connect('toggled', self._parent.enable_save)
		self._checkbox_automount_on_start.connect('toggled', self._parent.enable_save)
		self._checkbox_automount_on_insert.connect('toggled', self._parent.enable_save)
		self._checkbox_confirm_delete.connect('toggled', self._confirm_delete_toggle)

		# pack user interface
		vbox_general.pack_start(self._checkbox_trash_files, False, False, 0)
		vbox_general.pack_start(self._checkbox_reserve_size, False, False, 0)

		vbox_mounts.pack_start(self._checkbox_automount_on_start, False, False, 0)
		vbox_mounts.pack_start(self._checkbox_automount_on_insert, False, False, 0)

		vbox_confirmations.pack_start(self._checkbox_confirm_delete, False, False, 0)

		frame_general.add(vbox_general)
		frame_mounts.add(vbox_mounts)
		frame_confirmations.add(vbox_confirmations)

		self.pack_start(frame_general, False, False, 0)
		self.pack_start(frame_mounts, False, False, 0)
		self.pack_start(frame_confirmations, False, False, 0)
Ejemplo n.º 6
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'accelerators', _('Key bindings'))

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._accels = gtk.TreeStore(str, str, int, int, int, int)
		self._accels.set_sort_column_id(Column.TITLE, gtk.SORT_ASCENDING)

		self._list = gtk.TreeView()
		self._list.set_model(self._accels)
		self._list.set_rules_hint(True)
		self._list.set_enable_search(True)
		self._list.set_search_column(Column.TITLE)

		# create and configure cell renderers
		cell_name = gtk.CellRendererText()
		cell_primary = gtk.CellRendererAccel()
		cell_secondary = gtk.CellRendererAccel()

		cell_primary.set_property('accel-mode', gtk.CELL_RENDERER_ACCEL_MODE_OTHER)
		cell_primary.set_property('editable', True)

		cell_primary.connect('accel-edited', self.__accel_edited, True)
		cell_primary.connect('accel-cleared', self.__accel_cleared, True)

		cell_secondary.set_property('accel-mode', gtk.CELL_RENDERER_ACCEL_MODE_OTHER)
		cell_secondary.set_property('editable', True)

		cell_secondary.connect('accel-edited', self.__accel_edited, False)
		cell_secondary.connect('accel-cleared', self.__accel_cleared, False)

		# create and pack columns
		col_name = gtk.TreeViewColumn(_('Description'), cell_name, markup=Column.TITLE)
		col_name.set_min_width(200)
		col_name.set_resizable(True)
		col_name.set_sort_column_id(Column.TITLE)
		col_name.set_sort_order(gtk.SORT_ASCENDING)

		col_primary = gtk.TreeViewColumn(
									_('Primary'),
									cell_primary,
									accel_key=Column.PRIMARY_KEY,
									accel_mods=Column.PRIMARY_MODS
								)
		col_primary.set_min_width(100)

		col_secondary = gtk.TreeViewColumn(
									_('Secondary'),
									cell_secondary,
									accel_key=Column.SECONDARY_KEY,
									accel_mods=Column.SECONDARY_MODS
								)
		col_secondary.set_min_width(100)

		self._list.append_column(col_name)
		self._list.append_column(col_primary)
		self._list.append_column(col_secondary)

		# warning label
		label_warning = gtk.Label(_(
							'<b>Note:</b> You can only edit accelerators from '
							'objects created at least once in current session. '
							'To disable accelerator press <i>Backspace</i> '
							'in assign mode.'
						))
		label_warning.set_alignment(0, 0)
		label_warning.set_use_markup(True)
		label_warning.set_line_wrap(True)
		label_warning.connect('size-allocate', self._adjust_label)

		# pack interface
		container.add(self._list)

		self.pack_start(label_warning, False, False, 0)
		self.pack_start(container, True, True, 0)
Ejemplo n.º 7
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'view_and_edit',
                              _('View & Edit'))

        # viewer options
        frame_view = gtk.Frame(_('View'))
        vbox_view = gtk.VBox(False, 0)
        vbox_view.set_border_width(5)

        self._checkbox_view_word_wrap = gtk.CheckButton(_('Wrap long lines'))
        self._checkbox_view_word_wrap.connect('toggled',
                                              self._parent.enable_save)

        # editor options
        frame_edit = gtk.Frame(_('Edit'))

        vbox_edit = gtk.VBox(False, 0)
        vbox_edit.set_border_width(5)

        # installed application
        self._radio_application = gtk.RadioButton(
            label=_('Use installed application'))
        self._radio_application.connect('toggled', self._parent.enable_save)

        align_application = gtk.Alignment(xscale=1)
        align_application.set_padding(0, 10, 15, 15)
        vbox_application = gtk.VBox(False, 0)
        vbox_application.set_border_width(5)

        self._store = gtk.ListStore(str, str, str)
        self._combobox_application = gtk.ComboBox(model=self._store)
        self._combobox_application.connect('changed', self._parent.enable_save)

        cell_icon = gtk.CellRendererPixbuf()
        cell_name = gtk.CellRendererText()

        self._combobox_application.pack_start(cell_icon, False)
        self._combobox_application.pack_start(cell_name, True)

        self._combobox_application.add_attribute(cell_icon, 'icon-name',
                                                 Column.ICON)
        self._combobox_application.add_attribute(cell_name, 'text',
                                                 Column.NAME)

        # external options
        self._radio_external = gtk.RadioButton(group=self._radio_application,
                                               label=_('Use external command'))
        self._radio_external.connect('toggled', self._parent.enable_save)

        align_external = gtk.Alignment(xscale=1)
        align_external.set_padding(0, 10, 15, 15)
        vbox_external = gtk.VBox(False, 0)
        vbox_external.set_border_width(5)

        label_editor = gtk.Label(_('Command line:'))
        label_editor.set_alignment(0, 0.5)
        label_editor.set_use_markup(True)
        self._entry_editor = gtk.Entry()
        self._entry_editor.connect('changed', self._parent.enable_save)

        self._checkbox_terminal_command = gtk.CheckButton(
            _('Execute command in terminal tab'))
        self._checkbox_terminal_command.connect('toggled',
                                                self._parent.enable_save)

        # pack ui
        vbox_view.pack_start(self._checkbox_view_word_wrap, False, False, 0)

        vbox_application.pack_start(self._combobox_application, False, False,
                                    0)
        align_application.add(vbox_application)

        vbox_external.pack_start(label_editor, False, False, 0)
        vbox_external.pack_start(self._entry_editor, False, False, 0)
        vbox_external.pack_start(self._checkbox_terminal_command, False, False,
                                 0)
        align_external.add(vbox_external)

        vbox_edit.pack_start(self._radio_application, False, False, 0)
        vbox_edit.pack_start(align_application, False, False, 0)
        vbox_edit.pack_start(self._radio_external, False, False, 0)
        vbox_edit.pack_start(align_external, False, False, 0)

        frame_view.add(vbox_view)
        frame_edit.add(vbox_edit)

        self.pack_start(frame_view, False, False, 0)
        self.pack_start(frame_edit, False, False, 0)
Ejemplo n.º 8
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'commands',
                              _('Commands'))

        # create list box
        container = gtk.ScrolledWindow()
        container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        container.set_shadow_type(gtk.SHADOW_IN)

        self._commands = gtk.ListStore(str, str)

        self._list = gtk.TreeView()
        self._list.set_model(self._commands)
        self._list.set_rules_hint(True)

        # create and configure cell renderers
        cell_title = gtk.CellRendererText()
        cell_title.set_property('editable', True)
        cell_title.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
        cell_title.connect('edited', self._edited_command, 0)

        cell_command = gtk.CellRendererText()
        cell_command.set_property('editable', True)
        cell_command.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
        cell_command.connect('edited', self._edited_command, 1)

        # create and pack columns
        col_title = gtk.TreeViewColumn(_('Title'),
                                       cell_title,
                                       text=Column.TITLE)
        col_title.set_min_width(200)
        col_title.set_resizable(True)

        col_command = gtk.TreeViewColumn(_('Command'),
                                         cell_command,
                                         text=Column.COMMAND)
        col_command.set_resizable(True)
        col_command.set_expand(True)

        self._list.append_column(col_title)
        self._list.append_column(col_command)

        container.add(self._list)

        # create controls
        button_box = gtk.HBox(False, 5)

        button_add = gtk.Button(stock=gtk.STOCK_ADD)
        button_add.connect('clicked', self._add_command)

        button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
        button_delete.connect('clicked', self._delete_command)

        image_up = gtk.Image()
        image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

        button_move_up = gtk.Button(label=None)
        button_move_up.add(image_up)
        button_move_up.set_tooltip_text(_('Move Up'))
        button_move_up.connect('clicked', self._move_command, -1)

        image_down = gtk.Image()
        image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

        button_move_down = gtk.Button(label=None)
        button_move_down.add(image_down)
        button_move_down.set_tooltip_text(_('Move Down'))
        button_move_down.connect('clicked', self._move_command, 1)

        # pack ui
        button_box.pack_start(button_add, False, False, 0)
        button_box.pack_start(button_delete, False, False, 0)
        button_box.pack_end(button_move_down, False, False, 0)
        button_box.pack_end(button_move_up, False, False, 0)

        self.pack_start(container, True, True, 0)
        self.pack_start(button_box, False, False, 0)
Ejemplo n.º 9
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'accelerators', _('Key bindings'))

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._accels = gtk.TreeStore(str, str, int, int, int, int)

		self._list = gtk.TreeView()
		self._list.set_model(self._accels)
		self._list.set_rules_hint(True)
		self._list.set_enable_search(True)
		self._list.set_search_column(Column.TITLE)

		# create and configure cell renderers
		cell_name = gtk.CellRendererText()
		cell_primary = gtk.CellRendererAccel()
		cell_secondary = gtk.CellRendererAccel()

		cell_primary.set_property('accel-mode', gtk.CELL_RENDERER_ACCEL_MODE_OTHER)
		cell_primary.set_property('editable', True)

		cell_primary.connect('accel-edited', self.__accel_edited, True)
		cell_primary.connect('accel-cleared', self.__accel_cleared, True)

		cell_secondary.set_property('accel-mode', gtk.CELL_RENDERER_ACCEL_MODE_OTHER)
		cell_secondary.set_property('editable', True)

		cell_secondary.connect('accel-edited', self.__accel_edited, False)
		cell_secondary.connect('accel-cleared', self.__accel_cleared, False)

		# create and pack columns
		col_name = gtk.TreeViewColumn(_('Description'), cell_name, markup=Column.TITLE)
		col_name.set_min_width(200)
		col_name.set_resizable(True)

		col_primary = gtk.TreeViewColumn(
									_('Primary'),
									cell_primary,
									accel_key=Column.PRIMARY_KEY,
									accel_mods=Column.PRIMARY_MODS
								)
		col_primary.set_min_width(100)

		col_secondary = gtk.TreeViewColumn(
									_('Secondary'),
									cell_secondary,
									accel_key=Column.SECONDARY_KEY,
									accel_mods=Column.SECONDARY_MODS
								)
		col_secondary.set_min_width(100)

		self._list.append_column(col_name)
		self._list.append_column(col_primary)
		self._list.append_column(col_secondary)

		# warning label
		label_warning = gtk.Label(_(
							'<b>Note:</b> You can only edit accelerators from '
							'objects created at least once in current session. '
							'To disable accelerator press <i>Backspace</i> '
							'in assign mode.'
						))
		label_warning.set_alignment(0, 0)
		label_warning.set_use_markup(True)
		label_warning.set_line_wrap(True)
		label_warning.connect('size-allocate', self._adjust_label)

		# pack interface
		container.add(self._list)

		self.pack_start(label_warning, False, False, 0)
		self.pack_start(container, True, True, 0)
Ejemplo n.º 10
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'display', _('Display'))

		notebook = gtk.Notebook()

		# main window options
		label_main_window = gtk.Label(_('Main window'))
		vbox_main_window = gtk.VBox(False, 0)
		vbox_main_window.set_border_width(5)

		self._checkbox_hide_on_close = gtk.CheckButton(_('Hide main window on close'))
		self._checkbox_multiple_instances = gtk.CheckButton(_('Allow multiple instances'))
		self._checkbox_show_toolbar = gtk.CheckButton(_('Show toolbar'))
		self._checkbox_show_command_bar = gtk.CheckButton(_('Show command bar'))
		self._checkbox_show_command_entry = gtk.CheckButton(_('Show command entry'))
		self._checkbox_horizontal_split = gtk.CheckButton(_('Horizontal split'))

		self._checkbox_hide_on_close.connect('toggled', self._parent.enable_save, True)
		self._checkbox_multiple_instances.connect('toggled', self._parent.enable_save, True)
		self._checkbox_show_toolbar.connect('toggled', self._parent.enable_save)
		self._checkbox_show_command_bar.connect('toggled', self._parent.enable_save)
		self._checkbox_show_command_entry.connect('toggled', self._parent.enable_save)
		self._checkbox_horizontal_split.connect('toggled', self._parent.enable_save)

		# tab options
		label_tabs = gtk.Label(_('Tabs'))
		vbox_tabs = gtk.VBox(False, 0)
		vbox_tabs.set_border_width(5)

		self._checkbox_focus_new_tab = gtk.CheckButton(_('Focus new tab after opening'))
		self._checkbox_button_relief = gtk.CheckButton(_('Show normal button relief'))
		self._checkbox_button_icons = gtk.CheckButton(_('Show icons instead of text in tab buttons'))
		self._checkbox_tab_close_button = gtk.CheckButton(_('Show close button'))
		self._checkbox_always_show_tabs = gtk.CheckButton(_('Show tab(s) even if there is only one'))
		self._checkbox_ubuntu_coloring = gtk.CheckButton(_('Use Ubuntu coloring method for tab title bars'))
		self._checkbox_superuser_notification = gtk.CheckButton(_('Change title bar color when started as super user'))

		self._checkbox_focus_new_tab.connect('toggled', self._parent.enable_save)
		self._checkbox_button_relief.connect('toggled', self._parent.enable_save)
		self._checkbox_button_icons.connect('toggled', self._parent.enable_save, True)
		self._checkbox_tab_close_button.connect('toggled', self._parent.enable_save)
		self._checkbox_always_show_tabs.connect('toggled', self._parent.enable_save)
		self._checkbox_ubuntu_coloring.connect('toggled', self._parent.enable_save)
		self._checkbox_superuser_notification.connect('toggled', self._parent.enable_save)

		# status bar
		table = gtk.Table(2, 2, False)
		table.set_col_spacing(0, 5)
		table.set_row_spacings(5)

		label_status_bar = gtk.Label(_('Show status bar:'))
		label_status_bar.set_alignment(0, 0.5)

		list_status_bar = gtk.ListStore(str, int)
		list_status_bar.append((_('Always'), StatusVisible.ALWAYS))
		list_status_bar.append((_('When needed'), StatusVisible.WHEN_NEEDED))
		list_status_bar.append((_('Never'), StatusVisible.NEVER))

		cell_status_bar = gtk.CellRendererText()

		self._combobox_status_bar = gtk.ComboBox(list_status_bar)
		self._combobox_status_bar.connect('changed', self._parent.enable_save)
		self._combobox_status_bar.pack_start(cell_status_bar)
		self._combobox_status_bar.add_attribute(cell_status_bar, 'text', 0)

		# expand tabs
		label_expand_tab = gtk.Label(_('Expanded tabs:'))
		label_expand_tab.set_alignment(0, 0.5)

		list_expand_tab = gtk.ListStore(str, int)
		list_expand_tab.append((_('None'), TabExpand.NONE))
		list_expand_tab.append((_('Active'), TabExpand.ACTIVE))
		list_expand_tab.append((_('All'), TabExpand.ALL))

		cell_expand_tab = gtk.CellRendererText()

		self._combobox_expand_tabs = gtk.ComboBox(list_expand_tab)
		self._combobox_expand_tabs.connect('changed', self._parent.enable_save)
		self._combobox_expand_tabs.pack_start(cell_expand_tab)
		self._combobox_expand_tabs.add_attribute(cell_expand_tab, 'text', 0)

		# other options
		label_other = gtk.Label(_('Other'))
		vbox_other = gtk.VBox(False, 0)
		vbox_other.set_border_width(5)

		self._checkbox_hide_window_on_minimize = gtk.CheckButton(_('Hide operation window on minimize'))
		self._checkbox_show_notifications = gtk.CheckButton(_('Show notifications'))

		self._checkbox_hide_window_on_minimize.connect('toggled', self._parent.enable_save)
		self._checkbox_show_notifications.connect('toggled', self._parent.enable_save)

		# size format
		hbox_size_format = gtk.HBox(False, 5)
		label_size_format = gtk.Label(_('Size format:'))
		label_size_format.set_alignment(0, 0.5)

		list_size_format = gtk.ListStore(str, int)
		list_size_format.append((_('Localized'), SizeFormat.LOCAL))
		list_size_format.append((_('SI <small>(1 kB = 1000 B)</small>'), SizeFormat.SI))
		list_size_format.append((_('IEC <small>(1 KiB = 1024 B)</small>'), SizeFormat.IEC))

		cell_size_format = gtk.CellRendererText()

		self._combobox_size_format = gtk.ComboBox(list_size_format)
		self._combobox_size_format.connect('changed', self._parent.enable_save)
		self._combobox_size_format.pack_start(cell_size_format)
		self._combobox_size_format.add_attribute(cell_size_format, 'markup', 0)

		# pack ui
		hbox_size_format.pack_start(label_size_format, False, False, 0)
		hbox_size_format.pack_start(self._combobox_size_format, False, False, 0)

		table.attach(label_status_bar, 0, 1, 0, 1, xoptions=gtk.FILL)
		table.attach(self._combobox_status_bar, 1, 2, 0, 1, xoptions=gtk.FILL)

		table.attach(label_expand_tab, 0, 1, 1, 2, xoptions=gtk.FILL)
		table.attach(self._combobox_expand_tabs, 1, 2, 1, 2, xoptions=gtk.FILL)

		vbox_main_window.pack_start(self._checkbox_hide_on_close, False, False, 0)
		vbox_main_window.pack_start(self._checkbox_multiple_instances, False, False, 0)
		vbox_main_window.pack_start(self._checkbox_show_toolbar, False, False, 0)
		vbox_main_window.pack_start(self._checkbox_show_command_bar, False, False, 0)
		vbox_main_window.pack_start(self._checkbox_show_command_entry, False, False, 0)
		vbox_main_window.pack_start(self._checkbox_horizontal_split, False, False, 0)

		vbox_tabs.pack_start(self._checkbox_focus_new_tab, False, False, 0)
		vbox_tabs.pack_start(self._checkbox_button_relief, False, False, 0)
		vbox_tabs.pack_start(self._checkbox_button_icons, False, False, 0)
		vbox_tabs.pack_start(self._checkbox_tab_close_button, False, False, 0)
		vbox_tabs.pack_start(self._checkbox_always_show_tabs, False, False, 0)
		vbox_tabs.pack_start(self._checkbox_ubuntu_coloring, False, False, 0)
		vbox_tabs.pack_start(self._checkbox_superuser_notification, False, False, 0)
		vbox_tabs.pack_start(table, False, False, 5)

		vbox_other.pack_start(self._checkbox_hide_window_on_minimize, False, False, 0)
		vbox_other.pack_start(self._checkbox_show_notifications, False, False, 0)
		vbox_other.pack_start(hbox_size_format, False, False, 0)

		notebook.append_page(vbox_main_window, label_main_window)
		notebook.append_page(vbox_tabs, label_tabs)
		notebook.append_page(vbox_other, label_other)

		self.pack_start(notebook, True, True, 0)
Ejemplo n.º 11
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'toolbar',
                              _('Toolbar'))

        self._toolbar_manager = self._application.toolbar_manager

        # create list box
        container = gtk.ScrolledWindow()
        container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        container.set_shadow_type(gtk.SHADOW_IN)

        self._store = gtk.ListStore(str, str, str, str)
        self._list = gtk.TreeView()
        self._list.set_model(self._store)

        cell_icon = gtk.CellRendererPixbuf()
        cell_name = gtk.CellRendererText()
        cell_type = gtk.CellRendererText()

        # create name column
        col_name = gtk.TreeViewColumn(_('Name'))
        col_name.set_min_width(200)
        col_name.set_resizable(True)

        # pack and configure renderes
        col_name.pack_start(cell_icon, False)
        col_name.pack_start(cell_name, True)
        col_name.add_attribute(cell_icon, 'icon-name', Column.ICON)
        col_name.add_attribute(cell_name, 'text', Column.NAME)

        # create type column
        col_type = gtk.TreeViewColumn(_('Type'),
                                      cell_type,
                                      markup=Column.DESCRIPTION)
        col_type.set_resizable(True)
        col_type.set_expand(True)

        # add columns to the list
        self._list.append_column(col_name)
        self._list.append_column(col_type)

        container.add(self._list)

        # create controls
        button_box = gtk.HBox(False, 5)

        button_add = gtk.Button(stock=gtk.STOCK_ADD)
        button_add.connect('clicked', self._add_widget)

        button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
        button_delete.connect('clicked', self._delete_widget)

        button_edit = gtk.Button(stock=gtk.STOCK_EDIT)
        button_edit.connect('clicked', self._edit_widget)

        image_up = gtk.Image()
        image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

        button_move_up = gtk.Button(label=None)
        button_move_up.add(image_up)
        button_move_up.set_tooltip_text(_('Move Up'))
        button_move_up.connect('clicked', self._move_widget, -1)

        image_down = gtk.Image()
        image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

        button_move_down = gtk.Button(label=None)
        button_move_down.add(image_down)
        button_move_down.set_tooltip_text(_('Move Down'))
        button_move_down.connect('clicked', self._move_widget, 1)

        # pack ui
        button_box.pack_start(button_add, False, False, 0)
        button_box.pack_start(button_delete, False, False, 0)
        button_box.pack_start(button_edit, False, False, 0)
        button_box.pack_end(button_move_down, False, False, 0)
        button_box.pack_end(button_move_up, False, False, 0)

        # toolbar style
        label_style = gtk.Label(_('Toolbar style:'))
        list_styles = gtk.ListStore(str, int)
        list_styles.append((_('Icons'), gtk.TOOLBAR_ICONS))
        list_styles.append((_('Text'), gtk.TOOLBAR_TEXT))
        list_styles.append((_('Both'), gtk.TOOLBAR_BOTH))
        list_styles.append((_('Both horizontal'), gtk.TOOLBAR_BOTH_HORIZ))

        renderer = gtk.CellRendererText()

        self._combobox_styles = gtk.ComboBox(list_styles)
        self._combobox_styles.pack_start(renderer)
        self._combobox_styles.add_attribute(renderer, 'text', 0)
        self._combobox_styles.connect('changed', self._parent.enable_save)

        # toolbar icon size
        label_icon_size = gtk.Label(_('Icon size:'))
        list_icon_size = gtk.ListStore(str, int)
        list_icon_size.append((_('Same as menu item'), gtk.ICON_SIZE_MENU))
        list_icon_size.append(
            (_('Small toolbar icon'), gtk.ICON_SIZE_SMALL_TOOLBAR))
        list_icon_size.append(
            (_('Large toolbar icon'), gtk.ICON_SIZE_LARGE_TOOLBAR))
        list_icon_size.append((_('Same as buttons'), gtk.ICON_SIZE_BUTTON))
        list_icon_size.append((_('Same as drag icons'), gtk.ICON_SIZE_DND))
        list_icon_size.append((_('Same as dialog'), gtk.ICON_SIZE_DIALOG))

        renderer = gtk.CellRendererText()

        self._combobox_icon_size = gtk.ComboBox(list_icon_size)
        self._combobox_icon_size.pack_start(renderer)
        self._combobox_icon_size.add_attribute(renderer, 'text', 0)
        self._combobox_icon_size.connect('changed', self._parent.enable_save)

        style_box = gtk.HBox(False, 5)
        style_box.pack_start(label_style, False, False, 0)
        style_box.pack_start(self._combobox_styles, False, False, 0)

        size_box = gtk.HBox(False, 5)
        size_box.pack_start(label_icon_size, False, False, 0)
        size_box.pack_start(self._combobox_icon_size, False, False, 0)

        self.pack_start(style_box, False, False, 0)
        self.pack_start(size_box, False, False, 0)
        self.pack_start(container, True, True, 0)
        self.pack_start(button_box, False, False, 0)
Ejemplo n.º 12
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'toolbar', _('Toolbar'))

		self._toolbar_manager = self._application.toolbar_manager

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._store = gtk.ListStore(str, str, str, str)
		self._list = gtk.TreeView()
		self._list.set_model(self._store)

		cell_icon = gtk.CellRendererPixbuf()
		cell_name = gtk.CellRendererText()
		cell_type = gtk.CellRendererText()

		# create name column
		col_name = gtk.TreeViewColumn(_('Name'))
		col_name.set_min_width(200)
		col_name.set_resizable(True)

		# pack and configure renderes
		col_name.pack_start(cell_icon, False)
		col_name.pack_start(cell_name, True)
		col_name.add_attribute(cell_icon, 'icon-name', Column.ICON)
		col_name.add_attribute(cell_name, 'text', Column.NAME)

		# create type column
		col_type = gtk.TreeViewColumn(_('Type'), cell_type, markup=Column.DESCRIPTION)
		col_type.set_resizable(True)
		col_type.set_expand(True)

		# add columns to the list
		self._list.append_column(col_name)
		self._list.append_column(col_type)

		container.add(self._list)

		# create controls
		button_box = gtk.HBox(False, 5)

		button_add = gtk.Button(stock=gtk.STOCK_ADD)
		button_add.connect('clicked', self._add_widget)

		button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
		button_delete.connect('clicked', self._delete_widget)

		button_edit = gtk.Button(stock=gtk.STOCK_EDIT)
		button_edit.connect('clicked', self._edit_widget)

		image_up = gtk.Image()
		image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

		button_move_up = gtk.Button(label=None)
		button_move_up.add(image_up)
		button_move_up.set_tooltip_text(_('Move Up'))
		button_move_up.connect('clicked', self._move_widget, -1)

		image_down = gtk.Image()
		image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

		button_move_down = gtk.Button(label=None)
		button_move_down.add(image_down)
		button_move_down.set_tooltip_text(_('Move Down'))
		button_move_down.connect('clicked', self._move_widget, 1)

		# pack ui
		button_box.pack_start(button_add, False, False, 0)
		button_box.pack_start(button_delete, False, False, 0)
		button_box.pack_start(button_edit, False, False, 0)
		button_box.pack_end(button_move_down, False, False, 0)
		button_box.pack_end(button_move_up, False, False, 0)

		# toolbar style
		label_style = gtk.Label(_('Toolbar style:'))
		list_styles = gtk.ListStore(str, int)
		list_styles.append((_('Icons'), gtk.TOOLBAR_ICONS))
		list_styles.append((_('Text'), gtk.TOOLBAR_TEXT))
		list_styles.append((_('Both'), gtk.TOOLBAR_BOTH))
		list_styles.append((_('Both horizontal'), gtk.TOOLBAR_BOTH_HORIZ))

		renderer = gtk.CellRendererText()

		self._combobox_styles = gtk.ComboBox(list_styles)
		self._combobox_styles.pack_start(renderer)
		self._combobox_styles.add_attribute(renderer, 'text', 0)
		self._combobox_styles.connect('changed', self._parent.enable_save)

		# toolbar icon size
		label_icon_size = gtk.Label(_('Icon size:'))
		list_icon_size = gtk.ListStore(str, int)
		list_icon_size.append((_('Same as menu item'), gtk.ICON_SIZE_MENU))
		list_icon_size.append((_('Small toolbar icon'), gtk.ICON_SIZE_SMALL_TOOLBAR))
		list_icon_size.append((_('Large toolbar icon'), gtk.ICON_SIZE_LARGE_TOOLBAR))
		list_icon_size.append((_('Same as buttons'), gtk.ICON_SIZE_BUTTON))
		list_icon_size.append((_('Same as drag icons'), gtk.ICON_SIZE_DND))
		list_icon_size.append((_('Same as dialog'), gtk.ICON_SIZE_DIALOG))

		renderer = gtk.CellRendererText()

		self._combobox_icon_size = gtk.ComboBox(list_icon_size)
		self._combobox_icon_size.pack_start(renderer)
		self._combobox_icon_size.add_attribute(renderer, 'text', 0)
		self._combobox_icon_size.connect('changed', self._parent.enable_save)

		style_box = gtk.HBox(False, 5)
		style_box.pack_start(label_style, False, False, 0)
		style_box.pack_start(self._combobox_styles, False, False, 0)

		size_box = gtk.HBox(False, 5)
		size_box.pack_start(label_icon_size, False, False, 0)
		size_box.pack_start(self._combobox_icon_size, False, False, 0)

		self.pack_start(style_box, False, False, 0)
		self.pack_start(size_box, False, False, 0)
		self.pack_start(container, True, True, 0)
		self.pack_start(button_box, False, False, 0)
Ejemplo n.º 13
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'toolbar', _('Toolbar'))

		self._toolbar_manager = self._application.toolbar_manager

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._store = gtk.ListStore(str, str, str, str)
		self._list = gtk.TreeView()
		self._list.set_model(self._store)

		cell_icon = gtk.CellRendererPixbuf()
		cell_name = gtk.CellRendererText()
		cell_type = gtk.CellRendererText()

		# create name column
		col_name = gtk.TreeViewColumn(_('Name'))
		col_name.set_min_width(200)
		col_name.set_resizable(True)

		# pack and configure renderes
		col_name.pack_start(cell_icon, False)
		col_name.pack_start(cell_name, True)
		col_name.add_attribute(cell_icon, 'icon-name', Column.ICON)
		col_name.add_attribute(cell_name, 'text', Column.NAME)

		# create type column
		col_type = gtk.TreeViewColumn(_('Type'), cell_type, markup=Column.DESCRIPTION)
		col_type.set_resizable(True)
		col_type.set_expand(True)

		# add columns to the list
		self._list.append_column(col_name)
		self._list.append_column(col_type)

		container.add(self._list)

		# create controls
		button_box = gtk.HBox(False, 5)

		button_add = gtk.Button(stock=gtk.STOCK_ADD)
		button_add.connect('clicked', self._add_widget)

		button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
		button_delete.connect('clicked', self._delete_widget)

		button_edit = gtk.Button(stock=gtk.STOCK_EDIT)
		button_edit.connect('clicked', self._edit_widget)

		image_up = gtk.Image()
		image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

		button_move_up = gtk.Button(label=None)
		button_move_up.add(image_up)
		button_move_up.set_tooltip_text(_('Move Up'))
		button_move_up.connect('clicked', self._move_widget, -1)

		image_down = gtk.Image()
		image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

		button_move_down = gtk.Button(label=None)
		button_move_down.add(image_down)
		button_move_down.set_tooltip_text(_('Move Down'))
		button_move_down.connect('clicked', self._move_widget, 1)

		# pack ui
		button_box.pack_start(button_add, False, False, 0)
		button_box.pack_start(button_delete, False, False, 0)
		button_box.pack_start(button_edit, False, False, 0)
		button_box.pack_end(button_move_down, False, False, 0)
		button_box.pack_end(button_move_up, False, False, 0)

		self.pack_start(container, True, True, 0)
		self.pack_start(button_box, False, False, 0)
Ejemplo n.º 14
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'plugins',
                              _('Plugins'))

        # create interface
        container = gtk.ScrolledWindow()
        container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        container.set_shadow_type(gtk.SHADOW_IN)

        # create list box
        self._plugins = gtk.ListStore(
            bool,  # active
            str,  # location
            str,  # name
            str,  # author
            str,  # version
            str,  # contact
            str,  # site
            str  # description
        )

        self._list = gtk.TreeView()
        self._list.set_model(self._plugins)
        self._list.set_rules_hint(True)
        self._list.connect('cursor-changed', self.__handle_cursor_change)

        # create and configure cell renderers
        cell_active = gtk.CellRendererToggle()
        cell_active.connect('toggled', self._toggle_plugin)
        cell_name = gtk.CellRendererText()
        cell_author = gtk.CellRendererText()
        cell_version = gtk.CellRendererText()

        # create and pack columns
        col_active = gtk.TreeViewColumn(_('Active'),
                                        cell_active,
                                        active=Column.ACTIVE)

        col_name = gtk.TreeViewColumn(_('Plugin name'),
                                      cell_name,
                                      text=Column.NAME)
        col_name.set_resizable(True)
        col_name.set_expand(True)

        col_version = gtk.TreeViewColumn(_('Version'),
                                         cell_version,
                                         text=Column.VERSION)

        col_author = gtk.TreeViewColumn(_('Author'),
                                        cell_author,
                                        text=Column.AUTHOR)
        col_author.set_resizable(True)

        self._list.append_column(col_active)
        self._list.append_column(col_name)
        self._list.append_column(col_version)
        self._list.append_column(col_author)

        # create description
        self._label_description = gtk.Label()
        self._label_description.set_use_markup(True)
        self._label_description.set_line_wrap(True)
        self._label_description.set_selectable(True)
        self._label_description.set_padding(5, 5)
        self._label_description.connect('size-allocate', self.__adjust_label)

        self._expander_description = gtk.Expander(_('Description'))
        self._expander_description.add(self._label_description)

        # create controls
        hbox_controls = gtk.HBox(False, 5)

        image_contact = gtk.Image()
        image_contact.set_from_icon_name('gnome-stock-mail-new',
                                         gtk.ICON_SIZE_BUTTON)

        self._button_contact = gtk.Button()
        self._button_contact.set_label(_('Contact'))
        self._button_contact.set_image(image_contact)
        self._button_contact.set_sensitive(False)
        self._button_contact.connect('clicked',
                                     self.__handle_contact_button_click)

        image_home_page = gtk.Image()
        image_home_page.set_from_stock(gtk.STOCK_HOME, gtk.ICON_SIZE_BUTTON)

        self._button_home_page = gtk.Button()
        self._button_home_page.set_label(_('Visit site'))
        self._button_home_page.set_image(image_home_page)
        self._button_home_page.set_sensitive(False)
        self._button_home_page.connect('clicked',
                                       self.__handle_home_page_button_click)

        # pack containers
        container.add(self._list)

        hbox_controls.pack_start(self._button_contact, False, False, 0)
        hbox_controls.pack_start(self._button_home_page, False, False, 0)

        self.pack_start(container, True, True, 0)
        self.pack_start(self._expander_description, False, False, 0)
        self.pack_start(hbox_controls, False, False, 0)
Ejemplo n.º 15
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'terminal',
                              _('Terminal'))

        # create vte terminal options
        align_vte = gtk.Alignment(xscale=1)
        align_vte.set_padding(0, 10, 15, 15)
        self._vbox_vte = gtk.VBox(False, 0)

        self._radio_vte = gtk.RadioButton(label=_('VTE based terminal'))
        self._radio_vte.connect('toggled', self._parent.enable_save)

        # option for showing scrollbars
        self._checkbox_scrollbars_visible = gtk.CheckButton(
            _('Show scrollbars when needed'))
        self._checkbox_scrollbars_visible.connect('toggled',
                                                  self._parent.enable_save)

        # option for custom font
        self._align_font = gtk.Alignment()
        self._align_font.set_padding(0, 0, 15, 15)
        hbox_font = gtk.HBox(False, 5)

        self._checkbox_system_font = gtk.CheckButton(
            _('Use the system fixed width font'))
        self._checkbox_system_font.connect('toggled',
                                           self.__toggled_system_font)

        label_font = gtk.Label(_('Font:'))
        label_font.set_alignment(0, 0.5)

        self._button_font = gtk.FontButton()
        self._button_font.connect('font-set', self._parent.enable_save)

        # option for cursor shape
        hbox_cursor_shape = gtk.HBox(False, 5)

        label_cursor_shape = gtk.Label(_('Cursor shape:'))
        label_cursor_shape.set_alignment(0, 0.5)

        list_cursor_shape = gtk.ListStore(str, int)
        list_cursor_shape.append((_('Block'), CursorShape.BLOCK))
        list_cursor_shape.append((_('I-Beam'), CursorShape.IBEAM))
        list_cursor_shape.append((_('Underline'), CursorShape.UNDERLINE))

        cell_cursor_shape = gtk.CellRendererText()

        self._combobox_cursor_shape = gtk.ComboBox(list_cursor_shape)
        self._combobox_cursor_shape.connect('changed',
                                            self._parent.enable_save)
        self._combobox_cursor_shape.pack_start(cell_cursor_shape)
        self._combobox_cursor_shape.add_attribute(cell_cursor_shape, 'text', 0)

        # option for allowing bold text in terminal
        self._checkbox_allow_bold = gtk.CheckButton(_('Allow bold text'))
        self._checkbox_allow_bold.connect('toggled', self._parent.enable_save)

        # option for automatically hiding mouse when typing
        self._checkbox_autohide_mouse = gtk.CheckButton(
            _('Automatically hide mouse when typing'))
        self._checkbox_autohide_mouse.connect('toggled',
                                              self._parent.enable_save)

        # create external terminal options
        align_external = gtk.Alignment(xscale=1)
        align_external.set_padding(0, 0, 15, 15)
        self._vbox_external = gtk.VBox(False, 5)

        self._radio_external = gtk.RadioButton(group=self._radio_vte,
                                               label=_('External terminal'))

        vbox_command = gtk.VBox(False, 0)
        label_command = gtk.Label(_('Command line:'))
        label_command.set_alignment(0, 0.5)
        self._entry_command = gtk.Entry()
        self._entry_command.connect('changed', self._parent.enable_save)

        vbox_command2 = gtk.VBox(False, 0)
        label_command2 = gtk.Label(
            _('Command line for executing specific program:'))
        label_command2.set_alignment(0, 0.5)
        self._entry_command2 = gtk.Entry()
        self._entry_command2.connect('changed', self._parent.enable_save)

        label_note = gtk.Label(
            _('<small><i>Note:'
              '\n\tOmitting {0} will open new terminal application instead of tab.'
              '\n\t{0} will be replaced with socket/window id.'
              '\n\t{1} will be replaced with specified command and its parameters.'
              '\n\t{2} will be replaced with current working directory.'
              '</i></small>'))
        label_note.set_alignment(0, 0)
        label_note.set_use_markup(True)

        # pack interface
        hbox_font.pack_start(label_font, False, False, 0)
        hbox_font.pack_start(self._button_font, True, True, 0)

        self._align_font.add(hbox_font)

        hbox_cursor_shape.pack_start(label_cursor_shape, False, False, 0)
        hbox_cursor_shape.pack_start(self._combobox_cursor_shape, False, False,
                                     0)

        vbox_command.pack_start(label_command, False, False, 0)
        vbox_command.pack_start(self._entry_command, False, False, 0)
        vbox_command2.pack_start(label_command2, False, False, 0)
        vbox_command2.pack_start(self._entry_command2, False, False, 0)

        self._vbox_vte.pack_start(self._checkbox_scrollbars_visible, False,
                                  False, 0)
        self._vbox_vte.pack_start(self._checkbox_system_font, False, False, 0)
        self._vbox_vte.pack_start(self._align_font, False, False, 0)
        self._vbox_vte.pack_start(hbox_cursor_shape, False, False, 5)
        self._vbox_vte.pack_start(self._checkbox_allow_bold, False, False, 0)
        self._vbox_vte.pack_start(self._checkbox_autohide_mouse, False, False,
                                  0)

        self._vbox_external.pack_start(vbox_command, False, False, 0)
        self._vbox_external.pack_start(vbox_command2, False, False, 0)
        self._vbox_external.pack_start(label_note, False, False, 0)

        align_vte.add(self._vbox_vte)
        align_external.add(self._vbox_external)

        self.pack_start(self._radio_vte, False, False, 0)
        self.pack_start(align_vte, False, False, 0)
        self.pack_start(self._radio_external, False, False, 0)
        self.pack_start(align_external, False, False, 0)
Ejemplo n.º 16
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'terminal', _('Terminal'))

		# create vte terminal options
		align_vte = gtk.Alignment(xscale=1)
		align_vte.set_padding(0, 10, 15, 15)
		self._vbox_vte = gtk.VBox(False, 0)

		self._radio_vte = gtk.RadioButton(label=_('VTE based terminal'))
		self._radio_vte.connect('toggled', self._parent.enable_save)

		# option for showing scrollbars
		self._checkbox_scrollbars_visible = gtk.CheckButton(_('Show scrollbars when needed'))
		self._checkbox_scrollbars_visible.connect('toggled', self._parent.enable_save)

		# option for custom font
		self._align_font = gtk.Alignment()
		self._align_font.set_padding(0, 0, 15, 15)
		hbox_font = gtk.HBox(False, 5)

		self._checkbox_system_font = gtk.CheckButton(_('Use the system fixed width font'))
		self._checkbox_system_font.connect('toggled', self.__toggled_system_font)

		label_font = gtk.Label(_('Font:'))
		label_font.set_alignment(0, 0.5)

		self._button_font = gtk.FontButton()
		self._button_font.connect('font-set', self._parent.enable_save)

		# option for cursor shape
		hbox_cursor_shape = gtk.HBox(False, 5)

		label_cursor_shape = gtk.Label(_('Cursor shape:'))
		label_cursor_shape.set_alignment(0, 0.5)

		list_cursor_shape = gtk.ListStore(str, int)
		list_cursor_shape.append((_('Block'), CursorShape.BLOCK))
		list_cursor_shape.append((_('I-Beam'), CursorShape.IBEAM))
		list_cursor_shape.append((_('Underline'), CursorShape.UNDERLINE))

		cell_cursor_shape = gtk.CellRendererText()

		self._combobox_cursor_shape = gtk.ComboBox(list_cursor_shape)
		self._combobox_cursor_shape.connect('changed', self._parent.enable_save)
		self._combobox_cursor_shape.pack_start(cell_cursor_shape)
		self._combobox_cursor_shape.add_attribute(cell_cursor_shape, 'text', 0)

		# option for allowing bold text in terminal
		self._checkbox_allow_bold = gtk.CheckButton(_('Allow bold text'))
		self._checkbox_allow_bold.connect('toggled', self._parent.enable_save)

		# option for automatically hiding mouse when typing
		self._checkbox_autohide_mouse = gtk.CheckButton(_('Automatically hide mouse when typing'))
		self._checkbox_autohide_mouse.connect('toggled', self._parent.enable_save)

		# create external terminal options
		align_external = gtk.Alignment(xscale=1)
		align_external.set_padding(0, 0, 15, 15)
		self._vbox_external = gtk.VBox(False, 5)

		self._radio_external = gtk.RadioButton(group=self._radio_vte, label=_('External terminal'))

		vbox_command = gtk.VBox(False, 0)
		label_command = gtk.Label(_('Command line:'))
		label_command.set_alignment(0, 0.5)
		self._entry_command = gtk.Entry()
		self._entry_command.connect('changed', self._parent.enable_save)

		vbox_command2 = gtk.VBox(False, 0)
		label_command2 = gtk.Label(_('Command line for executing specific program:'))
		label_command2.set_alignment(0, 0.5)
		self._entry_command2 = gtk.Entry()
		self._entry_command2.connect('changed', self._parent.enable_save)

		label_note = gtk.Label(_(
					'<small><i>Note:'
					'\n\tOmitting {0} will open new terminal application instead of tab.'
					'\n\t{0} will be replaced with socket/window id.'
					'\n\t{1} will be replaced with specified command and its parameters.'
					'\n\t{2} will be replaced with current working directory.'
					'</i></small>'
				))
		label_note.set_alignment(0, 0)
		label_note.set_use_markup(True)

		# pack interface
		hbox_font.pack_start(label_font, False, False, 0)
		hbox_font.pack_start(self._button_font, True, True, 0)

		self._align_font.add(hbox_font)

		hbox_cursor_shape.pack_start(label_cursor_shape, False, False, 0)
		hbox_cursor_shape.pack_start(self._combobox_cursor_shape, False, False, 0)


		vbox_command.pack_start(label_command, False, False, 0)
		vbox_command.pack_start(self._entry_command, False, False, 0)
		vbox_command2.pack_start(label_command2, False, False, 0)
		vbox_command2.pack_start(self._entry_command2, False, False, 0)

		self._vbox_vte.pack_start(self._checkbox_scrollbars_visible, False, False, 0)
		self._vbox_vte.pack_start(self._checkbox_system_font, False, False, 0)
		self._vbox_vte.pack_start(self._align_font, False, False, 0)
		self._vbox_vte.pack_start(hbox_cursor_shape, False, False, 5)
		self._vbox_vte.pack_start(self._checkbox_allow_bold, False, False, 0)
		self._vbox_vte.pack_start(self._checkbox_autohide_mouse, False, False, 0)

		self._vbox_external.pack_start(vbox_command, False, False, 0)
		self._vbox_external.pack_start(vbox_command2, False, False, 0)
		self._vbox_external.pack_start(label_note, False, False, 0)

		align_vte.add(self._vbox_vte)
		align_external.add(self._vbox_external)

		self.pack_start(self._radio_vte, False, False, 0)
		self.pack_start(align_vte, False, False, 0)
		self.pack_start(self._radio_external, False, False, 0)
		self.pack_start(align_external, False, False, 0)
Ejemplo n.º 17
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'bookmarks', _('Bookmarks'))

		# mounts checkbox
		self._checkbox_show_mount_points = gtk.CheckButton(_('Show mount points in bookmarks menu'))
		self._checkbox_show_mount_points.connect('toggled', self._parent.enable_save)

		# system bookmarks checkbox
		self._checkbox_system_bookmarks = gtk.CheckButton(_('Show system bookmarks'))
		self._checkbox_system_bookmarks.connect('toggled', self._parent.enable_save)

		# bookmarks checkbox
		self._checkbox_add_home = gtk.CheckButton(_('Add home directory to bookmarks menu'))
		self._checkbox_add_home.connect('toggled', self._parent.enable_save)

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._bookmarks = gtk.ListStore(str, str)

		self._list = gtk.TreeView()
		self._list.set_model(self._bookmarks)
		self._list.set_rules_hint(True)

		cell_title = gtk.CellRendererText()
		cell_title.set_property('editable', True)
		cell_title.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_title.connect('edited', self._edited_bookmark, 0)

		cell_command = gtk.CellRendererText()
		cell_command.set_property('editable', True)
		cell_command.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_command.connect('edited', self._edited_bookmark, 1)

		col_title = gtk.TreeViewColumn(_('Title'), cell_title, text=Column.NAME)
		col_title.set_min_width(200)
		col_title.set_resizable(True)

		col_command = gtk.TreeViewColumn(_('Location'), cell_command, text=Column.URI)
		col_command.set_resizable(True)
		col_command.set_expand(True)

		self._list.append_column(col_title)
		self._list.append_column(col_command)

		container.add(self._list)

		# create controls
		button_box = gtk.HBox(False, 5)

		button_add = gtk.Button(stock=gtk.STOCK_ADD)
		button_add.connect('clicked', self._add_bookmark)

		button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
		button_delete.connect('clicked', self._delete_bookmark)

		image_up = gtk.Image()
		image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

		button_move_up = gtk.Button(label=None)
		button_move_up.add(image_up)
		button_move_up.set_tooltip_text(_('Move Up'))
		button_move_up.connect('clicked', self._move_bookmark, -1)

		image_down = gtk.Image()
		image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

		button_move_down = gtk.Button(label=None)
		button_move_down.add(image_down)
		button_move_down.set_tooltip_text(_('Move Down'))
		button_move_down.connect('clicked', self._move_bookmark, 1)

		# pack ui
		button_box.pack_start(button_add, False, False, 0)
		button_box.pack_start(button_delete, False, False, 0)
		button_box.pack_end(button_move_down, False, False, 0)
		button_box.pack_end(button_move_up, False, False, 0)

		# pack checkboxes
		vbox = gtk.VBox(False, 0)

		vbox.pack_start(self._checkbox_show_mount_points, False, False, 0)
		vbox.pack_start(self._checkbox_system_bookmarks, False, False, 0)
		vbox.pack_start(self._checkbox_add_home, False, False, 0)

		self.pack_start(vbox, False, False, 0)
		self.pack_start(container, True, True, 0)
		self.pack_start(button_box, False, False, 0)
Ejemplo n.º 18
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'plugins', _('Plugins'))

		# create interface
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		# create list box
		self._plugins = gtk.ListStore(
									bool,	# active
									str,	# location
									str,	# name
									str,	# author
									str,	# version
									str,	# contact
									str,	# site
									str		# description
								)

		self._list = gtk.TreeView()
		self._list.set_model(self._plugins)
		self._list.set_rules_hint(True)
		self._list.connect('cursor-changed', self.__handle_cursor_change)

		# create and configure cell renderers
		cell_active = gtk.CellRendererToggle()
		cell_active.connect('toggled', self._toggle_plugin)
		cell_name = gtk.CellRendererText()
		cell_author = gtk.CellRendererText()
		cell_version = gtk.CellRendererText()

		# create and pack columns
		col_active = gtk.TreeViewColumn(_('Active'), cell_active, active=Column.ACTIVE)

		col_name = gtk.TreeViewColumn(_('Plugin name'), cell_name, text=Column.NAME)
		col_name.set_resizable(True)
		col_name.set_expand(True)

		col_version = gtk.TreeViewColumn(_('Version'), cell_version, text=Column.VERSION)

		col_author = gtk.TreeViewColumn(_('Author'), cell_author, text=Column.AUTHOR)
		col_author.set_resizable(True)

		self._list.append_column(col_active)
		self._list.append_column(col_name)
		self._list.append_column(col_version)
		self._list.append_column(col_author)

		# create description
		self._label_description = gtk.Label()
		self._label_description.set_use_markup(True)
		self._label_description.set_line_wrap(True)
		self._label_description.set_selectable(True)
		self._label_description.set_padding(5, 5)
		self._label_description.connect('size-allocate', self.__adjust_label)

		self._expander_description = gtk.Expander(_('Description'))
		self._expander_description.add(self._label_description)

		# create controls
		hbox_controls = gtk.HBox(False, 5)

		image_contact = gtk.Image()
		image_contact.set_from_icon_name('gnome-stock-mail-new', gtk.ICON_SIZE_BUTTON)

		self._button_contact = gtk.Button()
		self._button_contact.set_label(_('Contact'))
		self._button_contact.set_image(image_contact)
		self._button_contact.set_sensitive(False)
		self._button_contact.connect('clicked', self.__handle_contact_button_click)

		image_home_page = gtk.Image()
		image_home_page.set_from_stock(gtk.STOCK_HOME, gtk.ICON_SIZE_BUTTON)

		self._button_home_page = gtk.Button()
		self._button_home_page.set_label(_('Visit site'))
		self._button_home_page.set_image(image_home_page)
		self._button_home_page.set_sensitive(False)
		self._button_home_page.connect('clicked', self.__handle_home_page_button_click)

		# pack containers
		container.add(self._list)

		hbox_controls.pack_start(self._button_contact, False, False, 0)
		hbox_controls.pack_start(self._button_home_page, False, False, 0)

		self.pack_start(container, True, True, 0)
		self.pack_start(self._expander_description, False, False, 0)
		self.pack_start(hbox_controls, False, False, 0)
Ejemplo n.º 19
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'view_and_edit', _('View & Edit'))

		# viewer options
		frame_view = gtk.Frame(_('View'))
		vbox_view = gtk.VBox(False, 0)
		vbox_view.set_border_width(5)

		self._checkbox_view_word_wrap = gtk.CheckButton(_('Wrap long lines'))
		self._checkbox_view_word_wrap.connect('toggled', self._parent.enable_save)

		# editor options
		frame_edit = gtk.Frame(_('Edit'))

		vbox_edit = gtk.VBox(False, 0)
		vbox_edit.set_border_width(5)

		# installed application
		self._radio_application = gtk.RadioButton(label=_('Use installed application'))
		self._radio_application.connect('toggled', self._parent.enable_save)

		align_application = gtk.Alignment(xscale=1)
		align_application.set_padding(0, 10, 15, 15)
		vbox_application = gtk.VBox(False, 0)
		vbox_application.set_border_width(5)

		self._store = gtk.ListStore(str, str, str)
		self._combobox_application = gtk.ComboBox(model=self._store)
		self._combobox_application.connect('changed', self._parent.enable_save)

		cell_icon = gtk.CellRendererPixbuf()
		cell_name = gtk.CellRendererText()

		self._combobox_application.pack_start(cell_icon, False)
		self._combobox_application.pack_start(cell_name, True)

		self._combobox_application.add_attribute(cell_icon, 'icon-name', Column.ICON)
		self._combobox_application.add_attribute(cell_name, 'text', Column.NAME)

		# external options
		self._radio_external = gtk.RadioButton(group=self._radio_application, label=_('Use external command'))
		self._radio_external.connect('toggled', self._parent.enable_save)

		align_external = gtk.Alignment(xscale=1)
		align_external.set_padding(0, 10, 15, 15)
		vbox_external = gtk.VBox(False, 0)
		vbox_external.set_border_width(5)

		label_editor = gtk.Label(_('Command line:'))
		label_editor.set_alignment(0, 0.5)
		label_editor.set_use_markup(True)
		self._entry_editor = gtk.Entry()
		self._entry_editor.connect('changed', self._parent.enable_save)

		self._checkbox_terminal_command = gtk.CheckButton(_('Execute command in terminal tab'))
		self._checkbox_terminal_command.connect('toggled', self._parent.enable_save)

		# pack ui
		vbox_view.pack_start(self._checkbox_view_word_wrap, False, False, 0)

		vbox_application.pack_start(self._combobox_application, False, False, 0)
		align_application.add(vbox_application)

		vbox_external.pack_start(label_editor, False, False, 0)
		vbox_external.pack_start(self._entry_editor, False, False, 0)
		vbox_external.pack_start(self._checkbox_terminal_command, False, False, 0)
		align_external.add(vbox_external)

		vbox_edit.pack_start(self._radio_application, False, False, 0)
		vbox_edit.pack_start(align_application, False, False, 0)
		vbox_edit.pack_start(self._radio_external, False, False, 0)
		vbox_edit.pack_start(align_external, False, False, 0)

		frame_view.add(vbox_view)
		frame_edit.add(vbox_edit)

		self.pack_start(frame_view, False, False, 0)
		self.pack_start(frame_edit, False, False, 0)
Ejemplo n.º 20
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'item_list', _('Item List'))

		notebook = gtk.Notebook()

		# create frames
		label_look_and_feel = gtk.Label(_('Look & feel'))
		label_operation = gtk.Label(_('Operation'))
		label_directories = gtk.Label(_('Directories'))
		label_columns = gtk.Label(_('Columns'))

		# vertical boxes
		vbox_look_and_feel = gtk.VBox(False, 0)
		vbox_operation = gtk.VBox(False, 0)
		vbox_directory = gtk.VBox(False, 0)
		vbox_columns = gtk.VBox(False, 0)

		vbox_look_and_feel.set_border_width(5)
		vbox_operation.set_border_width(5)
		vbox_directory.set_border_width(5)
		vbox_directory.set_spacing(5)
		vbox_columns.set_border_width(5)

		# file list options
		self._checkbox_row_hinting = gtk.CheckButton(_('Row hinting'))
		self._checkbox_show_hidden = gtk.CheckButton(_('Show hidden files'))
		self._checkbox_case_sensitive = gtk.CheckButton(_('Case sensitive item sorting'))
		self._checkbox_number_sensitive = gtk.CheckButton(_('Number sensitive item sorting'))
		self._checkbox_single_click = gtk.CheckButton(_('Single click navigation'))
		self._checkbox_right_click = gtk.CheckButton(_('Right click selects items'))
		self._checkbox_show_headers = gtk.CheckButton(_('Show list headers'))
		self._checkbox_media_preview = gtk.CheckButton(_('Fast media preview'))
		self._checkbox_show_expanders = gtk.CheckButton(_('Show tree expanders'))
		self._checkbox_hide_scrollbar = gtk.CheckButton(_('Hide horizontal scrollbar'))
		self._checkbox_second_extension = gtk.CheckButton(_('Support second level extension'))

		self._checkbox_row_hinting.connect('toggled', self._parent.enable_save)
		self._checkbox_show_hidden.connect('toggled', self._parent.enable_save)
		self._checkbox_case_sensitive.connect('toggled', self._parent.enable_save)
		self._checkbox_number_sensitive.connect('toggled', self._parent.enable_save)
		self._checkbox_single_click.connect('toggled', self._parent.enable_save)
		self._checkbox_right_click.connect('toggled', self._parent.enable_save)
		self._checkbox_show_headers.connect('toggled', self._parent.enable_save)
		self._checkbox_media_preview.connect('toggled', self._parent.enable_save)
		self._checkbox_show_expanders.connect('toggled', self._parent.enable_save)
		self._checkbox_hide_scrollbar.connect('toggled', self._parent.enable_save)
		self._checkbox_second_extension.connect('toggled', self._parent.enable_save)

		# bread crumbs type
		hbox_breadcrumbs = gtk.HBox(False, 5)
		label_breadcrumbs = gtk.Label(_('Breadcrumbs:'))
		label_breadcrumbs.set_alignment(0, 0.5)

		list_breadcrumbs = gtk.ListStore(str, int)
		list_breadcrumbs.append((_('None'), Breadcrumbs.TYPE_NONE))
		list_breadcrumbs.append((_('Normal'), Breadcrumbs.TYPE_NORMAL))
		list_breadcrumbs.append((_('Smart'), Breadcrumbs.TYPE_SMART))

		cell_breadcrumbs = gtk.CellRendererText()

		self._combobox_breadcrumbs = gtk.ComboBox(list_breadcrumbs)
		self._combobox_breadcrumbs.connect('changed', self._parent.enable_save)
		self._combobox_breadcrumbs.pack_start(cell_breadcrumbs)
		self._combobox_breadcrumbs.add_attribute(cell_breadcrumbs, 'text', 0)

		# file access mode format
		hbox_mode_format = gtk.HBox(False, 5)
		label_mode_format = gtk.Label(_('Access mode format:'))
		label_mode_format.set_alignment(0, 0.5)

		list_mode_format = gtk.ListStore(str, int)
		list_mode_format.append((_('Octal'), AccessModeFormat.OCTAL))
		list_mode_format.append((_('Textual'), AccessModeFormat.TEXTUAL))

		cell_mode_format = gtk.CellRendererText()

		self._combobox_mode_format = gtk.ComboBox(list_mode_format)
		self._combobox_mode_format.connect('changed', self._parent.enable_save)
		self._combobox_mode_format.pack_start(cell_mode_format)
		self._combobox_mode_format.add_attribute(cell_mode_format, 'text', 0)

		# grid lines
		hbox_grid_lines = gtk.HBox(False, 5)
		label_grid_lines = gtk.Label(_('Show grid lines:'))
		label_grid_lines.set_alignment(0, 0.5)

		list_grid_lines = gtk.ListStore(str, int)
		list_grid_lines.append((_('None'), gtk.TREE_VIEW_GRID_LINES_NONE))
		list_grid_lines.append((_('Horizontal'), gtk.TREE_VIEW_GRID_LINES_HORIZONTAL))
		list_grid_lines.append((_('Vertical'), gtk.TREE_VIEW_GRID_LINES_VERTICAL))
		list_grid_lines.append((_('Both'), gtk.TREE_VIEW_GRID_LINES_BOTH))

		cell_grid_lines = gtk.CellRendererText()

		self._combobox_grid_lines = gtk.ComboBox(list_grid_lines)
		self._combobox_grid_lines.connect('changed', self._parent.enable_save)
		self._combobox_grid_lines.pack_start(cell_grid_lines)
		self._combobox_grid_lines.add_attribute(cell_grid_lines, 'text', 0)

		# selection color
		hbox_selection_color = gtk.HBox(False, 5)

		label_selection_color = gtk.Label(_('Selection color:'))
		label_selection_color.set_alignment(0, 0.5)

		self._button_selection_color = gtk.ColorButton()
		self._button_selection_color.set_use_alpha(False)
		self._button_selection_color.connect('color-set', self._parent.enable_save)

		# selection indicator
		hbox_indicator = gtk.HBox(False, 5)

		label_indicator = gtk.Label(_('Selection indicator:'))
		label_indicator.set_alignment(0, 0.5)

		list_indicator = gtk.ListStore(str)
		list_indicator.append((u'\u25b6',))
		list_indicator.append((u'\u25e2',))
		list_indicator.append((u'\u25c8',))
		list_indicator.append((u'\u263b',))
		list_indicator.append((u'\u2771',))
		list_indicator.append((u'\u2738',))
		list_indicator.append((u'\u2731',))

		self._combobox_indicator = gtk.ComboBoxEntry(list_indicator, 0)
		self._combobox_indicator.connect('changed', self._parent.enable_save)
		self._combobox_indicator.set_size_request(100, -1)

		# quick search
		label_quick_search = gtk.Label(_('Quick search combination:'))
		label_quick_search.set_alignment(0, 0.5)
		label_quick_search.set_use_markup(True)
		self._checkbox_control = gtk.CheckButton(_('Control'))
		self._checkbox_alt = gtk.CheckButton(_('Alt'))
		self._checkbox_shift = gtk.CheckButton(_('Shift'))

		self._checkbox_control.connect('toggled', self._parent.enable_save)
		self._checkbox_alt.connect('toggled', self._parent.enable_save)
		self._checkbox_shift.connect('toggled', self._parent.enable_save)

		hbox_quick_search = gtk.HBox(False, 5)

		vbox_time_format = gtk.VBox(False, 0)
		label_time_format = gtk.Label(_('Date format:'))
		label_time_format.set_alignment(0, 0.5)
		self._entry_time_format = gtk.Entry()
		self._entry_time_format.set_tooltip_markup(
								'<b>' + _('Time is formed using the format located at:') + '</b>\n'
								'http://docs.python.org/library/time.html#time.strftime'
							)
		self._entry_time_format.connect('changed', self._parent.enable_save)

		# create list of directories
		container_directory = gtk.ScrolledWindow()
		container_directory.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container_directory.set_shadow_type(gtk.SHADOW_IN)

		self._checkbox_load_directories = gtk.CheckButton(_('Load specified tabs instead of saved'))
		self._checkbox_load_directories.connect('toggled', self._parent.enable_save)

		self._directory_store = gtk.ListStore(str, bool, bool)
		self._directory_list = gtk.TreeView(model=self._directory_store)

		cell_directory = gtk.CellRendererText()
		cell_left_list = gtk.CellRendererToggle()
		cell_right_list = gtk.CellRendererToggle()

		cell_left_list.connect('toggled', self._toggle_path, Source.LEFT)
		cell_right_list.connect('toggled', self._toggle_path, Source.RIGHT)

		col_directory = gtk.TreeViewColumn(_('Directory'), cell_directory, text=DirectoryColumn.PATH)
		col_directory.set_min_width(200)
		col_directory.set_resizable(True)
		col_directory.set_expand(True)

		col_left_list = gtk.TreeViewColumn(_('Left list'), cell_left_list, active=DirectoryColumn.LEFT_LIST)
		col_right_list = gtk.TreeViewColumn(_('Right list'), cell_right_list, active=DirectoryColumn.RIGHT_LIST)

		self._directory_list.append_column(col_directory)
		self._directory_list.append_column(col_left_list)
		self._directory_list.append_column(col_right_list)

		hbox_directory = gtk.HBox(False, 5)

		button_add_directory = gtk.Button(stock=gtk.STOCK_ADD)
		button_add_directory.connect('clicked', self.__button_add_clicked)

		button_delete_directory = gtk.Button(stock=gtk.STOCK_DELETE)
		button_delete_directory.connect('clicked', self._delete_path)

		image_up = gtk.Image()
		image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

		button_directory_move_up = gtk.Button(label=None)
		button_directory_move_up.add(image_up)
		button_directory_move_up.set_tooltip_text(_('Move Up'))
		button_directory_move_up.connect('clicked', self._move_path, -1)

		image_down = gtk.Image()
		image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

		button_directory_move_down = gtk.Button(label=None)
		button_directory_move_down.add(image_down)
		button_directory_move_down.set_tooltip_text(_('Move Down'))
		button_directory_move_down.connect('clicked', self._move_path, 1)

		self._menu_add_directory = gtk.Menu()

		menu_item_custom = gtk.MenuItem(_('Custom directory'))
		menu_item_separator = gtk.SeparatorMenuItem()
		menu_item_left_directory = gtk.MenuItem(_('Left directory'))
		menu_item_right_directory = gtk.MenuItem(_('Right directory'))

		menu_item_custom.connect('activate', self._add_path, Source.CUSTOM)
		menu_item_left_directory.connect('activate', self._add_path, Source.LEFT)
		menu_item_right_directory.connect('activate', self._add_path, Source.RIGHT)

		self._menu_add_directory.append(menu_item_custom)
		self._menu_add_directory.append(menu_item_separator)
		self._menu_add_directory.append(menu_item_left_directory)
		self._menu_add_directory.append(menu_item_right_directory)

		self._menu_add_directory.show_all()

		# create columns editor
		hbox_columns = gtk.HBox(False, 5)

		container_columns = gtk.ScrolledWindow()
		container_columns.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container_columns.set_shadow_type(gtk.SHADOW_IN)

		container_plugin = gtk.ScrolledWindow()
		container_plugin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
		container_plugin.set_shadow_type(gtk.SHADOW_IN)

		# create variable to store active extension to
		self._extensions = {}
		self._active_extension = None

		# create column list
		self._columns_store = gtk.ListStore(str, int, bool, str)
		self._columns_list = gtk.TreeView()

		self._columns_list.set_model(self._columns_store)
		self._columns_list.set_rules_hint(True)
		self._columns_list.set_enable_search(True)
		self._columns_list.set_search_column(Column.NAME)

		cell_name = gtk.CellRendererText()
		cell_size = gtk.CellRendererText()
		cell_visible = gtk.CellRendererToggle()
		cell_font_size = gtk.CellRendererSpin()

		cell_size.set_property('editable', True)
		cell_size.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_size.connect('edited', self._edited_column_size)

		cell_font_size.set_property('editable', True)
		cell_font_size.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		adjustment = gtk.Adjustment(0, 0, 100, 1, 10, 0)
		cell_font_size.set_property('adjustment', adjustment)
		cell_font_size.connect('edited', self._edited_column_font_size)

		cell_visible.connect('toggled', self._toggle_column_visible)

		col_name = gtk.TreeViewColumn(_('Column'), cell_name, text=Column.NAME)
		col_name.set_min_width(150)
		col_name.set_resizable(True)
		col_name.set_expand(True)

		col_size = gtk.TreeViewColumn(_('Size'), cell_size, text=Column.SIZE)
		col_size.set_min_width(50)

		col_visible = gtk.TreeViewColumn(_('Visible'), cell_visible, active=Column.VISIBLE)
		col_visible.set_min_width(50)

		col_font_size = gtk.TreeViewColumn(_('Font'), cell_font_size, text=Column.FONT_SIZE)
		col_font_size.set_min_width(50)

		self._columns_list.append_column(col_name)
		self._columns_list.append_column(col_size)
		self._columns_list.append_column(col_font_size)
		self._columns_list.append_column(col_visible)

		# create plugin list
		self._extension_store = gtk.ListStore(str, str)
		self._extension_list = gtk.TreeView()

		self._extension_list.set_model(self._extension_store)
		self._extension_list.set_size_request(130, -1)
		self._extension_list.set_headers_visible(False)

		self._extension_list.connect('cursor-changed', self._handle_cursor_change)

		cell_name = gtk.CellRendererText()
		col_name = gtk.TreeViewColumn(None, cell_name, text=ExtensionColumn.NAME)

		self._extension_list.append_column(col_name)

		# pack interface
		container_directory.add(self._directory_list)
		container_columns.add(self._columns_list)
		container_plugin.add(self._extension_list)

		hbox_directory.pack_start(button_add_directory, False, False, 0)
		hbox_directory.pack_start(button_delete_directory, False, False, 0)
		hbox_directory.pack_end(button_directory_move_down, False, False, 0)
		hbox_directory.pack_end(button_directory_move_up, False, False, 0)

		hbox_columns.pack_start(container_plugin, False, False, 0)
		hbox_columns.pack_start(container_columns, True, True, 0)

		hbox_indicator.pack_start(label_indicator, False, False, 0)
		hbox_indicator.pack_start(self._combobox_indicator, False, False, 0)

		hbox_selection_color.pack_start(label_selection_color, False, False, 0)
		hbox_selection_color.pack_start(self._button_selection_color, False, False, 0)

		hbox_quick_search.pack_start(label_quick_search, False, False, 0)
		hbox_quick_search.pack_start(self._checkbox_control, False, False, 0)
		hbox_quick_search.pack_start(self._checkbox_alt, False, False, 0)
		hbox_quick_search.pack_start(self._checkbox_shift, False, False, 0)

		hbox_breadcrumbs.pack_start(label_breadcrumbs, False, False, 0)
		hbox_breadcrumbs.pack_start(self._combobox_breadcrumbs, False, False, 0)

		hbox_mode_format.pack_start(label_mode_format, False, False, 0)
		hbox_mode_format.pack_start(self._combobox_mode_format, False, False, 0)

		hbox_grid_lines.pack_start(label_grid_lines, False, False, 0)
		hbox_grid_lines.pack_start(self._combobox_grid_lines, False, False, 0)

		vbox_time_format.pack_start(label_time_format, False, False, 0)
		vbox_time_format.pack_start(self._entry_time_format, False, False, 0)

		vbox_look_and_feel.pack_start(self._checkbox_row_hinting, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_show_headers, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_media_preview, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_show_hidden, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_show_expanders, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_hide_scrollbar, False, False, 0)
		vbox_look_and_feel.pack_start(hbox_breadcrumbs, False, False, 5)
		vbox_look_and_feel.pack_start(hbox_mode_format, False, False, 5)
		vbox_look_and_feel.pack_start(hbox_grid_lines, False, False, 5)
		vbox_look_and_feel.pack_start(hbox_selection_color, False, False, 5)
		vbox_look_and_feel.pack_start(hbox_indicator, False, False, 5)

		vbox_operation.pack_start(self._checkbox_case_sensitive, False, False, 0)
		vbox_operation.pack_start(self._checkbox_number_sensitive, False, False, 0)
		vbox_operation.pack_start(self._checkbox_single_click, False, False, 0)
		vbox_operation.pack_start(self._checkbox_right_click, False, False, 0)
		vbox_operation.pack_start(self._checkbox_second_extension, False, False, 0)
		vbox_operation.pack_start(hbox_quick_search, False, False, 5)
		vbox_operation.pack_start(vbox_time_format, False, False, 5)

		vbox_directory.pack_start(self._checkbox_load_directories, False, False, 0)
		vbox_directory.pack_start(container_directory, True, True, 0)
		vbox_directory.pack_start(hbox_directory, False, False, 0)

		vbox_columns.pack_start(hbox_columns, True, True, 0)

		notebook.append_page(vbox_look_and_feel, label_look_and_feel)
		notebook.append_page(vbox_operation, label_operation)
		notebook.append_page(vbox_directory, label_directories)
		notebook.append_page(vbox_columns, label_columns)

		self.pack_start(notebook, True, True, 0)
Ejemplo n.º 21
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'item_list', _('Item List'))

		notebook = gtk.Notebook()

		# create frames
		label_look_and_feel = gtk.Label(_('Look & feel'))
		label_operation = gtk.Label(_('Operation'))
		label_columns = gtk.Label(_('Columns'))

		# vertical boxes
		vbox_look_and_feel = gtk.VBox(False, 0)
		vbox_operation = gtk.VBox(False, 0)
		vbox_columns = gtk.VBox(False, 0)

		vbox_look_and_feel.set_border_width(5)
		vbox_operation.set_border_width(5)
		vbox_columns.set_border_width(5)

		# file list options
		self._checkbox_row_hinting = gtk.CheckButton(_('Row hinting'))
		self._checkbox_show_hidden = gtk.CheckButton(_('Show hidden files'))
		self._checkbox_case_sensitive = gtk.CheckButton(_('Case sensitive item sorting'))
		self._checkbox_right_click = gtk.CheckButton(_('Right click selects items'))
		self._checkbox_show_headers = gtk.CheckButton(_('Show list headers'))
		self._checkbox_media_preview = gtk.CheckButton(_('Fast media preview'))

		self._checkbox_row_hinting.connect('toggled', self._parent.enable_save)
		self._checkbox_show_hidden.connect('toggled', self._parent.enable_save)
		self._checkbox_case_sensitive.connect('toggled', self._parent.enable_save)
		self._checkbox_right_click.connect('toggled', self._parent.enable_save)
		self._checkbox_show_headers.connect('toggled', self._parent.enable_save)
		self._checkbox_media_preview.connect('toggled', self._parent.enable_save)

		# file access mode format
		hbox_mode_format = gtk.HBox(False, 5)
		label_mode_format = gtk.Label(_('Access mode format:'))
		label_mode_format.set_alignment(0, 0.5)

		list_mode_format = gtk.ListStore(str, int)
		list_mode_format.append((_('Octal'), AccessModeFormat.OCTAL))
		list_mode_format.append((_('Textual'), AccessModeFormat.TEXTUAL))

		cell_mode_format = gtk.CellRendererText()

		self._combobox_mode_format = gtk.ComboBox(list_mode_format)
		self._combobox_mode_format.connect('changed', self._parent.enable_save)
		self._combobox_mode_format.pack_start(cell_mode_format)
		self._combobox_mode_format.add_attribute(cell_mode_format, 'text', 0)

		# grid lines
		hbox_grid_lines = gtk.HBox(False, 5)
		label_grid_lines = gtk.Label(_('Show grid lines:'))
		label_grid_lines.set_alignment(0, 0.5)

		list_grid_lines = gtk.ListStore(str, int)
		list_grid_lines.append((_('None'), gtk.TREE_VIEW_GRID_LINES_NONE))
		list_grid_lines.append((_('Horizontal'), gtk.TREE_VIEW_GRID_LINES_HORIZONTAL))
		list_grid_lines.append((_('Vertical'), gtk.TREE_VIEW_GRID_LINES_VERTICAL))
		list_grid_lines.append((_('Both'), gtk.TREE_VIEW_GRID_LINES_BOTH))

		cell_grid_lines = gtk.CellRendererText()

		self._combobox_grid_lines = gtk.ComboBox(list_grid_lines)
		self._combobox_grid_lines.connect('changed', self._parent.enable_save)
		self._combobox_grid_lines.pack_start(cell_grid_lines)
		self._combobox_grid_lines.add_attribute(cell_grid_lines, 'text', 0)

		# selection color
		hbox_selection_color = gtk.HBox(False, 5)

		label_selection_color = gtk.Label(_('Selection color:'))
		label_selection_color.set_alignment(0, 0.5)

		self._button_selection_color = gtk.ColorButton()
		self._button_selection_color.set_use_alpha(False)
		self._button_selection_color.connect('color-set', self._parent.enable_save)

		# quick search
		label_quick_search = gtk.Label(_('Quick search combination:'))
		label_quick_search.set_alignment(0, 0.5)
		label_quick_search.set_use_markup(True)
		self._checkbox_control = gtk.CheckButton(_('Control'))
		self._checkbox_alt = gtk.CheckButton(_('Alt'))
		self._checkbox_shift = gtk.CheckButton(_('Shift'))

		self._checkbox_control.connect('toggled', self._parent.enable_save)
		self._checkbox_alt.connect('toggled', self._parent.enable_save)
		self._checkbox_shift.connect('toggled', self._parent.enable_save)

		hbox_quick_search = gtk.HBox(False, 5)

		vbox_time_format = gtk.VBox(False, 0)
		label_time_format = gtk.Label(_('Date format:'))
		label_time_format.set_alignment(0, 0.5)
		self._entry_time_format = gtk.Entry()
		self._entry_time_format.set_tooltip_markup(
								'<b>' + _('Time is formed using the format located at:') + '</b>\n'
								'http://docs.python.org/library/time.html#time.strftime'
							)
		self._entry_time_format.connect('changed', self._parent.enable_save)

		# create columns editor
		hbox_columns = gtk.HBox(False, 5)

		container_columns = gtk.ScrolledWindow()
		container_columns.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container_columns.set_shadow_type(gtk.SHADOW_IN)

		container_plugin = gtk.ScrolledWindow()
		container_plugin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
		container_plugin.set_shadow_type(gtk.SHADOW_IN)

		# create variable to store active extension to
		self._extensions = {}
		self._active_extension = None

		# create column list
		self._columns_store = gtk.ListStore(str, int, bool)
		self._columns_list = gtk.TreeView()

		self._columns_list.set_model(self._columns_store)
		self._columns_list.set_rules_hint(True)
		self._columns_list.set_enable_search(True)
		self._columns_list.set_search_column(Column.NAME)

		cell_name = gtk.CellRendererText()
		cell_size = gtk.CellRendererText()
		cell_visible = gtk.CellRendererToggle()

		cell_size.set_property('editable', True)
		cell_size.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_size.connect('edited', self._edited_column_size)

		cell_visible.connect('toggled', self._toggle_column_visible)

		col_name = gtk.TreeViewColumn(_('Column'), cell_name, text=Column.NAME)
		col_name.set_min_width(150)
		col_name.set_resizable(True)
		col_name.set_expand(True)

		col_size = gtk.TreeViewColumn(_('Size'), cell_size, text=Column.SIZE)
		col_size.set_min_width(50)

		col_visible = gtk.TreeViewColumn(_('Visible'), cell_visible, active=Column.VISIBLE)
		col_visible.set_min_width(50)

		self._columns_list.append_column(col_name)
		self._columns_list.append_column(col_size)
		self._columns_list.append_column(col_visible)

		# create plugin list
		self._extension_store = gtk.ListStore(str, str)
		self._extension_list = gtk.TreeView()

		self._extension_list.set_model(self._extension_store)
		self._extension_list.set_size_request(130, -1)
		self._extension_list.set_headers_visible(False)

		self._extension_list.connect('cursor-changed', self._handle_cursor_change)

		cell_name = gtk.CellRendererText()
		col_name = gtk.TreeViewColumn(None, cell_name, text=ExtensionColumn.NAME)

		self._extension_list.append_column(col_name)

		# pack interface
		container_columns.add(self._columns_list)
		container_plugin.add(self._extension_list)

		hbox_columns.pack_start(container_plugin, False, False, 0)
		hbox_columns.pack_start(container_columns, True, True, 0)

		hbox_selection_color.pack_start(label_selection_color, False, False, 0)
		hbox_selection_color.pack_start(self._button_selection_color, False, False, 0)

		hbox_quick_search.pack_start(label_quick_search, False, False, 0)
		hbox_quick_search.pack_start(self._checkbox_control, False, False, 0)
		hbox_quick_search.pack_start(self._checkbox_alt, False, False, 0)
		hbox_quick_search.pack_start(self._checkbox_shift, False, False, 0)

		hbox_mode_format.pack_start(label_mode_format, False, False, 0)
		hbox_mode_format.pack_start(self._combobox_mode_format, False, False, 0)

		hbox_grid_lines.pack_start(label_grid_lines, False, False, 0)
		hbox_grid_lines.pack_start(self._combobox_grid_lines, False, False, 0)

		vbox_time_format.pack_start(label_time_format, False, False, 0)
		vbox_time_format.pack_start(self._entry_time_format, False, False, 0)

		vbox_look_and_feel.pack_start(self._checkbox_row_hinting, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_show_headers, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_media_preview, False, False, 0)
		vbox_look_and_feel.pack_start(self._checkbox_show_hidden, False, False, 0)
		vbox_look_and_feel.pack_start(hbox_mode_format, False, False, 5)
		vbox_look_and_feel.pack_start(hbox_grid_lines, False, False, 5)
		vbox_look_and_feel.pack_start(hbox_selection_color, False, False, 5)

		vbox_operation.pack_start(self._checkbox_case_sensitive, False, False, 0)
		vbox_operation.pack_start(self._checkbox_right_click, False, False, 0)
		vbox_operation.pack_start(hbox_quick_search, False, False, 5)
		vbox_operation.pack_start(vbox_time_format, False, False, 5)

		vbox_columns.pack_start(hbox_columns, True, True, 0)

		notebook.append_page(vbox_look_and_feel, label_look_and_feel)
		notebook.append_page(vbox_operation, label_operation)
		notebook.append_page(vbox_columns, label_columns)

		self.pack_start(notebook, True, True, 0)
Ejemplo n.º 22
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'sessions',
                              _('Sessions'))

        self._options = application.tab_options
        self._manager = None

        # create list box
        container = gtk.ScrolledWindow()
        container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        container.set_shadow_type(gtk.SHADOW_IN)

        self._store = gtk.ListStore(str, int, int)

        self._list = gtk.TreeView()
        self._list.set_model(self._store)
        self._list.set_rules_hint(True)

        # create cell renderers
        cell_name = gtk.CellRendererText()
        cell_name.set_property('editable', True)
        cell_name.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
        cell_name.connect('edited', self._handle_edited_name, 0)

        cell_count = gtk.CellRendererText()

        # create columns
        col_name = gtk.TreeViewColumn(_('Name'), cell_name, text=Column.NAME)
        col_name.set_min_width(200)
        col_name.set_resizable(True)
        col_name.set_expand(True)

        col_count = gtk.TreeViewColumn(_('Tabs'),
                                       cell_count,
                                       text=Column.TAB_COUNT)

        self._list.append_column(col_name)
        self._list.append_column(col_count)

        # create controls
        button_box = gtk.HBox(False, 5)

        button_add = gtk.Button(stock=gtk.STOCK_ADD)
        button_add.connect('clicked', self._handle_add_session)

        button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
        button_delete.connect('clicked', self._handle_delete_session)

        image_up = gtk.Image()
        image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)
        button_move_up = gtk.Button(label=None)
        button_move_up.add(image_up)
        button_move_up.set_tooltip_text(_('Move up'))
        button_move_up.connect('clicked', self._handle_move_session, -1)

        image_down = gtk.Image()
        image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)
        button_move_down = gtk.Button(label=None)
        button_move_down.add(image_down)
        button_move_down.set_tooltip_text(_('Move down'))
        button_move_down.connect('clicked', self._handle_move_session, 1)

        # pack ui
        container.add(self._list)

        button_box.pack_start(button_add, False, False, 0)
        button_box.pack_start(button_delete, False, False, 0)
        button_box.pack_end(button_move_down, False, False, 0)
        button_box.pack_end(button_move_up, False, False, 0)

        self.pack_start(container, True, True, 0)
        self.pack_start(button_box, False, False, 0)
Ejemplo n.º 23
0
	def __init__(self, parent, application):
		SettingsPage.__init__(self, parent, application, 'commands', _('Commands'))

		# create list box
		container = gtk.ScrolledWindow()
		container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
		container.set_shadow_type(gtk.SHADOW_IN)

		self._commands = gtk.ListStore(str, str)

		self._list = gtk.TreeView()
		self._list.set_model(self._commands)
		self._list.set_rules_hint(True)

		# create and configure cell renderers
		cell_title = gtk.CellRendererText()
		cell_title.set_property('editable', True)
		cell_title.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_title.connect('edited', self._edited_command, 0)

		cell_command = gtk.CellRendererText()
		cell_command.set_property('editable', True)
		cell_command.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
		cell_command.connect('edited', self._edited_command, 1)

		# create and pack columns
		col_title = gtk.TreeViewColumn(_('Title'), cell_title, text=Column.TITLE)
		col_title.set_min_width(200)
		col_title.set_resizable(True)

		col_command = gtk.TreeViewColumn(_('Command'), cell_command, text=Column.COMMAND)
		col_command.set_resizable(True)
		col_command.set_expand(True)

		self._list.append_column(col_title)
		self._list.append_column(col_command)

		container.add(self._list)

		# create controls
		button_box = gtk.HBox(False, 5)

		button_add = gtk.Button(stock=gtk.STOCK_ADD)
		button_add.connect('clicked', self._add_command)

		button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
		button_delete.connect('clicked', self._delete_command)

		image_up = gtk.Image()
		image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

		button_move_up = gtk.Button(label=None)
		button_move_up.add(image_up)
		button_move_up.set_tooltip_text(_('Move Up'))
		button_move_up.connect('clicked', self._move_command, -1)

		image_down = gtk.Image()
		image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

		button_move_down = gtk.Button(label=None)
		button_move_down.add(image_down)
		button_move_down.set_tooltip_text(_('Move Down'))
		button_move_down.connect('clicked', self._move_command, 1)

		# pack ui
		button_box.pack_start(button_add, False, False, 0)
		button_box.pack_start(button_delete, False, False, 0)
		button_box.pack_end(button_move_down, False, False, 0)
		button_box.pack_end(button_move_up, False, False, 0)

		self.pack_start(container, True, True, 0)
		self.pack_start(button_box, False, False, 0)
Ejemplo n.º 24
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'display',
                              _('Display'))

        notebook = gtk.Notebook()

        # main window options
        label_main_window = gtk.Label(_('Main window'))
        vbox_main_window = gtk.VBox(False, 0)
        vbox_main_window.set_border_width(5)

        self._checkbox_hide_on_close = gtk.CheckButton(
            _('Hide main window on close'))
        self._checkbox_multiple_instances = gtk.CheckButton(
            _('Allow multiple instances'))
        self._checkbox_show_toolbar = gtk.CheckButton(_('Show toolbar'))
        self._checkbox_show_command_bar = gtk.CheckButton(
            _('Show command bar'))
        self._checkbox_show_command_entry = gtk.CheckButton(
            _('Show command entry'))
        self._checkbox_horizontal_split = gtk.CheckButton(
            _('Horizontal split'))

        self._checkbox_hide_on_close.connect('toggled',
                                             self._parent.enable_save, True)
        self._checkbox_multiple_instances.connect('toggled',
                                                  self._parent.enable_save,
                                                  True)
        self._checkbox_show_toolbar.connect('toggled',
                                            self._parent.enable_save)
        self._checkbox_show_command_bar.connect('toggled',
                                                self._parent.enable_save)
        self._checkbox_show_command_entry.connect('toggled',
                                                  self._parent.enable_save)
        self._checkbox_horizontal_split.connect('toggled',
                                                self._parent.enable_save)

        # tab options
        label_tabs = gtk.Label(_('Tabs'))
        vbox_tabs = gtk.VBox(False, 0)
        vbox_tabs.set_border_width(5)

        self._checkbox_focus_new_tab = gtk.CheckButton(
            _('Focus new tab after opening'))
        self._checkbox_button_relief = gtk.CheckButton(
            _('Show normal button relief'))
        self._checkbox_button_icons = gtk.CheckButton(
            _('Show icons instead of text in tab buttons'))
        self._checkbox_tab_close_button = gtk.CheckButton(
            _('Show close button'))
        self._checkbox_always_show_tabs = gtk.CheckButton(
            _('Show tab(s) even if there is only one'))
        self._checkbox_ubuntu_coloring = gtk.CheckButton(
            _('Use Ubuntu coloring method for tab title bars'))
        self._checkbox_superuser_notification = gtk.CheckButton(
            _('Change title bar color when started as super user'))

        self._checkbox_focus_new_tab.connect('toggled',
                                             self._parent.enable_save)
        self._checkbox_button_relief.connect('toggled',
                                             self._parent.enable_save)
        self._checkbox_button_icons.connect('toggled',
                                            self._parent.enable_save, True)
        self._checkbox_tab_close_button.connect('toggled',
                                                self._parent.enable_save)
        self._checkbox_always_show_tabs.connect('toggled',
                                                self._parent.enable_save)
        self._checkbox_ubuntu_coloring.connect('toggled',
                                               self._parent.enable_save)
        self._checkbox_superuser_notification.connect('toggled',
                                                      self._parent.enable_save)

        # status bar
        table = gtk.Table(2, 2, False)
        table.set_col_spacing(0, 5)
        table.set_row_spacings(5)

        label_status_bar = gtk.Label(_('Show status bar:'))
        label_status_bar.set_alignment(0, 0.5)

        list_status_bar = gtk.ListStore(str, int)
        list_status_bar.append((_('Always'), StatusVisible.ALWAYS))
        list_status_bar.append((_('When needed'), StatusVisible.WHEN_NEEDED))
        list_status_bar.append((_('Never'), StatusVisible.NEVER))

        cell_status_bar = gtk.CellRendererText()

        self._combobox_status_bar = gtk.ComboBox(list_status_bar)
        self._combobox_status_bar.connect('changed', self._parent.enable_save)
        self._combobox_status_bar.pack_start(cell_status_bar)
        self._combobox_status_bar.add_attribute(cell_status_bar, 'text', 0)

        # expand tabs
        label_expand_tab = gtk.Label(_('Expanded tabs:'))
        label_expand_tab.set_alignment(0, 0.5)

        list_expand_tab = gtk.ListStore(str, int)
        list_expand_tab.append((_('None'), TabExpand.NONE))
        list_expand_tab.append((_('Active'), TabExpand.ACTIVE))
        list_expand_tab.append((_('All'), TabExpand.ALL))

        cell_expand_tab = gtk.CellRendererText()

        self._combobox_expand_tabs = gtk.ComboBox(list_expand_tab)
        self._combobox_expand_tabs.connect('changed', self._parent.enable_save)
        self._combobox_expand_tabs.pack_start(cell_expand_tab)
        self._combobox_expand_tabs.add_attribute(cell_expand_tab, 'text', 0)

        # other options
        label_other = gtk.Label(_('Other'))
        vbox_other = gtk.VBox(False, 0)
        vbox_other.set_border_width(5)

        self._checkbox_hide_window_on_minimize = gtk.CheckButton(
            _('Hide operation window on minimize'))
        self._checkbox_show_notifications = gtk.CheckButton(
            _('Show notifications'))

        self._checkbox_hide_window_on_minimize.connect(
            'toggled', self._parent.enable_save)
        self._checkbox_show_notifications.connect('toggled',
                                                  self._parent.enable_save)

        # size format
        hbox_size_format = gtk.HBox(False, 5)
        label_size_format = gtk.Label(_('Size format:'))
        label_size_format.set_alignment(0, 0.5)

        list_size_format = gtk.ListStore(str, int)
        list_size_format.append((_('Localized'), SizeFormat.LOCAL))
        list_size_format.append(
            (_('SI <small>(1 kB = 1000 B)</small>'), SizeFormat.SI))
        list_size_format.append(
            (_('IEC <small>(1 KiB = 1024 B)</small>'), SizeFormat.IEC))

        cell_size_format = gtk.CellRendererText()

        self._combobox_size_format = gtk.ComboBox(list_size_format)
        self._combobox_size_format.connect('changed', self._parent.enable_save)
        self._combobox_size_format.pack_start(cell_size_format)
        self._combobox_size_format.add_attribute(cell_size_format, 'markup', 0)

        # pack ui
        hbox_size_format.pack_start(label_size_format, False, False, 0)
        hbox_size_format.pack_start(self._combobox_size_format, False, False,
                                    0)

        table.attach(label_status_bar, 0, 1, 0, 1, xoptions=gtk.FILL)
        table.attach(self._combobox_status_bar, 1, 2, 0, 1, xoptions=gtk.FILL)

        table.attach(label_expand_tab, 0, 1, 1, 2, xoptions=gtk.FILL)
        table.attach(self._combobox_expand_tabs, 1, 2, 1, 2, xoptions=gtk.FILL)

        vbox_main_window.pack_start(self._checkbox_hide_on_close, False, False,
                                    0)
        vbox_main_window.pack_start(self._checkbox_multiple_instances, False,
                                    False, 0)
        vbox_main_window.pack_start(self._checkbox_show_toolbar, False, False,
                                    0)
        vbox_main_window.pack_start(self._checkbox_show_command_bar, False,
                                    False, 0)
        vbox_main_window.pack_start(self._checkbox_show_command_entry, False,
                                    False, 0)
        vbox_main_window.pack_start(self._checkbox_horizontal_split, False,
                                    False, 0)

        vbox_tabs.pack_start(self._checkbox_focus_new_tab, False, False, 0)
        vbox_tabs.pack_start(self._checkbox_button_relief, False, False, 0)
        vbox_tabs.pack_start(self._checkbox_button_icons, False, False, 0)
        vbox_tabs.pack_start(self._checkbox_tab_close_button, False, False, 0)
        vbox_tabs.pack_start(self._checkbox_always_show_tabs, False, False, 0)
        vbox_tabs.pack_start(self._checkbox_ubuntu_coloring, False, False, 0)
        vbox_tabs.pack_start(self._checkbox_superuser_notification, False,
                             False, 0)
        vbox_tabs.pack_start(table, False, False, 5)

        vbox_other.pack_start(self._checkbox_hide_window_on_minimize, False,
                              False, 0)
        vbox_other.pack_start(self._checkbox_show_notifications, False, False,
                              0)
        vbox_other.pack_start(hbox_size_format, False, False, 0)

        notebook.append_page(vbox_main_window, label_main_window)
        notebook.append_page(vbox_tabs, label_tabs)
        notebook.append_page(vbox_other, label_other)

        self.pack_start(notebook, True, True, 0)
Ejemplo n.º 25
0
    def __init__(self, parent, application):
        SettingsPage.__init__(self, parent, application, 'bookmarks',
                              _('Bookmarks'))

        # mounts checkbox
        self._checkbox_show_mount_points = gtk.CheckButton(
            _('Show mount points in bookmarks menu'))
        self._checkbox_show_mount_points.connect('toggled',
                                                 self._parent.enable_save)

        # system bookmarks checkbox
        self._checkbox_system_bookmarks = gtk.CheckButton(
            _('Show system bookmarks'))
        self._checkbox_system_bookmarks.connect('toggled',
                                                self._parent.enable_save)

        # bookmarks checkbox
        self._checkbox_add_home = gtk.CheckButton(
            _('Add home directory to bookmarks menu'))
        self._checkbox_add_home.connect('toggled', self._parent.enable_save)

        # create list box
        container = gtk.ScrolledWindow()
        container.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        container.set_shadow_type(gtk.SHADOW_IN)

        self._bookmarks = gtk.ListStore(str, str)

        self._list = gtk.TreeView()
        self._list.set_model(self._bookmarks)
        self._list.set_rules_hint(True)

        cell_title = gtk.CellRendererText()
        cell_title.set_property('editable', True)
        cell_title.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
        cell_title.connect('edited', self._edited_bookmark, 0)

        cell_command = gtk.CellRendererText()
        cell_command.set_property('editable', True)
        cell_command.set_property('mode', gtk.CELL_RENDERER_MODE_EDITABLE)
        cell_command.connect('edited', self._edited_bookmark, 1)

        col_title = gtk.TreeViewColumn(_('Title'),
                                       cell_title,
                                       text=Column.NAME)
        col_title.set_min_width(200)
        col_title.set_resizable(True)

        col_command = gtk.TreeViewColumn(_('Location'),
                                         cell_command,
                                         text=Column.URI)
        col_command.set_resizable(True)
        col_command.set_expand(True)

        self._list.append_column(col_title)
        self._list.append_column(col_command)

        container.add(self._list)

        # create controls
        button_box = gtk.HBox(False, 5)

        button_add = gtk.Button(stock=gtk.STOCK_ADD)
        button_add.connect('clicked', self._add_bookmark)

        button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
        button_delete.connect('clicked', self._delete_bookmark)

        image_up = gtk.Image()
        image_up.set_from_stock(gtk.STOCK_GO_UP, gtk.ICON_SIZE_BUTTON)

        button_move_up = gtk.Button(label=None)
        button_move_up.add(image_up)
        button_move_up.set_tooltip_text(_('Move Up'))
        button_move_up.connect('clicked', self._move_bookmark, -1)

        image_down = gtk.Image()
        image_down.set_from_stock(gtk.STOCK_GO_DOWN, gtk.ICON_SIZE_BUTTON)

        button_move_down = gtk.Button(label=None)
        button_move_down.add(image_down)
        button_move_down.set_tooltip_text(_('Move Down'))
        button_move_down.connect('clicked', self._move_bookmark, 1)

        # pack ui
        button_box.pack_start(button_add, False, False, 0)
        button_box.pack_start(button_delete, False, False, 0)
        button_box.pack_end(button_move_down, False, False, 0)
        button_box.pack_end(button_move_up, False, False, 0)

        # pack checkboxes
        vbox = gtk.VBox(False, 0)

        vbox.pack_start(self._checkbox_show_mount_points, False, False, 0)
        vbox.pack_start(self._checkbox_system_bookmarks, False, False, 0)
        vbox.pack_start(self._checkbox_add_home, False, False, 0)

        self.pack_start(vbox, False, False, 0)
        self.pack_start(container, True, True, 0)
        self.pack_start(button_box, False, False, 0)