Added ManageResourceLocationsDialog
The ManageResourceLocationsDialog class provides a dialog for adding, editing and removing resource locations.
This commit is contained in:
63
include/ManageResourceLocationsDialog.h
Normal file
63
include/ManageResourceLocationsDialog.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* ManageResourceLocationsDialog.h - header file for ManageResourceLocationsDialog
|
||||
*
|
||||
* Copyright (c) 2010 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 _MANAGE_RESOURCE_LOCATIONS_DIALOG_H
|
||||
#define _MANAGE_RESOURCE_LOCATIONS_DIALOG_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
#include "ResourceLocation.h"
|
||||
|
||||
namespace Ui { class ManageResourceLocationsDialog; }
|
||||
|
||||
/*! \brief The ManageResourceLocationsDialog class provides a dialog for adding,
|
||||
* editing and removing resource locations.
|
||||
*/
|
||||
|
||||
class ManageResourceLocationsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/*! \brief Constructs an ManageResourceLocationsDialog.
|
||||
*/
|
||||
ManageResourceLocationsDialog();
|
||||
|
||||
/*! \brief Destroys the ManageResourceLocationsDialog. */
|
||||
virtual ~ManageResourceLocationsDialog();
|
||||
|
||||
|
||||
private slots:
|
||||
void addLocation();
|
||||
void editLocation();
|
||||
void removeLocation();
|
||||
|
||||
|
||||
private:
|
||||
Ui::ManageResourceLocationsDialog * ui;
|
||||
QList<ResourceLocation> m_locations;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
82
src/gui/Dialogs/ManageResourceLocationsDialog.cpp
Normal file
82
src/gui/Dialogs/ManageResourceLocationsDialog.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* ManageResourceLocationsDialog.cpp - implementation of ManageResourceLocationsDialog
|
||||
*
|
||||
* Copyright (c) 2010 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 "ManageResourceLocationsDialog.h"
|
||||
#include "EditResourceLocationDialog.h"
|
||||
#include "MainWindow.h"
|
||||
#include "engine.h"
|
||||
|
||||
#include "ui_ManageResourceLocationsDialog.h"
|
||||
|
||||
|
||||
|
||||
ManageResourceLocationsDialog::ManageResourceLocationsDialog() :
|
||||
QDialog( engine::mainWindow() ),
|
||||
ui( new Ui::ManageResourceLocationsDialog )
|
||||
{
|
||||
ui->setupUi( this );
|
||||
|
||||
connect( ui->addLocationButton, SIGNAL( clicked() ),
|
||||
this, SLOT( addLocation() ) );
|
||||
connect( ui->editLocationButton, SIGNAL( clicked() ),
|
||||
this, SLOT( editLocation() ) );
|
||||
connect( ui->removeLocationButton, SIGNAL( clicked() ),
|
||||
this, SLOT( removeLocation() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ManageResourceLocationsDialog::~ManageResourceLocationsDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ManageResourceLocationsDialog::addLocation()
|
||||
{
|
||||
EditResourceLocationDialog editDialog;
|
||||
if( editDialog.exec() )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ManageResourceLocationsDialog::editLocation()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ManageResourceLocationsDialog::removeLocation()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_ManageResourceLocationsDialog.cxx"
|
||||
|
||||
139
src/gui/Forms/ManageResourceLocationsDialog.ui
Normal file
139
src/gui/Forms/ManageResourceLocationsDialog.ui
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ManageResourceLocationsDialog</class>
|
||||
<widget class="QDialog" name="ManageResourceLocationsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>497</width>
|
||||
<height>323</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Manage resource locations</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Resource locations</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="locationTable">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>150</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||
<number>150</number>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Address</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="addLocationButton">
|
||||
<property name="text">
|
||||
<string>Add location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="editLocationButton">
|
||||
<property name="text">
|
||||
<string>Edit selected</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeLocationButton">
|
||||
<property name="text">
|
||||
<string>Remove selected</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</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>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ManageResourceLocationsDialog</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>ManageResourceLocationsDialog</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