Fri, 28 Jun 2024 17:19:26 +0200
Implemented the configuration page.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PipxInterface/ConfigurationPage/PipxPage.py Fri Jun 28 17:19:26 2024 +0200 @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2024 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing the pipx configuration page. +""" + +from eric7 import Preferences +from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import ( + ConfigurationPageBase, +) + +from .Ui_PipxPage import Ui_PipxPage + + +class PipxPage(ConfigurationPageBase, Ui_PipxPage): + """ + Class implementing the pipx configuration page. + """ + + def __init__(self, plugin): + """ + Constructor + + @param plugin reference to the plugin object + @type PluginPipxInterface + """ + super().__init__() + self.setupUi(self) + self.setObjectName("PipxPage") + + self.__plugin = plugin + + # set the pip index URL for information only + self.indexEdit.setText(Preferences.getPip("PipSearchIndex")) + + # set initial values + self.recentWorkdirsSpinBox.setValue( + self.__plugin.getPreferences("MaxRecentAppWorkdirs") + ) + + def save(self): + """ + Public slot to save the MQTT Monitor configuration. + """ + self.__plugin.setPreferences( + "MaxRecentAppWorkdirs", self.recentWorkdirsSpinBox.value() + )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PipxInterface/ConfigurationPage/PipxPage.ui Fri Jun 28 17:19:26 2024 +0200 @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PipxPage</class> + <widget class="QWidget" name="PipxPage"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>548</width> + <height>300</height> + </rect> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="headerLabel"> + <property name="text"> + <string><b>Configure Python Application Management</b></string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line9_3"> + <property name="frameShape"> + <enum>QFrame::HLine</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Index URL</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLineEdit" name="indexEdit"> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="clearButtonEnabled"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="indexLabel"> + <property name="text"> + <string><b>Note</b>: The index URL is configured on the 'Python Package Management' page.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_7"> + <property name="title"> + <string>Recent Application Working Directories</string> + </property> + <layout class="QHBoxLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Number of recent working directories:</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="recentWorkdirsSpinBox"> + <property name="toolTip"> + <string>Enter the number of recently used working directories to remember</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="minimum"> + <number>5</number> + </property> + <property name="maximum"> + <number>50</number> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>73</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PipxInterface/ConfigurationPage/Ui_PipxPage.py Fri Jun 28 17:19:26 2024 +0200 @@ -0,0 +1,70 @@ +# Form implementation generated from reading ui file 'PipxInterface/ConfigurationPage/PipxPage.ui' +# +# Created by: PyQt6 UI code generator 6.7.0 +# +# 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_PipxPage(object): + def setupUi(self, PipxPage): + PipxPage.setObjectName("PipxPage") + PipxPage.resize(548, 300) + self.verticalLayout_2 = QtWidgets.QVBoxLayout(PipxPage) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.headerLabel = QtWidgets.QLabel(parent=PipxPage) + self.headerLabel.setObjectName("headerLabel") + self.verticalLayout_2.addWidget(self.headerLabel) + self.line9_3 = QtWidgets.QFrame(parent=PipxPage) + self.line9_3.setFrameShape(QtWidgets.QFrame.Shape.HLine) + self.line9_3.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line9_3.setFrameShape(QtWidgets.QFrame.Shape.HLine) + self.line9_3.setObjectName("line9_3") + self.verticalLayout_2.addWidget(self.line9_3) + self.groupBox_2 = QtWidgets.QGroupBox(parent=PipxPage) + self.groupBox_2.setObjectName("groupBox_2") + self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox_2) + self.verticalLayout.setObjectName("verticalLayout") + self.indexEdit = QtWidgets.QLineEdit(parent=self.groupBox_2) + self.indexEdit.setReadOnly(True) + self.indexEdit.setClearButtonEnabled(False) + self.indexEdit.setObjectName("indexEdit") + self.verticalLayout.addWidget(self.indexEdit) + self.indexLabel = QtWidgets.QLabel(parent=self.groupBox_2) + self.indexLabel.setWordWrap(True) + self.indexLabel.setObjectName("indexLabel") + self.verticalLayout.addWidget(self.indexLabel) + self.verticalLayout_2.addWidget(self.groupBox_2) + self.groupBox_7 = QtWidgets.QGroupBox(parent=PipxPage) + self.groupBox_7.setObjectName("groupBox_7") + self.hboxlayout = QtWidgets.QHBoxLayout(self.groupBox_7) + self.hboxlayout.setObjectName("hboxlayout") + self.label = QtWidgets.QLabel(parent=self.groupBox_7) + self.label.setObjectName("label") + self.hboxlayout.addWidget(self.label) + self.recentWorkdirsSpinBox = QtWidgets.QSpinBox(parent=self.groupBox_7) + self.recentWorkdirsSpinBox.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.recentWorkdirsSpinBox.setMinimum(5) + self.recentWorkdirsSpinBox.setMaximum(50) + self.recentWorkdirsSpinBox.setObjectName("recentWorkdirsSpinBox") + self.hboxlayout.addWidget(self.recentWorkdirsSpinBox) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.hboxlayout.addItem(spacerItem) + self.verticalLayout_2.addWidget(self.groupBox_7) + spacerItem1 = QtWidgets.QSpacerItem(20, 73, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_2.addItem(spacerItem1) + + self.retranslateUi(PipxPage) + QtCore.QMetaObject.connectSlotsByName(PipxPage) + + def retranslateUi(self, PipxPage): + _translate = QtCore.QCoreApplication.translate + self.headerLabel.setText(_translate("PipxPage", "<b>Configure Python Application Management</b>")) + self.groupBox_2.setTitle(_translate("PipxPage", "Index URL")) + self.indexLabel.setText(_translate("PipxPage", "<b>Note</b>: The index URL is configured on the \'Python Package Management\' page.")) + self.groupBox_7.setTitle(_translate("PipxPage", "Recent Application Working Directories")) + self.label.setText(_translate("PipxPage", "Number of recent working directories:")) + self.recentWorkdirsSpinBox.setToolTip(_translate("PipxPage", "Enter the number of recently used working directories to remember"))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PipxInterface/ConfigurationPage/__init__.py Fri Jun 28 17:19:26 2024 +0200 @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2024 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Package containing the 'pipx' configuration page. +"""
--- a/PipxInterface/PipxWidget.py Fri Jun 28 16:36:46 2024 +0200 +++ b/PipxInterface/PipxWidget.py Fri Jun 28 17:19:26 2024 +0200 @@ -15,6 +15,7 @@ from eric7.EricGui import EricPixmapCache from eric7.EricGui.EricOverrideCursor import EricOverrideCursor from eric7.EricWidgets import EricFileDialog, EricMessageBox +from eric7.EricWidgets.EricApplication import ericApp from .Pipx import Pipx from .PipxAppStartDialog import PipxAppStartDialog @@ -142,7 +143,7 @@ ) ################################################################### - ## Menu with upgrade related actions + ## Menu with upinstall related actions ################################################################### self.__uninstallSubmenu = QMenu(self.tr("Uninstall")) @@ -167,6 +168,8 @@ self.__pipxMenu.addAction( self.tr("Standalone Interpreters"), self.__showInterpreters ) + self.__pipxMenu.addSeparator() + self.__pipxMenu.addAction(self.tr("Configure..."), self.__pipxConfigure) self.__pipxMenu.aboutToShow.connect(self.__aboutToShowPipxMenu) @@ -400,6 +403,13 @@ dlg = PipxInterpretersDialog(self.__pipx, self) dlg.exec() + @pyqtSlot() + def __pipxConfigure(self): + """ + Private slot to show the pipx configuration page. + """ + ericApp().getObject("UserInterface").showPreferences("pipxPage") + ####################################################################### ## Main widget related methods below #######################################################################
--- a/PluginPipxInterface.epj Fri Jun 28 16:36:46 2024 +0200 +++ b/PluginPipxInterface.epj Fri Jun 28 17:19:26 2024 +0200 @@ -183,6 +183,7 @@ "makefile": "OTHERS" }, "FORMS": [ + "PipxInterface/ConfigurationPage/PipxPage.ui", "PipxInterface/PipxAppStartDialog.ui", "PipxInterface/PipxExecDialog.ui", "PipxInterface/PipxInterpretersDialog.ui", @@ -272,6 +273,9 @@ }, "RESOURCES": [], "SOURCES": [ + "PipxInterface/ConfigurationPage/PipxPage.py", + "PipxInterface/ConfigurationPage/Ui_PipxPage.py", + "PipxInterface/ConfigurationPage/__init__.py", "PipxInterface/Pipx.py", "PipxInterface/PipxAppStartDialog.py", "PipxInterface/PipxExecDialog.py",