settingsdialog.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*****************************************************************************
  2. * settingsdialog.h - QStarDict, a dictionary for learning foreign languages *
  3. * Copyright (C) 2007-2023 Alexander Rodin *
  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 along *
  16. * with this program; if not, write to the Free Software Foundation, Inc., *
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
  18. *****************************************************************************/
  19. #ifndef SETTINGSDIALOG_H
  20. #define SETTINGSDIALOG_H
  21. #include <QDialog>
  22. #include "ui_settingsdialog.h"
  23. #include "dictcore.h"
  24. class QStandardItemModel;
  25. class QStandardItem;
  26. class QTimer;
  27. namespace QStarDict
  28. {
  29. class MainWindow;
  30. class PluginsModel;
  31. /**
  32. * The settings dialog.
  33. */
  34. class SettingsDialog: public QDialog, private Ui::SettingsDialog
  35. {
  36. Q_OBJECT
  37. public:
  38. /**
  39. * Construct new SettingsDialog widget with parent MainWindow.
  40. */
  41. SettingsDialog(QWidget *parent = 0);
  42. void accept();
  43. void reject();
  44. private slots:
  45. void on_dictsMoveUpButton_clicked();
  46. void on_dictsMoveDownButton_clicked();
  47. void on_dictsShowInfoButton_clicked();
  48. void on_dictsAddButton_clicked();
  49. void on_dictsRemoveButton_clicked();
  50. void loadDictsList();
  51. void dictLoadedPluginsChanged();
  52. void pluginClicked(const QModelIndex &index);
  53. void dictSelected();
  54. private:
  55. QStringList m_oldPlugins;
  56. QList<DictCore::Dictionary> m_oldDicts;
  57. QStandardItemModel *m_dictsModel;
  58. QTimer *m_dictsTimer;
  59. PluginsModel *m_dictPluginsModel;
  60. PluginsModel *m_miscPluginsModel;
  61. };
  62. }
  63. #endif // SETTINGSDIALOG_H
  64. // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent textwidth=120 formatoptions=tc