ResourceBrowser: added management-buttons

Added two new buttons "Manage locations" and "Show piano". The first
one will open a resource location management dialog while the latter
one toggles visibility of the preview piano below.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Tobias Doerffel
2009-06-30 00:24:16 +02:00
parent 9588e3dcce
commit 65668f9489
2 changed files with 28 additions and 1 deletions

View File

@@ -60,11 +60,12 @@ public:
private slots:
void showContextMenu( const QPoint & _pos );
void updateFilterStatus();
void startItemPreview( const QModelIndex & _idx );
void stopItemPreview( const QModelIndex & _idx );
void stopPreview();
void triggerDefaultAction( const QModelIndex & _idx );
void updateFilterStatus();
void manageDirectories();
private:

View File

@@ -26,6 +26,7 @@
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QMenu>
#include <QtGui/QPushButton>
#include "ResourceBrowser.h"
#include "ResourceFileMapper.h"
@@ -120,12 +121,30 @@ ResourceBrowser::ResourceBrowser( QWidget * _parent ) :
this,
SLOT( triggerDefaultAction( const QModelIndex & ) ) );
// create buttons below tree-view
QHBoxLayout * buttonLayout = new QHBoxLayout;
QPushButton * manageButton = new QPushButton( tr( "Manage locations" ) );
connect( manageButton, SIGNAL( clicked() ),
this, SLOT( manageDirectories() ) );
QPushButton * pianoButton = new QPushButton( tr( "Show piano" ) );
pianoButton->setCheckable( true );
pianoButton->setChecked( true );
buttonLayout->addWidget( manageButton );
buttonLayout->addWidget( pianoButton );
// create PianoView allowing the user to test selected resource
PianoView * pianoView = new PianoView( contentParent() );
pianoView->setModel( m_previewer.pianoModel() );
connect( pianoButton, SIGNAL( toggled( bool ) ),
pianoView, SLOT( setVisible( bool ) ) );
// add widgets/layouts to us (we're a SideBarWidget)
addContentLayout( filterLayout );
addContentWidget( m_treeView );
addContentLayout( buttonLayout );
addContentWidget( pianoView );
@@ -305,6 +324,13 @@ void ResourceBrowser::updateFilterStatus()
void ResourceBrowser::manageDirectories()
{
}
void ResourceBrowser::triggerAction( Actions _action, ResourceItem * _item )
{
switch( _action )