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 BATCHTRANSLATIONDIALOG_H |
5 | #define BATCHTRANSLATIONDIALOG_H |
6 | |
7 | #include "ui_batchtranslation.h" |
8 | #include "phrase.h" |
9 | |
10 | #include <QtWidgets/QDialog> |
11 | #include <QtGui/QStandardItemModel> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class MultiDataModel; |
16 | |
17 | class CheckableListModel : public QStandardItemModel |
18 | { |
19 | public: |
20 | CheckableListModel(QObject *parent = 0); |
21 | Qt::ItemFlags flags(const QModelIndex &index) const override; |
22 | }; |
23 | |
24 | class BatchTranslationDialog : public QDialog |
25 | { |
26 | Q_OBJECT |
27 | public: |
28 | BatchTranslationDialog(MultiDataModel *model, QWidget *w = 0); |
29 | void setPhraseBooks(const QList<PhraseBook *> &phrasebooks, int modelIndex); |
30 | |
31 | signals: |
32 | void finished(); |
33 | |
34 | private slots: |
35 | void startTranslation(); |
36 | void movePhraseBookUp(); |
37 | void movePhraseBookDown(); |
38 | |
39 | private: |
40 | Ui::BatchTranslationDialog m_ui; |
41 | CheckableListModel m_model; |
42 | MultiDataModel *m_dataModel; |
43 | QList<PhraseBook *> m_phrasebooks; |
44 | int m_modelIndex; |
45 | }; |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif // BATCHTRANSLATIONDIALOG_H |
50 | |