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;
57 bool openFiles(
const QStringList &names,
bool readWrite =
true);
75 void recentFileActivated(QAction *action);
76 void setupRecentFilesMenu();
87 void showTranslateDialog();
88 void showBatchTranslateDialog();
89 void showTranslationSettings();
90 void updateTranslateHit(
bool &hit);
91 void translate(
int mode);
93 void openPhraseBook();
94 void closePhraseBook(QAction *action);
95 void editPhraseBook(QAction *action);
96 void addToPhraseBook();
102 void fileAboutToShow();
103 void editAboutToShow();
105 void showContextDock();
106 void showMessagesDock();
107 void showPhrasesDock();
108 void showSourceCodeDock();
109 void showErrorDock();
113 bool maybeSave(
int model);
114 void updateProgress();
117 void updateCaption();
118 void updateLatestModel(
const QModelIndex &index);
119 void selectedContextChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
120 void selectedMessageChanged(
const QModelIndex &sortedIndex,
const QModelIndex &oldIndex);
121 void setCurrentMessageFromGuess(
int modelIndex,
const Candidate &tm);
124 void updateTranslation(
const QStringList &translations);
125 void updateTranslatorComment(
const QString &comment);
127 void updateActiveModel(
int);
128 void refreshItemViews();
129 void toggleFinished(
const QModelIndex &index);
130 void prevUnfinished();
131 void nextUnfinished();
133 FindDialog::FindOptions options,
int statusFilter);
135 void toggleStatistics();
136 void toggleVisualizeWhitespace();
138 void updatePhraseDicts();
139 void updatePhraseDict(
int model);
141#if QT_CONFIG(printsupport)
147 QModelIndex nextContext(
const QModelIndex &index)
const;
148 QModelIndex prevContext(
const QModelIndex &index)
const;
149 QModelIndex nextMessage(
const QModelIndex ¤tIndex,
bool checkUnfinished =
false)
const;
150 QModelIndex prevMessage(
const QModelIndex ¤tIndex,
bool checkUnfinished =
false)
const;
151 bool doNext(
bool checkUnfinished);
152 bool doPrev(
bool checkUnfinished);
155 void updateStatistics();
156 void initViewHeaders();
157 void modelCountChanged();
159 void setupToolBars();
160 void setCurrentMessage(
const QModelIndex &index);
161 void setCurrentMessage(
const QModelIndex &index,
int model);
162 QModelIndex setMessageViewRoot(
const QModelIndex &index);
163 QModelIndex currentContextIndex()
const;
164 QModelIndex currentMessageIndex()
const;
165 PhraseBook *doOpenPhraseBook(
const QString &name);
166 bool isPhraseBookOpen(
const QString &name);
167 bool savePhraseBook(QString *name,
PhraseBook &pb);
168 bool maybeSavePhraseBook(
PhraseBook *phraseBook);
169 bool maybeSavePhraseBooks();
170 QStringList pickTranslationFiles();
171 void doShowTranslationSettings(
int model);
172 void doUpdateLatestModel(
int model);
173 void updateSourceView(
int model,
MessageItem *item);
174 void updatePhraseBookActions();
175 void updatePhraseDictInternal(
int model);
176 void releaseInternal(
int model);
177 void saveInternal(
int model);
179#if QT_CONFIG(printsupport)
188 QProcess *m_assistantProcess;
189 QTreeView *m_contextView;
190 QTreeView *m_messageView;
193 QSortFilterProxyModel *m_sortedContextsModel;
194 QSortFilterProxyModel *m_sortedMessagesModel;
197 QStackedWidget *m_sourceAndFormView;
198 SourceCodeView *m_sourceCodeView;
201 QLabel *m_progressLabel;
202 QLabel *m_modifiedLabel;
204 QString m_phraseBookDir;
207 QList<PhraseBook *> m_phraseBooks;
208 QMap<QAction *, PhraseBook *> m_phraseBookMenu[3];
209#if QT_CONFIG(printsupport)
215 FindDialog::FindOptions m_findOptions;
216 int m_findStatusFilter = -1;
219 TranslateDialog *m_translateDialog;
220 QString m_latestFindText;
221 int m_latestCaseSensitivity;
222 int m_remainingCount;
228 bool m_settingCurrentMessage;
229 int m_fileActiveModel;
230 int m_editActiveModel;
233 QDockWidget *m_contextDock;
234 QDockWidget *m_messagesDock;
235 QDockWidget *m_phrasesDock;
236 QDockWidget *m_sourceAndFormDock;
237 QDockWidget *m_errorsDock;
int main(int argc, char *argv[])
[2]
void closeEvent(QCloseEvent *event) override
[21]
bool openFiles(const QStringList &names, bool readWrite=true)
static RecentFiles & recentFiles()
bool eventFilter(QObject *obj, QEvent *ev) override
Filters events if this object has been installed as an event filter for the watched object.
static QString friendlyString(const QString &str)
Combined button and popup list for selecting options.