Class: TopinambourPreferences

Inherits:
Gtk::Window
  • Object
show all
Defined in:
lib/preferences.rb

Overview

Copyright 2016-2018 Cedric LE MOIGNE, [email protected] This file is part of Topinambour.

Topinambour is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

Topinambour is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Topinambour. If not, see <www.gnu.org/licenses/>.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ TopinambourPreferences

Returns a new instance of TopinambourPreferences.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/preferences.rb', line 95

def initialize(parent)
  super(:type => :toplevel)
  set_transient_for(parent)
  @parent = parent

  configure_headerbar

  signal_connect "delete-event" do |widget|
    widget.destroy
    @parent.terminal.grab_focus
  end

  @settings = @parent.application.settings

  initialize_widgets
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



94
95
96
# File 'lib/preferences.rb', line 94

def settings
  @settings
end

Class Method Details

.initObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/preferences.rb', line 20

def init
  resource_file = "/com/github/cedlemo/topinambour/prefs-dialog.ui"
  set_template(:resource => resource_file)

  %w(width_spin height_spin shell_entry audible_bell_switch
     allow_bold_switch scroll_on_output_switch scroll_on_keystroke_switch
     rewrap_on_resize_switch mouse_autohide_switch cursor_shape_sel
     cursor_blink_mode_sel backspace_binding_sel delete_binding_sel
     css_chooser_button use_custom_css_switch).each do |widget|
    bind_template_child(widget)
  end

  set_connect_func { |name| method(name) }
end