Changeset View
Changeset View
Standalone View
Standalone View
umbrello/codeimpwizard/codeimpstatuspage.cpp
Show All 40 Lines | |||||
41 | #include <KMessageBox> | 41 | #include <KMessageBox> | ||
42 | 42 | | |||
43 | //qt includes | 43 | //qt includes | ||
44 | #if QT_VERSION >= 0x050000 | 44 | #if QT_VERSION >= 0x050000 | ||
45 | #include <QFileDialog> | 45 | #include <QFileDialog> | ||
46 | #endif | 46 | #endif | ||
47 | #include <QListWidget> | 47 | #include <QListWidget> | ||
48 | #include <QTimer> | 48 | #include <QTimer> | ||
49 | #include <QScrollBar> | ||||
49 | 50 | | |||
50 | /** | 51 | /** | ||
51 | * Constructor. | 52 | * Constructor. | ||
52 | * @param parent the parent (wizard) of this wizard page | 53 | * @param parent the parent (wizard) of this wizard page | ||
53 | */ | 54 | */ | ||
54 | CodeImpStatusPage::CodeImpStatusPage(QWidget *parent) | 55 | CodeImpStatusPage::CodeImpStatusPage(QWidget *parent) | ||
55 | : QWizardPage(parent), | 56 | : QWizardPage(parent), | ||
56 | m_workDone(false), | 57 | m_workDone(false), | ||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 131 | { | |||
135 | setCommitPage(true); //:TODO: disable back and cancel button ? | 136 | setCommitPage(true); //:TODO: disable back and cancel button ? | ||
136 | 137 | | |||
137 | UMLDoc* doc = UMLApp::app()->document(); | 138 | UMLDoc* doc = UMLApp::app()->document(); | ||
138 | doc->setLoading(true); | 139 | doc->setLoading(true); | ||
139 | // hide list view dockwindow to avoid time consuming update on every insert | 140 | // hide list view dockwindow to avoid time consuming update on every insert | ||
140 | m_savedlistViewVisible = UMLApp::app()->listView()->parentWidget()->isVisible(); | 141 | m_savedlistViewVisible = UMLApp::app()->listView()->parentWidget()->isVisible(); | ||
141 | UMLApp::app()->listView()->parentWidget()->setVisible(false); | 142 | UMLApp::app()->listView()->parentWidget()->setVisible(false); | ||
142 | 143 | | |||
143 | ui_textEditLogger->setHtml(i18np("<b>Code import of 1 file:</b><br>", "<b>Code import of %1 files:</b><br>", m_files.size())); | 144 | ui_textEditLogger->setHtml(i18np("<b>Code import of 1 file:</b><br>", "<b>Code import of %1 files:</b><br>\n", m_files.size())); | ||
habacker: Why do you changed this ? Did <br> not work ? | |||||
aherlas: Needed an extra EOL in order to display the information properly. | |||||
145 | | ||||
146 | ui_textEditLogger->insertHtml(QLatin1String("\n") + QLatin1String("<br>")); | ||||
habacker: Why do you mix \n and <br> ? | |||||
aherlas: Line 289 has also a mix between \n and <br>, did you notice? | |||||
147 | ui_textEditLogger->moveCursor (QTextCursor::End); | ||||
habacker: indentition issue - no space before '(' | |||||
aherlas: my mistake, I will correct it. | |||||
148 | ui_textEditLogger->verticalScrollBar()->setValue(ui_textEditLogger->verticalScrollBar()->maximum()); // move Cursor to the end | ||||
149 | | ||||
144 | m_index = 0; | 150 | m_index = 0; | ||
145 | m_workDone = false; | 151 | m_workDone = false; | ||
146 | m_savedUndoEnabled = UMLApp::app()->isUndoEnabled(); | 152 | m_savedUndoEnabled = UMLApp::app()->isUndoEnabled(); | ||
147 | UMLApp::app()->enableUndo(false); | 153 | UMLApp::app()->enableUndo(false); | ||
148 | 154 | | |||
149 | #ifdef ENABLE_IMPORT_THREAD | 155 | #ifdef ENABLE_IMPORT_THREAD | ||
150 | m_thread = new QThread; | 156 | m_thread = new QThread; | ||
151 | //connect(thread, SIGNAL(started()), this, SLOT(importCodeFile())); | 157 | //connect(thread, SIGNAL(started()), this, SLOT(importCodeFile())); | ||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | |||||
277 | void CodeImpStatusPage::messageToLog(const QString& file, const QString& text) | 283 | void CodeImpStatusPage::messageToLog(const QString& file, const QString& text) | ||
278 | { | 284 | { | ||
279 | if (file.isEmpty()) { | 285 | if (file.isEmpty()) { | ||
280 | ui_textEditLogger->insertHtml(QLatin1String("\n ") + text + QLatin1String("<br>")); | 286 | ui_textEditLogger->insertHtml(QLatin1String("\n ") + text + QLatin1String("<br>")); | ||
281 | } | 287 | } | ||
282 | else { | 288 | else { | ||
283 | ui_textEditLogger->insertHtml(QLatin1String("\n<b>") + file + QLatin1String(":</b> ") + text + QLatin1String("<br>")); | 289 | ui_textEditLogger->insertHtml(QLatin1String("\n<b>") + file + QLatin1String(":</b> ") + text + QLatin1String("<br>")); | ||
284 | } | 290 | } | ||
291 | // move Cursor to the end | ||||
292 | ui_textEditLogger->verticalScrollBar()->setValue(ui_textEditLogger->verticalScrollBar()->maximum()); | ||||
285 | } | 293 | } | ||
286 | 294 | | |||
287 | /** | 295 | /** | ||
288 | * Updates the status of the code import in the status table. | 296 | * Updates the status of the code import in the status table. | ||
289 | * @param file the file for which the code was imported | 297 | * @param file the file for which the code was imported | ||
290 | * @param text the text to display | 298 | * @param text the text to display | ||
291 | */ | 299 | */ | ||
292 | void CodeImpStatusPage::updateStatus(const QString& file, const QString& text) | 300 | void CodeImpStatusPage::updateStatus(const QString& file, const QString& text) | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
Why do you changed this ? Did <br> not work ?