Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/dialogs/loaddialog.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  * Copyright (C) 2014 Guilherme Brondani Torri <guitorri@gmail.com>        *
00003  *                                                                         *
00004  * Modified from SaveDialog and LibraryDialog                              *
00005  *                                                                         *
00006  * This is free software; you can redistribute it and/or modify            *
00007  * it under the terms of the GNU General Public License as published by    *
00008  * the Free Software Foundation; either version 2, or (at your option)     *
00009  * any later version.                                                      *
00010  *                                                                         *
00011  * This software is distributed in the hope that it will be useful,        *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
00014  * GNU General Public License for more details.                            *
00015  *                                                                         *
00016  * You should have received a copy of the GNU General Public License       *
00017  * along with this package; see the file COPYING.  If not, write to        *
00018  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,   *
00019  * Boston, MA 02110-1301, USA.                                             *
00020  ***************************************************************************/
00021 
00022 #ifndef LOADDIALOG_H
00023 #define LOADDIALOG_H
00024 
00025 #include <QVariant>
00026 #include <QDialog>
00027 #include <QMap>
00028 #include <QBoxLayout>
00029 #include <QGridLayout>
00030 #include <QBoxLayout>
00031 #include <QLabel>
00032 #include <QCheckBox>
00033 #include <QDir>
00034 
00035 class QBoxLayout;
00036 class QBoxLayout;
00037 class QGridLayout;
00038 class QSpacerItem;
00039 class QLabel;
00040 class QListWidget;
00041 class QListWidgetItem;
00042 class QPushButton;
00043 class QucsDoc;
00044 class QucsApp;
00045 
00046 class LoadDialog : public QDialog
00047 {
00048     Q_OBJECT
00049 public:
00050 
00051     enum {
00052         AbortClosing = 0,
00053         DontSave,
00054         Accept
00055     };
00056 
00057     LoadDialog(QWidget* p = 0, const char* n = 0, bool modal = true, Qt::WFlags fl = 0 );
00058     ~LoadDialog();
00059     void setApp(QucsApp *a);
00060     void initDialog();
00061 
00062     QStringList symbolFiles;
00063     QDir projDir;
00064 
00065     QMap<QString, QString> selectedComponents;
00066 
00067 private slots:
00068     void slotSelectAll();
00069     void slotSelectNone();
00070     void slotSymbolFileClicked(QListWidgetItem *item);
00071 
00072 protected slots:
00073     void reject();
00074     void loadSelected();
00075     void slotChangeIcon();
00076 
00077 protected:
00078     bool eventFilter(QObject *obj, QEvent *event);
00079 
00080 private:
00081     QLabel *iconPixmap;
00082     QLabel* label;
00083     QListWidget* fileView;
00084     QBoxLayout* LoadDialogLayout;
00085     QHBoxLayout* buttonsLayout;
00086     QSpacerItem* spacer;
00087     QucsApp *app;
00088 
00089     QPushButton *ButtOk, *ButtCancel,
00090                 *ButtSelectAll, *ButtSelectNone,
00091                 *ButtChangeIcon;
00092 };
00093 
00094 #endif // LOADDIALOG_H
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines