Default selected button in close confirmation dialogue is "Discard Changes" on GTK

Bug #1836178 reported by Alexander Willer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Undecided
Unassigned

Bug Description

Affects all applications.

When switching the active footprint, symbol or closing the application window while having unsaved changes, the appearing confirmation dialog has "Discard Changes" selected as the default option.

"Cancel" or "Save Changes" should be the default selected option to prevent data loss. In my opion, "Cancel" would be the better choice, since it doesn't alter any data by accident (in contrast to "Save Changes".

Application: kicad
Version: 5.1.2-1.fc30, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.7/openssl/zlib nghttp2/1.38.0
Platform: Linux 5.1.5-300.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 9.0.1 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: ui
Revision history for this message
Jeff Young (jeyjey) wrote :

The Mac version defaults to "Save Changes" (despite the Apple HIG saying "Cancel" is the safer choice).

Then again, many Mac applications now save automatically (without any input from the user whatsoever). Therefore, I think "Save Changes" is the correct default action.

Revision history for this message
Alexander Willer (awiller) wrote :

The advantage of "Cancel" as the default would obviously be that one cannot cause any data-altering action by accident.

Regarding auto save (for the primary board / schematic / lib file), I guess this goes against the attitude of "professional-type application" users. While the automatic backup to a separate file as a kind of implementation of auto save is certainly very useful, it doesn't interfere with the users decision of manually deciding about altering their data via the save (or don't save) action.

In contrast, auto save for the primary file kind of takes the freedom of choice to persist or discard any changes made (typical use case: saving the file, making experimental changes, discarding them without saving). Of course, this can also be achieved with some kind of VCS, but not everyone uses VCS for their KiCad projects.

tags: added: ui
Revision history for this message
Jeff Young (jeyjey) wrote :

The code (in UnsavedChangesDialog()) certainly attempts to set the right default (YES/Save):

    wxMessageDialog dlg( parent, aMessage, wxEmptyString,
                         wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
    dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
    dlg.SetYesNoLabels( _( "Save" ), _( "Discard Changes" ) );

Not sure what's going wrong, but it'll have to be debugged on GTK.

summary: Default selected button in close confirmation dialogue is "Discard
- Changes"
+ Changes" on GTK
Revision history for this message
Ian McInerney (imcinerney) wrote :

There have been some major changes to the close confirmation dialog box since 5.1.2 was released, and there was an issue with the default button selection in 5.1.2 that should now be fixed. @Alexander, can you try the nightly build to see if that fixes it?

@Jeff, the code you are looking at was only added recently (commit 8002692f3ece830e6673e8b3bedfd614379b791e), before that Seth commited a fix for the button defaults in 5d5422b4c53cff9380efd7de91e109920ac05b1e that addressed this issue.

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1836178] Re: Default selected button in close confirmation dialogue is "Discard Changes" on GTK

He he… well, that would certainly explain it. ;)

> On 14 Jul 2019, at 09:45, Ian McInerney <email address hidden> wrote:
>
> There have been some major changes to the close confirmation dialog box
> since 5.1.2 was released, and there was an issue with the default button
> selection in 5.1.2 that should now be fixed. @Alexander, can you try the
> nightly build to see if that fixes it?
>
> @Jeff, the code you are looking at was only added recently (commit
> 8002692f3ece830e6673e8b3bedfd614379b791e), before that Seth commited a
> fix for the button defaults in 5d5422b4c53cff9380efd7de91e109920ac05b1e
> that addressed this issue.
>
> --
> You received this bug notification because you are a member of KiCad Bug
> Squad, which is subscribed to KiCad.
> https://bugs.launchpad.net/bugs/1836178
>
> Title:
> Default selected button in close confirmation dialogue is "Discard
> Changes" on GTK
>
> Status in KiCad:
> New
>
> Bug description:
> Affects all applications.
>
> When switching the active footprint, symbol or closing the application
> window while having unsaved changes, the appearing confirmation dialog
> has "Discard Changes" selected as the default option.
>
> "Cancel" or "Save Changes" should be the default selected option to
> prevent data loss. In my opion, "Cancel" would be the better choice,
> since it doesn't alter any data by accident (in contrast to "Save
> Changes".
>
> Application: kicad
> Version: 5.1.2-1.fc30, release build
> Libraries:
> wxWidgets 3.0.4
> libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.7/openssl/zlib nghttp2/1.38.0
> Platform: Linux 5.1.5-300.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
> Build Info:
> wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
> Boost: 1.69.0
> OpenCASCADE Community Edition: 6.9.1
> Curl: 7.64.0
> Compiler: GCC 9.0.1 with C++ ABI 1013
>
> Build settings:
> USE_WX_GRAPHICS_CONTEXT=OFF
> USE_WX_OVERLAY=ON
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_PYTHON3=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_USE_OCC=OFF
> KICAD_SPICE=ON
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1836178/+subscriptions

Changed in kicad:
status: New → Fix Committed
milestone: none → 6.0.0-rc1
Revision history for this message
Alexander Willer (awiller) wrote :

Thanks for consideration, the issue is fixed in the following version:

Application: KiCad
Version: (5.99.0-135-ga1fe8cfa5), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.3 OpenSSL/1.1.1c-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.9.0/openssl/zlib nghttp2/1.39.2
Platform: Linux 5.2.11-200.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.65.3
    Compiler: GCC 9.2.1 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.