Skip to content

Commit

Permalink
Support Batch Delete of sources: Provide pyqtSignal and Slot for tool…
Browse files Browse the repository at this point in the history
…bar to request and receive updated list of selected sources from sourcelist. Change list selection method of SourceList to allow for multi-select.

Add support for multi-source selection. Add multi-source view pane in the conversationview.

Add styled icon, adjust button and sourcelist selector color to match EmptyConversationView color.
  • Loading branch information
rocodes committed Oct 15, 2024
1 parent 67400fd commit b30b70f
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 124 deletions.
2 changes: 1 addition & 1 deletion client/securedrop_client/gui/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(
# but when triggered from this menu, only applies to one source
self._confirmation_dialog = confirmation_dialog(set([self.source]))
self._confirmation_dialog.accepted.connect(
lambda: self.controller.delete_source(self.source)
lambda: self.controller.delete_sources(set([self.source]))
)
self.triggered.connect(self.trigger)

Expand Down
17 changes: 10 additions & 7 deletions client/securedrop_client/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from securedrop_client.db import Source, User
from securedrop_client.gui.auth import LoginDialog
from securedrop_client.gui.shortcuts import Shortcuts
from securedrop_client.gui.widgets import BottomPane, InnerTopPane, LeftPane, MainView
from securedrop_client.gui.widgets import BottomPane, LeftPane, MainView
from securedrop_client.logic import Controller
from securedrop_client.resources import load_all_fonts, load_css, load_icon

Expand Down Expand Up @@ -63,11 +63,6 @@ def __init__(
self.setWindowTitle(_("SecureDrop Client {}").format(__version__))
self.setWindowIcon(load_icon(self.icon))

# Top Pane to hold batch actions, eventually will also hold
# search bar for keyword filtering. The Top Pane is not a top-level
# layout element, but instead is nested inside the central widget view.
self.top_pane = InnerTopPane()

# Bottom Pane to display activity and error messages
self.bottom_pane = BottomPane()

Expand All @@ -80,6 +75,7 @@ def __init__(
self.main_pane.setLayout(layout)
self.left_pane = LeftPane()
self.main_view = MainView(self.main_pane, app_state)

layout.addWidget(self.left_pane)
layout.addWidget(self.main_view)

Expand Down Expand Up @@ -109,10 +105,15 @@ def setup(self, controller: Controller) -> None:
views used in the UI.
"""
self.controller = controller
self.top_pane.setup(self.controller)
self.bottom_pane.setup(self.controller)
self.left_pane.setup(self, self.controller)
self.main_view.setup(self.controller)

# Listen for changes to the selected sources in sourcelist
self.main_view.source_list.selected_sources.connect(
self.controller.on_receive_selected_sources
)

self.show_login()

def show_main_window(self, db_user: User | None = None) -> None:
Expand Down Expand Up @@ -190,13 +191,15 @@ def set_logged_in_as(self, db_user: User) -> None:
"""
self.left_pane.set_logged_in_as(db_user)
self.bottom_pane.set_logged_in()
self.main_view.set_logged_in()

def logout(self) -> None:
"""
Update the UI to show the user is logged out.
"""
self.left_pane.set_logged_out()
self.bottom_pane.set_logged_out()
self.main_view.set_logged_out()

def update_sync_status(self, message: str, duration: int = 0) -> None:
"""
Expand Down
Loading

0 comments on commit b30b70f

Please sign in to comment.