Class: Alexandria::UI::NewBookDialogManual
- Inherits:
-
BookPropertiesDialogBase
- Object
- BuilderBase
- BookPropertiesDialogBase
- Alexandria::UI::NewBookDialogManual
- Extended by:
- GetText
- Includes:
- GetText
- Defined in:
- lib/alexandria/ui/new_book_dialog_manual.rb
Defined Under Namespace
Classes: AddError
Constant Summary collapse
- TMP_COVER_FILE =
File.join(Dir.tmpdir, "tmp_cover")
Constants inherited from BookPropertiesDialogBase
BookPropertiesDialogBase::COVER_ABSOLUTE_MAXHEIGHT, BookPropertiesDialogBase::COVER_MAXWIDTH
Instance Method Summary collapse
-
#initialize(parent, library, &on_add_cb) ⇒ NewBookDialogManual
constructor
A new instance of NewBookDialogManual.
- #on_title_changed ⇒ Object
Methods inherited from BookPropertiesDialogBase
#on_add_author, #on_change_cover, #on_destroy, #on_image_no_rating_press, #on_image_rating1_press, #on_image_rating2_press, #on_image_rating3_press, #on_image_rating4_press, #on_image_rating5_press, #on_loaned, #on_loaned_date_changed, #on_remove_author, #own_toggled, #redd_toggled, #setup_date_widgets, #show, #want_toggled, #widget_names
Methods included from Logging
Methods included from CalendarPopup
#assign_selected_date, #clear_date_entry, #display_calendar_popup, #setup_calendar_widgets
Constructor Details
#initialize(parent, library, &on_add_cb) ⇒ NewBookDialogManual
Returns a new instance of NewBookDialogManual.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/alexandria/ui/new_book_dialog_manual.rb', line 18 def initialize(parent, library, &on_add_cb) super(parent, TMP_COVER_FILE) @library = library @on_add_cb = on_add_cb FileUtils.rm_f(TMP_COVER_FILE) = Gtk::Button.new(stock_id: Gtk::Stock::CANCEL) .signal_connect("clicked") { on_cancel } .show @button_box << = Gtk::Button.new(stock_id: Gtk::Stock::ADD) .signal_connect("clicked") { on_add } .show @button_box << = Gtk::Button.new(stock_id: Gtk::Stock::HELP) .signal_connect("clicked") { on_help } .show @button_box << @button_box.set_child_secondary(, true) self. = Book::DEFAULT_RATING self.cover = Icons::BOOK_ICON on_title_changed end |
Instance Method Details
#on_title_changed ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/alexandria/ui/new_book_dialog_manual.rb', line 47 def on_title_changed title = @entry_title.text.strip @book_properties_dialog.title = if title.empty? _("Adding a Book") else _("Adding '%s'") % title end end |