1 /** 2 * projectM-qt -- Qt4 based projectM GUI 3 * Copyright (C)2003-2004 projectM Team 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * See 'LICENSE.txt' included within this release 19 * 20 */ 21 22 #ifndef QPRESET_EDITOR_DIALOG_HPP 23 #define QPRESET_EDITOR_DIALOG_HPP 24 #include "ui_qpreseteditordialog.h" 25 class QProjectMWidget; 26 #include <QModelIndex> 27 class QPresetEditorDialog : public QDialog { 28 29 Q_OBJECT 30 31 public: 32 QPresetEditorDialog(QProjectMWidget * widget, QWidget * parent = 0, Qt::WindowFlags f = 0); 33 void setPreset(QString url, int rowIndex); 34 const QString & presetUrl() const; 35 presetIndex() const36 inline int presetIndex() const { 37 return m_index; 38 } 39 signals: 40 void presetModified(int rowIndex); 41 protected: 42 //void keyReleaseEvent(QKeyEvent * e); 43 public slots: 44 45 46 private slots: 47 void buttonBoxHandler(QAbstractButton * button); 48 void saveFile(); 49 void saveAndNotify(); 50 void updateWindowTitle(); 51 52 private: 53 int m_index; 54 void revertBuffer(); 55 QProjectMWidget * _qprojectMWidget; 56 Ui::QPresetEditorDialog _ui; 57 QString m_presetUrl; 58 59 60 61 62 }; 63 #endif 64