Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/dialogs/savedialog.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  * Copyright (C) 2006 by Gopala Krishna A <krishna.ggk@gmail.com>          *
00003  *                                                                         *
00004  * This is free software; you can redistribute it and/or modify            *
00005  * it under the terms of the GNU General Public License as published by    *
00006  * the Free Software Foundation; either version 2, or (at your option)     *
00007  * any later version.                                                      *
00008  *                                                                         *
00009  * This software 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           *
00012  * GNU General Public License for more details.                            *
00013  *                                                                         *
00014  * You should have received a copy of the GNU General Public License       *
00015  * along with this package; see the file COPYING.  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 SAVEDIALOG_H
00021 #define SAVEDIALOG_H
00022 
00023 #include <QVariant>
00024 #include <QDialog>
00025 #include <QMap>
00026 #include <QBoxLayout>
00027 #include <QGridLayout>
00028 #include <QBoxLayout>
00029 #include <QLabel>
00030 #include <QCheckBox>
00031 
00032 class QBoxLayout;
00033 class QBoxLayout;
00034 class QGridLayout;
00035 class QSpacerItem;
00036 class QLabel;
00037 class QListWidget;
00038 class QListWidgetItem;
00039 class QPushButton;
00040 class QucsDoc;
00041 class QucsApp;
00042 
00043 class SaveDialog : public QDialog
00044 {
00045    Q_OBJECT
00046    public:
00047       enum {
00048          AbortClosing = 0,
00049          DontSave,
00050          SaveSelected
00051       };
00052             
00053       SaveDialog(QWidget* p = 0, const char* n = 0, bool modal = true, Qt::WFlags fl = 0 );
00054       ~SaveDialog();
00055       void addUnsavedDoc(QucsDoc *doc);
00056       void setApp(QucsApp *a);
00057       bool isEmpty() const;
00058            
00059    protected slots:
00060       void dontSaveClicked();
00061       void saveSelectedClicked();
00062       void reject();
00063       
00064    private:
00065       void initDialog();
00066       
00067       QMap<QucsDoc*,QListWidgetItem*> unsavedDocs;
00068             
00069       QLabel* label;
00070       QListWidget* fileView;
00071       QPushButton* abortClosingButton;
00072       QPushButton* dontSaveButton;
00073       QPushButton* saveSelectedButton;
00074       QBoxLayout* SaveDialogLayout;
00075       QHBoxLayout* buttonsLayout;
00076       QSpacerItem* spacer;
00077       QucsApp *app;
00078 };
00079 
00080 #endif // SAVEDIALOG_H
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines