mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
fix: disable topbar buttons when game is None
This commit is contained in:
parent
cd97526d2b
commit
a0d38f7465
@ -18,6 +18,7 @@ class QBudgetBox(QGroupBox):
|
|||||||
self.money_amount = QLabel()
|
self.money_amount = QLabel()
|
||||||
|
|
||||||
self.finances = QPushButton("Details")
|
self.finances = QPushButton("Details")
|
||||||
|
self.finances.setDisabled(True)
|
||||||
self.finances.setProperty("style", "btn-primary")
|
self.finances.setProperty("style", "btn-primary")
|
||||||
self.finances.clicked.connect(self.openFinances)
|
self.finances.clicked.connect(self.openFinances)
|
||||||
|
|
||||||
@ -38,6 +39,7 @@ class QBudgetBox(QGroupBox):
|
|||||||
def setGame(self, game):
|
def setGame(self, game):
|
||||||
self.game = game
|
self.game = game
|
||||||
self.setBudget(self.game.budget, self.game.budget_reward_amount)
|
self.setBudget(self.game.budget, self.game.budget_reward_amount)
|
||||||
|
self.finances.setEnabled(True)
|
||||||
|
|
||||||
def openFinances(self):
|
def openFinances(self):
|
||||||
self.subwindow = QFinancesMenu(self.game)
|
self.subwindow = QFinancesMenu(self.game)
|
||||||
|
|||||||
@ -60,11 +60,13 @@ class QTopPanel(QFrame):
|
|||||||
self.factionsInfos = QFactionsInfos(self.game)
|
self.factionsInfos = QFactionsInfos(self.game)
|
||||||
|
|
||||||
self.settings = QPushButton("Settings")
|
self.settings = QPushButton("Settings")
|
||||||
|
self.settings.setDisabled(True)
|
||||||
self.settings.setIcon(CONST.ICONS["Settings"])
|
self.settings.setIcon(CONST.ICONS["Settings"])
|
||||||
self.settings.setProperty("style", "btn-primary")
|
self.settings.setProperty("style", "btn-primary")
|
||||||
self.settings.clicked.connect(self.openSettings)
|
self.settings.clicked.connect(self.openSettings)
|
||||||
|
|
||||||
self.statistics = QPushButton("Statistics")
|
self.statistics = QPushButton("Statistics")
|
||||||
|
self.statistics.setDisabled(True)
|
||||||
self.statistics.setIcon(CONST.ICONS["Statistics"])
|
self.statistics.setIcon(CONST.ICONS["Statistics"])
|
||||||
self.statistics.setProperty("style", "btn-primary")
|
self.statistics.setProperty("style", "btn-primary")
|
||||||
self.statistics.clicked.connect(self.openStatisticsWindow)
|
self.statistics.clicked.connect(self.openStatisticsWindow)
|
||||||
@ -100,6 +102,9 @@ class QTopPanel(QFrame):
|
|||||||
if game is None:
|
if game is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.settings.setEnabled(True)
|
||||||
|
self.statistics.setEnabled(True)
|
||||||
|
|
||||||
self.conditionsWidget.setCurrentTurn(game.turn, game.conditions)
|
self.conditionsWidget.setCurrentTurn(game.turn, game.conditions)
|
||||||
self.budgetBox.setGame(game)
|
self.budgetBox.setGame(game)
|
||||||
self.factionsInfos.setGame(game)
|
self.factionsInfos.setGame(game)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user