Changeset View
Changeset View
Standalone View
Standalone View
src/qt/utilitydialog.cpp
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | if (about) { | ||||
cursor.movePosition(QTextCursor::PreviousCell); | cursor.movePosition(QTextCursor::PreviousCell); | ||||
cursor.movePosition(QTextCursor::NextRow); | cursor.movePosition(QTextCursor::NextRow); | ||||
cursor.insertText(line.trimmed()); | cursor.insertText(line.trimmed()); | ||||
cursor.movePosition(QTextCursor::NextCell); | cursor.movePosition(QTextCursor::NextCell); | ||||
} else if (line.startsWith(" ")) { | } else if (line.startsWith(" ")) { | ||||
cursor.insertText(line.trimmed() + ' '); | cursor.insertText(line.trimmed() + ' '); | ||||
} else if (line.size() > 0) { | } else if (line.size() > 0) { | ||||
// Title of a group | // Title of a group | ||||
if (cursor.currentTable()) cursor.currentTable()->appendRows(1); | if (cursor.currentTable()) { | ||||
cursor.currentTable()->appendRows(1); | |||||
} | |||||
cursor.movePosition(QTextCursor::Down); | cursor.movePosition(QTextCursor::Down); | ||||
cursor.insertText(line.trimmed(), bold); | cursor.insertText(line.trimmed(), bold); | ||||
cursor.insertTable(1, 2, tf); | cursor.insertTable(1, 2, tf); | ||||
} | } | ||||
} | } | ||||
ui->helpMessage->moveCursor(QTextCursor::Start); | ui->helpMessage->moveCursor(QTextCursor::Start); | ||||
ui->scrollArea->setVisible(false); | ui->scrollArea->setVisible(false); | ||||
Show All 32 Lines | ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f) | ||||
QVBoxLayout *layout = new QVBoxLayout(); | QVBoxLayout *layout = new QVBoxLayout(); | ||||
layout->addWidget(new QLabel( | layout->addWidget(new QLabel( | ||||
tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" + | tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" + | ||||
tr("Do not shut down the computer until this window disappears."))); | tr("Do not shut down the computer until this window disappears."))); | ||||
setLayout(layout); | setLayout(layout); | ||||
} | } | ||||
QWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window) { | QWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window) { | ||||
if (!window) return nullptr; | if (!window) { | ||||
return nullptr; | |||||
} | |||||
// Show a simple window indicating shutdown status | // Show a simple window indicating shutdown status | ||||
QWidget *shutdownWindow = new ShutdownWindow(); | QWidget *shutdownWindow = new ShutdownWindow(); | ||||
shutdownWindow->setWindowTitle(window->windowTitle()); | shutdownWindow->setWindowTitle(window->windowTitle()); | ||||
// Center shutdown window at where main window was | // Center shutdown window at where main window was | ||||
const QPoint global = window->mapToGlobal(window->rect().center()); | const QPoint global = window->mapToGlobal(window->rect().center()); | ||||
shutdownWindow->move(global.x() - shutdownWindow->width() / 2, | shutdownWindow->move(global.x() - shutdownWindow->width() / 2, | ||||
global.y() - shutdownWindow->height() / 2); | global.y() - shutdownWindow->height() / 2); | ||||
shutdownWindow->show(); | shutdownWindow->show(); | ||||
return shutdownWindow; | return shutdownWindow; | ||||
} | } | ||||
void ShutdownWindow::closeEvent(QCloseEvent *event) { | void ShutdownWindow::closeEvent(QCloseEvent *event) { | ||||
event->ignore(); | event->ignore(); | ||||
} | } |