mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
made --stay-open work in GUI (#58)
This commit is contained in:
parent
c74e259fb4
commit
8fce3adeb5
@ -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()
|
||||
|
@ -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',
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user