Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Discover
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Discover
Commits
6bdfbdef
Commit
6bdfbdef
authored
Oct 30, 2017
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the update all button into a cancel button while updating
BUG: 386243
parent
b8096e9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
discover/qml/UpdatesPage.qml
discover/qml/UpdatesPage.qml
+10
-1
libdiscover/resources/ResourcesUpdatesModel.cpp
libdiscover/resources/ResourcesUpdatesModel.cpp
+5
-0
libdiscover/resources/ResourcesUpdatesModel.h
libdiscover/resources/ResourcesUpdatesModel.h
+3
-0
No files found.
discover/qml/UpdatesPage.qml
View file @
6bdfbdef
...
...
@@ -80,9 +80,18 @@ DiscoverPage
Layout.minimumWidth
:
Kirigami
.
Units
.
gridUnit
*
6
Layout.rightMargin
:
Kirigami
.
Units
.
gridUnit
text
:
unselectedItem
.
visible
?
i18n
(
"
Update Selected
"
)
:
i18n
(
"
Update All
"
)
enabled
:
!
resourcesUpdatesModel
.
isProgressing
visible
:
!
resourcesUpdatesModel
.
isProgressing
onClicked
:
page
.
start
()
}
Button
{
Layout.minimumWidth
:
Kirigami
.
Units
.
gridUnit
*
6
Layout.rightMargin
:
Kirigami
.
Units
.
gridUnit
iconName
:
"
dialog-cancel
"
text
:
i18n
(
"
Cancel
"
)
enabled
:
resourcesUpdatesModel
.
transaction
&&
resourcesUpdatesModel
.
transaction
.
isCancellable
visible
:
resourcesUpdatesModel
.
isProgressing
onClicked
:
resourcesUpdatesModel
.
transaction
.
cancel
()
}
}
}
...
...
libdiscover/resources/ResourcesUpdatesModel.cpp
View file @
6bdfbdef
...
...
@@ -250,4 +250,9 @@ void ResourcesUpdatesModel::setTransaction(UpdateTransaction* transaction)
Q_EMIT
progressingChanged
();
}
Transaction
*
ResourcesUpdatesModel
::
transaction
()
const
{
return
m_transaction
.
data
();
}
#include "ResourcesUpdatesModel.moc"
libdiscover/resources/ResourcesUpdatesModel.h
View file @
6bdfbdef
...
...
@@ -32,6 +32,7 @@ class QAction;
class
AbstractBackendUpdater
;
class
ResourcesModel
;
class
QDBusInterface
;
class
Transaction
;
class
UpdateTransaction
;
class
DISCOVERCOMMON_EXPORT
ResourcesUpdatesModel
:
public
QStandardItemModel
...
...
@@ -40,6 +41,7 @@ class DISCOVERCOMMON_EXPORT ResourcesUpdatesModel : public QStandardItemModel
Q_PROPERTY
(
bool
isProgressing
READ
isProgressing
NOTIFY
progressingChanged
)
Q_PROPERTY
(
QDateTime
lastUpdate
READ
lastUpdate
NOTIFY
progressingChanged
)
Q_PROPERTY
(
qint64
secsToLastUpdate
READ
secsToLastUpdate
NOTIFY
progressingChanged
)
Q_PROPERTY
(
Transaction
*
transaction
READ
transaction
NOTIFY
progressingChanged
)
public:
explicit
ResourcesUpdatesModel
(
QObject
*
parent
=
nullptr
);
...
...
@@ -54,6 +56,7 @@ class DISCOVERCOMMON_EXPORT ResourcesUpdatesModel : public QStandardItemModel
qint64
secsToLastUpdate
()
const
;
QVector
<
AbstractBackendUpdater
*>
updaters
()
const
{
return
m_updaters
;
}
Transaction
*
transaction
()
const
;
Q_SIGNALS:
void
downloadSpeedChanged
();
...
...
Write
Preview
Markdown
is supported
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