|
| 1 | +--- a/src/linguist/CMakeLists.txt |
| 2 | ++++ b/src/linguist/CMakeLists.txt |
| 3 | +@@ -16,7 +16,7 @@ add_subdirectory(lupdate) |
| 4 | + add_subdirectory(lupdate-pro) |
| 5 | + if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton |
| 6 | + AND QT_FEATURE_png AND QT_FEATURE_mdiarea AND QT_FEATURE_syntaxhighlighter |
| 7 | +- AND TARGET Qt::Widgets AND TARGET Qt::Quick) |
| 8 | ++ AND TARGET Qt::Widgets) |
| 9 | + add_subdirectory(linguist) |
| 10 | + endif() |
| 11 | + |
| 12 | +--- a/src/linguist/linguist/CMakeLists.txt |
| 13 | ++++ b/src/linguist/linguist/CMakeLists.txt |
| 14 | +@@ -22,7 +22,6 @@ qt_internal_add_app(linguist |
| 15 | + errorsview.cpp errorsview.h |
| 16 | + finddialog.cpp finddialog.h finddialog.ui |
| 17 | + uiformpreviewview.cpp uiformpreviewview.h |
| 18 | +- qmlformpreviewview.h qmlformpreviewview.cpp |
| 19 | + globals.cpp globals.h |
| 20 | + main.cpp |
| 21 | + mainwindow.cpp mainwindow.h mainwindow.ui |
| 22 | +@@ -53,8 +52,6 @@ qt_internal_add_app(linguist |
| 23 | + Qt::GuiPrivate |
| 24 | + Qt::UiToolsPrivate |
| 25 | + Qt::Widgets |
| 26 | +- Qt::QuickWidgets |
| 27 | +- Qt::QuickLayouts |
| 28 | + ) |
| 29 | + |
| 30 | + qt_internal_extend_target(linguist CONDITION QT_FEATURE_printsupport |
| 31 | +@@ -66,46 +63,6 @@ qt_internal_extend_target(linguist CONDITION QT_FEATURE_printsupport |
| 32 | + |
| 33 | + set(available_plugins "") |
| 34 | + |
| 35 | +-set(plugin_targets |
| 36 | +- Qt::qtquickcontrols2plugin |
| 37 | +- Qt::qtquick2plugin |
| 38 | +- Qt::qtquickdialogsplugin |
| 39 | +- Qt::qtquickcontrols2universalstyleplugin |
| 40 | +- Qt::qtquickcontrols2basicstyleplugin |
| 41 | +- Qt::qtquickcontrols2fluentwinui3styleplugin |
| 42 | +- Qt::qtquickcontrols2fusionstyleplugin |
| 43 | +- Qt::qtquickcontrols2imaginestyleplugin |
| 44 | +- Qt::qtquickcontrols2iosstyleplugin |
| 45 | +- Qt::qtquickcontrols2macosstyleplugin |
| 46 | +- Qt::qtquickcontrols2materialstyleplugin |
| 47 | +- Qt::qtquicktemplates2plugin |
| 48 | +- Qt::qtquickcontrols2implplugin |
| 49 | +- Qt::qtquickdialogs2quickimplplugin |
| 50 | +- Qt::qtquickcontrols2universalstyleimplplugin |
| 51 | +- Qt::qtquickcontrols2basicstyleimplplugin |
| 52 | +- Qt::qtquickcontrols2fluentwinui3styleimplplugin |
| 53 | +- Qt::qtquickcontrols2fusionstyleimplplugin |
| 54 | +- Qt::qtquickcontrols2imaginestyleimplplugin |
| 55 | +- Qt::qtquickcontrols2iosstyleimplplugin |
| 56 | +- Qt::qtquickcontrols2macosstyleimplplugin |
| 57 | +- Qt::qtquickcontrols2materialstyleimplplugin |
| 58 | +- Qt::quickwindow |
| 59 | +-) |
| 60 | +- |
| 61 | +-foreach(plugin ${plugin_targets}) |
| 62 | +- if(TARGET ${plugin}) |
| 63 | +- list(APPEND available_plugins ${plugin}) |
| 64 | +- endif() |
| 65 | +-endforeach() |
| 66 | +- |
| 67 | +-if (available_plugins) |
| 68 | +- if(BUILD_SHARED_LIBS) |
| 69 | +- add_dependencies(linguist ${available_plugins}) |
| 70 | +- else() |
| 71 | +- qt_internal_extend_target(linguist LIBRARIES ${available_plugins}) |
| 72 | +- endif() |
| 73 | +-endif() |
| 74 | +- |
| 75 | + qt_add_ui(linguist |
| 76 | + SOURCES |
| 77 | + batchtranslation.ui |
| 78 | +--- a/src/linguist/linguist/mainwindow.cpp |
| 79 | ++++ b/src/linguist/linguist/mainwindow.cpp |
| 80 | +@@ -12,7 +12,6 @@ |
| 81 | + #include "errorsview.h" |
| 82 | + #include "finddialog.h" |
| 83 | + #include "uiformpreviewview.h" |
| 84 | +-#include "qmlformpreviewview.h" |
| 85 | + #include "globals.h" |
| 86 | + #include "messageeditor.h" |
| 87 | + #include "messagemodel.h" |
| 88 | +@@ -79,11 +78,6 @@ static bool hasUiFormPreview(const QString &fileName) |
| 89 | + return fileName.endsWith(".ui"_L1) || fileName.endsWith(".jui"_L1); |
| 90 | + } |
| 91 | + |
| 92 | +-static bool hasQmlFormPreview(const QString &fileName, bool qmlPreviewChecked) |
| 93 | +-{ |
| 94 | +- return fileName.endsWith(QLatin1String(".qml")) && qmlPreviewChecked; |
| 95 | +-} |
| 96 | +- |
| 97 | + static QString leadingWhitespace(const QString &str) |
| 98 | + { |
| 99 | + int i = 0; |
| 100 | +@@ -491,11 +485,9 @@ MainWindow::MainWindow() |
| 101 | + m_sourceAndFormView = new QStackedWidget(this); |
| 102 | + m_sourceAndFormDock->setWidget(m_sourceAndFormView); |
| 103 | + m_uiFormPreviewView = new UiFormPreviewView(0, m_dataModel); |
| 104 | +- m_qmlFormPreviewView = new QmlFormPreviewView(m_dataModel); |
| 105 | + m_sourceCodeView = new SourceCodeView(0); |
| 106 | + m_sourceAndFormView->addWidget(m_sourceCodeView); |
| 107 | + m_sourceAndFormView->addWidget(m_uiFormPreviewView); |
| 108 | +- m_sourceAndFormView->addWidget(m_qmlFormPreviewView); |
| 109 | + |
| 110 | + // Set up errors dock widget |
| 111 | + m_errorsDock = new QDockWidget(this); |
| 112 | +@@ -693,7 +685,6 @@ void MainWindow::modelCountChanged() |
| 113 | + m_ui.actionFindPrev->setEnabled(false); |
| 114 | + |
| 115 | + m_uiFormPreviewView->setSourceContext(-1, 0); |
| 116 | +- m_qmlFormPreviewView->setSourceContext(-1, 0); |
| 117 | + } |
| 118 | + |
| 119 | + struct OpenedFile { |
| 120 | +@@ -1673,9 +1664,6 @@ void MainWindow::translationChanged(const MultiDataIndex &index) |
| 121 | + MessageItem *m = m_dataModel->messageItem(index); |
| 122 | + if (hasUiFormPreview(m->fileName())) |
| 123 | + m_uiFormPreviewView->setSourceContext(index.model(), m); |
| 124 | +- else if (hasQmlFormPreview(m->fileName(), m_ui.actionQmlPreview->isChecked())) |
| 125 | +- if (!m_qmlFormPreviewView->setSourceContext(index.model(), m)) |
| 126 | +- m_ui.actionQmlPreview->setChecked(false); |
| 127 | + } |
| 128 | + |
| 129 | + // This and the following function operate directly on the messageitem, |
| 130 | +@@ -1691,10 +1679,6 @@ void MainWindow::updateTranslation(const QStringList &translations) |
| 131 | + m->setTranslations(translations); |
| 132 | + if (!m->fileName().isEmpty() && hasUiFormPreview(m->fileName())) |
| 133 | + m_uiFormPreviewView->setSourceContext(m_currentIndex.model(), m); |
| 134 | +- else if (!m->fileName().isEmpty() |
| 135 | +- && hasQmlFormPreview(m->fileName(), m_ui.actionQmlPreview->isChecked())) |
| 136 | +- if (!m_qmlFormPreviewView->setSourceContext(m_currentIndex.model(), m)) |
| 137 | +- m_ui.actionQmlPreview->setChecked(false); |
| 138 | + updateDanger(m_currentIndex, true); |
| 139 | + |
| 140 | + if (m->isFinished()) |
| 141 | +@@ -2099,7 +2083,6 @@ void MainWindow::setupMenuBar() |
| 142 | + connect(m_ui.actionDisplayGuesses, &QAction::triggered, |
| 143 | + m_phraseView, &PhraseView::toggleGuessing); |
| 144 | + connect(m_ui.actionStatistics, &QAction::triggered, this, &MainWindow::showStatistics); |
| 145 | +- connect(m_ui.actionQmlPreview, &QAction::triggered, this, &MainWindow::toggleQmlPreview); |
| 146 | + connect(m_ui.actionVisualizeWhitespace, &QAction::triggered, |
| 147 | + this, &MainWindow::toggleVisualizeWhitespace); |
| 148 | + connect(m_ui.actionIncreaseZoom, &QAction::triggered, |
| 149 | +@@ -2209,11 +2192,7 @@ void MainWindow::updateSourceView(int model, MessageItem *item) |
| 150 | + if (hasUiFormPreview(item->fileName())) { |
| 151 | + m_sourceAndFormView->setCurrentWidget(m_uiFormPreviewView); |
| 152 | + m_uiFormPreviewView->setSourceContext(model, item); |
| 153 | +- } else if (hasQmlFormPreview(item->fileName(), m_ui.actionQmlPreview->isChecked()) |
| 154 | +- && m_qmlFormPreviewView->setSourceContext(model, item)) { |
| 155 | +- m_sourceAndFormView->setCurrentWidget(m_qmlFormPreviewView); |
| 156 | + } else { |
| 157 | +- m_ui.actionQmlPreview->setChecked(false); |
| 158 | + m_sourceAndFormView->setCurrentWidget(m_sourceCodeView); |
| 159 | + QDir dir = QFileInfo(m_dataModel->srcFileName(model)).dir(); |
| 160 | + QString fileName = QDir::cleanPath(dir.absoluteFilePath(item->fileName())); |
| 161 | +@@ -2754,14 +2733,6 @@ void MainWindow::showStatistics() |
| 162 | + updateStatistics(); |
| 163 | + } |
| 164 | + |
| 165 | +-void MainWindow::toggleQmlPreview() |
| 166 | +-{ |
| 167 | +- if (m_ui.actionQmlPreview->isChecked()) |
| 168 | +- m_sourceAndFormView->setCurrentWidget(m_qmlFormPreviewView); |
| 169 | +- else |
| 170 | +- m_sourceAndFormView->setCurrentWidget(m_sourceCodeView); |
| 171 | +-} |
| 172 | +- |
| 173 | + void MainWindow::toggleVisualizeWhitespace() |
| 174 | + { |
| 175 | + m_messageEditor->setVisualizeWhitespace(m_ui.actionVisualizeWhitespace->isChecked()); |
| 176 | +--- a/src/linguist/linguist/mainwindow.h |
| 177 | ++++ b/src/linguist/linguist/mainwindow.h |
| 178 | +@@ -37,7 +37,6 @@ class BatchTranslationDialog; |
| 179 | + class ErrorsView; |
| 180 | + class FocusWatcher; |
| 181 | + class UiFormPreviewView; |
| 182 | +-class QmlFormPreviewView; |
| 183 | + class MessageEditor; |
| 184 | + class PhraseView; |
| 185 | + class SourceCodeView; |
| 186 | +@@ -130,7 +129,6 @@ private slots: |
| 187 | + FindDialog::FindOptions options, int statusFilter); |
| 188 | + void revalidate(); |
| 189 | + void showStatistics(); |
| 190 | +- void toggleQmlPreview(); |
| 191 | + void toggleVisualizeWhitespace(); |
| 192 | + void onWhatsThis(); |
| 193 | + void updatePhraseDicts(); |
| 194 | +@@ -196,7 +194,6 @@ private: |
| 195 | + QStackedWidget *m_sourceAndFormView; |
| 196 | + SourceCodeView *m_sourceCodeView; |
| 197 | + UiFormPreviewView *m_uiFormPreviewView; |
| 198 | +- QmlFormPreviewView *m_qmlFormPreviewView; |
| 199 | + ErrorsView *m_errorsView; |
| 200 | + QLabel *m_progressLabel; |
| 201 | + QLabel *m_modifiedLabel; |
| 202 | +--- a/src/linguist/linguist/mainwindow.ui |
| 203 | ++++ b/src/linguist/linguist/mainwindow.ui |
| 204 | +@@ -97,7 +97,6 @@ |
| 205 | + </widget> |
| 206 | + <addaction name="actionResetSorting"/> |
| 207 | + <addaction name="actionDisplayGuesses"/> |
| 208 | +- <addaction name="actionQmlPreview"/> |
| 209 | + <addaction name="actionLengthVariants"/> |
| 210 | + <addaction name="actionVisualizeWhitespace"/> |
| 211 | + <addaction name="separator"/> |
| 212 | +@@ -646,26 +645,6 @@ |
| 213 | + <enum>QAction::NoRole</enum> |
| 214 | + </property> |
| 215 | + </action> |
| 216 | +- <action name="actionQmlPreview"> |
| 217 | +- <property name="checkable"> |
| 218 | +- <bool>true</bool> |
| 219 | +- </property> |
| 220 | +- <property name="checked"> |
| 221 | +- <bool>true</bool> |
| 222 | +- </property> |
| 223 | +- <property name="text"> |
| 224 | +- <string>&QML preview</string> |
| 225 | +- </property> |
| 226 | +- <property name="toolTip"> |
| 227 | +- <string>Displays a preview of QML documents.</string> |
| 228 | +- </property> |
| 229 | +- <property name="whatsThis"> |
| 230 | +- <string/> |
| 231 | +- </property> |
| 232 | +- <property name="menuRole"> |
| 233 | +- <enum>QAction::NoRole</enum> |
| 234 | +- </property> |
| 235 | +- </action> |
| 236 | + <action name="actionManual"> |
| 237 | + <property name="text"> |
| 238 | + <string>&Manual</string> |
0 commit comments