Class: Ruber::SaveModifiedFilesDlg
- Defined in:
- lib/ruber/main_window/save_modified_files_dlg.rb
Instance Attribute Summary collapse
-
#save ⇒ Object
readonly
Returns the value of attribute save.
Instance Method Summary collapse
-
#initialize(docs, parent = nil) ⇒ SaveModifiedFilesDlg
constructor
A new instance of SaveModifiedFilesDlg.
- #to_save ⇒ Object
Constructor Details
#initialize(docs, parent = nil) ⇒ SaveModifiedFilesDlg
Returns a new instance of SaveModifiedFilesDlg.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ruber/main_window/save_modified_files_dlg.rb', line 26 def initialize docs, parent = nil super parent @save = true @docs = docs self. = "Save documents" self.modal = true self. = KDE::VBox.new self Qt::Label.new KDE.i18n("The following documents have been modified. Do you want to save them before closing?"), @document_list = Qt::TreeView.new m = Qt::StandardItemModel.new @document_list def m.flags idx Qt::ItemIsSelectable|Qt::ItemIsEnabled|Qt::ItemIsUserCheckable end @document_list.model = m @document_list.root_is_decorated = false fill_list end |
Instance Attribute Details
#save ⇒ Object (readonly)
Returns the value of attribute save.
25 26 27 |
# File 'lib/ruber/main_window/save_modified_files_dlg.rb', line 25 def save @save end |
Instance Method Details
#to_save ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/ruber/main_window/save_modified_files_dlg.rb', line 45 def to_save res = [] m = @document_list.model @docs.each_with_index do |d, i| res << d if m.item(i, 0).checked? end res end |