1 /*************************************************************************** 2 * Copyright (C) 2005 by Joshua Keel <joshuakeel@gmail.com> * 3 * (C) 2007 by Jeremy Whiting <jpwhiting@kde.org> * 4 * * 5 * This program is free software; you can redistribute it and/or modify * 6 * it under the terms of the GNU General Public License as published by * 7 * the Free Software Foundation; either version 2 of the License, or * 8 * (at your option) any later version. * 9 * * 10 * This program 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 * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU General Public License * 16 * along with this program; if not, write to the * 17 * Free Software Foundation, Inc., * 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 19 ***************************************************************************/ 20 21 #ifndef VOCABSETTINGS_H 22 #define VOCABSETTINGS_H 23 24 #include "ui_vocabsettingswidget.h" 25 26 27 /** @brief Vocabulary Settings class 28 * @author Joshua Keel <joshuakeel@gmail.com> 29 * 30 * Settings page to choose vocabularies, and buttons to invoke the vocabulary editor 31 */ 32 class VocabSettings : public QWidget, public Ui::VocabSettingsWidget 33 { 34 Q_OBJECT 35 public: 36 /** default constructor */ 37 explicit VocabSettings(QWidget *parent); 38 39 /** default destructor */ 40 virtual ~VocabSettings(); 41 42 signals: 43 44 /** signifies the widget has been changed */ 45 void widgetModified(); 46 47 private slots: 48 49 /** create a new vocabulary 50 * called when the btnCreateNew is clicked 51 */ 52 void on_btnCreateNew_clicked(); 53 void on_btnDownloadNew_clicked(); 54 void on_btnEdit_clicked(); 55 void slotSelectionChanged(QTreeWidgetItem *item); 56 57 /** reload the list of vocabularies from what's on disk 58 * and emit widgetModified 59 */ 60 void refreshView(); 61 62 private: 63 64 /** load the list of vocabularies from what's on disk */ 65 void loadView(); 66 67 /** list of vocabulary files */ 68 QStringList m_fileList; 69 70 /** list of document titles */ 71 QStringList m_titleList; 72 73 /** list of document comments */ 74 QStringList m_commentList; 75 76 QMap<const QTreeWidgetItem*, int> m_itemMap; 77 }; 78 79 #endif 80 81