2018-04-24 00:24:12 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
OnionShare | https://onionshare.org/
|
|
|
|
|
|
|
|
Copyright (C) 2014-2018 Micah Lee <micah@micahflee.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
"""
|
2018-04-26 01:59:26 -04:00
|
|
|
import os
|
2018-04-24 00:24:12 -04:00
|
|
|
from PyQt5 import QtCore, QtWidgets, QtGui
|
|
|
|
|
|
|
|
from onionshare import strings
|
2018-04-24 01:08:51 -04:00
|
|
|
from onionshare.onion import *
|
2018-04-26 01:59:26 -04:00
|
|
|
from onionshare.common import Common
|
2018-04-26 12:30:53 -04:00
|
|
|
from onionshare.web import Web
|
2018-04-24 01:08:51 -04:00
|
|
|
|
|
|
|
from .file_selection import FileSelection
|
|
|
|
from .downloads import Downloads
|
2018-09-17 23:55:54 -04:00
|
|
|
from .threads import CompressThread
|
2018-09-28 19:00:22 -04:00
|
|
|
from .info import ShareModeInfo
|
2018-04-26 00:54:28 -04:00
|
|
|
from ..mode import Mode
|
2018-04-25 11:43:40 -04:00
|
|
|
from ..widgets import Alert
|
2018-04-24 01:08:51 -04:00
|
|
|
|
2018-04-26 00:54:28 -04:00
|
|
|
class ShareMode(Mode):
|
2018-04-24 00:24:12 -04:00
|
|
|
"""
|
|
|
|
Parts of the main window UI for sharing files.
|
|
|
|
"""
|
2018-04-26 00:54:28 -04:00
|
|
|
def init(self):
|
|
|
|
"""
|
|
|
|
Custom initialization for ReceiveMode.
|
|
|
|
"""
|
2018-09-17 23:55:54 -04:00
|
|
|
# Threads start out as None
|
|
|
|
self.compress_thread = None
|
|
|
|
|
2018-04-26 12:30:53 -04:00
|
|
|
# Create the Web object
|
2018-09-21 14:14:32 -04:00
|
|
|
self.web = Web(self.common, True, 'share')
|
2018-04-26 12:30:53 -04:00
|
|
|
|
2018-04-24 00:34:29 -04:00
|
|
|
# File selection
|
|
|
|
self.file_selection = FileSelection(self.common)
|
2018-04-26 00:54:28 -04:00
|
|
|
if self.filenames:
|
|
|
|
for filename in self.filenames:
|
2018-04-24 00:34:29 -04:00
|
|
|
self.file_selection.file_list.add_file(filename)
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-24 00:34:29 -04:00
|
|
|
# Server status
|
2018-04-28 02:02:04 -04:00
|
|
|
self.server_status.set_mode('share', self.file_selection)
|
2018-04-26 00:54:28 -04:00
|
|
|
self.server_status.server_started.connect(self.file_selection.server_started)
|
2018-04-24 00:34:29 -04:00
|
|
|
self.server_status.server_stopped.connect(self.file_selection.server_stopped)
|
|
|
|
self.server_status.server_stopped.connect(self.update_primary_action)
|
|
|
|
self.server_status.server_canceled.connect(self.file_selection.server_stopped)
|
|
|
|
self.server_status.server_canceled.connect(self.update_primary_action)
|
|
|
|
self.file_selection.file_list.files_updated.connect(self.server_status.update)
|
|
|
|
self.file_selection.file_list.files_updated.connect(self.update_primary_action)
|
2018-04-26 12:30:53 -04:00
|
|
|
# Tell server_status about web, then update
|
|
|
|
self.server_status.web = self.web
|
|
|
|
self.server_status.update()
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
# Filesize warning
|
|
|
|
self.filesize_warning = QtWidgets.QLabel()
|
|
|
|
self.filesize_warning.setWordWrap(True)
|
2018-05-07 19:21:22 -04:00
|
|
|
self.filesize_warning.setStyleSheet(self.common.css['share_filesize_warning'])
|
2018-04-24 00:34:29 -04:00
|
|
|
self.filesize_warning.hide()
|
|
|
|
|
|
|
|
# Downloads
|
|
|
|
self.downloads = Downloads(self.common)
|
2018-09-28 16:18:18 -04:00
|
|
|
self.downloads.hide()
|
2018-04-24 00:34:29 -04:00
|
|
|
self.downloads_in_progress = 0
|
|
|
|
self.downloads_completed = 0
|
|
|
|
|
2018-05-03 12:29:54 -04:00
|
|
|
# Information about share, and show downloads button
|
2018-09-28 19:00:22 -04:00
|
|
|
self.info = ShareModeInfo(self.common, self)
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
# Primary action layout
|
2018-04-26 00:54:28 -04:00
|
|
|
self.primary_action_layout.addWidget(self.filesize_warning)
|
2018-04-24 00:34:29 -04:00
|
|
|
self.primary_action.hide()
|
|
|
|
self.update_primary_action()
|
|
|
|
|
2018-04-24 01:08:51 -04:00
|
|
|
# Status bar, zip progress bar
|
|
|
|
self._zip_progress_bar = None
|
|
|
|
|
2018-09-28 15:51:30 -04:00
|
|
|
# Main layout
|
|
|
|
self.main_layout = QtWidgets.QVBoxLayout()
|
2018-09-28 18:47:49 -04:00
|
|
|
self.main_layout.addWidget(self.info)
|
2018-09-28 15:51:30 -04:00
|
|
|
self.main_layout.addLayout(self.file_selection)
|
|
|
|
self.main_layout.addWidget(self.primary_action)
|
|
|
|
self.main_layout.addWidget(self.min_width_widget)
|
|
|
|
|
2018-09-28 18:05:43 -04:00
|
|
|
# Wrapper layout
|
|
|
|
self.wrapper_layout = QtWidgets.QHBoxLayout()
|
|
|
|
self.wrapper_layout.addLayout(self.main_layout)
|
|
|
|
self.wrapper_layout.addWidget(self.downloads)
|
|
|
|
self.setLayout(self.wrapper_layout)
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
# Always start with focus on file selection
|
|
|
|
self.file_selection.setFocus()
|
|
|
|
|
2018-04-28 15:03:10 -04:00
|
|
|
def get_stop_server_shutdown_timeout_text(self):
|
|
|
|
"""
|
|
|
|
Return the string to put on the stop server button, if there's a shutdown timeout
|
|
|
|
"""
|
|
|
|
return strings._('gui_share_stop_server_shutdown_timeout', True)
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-28 15:03:10 -04:00
|
|
|
def timeout_finished_should_stop_server(self):
|
|
|
|
"""
|
|
|
|
The shutdown timer expired, should we stop the server? Returns a bool
|
|
|
|
"""
|
|
|
|
# If there were no attempts to download the share, or all downloads are done, we can stop
|
2018-09-21 14:36:19 -04:00
|
|
|
if self.web.share_mode.download_count == 0 or self.web.done:
|
2018-04-28 15:03:10 -04:00
|
|
|
self.server_status.stop_server()
|
|
|
|
self.server_status_label.setText(strings._('close_on_timeout', True))
|
|
|
|
return True
|
|
|
|
# A download is probably still running - hold off on stopping the share
|
|
|
|
else:
|
|
|
|
self.server_status_label.setText(strings._('timeout_download_still_running', True))
|
|
|
|
return False
|
2018-04-24 01:08:51 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
def start_server_custom(self):
|
2018-04-24 12:21:23 -04:00
|
|
|
"""
|
2018-04-26 01:59:26 -04:00
|
|
|
Starting the server.
|
|
|
|
"""
|
2018-04-26 12:30:53 -04:00
|
|
|
# Reset web counters
|
2018-09-21 14:36:19 -04:00
|
|
|
self.web.share_mode.download_count = 0
|
2018-04-26 12:30:53 -04:00
|
|
|
self.web.error404_count = 0
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
# Hide and reset the downloads if we have previously shared
|
|
|
|
self.reset_info_counters()
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
def start_server_step2_custom(self):
|
|
|
|
"""
|
|
|
|
Step 2 in starting the server. Zipping up files.
|
|
|
|
"""
|
|
|
|
# Add progress bar to the status bar, indicating the compressing of files.
|
2018-05-07 19:21:22 -04:00
|
|
|
self._zip_progress_bar = ZipProgressBar(self.common, 0)
|
2018-04-26 01:59:26 -04:00
|
|
|
self.filenames = []
|
|
|
|
for index in range(self.file_selection.file_list.count()):
|
|
|
|
self.filenames.append(self.file_selection.file_list.item(index).filename)
|
|
|
|
|
|
|
|
self._zip_progress_bar.total_files_size = ShareMode._compute_total_size(self.filenames)
|
|
|
|
self.status_bar.insertWidget(0, self._zip_progress_bar)
|
|
|
|
|
2018-09-17 23:55:54 -04:00
|
|
|
# prepare the files for sending in a new thread
|
|
|
|
self.compress_thread = CompressThread(self)
|
|
|
|
self.compress_thread.success.connect(self.starting_server_step3.emit)
|
|
|
|
self.compress_thread.success.connect(self.start_server_finished.emit)
|
|
|
|
self.compress_thread.error.connect(self.starting_server_error.emit)
|
|
|
|
self.server_status.server_canceled.connect(self.compress_thread.cancel)
|
|
|
|
self.compress_thread.start()
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
def start_server_step3_custom(self):
|
|
|
|
"""
|
|
|
|
Step 3 in starting the server. Remove zip progess bar, and display large filesize
|
|
|
|
warning, if applicable.
|
|
|
|
"""
|
|
|
|
# Remove zip progress bar
|
|
|
|
if self._zip_progress_bar is not None:
|
|
|
|
self.status_bar.removeWidget(self._zip_progress_bar)
|
|
|
|
self._zip_progress_bar = None
|
|
|
|
|
|
|
|
# Warn about sending large files over Tor
|
2018-09-21 14:36:19 -04:00
|
|
|
if self.web.share_mode.download_filesize >= 157286400: # 150mb
|
2018-04-26 01:59:26 -04:00
|
|
|
self.filesize_warning.setText(strings._("large_filesize", True))
|
|
|
|
self.filesize_warning.show()
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
def start_server_error_custom(self):
|
|
|
|
"""
|
|
|
|
Start server error.
|
|
|
|
"""
|
|
|
|
if self._zip_progress_bar is not None:
|
|
|
|
self.status_bar.removeWidget(self._zip_progress_bar)
|
|
|
|
self._zip_progress_bar = None
|
2018-05-04 19:06:24 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
def stop_server_custom(self):
|
|
|
|
"""
|
|
|
|
Stop server.
|
|
|
|
"""
|
|
|
|
# Remove the progress bar
|
|
|
|
if self._zip_progress_bar is not None:
|
|
|
|
self.status_bar.removeWidget(self._zip_progress_bar)
|
|
|
|
self._zip_progress_bar = None
|
|
|
|
|
|
|
|
self.filesize_warning.hide()
|
|
|
|
self.downloads_in_progress = 0
|
|
|
|
self.downloads_completed = 0
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_in_progress()
|
2018-04-26 01:59:26 -04:00
|
|
|
self.file_selection.file_list.adjustSize()
|
|
|
|
|
2018-09-17 23:55:54 -04:00
|
|
|
def cancel_server_custom(self):
|
|
|
|
"""
|
|
|
|
Stop the compression thread on cancel
|
|
|
|
"""
|
|
|
|
if self.compress_thread:
|
2018-09-28 16:43:10 -04:00
|
|
|
self.common.log('ShareMode', 'cancel_server: quitting compress thread')
|
2018-09-17 23:55:54 -04:00
|
|
|
self.compress_thread.quit()
|
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
def handle_tor_broke_custom(self):
|
|
|
|
"""
|
|
|
|
Connection to Tor broke.
|
2018-04-24 12:21:23 -04:00
|
|
|
"""
|
|
|
|
self.primary_action.hide()
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.show_less()
|
2018-04-24 12:21:23 -04:00
|
|
|
|
|
|
|
def handle_request_load(self, event):
|
|
|
|
"""
|
|
|
|
Handle REQUEST_LOAD event.
|
|
|
|
"""
|
2018-04-29 19:41:05 -04:00
|
|
|
self.system_tray.showMessage(strings._('systray_page_loaded_title', True), strings._('systray_download_page_loaded_message', True))
|
2018-04-24 12:21:23 -04:00
|
|
|
|
2018-05-08 01:16:45 -04:00
|
|
|
def handle_request_started(self, event):
|
2018-04-24 12:21:23 -04:00
|
|
|
"""
|
2018-05-08 01:15:29 -04:00
|
|
|
Handle REQUEST_STARTED event.
|
2018-04-24 12:21:23 -04:00
|
|
|
"""
|
2018-09-21 19:22:37 -04:00
|
|
|
if event["data"]["use_gzip"]:
|
|
|
|
filesize = self.web.share_mode.gzip_filesize
|
|
|
|
else:
|
|
|
|
filesize = self.web.share_mode.download_filesize
|
|
|
|
self.downloads.add(event["data"]["id"], filesize)
|
2018-09-28 22:54:46 -04:00
|
|
|
self.info.update_indicator(True)
|
2018-04-24 12:21:23 -04:00
|
|
|
self.downloads_in_progress += 1
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_in_progress()
|
2018-04-24 12:21:23 -04:00
|
|
|
|
2018-04-24 12:26:06 -04:00
|
|
|
self.system_tray.showMessage(strings._('systray_download_started_title', True), strings._('systray_download_started_message', True))
|
2018-04-24 12:21:23 -04:00
|
|
|
|
|
|
|
def handle_request_progress(self, event):
|
|
|
|
"""
|
|
|
|
Handle REQUEST_PROGRESS event.
|
|
|
|
"""
|
2018-05-04 21:08:23 -04:00
|
|
|
self.downloads.update(event["data"]["id"], event["data"]["bytes"])
|
2018-04-24 12:21:23 -04:00
|
|
|
|
|
|
|
# Is the download complete?
|
2018-09-25 00:40:10 -04:00
|
|
|
if event["data"]["bytes"] == self.web.share_mode.filesize:
|
2018-04-24 12:26:06 -04:00
|
|
|
self.system_tray.showMessage(strings._('systray_download_completed_title', True), strings._('systray_download_completed_message', True))
|
|
|
|
|
2018-04-24 12:21:23 -04:00
|
|
|
# Update the total 'completed downloads' info
|
|
|
|
self.downloads_completed += 1
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_completed()
|
2018-04-24 12:21:23 -04:00
|
|
|
# Update the 'in progress downloads' info
|
|
|
|
self.downloads_in_progress -= 1
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_in_progress()
|
2018-04-24 12:21:23 -04:00
|
|
|
|
2018-05-04 19:35:32 -04:00
|
|
|
# Close on finish?
|
|
|
|
if self.common.settings.get('close_after_first_download'):
|
2018-04-24 12:21:23 -04:00
|
|
|
self.server_status.stop_server()
|
|
|
|
self.status_bar.clearMessage()
|
2018-04-26 01:59:26 -04:00
|
|
|
self.server_status_label.setText(strings._('closing_automatically', True))
|
2018-04-24 12:21:23 -04:00
|
|
|
else:
|
|
|
|
if self.server_status.status == self.server_status.STATUS_STOPPED:
|
2018-05-04 21:08:23 -04:00
|
|
|
self.downloads.cancel(event["data"]["id"])
|
2018-04-24 12:21:23 -04:00
|
|
|
self.downloads_in_progress = 0
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_in_progress()
|
2018-04-24 12:21:23 -04:00
|
|
|
|
|
|
|
def handle_request_canceled(self, event):
|
|
|
|
"""
|
|
|
|
Handle REQUEST_CANCELED event.
|
|
|
|
"""
|
2018-05-04 21:08:23 -04:00
|
|
|
self.downloads.cancel(event["data"]["id"])
|
2018-04-24 12:21:23 -04:00
|
|
|
|
|
|
|
# Update the 'in progress downloads' info
|
|
|
|
self.downloads_in_progress -= 1
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_in_progress()
|
2018-04-24 12:26:06 -04:00
|
|
|
self.system_tray.showMessage(strings._('systray_download_canceled_title', True), strings._('systray_download_canceled_message', True))
|
2018-04-24 12:21:23 -04:00
|
|
|
|
2018-04-25 11:49:43 -04:00
|
|
|
def on_reload_settings(self):
|
|
|
|
"""
|
|
|
|
If there were some files listed for sharing, we should be ok to re-enable
|
|
|
|
the 'Start Sharing' button now.
|
|
|
|
"""
|
|
|
|
if self.server_status.file_selection.get_num_files() > 0:
|
|
|
|
self.primary_action.show()
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.show_more()
|
2018-04-25 11:49:43 -04:00
|
|
|
|
2018-04-24 00:34:29 -04:00
|
|
|
def update_primary_action(self):
|
2018-09-28 16:43:10 -04:00
|
|
|
self.common.log('ShareMode', 'update_primary_action')
|
|
|
|
|
2018-04-24 00:34:29 -04:00
|
|
|
# Show or hide primary action layout
|
|
|
|
file_count = self.file_selection.file_list.count()
|
|
|
|
if file_count > 0:
|
|
|
|
self.primary_action.show()
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.show_more()
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
# Update the file count in the info label
|
|
|
|
total_size_bytes = 0
|
|
|
|
for index in range(self.file_selection.file_list.count()):
|
|
|
|
item = self.file_selection.file_list.item(index)
|
|
|
|
total_size_bytes += item.size_bytes
|
|
|
|
total_size_readable = self.common.human_readable_filesize(total_size_bytes)
|
|
|
|
|
|
|
|
if file_count > 1:
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_label(strings._('gui_file_info', True).format(file_count, total_size_readable))
|
2018-04-24 00:34:29 -04:00
|
|
|
else:
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_label(strings._('gui_file_info_single', True).format(file_count, total_size_readable))
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
else:
|
|
|
|
self.primary_action.hide()
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.show_less()
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
# Resize window
|
2018-09-28 18:30:37 -04:00
|
|
|
self.resize_window()
|
2018-04-24 00:34:29 -04:00
|
|
|
|
|
|
|
def reset_info_counters(self):
|
|
|
|
"""
|
|
|
|
Set the info counters back to zero.
|
|
|
|
"""
|
2018-05-03 12:29:54 -04:00
|
|
|
self.downloads_completed = 0
|
|
|
|
self.downloads_in_progress = 0
|
2018-09-28 18:47:49 -04:00
|
|
|
self.info.update_downloads_completed()
|
|
|
|
self.info.update_downloads_in_progress()
|
2018-05-04 21:08:23 -04:00
|
|
|
self.downloads.reset()
|
2018-04-24 00:34:29 -04:00
|
|
|
|
2018-09-28 18:30:37 -04:00
|
|
|
def resize_window(self):
|
2018-09-29 18:12:05 -04:00
|
|
|
min_width = self.common.min_window_width
|
2018-09-28 18:30:37 -04:00
|
|
|
if self.downloads.isVisible():
|
|
|
|
min_width += 300
|
|
|
|
self.adjust_size.emit(min_width)
|
2018-09-28 16:24:44 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
@staticmethod
|
|
|
|
def _compute_total_size(filenames):
|
|
|
|
total_size = 0
|
|
|
|
for filename in filenames:
|
|
|
|
if os.path.isfile(filename):
|
|
|
|
total_size += os.path.getsize(filename)
|
|
|
|
if os.path.isdir(filename):
|
|
|
|
total_size += Common.dir_size(filename)
|
|
|
|
return total_size
|
|
|
|
|
|
|
|
|
|
|
|
class ZipProgressBar(QtWidgets.QProgressBar):
|
|
|
|
update_processed_size_signal = QtCore.pyqtSignal(int)
|
|
|
|
|
2018-05-07 19:21:22 -04:00
|
|
|
def __init__(self, common, total_files_size):
|
2018-04-26 01:59:26 -04:00
|
|
|
super(ZipProgressBar, self).__init__()
|
2018-05-07 19:21:22 -04:00
|
|
|
self.common = common
|
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
self.setMaximumHeight(20)
|
|
|
|
self.setMinimumWidth(200)
|
|
|
|
self.setValue(0)
|
|
|
|
self.setFormat(strings._('zip_progress_bar_format'))
|
2018-05-07 19:21:22 -04:00
|
|
|
self.setStyleSheet(self.common.css['share_zip_progess_bar'])
|
2018-04-26 01:59:26 -04:00
|
|
|
|
|
|
|
self._total_files_size = total_files_size
|
|
|
|
self._processed_size = 0
|
|
|
|
|
|
|
|
self.update_processed_size_signal.connect(self.update_processed_size)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def total_files_size(self):
|
|
|
|
return self._total_files_size
|
|
|
|
|
|
|
|
@total_files_size.setter
|
|
|
|
def total_files_size(self, val):
|
|
|
|
self._total_files_size = val
|
|
|
|
|
|
|
|
@property
|
|
|
|
def processed_size(self):
|
|
|
|
return self._processed_size
|
|
|
|
|
|
|
|
@processed_size.setter
|
|
|
|
def processed_size(self, val):
|
|
|
|
self.update_processed_size(val)
|
|
|
|
|
|
|
|
def update_processed_size(self, val):
|
|
|
|
self._processed_size = val
|
2018-09-21 19:22:37 -04:00
|
|
|
|
2018-04-26 01:59:26 -04:00
|
|
|
if self.processed_size < self.total_files_size:
|
|
|
|
self.setValue(int((self.processed_size * 100) / self.total_files_size))
|
|
|
|
elif self.total_files_size != 0:
|
|
|
|
self.setValue(100)
|
|
|
|
else:
|
|
|
|
self.setValue(0)
|