Commit Graph

89 Commits

Author SHA1 Message Date
timpieces
c575e63814 MacOS: Disable actions while file dialogs are open (#26169)
- Any action part of the application menu will trigger based on shortcut
  when a native file dialog is open
- Another way to fix this is to switch out the application menu, but
  afaict it requires writing native objective-c code. I think that's too
  much complexity just to get cmd+c/cmd+v in these file dialogs
- For now, just disable the actions so that select-all, rotate-left, etc
  don't trigger when pressed in these dialogs
- I've implemented an RAII wrapper to disable this. It should take
  pointers which should be fine because all of these dialog calls are
  blocking (so in principle nothing can change underneath).

I'm quite sure this won't have any adverse effects on other platforms,
but will need help from other developers to test in case.
2025-12-23 09:18:08 -06:00
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Leandro Heck
12fb41cf3f Gui: Use system dialogs by default (#24882)
* Fix the selector of the FileDialog and add the same default settings for the ColorDialog.

* Add option to set the default ColorDialog

* Use system dialog by default

* Remove new env var

* Fix the native file dialog selector

* Adjust env variable name

* Adjust env variable name
2025-11-02 16:50:48 +01:00
Markus Reitböck
a72a0d6405 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
wwmayer
2de6bb5301 Gui: Fix crash in FileDialog::getSaveFileName 2025-08-26 09:35:01 +02:00
Max Wilfinger
1850c5dc0f Fix missed strings for UI consistency
Fix ellipsis rendering
2025-08-08 06:37:59 -05:00
Max Wilfinger
6692dacc0a Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
Kacper Donat
cd87823ca7 Stylesheets: Fix file chooser buttons not displaying dots 2025-07-14 20:48:50 +02:00
Andrea
2d4ab5af20 REMOVE old QT<= 5.14 code
Ubuntu 22.04  use qt 1.15.3.
In the code is still used qt code <5.10.
A cleanup was done by removing qT code version used in ubuntu 18.04.
2025-03-05 09:32:06 +01:00
Benjamin Bræstrup Sayoc
8d2d0a47f4 Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Pieter Hijma
0894fe0e73 Core: Fix duplicated extensions (see #16299) 2024-09-09 22:11:44 -05:00
Chris Hennes
fe27127662 Gui: Correct repeated extension
Fixes #15908
2024-08-19 12:30:52 -04:00
Pieter Hijma
da75676ce8 Gui: Fix #15203 filename extension export 2024-08-12 11:52:48 -04:00
Chris Hennes
ea9f0c7a67 GUI: Update MacOS detection macros
For GUI-specific things use Q_OS_MACOS, and for other things use
Q_OS_APPLE.
2024-08-12 11:34:39 -04:00
wmayer
3c3ea2d601 Gui: fixes #10782: Unable to cancel Select module Open obj messagebox 2023-09-24 16:08:02 -05:00
wmayer
888a33917d Gui: modernize C++: use equals default 2023-08-20 18:12:43 +02:00
wmayer
fa8978ce99 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
c2e17824fa modernize C++: raw string literal 2023-08-07 19:51:15 -06:00
wmayer
3cafc5e782 Gui: Add download location to side bar of file dialog 2023-03-07 14:41:26 +01:00
wmayer
8d42b6f93c Gui: move to new style connect() 2023-02-01 13:49:35 +01:00
wmayer
62260a9ad4 Gui: [skip ci] fix some warnings reported by GH actions 2023-01-12 17:51:50 +01:00
wmayer
3f615bbe05 Gui: fix possible problems with new style connect
* In UIntSpinBox rename the signal to not overwrite the signal of the base class
* In UIntSpinBox use the (ambiguous) signal 'valueChanged' of the base class QSpinBox
* To avoid that connect() fails use the function pointer of the Qt class where the signal is defined
2023-01-12 17:02:59 +01:00
Uwe
5ad737ccdc [Gui] modernize some connect() settings
- addresses #6166
2023-01-12 15:13:16 +01:00
wmayer
4b08850edb Qt6 port:
* QApplication::setFallbackSessionManagementEnabled has been removed
* QString::medRef() has been removed. Use QString::mid() again.
* QTextStream::setCodec has been removed
* Use operator QVariant of the QFont class to make code Qt5 and Qt6 compatible
* Signature of QTreeWidget::mimeData() has changed in Qt6. Remove TreeWidget::mimeData() because it doesn't change the implementation
* QLayout::setMargin() is deprecated in Qt5 and has been removed in Qt6. Use QLayout::setContentsMargins()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QDesktopWidget is deprecated in Qt5 and has been removed in Qt6. Use QScreen
2022-11-01 16:55:40 +01:00
wmayer
75bfb8f48f Core: replace QRegExp with QRegularExpression 2022-10-06 13:54:20 +02:00
berniev
ae53c9b0a4 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
wmayer
f632712724 Gui: don't show non-existing and unusual directories in file dialog 2022-08-11 17:46:13 +02:00
wmayer
3fddaf4a2f Fix several clazy issues:
* Q_PROPERTY should have either NOTIFY or CONSTANT [-Wclazy-qproperty-without-notify]
* Use Q_ENUM instead of Q_ENUMS [-Wclazy-qenums]
* Add missing a Q_OBJECT macro [-Wclazy-missing-qobject-macro]
* Signal/Slot arguments need to be fully-qualified [-Wclazy-fully-qualified-moc-types]
2022-07-24 19:03:30 +02:00
Uwe
bb2b49fb1f [Gui] remove superfluous nullptr checks 2022-07-18 03:17:42 +02:00
wmayer
b3eca1447d Gui: show thumbnails in file dialog 2022-07-04 14:49:53 +02:00
wmayer
ac2e215119 Gui: make sure to use FileIconProvider in FileDialog and delete it after closing the dialog 2022-07-04 13:17:11 +02:00
wmayer
82a6241fc5 fix (Qt) issues found by clang's clazy tool:
+ -Wclazy-incorrect-emit
+ -Wclazy-strict-iterators
+ -Wclazy-overloaded-signal
+ -Wclazy-qstring-arg
+ -Wclazy-unused-non-trivial-variable
+ -Wclazy-container-anti-pattern
+ -Wclazy-range-loop-reference
+ -Wclazy-const-signal-or-slot
+ -Wclazy-detaching-temporary
+ -Wclazy-qfileinfo-exists
2022-06-29 21:00:54 +02:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
a8c679c370 [Gui] Expression: remove unused includes 2022-03-02 05:00:21 +01:00
wmayer
edd1d3e8e5 Gui: move options to use native or Qt dialogs to class DialogOptions 2021-12-30 17:31:00 +01:00
wmayer
08ee40692a Gui: fix memory leak 2021-04-12 00:06:18 +02:00
Chris Hennes
098d7b9aee [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
Chris Hennes
94ee26e61d Check for filename before selecting
Correct an error caught by @davidosterberg -- the non-native QFileDialog did
not behave as expected when not provided with a default filename, so that case
is now caught and the `selectFile()` call is bypassed.
2021-02-04 15:17:43 +01:00
Chris Hennes
3f40908241 Add default filename for exports
When exporting a single file, the filename defaults to the current FCStd
name plus a dash and the name of the object. If multiple objects are
selected, the default is the basename of the FCStd file. No extension is
added. This behavior is controllable via two hidden preferences,
BaseApp/Preferences/General/ExportDefaultFilenameSingle
BaseApp/Preferences/General/ExportDefaultFilenameMultiple

_Allow regeneration of default on new exports_

If an export has been done and it used the default filename, on the next
export regenerate the filename (potentially updating the selected object
name in that filename) instead of just defaulting to the last name.

_Search for extension in chosen filter first_

Originally the file dialog simply searched for the first available extension
in the overall filter list. This commit modifies it to first check the
selected extension, and only if that is empty to search the full filter
list. This section of code only runs if a default filename is set but
does not have an extension ("suffix" in Qt's terms).
2021-02-04 15:17:43 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
8678e52fd4 Gui: [skip ci] move dontUseNativeDialog() to unnamed namespace 2020-10-06 10:12:41 +02:00
wmayer
98b1116424 Qt5: QDialog extension/orientation is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
e00ff1d78d Qt5: 'void QFileDialog::setNameFilterDetailsVisible(bool)' is deprecated: Use setOption(HideNameFilterDetails, not enabled) instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
2641746808 Qt5: 'void QFileDialog::setConfirmOverwrite(bool)' is deprecated: Use setOption(DontConfirmOverwrite, not enabled) instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8dbe26a95f Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
7b72dcb062 Qt5: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8ef13be48b [skip ci] Implement AcceptMode for FileChooser to also allow to define an output file 2019-12-13 22:43:47 +01:00
wmayer
e993a9f982 pre-select name filter in import/export file dialog 2019-07-21 12:33:42 +02:00
Mateusz Skowroński
ac508516da Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
wmayer
3294fbfe94 do not make default suffix lower case 2018-12-29 13:52:28 +01:00