mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-11 16:58:11 +03:00
Unify Home and tray routing controls
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -1041,6 +1041,8 @@ class DeleteServersProgressDialog(AppQDialog):
|
||||
# Set invalid first
|
||||
AppSettings.set('ActivatedItemIndex', str(-1))
|
||||
|
||||
self.table.activeServerChanged.emit()
|
||||
|
||||
if APP().isSystemTrayConnected():
|
||||
if self.showTrayMessage:
|
||||
# Trigger disconnect
|
||||
@@ -1462,6 +1464,8 @@ class ServerTableView(
|
||||
):
|
||||
"""Represent user servers Qt table view."""
|
||||
|
||||
activeServerChanged = QtCore.Signal()
|
||||
|
||||
RowHeight = 42
|
||||
|
||||
Headers = [
|
||||
@@ -1953,6 +1957,7 @@ class ServerTableView(
|
||||
def activateItemByIndex(self, index, activate):
|
||||
"""Activate item by index."""
|
||||
oldIndex = Storage.UserActivatedItemIndex()
|
||||
changed = activate and oldIndex != int(index)
|
||||
|
||||
if activate:
|
||||
AppSettings.set('ActivatedItemIndex', str(index))
|
||||
@@ -1960,6 +1965,9 @@ class ServerTableView(
|
||||
self.sourceModel.emitRowChanged(oldIndex)
|
||||
self.sourceModel.emitRowChanged(index)
|
||||
|
||||
if changed:
|
||||
self.activeServerChanged.emit()
|
||||
|
||||
def flushItem(self, row: int, column: int, item: ServerProfile):
|
||||
"""Refresh item."""
|
||||
itemIndex = item.index
|
||||
@@ -2092,6 +2100,9 @@ class ServerTableView(
|
||||
|
||||
self.sourceModel.emitRowChanged(row)
|
||||
|
||||
if row == Storage.UserActivatedItemIndex():
|
||||
self.activeServerChanged.emit()
|
||||
|
||||
def flushAll(self):
|
||||
# Refresh index
|
||||
"""Refresh all."""
|
||||
@@ -2251,6 +2262,8 @@ class ServerTableView(
|
||||
# Set invalid first
|
||||
AppSettings.set('ActivatedItemIndex', str(-1))
|
||||
|
||||
self.activeServerChanged.emit()
|
||||
|
||||
if APP().isSystemTrayConnected():
|
||||
if showTrayMessage:
|
||||
# Trigger disconnect
|
||||
@@ -2574,6 +2587,8 @@ class ServerTableView(
|
||||
|
||||
AppSettings.set('ActivatedItemIndex', str(newActivatedIndex))
|
||||
|
||||
self.activeServerChanged.emit()
|
||||
|
||||
self.sourceModel.refreshIndexes()
|
||||
self.proxyModel.invalidate()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user