Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Show startup error string purely in qml side
  • Loading branch information
pvuorela committed Jun 8, 2016
1 parent 3cbe263 commit f325781
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions main.cpp
Expand Up @@ -143,6 +143,7 @@ int main(int argc, char *argv[])
context->setContextProperty( "term", &term );
context->setContextProperty( "util", &util );
context->setContextProperty( "keyLoader", &keyLoader );
context->setContextProperty( "startupErrorMessage", startupErrorMsg);

view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl("qrc:/qml/Main.qml"));
Expand All @@ -151,11 +152,6 @@ int main(int argc, char *argv[])
if(!root)
qFatal("no root object - qml error");

QObject* win = root->findChild<QObject*>("window");

if(!startupErrorMsg.isEmpty())
QMetaObject::invokeMethod(win, "showErrorMessage", Qt::QueuedConnection, Q_ARG(QVariant, startupErrorMsg));

TextRender *tr = root->findChild<TextRender*>("textrender");
tr->setUtil(&util);
tr->setTerminal(&term);
Expand Down
4 changes: 3 additions & 1 deletion qml/Main.qml
Expand Up @@ -107,7 +107,6 @@ Item {
property int scrollBarWidth: 6*window.pixelRatio

anchors.fill: parent
objectName: "window"
color: bellTimer.running ? "#ffffff" : bgcolor

Lineview {
Expand Down Expand Up @@ -448,6 +447,9 @@ Item {
Component.onCompleted: {
if( util.settingsValue("state/showWelcomeScreen") === true )
aboutDialog.state = "visible";
if (startupErrorMessage != "") {
showErrorMessage(startupErrorMessage)
}
}

function showErrorMessage(string)
Expand Down

0 comments on commit f325781

Please sign in to comment.