Added ManageResourceLocationsDialog

The ManageResourceLocationsDialog class provides a dialog for adding,
editing and removing resource locations.
This commit is contained in:
Tobias Doerffel
2010-10-08 13:36:11 +02:00
parent 903cf1f1e5
commit 654420d5f5
3 changed files with 284 additions and 0 deletions

View 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"

View 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>