Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin-Qt: add a Reset button to the options dialog #1685

Merged
merged 1 commit into from
Jan 5, 2013
Merged

Bitcoin-Qt: add a Reset button to the options dialog #1685

merged 1 commit into from
Jan 5, 2013

Conversation

Diapolo
Copy link

@Diapolo Diapolo commented Aug 18, 2012

  • a click on "Reset Options" sets all options to the default values by
    removing all stored settings (QSettings), loading the defaults and
    saving them as the new settings
  • before the reset is executed the user is presented a confirmation dialog
  • special casing was needed for StartAtStartup

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/3ba81511f1d9409c85ec00a67fa7d5ac3d21a806 for binaries and test log.

@@ -167,7 +185,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
case DisplayAddresses:
return QVariant(bDisplayAddresses);
case DetachDatabases:
return QVariant(bitdb.GetDetach());
return settings.value("detachDB", false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we agree last time that the preferences dialog shows the settings currently active. Thus, as overridden by command line options etc? In that case, this change is not valid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the original code, there is no default, when doing a reset, as the detach DB checkbox always reflects the current state. This seemed like the easiest way to fix that. Have you got a better idea?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laanwj What do you say? Is the general idea for that reset button a good one and what about the detach thing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I like the general idea of a reset "to factory settings" button. I don't agree with this change though as it makes detach different from the other core settings.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can revert this, but please consider the following:

This patch has the following behaviour:
1.
1.1. enable Detach Databases at Shutdown in settings -> Apply and close
1.2. click Reset -> Detach Databases at Shutdown get's disabled
2.
1.1. enable Detach Databases at Shutdown in settings -> Apply and close
1.2. disable Detach Databases at Shutdown in settings -> Apply and close
1.3. click Reset -> Detach Databases at Shutdown stays disabled

With current code:
1.
1.1. enable Detach Databases at Shutdown in settings -> Apply and close
1.2. click Reset -> Detach Databases at Shutdown stays enabled
2.
1.1. enable Detach Databases at Shutdown in settings -> Apply and close
1.2. disable Detach Databases at Shutdown in settings -> Apply and close
1.3. click Reset -> Detach Databases at Shutdown stays disabled

So current code is special and IMHO a user expects it to be the way after this patch, no?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laanwj Alright, as you did not respond, let me re-phrase, are there any further comments left, when I revert that single change :)?

@laanwj
Copy link
Member

laanwj commented Sep 21, 2012

@Diapolo my time is pretty limited, and I haven't found time to test and look at this in further detail yet. It will be a while before 0.8.0 is released, I guess, so there's no need to hurry.

@Diapolo
Copy link
Author

Diapolo commented Oct 7, 2012

@laanwj I found a method to achieve what I wanted, without the need to change the detachDB stuff in OptionsModel::data().

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/35ff85be9d53d082c4748472dd87fd98572f8798 for binaries and test log.

@Diapolo
Copy link
Author

Diapolo commented Nov 9, 2012

Updated and removed special casing for detachDB as that was removed entirely.

@luke-jr
Copy link
Member

luke-jr commented Nov 13, 2012

Does this correctly handle the Cancel case? That is, if I Reset and Cancel, no changes should be made (and making changes should require OK/Apply).

@Diapolo
Copy link
Author

Diapolo commented Nov 13, 2012

No, when you use reset button, this is a non-reversible action. It's IMO not worth the trouble (perhaps not even possible the way this is working), but I could add a warning message where you need to confirm the process, would this be sufficient then?

Making changes DOES already require OK/Apply.

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/92ffc1b5a9dbebc281da38782d99fb357ba77f15 for binaries and test log.

@sipa
Copy link
Member

sipa commented Jan 5, 2013

What is the status on this?

@Diapolo
Copy link
Author

Diapolo commented Jan 5, 2013

Neither @luke-jr nor @laanwj added further comments, but from my point of view this would be a nice little addition for 0.8.

Edit: I tried it and still seems to work, but would of course need a little testing an feedback ;).

@luke-jr
Copy link
Member

luke-jr commented Jan 5, 2013

I still think it's a usability bug for it to conflict with the Cancel action, but I don't really care enough to argue over it.

- a click on "Reset Options" sets all options to the default values by
  removing all stored settings (QSettings), loading the defaults and
  saving them as the new settings
- before the reset is executed the user is presented a confirmation dialog
- special casing was needed for StartAtStartup
@Diapolo
Copy link
Author

Diapolo commented Jan 5, 2013

Updated to include a confirmation dialog before executing the reset.

@laanwj
Copy link
Member

laanwj commented Jan 5, 2013

Much better with confirmation dialog, ACK

laanwj added a commit that referenced this pull request Jan 5, 2013
Bitcoin-Qt: add a Reset button to the options dialog
@laanwj laanwj merged commit 744adb2 into bitcoin:master Jan 5, 2013
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
Bitcoin-Qt: add a Reset button to the options dialog
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
…ons. (bitcoin#1685)

1ab21cf Remove bogus assert on number of oubound connections. (Matt Corallo)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants