Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Discover
Commits
da7b1977
Commit
da7b1977
authored
Mar 16, 2018
by
Aleix Pol Gonzalez
🐧
Browse files
Show a full error page to indicate that the resource wasn't found
BUG: 391756
parent
1e76a2f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
discover/DiscoverObject.cpp
View file @
da7b1977
...
...
@@ -229,7 +229,7 @@ void DiscoverObject::openApplication(const QUrl& url)
emit
openApplicationInternal
(
res
.
first
());
}
else
{
rootObject
()
->
setProperty
(
"defaultStartup"
,
true
);
showPassiveNotification
(
i18n
(
"Couldn't open %1"
,
url
.
toDisplayString
()));
Q_EMIT
openErrorPage
(
i18n
(
"Couldn't open %1"
,
url
.
toDisplayString
()));
}
});
}
...
...
discover/DiscoverObject.h
View file @
da7b1977
...
...
@@ -81,6 +81,7 @@ class DiscoverObject : public QObject
void
compactModeChanged
(
CompactMode
compactMode
);
void
preventedClose
();
void
unableToFind
(
const
QString
&
resid
);
void
openErrorPage
(
const
QString
&
errorMessage
);
private:
void
integrateObject
(
QObject
*
object
);
...
...
discover/qml/DiscoverWindow.qml
View file @
da7b1977
...
...
@@ -117,6 +117,12 @@ Kirigami.ApplicationWindow
Navigation
.
openApplicationList
({
search
:
search
})
}
onOpenErrorPage
:
{
Navigation
.
clearStack
()
console
.
warn
(
"
error
"
,
errorMessage
)
window
.
stack
.
push
(
errorPageComponent
,
{
error
:
errorMessage
,
title
:
i18n
(
"
Sorry...
"
)
})
}
onPreventedClose
:
showPassiveNotification
(
i18n
(
"
Could not close the application, there are tasks that need to be done.
"
))
onUnableToFind
:
{
showPassiveNotification
(
i18n
(
"
Unable to find resource: %1
"
,
resid
));
...
...
@@ -132,6 +138,20 @@ Kirigami.ApplicationWindow
}
}
Component
{
id
:
errorPageComponent
Kirigami.Page
{
id
:
page
property
string
error
:
""
Kirigami.Heading
{
text
:
page
.
error
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
}
}
}
Component
{
id
:
proceedDialog
Kirigami.OverlaySheet
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment