Commit Graph

96 Commits

Author SHA1 Message Date
Marek Roszko eb84c29414 Remove confirms dependence on pgm_base and unused header 2023-09-23 10:20:31 -04:00
Marek Roszko 6e04c2835a Remove unused header 2023-09-07 20:46:08 -04:00
Seth Hillbrand 7fe83993cf Be smarter about releasing lockfiles
If KiCad crashes or exits without deleting the lockfile, don't show the
warning message unless we are not the one who locked it or there are
other KiCad instances running locally.

This should catch 99% of the cases where the message is shown
incorrectly.  There may be some corner cases where the lock file is
created on a network drive using two different machines with the same
name and same user but these cases should be (famous last words)
sufficiently rare as to not be observed in practice
2023-07-21 15:40:19 -07:00
Marek Roszko 8a8589b9db Fix cli crash due to dialogs buried in the pcb parser...
Fixes sentry KICAD-Q2
2023-03-24 19:52:48 -04:00
Wayne Stambaugh 774f3f9794 Use wxMessageDialog in IsOK() on GTK builds.
wxRichMessageDialog does not have the same appearance as the native
message dialogs on GTK builds so they look completely out of place.
2023-01-19 08:28:48 -05:00
Seth Hillbrand 7e5a2450b8 Move multiple wxMessageBox to DisplayErrorMessage
Also provide protection for headless running in multiple callsites

Fixes https://gitlab.com/kicad/code/kicad/issues/13575
2023-01-18 16:54:01 -08:00
jean-pierre charras 966f7bfa4c Fix commit 0a881e09, not working on wxWidgets 3.1.5/msys2 2022-12-08 15:39:10 +01:00
Jon Evans 0a881e091c Fix build for gcc and wx < 3.1.6 2022-12-08 07:30:04 -05:00
Marek Roszko 2fc0cd68ed Avoid crashing due to empty lib tables in cli
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13097
2022-12-07 23:56:03 -05:00
Jeff Young da7eaeffd2 Move IsOK() to wxRichMessageDialog so it handles <ESC> properly.
Fixes https://gitlab.com/kicad/code/kicad/issues/12360
2022-09-11 12:21:16 +01:00
Mikolaj Wielgus 67d149ca73 QA: Use wxLogError() (not wxLogDebug()) in DisplayError[Message]() 2022-08-09 21:08:48 +02:00
Jeff Young e4b6da287f Fix errant string format char. 2022-08-03 14:27:56 +01:00
Mikolaj Wielgus 7cf5138c63 Sim: Bugfixes, mostly for MS Windows compilation errors
Unfortunately, Windows headers define a lot of macros for common words,
so we had to rename some enums to not collide.

We also fix some of the many bugs related to the new simulation
architecture and the Spice Model Editor dialog.
2022-07-30 02:25:34 +00:00
Jeff Young 6eada34f41 Use "Cancel" for cancel semantics, even when affirmitave to question.
Fixes https://gitlab.com/kicad/code/kicad/issues/11983
2022-07-24 08:47:01 +01:00
Marek Roszko 0e3b001c51 Lock the windows when we ask about unsaved changes
Fix #9274
2021-09-29 23:01:06 -04:00
Jeff Young 3aae3c6f65 Dark mode for a bunch of HTML dialogs.
WX_HTML_REPORT_BOX
WX_HTML_REPORT_PANEL
HTML_MESSAGEBOX
DIALOG_DISPLAY_HTML_TEXT

Fixes https://gitlab.com/kicad/code/kicad/issues/9157

Fixes https://gitlab.com/kicad/code/kicad/issues/9156
2021-09-14 21:23:57 +01:00
Jeff Young 2cdd3c9ebf Work-around incorrect spacing (and order) of buttons on Mac. 2021-08-31 22:39:25 +01:00
Wayne Stambaugh 5a28a06597 Use wxMessageDialog instead of wxRichMessageDialog.
wxRichMessageDialog does not look like the stock message boxes on any
platform so don't use it unless the checkbox option is required.
2021-08-31 14:41:40 -04:00
Jeff Young b5a3385ea9 Overhaul file locking system.
See bug report for details.

Fixes https://gitlab.com/kicad/code/kicad/issues/8919
2021-08-31 15:04:31 +01:00
Wayne Stambaugh 37b200cb3e Pass wxString objects by reference instead of on the stack. 2021-07-27 08:41:27 -04:00
Jeff Young 7fde05e8ee Add title to Save Changes dialog. 2021-06-17 18:23:58 +01:00
Jon Evans 720147d272 Remove transitive inclusion of bitmaps.h 2021-03-07 16:08:57 -05:00
Jeff Young d0af4e9f9d Save a cancel value when asked if it's not being used to cancel.
Many, many KIDIALOGs use OK/Cancel and then rename both buttons to
confirm or deny some action.  In those cases we *do* want to store
the deny actions if they check "Do Not Show Again".

Fixes https://gitlab.com/kicad/code/kicad/issues/6979
2021-01-08 21:32:19 +00:00
Jeff Young 412c9c8c4e Save should be disabled only if the file is up-to-date.
Any other issues (such as locked files) need to produce a dialog
with info for the user.
2020-12-11 23:58:30 +00:00
Marek Roszko e49ac45b84 HTML_MESSAGE_BOX is a dialog 2020-10-25 20:01:12 -04:00
jean-pierre charras f6b4b66a86 Avoid include wx/wx.h in many files that do not actually use this include.
Including wx.h includes the full set of wxWidgets include files, that is not good,
and can create some conflicts with some Windows headers on msys2.
2020-10-18 18:21:34 +02:00
Ian McInerney 4fef513a3f Fix library table panel path adding and cleanup duplicate dialog
When adding a .pretty library, if the actual .pretty folder were
selected then no folder would be added to the list of libraries.
This led to an assert when normalizing paths, and the library
not being added.
2020-02-14 19:07:27 +00:00
Ian McInerney 415aaabc29 Fix return type in KIDIALOG
It was returned as a bool for some reason...
2020-01-15 18:29:15 +00:00
Mark Roszko a80b2b7e39 KIDIALOG should ignore "cancel" for the do not show again option.
Fix #3734
2020-01-15 18:23:07 +00:00
Wayne Stambaugh 1abb198fb4 Minor UI improvement.
Use wxMessageDialog instead of wxRichMessageDialog in DisplayErrorMessage
so the platform specific message dialog is used.  wxRichMessageDialog
looks different than the stock message dialog on every platform so only
use it when a checkbox is required.
2019-12-14 12:29:38 -05:00
Jeff Young a25368cc6b Improve spelling.
The groundwork here is thanks to kunda1.

Fixes: lp:1831510
* https://bugs.launchpad.net/kicad/+bug/1831510
2019-08-20 19:14:05 +01:00
Jeff Young 4eab89d9ef Fix OSX button order issue in Unsaved Changes dialog.
Also changes the presentation of the string when the checkbox appears
so that the "Changes will be lost" warning isn't hidden by the turndown.
This last part may require conditional compilation as it's undocumented.

Lastly, regularizes the Unsaved Changes strings between the apps.
2019-06-17 17:01:57 +01:00
Wayne Stambaugh 77bf575742 CvPcb: fix save changes dialog layout issue.
DIALOG_EXIT was not being laid out correctly after setting the dialog
message.  Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT.  This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

https://bugs.launchpad.net/kicad/+bug/1832899
2019-06-16 12:10:24 -04:00
Seth Hillbrand a0f477cc5f Fix default button option on close
The default is meant to be "Save" but "Discard" was selected due to ID
ordering on creation.  Setting the focus before setting the default
makes the "Save" option the highlighted option that can be selected
immediately by pressing enter.
2019-05-15 12:14:20 -07:00
jean-pierre charras ec59361f75 Fix a few coverity errors 2019-02-16 14:09:21 +01:00
Wayne Stambaugh f839278597 Fix exit dialog layout issue on windows.
Apparently FinishDialogSettings() does need to be called on windows to
get the dialog to layout properly.  Hopefully this doesn't break any of
the other platforms.
2019-02-11 15:26:03 -05:00
jean-pierre charras 95af750fc9 Very minor fix in dialog_exit_base. 2019-02-08 08:16:10 +01:00
Seth Hillbrand 591e4137d7 pcbnew: Exit Yes/No with escape key
Fixes: lp:1814957
* https://bugs.launchpad.net/kicad/+bug/1814957
2019-02-07 08:42:26 -08:00
John Beard 55b5c7189a Exit dialog: use Layout on the whole window
Prevents mislaignment in footpritn editor on close with unsaved
changes.

Fixes: lp:1813961
* https://bugs.launchpad.net/kicad/+bug/1813961
2019-01-31 08:22:59 +01:00
Jeff Young c9ca1013b2 Make ModEdit and LibEdit library tree actions more consistent.
Adds Cut/Copy/Paste and Revert for footprints; introduces a new
shared Revert Changes? dialog; hooks up Add Library for footprints,
standardizes the Save As terminology.
2018-10-03 22:46:41 +01:00
Seth Hillbrand 4eece522df kicad: keep KIDIALOG boxes above other windows
Until answered, dialog boxes should remain at the front.  This flag only
works for MSW and GTK.
2018-09-08 21:24:29 -07:00
Seth Hillbrand ec33381064 pcbnew: Keep Yes/No dialogs above the windows
Modal yes/no questions should not be allowed to fall behind other
windows.  They need to be answered before the program continues and
clicking outside of the dialog should not hide dialog itself.

Fixes: lp:1790640
* https://bugs.launchpad.net/kicad/+bug/1790640
2018-09-08 21:09:57 -07:00
Jeff Young c90a3efea2 Change KIDIALOG hashing algorithm to __FILE__ + __LINE__.
Using Title + Message wasn't working for all the dialogs which
did substitutions in the message (which was a lot of them).

Fixes: lp:1789348
* https://bugs.launchpad.net/kicad/+bug/1789348
2018-08-29 23:38:23 +01:00
Jeff Young 4b1a31ffad Regularize save-changes dialogs. 2018-08-12 00:02:37 +01:00
Jeff Young 0cd75b2556 Flip show/hide of controls so they're shown when doing layout.
Fixes: lp:1785113
* https://bugs.launchpad.net/kicad/+bug/1785113
2018-08-06 13:48:17 +01:00
Jeff Young d8d4f75fa1 Fix button order and genralize Exit dialog so it can be shared more.
This also fixes a bunch of bugs where an error during save would
still close the window (rather than cancelling the close action).

Fixes: lp:1785034
* https://bugs.launchpad.net/kicad/+bug/1785034
2018-08-02 11:01:03 +01:00
Jeff Young 2155dd6591 Simplify ExitDialog and make platform-compliant.
Put the buttons in platform-compliant order.
Get rid of SaveMultiOptions in favour of repeated standard save
dialogs with a "Apply to all" checkbox.

Fixes: lp:1783444
* https://bugs.launchpad.net/kicad/+bug/1783444
2018-08-01 15:27:54 +01:00
Maciej Suminski 39d8d143d6 Fixed KIDIALOG freeze
wxDialog calls Show(false) when the dialog is about to be closed, but
KIDIALOG::Show() implementation did not forward the show parameter to
wxRichMessageDialog::Show() invocation. As the parameter was not
specified, the mentioned Show() call always used 'true' as the default
parameter, preventing the dialog from being closed.

Fixes: lp:1782999
* https://bugs.launchpad.net/kicad/+bug/1782999
2018-07-25 11:50:04 +02:00
Jeff Young c842ddfb97 Fix message mismatch in YesNoCancelDialog. 2018-05-02 21:49:57 +01:00
Seth Hillbrand e6245c5c5a Fix type comparison warning 2018-03-02 17:08:01 -08:00