Class: Alexandria::UI::NewSmartLibraryDialog
- Inherits:
-
SmartLibraryPropertiesDialogBase
- Object
- Gtk::Dialog
- SmartLibraryPropertiesDialogBase
- Alexandria::UI::NewSmartLibraryDialog
- Includes:
- GetText
- Defined in:
- lib/alexandria/ui/dialogs/new_smart_library_dialog.rb
Instance Attribute Summary
Attributes inherited from SmartLibraryPropertiesDialogBase
Instance Method Summary collapse
-
#initialize(parent) ⇒ NewSmartLibraryDialog
constructor
A new instance of NewSmartLibraryDialog.
Methods included from Logging
Constructor Details
#initialize(parent) ⇒ NewSmartLibraryDialog
Returns a new instance of NewSmartLibraryDialog.
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 57 58 59 60 61 62 |
# File 'lib/alexandria/ui/dialogs/new_smart_library_dialog.rb', line 27 def initialize(parent) super(parent) ([Gtk::Stock::CANCEL, :cancel], [Gtk::Stock::NEW, :ok]) self.title = _('New Smart Library') # FIXME: Should accept just :cancel self.default_response = Gtk::ResponseType::CANCEL show_all insert_new_rule while ((response = run) != :cancel) && (response != :delete_event) if response == :help Alexandria::UI.display_help(self, 'new-smart-library') elsif response == :ok if user_confirms_possible_weirdnesses_before_saving? rules = smart_library_rules basename = smart_library_base_name(rules) || _('Smart Library') name = Library.generate_new_name( Libraries.instance.all_libraries, basename) library = SmartLibrary.new(name, rules, predicate_operator_rule) yield(library) break end end end destroy end |