File indexing completed on 2024-05-12 16:23:32
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 EXPORTTAB_H 0021 #define EXPORTTAB_H 0022 0023 #include <QWidget> 0024 0025 #include <vector> 0026 0027 class QPushButton; 0028 class QGroupBox; 0029 class QTableWidget; 0030 class QLineEdit; 0031 class QLabel; 0032 class QGridLayout; 0033 class QTextEdit; 0034 class QToolBox; 0035 class QRadioButton; 0036 0037 0038 /** 0039 * The export tab in the preferences menu 0040 * @author Bjoern Erik Nilsen & Fredrik Berg Kjoelstad 0041 */ 0042 class ExportTab : public QWidget 0043 { 0044 Q_OBJECT 0045 public: 0046 /** 0047 * Sets up the tab. 0048 * @param parent the parent of the this widget 0049 */ 0050 ExportTab(QWidget *parent = 0); 0051 0052 /** 0053 * Applies the settings in the import tab. 0054 */ 0055 void apply(); 0056 0057 /** 0058 * Initializes the table and fills it with starting values. 0059 */ 0060 void initialize(); 0061 0062 void retranslateStrings(); 0063 0064 protected: 0065 void resizeEvent(QResizeEvent *event); 0066 0067 private slots: 0068 void addEncoder(); 0069 void removeEncoder(); 0070 void contentsChanged(int row, int column); 0071 void activeCellChanged(int row, int column); 0072 void editSettings(); 0073 void closeSettings(); 0074 void updateStartString(const QString &txt); 0075 void updateStopString(const QString &txt); 0076 void setDefaultOutput(const QString &txt); 0077 void setYesButtonOn(); 0078 void setNoButtonOn(); 0079 void browseFiles(); 0080 0081 private: 0082 std::vector<QString>startEncoderStrings; 0083 std::vector<QString>stopEncoderStrings; 0084 std::vector<QString>outputFiles; 0085 0086 QPushButton *addButton; 0087 QPushButton *removeButton; 0088 QPushButton *editButton; 0089 QPushButton *browseButton; 0090 QPushButton *closeButton; 0091 QRadioButton *yesButton; 0092 QRadioButton *noButton; 0093 QGroupBox *encoderPrefs; 0094 QTableWidget *encoderTable; 0095 QLineEdit *startEncoder; 0096 QLineEdit *stopEncoder; 0097 QLabel *startEncoderLabel; 0098 QLabel *stopEncoderLabel; 0099 QLineEdit *defaultOutput; 0100 QLabel *defaultOutputLabel; 0101 QLabel *askForOutput; 0102 QTextEdit *infoText; 0103 0104 void makeGUI(); 0105 }; 0106 0107 #endif