File indexing completed on 2024-05-12 16:23:33
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2008 by Bjoern Erik Nilsen & Fredrik Berg Kjoelstad* 0003 * bjoern.nilsen@bjoernen.com & fredrikbk@hotmail.com * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the * 0017 * Free Software Foundation, Inc., * 0018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 0019 ***************************************************************************/ 0020 #ifndef IMPORTTAB_H 0021 #define IMPORTTAB_H 0022 0023 #include <QTableWidget> 0024 #include <QLineEdit> 0025 #include <QPushButton> 0026 #include <QGroupBox> 0027 #include <QLabel> 0028 #include <QGridLayout> 0029 #include <QWidget> 0030 #include <QTextEdit> 0031 0032 #include <vector> 0033 0034 using namespace std; 0035 0036 0037 /** 0038 * The import tab in the preferences menu. 0039 * 0040 * @author Bjoern Erik Nilsen & Fredrik Berg Kjoelstad 0041 */ 0042 class ImportTab : public QWidget 0043 { 0044 Q_OBJECT 0045 public: 0046 /** 0047 * Sets up the import tab. 0048 * @param parent the parent of the widget. 0049 */ 0050 ImportTab( QWidget *parent = 0 ); 0051 0052 /** 0053 * Sets up the gui for the tab and connects the buttons. 0054 */ 0055 void makeGUI(); 0056 0057 /** 0058 * Initializes the table and fills it with starting values. 0059 */ 0060 void initializeImportValues(); 0061 0062 /** 0063 * Applies the settings in the import tab. 0064 */ 0065 void apply(); 0066 0067 void retranslateStrings(); 0068 0069 protected: 0070 void resizeEvent(QResizeEvent *event); 0071 0072 private slots: 0073 void addImportProgram(); 0074 void removeImportProgram(); 0075 void contentsChanged(int row, int column); 0076 void activeCellChanged(int row, int column); 0077 void changeSettings(); 0078 void closeChangeBox(); 0079 void updatePrePollString(const QString &txt); 0080 void updateStartDaemonString(const QString &txt); 0081 void updatestopDaemonString(const QString &txt); 0082 0083 private: 0084 vector<QString>prePollStrings; 0085 vector<QString>startDaemonStrings; 0086 vector<QString>stopDaemonStrings; 0087 0088 QTableWidget *deviceSelectionTable; 0089 QPushButton *addButton; 0090 QPushButton *removeButton; 0091 QPushButton *changeButton; 0092 QPushButton *closeChangeBoxButton; 0093 QLineEdit *prePollEdit; 0094 QLineEdit *startDaemonEdit; 0095 QLineEdit *stopDaemonEdit; 0096 QGroupBox *grabberPreferences; 0097 QLabel *prePollLabel; 0098 QLabel *startDaemonLabel; 0099 QLabel *stopDaemonLabel; 0100 QTableWidgetItem *checkTableItem; 0101 QTextEdit *informationText; 0102 }; 0103 0104 #endif