mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +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> ===
|
||||
*
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -21,10 +22,12 @@
|
||||
#include "InboxModel.h"
|
||||
#include "PlayableProxyModel.h"
|
||||
#include "ContextMenu.h"
|
||||
#include "playlist/TrackItemDelegate.h"
|
||||
#include "ViewManager.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
InboxView::InboxView(QWidget *parent) :
|
||||
TrackView(parent)
|
||||
InboxView::InboxView( QWidget* parent ) :
|
||||
TrackView( parent )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -63,3 +66,26 @@ InboxView::onMenuTriggered( int action )
|
||||
else
|
||||
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> ===
|
||||
*
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -21,6 +22,7 @@
|
||||
#define INBOXVIEW_H
|
||||
|
||||
#include "TrackView.h"
|
||||
#include "FlexibleView.h"
|
||||
|
||||
class InboxView : public TrackView
|
||||
{
|
||||
@@ -37,4 +39,12 @@ public slots:
|
||||
virtual void onMenuTriggered( int action );
|
||||
};
|
||||
|
||||
class InboxPage : public FlexibleView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InboxPage( QWidget* parent = 0 );
|
||||
};
|
||||
|
||||
#endif // INBOXVIEW_H
|
||||
|
Reference in New Issue
Block a user