1bb02e0acSNicolas Bonnefon /* 2bb02e0acSNicolas Bonnefon * Copyright (C) 2009, 2010, 2013 Nicolas Bonnefon and other contributors 3bb02e0acSNicolas Bonnefon * 4bb02e0acSNicolas Bonnefon * This file is part of glogg. 5bb02e0acSNicolas Bonnefon * 6bb02e0acSNicolas Bonnefon * glogg is free software: you can redistribute it and/or modify 7bb02e0acSNicolas Bonnefon * it under the terms of the GNU General Public License as published by 8bb02e0acSNicolas Bonnefon * the Free Software Foundation, either version 3 of the License, or 9bb02e0acSNicolas Bonnefon * (at your option) any later version. 10bb02e0acSNicolas Bonnefon * 11bb02e0acSNicolas Bonnefon * glogg is distributed in the hope that it will be useful, 12bb02e0acSNicolas Bonnefon * but WITHOUT ANY WARRANTY; without even the implied warranty of 13bb02e0acSNicolas Bonnefon * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14bb02e0acSNicolas Bonnefon * GNU General Public License for more details. 15bb02e0acSNicolas Bonnefon * 16bb02e0acSNicolas Bonnefon * You should have received a copy of the GNU General Public License 17bb02e0acSNicolas Bonnefon * along with glogg. If not, see <http://www.gnu.org/licenses/>. 18bb02e0acSNicolas Bonnefon */ 19bb02e0acSNicolas Bonnefon 20bb02e0acSNicolas Bonnefon #ifndef OPTIONSDIALOG_H 21bb02e0acSNicolas Bonnefon #define OPTIONSDIALOG_H 22bb02e0acSNicolas Bonnefon 23bb02e0acSNicolas Bonnefon #include <QDialog> 24bb02e0acSNicolas Bonnefon 25bb02e0acSNicolas Bonnefon #include "configuration.h" 26bb02e0acSNicolas Bonnefon 27bb02e0acSNicolas Bonnefon #include "ui_optionsdialog.h" 28bb02e0acSNicolas Bonnefon 29bb02e0acSNicolas Bonnefon // Implements the main option dialog box 30bb02e0acSNicolas Bonnefon class OptionsDialog : public QDialog, public Ui::OptionsDialog 31bb02e0acSNicolas Bonnefon { 32bb02e0acSNicolas Bonnefon Q_OBJECT 33bb02e0acSNicolas Bonnefon 34bb02e0acSNicolas Bonnefon public: 35bb02e0acSNicolas Bonnefon OptionsDialog(QWidget* parent = 0); 36bb02e0acSNicolas Bonnefon 37bb02e0acSNicolas Bonnefon signals: 38bb02e0acSNicolas Bonnefon // Is emitted when new settings must be used 39bb02e0acSNicolas Bonnefon void optionsChanged(); 40bb02e0acSNicolas Bonnefon 41bb02e0acSNicolas Bonnefon private slots: 42bb02e0acSNicolas Bonnefon // Clears and updates the font size box with the sizes allowed 43bb02e0acSNicolas Bonnefon // by the passed font family. 44bb02e0acSNicolas Bonnefon void updateFontSize(const QString& fontFamily); 45bb02e0acSNicolas Bonnefon // Update the content of the global Config() using parameters 46bb02e0acSNicolas Bonnefon // from the dialog box. 47bb02e0acSNicolas Bonnefon void updateConfigFromDialog(); 48bb02e0acSNicolas Bonnefon // Called when a ok/cancel/apply button is clicked. 49bb02e0acSNicolas Bonnefon void onButtonBoxClicked( QAbstractButton* button ); 50bb02e0acSNicolas Bonnefon // Called when the 'incremental' button is toggled. 51bb02e0acSNicolas Bonnefon void onIncrementalChanged(); 52*80bca0a3SNicolas Bonnefon // Called when the 'polling' checkbox is toggled. 53*80bca0a3SNicolas Bonnefon void onPollingChanged(); 54bb02e0acSNicolas Bonnefon 55bb02e0acSNicolas Bonnefon private: 56*80bca0a3SNicolas Bonnefon void setupTabs(); 57bb02e0acSNicolas Bonnefon void setupFontList(); 58bb02e0acSNicolas Bonnefon void setupRegexp(); 59bb02e0acSNicolas Bonnefon void setupIncremental(); 60*80bca0a3SNicolas Bonnefon void setupPolling(); 61bb02e0acSNicolas Bonnefon 62bb02e0acSNicolas Bonnefon int getRegexpIndex( SearchRegexpType syntax ) const; 63bb02e0acSNicolas Bonnefon SearchRegexpType getRegexpTypeFromIndex( int index ) const; 64bb02e0acSNicolas Bonnefon 65bb02e0acSNicolas Bonnefon void updateDialogFromConfig(); 66*80bca0a3SNicolas Bonnefon 67*80bca0a3SNicolas Bonnefon QValidator* polling_interval_validator_; 68bb02e0acSNicolas Bonnefon }; 69bb02e0acSNicolas Bonnefon 70bb02e0acSNicolas Bonnefon #endif 71