Add custom name for packages in ATO overview

Resolves #55
This commit is contained in:
Raffson
2023-01-02 02:26:00 +01:00
parent f4d75a2c6f
commit 2aed461b3a
4 changed files with 32 additions and 2 deletions

View File

@@ -277,7 +277,10 @@ class PackageDelegate(TwoColumnRowDelegate):
def text_for(self, index: QModelIndex, row: int, column: int) -> str:
package = self.package(index)
if (row, column) == (0, 0):
return f"{package.package_description} {package.target.name}"
string = f"{package.package_description} {package.target.name}"
if package.custom_name:
string = string + f" ({package.custom_name})"
return string
elif (row, column) == (0, 1):
clients = self.num_clients(index)
return f"Player Slots: {clients}" if clients else ""