[interactiveterminal] Refactor error message

- refactor error message
 - ifx capitalisation problem
 - remove editorializing in comments

FIXES #866
main
Adriaan de Groot 7 years ago
parent 49fda9da28
commit 3cb6fd839b

@ -46,6 +46,14 @@ InteractiveTerminalPage::InteractiveTerminalPage( QWidget* parent )
m_layout->addWidget( m_headerLabel ); m_layout->addWidget( m_headerLabel );
} }
static void
errorKonsoleNotInstalled( QWidget* parent)
{
QMessageBox::critical( parent,
parent->tr( "Konsole not installed"),
parent->tr( "Please install KDE Konsole and try again!" ),
QMessageBox::Ok );
}
void void
InteractiveTerminalPage::onActivate() InteractiveTerminalPage::onActivate()
@ -60,15 +68,7 @@ InteractiveTerminalPage::onActivate()
{ {
// And all of this hoping the Konsole application is installed. If not, // And all of this hoping the Konsole application is installed. If not,
// tough cookies. // tough cookies.
// Maybe linking against a library seemed too simple and elegant so errorKonsoleNotInstalled( this );
// someone decided to have a terminal widget depend on over 9000 other
// KDElibs things that have nothing to do with a terminal widget, and
// have the loading happen at runtime so it's more likely to fail at
// an inconvenient time.
QMessageBox::critical( this,
tr( "Konsole not installed"),
tr( "Please install the kde konsole and try again!" ),
QMessageBox::Ok);
return ; return ;
} }
@ -80,10 +80,7 @@ InteractiveTerminalPage::onActivate()
if ( !p ) if ( !p )
{ {
// One more opportunity for the loading operation to fail. // One more opportunity for the loading operation to fail.
QMessageBox::critical( this, errorKonsoleNotInstalled( this );
tr( "Konsole not installed"),
tr( "Please install the kde konsole and try again!" ),
QMessageBox::Ok);
return; return;
} }
@ -92,10 +89,7 @@ InteractiveTerminalPage::onActivate()
if ( !t ) if ( !t )
{ {
// This is why we can't have nice things. // This is why we can't have nice things.
QMessageBox::critical( this, errorKonsoleNotInstalled( this );
tr( "Konsole not installed"),
tr( "Please install the kde konsole and try again!" ),
QMessageBox::Ok);
return; return;
} }

Loading…
Cancel
Save