Sha256: ffb7e0d41ed7fdef42f67a67033bc9f1ddd1773eecf4daab678cf3b3b1b781f9

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require 'jldrill/model/Config'
require 'jldrill/views/gtk/widgets/SelectorWindow'
require 'jldrill/contexts/GetFilenameContext'
require 'gtk2'

module JLDrill::Gtk

	class FilenameSelectorView < JLDrill::GetFilenameContext::FilenameSelectorView
        attr_reader :selectorWindow
        	
		def initialize(context)
			super(context)
			@selectorWindow = nil
		end
		
		def getWidget
			@selectorWindow
		end

        def destroy
            @selectorWindow.destroy
            @selectorWindow = nil
        end

        def createSelectorWindow(type)
            if @selectorWindow.nil?
                # The tests create the selector window in advance.
                # So if the window is non-nil, don't create it.
                # Once the window has run once, it should be reset to nil.
                @selectorWindow = SelectorWindow.new(type)
            end
         end

        def run(type)
            createSelectorWindow(type)
            @selectorWindow.current_folder = @directory unless @directory.nil?
            retVal = @selectorWindow.execute
            @filename = @selectorWindow.chosenFilename
            @directory = @selectorWindow.chosenDirectory
            retVal
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.5.1.7 lib/jldrill/views/gtk/FilenameSelectorView.rb