From 8e32373a9910082bb4d4206a8d08f87f22636a73 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Tue, 27 Mar 2018 23:03:01 +0300 Subject: [PATCH] picon name update after service edit --- app/ui/download_dialog.py | 2 +- app/ui/service_details_dialog.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/ui/download_dialog.py b/app/ui/download_dialog.py index c3481d45..49c1d942 100644 --- a/app/ui/download_dialog.py +++ b/app/ui/download_dialog.py @@ -77,7 +77,7 @@ class DownloadDialog: if download: download_data(properties=self._properties, download_type=d_type) else: - self.show_info_message("Please, wait...", Gtk.MessageType.INFO) + self.show_info_message(get_message("Please, wait..."), Gtk.MessageType.INFO) upload_data(properties=self._properties, download_type=d_type, remove_unused=self._remove_unused_check_button.get_active(), diff --git a/app/ui/service_details_dialog.py b/app/ui/service_details_dialog.py index c2fa1997..5b97cc85 100644 --- a/app/ui/service_details_dialog.py +++ b/app/ui/service_details_dialog.py @@ -1,5 +1,7 @@ import re +import os + from app.commons import run_idle from app.eparser import Service, get_satellites from app.eparser.ecommons import MODULATION, Inversion, ROLL_OFF, Pilot, Flag, Pids, POLARIZATION, \ @@ -348,9 +350,12 @@ class ServiceDetailsDialog: bq[i] = fav_id def update_picon_name(self, old_name, new_name): - pass - # for file in os.listdir(self._picons_dir_path): - # os.rename(old_name, file.replace(old_name, new_name)) + for file_name in os.listdir(self._picons_dir_path): + if file_name == old_name: + old_file = os.path.join(self._picons_dir_path, old_name) + new_file = os.path.join(self._picons_dir_path, new_name) + os.rename(old_file, new_file) + break def on_new(self): service = self.get_service(*self.get_srv_data(), self.get_transponder_data())