Skip to content

Commit

Permalink
add confirm dialog to bootlogo manager
Browse files Browse the repository at this point in the history
  • Loading branch information
DYefremov committed Aug 15, 2024
1 parent fda9780 commit 5c3532d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/ui/bootlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@
from ftplib import all_errors
from pathlib import Path

from gi.repository import GObject

from app.commons import log, run_task
from app.connections import UtfFTP
from app.settings import IS_DARWIN
from app.ui.dialogs import translate, get_chooser_dialog
from app.ui.dialogs import translate, get_chooser_dialog, show_dialog, DialogType
from app.ui.main_helper import get_picon_pixbuf, redraw_image
from app.ui.uicommons import HeaderBar
from .uicommons import Gtk, GLib
Expand Down Expand Up @@ -205,6 +203,9 @@ def on_receive(self, button):
self.download_data(self._file_combo_box.get_active_id())

def on_transmit(self, button):
if show_dialog(DialogType.QUESTION, self) != Gtk.ResponseType.OK:
return True

mvi_file = Path(self._img_path).parent.joinpath(self._file_combo_box.get_active_id())
if not mvi_file.is_file():
log(self._app.show_error_message(translate("No *.mvi file found for the selected image!")))
Expand Down Expand Up @@ -289,6 +290,7 @@ def download_data(self, f_name):
log(f"{self.__class__.__name__} [download error] {e}")
GLib.idle_add(self._app.show_error_message, f"{translate('Failed to download data:')} {e}")

@run_task
def transfer_data(self, f_path):
try:
settings = self._app.app_settings
Expand Down

0 comments on commit 5c3532d

Please sign in to comment.