diff options
author | Micah Lee <micah@micahflee.com> | 2019-10-13 14:35:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-13 14:35:40 -0400 |
commit | 896659c6963c14c4e047cff7f3d421977060ed23 (patch) | |
tree | 660468dd7478fb001ced211a4a33ae28a1b5f9a4 /onionshare_gui/widgets.py | |
parent | bbf6c02da645fcd4fc50db18dd341178ad4fa2e6 (diff) | |
parent | 7d24bf9ffcd1e21e087431c21bfc658803a61ab6 (diff) | |
download | onionshare-2.2.tar.gz onionshare-2.2.zip |
Merge pull request #1048 from micahflee/developv2.2
Version 2.2
Diffstat (limited to 'onionshare_gui/widgets.py')
-rw-r--r-- | onionshare_gui/widgets.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/onionshare_gui/widgets.py b/onionshare_gui/widgets.py index 600165aa..d16485fe 100644 --- a/onionshare_gui/widgets.py +++ b/onionshare_gui/widgets.py @@ -19,19 +19,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ from PyQt5 import QtCore, QtWidgets, QtGui + class Alert(QtWidgets.QMessageBox): """ An alert box dialog. """ - def __init__(self, common, message, icon=QtWidgets.QMessageBox.NoIcon, buttons=QtWidgets.QMessageBox.Ok, autostart=True): + + def __init__( + self, + common, + message, + icon=QtWidgets.QMessageBox.NoIcon, + buttons=QtWidgets.QMessageBox.Ok, + autostart=True, + ): super(Alert, self).__init__(None) self.common = common - self.common.log('Alert', '__init__') + self.common.log("Alert", "__init__") self.setWindowTitle("OnionShare") - self.setWindowIcon(QtGui.QIcon(self.common.get_resource_path('images/logo.png'))) + self.setWindowIcon( + QtGui.QIcon(self.common.get_resource_path("images/logo.png")) + ) self.setText(message) self.setIcon(icon) self.setStandardButtons(buttons) @@ -49,11 +60,12 @@ class AddFileDialog(QtWidgets.QFileDialog): This is because the macOS sandbox requires native dialogs, and this is a Qt5 dialog. """ + def __init__(self, common, *args, **kwargs): QtWidgets.QFileDialog.__init__(self, *args, **kwargs) self.common = common - self.common.log('AddFileDialog', '__init__') + self.common.log("AddFileDialog", "__init__") self.setOption(self.DontUseNativeDialog, True) self.setOption(self.ReadOnly, True) @@ -65,5 +77,5 @@ class AddFileDialog(QtWidgets.QFileDialog): list_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) def accept(self): - self.common.log('AddFileDialog', 'accept') + self.common.log("AddFileDialog", "accept") QtWidgets.QDialog.accept(self) |