From a76a27efca2134bae8713a3e60431f9171ccd565 Mon Sep 17 00:00:00 2001 From: Allie Crevier <4522213+creviera@users.noreply.github.com> Date: Tue, 26 Feb 2019 23:54:55 -0800 Subject: [PATCH] QTBUG-69204 workaround --- securedrop_client/app.py | 6 ++++-- securedrop_client/gui/widgets.py | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/securedrop_client/app.py b/securedrop_client/app.py index cb312a2541..bffd0217c0 100644 --- a/securedrop_client/app.py +++ b/securedrop_client/app.py @@ -30,7 +30,7 @@ from securedrop_client import __version__ from securedrop_client.logic import Client from securedrop_client.gui.main import Window -from securedrop_client.resources import load_icon, load_css +from securedrop_client.resources import load_icon from securedrop_client.db import make_engine from securedrop_client.utils import safe_mkdir @@ -162,7 +162,9 @@ def start_app(args, qt_args) -> None: gui = Window(args.sdc_home) app.setWindowIcon(load_icon(gui.icon)) - app.setStyleSheet(load_css('sdclient.css')) + # Revert once https://bugreports.qt.io/browse/QTBUG-69204 is fixed + # See https://github.com/freedomofpress/securedrop-client/issues/273 + # app.setStyleSheet(load_css('sdclient.css')) engine = make_engine(args.sdc_home) Session = sessionmaker(bind=engine) diff --git a/securedrop_client/gui/widgets.py b/securedrop_client/gui/widgets.py index 56833dbb4c..4ec8ddf891 100644 --- a/securedrop_client/gui/widgets.py +++ b/securedrop_client/gui/widgets.py @@ -172,10 +172,10 @@ def set_conversation(self, widget): old_widget = self.view_layout.takeAt(0) if old_widget: - old_widget.widget().setVisible(False) + old_widget.widget().hide() self.view_layout.addWidget(widget) - widget.setVisible(True) + widget.show() class SourceList(QListWidget): @@ -407,6 +407,7 @@ def setup(self, controller): self.error_label = QLabel('') self.error_label.setObjectName('error_label') + self.error_label.setStyleSheet('color: red') layout.addStretch() layout.addWidget(self.title) @@ -695,7 +696,6 @@ def __init__(self, source_db_object: Source, sdc_home: str, controller: Client, main_layout = QVBoxLayout() main_layout.addWidget(self.scroll) self.setLayout(main_layout) - self.update_conversation(self.source.collection) def clear_conversation(self): @@ -771,7 +771,7 @@ def add_reply(self, message_id: str, reply: str, files=None) -> None: class SourceConversationWrapper(QWidget): """ Wrapper for a source's conversation including the chat window, profile tab, and other - per-soruce resources. + per-source resources. """ def __init__(