mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Share one trayIcon across all windows
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
using namespace Tomahawk;
|
||||
|
||||
SourcesModel* TomahawkWindow::s_sourcesModel = 0;
|
||||
TomahawkTrayIcon* TomahawkWindow::s_trayIcon = 0;
|
||||
|
||||
TomahawkWindow::TomahawkWindow( QWidget* parent )
|
||||
: QMainWindow( parent )
|
||||
, m_trayIcon( new TomahawkTrayIcon( this ) )
|
||||
{
|
||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
||||
|
||||
@@ -45,6 +45,9 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
||||
if( !s_sourcesModel )
|
||||
s_sourcesModel = new SourcesModel( this );
|
||||
|
||||
if( !s_trayIcon )
|
||||
s_trayIcon = new TomahawkTrayIcon( this );
|
||||
|
||||
setupSignals();
|
||||
}
|
||||
|
||||
@@ -127,7 +130,7 @@ TomahawkWindow::closeEvent( QCloseEvent* e )
|
||||
return;
|
||||
}
|
||||
#else
|
||||
m_trayIcon->setShowHideWindow( false );
|
||||
s_trayIcon->setShowHideWindow( false );
|
||||
#endif
|
||||
|
||||
e->accept();
|
||||
|
@@ -59,9 +59,9 @@ private:
|
||||
|
||||
protected:
|
||||
static SourcesModel* s_sourcesModel;
|
||||
static TomahawkTrayIcon* s_trayIcon;
|
||||
|
||||
QString m_windowTitle;
|
||||
TomahawkTrayIcon* m_trayIcon;
|
||||
Tomahawk::result_ptr m_currentTrack;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user