Skip to content

Commit

Permalink
Improve delete_sources tooltip message.
Browse files Browse the repository at this point in the history
Decrease font size in ConversationPane instructions.

Clean up test comments.
  • Loading branch information
rocodes committed Oct 24, 2024
1 parent d71951f commit b2f9ca3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
6 changes: 4 additions & 2 deletions client/securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,15 @@ def __init__(self) -> None:
self.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)

# TODO: set keyboard shortcut?
self.delete_sources_action = QAction(
QIcon(load_image("delete_sources_toolbar_icon.svg")), _("DELETE SOURCES"), self
)
self.delete_sources_action.setObjectName("BatchActionButton")
self.delete_sources_action.setToolTip(
_("Delete selected source accounts. Ctrl+click to select multiple sources.")
_(
"Delete selected source accounts. "
"Ctrl+click sources below to select multiple sources."
)
)
self.delete_sources_action.triggered.connect(self.on_action_triggered)
self.button = self.widgetForAction(self.delete_sources_action)
Expand Down
2 changes: 1 addition & 1 deletion client/securedrop_client/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ msgstr ""
msgid "DELETE SOURCES"
msgstr ""

msgid "Delete selected source accounts. Ctrl+click to select multiple sources."
msgid "Delete selected source accounts. Ctrl+click sources below to select multiple sources."
msgstr ""

msgid "{}"
Expand Down
3 changes: 3 additions & 0 deletions client/securedrop_client/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ def login_offline_mode(self) -> None:
# may have attempted online mode login, then switched to offline)
self.gui.clear_clipboard()
self.gui.show_main_window()

# All child elements of main window should show logged_out state
self.gui.logout()
self.update_sources()

def on_action_requiring_login(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions client/securedrop_client/resources/css/sdclient.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ QWidget {
#EmptyConversationView QLabel {
font-family: Montserrat;
font-weight: 400;
font-size: 35px;
font-size: 30px;
color: #a5b3e9;
}

Expand All @@ -180,7 +180,7 @@ QWidget {

#EmptyConversationView QLabel#EmptyConversationView_bullet {
margin: 4px 0px 0px 0px;
font-size: 35px;
font-size: 30px;
font-weight: 600;
}

Expand Down
8 changes: 0 additions & 8 deletions client/tests/gui/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,9 @@ def test_MainView_show_sources_with_none_selected(mocker):
source_item = SourceListWidgetItem(mv.source_list)
mv.source_list.setItemWidget(source_item, source_widget)
mv.source_list.source_items["stub_uuid"] = source_item
# mocker.patch.object(mv.source_list, "update_sources")

mv.show_sources([factory.Source(), factory.Source(), factory.Source()])

# mv.source_list.update_sources.assert_called_once_with([1, 2, 3])
assert mv.view_layout.currentIndex() == mv.NOTHING_SELECTED_INDEX


Expand Down Expand Up @@ -647,9 +645,6 @@ def test_MainView_on_source_changed(mocker):
mv.source_list.count = mocker.MagicMock(return_value=3)
mv.controller = mocker.MagicMock(is_authenticated=True)
mocker.patch("securedrop_client.gui.widgets.source_exists", return_value=True)
# scw = SourceConversationWrapper(source, mv.controller)
# mocker.patch("securedrop_client.gui.widgets.SourceConversationWrapper", return_value=scw)
# TODO
mv.on_source_changed()

mv.source_list.get_selected_source.assert_called_once_with()
Expand Down Expand Up @@ -769,9 +764,6 @@ def test_MainView_on_source_changed_updates_conversation_view(mocker, session):
session.add(reply)
session.commit()
source_selected = mocker.patch("securedrop_client.gui.widgets.SourceList.source_selected")
# mocker.patch(
# "securedrop_client.gui.widgets.SourceList.get_selected_source", return_value=source
# )
add_message_fn = mocker.patch(
"securedrop_client.gui.widgets.ConversationView.add_message", new=mocker.Mock()
)
Expand Down

0 comments on commit b2f9ca3

Please sign in to comment.