Sha256: e7138759b79ae450e1f12b8456fe2b9db6243f478d2c5473ba885c2040baea41

Contents?: true

Size: 1.75 KB

Versions: 1

Compression:

Stored size: 1.75 KB

Contents

# encoding: utf-8
require 'jldrill/views/gtk/widgets/VocabularyWindow'
require 'jldrill/contexts/ModifyVocabularyContext'
require 'gtk2'

module JLDrill::Gtk

	class VocabularyView < JLDrill::ModifyVocabularyContext::VocabularyView
	
        attr_reader :vocabularyWindow
        	
		def initialize(context, name)
			super(context, name)
			@vocabularyWindow = VocabularyWindow.new(self, name)
            @vocabularyWindow.setFocus
		end
		
		def getWidget
			@vocabularyWindow
		end

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

        def emitAddButtonClickedEvent
            @vocabularyWindow.addButton.clicked
        end
        
        def update(vocabulary)
            @vocabularyWindow.update(vocabulary)
            super(vocabulary)
        end

        def updateSearch
            @vocabularyWindow.updateSearchTable
        end
       
        def getVocabulary
            @vocabulary = @vocabularyWindow.getVocab
        end

        # Returns true if the vocabulary has been added
        def clearVocabulary
            super
            @vocabularyWindow.update(@vocabulary)
            @vocabularyWindow.updateSearchTable
            @vocabularyWindow.setFocus
        end

        def close
            @context.exit
        end

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

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

        def dictionaryLoaded?
            @context.dictionaryLoaded?
        end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.6.0.1 lib/jldrill/views/gtk/VocabularyView.rb