From ef3e8398fe5ca099a0a6e452e96c96426c09de05 Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Fri, 22 Aug 2014 18:48:43 +0200 Subject: [PATCH 1/5] Update dutch translation strings --- onionshare/strings.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/onionshare/strings.json b/onionshare/strings.json index 57904dcb..5da018ec 100644 --- a/onionshare/strings.json +++ b/onionshare/strings.json @@ -106,7 +106,15 @@ "close_on_finish": "Sluit automatisch", "close_countdown": "Sluit in {0} seconden...", "choose_file": "Kies betsand om te delen", - "copy_url": "Kopieer URL" + "copy_url": "Kopieer URL", + "closing_automatically": "Sluit nu automatisch omdat download gereed is", + "error_tails_invalid_port": "Ongeldige waarde, poort moet een integer zijn", + "error_tails_unknown_root": "Onbekende fout met het Tails root proces", + "help_tails_port": "Alleen Tails: poort voor het openen van firewall, starten verborgen service", + "help_local_only": "Maak geen gebruik van Tor, alleen voor ontwikkeling", + "help_stay_open": "Laat verborgen service draaien nadat download gereed is", + "help_debug": "Log fouten naar harde schrijf", + "help_filename": "Bestand om te delen" }, "pt": { "calculating_sha1": "Calculando checksum SHA1.", "connecting_ctrlport": "Conectando-se à porta de controle Tor para configurar serviço escondido na porta {0}.", From 1366d45e65a44b62c0df2db1683fb4ae01508acb Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Fri, 22 Aug 2014 23:07:39 +0200 Subject: [PATCH 2/5] Fix close automatically --- onionshare/onionshare.py | 3 +++ onionshare_gui/onionshare_gui.py | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 71e198a9..9d9c2f31 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -52,6 +52,9 @@ def set_stay_open(new_stay_open): global stay_open stay_open = new_stay_open +def get_stay_open(): + stay_open = new_stay_open + app = Flask(__name__) def debug_mode(): diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index a37865d9..8a743a00 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -127,7 +127,7 @@ class OnionShareGui(QtGui.QWidget): # close automatically checkbox self.closeAutomatically = QtGui.QCheckBox(self.widget) self.closeAutomatically.setCheckState(QtCore.Qt.Checked) - if onionshare.stay_open: + if onionshare.get_stay_open(): self.closeAutomatically.setCheckState(QtCore.Qt.Unchecked) self.closeAutomatically.setStyleSheet("font-size: 12px") @@ -218,7 +218,7 @@ class OnionShareGui(QtGui.QWidget): if event["data"]["bytes"] == onionshare.filesize: self.update_log(event, translated("download_finished")) # close on finish? - if not onionshare.stay_open: + if not onionshare.get_stay_open(): time.sleep(1) def close_countdown(i): if i > 0: @@ -275,7 +275,8 @@ class OnionShareGui(QtGui.QWidget): def stay_open_changed(self, state): if state > 0: onionshare.set_stay_open(False) - onionshare.set_stay_open(True) + else: + onionshare.set_stay_open(True) return def alert(msg, icon=QtGui.QMessageBox.NoIcon): @@ -326,11 +327,11 @@ def main(): stay_open = bool(args.stay_open) debug = bool(args.debug) + onionshare.set_stay_open(stay_open) + if debug: onionshare.debug_mode() - onionshare.set_stay_open(stay_open) - # create the onionshare icon global window_icon, onionshare_gui_dir window_icon = QtGui.QIcon("{0}/static/logo.png".format(onionshare_gui_dir)) From 9194b79b8a51be3315ab48c1d7f090f47d856cab Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Fri, 22 Aug 2014 23:12:12 +0200 Subject: [PATCH 3/5] Fix close automatically --- onionshare/onionshare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 9d9c2f31..e427f04a 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -53,7 +53,7 @@ def set_stay_open(new_stay_open): stay_open = new_stay_open def get_stay_open(): - stay_open = new_stay_open + return stay_open app = Flask(__name__) From fe92ca4311500adc927e23f2c4576aba98c95283 Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Sat, 23 Aug 2014 00:01:44 +0200 Subject: [PATCH 4/5] Fix displaying of local host --- onionshare_gui/onionshare_gui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index a37865d9..2dfb001a 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -362,6 +362,8 @@ def main(): except onionshare.NoTor as e: alert(e.args[0], QtGui.QMessageBox.Warning) return + else: + onion_host = local_host # select file to share filename, basename = select_file(onionshare.strings, filename) From 829f15ab34c18680dd36d296c931964f945884a4 Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Sat, 23 Aug 2014 00:10:51 +0200 Subject: [PATCH 5/5] Remove unused imports --- onionshare/onionshare.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 71e198a9..ec96f1a0 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -1,13 +1,11 @@ # -*- coding: utf-8 -*- import os, sys, subprocess, time, hashlib, platform, json, locale, socket, argparse, Queue, inspect, base64, mimetypes, hmac -from random import randint -from functools import wraps from itertools import izip from stem.control import Controller from stem import SocketError -from flask import Flask, Markup, Response, request, make_response, send_from_directory, render_template_string, abort +from flask import Flask, Response, request, render_template_string, abort class NoTor(Exception): pass