Class: Alexandria::UI::SmartLibraryPropertiesDialog
- Inherits:
-
SmartLibraryPropertiesDialogBase
- Object
- Gtk::Dialog
- SmartLibraryPropertiesDialogBase
- Alexandria::UI::SmartLibraryPropertiesDialog
- Includes:
- GetText
- Defined in:
- lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb
Instance Attribute Summary
Attributes inherited from SmartLibraryPropertiesDialogBase
Instance Method Summary collapse
-
#initialize(parent, smart_library) ⇒ SmartLibraryPropertiesDialog
constructor
A new instance of SmartLibraryPropertiesDialog.
Methods included from Logging
Constructor Details
#initialize(parent, smart_library) ⇒ SmartLibraryPropertiesDialog
Returns a new instance of SmartLibraryPropertiesDialog.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb', line 26 def initialize(parent, smart_library) super(parent) ([Gtk::Stock::CANCEL, :cancel], [Gtk::Stock::SAVE, :ok]) self.title = _("Properties for '%s'") % smart_library.name # FIXME: Should accept just :cancel self.default_response = Gtk::ResponseType::CANCEL show_all smart_library.rules.each { |x| insert_new_rule(x) } update_rules_header_box(smart_library.predicate_operator_rule) while (response = run) != :cancel if response == :help Alexandria::UI.display_help(self, 'edit-smart-library') elsif response == :ok if user_confirms_possible_weirdnesses_before_saving? smart_library.rules = smart_library_rules smart_library.predicate_operator_rule = predicate_operator_rule smart_library.save yield(smart_library) break end end end destroy end |