Class: Todoable::UI::LoginForm

Inherits:
Gtk::Box
  • Object
show all
Defined in:
lib/todoable/ui/gtk/loginform.rb

Instance Method Summary collapse

Constructor Details

#initializeLoginForm

Returns a new instance of LoginForm



36
37
38
39
40
41
42
43
44
45
# File 'lib/todoable/ui/gtk/loginform.rb', line 36

def initialize
  # When type_register() is used, super is equivalent to
  # GLib::Object#initialize. Thus it needs a hash instead of passing
  # the actual parameters
  super "orientation" => :vertical, "spacing" => 10

  # Create UI Elements
  @errorbar = @errorlabel = @username = @password = @spinner = nil
  add_ui_elements
end

Instance Method Details

#report_error(message) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/todoable/ui/gtk/loginform.rb', line 47

def report_error message
  set_sensitive true
  @spinner.stop
  @errorlabel.text = message
  @errorbar.set_no_show_all false
  @errorbar.show_all
  @errorbar.visible = true
end

#successObject



56
57
58
59
60
61
62
# File 'lib/todoable/ui/gtk/loginform.rb', line 56

def success
  set_sensitive true
  @spinner.stop
  @username.text = ''
  @password.text = ''
  @errorbar.hide
end