Class: Ruber::MainWindowSettingsWidget

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

Overview

Class containing the settings associated with the main window

Constant Summary

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

- (MainWindowSettingsWidget) initialize(parent = nil)

A new instance of MainWindowSettingsWidget

Parameters:

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

    the parent widget



748
749
750
751
752
753
754
# File 'lib/ruber/main_window/main_window_actions.rb', line 748

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

- (Qt::Size) sizeHint

Override of Qt::Widget#sizeHint

Returns:

  • (Qt::Size)

    the suggested size for the widget



761
762
763
# File 'lib/ruber/main_window/main_window_actions.rb', line 761

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

- (Integer) tool_open_files

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



782
783
784
# File 'lib/ruber/main_window/main_window_actions.rb', line 782

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

- (Symbol) tool_open_files=(value)

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:



771
772
773
774
# File 'lib/ruber/main_window/main_window_actions.rb', line 771

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