Commit 18fd08ca authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Revert "Qt: StandardPanel: Add spinner on network SD nodes."

This reverts commit 62c58470.
This commit broke the tests suite; the Qt interfaces crashes always.
parent 0cbb516c
...@@ -141,7 +141,6 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -141,7 +141,6 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
DCONNECT( selector, categoryActivated( playlist_item_t *, bool ), DCONNECT( selector, categoryActivated( playlist_item_t *, bool ),
mainView, setRootItem( playlist_item_t *, bool ) ); mainView, setRootItem( playlist_item_t *, bool ) );
mainView->setRootItem( p_root, false ); mainView->setRootItem( p_root, false );
CONNECT( selector, SDCategorySelected(bool), mainView, setWaiting(bool) );
/* */ /* */
split = new PlaylistSplitter( this ); split = new PlaylistSplitter( this );
......
...@@ -334,7 +334,6 @@ void PLSelector::createItems() ...@@ -334,7 +334,6 @@ void PLSelector::createItems()
selItem = addItem( SD_TYPE, *ppsz_longname ); selItem = addItem( SD_TYPE, *ppsz_longname );
} }
selItem->treeItem()->setData( 0, SD_CATEGORY_ROLE, *p_category );
putSDData( selItem, *ppsz_name, *ppsz_longname ); putSDData( selItem, *ppsz_name, *ppsz_longname );
if ( ! icon.isNull() ) if ( ! icon.isNull() )
selItem->treeItem()->setData( 0, Qt::DecorationRole, icon ); selItem->treeItem()->setData( 0, Qt::DecorationRole, icon );
...@@ -420,13 +419,7 @@ void PLSelector::setSource( QTreeWidgetItem *item ) ...@@ -420,13 +419,7 @@ void PLSelector::setSource( QTreeWidgetItem *item )
/* */ /* */
if( pl_item ) if( pl_item )
{
emit categoryActivated( pl_item, false ); emit categoryActivated( pl_item, false );
emit SDCategorySelected(
item->data( 0, SD_CATEGORY_ROLE ).toInt()
& ( SD_CAT_INTERNET | SD_CAT_LAN )
);
}
} }
PLSelItem * PLSelector::addItem ( PLSelItem * PLSelector::addItem (
......
...@@ -62,7 +62,6 @@ enum { ...@@ -62,7 +62,6 @@ enum {
IN_ITEM_ROLE, //input_item_t->i_id IN_ITEM_ROLE, //input_item_t->i_id
SPECIAL_ROLE, //SpecialData SPECIAL_ROLE, //SpecialData
CAP_SEARCH_ROLE, CAP_SEARCH_ROLE,
SD_CATEGORY_ROLE,
}; };
enum ItemAction { enum ItemAction {
...@@ -155,7 +154,6 @@ private slots: ...@@ -155,7 +154,6 @@ private slots:
signals: signals:
void categoryActivated( playlist_item_t *, bool ); void categoryActivated( playlist_item_t *, bool );
void SDCategorySelected( bool );
}; };
#endif #endif
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "components/playlist/ml_model.hpp" /* MLModel */ #include "components/playlist/ml_model.hpp" /* MLModel */
#include "components/playlist/views.hpp" /* 3 views */ #include "components/playlist/views.hpp" /* 3 views */
#include "components/playlist/selector.hpp" /* PLSelector */ #include "components/playlist/selector.hpp" /* PLSelector */
#include "util/customwidgets.hpp" /* PixmapAnimator */
#include "menus.hpp" /* Popup */ #include "menus.hpp" /* Popup */
#include "input_manager.hpp" /* THEMIM */ #include "input_manager.hpp" /* THEMIM */
#include "dialogs_provider.hpp" /* THEDP */ #include "dialogs_provider.hpp" /* THEDP */
...@@ -88,14 +87,6 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, ...@@ -88,14 +87,6 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
currentRootIndexId = -1; currentRootIndexId = -1;
lastActivatedId = -1; lastActivatedId = -1;
QList<QString> frames;
frames << ":/util/wait1";
frames << ":/util/wait2";
frames << ":/util/wait3";
frames << ":/util/wait4";
spinnerAnimation = new PixmapAnimator( this, frames );
CONNECT( spinnerAnimation, pixmapReady( const QPixmap & ), this, updateViewport() );
/* Saved Settings */ /* Saved Settings */
int i_savedViewMode = getSettings()->value( "Playlist/view-mode", TREE_VIEW ).toInt(); int i_savedViewMode = getSettings()->value( "Playlist/view-mode", TREE_VIEW ).toInt();
i_zoom = getSettings()->value( "Playlist/zoom", 0 ).toInt(); i_zoom = getSettings()->value( "Playlist/zoom", 0 ).toInt();
...@@ -512,20 +503,6 @@ bool StandardPLPanel::eventFilter ( QObject *obj, QEvent * event ) ...@@ -512,20 +503,6 @@ bool StandardPLPanel::eventFilter ( QObject *obj, QEvent * event )
"media source from the left."), "media source from the left."),
QPalette::Text ); QPalette::Text );
} }
else if ( spinnerAnimation->state() == PixmapAnimator::Running )
{
if ( currentView->model()->rowCount() )
spinnerAnimation->stop(); /* Trick until SD emits events */
else
{
QWidget *viewport = qobject_cast<QWidget *>( obj );
QStylePainter painter( viewport );
QPixmap *spinner = spinnerAnimation->getPixmap();
QPoint point = viewport->geometry().center();
point -= QPoint( spinner->size().width() / 2, spinner->size().height() / 2 );
painter.drawPixmap( point, *spinner );
}
}
} }
return false; return false;
} }
...@@ -705,23 +682,6 @@ void StandardPLPanel::showView( int i_view ) ...@@ -705,23 +682,6 @@ void StandardPLPanel::showView( int i_view )
gotoPlayingItem(); gotoPlayingItem();
} }
void StandardPLPanel::setWaiting( bool b )
{
if ( b )
{
spinnerAnimation->setLoopCount( 20 ); /* Trick until SD emits an event */
spinnerAnimation->start();
}
else
spinnerAnimation->stop();
}
void StandardPLPanel::updateViewport()
{
/* A single update on parent widget won't work */
currentView->viewport()->repaint();
}
int StandardPLPanel::currentViewIndex() const int StandardPLPanel::currentViewIndex() const
{ {
if( currentView == treeView ) if( currentView == treeView )
......
...@@ -53,7 +53,6 @@ class PicFlowView; ...@@ -53,7 +53,6 @@ class PicFlowView;
class LocationBar; class LocationBar;
class PLSelector; class PLSelector;
class PlaylistWidget; class PlaylistWidget;
class PixmapAnimator;
class StandardPLPanel: public QWidget class StandardPLPanel: public QWidget
{ {
...@@ -111,14 +110,10 @@ private: ...@@ -111,14 +110,10 @@ private:
/* for popup */ /* for popup */
QModelIndex popupIndex; /* FIXME: don't store here, pass as Action param */ QModelIndex popupIndex; /* FIXME: don't store here, pass as Action param */
/* Wait spinner */
PixmapAnimator *spinnerAnimation;
public slots: public slots:
void setRootItem( playlist_item_t *, bool ); void setRootItem( playlist_item_t *, bool );
void browseInto( const QModelIndex& ); void browseInto( const QModelIndex& );
void showView( int ); void showView( int );
void setWaiting( bool ); /* spinner */
private slots: private slots:
void deleteSelection(); void deleteSelection();
...@@ -145,7 +140,6 @@ private slots: ...@@ -145,7 +140,6 @@ private slots:
void toggleColumnShown( int ); void toggleColumnShown( int );
void cycleViews(); void cycleViews();
void updateViewport(); /* spinner */
signals: signals:
void viewChanged( const QModelIndex& ); void viewChanged( const QModelIndex& );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment