8#include "ui_mainwindow.h"
13#include <QtCore/private/qconfig_p.h>
15#include <QtCore/QHash>
17#include <QtCore/QLocale>
19#include <QtWidgets/QMainWindow>
30class QSortFilterProxyModel;
79 void recentFileActivated(QAction *action);
80 void setupRecentFilesMenu();
91 void showTranslateDialog();
92 void showBatchTranslateDialog();
93 void showTranslationSettings();
94 void updateTranslateHit(
bool &hit);
95 void translate(
int mode);
97 void openPhraseBook();
98 void closePhraseBook(QAction *action);
99 void editPhraseBook(QAction *action);
100 void addToPhraseBook();
106 void fileAboutToShow();
107 void editAboutToShow();
109 void showContextDock();
110 void showMessagesDock();
111 void showPhrasesDock();
112 void showSourceCodeDock();
113 void showErrorDock();
117 bool maybeSave(
int model);
118 void updateProgress();
121 void updateCaption();
122 void updateLatestModel(
const QModelIndex &index);
123 void selectedContextChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
124 void selectedLabelChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
125 void selectedMessageChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
126 void setCurrentMessageFromGuess(
int modelIndex,
const Candidate &tm);
127 void contextAndLabelTabChanged();
130 void updateTranslation(
const QStringList &translations);
131 void updateTranslatorComment(
const QString &comment);
133 void updateVisibleColumns();
134 void updateActiveModel(
int);
135 void refreshItemViews();
136 void toggleFinished(
const QModelIndex &index);
137 void openMachineTranslateDialog();
138 void prevUnfinished();
139 void nextUnfinished();
141 FindDialog::FindOptions options,
int statusFilter);
143 void showStatistics();
145 void toggleQmlPreview();
147 void toggleVisualizeWhitespace();
149 void updatePhraseDicts();
150 void updatePhraseDict(
int model);
152#if QT_CONFIG(printsupport)
160 QModelIndex nextGroup(
const QModelIndex &index)
const;
161 QModelIndex prevGroup(
const QModelIndex &index)
const;
162 QModelIndex firstMessage()
const;
163 QModelIndex nextMessage(
const QModelIndex ¤tIndex,
bool checkUnfinished =
false)
const;
164 QModelIndex prevMessage(
const QModelIndex ¤tIndex,
bool checkUnfinished =
false)
const;
165 bool doNext(
bool checkUnfinished);
166 bool doPrev(
bool checkUnfinished);
169 void updateStatistics();
170 void initViewHeaders();
171 void modelCountChanged();
173 void setupToolBars();
174 void setCurrentMessage(
const QModelIndex &index);
175 void setCurrentMessage(
const QModelIndex &index,
int model);
176 QModelIndex setMessageViewRoot(
const QModelIndex &index);
177 QModelIndex currentMessageIndex()
const;
178 PhraseBook *doOpenPhraseBook(
const QString &name);
179 bool isPhraseBookOpen(
const QString &name);
180 bool savePhraseBook(QString *name,
PhraseBook &pb);
181 bool maybeSavePhraseBook(
PhraseBook *phraseBook);
182 bool maybeSavePhraseBooks();
183 void pickTranslationFiles();
184 void doShowTranslationSettings(
int model);
185 void doUpdateLatestModel(
int model);
186 void updateSourceView(
int model,
MessageItem *item);
187 void updatePhraseBookActions();
188 void updatePhraseDictInternal(
int model);
189 void releaseInternal(
int model);
190 void saveInternal(
int model);
192#if QT_CONFIG(printsupport)
201 std::unique_ptr<HelpClient> m_helpClient;
203 QTreeView *m_contextView;
204 QTreeView *m_labelView;
205 QTreeView *m_messageView;
210 QSortFilterProxyModel *m_sortedContextsModel;
211 QSortFilterProxyModel *m_sortedLabelsModel;
212 QSortFilterProxyModel *m_activeSortedGroupsModel;
213 QSortFilterProxyModel *m_sortedIdBasedMessagesModel;
214 QSortFilterProxyModel *m_sortedTextBasedMessagesModel;
215 QSortFilterProxyModel *m_activeSortedMessagesModel;
218 QStackedWidget *m_sourceAndFormView;
219 QTabWidget *m_contextAndLabelView;
220 SourceCodeView *m_sourceCodeView;
226 QLabel *m_progressLabel;
227 QLabel *m_modifiedLabel;
229 QString m_phraseBookDir;
232 QList<PhraseBook *> m_phraseBooks;
233 QMap<QAction *, PhraseBook *> m_phraseBookMenu[3];
234#if QT_CONFIG(printsupport)
240 FindDialog::FindOptions m_findOptions;
241 int m_findStatusFilter = -1;
244 TranslateDialog *m_translateDialog;
245 QString m_latestFindText;
246 int m_latestCaseSensitivity;
247 QModelIndex m_searchIndex;
253 bool m_settingCurrentMessage;
254 std::optional<TranslationType> m_activeTranslationType;
255 int m_fileActiveModel;
256 int m_editActiveModel;
258 QDockWidget *m_contextAndLabelDock;
259 QDockWidget *m_messagesDock;
260 QDockWidget *m_phrasesDock;
261 QDockWidget *m_sourceAndFormDock;
262 QDockWidget *m_errorsDock;
266 RecentFiles m_recentFiles;
268 bool m_globalReadWrite =
true;
MainWindow(HelpClientType helpClientType)
static QString description()
void closeEvent(QCloseEvent *e) override
This event handler is called with the given event when Qt receives a window close request for a top-l...
bool openFiles(const QStringList &names)
bool eventFilter(QObject *obj, QEvent *ev) override
Filters events if this object has been installed as an event filter for the watched object.
Combined button and popup list for selecting options.
int main(int argc, char *argv[])
[ctor_close]