Class: ATT::SavePopup

Inherits:
FilePopup show all
Defined in:
lib/popup/save_popup.rb

Overview

for save as dialog

Constant Summary

Constants inherited from FilePopup

FilePopup::CONFIRM_TEXT

Constants inherited from Popup

Popup::VERSION

Instance Attribute Summary

Attributes inherited from Popup

#window

Instance Method Summary collapse

Methods inherited from FilePopup

#click_confirm, #confirm_button, #set_text, #text_field

Methods inherited from Popup

#assert_exist?, #close, collect_windows, find, find_all, find_when, #initialize, record

Constructor Details

This class inherits a constructor from ATT::Popup

Instance Method Details

#set(file_path = '') ⇒ Object Also known as: click, saveas

Save dialog as a file if file_path is nil,it will take the default name given by dialog.elsif file_path is relative path, it will be expand to abosulte path join with ATT::Config.root @param: file_path



8
9
10
11
12
13
14
15
16
# File 'lib/popup/save_popup.rb', line 8

def set(file_path='')
  if file_path.to_s.strip.length == 0 # It's nil, empty, or just whitespace
    file_name = text_field.value
    file_path = File.join(Config.root, file_name)
  end
  check_file_not_exist?(file_path)
  set_text(file_path)
  click_confirm
end