diff --git a/src/cruiz/commands/conaninvocation.py b/src/cruiz/commands/conaninvocation.py index ee5472f..8779f4c 100755 --- a/src/cruiz/commands/conaninvocation.py +++ b/src/cruiz/commands/conaninvocation.py @@ -90,8 +90,8 @@ def _critical_failure(self, message: str) -> None: None, # type: ignore[arg-type] "System failure", message, - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) sys.exit(1) diff --git a/src/cruiz/entrypoint.py b/src/cruiz/entrypoint.py index 3a207d2..e59a1f0 100755 --- a/src/cruiz/entrypoint.py +++ b/src/cruiz/entrypoint.py @@ -20,8 +20,8 @@ "Conan unavailable", "Unable to locate the conan Python package in the current environment.\n" "Use pip install conan[==version].", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) sys.exit(-1) @@ -72,8 +72,8 @@ def _are_resources_out_of_date() -> bool: None, # type: ignore[arg-type] "Resources", "Resources are out of date.\n" "Please build with python3 setup.py build", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) sys.exit(-1) diff --git a/src/cruiz/mainwindow.py b/src/cruiz/mainwindow.py index 14e9c11..22423ac 100755 --- a/src/cruiz/mainwindow.py +++ b/src/cruiz/mainwindow.py @@ -389,9 +389,9 @@ def load_recipe( "Recipe does not exist", f"The recipe at {str(recipe_path)} no longer exists. \ Remove from the recent list?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.Yes: # TODO: this is not ideal, as it's not atomic @@ -665,8 +665,8 @@ def _icon_license(self) -> None: self, "Failed file copy", f"Unable to copy the {license_file} to a temporary location for viewing", # noqa: E501 - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return QtGui.QDesktopServices.openUrl( diff --git a/src/cruiz/manage_local_cache/managelocalcachesdialog.py b/src/cruiz/manage_local_cache/managelocalcachesdialog.py index ddb8545..916f7df 100755 --- a/src/cruiz/manage_local_cache/managelocalcachesdialog.py +++ b/src/cruiz/manage_local_cache/managelocalcachesdialog.py @@ -237,9 +237,9 @@ def reject(self) -> None: self, "Local cache modifications", "Do you want to lose unsaved changes to the local cache?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) == QtWidgets.QMessageBox.StandardButton.No ): @@ -611,9 +611,9 @@ def _operations_remove_all_packages(self) -> None: self, "Package deletion", "Are you sure you want to delete all packages from this local cache?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.Yes: RemoveAllPackagesDialog(self._context, self).exec_() @@ -647,9 +647,9 @@ def _operations_delete_cache(self) -> None: self, "Local cache deletion", f"Are you sure you want to delete the local cache {cache_name}?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.No: return @@ -675,9 +675,9 @@ def _operations_delete_cache(self) -> None: if short_home_dir else f"Please confirm deletion of the directory {conan_home_dir}?" ), - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.No: return diff --git a/src/cruiz/manage_local_cache/widgets/installconfigdialog.py b/src/cruiz/manage_local_cache/widgets/installconfigdialog.py index 180eb81..9d7725d 100755 --- a/src/cruiz/manage_local_cache/widgets/installconfigdialog.py +++ b/src/cruiz/manage_local_cache/widgets/installconfigdialog.py @@ -77,8 +77,8 @@ def _install_complete(self, result: typing.Any, exception: typing.Any) -> None: self, "Local cache config install failure", str(exception), - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return with RecentConanConfigSettingsReader() as settings: diff --git a/src/cruiz/manage_local_cache/widgets/movelocalcachedialog.py b/src/cruiz/manage_local_cache/widgets/movelocalcachedialog.py index 790b647..1c4e00e 100755 --- a/src/cruiz/manage_local_cache/widgets/movelocalcachedialog.py +++ b/src/cruiz/manage_local_cache/widgets/movelocalcachedialog.py @@ -102,8 +102,8 @@ def accept(self) -> None: "Conan local cache home directory", f"The selected home directory '{new_home_dir}' is unchanged. " "Please choose another.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return qdir = QtCore.QDir(new_home_dir) @@ -113,8 +113,8 @@ def accept(self) -> None: "Conan local cache home directory", f"The selected home directory '{new_home_dir}' already exists. " "Please choose another.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return if not qdir.isEmpty(): @@ -123,8 +123,8 @@ def accept(self) -> None: "Conan local cache home directory", f"The selected home directory '{new_home_dir}' is not empty. " "Please choose another.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return if short_home_dir: @@ -135,8 +135,8 @@ def accept(self) -> None: "Conan local cache short home directory", f"The selected short home directory '{new_short_home_dir}' " "is unchanged. Please choose another.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return qdir = QtCore.QDir(new_short_home_dir) @@ -146,8 +146,8 @@ def accept(self) -> None: "Conan local cache short home directory", f"The selected short home directory '{new_short_home_dir}' already" " exists. Please choose another.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return if not qdir.isEmpty(): @@ -156,8 +156,8 @@ def accept(self) -> None: "Conan local cache short home directory", f"The selected short home directory '{new_short_home_dir}' is " "not empty. Please choose another.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return else: @@ -191,8 +191,8 @@ def _move( self, "Conan move local cache", f"Failed to move the local cache home dir because: {exception}.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) # roll back previous steps settings.home_dir = old_home_dir # type: ignore @@ -209,8 +209,8 @@ def _move( "Conan move local cache", "Failed to move the local cache short home dir because: " f"{exception}.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) # roll back previous steps shutil.move(new_home_dir, str(old_conan_dir)) diff --git a/src/cruiz/manage_local_cache/widgets/newlocalcachewizard.py b/src/cruiz/manage_local_cache/widgets/newlocalcachewizard.py index 811d7d3..511ecb4 100755 --- a/src/cruiz/manage_local_cache/widgets/newlocalcachewizard.py +++ b/src/cruiz/manage_local_cache/widgets/newlocalcachewizard.py @@ -171,8 +171,8 @@ def _perform_new_cache_config_install_complete( self, "New local cache configuration install failure", str(exception), - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) @property diff --git a/src/cruiz/manage_local_cache/widgets/progressdialogs.py b/src/cruiz/manage_local_cache/widgets/progressdialogs.py index a856611..d43b79f 100755 --- a/src/cruiz/manage_local_cache/widgets/progressdialogs.py +++ b/src/cruiz/manage_local_cache/widgets/progressdialogs.py @@ -33,8 +33,8 @@ def _done(self, result: typing.Any, exception: typing.Any) -> None: self, f"{self._title} failed", str(exception), - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return self.reset() diff --git a/src/cruiz/recipe/recipewidget.py b/src/cruiz/recipe/recipewidget.py index b967a62..ebc09fb 100755 --- a/src/cruiz/recipe/recipewidget.py +++ b/src/cruiz/recipe/recipewidget.py @@ -379,8 +379,8 @@ def closeEvent(self, event: QtGui.QCloseEvent) -> None: self, "Recipe cannot be closed", "Commands are still running. Cannot close recipe.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) event.ignore() return @@ -964,9 +964,9 @@ def _local_workflow_on_delete_common_subdir(self) -> None: self, "Delete directory", f"Delete the directory '{resolved_working_dir}'?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.No: return @@ -990,9 +990,9 @@ def _local_workflow_on_delete_command_folder(self, property_name: str) -> None: self, "Delete directory", f"Delete the directory '{command_dir}'?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.No: return @@ -1344,8 +1344,8 @@ def _open_package_directory(self) -> None: self, "No such package directory", f"Package directory '{directory}' does not exist", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) def _copy_package_directory(self) -> None: diff --git a/src/cruiz/recipe/toolbars/buildfeatures.py b/src/cruiz/recipe/toolbars/buildfeatures.py index 9f02fff..9a7e4fc 100755 --- a/src/cruiz/recipe/toolbars/buildfeatures.py +++ b/src/cruiz/recipe/toolbars/buildfeatures.py @@ -136,9 +136,9 @@ def reject(self) -> None: self, "Unsaved compiler cache arguments", "Modifications are unsaved. Do you want to discard them?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if response == QtWidgets.QMessageBox.StandardButton.No: return diff --git a/src/cruiz/remote_browser/pages/packagebinarypage.py b/src/cruiz/remote_browser/pages/packagebinarypage.py index bb7e237..3356aed 100644 --- a/src/cruiz/remote_browser/pages/packagebinarypage.py +++ b/src/cruiz/remote_browser/pages/packagebinarypage.py @@ -336,8 +336,8 @@ def _on_prev_dclicked(self, index: QtCore.QModelIndex) -> None: self, "Cannot view file contents", f"Unable to interpret file {path} in archive {container} " "as text", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) def on_cancel(self) -> None: diff --git a/src/cruiz/remote_browser/remotebrowser.py b/src/cruiz/remote_browser/remotebrowser.py index 3a0839c..82d6e55 100644 --- a/src/cruiz/remote_browser/remotebrowser.py +++ b/src/cruiz/remote_browser/remotebrowser.py @@ -53,8 +53,8 @@ def closeEvent(self, event: QtGui.QCloseEvent) -> None: self, "Remote browser cannot be closed", "Commands are still running. Cannot close remote browser.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) event.ignore() return diff --git a/src/cruiz/revealonfilesystem.py b/src/cruiz/revealonfilesystem.py index 96e1671..65c7547 100644 --- a/src/cruiz/revealonfilesystem.py +++ b/src/cruiz/revealonfilesystem.py @@ -46,8 +46,8 @@ def _use_xdg_open(file_info: QtCore.QFileInfo) -> None: None, # type: ignore[arg-type] "Cannot reveal path", "Unable to find the path to xdg-open", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return script_args = [file_info.canonicalFilePath()] @@ -61,8 +61,8 @@ def reveal_on_filesystem(path: pathlib.Path) -> None: None, # type: ignore[arg-type] "Cannot reveal path", f"Path '{path}' does not exist", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return file_info = QtCore.QFileInfo(path) @@ -86,8 +86,8 @@ def open_terminal_at(path: str) -> None: None, # type: ignore[arg-type] "Cannot open terminal at path", f"Path '{path}' does not exist", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return if platform.system() == "Darwin": @@ -116,8 +116,8 @@ def open_terminal_at(path: str) -> None: None, # type: ignore[arg-type] "Cannot open terminal at path", "Unable to detect window manager", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) else: raise RuntimeError(f"Unrecognised platform {platform.system()}") diff --git a/src/cruiz/settings/managers/cleansettings.py b/src/cruiz/settings/managers/cleansettings.py index 188ec98..df59857 100755 --- a/src/cruiz/settings/managers/cleansettings.py +++ b/src/cruiz/settings/managers/cleansettings.py @@ -59,9 +59,9 @@ def sanitise_settings(widget: QtWidgets.QWidget) -> bool: widget, "Inconsistent recipe settings", message, - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.Yes, + QtWidgets.QMessageBox.StandardButton.Yes, ) if response == QtWidgets.QMessageBox.StandardButton.Yes: for uuid in incomplete_uuids: @@ -78,9 +78,9 @@ def sanitise_settings(widget: QtWidgets.QWidget) -> bool: widget, "Inconsistent recipe settings", message, - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.Yes, + QtWidgets.QMessageBox.StandardButton.Yes, ) if response == QtWidgets.QMessageBox.StandardButton.Yes: for uuid, _ in recipe_no_longer_exists_uuid.items(): @@ -96,9 +96,9 @@ def sanitise_settings(widget: QtWidgets.QWidget) -> bool: widget, "Inconsistent recipe settings", message, - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.Yes, + QtWidgets.QMessageBox.StandardButton.Yes, ) if response == QtWidgets.QMessageBox.StandardButton.Yes: for uuid in recent_recipe_only: @@ -114,9 +114,9 @@ def sanitise_settings(widget: QtWidgets.QWidget) -> bool: widget, "Inconsistent recipe settings", message, - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.Yes, + QtWidgets.QMessageBox.StandardButton.Yes, ) if response == QtWidgets.QMessageBox.StandardButton.Yes: for uuid in all_uuids: diff --git a/src/cruiz/settings/preferencesdialog.py b/src/cruiz/settings/preferencesdialog.py index 6b3ba80..21f15ef 100755 --- a/src/cruiz/settings/preferencesdialog.py +++ b/src/cruiz/settings/preferencesdialog.py @@ -488,9 +488,9 @@ def reject(self) -> None: self, "Unsaved preferences", "Modifications are unsaved. Do you want to discard them?", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if response == QtWidgets.QMessageBox.StandardButton.No: return @@ -1157,9 +1157,9 @@ def _recipes_change_cache(self) -> None: "Change local cache for recipe", "Are you sure you want to change the local cache for recipe " f"'{path_itemdata[0]}' to '{cache_menu_action.text()}'", - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.No: return @@ -1181,8 +1181,8 @@ def _recipes_forget_recipe(self) -> None: "Recipe still has editables", f"Recipe {recipe_path} still has editable dependencies. " "Cannot forget until they are removed.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return # TODO: this is not ideal, as it's not atomic @@ -1272,8 +1272,8 @@ def _import_presets(self) -> None: "Preference presets", f"{prefix_path} is an invalid preference presets file. " "Aborting import.", - button0=QtWidgets.QMessageBox.StandardButton.Ok, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.Ok, + QtWidgets.QMessageBox.StandardButton.NoButton, ) return LocalCacheSettingsWriter().presets(presets["cruiz_presets"]) @@ -1304,9 +1304,9 @@ def _restore_defaults(self) -> None: "Performing a factory reset will clear all settings and restart cruiz. " "Do you want to continue?" ), - button0=QtWidgets.QMessageBox.StandardButton.Yes + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, - button1=QtWidgets.QMessageBox.StandardButton.NoButton, + QtWidgets.QMessageBox.StandardButton.NoButton, ) if result == QtWidgets.QMessageBox.StandardButton.Yes: factory_reset()