Added new DirectorySelectDialog
DirectorySelectDialog is another subclass of ResourceSelectDialog, allowing to pick a certain directory via a tree view and a filter line edit.
This commit is contained in:
46
include/DirectorySelectDialog.h
Normal file
46
include/DirectorySelectDialog.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* DirectorySelectDialog.h - header file for DirectorySelectDialog
|
||||
*
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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 _DIRECTORY_SELECT_DIALOG_H
|
||||
#define _DIRECTORY_SELECT_DIALOG_H
|
||||
|
||||
#include "ResourceSelectDialog.h"
|
||||
|
||||
namespace Ui { class DirectorySelectDialog; }
|
||||
|
||||
class DirectorySelectDialog : public ResourceSelectDialog
|
||||
{
|
||||
public:
|
||||
DirectorySelectDialog( QWidget * _parent,
|
||||
DatabaseScope _databaseScope = AllResources );
|
||||
~DirectorySelectDialog();
|
||||
|
||||
|
||||
private:
|
||||
Ui::DirectorySelectDialog * ui;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
50
src/gui/DirectorySelectDialog.cpp
Normal file
50
src/gui/DirectorySelectDialog.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* DirectorySelectDialog.cpp - implementation of DirectorySelectDialog
|
||||
*
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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 "DirectorySelectDialog.h"
|
||||
|
||||
#include "ui_DirectorySelectDialog.h"
|
||||
|
||||
|
||||
DirectorySelectDialog::DirectorySelectDialog( QWidget * _parent,
|
||||
DatabaseScope _databaseScope ) :
|
||||
ResourceSelectDialog( _parent, ResourceSelectDialog::TreeModel,
|
||||
_databaseScope ),
|
||||
ui( new Ui::DirectorySelectDialog )
|
||||
{
|
||||
// setup form
|
||||
ui->setupUi( this );
|
||||
|
||||
// setup ResourceSelectDialog
|
||||
setupUi();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DirectorySelectDialog::~DirectorySelectDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
89
src/gui/Forms/DirectorySelectDialog.ui
Normal file
89
src/gui/Forms/DirectorySelectDialog.ui
Normal file
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DirectorySelectDialog</class>
|
||||
<widget class="QDialog" name="DirectorySelectDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>465</width>
|
||||
<height>546</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Select directory</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="filterEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ResourceTreeView" name="resourceTreeView">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
<property name="headerHidden">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ResourceTreeView</class>
|
||||
<extends>QTreeView</extends>
|
||||
<header>ResourceTreeView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>filterEdit</tabstop>
|
||||
<tabstop>resourceTreeView</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DirectorySelectDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DirectorySelectDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user