mirror of
https://github.com/onionshare/onionshare.git
synced 2025-04-20 23:46:35 -04:00
Merge deab6ba1bc6ef7afeec9485ee815d5b8390a01c7 into 12e7a9ba59e452a4fce9bad25e1b71e0ddf1cf94
This commit is contained in:
commit
e2e79d1c27
@ -26,10 +26,10 @@ import signal
|
||||
import json
|
||||
import psutil
|
||||
import getpass
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from PySide6.QtCore import Slot, Qt
|
||||
from PySide6.QtGui import QPalette, QColor
|
||||
from qtpy.QtCore import Slot, Qt
|
||||
from qtpy.QtGui import QPalette, QColor
|
||||
|
||||
from onionshare_cli.common import Common
|
||||
from onionshare_cli.settings import Settings
|
||||
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import json
|
||||
import os
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.censorship import (
|
||||
CensorshipCircumvention,
|
||||
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import os
|
||||
import shutil
|
||||
from pkg_resources import resource_filename
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from . import strings
|
||||
from onionshare_cli.onion import (
|
||||
@ -624,9 +624,11 @@ class ToggleCheckbox(QtWidgets.QCheckBox):
|
||||
x = (
|
||||
rect.width() - rect.x() - self.w + 20
|
||||
) # 20 is the padding between text and toggle
|
||||
x = int(x)
|
||||
y = (
|
||||
self.height() / 2 - self.h / 2 + 16
|
||||
) # 16 is the padding top for the checkbox
|
||||
y = int(y)
|
||||
self.toggleRect = QtCore.QRect(x, y, self.w, self.h)
|
||||
painter.setBrush(QtGui.QColor(self.bg_color))
|
||||
painter.drawRoundedRect(x, y, self.w, self.h, self.h / 2, self.h / 2)
|
||||
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
import time
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from . import strings
|
||||
from .widgets import Alert
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
import requests
|
||||
import os
|
||||
import base64
|
||||
|
@ -1,4 +1,4 @@
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.mode_settings import ModeSettings
|
||||
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
import platform
|
||||
import datetime
|
||||
from onionshare_cli.settings import Settings
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
|
||||
from onionshare_cli.common import AutoStopTimer
|
||||
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.web import Web
|
||||
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import os
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from ... import strings
|
||||
from ...widgets import Alert, AddFileDialog
|
||||
|
@ -22,9 +22,11 @@ import time
|
||||
import subprocess
|
||||
import os
|
||||
from datetime import datetime
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
from urllib.parse import unquote
|
||||
|
||||
|
||||
from ... import strings
|
||||
from ...widgets import Alert
|
||||
from ...gui_common import GuiCommon
|
||||
@ -122,7 +124,7 @@ class ShareHistoryItem(HistoryItem):
|
||||
self.progress_bar.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|
||||
self.progress_bar.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.progress_bar.setMinimum(0)
|
||||
self.progress_bar.setMaximum(total_bytes / 1024)
|
||||
self.progress_bar.setMaximum(total_bytes // 1024)
|
||||
self.progress_bar.setValue(0)
|
||||
self.progress_bar.setStyleSheet(
|
||||
self.common.gui.css["downloads_uploads_progress_bar"]
|
||||
@ -141,7 +143,7 @@ class ShareHistoryItem(HistoryItem):
|
||||
def update(self, downloaded_bytes):
|
||||
self.downloaded_bytes = downloaded_bytes
|
||||
|
||||
self.progress_bar.setValue(downloaded_bytes / 1024)
|
||||
self.progress_bar.setValue(downloaded_bytes // 1024)
|
||||
if (downloaded_bytes / 1024) == (self.progress_bar.total_bytes / 1024):
|
||||
pb_fmt = strings._("gui_all_modes_progress_complete").format(
|
||||
self.common.format_seconds(time.time() - self.started)
|
||||
@ -393,8 +395,8 @@ class ReceiveHistoryItem(HistoryItem):
|
||||
total_uploaded_bytes += data["progress"][filename]["uploaded_bytes"]
|
||||
|
||||
# Update the progress bar
|
||||
self.progress_bar.setMaximum(self.content_length / 1024)
|
||||
self.progress_bar.setValue(total_uploaded_bytes / 1024)
|
||||
self.progress_bar.setMaximum(self.content_length // 1024)
|
||||
self.progress_bar.setValue(total_uploaded_bytes // 1024)
|
||||
|
||||
elapsed = datetime.now() - self.started
|
||||
if elapsed.seconds < 10:
|
||||
@ -529,7 +531,7 @@ class IndividualFileHistoryItem(HistoryItem):
|
||||
else:
|
||||
self.total_bytes = data["filesize"]
|
||||
self.progress_bar.setMinimum(0)
|
||||
self.progress_bar.setMaximum(data["filesize"] / 1024)
|
||||
self.progress_bar.setMaximum(data["filesize"] // 1024)
|
||||
self.progress_bar.total_bytes = data["filesize"]
|
||||
|
||||
# Start at 0
|
||||
@ -538,7 +540,7 @@ class IndividualFileHistoryItem(HistoryItem):
|
||||
def update(self, downloaded_bytes):
|
||||
self.downloaded_bytes = downloaded_bytes
|
||||
|
||||
self.progress_bar.setValue(downloaded_bytes / 1024)
|
||||
self.progress_bar.setValue(downloaded_bytes // 1024)
|
||||
if (downloaded_bytes / 1024) == (self.progress_bar.total_bytes / 1024):
|
||||
self.status_code_label.setText("200")
|
||||
self.status_code_label.setStyleSheet(
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
|
||||
from ... import strings
|
||||
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import os
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.web import Web
|
||||
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import os
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.common import Common
|
||||
from onionshare_cli.web import Web
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore
|
||||
from qtpy import QtCore
|
||||
|
||||
|
||||
class CompressThread(QtCore.QThread):
|
||||
|
@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.common import Common
|
||||
from onionshare_cli.web import Web
|
||||
|
@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import textwrap
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from PySide6.QtCore import Qt
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
from qtpy.QtCore import Qt
|
||||
|
||||
from .. import strings
|
||||
from ..widgets import Alert
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import queue
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.onionshare import OnionShare
|
||||
from onionshare_cli.web import Web
|
||||
@ -69,11 +69,11 @@ class NewTabButton(QtWidgets.QPushButton):
|
||||
self.title_label.setStyleSheet(self.common.gui.css["new_tab_title_text"])
|
||||
if self.title_label.sizeHint().width() >= 250:
|
||||
self.title_label.setGeometry(
|
||||
(self.width() - 250) / 2, self.height() - 120, 250, 60
|
||||
(self.width() - 250) // 2, self.height() - 120, 250, 60
|
||||
)
|
||||
else:
|
||||
self.title_label.setGeometry(
|
||||
(self.width() - 250) / 2, self.height() - 100, 250, 30
|
||||
(self.width() - 250) // 2, self.height() - 100, 250, 30
|
||||
)
|
||||
self.title_label.show()
|
||||
|
||||
@ -82,7 +82,7 @@ class NewTabButton(QtWidgets.QPushButton):
|
||||
self.text_label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.text_label.setStyleSheet(self.common.gui.css["new_tab_button_text"])
|
||||
self.text_label.setGeometry(
|
||||
(self.width() - 200) / 2, self.height() - 50, 200, 30
|
||||
(self.width() - 200) // 2, self.height() - 50, 200, 30
|
||||
)
|
||||
self.text_label.show()
|
||||
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
|
||||
from onionshare_cli.mode_settings import ModeSettings
|
||||
|
||||
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import time
|
||||
import json
|
||||
import os
|
||||
from PySide6 import QtCore
|
||||
from qtpy import QtCore
|
||||
|
||||
from onionshare_cli.onion import (
|
||||
TorErrorInvalidSetting,
|
||||
|
@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
import time
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
from qtpy import QtCore, QtWidgets
|
||||
|
||||
from onionshare_cli.onion import (
|
||||
BundledTorCanceled,
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
import sys
|
||||
import platform
|
||||
import os
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore
|
||||
from qtpy import QtCore
|
||||
import datetime
|
||||
import re
|
||||
import socks
|
||||
|
@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PySide6 import QtCore, QtWidgets, QtGui
|
||||
from qtpy import QtCore, QtWidgets, QtGui
|
||||
import qrcode
|
||||
|
||||
from . import strings
|
||||
|
@ -2,7 +2,7 @@ import sys
|
||||
import os
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from PySide6 import QtTest
|
||||
from qtpy import QtTest
|
||||
|
||||
|
||||
# Force tests to look for resources in the source code tree
|
||||
|
@ -7,7 +7,7 @@ import secrets
|
||||
import platform
|
||||
import sys
|
||||
|
||||
from PySide6 import QtCore, QtTest, QtWidgets
|
||||
from qtpy import QtCore, QtTest, QtWidgets
|
||||
|
||||
from onionshare_cli.common import Common
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import requests
|
||||
|
||||
from PySide6 import QtTest
|
||||
from qtpy import QtTest
|
||||
|
||||
from .gui_base_test import GuiBaseTest
|
||||
|
||||
|
@ -6,7 +6,7 @@ import shutil
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from PySide6 import QtCore, QtTest
|
||||
from qtpy import QtCore, QtTest
|
||||
|
||||
from .gui_base_test import GuiBaseTest
|
||||
|
||||
|
@ -3,7 +3,7 @@ import requests
|
||||
import tempfile
|
||||
import zipfile
|
||||
|
||||
from PySide6 import QtCore, QtTest
|
||||
from qtpy import QtCore, QtTest
|
||||
|
||||
from .gui_base_test import GuiBaseTest
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from PySide6 import QtCore, QtTest, QtWidgets
|
||||
from qtpy import QtCore, QtTest, QtWidgets
|
||||
|
||||
from .gui_base_test import GuiBaseTest
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import requests
|
||||
|
||||
from PySide6 import QtTest
|
||||
from qtpy import QtTest
|
||||
|
||||
from .gui_base_test import GuiBaseTest
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user