8#include "ui_mainwindow.h"
13#include <QtCore/private/qconfig_p.h>
15#include <QtCore/QHash>
17#include <QtCore/QLocale>
19#include <QtWidgets/QMainWindow>
31class QSortFilterProxyModel;
73 void recentFileActivated(QAction *action);
74 void setupRecentFilesMenu();
85 void showTranslateDialog();
86 void showBatchTranslateDialog();
87 void showTranslationSettings();
88 void updateTranslateHit(
bool &hit);
89 void translate(
int mode);
91 void openPhraseBook();
92 void closePhraseBook(QAction *action);
93 void editPhraseBook(QAction *action);
94 void addToPhraseBook();
100 void fileAboutToShow();
101 void editAboutToShow();
103 void showContextDock();
104 void showMessagesDock();
105 void showPhrasesDock();
106 void showSourceCodeDock();
107 void showErrorDock();
111 bool maybeSave(
int model);
112 void updateProgress();
115 void updateCaption();
116 void updateLatestModel(
const QModelIndex &index);
117 void selectedContextChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
118 void selectedLabelChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
119 void selectedMessageChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
120 void setCurrentMessageFromGuess(
int modelIndex,
const Candidate &tm);
121 void contextAndLabelTabChanged();
124 void updateTranslation(
const QStringList &translations);
125 void updateTranslatorComment(
const QString &comment);
127 void updateVisibleColumns();
128 void updateActiveModel(
int);
129 void refreshItemViews();
130 void toggleFinished(
const QModelIndex &index);
131 void openMachineTranslateDialog();
132 void prevUnfinished();
133 void nextUnfinished();
135 FindDialog::FindOptions options,
int statusFilter);
137 void showStatistics();
138 void toggleQmlPreview();
139 void toggleVisualizeWhitespace();
141 void updatePhraseDicts();
142 void updatePhraseDict(
int model);
144#if QT_CONFIG(printsupport)
152 QModelIndex nextGroup(
const QModelIndex &index)
const;
153 QModelIndex prevGroup(
const QModelIndex &index)
const;
154 QModelIndex firstMessage()
const;
155 QModelIndex nextMessage(
const QModelIndex ¤tIndex,
bool checkUnfinished =
false)
const;
156 QModelIndex prevMessage(
const QModelIndex ¤tIndex,
bool checkUnfinished =
false)
const;
157 bool doNext(
bool checkUnfinished);
158 bool doPrev(
bool checkUnfinished);
161 void updateStatistics();
162 void initViewHeaders();
163 void modelCountChanged();
165 void setupToolBars();
166 void setCurrentMessage(
const QModelIndex &index);
167 void setCurrentMessage(
const QModelIndex &index,
int model);
168 QModelIndex setMessageViewRoot(
const QModelIndex &index);
169 QModelIndex currentMessageIndex()
const;
170 PhraseBook *doOpenPhraseBook(
const QString &name);
171 bool isPhraseBookOpen(
const QString &name);
172 bool savePhraseBook(QString *name,
PhraseBook &pb);
173 bool maybeSavePhraseBook(
PhraseBook *phraseBook);
174 bool maybeSavePhraseBooks();
175 void pickTranslationFiles();
176 void doShowTranslationSettings(
int model);
177 void doUpdateLatestModel(
int model);
178 void updateSourceView(
int model,
MessageItem *item);
179 void updatePhraseBookActions();
180 void updatePhraseDictInternal(
int model);
181 void releaseInternal(
int model);
182 void saveInternal(
int model);
184#if QT_CONFIG(printsupport)
193#if QT_CONFIG(process)
196 QTreeView *m_contextView;
197 QTreeView *m_labelView;
198 QTreeView *m_messageView;
203 QSortFilterProxyModel *m_sortedContextsModel;
204 QSortFilterProxyModel *m_sortedLabelsModel;
205 QSortFilterProxyModel *m_activeSortedGroupsModel;
206 QSortFilterProxyModel *m_sortedIdBasedMessagesModel;
207 QSortFilterProxyModel *m_sortedTextBasedMessagesModel;
208 QSortFilterProxyModel *m_activeSortedMessagesModel;
211 QStackedWidget *m_sourceAndFormView;
212 QTabWidget *m_contextAndLabelView;
213 SourceCodeView *m_sourceCodeView;
217 QLabel *m_progressLabel;
218 QLabel *m_modifiedLabel;
220 QString m_phraseBookDir;
223 QList<PhraseBook *> m_phraseBooks;
224 QMap<QAction *, PhraseBook *> m_phraseBookMenu[3];
225#if QT_CONFIG(printsupport)
231 FindDialog::FindOptions m_findOptions;
232 int m_findStatusFilter = -1;
235 TranslateDialog *m_translateDialog;
236 QString m_latestFindText;
237 int m_latestCaseSensitivity;
238 QModelIndex m_searchIndex;
244 bool m_settingCurrentMessage;
245 std::optional<TranslationType> m_activeTranslationType;
246 int m_fileActiveModel;
247 int m_editActiveModel;
249 QDockWidget *m_contextAndLabelDock;
250 QDockWidget *m_messagesDock;
251 QDockWidget *m_phrasesDock;
252 QDockWidget *m_sourceAndFormDock;
253 QDockWidget *m_errorsDock;
257 RecentFiles m_recentFiles;
259 bool m_globalReadWrite =
true;
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.
int main(int argc, char *argv[])
[ctor_close]