mirror of
https://github.com/aclist/dztui.git
synced 2026-11-11 12:30:37 +01:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52c126ff8c | ||
|
|
f76c400697 |
No files matched your search
@@ -46,6 +46,15 @@ class ConfigManager:
|
|||||||
ips.append(record)
|
ips.append(record)
|
||||||
self.update_config(Preferences.IP_LIST, ips)
|
self.update_config(Preferences.IP_LIST, ips)
|
||||||
|
|
||||||
|
def remove_from_history_file(self, fqip: str) -> None:
|
||||||
|
try:
|
||||||
|
history = self.prefs.paths.history
|
||||||
|
ips = [line.rstrip() for line in history.read_text().splitlines()]
|
||||||
|
ips.remove(fqip)
|
||||||
|
history.write_text("\n".join(ips))
|
||||||
|
except Exception as e:
|
||||||
|
logger.critical(e)
|
||||||
|
|
||||||
def update_history_file(self, fqip: str) -> None:
|
def update_history_file(self, fqip: str) -> None:
|
||||||
try:
|
try:
|
||||||
with open(self.prefs.paths.history, "r") as f:
|
with open(self.prefs.paths.history, "r") as f:
|
||||||
|
|||||||
@@ -285,6 +285,10 @@ class ServerModelManager:
|
|||||||
def remove_from_history(self, record: Servers.Record) -> None:
|
def remove_from_history(self, record: Servers.Record) -> None:
|
||||||
proxy_man = self._get_proxy_man()
|
proxy_man = self._get_proxy_man()
|
||||||
proxy_man.remove_row_from_control(record)
|
proxy_man.remove_row_from_control(record)
|
||||||
|
|
||||||
|
fqip = Servers.record_to_fqip(record)
|
||||||
|
config_man = self.controller.get_config_man()
|
||||||
|
config_man.remove_from_history_file(fqip)
|
||||||
self.update_history()
|
self.update_history()
|
||||||
|
|
||||||
@call_on_thread(dialog.querying)
|
@call_on_thread(dialog.querying)
|
||||||
|
|||||||
Reference in new issue
Block a user