show is_over in warsTree & fator resources paths
This commit is contained in:
parent
a9cd4c9e27
commit
e14f272a48
28 changed files with 750 additions and 595 deletions
|
|
@ -1,12 +1,79 @@
|
|||
from enum import StrEnum
|
||||
from enum import Enum, auto
|
||||
from pathlib import Path
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
from PyQt6.QtGui import QIcon
|
||||
|
||||
|
||||
# Paths
|
||||
PACKAGE_ROOT = Path(__file__).resolve().parent
|
||||
VIEW_ROOT = PACKAGE_ROOT / "view"
|
||||
RESOURCES_DIR = VIEW_ROOT / "resources"
|
||||
|
||||
ROLE_TYPE = Qt.ItemDataRole.UserRole
|
||||
ROLE_ID = Qt.ItemDataRole.UserRole + 1
|
||||
|
||||
|
||||
class IconName(str, Enum):
|
||||
UNDO = ("undo",)
|
||||
REDO = ("redo",)
|
||||
PAIRING = ("pairing",)
|
||||
DRAW = ("draw",)
|
||||
DELETE = ("delete",)
|
||||
SAVE_AS = ("save_as",)
|
||||
SAVE = ("save",)
|
||||
NEW = ("new",)
|
||||
EXIT = ("exit",)
|
||||
END = ("end",)
|
||||
OPEN = ("load",)
|
||||
ONGOING = ("ongoing",)
|
||||
EXPORT = ("export",)
|
||||
EDIT = ("edit",)
|
||||
ADD = ("add",)
|
||||
ABOUT = ("about",)
|
||||
WARS = ("wars",)
|
||||
DONE = ("done",)
|
||||
WIN = ("win",)
|
||||
PLAYERS = ("players",)
|
||||
WARCHRON = "warchron"
|
||||
|
||||
|
||||
class Icons:
|
||||
_cache: dict[str, QIcon] = {}
|
||||
|
||||
_paths = {
|
||||
IconName.UNDO: "arrow-curve-180-left",
|
||||
IconName.REDO: "arrow-curve",
|
||||
IconName.PAIRING: "arrow-switch",
|
||||
IconName.DRAW: "balance.png",
|
||||
IconName.DELETE: "cross.png",
|
||||
IconName.SAVE_AS: "disk--pencil.png",
|
||||
IconName.SAVE: "disk.png",
|
||||
IconName.NEW: "document.png",
|
||||
IconName.EXIT: "door--arrow.png",
|
||||
IconName.END: "flag-white.png",
|
||||
IconName.OPEN: "folder.png",
|
||||
IconName.ONGOING: "hourglass.png",
|
||||
IconName.EXPORT: "notebook--arrow.png",
|
||||
IconName.EDIT: "pencil.png",
|
||||
IconName.ADD: "plus.png",
|
||||
IconName.ABOUT: "question.png",
|
||||
IconName.WARS: "swords-small.png",
|
||||
IconName.DONE: "tick.png",
|
||||
IconName.WIN: "trophy.png",
|
||||
IconName.PLAYERS: "users.png",
|
||||
IconName.WARCHRON: "warchron_logo.png",
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def get(cls, name: IconName) -> QIcon:
|
||||
if name not in cls._cache:
|
||||
path = RESOURCES_DIR / cls._paths[name]
|
||||
cls._cache[name] = QIcon(str(path))
|
||||
return cls._cache[name]
|
||||
|
||||
|
||||
class ItemType(StrEnum):
|
||||
PLAYER = "player"
|
||||
WAR = "war"
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ class CampaignController:
|
|||
return
|
||||
self.app.is_dirty = True
|
||||
self.app.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
self.app.navigation.refresh(RefreshScope.WARS_TREE)
|
||||
|
||||
# Campaign participant methods
|
||||
|
||||
|
|
@ -199,7 +200,8 @@ class CampaignController:
|
|||
camp = self.app.model.get_campaign(self.app.navigation.selected_campaign_id)
|
||||
rounds = camp.get_all_rounds()
|
||||
rnd_objs: List[RoundDTO] = [
|
||||
RoundDTO(id=rnd.id, index=camp.get_round_index(rnd.id)) for rnd in rounds
|
||||
RoundDTO(id=rnd.id, index=camp.get_round_index(rnd.id), is_over=rnd.is_over)
|
||||
for rnd in rounds
|
||||
]
|
||||
objectives = war.get_all_objectives()
|
||||
obj_dtos: List[ObjectiveDTO] = [
|
||||
|
|
@ -241,7 +243,8 @@ class CampaignController:
|
|||
war = self.app.model.get_war_by_campaign(camp.id)
|
||||
rounds = camp.get_all_rounds()
|
||||
rnd_dto: List[RoundDTO] = [
|
||||
RoundDTO(id=rnd.id, index=i) for i, rnd in enumerate(rounds, start=1)
|
||||
RoundDTO(id=rnd.id, index=i, is_over=rnd.is_over)
|
||||
for i, rnd in enumerate(rounds, start=1)
|
||||
]
|
||||
objectives = war.get_all_objectives()
|
||||
obj_dto: List[ObjectiveDTO] = [
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
from typing import List
|
||||
from dataclasses import dataclass
|
||||
|
||||
from PyQt6.QtGui import QIcon
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ParticipantOption:
|
||||
|
|
@ -19,6 +21,7 @@ class WarDTO:
|
|||
id: str
|
||||
name: str
|
||||
year: int
|
||||
is_over: bool
|
||||
_campaigns: List["CampaignDTO"] | None = None
|
||||
|
||||
def get_all_campaigns(self) -> List["CampaignDTO"]:
|
||||
|
|
@ -44,6 +47,7 @@ class CampaignDTO:
|
|||
id: str
|
||||
name: str
|
||||
month: int
|
||||
is_over: bool
|
||||
_rounds: List["RoundDTO"] | None = None
|
||||
|
||||
def get_all_rounds(self) -> List["RoundDTO"]:
|
||||
|
|
@ -74,6 +78,7 @@ class SectorDTO:
|
|||
class RoundDTO:
|
||||
id: str
|
||||
index: int | None
|
||||
is_over: bool
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
|
|
@ -95,6 +100,6 @@ class BattleDTO:
|
|||
score: str | None
|
||||
victory_condition: str | None
|
||||
comment: str | None
|
||||
state_icon: str | None
|
||||
player1_icon: str | None
|
||||
player2_icon: str | None
|
||||
state_icon: QIcon | None
|
||||
player1_icon: QIcon | None
|
||||
player2_icon: QIcon | None
|
||||
|
|
|
|||
|
|
@ -36,13 +36,19 @@ class NavigationController:
|
|||
id=w.id,
|
||||
name=w.name,
|
||||
year=w.year,
|
||||
is_over=w.is_over,
|
||||
_campaigns=[
|
||||
CampaignDTO(
|
||||
id=c.id,
|
||||
name=c.name,
|
||||
month=c.month,
|
||||
is_over=c.is_over,
|
||||
_rounds=[
|
||||
RoundDTO(id=r.id, index=c.get_round_index(r.id))
|
||||
RoundDTO(
|
||||
id=r.id,
|
||||
index=c.get_round_index(r.id),
|
||||
is_over=r.is_over,
|
||||
)
|
||||
for r in c.get_all_rounds()
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from typing import List, TYPE_CHECKING
|
|||
|
||||
from PyQt6.QtWidgets import QDialog, QMessageBox
|
||||
|
||||
from warchron.constants import ItemType, RefreshScope
|
||||
from warchron.constants import ItemType, RefreshScope, Icons, IconName
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from warchron.controller.app_controller import AppController
|
||||
|
|
@ -59,9 +59,9 @@ class RoundController:
|
|||
battle = self.app.model.create_battle(
|
||||
round_id=rnd.id, sector_id=sect.id
|
||||
)
|
||||
state_icon = ".\\src\\warchron\\view\\ui\\../resources/hourglass.png"
|
||||
state_icon = Icons.get(IconName.ONGOING)
|
||||
if battle.is_finished():
|
||||
state_icon = ".\\src\\warchron\\view\\ui\\../resources/tick.png"
|
||||
state_icon = Icons.get(IconName.DONE)
|
||||
if battle.player_1_id:
|
||||
camp_part = camp.participants[battle.player_1_id]
|
||||
player_1_name = self.app.model.get_participant_name(
|
||||
|
|
@ -86,13 +86,13 @@ class RoundController:
|
|||
p1_icon = None
|
||||
p2_icon = None
|
||||
if battle.is_draw():
|
||||
p1_icon = ".\\src\\warchron\\view\\ui\\../resources/balance.png"
|
||||
p2_icon = ".\\src\\warchron\\view\\ui\\../resources/balance.png"
|
||||
p1_icon = Icons.get(IconName.DRAW)
|
||||
p2_icon = Icons.get(IconName.DRAW)
|
||||
elif battle.winner_id:
|
||||
if battle.winner_id == battle.player_1_id:
|
||||
p1_icon = ".\\src\\warchron\\view\\ui\\../resources/trophy.png"
|
||||
p1_icon = Icons.get(IconName.WIN)
|
||||
elif battle.winner_id == battle.player_2_id:
|
||||
p2_icon = ".\\src\\warchron\\view\\ui\\../resources/trophy.png"
|
||||
p2_icon = Icons.get(IconName.WIN)
|
||||
battles_for_display.append(
|
||||
BattleDTO(
|
||||
id=battle.sector_id,
|
||||
|
|
@ -141,6 +141,7 @@ class RoundController:
|
|||
return
|
||||
self.app.is_dirty = True
|
||||
self.app.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
self.app.navigation.refresh(RefreshScope.WARS_TREE)
|
||||
|
||||
# Choice methods
|
||||
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ class WarController:
|
|||
return
|
||||
self.app.is_dirty = True
|
||||
self.app.navigation.refresh(RefreshScope.CURRENT_SELECTION_DETAILS)
|
||||
self.app.navigation.refresh(RefreshScope.WARS_TREE)
|
||||
|
||||
def set_major_value(self, value: int) -> None:
|
||||
war_id = self.app.navigation.selected_war_id
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from typing import cast, List
|
|||
|
||||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.controller.dtos import ParticipantOption, SectorDTO
|
||||
from warchron.view.helpers import select_if_exists
|
||||
from warchron.view.ui.ui_battle_dialog import Ui_battleDialog
|
||||
|
|
@ -45,6 +46,7 @@ class BattleDialog(QDialog):
|
|||
self.ui.score.setText(default_score)
|
||||
self.ui.victoryCondition.setText(default_victory_condition)
|
||||
self.ui.battleComment.setPlainText(default_comment)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_sector_id(self) -> str:
|
||||
return cast(str, self.ui.sectorComboBox.currentData())
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from PyQt6.QtWidgets import QDialog
|
||||
from PyQt6.QtWidgets import QDialog, QWidget
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.view.ui.ui_campaign_dialog import Ui_campaignDialog
|
||||
from PyQt6.QtWidgets import QWidget
|
||||
|
||||
|
||||
class CampaignDialog(QDialog):
|
||||
|
|
@ -17,6 +17,7 @@ class CampaignDialog(QDialog):
|
|||
self.ui.campaignName.setText(default_name)
|
||||
if default_month is not None:
|
||||
self.ui.campaignMonth.setValue(default_month)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_campaign_name(self) -> str:
|
||||
return self.ui.campaignName.text().strip()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from typing import cast, List
|
|||
|
||||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.controller.dtos import ParticipantOption
|
||||
from warchron.view.helpers import select_if_exists
|
||||
from warchron.view.ui.ui_campaign_participant_dialog import (
|
||||
|
|
@ -29,6 +30,7 @@ class CampaignParticipantDialog(QDialog):
|
|||
self.ui.playerComboBox.setEnabled(editable_player)
|
||||
self.ui.leader.setText(default_leader)
|
||||
self.ui.theme.setText(default_theme)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_player_id(self) -> str:
|
||||
return cast(str, self.ui.playerComboBox.currentData())
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from typing import cast, List
|
|||
|
||||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.controller.dtos import ParticipantOption, SectorDTO
|
||||
from warchron.view.helpers import select_if_exists
|
||||
from warchron.view.ui.ui_choice_dialog import Ui_choiceDialog
|
||||
|
|
@ -34,6 +35,7 @@ class ChoiceDialog(QDialog):
|
|||
select_if_exists(self.ui.priorityComboBox, default_priority_id)
|
||||
select_if_exists(self.ui.secondaryComboBox, default_secondary_id)
|
||||
self.ui.choiceComment.setPlainText(default_comment)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_participant_id(self) -> str:
|
||||
return cast(str, self.ui.playerComboBox.currentData())
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.view.ui.ui_objective_dialog import Ui_objectiveDialog
|
||||
|
||||
|
||||
|
|
@ -16,6 +17,7 @@ class ObjectiveDialog(QDialog):
|
|||
self.ui.setupUi(self) # type: ignore
|
||||
self.ui.objectiveName.setText(default_name)
|
||||
self.ui.objectiveDescription.setPlainText(default_description)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_objective_name(self) -> str:
|
||||
return self.ui.objectiveName.text().strip()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.view.ui.ui_player_dialog import Ui_playerDialog
|
||||
|
||||
|
||||
|
|
@ -11,6 +12,7 @@ class PlayerDialog(QDialog):
|
|||
self.ui: Ui_playerDialog = Ui_playerDialog()
|
||||
self.ui.setupUi(self) # type: ignore
|
||||
self.ui.playerName.setText(default_name)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_player_name(self) -> str:
|
||||
return self.ui.playerName.text().strip()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from typing import cast, List
|
|||
|
||||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.controller.dtos import ObjectiveDTO, RoundDTO
|
||||
from warchron.view.helpers import select_if_exists, format_round_label
|
||||
from warchron.view.ui.ui_sector_dialog import Ui_sectorDialog
|
||||
|
|
@ -42,6 +43,7 @@ class SectorDialog(QDialog):
|
|||
select_if_exists(self.ui.influenceComboBox, default_influence_id)
|
||||
self.ui.sectorMission.setText(default_mission)
|
||||
self.ui.sectorDescription.setPlainText(default_description)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_sector_name(self) -> str:
|
||||
return self.ui.sectorName.text().strip()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_battle_result_dialog.ui'
|
||||
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_battle_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.7.1
|
||||
#
|
||||
|
|
@ -9,136 +9,126 @@
|
|||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_battleDialog(object):
|
||||
class Ui_battleResultDialog(object):
|
||||
def setupUi(self, battleResultDialog):
|
||||
battleResultDialog.setObjectName("battleResultDialog")
|
||||
battleResultDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||
battleResultDialog.resize(668, 317)
|
||||
battleResultDialog.resize(771, 315)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(
|
||||
QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"),
|
||||
QtGui.QIcon.Mode.Normal,
|
||||
QtGui.QIcon.State.Off,
|
||||
)
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
battleResultDialog.setWindowIcon(icon)
|
||||
self.gridLayout = QtWidgets.QGridLayout(battleResultDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(battleResultDialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label_7 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout.addWidget(self.label_7, 0, 0, 1, 1)
|
||||
self.horizontalLayout.addWidget(self.label_7)
|
||||
self.sectorComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.sectorComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.sectorComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.sectorComboBox.setSizePolicy(sizePolicy)
|
||||
self.sectorComboBox.setObjectName("sectorComboBox")
|
||||
self.gridLayout.addWidget(self.sectorComboBox, 0, 1, 1, 1)
|
||||
self.horizontalLayout.addWidget(self.sectorComboBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.label_5 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout.addWidget(self.label_5, 0, 2, 1, 1)
|
||||
self.horizontalLayout.addWidget(self.label_5)
|
||||
self.player1ComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.player1ComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.player1ComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.player1ComboBox.setSizePolicy(sizePolicy)
|
||||
self.player1ComboBox.setObjectName("player1ComboBox")
|
||||
self.gridLayout.addWidget(self.player1ComboBox, 0, 3, 1, 1)
|
||||
self.horizontalLayout.addWidget(self.player1ComboBox)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem1)
|
||||
self.label_6 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout.addWidget(self.label_6, 0, 4, 1, 1)
|
||||
self.horizontalLayout.addWidget(self.label_6)
|
||||
self.player2ComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.player2ComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.player2ComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.player2ComboBox.setSizePolicy(sizePolicy)
|
||||
self.player2ComboBox.setObjectName("player2ComboBox")
|
||||
self.gridLayout.addWidget(self.player2ComboBox, 0, 5, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.gridLayout.addItem(spacerItem, 1, 1, 1, 1)
|
||||
self.horizontalLayout.addWidget(self.player2ComboBox)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem2)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem3)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 2, 0, 1, 1)
|
||||
self.horizontalLayout_2.addWidget(self.label)
|
||||
self.winnerComboBox = QtWidgets.QComboBox(parent=battleResultDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.winnerComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.winnerComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.winnerComboBox.setSizePolicy(sizePolicy)
|
||||
self.winnerComboBox.setObjectName("winnerComboBox")
|
||||
self.gridLayout.addWidget(self.winnerComboBox, 2, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 3, 0, 1, 1)
|
||||
self.score = QtWidgets.QLineEdit(parent=battleResultDialog)
|
||||
self.score.setObjectName("score")
|
||||
self.gridLayout.addWidget(self.score, 3, 1, 1, 2)
|
||||
self.horizontalLayout_2.addWidget(self.winnerComboBox)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem4)
|
||||
self.label_3 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 3, 3, 1, 1)
|
||||
self.horizontalLayout_2.addWidget(self.label_3)
|
||||
self.victoryCondition = QtWidgets.QLineEdit(parent=battleResultDialog)
|
||||
self.victoryCondition.setObjectName("victoryCondition")
|
||||
self.gridLayout.addWidget(self.victoryCondition, 3, 4, 1, 2)
|
||||
self.horizontalLayout_2.addWidget(self.victoryCondition)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem5)
|
||||
self.label_2 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
self.score = QtWidgets.QLineEdit(parent=battleResultDialog)
|
||||
self.score.setObjectName("score")
|
||||
self.horizontalLayout_2.addWidget(self.score)
|
||||
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem6)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_4 = QtWidgets.QLabel(parent=battleResultDialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1)
|
||||
self.horizontalLayout_3.addWidget(self.label_4)
|
||||
self.battleComment = QtWidgets.QPlainTextEdit(parent=battleResultDialog)
|
||||
self.battleComment.setObjectName("battleComment")
|
||||
self.gridLayout.addWidget(self.battleComment, 4, 1, 1, 5)
|
||||
self.horizontalLayout_3.addWidget(self.battleComment)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=battleResultDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 5, 4, 1, 2)
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(battleResultDialog)
|
||||
self.buttonBox.accepted.connect(battleResultDialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(battleResultDialog.reject) # type: ignore
|
||||
self.buttonBox.accepted.connect(battleResultDialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(battleResultDialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(battleResultDialog)
|
||||
|
||||
def retranslateUi(self, battleResultDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
battleResultDialog.setWindowTitle(
|
||||
_translate("battleResultDialog", "Battle result")
|
||||
)
|
||||
battleResultDialog.setWindowTitle(_translate("battleResultDialog", "Battle result"))
|
||||
self.label_7.setText(_translate("battleResultDialog", "Sector"))
|
||||
self.label_5.setText(_translate("battleResultDialog", "Player 1"))
|
||||
self.label_6.setText(_translate("battleResultDialog", "Player 2"))
|
||||
self.label.setText(_translate("battleResultDialog", "Winner"))
|
||||
self.label_2.setText(_translate("battleResultDialog", "Score"))
|
||||
self.label_3.setText(_translate("battleResultDialog", "Victory condition"))
|
||||
self.label_2.setText(_translate("battleResultDialog", "Score"))
|
||||
self.label_4.setText(_translate("battleResultDialog", "Comment"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
battleResultDialog = QtWidgets.QDialog()
|
||||
ui = Ui_battleResultDialog()
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>668</width>
|
||||
<height>317</height>
|
||||
<width>771</width>
|
||||
<height>315</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -20,59 +20,102 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Sector</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Sector</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="sectorComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Player 1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="player1ComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Player 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="player2ComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="sectorComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Player 1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QComboBox" name="player1ComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Player 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QComboBox" name="player2ComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
@ -85,54 +128,101 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Winner</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Winner</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="winnerComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Victory condition</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="victoryCondition"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Score</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="score"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="winnerComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Comment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="battleComment"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Score</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="score"/>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Victory condition</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4" colspan="2">
|
||||
<widget class="QLineEdit" name="victoryCondition"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Comment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="5">
|
||||
<widget class="QPlainTextEdit" name="battleComment"/>
|
||||
</item>
|
||||
<item row="5" column="4" colspan="2">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
|||
|
|
@ -15,77 +15,58 @@ class Ui_choiceDialog(object):
|
|||
choiceDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||
choiceDialog.resize(561, 246)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(
|
||||
QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"),
|
||||
QtGui.QIcon.Mode.Normal,
|
||||
QtGui.QIcon.State.Off,
|
||||
)
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
choiceDialog.setWindowIcon(icon)
|
||||
self.gridLayout = QtWidgets.QGridLayout(choiceDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.formLayout = QtWidgets.QFormLayout(choiceDialog)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(parent=choiceDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||
self.playerComboBox = QtWidgets.QComboBox(parent=choiceDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.playerComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.playerComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.playerComboBox.setSizePolicy(sizePolicy)
|
||||
self.playerComboBox.setObjectName("playerComboBox")
|
||||
self.gridLayout.addWidget(self.playerComboBox, 0, 1, 1, 1)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.playerComboBox)
|
||||
self.label_2 = QtWidgets.QLabel(parent=choiceDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||
self.priorityComboBox = QtWidgets.QComboBox(parent=choiceDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.priorityComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.priorityComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.priorityComboBox.setSizePolicy(sizePolicy)
|
||||
self.priorityComboBox.setObjectName("priorityComboBox")
|
||||
self.gridLayout.addWidget(self.priorityComboBox, 1, 1, 1, 1)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.priorityComboBox)
|
||||
self.label_3 = QtWidgets.QLabel(parent=choiceDialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
|
||||
self.secondaryComboBox = QtWidgets.QComboBox(parent=choiceDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.secondaryComboBox.sizePolicy().hasHeightForWidth()
|
||||
)
|
||||
sizePolicy.setHeightForWidth(self.secondaryComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.secondaryComboBox.setSizePolicy(sizePolicy)
|
||||
self.secondaryComboBox.setObjectName("secondaryComboBox")
|
||||
self.gridLayout.addWidget(self.secondaryComboBox, 2, 1, 1, 1)
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.secondaryComboBox)
|
||||
self.label_4 = QtWidgets.QLabel(parent=choiceDialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
|
||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_4)
|
||||
self.choiceComment = QtWidgets.QPlainTextEdit(parent=choiceDialog)
|
||||
self.choiceComment.setObjectName("choiceComment")
|
||||
self.gridLayout.addWidget(self.choiceComment, 3, 1, 1, 1)
|
||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.choiceComment)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=choiceDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 2)
|
||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||
|
||||
self.retranslateUi(choiceDialog)
|
||||
self.buttonBox.accepted.connect(choiceDialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(choiceDialog.reject) # type: ignore
|
||||
self.buttonBox.accepted.connect(choiceDialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(choiceDialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(choiceDialog)
|
||||
|
||||
def retranslateUi(self, choiceDialog):
|
||||
|
|
@ -99,7 +80,6 @@ class Ui_choiceDialog(object):
|
|||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
choiceDialog = QtWidgets.QDialog()
|
||||
ui = Ui_choiceDialog()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.addPlayerBtn = QtWidgets.QPushButton(parent=self.playersTab)
|
||||
icon1 = QtGui.QIcon()
|
||||
icon1.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/plus.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.addPlayerBtn.setIcon(icon1)
|
||||
self.addPlayerBtn.setObjectName("addPlayerBtn")
|
||||
self.horizontalLayout.addWidget(self.addPlayerBtn)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
|
|
@ -54,9 +51,7 @@ class Ui_MainWindow(object):
|
|||
self.playersTable.setHorizontalHeaderItem(3, item)
|
||||
self.playersTable.horizontalHeader().setStretchLastSection(False)
|
||||
self.gridLayout.addWidget(self.playersTable, 1, 0, 1, 1)
|
||||
icon2 = QtGui.QIcon()
|
||||
icon2.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/users.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.tabWidget.addTab(self.playersTab, icon2, "")
|
||||
self.tabWidget.addTab(self.playersTab, "")
|
||||
self.warsTab = QtWidgets.QWidget()
|
||||
self.warsTab.setObjectName("warsTab")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.warsTab)
|
||||
|
|
@ -64,17 +59,14 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.addWarBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
||||
self.addWarBtn.setIcon(icon1)
|
||||
self.addWarBtn.setObjectName("addWarBtn")
|
||||
self.horizontalLayout_2.addWidget(self.addWarBtn)
|
||||
self.addCampaignBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
||||
self.addCampaignBtn.setEnabled(False)
|
||||
self.addCampaignBtn.setIcon(icon1)
|
||||
self.addCampaignBtn.setObjectName("addCampaignBtn")
|
||||
self.horizontalLayout_2.addWidget(self.addCampaignBtn)
|
||||
self.addRoundBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
||||
self.addRoundBtn.setEnabled(False)
|
||||
self.addRoundBtn.setIcon(icon1)
|
||||
self.addRoundBtn.setObjectName("addRoundBtn")
|
||||
self.horizontalLayout_2.addWidget(self.addRoundBtn)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
|
|
@ -125,6 +117,9 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_8.addWidget(self.warYear)
|
||||
self.verticalLayout_10.addLayout(self.horizontalLayout_8)
|
||||
self.groupBox = QtWidgets.QGroupBox(parent=self.pageWar)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.groupBox.setFont(font)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
|
|
@ -132,10 +127,6 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.addObjectiveBtn = QtWidgets.QPushButton(parent=self.groupBox)
|
||||
self.addObjectiveBtn.setEnabled(True)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.addObjectiveBtn.setFont(font)
|
||||
self.addObjectiveBtn.setIcon(icon1)
|
||||
self.addObjectiveBtn.setObjectName("addObjectiveBtn")
|
||||
self.horizontalLayout_3.addWidget(self.addObjectiveBtn)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
|
|
@ -191,13 +182,15 @@ class Ui_MainWindow(object):
|
|||
self.verticalLayout.addWidget(self.objectivesTable)
|
||||
self.verticalLayout_10.addWidget(self.groupBox)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(parent=self.pageWar)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.groupBox_2.setFont(font)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.addWarParticipantBtn = QtWidgets.QPushButton(parent=self.groupBox_2)
|
||||
self.addWarParticipantBtn.setIcon(icon1)
|
||||
self.addWarParticipantBtn.setObjectName("addWarParticipantBtn")
|
||||
self.horizontalLayout_5.addWidget(self.addWarParticipantBtn)
|
||||
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
|
|
@ -229,9 +222,6 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_6.addItem(spacerItem10)
|
||||
self.endWarBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
||||
self.endWarBtn.setEnabled(True)
|
||||
icon3 = QtGui.QIcon()
|
||||
icon3.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/flag-white.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.endWarBtn.setIcon(icon3)
|
||||
self.endWarBtn.setObjectName("endWarBtn")
|
||||
self.horizontalLayout_6.addWidget(self.endWarBtn)
|
||||
self.verticalLayout_10.addLayout(self.horizontalLayout_6)
|
||||
|
|
@ -258,6 +248,9 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_11.addWidget(self.campaignMonth)
|
||||
self.verticalLayout_7.addLayout(self.horizontalLayout_11)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(parent=self.pageCampaign)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.groupBox_3.setFont(font)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox_3)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
|
|
@ -265,7 +258,6 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_17.setObjectName("horizontalLayout_17")
|
||||
self.addSectorBtn = QtWidgets.QPushButton(parent=self.groupBox_3)
|
||||
self.addSectorBtn.setEnabled(True)
|
||||
self.addSectorBtn.setIcon(icon1)
|
||||
self.addSectorBtn.setObjectName("addSectorBtn")
|
||||
self.horizontalLayout_17.addWidget(self.addSectorBtn)
|
||||
spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
|
|
@ -295,13 +287,15 @@ class Ui_MainWindow(object):
|
|||
self.verticalLayout_5.addWidget(self.sectorsTable)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_3)
|
||||
self.groupBox_4 = QtWidgets.QGroupBox(parent=self.pageCampaign)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.groupBox_4.setFont(font)
|
||||
self.groupBox_4.setObjectName("groupBox_4")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.groupBox_4)
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.horizontalLayout_18 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_18.setObjectName("horizontalLayout_18")
|
||||
self.addCampaignParticipantBtn = QtWidgets.QPushButton(parent=self.groupBox_4)
|
||||
self.addCampaignParticipantBtn.setIcon(icon1)
|
||||
self.addCampaignParticipantBtn.setObjectName("addCampaignParticipantBtn")
|
||||
self.horizontalLayout_18.addWidget(self.addCampaignParticipantBtn)
|
||||
spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
|
|
@ -332,7 +326,6 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_10.addItem(spacerItem14)
|
||||
self.endCampaignBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
||||
self.endCampaignBtn.setEnabled(True)
|
||||
self.endCampaignBtn.setIcon(icon3)
|
||||
self.endCampaignBtn.setObjectName("endCampaignBtn")
|
||||
self.horizontalLayout_10.addWidget(self.endCampaignBtn)
|
||||
self.verticalLayout_7.addLayout(self.horizontalLayout_10)
|
||||
|
|
@ -351,6 +344,9 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_14.addWidget(self.roundNb)
|
||||
self.verticalLayout_8.addLayout(self.horizontalLayout_14)
|
||||
self.groupBox_5 = QtWidgets.QGroupBox(parent=self.pageRound)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.groupBox_5.setFont(font)
|
||||
self.groupBox_5.setObjectName("groupBox_5")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.groupBox_5)
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
|
|
@ -376,13 +372,13 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_13.addItem(spacerItem15)
|
||||
self.resolvePairingBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||
self.resolvePairingBtn.setEnabled(False)
|
||||
icon4 = QtGui.QIcon()
|
||||
icon4.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-switch.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.resolvePairingBtn.setIcon(icon4)
|
||||
self.resolvePairingBtn.setObjectName("resolvePairingBtn")
|
||||
self.horizontalLayout_13.addWidget(self.resolvePairingBtn)
|
||||
self.verticalLayout_8.addLayout(self.horizontalLayout_13)
|
||||
self.groupBox_6 = QtWidgets.QGroupBox(parent=self.pageRound)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.groupBox_6.setFont(font)
|
||||
self.groupBox_6.setObjectName("groupBox_6")
|
||||
self.horizontalLayout_12 = QtWidgets.QHBoxLayout(self.groupBox_6)
|
||||
self.horizontalLayout_12.setObjectName("horizontalLayout_12")
|
||||
|
|
@ -413,19 +409,16 @@ class Ui_MainWindow(object):
|
|||
self.horizontalLayout_9.addItem(spacerItem16)
|
||||
self.endRoundBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||
self.endRoundBtn.setEnabled(True)
|
||||
self.endRoundBtn.setIcon(icon3)
|
||||
self.endRoundBtn.setObjectName("endRoundBtn")
|
||||
self.horizontalLayout_9.addWidget(self.endRoundBtn)
|
||||
self.verticalLayout_8.addLayout(self.horizontalLayout_9)
|
||||
self.selectedDetailsStack.addWidget(self.pageRound)
|
||||
self.verticalLayout_3.addWidget(self.splitter)
|
||||
icon5 = QtGui.QIcon()
|
||||
icon5.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/swords-small.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.tabWidget.addTab(self.warsTab, icon5, "")
|
||||
self.tabWidget.addTab(self.warsTab, "")
|
||||
self.verticalLayout_9.addWidget(self.tabWidget)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1235, 22))
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1235, 21))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
|
||||
self.menuFile.setObjectName("menuFile")
|
||||
|
|
@ -438,52 +431,25 @@ class Ui_MainWindow(object):
|
|||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.actionNew = QtGui.QAction(parent=MainWindow)
|
||||
icon6 = QtGui.QIcon()
|
||||
icon6.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/document.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionNew.setIcon(icon6)
|
||||
self.actionNew.setObjectName("actionNew")
|
||||
self.actionOpen = QtGui.QAction(parent=MainWindow)
|
||||
icon7 = QtGui.QIcon()
|
||||
icon7.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/folder.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionOpen.setIcon(icon7)
|
||||
self.actionOpen.setObjectName("actionOpen")
|
||||
self.actionSave = QtGui.QAction(parent=MainWindow)
|
||||
icon8 = QtGui.QIcon()
|
||||
icon8.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/disk.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionSave.setIcon(icon8)
|
||||
self.actionSave.setObjectName("actionSave")
|
||||
self.actionExit = QtGui.QAction(parent=MainWindow)
|
||||
icon9 = QtGui.QIcon()
|
||||
icon9.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/door--arrow.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionExit.setIcon(icon9)
|
||||
self.actionExit.setObjectName("actionExit")
|
||||
self.actionUndo = QtGui.QAction(parent=MainWindow)
|
||||
self.actionUndo.setEnabled(False)
|
||||
icon10 = QtGui.QIcon()
|
||||
icon10.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-curve-180-left.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionUndo.setIcon(icon10)
|
||||
self.actionUndo.setObjectName("actionUndo")
|
||||
self.actionRedo = QtGui.QAction(parent=MainWindow)
|
||||
self.actionRedo.setEnabled(False)
|
||||
icon11 = QtGui.QIcon()
|
||||
icon11.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/arrow-curve.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionRedo.setIcon(icon11)
|
||||
self.actionRedo.setObjectName("actionRedo")
|
||||
self.actionAbout = QtGui.QAction(parent=MainWindow)
|
||||
icon12 = QtGui.QIcon()
|
||||
icon12.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/question.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionAbout.setIcon(icon12)
|
||||
self.actionAbout.setObjectName("actionAbout")
|
||||
self.actionExport = QtGui.QAction(parent=MainWindow)
|
||||
self.actionExport.setEnabled(False)
|
||||
icon13 = QtGui.QIcon()
|
||||
icon13.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/notebook--arrow.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionExport.setIcon(icon13)
|
||||
self.actionExport.setObjectName("actionExport")
|
||||
self.actionSave_as = QtGui.QAction(parent=MainWindow)
|
||||
icon14 = QtGui.QIcon()
|
||||
icon14.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/disk--pencil.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
self.actionSave_as.setIcon(icon14)
|
||||
self.actionSave_as.setObjectName("actionSave_as")
|
||||
self.menuFile.addAction(self.actionNew)
|
||||
self.menuFile.addAction(self.actionOpen)
|
||||
|
|
@ -604,9 +570,9 @@ class Ui_MainWindow(object):
|
|||
item = self.battlesTable.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Player 2"))
|
||||
item = self.battlesTable.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Score"))
|
||||
item = self.battlesTable.horizontalHeaderItem(4)
|
||||
item.setText(_translate("MainWindow", "Victory condition"))
|
||||
item = self.battlesTable.horizontalHeaderItem(4)
|
||||
item.setText(_translate("MainWindow", "Score"))
|
||||
item = self.battlesTable.horizontalHeaderItem(5)
|
||||
item.setText(_translate("MainWindow", "Comment"))
|
||||
self.endRoundBtn.setText(_translate("MainWindow", "End round"))
|
||||
|
|
|
|||
|
|
@ -25,10 +25,6 @@
|
|||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="playersTab">
|
||||
<attribute name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/users.png</normaloff>../resources/users.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>Players</string>
|
||||
</attribute>
|
||||
|
|
@ -40,10 +36,6 @@
|
|||
<property name="text">
|
||||
<string>Add player</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -103,10 +95,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="warsTab">
|
||||
<attribute name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/swords-small.png</normaloff>../resources/swords-small.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>Wars</string>
|
||||
</attribute>
|
||||
|
|
@ -118,10 +106,6 @@
|
|||
<property name="text">
|
||||
<string>Add war</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -132,10 +116,6 @@
|
|||
<property name="text">
|
||||
<string>Add Campaign</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -146,10 +126,6 @@
|
|||
<property name="text">
|
||||
<string>Add Round</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -272,6 +248,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Objectives</string>
|
||||
</property>
|
||||
|
|
@ -283,18 +264,9 @@
|
|||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add objective</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -450,6 +422,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Participants</string>
|
||||
</property>
|
||||
|
|
@ -461,10 +438,6 @@
|
|||
<property name="text">
|
||||
<string>Add participant</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -552,10 +525,6 @@
|
|||
<property name="text">
|
||||
<string>End war</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/flag-white.png</normaloff>../resources/flag-white.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
@ -607,6 +576,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Sectors</string>
|
||||
</property>
|
||||
|
|
@ -621,10 +595,6 @@
|
|||
<property name="text">
|
||||
<string>Add Sector</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -698,6 +668,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Participants</string>
|
||||
</property>
|
||||
|
|
@ -709,10 +684,6 @@
|
|||
<property name="text">
|
||||
<string>Add participant</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/plus.png</normaloff>../resources/plus.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -797,10 +768,6 @@
|
|||
<property name="text">
|
||||
<string>End campaign</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/flag-white.png</normaloff>../resources/flag-white.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
@ -827,6 +794,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Choices</string>
|
||||
</property>
|
||||
|
|
@ -891,16 +863,17 @@
|
|||
<property name="text">
|
||||
<string>Resolve pairing</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/arrow-switch.png</normaloff>../resources/arrow-switch.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Battles</string>
|
||||
</property>
|
||||
|
|
@ -936,12 +909,12 @@
|
|||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Score</string>
|
||||
<string>Victory condition</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Victory condition</string>
|
||||
<string>Score</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
|
|
@ -977,10 +950,6 @@
|
|||
<property name="text">
|
||||
<string>End round</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/flag-white.png</normaloff>../resources/flag-white.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
@ -1002,7 +971,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1235</width>
|
||||
<height>22</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
|
@ -1037,10 +1006,6 @@
|
|||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionNew">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/document.png</normaloff>../resources/document.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
|
|
@ -1049,10 +1014,6 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionOpen">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/folder.png</normaloff>../resources/folder.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
|
|
@ -1061,10 +1022,6 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionSave">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/disk.png</normaloff>../resources/disk.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
|
|
@ -1073,10 +1030,6 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionExit">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/door--arrow.png</normaloff>../resources/door--arrow.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
|
|
@ -1088,10 +1041,6 @@
|
|||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/arrow-curve-180-left.png</normaloff>../resources/arrow-curve-180-left.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Undo</string>
|
||||
</property>
|
||||
|
|
@ -1103,10 +1052,6 @@
|
|||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/arrow-curve.png</normaloff>../resources/arrow-curve.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Redo</string>
|
||||
</property>
|
||||
|
|
@ -1115,10 +1060,6 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/question.png</normaloff>../resources/question.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
|
|
@ -1127,19 +1068,11 @@
|
|||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/notebook--arrow.png</normaloff>../resources/notebook--arrow.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Export</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_as">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>../resources/disk--pencil.png</normaloff>../resources/disk--pencil.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save as...</string>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -17,25 +17,25 @@ class Ui_objectiveDialog(object):
|
|||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
objectiveDialog.setWindowIcon(icon)
|
||||
self.gridLayout = QtWidgets.QGridLayout(objectiveDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.formLayout = QtWidgets.QFormLayout(objectiveDialog)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(parent=objectiveDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||
self.objectiveName = QtWidgets.QLineEdit(parent=objectiveDialog)
|
||||
self.objectiveName.setObjectName("objectiveName")
|
||||
self.gridLayout.addWidget(self.objectiveName, 0, 1, 1, 1)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.objectiveName)
|
||||
self.label_2 = QtWidgets.QLabel(parent=objectiveDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||
self.objectiveDescription = QtWidgets.QTextEdit(parent=objectiveDialog)
|
||||
self.objectiveDescription.setObjectName("objectiveDescription")
|
||||
self.gridLayout.addWidget(self.objectiveDescription, 1, 1, 1, 1)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.objectiveDescription)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=objectiveDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 2)
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||
|
||||
self.retranslateUi(objectiveDialog)
|
||||
self.buttonBox.accepted.connect(objectiveDialog.accept) # type: ignore
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
|
|
|||
|
|
@ -13,33 +13,34 @@ class Ui_sectorDialog(object):
|
|||
def setupUi(self, sectorDialog):
|
||||
sectorDialog.setObjectName("sectorDialog")
|
||||
sectorDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||
sectorDialog.resize(602, 338)
|
||||
sectorDialog.resize(888, 338)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
sectorDialog.setWindowIcon(icon)
|
||||
self.gridLayout = QtWidgets.QGridLayout(sectorDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(sectorDialog)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.label_2 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
|
||||
self.verticalLayout_4.addWidget(self.label_2)
|
||||
self.label = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout_4.addWidget(self.label)
|
||||
self.label_7 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.verticalLayout_4.addWidget(self.label_7)
|
||||
self.horizontalLayout_6.addLayout(self.verticalLayout_4)
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.sectorName = QtWidgets.QLineEdit(parent=sectorDialog)
|
||||
self.sectorName.setText("")
|
||||
self.sectorName.setObjectName("sectorName")
|
||||
self.gridLayout.addWidget(self.sectorName, 0, 1, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 0, 2, 1, 1)
|
||||
self.majorComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.majorComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.majorComboBox.setSizePolicy(sizePolicy)
|
||||
self.majorComboBox.setObjectName("majorComboBox")
|
||||
self.gridLayout.addWidget(self.majorComboBox, 0, 3, 1, 1)
|
||||
self.label = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
|
||||
self.verticalLayout_3.addWidget(self.sectorName)
|
||||
self.roundComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
|
|
@ -47,10 +48,39 @@ class Ui_sectorDialog(object):
|
|||
sizePolicy.setHeightForWidth(self.roundComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.roundComboBox.setSizePolicy(sizePolicy)
|
||||
self.roundComboBox.setObjectName("roundComboBox")
|
||||
self.gridLayout.addWidget(self.roundComboBox, 1, 1, 1, 1)
|
||||
self.verticalLayout_3.addWidget(self.roundComboBox)
|
||||
self.sectorMission = QtWidgets.QLineEdit(parent=sectorDialog)
|
||||
self.sectorMission.setText("")
|
||||
self.sectorMission.setObjectName("sectorMission")
|
||||
self.verticalLayout_3.addWidget(self.sectorMission)
|
||||
self.horizontalLayout_6.addLayout(self.verticalLayout_3)
|
||||
self.horizontalLayout.addLayout(self.horizontalLayout_6)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.label_3 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.verticalLayout_2.addWidget(self.label_3)
|
||||
self.label_4 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 1, 2, 1, 1)
|
||||
self.verticalLayout_2.addWidget(self.label_4)
|
||||
self.label_5 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.verticalLayout_2.addWidget(self.label_5)
|
||||
self.horizontalLayout_5.addLayout(self.verticalLayout_2)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.majorComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.majorComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.majorComboBox.setSizePolicy(sizePolicy)
|
||||
self.majorComboBox.setObjectName("majorComboBox")
|
||||
self.verticalLayout.addWidget(self.majorComboBox)
|
||||
self.minorComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
|
|
@ -58,17 +88,7 @@ class Ui_sectorDialog(object):
|
|||
sizePolicy.setHeightForWidth(self.minorComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.minorComboBox.setSizePolicy(sizePolicy)
|
||||
self.minorComboBox.setObjectName("minorComboBox")
|
||||
self.gridLayout.addWidget(self.minorComboBox, 1, 3, 1, 1)
|
||||
self.label_7 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout.addWidget(self.label_7, 2, 0, 1, 1)
|
||||
self.sectorMission = QtWidgets.QLineEdit(parent=sectorDialog)
|
||||
self.sectorMission.setText("")
|
||||
self.sectorMission.setObjectName("sectorMission")
|
||||
self.gridLayout.addWidget(self.sectorMission, 2, 1, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout.addWidget(self.label_5, 2, 2, 1, 1)
|
||||
self.verticalLayout.addWidget(self.minorComboBox)
|
||||
self.influenceComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
|
|
@ -76,18 +96,26 @@ class Ui_sectorDialog(object):
|
|||
sizePolicy.setHeightForWidth(self.influenceComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.influenceComboBox.setSizePolicy(sizePolicy)
|
||||
self.influenceComboBox.setObjectName("influenceComboBox")
|
||||
self.gridLayout.addWidget(self.influenceComboBox, 2, 3, 1, 1)
|
||||
self.verticalLayout.addWidget(self.influenceComboBox)
|
||||
self.horizontalLayout_5.addLayout(self.verticalLayout)
|
||||
self.horizontalLayout.addLayout(self.horizontalLayout_5)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem1)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.label_6 = QtWidgets.QLabel(parent=sectorDialog)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout.addWidget(self.label_6, 3, 0, 1, 1)
|
||||
self.horizontalLayout_4.addWidget(self.label_6)
|
||||
self.sectorDescription = QtWidgets.QPlainTextEdit(parent=sectorDialog)
|
||||
self.sectorDescription.setObjectName("sectorDescription")
|
||||
self.gridLayout.addWidget(self.sectorDescription, 3, 1, 1, 3)
|
||||
self.horizontalLayout_4.addWidget(self.sectorDescription)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout_4)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=sectorDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 4, 2, 1, 2)
|
||||
self.verticalLayout_5.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(sectorDialog)
|
||||
self.buttonBox.accepted.connect(sectorDialog.accept) # type: ignore
|
||||
|
|
@ -98,10 +126,10 @@ class Ui_sectorDialog(object):
|
|||
_translate = QtCore.QCoreApplication.translate
|
||||
sectorDialog.setWindowTitle(_translate("sectorDialog", "Sector"))
|
||||
self.label_2.setText(_translate("sectorDialog", "Name"))
|
||||
self.label_3.setText(_translate("sectorDialog", "Major objective"))
|
||||
self.label.setText(_translate("sectorDialog", "Round"))
|
||||
self.label_4.setText(_translate("sectorDialog", "Minor opportunity"))
|
||||
self.label_7.setText(_translate("sectorDialog", "Mission"))
|
||||
self.label_3.setText(_translate("sectorDialog", "Major objective"))
|
||||
self.label_4.setText(_translate("sectorDialog", "Minor opportunity"))
|
||||
self.label_5.setText(_translate("sectorDialog", "Influence"))
|
||||
self.label_6.setText(_translate("sectorDialog", "Description"))
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>602</width>
|
||||
<width>888</width>
|
||||
<height>338</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -20,114 +20,172 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Round</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Mission</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="sectorName">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="roundComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="sectorMission">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Major objective</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Minor opportunity</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Influence</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="majorComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="minorComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="influenceComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="sectorName">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="sectorDescription"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Major objective</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QComboBox" name="majorComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Round</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="roundComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Minor opportunity</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QComboBox" name="minorComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Mission</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="sectorMission">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Influence</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QComboBox" name="influenceComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QPlainTextEdit" name="sectorDescription"/>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="2">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
|||
|
|
@ -17,27 +17,27 @@ class Ui_warDialog(object):
|
|||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
warDialog.setWindowIcon(icon)
|
||||
self.gridLayout = QtWidgets.QGridLayout(warDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.formLayout = QtWidgets.QFormLayout(warDialog)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(parent=warDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||
self.warName = QtWidgets.QLineEdit(parent=warDialog)
|
||||
self.warName.setObjectName("warName")
|
||||
self.gridLayout.addWidget(self.warName, 0, 1, 1, 1)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.warName)
|
||||
self.label_2 = QtWidgets.QLabel(parent=warDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||
self.warYear = QtWidgets.QSpinBox(parent=warDialog)
|
||||
self.warYear.setMinimum(1970)
|
||||
self.warYear.setMaximum(3000)
|
||||
self.warYear.setObjectName("warYear")
|
||||
self.gridLayout.addWidget(self.warYear, 1, 1, 1, 1)
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.warYear)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=warDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 2)
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||
|
||||
self.retranslateUi(warDialog)
|
||||
self.buttonBox.accepted.connect(warDialog.accept) # type: ignore
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import annotations
|
||||
from typing import Callable, List
|
||||
from pathlib import Path
|
||||
import calendar
|
||||
|
|
@ -5,9 +6,9 @@ import calendar
|
|||
from PyQt6 import QtWidgets
|
||||
from PyQt6.QtCore import Qt, QPoint
|
||||
from PyQt6.QtWidgets import QWidget, QFileDialog, QTreeWidgetItem, QMenu
|
||||
from PyQt6.QtGui import QCloseEvent, QIcon
|
||||
from PyQt6.QtGui import QCloseEvent
|
||||
|
||||
from warchron.constants import ROLE_TYPE, ROLE_ID, ItemType
|
||||
from warchron.constants import ROLE_TYPE, ROLE_ID, ItemType, Icons, IconName
|
||||
from warchron.controller.dtos import (
|
||||
ParticipantOption,
|
||||
TreeSelection,
|
||||
|
|
@ -56,6 +57,7 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
)
|
||||
self.addCampaignBtn.clicked.connect(self._on_add_campaign_clicked)
|
||||
self.addRoundBtn.clicked.connect(self._on_add_round_clicked)
|
||||
|
||||
# Pages
|
||||
self.warParticipantsTable.setContextMenuPolicy(
|
||||
Qt.ContextMenuPolicy.CustomContextMenu
|
||||
|
|
@ -89,6 +91,37 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
)
|
||||
self.majorValue.valueChanged.connect(self._on_major_changed)
|
||||
self.minorValue.valueChanged.connect(self._on_minor_changed)
|
||||
self._apply_icons()
|
||||
|
||||
def _apply_icons(self) -> None:
|
||||
# Window
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
# Menu bar
|
||||
self.actionNew.setIcon(Icons.get(IconName.NEW))
|
||||
self.actionOpen.setIcon(Icons.get(IconName.OPEN))
|
||||
self.actionSave.setIcon(Icons.get(IconName.SAVE))
|
||||
self.actionSave_as.setIcon(Icons.get(IconName.SAVE_AS))
|
||||
self.actionExit.setIcon(Icons.get(IconName.EXIT))
|
||||
self.actionUndo.setIcon(Icons.get(IconName.UNDO))
|
||||
self.actionRedo.setIcon(Icons.get(IconName.REDO))
|
||||
self.actionExport.setIcon(Icons.get(IconName.EXPORT))
|
||||
self.actionAbout.setIcon(Icons.get(IconName.ABOUT))
|
||||
# Tabs
|
||||
self.tabWidget.setTabIcon(0, Icons.get(IconName.PLAYERS))
|
||||
self.tabWidget.setTabIcon(1, Icons.get(IconName.WARS))
|
||||
# Buttons
|
||||
self.addPlayerBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.addWarBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.addCampaignBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.addRoundBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.addObjectiveBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.addWarParticipantBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.endWarBtn.setIcon(Icons.get(IconName.END))
|
||||
self.addSectorBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.addCampaignParticipantBtn.setIcon(Icons.get(IconName.ADD))
|
||||
self.endCampaignBtn.setIcon(Icons.get(IconName.END))
|
||||
self.resolvePairingBtn.setIcon(Icons.get(IconName.PAIRING))
|
||||
self.endRoundBtn.setIcon(Icons.get(IconName.END))
|
||||
|
||||
def _emit_selection_changed(self, current: QTreeWidgetItem | None) -> None:
|
||||
if not self.on_tree_selection_changed:
|
||||
|
|
@ -147,12 +180,8 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
player_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
delete_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/cross.png"), "Delete"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
delete_action = menu.addAction(Icons.get(IconName.DELETE), "Delete")
|
||||
viewport = self.playersTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -195,12 +224,8 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
menu = QMenu(self)
|
||||
edit_action = None
|
||||
if item_type != ItemType.ROUND:
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
delete_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/cross.png"), "Delete"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
delete_action = menu.addAction(Icons.get(IconName.DELETE), "Delete")
|
||||
viewport = self.warsTree.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -216,18 +241,23 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
tree.clear()
|
||||
tree.setColumnCount(1)
|
||||
tree.setHeaderLabels(["Wars"])
|
||||
hourglass = Icons.get(IconName.ONGOING)
|
||||
check = Icons.get(IconName.DONE)
|
||||
for war in wars:
|
||||
war_item = QTreeWidgetItem([format_war_label(war)])
|
||||
war_item.setIcon(0, check if war.is_over else hourglass)
|
||||
war_item.setData(0, ROLE_TYPE, ItemType.WAR)
|
||||
war_item.setData(0, ROLE_ID, war.id)
|
||||
tree.addTopLevelItem(war_item)
|
||||
for camp in war.get_all_campaigns():
|
||||
camp_item = QTreeWidgetItem([format_campaign_label(camp)])
|
||||
camp_item.setIcon(0, check if camp.is_over else hourglass)
|
||||
camp_item.setData(0, ROLE_TYPE, ItemType.CAMPAIGN)
|
||||
camp_item.setData(0, ROLE_ID, camp.id)
|
||||
war_item.addChild(camp_item)
|
||||
for index, rnd in enumerate(camp.get_all_rounds(), start=1):
|
||||
rnd_item = QTreeWidgetItem([format_round_label(index)])
|
||||
rnd_item.setIcon(0, check if rnd.is_over else hourglass)
|
||||
rnd_item.setData(0, ROLE_TYPE, ItemType.ROUND)
|
||||
rnd_item.setData(0, ROLE_ID, rnd.id)
|
||||
camp_item.addChild(rnd_item)
|
||||
|
|
@ -283,12 +313,8 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
objective_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
delete_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/cross.png"), "Delete"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
delete_action = menu.addAction(Icons.get(IconName.DELETE), "Delete")
|
||||
viewport = self.objectivesTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -307,12 +333,8 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
participant_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
delete_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/cross.png"), "Delete"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
delete_action = menu.addAction(Icons.get(IconName.DELETE), "Delete")
|
||||
viewport = self.warParticipantsTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -380,12 +402,8 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
sector_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
delete_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/cross.png"), "Delete"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
delete_action = menu.addAction(Icons.get(IconName.DELETE), "Delete")
|
||||
viewport = self.sectorsTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -404,12 +422,8 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
participant_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
delete_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/cross.png"), "Delete"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
delete_action = menu.addAction(Icons.get(IconName.DELETE), "Delete")
|
||||
viewport = self.campaignParticipantsTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -476,9 +490,7 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
if choice_id is None:
|
||||
return
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
viewport = self.choicesTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -497,9 +509,7 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
if battle_id is None:
|
||||
return
|
||||
menu = QMenu(self)
|
||||
edit_action = menu.addAction(
|
||||
QIcon(".\\src\\warchron\\view\\ui\\../resources/pencil.png"), "Edit"
|
||||
)
|
||||
edit_action = menu.addAction(Icons.get(IconName.EDIT), "Edit")
|
||||
viewport = self.battlesTable.viewport()
|
||||
assert viewport is not None
|
||||
action = menu.exec(viewport.mapToGlobal(pos))
|
||||
|
|
@ -530,13 +540,13 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
for row, battle in enumerate(sectors):
|
||||
sector_item = QtWidgets.QTableWidgetItem(battle.sector_name)
|
||||
if battle.state_icon:
|
||||
sector_item.setIcon(QIcon(battle.state_icon))
|
||||
sector_item.setIcon(battle.state_icon)
|
||||
player_1_item = QtWidgets.QTableWidgetItem(battle.player_1)
|
||||
if battle.player1_icon:
|
||||
player_1_item.setIcon(QIcon(battle.player1_icon))
|
||||
player_1_item.setIcon(battle.player1_icon)
|
||||
player_2_item = QtWidgets.QTableWidgetItem(battle.player_2)
|
||||
if battle.player2_icon:
|
||||
player_2_item.setIcon(QIcon(battle.player2_icon))
|
||||
player_2_item.setIcon(battle.player2_icon)
|
||||
score_item = QtWidgets.QTableWidgetItem(battle.score)
|
||||
vp_item = QtWidgets.QTableWidgetItem(battle.victory_condition)
|
||||
comment_item = QtWidgets.QTableWidgetItem(battle.comment)
|
||||
|
|
@ -544,7 +554,7 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
table.setItem(row, 0, sector_item)
|
||||
table.setItem(row, 1, player_1_item)
|
||||
table.setItem(row, 2, player_2_item)
|
||||
table.setItem(row, 3, score_item)
|
||||
table.setItem(row, 4, vp_item)
|
||||
table.setItem(row, 3, vp_item)
|
||||
table.setItem(row, 4, score_item)
|
||||
table.setItem(row, 5, comment_item)
|
||||
table.resizeColumnsToContents()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.view.ui.ui_war_dialog import Ui_warDialog
|
||||
|
||||
|
||||
|
|
@ -16,6 +17,7 @@ class WarDialog(QDialog):
|
|||
self.ui.warName.setText(default_name)
|
||||
if default_year is not None:
|
||||
self.ui.warYear.setValue(default_year)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_war_name(self) -> str:
|
||||
return self.ui.warName.text().strip()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from typing import cast, List
|
|||
|
||||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.controller.dtos import ParticipantOption
|
||||
from warchron.view.helpers import select_if_exists
|
||||
from warchron.view.ui.ui_war_participant_dialog import Ui_warParticipantDialog
|
||||
|
|
@ -25,6 +26,7 @@ class WarParticipantDialog(QDialog):
|
|||
select_if_exists(self.ui.playerComboBox, default_player_id)
|
||||
self.ui.playerComboBox.setEnabled(editable_player)
|
||||
self.ui.faction.setText(default_faction)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_player_id(self) -> str:
|
||||
return cast(str, self.ui.playerComboBox.currentData())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue