Class: Ruber::ProjectFilesWidget

Inherits:
ProjectConfigWidget show all
Defined in:
lib/ruber/world/project_files_widget.rb

Overview

Widget where the user can choose the rules for files to include and exclude from a project.

This widget contains two ProjectFilesRuleChooser widgets, one for the files to include in the project and another for the files to exclude, and one lineedit where the user chooses the extensions of the files to add by default to the project.

Instance Attribute Summary

Attributes inherited from ProjectConfigWidget

#project

Instance Method Summary collapse

Constructor Details

#initialize(prj) ⇒ ProjectFilesWidget

Returns a new instance of ProjectFilesWidget.

Parameters:



260
261
262
263
264
265
266
267
268
# File 'lib/ruber/world/project_files_widget.rb', line 260

def initialize prj
  super
  @ui = Ui::ProjectFilesWidget.new
  @ui.setupUi self
  @ui.include_rules.project = prj
  @ui.exclude_rules.project = prj
  connect @ui.include_rules, SIGNAL('rules_edited()'), self, SIGNAL('settings_changed()')
  connect @ui.extensions, SIGNAL('textChanged(QString)'), self, SIGNAL('settings_changed()')
end

Instance Method Details

#read_settingsnil

Reads the settings from the project

Returns:

  • (nil)


275
276
277
278
279
280
281
282
# File 'lib/ruber/world/project_files_widget.rb', line 275

def read_settings
  rules = project[:general, :project_files]
  @ui.include_rules.rules = rules[:include]
  @ui.exclude_rules.rules = rules[:exclude]
  exts = rules[:extensions]
  @ui.extensions.text = exts.join ' '
  nil
end

#store_settingsnil

Writes the settings to the project

Returns:

  • (nil)


289
290
291
292
293
294
295
296
297
# File 'lib/ruber/world/project_files_widget.rb', line 289

def store_settings
  res = {
    :include => @ui.include_rules.rules,
    :exclude => @ui.exclude_rules.rules,
    :extensions => @ui.extensions.text.split(/[\s,;]/)
  }
  project[:general, :project_files] = res
  nil
end