add/edit/delete sectors and participants in campaign
This commit is contained in:
parent
495a5adb98
commit
2816da010c
22 changed files with 1799 additions and 923 deletions
|
|
@ -17,25 +17,27 @@ class Ui_campaignDialog(object):
|
|||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
campaignDialog.setWindowIcon(icon)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=campaignDialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(10, 60, 341, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.formLayout = QtWidgets.QFormLayout(campaignDialog)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(parent=campaignDialog)
|
||||
self.label.setGeometry(QtCore.QRect(10, 20, 47, 14))
|
||||
self.label.setObjectName("label")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
|
||||
self.campaignName = QtWidgets.QLineEdit(parent=campaignDialog)
|
||||
self.campaignName.setGeometry(QtCore.QRect(60, 20, 113, 20))
|
||||
self.campaignName.setObjectName("campaignName")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.campaignName)
|
||||
self.label_2 = QtWidgets.QLabel(parent=campaignDialog)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 50, 47, 14))
|
||||
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.setGeometry(QtCore.QRect(60, 50, 71, 22))
|
||||
self.campaignMonth.setMinimum(1)
|
||||
self.campaignMonth.setMaximum(12)
|
||||
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.buttonBox.accepted.connect(campaignDialog.accept) # type: ignore
|
||||
|
|
|
|||
|
|
@ -20,74 +20,45 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<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">
|
||||
<property name="geometry">
|
||||
<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="campaignName">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>20</y>
|
||||
<width>113</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<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">
|
||||
<string>Month:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<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">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>12</number>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="campaignName"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Month:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="campaignMonth">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>12</number>
|
||||
</property>
|
||||
</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>
|
||||
<resources/>
|
||||
<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>
|
||||
|
|
@ -147,12 +147,12 @@ class Ui_MainWindow(object):
|
|||
self.campaignMonth.setFont(font)
|
||||
self.campaignMonth.setObjectName("campaignMonth")
|
||||
self.labelParticipants_2 = QtWidgets.QLabel(parent=self.pageCampaign)
|
||||
self.labelParticipants_2.setGeometry(QtCore.QRect(10, 180, 47, 13))
|
||||
self.labelParticipants_2.setGeometry(QtCore.QRect(10, 180, 61, 16))
|
||||
self.labelParticipants_2.setObjectName("labelParticipants_2")
|
||||
self.campaignParticipantsTable = QtWidgets.QTableWidget(parent=self.pageCampaign)
|
||||
self.campaignParticipantsTable.setGeometry(QtCore.QRect(10, 200, 401, 181))
|
||||
self.campaignParticipantsTable.setObjectName("campaignParticipantsTable")
|
||||
self.campaignParticipantsTable.setColumnCount(4)
|
||||
self.campaignParticipantsTable.setColumnCount(5)
|
||||
self.campaignParticipantsTable.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.campaignParticipantsTable.setHorizontalHeaderItem(0, item)
|
||||
|
|
@ -162,6 +162,8 @@ class Ui_MainWindow(object):
|
|||
self.campaignParticipantsTable.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.campaignParticipantsTable.setHorizontalHeaderItem(3, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.campaignParticipantsTable.setHorizontalHeaderItem(4, item)
|
||||
self.sectorsTable = QtWidgets.QTableWidget(parent=self.pageCampaign)
|
||||
self.sectorsTable.setGeometry(QtCore.QRect(10, 60, 401, 101))
|
||||
self.sectorsTable.setObjectName("sectorsTable")
|
||||
|
|
@ -315,7 +317,7 @@ class Ui_MainWindow(object):
|
|||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(1)
|
||||
self.selectedDetailsStack.setCurrentIndex(0)
|
||||
self.selectedDetailsStack.setCurrentIndex(2)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
|
|
@ -366,8 +368,10 @@ class Ui_MainWindow(object):
|
|||
item = self.campaignParticipantsTable.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "Leader"))
|
||||
item = self.campaignParticipantsTable.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Victory pts."))
|
||||
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."))
|
||||
item = self.sectorsTable.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Name"))
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -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):
|
||||
playerDialog.setObjectName("playerDialog")
|
||||
playerDialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
|
||||
playerDialog.resize(378, 98)
|
||||
playerDialog.resize(378, 67)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
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.setGeometry(QtCore.QRect(10, 60, 341, 32))
|
||||
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=playerDialog)
|
||||
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.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||
|
||||
self.retranslateUi(playerDialog)
|
||||
self.buttonBox.accepted.connect(playerDialog.accept) # type: ignore
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>378</width>
|
||||
<height>98</height>
|
||||
<height>67</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -20,45 +20,28 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<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">
|
||||
<property name="geometry">
|
||||
<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>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</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">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<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.addPixmap(QtGui.QPixmap(".\\src\\warchron\\view\\ui\\../resources/warchron_logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
|
||||
warDialog.setWindowIcon(icon)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=warDialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(10, 80, 341, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(warDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label = QtWidgets.QLabel(parent=warDialog)
|
||||
self.label.setGeometry(QtCore.QRect(10, 20, 47, 14))
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.warName = QtWidgets.QLineEdit(parent=warDialog)
|
||||
self.warName.setGeometry(QtCore.QRect(60, 20, 113, 20))
|
||||
self.warName.setObjectName("warName")
|
||||
self.gridLayout.addWidget(self.warName, 0, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(parent=warDialog)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 50, 47, 14))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.warYear = QtWidgets.QSpinBox(parent=warDialog)
|
||||
self.warYear.setGeometry(QtCore.QRect(60, 50, 71, 22))
|
||||
self.warYear.setMinimum(1970)
|
||||
self.warYear.setMaximum(3000)
|
||||
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.buttonBox.accepted.connect(warDialog.accept) # type: ignore
|
||||
|
|
|
|||
|
|
@ -20,74 +20,45 @@
|
|||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<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">
|
||||
<property name="geometry">
|
||||
<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="warName">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>20</y>
|
||||
<width>113</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<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">
|
||||
<string>Year:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<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">
|
||||
<number>1970</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>3000</number>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="warName"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Year:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="warYear">
|
||||
<property name="minimum">
|
||||
<number>1970</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>3000</number>
|
||||
</property>
|
||||
</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>
|
||||
<resources/>
|
||||
<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"?>
|
||||
<ui version="4.0">
|
||||
<class>participantDialog</class>
|
||||
<widget class="QDialog" name="participantDialog">
|
||||
<class>warParticipantDialog</class>
|
||||
<widget class="QDialog" name="warParticipantDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::ApplicationModal</enum>
|
||||
</property>
|
||||
|
|
@ -10,17 +10,17 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>394</width>
|
||||
<height>148</height>
|
||||
<height>96</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Participant</string>
|
||||
<string>War participant</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>../resources/warchron_logo.png</normaloff>../resources/warchron_logo.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>participantDialog</receiver>
|
||||
<receiver>warParticipantDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>participantDialog</receiver>
|
||||
<receiver>warParticipantDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<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_campaign_dialog import Ui_campaignDialog
|
||||
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):
|
||||
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.objectivesTable.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
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.customContextMenuRequested.connect(self._on_wars_tree_context_menu)
|
||||
self.addCampaignBtn.clicked.connect(self._on_add_campaign_clicked)
|
||||
|
|
@ -147,32 +174,23 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
if self.on_delete_item:
|
||||
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):
|
||||
tree = self.warsTree
|
||||
tree.clear()
|
||||
tree.setColumnCount(1)
|
||||
tree.setHeaderLabels(["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_ID, war.id)
|
||||
tree.addTopLevelItem(war_item)
|
||||
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_ID, camp.id)
|
||||
war_item.addChild(camp_item)
|
||||
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_ID, rnd.id)
|
||||
camp_item.addChild(rnd_item)
|
||||
|
|
@ -282,10 +300,78 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
|
||||
# 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):
|
||||
self.campaignName.setText(name)
|
||||
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
|
||||
|
||||
def show_round_details(self, *, index: int):
|
||||
|
|
@ -346,17 +432,14 @@ class ObjectiveDialog(QDialog):
|
|||
def get_objective_description(self) -> str:
|
||||
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):
|
||||
super().__init__(parent)
|
||||
self.ui = Ui_participantDialog()
|
||||
self.ui = Ui_warParticipantDialog()
|
||||
self.ui.setupUi(self)
|
||||
for player in players:
|
||||
self.ui.playerComboBox.addItem(player.name, player.id)
|
||||
if default_player_id:
|
||||
index = self.ui.playerComboBox.findData(default_player_id)
|
||||
if index != -1:
|
||||
self.ui.playerComboBox.setCurrentIndex(index)
|
||||
select_if_exists(self.ui.playerComboBox, default_player_id)
|
||||
self.ui.playerComboBox.setEnabled(editable_player)
|
||||
self.ui.faction.setText(default_faction)
|
||||
|
||||
|
|
@ -364,4 +447,60 @@ class ParticipantDialog(QDialog):
|
|||
return self.ui.playerComboBox.currentData()
|
||||
|
||||
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