Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Feb 2, 2013
2 parents 5f74cab + 1f97d6b commit 5e0c0a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/copy_from_server.rb
Expand Up @@ -13,7 +13,7 @@ def shutdown!
def wait_for_transfer_file_come_up
assert @current_transfer_file == nil
while (files = current_transfer_ready_files).length == 0
sleep! :client, 'wait_for_transfer_file_come_up'
sleep! :client, 'wait_for_next_transfer_ready_file_to_appear'
if @shutdown
raise 'shutting down' # should be safe here...
end
Expand Down
15 changes: 10 additions & 5 deletions lib/gui_setup.rb
Expand Up @@ -39,7 +39,7 @@ def re_configure
end
storage[:root_drive] = dir
storage[:client_count] = get_input("how many total end storage places will there be?", 2).to_i
storage[:shared_drive_space_to_use] = get_input("How much shared drive to use for transfers (in GB)", storage[:shared_drive_space_to_use] || 2.5).to_f
storage[:shared_drive_space_to_use] = get_input("How much shared drive to use for outgoing transfers (in GB)", storage[:shared_drive_space_to_use] || 2.5).to_f
transfer_dir = File.expand_path('~/synchronizer_drop_files_here_they_will_be_copied_out_then_deleted')
FileUtils.mkdir_p(transfer_dir)
storage[:drop_into_folder] = new_existing_dir_chooser_and_go("Pick directory where you can drop files in to have them transferred", storage[:drop_into_folder] || transfer_dir)
Expand All @@ -62,7 +62,7 @@ def setup_ui

a.elements[:re_configure].on_clicked {
re_configure
show_message "ok, shutting down app now, then restart it..."
show_message "ok, shutting down app now, restart it for new changes to take effect..."
shutdown
}

Expand All @@ -88,15 +88,20 @@ def reveal_drop_into_folder
}

def shutdown
puts 'shutting down...'
a.elements[:status].text = "shutting down..."
unless @subject.shutdown
@subject.shutdown!
@subject.shutdown!
Thread.new {
@t1.join
p 'join1'
@t1.join
p 'join2'
@t2.join
p 'closing...'
a.close!
}
end
end

end

setup_ui # init...
Expand Down

0 comments on commit 5e0c0a7

Please sign in to comment.