00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Thomas Zander <zander@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KPTPRESOURCESPANEL_H 00021 #define KPTPRESOURCESPANEL_H 00022 00023 #include "kptresource.h" 00024 #include "ui_resourcespanelbase.h" 00025 00026 #include <QString> 00027 00028 class KCommand; 00029 00030 namespace KPlato 00031 { 00032 00033 class Project; 00034 class GroupItem; 00035 class ResourcesPanelResourceItem; 00036 class ResourcesPanelGroupLVItem; 00037 class Part; 00038 00039 class ResourcesPanelBase : public QWidget, public Ui::ResourcesPanelBase 00040 { 00041 public: 00042 ResourcesPanelBase( QWidget *parent ) : QWidget( parent ) { 00043 setupUi( this ); 00044 } 00045 }; 00046 00047 00048 class ResourcesPanel : public ResourcesPanelBase { 00049 Q_OBJECT 00050 public: 00051 ResourcesPanel (QWidget *parent, Project *project); 00052 ~ResourcesPanel(); 00053 00054 bool ok(); 00055 KCommand *buildCommand(Part *part); 00056 00057 protected slots: 00058 void slotAddGroup(); 00059 void slotDeleteGroup(); 00060 00061 void slotAddResource(); 00062 void slotEditResource(); 00063 void slotDeleteResource(); 00064 00065 void slotGroupSelectionChanged(QTreeWidgetItem *item); 00066 void slotGroupSelectionChanged(); 00067 void slotGroupChanged(QTreeWidgetItem *ci, int col); 00068 void slotResourceChanged(); 00069 void slotCurrentChanged(QListWidgetItem *curr, QListWidgetItem* prev); 00070 00071 signals: 00072 void changed(); 00073 void selectionChanged(); 00074 00075 private: 00076 Project *project; 00077 ResourcesPanelGroupLVItem *m_groupItem; 00078 00079 QList<GroupItem*> m_groupItems; 00080 QList<GroupItem*> m_deletedGroupItems; 00081 00082 bool m_blockResourceRename; 00083 }; 00084 00085 } //KPlato namespace 00086 00087 #endif // PRESOURCESPANEL_H