Skip to content

Add setting to disable Save Needed dialog box#1103

Merged
klayoutmatthias merged 2 commits intoKLayout:masterfrom
nikosavola:1102-setting-to-disable-save-needed
Jun 28, 2022
Merged

Add setting to disable Save Needed dialog box#1103
klayoutmatthias merged 2 commits intoKLayout:masterfrom
nikosavola:1102-setting-to-disable-save-needed

Conversation

@nikosavola
Copy link
Contributor

This PR adds a setting to disable the Save Needed dialog box.

Additionally

  • a random quotation mark here is removed
    image
  • a dot added to finish the sentence in Watch Layout Files

Closes #1102

@klayoutmatthias
Copy link
Collaborator

Thanks for the patch, but this will not work.

You're not checking against the value of the option, but against the string containing the configuration option name in layMainWindow.cc (cfg_always_exit_without_saving). This probably always exits without asking.

The correct way is to introduce a boolean member in lay::MainWindow (e.g. bool m_always_exit_without_saving), initialize it with false in the constructor, set its value from the cfg_always_exit_without_saving configuration option in lay::MainWindow::configure and use this boolean in the if condition.

Matthias

@nikosavola nikosavola marked this pull request as ready for review June 28, 2022 07:51
@nikosavola
Copy link
Contributor Author

Thanks for the patch, but this will not work.

You're not checking against the value of the option, but against the string containing the configuration option name in layMainWindow.cc (cfg_always_exit_without_saving). This probably always exits without asking.

The correct way is to introduce a boolean member in lay::MainWindow (e.g. bool m_always_exit_without_saving), initialize it with false in the constructor, set its value from the cfg_always_exit_without_saving configuration option in lay::MainWindow::configure and use this boolean in the if condition.

Matthias

Hello Matthias. Thanks for the feedback.

I updated the code, is it now correct? I'm having problems with the compiler so it's a bit hard to test 😅

@klayoutmatthias
Copy link
Collaborator

Yes, that's fine now! :)

@klayoutmatthias klayoutmatthias merged commit 241815e into KLayout:master Jun 28, 2022
klayoutmatthias pushed a commit that referenced this pull request Jun 28, 2022
* Add setting to disable Save Needed dialog box

* Add `m_always_exit_without_saving` to `MainWindow`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add setting to disable Save Needed dialog box

2 participants