summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-01-21 17:28:24 -0800
committerMicah Lee <micah@micahflee.com>2019-01-21 17:28:24 -0800
commitf4cd49e9dcce92f65dd881c38a7101f39ed19075 (patch)
tree2332d49f3bc7a2711f7433533b3122e468c59a60
parent1be10f1e0268567c3fc7d19f4b9a1692e8f38fb7 (diff)
parent6af9a8a1cd81ca171304d3dfe83e388e45b9183d (diff)
downloadonionshare-f4cd49e9dcce92f65dd881c38a7101f39ed19075.tar.gz
onionshare-f4cd49e9dcce92f65dd881c38a7101f39ed19075.zip
Merge branch 'develop' into 866_receive_mode_crash
-rw-r--r--onionshare/web/receive_mode.py52
-rw-r--r--onionshare_gui/mode/history.py6
-rw-r--r--share/locale/fa.json131
-rw-r--r--share/locale/ja.json154
-rw-r--r--tests/GuiReceiveTest.py23
5 files changed, 211 insertions, 155 deletions
diff --git a/onionshare/web/receive_mode.py b/onionshare/web/receive_mode.py
index ad72c9f4..450417f6 100644
--- a/onionshare/web/receive_mode.py
+++ b/onionshare/web/receive_mode.py
@@ -65,6 +65,21 @@ class ReceiveModeWeb(object):
date_dir = now.strftime("%Y-%m-%d")
time_dir = now.strftime("%H.%M.%S")
receive_mode_dir = os.path.join(self.common.settings.get('data_dir'), date_dir, time_dir)
+ valid = True
+ try:
+ os.makedirs(receive_mode_dir, 0o700, exist_ok=True)
+ except PermissionError:
+ self.web.add_request(self.web.REQUEST_ERROR_DATA_DIR_CANNOT_CREATE, request.path, {
+ "receive_mode_dir": receive_mode_dir
+ })
+ print(strings._('error_cannot_create_data_dir').format(receive_mode_dir))
+ valid = False
+ if not valid:
+ flash('Error uploading, please inform the OnionShare user', 'error')
+ if self.common.settings.get('public_mode'):
+ return redirect('/')
+ else:
+ return redirect('/{}'.format(slug_candidate))
files = request.files.getlist('file[]')
filenames = []
@@ -290,13 +305,8 @@ class ReceiveModeRequest(Request):
strings._("receive_mode_upload_starting").format(self.web.common.human_readable_filesize(self.content_length))
))
- # Tell the GUI
- self.web.add_request(self.web.REQUEST_STARTED, self.path, {
- 'id': self.upload_id,
- 'content_length': self.content_length
- })
-
- self.web.receive_mode.uploads_in_progress.append(self.upload_id)
+ # Don't tell the GUI that a request has started until we start receiving files
+ self.told_gui_about_request = False
self.previous_file = None
@@ -306,6 +316,16 @@ class ReceiveModeRequest(Request):
writable stream.
"""
if self.upload_request:
+ if not self.told_gui_about_request:
+ # Tell the GUI about the request
+ self.web.add_request(self.web.REQUEST_STARTED, self.path, {
+ 'id': self.upload_id,
+ 'content_length': self.content_length
+ })
+ self.web.receive_mode.uploads_in_progress.append(self.upload_id)
+
+ self.told_gui_about_request = True
+
self.progress[filename] = {
'uploaded_bytes': 0,
'complete': False
@@ -327,6 +347,7 @@ class ReceiveModeRequest(Request):
self.web.common.log('ReceiveModeRequest', 'close')
try:
+<<<<<<< HEAD
upload_id = self.upload_id
if not self.web.stop_q.empty():
@@ -335,12 +356,20 @@ class ReceiveModeRequest(Request):
'id': upload_id
})
else:
+=======
+ if self.told_gui_about_request:
+ upload_id = self.upload_id
+>>>>>>> develop
# Inform the GUI that the upload has finished
self.web.add_request(self.web.REQUEST_UPLOAD_FINISHED, self.path, {
'id': upload_id
})
+<<<<<<< HEAD
self.web.receive_mode.uploads_in_progress.remove(upload_id)
+=======
+ self.web.receive_mode.uploads_in_progress.remove(upload_id)
+>>>>>>> develop
except AttributeError:
pass
@@ -365,10 +394,11 @@ class ReceiveModeRequest(Request):
), end='')
# Update the GUI on the upload progress
- self.web.add_request(self.web.REQUEST_PROGRESS, self.path, {
- 'id': self.upload_id,
- 'progress': self.progress
- })
+ if self.told_gui_about_request:
+ self.web.add_request(self.web.REQUEST_PROGRESS, self.path, {
+ 'id': self.upload_id,
+ 'progress': self.progress
+ })
def file_close_func(self, filename):
"""
diff --git a/onionshare_gui/mode/history.py b/onionshare_gui/mode/history.py
index 0ebd8b93..6af804b2 100644
--- a/onionshare_gui/mode/history.py
+++ b/onionshare_gui/mode/history.py
@@ -375,13 +375,15 @@ class HistoryItemList(QtWidgets.QScrollArea):
"""
Update an item. Override this method.
"""
- self.items[id].update(data)
+ if id in self.items:
+ self.items[id].update(data)
def cancel(self, id):
"""
Cancel an item. Override this method.
"""
- self.items[id].cancel()
+ if id in self.items:
+ self.items[id].cancel()
def reset(self):
"""
diff --git a/share/locale/fa.json b/share/locale/fa.json
index 21ebbec5..bca7cc99 100644
--- a/share/locale/fa.json
+++ b/share/locale/fa.json
@@ -71,23 +71,23 @@
"gui_settings_stealth_option": "",
"gui_settings_stealth_hidservauth_string": "",
"gui_settings_autoupdate_label": "بررسی برای نسخه جدید",
- "gui_settings_autoupdate_option": "",
+ "gui_settings_autoupdate_option": "زمانی که نسخه جدید موجود بود من را خبر کن",
"gui_settings_autoupdate_timestamp": "",
"gui_settings_autoupdate_timestamp_never": "هرگز",
- "gui_settings_autoupdate_check_button": "",
+ "gui_settings_autoupdate_check_button": "بررسی برای نسخه جدید",
"gui_settings_general_label": "تنظیمات کلی",
"gui_settings_sharing_label": "تنظیمات اشتراک گذاری",
- "gui_settings_close_after_first_download_option": "",
+ "gui_settings_close_after_first_download_option": "توقف اشتراک پس از اولین دانلود",
"gui_settings_connection_type_label": "",
"gui_settings_connection_type_bundled_option": "",
"gui_settings_connection_type_automatic_option": "",
- "gui_settings_connection_type_control_port_option": "",
- "gui_settings_connection_type_socket_file_option": "",
- "gui_settings_connection_type_test_button": "",
- "gui_settings_control_port_label": "",
- "gui_settings_socket_file_label": "",
+ "gui_settings_connection_type_control_port_option": "اتصال از طریق پورت کنترل",
+ "gui_settings_connection_type_socket_file_option": "اتصال از طریق فایل سوکت",
+ "gui_settings_connection_type_test_button": "تست اتصال به Tor",
+ "gui_settings_control_port_label": "پورت کنترل",
+ "gui_settings_socket_file_label": "فایل سوکت‌",
"gui_settings_socks_label": "پورت SOCKS",
- "gui_settings_authenticate_label": "",
+ "gui_settings_authenticate_label": "تنظیمات احراز هویت Tor",
"gui_settings_authenticate_no_auth_option": "",
"gui_settings_authenticate_password_option": "رمز عبور",
"gui_settings_password_label": "رمز عبور",
@@ -98,14 +98,14 @@
"gui_settings_tor_bridges_meek_lite_azure_radio_option": "",
"gui_settings_tor_bridges_meek_lite_azure_radio_option_no_obfs4proxy": "",
"gui_settings_meek_lite_expensive_warning": "",
- "gui_settings_tor_bridges_custom_radio_option": "",
- "gui_settings_tor_bridges_custom_label": "",
- "gui_settings_tor_bridges_invalid": "",
+ "gui_settings_tor_bridges_custom_radio_option": "استفاده از بریج های کاستوم",
+ "gui_settings_tor_bridges_custom_label": "میتوانید از <a href=\"https://bridges.torproject.org/options\">https://bridges.torproject.org</a> بریج دریافت کنید",
+ "gui_settings_tor_bridges_invalid": "هیچ کدام از بریج هایی که شما اضافه کردید کار نمی کند.\nآن ها را دوباره چک کنید یا بریج های دیگری اضافه کنید.",
"gui_settings_button_save": "ذخیره",
"gui_settings_button_cancel": "لغو",
- "gui_settings_button_help": "",
- "gui_settings_shutdown_timeout_checkbox": "",
- "gui_settings_shutdown_timeout": "",
+ "gui_settings_button_help": "راهنما",
+ "gui_settings_shutdown_timeout_checkbox": "استفاده از تایمر توقف خودکار",
+ "gui_settings_shutdown_timeout": "توقف اشتراک در:",
"settings_error_unknown": "",
"settings_error_automatic": "",
"settings_error_socket_port": "",
@@ -119,70 +119,71 @@
"settings_test_success": "",
"error_tor_protocol_error": "",
"error_tor_protocol_error_unknown": "",
- "error_invalid_private_key": "",
- "connecting_to_tor": "",
+ "error_invalid_private_key": "این نوع کلید خصوصی پشتیبانی نمی شود",
+ "connecting_to_tor": "در حال اتصال به شبکه Tor",
"update_available": "",
"update_error_check_error": "",
"update_error_invalid_latest_version": "",
- "update_not_available": "",
- "gui_tor_connection_ask": "",
+ "update_not_available": "شما از آخرین نسخه OnionShare استفاده می کنید.",
+ "gui_tor_connection_ask": "باز کردن تنظیمات برای ساماندهی اتصال به Tor؟",
"gui_tor_connection_ask_open_settings": "بله",
"gui_tor_connection_ask_quit": "خروج",
- "gui_tor_connection_error_settings": "",
- "gui_tor_connection_canceled": "",
- "gui_tor_connection_lost": "",
- "gui_server_started_after_timeout": "",
- "gui_server_timeout_expired": "",
- "share_via_onionshare": "",
- "gui_use_legacy_v2_onions_checkbox": "",
- "gui_save_private_key_checkbox": "",
+ "gui_tor_connection_error_settings": "تغییر نحوه اتصال OnionShare به شبکه Tor در تنظیمات.",
+ "gui_tor_connection_canceled": "اتصال به Tor برقرار نشد.\n\nمطمئن شوید که به اینترنت متصل هستید، سپس OnionShare را دوباره باز کرده و اتصال آن را به Tor دوباره برقرار کنید.",
+ "gui_tor_connection_lost": "اتصال با Tor قطع شده است.",
+ "gui_server_started_after_timeout": "تایمر توقف خودکار قبل از آغاز سرور به پایان رسید.\nلطفا یک اشتراک جدید درست کنید.",
+ "gui_server_timeout_expired": "تایمر توقف خودکار به پایان رسید.\nلطفا برای آغاز اشتراک گذاری آن را به روز رسانی کنید.",
+ "share_via_onionshare": "OnionShare کنید",
+ "gui_use_legacy_v2_onions_checkbox": "استفاده از آدرس های بازمانده",
+ "gui_save_private_key_checkbox": "استفاده از یک آدرس پایا",
"gui_share_url_description": "",
"gui_receive_url_description": "",
"gui_url_label_persistent": "",
- "gui_url_label_stay_open": "",
- "gui_url_label_onetime": "",
+ "gui_url_label_stay_open": "این اشتراک به صورت خودکار متوقف نمی شود.",
+ "gui_url_label_onetime": "این اشتراک پس از اولین تکمیل متوقف خواهد شد.",
"gui_url_label_onetime_and_persistent": "",
- "gui_status_indicator_share_stopped": "",
- "gui_status_indicator_share_working": "",
- "gui_status_indicator_share_started": "",
- "gui_status_indicator_receive_stopped": "",
- "gui_status_indicator_receive_working": "",
+ "gui_status_indicator_share_stopped": "آماده به اشتراک گذاری",
+ "gui_status_indicator_share_working": "در حال شروع…",
+ "gui_status_indicator_share_started": "در حال اشتراک گذاری",
+ "gui_status_indicator_receive_stopped": "آماده دریافت",
+ "gui_status_indicator_receive_working": "در حال شروع…",
"gui_status_indicator_receive_started": "درحال دریافت",
- "gui_file_info": "",
- "gui_file_info_single": "",
- "history_in_progress_tooltip": "",
- "history_completed_tooltip": "",
- "info_in_progress_uploads_tooltip": "",
- "info_completed_uploads_tooltip": "",
- "error_cannot_create_downloads_dir": "",
- "receive_mode_downloads_dir": "",
- "receive_mode_warning": "",
- "gui_receive_mode_warning": "",
- "receive_mode_upload_starting": "",
- "receive_mode_received_file": "",
- "gui_mode_share_button": "",
- "gui_mode_receive_button": "",
- "gui_settings_receiving_label": "",
- "gui_settings_downloads_label": "",
+ "gui_file_info": "{} فایل ها، {}",
+ "gui_file_info_single": "{} فایل، {}",
+ "history_in_progress_tooltip": "{} در حال انجام",
+ "history_completed_tooltip": "{} کامل شد",
+ "info_in_progress_uploads_tooltip": "{} آپلود در حال انجام",
+ "info_completed_uploads_tooltip": "{} آپلود کامل شد",
+ "error_cannot_create_downloads_dir": "ناتوانی در ایجاد پوشه حالت دریافت: {}",
+ "receive_mode_downloads_dir": "فایل های ارسال شده به شما در این پوشه پدیدار خواهند شد: {}",
+ "receive_mode_warning": "هشدار: حالت دریافت به سایر افراد اجازه می دهد تا به روی کامپیوتر شما فایل آپلود کنند. برخی فایل ها را اگر باز کنید پتانسیل آن را دارند تا کنترل کامپیوتر شما را در دست بگیرند. فقط چیزهایی که از کسانی دریافت کردید که به آن ها اعتماد دارید را باز کنید، یا اگر میدانید دارید چه کار میکنید.",
+ "gui_receive_mode_warning": "حالت دریافت به سایر افراد اجازه می دهد تا روی کامپیوتر شما فایل آپلود کنند.<br><br><b>برخی فایل ها را اگر باز کنید پتانسیل این را دارند که کنترل کامپیوتر شما را در دست بگیرند. فقط چیزهایی را باز کنید که از کسانی دریافت کرده اید که به آن ها اعتماد دارید، یا میدانید دارید چه کار میکنید.</b>",
+ "receive_mode_upload_starting": "آپلود حجم کلی {} در حال آغاز می باشد",
+ "receive_mode_received_file": "دریافت شده: {}",
+ "gui_mode_share_button": "اشتراک گذاری فایل ها",
+ "gui_mode_receive_button": "دریافت فایل ها",
+ "gui_settings_receiving_label": "تنظیمات دریافت",
+ "gui_settings_downloads_label": "ذخیره فایل ها در",
"gui_settings_downloads_button": "فهرست",
"gui_settings_receive_allow_receiver_shutdown_checkbox": "",
- "gui_settings_public_mode_checkbox": "",
- "systray_close_server_title": "",
- "systray_close_server_message": "",
- "systray_page_loaded_title": "",
- "systray_download_page_loaded_message": "",
- "systray_upload_page_loaded_message": "",
- "gui_uploads": "",
- "gui_no_uploads": "",
- "gui_clear_history": "",
- "gui_upload_in_progress": "",
- "gui_upload_finished_range": "",
- "gui_upload_finished": "",
+ "gui_settings_public_mode_checkbox": "حالت عمومی",
+ "systray_close_server_title": "سرور OnionShare بسته شد",
+ "systray_close_server_message": "یک کاربر سرور را بست",
+ "systray_page_loaded_title": "صفحه OnionShare بارگذاری شد",
+ "systray_download_page_loaded_message": "یک کاربر صفحه دانلود را بارگذاری کرد",
+ "systray_upload_page_loaded_message": "یک کاربر صفحه آپلود را بارگذاری کرد",
+ "gui_uploads": "تاریخچه آپلود",
+ "gui_no_uploads": "هیچ آپلودی هنوز وجود ندارد",
+ "gui_clear_history": "پاکسازی همه",
+ "gui_upload_in_progress": "آپلود آغاز شد {}",
+ "gui_upload_finished_range": "{} به {} آپلود شد",
+ "gui_upload_finished": "{} آپلود شد",
"gui_download_in_progress": "دانلود آغاز شد {}",
- "gui_open_folder_error_nautilus": "",
+ "gui_open_folder_error_nautilus": "ناتوانی در باز کردن پوشه به دلیل موجود نبودن ناتیلوس. فایل در اینجا قرار دارد: {}",
"gui_settings_language_label": "زبان ترجیحی",
- "gui_settings_language_changed_notice": "",
+ "gui_settings_language_changed_notice": "ری استارت OnionShare برای دیدن نتیجه اعمال تغییر در زبان.",
"timeout_upload_still_running": "انتظار برای تکمیل آپلود",
"gui_add_files": "افزودن فایل ها",
- "gui_add_folder": "افزودن پوشه"
+ "gui_add_folder": "افزودن پوشه",
+ "gui_connect_to_tor_for_onion_settings": "اتصال به Tor برای دیدن تنظیمات سرویس onion"
}
diff --git a/share/locale/ja.json b/share/locale/ja.json
index acddc8c2..77ae9b58 100644
--- a/share/locale/ja.json
+++ b/share/locale/ja.json
@@ -72,7 +72,7 @@
"gui_settings_window_title": "設定",
"gui_settings_whats_this": "<a href='{0:s}'>これは何ですか?</a>",
"gui_settings_stealth_option": "クライアント認証を使用",
- "gui_settings_stealth_hidservauth_string": "秘密鍵を保存したので、クリックしてHidServAuthをコピーできます。",
+ "gui_settings_stealth_hidservauth_string": "秘密鍵を保存したので、\nクリックしてHidServAuthをコピーできます。",
"gui_settings_autoupdate_label": "更新バージョンの有無をチェックする",
"gui_settings_autoupdate_option": "更新通知を起動します",
"gui_settings_autoupdate_timestamp": "前回にチェックした時: {}",
@@ -109,80 +109,80 @@
"gui_settings_button_help": "ヘルプ",
"gui_settings_shutdown_timeout_checkbox": "自動停止タイマーを使用する",
"gui_settings_shutdown_timeout": "共有を停止する時間:",
- "settings_error_unknown": "",
- "settings_error_automatic": "",
- "settings_error_socket_port": "",
- "settings_error_socket_file": "",
- "settings_error_auth": "",
- "settings_error_missing_password": "",
- "settings_error_unreadable_cookie_file": "",
- "settings_error_bundled_tor_not_supported": "",
- "settings_error_bundled_tor_timeout": "",
- "settings_error_bundled_tor_broken": "",
- "settings_test_success": "",
- "error_tor_protocol_error": "",
- "error_tor_protocol_error_unknown": "",
- "error_invalid_private_key": "",
- "connecting_to_tor": "",
- "update_available": "",
- "update_error_check_error": "",
- "update_error_invalid_latest_version": "",
- "update_not_available": "",
- "gui_tor_connection_ask": "",
- "gui_tor_connection_ask_open_settings": "",
- "gui_tor_connection_ask_quit": "",
- "gui_tor_connection_error_settings": "",
- "gui_tor_connection_canceled": "",
- "gui_tor_connection_lost": "",
- "gui_server_started_after_timeout": "",
- "gui_server_timeout_expired": "",
- "share_via_onionshare": "",
- "gui_connect_to_tor_for_onion_settings": "",
- "gui_use_legacy_v2_onions_checkbox": "",
- "gui_save_private_key_checkbox": "",
- "gui_share_url_description": "",
- "gui_receive_url_description": "",
- "gui_url_label_persistent": "",
- "gui_url_label_stay_open": "",
- "gui_url_label_onetime": "",
- "gui_url_label_onetime_and_persistent": "",
- "gui_status_indicator_share_stopped": "",
- "gui_status_indicator_share_working": "",
- "gui_status_indicator_share_started": "",
- "gui_status_indicator_receive_stopped": "",
- "gui_status_indicator_receive_working": "",
- "gui_status_indicator_receive_started": "",
- "gui_file_info": "",
- "gui_file_info_single": "",
- "history_in_progress_tooltip": "",
- "history_completed_tooltip": "",
- "info_in_progress_uploads_tooltip": "",
- "info_completed_uploads_tooltip": "",
- "error_cannot_create_downloads_dir": "",
- "receive_mode_downloads_dir": "",
- "receive_mode_warning": "",
- "gui_receive_mode_warning": "",
- "receive_mode_upload_starting": "",
- "receive_mode_received_file": "",
- "gui_mode_share_button": "",
- "gui_mode_receive_button": "",
- "gui_settings_receiving_label": "",
- "gui_settings_downloads_label": "",
- "gui_settings_downloads_button": "",
- "gui_settings_public_mode_checkbox": "",
- "systray_close_server_title": "",
- "systray_close_server_message": "",
- "systray_page_loaded_title": "",
- "systray_download_page_loaded_message": "",
- "systray_upload_page_loaded_message": "",
- "gui_uploads": "",
- "gui_no_uploads": "",
- "gui_clear_history": "",
- "gui_upload_in_progress": "",
- "gui_upload_finished_range": "",
- "gui_upload_finished": "",
- "gui_download_in_progress": "",
- "gui_open_folder_error_nautilus": "",
- "gui_settings_language_label": "",
- "gui_settings_language_changed_notice": ""
+ "settings_error_unknown": "設定を解釈できないため、Torコントローラーと接続できません。",
+ "settings_error_automatic": "Torコントローラーと接続できません。Torブラウザ(torproject.orgから入手できる)がバックグラウンドで動作していますか?",
+ "settings_error_socket_port": "{}:{}でTorコントローラーと接続できません。",
+ "settings_error_socket_file": "ソケットファイル{}を使用してTorコントローラーと接続できません。",
+ "settings_error_auth": "{}:{}と接続できましたが、認証ができません。これは実際にTorコントローラーですか?",
+ "settings_error_missing_password": "Torコントローラーと接続できましたが、認証にはパスワードが必要です。",
+ "settings_error_unreadable_cookie_file": "Torコントローラーと接続できましたが、パスワードが診違っているあるいはクッキーファイルの読み出し許可がないかもしれない。",
+ "settings_error_bundled_tor_not_supported": "OnionShareに組み込まれているTorバージョンはWindowsやmacOSの開発者モードで動作できません。",
+ "settings_error_bundled_tor_timeout": "Torとの接続は時間がかかり過ぎます。インターネットとの接続、あるいはシステム・クロックの精度には問題がありますか?",
+ "settings_error_bundled_tor_broken": "OnionShareはバックグラウンドで動作しているTorと接続できませんでした:\n{}",
+ "settings_test_success": "Torコントローラーと接続完了。\n\nTorバージョン:{}\nエフェメラルonionサービスをサポートする:{}\nクライアント認証をサポートする:{}\nnext-gen .onionアドレスをサポートする:{}.",
+ "error_tor_protocol_error": "Torとのエラーが生じました: {}",
+ "error_tor_protocol_error_unknown": "Torとの未知のエラーが生じました",
+ "error_invalid_private_key": "この秘密鍵形式は未対応である",
+ "connecting_to_tor": "Torネットワークと接続中",
+ "update_available": "OnionShareの新バージョンはリリースされました。<a href='{}'>こちら</a>から入手できます。<br><br>現行バージョンは{}そして最新バージョンは{}。",
+ "update_error_check_error": "新バージョンのチェックをできなかった:OnionShare公式サイトによれば、最新バージョンは認識できない '{}'です…",
+ "update_error_invalid_latest_version": "新バージョンのチェックをできなかった:多分Torと接続していない、あるいはOnionShare公式サイトはダウンかもしれない?",
+ "update_not_available": "OnionShareの最新バージョンを使っています。",
+ "gui_tor_connection_ask": "設定を開いて、Torとの接続問題を解決しますか?",
+ "gui_tor_connection_ask_open_settings": "はい",
+ "gui_tor_connection_ask_quit": "終了",
+ "gui_tor_connection_error_settings": "設定でTorとの接続方法を変更してみて下さい。",
+ "gui_tor_connection_canceled": "Torと接続できませんでした。\n\nインターネット接続を確認してから、OnionShareを再開してTorとの接続を設定して下さい。",
+ "gui_tor_connection_lost": "Torから切断されました。",
+ "gui_server_started_after_timeout": "サーバーが起動した前、自動停止タイマーがタイムアウトしました。\n再びファイル共有をして下さい。",
+ "gui_server_timeout_expired": "自動停止タイマーはすでにタイムアウトしています。\n共有し始めるにはリセットして下さい。",
+ "share_via_onionshare": "OnionShareで共有する",
+ "gui_connect_to_tor_for_onion_settings": "onionサービス設定を見るのにTorと接続して下さい",
+ "gui_use_legacy_v2_onions_checkbox": "レガシーアドレスを使用する",
+ "gui_save_private_key_checkbox": "永続的アドレスを使用する",
+ "gui_share_url_description": "このOnionShareアドレスを持つ限り<b>誰でも</b>は<b>Torブラウザー</b>を利用してこのファイルを<b>ダウンロードできます</b>:<img src='{}' />",
+ "gui_receive_url_description": "このOnionShareアドレスを持つ限り<b>誰でも</b>は<b>Torブラウザー</b>を利用してこのPCにファイルを<b>アップロードできます</b>:<img src='{}' />",
+ "gui_url_label_persistent": "このファイル共有には自動停止はありません。<br><br>その次の共有は同じアドレスを再利用します。(1回限りのアドレスには、設定で「永続的アドレス」を無効にして下さい。)",
+ "gui_url_label_stay_open": "このファイル共有には自動停止はありません。",
+ "gui_url_label_onetime": "このファイル共有は最初の完了後に停止されます。",
+ "gui_url_label_onetime_and_persistent": "このファイル共有には自動停止はありません。<br><br>その次の共有は同じアドレスを再利用します。(1回限りのアドレスには、設定で「永続的アドレス」を無効にして下さい。)",
+ "gui_status_indicator_share_stopped": "共有の準備完了",
+ "gui_status_indicator_share_working": "起動しています…",
+ "gui_status_indicator_share_started": "共有中",
+ "gui_status_indicator_receive_stopped": "受信の準備完了",
+ "gui_status_indicator_receive_working": "起動しています…",
+ "gui_status_indicator_receive_started": "受信中",
+ "gui_file_info": "{} ファイル, {}",
+ "gui_file_info_single": "{} ファイル, {}",
+ "history_in_progress_tooltip": "{} 進行中",
+ "history_completed_tooltip": "{} 完了",
+ "info_in_progress_uploads_tooltip": "{} 進行中のアップロード",
+ "info_completed_uploads_tooltip": "{} 完了のアップロード",
+ "error_cannot_create_downloads_dir": "受信モードフォルダを作成できなかった: {}",
+ "receive_mode_downloads_dir": "受信されるファイルはこのフォルダに保存されます: {}",
+ "receive_mode_warning": "警告:受信モードで他の人はあなたのPCへファイルをアップロードできるようにします。悪意なファイルを開いたら、PCは感染される可能性があります。ファイル内容を完全に理解しない場合、信用している人のみからのファイルを開いて下さい。",
+ "gui_receive_mode_warning": "受信モードで他の人はあなたのPCへファイルをアップロードできるようにします。<br><br><b>悪意なファイルを開いたら、PCは感染される可能性があります。ファイル内容を完全に理解しない場合、信用している人のみからのファイルを開いて下さい。</b>",
+ "receive_mode_upload_starting": "ファイルサイズ{}のアップロードが実行中",
+ "receive_mode_received_file": "受信した: {}",
+ "gui_mode_share_button": "ファイル共有",
+ "gui_mode_receive_button": "ファイル受信",
+ "gui_settings_receiving_label": "受信設定",
+ "gui_settings_downloads_label": "保存フォルダ",
+ "gui_settings_downloads_button": "選ぶ",
+ "gui_settings_public_mode_checkbox": "公開モード",
+ "systray_close_server_title": "OnionShareサーバーは閉鎖されました",
+ "systray_close_server_message": "ユーザーがサーバーを閉鎖しました",
+ "systray_page_loaded_title": "OnionShareページはロードされました",
+ "systray_download_page_loaded_message": "ユーザーがダウンロードページをロードしました",
+ "systray_upload_page_loaded_message": "ユーザーがアップロードページをロードしました",
+ "gui_uploads": "アップロード履歴",
+ "gui_no_uploads": "アップロードはまだありません",
+ "gui_clear_history": "全てをクリアする",
+ "gui_upload_in_progress": "アップロード開始しました {}",
+ "gui_upload_finished_range": "{}を{}にアップロードしました",
+ "gui_upload_finished": "{}をアップロードしました",
+ "gui_download_in_progress": "ダウンロード開始しました {}",
+ "gui_open_folder_error_nautilus": "nautilusを利用できないためフォルダーを開けません。ファイルはここに保存されました: {}",
+ "gui_settings_language_label": "優先言語",
+ "gui_settings_language_changed_notice": "言語設定の変更を実行するにはOnionShareを再起動して下さい。"
}
diff --git a/tests/GuiReceiveTest.py b/tests/GuiReceiveTest.py
index a23a4bc6..8a03283e 100644
--- a/tests/GuiReceiveTest.py
+++ b/tests/GuiReceiveTest.py
@@ -52,6 +52,28 @@ class GuiReceiveTest(GuiBaseTest):
response = requests.get('http://127.0.0.1:{}/close'.format(self.gui.app.port))
self.assertEqual(response.status_code, 404)
+ def uploading_zero_files_shouldnt_change_ui(self, mode, public_mode):
+ '''If you submit the receive mode form without selecting any files, the UI shouldn't get updated'''
+ if not public_mode:
+ path = 'http://127.0.0.1:{}/{}/upload'.format(self.gui.app.port, self.gui.receive_mode.web.slug)
+ else:
+ path = 'http://127.0.0.1:{}/upload'.format(self.gui.app.port)
+
+ # What were the counts before submitting the form?
+ before_in_progress_count = mode.history.in_progress_count
+ before_completed_count = mode.history.completed_count
+ before_number_of_history_items = len(mode.history.item_list.items)
+
+ # Click submit without including any files a few times
+ response = requests.post(path, files={})
+ response = requests.post(path, files={})
+ response = requests.post(path, files={})
+
+ # The counts shouldn't change
+ self.assertEqual(mode.history.in_progress_count, before_in_progress_count)
+ self.assertEqual(mode.history.completed_count, before_completed_count)
+ self.assertEqual(len(mode.history.item_list.items), before_number_of_history_items)
+
def run_receive_mode_sender_closed_tests(self, public_mode):
'''Test that the share can be stopped by the sender in receive mode'''
if not public_mode:
@@ -97,6 +119,7 @@ class GuiReceiveTest(GuiBaseTest):
self.counter_incremented(self.gui.receive_mode, 3)
self.upload_file(public_mode, '/tmp/testdir/test', 'test')
self.counter_incremented(self.gui.receive_mode, 4)
+ self.uploading_zero_files_shouldnt_change_ui(self.gui.receive_mode, public_mode)
self.history_indicator(self.gui.receive_mode, public_mode)
self.server_is_stopped(self.gui.receive_mode, False)
self.web_server_is_stopped()