Skip to content
GitLab
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
01ca64c0
Commit
01ca64c0
authored
Feb 01, 2022
by
Aleix Pol Gonzalez
🐧
Committed by
Aleix Pol Gonzalez
Feb 21, 2022
Browse files
pk: Tell our users when they're running an unsupported version of their Distro
BUG: 449259
parent
976a3172
Pipeline
#140600
passed with stage
in 1 minute and 10 seconds
Changes
6
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
discover/qml/DiscoverPage.qml
View file @
01ca64c0
...
...
@@ -14,6 +14,11 @@ Kirigami.ScrollablePage
Kirigami.Theme.colorSet
:
Kirigami
.
Theme
.
View
Kirigami.Theme.inherit
:
false
header
:
Kirigami.InlineMessage
{
id
:
headerInlineMessage
visible
:
false
}
readonly
property
var
s1
:
Shortcut
{
sequence
:
StandardKey
.
MoveToNextPage
enabled
:
root
.
isCurrentPage
...
...
discover/qml/DiscoverWindow.qml
View file @
01ca64c0
...
...
@@ -160,6 +160,14 @@ Kirigami.ApplicationWindow
showPassiveNotification
(
message
)
console
.
log
(
"
message:
"
,
message
)
}
function
onInlineMessage
(
type
,
icon
,
message
)
{
leftPage
.
header
.
type
=
type
leftPage
.
header
.
icon
.
name
=
icon
leftPage
.
header
.
text
=
message
leftPage
.
header
.
visible
=
true
console
.
log
(
"
inline message:
"
,
message
)
}
}
footer
:
Loader
{
...
...
libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
View file @
01ca64c0
...
...
@@ -12,6 +12,8 @@
#include
"PKTransaction.h"
#include
"PackageKitSourcesBackend.h"
#include
"PackageKitUpdater.h"
#include
<AppStreamQt/release.h>
#include
<AppStreamQt/utils.h>
#include
<appstream/AppStreamIntegration.h>
#include
<appstream/AppStreamUtils.h>
#include
<appstream/OdrsReviewsBackend.h>
...
...
@@ -225,6 +227,23 @@ void PackageKitBackend::reloadPackageList()
Q_EMIT
loadedAppStream
();
}
acquireFetching
(
false
);
const
QList
<
AppStream
::
Component
>
distroComponents
=
m_appdata
->
componentsById
(
AppStream
::
Utils
::
currentDistroComponentId
());
for
(
const
AppStream
::
Component
&
dc
:
distroComponents
)
{
const
auto
releases
=
dc
.
releases
();
for
(
auto
r
:
releases
)
{
if
(
AppStream
::
Utils
::
vercmpSimple
(
r
.
version
(),
AppStreamIntegration
::
global
()
->
osRelease
()
->
version
())
==
0
)
{
if
(
r
.
timestampEol
()
<
QDateTime
::
currentDateTime
())
{
const
QString
releaseDate
=
QLocale
().
toString
(
r
.
timestampEol
());
Q_EMIT
inlineMessage
(
InlineMessageType
::
Warning
,
QStringLiteral
(
"dialog-warning"
),
i18nc
(
"%1 is the date as formatted by the locale"
,
"Your operating system ended support on %1. Consider upgrading to a supported version."
,
releaseDate
));
}
}
}
}
});
fw
->
setFuture
(
QtConcurrent
::
run
(
&
m_threadPool
,
&
loadAppStream
,
m_appdata
.
get
()));
}
...
...
libdiscover/resources/AbstractResourcesBackend.h
View file @
01ca64c0
...
...
@@ -58,6 +58,14 @@ private:
QVariantList
m_actions
;
};
// Keep in sync with Kirigami's enums.h
enum
class
InlineMessageType
{
Information
=
0
,
Positive
,
Warning
,
Error
,
};
/**
* \class AbstractResourcesBackend AbstractResourcesBackend.h "AbstractResourcesBackend.h"
*
...
...
@@ -248,6 +256,7 @@ Q_SIGNALS:
void
resourceRemoved
(
AbstractResource
*
resource
);
void
passiveMessage
(
const
QString
&
message
);
void
inlineMessage
(
InlineMessageType
type
,
const
QString
&
iconName
,
const
QString
&
message
);
void
fetchingUpdatesProgressChanged
();
private:
...
...
libdiscover/resources/ResourcesModel.cpp
View file @
01ca64c0
...
...
@@ -148,6 +148,7 @@ void ResourcesModel::addResourcesBackend(AbstractResourcesBackend *backend)
});
connect
(
backend
,
&
AbstractResourcesBackend
::
resourceRemoved
,
this
,
&
ResourcesModel
::
resourceRemoved
);
connect
(
backend
,
&
AbstractResourcesBackend
::
passiveMessage
,
this
,
&
ResourcesModel
::
passiveMessage
);
connect
(
backend
,
&
AbstractResourcesBackend
::
inlineMessage
,
this
,
&
ResourcesModel
::
inlineMessage
);
connect
(
backend
->
backendUpdater
(),
&
AbstractBackendUpdater
::
progressingChanged
,
this
,
&
ResourcesModel
::
slotFetching
);
if
(
backend
->
reviewsBackend
())
{
connect
(
backend
->
reviewsBackend
(),
&
AbstractReviewsBackend
::
error
,
this
,
&
ResourcesModel
::
passiveMessage
,
Qt
::
UniqueConnection
);
...
...
libdiscover/resources/ResourcesModel.h
View file @
01ca64c0
...
...
@@ -134,6 +134,7 @@ Q_SIGNALS:
void
passiveMessage
(
const
QString
&
message
);
void
currentApplicationBackendChanged
(
AbstractResourcesBackend
*
currentApplicationBackend
);
void
fetchingUpdatesProgressChanged
(
int
fetchingUpdatesProgress
);
void
inlineMessage
(
InlineMessageType
type
,
const
QString
&
iconName
,
const
QString
&
message
);
private
Q_SLOTS
:
void
callerFetchingChanged
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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