mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-18 03:14:06 +00:00
+! Don't allow interacting with the tray icon until the program loads fully.
This commit is contained in:
parent
356570b244
commit
9aefea2dc8
|
@ -168,11 +168,15 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
connect( dictionaryBar.toggleViewAction(), SIGNAL(toggled(bool)),
|
connect( dictionaryBar.toggleViewAction(), SIGNAL(toggled(bool)),
|
||||||
this, SLOT(dictionaryBarToggled(bool)) );
|
this, SLOT(dictionaryBarToggled(bool)) );
|
||||||
|
|
||||||
// Show tray icon early so the user would be happy
|
// Show tray icon early so the user would be happy. It won't be functional
|
||||||
updateTrayIcon();
|
// though until the program inits fully.
|
||||||
|
|
||||||
if ( trayIcon )
|
if ( cfg.preferences.enableTrayIcon )
|
||||||
|
{
|
||||||
|
trayIcon = new QSystemTrayIcon( QIcon( ":/icons/programicon.png" ), this );
|
||||||
trayIcon->setToolTip( tr( "Loading..." ) );
|
trayIcon->setToolTip( tr( "Loading..." ) );
|
||||||
|
trayIcon->show();
|
||||||
|
}
|
||||||
|
|
||||||
connect( navBack, SIGNAL( activated() ),
|
connect( navBack, SIGNAL( activated() ),
|
||||||
this, SLOT( backClicked() ) );
|
this, SLOT( backClicked() ) );
|
||||||
|
@ -270,6 +274,17 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
|
|
||||||
ui.translateLine->setFocus();
|
ui.translateLine->setFocus();
|
||||||
|
|
||||||
|
if ( trayIcon )
|
||||||
|
{
|
||||||
|
// Upgrade existing dummy tray icon into a full-functional one
|
||||||
|
|
||||||
|
trayIcon->setContextMenu( &trayIconMenu );
|
||||||
|
trayIcon->show();
|
||||||
|
|
||||||
|
connect( trayIcon, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ),
|
||||||
|
this, SLOT( trayIconActivated( QSystemTrayIcon::ActivationReason ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
updateTrayIcon();
|
updateTrayIcon();
|
||||||
|
|
||||||
// Update zoomers
|
// Update zoomers
|
||||||
|
|
Loading…
Reference in a new issue