mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Added ViewManager::destroyCurrentPage().
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
* Copyright 2010-2012, Leo Franchi <lfranchi@kde.org>
|
* Copyright 2010-2012, Leo Franchi <lfranchi@kde.org>
|
||||||
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
|
||||||
@@ -586,6 +586,17 @@ ViewManager::destroyPage( ViewPage* page )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
ViewManager::destroyCurrentPage()
|
||||||
|
{
|
||||||
|
if ( !currentPage() || !currentPage()->isTemporaryPage() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
destroyPage( currentPage() );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ViewManager::setPage( ViewPage* page, bool trackHistory )
|
ViewManager::setPage( ViewPage* page, bool trackHistory )
|
||||||
{
|
{
|
||||||
@@ -649,7 +660,7 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
|
|||||||
m_stack->setCurrentWidget( page->widget() );
|
m_stack->setCurrentWidget( page->widget() );
|
||||||
|
|
||||||
//This should save the CPU cycles, especially with pages like the visualizer
|
//This should save the CPU cycles, especially with pages like the visualizer
|
||||||
if(previousPage && previousPage != page->widget())
|
if ( previousPage && previousPage != page->widget() )
|
||||||
previousPage->hide();
|
previousPage->hide();
|
||||||
|
|
||||||
updateView();
|
updateView();
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
@@ -164,6 +164,7 @@ public slots:
|
|||||||
QList< Tomahawk::ViewPage* > allPages() const;
|
QList< Tomahawk::ViewPage* > allPages() const;
|
||||||
QList< Tomahawk::ViewPage* > historyPages() const;
|
QList< Tomahawk::ViewPage* > historyPages() const;
|
||||||
void destroyPage( Tomahawk::ViewPage* page );
|
void destroyPage( Tomahawk::ViewPage* page );
|
||||||
|
bool destroyCurrentPage();
|
||||||
|
|
||||||
void showQueue() { emit showQueueRequested(); }
|
void showQueue() { emit showQueueRequested(); }
|
||||||
void hideQueue() { emit hideQueueRequested(); }
|
void hideQueue() { emit hideQueueRequested(); }
|
||||||
|
Reference in New Issue
Block a user