-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
PkUpdates.hxx
66 lines (51 loc) · 1.55 KB
/
PkUpdates.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
This file is part of liquidshell.
SPDX-FileCopyrightText: 2017 - 2024 Martin Koller <kollix@aon.at>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef _PkUpdates_H_
#define _PkUpdates_H_
// software updates via PackageKit
#include <SysTrayItem.hxx>
#include <PackageKit/Daemon>
#include <KNotification>
#include <QMultiMap>
#include <QTimer>
#include <QDateTime>
#include <QPointer>
class PkUpdateList;
class PkUpdates : public SysTrayItem
{
Q_OBJECT
public:
PkUpdates(QWidget *parent);
struct PackageData
{
QString id;
QString summary;
};
typedef QMultiMap<PackageKit::Transaction::Info, PackageData> PackageList;
protected:
QWidget *getDetailsList() override;
private Q_SLOTS:
void checkForUpdatesReached();
void checkForUpdates();
void refreshFinished(PackageKit::Transaction::Exit status, uint runtime);
void package(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary);
void transactionError(PackageKit::Transaction::Error error, const QString &details);
void packageInstalled(const QString &id);
void packageCountToInstallChanged(int num);
private:
void addItems(QString &tooltip, const QList<PackageData> &list) const;
void createToolTip(bool notify = false);
void setRefreshProgress(int progress);
private:
PackageList packages;
QTimer updateTimer;
QDateTime nextCheck;
PkUpdateList *updateList = nullptr;
int refreshProgress = 100;
QPixmap currentPixmap;
QPointer<KNotification> notification;
};
#endif