1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef PHRASEBOOKBOX_H |
5 | #define PHRASEBOOKBOX_H |
6 | |
7 | #include "ui_phrasebookbox.h" |
8 | #include "phrase.h" |
9 | #include "phrasemodel.h" |
10 | #include <QDialog> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | class TranslationSettingsDialog; |
15 | |
16 | class QSortFilterProxyModel; |
17 | |
18 | class PhraseBookBox : public QDialog, public Ui::PhraseBookBox |
19 | { |
20 | Q_OBJECT |
21 | public: |
22 | PhraseBookBox(PhraseBook *phraseBook, QWidget *parent = 0); |
23 | |
24 | protected: |
25 | bool eventFilter(QObject *obj, QEvent *event) override; |
26 | |
27 | private slots: |
28 | void newPhrase(); |
29 | void removePhrase(); |
30 | void settings(); |
31 | void save(); |
32 | void sourceChanged(const QString &source); |
33 | void targetChanged(const QString &target); |
34 | void definitionChanged(const QString &definition); |
35 | void selectionChanged(); |
36 | |
37 | private: |
38 | void selectItem(const QModelIndex &index); |
39 | void enableDisable(); |
40 | QModelIndex currentPhraseIndex() const; |
41 | |
42 | QString fn; |
43 | PhraseBook *m_phraseBook; |
44 | PhraseModel *phrMdl; |
45 | QSortFilterProxyModel *m_sortedPhraseModel; |
46 | TranslationSettingsDialog *m_translationSettingsDialog; |
47 | }; |
48 | |
49 | QT_END_NAMESPACE |
50 | |
51 | #endif |
52 |