Class: Ruber::MainWindowSettingsWidget

Inherits:
Qt::Widget
  • Object
show all
Defined in:
lib/ruber/main_window/main_window_actions.rb

Overview

Class containing the settings associated with the main window

Constant Summary collapse

TOOL_OPEN_FILES =

Mapping between modes to open files from tool widgets and indexes in the corresponding combo box

[:split_horizontally, :split_vertically, :new_tab]

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ MainWindowSettingsWidget

Returns a new instance of MainWindowSettingsWidget.

Parameters:

  • parent (Qt::Widget, nil) (defaults to: nil)

    the parent widget



751
752
753
754
755
756
757
# File 'lib/ruber/main_window/main_window_actions.rb', line 751

def initialize parent = nil
  super
  @ui = Ui::MainWindowSettingsWidget.new
  @ui.setupUi self
  @ui._general__default_script_directory.mode = KDE::File::Directory
  @ui._general__default_project_directory.mode = KDE::File::Directory
end

Instance Method Details

#sizeHintQt::Size

Override of @Qt::Widget#sizeHint@

Returns:

  • (Qt::Size)

    the suggested size for the widget



764
765
766
# File 'lib/ruber/main_window/main_window_actions.rb', line 764

def sizeHint
  Qt::Size.new(380,150)
end

#tool_open_filesInteger

Store method for the @general/tool_open_files@ setting

the combo box

Returns:

  • (Integer)

    the entry in TOOL_OPEN_FILES corresponding to the one selected in



785
786
787
# File 'lib/ruber/main_window/main_window_actions.rb', line 785

def tool_open_files
  TOOL_OPEN_FILES[@ui._general__tool_open_files.current_index]
end

#tool_open_files=(value) ⇒ Symbol

Read method for the @general/tool_open_files@ setting

Parameters:

  • value (Symbol)

    the value of the option. It can have any value contained in the TOOL_OPEN_FILES array

Returns:



774
775
776
777
# File 'lib/ruber/main_window/main_window_actions.rb', line 774

def tool_open_files= value
  @ui._general__tool_open_files.current_index = TOOL_OPEN_FILES.index(value) || 0
  value
end