Compare commits
2 commits
495a5adb98
...
032ab2d2c4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
032ab2d2c4 | ||
|
|
2816da010c |
22 changed files with 1999 additions and 1108 deletions
|
|
@ -13,6 +13,8 @@ class ItemType(StrEnum):
|
||||||
ROUND = "round"
|
ROUND = "round"
|
||||||
OBJECTIVE = "objective"
|
OBJECTIVE = "objective"
|
||||||
WAR_PARTICIPANT = "war_participant"
|
WAR_PARTICIPANT = "war_participant"
|
||||||
|
SECTOR = "sector"
|
||||||
|
CAMPAIGN_PARTICIPANT = "campaign_participant"
|
||||||
|
|
||||||
class RefreshScope(Enum):
|
class RefreshScope(Enum):
|
||||||
NONE = auto()
|
NONE = auto()
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QMessageBox, QDialog
|
from PyQt6.QtWidgets import QMessageBox, QDialog
|
||||||
from warchron.model.model import Model
|
from warchron.model.model import Model
|
||||||
from warchron.view.view import View
|
from warchron.view.view import View
|
||||||
|
|
||||||
from warchron.constants import ItemType, RefreshScope
|
from warchron.constants import ItemType, RefreshScope
|
||||||
from warchron.view.view import PlayerDialog, WarDialog, CampaignDialog, ObjectiveDialog, ParticipantDialog
|
from warchron.view.view import PlayerDialog, WarDialog, CampaignDialog, ObjectiveDialog, WarParticipantDialog, CampaignParticipantDialog, SectorDialog
|
||||||
|
from warchron.controller.dtos import ParticipantOption
|
||||||
|
|
||||||
class Controller:
|
class Controller:
|
||||||
def __init__(self, model: Model, view: View):
|
def __init__(self, model: Model, view: View):
|
||||||
|
|
@ -37,6 +37,8 @@ class Controller:
|
||||||
self.view.addWarBtn.clicked.connect(self.add_war)
|
self.view.addWarBtn.clicked.connect(self.add_war)
|
||||||
self.view.addObjectiveBtn.clicked.connect(self.add_objective)
|
self.view.addObjectiveBtn.clicked.connect(self.add_objective)
|
||||||
self.view.addWarParticipantBtn.clicked.connect(self.add_war_participant)
|
self.view.addWarParticipantBtn.clicked.connect(self.add_war_participant)
|
||||||
|
self.view.addSectorBtn.clicked.connect(self.add_sector)
|
||||||
|
self.view.addCampaignParticipantBtn.clicked.connect(self.add_campaign_participant)
|
||||||
self.view.on_edit_item = self.edit_item
|
self.view.on_edit_item = self.edit_item
|
||||||
self.view.on_delete_item = self.delete_item
|
self.view.on_delete_item = self.delete_item
|
||||||
|
|
||||||
|
|
@ -145,6 +147,22 @@ class Controller:
|
||||||
def _fill_campaign_details(self, campaign_id: str):
|
def _fill_campaign_details(self, campaign_id: str):
|
||||||
camp = self.model.get_campaign(campaign_id)
|
camp = self.model.get_campaign(campaign_id)
|
||||||
self.view.show_campaign_details(name=camp.name, month=camp.month)
|
self.view.show_campaign_details(name=camp.name, month=camp.month)
|
||||||
|
sectors = camp.get_all_sectors()
|
||||||
|
sectors_for_display = []
|
||||||
|
war = self.model.get_war_by_campaign(camp.id)
|
||||||
|
for sect in sectors:
|
||||||
|
round_index = camp.get_round_index(sect.round_id)
|
||||||
|
major_name = war.get_objective_name(sect.major_objective_id)
|
||||||
|
minor_name = war.get_objective_name(sect.minor_objective_id)
|
||||||
|
influence_name = war.get_objective_name(sect.influence_objective_id)
|
||||||
|
sectors_for_display.append((sect.name,round_index,major_name,minor_name,influence_name,sect.id))
|
||||||
|
self.view.display_campaign_sectors(sectors_for_display)
|
||||||
|
participants = camp.get_all_campaign_participants()
|
||||||
|
participants_for_display = [
|
||||||
|
(self.model.get_player_name(p.id), p.leader, p.theme, p.id)
|
||||||
|
for p in participants
|
||||||
|
]
|
||||||
|
self.view.display_campaign_participants(participants_for_display)
|
||||||
|
|
||||||
def _fill_round_details(self, round_id: str):
|
def _fill_round_details(self, round_id: str):
|
||||||
index = self.model.get_round_index(round_id)
|
index = self.model.get_round_index(round_id)
|
||||||
|
|
@ -248,12 +266,65 @@ class Controller:
|
||||||
elif item_type == ItemType.WAR_PARTICIPANT:
|
elif item_type == ItemType.WAR_PARTICIPANT:
|
||||||
part = self.model.get_war_participant(item_id)
|
part = self.model.get_war_participant(item_id)
|
||||||
player = self.model.get_player(part.id)
|
player = self.model.get_player(part.id)
|
||||||
dialog = ParticipantDialog(self.view, players=[player], default_player_id=part.id, default_faction=part.faction)
|
dialog = WarParticipantDialog(
|
||||||
|
self.view,
|
||||||
|
players=[player],
|
||||||
|
default_player_id=part.id,
|
||||||
|
default_faction=part.faction,
|
||||||
|
editable_player=False
|
||||||
|
)
|
||||||
if dialog.exec() == QDialog.DialogCode.Accepted:
|
if dialog.exec() == QDialog.DialogCode.Accepted:
|
||||||
id = dialog.get_player_id()
|
|
||||||
faction = dialog.get_participant_faction()
|
faction = dialog.get_participant_faction()
|
||||||
self.model.update_war_participant(item_id, faction=faction)
|
self.model.update_war_participant(item_id, faction=faction)
|
||||||
self.refresh(RefreshScope.WAR_DETAILS)
|
self.refresh(RefreshScope.WAR_DETAILS)
|
||||||
|
elif item_type == ItemType.SECTOR:
|
||||||
|
sect = self.model.get_sector(item_id)
|
||||||
|
camp = self.model.get_campaign_by_sector(item_id)
|
||||||
|
war = self.model.get_war_by_campaign(camp.id)
|
||||||
|
rounds = camp.get_all_rounds()
|
||||||
|
objectives = war.get_all_objectives()
|
||||||
|
dialog = SectorDialog(
|
||||||
|
self.view,
|
||||||
|
default_name=sect.name,
|
||||||
|
rounds=rounds,
|
||||||
|
default_round_id=sect.round_id,
|
||||||
|
objectives=objectives,
|
||||||
|
default_major_id=sect.major_objective_id,
|
||||||
|
default_minor_id=sect.minor_objective_id,
|
||||||
|
default_influence_id=sect.influence_objective_id,
|
||||||
|
)
|
||||||
|
if dialog.exec() == QDialog.DialogCode.Accepted:
|
||||||
|
name = dialog.get_sector_name()
|
||||||
|
round_id = dialog.get_round_id()
|
||||||
|
major_id = dialog.get_major_id()
|
||||||
|
minor_id = dialog.get_minor_id()
|
||||||
|
influence_id = dialog.get_influence_id()
|
||||||
|
self.model.update_sector(
|
||||||
|
item_id,
|
||||||
|
name=name,
|
||||||
|
round_id=round_id,
|
||||||
|
major_id=major_id,
|
||||||
|
minor_id=minor_id,
|
||||||
|
influence_id=influence_id
|
||||||
|
)
|
||||||
|
self.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||||
|
elif item_type == ItemType.CAMPAIGN_PARTICIPANT:
|
||||||
|
part = self.model.get_campaign_participant(item_id)
|
||||||
|
player = self.model.get_player(part.id)
|
||||||
|
part_opt = [ParticipantOption(id=player.id, name=player.name)]
|
||||||
|
dialog = CampaignParticipantDialog(
|
||||||
|
self.view,
|
||||||
|
participants=part_opt,
|
||||||
|
default_participant_id=part.id,
|
||||||
|
default_leader=part.leader,
|
||||||
|
default_theme=part.theme,
|
||||||
|
editable_player=False
|
||||||
|
)
|
||||||
|
if dialog.exec() == QDialog.DialogCode.Accepted:
|
||||||
|
leader = dialog.get_participant_leader()
|
||||||
|
theme = dialog.get_participant_theme()
|
||||||
|
self.model.update_campaign_participant(item_id, leader=leader, theme=theme)
|
||||||
|
self.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||||
self.is_dirty = True
|
self.is_dirty = True
|
||||||
|
|
||||||
def delete_item(self, item_type: str, item_id: str):
|
def delete_item(self, item_type: str, item_id: str):
|
||||||
|
|
@ -282,6 +353,12 @@ class Controller:
|
||||||
elif item_type == ItemType.WAR_PARTICIPANT:
|
elif item_type == ItemType.WAR_PARTICIPANT:
|
||||||
self.model.remove_war_participant(item_id)
|
self.model.remove_war_participant(item_id)
|
||||||
self.refresh(RefreshScope.WAR_DETAILS)
|
self.refresh(RefreshScope.WAR_DETAILS)
|
||||||
|
elif item_type == ItemType.SECTOR:
|
||||||
|
self.model.remove_sector(item_id)
|
||||||
|
self.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||||
|
elif item_type == ItemType.CAMPAIGN_PARTICIPANT:
|
||||||
|
self.model.remove_campaign_participant(item_id)
|
||||||
|
self.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||||
elif item_type == ItemType.ROUND:
|
elif item_type == ItemType.ROUND:
|
||||||
camp = self.model.get_campaign_by_round(item_id)
|
camp = self.model.get_campaign_by_round(item_id)
|
||||||
camp_id = camp.id
|
camp_id = camp.id
|
||||||
|
|
@ -345,12 +422,12 @@ class Controller:
|
||||||
|
|
||||||
# Objective methods
|
# Objective methods
|
||||||
|
|
||||||
def _validate_objective_inputs(self, name: str, description: int) -> bool:
|
def _validate_objective_inputs(self, name: str, description: str) -> bool:
|
||||||
if not name.strip():
|
if not name.strip():
|
||||||
QMessageBox.warning(
|
QMessageBox.warning(
|
||||||
self.view,
|
self.view,
|
||||||
"Invalid name",
|
"Invalid name",
|
||||||
"Campaign name cannot be empty."
|
"Objective name cannot be empty."
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
@ -363,7 +440,7 @@ class Controller:
|
||||||
return
|
return
|
||||||
name = dialog.get_objective_name()
|
name = dialog.get_objective_name()
|
||||||
description = dialog.get_objective_description()
|
description = dialog.get_objective_description()
|
||||||
if not name:
|
if not self._validate_objective_inputs(name, description):
|
||||||
return
|
return
|
||||||
self.model.add_objective(self.selected_war_id, name, description)
|
self.model.add_objective(self.selected_war_id, name, description)
|
||||||
self.is_dirty = True
|
self.is_dirty = True
|
||||||
|
|
@ -375,7 +452,7 @@ class Controller:
|
||||||
if not self.selected_war_id:
|
if not self.selected_war_id:
|
||||||
return
|
return
|
||||||
players = self.model.get_available_players(self.selected_war_id)
|
players = self.model.get_available_players(self.selected_war_id)
|
||||||
dialog = ParticipantDialog(self.view, players=players)
|
dialog = WarParticipantDialog(self.view, players=players)
|
||||||
if dialog.exec() != QDialog.DialogCode.Accepted:
|
if dialog.exec() != QDialog.DialogCode.Accepted:
|
||||||
return
|
return
|
||||||
player_id = dialog.get_player_id()
|
player_id = dialog.get_player_id()
|
||||||
|
|
@ -419,6 +496,59 @@ class Controller:
|
||||||
self.is_dirty = True
|
self.is_dirty = True
|
||||||
self.refresh_and_select(RefreshScope.WARS_TREE, item_type=ItemType.CAMPAIGN, item_id=camp.id)
|
self.refresh_and_select(RefreshScope.WARS_TREE, item_type=ItemType.CAMPAIGN, item_id=camp.id)
|
||||||
|
|
||||||
|
# Campaign participant methods
|
||||||
|
|
||||||
|
def add_campaign_participant(self):
|
||||||
|
if not self.selected_campaign_id:
|
||||||
|
return
|
||||||
|
participants = self.model.get_available_war_participants(self.selected_campaign_id)
|
||||||
|
part_opts = [ParticipantOption(id=p.id, name=self.model.get_player_name(p.id)) for p in participants]
|
||||||
|
dialog = CampaignParticipantDialog(self.view, participants=part_opts)
|
||||||
|
if dialog.exec() != QDialog.DialogCode.Accepted:
|
||||||
|
return
|
||||||
|
player_id = dialog.get_player_id()
|
||||||
|
leader = dialog.get_participant_leader()
|
||||||
|
theme = dialog.get_participant_theme()
|
||||||
|
if not player_id:
|
||||||
|
return
|
||||||
|
self.model.add_campaign_participant(self.selected_campaign_id, player_id, leader, theme)
|
||||||
|
self.is_dirty = True
|
||||||
|
self.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||||
|
|
||||||
|
# Sector methods
|
||||||
|
|
||||||
|
def _validate_sector_inputs(self, name: str, round_id: str, major_id: str, minor_id: str, influence_id:str) -> bool:
|
||||||
|
if not name.strip():
|
||||||
|
QMessageBox.warning(
|
||||||
|
self.view,
|
||||||
|
"Invalid name",
|
||||||
|
"Sector name cannot be empty."
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
# allow same objectives in different fields?
|
||||||
|
return True
|
||||||
|
|
||||||
|
def add_sector(self):
|
||||||
|
if not self.selected_campaign_id:
|
||||||
|
return
|
||||||
|
war = self.model.get_war_by_campaign(self.selected_campaign_id)
|
||||||
|
camp = self.model.get_campaign(self.selected_campaign_id)
|
||||||
|
rounds = camp.get_all_rounds()
|
||||||
|
objectives = war.get_all_objectives()
|
||||||
|
dialog = SectorDialog(self.view, default_name="", rounds=rounds, objectives=objectives)
|
||||||
|
if dialog.exec() != QDialog.DialogCode.Accepted:
|
||||||
|
return
|
||||||
|
name = dialog.get_sector_name()
|
||||||
|
round_id = dialog.get_round_id()
|
||||||
|
major_id = dialog.get_major_id()
|
||||||
|
minor_id = dialog.get_minor_id()
|
||||||
|
influence_id = dialog.get_influence_id()
|
||||||
|
if not self._validate_sector_inputs(name, round_id, major_id, minor_id, influence_id):
|
||||||
|
return
|
||||||
|
self.model.add_sector(self.selected_campaign_id, name, round_id, major_id, minor_id, influence_id)
|
||||||
|
self.is_dirty = True
|
||||||
|
self.refresh(RefreshScope.CAMPAIGN_DETAILS)
|
||||||
|
|
||||||
# Round methods
|
# Round methods
|
||||||
|
|
||||||
def add_round(self):
|
def add_round(self):
|
||||||
|
|
|
||||||
6
src/warchron/controller/dtos.py
Normal file
6
src/warchron/controller/dtos.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
@dataclass(frozen=True)
|
||||||
|
class ParticipantOption:
|
||||||
|
id: str
|
||||||
|
name: str
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from warchron.model.round import Round
|
from warchron.model.round import Round
|
||||||
|
|
||||||
|
|
@ -9,8 +8,8 @@ class Campaign:
|
||||||
self.id: str = str(uuid4())
|
self.id: str = str(uuid4())
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
self.month: int = month
|
self.month: int = month
|
||||||
self.participants = {}
|
self.participants: dict[str, CampaignParticipant] = {}
|
||||||
self.sectors = {}
|
self.sectors: dict[str, Sector] = {}
|
||||||
self.rounds = []
|
self.rounds = []
|
||||||
self.is_over = False
|
self.is_over = False
|
||||||
|
|
||||||
|
|
@ -46,6 +45,61 @@ class Campaign:
|
||||||
camp.set_state(data.get("is_over", False))
|
camp.set_state(data.get("is_over", False))
|
||||||
return camp
|
return camp
|
||||||
|
|
||||||
|
# Campaign participant methods
|
||||||
|
|
||||||
|
def get_all_campaign_participants_ids(self) -> set[str]:
|
||||||
|
return set(self.participants.keys())
|
||||||
|
|
||||||
|
def has_participant(self, player_id: str) -> bool:
|
||||||
|
return player_id in self.participants
|
||||||
|
|
||||||
|
def add_campaign_participant(self, player_id: str, leader: str, theme: str) -> CampaignParticipant:
|
||||||
|
if player_id in self.participants:
|
||||||
|
raise ValueError("Player already registered in this campaign")
|
||||||
|
participant = CampaignParticipant(player_id, leader, theme)
|
||||||
|
self.participants[participant.id] = participant
|
||||||
|
return participant
|
||||||
|
|
||||||
|
def get_campaign_participant(self, id: str) -> CampaignParticipant:
|
||||||
|
return self.participants[id]
|
||||||
|
|
||||||
|
def get_all_campaign_participants(self) -> list[CampaignParticipant]:
|
||||||
|
return list(self.participants.values())
|
||||||
|
|
||||||
|
def update_campaign_participant(self, player_id: str, *, leader: str, theme: str):
|
||||||
|
part = self.get_campaign_participant(player_id)
|
||||||
|
part.set_leader(leader)
|
||||||
|
part.set_theme(theme)
|
||||||
|
|
||||||
|
def remove_campaign_participant(self, player_id: str):
|
||||||
|
del self.participants[player_id]
|
||||||
|
|
||||||
|
# Sector methods
|
||||||
|
|
||||||
|
def add_sector(self, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str) -> Sector:
|
||||||
|
sect = Sector(name, round_id, major_id, minor_id, influence_id)
|
||||||
|
self.sectors[sect.id] = sect
|
||||||
|
return sect
|
||||||
|
|
||||||
|
def get_sector(self, id: str) -> Sector:
|
||||||
|
return self.sectors[id]
|
||||||
|
|
||||||
|
def get_all_sectors(self) -> list[Sector]:
|
||||||
|
return list(self.sectors.values())
|
||||||
|
|
||||||
|
def update_sector(self, sector_id: str, *, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str):
|
||||||
|
sect = self.get_sector(sector_id)
|
||||||
|
sect.set_name(name)
|
||||||
|
sect.set_round(round_id)
|
||||||
|
sect.set_major(major_id)
|
||||||
|
sect.set_minor(minor_id)
|
||||||
|
sect.set_influence(influence_id)
|
||||||
|
|
||||||
|
def remove_sector(self, sector_id: str):
|
||||||
|
del self.sectors[sector_id]
|
||||||
|
|
||||||
|
# Round methods
|
||||||
|
|
||||||
def has_round(self, round_id: str) -> bool:
|
def has_round(self, round_id: str) -> bool:
|
||||||
return any(r.id == round_id for r in self.rounds)
|
return any(r.id == round_id for r in self.rounds)
|
||||||
|
|
||||||
|
|
@ -66,23 +120,59 @@ class Campaign:
|
||||||
self.rounds.remove(rnd)
|
self.rounds.remove(rnd)
|
||||||
|
|
||||||
def get_round_index(self, round_id: str) -> int:
|
def get_round_index(self, round_id: str) -> int:
|
||||||
|
if round_id is None:
|
||||||
|
return None
|
||||||
for index, rnd in enumerate(self.rounds, start=1):
|
for index, rnd in enumerate(self.rounds, start=1):
|
||||||
if rnd.id == round_id:
|
if rnd.id == round_id:
|
||||||
return index
|
return index
|
||||||
raise KeyError("Round not found in campaign")
|
raise KeyError("Round not found in campaign")
|
||||||
|
|
||||||
|
def get_round_name(self, round_id: str | None) -> str:
|
||||||
|
if round_id is None:
|
||||||
|
return ""
|
||||||
|
for rnd in self.rounds:
|
||||||
|
if rnd.id == round_id:
|
||||||
|
return rnd.name
|
||||||
|
return ""
|
||||||
|
|
||||||
class CampaignParticipant:
|
class CampaignParticipant:
|
||||||
def __init__(self,war_participant_id: str, leader: str):
|
def __init__(self,player_id: str, leader: str, theme: str):
|
||||||
self.id: str = war_participant_id # ref to War.participants
|
self.id: str = player_id # ref to War.participants
|
||||||
self.leader: str = leader
|
self.leader: str = leader
|
||||||
self.victory_points = 0
|
self.theme: str = theme
|
||||||
self.objective_points = {}
|
|
||||||
|
def set_id(self, new_id: str):
|
||||||
|
self.id = new_id
|
||||||
|
|
||||||
|
def set_leader(self, new_faction: str):
|
||||||
|
self.leader = new_faction
|
||||||
|
|
||||||
|
def set_theme(self, new_theme: str):
|
||||||
|
self.theme = new_theme
|
||||||
|
|
||||||
class Sector:
|
class Sector:
|
||||||
def __init__(self, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str):
|
def __init__(self, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str):
|
||||||
self.id: str = str(uuid4())
|
self.id: str = str(uuid4())
|
||||||
self.name: str = name
|
self.name: str = name
|
||||||
|
self.round_id: str = round_id
|
||||||
self.major_objective_id: str = major_id
|
self.major_objective_id: str = major_id
|
||||||
self.minor_objective_id: str = minor_id
|
self.minor_objective_id: str = minor_id
|
||||||
self.influence_objective_id: str = influence_id
|
self.influence_objective_id: str = influence_id
|
||||||
self.round_id: str = round_id
|
|
||||||
|
def set_id(self, new_id: str):
|
||||||
|
self.id = new_id
|
||||||
|
|
||||||
|
def set_name(self, new_name: str):
|
||||||
|
self.name = new_name
|
||||||
|
|
||||||
|
def set_round(self, new_round_id: str):
|
||||||
|
self.round_id = new_round_id
|
||||||
|
|
||||||
|
def set_major(self, new_major_id: str):
|
||||||
|
self.major_objective_id = new_major_id
|
||||||
|
|
||||||
|
def set_minor(self, new_minor_id: str):
|
||||||
|
self.minor_objective_id = new_minor_id
|
||||||
|
|
||||||
|
def set_influence(self, new_influence_id: str):
|
||||||
|
self.influence_objective_id = new_influence_id
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from datetime import datetime
|
||||||
|
|
||||||
from warchron.model.player import Player
|
from warchron.model.player import Player
|
||||||
from warchron.model.war import War, Objective, WarParticipant
|
from warchron.model.war import War, Objective, WarParticipant
|
||||||
from warchron.model.campaign import Campaign
|
from warchron.model.campaign import Campaign, Sector, CampaignParticipant
|
||||||
from warchron.model.round import Round
|
from warchron.model.round import Round
|
||||||
|
|
||||||
class Model:
|
class Model:
|
||||||
|
|
@ -156,7 +156,7 @@ class Model:
|
||||||
if not war.has_participant(player.id)
|
if not war.has_participant(player.id)
|
||||||
]
|
]
|
||||||
|
|
||||||
def add_war_participant(self, war_id: str, player_id: str, faction: str) -> Objective:
|
def add_war_participant(self, war_id: str, player_id: str, faction: str) -> WarParticipant:
|
||||||
war = self.get_war(war_id)
|
war = self.get_war(war_id)
|
||||||
return war.add_war_participant(player_id, faction)
|
return war.add_war_participant(player_id, faction)
|
||||||
|
|
||||||
|
|
@ -199,6 +199,20 @@ class Model:
|
||||||
return camp
|
return camp
|
||||||
raise KeyError(f"Round {round_id} not found")
|
raise KeyError(f"Round {round_id} not found")
|
||||||
|
|
||||||
|
def get_campaign_by_campaign_participant(self, participant_id: str) -> Campaign:
|
||||||
|
for war in self.wars.values():
|
||||||
|
camp = war.get_campaign_by_campaign_participant(participant_id)
|
||||||
|
if camp is not None:
|
||||||
|
return camp
|
||||||
|
raise KeyError(f"Participant {participant_id} not found")
|
||||||
|
|
||||||
|
def get_campaign_by_sector(self, sector_id: str) -> Campaign:
|
||||||
|
for war in self.wars.values():
|
||||||
|
camp = war.get_campaign_by_sector(sector_id)
|
||||||
|
if camp is not None:
|
||||||
|
return camp
|
||||||
|
raise KeyError(f"Sector {sector_id} not found")
|
||||||
|
|
||||||
def update_campaign(self, campaign_id: str, *, name: str, month: int):
|
def update_campaign(self, campaign_id: str, *, name: str, month: int):
|
||||||
war = self.get_war_by_campaign(campaign_id)
|
war = self.get_war_by_campaign(campaign_id)
|
||||||
war.update_campaign(campaign_id, name=name, month=month)
|
war.update_campaign(campaign_id, name=name, month=month)
|
||||||
|
|
@ -207,16 +221,64 @@ class Model:
|
||||||
war = self.get_war_by_campaign(campaign_id)
|
war = self.get_war_by_campaign(campaign_id)
|
||||||
war.remove_campaign(campaign_id)
|
war.remove_campaign(campaign_id)
|
||||||
|
|
||||||
|
# Sector methods
|
||||||
|
|
||||||
|
def add_sector(self, campaign_id: str, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str) -> Sector:
|
||||||
|
camp = self.get_campaign(campaign_id)
|
||||||
|
return camp.add_sector(name, round_id, major_id, minor_id, influence_id)
|
||||||
|
|
||||||
|
def get_sector(self, sector_id) -> Sector:
|
||||||
|
for war in self.wars.values():
|
||||||
|
for camp in war.campaigns:
|
||||||
|
for sect in camp.sectors.values():
|
||||||
|
if sect.id == sector_id:
|
||||||
|
return sect
|
||||||
|
raise KeyError("Sector not found")
|
||||||
|
|
||||||
|
def update_sector(self, sector_id: str, *, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str):
|
||||||
|
camp = self.get_campaign_by_sector(sector_id)
|
||||||
|
camp.update_sector(sector_id, name=name, round_id=round_id, major_id=major_id, minor_id=minor_id, influence_id=influence_id)
|
||||||
|
|
||||||
|
def remove_sector(self, sector_id: str):
|
||||||
|
camp = self.get_campaign_by_sector(sector_id)
|
||||||
|
camp.remove_sector(sector_id)
|
||||||
|
|
||||||
|
# Campaign participant methods
|
||||||
|
|
||||||
|
def get_available_war_participants(self, campaign_id: str) -> list[WarParticipant]:
|
||||||
|
war = self.get_war_by_campaign(campaign_id)
|
||||||
|
return war.get_available_war_participants(campaign_id)
|
||||||
|
|
||||||
|
def add_campaign_participant(self, camp_id: str, player_id: str, leader: str, theme: str) -> CampaignParticipant:
|
||||||
|
camp = self.get_campaign(camp_id)
|
||||||
|
return camp.add_campaign_participant(player_id, leader, theme)
|
||||||
|
|
||||||
|
def get_campaign_participant(self, participant_id) -> CampaignParticipant:
|
||||||
|
for war in self.wars.values():
|
||||||
|
for camp in war.campaigns:
|
||||||
|
for part in camp.participants.values():
|
||||||
|
if part.id == participant_id:
|
||||||
|
return part
|
||||||
|
raise KeyError("Participant not found")
|
||||||
|
|
||||||
|
def update_campaign_participant(self, participant_id: str, *, leader: str, theme: str):
|
||||||
|
camp = self.get_campaign_by_campaign_participant(participant_id)
|
||||||
|
camp.update_campaign_participant(participant_id, leader=leader, theme=theme)
|
||||||
|
|
||||||
|
def remove_campaign_participant(self, participant_id: str):
|
||||||
|
camp = self.get_campaign_by_campaign_participant(participant_id)
|
||||||
|
camp.remove_campaign_participant(participant_id)
|
||||||
|
|
||||||
# Round methods
|
# Round methods
|
||||||
|
|
||||||
def add_round(self, campaign_id: str) -> Round:
|
def add_round(self, campaign_id: str) -> Round:
|
||||||
campaign = self.get_campaign(campaign_id)
|
camp = self.get_campaign(campaign_id)
|
||||||
return campaign.add_round()
|
return camp.add_round()
|
||||||
|
|
||||||
def get_round(self, round_id: str) -> Round:
|
def get_round(self, round_id: str) -> Round:
|
||||||
for war in self.wars.values():
|
for war in self.wars.values():
|
||||||
for campaign in war.campaigns:
|
for camp in war.campaigns:
|
||||||
for rnd in campaign.rounds:
|
for rnd in camp.rounds:
|
||||||
if rnd.id == round_id:
|
if rnd.id == round_id:
|
||||||
return rnd
|
return rnd
|
||||||
raise KeyError("Round not found")
|
raise KeyError("Round not found")
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from warchron.model.campaign import Campaign
|
from warchron.model.campaign import Campaign, Sector, CampaignParticipant
|
||||||
|
|
||||||
|
|
||||||
class War:
|
class War:
|
||||||
|
|
@ -50,9 +50,9 @@ class War:
|
||||||
# Objective methods
|
# Objective methods
|
||||||
|
|
||||||
def add_objective(self, name: str, description: str) -> Objective:
|
def add_objective(self, name: str, description: str) -> Objective:
|
||||||
objective = Objective(name, description)
|
obj = Objective(name, description)
|
||||||
self.objectives[objective.id] = objective
|
self.objectives[obj.id] = obj
|
||||||
return objective
|
return obj
|
||||||
|
|
||||||
def get_objective(self, id: str) -> Objective:
|
def get_objective(self, id: str) -> Objective:
|
||||||
return self.objectives[id]
|
return self.objectives[id]
|
||||||
|
|
@ -60,6 +60,12 @@ class War:
|
||||||
def get_all_objectives(self) -> list[Objective]:
|
def get_all_objectives(self) -> list[Objective]:
|
||||||
return list(self.objectives.values())
|
return list(self.objectives.values())
|
||||||
|
|
||||||
|
def get_objective_name(self, objective_id: str | None) -> str:
|
||||||
|
if objective_id is None:
|
||||||
|
return ""
|
||||||
|
obj = self.objectives.get(objective_id)
|
||||||
|
return obj.name if obj else ""
|
||||||
|
|
||||||
def update_objective(self, objective_id: str, *, name: str, description: str):
|
def update_objective(self, objective_id: str, *, name: str, description: str):
|
||||||
obj = self.get_objective(objective_id)
|
obj = self.get_objective(objective_id)
|
||||||
obj.set_name(name)
|
obj.set_name(name)
|
||||||
|
|
@ -126,6 +132,20 @@ class War:
|
||||||
return camp
|
return camp
|
||||||
raise KeyError(f"Round {round_id} not found in any Campaign")
|
raise KeyError(f"Round {round_id} not found in any Campaign")
|
||||||
|
|
||||||
|
def get_campaign_by_sector(self, sector_id: str) -> Campaign:
|
||||||
|
for camp in self.campaigns:
|
||||||
|
for sect in camp.sectors.values():
|
||||||
|
if sect.id == sector_id:
|
||||||
|
return camp
|
||||||
|
raise KeyError(f"Sector {sector_id} not found in any Campaign")
|
||||||
|
|
||||||
|
def get_campaign_by_campaign_participant(self, participant_id: str) -> Campaign:
|
||||||
|
for camp in self.campaigns:
|
||||||
|
for part in camp.participants.values():
|
||||||
|
if part.id == participant_id:
|
||||||
|
return camp
|
||||||
|
raise KeyError(f"Participant {participant_id} not found in any Campaign")
|
||||||
|
|
||||||
def update_campaign(self, campaign_id: str, *, name: str, month: int):
|
def update_campaign(self, campaign_id: str, *, name: str, month: int):
|
||||||
camp = self.get_campaign(campaign_id)
|
camp = self.get_campaign(campaign_id)
|
||||||
camp.set_name(name)
|
camp.set_name(name)
|
||||||
|
|
@ -138,6 +158,52 @@ class War:
|
||||||
camp = self.get_campaign(campaign_id)
|
camp = self.get_campaign(campaign_id)
|
||||||
self.campaigns.remove(camp)
|
self.campaigns.remove(camp)
|
||||||
|
|
||||||
|
# Sector methods
|
||||||
|
|
||||||
|
def add_sector(self, campaign_id, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str) -> Sector:
|
||||||
|
camp = self.get_campaign(campaign_id)
|
||||||
|
return camp.add_sector(name, round_id, major_id, minor_id, influence_id)
|
||||||
|
|
||||||
|
def get_sector(self, id: str) -> Sector:
|
||||||
|
return self.sectors[id]
|
||||||
|
|
||||||
|
def update_sector(self, objective_id: str, *, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str):
|
||||||
|
obj = self.get_objective(objective_id)
|
||||||
|
obj.set_name(name)
|
||||||
|
|
||||||
|
def remove_sector(self, sector_id: str):
|
||||||
|
camp = self.get_campaign_by_sector(sector_id)
|
||||||
|
camp.remove_sector(sector_id)
|
||||||
|
|
||||||
|
# Campaign participant methods
|
||||||
|
|
||||||
|
def get_available_war_participants(self, campaign_id: str) -> list[WarParticipant]:
|
||||||
|
camp = self.get_campaign(campaign_id)
|
||||||
|
return [
|
||||||
|
part
|
||||||
|
for part in self.participants.values()
|
||||||
|
if not camp.has_participant(part.id)
|
||||||
|
]
|
||||||
|
|
||||||
|
def add_campaign_participant(self, campaign_id: str, player_id: str, leader: str, theme: str) -> CampaignParticipant:
|
||||||
|
camp = self.get_campaign(campaign_id)
|
||||||
|
return camp.add_campaign_participant(player_id, leader, theme)
|
||||||
|
|
||||||
|
def get_campaign_participant(self, participant_id) -> CampaignParticipant:
|
||||||
|
for camp in self.campaigns.values():
|
||||||
|
for part in camp.participants.values():
|
||||||
|
if part.id == participant_id:
|
||||||
|
return part
|
||||||
|
raise KeyError("Participant not found")
|
||||||
|
|
||||||
|
def update_campaign_participant(self, participant_id: str, *, faction: str):
|
||||||
|
camp = self.get_campaign_by_campaign_participant(participant_id)
|
||||||
|
camp.update_campaign_participant(participant_id, faction=faction)
|
||||||
|
|
||||||
|
def remove_campaign_participant(self, participant_id: str):
|
||||||
|
camp = self.get_campaign_by_campaign_participant(participant_id)
|
||||||
|
camp.remove_campaign_participant(participant_id)
|
||||||
|
|
||||||
class Objective:
|
class Objective:
|
||||||
def __init__(self, name: str, description: str):
|
def __init__(self, name: str, description: str):
|
||||||
self.id: str = str(uuid4())
|
self.id: str = str(uuid4())
|
||||||
|
|
|
||||||
|
|
@ -17,25 +17,27 @@ class Ui_campaignDialog(object):
|
||||||
icon = QtGui.QIcon()
|
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)
|
||||||
campaignDialog.setWindowIcon(icon)
|
campaignDialog.setWindowIcon(icon)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=campaignDialog)
|
self.formLayout = QtWidgets.QFormLayout(campaignDialog)
|
||||||
self.buttonBox.setGeometry(QtCore.QRect(10, 60, 341, 32))
|
self.formLayout.setObjectName("formLayout")
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
|
||||||
self.label = QtWidgets.QLabel(parent=campaignDialog)
|
self.label = QtWidgets.QLabel(parent=campaignDialog)
|
||||||
self.label.setGeometry(QtCore.QRect(10, 20, 47, 14))
|
|
||||||
self.label.setObjectName("label")
|
self.label.setObjectName("label")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||||
self.campaignName = QtWidgets.QLineEdit(parent=campaignDialog)
|
self.campaignName = QtWidgets.QLineEdit(parent=campaignDialog)
|
||||||
self.campaignName.setGeometry(QtCore.QRect(60, 20, 113, 20))
|
|
||||||
self.campaignName.setObjectName("campaignName")
|
self.campaignName.setObjectName("campaignName")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.campaignName)
|
||||||
self.label_2 = QtWidgets.QLabel(parent=campaignDialog)
|
self.label_2 = QtWidgets.QLabel(parent=campaignDialog)
|
||||||
self.label_2.setGeometry(QtCore.QRect(10, 50, 47, 14))
|
|
||||||
self.label_2.setObjectName("label_2")
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||||
self.campaignMonth = QtWidgets.QSpinBox(parent=campaignDialog)
|
self.campaignMonth = QtWidgets.QSpinBox(parent=campaignDialog)
|
||||||
self.campaignMonth.setGeometry(QtCore.QRect(60, 50, 71, 22))
|
|
||||||
self.campaignMonth.setMinimum(1)
|
self.campaignMonth.setMinimum(1)
|
||||||
self.campaignMonth.setMaximum(12)
|
self.campaignMonth.setMaximum(12)
|
||||||
self.campaignMonth.setObjectName("campaignMonth")
|
self.campaignMonth.setObjectName("campaignMonth")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.campaignMonth)
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=campaignDialog)
|
||||||
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||||
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
|
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||||
|
|
||||||
self.retranslateUi(campaignDialog)
|
self.retranslateUi(campaignDialog)
|
||||||
self.buttonBox.accepted.connect(campaignDialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(campaignDialog.accept) # type: ignore
|
||||||
|
|
|
||||||
|
|
@ -20,67 +20,26 @@
|
||||||
<iconset>
|
<iconset>
|
||||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>341</width>
|
|
||||||
<height>32</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>14</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name:</string>
|
<string>Name:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLineEdit" name="campaignName">
|
</item>
|
||||||
<property name="geometry">
|
<item row="0" column="1">
|
||||||
<rect>
|
<widget class="QLineEdit" name="campaignName"/>
|
||||||
<x>60</x>
|
</item>
|
||||||
<y>20</y>
|
<item row="1" column="0">
|
||||||
<width>113</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>50</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>14</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Month:</string>
|
<string>Month:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="campaignMonth">
|
<widget class="QSpinBox" name="campaignMonth">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>50</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -88,6 +47,18 @@
|
||||||
<number>12</number>
|
<number>12</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
|
|
||||||
72
src/warchron/view/ui/ui_campaign_participant_dialog.py
Normal file
72
src/warchron/view/ui/ui_campaign_participant_dialog.py
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_campaign_participant_dialog.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt6 UI code generator 6.7.1
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_campaignParticipantDialog(object):
|
||||||
|
def setupUi(self, campaignParticipantDialog):
|
||||||
|
campaignParticipantDialog.setObjectName("campaignParticipantDialog")
|
||||||
|
campaignParticipantDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||||
|
campaignParticipantDialog.resize(394, 124)
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
|
campaignParticipantDialog.setWindowIcon(icon)
|
||||||
|
self.formLayout = QtWidgets.QFormLayout(campaignParticipantDialog)
|
||||||
|
self.formLayout.setObjectName("formLayout")
|
||||||
|
self.label = QtWidgets.QLabel(parent=campaignParticipantDialog)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||||
|
self.playerComboBox = QtWidgets.QComboBox(parent=campaignParticipantDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.playerComboBox.sizePolicy().hasHeightForWidth())
|
||||||
|
self.playerComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.playerComboBox.setObjectName("playerComboBox")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.playerComboBox)
|
||||||
|
self.label_2 = QtWidgets.QLabel(parent=campaignParticipantDialog)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||||
|
self.leader = QtWidgets.QLineEdit(parent=campaignParticipantDialog)
|
||||||
|
self.leader.setObjectName("leader")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.leader)
|
||||||
|
self.label_3 = QtWidgets.QLabel(parent=campaignParticipantDialog)
|
||||||
|
self.label_3.setObjectName("label_3")
|
||||||
|
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
|
||||||
|
self.theme = QtWidgets.QLineEdit(parent=campaignParticipantDialog)
|
||||||
|
self.theme.setText("")
|
||||||
|
self.theme.setObjectName("theme")
|
||||||
|
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.theme)
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=campaignParticipantDialog)
|
||||||
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||||
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
|
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||||
|
|
||||||
|
self.retranslateUi(campaignParticipantDialog)
|
||||||
|
self.buttonBox.accepted.connect(campaignParticipantDialog.accept) # type: ignore
|
||||||
|
self.buttonBox.rejected.connect(campaignParticipantDialog.reject) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(campaignParticipantDialog)
|
||||||
|
|
||||||
|
def retranslateUi(self, campaignParticipantDialog):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
campaignParticipantDialog.setWindowTitle(_translate("campaignParticipantDialog", "Campaign participant"))
|
||||||
|
self.label.setText(_translate("campaignParticipantDialog", "Player"))
|
||||||
|
self.label_2.setText(_translate("campaignParticipantDialog", "Leader"))
|
||||||
|
self.label_3.setText(_translate("campaignParticipantDialog", "Theme"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import sys
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
campaignParticipantDialog = QtWidgets.QDialog()
|
||||||
|
ui = Ui_campaignParticipantDialog()
|
||||||
|
ui.setupUi(campaignParticipantDialog)
|
||||||
|
campaignParticipantDialog.show()
|
||||||
|
sys.exit(app.exec())
|
||||||
112
src/warchron/view/ui/ui_campaign_participant_dialog.ui
Normal file
112
src/warchron/view/ui/ui_campaign_participant_dialog.ui
Normal file
|
|
@ -0,0 +1,112 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>campaignParticipantDialog</class>
|
||||||
|
<widget class="QDialog" name="campaignParticipantDialog">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::ApplicationModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>394</width>
|
||||||
|
<height>124</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Campaign participant</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Player</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="playerComboBox">
|
||||||
|
<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_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Leader</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="leader"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Theme</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="theme">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>campaignParticipantDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>campaignParticipantDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
|
|
@ -12,19 +12,29 @@ from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
class Ui_MainWindow(object):
|
class Ui_MainWindow(object):
|
||||||
def setupUi(self, MainWindow):
|
def setupUi(self, MainWindow):
|
||||||
MainWindow.setObjectName("MainWindow")
|
MainWindow.setObjectName("MainWindow")
|
||||||
MainWindow.resize(800, 600)
|
MainWindow.resize(1288, 817)
|
||||||
icon = QtGui.QIcon()
|
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)
|
||||||
MainWindow.setWindowIcon(icon)
|
MainWindow.setWindowIcon(icon)
|
||||||
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
||||||
self.centralwidget.setObjectName("centralwidget")
|
self.centralwidget.setObjectName("centralwidget")
|
||||||
|
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||||
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget)
|
self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget)
|
||||||
self.tabWidget.setGeometry(QtCore.QRect(16, 9, 771, 531))
|
|
||||||
self.tabWidget.setObjectName("tabWidget")
|
self.tabWidget.setObjectName("tabWidget")
|
||||||
self.playersTab = QtWidgets.QWidget()
|
self.playersTab = QtWidgets.QWidget()
|
||||||
self.playersTab.setObjectName("playersTab")
|
self.playersTab.setObjectName("playersTab")
|
||||||
|
self.gridLayout = QtWidgets.QGridLayout(self.playersTab)
|
||||||
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
|
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
|
self.addPlayerBtn = QtWidgets.QPushButton(parent=self.playersTab)
|
||||||
|
self.addPlayerBtn.setObjectName("addPlayerBtn")
|
||||||
|
self.horizontalLayout.addWidget(self.addPlayerBtn)
|
||||||
|
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
|
self.horizontalLayout.addItem(spacerItem)
|
||||||
|
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
|
||||||
self.playersTable = QtWidgets.QTableWidget(parent=self.playersTab)
|
self.playersTable = QtWidgets.QTableWidget(parent=self.playersTab)
|
||||||
self.playersTable.setGeometry(QtCore.QRect(10, 60, 741, 431))
|
|
||||||
self.playersTable.setObjectName("playersTable")
|
self.playersTable.setObjectName("playersTable")
|
||||||
self.playersTable.setColumnCount(4)
|
self.playersTable.setColumnCount(4)
|
||||||
self.playersTable.setRowCount(0)
|
self.playersTable.setRowCount(0)
|
||||||
|
|
@ -36,59 +46,60 @@ class Ui_MainWindow(object):
|
||||||
self.playersTable.setHorizontalHeaderItem(2, item)
|
self.playersTable.setHorizontalHeaderItem(2, item)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.playersTable.setHorizontalHeaderItem(3, item)
|
self.playersTable.setHorizontalHeaderItem(3, item)
|
||||||
self.addPlayerBtn = QtWidgets.QPushButton(parent=self.playersTab)
|
self.gridLayout.addWidget(self.playersTable, 1, 0, 1, 1)
|
||||||
self.addPlayerBtn.setGeometry(QtCore.QRect(20, 20, 75, 23))
|
|
||||||
self.addPlayerBtn.setObjectName("addPlayerBtn")
|
|
||||||
icon1 = QtGui.QIcon()
|
icon1 = QtGui.QIcon()
|
||||||
icon1.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/users.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon1.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/users.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.tabWidget.addTab(self.playersTab, icon1, "")
|
self.tabWidget.addTab(self.playersTab, icon1, "")
|
||||||
self.warsTab = QtWidgets.QWidget()
|
self.warsTab = QtWidgets.QWidget()
|
||||||
self.warsTab.setObjectName("warsTab")
|
self.warsTab.setObjectName("warsTab")
|
||||||
self.warsTree = QtWidgets.QTreeWidget(parent=self.warsTab)
|
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.warsTab)
|
||||||
self.warsTree.setGeometry(QtCore.QRect(10, 60, 211, 431))
|
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||||
self.warsTree.setObjectName("warsTree")
|
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
self.addWarBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
self.addWarBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
||||||
self.addWarBtn.setGeometry(QtCore.QRect(20, 20, 75, 23))
|
|
||||||
self.addWarBtn.setObjectName("addWarBtn")
|
self.addWarBtn.setObjectName("addWarBtn")
|
||||||
|
self.horizontalLayout_2.addWidget(self.addWarBtn)
|
||||||
self.addCampaignBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
self.addCampaignBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
||||||
self.addCampaignBtn.setEnabled(False)
|
self.addCampaignBtn.setEnabled(False)
|
||||||
self.addCampaignBtn.setGeometry(QtCore.QRect(110, 20, 91, 23))
|
|
||||||
self.addCampaignBtn.setObjectName("addCampaignBtn")
|
self.addCampaignBtn.setObjectName("addCampaignBtn")
|
||||||
|
self.horizontalLayout_2.addWidget(self.addCampaignBtn)
|
||||||
self.addRoundBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
self.addRoundBtn = QtWidgets.QPushButton(parent=self.warsTab)
|
||||||
self.addRoundBtn.setEnabled(False)
|
self.addRoundBtn.setEnabled(False)
|
||||||
self.addRoundBtn.setGeometry(QtCore.QRect(220, 20, 91, 23))
|
|
||||||
self.addRoundBtn.setObjectName("addRoundBtn")
|
self.addRoundBtn.setObjectName("addRoundBtn")
|
||||||
|
self.horizontalLayout_2.addWidget(self.addRoundBtn)
|
||||||
|
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
|
self.horizontalLayout_2.addItem(spacerItem1)
|
||||||
|
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||||
|
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||||
|
self.warsTree = QtWidgets.QTreeWidget(parent=self.warsTab)
|
||||||
|
self.warsTree.setObjectName("warsTree")
|
||||||
|
self.horizontalLayout_6.addWidget(self.warsTree)
|
||||||
self.selectedDetailsStack = QtWidgets.QStackedWidget(parent=self.warsTab)
|
self.selectedDetailsStack = QtWidgets.QStackedWidget(parent=self.warsTab)
|
||||||
self.selectedDetailsStack.setGeometry(QtCore.QRect(239, 59, 511, 431))
|
|
||||||
self.selectedDetailsStack.setObjectName("selectedDetailsStack")
|
self.selectedDetailsStack.setObjectName("selectedDetailsStack")
|
||||||
self.pageEmpty = QtWidgets.QWidget()
|
self.pageEmpty = QtWidgets.QWidget()
|
||||||
self.pageEmpty.setObjectName("pageEmpty")
|
self.pageEmpty.setObjectName("pageEmpty")
|
||||||
|
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.pageEmpty)
|
||||||
|
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||||
|
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_7.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetDefaultConstraint)
|
||||||
|
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||||
|
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
|
self.horizontalLayout_7.addItem(spacerItem2)
|
||||||
self.labelSelect = QtWidgets.QLabel(parent=self.pageEmpty)
|
self.labelSelect = QtWidgets.QLabel(parent=self.pageEmpty)
|
||||||
self.labelSelect.setGeometry(QtCore.QRect(110, 30, 301, 51))
|
|
||||||
self.labelSelect.setObjectName("labelSelect")
|
self.labelSelect.setObjectName("labelSelect")
|
||||||
|
self.horizontalLayout_7.addWidget(self.labelSelect)
|
||||||
|
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
|
self.horizontalLayout_7.addItem(spacerItem3)
|
||||||
|
self.verticalLayout_4.addLayout(self.horizontalLayout_7)
|
||||||
self.selectedDetailsStack.addWidget(self.pageEmpty)
|
self.selectedDetailsStack.addWidget(self.pageEmpty)
|
||||||
self.pageWar = QtWidgets.QWidget()
|
self.pageWar = QtWidgets.QWidget()
|
||||||
self.pageWar.setObjectName("pageWar")
|
self.pageWar.setObjectName("pageWar")
|
||||||
self.warName = QtWidgets.QLabel(parent=self.pageWar)
|
self.gridLayout_3 = QtWidgets.QGridLayout(self.pageWar)
|
||||||
self.warName.setGeometry(QtCore.QRect(10, 10, 241, 16))
|
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||||
font = QtGui.QFont()
|
self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
|
||||||
font.setPointSize(12)
|
self.horizontalLayout_10.setObjectName("horizontalLayout_10")
|
||||||
self.warName.setFont(font)
|
|
||||||
self.warName.setObjectName("warName")
|
|
||||||
self.warYear = QtWidgets.QLabel(parent=self.pageWar)
|
|
||||||
self.warYear.setGeometry(QtCore.QRect(280, 10, 71, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(12)
|
|
||||||
self.warYear.setFont(font)
|
|
||||||
self.warYear.setObjectName("warYear")
|
|
||||||
self.labelParticipants = QtWidgets.QLabel(parent=self.pageWar)
|
|
||||||
self.labelParticipants.setGeometry(QtCore.QRect(10, 150, 111, 16))
|
|
||||||
self.labelParticipants.setObjectName("labelParticipants")
|
|
||||||
self.addWarParticipantBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
|
||||||
self.addWarParticipantBtn.setGeometry(QtCore.QRect(420, 270, 81, 23))
|
|
||||||
self.addWarParticipantBtn.setObjectName("addWarParticipantBtn")
|
|
||||||
self.warParticipantsTable = QtWidgets.QTableWidget(parent=self.pageWar)
|
self.warParticipantsTable = QtWidgets.QTableWidget(parent=self.pageWar)
|
||||||
self.warParticipantsTable.setGeometry(QtCore.QRect(10, 170, 401, 211))
|
|
||||||
self.warParticipantsTable.setObjectName("warParticipantsTable")
|
self.warParticipantsTable.setObjectName("warParticipantsTable")
|
||||||
self.warParticipantsTable.setColumnCount(5)
|
self.warParticipantsTable.setColumnCount(5)
|
||||||
self.warParticipantsTable.setRowCount(0)
|
self.warParticipantsTable.setRowCount(0)
|
||||||
|
|
@ -102,12 +113,14 @@ class Ui_MainWindow(object):
|
||||||
self.warParticipantsTable.setHorizontalHeaderItem(3, item)
|
self.warParticipantsTable.setHorizontalHeaderItem(3, item)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.warParticipantsTable.setHorizontalHeaderItem(4, item)
|
self.warParticipantsTable.setHorizontalHeaderItem(4, item)
|
||||||
self.endWarBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
self.horizontalLayout_10.addWidget(self.warParticipantsTable)
|
||||||
self.endWarBtn.setEnabled(True)
|
self.addWarParticipantBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
||||||
self.endWarBtn.setGeometry(QtCore.QRect(230, 400, 61, 23))
|
self.addWarParticipantBtn.setObjectName("addWarParticipantBtn")
|
||||||
self.endWarBtn.setObjectName("endWarBtn")
|
self.horizontalLayout_10.addWidget(self.addWarParticipantBtn)
|
||||||
|
self.gridLayout_3.addLayout(self.horizontalLayout_10, 4, 0, 1, 4)
|
||||||
|
self.horizontalLayout_9 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_9.setObjectName("horizontalLayout_9")
|
||||||
self.objectivesTable = QtWidgets.QTableWidget(parent=self.pageWar)
|
self.objectivesTable = QtWidgets.QTableWidget(parent=self.pageWar)
|
||||||
self.objectivesTable.setGeometry(QtCore.QRect(10, 60, 401, 71))
|
|
||||||
self.objectivesTable.setObjectName("objectivesTable")
|
self.objectivesTable.setObjectName("objectivesTable")
|
||||||
self.objectivesTable.setColumnCount(2)
|
self.objectivesTable.setColumnCount(2)
|
||||||
self.objectivesTable.setRowCount(0)
|
self.objectivesTable.setRowCount(0)
|
||||||
|
|
@ -115,55 +128,62 @@ class Ui_MainWindow(object):
|
||||||
self.objectivesTable.setHorizontalHeaderItem(0, item)
|
self.objectivesTable.setHorizontalHeaderItem(0, item)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.objectivesTable.setHorizontalHeaderItem(1, item)
|
self.objectivesTable.setHorizontalHeaderItem(1, item)
|
||||||
self.labelObjectives = QtWidgets.QLabel(parent=self.pageWar)
|
self.horizontalLayout_9.addWidget(self.objectivesTable)
|
||||||
self.labelObjectives.setGeometry(QtCore.QRect(10, 40, 111, 20))
|
|
||||||
self.labelObjectives.setObjectName("labelObjectives")
|
|
||||||
self.addObjectiveBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
self.addObjectiveBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
||||||
self.addObjectiveBtn.setEnabled(True)
|
self.addObjectiveBtn.setEnabled(True)
|
||||||
self.addObjectiveBtn.setGeometry(QtCore.QRect(420, 80, 91, 23))
|
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setPointSize(10)
|
font.setPointSize(10)
|
||||||
self.addObjectiveBtn.setFont(font)
|
self.addObjectiveBtn.setFont(font)
|
||||||
self.addObjectiveBtn.setObjectName("addObjectiveBtn")
|
self.addObjectiveBtn.setObjectName("addObjectiveBtn")
|
||||||
|
self.horizontalLayout_9.addWidget(self.addObjectiveBtn)
|
||||||
|
self.gridLayout_3.addLayout(self.horizontalLayout_9, 2, 0, 1, 4)
|
||||||
|
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
|
self.gridLayout_3.addItem(spacerItem4, 5, 3, 1, 1)
|
||||||
|
self.endWarBtn = QtWidgets.QPushButton(parent=self.pageWar)
|
||||||
|
self.endWarBtn.setEnabled(True)
|
||||||
|
self.endWarBtn.setObjectName("endWarBtn")
|
||||||
|
self.gridLayout_3.addWidget(self.endWarBtn, 5, 1, 1, 1)
|
||||||
|
self.labelParticipants = QtWidgets.QLabel(parent=self.pageWar)
|
||||||
|
self.labelParticipants.setObjectName("labelParticipants")
|
||||||
|
self.gridLayout_3.addWidget(self.labelParticipants, 3, 0, 1, 1)
|
||||||
|
self.labelObjectives = QtWidgets.QLabel(parent=self.pageWar)
|
||||||
|
self.labelObjectives.setObjectName("labelObjectives")
|
||||||
|
self.gridLayout_3.addWidget(self.labelObjectives, 1, 0, 1, 1)
|
||||||
|
self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
|
||||||
|
self.warName = QtWidgets.QLabel(parent=self.pageWar)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setPointSize(12)
|
||||||
|
self.warName.setFont(font)
|
||||||
|
self.warName.setObjectName("warName")
|
||||||
|
self.horizontalLayout_8.addWidget(self.warName)
|
||||||
|
self.warYear = QtWidgets.QLabel(parent=self.pageWar)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setPointSize(12)
|
||||||
|
self.warYear.setFont(font)
|
||||||
|
self.warYear.setObjectName("warYear")
|
||||||
|
self.horizontalLayout_8.addWidget(self.warYear)
|
||||||
|
self.gridLayout_3.addLayout(self.horizontalLayout_8, 0, 0, 1, 4)
|
||||||
self.selectedDetailsStack.addWidget(self.pageWar)
|
self.selectedDetailsStack.addWidget(self.pageWar)
|
||||||
self.pageCampaign = QtWidgets.QWidget()
|
self.pageCampaign = QtWidgets.QWidget()
|
||||||
self.pageCampaign.setObjectName("pageCampaign")
|
self.pageCampaign.setObjectName("pageCampaign")
|
||||||
self.campaignName = QtWidgets.QLabel(parent=self.pageCampaign)
|
self.gridLayout_4 = QtWidgets.QGridLayout(self.pageCampaign)
|
||||||
self.campaignName.setGeometry(QtCore.QRect(10, 10, 241, 16))
|
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(12)
|
|
||||||
self.campaignName.setFont(font)
|
|
||||||
self.campaignName.setObjectName("campaignName")
|
|
||||||
self.labelSectors = QtWidgets.QLabel(parent=self.pageCampaign)
|
self.labelSectors = QtWidgets.QLabel(parent=self.pageCampaign)
|
||||||
self.labelSectors.setGeometry(QtCore.QRect(10, 40, 91, 16))
|
|
||||||
self.labelSectors.setObjectName("labelSectors")
|
self.labelSectors.setObjectName("labelSectors")
|
||||||
self.addCampaignParticipantBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
self.gridLayout_4.addWidget(self.labelSectors, 1, 0, 1, 1)
|
||||||
self.addCampaignParticipantBtn.setGeometry(QtCore.QRect(420, 270, 75, 23))
|
|
||||||
self.addCampaignParticipantBtn.setObjectName("addCampaignParticipantBtn")
|
|
||||||
self.campaignMonth = QtWidgets.QLabel(parent=self.pageCampaign)
|
|
||||||
self.campaignMonth.setGeometry(QtCore.QRect(280, 10, 121, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(12)
|
|
||||||
self.campaignMonth.setFont(font)
|
|
||||||
self.campaignMonth.setObjectName("campaignMonth")
|
|
||||||
self.labelParticipants_2 = QtWidgets.QLabel(parent=self.pageCampaign)
|
self.labelParticipants_2 = QtWidgets.QLabel(parent=self.pageCampaign)
|
||||||
self.labelParticipants_2.setGeometry(QtCore.QRect(10, 180, 47, 13))
|
|
||||||
self.labelParticipants_2.setObjectName("labelParticipants_2")
|
self.labelParticipants_2.setObjectName("labelParticipants_2")
|
||||||
self.campaignParticipantsTable = QtWidgets.QTableWidget(parent=self.pageCampaign)
|
self.gridLayout_4.addWidget(self.labelParticipants_2, 3, 0, 1, 1)
|
||||||
self.campaignParticipantsTable.setGeometry(QtCore.QRect(10, 200, 401, 181))
|
self.endCampaignBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
||||||
self.campaignParticipantsTable.setObjectName("campaignParticipantsTable")
|
self.endCampaignBtn.setEnabled(True)
|
||||||
self.campaignParticipantsTable.setColumnCount(4)
|
self.endCampaignBtn.setObjectName("endCampaignBtn")
|
||||||
self.campaignParticipantsTable.setRowCount(0)
|
self.gridLayout_4.addWidget(self.endCampaignBtn, 5, 1, 1, 1)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
self.campaignParticipantsTable.setHorizontalHeaderItem(0, item)
|
self.gridLayout_4.addItem(spacerItem5, 5, 2, 1, 1)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
self.horizontalLayout_12 = QtWidgets.QHBoxLayout()
|
||||||
self.campaignParticipantsTable.setHorizontalHeaderItem(1, item)
|
self.horizontalLayout_12.setObjectName("horizontalLayout_12")
|
||||||
item = QtWidgets.QTableWidgetItem()
|
|
||||||
self.campaignParticipantsTable.setHorizontalHeaderItem(2, item)
|
|
||||||
item = QtWidgets.QTableWidgetItem()
|
|
||||||
self.campaignParticipantsTable.setHorizontalHeaderItem(3, item)
|
|
||||||
self.sectorsTable = QtWidgets.QTableWidget(parent=self.pageCampaign)
|
self.sectorsTable = QtWidgets.QTableWidget(parent=self.pageCampaign)
|
||||||
self.sectorsTable.setGeometry(QtCore.QRect(10, 60, 401, 101))
|
|
||||||
self.sectorsTable.setObjectName("sectorsTable")
|
self.sectorsTable.setObjectName("sectorsTable")
|
||||||
self.sectorsTable.setColumnCount(5)
|
self.sectorsTable.setColumnCount(5)
|
||||||
self.sectorsTable.setRowCount(0)
|
self.sectorsTable.setRowCount(0)
|
||||||
|
|
@ -177,43 +197,68 @@ class Ui_MainWindow(object):
|
||||||
self.sectorsTable.setHorizontalHeaderItem(3, item)
|
self.sectorsTable.setHorizontalHeaderItem(3, item)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.sectorsTable.setHorizontalHeaderItem(4, item)
|
self.sectorsTable.setHorizontalHeaderItem(4, item)
|
||||||
|
self.horizontalLayout_12.addWidget(self.sectorsTable)
|
||||||
self.addSectorBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
self.addSectorBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
||||||
self.addSectorBtn.setEnabled(True)
|
self.addSectorBtn.setEnabled(True)
|
||||||
self.addSectorBtn.setGeometry(QtCore.QRect(420, 110, 71, 23))
|
|
||||||
self.addSectorBtn.setObjectName("addSectorBtn")
|
self.addSectorBtn.setObjectName("addSectorBtn")
|
||||||
self.endCampaignBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
self.horizontalLayout_12.addWidget(self.addSectorBtn)
|
||||||
self.endCampaignBtn.setEnabled(True)
|
self.gridLayout_4.addLayout(self.horizontalLayout_12, 4, 0, 1, 3)
|
||||||
self.endCampaignBtn.setGeometry(QtCore.QRect(210, 400, 91, 23))
|
self.horizontalLayout_13 = QtWidgets.QHBoxLayout()
|
||||||
self.endCampaignBtn.setObjectName("endCampaignBtn")
|
self.horizontalLayout_13.setObjectName("horizontalLayout_13")
|
||||||
|
self.campaignParticipantsTable = QtWidgets.QTableWidget(parent=self.pageCampaign)
|
||||||
|
self.campaignParticipantsTable.setObjectName("campaignParticipantsTable")
|
||||||
|
self.campaignParticipantsTable.setColumnCount(5)
|
||||||
|
self.campaignParticipantsTable.setRowCount(0)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.campaignParticipantsTable.setHorizontalHeaderItem(0, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.campaignParticipantsTable.setHorizontalHeaderItem(1, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.campaignParticipantsTable.setHorizontalHeaderItem(2, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.campaignParticipantsTable.setHorizontalHeaderItem(3, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.campaignParticipantsTable.setHorizontalHeaderItem(4, item)
|
||||||
|
self.horizontalLayout_13.addWidget(self.campaignParticipantsTable)
|
||||||
|
self.addCampaignParticipantBtn = QtWidgets.QPushButton(parent=self.pageCampaign)
|
||||||
|
self.addCampaignParticipantBtn.setObjectName("addCampaignParticipantBtn")
|
||||||
|
self.horizontalLayout_13.addWidget(self.addCampaignParticipantBtn)
|
||||||
|
self.gridLayout_4.addLayout(self.horizontalLayout_13, 2, 0, 1, 3)
|
||||||
|
self.horizontalLayout_11 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_11.setObjectName("horizontalLayout_11")
|
||||||
|
self.campaignName = QtWidgets.QLabel(parent=self.pageCampaign)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setPointSize(12)
|
||||||
|
self.campaignName.setFont(font)
|
||||||
|
self.campaignName.setObjectName("campaignName")
|
||||||
|
self.horizontalLayout_11.addWidget(self.campaignName)
|
||||||
|
self.campaignMonth = QtWidgets.QLabel(parent=self.pageCampaign)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setPointSize(12)
|
||||||
|
self.campaignMonth.setFont(font)
|
||||||
|
self.campaignMonth.setObjectName("campaignMonth")
|
||||||
|
self.horizontalLayout_11.addWidget(self.campaignMonth)
|
||||||
|
self.gridLayout_4.addLayout(self.horizontalLayout_11, 0, 0, 1, 3)
|
||||||
self.selectedDetailsStack.addWidget(self.pageCampaign)
|
self.selectedDetailsStack.addWidget(self.pageCampaign)
|
||||||
self.pageRound = QtWidgets.QWidget()
|
self.pageRound = QtWidgets.QWidget()
|
||||||
self.pageRound.setObjectName("pageRound")
|
self.pageRound.setObjectName("pageRound")
|
||||||
|
self.gridLayout_5 = QtWidgets.QGridLayout(self.pageRound)
|
||||||
|
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||||
self.labelChoices = QtWidgets.QLabel(parent=self.pageRound)
|
self.labelChoices = QtWidgets.QLabel(parent=self.pageRound)
|
||||||
self.labelChoices.setGeometry(QtCore.QRect(10, 40, 91, 16))
|
|
||||||
self.labelChoices.setObjectName("labelChoices")
|
self.labelChoices.setObjectName("labelChoices")
|
||||||
self.choicesTable = QtWidgets.QTableWidget(parent=self.pageRound)
|
self.gridLayout_5.addWidget(self.labelChoices, 1, 0, 1, 1)
|
||||||
self.choicesTable.setGeometry(QtCore.QRect(10, 60, 301, 141))
|
self.labelBattles = QtWidgets.QLabel(parent=self.pageRound)
|
||||||
self.choicesTable.setObjectName("choicesTable")
|
self.labelBattles.setObjectName("labelBattles")
|
||||||
self.choicesTable.setColumnCount(3)
|
self.gridLayout_5.addWidget(self.labelBattles, 3, 0, 1, 1)
|
||||||
self.choicesTable.setRowCount(0)
|
self.endRoundBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
self.endRoundBtn.setEnabled(True)
|
||||||
self.choicesTable.setHorizontalHeaderItem(0, item)
|
self.endRoundBtn.setObjectName("endRoundBtn")
|
||||||
item = QtWidgets.QTableWidgetItem()
|
self.gridLayout_5.addWidget(self.endRoundBtn, 5, 1, 1, 1)
|
||||||
self.choicesTable.setHorizontalHeaderItem(1, item)
|
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
self.gridLayout_5.addItem(spacerItem6, 5, 2, 1, 1)
|
||||||
self.choicesTable.setHorizontalHeaderItem(2, item)
|
self.horizontalLayout_15 = QtWidgets.QHBoxLayout()
|
||||||
self.roundNb = QtWidgets.QLabel(parent=self.pageRound)
|
self.horizontalLayout_15.setObjectName("horizontalLayout_15")
|
||||||
self.roundNb.setGeometry(QtCore.QRect(10, 10, 241, 16))
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(12)
|
|
||||||
self.roundNb.setFont(font)
|
|
||||||
self.roundNb.setObjectName("roundNb")
|
|
||||||
self.resolvePairingBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
|
||||||
self.resolvePairingBtn.setEnabled(True)
|
|
||||||
self.resolvePairingBtn.setGeometry(QtCore.QRect(320, 110, 91, 23))
|
|
||||||
self.resolvePairingBtn.setObjectName("resolvePairingBtn")
|
|
||||||
self.battlesTable = QtWidgets.QTableWidget(parent=self.pageRound)
|
self.battlesTable = QtWidgets.QTableWidget(parent=self.pageRound)
|
||||||
self.battlesTable.setGeometry(QtCore.QRect(10, 240, 301, 111))
|
|
||||||
self.battlesTable.setObjectName("battlesTable")
|
self.battlesTable.setObjectName("battlesTable")
|
||||||
self.battlesTable.setColumnCount(3)
|
self.battlesTable.setColumnCount(3)
|
||||||
self.battlesTable.setRowCount(0)
|
self.battlesTable.setRowCount(0)
|
||||||
|
|
@ -223,24 +268,49 @@ class Ui_MainWindow(object):
|
||||||
self.battlesTable.setHorizontalHeaderItem(1, item)
|
self.battlesTable.setHorizontalHeaderItem(1, item)
|
||||||
item = QtWidgets.QTableWidgetItem()
|
item = QtWidgets.QTableWidgetItem()
|
||||||
self.battlesTable.setHorizontalHeaderItem(2, item)
|
self.battlesTable.setHorizontalHeaderItem(2, item)
|
||||||
|
self.horizontalLayout_15.addWidget(self.battlesTable)
|
||||||
self.enterResultBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
self.enterResultBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||||
self.enterResultBtn.setEnabled(True)
|
self.enterResultBtn.setEnabled(True)
|
||||||
self.enterResultBtn.setGeometry(QtCore.QRect(320, 290, 91, 23))
|
|
||||||
self.enterResultBtn.setObjectName("enterResultBtn")
|
self.enterResultBtn.setObjectName("enterResultBtn")
|
||||||
self.endRoundBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
self.horizontalLayout_15.addWidget(self.enterResultBtn)
|
||||||
self.endRoundBtn.setEnabled(True)
|
self.gridLayout_5.addLayout(self.horizontalLayout_15, 4, 0, 1, 3)
|
||||||
self.endRoundBtn.setGeometry(QtCore.QRect(220, 400, 71, 23))
|
self.horizontalLayout_16 = QtWidgets.QHBoxLayout()
|
||||||
self.endRoundBtn.setObjectName("endRoundBtn")
|
self.horizontalLayout_16.setObjectName("horizontalLayout_16")
|
||||||
self.labelBattles = QtWidgets.QLabel(parent=self.pageRound)
|
self.choicesTable = QtWidgets.QTableWidget(parent=self.pageRound)
|
||||||
self.labelBattles.setGeometry(QtCore.QRect(10, 220, 91, 16))
|
self.choicesTable.setObjectName("choicesTable")
|
||||||
self.labelBattles.setObjectName("labelBattles")
|
self.choicesTable.setColumnCount(3)
|
||||||
|
self.choicesTable.setRowCount(0)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.choicesTable.setHorizontalHeaderItem(0, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.choicesTable.setHorizontalHeaderItem(1, item)
|
||||||
|
item = QtWidgets.QTableWidgetItem()
|
||||||
|
self.choicesTable.setHorizontalHeaderItem(2, item)
|
||||||
|
self.horizontalLayout_16.addWidget(self.choicesTable)
|
||||||
|
self.resolvePairingBtn = QtWidgets.QPushButton(parent=self.pageRound)
|
||||||
|
self.resolvePairingBtn.setEnabled(True)
|
||||||
|
self.resolvePairingBtn.setObjectName("resolvePairingBtn")
|
||||||
|
self.horizontalLayout_16.addWidget(self.resolvePairingBtn)
|
||||||
|
self.gridLayout_5.addLayout(self.horizontalLayout_16, 2, 0, 1, 3)
|
||||||
|
self.horizontalLayout_14 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_14.setObjectName("horizontalLayout_14")
|
||||||
|
self.roundNb = QtWidgets.QLabel(parent=self.pageRound)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setPointSize(12)
|
||||||
|
self.roundNb.setFont(font)
|
||||||
|
self.roundNb.setObjectName("roundNb")
|
||||||
|
self.horizontalLayout_14.addWidget(self.roundNb)
|
||||||
|
self.gridLayout_5.addLayout(self.horizontalLayout_14, 0, 0, 1, 3)
|
||||||
self.selectedDetailsStack.addWidget(self.pageRound)
|
self.selectedDetailsStack.addWidget(self.pageRound)
|
||||||
|
self.horizontalLayout_6.addWidget(self.selectedDetailsStack)
|
||||||
|
self.verticalLayout_3.addLayout(self.horizontalLayout_6)
|
||||||
icon2 = QtGui.QIcon()
|
icon2 = QtGui.QIcon()
|
||||||
icon2.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/swords-small.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
icon2.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/swords-small.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
self.tabWidget.addTab(self.warsTab, icon2, "")
|
self.tabWidget.addTab(self.warsTab, icon2, "")
|
||||||
|
self.verticalLayout.addWidget(self.tabWidget)
|
||||||
MainWindow.setCentralWidget(self.centralwidget)
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
||||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
|
self.menubar.setGeometry(QtCore.QRect(0, 0, 1288, 31))
|
||||||
self.menubar.setObjectName("menubar")
|
self.menubar.setObjectName("menubar")
|
||||||
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
|
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
|
||||||
self.menuFile.setObjectName("menuFile")
|
self.menuFile.setObjectName("menuFile")
|
||||||
|
|
@ -315,12 +385,13 @@ class Ui_MainWindow(object):
|
||||||
|
|
||||||
self.retranslateUi(MainWindow)
|
self.retranslateUi(MainWindow)
|
||||||
self.tabWidget.setCurrentIndex(1)
|
self.tabWidget.setCurrentIndex(1)
|
||||||
self.selectedDetailsStack.setCurrentIndex(0)
|
self.selectedDetailsStack.setCurrentIndex(3)
|
||||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
|
||||||
def retranslateUi(self, MainWindow):
|
def retranslateUi(self, MainWindow):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
MainWindow.setWindowTitle(_translate("MainWindow", "WarChron"))
|
MainWindow.setWindowTitle(_translate("MainWindow", "WarChron"))
|
||||||
|
self.addPlayerBtn.setText(_translate("MainWindow", "Add player"))
|
||||||
item = self.playersTable.horizontalHeaderItem(0)
|
item = self.playersTable.horizontalHeaderItem(0)
|
||||||
item.setText(_translate("MainWindow", "Name"))
|
item.setText(_translate("MainWindow", "Name"))
|
||||||
item = self.playersTable.horizontalHeaderItem(1)
|
item = self.playersTable.horizontalHeaderItem(1)
|
||||||
|
|
@ -329,16 +400,11 @@ class Ui_MainWindow(object):
|
||||||
item.setText(_translate("MainWindow", "Wins"))
|
item.setText(_translate("MainWindow", "Wins"))
|
||||||
item = self.playersTable.horizontalHeaderItem(3)
|
item = self.playersTable.horizontalHeaderItem(3)
|
||||||
item.setText(_translate("MainWindow", "Rewards"))
|
item.setText(_translate("MainWindow", "Rewards"))
|
||||||
self.addPlayerBtn.setText(_translate("MainWindow", "Add player"))
|
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.playersTab), _translate("MainWindow", "Players"))
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.playersTab), _translate("MainWindow", "Players"))
|
||||||
self.addWarBtn.setText(_translate("MainWindow", "Add war"))
|
self.addWarBtn.setText(_translate("MainWindow", "Add war"))
|
||||||
self.addCampaignBtn.setText(_translate("MainWindow", "Add Campaign"))
|
self.addCampaignBtn.setText(_translate("MainWindow", "Add Campaign"))
|
||||||
self.addRoundBtn.setText(_translate("MainWindow", "Add Round"))
|
self.addRoundBtn.setText(_translate("MainWindow", "Add Round"))
|
||||||
self.labelSelect.setText(_translate("MainWindow", "Select an element within the tree to show/edit details."))
|
self.labelSelect.setText(_translate("MainWindow", "Select an element within the tree to show/edit details."))
|
||||||
self.warName.setText(_translate("MainWindow", "warName"))
|
|
||||||
self.warYear.setText(_translate("MainWindow", "warYear"))
|
|
||||||
self.labelParticipants.setText(_translate("MainWindow", "Participants"))
|
|
||||||
self.addWarParticipantBtn.setText(_translate("MainWindow", "Add participant"))
|
|
||||||
item = self.warParticipantsTable.horizontalHeaderItem(0)
|
item = self.warParticipantsTable.horizontalHeaderItem(0)
|
||||||
item.setText(_translate("MainWindow", "Name"))
|
item.setText(_translate("MainWindow", "Name"))
|
||||||
item = self.warParticipantsTable.horizontalHeaderItem(1)
|
item = self.warParticipantsTable.horizontalHeaderItem(1)
|
||||||
|
|
@ -349,26 +415,20 @@ class Ui_MainWindow(object):
|
||||||
item.setText(_translate("MainWindow", "Victory pts."))
|
item.setText(_translate("MainWindow", "Victory pts."))
|
||||||
item = self.warParticipantsTable.horizontalHeaderItem(4)
|
item = self.warParticipantsTable.horizontalHeaderItem(4)
|
||||||
item.setText(_translate("MainWindow", "Theme pts"))
|
item.setText(_translate("MainWindow", "Theme pts"))
|
||||||
self.endWarBtn.setText(_translate("MainWindow", "End war"))
|
self.addWarParticipantBtn.setText(_translate("MainWindow", "Add participant"))
|
||||||
item = self.objectivesTable.horizontalHeaderItem(0)
|
item = self.objectivesTable.horizontalHeaderItem(0)
|
||||||
item.setText(_translate("MainWindow", "Name"))
|
item.setText(_translate("MainWindow", "Name"))
|
||||||
item = self.objectivesTable.horizontalHeaderItem(1)
|
item = self.objectivesTable.horizontalHeaderItem(1)
|
||||||
item.setText(_translate("MainWindow", "Description"))
|
item.setText(_translate("MainWindow", "Description"))
|
||||||
self.labelObjectives.setText(_translate("MainWindow", "Objectives"))
|
|
||||||
self.addObjectiveBtn.setText(_translate("MainWindow", "Add objective"))
|
self.addObjectiveBtn.setText(_translate("MainWindow", "Add objective"))
|
||||||
self.campaignName.setText(_translate("MainWindow", "campaignName"))
|
self.endWarBtn.setText(_translate("MainWindow", "End war"))
|
||||||
|
self.labelParticipants.setText(_translate("MainWindow", "Participants"))
|
||||||
|
self.labelObjectives.setText(_translate("MainWindow", "Objectives"))
|
||||||
|
self.warName.setText(_translate("MainWindow", "warName"))
|
||||||
|
self.warYear.setText(_translate("MainWindow", "warYear"))
|
||||||
self.labelSectors.setText(_translate("MainWindow", "Sectors"))
|
self.labelSectors.setText(_translate("MainWindow", "Sectors"))
|
||||||
self.addCampaignParticipantBtn.setText(_translate("MainWindow", "Add participant"))
|
|
||||||
self.campaignMonth.setText(_translate("MainWindow", "campaignMonth"))
|
|
||||||
self.labelParticipants_2.setText(_translate("MainWindow", "Participants"))
|
self.labelParticipants_2.setText(_translate("MainWindow", "Participants"))
|
||||||
item = self.campaignParticipantsTable.horizontalHeaderItem(0)
|
self.endCampaignBtn.setText(_translate("MainWindow", "End campaign"))
|
||||||
item.setText(_translate("MainWindow", "Name"))
|
|
||||||
item = self.campaignParticipantsTable.horizontalHeaderItem(1)
|
|
||||||
item.setText(_translate("MainWindow", "Leader"))
|
|
||||||
item = self.campaignParticipantsTable.horizontalHeaderItem(2)
|
|
||||||
item.setText(_translate("MainWindow", "Victory pts."))
|
|
||||||
item = self.campaignParticipantsTable.horizontalHeaderItem(3)
|
|
||||||
item.setText(_translate("MainWindow", "Theme pts."))
|
|
||||||
item = self.sectorsTable.horizontalHeaderItem(0)
|
item = self.sectorsTable.horizontalHeaderItem(0)
|
||||||
item.setText(_translate("MainWindow", "Name"))
|
item.setText(_translate("MainWindow", "Name"))
|
||||||
item = self.sectorsTable.horizontalHeaderItem(1)
|
item = self.sectorsTable.horizontalHeaderItem(1)
|
||||||
|
|
@ -380,16 +440,22 @@ class Ui_MainWindow(object):
|
||||||
item = self.sectorsTable.horizontalHeaderItem(4)
|
item = self.sectorsTable.horizontalHeaderItem(4)
|
||||||
item.setText(_translate("MainWindow", "Influence imp."))
|
item.setText(_translate("MainWindow", "Influence imp."))
|
||||||
self.addSectorBtn.setText(_translate("MainWindow", "Add Sector"))
|
self.addSectorBtn.setText(_translate("MainWindow", "Add Sector"))
|
||||||
self.endCampaignBtn.setText(_translate("MainWindow", "End campaign"))
|
item = self.campaignParticipantsTable.horizontalHeaderItem(0)
|
||||||
|
item.setText(_translate("MainWindow", "Name"))
|
||||||
|
item = self.campaignParticipantsTable.horizontalHeaderItem(1)
|
||||||
|
item.setText(_translate("MainWindow", "Leader"))
|
||||||
|
item = self.campaignParticipantsTable.horizontalHeaderItem(2)
|
||||||
|
item.setText(_translate("MainWindow", "Theme"))
|
||||||
|
item = self.campaignParticipantsTable.horizontalHeaderItem(3)
|
||||||
|
item.setText(_translate("MainWindow", "Victory pts."))
|
||||||
|
item = self.campaignParticipantsTable.horizontalHeaderItem(4)
|
||||||
|
item.setText(_translate("MainWindow", "Theme pts."))
|
||||||
|
self.addCampaignParticipantBtn.setText(_translate("MainWindow", "Add participant"))
|
||||||
|
self.campaignName.setText(_translate("MainWindow", "campaignName"))
|
||||||
|
self.campaignMonth.setText(_translate("MainWindow", "campaignMonth"))
|
||||||
self.labelChoices.setText(_translate("MainWindow", "Choices"))
|
self.labelChoices.setText(_translate("MainWindow", "Choices"))
|
||||||
item = self.choicesTable.horizontalHeaderItem(0)
|
self.labelBattles.setText(_translate("MainWindow", "Battles"))
|
||||||
item.setText(_translate("MainWindow", "Player"))
|
self.endRoundBtn.setText(_translate("MainWindow", "End round"))
|
||||||
item = self.choicesTable.horizontalHeaderItem(1)
|
|
||||||
item.setText(_translate("MainWindow", "Prioritary"))
|
|
||||||
item = self.choicesTable.horizontalHeaderItem(2)
|
|
||||||
item.setText(_translate("MainWindow", "Secondary"))
|
|
||||||
self.roundNb.setText(_translate("MainWindow", "Round Nb"))
|
|
||||||
self.resolvePairingBtn.setText(_translate("MainWindow", "Resolve pairing"))
|
|
||||||
item = self.battlesTable.horizontalHeaderItem(0)
|
item = self.battlesTable.horizontalHeaderItem(0)
|
||||||
item.setText(_translate("MainWindow", "Sector"))
|
item.setText(_translate("MainWindow", "Sector"))
|
||||||
item = self.battlesTable.horizontalHeaderItem(1)
|
item = self.battlesTable.horizontalHeaderItem(1)
|
||||||
|
|
@ -397,8 +463,14 @@ class Ui_MainWindow(object):
|
||||||
item = self.battlesTable.horizontalHeaderItem(2)
|
item = self.battlesTable.horizontalHeaderItem(2)
|
||||||
item.setText(_translate("MainWindow", "Player 2"))
|
item.setText(_translate("MainWindow", "Player 2"))
|
||||||
self.enterResultBtn.setText(_translate("MainWindow", "Enter results"))
|
self.enterResultBtn.setText(_translate("MainWindow", "Enter results"))
|
||||||
self.endRoundBtn.setText(_translate("MainWindow", "End round"))
|
item = self.choicesTable.horizontalHeaderItem(0)
|
||||||
self.labelBattles.setText(_translate("MainWindow", "Battles"))
|
item.setText(_translate("MainWindow", "Player"))
|
||||||
|
item = self.choicesTable.horizontalHeaderItem(1)
|
||||||
|
item.setText(_translate("MainWindow", "Prioritary"))
|
||||||
|
item = self.choicesTable.horizontalHeaderItem(2)
|
||||||
|
item.setText(_translate("MainWindow", "Secondary"))
|
||||||
|
self.resolvePairingBtn.setText(_translate("MainWindow", "Resolve pairing"))
|
||||||
|
self.roundNb.setText(_translate("MainWindow", "Round Nb"))
|
||||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.warsTab), _translate("MainWindow", "Wars"))
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.warsTab), _translate("MainWindow", "Wars"))
|
||||||
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
||||||
self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
|
self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>1288</width>
|
||||||
<height>600</height>
|
<height>817</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -18,15 +18,9 @@
|
||||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>16</x>
|
|
||||||
<y>9</y>
|
|
||||||
<width>771</width>
|
|
||||||
<height>531</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -38,15 +32,33 @@
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Players</string>
|
<string>Players</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QTableWidget" name="playersTable">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<x>10</x>
|
<item>
|
||||||
<y>60</y>
|
<widget class="QPushButton" name="addPlayerBtn">
|
||||||
<width>741</width>
|
<property name="text">
|
||||||
<height>431</height>
|
<string>Add player</string>
|
||||||
</rect>
|
|
||||||
</property>
|
</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>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QTableWidget" name="playersTable">
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
|
|
@ -68,19 +80,8 @@
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="addPlayerBtn">
|
</item>
|
||||||
<property name="geometry">
|
</layout>
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>75</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add player</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="warsTab">
|
<widget class="QWidget" name="warsTab">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
|
|
@ -90,165 +91,117 @@
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Wars</string>
|
<string>Wars</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QTreeWidget" name="warsTree">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<x>10</x>
|
<item>
|
||||||
<y>60</y>
|
<widget class="QPushButton" name="addWarBtn">
|
||||||
<width>211</width>
|
<property name="text">
|
||||||
<height>431</height>
|
<string>Add war</string>
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addCampaignBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Add Campaign</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="addRoundBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Add Round</string>
|
||||||
|
</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>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeWidget" name="warsTree">
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="addWarBtn">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>75</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add war</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="addCampaignBtn">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>110</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add Campaign</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="addRoundBtn">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>220</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add Round</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QStackedWidget" name="selectedDetailsStack">
|
<widget class="QStackedWidget" name="selectedDetailsStack">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>239</x>
|
|
||||||
<y>59</y>
|
|
||||||
<width>511</width>
|
|
||||||
<height>431</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pageEmpty">
|
<widget class="QWidget" name="pageEmpty">
|
||||||
<widget class="QLabel" name="labelSelect">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
<x>110</x>
|
<property name="sizeConstraint">
|
||||||
<y>30</y>
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
<width>301</width>
|
|
||||||
<height>51</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<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="labelSelect">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Select an element within the tree to show/edit details.</string>
|
<string>Select an element within the tree to show/edit details.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</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>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="pageWar">
|
<widget class="QWidget" name="pageWar">
|
||||||
<widget class="QLabel" name="warName">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<property name="geometry">
|
<item row="4" column="0" colspan="4">
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
<x>10</x>
|
<item>
|
||||||
<y>10</y>
|
|
||||||
<width>241</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>warName</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="warYear">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>280</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>warYear</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="labelParticipants">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>150</y>
|
|
||||||
<width>111</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Participants</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="addWarParticipantBtn">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>420</x>
|
|
||||||
<y>270</y>
|
|
||||||
<width>81</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add participant</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QTableWidget" name="warParticipantsTable">
|
<widget class="QTableWidget" name="warParticipantsTable">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>170</y>
|
|
||||||
<width>401</width>
|
|
||||||
<height>211</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
|
|
@ -275,31 +228,20 @@
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="endWarBtn">
|
</item>
|
||||||
<property name="enabled">
|
<item>
|
||||||
<bool>true</bool>
|
<widget class="QPushButton" name="addWarParticipantBtn">
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>230</x>
|
|
||||||
<y>400</y>
|
|
||||||
<width>61</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>End war</string>
|
<string>Add participant</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="4">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
|
<item>
|
||||||
<widget class="QTableWidget" name="objectivesTable">
|
<widget class="QTableWidget" name="objectivesTable">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>401</width>
|
|
||||||
<height>71</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
|
|
@ -311,31 +253,12 @@
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="labelObjectives">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>111</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Objectives</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="addObjectiveBtn">
|
<widget class="QPushButton" name="addObjectiveBtn">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>420</x>
|
|
||||||
<y>80</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>10</pointsize>
|
<pointsize>10</pointsize>
|
||||||
|
|
@ -345,122 +268,119 @@
|
||||||
<string>Add objective</string>
|
<string>Add objective</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
<widget class="QWidget" name="pageCampaign">
|
</layout>
|
||||||
<widget class="QLabel" name="campaignName">
|
</item>
|
||||||
<property name="geometry">
|
<item row="5" column="3">
|
||||||
<rect>
|
<spacer name="horizontalSpacer_6">
|
||||||
<x>10</x>
|
<property name="orientation">
|
||||||
<y>10</y>
|
<enum>Qt::Horizontal</enum>
|
||||||
<width>241</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="sizeHint" stdset="0">
|
||||||
<font>
|
<size>
|
||||||
<pointsize>12</pointsize>
|
<width>40</width>
|
||||||
</font>
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QPushButton" name="endWarBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>campaignName</string>
|
<string>End war</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="labelSectors">
|
</item>
|
||||||
<property name="geometry">
|
<item row="3" column="0">
|
||||||
<rect>
|
<widget class="QLabel" name="labelParticipants">
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sectors</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="addCampaignParticipantBtn">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>420</x>
|
|
||||||
<y>270</y>
|
|
||||||
<width>75</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Add participant</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="campaignMonth">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>280</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>121</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>campaignMonth</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="labelParticipants_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>180</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>13</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Participants</string>
|
<string>Participants</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTableWidget" name="campaignParticipantsTable">
|
</item>
|
||||||
<property name="geometry">
|
<item row="1" column="0">
|
||||||
<rect>
|
<widget class="QLabel" name="labelObjectives">
|
||||||
<x>10</x>
|
|
||||||
<y>200</y>
|
|
||||||
<width>401</width>
|
|
||||||
<height>181</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Objectives</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Leader</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Victory pts.</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Theme pts.</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTableWidget" name="sectorsTable">
|
</item>
|
||||||
<property name="geometry">
|
<item row="0" column="0" colspan="4">
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
<x>10</x>
|
<item>
|
||||||
<y>60</y>
|
<widget class="QLabel" name="warName">
|
||||||
<width>401</width>
|
<property name="font">
|
||||||
<height>101</height>
|
<font>
|
||||||
</rect>
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>warName</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="warYear">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>warYear</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageCampaign">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelSectors">
|
||||||
|
<property name="text">
|
||||||
|
<string>Sectors</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="labelParticipants_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Participants</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QPushButton" name="endCampaignBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>End campaign</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="2">
|
||||||
|
<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 row="4" column="0" colspan="3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableWidget" name="sectorsTable">
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
|
|
@ -487,121 +407,132 @@
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="addSectorBtn">
|
<widget class="QPushButton" name="addSectorBtn">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>420</x>
|
|
||||||
<y>110</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Add Sector</string>
|
<string>Add Sector</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="endCampaignBtn">
|
</item>
|
||||||
<property name="enabled">
|
</layout>
|
||||||
<bool>true</bool>
|
</item>
|
||||||
</property>
|
<item row="2" column="0" colspan="3">
|
||||||
<property name="geometry">
|
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||||
<rect>
|
<item>
|
||||||
<x>210</x>
|
<widget class="QTableWidget" name="campaignParticipantsTable">
|
||||||
<y>400</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>End campaign</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="pageRound">
|
|
||||||
<widget class="QLabel" name="labelChoices">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Choices</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QTableWidget" name="choicesTable">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>301</width>
|
|
||||||
<height>141</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Player</string>
|
<string>Name</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prioritary</string>
|
<string>Leader</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Secondary</string>
|
<string>Theme</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Victory pts.</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Theme pts.</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="roundNb">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QPushButton" name="addCampaignParticipantBtn">
|
||||||
<x>10</x>
|
<property name="text">
|
||||||
<y>10</y>
|
<string>Add participant</string>
|
||||||
<width>241</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="campaignName">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Round Nb</string>
|
<string>campaignName</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="resolvePairingBtn">
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="campaignMonth">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>campaignMonth</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageRound">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelChoices">
|
||||||
|
<property name="text">
|
||||||
|
<string>Choices</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="labelBattles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Battles</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QPushButton" name="endRoundBtn">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>320</x>
|
|
||||||
<y>110</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Resolve pairing</string>
|
<string>End round</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTableWidget" name="battlesTable">
|
</item>
|
||||||
<property name="geometry">
|
<item row="5" column="2">
|
||||||
<rect>
|
<spacer name="horizontalSpacer_7">
|
||||||
<x>10</x>
|
<property name="orientation">
|
||||||
<y>240</y>
|
<enum>Qt::Horizontal</enum>
|
||||||
<width>301</width>
|
|
||||||
<height>111</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableWidget" name="battlesTable">
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Sector</string>
|
<string>Sector</string>
|
||||||
|
|
@ -618,63 +549,87 @@
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="enterResultBtn">
|
<widget class="QPushButton" name="enterResultBtn">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>320</x>
|
|
||||||
<y>290</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enter results</string>
|
<string>Enter results</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="endRoundBtn">
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableWidget" name="choicesTable">
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Player</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Prioritary</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Secondary</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="resolvePairingBtn">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="text">
|
||||||
<rect>
|
<string>Resolve pairing</string>
|
||||||
<x>220</x>
|
</property>
|
||||||
<y>400</y>
|
</widget>
|
||||||
<width>71</width>
|
</item>
|
||||||
<height>23</height>
|
</layout>
|
||||||
</rect>
|
</item>
|
||||||
|
<item row="0" column="0" colspan="3">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="roundNb">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>End round</string>
|
<string>Round Nb</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="labelBattles">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>220</y>
|
|
||||||
<width>91</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Battles</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>1288</width>
|
||||||
<height>21</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_participant_dialog.ui'
|
|
||||||
#
|
|
||||||
# Created by: PyQt6 UI code generator 6.7.1
|
|
||||||
#
|
|
||||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
|
||||||
# run again. Do not edit this file unless you know what you are doing.
|
|
||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_participantDialog(object):
|
|
||||||
def setupUi(self, participantDialog):
|
|
||||||
participantDialog.setObjectName("participantDialog")
|
|
||||||
participantDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
|
||||||
participantDialog.resize(394, 148)
|
|
||||||
icon = QtGui.QIcon()
|
|
||||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
|
||||||
participantDialog.setWindowIcon(icon)
|
|
||||||
self.gridLayout = QtWidgets.QGridLayout(participantDialog)
|
|
||||||
self.gridLayout.setObjectName("gridLayout")
|
|
||||||
self.label = QtWidgets.QLabel(parent=participantDialog)
|
|
||||||
self.label.setObjectName("label")
|
|
||||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
|
||||||
self.playerComboBox = QtWidgets.QComboBox(parent=participantDialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.playerComboBox.sizePolicy().hasHeightForWidth())
|
|
||||||
self.playerComboBox.setSizePolicy(sizePolicy)
|
|
||||||
self.playerComboBox.setObjectName("playerComboBox")
|
|
||||||
self.gridLayout.addWidget(self.playerComboBox, 0, 1, 1, 1)
|
|
||||||
self.label_2 = QtWidgets.QLabel(parent=participantDialog)
|
|
||||||
self.label_2.setObjectName("label_2")
|
|
||||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
|
||||||
self.faction = QtWidgets.QLineEdit(parent=participantDialog)
|
|
||||||
self.faction.setObjectName("faction")
|
|
||||||
self.gridLayout.addWidget(self.faction, 1, 1, 1, 1)
|
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=participantDialog)
|
|
||||||
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.retranslateUi(participantDialog)
|
|
||||||
self.buttonBox.accepted.connect(participantDialog.accept) # type: ignore
|
|
||||||
self.buttonBox.rejected.connect(participantDialog.reject) # type: ignore
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(participantDialog)
|
|
||||||
|
|
||||||
def retranslateUi(self, participantDialog):
|
|
||||||
_translate = QtCore.QCoreApplication.translate
|
|
||||||
participantDialog.setWindowTitle(_translate("participantDialog", "Participant"))
|
|
||||||
self.label.setText(_translate("participantDialog", "Player"))
|
|
||||||
self.label_2.setText(_translate("participantDialog", "Faction"))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
import sys
|
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
|
||||||
participantDialog = QtWidgets.QDialog()
|
|
||||||
ui = Ui_participantDialog()
|
|
||||||
ui.setupUi(participantDialog)
|
|
||||||
participantDialog.show()
|
|
||||||
sys.exit(app.exec())
|
|
||||||
|
|
@ -13,21 +13,23 @@ class Ui_playerDialog(object):
|
||||||
def setupUi(self, playerDialog):
|
def setupUi(self, playerDialog):
|
||||||
playerDialog.setObjectName("playerDialog")
|
playerDialog.setObjectName("playerDialog")
|
||||||
playerDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
playerDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||||
playerDialog.resize(378, 98)
|
playerDialog.resize(378, 67)
|
||||||
icon = QtGui.QIcon()
|
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)
|
||||||
playerDialog.setWindowIcon(icon)
|
playerDialog.setWindowIcon(icon)
|
||||||
|
self.formLayout = QtWidgets.QFormLayout(playerDialog)
|
||||||
|
self.formLayout.setObjectName("formLayout")
|
||||||
|
self.label = QtWidgets.QLabel(parent=playerDialog)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||||
|
self.playerName = QtWidgets.QLineEdit(parent=playerDialog)
|
||||||
|
self.playerName.setObjectName("playerName")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.playerName)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=playerDialog)
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=playerDialog)
|
||||||
self.buttonBox.setGeometry(QtCore.QRect(10, 60, 341, 32))
|
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
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.buttonBox.setObjectName("buttonBox")
|
||||||
self.label = QtWidgets.QLabel(parent=playerDialog)
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||||
self.label.setGeometry(QtCore.QRect(10, 20, 47, 14))
|
|
||||||
self.label.setObjectName("label")
|
|
||||||
self.playerName = QtWidgets.QLineEdit(parent=playerDialog)
|
|
||||||
self.playerName.setGeometry(QtCore.QRect(60, 20, 113, 20))
|
|
||||||
self.playerName.setObjectName("playerName")
|
|
||||||
|
|
||||||
self.retranslateUi(playerDialog)
|
self.retranslateUi(playerDialog)
|
||||||
self.buttonBox.accepted.connect(playerDialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(playerDialog.accept) # type: ignore
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>378</width>
|
<width>378</width>
|
||||||
<height>98</height>
|
<height>67</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -20,15 +20,19 @@
|
||||||
<iconset>
|
<iconset>
|
||||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
<widget class="QLabel" name="label">
|
||||||
<x>10</x>
|
<property name="text">
|
||||||
<y>60</y>
|
<string>Name:</string>
|
||||||
<width>341</width>
|
|
||||||
<height>32</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="playerName"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -36,29 +40,8 @@
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="label">
|
</item>
|
||||||
<property name="geometry">
|
</layout>
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>14</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Name:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLineEdit" name="playerName">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>113</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
|
|
||||||
101
src/warchron/view/ui/ui_sector_dialog.py
Normal file
101
src/warchron/view/ui/ui_sector_dialog.py
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_sector_dialog.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt6 UI code generator 6.7.1
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_sectorDialog(object):
|
||||||
|
def setupUi(self, sectorDialog):
|
||||||
|
sectorDialog.setObjectName("sectorDialog")
|
||||||
|
sectorDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||||
|
sectorDialog.resize(514, 129)
|
||||||
|
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.label_2 = QtWidgets.QLabel(parent=sectorDialog)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
|
||||||
|
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.roundComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.roundComboBox.sizePolicy().hasHeightForWidth())
|
||||||
|
self.roundComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.roundComboBox.setObjectName("roundComboBox")
|
||||||
|
self.gridLayout.addWidget(self.roundComboBox, 1, 1, 1, 1)
|
||||||
|
self.label_4 = QtWidgets.QLabel(parent=sectorDialog)
|
||||||
|
self.label_4.setObjectName("label_4")
|
||||||
|
self.gridLayout.addWidget(self.label_4, 1, 2, 1, 1)
|
||||||
|
self.minorComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
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_5 = QtWidgets.QLabel(parent=sectorDialog)
|
||||||
|
self.label_5.setObjectName("label_5")
|
||||||
|
self.gridLayout.addWidget(self.label_5, 2, 2, 1, 1)
|
||||||
|
self.influenceComboBox = QtWidgets.QComboBox(parent=sectorDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.influenceComboBox.sizePolicy().hasHeightForWidth())
|
||||||
|
self.influenceComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.influenceComboBox.setObjectName("influenceComboBox")
|
||||||
|
self.gridLayout.addWidget(self.influenceComboBox, 2, 3, 1, 1)
|
||||||
|
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, 3, 2, 1, 2)
|
||||||
|
|
||||||
|
self.retranslateUi(sectorDialog)
|
||||||
|
self.buttonBox.accepted.connect(sectorDialog.accept) # type: ignore
|
||||||
|
self.buttonBox.rejected.connect(sectorDialog.reject) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(sectorDialog)
|
||||||
|
|
||||||
|
def retranslateUi(self, sectorDialog):
|
||||||
|
_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_5.setText(_translate("sectorDialog", "Influence"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import sys
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
sectorDialog = QtWidgets.QDialog()
|
||||||
|
ui = Ui_sectorDialog()
|
||||||
|
ui.setupUi(sectorDialog)
|
||||||
|
sectorDialog.show()
|
||||||
|
sys.exit(app.exec())
|
||||||
153
src/warchron/view/ui/ui_sector_dialog.ui
Normal file
153
src/warchron/view/ui/ui_sector_dialog.ui
Normal file
|
|
@ -0,0 +1,153 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>sectorDialog</class>
|
||||||
|
<widget class="QDialog" name="sectorDialog">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::ApplicationModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>514</width>
|
||||||
|
<height>129</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Sector</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<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>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="sectorName">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</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="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="2" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>sectorDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>sectorDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
|
|
@ -17,25 +17,27 @@ class Ui_warDialog(object):
|
||||||
icon = QtGui.QIcon()
|
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)
|
||||||
warDialog.setWindowIcon(icon)
|
warDialog.setWindowIcon(icon)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=warDialog)
|
self.gridLayout = QtWidgets.QGridLayout(warDialog)
|
||||||
self.buttonBox.setGeometry(QtCore.QRect(10, 80, 341, 32))
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
|
||||||
self.label = QtWidgets.QLabel(parent=warDialog)
|
self.label = QtWidgets.QLabel(parent=warDialog)
|
||||||
self.label.setGeometry(QtCore.QRect(10, 20, 47, 14))
|
|
||||||
self.label.setObjectName("label")
|
self.label.setObjectName("label")
|
||||||
|
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||||
self.warName = QtWidgets.QLineEdit(parent=warDialog)
|
self.warName = QtWidgets.QLineEdit(parent=warDialog)
|
||||||
self.warName.setGeometry(QtCore.QRect(60, 20, 113, 20))
|
|
||||||
self.warName.setObjectName("warName")
|
self.warName.setObjectName("warName")
|
||||||
|
self.gridLayout.addWidget(self.warName, 0, 1, 1, 1)
|
||||||
self.label_2 = QtWidgets.QLabel(parent=warDialog)
|
self.label_2 = QtWidgets.QLabel(parent=warDialog)
|
||||||
self.label_2.setGeometry(QtCore.QRect(10, 50, 47, 14))
|
|
||||||
self.label_2.setObjectName("label_2")
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||||
self.warYear = QtWidgets.QSpinBox(parent=warDialog)
|
self.warYear = QtWidgets.QSpinBox(parent=warDialog)
|
||||||
self.warYear.setGeometry(QtCore.QRect(60, 50, 71, 22))
|
|
||||||
self.warYear.setMinimum(1970)
|
self.warYear.setMinimum(1970)
|
||||||
self.warYear.setMaximum(3000)
|
self.warYear.setMaximum(3000)
|
||||||
self.warYear.setObjectName("warYear")
|
self.warYear.setObjectName("warYear")
|
||||||
|
self.gridLayout.addWidget(self.warYear, 1, 1, 1, 1)
|
||||||
|
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.retranslateUi(warDialog)
|
self.retranslateUi(warDialog)
|
||||||
self.buttonBox.accepted.connect(warDialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(warDialog.accept) # type: ignore
|
||||||
|
|
|
||||||
|
|
@ -20,67 +20,26 @@
|
||||||
<iconset>
|
<iconset>
|
||||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>80</y>
|
|
||||||
<width>341</width>
|
|
||||||
<height>32</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>14</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name:</string>
|
<string>Name:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLineEdit" name="warName">
|
</item>
|
||||||
<property name="geometry">
|
<item row="0" column="1">
|
||||||
<rect>
|
<widget class="QLineEdit" name="warName"/>
|
||||||
<x>60</x>
|
</item>
|
||||||
<y>20</y>
|
<item row="1" column="0">
|
||||||
<width>113</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>50</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>14</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Year:</string>
|
<string>Year:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="warYear">
|
<widget class="QSpinBox" name="warYear">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>50</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1970</number>
|
<number>1970</number>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -88,6 +47,18 @@
|
||||||
<number>3000</number>
|
<number>3000</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
|
|
||||||
64
src/warchron/view/ui/ui_war_participant_dialog.py
Normal file
64
src/warchron/view/ui/ui_war_participant_dialog.py
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
# Form implementation generated from reading ui file '.\src\warchron\view\ui\ui_war_participant_dialog.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt6 UI code generator 6.7.1
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_warParticipantDialog(object):
|
||||||
|
def setupUi(self, warParticipantDialog):
|
||||||
|
warParticipantDialog.setObjectName("warParticipantDialog")
|
||||||
|
warParticipantDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||||
|
warParticipantDialog.resize(394, 96)
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||||
|
warParticipantDialog.setWindowIcon(icon)
|
||||||
|
self.formLayout = QtWidgets.QFormLayout(warParticipantDialog)
|
||||||
|
self.formLayout.setObjectName("formLayout")
|
||||||
|
self.label = QtWidgets.QLabel(parent=warParticipantDialog)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||||
|
self.playerComboBox = QtWidgets.QComboBox(parent=warParticipantDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.playerComboBox.sizePolicy().hasHeightForWidth())
|
||||||
|
self.playerComboBox.setSizePolicy(sizePolicy)
|
||||||
|
self.playerComboBox.setObjectName("playerComboBox")
|
||||||
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.playerComboBox)
|
||||||
|
self.label_2 = QtWidgets.QLabel(parent=warParticipantDialog)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||||
|
self.faction = QtWidgets.QLineEdit(parent=warParticipantDialog)
|
||||||
|
self.faction.setObjectName("faction")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.faction)
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=warParticipantDialog)
|
||||||
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||||
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
|
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||||
|
|
||||||
|
self.retranslateUi(warParticipantDialog)
|
||||||
|
self.buttonBox.accepted.connect(warParticipantDialog.accept) # type: ignore
|
||||||
|
self.buttonBox.rejected.connect(warParticipantDialog.reject) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(warParticipantDialog)
|
||||||
|
|
||||||
|
def retranslateUi(self, warParticipantDialog):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
warParticipantDialog.setWindowTitle(_translate("warParticipantDialog", "War participant"))
|
||||||
|
self.label.setText(_translate("warParticipantDialog", "Player"))
|
||||||
|
self.label_2.setText(_translate("warParticipantDialog", "Faction"))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import sys
|
||||||
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
|
warParticipantDialog = QtWidgets.QDialog()
|
||||||
|
ui = Ui_warParticipantDialog()
|
||||||
|
ui.setupUi(warParticipantDialog)
|
||||||
|
warParticipantDialog.show()
|
||||||
|
sys.exit(app.exec())
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>participantDialog</class>
|
<class>warParticipantDialog</class>
|
||||||
<widget class="QDialog" name="participantDialog">
|
<widget class="QDialog" name="warParticipantDialog">
|
||||||
<property name="windowModality">
|
<property name="windowModality">
|
||||||
<enum>Qt::ApplicationModal</enum>
|
<enum>Qt::ApplicationModal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -10,17 +10,17 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>394</width>
|
<width>394</width>
|
||||||
<height>148</height>
|
<height>96</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Participant</string>
|
<string>War participant</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset>
|
||||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>participantDialog</receiver>
|
<receiver>warParticipantDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>participantDialog</receiver>
|
<receiver>warParticipantDialog</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|
@ -12,7 +12,30 @@ from warchron.view.ui.ui_player_dialog import Ui_playerDialog
|
||||||
from warchron.view.ui.ui_war_dialog import Ui_warDialog
|
from warchron.view.ui.ui_war_dialog import Ui_warDialog
|
||||||
from warchron.view.ui.ui_campaign_dialog import Ui_campaignDialog
|
from warchron.view.ui.ui_campaign_dialog import Ui_campaignDialog
|
||||||
from warchron.view.ui.ui_objective_dialog import Ui_objectiveDialog
|
from warchron.view.ui.ui_objective_dialog import Ui_objectiveDialog
|
||||||
from warchron.view.ui.ui_participant_dialog import Ui_participantDialog
|
from warchron.view.ui.ui_war_participant_dialog import Ui_warParticipantDialog
|
||||||
|
from warchron.view.ui.ui_campaign_participant_dialog import Ui_campaignParticipantDialog
|
||||||
|
from warchron.view.ui.ui_sector_dialog import Ui_sectorDialog
|
||||||
|
from warchron.controller.dtos import ParticipantOption
|
||||||
|
|
||||||
|
# utils...
|
||||||
|
|
||||||
|
def select_if_exists(combo, value):
|
||||||
|
if value is None:
|
||||||
|
return
|
||||||
|
idx = combo.findData(value)
|
||||||
|
if idx != -1:
|
||||||
|
combo.setCurrentIndex(idx)
|
||||||
|
|
||||||
|
def format_war_label(war) -> str:
|
||||||
|
return f"{war.name} ({war.year})"
|
||||||
|
|
||||||
|
def format_campaign_label(camp) -> str:
|
||||||
|
return f"{camp.name} ({calendar.month_name[camp.month]})"
|
||||||
|
|
||||||
|
def format_round_label(round, index: int) -> str:
|
||||||
|
if index is None:
|
||||||
|
return ""
|
||||||
|
return f"Round {index}"
|
||||||
|
|
||||||
class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|
@ -31,6 +54,10 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
self.warParticipantsTable.customContextMenuRequested.connect(self._on_war_participants_table_context_menu)
|
self.warParticipantsTable.customContextMenuRequested.connect(self._on_war_participants_table_context_menu)
|
||||||
self.objectivesTable.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
self.objectivesTable.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||||
self.objectivesTable.customContextMenuRequested.connect(self._on_objectives_table_context_menu)
|
self.objectivesTable.customContextMenuRequested.connect(self._on_objectives_table_context_menu)
|
||||||
|
self.campaignParticipantsTable.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||||
|
self.campaignParticipantsTable.customContextMenuRequested.connect(self._on_campaign_participants_table_context_menu)
|
||||||
|
self.sectorsTable.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||||
|
self.sectorsTable.customContextMenuRequested.connect(self._on_sectors_table_context_menu)
|
||||||
self.warsTree.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
self.warsTree.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||||
self.warsTree.customContextMenuRequested.connect(self._on_wars_tree_context_menu)
|
self.warsTree.customContextMenuRequested.connect(self._on_wars_tree_context_menu)
|
||||||
self.addCampaignBtn.clicked.connect(self._on_add_campaign_clicked)
|
self.addCampaignBtn.clicked.connect(self._on_add_campaign_clicked)
|
||||||
|
|
@ -147,32 +174,23 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
if self.on_delete_item:
|
if self.on_delete_item:
|
||||||
self.on_delete_item(item_type, item_id)
|
self.on_delete_item(item_type, item_id)
|
||||||
|
|
||||||
def _format_war_label(self, war) -> str:
|
|
||||||
return f"{war.name} ({war.year})"
|
|
||||||
|
|
||||||
def _format_campaign_label(self, camp) -> str:
|
|
||||||
return f"{camp.name} ({calendar.month_name[camp.month]})"
|
|
||||||
|
|
||||||
def _format_round_label(self, round, index: int) -> str:
|
|
||||||
return f"Round {index}"
|
|
||||||
|
|
||||||
def display_wars_tree(self, wars: list):
|
def display_wars_tree(self, wars: list):
|
||||||
tree = self.warsTree
|
tree = self.warsTree
|
||||||
tree.clear()
|
tree.clear()
|
||||||
tree.setColumnCount(1)
|
tree.setColumnCount(1)
|
||||||
tree.setHeaderLabels(["Wars"])
|
tree.setHeaderLabels(["Wars"])
|
||||||
for war in wars:
|
for war in wars:
|
||||||
war_item = QTreeWidgetItem([self._format_war_label(war)])
|
war_item = QTreeWidgetItem([format_war_label(war)])
|
||||||
war_item.setData(0, ROLE_TYPE, ItemType.WAR)
|
war_item.setData(0, ROLE_TYPE, ItemType.WAR)
|
||||||
war_item.setData(0, ROLE_ID, war.id)
|
war_item.setData(0, ROLE_ID, war.id)
|
||||||
tree.addTopLevelItem(war_item)
|
tree.addTopLevelItem(war_item)
|
||||||
for camp in war.get_all_campaigns():
|
for camp in war.get_all_campaigns():
|
||||||
camp_item = QTreeWidgetItem([self._format_campaign_label(camp)])
|
camp_item = QTreeWidgetItem([format_campaign_label(camp)])
|
||||||
camp_item.setData(0, ROLE_TYPE, ItemType.CAMPAIGN)
|
camp_item.setData(0, ROLE_TYPE, ItemType.CAMPAIGN)
|
||||||
camp_item.setData(0, ROLE_ID, camp.id)
|
camp_item.setData(0, ROLE_ID, camp.id)
|
||||||
war_item.addChild(camp_item)
|
war_item.addChild(camp_item)
|
||||||
for index, rnd in enumerate(camp.get_all_rounds(), start=1):
|
for index, rnd in enumerate(camp.get_all_rounds(), start=1):
|
||||||
rnd_item = QTreeWidgetItem([self._format_round_label(rnd, index)])
|
rnd_item = QTreeWidgetItem([format_round_label(rnd, index)])
|
||||||
rnd_item.setData(0, ROLE_TYPE, ItemType.ROUND)
|
rnd_item.setData(0, ROLE_TYPE, ItemType.ROUND)
|
||||||
rnd_item.setData(0, ROLE_ID, rnd.id)
|
rnd_item.setData(0, ROLE_ID, rnd.id)
|
||||||
camp_item.addChild(rnd_item)
|
camp_item.addChild(rnd_item)
|
||||||
|
|
@ -282,10 +300,78 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
|
|
||||||
# Campaign page
|
# Campaign page
|
||||||
|
|
||||||
|
def _on_sectors_table_context_menu(self, pos):
|
||||||
|
item = self.sectorsTable.itemAt(pos)
|
||||||
|
if not item:
|
||||||
|
return
|
||||||
|
row = item.row()
|
||||||
|
name_item = self.sectorsTable.item(row, 0)
|
||||||
|
if not name_item:
|
||||||
|
return
|
||||||
|
sector_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||||
|
menu = QMenu(self)
|
||||||
|
edit_action = menu.addAction("Edit")
|
||||||
|
delete_action = menu.addAction("Delete")
|
||||||
|
action = menu.exec(self.sectorsTable.viewport().mapToGlobal(pos))
|
||||||
|
if action == edit_action and self.on_edit_item:
|
||||||
|
self.on_edit_item(ItemType.SECTOR, sector_id)
|
||||||
|
elif action == delete_action and self.on_delete_item:
|
||||||
|
self.on_delete_item(ItemType.SECTOR, sector_id)
|
||||||
|
|
||||||
|
def _on_campaign_participants_table_context_menu(self, pos):
|
||||||
|
item = self.campaignParticipantsTable.itemAt(pos)
|
||||||
|
if not item:
|
||||||
|
return
|
||||||
|
row = item.row()
|
||||||
|
name_item = self.campaignParticipantsTable.item(row, 0)
|
||||||
|
if not name_item:
|
||||||
|
return
|
||||||
|
participant_id = name_item.data(Qt.ItemDataRole.UserRole)
|
||||||
|
menu = QMenu(self)
|
||||||
|
edit_action = menu.addAction("Edit")
|
||||||
|
delete_action = menu.addAction("Delete")
|
||||||
|
action = menu.exec(self.campaignParticipantsTable.viewport().mapToGlobal(pos))
|
||||||
|
if action == edit_action and self.on_edit_item:
|
||||||
|
self.on_edit_item(ItemType.CAMPAIGN_PARTICIPANT, participant_id)
|
||||||
|
elif action == delete_action and self.on_delete_item:
|
||||||
|
self.on_delete_item(ItemType.CAMPAIGN_PARTICIPANT, participant_id)
|
||||||
|
|
||||||
def show_campaign_details(self, *, name: str, month: int):
|
def show_campaign_details(self, *, name: str, month: int):
|
||||||
self.campaignName.setText(name)
|
self.campaignName.setText(name)
|
||||||
self.campaignMonth.setText(calendar.month_name[month])
|
self.campaignMonth.setText(calendar.month_name[month])
|
||||||
|
|
||||||
|
def display_campaign_sectors(self, sectors: list[tuple[str, str, str, str, str, str]]):
|
||||||
|
table = self.sectorsTable
|
||||||
|
table.clearContents()
|
||||||
|
table.setRowCount(len(sectors))
|
||||||
|
for row, (name, round_index, major, minor, influence, pid) in enumerate(sectors):
|
||||||
|
name_item = QtWidgets.QTableWidgetItem(name)
|
||||||
|
round_item = QtWidgets.QTableWidgetItem(format_round_label(None, round_index))
|
||||||
|
major_item = QtWidgets.QTableWidgetItem(major)
|
||||||
|
minor_item = QtWidgets.QTableWidgetItem(minor)
|
||||||
|
influence_item = QtWidgets.QTableWidgetItem(influence)
|
||||||
|
name_item.setData(Qt.ItemDataRole.UserRole, pid)
|
||||||
|
table.setItem(row, 0, name_item)
|
||||||
|
table.setItem(row, 1, round_item)
|
||||||
|
table.setItem(row, 2, major_item)
|
||||||
|
table.setItem(row, 3, minor_item)
|
||||||
|
table.setItem(row, 4, influence_item)
|
||||||
|
table.resizeColumnsToContents()
|
||||||
|
|
||||||
|
def display_campaign_participants(self, participants: list[tuple[str, str, str, str]]):
|
||||||
|
table = self.campaignParticipantsTable
|
||||||
|
table.clearContents()
|
||||||
|
table.setRowCount(len(participants))
|
||||||
|
for row, (name, leader, theme, pid) in enumerate(participants):
|
||||||
|
name_item = QtWidgets.QTableWidgetItem(name)
|
||||||
|
lead_item = QtWidgets.QTableWidgetItem(leader)
|
||||||
|
theme_item = QtWidgets.QTableWidgetItem(theme)
|
||||||
|
name_item.setData(Qt.ItemDataRole.UserRole, pid)
|
||||||
|
table.setItem(row, 0, name_item)
|
||||||
|
table.setItem(row, 1, lead_item)
|
||||||
|
table.setItem(row, 2, theme_item)
|
||||||
|
table.resizeColumnsToContents()
|
||||||
|
|
||||||
# Round page
|
# Round page
|
||||||
|
|
||||||
def show_round_details(self, *, index: int):
|
def show_round_details(self, *, index: int):
|
||||||
|
|
@ -346,17 +432,14 @@ class ObjectiveDialog(QDialog):
|
||||||
def get_objective_description(self) -> str:
|
def get_objective_description(self) -> str:
|
||||||
return self.ui.objectiveDescription.toPlainText().strip()
|
return self.ui.objectiveDescription.toPlainText().strip()
|
||||||
|
|
||||||
class ParticipantDialog(QDialog):
|
class WarParticipantDialog(QDialog):
|
||||||
def __init__(self, parent=None, *, players: list, default_player_id=None, default_faction="", editable_player=True):
|
def __init__(self, parent=None, *, players: list, default_player_id=None, default_faction="", editable_player=True):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.ui = Ui_participantDialog()
|
self.ui = Ui_warParticipantDialog()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
for player in players:
|
for player in players:
|
||||||
self.ui.playerComboBox.addItem(player.name, player.id)
|
self.ui.playerComboBox.addItem(player.name, player.id)
|
||||||
if default_player_id:
|
select_if_exists(self.ui.playerComboBox, default_player_id)
|
||||||
index = self.ui.playerComboBox.findData(default_player_id)
|
|
||||||
if index != -1:
|
|
||||||
self.ui.playerComboBox.setCurrentIndex(index)
|
|
||||||
self.ui.playerComboBox.setEnabled(editable_player)
|
self.ui.playerComboBox.setEnabled(editable_player)
|
||||||
self.ui.faction.setText(default_faction)
|
self.ui.faction.setText(default_faction)
|
||||||
|
|
||||||
|
|
@ -365,3 +448,59 @@ class ParticipantDialog(QDialog):
|
||||||
|
|
||||||
def get_participant_faction(self) -> str:
|
def get_participant_faction(self) -> str:
|
||||||
return self.ui.faction.text().strip()
|
return self.ui.faction.text().strip()
|
||||||
|
|
||||||
|
class CampaignParticipantDialog(QDialog):
|
||||||
|
def __init__(self, parent=None, *, participants: list[ParticipantOption], default_participant_id=None, default_leader="", default_theme="", editable_player=True):
|
||||||
|
super().__init__(parent)
|
||||||
|
self.ui = Ui_campaignParticipantDialog()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
for part in participants:
|
||||||
|
self.ui.playerComboBox.addItem(part.name, part.id)
|
||||||
|
select_if_exists(self.ui.playerComboBox, default_participant_id)
|
||||||
|
self.ui.playerComboBox.setEnabled(editable_player)
|
||||||
|
self.ui.leader.setText(default_leader)
|
||||||
|
self.ui.theme.setText(default_theme)
|
||||||
|
|
||||||
|
def get_player_id(self) -> str:
|
||||||
|
return self.ui.playerComboBox.currentData()
|
||||||
|
|
||||||
|
def get_participant_leader(self) -> str:
|
||||||
|
return self.ui.leader.text().strip()
|
||||||
|
|
||||||
|
def get_participant_theme(self) -> str:
|
||||||
|
return self.ui.theme.text().strip()
|
||||||
|
|
||||||
|
class SectorDialog(QDialog):
|
||||||
|
def __init__(self, parent=None, *, default_name="", rounds: list, default_round_id=None, objectives: list, default_major_id=None, default_minor_id=None, default_influence_id=None):
|
||||||
|
super().__init__(parent)
|
||||||
|
self.ui = Ui_sectorDialog()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
self.ui.majorComboBox.addItem("(none)", None)
|
||||||
|
self.ui.minorComboBox.addItem("(none)", None)
|
||||||
|
self.ui.influenceComboBox.addItem("(none)", None)
|
||||||
|
self.ui.sectorName.setText(default_name)
|
||||||
|
for index, rnd in enumerate(rounds, start=1):
|
||||||
|
self.ui.roundComboBox.addItem(format_round_label(rnd, index), rnd.id)
|
||||||
|
select_if_exists(self.ui.roundComboBox, default_round_id)
|
||||||
|
for obj in objectives:
|
||||||
|
self.ui.majorComboBox.addItem(obj.name, obj.id)
|
||||||
|
self.ui.minorComboBox.addItem(obj.name, obj.id)
|
||||||
|
self.ui.influenceComboBox.addItem(obj.name, obj.id)
|
||||||
|
select_if_exists(self.ui.majorComboBox, default_major_id)
|
||||||
|
select_if_exists(self.ui.minorComboBox, default_minor_id)
|
||||||
|
select_if_exists(self.ui.influenceComboBox, default_influence_id)
|
||||||
|
|
||||||
|
def get_sector_name(self) -> str:
|
||||||
|
return self.ui.sectorName.text().strip()
|
||||||
|
|
||||||
|
def get_round_id(self) -> str:
|
||||||
|
return self.ui.roundComboBox.currentData()
|
||||||
|
|
||||||
|
def get_major_id(self) -> str:
|
||||||
|
return self.ui.majorComboBox.currentData()
|
||||||
|
|
||||||
|
def get_minor_id(self) -> str:
|
||||||
|
return self.ui.minorComboBox.currentData()
|
||||||
|
|
||||||
|
def get_influence_id(self) -> str:
|
||||||
|
return self.ui.influenceComboBox.currentData()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue