From 9158b9708793fcd91aac1fe07147c666e54d8718 Mon Sep 17 00:00:00 2001 From: rohit Date: Tue, 13 Aug 2024 01:01:41 +0530 Subject: [PATCH 1/4] ui --- mslib/msui/qt5/ui_mainwindow.py | 113 ++++++++++---- mslib/msui/ui/ui_mainwindow.ui | 256 ++++++++++++++++++++++++-------- 2 files changed, 278 insertions(+), 91 deletions(-) diff --git a/mslib/msui/qt5/ui_mainwindow.py b/mslib/msui/qt5/ui_mainwindow.py index 2b8056f50..964b57aa9 100644 --- a/mslib/msui/qt5/ui_mainwindow.py +++ b/mslib/msui/qt5/ui_mainwindow.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'mslib/msui/ui/ui_mainwindow.ui' # -# Created by: PyQt5 UI code generator 5.15.7 +# Created by: PyQt5 UI code generator 5.12.3 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -14,7 +14,7 @@ class Ui_MSUIMainWindow(object): def setupUi(self, MSUIMainWindow): MSUIMainWindow.setObjectName("MSUIMainWindow") - MSUIMainWindow.resize(738, 749) + MSUIMainWindow.resize(770, 895) MSUIMainWindow.setMinimumSize(QtCore.QSize(507, 736)) self.centralwidget = QtWidgets.QWidget(MSUIMainWindow) self.centralwidget.setObjectName("centralwidget") @@ -113,36 +113,49 @@ def setupUi(self, MSUIMainWindow): self.gridLayout_3.setContentsMargins(8, 8, 8, 8) self.gridLayout_3.setObjectName("gridLayout_3") self.workingStatusLabel = QtWidgets.QLabel(self.openOperationsGb) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.workingStatusLabel.sizePolicy().hasHeightForWidth()) + self.workingStatusLabel.setSizePolicy(sizePolicy) self.workingStatusLabel.setWordWrap(True) self.workingStatusLabel.setObjectName("workingStatusLabel") self.gridLayout_3.addWidget(self.workingStatusLabel, 6, 0, 1, 2) - self.activeOperationDesc = QtWidgets.QLabel(self.openOperationsGb) - self.activeOperationDesc.setObjectName("activeOperationDesc") - self.gridLayout_3.addWidget(self.activeOperationDesc, 1, 0, 1, 2) - self.activeOperationsLabel = QtWidgets.QLabel(self.openOperationsGb) - self.activeOperationsLabel.setObjectName("activeOperationsLabel") - self.gridLayout_3.addWidget(self.activeOperationsLabel, 2, 0, 1, 1) self.workLocallyCheckbox = QtWidgets.QCheckBox(self.openOperationsGb) self.workLocallyCheckbox.setObjectName("workLocallyCheckbox") - self.gridLayout_3.addWidget(self.workLocallyCheckbox, 10, 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.gridLayout_3.addWidget(self.workLocallyCheckbox, 9, 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.categoryLabel = QtWidgets.QLabel(self.openOperationsGb) + self.gridLayout_3.addWidget(self.serverOptionsCb, 9, 1, 1, 1) + self.groupBox = QtWidgets.QGroupBox(self.openOperationsGb) + self.groupBox.setObjectName("groupBox") + self.categoryLabel = QtWidgets.QLabel(self.groupBox) + self.categoryLabel.setGeometry(QtCore.QRect(10, 30, 111, 23)) self.categoryLabel.setObjectName("categoryLabel") - self.gridLayout_3.addWidget(self.categoryLabel, 9, 0, 1, 1) - self.listOperationsMSC = QtWidgets.QListWidget(self.openOperationsGb) - self.listOperationsMSC.setObjectName("listOperationsMSC") - self.gridLayout_3.addWidget(self.listOperationsMSC, 4, 0, 1, 2) + self.filterCategoryCb = QtWidgets.QComboBox(self.groupBox) + self.filterCategoryCb.setGeometry(QtCore.QRect(170, 30, 151, 21)) + self.filterCategoryCb.setAutoFillBackground(False) + self.filterCategoryCb.setEditable(False) + self.filterCategoryCb.setObjectName("filterCategoryCb") + self.filterCategoryCb.addItem("") + self.regexlable = QtWidgets.QLabel(self.groupBox) + self.regexlable.setGeometry(QtCore.QRect(10, 60, 131, 16)) + self.regexlable.setObjectName("regexlable") + self.ignoreArchiveCb = QtWidgets.QCheckBox(self.groupBox) + self.ignoreArchiveCb.setGeometry(QtCore.QRect(10, 90, 181, 21)) + self.ignoreArchiveCb.setObjectName("ignoreArchiveCb") + self.applyCancelBb = QtWidgets.QDialogButtonBox(self.groupBox) + self.applyCancelBb.setGeometry(QtCore.QRect(100, 120, 161, 24)) + self.applyCancelBb.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel) + self.applyCancelBb.setCenterButtons(False) + self.applyCancelBb.setObjectName("applyCancelBb") + self.regexFilterLe = QtWidgets.QLineEdit(self.groupBox) + self.regexFilterLe.setGeometry(QtCore.QRect(170, 60, 151, 23)) + self.regexFilterLe.setObjectName("regexFilterLe") + self.gridLayout_3.addWidget(self.groupBox, 7, 0, 1, 2) self.pbOpenOperationArchive = QtWidgets.QPushButton(self.openOperationsGb) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -150,14 +163,46 @@ def setupUi(self, MSUIMainWindow): sizePolicy.setHeightForWidth(self.pbOpenOperationArchive.sizePolicy().hasHeightForWidth()) self.pbOpenOperationArchive.setSizePolicy(sizePolicy) self.pbOpenOperationArchive.setObjectName("pbOpenOperationArchive") - self.gridLayout_3.addWidget(self.pbOpenOperationArchive, 11, 0, 1, 2) + self.gridLayout_3.addWidget(self.pbOpenOperationArchive, 10, 0, 1, 2) + self.frame = QtWidgets.QFrame(self.openOperationsGb) + self.frame.setMinimumSize(QtCore.QSize(200, 420)) + self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame.setObjectName("frame") + self.activeOperationDesc = QtWidgets.QLabel(self.frame) + self.activeOperationDesc.setGeometry(QtCore.QRect(10, 10, 332, 15)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.activeOperationDesc.sizePolicy().hasHeightForWidth()) + self.activeOperationDesc.setSizePolicy(sizePolicy) + self.activeOperationDesc.setObjectName("activeOperationDesc") + self.activeOperationsLabel = QtWidgets.QLabel(self.frame) + self.activeOperationsLabel.setGeometry(QtCore.QRect(10, 40, 332, 15)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.activeOperationsLabel.sizePolicy().hasHeightForWidth()) + self.activeOperationsLabel.setSizePolicy(sizePolicy) + self.activeOperationsLabel.setObjectName("activeOperationsLabel") + self.listOperationsMSC = QtWidgets.QListWidget(self.frame) + self.listOperationsMSC.setGeometry(QtCore.QRect(10, 60, 332, 351)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listOperationsMSC.sizePolicy().hasHeightForWidth()) + self.listOperationsMSC.setSizePolicy(sizePolicy) + self.listOperationsMSC.setMinimumSize(QtCore.QSize(0, 0)) + self.listOperationsMSC.setMaximumSize(QtCore.QSize(16777215, 400)) + self.listOperationsMSC.setObjectName("listOperationsMSC") + self.gridLayout_3.addWidget(self.frame, 0, 0, 1, 2) self.horizontalLayout.addWidget(self.openOperationsGb) self.verticalLayout_2.addLayout(self.horizontalLayout) self.gridLayout.addLayout(self.verticalLayout_2, 0, 0, 1, 2) self.gridLayout.setColumnStretch(0, 1) MSUIMainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MSUIMainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 738, 22)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 770, 20)) self.menubar.setNativeMenuBar(False) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) @@ -280,13 +325,12 @@ def setupUi(self, MSUIMainWindow): self.retranslateUi(MSUIMainWindow) self.filterCategoryCb.setCurrentIndex(0) - self.actionQuit.triggered.connect(MSUIMainWindow.close) # type: ignore + self.actionQuit.triggered.connect(MSUIMainWindow.close) QtCore.QMetaObject.connectSlotsByName(MSUIMainWindow) MSUIMainWindow.setTabOrder(self.connectBtn, self.userOptionsTb) MSUIMainWindow.setTabOrder(self.userOptionsTb, self.listFlightTracks) MSUIMainWindow.setTabOrder(self.listFlightTracks, self.listViews) - MSUIMainWindow.setTabOrder(self.listViews, self.listOperationsMSC) - MSUIMainWindow.setTabOrder(self.listOperationsMSC, self.workLocallyCheckbox) + MSUIMainWindow.setTabOrder(self.listViews, self.workLocallyCheckbox) MSUIMainWindow.setTabOrder(self.workLocallyCheckbox, self.serverOptionsCb) def retranslateUi(self, MSUIMainWindow): @@ -305,21 +349,24 @@ def retranslateUi(self, MSUIMainWindow): self.openViewsLabel.setText(_translate("MSUIMainWindow", "Open Views:")) self.listViews.setToolTip(_translate("MSUIMainWindow", "Double-click a view to bring it to the front.")) self.workingStatusLabel.setText(_translate("MSUIMainWindow", "No operations selected")) - self.activeOperationDesc.setText(_translate("MSUIMainWindow", "Select Operation to View Description")) - self.activeOperationsLabel.setText(_translate("MSUIMainWindow", "Operations")) self.workLocallyCheckbox.setToolTip(_translate("MSUIMainWindow", "Check to work asynchronously from the server")) self.workLocallyCheckbox.setText(_translate("MSUIMainWindow", "Work Asynchronously")) - 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.categoryLabel.setText(_translate("MSUIMainWindow", "Category:")) + self.groupBox.setTitle(_translate("MSUIMainWindow", "Filter flight operations")) + self.categoryLabel.setText(_translate("MSUIMainWindow", "Filter by category:")) + self.filterCategoryCb.setWhatsThis(_translate("MSUIMainWindow", "filter by operation category")) + self.filterCategoryCb.setCurrentText(_translate("MSUIMainWindow", "ANY")) + self.filterCategoryCb.setItemText(0, _translate("MSUIMainWindow", "ANY")) + self.regexlable.setText(_translate("MSUIMainWindow", "Regex filter pattern:")) + self.ignoreArchiveCb.setText(_translate("MSUIMainWindow", "Ignore Archive operations")) + self.pbOpenOperationArchive.setText(_translate("MSUIMainWindow", "Operation Archive")) + self.activeOperationDesc.setText(_translate("MSUIMainWindow", "Select Operation to View Description")) + self.activeOperationsLabel.setText(_translate("MSUIMainWindow", "Operations")) self.listOperationsMSC.setToolTip(_translate("MSUIMainWindow", "List of mscolab operations.\n" "Double click a operation to activate and view its description.")) - self.pbOpenOperationArchive.setText(_translate("MSUIMainWindow", "Operation Archive")) self.menuFile.setTitle(_translate("MSUIMainWindow", "&File")) self.menuImportFlightTrack.setTitle(_translate("MSUIMainWindow", "Import Flight Track")) self.menuExportActiveFlightTrack.setTitle(_translate("MSUIMainWindow", "Export Flight Track")) diff --git a/mslib/msui/ui/ui_mainwindow.ui b/mslib/msui/ui/ui_mainwindow.ui index 9f6209063..494dc80a3 100644 --- a/mslib/msui/ui/ui_mainwindow.ui +++ b/mslib/msui/ui/ui_mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 738 - 749 + 770 + 895 @@ -235,6 +235,12 @@ Save a flight track to name it. + + + 0 + 0 + + No operations selected @@ -243,21 +249,7 @@ Save a flight track to name it. - - - - Select Operation to View Description - - - - - - - Operations - - - - + Check to work asynchronously from the server @@ -268,30 +260,6 @@ Save a flight track to name it. - - - filter by operation category - - - false - - - false - - - ANY - - - 0 - - - - ANY - - - - - Fetch/Save Server options @@ -313,22 +281,109 @@ Save a flight track to name it. - - - - Category: - - - - - - - List of mscolab operations. -Double click a operation to activate and view its description. - + + + + Filter flight operations + + + + + 10 + 30 + 111 + 23 + + + + Filter by category: + + + + + + 170 + 30 + 151 + 21 + + + + filter by operation category + + + false + + + false + + + ANY + + + 0 + + + + ANY + + + + + + + 10 + 60 + 131 + 16 + + + + Regex filter pattern: + + + + + + 10 + 90 + 181 + 21 + + + + Ignore Archive operations + + + + + + 100 + 120 + 161 + 24 + + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel + + + false + + + + + + 170 + 60 + 151 + 23 + + + - + @@ -341,6 +396,92 @@ Double click a operation to activate and view its description. + + + + + 200 + 420 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 332 + 15 + + + + + 0 + 0 + + + + Select Operation to View Description + + + + + + 10 + 40 + 332 + 15 + + + + + 0 + 0 + + + + Operations + + + + + + 10 + 60 + 332 + 351 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 400 + + + + List of mscolab operations. +Double click a operation to activate and view its description. + + + + @@ -355,8 +496,8 @@ Double click a operation to activate and view its description. 0 0 - 738 - 22 + 770 + 20 @@ -627,7 +768,6 @@ Double click a operation to activate and view its description. userOptionsTb listFlightTracks listViews - listOperationsMSC workLocallyCheckbox serverOptionsCb From 975fdb18f7625d1f40f172dc99321a2da3d751fd Mon Sep 17 00:00:00 2001 From: rohit Date: Fri, 16 Aug 2024 22:43:13 +0530 Subject: [PATCH 2/4] reuested change in the ui --- mslib/msui/qt5/ui_mainwindow.py | 99 +++++++------- mslib/msui/ui/ui_mainwindow.ui | 230 +++++++++++++------------------- 2 files changed, 143 insertions(+), 186 deletions(-) diff --git a/mslib/msui/qt5/ui_mainwindow.py b/mslib/msui/qt5/ui_mainwindow.py index 964b57aa9..106d6562b 100644 --- a/mslib/msui/qt5/ui_mainwindow.py +++ b/mslib/msui/qt5/ui_mainwindow.py @@ -14,7 +14,7 @@ class Ui_MSUIMainWindow(object): def setupUi(self, MSUIMainWindow): MSUIMainWindow.setObjectName("MSUIMainWindow") - MSUIMainWindow.resize(770, 895) + MSUIMainWindow.resize(811, 835) MSUIMainWindow.setMinimumSize(QtCore.QSize(507, 736)) self.centralwidget = QtWidgets.QWidget(MSUIMainWindow) self.centralwidget.setObjectName("centralwidget") @@ -112,25 +112,21 @@ 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.workingStatusLabel = QtWidgets.QLabel(self.openOperationsGb) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) + self.activeOperationDesc = QtWidgets.QLabel(self.openOperationsGb) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.workingStatusLabel.sizePolicy().hasHeightForWidth()) - self.workingStatusLabel.setSizePolicy(sizePolicy) - self.workingStatusLabel.setWordWrap(True) - self.workingStatusLabel.setObjectName("workingStatusLabel") - self.gridLayout_3.addWidget(self.workingStatusLabel, 6, 0, 1, 2) - self.workLocallyCheckbox = QtWidgets.QCheckBox(self.openOperationsGb) - self.workLocallyCheckbox.setObjectName("workLocallyCheckbox") - self.gridLayout_3.addWidget(self.workLocallyCheckbox, 9, 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, 9, 1, 1, 1) + sizePolicy.setHeightForWidth(self.activeOperationDesc.sizePolicy().hasHeightForWidth()) + self.activeOperationDesc.setSizePolicy(sizePolicy) + self.activeOperationDesc.setObjectName("activeOperationDesc") + self.gridLayout_3.addWidget(self.activeOperationDesc, 0, 0, 1, 1) self.groupBox = QtWidgets.QGroupBox(self.openOperationsGb) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) + self.groupBox.setSizePolicy(sizePolicy) + self.groupBox.setMaximumSize(QtCore.QSize(16777215, 120)) self.groupBox.setObjectName("groupBox") self.categoryLabel = QtWidgets.QLabel(self.groupBox) self.categoryLabel.setGeometry(QtCore.QRect(10, 30, 111, 23)) @@ -147,15 +143,10 @@ def setupUi(self, MSUIMainWindow): self.ignoreArchiveCb = QtWidgets.QCheckBox(self.groupBox) self.ignoreArchiveCb.setGeometry(QtCore.QRect(10, 90, 181, 21)) self.ignoreArchiveCb.setObjectName("ignoreArchiveCb") - self.applyCancelBb = QtWidgets.QDialogButtonBox(self.groupBox) - self.applyCancelBb.setGeometry(QtCore.QRect(100, 120, 161, 24)) - self.applyCancelBb.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel) - self.applyCancelBb.setCenterButtons(False) - self.applyCancelBb.setObjectName("applyCancelBb") self.regexFilterLe = QtWidgets.QLineEdit(self.groupBox) self.regexFilterLe.setGeometry(QtCore.QRect(170, 60, 151, 23)) self.regexFilterLe.setObjectName("regexFilterLe") - self.gridLayout_3.addWidget(self.groupBox, 7, 0, 1, 2) + self.gridLayout_3.addWidget(self.groupBox, 9, 0, 1, 2) self.pbOpenOperationArchive = QtWidgets.QPushButton(self.openOperationsGb) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -163,46 +154,50 @@ def setupUi(self, MSUIMainWindow): sizePolicy.setHeightForWidth(self.pbOpenOperationArchive.sizePolicy().hasHeightForWidth()) self.pbOpenOperationArchive.setSizePolicy(sizePolicy) self.pbOpenOperationArchive.setObjectName("pbOpenOperationArchive") - self.gridLayout_3.addWidget(self.pbOpenOperationArchive, 10, 0, 1, 2) - self.frame = QtWidgets.QFrame(self.openOperationsGb) - self.frame.setMinimumSize(QtCore.QSize(200, 420)) - self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) - self.frame.setFrameShadow(QtWidgets.QFrame.Raised) - self.frame.setObjectName("frame") - self.activeOperationDesc = QtWidgets.QLabel(self.frame) - self.activeOperationDesc.setGeometry(QtCore.QRect(10, 10, 332, 15)) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.activeOperationDesc.sizePolicy().hasHeightForWidth()) - self.activeOperationDesc.setSizePolicy(sizePolicy) - self.activeOperationDesc.setObjectName("activeOperationDesc") - self.activeOperationsLabel = QtWidgets.QLabel(self.frame) - self.activeOperationsLabel.setGeometry(QtCore.QRect(10, 40, 332, 15)) + self.gridLayout_3.addWidget(self.pbOpenOperationArchive, 12, 0, 1, 2) + self.activeOperationsLabel = QtWidgets.QLabel(self.openOperationsGb) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.activeOperationsLabel.sizePolicy().hasHeightForWidth()) self.activeOperationsLabel.setSizePolicy(sizePolicy) self.activeOperationsLabel.setObjectName("activeOperationsLabel") - self.listOperationsMSC = QtWidgets.QListWidget(self.frame) - self.listOperationsMSC.setGeometry(QtCore.QRect(10, 60, 332, 351)) + self.gridLayout_3.addWidget(self.activeOperationsLabel, 1, 0, 1, 1) + self.workLocallyCheckbox = QtWidgets.QCheckBox(self.openOperationsGb) + self.workLocallyCheckbox.setObjectName("workLocallyCheckbox") + self.gridLayout_3.addWidget(self.workLocallyCheckbox, 11, 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, 11, 1, 1, 1) + self.workingStatusLabel = QtWidgets.QLabel(self.openOperationsGb) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.workingStatusLabel.sizePolicy().hasHeightForWidth()) + self.workingStatusLabel.setSizePolicy(sizePolicy) + self.workingStatusLabel.setWordWrap(True) + self.workingStatusLabel.setObjectName("workingStatusLabel") + self.gridLayout_3.addWidget(self.workingStatusLabel, 8, 0, 1, 1) + self.listOperationsMSC = QtWidgets.QListWidget(self.openOperationsGb) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.listOperationsMSC.sizePolicy().hasHeightForWidth()) self.listOperationsMSC.setSizePolicy(sizePolicy) self.listOperationsMSC.setMinimumSize(QtCore.QSize(0, 0)) - self.listOperationsMSC.setMaximumSize(QtCore.QSize(16777215, 400)) + self.listOperationsMSC.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.listOperationsMSC.setObjectName("listOperationsMSC") - self.gridLayout_3.addWidget(self.frame, 0, 0, 1, 2) + self.gridLayout_3.addWidget(self.listOperationsMSC, 7, 0, 1, 2) self.horizontalLayout.addWidget(self.openOperationsGb) self.verticalLayout_2.addLayout(self.horizontalLayout) self.gridLayout.addLayout(self.verticalLayout_2, 0, 0, 1, 2) self.gridLayout.setColumnStretch(0, 1) MSUIMainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MSUIMainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 770, 20)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 811, 20)) self.menubar.setNativeMenuBar(False) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) @@ -348,13 +343,7 @@ def retranslateUi(self, MSUIMainWindow): "Save a flight track to name it.")) self.openViewsLabel.setText(_translate("MSUIMainWindow", "Open Views:")) self.listViews.setToolTip(_translate("MSUIMainWindow", "Double-click a view to bring it to the front.")) - self.workingStatusLabel.setText(_translate("MSUIMainWindow", "No operations selected")) - self.workLocallyCheckbox.setToolTip(_translate("MSUIMainWindow", "Check to work asynchronously from the server")) - self.workLocallyCheckbox.setText(_translate("MSUIMainWindow", "Work Asynchronously")) - 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.activeOperationDesc.setText(_translate("MSUIMainWindow", "Select Operation to View Description")) self.groupBox.setTitle(_translate("MSUIMainWindow", "Filter flight operations")) self.categoryLabel.setText(_translate("MSUIMainWindow", "Filter by category:")) self.filterCategoryCb.setWhatsThis(_translate("MSUIMainWindow", "filter by operation category")) @@ -363,8 +352,14 @@ def retranslateUi(self, MSUIMainWindow): self.regexlable.setText(_translate("MSUIMainWindow", "Regex filter pattern:")) self.ignoreArchiveCb.setText(_translate("MSUIMainWindow", "Ignore Archive operations")) self.pbOpenOperationArchive.setText(_translate("MSUIMainWindow", "Operation Archive")) - self.activeOperationDesc.setText(_translate("MSUIMainWindow", "Select Operation to View Description")) self.activeOperationsLabel.setText(_translate("MSUIMainWindow", "Operations")) + self.workLocallyCheckbox.setToolTip(_translate("MSUIMainWindow", "Check to work asynchronously from the server")) + self.workLocallyCheckbox.setText(_translate("MSUIMainWindow", "Work Asynchronously")) + 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.listOperationsMSC.setToolTip(_translate("MSUIMainWindow", "List of mscolab operations.\n" "Double click a operation to activate and view its description.")) self.menuFile.setTitle(_translate("MSUIMainWindow", "&File")) diff --git a/mslib/msui/ui/ui_mainwindow.ui b/mslib/msui/ui/ui_mainwindow.ui index 494dc80a3..70aa0acfd 100644 --- a/mslib/msui/ui/ui_mainwindow.ui +++ b/mslib/msui/ui/ui_mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 770 - 895 + 811 + 835 @@ -233,56 +233,33 @@ Save a flight track to name it. 8 - - + + - + 0 0 - No operations selected - - - true + Select Operation to View Description - - - - Check to work asynchronously from the server - - - Work Asynchronously + + + + + 0 + 0 + - - - - - - Fetch/Save Server options + + + 16777215 + 120 + - - - Server Options - - - - - Fetch From Server - - - - - Save To Server - - - - - - Filter flight operations @@ -355,22 +332,6 @@ Save a flight track to name it. Ignore Archive operations - - - - 100 - 120 - 161 - 24 - - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel - - - false - - @@ -383,7 +344,7 @@ Save a flight track to name it. - + @@ -396,90 +357,91 @@ Save a flight track to name it. - - - - - 200 - 420 - + + + + + 0 + 0 + - - QFrame::StyledPanel + + Operations - - QFrame::Raised + + + + + + Check to work asynchronously from the server - - - - 10 - 10 - 332 - 15 - - - - - 0 - 0 - - + + Work Asynchronously + + + + + + + Fetch/Save Server options + + - Select Operation to View Description - - - - - - 10 - 40 - 332 - 15 - - - - - 0 - 0 - + Server Options + + - Operations - - - - - - 10 - 60 - 332 - 351 - - - - - 0 - 0 - - - - - 0 - 0 - + Fetch From Server - - - 16777215 - 400 - + + + + Save To Server - - List of mscolab operations. + + + + + + + + 0 + 0 + + + + No operations selected + + + true + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + List of mscolab operations. Double click a operation to activate and view its description. - - + @@ -496,7 +458,7 @@ Double click a operation to activate and view its description. 0 0 - 770 + 811 20 From 754053e7d9a7e4d19d87232e4b81f916b918e52e Mon Sep 17 00:00:00 2001 From: rohit Date: Sun, 18 Aug 2024 20:59:34 +0530 Subject: [PATCH 3/4] filtering happening in mainwindow only --- mslib/msui/mscolab.py | 37 +++++++++++++++++++++++++++++++++++ mslib/msui/msui_mainwindow.py | 7 +++++++ 2 files changed, 44 insertions(+) diff --git a/mslib/msui/mscolab.py b/mslib/msui/mscolab.py index 2c59ace2d..95b7be246 100644 --- a/mslib/msui/mscolab.py +++ b/mslib/msui/mscolab.py @@ -577,6 +577,8 @@ def __init__(self, parent=None, data_dir=None): else: self.data_dir = data_dir self.create_dir() + # Variable to store filtered operations + self.filtered_operations = [] def view_description(self): data = { @@ -1383,6 +1385,41 @@ def operation_category_handler(self, update_operations=True): else: self.add_operations_to_ui() + def apply_regex_filter(self): + + """ + Filters the operations list based on a regex pattern provided by the user. + """ + pattern = self.ui.regexFilterLe.text() + if not pattern: + # If no pattern, reset to show all operations + self.filtered_operations = self.operations + else: + try: + regex = re.compile(pattern) + self.filtered_operations = [op for op in self.operations if regex.search(op['path'])] + except re.error: + show_popup(self.ui, "Error", "Invalid regex pattern!", icon=2) + self.filtered_operations = self.operations + + # Update the UI with the filtered operations + self.display_operations(self.filtered_operations) + + def display_operations(self, operations): + """ + Displays the given list of operations in the UI. + """ + self.ui.listOperationsMSC.clear() + for operation in operations: + operation_desc = f'{operation["path"]} - {operation["access_level"]}' + widgetItem = QtWidgets.QListWidgetItem(operation_desc) + widgetItem.op_id = operation["op_id"] + widgetItem.operation_category = operation["category"] + widgetItem.operation_path = operation["path"] + widgetItem.access_level = operation["access_level"] + widgetItem.active_operation_description = operation["description"] + self.ui.listOperationsMSC.addItem(widgetItem) + def server_options_handler(self, index): selected_option = self.ui.serverOptionsCb.currentText() self.ui.serverOptionsCb.blockSignals(True) diff --git a/mslib/msui/msui_mainwindow.py b/mslib/msui/msui_mainwindow.py index f1ec9768b..3a1501efc 100644 --- a/mslib/msui/msui_mainwindow.py +++ b/mslib/msui/msui_mainwindow.py @@ -466,6 +466,9 @@ def __init__(self, mscolab_data_dir=None, tutorial_mode=False, *args): self.actionSaveActiveFlightTrackAs.triggered.connect(self.save_as_handler) self.actionCloseSelectedFlightTrack.triggered.connect(self.close_selected_flight_track) + # regex filter + self.regexFilterLe.textChanged.connect(self.apply_filter) + # Views menu. self.actionTopView.triggered.connect(functools.partial(self.create_view_handler, "topview")) self.actionSideView.triggered.connect(functools.partial(self.create_view_handler, "sideview")) @@ -538,6 +541,10 @@ def __init__(self, mscolab_data_dir=None, tutorial_mode=False, *args): self.actionUpdater.triggered.connect(self.updater.show) self.openOperationsGb.hide() + def apply_filter(self): + # Trigger filtering in MSColab + self.mscolab.apply_regex_filter() + def bring_main_window_to_front(self): self.show() self.raise_() From b9b0ea2db2222f25cf32f179945156e9266ddbcf Mon Sep 17 00:00:00 2001 From: rohit Date: Tue, 10 Sep 2024 20:35:01 +0530 Subject: [PATCH 4/4] ui --- mslib/msui/qt5/ui_mainwindow.py | 7 ++----- mslib/msui/ui/ui_mainwindow.ui | 21 +++++++-------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/mslib/msui/qt5/ui_mainwindow.py b/mslib/msui/qt5/ui_mainwindow.py index 106d6562b..6de5e4174 100644 --- a/mslib/msui/qt5/ui_mainwindow.py +++ b/mslib/msui/qt5/ui_mainwindow.py @@ -126,7 +126,8 @@ def setupUi(self, MSUIMainWindow): sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) self.groupBox.setSizePolicy(sizePolicy) - self.groupBox.setMaximumSize(QtCore.QSize(16777215, 120)) + self.groupBox.setMinimumSize(QtCore.QSize(0, 0)) + self.groupBox.setMaximumSize(QtCore.QSize(16777215, 90)) self.groupBox.setObjectName("groupBox") self.categoryLabel = QtWidgets.QLabel(self.groupBox) self.categoryLabel.setGeometry(QtCore.QRect(10, 30, 111, 23)) @@ -140,9 +141,6 @@ def setupUi(self, MSUIMainWindow): self.regexlable = QtWidgets.QLabel(self.groupBox) self.regexlable.setGeometry(QtCore.QRect(10, 60, 131, 16)) self.regexlable.setObjectName("regexlable") - self.ignoreArchiveCb = QtWidgets.QCheckBox(self.groupBox) - self.ignoreArchiveCb.setGeometry(QtCore.QRect(10, 90, 181, 21)) - self.ignoreArchiveCb.setObjectName("ignoreArchiveCb") self.regexFilterLe = QtWidgets.QLineEdit(self.groupBox) self.regexFilterLe.setGeometry(QtCore.QRect(170, 60, 151, 23)) self.regexFilterLe.setObjectName("regexFilterLe") @@ -350,7 +348,6 @@ def retranslateUi(self, MSUIMainWindow): self.filterCategoryCb.setCurrentText(_translate("MSUIMainWindow", "ANY")) self.filterCategoryCb.setItemText(0, _translate("MSUIMainWindow", "ANY")) self.regexlable.setText(_translate("MSUIMainWindow", "Regex filter pattern:")) - self.ignoreArchiveCb.setText(_translate("MSUIMainWindow", "Ignore Archive operations")) self.pbOpenOperationArchive.setText(_translate("MSUIMainWindow", "Operation Archive")) self.activeOperationsLabel.setText(_translate("MSUIMainWindow", "Operations")) self.workLocallyCheckbox.setToolTip(_translate("MSUIMainWindow", "Check to work asynchronously from the server")) diff --git a/mslib/msui/ui/ui_mainwindow.ui b/mslib/msui/ui/ui_mainwindow.ui index 70aa0acfd..077d1a1f4 100644 --- a/mslib/msui/ui/ui_mainwindow.ui +++ b/mslib/msui/ui/ui_mainwindow.ui @@ -254,10 +254,16 @@ Save a flight track to name it. 0 + + + 0 + 0 + + 16777215 - 120 + 90 @@ -319,19 +325,6 @@ Save a flight track to name it. Regex filter pattern: - - - - 10 - 90 - 181 - 21 - - - - Ignore Archive operations - -