Skip to content

Conversation

@lucydodo
Copy link
Member

@lucydodo lucydodo commented Oct 2, 2020

This patch changes to give a option to users that disable 'Save Project' dialog.
This PR is related to issue #2417.

Detailed Changes

  1. Add the following checkbox to the 'PreferencesDialog' : Do NOT ask 'Save Project'
    • and set default value for new checkbox to false
      Screenshot from 2020-10-02 22-02-23
  2. Add the code that check the new checkbox is enabled or disabled in askSaveSqlTab()

Test Environment

  • Ubuntu Desktop 20.04.1

Thank you.

@lucydodo lucydodo added the enhancement Feature requests. label Oct 2, 2020
@lucydodo lucydodo requested a review from justinclift October 2, 2020 12:46
@lucydodo lucydodo self-assigned this Oct 2, 2020
@lucydodo
Copy link
Member Author

lucydodo commented Oct 2, 2020

@justinclift May I ask for a review because since you participated in that issue? 🤔

@justinclift
Copy link
Member

Sure. 😄

I can't review the code in a meaningful way (lack of C++ skill these days).

Looking at the text string "Do NOT ask 'Save Project'", that should probably be updated to "Do NOT ask to 'Save Project'".

It would probably be useful to add some kind of tooltip or similar help text as well, to let people know what this is for. Maybe something like "If this is turned on, then changes to the database file won't generate a save confirmation dialog when closing the database. Instead, the changes will be lost, leaving the database unchanged."

Does that help? 😄

@lucydodo
Copy link
Member Author

lucydodo commented Oct 2, 2020

@justinclift Cool 😄 , I'm out there right now, so I'll fix it when I get home. And I am still analyzing about the our project code, so I'm worried that it will cause problems that I don't know. Could you recommend another reviewer? 🤔

Sorry if it's rude. It was never intended to be that way.

@chrisjlocke
Copy link
Member

then changes to the database file won't generate a save confirmation dialog

Not /strictly/ true. I thought this stopped the dialogs that pop up if you create a new 'execute Sql' tab, and not directly related to the database itself...

that should probably be updated to ...

Do the other controls move to the right automatically, or does lucydodo have to move half a billion controls to align them all? 🤣

@justinclift
Copy link
Member

Sorry if it's rude. It was never intended to be that way.

Er... if what's rude?

Um, I'm not seeing anything related to rudeness here, so I'm not sure what that comment is about. 🤷‍♂️

Reviewer wise, I'd say @mgrojo probably. 😁

@lucydodo
Copy link
Member Author

lucydodo commented Oct 2, 2020

@justinclift It may be a silly concern, but I was worried that it might sound rude to ask an existing reviewer to recommend another reviewer. Each person has a different culture, so I'm careful about the small things. 🤔 🤔

@lucydodo
Copy link
Member Author

lucydodo commented Oct 2, 2020

@chrisjlocke Oh, You're right. 😄
It only works when user open the database file, not the project file, and modify and close the SQL tab.
Is there any other good expression? or would it better to move the checkbox to the 'SQL' tab rather than 'General' tab?

@lucydodo lucydodo requested a review from mgrojo October 2, 2020 16:26
@lucydodo
Copy link
Member Author

lucydodo commented Oct 2, 2020

For now, I change and add like the following:

  • Change : Do NOT ask 'Save Project' -> Do NOT ask to 'Save Project' in SQL Editor tabs
  • New : If this is turned on, then changes to the SQL editor won't generate a
    save a project confirmation dialog when closing the SQL editor tab. Instead, the changes will be lost.

Here's the screenshot but it's not look neat even to me. I think it needs to be modification.
Screen Shot 2020-10-03 at 2 01 14

@justinclift justinclift removed their request for review October 3, 2020 00:13
@chrisjlocke
Copy link
Member

Do NOT ask to 'Save Project' in SQL Editor tabs

"Do NOT prompt to save SQL tabs in new project file."
Maybe... 😉

Did you squish down the 'Manage' button while you were there? On my system, its huuuuuuuuuuuuuuuuuuuge.... (and looks weird!)

image

@mgrojo
Copy link
Member

mgrojo commented Oct 3, 2020 via email

@justinclift
Copy link
Member

Why not "Prompt to save SQL tabs in new project file" with default value True?

That's a good idea. 😄

@chrisjlocke
Copy link
Member

Good idea, @mgrojo

@lucydodo
Copy link
Member Author

lucydodo commented Oct 4, 2020

@mgrojo Thanks for great idea 😄 I just modified the code according to your review.

Copy link
Member

@mgrojo mgrojo left a comment

Choose a reason for hiding this comment

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

With all the changes to the PreferencesDialog.ui it's difficult to know if some problem has slipped in. I suppose they are the consequence of the trials during the pull-request review. Could they be undone, so only the relevant changes are there? That will also make the history cleaner if we squashed the branch before commiting.

@lucydodo
Copy link
Member Author

lucydodo commented Oct 4, 2020

Are you saying squash all the commits of this PR?

@mgrojo
Copy link
Member

mgrojo commented Oct 4, 2020

Are you saying squash all the commits of this PR?

Don't worry about that. That can be done at the end before merging and can be done through the GitHub web controls. What I'm asking is to undo all the unnecessary changes in the PreferencesDialog.ui file. This could be done restoring the original version and inserting the new check-button. I suppose the remaining changes are unneeded and unrelated to this pull-request. Am I wrong about it?

@lucydodo
Copy link
Member Author

lucydodo commented Oct 4, 2020

oh, sorry I misunderstood. I have already reverted unnecessary changes to PreferencesDialog.ui
Maybe it looks messy with new checkbox being added between existing items.

Or shall I re-deisgn in Qt Creator and compare?

@lucydodo
Copy link
Member Author

lucydodo commented Oct 4, 2020

@mgrojo I'm really sorry. I was wrong. I tried again in Qt Creator and the changes are drastically reduced.
I guess I made a mistake while editing the layout. I just re-committed.

@mgrojo mgrojo merged commit 04d53c6 into sqlitebrowser:master Oct 4, 2020
@mgrojo
Copy link
Member

mgrojo commented Oct 4, 2020

No problem at all! It's now squashed and merged into the master branch.

@lucydodo
Copy link
Member Author

lucydodo commented Oct 4, 2020

Thanks to the members who gave me valuable comments and reviews. 😄

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

Labels

enhancement Feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants