mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-14 10:05:32 +02:00
* Wrap InboxView in an InboxPage.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
|
||||||
|
* Copyright 2014, Christian Muehlhaeuser <muesli@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
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,6 +22,8 @@
|
|||||||
#include "InboxModel.h"
|
#include "InboxModel.h"
|
||||||
#include "PlayableProxyModel.h"
|
#include "PlayableProxyModel.h"
|
||||||
#include "ContextMenu.h"
|
#include "ContextMenu.h"
|
||||||
|
#include "playlist/TrackItemDelegate.h"
|
||||||
|
#include "ViewManager.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
InboxView::InboxView( QWidget* parent ) :
|
InboxView::InboxView( QWidget* parent ) :
|
||||||
@@ -63,3 +66,26 @@ InboxView::onMenuTriggered( int action )
|
|||||||
else
|
else
|
||||||
TrackView::onMenuTriggered( action );
|
TrackView::onMenuTriggered( action );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
InboxPage::InboxPage( QWidget* parent ) :
|
||||||
|
FlexibleView( parent )
|
||||||
|
{
|
||||||
|
InboxView* inboxView = new InboxView( this );
|
||||||
|
setTrackView( inboxView );
|
||||||
|
setCurrentMode( Flat );
|
||||||
|
|
||||||
|
inboxView->proxyModel()->setStyle( PlayableProxyModel::Large );
|
||||||
|
/* inboxView->proxyModel()->setGroupBy( true );
|
||||||
|
* inboxView->setSortingEnabled( true );
|
||||||
|
* inboxView->proxyModel()->sort( 0 );*/
|
||||||
|
inboxView->setEmptyTip( tr( "No listening suggestions here." ) );
|
||||||
|
|
||||||
|
inboxView->setGuid( "inbox" );
|
||||||
|
inboxView->setHeaderHidden( true );
|
||||||
|
|
||||||
|
setPlayableModel( ViewManager::instance()->inboxModel() );
|
||||||
|
|
||||||
|
TrackItemDelegate* delegate = new TrackItemDelegate( TrackItemDelegate::Inbox, inboxView, inboxView->proxyModel() );
|
||||||
|
inboxView->setPlaylistItemDelegate( delegate );
|
||||||
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
|
||||||
|
* Copyright 2014, Christian Muehlhaeuser <muesli@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
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
#define INBOXVIEW_H
|
#define INBOXVIEW_H
|
||||||
|
|
||||||
#include "TrackView.h"
|
#include "TrackView.h"
|
||||||
|
#include "FlexibleView.h"
|
||||||
|
|
||||||
class InboxView : public TrackView
|
class InboxView : public TrackView
|
||||||
{
|
{
|
||||||
@@ -37,4 +39,12 @@ public slots:
|
|||||||
virtual void onMenuTriggered( int action );
|
virtual void onMenuTriggered( int action );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class InboxPage : public FlexibleView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit InboxPage( QWidget* parent = 0 );
|
||||||
|
};
|
||||||
|
|
||||||
#endif // INBOXVIEW_H
|
#endif // INBOXVIEW_H
|
||||||
|
Reference in New Issue
Block a user