Skip to content

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Dec 3, 2011

The -min command line option, according to the help text, is supposed to start bitcoin minimized. This pull request implements this functionality again. See issue #671.

@@ -170,7 +170,15 @@ int main(int argc, char *argv[])
window.setClientModel(&clientModel);
window.setWalletModel(&walletModel);

window.show();
// If -min option passed, start window minimized.
if(mapArgs.count("-min"))
Copy link
Contributor

Choose a reason for hiding this comment

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

if (GetBoolArg("-min")) ... would be more consistent with other boolean args (otherwise -min=0 is interpreted as true).

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed

@laanwj
Copy link
Member Author

laanwj commented Dec 4, 2011

Updated to use GetBoolArg

@TheBlueMatt
Copy link
Contributor

Nice feature, ACK

@gavinandresen
Copy link
Contributor

ACK

@gavinandresen gavinandresen merged commit 8848a70 into bitcoin:master Dec 5, 2011
@runeksvendsen
Copy link
Contributor

Thanks for writing this patch laanwj!

I did some testing, and it works fine for me unless I use the option "Minimize to the tray instead of the taskbar". If this option is on, then I am not able to get the GUI back to an unminimized state after I start it. This is only the case when the program is started initially. If this setting is ON, and the program is started with the -min option, I can't get it back from the taskbar; nothing happens when I click the icon. If this setting is OFF, and the program is started with the -min option, it works fine, even if this setting is turned ON after starting the program.

@runeksvendsen
Copy link
Contributor

It would be nice if the splash screen wasn't shown when the -min option is specified. I tried writing a patch, but got stuck when I found out that I can't use GetBoolArg to decide whether or not to show the splash screen, since at the point in the code where the splash screen is shown AppInit2 hasn't been run yet, and it's in AppInit2 that the variable (mapArgs) needed for GetBoolArg to function is populated with data.

What could be done about this? Should we be parsing argv directly, or is there a neater trick?

@laanwj
Copy link
Member Author

laanwj commented Dec 9, 2011

  1. yes, currently it does not take into account "minimize to the tray" because this is not a Qt feature, we'd need to override BitcoinGUI::showMinimized to take this into account

  2. I think a neat way would be to put basic argument parsing (ParseParameters) to beginning of main(), after Qt had its shot at the arguments with QApplication() ... Could just put a #ifndef QT_GUI around it in init.cpp to make sure it is not done twice. This is also useful if we want to provide an argument to override the language (changing the GUI language #678).

@runeksvendsen
Copy link
Contributor

I see. I guess 1) will have to wait some time then. Maybe we should ignore the "minimize to tray"-setting when the "-min" option is specified?

I have implemented 2) in pull request #690

@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.

4 participants