mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 07:02:50 +01:00
fix: no statusbar in special pages
This commit is contained in:
1 parent
ff0c5caf30
commit
12d971a5cf
1 file changed
+14
-11
+14
-11
@@ -665,6 +665,10 @@ def pluralize(plural: str, count: int) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def format_metadata(row_sel: str) -> str:
|
def format_metadata(row_sel: str) -> str:
|
||||||
|
"""
|
||||||
|
Currently only being used for legacy
|
||||||
|
favorite server tooltip, cf Statusbar.update_app_meta()
|
||||||
|
"""
|
||||||
row = None
|
row = None
|
||||||
for i in RowType:
|
for i in RowType:
|
||||||
if i.dict["label"] == row_sel:
|
if i.dict["label"] == row_sel:
|
||||||
@@ -956,7 +960,6 @@ def process_toggle(command: RowType) -> None:
|
|||||||
case RowType.TGL_INSTALL:
|
case RowType.TGL_INSTALL:
|
||||||
if query_config("auto_install")[0] == "1":
|
if query_config("auto_install")[0] == "1":
|
||||||
proc = call_out("toggle", cmd_string)
|
proc = call_out("toggle", cmd_string)
|
||||||
App.grid.statusbar.refresh()
|
|
||||||
return
|
return
|
||||||
# manual -> auto mode
|
# manual -> auto mode
|
||||||
proc = call_out("find_id", "")
|
proc = call_out("find_id", "")
|
||||||
@@ -969,7 +972,6 @@ def process_toggle(command: RowType) -> None:
|
|||||||
LinkDialog(manual_sub_msg, link, command, user_id)
|
LinkDialog(manual_sub_msg, link, command, user_id)
|
||||||
case _:
|
case _:
|
||||||
proc = call_out("toggle", cmd_string)
|
proc = call_out("toggle", cmd_string)
|
||||||
App.grid.statusbar.refresh()
|
|
||||||
|
|
||||||
|
|
||||||
def process_user_input(enum: RowType) -> None:
|
def process_user_input(enum: RowType) -> None:
|
||||||
@@ -3537,7 +3539,15 @@ class Statusbar(Gtk.Statusbar):
|
|||||||
self.push(meta, string)
|
self.push(meta, string)
|
||||||
|
|
||||||
def refresh(self) -> None:
|
def refresh(self) -> None:
|
||||||
self.update_app_meta()
|
unsupported_contexts = [
|
||||||
|
RowType.KEYBINDINGS,
|
||||||
|
RowType.SHOW_LOG,
|
||||||
|
RowType.CHANGELOG,
|
||||||
|
RowType.OPTIONS,
|
||||||
|
]
|
||||||
|
if App.treeview.subpage in unsupported_contexts:
|
||||||
|
self.set_text("")
|
||||||
|
return
|
||||||
command = App.treeview.get_value_at_index(0)
|
command = App.treeview.get_value_at_index(0)
|
||||||
formatted = format_metadata(command)
|
formatted = format_metadata(command)
|
||||||
if len(formatted) > 0:
|
if len(formatted) > 0:
|
||||||
@@ -3578,14 +3588,7 @@ class Statusbar(Gtk.Statusbar):
|
|||||||
config_vals.clear()
|
config_vals.clear()
|
||||||
for i in query_config():
|
for i in query_config():
|
||||||
config_vals.append(i)
|
config_vals.append(i)
|
||||||
_branch = config_vals[0]
|
concat_label = f"{_VERSION}"
|
||||||
_branch = _branch.upper()
|
|
||||||
_debug = config_vals[1]
|
|
||||||
if _debug == "":
|
|
||||||
_debug = "NORMAL"
|
|
||||||
else:
|
|
||||||
_debug = "DEBUG"
|
|
||||||
concat_label = f"{_branch} | {_debug} | {_VERSION}"
|
|
||||||
self.status_right_label.set_text(concat_label)
|
self.status_right_label.set_text(concat_label)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user