Changes to Addon First Run Dialog (#17518)

* Changes to Addon First Run Dialog

Updated Addon Manager first run dialog as per issue no. #17317

* Incorporated review comments

* Update src/Mod/AddonManager/addonmanager_preferences_defaults.json

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/AddonManager/addonmanager_preferences_defaults.json

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Removed default assigns as requested

* Defaults updated

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
This commit is contained in:
James
2024-10-30 23:10:22 +00:00
committed by GitHub
parent b6cda4309a
commit fa9a5a8551
6 changed files with 156 additions and 169 deletions

View File

@@ -271,7 +271,7 @@ class CommandAddonManager(QtCore.QObject):
self.button_bar = WidgetGlobalButtonBar(self.dialog)
# If we are checking for updates automatically, hide the Check for updates button:
autocheck = pref.GetBool("AutoCheck", False)
autocheck = pref.GetBool("AutoCheck", True)
if autocheck:
self.button_bar.check_for_updates.hide()
else:
@@ -477,7 +477,7 @@ class CommandAddonManager(QtCore.QObject):
self.select_addon,
]
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Addons")
if pref.GetBool("DownloadMacros", False):
if pref.GetBool("DownloadMacros", True):
self.startup_sequence.append(self.load_macro_metadata)
self.number_of_progress_regions = len(self.startup_sequence)
self.current_progress_region = 0
@@ -664,7 +664,7 @@ class CommandAddonManager(QtCore.QObject):
"""checks every installed addon for available updates"""
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Addons")
autocheck = pref.GetBool("AutoCheck", False)
autocheck = pref.GetBool("AutoCheck", True)
if not autocheck:
FreeCAD.Console.PrintLog(
"Addon Manager: Skipping update check because AutoCheck user preference is False\n"

View File

@@ -2,6 +2,7 @@
<qresource>
<file>icons/preferences-addon_manager.svg</file>
<file>icons/3D_Printing_Tools_workbench_icon.svg</file>
<file>icons/AddonMgrWithWarning.svg</file>
<file>icons/A2plus_workbench_icon.svg</file>
<file>icons/AirPlaneDesign_workbench_icon.svg</file>
<file>icons/ArchTextures_workbench_icon.svg</file>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -26,6 +26,7 @@
import os
from PySide import QtCore, QtWidgets
from PySide.QtGui import QPixmap
import FreeCAD
import FreeCADGui
@@ -51,55 +52,15 @@ class FirstRunDialog:
warning_dialog = FreeCADGui.PySideUic.loadUi(
os.path.join(os.path.dirname(__file__), "first_run.ui")
)
autocheck = self.pref.GetBool("AutoCheck", False)
download_macros = self.pref.GetBool("DownloadMacros", False)
proxy_string = self.pref.GetString("ProxyUrl", "")
if self.pref.GetBool("NoProxyCheck", True):
proxy_option = 0
elif self.pref.GetBool("SystemProxyCheck", False):
proxy_option = 1
elif self.pref.GetBool("UserProxyCheck", False):
proxy_option = 2
def toggle_proxy_list(option: int):
if option == 2:
warning_dialog.lineEditProxy.show()
else:
warning_dialog.lineEditProxy.hide()
warning_dialog.checkBoxAutoCheck.setChecked(autocheck)
warning_dialog.checkBoxDownloadMacroMetadata.setChecked(download_macros)
warning_dialog.comboBoxProxy.setCurrentIndex(proxy_option)
toggle_proxy_list(proxy_option)
if proxy_option == 2:
warning_dialog.lineEditProxy.setText(proxy_string)
warning_dialog.comboBoxProxy.currentIndexChanged.connect(toggle_proxy_list)
warning_dialog.labelWarning.setStyleSheet(
f"color:{utils.warning_color_string()};font-weight:bold;"
)
# Set signal handlers for accept/reject buttons
warning_dialog.buttonContinue.clicked.connect(warning_dialog.accept)
warning_dialog.buttonQuit.clicked.connect(warning_dialog.reject)
# Show the dialog and check whether the user accepted or canceled
if warning_dialog.exec() == QtWidgets.QDialog.Accepted:
# Store warning as read/accepted
self.readWarning = True
self.pref.SetBool("readWarning2022", True)
self.pref.SetBool("AutoCheck", warning_dialog.checkBoxAutoCheck.isChecked())
self.pref.SetBool(
"DownloadMacros",
warning_dialog.checkBoxDownloadMacroMetadata.isChecked(),
)
selected_proxy_option = warning_dialog.comboBoxProxy.currentIndex()
if selected_proxy_option == 0:
self.pref.SetBool("NoProxyCheck", True)
self.pref.SetBool("SystemProxyCheck", False)
self.pref.SetBool("UserProxyCheck", False)
elif selected_proxy_option == 1:
self.pref.SetBool("NoProxyCheck", False)
self.pref.SetBool("SystemProxyCheck", True)
self.pref.SetBool("UserProxyCheck", False)
else:
self.pref.SetBool("NoProxyCheck", False)
self.pref.SetBool("SystemProxyCheck", False)
self.pref.SetBool("UserProxyCheck", True)
self.pref.SetString("ProxyUrl", warning_dialog.lineEditProxy.text())
return self.readWarning

View File

@@ -26,7 +26,7 @@
"MacroGitURL": "https://github.com/FreeCAD/FreeCAD-Macros",
"MacroUpdateStatsURL": "https://addons.freecad.org/macro_update_stats.json",
"MacroWikiURL": "https://wiki.freecad.org/Macros_recipes",
"NoProxyCheck": "",
"NoProxyCheck": true,
"PackageTypeSelection": 0,
"PrimaryAddonsSubmoduleURL":
"https://raw.githubusercontent.com/FreeCAD/FreeCAD-addons/master/.gitmodules",
@@ -35,9 +35,9 @@
"SelectedAddon": "",
"ShowBranchSwitcher": false,
"StatusSelection": 0,
"SystemProxyCheck": "",
"SystemProxyCheck": false,
"UpdateFrequencyComboEntry": 0,
"UserProxyCheck": "",
"UserProxyCheck": false,
"ViewStyle": 1,
"WindowHeight": 600,
"WindowWidth": 800,

View File

@@ -9,129 +9,105 @@
<rect>
<x>0</x>
<y>0</y>
<width>398</width>
<height>237</height>
<width>520</width>
<height>110</height>
</rect>
</property>
<property name="windowTitle">
<string>Welcome to the Addon Manager</string>
<string>Add-on Manager: Warning!</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labelWarning">
<property name="text">
<string>The addons that can be installed here are not officially part of FreeCAD, and are not reviewed by the FreeCAD team. Make sure you know what you are installing!</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Download Settings</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAutoCheck">
<property name="text">
<string>Automatically check installed Addons for updates</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDownloadMacroMetadata">
<property name="text">
<string>Download Macro metadata (approximately 10MB)</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="comboBoxProxy">
<item>
<property name="text">
<string>No proxy</string>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="bodyLayout">
<property name="spacing">
<number>30</number>
</property>
</item>
<item>
<property name="text">
<string>System proxy</string>
<property name="leftMargin">
<number>20</number>
</property>
</item>
<item>
<property name="text">
<string>User-defined proxy:</string>
<property name="topMargin">
<number>6</number>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditProxy"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>These and other settings are available in the FreeCAD Preferences window.</string>
</property>
</widget>
</item>
<item>
<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>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="warningIconLabel">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="pixmap">
<pixmap resource="../AddonManager.qrc">:/icons/AddonMgrWithWarning.svg</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelWarning">
<property name="text">
<string>The Add-on Manager provides access to an extensive library of useful third-party FreeCAD extensions. No guarantees can be made regarding their safety or functionality.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacerMiddle">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="buttonLayout">
<item>
<spacer name="horizontalSpacerLeft">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="buttonContinue">
<property name="text">
<string>Continue</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonQuit">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</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>Dialog</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>
</widget>
<resources/>
<connections/>
</ui>