File plasma-pk-updates-0.3.2+git70.obscpio of Package plasma5-pk-updates
07070100000000000081A4000000000000000000000001622273890000010C000000000000000000000000000000000000002900000000plasma-pk-updates-0.3.2+git70/.gitignore# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt-es
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.moc
moc_*.cpp
qrc_*.cpp
ui_*.h
Makefile*
*-build-*
# QtCreator
*.autosave
#QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*
07070100000001000081A40000000000000000000000016222738900000428000000000000000000000000000000000000002D00000000plasma-pk-updates-0.3.2+git70/CMakeLists.txtcmake_minimum_required(VERSION 3.0)
project(plasma-pk-updates VERSION 0.3.2)
add_definitions(-DPROJECT_VERSION="\\\"${PROJECT_VERSION}\\\"")
find_package(ECM 1.3.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
set(CMAKE_AUTOMOC ON)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMInstallIcons)
include(FeatureSummary)
find_package(Qt5 REQUIRED
Core
Gui
Widgets
Quick
DBus
)
find_package(KF5 REQUIRED
Plasma
I18n
CoreAddons # KFormat
Notifications
Solid # Solid::Power
)
find_package(packagekitqt5 REQUIRED)
add_definitions(
-DQT_USE_FAST_CONCATENATION
-DQT_USE_FAST_OPERATOR_PLUS
-DQT_STRICT_ITERATORS
-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
)
if(CMAKE_COMPILER_IS_GNUCXX)
# more aggressive warnings and C++11 support
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
endif()
add_subdirectory(src)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
07070100000002000081A40000000000000000000000016222738900008932000000000000000000000000000000000000002600000000plasma-pk-updates-0.3.2+git70/LICENSEGNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
07070100000003000081A40000000000000000000000016222738900000094000000000000000000000000000000000000002800000000plasma-pk-updates-0.3.2+git70/README.md# Plasma software updates
Plasma applet for software updates using PackageKit
Author: Lukáš Tinkl <lukas@kde.org>
Released under GPL 2.0+
07070100000004000041ED0000000000000000000000046222738900000000000000000000000000000000000000000000002200000000plasma-pk-updates-0.3.2+git70/src07070100000005000081A40000000000000000000000016222738900000037000000000000000000000000000000000000003100000000plasma-pk-updates-0.3.2+git70/src/CMakeLists.txtadd_subdirectory(declarative)
add_subdirectory(plasma)
07070100000006000041ED0000000000000000000000026222738900000000000000000000000000000000000000000000002E00000000plasma-pk-updates-0.3.2+git70/src/declarative07070100000007000081A400000000000000000000000162227389000003D0000000000000000000000000000000000000003D00000000plasma-pk-updates-0.3.2+git70/src/declarative/CMakeLists.txtadd_definitions(-DTRANSLATION_DOMAIN="pkupdates")
set(plasmapk_qmlplugins_SRCS
qmlplugins.cpp
pkupdates.cpp
PkStrings.cpp
)
add_library(plasmapk_qmlplugins SHARED ${plasmapk_qmlplugins_SRCS})
target_link_libraries(plasmapk_qmlplugins
Qt5::Core
Qt5::Qml
Qt5::DBus
KF5::I18n
KF5::CoreAddons
KF5::Notifications
KF5::ConfigCore
KF5::Solid
PK::packagekitqt5
)
install(TARGETS plasmapk_qmlplugins DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/PackageKit)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/PackageKit)
install(FILES plasma_pk_updates.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR} )
# test binary
set(plasmapk_console_SRCS
pkupdates.cpp
PkStrings.cpp
main.cpp
)
add_executable(plasmapk-console ${plasmapk_console_SRCS})
target_link_libraries(plasmapk-console
Qt5::Core
KF5::I18n
KF5::CoreAddons
KF5::ConfigCore
KF5::Solid
KF5::Notifications
PK::packagekitqt5
)
07070100000008000081A4000000000000000000000001622273890000004E000000000000000000000000000000000000003A00000000plasma-pk-updates-0.3.2+git70/src/declarative/Messages.sh#!/usr/bin/env bash
$XGETTEXT `find . -name '*.cpp'` -o $podir/pkupdates.pot
07070100000009000081A4000000000000000000000001622273890000C927000000000000000000000000000000000000003C00000000plasma-pk-updates-0.3.2+git70/src/declarative/PkStrings.cpp/***************************************************************************
* Copyright (C) 2008-2011 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; see the file COPYING. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "PkStrings.h"
#include <QDebug>
#include <KLocalizedString>
#include <KFormat>
#include <limits.h>
using namespace PackageKit;
QString PkStrings::status(Transaction::Status status, uint speed, qulonglong downloadRemaining)
{
switch (status) {
case Transaction::StatusUnknown:
return i18nc("This is when the transaction status is not known",
"Unknown state");
case Transaction::StatusSetup:
return i18nc("transaction state, the daemon is in the process of starting",
"Waiting for service to start");
case Transaction::StatusWait:
return i18nc("transaction state, the transaction is waiting for another to complete",
"Waiting for other tasks");
case Transaction::StatusRunning :
return i18nc("transaction state, just started",
"Running task");
case Transaction::StatusQuery :
return i18nc("transaction state, is querying data",
"Querying");
case Transaction::StatusInfo :
return i18nc("transaction state, getting data from a server",
"Getting information");
case Transaction::StatusRemove :
return i18nc("transaction state, removing packages",
"Removing packages");
case Transaction::StatusDownload:
if (speed != 0 && downloadRemaining != 0) {
return i18nc("transaction state, downloading package files",
"Downloading at %1/s, %2 remaining",
KFormat().formatByteSize(speed),
KFormat().formatByteSize(downloadRemaining));
} else if (speed != 0 && downloadRemaining == 0) {
return i18nc("transaction state, downloading package files",
"Downloading at %1/s",
KFormat().formatByteSize(speed));
} else if (speed == 0 && downloadRemaining != 0) {
return i18nc("transaction state, downloading package files",
"Downloading, %1 remaining",
KFormat().formatByteSize(downloadRemaining));
} else {
return i18nc("transaction state, downloading package files",
"Downloading");
}
case Transaction::StatusInstall :
return i18nc("transaction state, installing packages",
"Installing packages");
case Transaction::StatusRefreshCache :
return i18nc("transaction state, refreshing internal lists",
"Refreshing software list");
case Transaction::StatusUpdate :
return i18nc("transaction state, installing updates",
"Updating packages");
case Transaction::StatusCleanup :
return i18nc("transaction state, removing old packages, and cleaning config files",
"Cleaning up packages");
case Transaction::StatusObsolete :
return i18nc("transaction state, obsoleting old packages",
"Obsoleting packages");
case Transaction::StatusDepResolve :
return i18nc("transaction state, checking the transaction before we do it",
"Resolving dependencies");
case Transaction::StatusSigCheck :
return i18nc("transaction state, checking if we have all the security keys for the operation",
"Checking signatures");
case Transaction::StatusTestCommit :
return i18nc("transaction state, when we're doing a test transaction",
"Testing changes");
case Transaction::StatusCommit :
return i18nc("transaction state, when we're writing to the system package database",
"Committing changes");
case Transaction::StatusRequest :
return i18nc("transaction state, requesting data from a server",
"Requesting data");
case Transaction::StatusFinished :
return i18nc("transaction state, all done!",
"Finished");
case Transaction::StatusCancel :
return i18nc("transaction state, in the process of cancelling",
"Cancelling");
case Transaction::StatusDownloadRepository :
return i18nc("transaction state, downloading metadata",
"Downloading repository information");
case Transaction::StatusDownloadPackagelist :
return i18nc("transaction state, downloading metadata",
"Downloading list of packages");
case Transaction::StatusDownloadFilelist :
return i18nc("transaction state, downloading metadata",
"Downloading file lists");
case Transaction::StatusDownloadChangelog :
return i18nc("transaction state, downloading metadata",
"Downloading lists of changes");
case Transaction::StatusDownloadGroup :
return i18nc("transaction state, downloading metadata",
"Downloading groups");
case Transaction::StatusDownloadUpdateinfo :
return i18nc("transaction state, downloading metadata",
"Downloading update information");
case Transaction::StatusRepackaging :
return i18nc("transaction state, repackaging delta files",
"Repackaging files");
case Transaction::StatusLoadingCache :
return i18nc("transaction state, loading databases",
"Loading cache");
case Transaction::StatusScanApplications :
return i18nc("transaction state, scanning for running processes",
"Scanning installed applications");
case Transaction::StatusGeneratePackageList :
return i18nc("transaction state, generating a list of packages installed on the system",
"Generating package lists");
case Transaction::StatusWaitingForLock :
return i18nc("transaction state, when we're waiting for the native tools to exit",
"Waiting for package manager lock");
case Transaction::StatusWaitingForAuth :
return i18nc("waiting for user to type in a password",
"Waiting for authentication");
case Transaction::StatusScanProcessList :
return i18nc("we are updating the list of processes",
"Updating the list of running applications");
case Transaction::StatusCheckExecutableFiles :
return i18nc("we are checking executable files in use",
"Checking for applications currently in use");
case Transaction::StatusCheckLibraries :
return i18nc("we are checking for libraries in use",
"Checking for libraries currently in use");
case Transaction::StatusCopyFiles :
return i18nc("we are copying package files to prepare to install",
"Copying files");
}
qWarning() << "status unrecognised: " << status;
return QString();
}
QString PkStrings::statusPast(Transaction::Status status)
{
switch (status) {
case Transaction::StatusDownload:
return i18nc("The action of the package, in past tense", "Downloaded");
case Transaction::StatusUpdate:
return i18nc("The action of the package, in past tense", "Updated");
case Transaction::StatusInstall:
return i18nc("The action of the package, in past tense", "Installed");
case Transaction::StatusRemove:
return i18nc("The action of the package, in past tense", "Removed");
case Transaction::StatusCleanup:
return i18nc("The action of the package, in past tense", "Cleaned Up");
case Transaction::StatusObsolete:
return i18nc("The action of the package, in past tense", "Obsoleted");
default : // In this case we don't want to map all enums
qWarning() << "status unrecognised: " << status;
return QString();
}
}
QString PkStrings::action(Transaction::Role role, Transaction::TransactionFlags flags)
{
switch (role) {
case Transaction::RoleUnknown :
return i18nc("The role of the transaction, in present tense", "Unknown role type");
case Transaction::RoleDependsOn :
return i18nc("The role of the transaction, in present tense", "Getting dependencies");
case Transaction::RoleGetUpdateDetail :
return i18nc("The role of the transaction, in present tense", "Getting update detail");
case Transaction::RoleGetDetails:
case Transaction::RoleGetDetailsLocal:
return i18nc("The role of the transaction, in present tense", "Getting details");
case Transaction::RoleRequiredBy :
return i18nc("The role of the transaction, in present tense", "Getting requires");
case Transaction::RoleGetUpdates :
return i18nc("The role of the transaction, in present tense", "Getting updates");
case Transaction::RoleSearchDetails :
return i18nc("The role of the transaction, in present tense", "Searching details");
case Transaction::RoleSearchFile :
return i18nc("The role of the transaction, in present tense", "Searching for file");
case Transaction::RoleSearchGroup :
return i18nc("The role of the transaction, in present tense", "Searching groups");
case Transaction::RoleSearchName :
return i18nc("The role of the transaction, in present tense", "Searching by package name");
case Transaction::RoleRemovePackages :
if (flags & Transaction::TransactionFlagSimulate) {
return i18nc("The role of the transaction, in present tense", "Simulating removal");
} else if (flags & Transaction::TransactionFlagOnlyDownload) {
return i18nc("The role of the transaction, in present tense", "Downloading packages");
}
return i18nc("The role of the transaction, in present tense", "Removing");
case Transaction::RoleInstallPackages :
if (flags & Transaction::TransactionFlagSimulate) {
return i18nc("The role of the transaction, in present tense", "Simulating install");
} else if (flags & Transaction::TransactionFlagOnlyDownload) {
return i18nc("The role of the transaction, in present tense", "Downloading packages");
}
return i18nc("The role of the transaction, in present tense", "Installing");
case Transaction::RoleInstallFiles :
if (flags & Transaction::TransactionFlagSimulate) {
return i18nc("The role of the transaction, in present tense", "Simulating file install");
} else if (flags & Transaction::TransactionFlagOnlyDownload) {
return i18nc("The role of the transaction, in present tense", "Downloading required packages");
}
return i18nc("The role of the transaction, in present tense", "Installing file");
case Transaction::RoleRefreshCache :
return i18nc("The role of the transaction, in present tense", "Refreshing package cache");
case Transaction::RoleUpdatePackages :
if (flags & Transaction::TransactionFlagSimulate) {
return i18nc("The role of the transaction, in present tense", "Simulating update");
} else if (flags & Transaction::TransactionFlagOnlyDownload) {
return i18nc("The role of the transaction, in present tense", "Downloading updates");
}
return i18nc("The role of the transaction, in present tense", "Updating packages");
case Transaction::RoleCancel :
return i18nc("The role of the transaction, in present tense", "Canceling");
case Transaction::RoleGetRepoList :
return i18nc("The role of the transaction, in present tense", "Getting list of repositories");
case Transaction::RoleRepoEnable :
return i18nc("The role of the transaction, in present tense", "Enabling repository");
case Transaction::RoleRepoSetData :
return i18nc("The role of the transaction, in present tense", "Setting repository data");
case Transaction::RoleResolve :
return i18nc("The role of the transaction, in present tense", "Resolving");
case Transaction::RoleGetFiles:
case Transaction::RoleGetFilesLocal:
return i18nc("The role of the transaction, in present tense", "Getting file list");
case Transaction::RoleWhatProvides :
return i18nc("The role of the transaction, in present tense", "Getting what provides");
case Transaction::RoleInstallSignature :
return i18nc("The role of the transaction, in present tense", "Installing signature");
case Transaction::RoleGetPackages :
return i18nc("The role of the transaction, in present tense", "Getting package lists");
case Transaction::RoleAcceptEula :
return i18nc("The role of the transaction, in present tense", "Accepting EULA");
case Transaction::RoleDownloadPackages :
return i18nc("The role of the transaction, in present tense", "Downloading packages");
case Transaction::RoleGetDistroUpgrades :
return i18nc("The role of the transaction, in present tense", "Getting distribution upgrade information");
case Transaction::RoleGetCategories :
return i18nc("The role of the transaction, in present tense", "Getting categories");
case Transaction::RoleGetOldTransactions :
return i18nc("The role of the transaction, in present tense", "Getting old transactions");
case Transaction::RoleRepairSystem :
return i18nc("The role of the transaction, in present tense", "Repairing system");
case Transaction::RoleRepoRemove:
return i18nc("The role of the transaction, in present tense", "Removing repository");
}
qWarning() << "action unrecognised: " << role;
return QString();
}
QString PkStrings::actionPast(Transaction::Role action)
{
switch (action) {
case Transaction::RoleUnknown:
return i18nc("The role of the transaction, in past tense", "Unknown role type");
case Transaction::RoleDependsOn :
return i18nc("The role of the transaction, in past tense", "Got dependencies");
case Transaction::RoleGetUpdateDetail :
return i18nc("The role of the transaction, in past tense", "Got update detail");
case Transaction::RoleGetDetails:
case Transaction::RoleGetDetailsLocal:
return i18nc("The role of the transaction, in past tense", "Got details");
case Transaction::RoleRequiredBy :
return i18nc("The role of the transaction, in past tense", "Got requires");
case Transaction::RoleGetUpdates :
return i18nc("The role of the transaction, in past tense", "Got updates");
case Transaction::RoleSearchDetails :
return i18nc("The role of the transaction, in past tense", "Searched for package details");
case Transaction::RoleSearchFile :
return i18nc("The role of the transaction, in past tense", "Searched for file");
case Transaction::RoleSearchGroup :
return i18nc("The role of the transaction, in past tense", "Searched groups");
case Transaction::RoleSearchName :
return i18nc("The role of the transaction, in past tense", "Searched for package name");
case Transaction::RoleRemovePackages :
return i18nc("The role of the transaction, in past tense", "Removed packages");
case Transaction::RoleInstallPackages :
return i18nc("The role of the transaction, in past tense", "Installed packages");
case Transaction::RoleInstallFiles :
return i18nc("The role of the transaction, in past tense", "Installed local files");
case Transaction::RoleRefreshCache :
return i18nc("The role of the transaction, in past tense", "Refreshed package cache");
case Transaction::RoleUpdatePackages :
return i18nc("The role of the transaction, in past tense", "Updated packages");
case Transaction::RoleCancel :
return i18nc("The role of the transaction, in past tense", "Canceled");
case Transaction::RoleGetRepoList :
return i18nc("The role of the transaction, in past tense", "Got list of repositories");
case Transaction::RoleRepoEnable :
return i18nc("The role of the transaction, in past tense", "Enabled repository");
case Transaction::RoleRepoSetData :
return i18nc("The role of the transaction, in past tense", "Set repository data");
case Transaction::RoleResolve :
return i18nc("The role of the transaction, in past tense", "Resolved");
case Transaction::RoleGetFiles:
case Transaction::RoleGetFilesLocal:
return i18nc("The role of the transaction, in past tense", "Got file list");
case Transaction::RoleWhatProvides :
return i18nc("The role of the transaction, in past tense", "Got what provides");
case Transaction::RoleInstallSignature :
return i18nc("The role of the transaction, in past tense", "Installed signature");
case Transaction::RoleGetPackages :
return i18nc("The role of the transaction, in past tense", "Got package lists");
case Transaction::RoleAcceptEula :
return i18nc("The role of the transaction, in past tense", "Accepted EULA");
case Transaction::RoleDownloadPackages :
return i18nc("The role of the transaction, in past tense", "Downloaded packages");
case Transaction::RoleGetDistroUpgrades :
return i18nc("The role of the transaction, in past tense", "Got distribution upgrades");
case Transaction::RoleGetCategories :
return i18nc("The role of the transaction, in past tense", "Got categories");
case Transaction::RoleGetOldTransactions :
return i18nc("The role of the transaction, in past tense", "Got old transactions");
case Transaction::RoleRepairSystem:
return i18nc("The role of the transaction, in past tense", "Repaired system");
case Transaction::RoleRepoRemove:
return i18nc("The role of the transaction, in past tense", "Removed repository");
}
qWarning() << "action unrecognised: " << action;
return QString();
}
QString PkStrings::infoPresent(Transaction::Info info)
{
switch (info) {
case Transaction::InfoDownloading :
return i18n("Downloading");
case Transaction::InfoUpdating :
return i18n("Updating");
case Transaction::InfoInstalling :
return i18n("Installing");
case Transaction::InfoRemoving :
return i18n("Removing");
case Transaction::InfoCleanup :
return i18n("Cleaning up");
case Transaction::InfoObsoleting :
return i18n("Obsoleting");
case Transaction::InfoReinstalling :
return i18n("Reinstalling");
case Transaction::InfoPreparing :
return i18n("Preparing");
case Transaction::InfoDecompressing :
return i18n("Decompressing");
default :
qWarning() << "info unrecognised:" << info;
return QString();
}
}
QString PkStrings::infoPast(Transaction::Info info)
{
switch (info) {
case Transaction::InfoDownloading :
return i18n("Downloaded");
case Transaction::InfoUpdating :
return i18n("Updated");
case Transaction::InfoInstalling :
return i18n("Installed");
case Transaction::InfoRemoving :
return i18n("Removed");
case Transaction::InfoCleanup :
return i18n("Cleaned up");
case Transaction::InfoObsoleting :
return i18n("Obsoleted");
case Transaction::InfoReinstalling :
return i18n("Reinstalled");
case Transaction::InfoPreparing :
return i18n("Prepared");
case Transaction::InfoDecompressing :
return i18n("Decompressed");
default :
qWarning() << "info unrecognised: " << info;
return QString();
}
}
QString PkStrings::error(Transaction::Error error)
{
switch (error) {
case Transaction::ErrorNoNetwork :
return i18n("No network connection available");
case Transaction::ErrorNoCache :
return i18n("No package cache is available");
case Transaction::ErrorOom :
return i18n("Out of memory");
case Transaction::ErrorCreateThreadFailed :
return i18n("Failed to create a thread");
case Transaction::ErrorNotSupported :
return i18n("Not supported by this backend");
case Transaction::ErrorInternalError :
return i18n("An internal system error has occurred");
case Transaction::ErrorGpgFailure :
return i18n("A security trust relationship is not present");
case Transaction::ErrorPackageNotInstalled :
return i18n("The package is not installed");
case Transaction::ErrorPackageNotFound :
return i18n("The package was not found");
case Transaction::ErrorPackageAlreadyInstalled :
return i18n("The package is already installed");
case Transaction::ErrorPackageDownloadFailed :
return i18n("The package download failed");
case Transaction::ErrorGroupNotFound :
return i18n("The group was not found");
case Transaction::ErrorGroupListInvalid :
return i18n("The group list was invalid");
case Transaction::ErrorDepResolutionFailed :
return i18n("Dependency resolution failed");
case Transaction::ErrorFilterInvalid :
return i18n("Search filter was invalid");
case Transaction::ErrorPackageIdInvalid :
return i18n("The package identifier was not well formed");
case Transaction::ErrorTransactionError :
return i18n("Transaction error");
case Transaction::ErrorRepoNotFound :
return i18n("Repository name was not found");
case Transaction::ErrorCannotRemoveSystemPackage :
return i18n("Could not remove a protected system package");
case Transaction::ErrorTransactionCancelled :
return i18n("The task was canceled");
case Transaction::ErrorProcessKill :
return i18n("The task was forcibly canceled");
case Transaction::ErrorFailedConfigParsing :
return i18n("Reading the config file failed");
case Transaction::ErrorCannotCancel :
return i18n("The task cannot be cancelled");
case Transaction::ErrorCannotInstallSourcePackage :
return i18n("Source packages cannot be installed");
case Transaction::ErrorNoLicenseAgreement :
return i18n("The license agreement failed");
case Transaction::ErrorFileConflicts :
return i18n("Local file conflict between packages");
case Transaction::ErrorPackageConflicts :
return i18n("Packages are not compatible");
case Transaction::ErrorRepoNotAvailable :
return i18n("Problem connecting to a software origin");
case Transaction::ErrorFailedInitialization :
return i18n("Failed to initialize");
case Transaction::ErrorFailedFinalise :
return i18n("Failed to finalize");
case Transaction::ErrorCannotGetLock :
return i18n("Cannot get lock");
case Transaction::ErrorNoPackagesToUpdate :
return i18n("No packages to update");
case Transaction::ErrorCannotWriteRepoConfig :
return i18n("Cannot write repository configuration");
case Transaction::ErrorLocalInstallFailed :
return i18n("Local install failed");
case Transaction::ErrorBadGpgSignature :
return i18n("Bad GPG signature");
case Transaction::ErrorMissingGpgSignature :
return i18n("Missing GPG signature");
case Transaction::ErrorRepoConfigurationError :
return i18n("Repository configuration invalid");
case Transaction::ErrorInvalidPackageFile :
return i18n("Invalid package file");
case Transaction::ErrorPackageInstallBlocked :
return i18n("Package install blocked");
case Transaction::ErrorPackageCorrupt :
return i18n("Package is corrupt");
case Transaction::ErrorAllPackagesAlreadyInstalled :
return i18n("All packages are already installed");
case Transaction::ErrorFileNotFound :
return i18n("The specified file could not be found");
case Transaction::ErrorNoMoreMirrorsToTry :
return i18n("No more mirrors are available");
case Transaction::ErrorNoDistroUpgradeData :
return i18n("No distribution upgrade data is available");
case Transaction::ErrorIncompatibleArchitecture :
return i18n("Package is incompatible with this system");
case Transaction::ErrorNoSpaceOnDevice :
return i18n("No space is left on the disk");
case Transaction::ErrorMediaChangeRequired :
return i18n("A media change is required");
case Transaction::ErrorNotAuthorized :
return i18n("Authorization failed");
case Transaction::ErrorUpdateNotFound :
return i18n("Update not found");
case Transaction::ErrorCannotInstallRepoUnsigned :
return i18n("Cannot install from untrusted origin");
case Transaction::ErrorCannotUpdateRepoUnsigned :
return i18n("Cannot update from untrusted origin");
case Transaction::ErrorCannotGetFilelist :
return i18n("Cannot get the file list");
case Transaction::ErrorCannotGetRequires :
return i18n("Cannot get package requires");
case Transaction::ErrorCannotDisableRepository :
return i18n("Cannot disable origin");
case Transaction::ErrorRestrictedDownload :
return i18n("The download failed");
case Transaction::ErrorPackageFailedToConfigure :
return i18n("Package failed to configure");
case Transaction::ErrorPackageFailedToBuild :
return i18n("Package failed to build");
case Transaction::ErrorPackageFailedToInstall :
return i18n("Package failed to install");
case Transaction::ErrorPackageFailedToRemove :
return i18n("Package failed to be removed");
case Transaction::ErrorUpdateFailedDueToRunningProcess :
return i18n("Update failed due to running process");
case Transaction::ErrorPackageDatabaseChanged :
return i18n("The package database was changed");
case Transaction::ErrorProvideTypeNotSupported :
return i18n("Virtual provide type is not supported");
case Transaction::ErrorInstallRootInvalid :
return i18n("Install root is invalid");
case Transaction::ErrorCannotFetchSources :
return i18n("Cannot fetch install sources");
case Transaction::ErrorCancelledPriority :
return i18n("Rescheduled due to priority");
case Transaction::ErrorUnfinishedTransaction:
return i18n("Unfinished transaction");
case Transaction::ErrorLockRequired:
return i18n("Lock required");
case Transaction::ErrorUnknown:
return i18n("Unknown error");
}
qWarning() << "error unrecognised: " << error;
return QString();
}
QString PkStrings::errorMessage(Transaction::Error error)
{
switch (error) {
case Transaction::ErrorNoNetwork :
return i18n("There is no network connection available.\n"
"Please check your connection settings and try again");
case Transaction::ErrorNoCache :
return i18n("The package list needs to be rebuilt.\n"
"This should have been done by the backend automatically.");
case Transaction::ErrorOom :
return i18n("The service that is responsible for handling user requests is out of memory.\n"
"Please close some programs or restart your computer.");
case Transaction::ErrorCreateThreadFailed :
return i18n("A thread could not be created to service the user request.");
case Transaction::ErrorNotSupported :
return i18n("The action is not supported by this backend.\n"
"Please report a bug as this should not have happened.");
case Transaction::ErrorInternalError :
return i18n("A problem that we were not expecting has occurred.\n"
"Please report this bug with the error description.");
case Transaction::ErrorGpgFailure :
return i18n("A security trust relationship could not be made with the software origin.\n"
"Please check your software signature settings.");
case Transaction::ErrorPackageNotInstalled :
return i18n("The package that is trying to be removed or updated is not already installed.");
case Transaction::ErrorPackageNotFound :
return i18n("The package that is being modified was not found on your system or in any software origin.");
case Transaction::ErrorPackageAlreadyInstalled :
return i18n("The package that is trying to be installed is already installed.");
case Transaction::ErrorPackageDownloadFailed :
return i18n("The package download failed.\n"
"Please check your network connectivity.");
case Transaction::ErrorGroupNotFound :
return i18n("The group type was not found.\n"
"Please check your group list and try again.");
case Transaction::ErrorGroupListInvalid :
return i18n("The group list could not be loaded.\n"
"Refreshing your cache may help, although this is normally a software "
"origin error.");
case Transaction::ErrorDepResolutionFailed :
return i18n("A package dependency could not be found.\n"
"More information is available in the detailed report.");
case Transaction::ErrorFilterInvalid :
return i18n("The search filter was not correctly formed.");
case Transaction::ErrorPackageIdInvalid :
return i18n("The package identifier was not well formed when sent to the system daemon.\n"
"This normally indicates an internal bug and should be reported.");
case Transaction::ErrorTransactionError :
return i18n("An error occurred while running the transaction.\n"
"More information is available in the detailed report.");
case Transaction::ErrorRepoNotFound :
return i18n("The remote software origin name was not found.\n"
"You may need to enable an item in Software Origins.");
case Transaction::ErrorCannotRemoveSystemPackage :
return i18n("Removing a protected system package is not allowed.");
case Transaction::ErrorTransactionCancelled :
return i18n("The task was canceled successfully and no packages were changed.");
case Transaction::ErrorProcessKill :
return i18n("The task was canceled successfully and no packages were changed.\n"
"The backend did not exit cleanly.");
case Transaction::ErrorFailedConfigParsing :
return i18n("The native package configuration file could not be opened.\n"
"Please make sure your system's configuration is valid.");
case Transaction::ErrorCannotCancel :
return i18n("The task is not safe to be cancelled at this time.");
case Transaction::ErrorCannotInstallSourcePackage :
return i18n("Source packages are not normally installed this way.\n"
"Check the extension of the file you are trying to install.");
case Transaction::ErrorNoLicenseAgreement :
return i18n("The license agreement was not agreed to.\n"
"To use this software you have to accept the license.");
case Transaction::ErrorFileConflicts :
return i18n("Two packages provide the same file.\n"
"This is usually due to mixing packages for different software origins.");
case Transaction::ErrorPackageConflicts :
return i18n("Multiple packages exist that are not compatible with each other.\n"
"This is usually due to mixing packages from different software origins.");
case Transaction::ErrorRepoNotAvailable :
return i18n("There was a (possibly temporary) problem connecting to a software origins.\n"
"Please check the detailed error for further details.");
case Transaction::ErrorFailedInitialization :
return i18n("Failed to initialize packaging backend.\n"
"This may occur if other packaging tools are being used simultaneously.");
case Transaction::ErrorFailedFinalise :
return i18n("Failed to close down the backend instance.\n"
"This error can normally be ignored.");
case Transaction::ErrorCannotGetLock :
return i18n("Cannot get the exclusive lock on the packaging backend.\n"
"Please close any other legacy packaging tools that may be open.");
case Transaction::ErrorNoPackagesToUpdate :
return i18n("None of the selected packages could be updated.");
case Transaction::ErrorCannotWriteRepoConfig :
return i18n("The repository configuration could not be modified.");
case Transaction::ErrorLocalInstallFailed :
return i18n("Installing the local file failed.\n"
"More information is available in the detailed report.");
case Transaction::ErrorBadGpgSignature :
return i18n("The package signature could not be verified.");
case Transaction::ErrorMissingGpgSignature :
return i18n("The package signature was missing and this package is untrusted.\n"
"This package was not signed with a GPG key when created.");
case Transaction::ErrorRepoConfigurationError :
return i18n("Repository configuration was invalid and could not be read.");
case Transaction::ErrorInvalidPackageFile :
return i18n("The package you are attempting to install is not valid.\n"
"The package file could be corrupt, or not a proper package.");
case Transaction::ErrorPackageInstallBlocked :
return i18n("Installation of this package was prevented by your packaging system's configuration.");
case Transaction::ErrorPackageCorrupt :
return i18n("The package that was downloaded is corrupt and needs to be downloaded again.");
case Transaction::ErrorAllPackagesAlreadyInstalled :
return i18n("All of the packages selected for install are already installed on the system.");
case Transaction::ErrorFileNotFound :
return i18n("The specified file could not be found on the system.\n"
"Check that the file still exists and has not been deleted.");
case Transaction::ErrorNoMoreMirrorsToTry :
return i18n("Required data could not be found on any of the configured software origins.\n"
"There were no more download mirrors that could be tried.");
case Transaction::ErrorNoDistroUpgradeData :
return i18n("Required upgrade data could not be found in any of the configured software origins.\n"
"The list of distribution upgrades will be unavailable.");
case Transaction::ErrorIncompatibleArchitecture :
return i18n("The package that is trying to be installed is incompatible with this system.");
case Transaction::ErrorNoSpaceOnDevice :
return i18n("There is insufficient space on the device.\n"
"Free some space on the system disk to perform this operation.");
case Transaction::ErrorMediaChangeRequired :
return i18n("Additional media is required to complete the transaction.");
case Transaction::ErrorNotAuthorized :
return i18n("You have failed to provide correct authentication.\n"
"Please check any passwords or account settings.");
case Transaction::ErrorUpdateNotFound :
return i18n("The specified update could not be found.\n"
"It could have already been installed or no longer available on the remote server.");
case Transaction::ErrorCannotInstallRepoUnsigned :
return i18n("The package could not be installed from untrusted origin.");
case Transaction::ErrorCannotUpdateRepoUnsigned :
return i18n("The package could not be updated from untrusted origin.");
case Transaction::ErrorCannotGetFilelist :
return i18n("The file list is not available for this package.");
case Transaction::ErrorCannotGetRequires :
return i18n("The information about what requires this package could not be obtained.");
case Transaction::ErrorCannotDisableRepository :
return i18n("The specified software origin could not be disabled.");
case Transaction::ErrorRestrictedDownload :
return i18n("The download could not be done automatically and should be done manually.\n"
"More information is available in the detailed report.");
case Transaction::ErrorPackageFailedToConfigure :
return i18n("One of the selected packages failed to configure correctly.\n"
"More information is available in the detailed report.");
case Transaction::ErrorPackageFailedToBuild :
return i18n("One of the selected packages failed to build correctly.\n"
"More information is available in the detailed report.");
case Transaction::ErrorPackageFailedToInstall :
return i18n("One of the selected packages failed to install correctly.\n"
"More information is available in the detailed report.");
case Transaction::ErrorPackageFailedToRemove :
return i18n("One of the selected packages failed to be removed correctly.\n"
"More information is available in the detailed report.");
case Transaction::ErrorUpdateFailedDueToRunningProcess :
return i18n("A program is running that has to be closed before the update can proceed.\n"
"More information is available in the detailed report.");
case Transaction::ErrorPackageDatabaseChanged :
return i18n("The package database was changed while the request was running.");
case Transaction::ErrorProvideTypeNotSupported :
return i18n("The virtual provide type is not supported by this system.");
case Transaction::ErrorInstallRootInvalid :
return i18n("The install root is invalid. Please contact your administrator.");
case Transaction::ErrorCannotFetchSources :
return i18n("The list of software could not be downloaded.");
case Transaction::ErrorCancelledPriority :
return i18n("The transaction has been cancelled and will be retried when the system is idle.");
case Transaction::ErrorUnfinishedTransaction :
return i18n("A previous package management transaction was interrupted.");
case Transaction::ErrorLockRequired :
return i18n("A package manager lock is required.");
case Transaction::ErrorUnknown:
return i18n("Unknown error, please report a bug.\n"
"More information is available in the detailed report.");
}
qWarning() << "error unrecognised: " << error;
return QString();
}
QString PkStrings::groups(Transaction::Group group)
{
switch (group) {
case Transaction::GroupAccessibility :
return i18nc("The group type", "Accessibility");
case Transaction::GroupAccessories :
return i18nc("The group type", "Accessories");
case Transaction::GroupEducation :
return i18nc("The group type", "Education");
case Transaction::GroupGames :
return i18nc("The group type", "Games");
case Transaction::GroupGraphics :
return i18nc("The group type", "Graphics");
case Transaction::GroupInternet :
return i18nc("The group type", "Internet");
case Transaction::GroupOffice :
return i18nc("The group type", "Office");
case Transaction::GroupOther :
return i18nc("The group type", "Others");
case Transaction::GroupProgramming :
return i18nc("The group type", "Development");
case Transaction::GroupMultimedia :
return i18nc("The group type", "Multimedia");
case Transaction::GroupSystem :
return i18nc("The group type", "System");
case Transaction::GroupDesktopGnome :
return i18nc("The group type", "GNOME desktop");
case Transaction::GroupDesktopKde :
return i18nc("The group type", "KDE desktop");
case Transaction::GroupDesktopXfce :
return i18nc("The group type", "XFCE desktop");
case Transaction::GroupDesktopOther :
return i18nc("The group type", "Other desktops");
case Transaction::GroupPublishing :
return i18nc("The group type", "Publishing");
case Transaction::GroupServers :
return i18nc("The group type", "Servers");
case Transaction::GroupFonts :
return i18nc("The group type", "Fonts");
case Transaction::GroupAdminTools :
return i18nc("The group type", "Admin tools");
case Transaction::GroupLegacy :
return i18nc("The group type", "Legacy");
case Transaction::GroupLocalization :
return i18nc("The group type", "Localization");
case Transaction::GroupVirtualization :
return i18nc("The group type", "Virtualization");
case Transaction::GroupSecurity :
return i18nc("The group type", "Security");
case Transaction::GroupPowerManagement :
return i18nc("The group type", "Power management");
case Transaction::GroupCommunication :
return i18nc("The group type", "Communication");
case Transaction::GroupNetwork :
return i18nc("The group type", "Network");
case Transaction::GroupMaps :
return i18nc("The group type", "Maps");
case Transaction::GroupRepos :
return i18nc("The group type", "Software sources");
case Transaction::GroupScience :
return i18nc("The group type", "Science");
case Transaction::GroupDocumentation :
return i18nc("The group type", "Documentation");
case Transaction::GroupElectronics :
return i18nc("The group type", "Electronics");
case Transaction::GroupCollections ://TODO check this one
return i18nc("The group type", "Package collections");
case Transaction::GroupVendor :
return i18nc("The group type", "Vendor");
case Transaction::GroupNewest :
return i18nc("The group type", "Newest packages");
case Transaction::GroupUnknown:
return i18nc("The group type", "Unknown group");
}
qWarning() << "group unrecognised: " << group;
return QString();
}
QString PkStrings::info(int state)
{
Transaction::Info stateEnum = static_cast<Transaction::Info>(state);
switch (stateEnum) {
case Transaction::InfoLow :
return i18nc("The type of update", "Trivial update");
case Transaction::InfoNormal :
return i18nc("The type of update", "Normal update");
case Transaction::InfoImportant :
return i18nc("The type of update", "Important update");
case Transaction::InfoSecurity :
return i18nc("The type of update", "Security update");
case Transaction::InfoBugfix :
return i18nc("The type of update", "Bug fix update");
case Transaction::InfoEnhancement :
return i18nc("The type of update", "Enhancement update");
case Transaction::InfoBlocked :
return i18nc("The type of update", "Blocked update");
case Transaction::InfoInstalled :
case Transaction::InfoCollectionInstalled :
return i18nc("The type of update", "Installed");
case Transaction::InfoAvailable :
case Transaction::InfoCollectionAvailable :
return i18nc("The type of update", "Available");
case Transaction::InfoUnknown:
return i18nc("The type of update", "Unknown update");
default : // In this case we don't want to map all enums
qWarning() << "info unrecognised: " << state;
return QString();
}
}
QString PkStrings::packageQuantity(bool updates, int packages, int selected)
{
if (updates) {
if (packages == 0) {
return i18n("No Updates Available");
} else if (packages == selected) {
return i18ncp("Some updates were selected on the view",
"1 Update Selected",
"%1 Updates Selected", packages);
} else if (selected == 0) {
return i18ncp("Some updates are being shown on the screen",
"1 Update", "%1 Updates",
packages);
} else {
return i18nc("Type of update, in the case it's just an update", "%1, %2",
i18ncp("Part of: %1 Updates, %1 Selected", "%1 Update", "%1 Updates", packages),
i18ncp("Part of: %1 Updates, %1 Selected", "%1 Selected", "%1 Selected", selected));
}
} else {
if (packages == 0) {
return i18n("No Packages");
}
return i18np("1 Package", "%1 Packages", packages);
}
}
QString PkStrings::restartTypeFuture(Transaction::Restart value)
{
switch (value) {
case Transaction::RestartNone:
return i18n("No restart is necessary");
case Transaction::RestartApplication:
return i18n("You will be required to restart this application");
case Transaction::RestartSession:
return i18n("You will be required to log out and back in");
case Transaction::RestartSystem:
return i18n("A restart will be required");
case Transaction::RestartSecuritySession:
return i18n("You will be required to log out and back in due to a security update.");
case Transaction::RestartSecuritySystem:
return i18n("A restart will be required due to a security update.");
case Transaction::RestartUnknown:
qWarning() << "restartTypeFuture(Transaction::RestartUnknown)";
return QString();
}
qWarning() << "restart unrecognised: " << value;
return QString();
}
QString PkStrings::restartType(Transaction::Restart value)
{
switch (value) {
case Transaction::RestartNone:
return i18n("No restart is required");
case Transaction::RestartSystem:
return i18n("A restart is required");
case Transaction::RestartSession:
return i18n("You need to log out and log back in");
case Transaction::RestartApplication:
return i18n("You need to restart the application");
case Transaction::RestartSecuritySession:
return i18n("You need to log out and log back in to remain secure.");
case Transaction::RestartSecuritySystem:
return i18n("A restart is required to remain secure.");
case Transaction::RestartUnknown:
qWarning() << "restartType(Transaction::RestartUnknown)";
return QString();
}
qWarning() << "restart unrecognised: " << value;
return QString();
}
QString PkStrings::updateState(Transaction::UpdateState value)
{
switch (value) {
case Transaction::UpdateStateStable:
return i18n("Stable");
case Transaction::UpdateStateUnstable:
return i18n("Unstable");
case Transaction::UpdateStateTesting:
return i18n("Testing");
case Transaction::UpdateStateUnknown:
qWarning() << "updateState(Transaction::UnknownUpdateState)";
return QString();
}
qWarning() << "value unrecognised: " << value;
return QString();
}
QString PkStrings::mediaMessage(Transaction::MediaType value, const QString &text)
{
switch (value) {
case Transaction::MediaTypeCd :
return i18n("Please insert the CD labeled '%1', and press continue.", text);
case Transaction::MediaTypeDvd :
return i18n("Please insert the DVD labeled '%1', and press continue.", text);
case Transaction::MediaTypeDisc :
return i18n("Please insert the disc labeled '%1', and press continue.", text);
case Transaction::MediaTypeUnknown:
return i18n("Please insert the medium labeled '%1', and press continue.", text);
}
qWarning() << "value unrecognised: " << value;
return i18n("Please insert the medium labeled '%1', and press continue.", text);
}
QString PkStrings::daemonError(int value)
{
Transaction::InternalError statusEnum = static_cast<Transaction::InternalError>(value);
switch (statusEnum) {
case Transaction::InternalErrorFailedAuth :
return i18n("You do not have the necessary privileges to perform this action.");
case Transaction::InternalErrorNoTid :
return i18n("Could not get a transaction id from packagekitd.");
case Transaction::InternalErrorAlreadyTid :
return i18n("Cannot connect to this transaction id.");
case Transaction::InternalErrorRoleUnkown :
return i18n("This action is unknown.");
case Transaction::InternalErrorCannotStartDaemon :
return i18n("The packagekitd service could not be started.");
case Transaction::InternalErrorInvalidInput :
return i18n("The query is not valid.");
case Transaction::InternalErrorInvalidFile :
return i18n("The file is not valid.");
case Transaction::InternalErrorFunctionNotSupported :
return i18n("This function is not yet supported.");
case Transaction::InternalErrorDaemonUnreachable :
return i18n("Could not talk to packagekitd.");
case Transaction::InternalErrorFailed:
return i18n("Error talking to packagekitd.");
case Transaction::InternalErrorNone:
case Transaction::InternalErrorUnkown :
return i18n("An unknown error happened.");
}
qWarning() << "value unrecognised: " << value;
return i18n("An unknown error happened.");
}
QString PkStrings::prettyFormatDuration(unsigned long mSec)
{
return KFormat().formatDuration(mSec);
}
QString PkStrings::lastCacheRefreshTitle(uint lastTime)
{
unsigned long fifteen = 60 * 60 * 24 * 15;
unsigned long thirty = 60 * 60 * 24 * 30;
if (lastTime != UINT_MAX && lastTime < fifteen) {
return i18n("Your system is up to date");
} else if (lastTime != UINT_MAX && lastTime > fifteen && lastTime < thirty) {
return i18n("You have no updates");
}
return i18n("Last check for updates was more than a month ago");
}
QString PkStrings::lastCacheRefreshSubTitle(uint lastTime)
{
unsigned long thirty = 60 * 60 * 24 * 30;
if (lastTime != UINT_MAX && lastTime < thirty) {
return i18n("Verified %1 ago", PkStrings::prettyFormatDuration(lastTime * 1000));
}
return i18n("It's strongly recommended that you check for new updates now");
}
0707010000000A000081A40000000000000000000000016222738900000B9F000000000000000000000000000000000000003A00000000plasma-pk-updates-0.3.2+git70/src/declarative/PkStrings.h/***************************************************************************
* Copyright (C) 2008-2012 by Daniel Nicoletti *
* dantti12@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; see the file COPYING. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef PK_STRINGS_H
#define PK_STRINGS_H
#include <PackageKit/Transaction>
class PkStrings : public QObject
{
Q_OBJECT
public slots:
static QString infoPresent(PackageKit::Transaction::Info info);
static QString infoPast(PackageKit::Transaction::Info info);
static QString error(PackageKit::Transaction::Error error);
static QString errorMessage(PackageKit::Transaction::Error error);
static QString status(PackageKit::Transaction::Status status, uint speed = 0, qulonglong downloadRemaining = 0);
static QString statusPast(PackageKit::Transaction::Status status);
static QString groups(PackageKit::Transaction::Group group);
static QString info(int state);
static QString packageQuantity(bool updates, int packages, int selected);
static QString updateState(PackageKit::Transaction::UpdateState value);
static QString restartType(PackageKit::Transaction::Restart value);
static QString restartTypeFuture(PackageKit::Transaction::Restart value);
static QString action(PackageKit::Transaction::Role role, PackageKit::Transaction::TransactionFlags flags);
static QString actionPast(PackageKit::Transaction::Role action);
static QString mediaMessage(PackageKit::Transaction::MediaType value, const QString &text);
static QString daemonError(int value);
static QString prettyFormatDuration(unsigned long mSec);
static QString lastCacheRefreshTitle(uint lastTime);
static QString lastCacheRefreshSubTitle(uint lastTime);
};
#endif
0707010000000B000081A40000000000000000000000016222738900000482000000000000000000000000000000000000003700000000plasma-pk-updates-0.3.2+git70/src/declarative/main.cpp/*
Copyright (C) 2014 Lukáš Tinkl <lukas@kde.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtWidgets/QApplication>
#include "pkupdates.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setOrganizationName("KDE");
app.setOrganizationDomain("kde.org");
app.setApplicationName("PkConsole");
app.setApplicationVersion(PROJECT_VERSION);
PkUpdates * upd = new PkUpdates(qApp);
QObject::connect(upd, &PkUpdates::done, qApp, &QCoreApplication::quit);
return app.exec();
}
0707010000000C000081A4000000000000000000000001622273890000705E000000000000000000000000000000000000003C00000000plasma-pk-updates-0.3.2+git70/src/declarative/pkupdates.cpp/***************************************************************************
* Copyright (C) 2015 Lukáš Tinkl <lukas@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; see the file COPYING. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <limits.h>
#include <QDebug>
#include <QTimer>
#include <QDBusReply>
#include <QDBusInterface>
#include <KLocalizedString>
#include <KFormat>
#include <KNotification>
#include <Solid/Power>
#include <Solid/AcPluggedJob>
#include <KConfigGroup>
#include <KSharedConfig>
#include "pkupdates.h"
#include "PkStrings.h"
Q_LOGGING_CATEGORY(PLASMA_PK_UPDATES, "plasma-pk-updates")
namespace
{
const auto s_pkUpdatesIconName = QStringLiteral("system-software-update");
const auto s_componentName = QStringLiteral("plasma_pk_updates");
const auto s_eventIdUpdatesAvailable = QStringLiteral("updatesAvailable");
const auto s_eventIdUpdatesInstalled = QStringLiteral("updatesInstalled");
const auto s_eventIdRestartRequired = QStringLiteral("restartRequired");
const auto s_eventIdError = QStringLiteral("updateError");
} // namespace {
PkUpdates::PkUpdates(QObject *parent) :
QObject(parent),
m_isOnBattery(true)
{
setStatusMessage(i18n("Idle"));
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::changed, this, &PkUpdates::onChanged);
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::updatesChanged, this, &PkUpdates::onUpdatesChanged);
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::networkStateChanged, this, &PkUpdates::networkStateChanged);
connect(Solid::Power::self(), &Solid::Power::resumeFromSuspend, this,
[this] {PackageKit::Daemon::stateHasChanged(QStringLiteral("resume"));});
connect(Solid::Power::self(), &Solid::Power::acPluggedChanged, this, [this] (bool acPlugged) {
qCDebug(PLASMA_PK_UPDATES) << "acPluggedChanged onBattery:" << m_isOnBattery << "->" << !acPlugged;
if (!acPlugged != m_isOnBattery) {
m_isOnBattery = !acPlugged;
emit PkUpdates::isOnBatteryChanged();
}
});
auto acPluggedJob = Solid::Power::self()->isAcPlugged(this);
connect(acPluggedJob , &Solid::Job::result, this, [this] (Solid::Job* job) {
bool acPlugged = static_cast<Solid::AcPluggedJob*>(job)->isPlugged();
qCDebug(PLASMA_PK_UPDATES) << "acPlugged initial state" << acPlugged;
m_isOnBattery = !acPlugged;
emit PkUpdates::isOnBatteryChanged();
});
acPluggedJob->start();
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::networkStateChanged, this, &PkUpdates::doDelayedCheckUpdates);
connect(this, &PkUpdates::isActiveChanged, this, &PkUpdates::messageChanged);
connect(this, &PkUpdates::networkStateChanged, this, &PkUpdates::messageChanged);
}
PkUpdates::~PkUpdates()
{
if (m_cacheTrans) {
if (m_cacheTrans->allowCancel())
m_cacheTrans->cancel();
m_cacheTrans->deleteLater();
}
if (m_updatesTrans) {
if (m_updatesTrans->allowCancel())
m_updatesTrans->cancel();
m_updatesTrans->deleteLater();
}
if (m_installTrans) {
m_installTrans->deleteLater();
}
if (m_detailTrans) {
m_detailTrans->deleteLater();
}
}
int PkUpdates::count() const
{
return m_updateList.count();
}
int PkUpdates::importantCount() const
{
return m_importantList.count();
}
int PkUpdates::securityCount() const
{
return m_securityList.count();
}
bool PkUpdates::isSystemUpToDate() const
{
return m_updateList.isEmpty();
}
QString PkUpdates::iconName() const
{
if (securityCount() > 0) {
return QStringLiteral("update-high");
} else if (importantCount() > 0) {
return QStringLiteral("update-medium");
} else if (count() > 0) {
return QStringLiteral("update-low");
} else {
return QStringLiteral("update-none");
}
}
QString PkUpdates::message() const
{
if (isActive()) {
if (m_activity == CheckingUpdates)
return i18n("Checking updates");
else if (m_activity == GettingUpdates)
return i18n("Getting updates");
else if (m_activity == InstallingUpdates)
return i18n("Installing updates");
return i18n("Working");
} else if (!isSystemUpToDate()) {
QStringList extra;
const QString msg = i18np("You have 1 new update", "You have %1 new updates", count());
if (securityCount() > 0)
extra += i18np("1 security update", "%1 security updates", securityCount());
if (importantCount() > 0)
extra += i18np("1 important update", "%1 important updates", importantCount());
if (extra.isEmpty())
return msg;
else
return msg + "\n" + i18n("(including %1)", extra.join(i18n(" and ")));
} else if (!isNetworkOnline()) {
return i18n("Your system is offline");
}
switch (m_lastCheckState) {
case NoCheckDone:
return i18n("Not checked for updates yet");
default:
case CheckFailed:
return i18n("Checking for updates failed");
case CheckSucceeded:
return i18n("Your system is up to date");
}
}
int PkUpdates::percentage() const
{
return m_percentage;
}
QString PkUpdates::statusMessage() const
{
return m_statusMessage;
}
bool PkUpdates::isActive() const
{
return m_activity != Idle;
}
QVariantMap PkUpdates::packages() const
{
return m_updateList;
}
bool PkUpdates::isNetworkOnline() const
{
qCDebug(PLASMA_PK_UPDATES) << "Is net online:" << (PackageKit::Daemon::networkState() > PackageKit::Daemon::Network::NetworkOffline);
return (PackageKit::Daemon::networkState() > PackageKit::Daemon::Network::NetworkOffline);
}
void PkUpdates::doDelayedCheckUpdates()
{
if (m_checkUpdatesWhenNetworkOnline && isNetworkOnline())
{
qCDebug(PLASMA_PK_UPDATES) << "CheckUpdates was delayed. Doing it now";
m_checkUpdatesWhenNetworkOnline = false;
checkUpdates(m_isManualCheck /* manual */);
}
}
bool PkUpdates::isNetworkMobile() const
{
qCDebug(PLASMA_PK_UPDATES) << "Is net mobile:" << (PackageKit::Daemon::networkState() == PackageKit::Daemon::Network::NetworkMobile);
return (PackageKit::Daemon::networkState() == PackageKit::Daemon::Network::NetworkMobile);
}
bool PkUpdates::isOnBattery() const
{
qCDebug(PLASMA_PK_UPDATES) << "Is on battery:" << m_isOnBattery;
return m_isOnBattery;
}
bool PkUpdates::lastCheckSuccessful() const
{
const bool ret = m_lastCheckState == CheckSucceeded;
qCDebug(PLASMA_PK_UPDATES) << "Last check successful:" << ret;
return ret;
}
void PkUpdates::getUpdateDetails(const QString &pkgID)
{
qCDebug(PLASMA_PK_UPDATES) << "Requesting update details for" << pkgID;
m_detailTrans = PackageKit::Daemon::getUpdateDetail(pkgID);
connect(m_detailTrans.data(), &PackageKit::Transaction::updateDetail, this, &PkUpdates::onUpdateDetail);
}
QString PkUpdates::timestamp() const
{
const qint64 lastCheck = QDateTime::currentMSecsSinceEpoch() - lastRefreshTimestamp();
if (lastCheck != -1)
return i18n("Last check: %1 ago", KFormat().formatSpelloutDuration(lastCheck));
return i18n("Last check: never");
}
void PkUpdates::checkUpdates(bool manual)
{
m_isManualCheck = manual;
if (!isNetworkOnline())
{
qCDebug(PLASMA_PK_UPDATES) << "Checking updates delayed. Network is offline";
m_checkUpdatesWhenNetworkOnline = true;
return;
}
qCDebug(PLASMA_PK_UPDATES) << "Checking for updates";
// ask the Packagekit daemon to refresh the cache
m_cacheTrans = PackageKit::Daemon::refreshCache(false);
setActivity(CheckingUpdates);
// evaluate the result
connect(m_cacheTrans.data(), &PackageKit::Transaction::statusChanged, this, &PkUpdates::onStatusChanged);
connect(m_cacheTrans.data(), &PackageKit::Transaction::finished, this, &PkUpdates::onFinished);
connect(m_cacheTrans.data(), &PackageKit::Transaction::errorCode, this, &PkUpdates::onRefreshErrorCode);
connect(m_cacheTrans.data(), &PackageKit::Transaction::requireRestart, this, &PkUpdates::onRequireRestart);
connect(m_cacheTrans.data(), &PackageKit::Transaction::repoSignatureRequired, this, &PkUpdates::onRepoSignatureRequired);
}
qint64 PkUpdates::lastRefreshTimestamp() const
{
KConfigGroup grp(KSharedConfig::openConfig("plasma-pk-updates"), "General");
return grp.readEntry<qint64>("Timestamp", -1);
}
QString PkUpdates::packageName(const QString &pkgId)
{
return PackageKit::Daemon::packageName(pkgId);
}
QString PkUpdates::packageVersion(const QString &pkgId)
{
return PackageKit::Daemon::packageVersion(pkgId);
}
void PkUpdates::getUpdates()
{
m_updatesTrans = PackageKit::Daemon::getUpdates();
setActivity(GettingUpdates);
m_updateList.clear();
m_importantList.clear();
m_securityList.clear();
connect(m_updatesTrans.data(), &PackageKit::Transaction::statusChanged, this, &PkUpdates::onStatusChanged);
connect(m_updatesTrans.data(), &PackageKit::Transaction::finished, this, &PkUpdates::onFinished);
connect(m_updatesTrans.data(), &PackageKit::Transaction::errorCode, this, &PkUpdates::onErrorCode);
connect(m_updatesTrans.data(), &PackageKit::Transaction::package, this, &PkUpdates::onPackage);
connect(m_updatesTrans.data(), &PackageKit::Transaction::requireRestart, this, &PkUpdates::onRequireRestart);
connect(m_updatesTrans.data(), &PackageKit::Transaction::repoSignatureRequired, this, &PkUpdates::onRepoSignatureRequired);
}
void PkUpdates::installUpdates(const QStringList &packageIds, bool simulate, bool untrusted)
{
qCDebug(PLASMA_PK_UPDATES) << "Installing updates" << packageIds << ", simulate:" << simulate << ", untrusted:" << untrusted;
PackageKit::Transaction::TransactionFlags flags = PackageKit::Transaction::TransactionFlagOnlyTrusted;
if (simulate) {
flags |= PackageKit::Transaction::TransactionFlagSimulate;
} else if (untrusted) {
flags = PackageKit::Transaction::TransactionFlagNone;
}
m_restartType = PackageKit::Transaction::RestartNone;
m_requiredEulas.clear();
m_packages = packageIds;
m_installTrans = PackageKit::Daemon::updatePackages(m_packages, flags);
setActivity(InstallingUpdates);
connect(m_installTrans.data(), &PackageKit::Transaction::statusChanged, this, &PkUpdates::onStatusChanged);
connect(m_installTrans.data(), &PackageKit::Transaction::finished, this, &PkUpdates::onFinished);
connect(m_installTrans.data(), &PackageKit::Transaction::errorCode, this, &PkUpdates::onErrorCode);
connect(m_installTrans.data(), &PackageKit::Transaction::package, this, &PkUpdates::onPackageUpdating);
connect(m_installTrans.data(), &PackageKit::Transaction::requireRestart, this, &PkUpdates::onRequireRestart);
connect(m_installTrans.data(), &PackageKit::Transaction::repoSignatureRequired, this, &PkUpdates::onRepoSignatureRequired);
connect(m_installTrans.data(), &PackageKit::Transaction::eulaRequired, this, &PkUpdates::onEulaRequired);
}
void PkUpdates::onChanged()
{
qCDebug(PLASMA_PK_UPDATES) << "Daemon changed";
}
void PkUpdates::onUpdatesChanged()
{
qCDebug(PLASMA_PK_UPDATES) << "Updates changed, getting updates!";
getUpdates();
}
void PkUpdates::onStatusChanged()
{
PackageKit::Transaction * trans;
if ((trans = qobject_cast<PackageKit::Transaction *>(sender()))) {
qCDebug(PLASMA_PK_UPDATES) << "Transaction status changed:"
<< PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)trans->status(), "Status")
<< QStringLiteral("(%1%)").arg(trans->percentage());
if (trans->status() == PackageKit::Transaction::StatusFinished)
return;
setStatusMessage(PkStrings::status(trans->status(), trans->speed(), trans->downloadSizeRemaining()));
setPercentage(trans->percentage());
}
}
void PkUpdates::onPackage(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary)
{
qCDebug(PLASMA_PK_UPDATES) << "Got update package:" << packageID << ", summary:" << summary <<
", type:" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)info, "Info");
switch (info) {
case PackageKit::Transaction::InfoBlocked:
// Blocked updates are not installable updates so there is no
// reason to show/count them
return;
case PackageKit::Transaction::InfoImportant:
m_importantList << packageID;
break;
case PackageKit::Transaction::InfoSecurity:
m_securityList << packageID;
break;
default:
break;
}
m_updateList.insert(packageID, summary);
}
void PkUpdates::onPackageUpdating(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary)
{
Q_UNUSED(summary)
qCDebug(PLASMA_PK_UPDATES) << "Package updating:" << packageID <<
", info:" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)info, "Info");
const uint percent = m_installTrans->percentage();
if (percent <= 100) {
setStatusMessage(i18nc("1 installation status, 2 pkg name, 3 percentage", "%1 %2 (%3%)",
PkStrings::infoPresent(info), PackageKit::Daemon::packageName(packageID), percent));
} else {
setStatusMessage(i18nc("1 installation status, 2 pkg name", "%1 %2",
PkStrings::infoPresent(info), PackageKit::Daemon::packageName(packageID), percent));
}
setPercentage(percent);
}
void PkUpdates::onFinished(PackageKit::Transaction::Exit status, uint runtime)
{
PackageKit::Transaction * trans = qobject_cast<PackageKit::Transaction *>(sender());
if (!trans)
return;
trans->deleteLater();
qCDebug(PLASMA_PK_UPDATES) << "Transaction" << trans->tid().path() <<
"finished with status" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)status, "Exit") <<
"in" << runtime/1000 << "seconds";
auto oldLastCheckState = m_lastCheckState;
if (trans->role() == PackageKit::Transaction::RoleRefreshCache) {
m_lastCheckState = status == PackageKit::Transaction::ExitSuccess ? CheckSucceeded : CheckFailed;
if (m_lastCheckState == CheckSucceeded) {
qCDebug(PLASMA_PK_UPDATES) << "Cache transaction finished successfully";
// save the timestamp
KConfigGroup grp(KSharedConfig::openConfig("plasma-pk-updates"), "General");
grp.writeEntry("Timestamp", QDateTime::currentDateTime().toMSecsSinceEpoch());
grp.writeEntry("FailedAutoRefeshCount", 0);
grp.sync();
return;
} else {
qCDebug(PLASMA_PK_UPDATES) << "Cache transaction didn't finish successfully";
emit done();
}
} else if (trans->role() == PackageKit::Transaction::RoleGetUpdates) {
m_lastCheckState = status == PackageKit::Transaction::ExitSuccess ? CheckSucceeded : CheckFailed;
if (m_lastCheckState == CheckSucceeded) {
qCDebug(PLASMA_PK_UPDATES) << "Check updates transaction finished successfully";
const int upCount = count();
if (upCount != m_lastUpdateCount && m_lastNotification) {
qCDebug(PLASMA_PK_UPDATES) << "Disposing old update count notification";
m_lastNotification->close();
}
if (upCount > 0 && upCount != m_lastUpdateCount) {
m_lastUpdateCount = upCount;
m_lastNotification = KNotification::event(s_eventIdUpdatesAvailable,
QString(),
i18np("You have 1 new update", "You have %1 new updates", upCount),
s_pkUpdatesIconName, nullptr, KNotification::Persistent,
s_componentName);
connect(m_lastNotification, &KNotification::closed, this, [this] {
qCDebug(PLASMA_PK_UPDATES) << "Old notification closed";
m_lastNotification = nullptr;
m_lastUpdateCount = 0;
});
}
} else {
qCDebug(PLASMA_PK_UPDATES) << "Check updates transaction didn't finish successfully";
}
qCDebug(PLASMA_PK_UPDATES) << "Total number of updates: " << count();
emit done();
} else if (trans->role() == PackageKit::Transaction::RoleUpdatePackages) {
qCDebug(PLASMA_PK_UPDATES) << "Finished updating packages:" << m_packages;
if (status == PackageKit::Transaction::ExitNeedUntrusted) {
qCDebug(PLASMA_PK_UPDATES) << "Transaction needs untrusted packages";
// restart transaction with "untrusted" flag
installUpdates(m_packages, false /*simulate*/, true /*untrusted*/);
return;
} else if (status == PackageKit::Transaction::ExitEulaRequired) {
qCDebug(PLASMA_PK_UPDATES) << "Acceptance of EULAs required";
promptNextEulaAgreement();
return;
} else if (status == PackageKit::Transaction::ExitSuccess && trans->transactionFlags().testFlag(PackageKit::Transaction::TransactionFlagSimulate)) {
qCDebug(PLASMA_PK_UPDATES) << "Simulation finished with success, restarting the transaction";
installUpdates(m_packages, false /*simulate*/, false /*untrusted*/);
return;
} else if (status == PackageKit::Transaction::ExitSuccess) {
qCDebug(PLASMA_PK_UPDATES) << "Update packages transaction finished successfully";
if (m_lastNotification) {
m_lastNotification->close();
}
KNotification::event(s_eventIdUpdatesInstalled,
i18n("Updates Installed"),
i18np("Successfully updated %1 package", "Successfully updated %1 packages", m_packages.count()),
s_pkUpdatesIconName, nullptr,
KNotification::CloseOnTimeout,
s_componentName);
showRestartNotification();
emit updatesInstalled();
} else {
qCDebug(PLASMA_PK_UPDATES) << "Update packages transaction didn't finish successfully";
// just try to refresh cache in case of error, the user might have installed the updates manually meanwhile
checkUpdates(false /* manual */);
return;
}
setActivity(Idle);
return;
} else {
qCDebug(PLASMA_PK_UPDATES) << "Unhandled transaction type:" << PackageKit::Daemon::enumToString<PackageKit::Transaction>(trans->role(), "Role");
setActivity(Idle);
return;
}
if (oldLastCheckState != m_lastCheckState) {
emit lastCheckSuccessfulChanged();
}
setActivity(Idle);
emit updatesChanged();
}
void PkUpdates::onErrorCode(PackageKit::Transaction::Error error, const QString &details)
{
showError(error, details);
}
void PkUpdates::onRefreshErrorCode(PackageKit::Transaction::Error error, const QString &details)
{
if(!m_isManualCheck) {
auto isTransientError = [] (PackageKit::Transaction::Error error) {
return (error == PackageKit::Transaction::ErrorFailedInitialization) ||
(error == PackageKit::Transaction::ErrorNotAuthorized) ||
(error == PackageKit::Transaction::ErrorNoNetwork) ||
(error == PackageKit::Transaction::ErrorCannotGetLock);
};
KConfigGroup grp(KSharedConfig::openConfig("plasma-pk-updates"), "General");
auto failCount = grp.readEntry<qint64>("FailedAutoRefeshCount", 0);
failCount += 1;
grp.writeEntry("FailedAutoRefeshCount", failCount);
grp.sync();
if(failCount <= 1 && isTransientError(error)) {
qDebug(PLASMA_PK_UPDATES) << "Ignoring notification for likely transient error during automatic check";
return;
}
}
showError(error, details);
}
void PkUpdates::showError(PackageKit::Transaction::Error error, const QString &details)
{
qWarning() << "PK error:" << details << "type:" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)error, "Error");
if (error == PackageKit::Transaction::ErrorBadGpgSignature || error == PackageKit::Transaction::ErrorNoLicenseAgreement)
return;
KNotification::event(s_eventIdError, i18n("Update Error"),
details,
s_pkUpdatesIconName, nullptr,
KNotification::Persistent,
s_componentName);
}
void PkUpdates::onRequireRestart(PackageKit::Transaction::Restart type, const QString &packageID)
{
PackageKit::Transaction * trans = qobject_cast<PackageKit::Transaction *>(sender());
if (!trans)
return;
qCDebug(PLASMA_PK_UPDATES) << "RESTART" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)type, "Restart")
<< "is required for package" << packageID;
// Only replace if the new type has a higher place in the list than the current one.
static const PackageKit::Transaction::Restart restart_order[] = {
PackageKit::Transaction::RestartNone,
PackageKit::Transaction::RestartApplication,
PackageKit::Transaction::RestartSession,
PackageKit::Transaction::RestartSecuritySession,
PackageKit::Transaction::RestartSystem,
PackageKit::Transaction::RestartSecuritySystem,
};
auto prio_current = std::find(std::begin(restart_order), std::end(restart_order), m_restartType),
prio_new = std::find(std::begin(restart_order), std::end(restart_order), type);
if(prio_new == std::end(restart_order)) {
qWarning() << "Unknown/unhandled restart type" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)type, "Restart");
return;
}
// Compare the priority
if(std::distance(prio_current, prio_new) <= 0)
return;
m_restartType = type;
m_restartPackageID = packageID;
}
void PkUpdates::showRestartNotification()
{
KNotification *notification = nullptr;
bool reboot = false;
switch(m_restartType)
{
case PackageKit::Transaction::RestartSystem:
case PackageKit::Transaction::RestartSecuritySystem:
notification = new KNotification(s_eventIdRestartRequired, KNotification::Persistent);
notification->setActions(QStringList{QLatin1String("Restart")});
notification->setTitle(i18n("Restart is required"));
notification->setText(i18n("The computer will have to be restarted after the update for the changes to take effect."));
reboot = true;
break;
case PackageKit::Transaction::RestartSession:
case PackageKit::Transaction::RestartSecuritySession:
notification = new KNotification(s_eventIdRestartRequired, KNotification::Persistent);
notification->setActions(QStringList{QLatin1String("Logout")});
notification->setTitle(i18n("Session restart is required"));
notification->setText(i18n("You will need to log out and back in after the update for the changes to take effect."));
break;
case PackageKit::Transaction::RestartNone:
case PackageKit::Transaction::RestartApplication:
return;
default:
qWarning() << "Unknown/unhandled restart type" << PackageKit::Daemon::enumToString<PackageKit::Transaction>((int)m_restartType, "Restart");
return;
}
notification->setComponentName(s_componentName);
notification->setIconName(s_pkUpdatesIconName);
connect(notification, &KNotification::action1Activated, this, [reboot] () {
QDBusInterface interface("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface", QDBusConnection::sessionBus());
if (reboot) {
interface.asyncCall("logout", 0, 1, 2); // Options: do not ask again | reboot | force
} else {
interface.asyncCall("logout", 0, 0, 2); // Options: do not ask again | logout | force
}
});
notification->sendEvent();
}
void PkUpdates::onUpdateDetail(const QString &packageID, const QStringList &updates, const QStringList &obsoletes,
const QStringList &vendorUrls, const QStringList &bugzillaUrls, const QStringList &cveUrls,
PackageKit::Transaction::Restart restart, const QString &updateText, const QString &changelog,
PackageKit::Transaction::UpdateState state, const QDateTime &issued, const QDateTime &updated)
{
Q_UNUSED(updates);
Q_UNUSED(obsoletes);
Q_UNUSED(vendorUrls);
Q_UNUSED(cveUrls);
Q_UNUSED(restart);
Q_UNUSED(changelog);
Q_UNUSED(state);
Q_UNUSED(issued);
Q_UNUSED(updated);
qCDebug(PLASMA_PK_UPDATES) << "Got update details for" << packageID;
emit updateDetail(packageID, updateText, bugzillaUrls);
}
void PkUpdates::onRepoSignatureRequired(const QString &packageID, const QString &repoName, const QString &keyUrl, const QString &keyUserid,
const QString &keyId, const QString &keyFingerprint, const QString &keyTimestamp,
PackageKit::Transaction::SigType type)
{
Q_UNUSED(repoName);
Q_UNUSED(keyUrl);
Q_UNUSED(keyUserid);
Q_UNUSED(keyId);
Q_UNUSED(keyFingerprint);
Q_UNUSED(keyTimestamp);
Q_UNUSED(type);
// TODO provide a way to confirm and import GPG keys
qCDebug(PLASMA_PK_UPDATES) << "Repo sig required" << packageID;
}
void PkUpdates::onEulaRequired(const QString &eulaID, const QString &packageID, const QString &vendor, const QString &licenseAgreement)
{
m_requiredEulas[eulaID] = {packageID, vendor, licenseAgreement};
}
void PkUpdates::promptNextEulaAgreement()
{
if(m_requiredEulas.empty()) {
// Restart the transaction
installUpdates(m_packages, false, false);
return;
}
QString eulaID = m_requiredEulas.firstKey();
const EulaData &eula = m_requiredEulas[eulaID];
emit eulaRequired(eulaID, eula.packageID, eula.vendor, eula.licenseAgreement);
}
void PkUpdates::eulaAgreementResult(const QString &eulaID, bool agreed)
{
if(!agreed) {
qCDebug(PLASMA_PK_UPDATES) << "EULA declined";
// Do the same as the failure case in onFinished
checkUpdates(m_isManualCheck /* manual */);
return;
}
m_eulaTrans = PackageKit::Daemon::acceptEula(eulaID);
connect(m_eulaTrans.data(), &PackageKit::Transaction::finished, this,
[this, eulaID] (PackageKit::Transaction::Exit exit, uint) {
if (exit == PackageKit::Transaction::ExitSuccess) {
m_requiredEulas.remove(eulaID);
promptNextEulaAgreement();
} else {
qCWarning(PLASMA_PK_UPDATES) << "EULA acceptance failed";
}
}
);
}
void PkUpdates::setStatusMessage(const QString &message)
{
m_statusMessage = message;
emit statusMessageChanged();
}
void PkUpdates::setActivity(Activity act)
{
if (act != m_activity) {
m_activity = act;
emit isActiveChanged();
}
}
void PkUpdates::setPercentage(int value)
{
if (value != m_percentage) {
m_percentage = value;
emit percentageChanged();
}
}
0707010000000D000081A400000000000000000000000162227389000029F0000000000000000000000000000000000000003A00000000plasma-pk-updates-0.3.2+git70/src/declarative/pkupdates.h/***************************************************************************
* Copyright (C) 2015 Lukáš Tinkl <lukas@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; see the file COPYING. If not, write to *
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef PLASMA_PK_UPDATES_H
#define PLASMA_PK_UPDATES_H
#include <QObject>
#include <QPointer>
#include <QLoggingCategory>
#include <PackageKit/Daemon>
#include <PackageKit/Transaction>
class QTimer;
class KNotification;
Q_DECLARE_LOGGING_CATEGORY(PLASMA_PK_UPDATES)
/**
* @brief The PkUpdates class
*
* Backend class to check for available PackageKit system updates.
* Use checkUpdates() to perform the check, retrieve them with packages()
*/
class PkUpdates : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY updatesChanged)
Q_PROPERTY(int importantCount READ importantCount NOTIFY updatesChanged)
Q_PROPERTY(int securityCount READ securityCount NOTIFY updatesChanged)
Q_PROPERTY(bool isSystemUpToDate READ isSystemUpToDate NOTIFY updatesChanged)
Q_PROPERTY(QString iconName READ iconName NOTIFY updatesChanged)
Q_PROPERTY(QString message READ message NOTIFY messageChanged)
Q_PROPERTY(int percentage READ percentage NOTIFY percentageChanged)
Q_PROPERTY(QString timestamp READ timestamp NOTIFY updatesChanged)
Q_PROPERTY(QString statusMessage READ statusMessage NOTIFY statusMessageChanged)
Q_PROPERTY(QVariantMap packages READ packages NOTIFY updatesChanged)
Q_PROPERTY(bool isActive READ isActive NOTIFY isActiveChanged)
Q_PROPERTY(bool isNetworkOnline READ isNetworkOnline NOTIFY networkStateChanged)
Q_PROPERTY(bool isNetworkMobile READ isNetworkMobile NOTIFY networkStateChanged)
Q_PROPERTY(bool isOnBattery READ isOnBattery NOTIFY isOnBatteryChanged)
Q_PROPERTY(bool lastCheckSuccessful READ lastCheckSuccessful NOTIFY lastCheckSuccessfulChanged)
public:
enum Activity {Idle, CheckingUpdates, GettingUpdates, InstallingUpdates};
Q_ENUM(Activity)
explicit PkUpdates(QObject *parent = nullptr);
~PkUpdates();
/**
* @return the total number of updates, including important and/or security ones
*/
int count() const;
/**
* @return the number of important updates, included in total count()
*/
int importantCount() const;
/**
* @return the number of security updates, included in total count()
*/
int securityCount() const;
/**
* @return whether the system is up to date (count() == 0)
*/
bool isSystemUpToDate() const;
/**
* @return the system update status icon name
*/
QString iconName() const;
/**
* @return the overall status with number of available updates
*/
QString message() const;
/**
* @return the progress percentage (0..100), 101 as a special value indicating indeterminate value
*/
int percentage() const;
/**
* @return time stamp of the last update check
*/
QString timestamp() const;
/**
* @return status messsage conveying the action being currently performed
*/
QString statusMessage() const;
/**
* @return whether we're currently checking for updates or not
*/
bool isActive() const;
/**
* @return the packages to update (key=packageId, value=description)
*/
QVariantMap packages() const;
/**
* @return whether the network is online
*/
bool isNetworkOnline() const;
/**
* @return whether we are on a mobile network connection (assumes isNetworkOnline())
*/
bool isNetworkMobile() const;
/**
* @return whether we are running on battery
*/
bool isOnBattery() const;
/**
* @return whether the last check for updates succeeded
*/
bool lastCheckSuccessful() const;
signals:
/**
* Emitted when the number uf updates has changed
*/
void updatesChanged();
/**
* Emitted when the updates check is finished (with success or error)
*/
void done();
/**
* Emitted after updates were installed successfully
*/
void updatesInstalled();
/**
* Emitted with update details
* @see getUpdateDetails()
*/
void updateDetail(const QString &packageID, const QString &updateText, const QStringList &urls);
/**
* Emitted when an EULA agreement prevents the transaction from running
* @param eulaId the EULA identifier
* @param packageID ID of the package for which an EULA is required
* @param vendorName the vendor name
* @param licenseAgreement the EULA text
*
* @see eulaAgreementResult()
*/
void eulaRequired(const QString &eulaID, const QString &packageID, const QString &vendor, const QString &licenseAgreement);
// private ;)
void statusMessageChanged();
void isActiveChanged();
void percentageChanged();
void networkStateChanged();
void isOnBatteryChanged();
void lastCheckSuccessfulChanged();
void messageChanged();
public slots:
/**
* Perform a cache update, possibly resulting in an update check. Signal updatesChanged() gets emitted
* as a result. Consult the count() property whether there are new updates available.
*
* @param manual whether this check was triggered via explicit user interaction
*/
Q_INVOKABLE void checkUpdates(bool manual = false);
/**
* Launch the update process
*
* @param packageIds list of package IDs to update
*/
Q_INVOKABLE void installUpdates(const QStringList & packageIds, bool simulate = true, bool untrusted = false);
/**
* @return the timestamp (in milliseconds) of the last cache check, -1 if never
*/
Q_INVOKABLE qint64 lastRefreshTimestamp() const;
/**
* @return the package name extracted from its ID
*/
Q_INVOKABLE static QString packageName(const QString & pkgId);
/**
* @return the package version extracted from its ID
*/
Q_INVOKABLE static QString packageVersion(const QString & pkgId);
/**
* Request details about the details
* @param pkgIds Package IDs
*
* Emits updateDetail()
*/
Q_INVOKABLE void getUpdateDetails(const QString & pkgID);
Q_INVOKABLE void doDelayedCheckUpdates();
/**
* If agreed to eulaID, starts an EULA acceptance transaction and continues.
*/
Q_INVOKABLE void eulaAgreementResult(const QString &eulaID, bool agreed);
private slots:
void getUpdates();
void onChanged();
void onUpdatesChanged();
void onStatusChanged();
void onPackage(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary);
void onPackageUpdating(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary);
void onFinished(PackageKit::Transaction::Exit status, uint runtime);
void onErrorCode(PackageKit::Transaction::Error error, const QString &details);
void onRefreshErrorCode(PackageKit::Transaction::Error error, const QString &details);
void onRequireRestart(PackageKit::Transaction::Restart type, const QString &packageID);
void onUpdateDetail(const QString &packageID, const QStringList &updates, const QStringList &obsoletes, const QStringList &vendorUrls,
const QStringList &bugzillaUrls, const QStringList &cveUrls, PackageKit::Transaction::Restart restart,
const QString &updateText, const QString &changelog, PackageKit::Transaction::UpdateState state,
const QDateTime &issued, const QDateTime &updated);
void onRepoSignatureRequired(const QString & packageID, const QString & repoName, const QString & keyUrl, const QString & keyUserid,
const QString & keyId, const QString & keyFingerprint, const QString & keyTimestamp, PackageKit::Transaction::SigType type);
void onEulaRequired(const QString &eulaID, const QString &packageID, const QString &vendor, const QString &licenseAgreement);
private:
struct EulaData {
QString packageID;
QString vendor;
QString licenseAgreement;
};
void setStatusMessage(const QString &message);
void setActivity(Activity act);
void setPercentage(int value);
void showError(PackageKit::Transaction::Error error, const QString &details);
void promptNextEulaAgreement();
void showRestartNotification();
QPointer<PackageKit::Transaction> m_updatesTrans;
QPointer<PackageKit::Transaction> m_cacheTrans;
QPointer<PackageKit::Transaction> m_installTrans;
QPointer<PackageKit::Transaction> m_detailTrans;
QPointer<PackageKit::Transaction> m_eulaTrans;
QStringList m_packages;
QPointer<KNotification> m_lastNotification;
int m_lastUpdateCount = 0;
QVariantMap m_updateList;
QStringList m_importantList;
QStringList m_securityList;
QString m_statusMessage;
int m_percentage = 0;
Activity m_activity = Idle;
enum {
NoCheckDone,
CheckFailed,
CheckSucceeded
} m_lastCheckState = NoCheckDone;
bool m_checkUpdatesWhenNetworkOnline = false;
bool m_isOnBattery;
// If the current check was triggered manually
bool m_isManualCheck;
// If a transaction failed because of required EULAs,
// this contains a map of their IDs to their data
QMap<QString, EulaData> m_requiredEulas;
PackageKit::Transaction::Restart m_restartType = PackageKit::Transaction::RestartNone;
QString m_restartPackageID;
};
#endif // PLASMA_PK_UPDATES_H
0707010000000E000081A40000000000000000000000016222738900003A8C000000000000000000000000000000000000004900000000plasma-pk-updates-0.3.2+git70/src/declarative/plasma_pk_updates.notifyrc[Global]
IconName=system-software-update
Comment=Software Updates
Comment[az]=Proqram Təminatı Yenilənmələri
Comment[ca]=Actualitzacions de programari
Comment[ca@valencia]=Actualitzacions de programari
Comment[cs]=Aktualizace software
Comment[da]=Softwareopdateringer
Comment[de]=Softwareaktualisierungen
Comment[en_GB]=Software Updates
Comment[es]=Actualizaciones de software
Comment[et]=Tarkvarauuendused
Comment[eu]=Software eguneratzeak
Comment[fi]=Ohjelmistopäivitykset
Comment[fr]=Mises à jour des logiciels
Comment[gl]=Actualizacións de software
Comment[hu]=Szoftverfrissítések
Comment[id]=Pembaruan Perangkat Lunak
Comment[it]=Aggiornamenti software
Comment[ko]=소프트웨어 업데이트
Comment[lt]=Programinės įrangos atnaujinimai
Comment[nl]=Elementen voor software bijwerken
Comment[nn]=Programoppdateringar
Comment[pa]=ਸਾਫਟਵੇਅਰ ਅੱਪਡੇਟ
Comment[pl]=Uaktualnienia oprogramowania
Comment[pt]=Actualizações de Aplicações
Comment[pt_BR]=Atualização de software
Comment[ro]=Actualizări de programe
Comment[ru]=Обновления программ
Comment[sk]=Aktualizácie softvéru
Comment[sl]=Programske posodobitve
Comment[sv]=Uppdateringar av programvara
Comment[tg]=Навсозиҳои нармафзор
Comment[tr]=Yazılım Güncellemeleri
Comment[uk]=Оновлення програм
Comment[x-test]=xxSoftware Updatesxx
Comment[zh_CN]=软件更新
Comment[zh_TW]=軟體更新
[Event/updatesAvailable]
Name=Updates Available
Name[az]=Yenilənmələr mövcuddur
Name[ca]=Actualitzacions disponibles
Name[ca@valencia]=Actualitzacions disponibles
Name[cs]=Jsou dostupné aktualizace
Name[da]=Opdateringer tilgængelige
Name[de]=Aktualisierungen verfügbar
Name[en_GB]=Updates Available
Name[es]=Actualizaciones disponibles
Name[et]=Saadaval on uuendusi
Name[eu]=Eguneratzeak erabilgarri
Name[fi]=Päivityksiä saatavilla
Name[fr]=Mises à jour disponibles
Name[gl]=Hai actualizacións dispoñíbeis
Name[hu]=Frissítések érhetőek el
Name[id]=Tersedia Pembaruan
Name[it]=Aggiornamenti disponibili
Name[ko]=업데이트 사용 가능
Name[lt]=Prieinami atnaujinimai
Name[nl]=Elementen voor bijwerken zijn beschikbaar
Name[nn]=Oppdateringar tilgjengelege
Name[pa]=ਅੱਪਡੇਟ ਉਪਲਬਧ ਹਨ
Name[pl]=Dostępne uaktualnienia
Name[pt]=Actualizações Disponíveis
Name[pt_BR]=Atualizações disponíveis
Name[ro]=Actualizări disponibile
Name[ru]=Доступны обновления
Name[sk]=Dostupné aktualizácie
Name[sl]=Na voljo so posodobitve
Name[sv]=Uppdateringar tillgängliga
Name[tg]=Навсозиҳо дастрасанд
Name[tr]=Güncellemeler Kullanılabilir
Name[uk]=Доступні оновлення
Name[x-test]=xxUpdates Availablexx
Name[zh_CN]=可用更新
Name[zh_TW]=有更新可用
Comment=Software updates for the system are available
Comment[az]=Sistem üçün proqram təminatı yenilənmələri əlçatandır
Comment[ca]=Hi ha disponibles actualitzacions de programari per al sistema
Comment[ca@valencia]=Hi ha disponibles actualitzacions de programari per al sistema
Comment[cs]=Jsou dostupné aktualizace systému
Comment[da]=Der er softwareopdateringer tilgængelige til systemet
Comment[de]=Software-Aktualisierungen für das System sind verfügbar
Comment[en_GB]=Software updates for the system are available
Comment[es]=Hay disponibles actualizaciones de software para el sistema
Comment[et]=Süsteemile on saadaval tarkvarauuendusi
Comment[eu]=Sistemaren eguneraketak erabilgarri daude
Comment[fi]=Järjestelmään on saatavilla ohjelmistopäivityksiä
Comment[fr]=Des mises à jour de logiciels pour le système sont disponibles
Comment[gl]=Hai actualizacións de software dispoñíbeis para o sistema
Comment[hu]=Szoftverfrissítések érhetők el a rendszerhez
Comment[id]=Pembaruan perangkat lunak untuk sistem telah tersedia
Comment[it]=Sono disponibili degli aggiornamenti software per il sistema
Comment[ko]=시스템 소프트웨어 업데이트 사용 가능
Comment[lt]=Sistemai yra prieinami programinės įrangos atnaujinimai
Comment[nl]=Er zijn elementen voor bijwerken van software voor het systeem beschikbaar
Comment[nn]=Det finst programoppdateringar for systemet
Comment[pa]=ਸਿਸਟਮ ਲਈ ਸਾਫਟਵੇਅਰ ਅੱਪਡੇਟ ਉਪਲੱਬਧ ਹਨ
Comment[pl]=Dostępne uaktualnienie oprogramowania
Comment[pt]=Estão disponíveis actualizações de aplicações do sistema
Comment[pt_BR]=Estão disponíveis atualizações de software para o sistema
Comment[ro]=Sunt disponibile actualizări de programe pentru sistem
Comment[ru]=Доступны обновления программного обеспечения
Comment[sk]=Sú dostupné softvérové aktualizácie systému
Comment[sl]=Na voljo so posodobitve programske opreme za sistem
Comment[sv]=Uppdateringar av programvara för systemet är tillgängliga
Comment[tg]=Навсозиҳои нармафзор барои низоми шумо дастрасанд
Comment[tr]=Sistem için kullanılabilir yazılım güncelleştirmeleri var
Comment[uk]=Випущено оновлення програмного забезпечення для вашої системи
Comment[x-test]=xxSoftware updates for the system are availablexx
Comment[zh_CN]=系统软件更新可用
Comment[zh_TW]=系統有可用的軟體更新
Action=Popup
[Event/updatesInstalled]
Name=Updates Installed
Name[az]=Yenilənmələr quraşdırıldı
Name[ca]=Actualitzacions instal·lades
Name[ca@valencia]=Actualitzacions instal·lades
Name[cs]=Aktualizace byly nainstalovány
Name[da]=Opdateringer installeret
Name[de]=Aktualisierungen installiert
Name[en_GB]=Updates Installed
Name[es]=Actualizaciones instaladas
Name[et]=Uuendused paigaldatud
Name[eu]=Eguneratzeak instalatu dira
Name[fi]=Päivitykset on asennettu
Name[fr]=Mises à jour installées
Name[gl]=Instaláronse as actualizacións
Name[hu]=Frissítések telepítve
Name[id]=Pembaruan Terinstal
Name[it]=Aggiornamenti installati
Name[ko]=업데이트 설치됨
Name[lt]=Atnaujinimai įdiegti
Name[nl]=Elementen voor bijwerken zijn geïnstalleerd
Name[nn]=Oppdateringar installerte
Name[pa]=ਅੱਪਡੇਟ ਇੰਸਟਾਲ ਹਨ
Name[pl]=Wgrano uaktualnienia
Name[pt]=Actualizações Instaladas
Name[pt_BR]=Atualizações instaladas
Name[ro]=Actualizări instalate
Name[ru]=Обновления установлены
Name[sk]=Aktualizácie nainštalované
Name[sl]=Posodobitve nameščene
Name[sv]=Uppdateringar installerade
Name[tg]=Навсозиҳо насб карда шудаанд
Name[tr]=Güncellemeler Kuruldu
Name[uk]=Встановлено оновлення
Name[x-test]=xxUpdates Installedxx
Name[zh_CN]=更新已安装
Name[zh_TW]=已安裝更新
Comment=The updates have been installed successfully
Comment[az]=Yenilənmələr müvəffəqiyyətlə quraşdırıldı
Comment[ca]=Les actualitzacions que s'han instal·lat correctament
Comment[ca@valencia]=Les actualitzacions que s'han instal·lat correctament
Comment[cs]=Aktualizace byly úspěšně nainstalovány
Comment[da]=Opdateringerne er blevet installeret
Comment[de]=Die Aktualisierungen wurden erfolgreich installiert
Comment[en_GB]=The updates have been installed successfully
Comment[es]=Se han instalado las actualizaciones satisfactoriamente
Comment[et]=Uuendused paigaldati edukalt
Comment[eu]=Eguneratzeak ondo instalatu dira
Comment[fi]=Päivitysten asentaminen onnistui
Comment[fr]=Les mises à jour ont été installées avec succès
Comment[gl]=As actualizacións instaláronse correctamente
Comment[hu]=A frissítések telepítése sikeres
Comment[id]=Pembaruan telah terinstal dengan sukses
Comment[it]=Gli aggiornamenti sono stati installati correttamente
Comment[ko]=업데이트가 설치됨
Comment[lt]=Atnaujinimai sėkmingai įdiegti
Comment[nl]=De elementen voor bijwerken zijn met succes geïnstalleerd
Comment[nn]=Oppdateringane er no installerte
Comment[pa]=ਅੱਪਡੇਟਾਂ ਨੂੰ ਕਾਮਯਾਬੀ ਨਾਲ ਇੰਸਟਾਲ ਕੀਤਾ ਜਾ ਚੁੱਕਾ ਹੈ
Comment[pl]=Pomyślnie wgrano uaktualnienia
Comment[pt]=As actualizações foram instaladas com sucesso
Comment[pt_BR]=As atualizações foram instaladas com sucesso
Comment[ro]=Actualizările au fost instalate cu succes
Comment[ru]=Обновления успешно установлены
Comment[sk]=Aktualizácie boli úspešne nainštalované
Comment[sl]=Posodobitve so bile uspešno nameščene
Comment[sv]=Uppdateringarna har installerats med lyckat resultat
Comment[tg]=Навсозиҳо бо муваффақият насб карда шудаанд
Comment[tr]=Güncellemeler başarıyla kuruldu
Comment[uk]=Оновлення успішно встановлено
Comment[x-test]=xxThe updates have been installed successfullyxx
Comment[zh_CN]=更新已成功安装
Comment[zh_TW]=已成功安裝更新
Action=Popup
[Event/restartRequired]
Name=Restart Required
Name[az]=Yenidən başlatmaq tələb olunur
Name[ca]=Cal reiniciar
Name[ca@valencia]=Cal reiniciar
Name[cs]=Je vyžadován restart
Name[da]=Genstart nødvendig
Name[de]=Ein Neustart ist erforderlich
Name[en_GB]=Restart Required
Name[es]=Se necesita reiniciar
Name[et]=Vajalik on taaskäivitus
Name[eu]=Berrabiatu beharra dago
Name[fi]=Uudelleenkäynnistys vaaditaan
Name[fr]=Redémarrage nécessaire
Name[gl]=Debe reiniciarse
Name[hu]=Újraindítás szükséges
Name[id]=Diperlukan Penyalaan Ulang
Name[it]=È necessario un riavvio
Name[ko]=다시 시작 필요
Name[lt]=Reikia paleisti iš naujo
Name[nl]=Opnieuw starten is vereist
Name[nn]=Du må starta maskina på nytt
Name[pa]=ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ
Name[pl]=Wymagane ponowne uruchomienie
Name[pt]=Reinício Necessário
Name[pt_BR]=Reinicialização necessária
Name[ro]=Repornire necesară
Name[ru]=Требуется перезагрузка
Name[sk]=Vyžaduje sa reštart
Name[sl]=Zahtevan je ponovni zagon
Name[sv]=Omstart krävs
Name[tg]=Компютер бояд аз нав оғоз карда шавад
Name[tr]=Yeniden Başlatma Gerekli
Name[uk]=Потрібне перезавантаження
Name[x-test]=xxRestart Requiredxx
Name[zh_CN]=需要重启
Name[zh_TW]=需要重新啟動
Comment=A session or computer restart is required
Comment[az]=Sessiyanın və ya kompyuterij yenidən başladılması tələb olunur
Comment[ca]=Cal reiniciar una sessió o l'ordinador
Comment[ca@valencia]=Cal reiniciar una sessió o l'ordinador
Comment[cs]=Je vyžadován restart sezení
Comment[da]=Genstart af sessionen eller computeren er nødvendig
Comment[de]=Ein Neustart der Sitzung oder des Rechners ist erforderlich
Comment[en_GB]=A session or computer restart is required
Comment[es]=Se necesita un reinicio del sistema o de la sesión
Comment[et]=Vajalik on seansi või arvuti taaskäivitus
Comment[eu]=Saioa edo sistema berrabiatu beharra dago
Comment[fi]=Istunto tai tietokone on käynnistettävä uudelleen
Comment[fr]=Un redémarrage de la session ou de l'ordinateur est nécessaire
Comment[gl]=Debe reiniciarse a sesión ou o computador
Comment[hu]=A munkamenet vagy a számítógép újraindítása szükséges
Comment[id]=Sebuah sesi atau penyalaan ulang komputer telah diperlukan
Comment[it]=È richiesto un riavvio del computer o della sessione
Comment[ko]=세션이나 컴퓨터를 다시 시작해야 함
Comment[lt]=Reikalingas seanso ar kompiuterio paleidimas iš naujo
Comment[nl]=Een herstart van de sessie of computer is vereist
Comment[nn]=Du må logga ut og inn att eller starta maskina på nytt
Comment[pa]=ਸ਼ੈਸ਼ਨ ਜਾਂ ਕੰਪਿਊਟਰ ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ ਹੈ
Comment[pl]=Wymagane ponowne uruchomienie sesji lub komputera
Comment[pt]=É necessário reiniciar a sessão ou o computador
Comment[pt_BR]=É necessário reiniciar a sessão ou o computador
Comment[ro]=Este necesară repornirea sesiunii sau a sistemului
Comment[ru]=Требуется перезапуск сеанса работы или перезагрузка
Comment[sk]=Vyžaduje sa reštart sedenia alebo počítača
Comment[sl]=Potrebna je nova seja ali ponovni zagon računalnika
Comment[sv]=Omstart av session eller dator krävs
Comment[tg]=Ҷаласаи ҷорӣ ё компютер бояд аз нав оғоз карда шавад
Comment[tr]=Oturum veya bilgisayar yeniden başlatması gerekli
Comment[uk]=Слід виконати перезавантаження сеансу або комп'ютера
Comment[x-test]=xxA session or computer restart is requiredxx
Comment[zh_CN]=需要重启系统或会话
Comment[zh_TW]=需要重新啟動工作階段或電腦
Action=Popup
[Event/updateError]
Name=Update Error
Name[az]=Yenilənmə xatası
Name[ca]=Error en actualitzar
Name[ca@valencia]=Error en actualitzar
Name[cs]=Chyba aktualizace
Name[da]=Opdateringsfejl
Name[de]=Fehler beim Aktualisieren
Name[en_GB]=Update Error
Name[es]=Error al actualizar
Name[et]=Tõrge uuendamisel
Name[eu]=Eguneratze errorea
Name[fi]=Päivitysvirhe
Name[fr]=Erreur lors de la mise à jour
Name[gl]=Erro de actualización
Name[hu]=Frissítési hiba
Name[id]=Error Pembaruan
Name[it]=Errore nell'aggiornamento
Name[ko]=업데이트 오류
Name[lt]=Atnaujinimo klaida
Name[nl]=Fout tijdens bijwerken
Name[nn]=Feil ved oppdatering
Name[pa]=ਅੱਪਡੇਟ ਗਲਤੀ
Name[pl]=Błąd uaktualnienia
Name[pt]=Erro na Actualização
Name[pt_BR]=Erro na atualização
Name[ro]=Eroare la actualizare
Name[ru]=Ошибка обновления
Name[sk]=Chyba aktualizácie
Name[sl]=Napaka posodobitve
Name[sv]=Uppdateringsfel
Name[tg]=Хатои навсозӣ
Name[tr]=Güncelleme Hatası
Name[uk]=Помилка під час оновлення
Name[x-test]=xxUpdate Errorxx
Name[zh_CN]=更新错误
Name[zh_TW]=更新發生錯誤
Comment=An error occurred
Comment[az]=Xəta baş verdi
Comment[ca]=S'ha produït un error
Comment[ca@valencia]=S'ha produït un error
Comment[cs]=Vyskytla se chyba
Comment[da]=Der opstod en fejl
Comment[de]=Es ist ein Fehler aufgetreten
Comment[en_GB]=An error occurred
Comment[es]=Ha ocurrido un error
Comment[et]=Tekkis tõrge
Comment[eu]=Errore bat gertatu da
Comment[fi]=Sattui virhe
Comment[fr]=Une erreur est survenue
Comment[gl]=Produciuse un erro
Comment[hu]=Hiba történt
Comment[id]=Sebuah error terjadi
Comment[it]=Si è verificato un errore
Comment[ko]=오류 발생
Comment[lt]=Įvyko klaida
Comment[nl]=Er deed zich een fout voor
Comment[nn]=Det oppstod ein feil
Comment[pa]=ਗਲਤੀ ਹੋਈ ਹੈ
Comment[pl]=Wystąpił błąd
Comment[pt]=Ocorreu um erro
Comment[pt_BR]=Ocorreu um erro
Comment[ro]=A intervenit o eroare
Comment[ru]=Произошла ошибка
Comment[sk]=Vyskytla sa chyba
Comment[sl]=Prišlo je do napake
Comment[sv]=Ett fel uppstod
Comment[tg]=Хато ба вуҷуд омад
Comment[tr]=Bir hata oluştu
Comment[uk]=Сталася помилка
Comment[x-test]=xxAn error occurredxx
Comment[zh_CN]=发生了一个错误
Comment[zh_TW]=發生錯誤
Action=Popup
0707010000000F000081A4000000000000000000000001622273890000003D000000000000000000000000000000000000003500000000plasma-pk-updates-0.3.2+git70/src/declarative/qmldirmodule org.kde.plasma.PackageKit
plugin plasmapk_qmlplugins
07070100000010000081A40000000000000000000000016222738900000510000000000000000000000000000000000000003D00000000plasma-pk-updates-0.3.2+git70/src/declarative/qmlplugins.cpp/*
Copyright 2015 Lukáš Tinkl <lukas@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtQml>
#include "qmlplugins.h"
#include "pkupdates.h"
void QmlPlugins::registerTypes(const char* uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.PackageKit"));
// @uri org.kde.plasma.PackageKit.PkUpdates
qmlRegisterSingletonType<PkUpdates>(uri, 1, 0, "PkUpdates", [](QQmlEngine*, QJSEngine*) -> QObject* { return new PkUpdates; });
}
07070100000011000081A400000000000000000000000162227389000004F0000000000000000000000000000000000000003B00000000plasma-pk-updates-0.3.2+git70/src/declarative/qmlplugins.h/*
Copyright 2015 Lukáš Tinkl <lukas@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLASMA_PK_QML_PLUGINS_H
#define PLASMA_PK_QML_PLUGINS_H
#include <QQmlExtensionPlugin>
class QmlPlugins : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char * uri) Q_DECL_OVERRIDE;
};
#endif // PLASMA_PK_QML_PLUGINS_H
07070100000012000041ED0000000000000000000000036222738900000000000000000000000000000000000000000000002900000000plasma-pk-updates-0.3.2+git70/src/plasma07070100000013000081A400000000000000000000000162227389000000B4000000000000000000000000000000000000003800000000plasma-pk-updates-0.3.2+git70/src/plasma/CMakeLists.txtconfigure_file(${CMAKE_CURRENT_SOURCE_DIR}/metadata.desktop.cmake
${CMAKE_CURRENT_SOURCE_DIR}/metadata.desktop
)
plasma_install_package(. org.kde.plasma.pkupdates)
07070100000014000081A4000000000000000000000001622273890000006B000000000000000000000000000000000000003500000000plasma-pk-updates-0.3.2+git70/src/plasma/Messages.sh#!/usr/bin/env bash
$XGETTEXT `find . -name '*.qml'` -o $podir/plasma_applet_org.kde.plasma.pkupdates.pot
07070100000015000041ED0000000000000000000000046222738900000000000000000000000000000000000000000000003200000000plasma-pk-updates-0.3.2+git70/src/plasma/contents07070100000016000041ED0000000000000000000000026222738900000000000000000000000000000000000000000000003900000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/config07070100000017000081A40000000000000000000000016222738900000641000000000000000000000000000000000000004400000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/config/config.qml/***************************************************************************
* Copyright 2013 by Sebastian Kügler <sebas@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.0
import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("General")
icon: "system-software-update"
source: "ConfigGeneral.qml"
}
}
07070100000018000081A400000000000000000000000162227389000002FF000000000000000000000000000000000000004200000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/config/main.xml<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="General">
<entry name="daily" type="Bool">
<default>true</default>
</entry>
<entry name="weekly" type="Bool">
<default>false</default>
</entry>
<entry name="monthly" type="Bool">
<default>false</default>
</entry>
<entry name="check_on_mobile" type="Bool">
<default>false</default>
</entry>
<entry name="check_on_battery" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>
07070100000019000041ED0000000000000000000000026222738900000000000000000000000000000000000000000000003500000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/ui0707010000001A000081A400000000000000000000000162227389000008E2000000000000000000000000000000000000004700000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/ui/ConfigGeneral.qml/*
* Copyright 2015 Lukáš Tinkl <lukas@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.2
import QtQuick.Controls 2.5
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: iconsPage
width: childrenRect.width
height: childrenRect.height
implicitWidth: pageColumn.implicitWidth
implicitHeight: pageColumn.implicitHeight
property alias cfg_daily: daily.checked
property alias cfg_weekly: weekly.checked
property alias cfg_monthly: monthly.checked
property alias cfg_check_on_mobile: mobile.checked
property alias cfg_check_on_battery: battery.checked
Column {
id: pageColumn
spacing: units.smallSpacing
GroupBox {
width: parent.width
ButtonGroup { buttons: intervalColumn.children }
title: i18n("Check Interval")
Column {
id: intervalColumn
spacing: units.smallSpacing
RadioButton {
id: daily
text: i18n("Daily")
}
RadioButton {
id: weekly
text: i18n("Weekly")
}
RadioButton {
id: monthly
text: i18n("Monthly")
}
}
}
CheckBox {
id: mobile
text: i18n("Check for updates even on a mobile connection")
}
CheckBox {
id: battery
text: i18n("Check for updates even when on battery")
}
}
}
0707010000001B000081A40000000000000000000000016222738900002FAF000000000000000000000000000000000000003E00000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/ui/Full.qml/***************************************************************************
* Copyright (C) 2013 by Aleix Pol Gonzalez <aleixpol@blue-systems.com> *
* Copyright (C) 2015 by Lukáš Tinkl <lukas@kde.org> *
* Copyright (C) 2015 by Jan Grulich <jgrulich@redhat.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Dialogs 1.2
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.PackageKit 1.0
Item {
id: fullRepresentation
property bool anySelected: false
property bool allSelected: false
property bool populatePreSelected: true
width: units.gridUnit * 20
height: units.gridUnit * 20
Binding {
target: timestampLabel
property: "text"
value: PkUpdates.timestamp
when: !plasmoid.expanded
}
Connections {
target: PkUpdates
onUpdatesChanged: populateModel()
onUpdateDetail: updateDetails(packageID, updateText, urls)
onUpdatesInstalled: plasmoid.expanded = false
onEulaRequired: eulaDialog.showPrompt(eulaID, packageID, vendor, licenseAgreement)
}
Component.onCompleted: populateModel()
Dialog {
property string eulaID: ""
property string packageName: ""
property string vendor: ""
property string licenseText: ""
property bool buttonClicked: false
id: eulaDialog
title: i18n("License Agreement for %1").arg(packageName)
standardButtons: StandardButton.Yes | StandardButton.No
ColumnLayout {
anchors.fill: parent
QQC2.Label {
text: i18n("License agreement required for %1 (from %2):").arg(eulaDialog.packageName).arg(eulaDialog.vendor)
}
QQC2.ScrollView {
Layout.fillWidth: true
Layout.fillHeight: true
// The Dialog uses the implicit size as minimum,
// so this doesn't have much effect...
Layout.minimumWidth: 400
Layout.minimumHeight: 200
Layout.preferredWidth: 600
Layout.preferredHeight: 500
// Work around that TextArea does not redraw
// when the visible area changes after resizing.
onHeightChanged: licenseArea.update()
onWidthChanged: licenseArea.update()
QQC2.TextArea {
id: licenseArea
text: eulaDialog.licenseText
readOnly: true
}
}
QQC2.Label {
text: i18n("Do you accept?")
}
}
onVisibleChanged: {
// onRejected does not fire on dialog closing, so implement that ourselves
if(!visible && !buttonClicked)
onNo();
}
onNo: {
buttonClicked = true;
PkUpdates.eulaAgreementResult(this.eulaID, false);
}
onYes: {
buttonClicked = true;
PkUpdates.eulaAgreementResult(this.eulaID, true);
}
function showPrompt(eulaID, packageID, vendor, licenseAgreement) {
this.eulaID = eulaID;
this.packageName = PkUpdates.packageName(packageID);
this.vendor = vendor;
this.licenseText = licenseAgreement;
this.visible = true;
}
}
ListModel {
id: updatesModel
}
ColumnLayout {
id: statusbar
anchors.fill: parent
spacing: units.smallSpacing
PlasmaExtras.Heading {
Layout.fillWidth: true
level: 4
wrapMode: Text.WordWrap
text: !PkUpdates.isNetworkOnline ? i18n("Network is offline") : PkUpdates.message
}
PlasmaComponents3.Label {
visible: PkUpdates.isActive || PkUpdates.count === 0
font.pointSize: theme.smallestFont.pointSize;
opacity: 0.6;
text: {
if (PkUpdates.isActive)
return PkUpdates.statusMessage
else if (PkUpdates.isNetworkOnline)
return i18n("Updates are automatically checked %1.",
updateInterval(plasmoid.configuration.daily,
plasmoid.configuration.weekly,
plasmoid.configuration.monthly));
return ""
}
Layout.fillWidth: true
wrapMode: Text.WordWrap
}
PlasmaComponents3.Label {
id: timestampLabel
Layout.fillWidth: true
visible: !PkUpdates.isActive
wrapMode: Text.WordWrap
font.italic: true
font.pointSize: theme.smallestFont.pointSize;
opacity: 0.6;
text: PkUpdates.timestamp
}
PlasmaComponents3.ProgressBar {
Layout.fillWidth: true
visible: PkUpdates.isActive
from: 0
to: 101 // BUG workaround a bug in ProgressBar! if the value is > max, it's set to max and never changes below
value: PkUpdates.percentage
indeterminate: PkUpdates.percentage > 100
}
PlasmaExtras.ScrollArea {
id: listViewScrollArea
Layout.fillWidth: true
Layout.fillHeight: true
visible: PkUpdates.count && PkUpdates.isNetworkOnline && !PkUpdates.isActive
ListView {
id: updatesView
clip: true
model: PlasmaCore.SortFilterModel {
sourceModel: updatesModel
filterRole: "name"
}
anchors.fill: parent
currentIndex: -1
property int lastIndex: -1
boundsBehavior: Flickable.StopAtBounds
delegate: PackageDelegate {
onClicked: {
if (updatesView.lastIndex == updatesView.currentIndex) {
// Unselect as current
updatesView.currentIndex = -1
} else {
// Expand, load details
PkUpdates.getUpdateDetails(id)
}
updatesView.lastIndex = updatesView.currentIndex
}
onCheckStateChanged: updateSelectionState();
}
}
}
// Container for other items that can be shown when the main scroll
// view is not visible
Item {
Layout.fillWidth: true
Layout.fillHeight: true
visible: !listViewScrollArea.visible
PlasmaComponents3.BusyIndicator {
running: PkUpdates.isActive && PkUpdates.count == 0
visible: running
anchors.centerIn: parent
}
PlasmaExtras.PlaceholderMessage {
anchors.centerIn: parent
width: parent.width - (units.largeSpacing * 4)
visible: PkUpdates.count === 0 && PkUpdates.isNetworkOnline && !PkUpdates.isActive
text: PkUpdates.lastCheckSuccessful ? i18n("No updates available") : ""
helpfulAction: QQC2.Action {
icon.name: "view-refresh"
text: "Check for Updates"
onTriggered: {
PkUpdates.checkUpdates(true /* manual */) // circumvent the checks, the user knows what they're doing ;)
}
}
}
}
PlasmaComponents3.CheckBox {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing
visible: PkUpdates.count !== 0 && PkUpdates.isNetworkOnline && !PkUpdates.isActive
tristate: true
checkState: fullRepresentation.allSelected ? Qt.Checked :
(fullRepresentation.anySelected ? Qt.PartiallyChecked
: Qt.Unchecked)
text: i18n("Select all packages")
onClicked: {
populatePreSelected = !fullRepresentation.anySelected;
populateModel();
}
}
PlasmaComponents3.Button {
visible: PkUpdates.count !== 0 && PkUpdates.isNetworkOnline && !PkUpdates.isActive
icon.name: "install"
enabled: fullRepresentation.anySelected
Layout.alignment: Qt.AlignHCenter
text: i18n("Install Updates")
onClicked: PkUpdates.installUpdates(selectedPackages())
PlasmaComponents3.ToolTip {
text: i18n("Performs the software update")
}
}
}
function updateSelectionState() {
console.log("Updating state of selection");
var anySelected = false;
var allSelected = true;
for (var i = 0; i < updatesModel.count; i++) {
var pkg = updatesModel.get(i)
if (pkg.selected)
anySelected = true;
else
allSelected = false;
if (anySelected && !allSelected)
break; // Can't change anymore
}
fullRepresentation.anySelected = anySelected;
fullRepresentation.allSelected = allSelected;
}
function selectedPackages() {
var result = []
for (var i = 0; i < updatesModel.count; i++) {
var pkg = updatesModel.get(i)
if (pkg.selected) {
print("Package " + pkg.id + " selected for update")
result.push(pkg.id)
}
}
return result
}
function populateModel() {
print("Populating model")
updatesModel.clear()
var packages = PkUpdates.packages
for (var id in packages) {
if (packages.hasOwnProperty(id)) {
var desc = packages[id]
updatesModel.append({"selected": populatePreSelected, "id": id, "name": PkUpdates.packageName(id), "desc": desc, "version": PkUpdates.packageVersion(id)})
}
}
updateSelectionState();
}
function updateDetails(packageID, updateText, urls) {
//print("Got update details for: " + packageID)
print("Update text: " + updateText)
print("URLs: " + urls)
updatesView.currentItem.updateText = updateText
updatesView.currentItem.updateUrls = urls
}
function updateInterval(daily, weekly, monthly) {
if (weekly)
return i18n("weekly");
else if (monthly)
return i18n("monthly");
return i18n("daily");
}
}
0707010000001C000081A40000000000000000000000016222738900001543000000000000000000000000000000000000004900000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/ui/PackageDelegate.qml/***************************************************************************
* Copyright (C) 2013 by Aleix Pol Gonzalez <aleixpol@blue-systems.com> *
* Copyright (C) 2015 by Lukáš Tinkl <lukas@kde.org> *
* Copyright (C) 2015 by Jan Grulich <jgrulich@redhat.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.5
import QtQuick.Layouts 1.12
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
PlasmaExtras.ListItem {
id: packageDelegate
property string updateText
property variant updateUrls: []
readonly property bool expanded: ListView.isCurrentItem
signal checkStateChanged(bool checked)
height: innerLayout.height + (units.smallSpacing * 2)
enabled: true
checked: containsMouse || expanded
// The binding is overwritten on clicks, as this is for some reason a Button
onClicked: checked = Qt.binding(function(){ return containsMouse || expanded; });
RowLayout {
id: innerLayout
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
PlasmaComponents3.CheckBox {
Layout.alignment: Qt.AlignVCenter
checked: selected
onClicked: {
updatesModel.setProperty(index, "selected", checked)
packageDelegate.checkStateChanged(checked)
}
}
ColumnLayout {
spacing: units.smallSpacing / 2
PlasmaComponents3.Label {
Layout.fillWidth: true
elide: Text.ElideRight
text: i18nc("Package Name (Version)", "%1 (%2)", name, version)
}
PlasmaComponents3.Label {
Layout.fillWidth: true
elide: Text.ElideRight
font.pointSize: theme.smallestFont.pointSize
opacity: 0.6
text: desc
}
ColumnLayout {
visible: packageDelegate.expanded
spacing: units.smallSpacing / 2
PlasmaCore.SvgItem {
Layout.preferredHeight: lineSvg.elementSize("horizontal-line").height
Layout.fillWidth: true
elementId: "horizontal-line";
svg: PlasmaCore.Svg {
id: lineSvg;
imagePath: "widgets/line";
}
}
PlasmaComponents3.Label {
Layout.fillWidth: true
font.weight: Font.DemiBold
text: i18nc("description of the update", "Update Description")
}
PlasmaComponents3.Label {
Layout.fillWidth: true
font.pointSize: theme.smallestFont.pointSize
opacity: 0.6
text: updateText == "" ? i18n("No description available") : updateText
wrapMode: Text.WordWrap
}
PlasmaComponents3.Label {
visible: updateUrls.count > 0
Layout.fillWidth: true
font.weight: Font.DemiBold
text: i18n("Related URLs")
}
Repeater {
model: updateUrls
PlasmaComponents3.Label {
Layout.fillWidth: true
color: theme.linkColor
font.pointSize: theme.smallestFont.pointSize
font.underline: true
opacity: 0.6
text: modelData
wrapMode: Text.WordWrap
MouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
Qt.openUrlExternally(modelData)
}
}
}
}
}
}
}
}
0707010000001D000081A400000000000000000000000162227389000010F3000000000000000000000000000000000000003E00000000plasma-pk-updates-0.3.2+git70/src/plasma/contents/ui/main.qml/***************************************************************************
* Copyright (C) 2014 by Aleix Pol Gonzalez <aleixpol@blue-systems.com> *
* Copyright (C) 2015 by Lukáš Tinkl <lukas@kde.org> *
* Copyright (C) 2015 by Jan Grulich <jgrulich@redhat.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.2
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.PackageKit 1.0
Item
{
Plasmoid.fullRepresentation: Full {}
Plasmoid.toolTipSubText: PkUpdates.message
Plasmoid.icon: PkUpdates.iconName
Plasmoid.switchWidth: units.gridUnit * 10;
Plasmoid.switchHeight: units.gridUnit * 10;
property bool checkDaily: plasmoid.configuration.daily
property bool checkWeekly: plasmoid.configuration.weekly
property bool checkMonthly: plasmoid.configuration.monthly
property bool checkOnMobile: plasmoid.configuration.check_on_mobile
property bool checkOnBattery: plasmoid.configuration.check_on_battery
property double lastCheckAttempt: PkUpdates.lastRefreshTimestamp()
readonly property int secsAutoCheckLimit: 10 * 60
readonly property int secsInDay: 60 * 60 * 24;
readonly property int secsInWeek: secsInDay * 7;
readonly property int secsInMonth: secsInDay * 30;
readonly property bool networkAllowed: PkUpdates.isNetworkMobile ? checkOnMobile : PkUpdates.isNetworkOnline
readonly property bool batteryAllowed: PkUpdates.isOnBattery ? checkOnBattery : true
Timer {
id: timer
repeat: true
triggeredOnStart: true
interval: 1000 * 60 * 60; // 1 hour
onTriggered: {
if (needsForcedUpdate() && networkAllowed && batteryAllowed) {
lastCheckAttempt = Date.now();
PkUpdates.checkUpdates(false /* manual */);
}
}
}
Binding {
target: plasmoid
property: "status"
value: PkUpdates.isActive || !PkUpdates.isSystemUpToDate ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.PassiveStatus;
}
Plasmoid.compactRepresentation: PlasmaCore.IconItem {
source: PkUpdates.iconName
anchors.fill: parent
MouseArea {
anchors.fill: parent
onClicked: plasmoid.expanded = !plasmoid.expanded
}
}
function needsForcedUpdate() {
if ((Date.now() - lastCheckAttempt)/1000 < secsAutoCheckLimit) {
return false;
}
var secs = (Date.now() - PkUpdates.lastRefreshTimestamp())/1000; // compare with the saved timestamp
if (secs < 0) { // never checked before
return true;
} else if (checkDaily) {
return secs >= secsInDay;
} else if (checkWeekly) {
return secs >= secsInWeek;
} else if (checkMonthly) {
return secs >= secsInMonth;
}
return false;
}
Connections {
target: PkUpdates
onNetworkStateChanged: timer.restart()
onIsOnBatteryChanged: timer.restart()
}
Component.onCompleted: {
timer.start()
}
}
0707010000001E000081A40000000000000000000000016222738900000E19000000000000000000000000000000000000004000000000plasma-pk-updates-0.3.2+git70/src/plasma/metadata.desktop.cmake[Desktop Entry]
Name=Software Updates
Name[az]=Proqram Təminatı Yenilənmələri
Name[ca]=Actualitzacions de programari
Name[ca@valencia]=Actualitzacions de programari
Name[cs]=Aktualizace software
Name[da]=Softwareopdateringer
Name[de]=Softwareaktualisierungen
Name[en_GB]=Software Updates
Name[es]=Actualizaciones de software
Name[et]=Tarkvarauuendused
Name[eu]=Software eguneratzeak
Name[fi]=Ohjelmistopäivitykset
Name[fr]=Mises à jour des logiciels
Name[gl]=Actualizacións de software
Name[hu]=Szoftverfrissítések
Name[id]=Pembaruan Perangkat Lunak
Name[it]=Aggiornamenti software
Name[ko]=소프트웨어 업데이트
Name[lt]=Programinės įrangos atnaujinimai
Name[nl]=Elementen voor software bijwerken
Name[nn]=Programoppdateringar
Name[pa]=ਸਾਫਟਵੇਅਰ ਅੱਪਡੇਟ ਹਨ
Name[pl]=Uaktualnienia oprogramowania
Name[pt]=Actualizações de Aplicações
Name[pt_BR]=Atualização de aplicativos
Name[ro]=Actualizări de programe
Name[ru]=Обновления программ
Name[sk]=Aktualizácie softvéru
Name[sl]=Programske posodobitve
Name[sv]=Uppdateringar av programvara
Name[tg]=Навсозиҳои нармафзор
Name[tr]=Yazılım Güncellemeleri
Name[uk]=Оновлення програм
Name[x-test]=xxSoftware Updatesxx
Name[zh_CN]=软件更新
Name[zh_TW]=軟體更新
Comment=Get software updates
Comment[az]=Proqram təminatı yenilənmələrini alın
Comment[ca]=Obtén les actualitzacions de programari
Comment[ca@valencia]=Obtén les actualitzacions de programari
Comment[cs]=Získejte aktualizace software
Comment[da]=Hent softwareopdateringer
Comment[de]=Softwareaktualisierungen beziehen
Comment[en_GB]=Get software updates
Comment[es]=Obtener actualizaciones de software
Comment[et]=Tarkvarauuenduste hankimine
Comment[eu]=Lortu software eguneratzeak
Comment[fi]=Nouda ohjelmistopäivitykset
Comment[fr]=Télécharger les mises à jour des logiciels
Comment[gl]=Obteña actualizacións de software.
Comment[hu]=Szoftverfrissítések letöltése
Comment[id]=Dapatkan pembaruan perangkat lunak
Comment[it]=Scarica gli aggiornamenti del software
Comment[ko]=소프트웨어 업데이트 가져오기
Comment[lt]=Gauti programinės įrangos atnaujinimus
Comment[nl]=Elementen voor software bijwerken ophalen
Comment[nn]=Hent programoppdateringar
Comment[pa]=ਸਾਫਟਵੇਅਰ ਅੱਪਡੇਟ ਲਵੋ
Comment[pl]=Pobiera uaktualnienia oprogramowania
Comment[pt]=Obter actualizações das aplicações
Comment[pt_BR]=Obter a atualização de aplicativos
Comment[ro]=Obține actualizări de programe
Comment[ru]=Обновления программного обеспечения
Comment[sk]=Získať aktualizácie softvéru
Comment[sl]=Pridobi programske posodobitve
Comment[sv]=Hämta uppdateringar av programvara
Comment[tg]=Гирифтани навсозиҳои нармафзор
Comment[tr]=Yazılım güncellemelerini al
Comment[uk]=Отримання оновлень програм
Comment[x-test]=xxGet software updatesxx
Comment[zh_CN]=获取软件更新
Comment[zh_TW]=取得軟體更新
Icon=system-software-update
Type=Service
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-NotificationArea=true
X-KDE-PluginInfo-Name=org.kde.plasma.pkupdates
X-KDE-PluginInfo-Category=System Information
X-KDE-PluginInfo-Author=Lukáš Tinkl
X-KDE-PluginInfo-Email=lukas@kde.org
X-KDE-PluginInfo-Version=@PROJECT_VERSION@
X-KDE-PluginInfo-Website=https://phabricator.kde.org/source/plasma-pk-updates/
X-KDE-PluginInfo-License=GPL2
X-KDE-PluginInfo-EnabledByDefault=true
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!364 blocks