# Path: sunflower/widgets/settings_page.py
# class SettingsPage(Gtk.ScrolledWindow):
# 	"""Abstract class used to build pages in preferences window."""
# 
# 	def __init__(self, parent, application, name, title):
# 		Gtk.ScrolledWindow.__init__(self)
# 
# 		self._parent = parent
# 		self._application = application
# 		self._page_name = name
# 		self._page_title = title
# 
# 		# configure main container
# 		self._box = Gtk.VBox.new(False, 0)
# 		self._box.set_spacing(15)
# 		self._box.set_border_width(15)
# 
# 		# add page to preferences window
# 		self.add(self._box)
# 		self._parent.add_tab(self._page_name, self._page_title, self)
# 
# 	def _create_section(self, title, container):
# 		"""Create widget section with title."""
# 		box = Gtk.VBox.new(False, 0)
# 
# 		# create section title
# 		label_title = Gtk.Label.new('<big>{}</big>'.format(title))
# 		label_title.set_alignment(0, 0.5)
# 		label_title.set_use_markup(True)
# 		box.pack_start(label_title, True, False, 0)
# 		box.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), True, False, 0)
# 
# 		# pack container
# 		box.pack_start(container, True, False, 0)
# 		container.set_border_width(10)
# 		self._box.pack_start(box, False, False, 0)
# 
# 	def _create_radio_section(self, title, container, group=None):
# 		"""Create section which contains radio button and return radio button."""
# 		box = Gtk.VBox.new(False, 0)
# 
# 		# create section title
# 		label_title = Gtk.Label.new('<big>{}</big>'.format(title))
# 		label_title.set_alignment(0, 0.5)
# 		label_title.set_use_markup(True)
# 		radio_title = Gtk.RadioButton.new_from_widget(group)
# 		radio_title.add(label_title)
# 		box.pack_start(radio_title, True, False, 0)
# 		box.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), True, False, 0)
# 
# 		# pack container
# 		box.pack_start(container, True, False, 0)
# 		container.set_border_width(10)
# 		self._box.pack_start(box, False, False, 0)
# 
# 		return radio_title
# 
# 	def _load_options(self):
# 		"""Load options and update interface"""
# 		pass
# 
# 	def _save_options(self):
# 		"""Method called when save button is clicked"""
# 		pass
# 
# 	def pack_start(self, *args, **kwargs):
# 		"""Pack things in container."""
# 		self._box.pack_start(*args, **kwargs)
# 
# 	def pack_end(self, *args, **kwargs):
# 		"""Pack things in container."""
# 		self._box.pack_end(*args, **kwargs)
# 
# Path: sunflower/plugin_base/terminal.py
# class TerminalType:
# 	VTE = 0
# 	EXTERNAL = 1
# 
# class CursorShape:
# 	BLOCK = 0
# 	IBEAM = 1
# 	UNDERLINE = 2


from gi.repository import Gtk
from sunflower.widgets.settings_page import SettingsPage
from sunflower.plugin_base.terminal import TerminalType, CursorShape
		self._entry_command.set_text(options.get('command'))
		self._entry_command2.set_text(options.get('command2'))
		self._checkbox_system_font.set_active(options.get('use_system_font'))
		self._combobox_cursor_shape.set_active(options.get('cursor_shape'))
		self._checkbox_allow_bold.set_active(options.get('allow_bold'))
		self._checkbox_autohide_mouse.set_active(options.get('mouse_autohide'))
		self._button_font.set_font_name(options.get('font'))

		# apply terminal type
		terminal_type = options.get('type')
		if terminal_type == TerminalType.VTE:
			self._radio_vte.set_active(True)

		else:
			self._radio_external.set_active(True)

	def _save_options(self):
		"""Save terminal tab options"""
		options = self._application.options.section('terminal')

		options.set('show_scrollbars', self._checkbox_scrollbars_visible.get_active())
		options.set('command', self._entry_command.get_text())
		options.set('command2', self._entry_command2.get_text())
		options.set('use_system_font', self._checkbox_system_font.get_active())
		options.set('cursor_shape', self._combobox_cursor_shape.get_active())
		options.set('allow_bold', self._checkbox_allow_bold.get_active())
		options.set('mouse_autohide', self._checkbox_autohide_mouse.get_active())
		options.set('font', self._button_font.get_font_name())

		# save terminal type

# Path: sunflower/widgets/settings_page.py
# class SettingsPage(Gtk.ScrolledWindow):
# 	"""Abstract class used to build pages in preferences window."""
# 
# 	def __init__(self, parent, application, name, title):
# 		Gtk.ScrolledWindow.__init__(self)
# 
# 		self._parent = parent
# 		self._application = application
# 		self._page_name = name
# 		self._page_title = title
# 
# 		# configure main container
# 		self._box = Gtk.VBox.new(False, 0)
# 		self._box.set_spacing(15)
# 		self._box.set_border_width(15)
# 
# 		# add page to preferences window
# 		self.add(self._box)
# 		self._parent.add_tab(self._page_name, self._page_title, self)
# 
# 	def _create_section(self, title, container):
# 		"""Create widget section with title."""
# 		box = Gtk.VBox.new(False, 0)
# 
# 		# create section title
# 		label_title = Gtk.Label.new('<big>{}</big>'.format(title))
# 		label_title.set_alignment(0, 0.5)
# 		label_title.set_use_markup(True)
# 		box.pack_start(label_title, True, False, 0)
# 		box.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), True, False, 0)
# 
# 		# pack container
# 		box.pack_start(container, True, False, 0)
# 		container.set_border_width(10)
# 		self._box.pack_start(box, False, False, 0)
# 
# 	def _create_radio_section(self, title, container, group=None):
# 		"""Create section which contains radio button and return radio button."""
# 		box = Gtk.VBox.new(False, 0)
# 
# 		# create section title
# 		label_title = Gtk.Label.new('<big>{}</big>'.format(title))
# 		label_title.set_alignment(0, 0.5)
# 		label_title.set_use_markup(True)
# 		radio_title = Gtk.RadioButton.new_from_widget(group)
# 		radio_title.add(label_title)
# 		box.pack_start(radio_title, True, False, 0)
# 		box.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), True, False, 0)
# 
# 		# pack container
# 		box.pack_start(container, True, False, 0)
# 		container.set_border_width(10)
# 		self._box.pack_start(box, False, False, 0)
# 
# 		return radio_title
# 
# 	def _load_options(self):
# 		"""Load options and update interface"""
# 		pass
# 
# 	def _save_options(self):
# 		"""Method called when save button is clicked"""
# 		pass
# 
# 	def pack_start(self, *args, **kwargs):
# 		"""Pack things in container."""
# 		self._box.pack_start(*args, **kwargs)
# 
# 	def pack_end(self, *args, **kwargs):
# 		"""Pack things in container."""
# 		self._box.pack_end(*args, **kwargs)
# 
# Path: sunflower/plugin_base/terminal.py
# class TerminalType:
# 	VTE = 0
# 	EXTERNAL = 1
# 
# class CursorShape:
# 	BLOCK = 0
# 	IBEAM = 1
# 	UNDERLINE = 2


# Path: sunflower/gui/preferences/terminal.py
from gi.repository import Gtk
from sunflower.widgets.settings_page import SettingsPage
from sunflower.plugin_base.terminal import TerminalType, CursorShape

		self._entry_command.set_text(options.get('command'))
		self._entry_command2.set_text(options.get('command2'))
		self._checkbox_system_font.set_active(options.get('use_system_font'))
		self._combobox_cursor_shape.set_active(options.get('cursor_shape'))
		self._checkbox_allow_bold.set_active(options.get('allow_bold'))
		self._checkbox_autohide_mouse.set_active(options.get('mouse_autohide'))
		self._button_font.set_font_name(options.get('font'))

		# apply terminal type
		terminal_type = options.get('type')
		if terminal_type == TerminalType.VTE:
			self._radio_vte.set_active(True)

		else:
			self._radio_external.set_active(True)

	def _save_options(self):
		"""Save terminal tab options"""
		options = self._application.options.section('terminal')

		options.set('show_scrollbars', self._checkbox_scrollbars_visible.get_active())
		options.set('command', self._entry_command.get_text())
		options.set('command2', self._entry_command2.get_text())
		options.set('use_system_font', self._checkbox_system_font.get_active())
		options.set('cursor_shape', self._combobox_cursor_shape.get_active())
		options.set('allow_bold', self._checkbox_allow_bold.get_active())
		options.set('mouse_autohide', self._checkbox_autohide_mouse.get_active())
		options.set('font', self._button_font.get_font_name())

		# save terminal type

		terminal_type = TerminalType.VTE if self._radio_vte.get_active() else TerminalType.EXTERNAL