@ -15,6 +15,7 @@
# include <stdio.h>
# include <stdio.h>
# include <QCloseEvent>
# include <QLabel>
# include <QLabel>
# include <QRegExp>
# include <QRegExp>
# include <QVBoxLayout>
# include <QVBoxLayout>
@ -106,18 +107,26 @@ void HelpMessageDialog::on_okButton_accepted()
/** "Shutdown" window */
/** "Shutdown" window */
ShutdownWindow : : ShutdownWindow ( QWidget * parent , Qt : : WindowFlags f ) :
QWidget ( parent , f )
{
QVBoxLayout * layout = new QVBoxLayout ( ) ;
layout - > addWidget ( new QLabel (
tr ( " Bitcoin Core is shutting down... " ) + " <br /><br /> " +
tr ( " Do not shut down the computer until this window disappears. " ) ) ) ;
setLayout ( layout ) ;
}
void ShutdownWindow : : showShutdownWindow ( BitcoinGUI * window )
void ShutdownWindow : : showShutdownWindow ( BitcoinGUI * window )
{
{
if ( ! window )
if ( ! window )
return ;
return ;
// Show a simple window indicating shutdown status
// Show a simple window indicating shutdown status
QWidget * shutdownWindow = new QWidget ( ) ;
QWidget * shutdownWindow = new ShutdownWindow ( ) ;
QVBoxLayout * layout = new QVBoxLayout ( ) ;
// We don't hold a direct pointer to the shutdown window after creation, so use
layout - > addWidget ( new QLabel (
// Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually.
tr ( " Bitcoin Core is shutting down... " ) + " <br /><br /> " +
shutdownWindow - > setAttribute ( Qt : : WA_DeleteOnClose ) ;
tr ( " Do not shut down the computer until this window disappears. " ) ) ) ;
shutdownWindow - > setLayout ( layout ) ;
shutdownWindow - > setWindowTitle ( window - > windowTitle ( ) ) ;
shutdownWindow - > setWindowTitle ( window - > windowTitle ( ) ) ;
// Center shutdown window at where main window was
// Center shutdown window at where main window was
@ -125,3 +134,8 @@ void ShutdownWindow::showShutdownWindow(BitcoinGUI *window)
shutdownWindow - > move ( global . x ( ) - shutdownWindow - > width ( ) / 2 , global . y ( ) - shutdownWindow - > height ( ) / 2 ) ;
shutdownWindow - > move ( global . x ( ) - shutdownWindow - > width ( ) / 2 , global . y ( ) - shutdownWindow - > height ( ) / 2 ) ;
shutdownWindow - > show ( ) ;
shutdownWindow - > show ( ) ;
}
}
void ShutdownWindow : : closeEvent ( QCloseEvent * event )
{
event - > ignore ( ) ;
}