made --stay-open work in GUI (#58)

This commit is contained in:
Micah Lee 2014-06-26 14:31:29 -04:00
parent c74e259fb4
commit 8fce3adeb5
3 changed files with 9 additions and 2 deletions

View File

@ -130,6 +130,7 @@ def main():
webapp.onion_host = local_host
webapp.qtapp = app
webapp.clipboard = app.clipboard()
webapp.stay_open = bool(stay_open)
# run the web app in a new thread
webapp_port = onionshare.choose_port()

View File

@ -87,6 +87,10 @@ $(function(){
$('#close-on-finish-wrapper label').html(onionshare.strings['close_on_finish']);
$('#loading .calculating').html(onionshare.strings['calculating_sha1']);
if(onionshare.stay_open) {
$('#close-on-finish').removeAttr('checked');
}
// after getting the initial info, start the onionshare server
$.ajax({
url: '/start_onionshare',

View File

@ -7,6 +7,7 @@ filename = None
onion_host = None
qtapp = None
clipboard = None
stay_open = None
url = None
@ -35,12 +36,13 @@ def index():
@app.route("/init_info")
def init_info():
global onionshare, filename
global onionshare, filename, stay_open
basename = os.path.basename(filename)
return json.dumps({
'strings': onionshare.strings,
'basename': basename
'basename': basename,
'stay_open': stay_open
})
@app.route("/start_onionshare")