Class: JLDrill::Gtk::VocabularyView

Inherits:
ModifyVocabularyContext::VocabularyView show all
Defined in:
lib/jldrill/views/gtk/VocabularyView.rb

Instance Attribute Summary collapse

Attributes inherited from ModifyVocabularyContext::VocabularyView

#actionName, #vocabulary

Attributes inherited from Context::View

#context

Instance Method Summary collapse

Methods inherited from ModifyVocabularyContext::VocabularyView

#action

Methods inherited from Context::View

#addView, #removeView, #removingViewFrom, #viewAddedTo

Constructor Details

#initialize(context, name) ⇒ VocabularyView

Returns a new instance of VocabularyView.



12
13
14
15
16
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 12

def initialize(context, name)
	super(context, name)
	@vocabularyWindow = VocabularyWindow.new(self, name)
          @vocabularyWindow.setFocus
end

Instance Attribute Details

#vocabularyWindowObject (readonly)

Returns the value of attribute vocabularyWindow.



10
11
12
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 10

def vocabularyWindow
  @vocabularyWindow
end

Instance Method Details

#clearVocabularyObject

Returns true if the vocabulary has been added



48
49
50
51
52
53
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 48

def clearVocabulary
    super
    @vocabularyWindow.update(@vocabulary)
    @vocabularyWindow.updateSearchTable
    @vocabularyWindow.setFocus
end

#closeObject



55
56
57
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 55

def close
    @context.exit
end

#destroyObject



22
23
24
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 22

def destroy
    @vocabularyWindow.explicitDestroy
end

#dictionaryLoaded?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 67

def dictionaryLoaded?
    @context.dictionaryLoaded?
end

#emitAddButtonClickedEventObject



30
31
32
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 30

def emitAddButtonClickedEvent
    @vocabularyWindow.addButton.clicked
end

#emitDestroyEventObject



26
27
28
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 26

def emitDestroyEvent
	@vocabularyWindow.signal_emit("destroy")
end

#getVocabularyObject



43
44
45
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 43

def getVocabulary
    @vocabulary = @vocabularyWindow.getVocab
end

#getWidgetObject



18
19
20
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 18

def getWidget
	@vocabularyWindow
end

#loadDictionaryObject



71
72
73
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 71

def loadDictionary
    @context.loadDictionary
end

#preview(item) ⇒ Object



63
64
65
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 63

def preview(item)
    @context.preview(item)
end

#search(kanji, reading) ⇒ Object



59
60
61
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 59

def search(kanji, reading)
    @context.search(kanji, reading)
end

#showBusy(bool) ⇒ Object



75
76
77
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 75

def showBusy(bool)
    @vocabularyWindow.showBusy(bool)
end

#update(vocabulary) ⇒ Object



34
35
36
37
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 34

def update(vocabulary)
    @vocabularyWindow.update(vocabulary)
    super(vocabulary)
end

#updateSearchObject



39
40
41
# File 'lib/jldrill/views/gtk/VocabularyView.rb', line 39

def updateSearch
    @vocabularyWindow.updateSearchTable
end