Skip to content

Commit

Permalink
Set fixed user count label size irrespective of operation description…
Browse files Browse the repository at this point in the history
… length
  • Loading branch information
workaryangupta committed Jul 31, 2024
1 parent e1c5d8b commit fedab62
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 92 deletions.
77 changes: 46 additions & 31 deletions mslib/msui/qt5/ui_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,6 @@ def setupUi(self, MSUIMainWindow):
self.gridLayout_3 = QtWidgets.QGridLayout(self.openOperationsGb)
self.gridLayout_3.setContentsMargins(8, 8, 8, 8)
self.gridLayout_3.setObjectName("gridLayout_3")
self.filterCategoryCb = QtWidgets.QComboBox(self.openOperationsGb)
self.filterCategoryCb.setAutoFillBackground(False)
self.filterCategoryCb.setEditable(False)
self.filterCategoryCb.setObjectName("filterCategoryCb")
self.filterCategoryCb.addItem("")
self.gridLayout_3.addWidget(self.filterCategoryCb, 9, 1, 1, 1)
self.workLocallyCheckbox = QtWidgets.QCheckBox(self.openOperationsGb)
self.workLocallyCheckbox.setObjectName("workLocallyCheckbox")
self.gridLayout_3.addWidget(self.workLocallyCheckbox, 10, 0, 1, 1)
self.pbOpenOperationArchive = QtWidgets.QPushButton(self.openOperationsGb)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
Expand All @@ -130,34 +121,48 @@ def setupUi(self, MSUIMainWindow):
self.pbOpenOperationArchive.setSizePolicy(sizePolicy)
self.pbOpenOperationArchive.setObjectName("pbOpenOperationArchive")
self.gridLayout_3.addWidget(self.pbOpenOperationArchive, 11, 0, 1, 2)
self.activeOperationsLabel = QtWidgets.QLabel(self.openOperationsGb)
self.activeOperationsLabel.setObjectName("activeOperationsLabel")
self.gridLayout_3.addWidget(self.activeOperationsLabel, 2, 0, 1, 1)
self.serverOptionsCb = QtWidgets.QComboBox(self.openOperationsGb)
self.serverOptionsCb.setObjectName("serverOptionsCb")
self.serverOptionsCb.addItem("")
self.serverOptionsCb.addItem("")
self.serverOptionsCb.addItem("")
self.gridLayout_3.addWidget(self.serverOptionsCb, 10, 1, 1, 1)
self.workingStatusLabel = QtWidgets.QLabel(self.openOperationsGb)
self.workingStatusLabel.setWordWrap(True)
self.workingStatusLabel.setObjectName("workingStatusLabel")
self.gridLayout_3.addWidget(self.workingStatusLabel, 6, 0, 1, 2)
self.categoryLabel = QtWidgets.QLabel(self.openOperationsGb)
self.categoryLabel.setObjectName("categoryLabel")
self.gridLayout_3.addWidget(self.categoryLabel, 9, 0, 1, 1)
self.activeOperationDesc = QtWidgets.QLabel(self.openOperationsGb)
self.activeOperationDesc.setObjectName("activeOperationDesc")
self.gridLayout_3.addWidget(self.activeOperationDesc, 1, 0, 1, 1)
self.workLocallyCheckbox = QtWidgets.QCheckBox(self.openOperationsGb)
self.workLocallyCheckbox.setObjectName("workLocallyCheckbox")
self.gridLayout_3.addWidget(self.workLocallyCheckbox, 10, 0, 1, 1)
self.listOperationsMSC = QtWidgets.QListWidget(self.openOperationsGb)
self.listOperationsMSC.setObjectName("listOperationsMSC")
self.gridLayout_3.addWidget(self.listOperationsMSC, 4, 0, 1, 2)
self.activeOperationDesc = QtWidgets.QLabel(self.openOperationsGb)
self.activeOperationDesc.setLineWidth(1)
self.activeOperationDesc.setObjectName("activeOperationDesc")
self.gridLayout_3.addWidget(self.activeOperationDesc, 1, 0, 1, 1)
self.activeOperationsLabel = QtWidgets.QLabel(self.openOperationsGb)
self.activeOperationsLabel.setObjectName("activeOperationsLabel")
self.gridLayout_3.addWidget(self.activeOperationsLabel, 2, 0, 1, 1)
self.filterCategoryCb = QtWidgets.QComboBox(self.openOperationsGb)
self.filterCategoryCb.setAutoFillBackground(False)
self.filterCategoryCb.setEditable(False)
self.filterCategoryCb.setObjectName("filterCategoryCb")
self.filterCategoryCb.addItem("")
self.gridLayout_3.addWidget(self.filterCategoryCb, 9, 1, 1, 1)
self.serverOptionsCb = QtWidgets.QComboBox(self.openOperationsGb)
self.serverOptionsCb.setObjectName("serverOptionsCb")
self.serverOptionsCb.addItem("")
self.serverOptionsCb.addItem("")
self.serverOptionsCb.addItem("")
self.gridLayout_3.addWidget(self.serverOptionsCb, 10, 1, 1, 1)
self.userCountLabel = QtWidgets.QLabel(self.openOperationsGb)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.userCountLabel.sizePolicy().hasHeightForWidth())
self.userCountLabel.setSizePolicy(sizePolicy)
self.userCountLabel.setMinimumSize(QtCore.QSize(120, 0))
self.userCountLabel.setMaximumSize(QtCore.QSize(120, 16777215))
self.userCountLabel.setLayoutDirection(QtCore.Qt.LeftToRight)
self.userCountLabel.setAutoFillBackground(False)
self.userCountLabel.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.userCountLabel.setFrameShadow(QtWidgets.QFrame.Plain)
self.userCountLabel.setScaledContents(False)
Expand Down Expand Up @@ -318,22 +323,22 @@ def retranslateUi(self, MSUIMainWindow):
self.listFlightTracks.setSortingEnabled(False)
self.openViewsLabel.setText(_translate("MSUIMainWindow", "Open Views:"))
self.listViews.setToolTip(_translate("MSUIMainWindow", "Double-click a view to bring it to the front."))
self.filterCategoryCb.setWhatsThis(_translate("MSUIMainWindow", "filter by operation category"))
self.filterCategoryCb.setCurrentText(_translate("MSUIMainWindow", "ANY"))
self.filterCategoryCb.setItemText(0, _translate("MSUIMainWindow", "ANY"))
self.pbOpenOperationArchive.setText(_translate("MSUIMainWindow", "Operation Archive"))
self.workingStatusLabel.setText(_translate("MSUIMainWindow", "No operations selected"))
self.categoryLabel.setText(_translate("MSUIMainWindow", "Category:"))
self.workLocallyCheckbox.setToolTip(_translate("MSUIMainWindow", "Check to work asynchronously from the server"))
self.workLocallyCheckbox.setText(_translate("MSUIMainWindow", "Work Asynchronously"))
self.pbOpenOperationArchive.setText(_translate("MSUIMainWindow", "Operation Archive"))
self.listOperationsMSC.setToolTip(_translate("MSUIMainWindow", "List of mscolab operations.\n"
"Double click a operation to activate and view its description."))
self.activeOperationDesc.setText(_translate("MSUIMainWindow", "Select Operation to View Description"))
self.activeOperationsLabel.setText(_translate("MSUIMainWindow", "Operations"))
self.filterCategoryCb.setWhatsThis(_translate("MSUIMainWindow", "filter by operation category"))
self.filterCategoryCb.setCurrentText(_translate("MSUIMainWindow", "ANY"))
self.filterCategoryCb.setItemText(0, _translate("MSUIMainWindow", "ANY"))
self.serverOptionsCb.setToolTip(_translate("MSUIMainWindow", "Fetch/Save Server options"))
self.serverOptionsCb.setItemText(0, _translate("MSUIMainWindow", "Server Options"))
self.serverOptionsCb.setItemText(1, _translate("MSUIMainWindow", "Fetch From Server"))
self.serverOptionsCb.setItemText(2, _translate("MSUIMainWindow", "Save To Server"))
self.workingStatusLabel.setText(_translate("MSUIMainWindow", "No operations selected"))
self.categoryLabel.setText(_translate("MSUIMainWindow", "Category:"))
self.activeOperationDesc.setText(_translate("MSUIMainWindow", "Select Operation to View Description"))
self.listOperationsMSC.setToolTip(_translate("MSUIMainWindow", "List of mscolab operations.\n"
"Double click a operation to activate and view its description."))
self.userCountLabel.setText(_translate("MSUIMainWindow", "Active Users: 0"))
self.menuFile.setTitle(_translate("MSUIMainWindow", "&File"))
self.menuImportFlightTrack.setTitle(_translate("MSUIMainWindow", "Import Flight Track"))
Expand Down Expand Up @@ -383,3 +388,13 @@ def retranslateUi(self, MSUIMainWindow):
self.actionLeaveOperation.setText(_translate("MSUIMainWindow", "&Leave Operation"))
self.actionArchiveOperation.setText(_translate("MSUIMainWindow", "Archive Operation"))
self.actionChangeCategory.setText(_translate("MSUIMainWindow", "Change Category"))


if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MSUIMainWindow = QtWidgets.QMainWindow()
ui = Ui_MSUIMainWindow()
ui.setupUi(MSUIMainWindow)
MSUIMainWindow.show()
sys.exit(app.exec_())
143 changes: 82 additions & 61 deletions mslib/msui/ui/ui_mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -239,28 +239,34 @@ Save a flight track to name it.</string>
<property name="bottomMargin">
<number>8</number>
</property>
<item row="9" column="1">
<widget class="QComboBox" name="filterCategoryCb">
<property name="whatsThis">
<string>filter by operation category</string>
<item row="11" column="0" colspan="2">
<widget class="QPushButton" name="pbOpenOperationArchive">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>false</bool>
<property name="text">
<string>Operation Archive</string>
</property>
<property name="editable">
<bool>false</bool>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="workingStatusLabel">
<property name="text">
<string>No operations selected</string>
</property>
<property name="currentText">
<string>ANY</string>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="currentIndex">
<number>0</number>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="categoryLabel">
<property name="text">
<string>Category:</string>
</property>
<item>
<property name="text">
<string>ANY</string>
</property>
</item>
</widget>
</item>
<item row="10" column="0">
Expand All @@ -273,16 +279,24 @@ Save a flight track to name it.</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="QPushButton" name="pbOpenOperationArchive">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="4" column="0" colspan="2">
<widget class="QListWidget" name="listOperationsMSC">
<property name="toolTip">
<string>List of mscolab operations.
Double click a operation to activate and view its description.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="activeOperationDesc">
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>Operation Archive</string>
<string>Select Operation to View Description</string>
</property>
<property name="margin">
<number>1</number>
</property>
</widget>
</item>
Expand All @@ -293,6 +307,30 @@ Save a flight track to name it.</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QComboBox" name="filterCategoryCb">
<property name="whatsThis">
<string>filter by operation category</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string>ANY</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>ANY</string>
</property>
</item>
</widget>
</item>
<item row="10" column="1">
<widget class="QComboBox" name="serverOptionsCb">
<property name="toolTip">
Expand All @@ -315,49 +353,32 @@ Save a flight track to name it.</string>
</item>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="workingStatusLabel">
<property name="text">
<string>No operations selected</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="categoryLabel">
<property name="text">
<string>Category:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="activeOperationDesc">
<property name="text">
<string>Select Operation to View Description</string>
</property>
<property name="margin">
<number>1</number>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QListWidget" name="listOperationsMSC">
<property name="toolTip">
<string>List of mscolab operations.
Double click a operation to activate and view its description.</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="userCountLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down

0 comments on commit fedab62

Please sign in to comment.