diff --git a/include/QuickLoadDialog.h b/include/QuickLoadDialog.h new file mode 100644 index 000000000..3395e05c2 --- /dev/null +++ b/include/QuickLoadDialog.h @@ -0,0 +1,48 @@ +/* + * QuickLoadDialog.h - header file for QuickLoadDialog + * + * Copyright (c) 2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef _QUICK_LOAD_DIALOG_H +#define _QUICK_LOAD_DIALOG_H + +#include + + +namespace Ui { class QuickLoadDialog; } +class ResourceListModel; + +class QuickLoadDialog : public QDialog +{ +public: + QuickLoadDialog( QWidget * _parent ); + ~QuickLoadDialog(); + + +private: + Ui::QuickLoadDialog * ui; + ResourceListModel * m_listModel; + +} ; + +#endif + diff --git a/src/gui/QuickLoadDialog.cpp b/src/gui/QuickLoadDialog.cpp new file mode 100644 index 000000000..79e6084d9 --- /dev/null +++ b/src/gui/QuickLoadDialog.cpp @@ -0,0 +1,61 @@ +/* + * QuickLoadDialog.cpp - implementation of QuickLoadDialog + * + * Copyright (c) 2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#include "QuickLoadDialog.h" +#include "ResourceListModel.h" +#include "UnifiedResourceProvider.h" +#include "engine.h" + +#include "ui_QuickLoadDialog.h" + + + +QuickLoadDialog::QuickLoadDialog( QWidget * _parent ) : + QDialog( _parent ), + ui( new Ui::QuickLoadDialog ), + m_listModel( new ResourceListModel( + engine::resourceProvider()->database(), this ) ) +{ + ui->setupUi( this ); + + // setup list view to display our model + ui->resourceListView->setModel( m_listModel ); + ui->resourceListView->selectionModel()->select( + m_listModel->index( 0, 0 ), + QItemSelectionModel::SelectCurrent ); + + // connect filter edit with model + connect( ui->filterEdit, SIGNAL( textChanged( const QString & ) ), + m_listModel, SLOT( setFilter( const QString & ) ) ); +} + + + + +QuickLoadDialog::~QuickLoadDialog() +{ + delete m_listModel; +} + + diff --git a/src/gui/dialogs/QuickLoadDialog.ui b/src/gui/dialogs/QuickLoadDialog.ui new file mode 100644 index 000000000..c9093c470 --- /dev/null +++ b/src/gui/dialogs/QuickLoadDialog.ui @@ -0,0 +1,120 @@ + + + QuickLoadDialog + + + + 0 + 0 + 458 + 546 + + + + Load resource + + + + + + + + Resource type: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + + 0 + 0 + + + + + + + + + + + + + QAbstractItemView::ScrollPerPixel + + + true + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + filterEdit + resourceListView + comboBox + buttonBox + + + + + buttonBox + accepted() + QuickLoadDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + QuickLoadDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +