Class: Ruber::ProjectFilesWidget
- Inherits:
-
ProjectConfigWidget
- Object
- Qt::Widget
- ProjectConfigWidget
- Ruber::ProjectFilesWidget
- Defined in:
- lib/ruber/application/project_files_widget.rb,
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
Instance Method Summary (collapse)
-
- (ProjectFilesWidget) initialize(prj)
constructor
A new instance of ProjectFilesWidget.
-
- (nil) read_settings
slot
Reads the settings from the project.
-
- (nil) store_settings
slot
Writes the settings to the project.
Signal Summary
-
- settings_changed
Signal emitted whenever the contents of the widgets change so that the Apply button in the dialg can be enabled accordingly.
Constructor Details
- (ProjectFilesWidget) initialize(prj)
A new instance of ProjectFilesWidget
260 261 262 263 264 265 266 267 268 |
# File 'lib/ruber/application/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
- (nil) read_settings
Reads the settings from the project
275 276 277 278 279 280 281 282 |
# File 'lib/ruber/application/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 |
Slot Signature:
read_settings(QObject*)
- (nil) store_settings
Writes the settings to the project
289 290 291 292 293 294 295 296 297 |
# File 'lib/ruber/application/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 |
Slot Signature:
store_settings(QObject*)
Signal Details
- settings_changed
Signal emitted whenever the contents of the widgets change so that the Apply button in the dialg can be enabled accordingly