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

Command Line Switch To Disable Version Check #1588

Closed
chrisjlocke opened this Issue Oct 22, 2018 · 13 comments

Comments

Projects
None yet
4 participants
@chrisjlocke
Copy link
Contributor

chrisjlocke commented Oct 22, 2018

Describe the new feature

In relation to #1560
If a command line switch could be provided, then the version update check could be ignored.
Depending on the OS, the application has to start to get into the options to disable the option ... this isn't possible if the application crashes when the application starts.

Additional info

Please answer these questions before submitting your feature request.

Is your feature request related to an issue? Please include the issue number.

Yes. #1560

Does this feature exist in another product or project? Please provide a link.

Other applications have a 'safe mode' switch. Various plugins/checks are turned off.

Do you have a screenshot? Please add screenshots to help explain your idea.

n/a

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Oct 22, 2018

Good idea. We should do this. Preferably in 3.11.0, if someone has a chance to add suitable code. 😄

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Oct 22, 2018

What about generalising this to any setting?:

-o, --option [group/setting=value] Run application with this setting temporarily set to value

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Oct 22, 2018

I'm working on that.

@mgrojo mgrojo self-assigned this Oct 22, 2018

mgrojo added a commit that referenced this issue Oct 22, 2018

Command line option for running with some setting set to a given value
There are cases where the default configuration makes impossible to
use the application, due to some misbehaviour, like in issue #1560. This
new command line option allows users to set any setting to any value.
The setting is not saved unless user enters Preferences and saves the
current values. This allows overriding the preferences for the session
duration from the command line and also overriding the defaults for the
first session to work around problems with those defaults.

See issue #1588
@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Oct 22, 2018

I've committed to master the new option as I described in my previous comment. The setting is not saved unless user enters Preferences and presses Save. This is useful also for testing with some value and then through it away. I've tested with integer, string, boolean, font, colour values and it's working for me in every case, except for the language, which is initialised before reading the command line and consequently, the setting is correctly set, but not applied in the session. I think this glitch can be tolerated.

For #1311 and (hypothetically) #1560 users can run with this option and then use Preferences > Save:

sqlitebrowser -o checkversion/enabled=false

Several options can be concatenated for getting a profile completely different to your saved preferences.

./sqlitebrowser -o databrowser/null_bg_colour=pink -o editor/font=Utopia -o editor/wrap_lines=0 -o remote/active=false

That opens the door to having several desktop shortcuts with different profiles.

If this works well in tomorrow's nightly, I think it can be cherry-picked to the v3.11.x branch. It would need new translations for two strings related to the command line usage, though.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Oct 22, 2018

Sounds like a smart approach @mgrojo. 😄

@chrisjlocke

This comment has been minimized.

Copy link
Contributor Author

chrisjlocke commented Oct 23, 2018

Excellent solution, @mgrojo 🥇

@chrisjlocke

This comment has been minimized.

Copy link
Contributor Author

chrisjlocke commented Oct 23, 2018

(that emoji always looks like a rabbit to me....!)

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Oct 30, 2018

Should we close this issue then? 😄

@chrisjlocke

This comment has been minimized.

Copy link
Contributor Author

chrisjlocke commented Nov 6, 2018

Closing due to the masterful @mgrojo doing his coding skillzzzzzzzz.

@chrisjlocke chrisjlocke closed this Nov 6, 2018

@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Nov 6, 2018

There is a pending decision about whether this should be added to the v3.11.x branch for working around #1311. I think it's safe enough; the code is very simple indeed (so totally undeserved compliments, by the way 😉 but thanks). The only drawback is that there will be two new strings to translate (only in the command-line interface which at least is not very visible if some translator is not able to update them for the release).

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Nov 7, 2018

Might as well add it to the 3.11 branch. I should have time to get an alpha2 release created either friday or this weekend. If I don't have the SQLCipher bits worked out by then, then alpha2 can be with standard SQLite until until I do have SQLCipher working. That'll still give people something newer to test. 😄

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Nov 8, 2018

I agree - no reason to not add this to 3.11 😄

mgrojo added a commit that referenced this issue Nov 8, 2018

Command line option for running with some setting set to a given value
There are cases where the default configuration makes impossible to
use the application, due to some misbehaviour, like in issue #1560. This
new command line option allows users to set any setting to any value.
The setting is not saved unless user enters Preferences and saves the
current values. This allows overriding the preferences for the session
duration from the command line and also overriding the defaults for the
first session to work around problems with those defaults.

See issue #1588

mgrojo added a commit that referenced this issue Nov 8, 2018

Updated translations with messages from issue #1588
Only relevant changes to ongoing translations are committed, so that
future conflicts are minimised.

Added Spanish translation for the new messages.
@mgrojo

This comment has been minimized.

Copy link
Contributor

mgrojo commented Nov 8, 2018

Ok. Added to v3.11.x and translation files updated with the new messages.

mgrojo added a commit that referenced this issue Nov 10, 2018

Updated translations with messages from issue #1588
Only relevant changes to ongoing translations are committed, so that
future conflicts are minimised.

Added Spanish translation for the new messages.

mgrojo added a commit that referenced this issue Nov 10, 2018

mgrojo added a commit that referenced this issue Nov 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment