From 654420d5f57536296b64f997250a43dac1d1f9aa Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 8 Oct 2010 13:36:11 +0200 Subject: [PATCH] Added ManageResourceLocationsDialog The ManageResourceLocationsDialog class provides a dialog for adding, editing and removing resource locations. --- include/ManageResourceLocationsDialog.h | 63 ++++++++ .../Dialogs/ManageResourceLocationsDialog.cpp | 82 +++++++++++ .../Forms/ManageResourceLocationsDialog.ui | 139 ++++++++++++++++++ 3 files changed, 284 insertions(+) create mode 100644 include/ManageResourceLocationsDialog.h create mode 100644 src/gui/Dialogs/ManageResourceLocationsDialog.cpp create mode 100644 src/gui/Forms/ManageResourceLocationsDialog.ui diff --git a/include/ManageResourceLocationsDialog.h b/include/ManageResourceLocationsDialog.h new file mode 100644 index 000000000..1cd6d35ea --- /dev/null +++ b/include/ManageResourceLocationsDialog.h @@ -0,0 +1,63 @@ +/* + * ManageResourceLocationsDialog.h - header file for ManageResourceLocationsDialog + * + * Copyright (c) 2010 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 _MANAGE_RESOURCE_LOCATIONS_DIALOG_H +#define _MANAGE_RESOURCE_LOCATIONS_DIALOG_H + +#include + +#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 m_locations; + +} ; + + +#endif diff --git a/src/gui/Dialogs/ManageResourceLocationsDialog.cpp b/src/gui/Dialogs/ManageResourceLocationsDialog.cpp new file mode 100644 index 000000000..8a8d10d2e --- /dev/null +++ b/src/gui/Dialogs/ManageResourceLocationsDialog.cpp @@ -0,0 +1,82 @@ +/* + * ManageResourceLocationsDialog.cpp - implementation of ManageResourceLocationsDialog + * + * Copyright (c) 2010 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 "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" + diff --git a/src/gui/Forms/ManageResourceLocationsDialog.ui b/src/gui/Forms/ManageResourceLocationsDialog.ui new file mode 100644 index 000000000..242c99c07 --- /dev/null +++ b/src/gui/Forms/ManageResourceLocationsDialog.ui @@ -0,0 +1,139 @@ + + + ManageResourceLocationsDialog + + + + 0 + 0 + 497 + 323 + + + + Manage resource locations + + + + + + Resource locations + + + + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + false + + + 150 + + + 150 + + + + Name + + + + + Type + + + + + Address + + + + + + + + + + Add location + + + + + + + Edit selected + + + + + + + Remove selected + + + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ManageResourceLocationsDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ManageResourceLocationsDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +