pax_global_header 0000666 0000000 0000000 00000000064 11261733517 0014520 g ustar 00root root 0000000 0000000 52 comment=ae4cffff9b307730cb5b5b52bafab2a5521a052e
flickrop-0.7.1/ 0000775 0000000 0000000 00000000000 11261733517 0013336 5 ustar 00root root 0000000 0000000 flickrop-0.7.1/.gitignore 0000664 0000000 0000000 00000000011 11261733517 0015316 0 ustar 00root root 0000000 0000000 build
*~
flickrop-0.7.1/CMakeLists.txt 0000664 0000000 0000000 00000001150 11261733517 0016073 0 ustar 00root root 0000000 0000000 project(plasma-flickrop)
# Find the required Libaries
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
if ( NOT WITHOUT_MARBLE )
find_package(Marble)
endif ( NOT WITHOUT_MARBLE )
if ( ${KDE_VERSION} VERSION_LESS "4.1.90" )
find_package(Plasma REQUIRED)
else ( ${KDE_VERSION} VERSION_LESS "4.1.90" )
set( PLASMA_LIBS ${KDE4_PLASMA_LIBS} )
endif ( ${KDE_VERSION} VERSION_LESS "4.1.90" )
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
)
add_subdirectory(applet)
add_subdirectory(engine)
add_subdirectory(po)
flickrop-0.7.1/COPYING 0000664 0000000 0000000 00000104513 11261733517 0014375 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
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.
Copyright (C)
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 .
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:
Copyright (C)
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
.
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
.
flickrop-0.7.1/ChangeLog 0000664 0000000 0000000 00000005755 11261733517 0015124 0 ustar 00root root 0000000 0000000 v0.7.1
======
- Spanish translation added, thanks to Cristian Fadón.
v0.7
====
- Added localization support (Dutch translation included).
- Fade effect when showing a new photo.
- Several bugfixes
v0.6.1
======
Nothing big in this release, it just fixes a few minor things.
- Don't assert in the case that a photo is retrieved and a new set of photos
has been requested in the meantime.
- Disable "Next Photo" while retrieving a new list of photos after editing the
settings.
- Fix layouting in the streams page.
- Don't print the word "by" when the author is unknown.
- Cleanups
v0.6
====
- Added ability to load photos taken on a particular geographical location. It
locates Marble on the system and uses that. If Marble is not on the system,
or if you explicitely state you don't want that, a simple dialog is shown
where you can enter longitude and latitude.
- Ability to access restricted content. This requires the user to have an
account and have SafeSearch disabled, and to have this applet authenticated
with Flickr.
v0.5.2
======
- This release should fix what 0.5.1 attempted to fix: fix a crash when there
are no photos. The checks in the previous release appeared not to be robust
enough. Thanks to Biert and his crappy network connection who brought this
to my attention.
v0.5.1
======
- Fix crash when the user requests next photo when there no photos are
available.
- Fix heights of dialogs, there was some unnecessary vertical space.
v0.5
====
- Ability to switch off the background.
- Rounded corners (optional).
- Soft borders (optional).
- Cache all paint operations, for example when moving the applet.
- Converted all configuration pages to Qt Designer pages.
v0.4.1
======
- Bugfix that no photos were shown when compiled with Qt 4.5.x.
This only applies to people compiling this applet with Qt 4.5.x. If you have
compiled version 0.4 with Qt 4.4 there is absolutely no need to update.
v0.4
====
- Another type of photo stream added: photo sets.
It is possible to enter a Flickr username and pick one of his/her photosets.
Of course, this allows you to load your own photo sets as well.
- Made the applet compatible with KDE 4.2.
- Put the photos in random order after loading them.
v0.3.1
======
- Fix compile error.
v0.3
====
- Ability to choose different photo streams. Choices are:
- Interesting photos (which versions 0.1 and 0.2 were basically doing)
- Your favorite photos
- Based on a tag. Enter a tag, and then choose a cluster. For instance,
if you type "jaguar", you have to choose if you mean the car or the
animal.
- Delay cleaning the cache (and do it periodically with long uptimes).
v0.2
====
- Separated the code in an applet section and engine section.
- Ability to authenticate with Flickr.com.
Features which require authentication will be possible in the future.
- Mark photos as Favorite from the context menu (authentication required).
- Added menu entries to visit the Flickr pages of photos and authors.
v0.1
====
- Initial release
flickrop-0.7.1/README 0000664 0000000 0000000 00000003520 11261733517 0014216 0 ustar 00root root 0000000 0000000 Flickr On Plasma 0.7.1
======================
Introduction
------------
This is Flickr On Plasma, a Plasma [1] applet showing:
* the most interesting pictures on Flickr [2];
* your favorite photos;
* a particular photoset;
* a set of photos based on a tag;
* photos taken on a particular location.
Build instructions
------------------
Make sure to have Plasma from KDE 4.1 or higher installed and CMake. Marble is
an optional dependency.
Then proceed as follows:
tar xvjf flickrop-0.7.1.tar.bz2
cd flickrop-0.7.1
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$KDEHOME ..
make
make install
Of course you can set the prefix to anything you want, but this allows you to
install the applet as a user.
If you don't wish to depend on Marble, you can explicitely turn it off by
replacing the cmake command above with the following:
cmake -DCMAKE_INSTALL_PREFIX=$KDEHOME -DWITHOUT_MARBLE=true ..
Repository
----------
There is a Git repository available where you can download the latest code.
To clone, execute:
git clone git://github.com/bram85/flickrop.git
or
git clone git://gitorious.org/flickrop/flickrop.git
The web interfaces are located at [3] and [4].
Translation
-----------
You can contribute to Flickr On Plasma by translating it to your language. You
can retrieve the latest template from the Git repository (as described above) in
the po folder (flickrop.pot). Save your file as flickrop_xx.po where xx is your
language code in KDE.
When you're done, send me a pull request or send the resulting *.po file by
email. Your contribution is appreciated!
References
----------
[1] http://plasma.kde.org
[2] http://www.flickr.com
[3] http://github.com/bram85/flickrop
[4] http://gitorious.org/flickrop/flickrop
Credits
-------
Author: Bram Schoenmakers
Spanish translation: Christian Fadón
flickrop-0.7.1/applet/ 0000775 0000000 0000000 00000000000 11261733517 0014623 5 ustar 00root root 0000000 0000000 flickrop-0.7.1/applet/CMakeLists.txt 0000664 0000000 0000000 00000001706 11261733517 0017367 0 ustar 00root root 0000000 0000000 # We add our source code here
set(flickrop_SRCS flickrop.cpp clusterdialog.cpp photosetdialog.cpp locationdialog.cpp)
set(flickrop_LIBS ${PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} )
if ( MARBLE_FOUND ) # FIXME
include_directories( ${MARBLE_INCLUDE_DIR} )
add_definitions( -DWITH_MARBLE )
set( flickrop_SRCS ${flickrop_SRCS} marbledialog.cpp )
set( flickrop_LIBS ${flickrop_LIBS} ${MARBLE_LIBRARIES} )
else( MARBLE_FOUND )
set( flickrop_SRCS ${flickrop_SRCS} coordinatedialog.cpp )
endif( MARBLE_FOUND )
kde4_add_ui_files( flickrop_SRCS generalsettings.ui streamsettings.ui authenticationsettings.ui )
# Now make sure all files get to the right place
kde4_add_plugin(plasma_applet_flickrop ${flickrop_SRCS})
target_link_libraries( plasma_applet_flickrop ${flickrop_LIBS} )
install(TARGETS plasma_applet_flickrop
DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-applet-flickrop.desktop
DESTINATION ${SERVICES_INSTALL_DIR})
flickrop-0.7.1/applet/authenticationsettings.ui 0000664 0000000 0000000 00000003315 11261733517 0021764 0 ustar 00root root 0000000 0000000
AuthenticationWidget
0
0
400
121
Form
-
0
0
In order to use all functions in Flickr On Plasma, you have to authenticate with Flickr. Press the button below to start the authentication.
Qt::AlignCenter
true
-
Authenticate
-
Qt::Vertical
20
0
KPushButton
QPushButton
flickrop-0.7.1/applet/clusterdialog.cpp 0000664 0000000 0000000 00000006162 11261733517 0020175 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include "clusterdialog.h"
#include
#include
#include
#include
ClusterDialog::ClusterDialog( QWidget *p_parent )
: KDialog( p_parent )
{
QGroupBox *mainwidget = new QGroupBox( i18n("Select the cluster which you would like to see" ), this );
setMainWidget( mainwidget );
setButtons( KDialog::Ok | KDialog::Cancel );
enableButtonOk( false );
m_vbox = new QVBoxLayout( mainwidget );
}
ClusterDialog::~ClusterDialog()
{
}
void ClusterDialog::addCluster( const QStringList &p_cluster )
{
QString label = p_cluster[ 0 ];
for ( int i = 1; i < p_cluster.size(); ++i )
{
label += ',';
if ( i % 8 == 0 )
{
label += '\n';
}
label += p_cluster[ i ];
}
QRadioButton *button = new QRadioButton( label, this );
connect( button, SIGNAL( toggled( bool ) ), SLOT( clusterChosen() ) );
m_vbox->addWidget( button );
// create cluster-id
QString cluster_id = p_cluster[ 0 ];
for ( int i = 1; i < qMin( p_cluster.size(), 3 ); ++i )
{
cluster_id += '-';
cluster_id += p_cluster[ i ];
}
m_buttons[ button ] = cluster_id;
}
void ClusterDialog::reset()
{
QHash::const_iterator it = m_buttons.begin();
for ( ; it != m_buttons.end(); ++it )
{
m_vbox->removeWidget( it.key() );
delete it.key();
}
m_buttons.clear();
enableButtonOk( false );
}
QString ClusterDialog::cluster() const
{
QHash::const_iterator it = m_buttons.begin();
for ( ; it != m_buttons.end(); ++it )
{
if ( it.key()->isChecked() )
{
return it.value();
}
}
return QString();
}
void ClusterDialog::clusterChosen()
{
enableButtonOk( true );
}
flickrop-0.7.1/applet/clusterdialog.h 0000664 0000000 0000000 00000003663 11261733517 0017645 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef CLUSTER_DIALOG_H
#define CLUSTER_DIALOG_H
#include
#include
class QRadioButton;
class QVBoxLayout;
class ClusterDialog : public KDialog
{
Q_OBJECT
public:
ClusterDialog( QWidget *p_parent = 0 );
~ClusterDialog();
void addCluster( const QStringList &p_cluster );
QString cluster() const;
void reset();
protected slots:
void clusterChosen();
private:
QVBoxLayout *m_vbox;
QHash< QRadioButton*, QString > m_buttons;
};
#endif // CLUSTER_DIALOG_H
flickrop-0.7.1/applet/coordinatedialog.cpp 0000664 0000000 0000000 00000010130 11261733517 0020631 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include
#include
#include
#include
#include
#include
#include "coordinatedialog.h"
static QString s_expression;
CoordinateDialog::CoordinateDialog( QWidget *p_parent )
: LocationDialog( p_parent )
, m_longitude_valid( false )
, m_latitude_valid( false )
, m_latitude( 0.0 )
, m_longitude( 0.0 )
{
// used to check the validity of the input
s_expression = "^[0-9]+([." + KGlobal::locale()->decimalSymbol() + "][0-9]+)?$";
QGroupBox *group = new QGroupBox( i18n("Select a location:" ), this );
QGridLayout *layout = new QGridLayout( group );
QLabel *label = new QLabel( i18n( "Longitude:" ), this );
m_longitudeEdit = new KLineEdit( this );
label->setBuddy( m_longitudeEdit );
connect( m_longitudeEdit, SIGNAL( textEdited( const QString & ) ), SLOT( longitudeChanged( const QString & ) ) );
layout->addWidget( label, 0, 0 );
layout->addWidget( m_longitudeEdit, 0, 1 );
label = new QLabel( i18n( "Latitude:" ), this );
m_latitudeEdit = new KLineEdit( this );
label->setBuddy( m_latitudeEdit );
connect( m_latitudeEdit, SIGNAL( textEdited( const QString & ) ), SLOT( latitudeChanged( const QString & ) ) );
layout->addWidget( label, 1, 0 );
layout->addWidget( m_latitudeEdit, 1, 1 );
label = new QLabel( i18n( "Accuracy:" ), this );
label->setBuddy( m_accuracyCombo );
layout->addWidget( label, 2, 0 );
layout->addWidget( m_accuracyCombo, 2, 1 );
setMainWidget( group );
setButtons( KDialog::Ok | KDialog::Cancel );
setOkButton();
}
CoordinateDialog::~CoordinateDialog()
{
}
qreal CoordinateDialog::getLatitude() const
{
return m_latitude;
}
qreal CoordinateDialog::getLongitude() const
{
return m_longitude;
}
void CoordinateDialog::setLongitude( qreal p_longitude )
{
m_longitude = p_longitude;
m_longitude_valid = true;
m_longitudeEdit->setText( QString::number( p_longitude ) );
setOkButton();
}
void CoordinateDialog::setLatitude( qreal p_latitude )
{
m_latitude = p_latitude;
m_latitude_valid = true;
m_latitudeEdit->setText( QString::number( p_latitude ) );
setOkButton();
}
void CoordinateDialog::setOkButton()
{
enableButtonOk( m_longitude_valid && m_latitude_valid );
}
void CoordinateDialog::longitudeChanged( const QString &p_longitude )
{
m_longitude_valid = p_longitude.contains( QRegExp( s_expression ) );
if ( m_longitude_valid )
{
m_longitude = p_longitude.toDouble();
}
setOkButton();
}
void CoordinateDialog::latitudeChanged( const QString &p_latitude )
{
m_latitude_valid = p_latitude.contains( QRegExp( s_expression ) );
if ( m_latitude_valid )
{
m_latitude = p_latitude.toDouble();
}
setOkButton();
}
flickrop-0.7.1/applet/coordinatedialog.h 0000664 0000000 0000000 00000004232 11261733517 0020304 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef COORDINATEDIALOG_H
#define COORDINATEDIALOG_H
#include "locationdialog.h"
class KLineEdit;
class CoordinateDialog : public LocationDialog
{
Q_OBJECT
public:
CoordinateDialog( QWidget *p_parent = 0 );
~CoordinateDialog();
qreal getLatitude() const;
qreal getLongitude() const;
void setLatitude( qreal p_latitude );
void setLongitude( qreal p_longitude );
private slots:
void longitudeChanged( const QString &p_longitude );
void latitudeChanged( const QString &p_latitude );
private:
void setOkButton();
bool m_longitude_valid;
bool m_latitude_valid;
qreal m_latitude;
qreal m_longitude;
KLineEdit *m_longitudeEdit;
KLineEdit *m_latitudeEdit;
};
#endif // COORDINATEDIALOG_H
flickrop-0.7.1/applet/flickrop.cpp 0000664 0000000 0000000 00000072773 11261733517 0017160 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "clusterdialog.h"
#include "photosetdialog.h"
#include "../engine/flickr_engine.h"
// Include the correct coordinate dialog.
#ifdef WITH_MARBLE
#include "marbledialog.h"
#else
#include "coordinatedialog.h"
#endif
#include "flickrop.h"
using namespace Plasma;
#if QT_VERSION < 0x040500
// this Plasma:: should stay here, otherwise it breaks the applet!
Q_DECLARE_METATYPE( Plasma::DataEngine::Data )
#endif
FlickrOP::FlickrOP( QObject* p_parent, const QVariantList& p_args )
: Applet( p_parent, p_args )
, m_engine( 0 )
, m_timeline( 0 )
, m_alpha( 1.0 )
, m_authenticated( false )
, m_cluster_chosen( false )
, m_location_chosen( false )
, m_general_page( 0 )
, m_stream_page( 0 )
, m_authentication_page( 0 )
, m_visitAuthor( 0 )
, m_visitPhotoPage( 0 )
, m_visitAuthorPhotos( 0 )
, m_config_dialog( 0 )
, m_round_corners( false )
, m_show_background( true )
, m_soft_borders( false )
{
KGlobal::locale()->insertCatalog("flickrop");
setBackgroundHints( Applet::NoBackground );
setAspectRatioMode( KeepAspectRatio );
setHasConfigurationInterface( true );
}
FlickrOP::~FlickrOP()
{
KConfigGroup cfg = config();
cfg.writeEntry( "token", m_config["token"] );
delete m_clusterdialog;
delete m_photosetdialog;
delete m_locationdialog;
delete m_general_page;
delete m_stream_page;
delete m_authentication_page;
}
void FlickrOP::init()
{
m_timeline = new QTimeLine( 1000, this );
m_timeline->setCurveShape( QTimeLine::EaseInCurve );
connect( m_timeline, SIGNAL( valueChanged( qreal ) ), SLOT( setAlpha( qreal ) ) );
m_nextPhoto = new QAction( SmallIcon("system-run"), i18n("Ne&xt Photo"), this );
m_nextPhoto->setEnabled( false );
m_actions.append( m_nextPhoto );
connect( m_nextPhoto, SIGNAL( triggered( bool ) ), SLOT( nextPhoto() ) );
m_markFavorite = new QAction( SmallIcon("emblem-favorite"), i18n("Mark As &Favorite"), this );
m_markFavorite->setEnabled( false );
m_actions.append( m_markFavorite );
connect( m_markFavorite, SIGNAL( triggered( bool ) ), SLOT( markAsFavorite() ) );
QAction *separator = new QAction( this );
separator->setSeparator( true );
m_actions.append( separator );
m_visitAuthor = new QAction( SmallIcon("user-identity"), i18n("Visit &Author's Profile"), this );
m_visitAuthor->setEnabled( false );
m_actions.append( m_visitAuthor );
connect( m_visitAuthor, SIGNAL( triggered( bool ) ), SLOT( visitAuthor() ) );
m_visitAuthorPhotos = new QAction( SmallIcon("camera-photo"), i18n("Visit Aut&hor's Photos"), this );
m_visitAuthorPhotos->setEnabled( false );
m_actions.append( m_visitAuthorPhotos );
connect( m_visitAuthorPhotos, SIGNAL( triggered( bool ) ), SLOT( visitAuthorPhotos() ) );
m_visitPhotoPage = new QAction( SmallIcon("internet-web-browser"), i18n("Visit &Photo Page"), this );
m_visitPhotoPage->setEnabled( false );
m_actions.append( m_visitPhotoPage );
connect( m_visitPhotoPage, SIGNAL( triggered( bool ) ), SLOT( visitPhoto() ) );
separator = new QAction( this );
separator->setSeparator( true );
m_actions.append( separator );
m_engine = dataEngine("flickrop");
m_engine->connectAllSources( this );
m_config["force_reload"] = true;
m_config["check_token"] = true;
readConfig(); // will also fire the engine
}
void FlickrOP::paintInterface ( QPainter *p_painter, const QStyleOptionGraphicsItem *p_option, const QRect &p_contentsRect )
{
setBackgroundHints( m_show_background ? Applet::TranslucentBackground : Applet::NoBackground );
if ( m_pixmapCache.isNull() || p_contentsRect.size() != m_pixmapCache.size() )
{
paintCache( p_option, p_contentsRect );
}
if ( !m_oldPixmapCache.isNull() )
{
p_painter->setOpacity( m_alpha );
p_painter->drawPixmap( p_contentsRect, m_pixmapCache, p_contentsRect );
p_painter->setOpacity( 1.0 - m_alpha );
p_painter->drawPixmap( p_contentsRect, m_oldPixmapCache, p_contentsRect );
}
else
{
p_painter->drawPixmap( p_contentsRect, m_pixmapCache, p_contentsRect );
}
}
void FlickrOP::paintCache ( const QStyleOptionGraphicsItem *p_option, const QRect &p_contentsRect )
{
Q_UNUSED( p_option );
m_pixmapCache = QPixmap( p_contentsRect.size() );
m_pixmapCache.fill( Qt::transparent );
QPainter painter( &m_pixmapCache );
if( !m_error.isEmpty() )
{
painter.drawText( p_contentsRect, Qt::AlignCenter, m_error );
}
else if( !m_photo.filename.isNull() )
{
// photo
int y = p_contentsRect.y();
int width;
int height;
if ( m_pixmapPhoto.width() > m_pixmapPhoto.height() )
{
width = qMin( p_contentsRect.width(), m_pixmapPhoto.width() );
height = (int)( width * m_pixmapPhoto.height() / m_pixmapPhoto.width() );
y += (int)((p_contentsRect.height() * 0.5 ) - ( height * 0.5 ) );
}
else // height <= width
{
height = qMin( p_contentsRect.height(), m_pixmapPhoto.height() );
width = (int)( height * m_pixmapPhoto.width() / m_pixmapPhoto.height() );
if ( !m_show_author )
{
// if the author isn't shown, we can really center the image vertically
y += (int)((p_contentsRect.height() * 0.5 ) - ( height * 0.5 ) );
}
}
int x = p_contentsRect.x() + (int)((p_contentsRect.width() * 0.5 ) - ( width * 0.5 ) );
QRect photoRect = QRect( x, y, width, height );
if ( m_show_author )
{
// text
QString text;
if ( m_photo.title.isEmpty() )
{
text = i18nc( "author", "By %1", m_photo.author.username );
}
else if ( m_photo.author.username.isEmpty() )
{
text = m_photo.title;
}
else
{
text = i18nc( "title and author", "\"%1\" by %2", m_photo.title, m_photo.author.username );
}
painter.setPen( m_author_color );
painter.setFont( m_author_font );
QRect textArea( x, y + height, width, p_contentsRect.bottom() - y - height );
QRect author_boundbox = painter.boundingRect( textArea, Qt::AlignRight | Qt::TextWordWrap, text );
painter.drawText( author_boundbox, Qt::AlignRight | Qt::TextWordWrap, text );
}
painter.setRenderHint( QPainter::Antialiasing );
painter.setRenderHint( QPainter::SmoothPixmapTransform );
painter.save();
QPainterPath roundPath;
if ( m_round_corners )
{
roundPath = Plasma::PaintUtils::roundedRectangle( photoRect, (int)(size().width() * 0.03) );
// it sucks that Qt does not antialias the corners when clipping, it looks a bit rubbish
// if soft borders are not set, it will be covered with a black line, drawn below
painter.setClipPath( roundPath );
}
painter.drawPixmap( photoRect, m_pixmapPhoto );
painter.restore();
if ( m_soft_borders )
{
painter.save();
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
painter.drawPixmap( photoRect, createMask( photoRect.size() ) );
painter.restore();
}
if ( !m_soft_borders && m_round_corners )
{
painter.setPen(QPen(Qt::black, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
painter.drawPath( roundPath );
}
}
}
QPixmap FlickrOP::createMask( const QSize &p_size )
{
QPixmap pixmap( p_size );
pixmap.fill( Qt::transparent );
QPainter painter( &pixmap );
painter.setBrush( Qt::NoBrush );
painter.setRenderHint( QPainter::Antialiasing, false );
qreal opacity = 0.0;
qreal step = 1.0 / ( size().width() * 0.01 );
QRectF rect = pixmap.rect();
// draw gradient
while ( opacity < 1.0 )
{
painter.setOpacity( opacity );
painter.drawRect( rect );
opacity += step;
rect.adjust( 1.0, 1.0, -1.0, -1.0 );
}
// fill rectangle
painter.setBrush( Qt::black );
painter.drawRect( rect );
painter.end();
return pixmap;
}
void FlickrOP::readConfig()
{
KConfigGroup cfg = config();
m_config["interval"] = cfg.readEntry( "interval", 3600 );
m_round_corners = cfg.readEntry( "roundcorners", false );
m_show_background = cfg.readEntry( "showbackground", true );
m_soft_borders = cfg.readEntry( "softborders", false );
QString token = cfg.readEntry( "token", "" );
m_config["token"] = token;
// don't check for token validity if there is none
if ( token.isEmpty() )
{
m_config["check_token"] = false;
}
m_show_author = cfg.readEntry( "show_author", true );
m_author_font = cfg.readEntry( "author_font", KGlobalSettings::generalFont() );
QFontMetrics fm( m_author_font );
m_font_height = fm.height();
m_author_color = cfg.readEntry( "author_color", Theme::defaultTheme()->color( Theme::TextColor ) );
QString size = cfg.readEntry( "size", "" );
m_config["size"] = size;
setSize( size );
m_config["listtype"] = cfg.readEntry( "listtype", "interestingness" );
// photosets
m_config["photoset-id"] = cfg.readEntry( "photoset-id", "" );
m_config["photoset-username"] = cfg.readEntry( "photoset-username", "" );
m_config["photoset-nsid"] = cfg.readEntry( "photoset-nsid", "" );
m_photoset_chosen = !m_config["photoset-id"].toString().isEmpty();
// tags
m_config["tag"] = cfg.readEntry( "tag", "" );
m_config["cluster-id"] = cfg.readEntry( "cluster-id", "" );
m_cluster_chosen = !m_config["cluster-id"].toString().isEmpty();
// location
m_config["location-lon"] = cfg.readEntry( "location-lon", 9.05747 );
m_config["location-lat"] = cfg.readEntry( "location-lat", 48.5331 );
int accuracy = cfg.readEntry( "location-accuracy", 11 ); // default to city level
m_config["location-accuracy"] = accuracy;
accuracy = ( accuracy < 1 || accuracy > 16 ) ? 11 : accuracy; // normalize
m_location_chosen = true;
sendConfigurationToEngine();
setBackgroundHints( m_show_background ? Applet::TranslucentBackground : Applet::NoBackground );
resetPixmapCache();
update();
}
void FlickrOP::sendConfigurationToEngine()
{
#if QT_VERSION < 0x040500
m_engine->setProperty( "config", QVariant::fromValue( m_config ) );
#else
m_engine->setProperty( "config", m_config );
#endif
m_config["force_reload"] = false;
m_config["check_token"] = false;
}
void FlickrOP::writeConfig()
{
KConfigGroup cfg = config();
int index = m_general_page->m_interval_combo->currentIndex();
int unit = m_general_page->m_interval_combo->itemData( index ).toInt();
int interval = m_general_page->m_interval_value->value() * unit;
cfg.writeEntry( "interval", interval );
cfg.writeEntry( "roundcorners", m_general_page->m_round_corner_check->isChecked() );
cfg.writeEntry( "showbackground", m_general_page->m_show_background_check->isChecked() );
cfg.writeEntry( "softborders", m_general_page->m_soft_borders_check->isChecked() );
QString newsize = m_general_page->m_size_combo->itemData( m_general_page->m_size_combo->currentIndex() ).toString();
cfg.writeEntry( "size", newsize );
cfg.writeEntry( "show_author", m_general_page->m_show_author_check->isChecked() );
cfg.writeEntry( "author_font", m_general_page->m_author_font_req->font() );
cfg.writeEntry( "author_color", m_general_page->m_colorbutton->color() );
QString listtype;
QString clusterid;
QString photosetid;
qreal longitude = m_config["location-lon"].toDouble();
qreal latitude = m_config["location-lat"].toDouble();
int accuracy = m_config["location-accuracy"].toInt();
if ( m_stream_page->m_favorite_radio->isChecked() )
{
listtype = "favorites";
}
else if ( m_stream_page->m_tag_radio->isChecked() && m_cluster_chosen )
{
listtype = "tag";
}
else if ( m_stream_page->m_photoset_radio->isChecked() && m_photoset_chosen )
{
listtype = "photoset";
}
else if ( m_stream_page->m_location_radio->isChecked() && m_location_chosen )
{
listtype = "location";
}
else
{
listtype = "interestingness";
}
cfg.writeEntry( "listtype", listtype );
if ( m_photoset_chosen )
{
photosetid = m_photosetdialog ? m_photosetdialog->photoset() : m_config["photoset-id"].toString();
cfg.writeEntry( "photoset-id", photosetid );
cfg.writeEntry( "photoset-username", m_stream_page->m_photoset_edit->text() );
cfg.writeEntry( "photoset-nsid", m_nsid );
}
if ( m_cluster_chosen )
{
cfg.writeEntry( "tag", m_stream_page->m_tag_edit->text() );
clusterid = m_clusterdialog ? m_clusterdialog->cluster() : m_config["cluster-id"].toString();
cfg.writeEntry( "cluster-id", clusterid );
}
if ( m_location_chosen )
{
longitude = m_locationdialog ? m_locationdialog->getLongitude() : m_config["location-lon"].toDouble();
latitude = m_locationdialog ? m_locationdialog->getLatitude() : m_config["location-lat"].toDouble();
accuracy = m_locationdialog ? m_locationdialog->getAccuracy() : m_config["location-accuracy"].toInt();
cfg.writeEntry( "location-lon", longitude );
cfg.writeEntry( "location-lat", latitude );
cfg.writeEntry( "location-accuracy", accuracy );
}
cfg.writeEntry( "token", m_config["token"] );
bool forceReload = ( m_config["listtype"] != listtype
|| newsize != m_config["size"].toString()
|| m_config["cluster-id"].toString() != clusterid
|| m_config["photoset-id"].toString() != photosetid
|| m_config["location-lon"].toDouble() != longitude
|| m_config["location-lat"].toDouble() != latitude
|| m_config["location-accuracy"].toInt() != accuracy );
m_config[ "force_reload" ] = forceReload;
if ( forceReload )
{
m_nextPhoto->setEnabled( false );
}
}
// http://www.flickr.com/services/api/misc.urls.html
// s small square 75x75
// t thumbnail, 100 on longest side
// m small, 240 on longest side
// - medium, 500 on longest side
// b large, 1024 on longest side (only exists for very large original images)
// o original image, either a jpg, gif or png, depending on source format
void FlickrOP::setSize( const QString &p_size )
{
// some margin
const int mw = 30;
const int mh = 30 + ( m_show_author ? 2 * m_font_height : 0 );
if ( p_size == "s" )
{
resize( 75 + mw, 75 + mh );
}
else if ( p_size == "t" )
{
resize( 100 + mw, 100 + mh );
}
else if ( p_size == "m" )
{
resize( 240 + mw, 240 + mh );
}
else if ( p_size.isEmpty() )
{
resize( 500 + mw, 500 + mh );
}
else if ( p_size == "b" )
{
resize( 1024 + mw, 1024 + mh );
}
// TODO: Original format
}
void FlickrOP::createConfigurationInterface( KConfigDialog *p_parent )
{
// we need this in order to enable, disable the OK/Apply buttons from slots
// in writeConfig and readConfig its already too late
m_config_dialog = p_parent;
m_config_dialog->setMinimumWidth( 550 );
p_parent->setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply );
connect( p_parent, SIGNAL( applyClicked() ), SLOT( writeConfig() ) );
connect( p_parent, SIGNAL( applyClicked() ), SLOT( readConfig() ) );
connect( p_parent, SIGNAL( okClicked() ), SLOT( writeConfig() ) );
connect( p_parent, SIGNAL( okClicked() ), SLOT( readConfig() ) );
m_general_page = new Ui::GeneralWidget;
m_stream_page = new Ui::StreamWidget;
m_authentication_page = new Ui::AuthenticationWidget;
QWidget *page = new QWidget();
m_general_page->setupUi( page );
p_parent->addPage( page, i18n( "General" ), "configure" );
page = new QWidget();
m_stream_page->setupUi( page );
p_parent->addPage( page, i18n( "Streams" ), "camera-photo" );
page = new QWidget();
m_authentication_page->setupUi( page );
p_parent->addPage( page, i18n( "Authentication" ), "preferences-desktop-user-password" );
// read settings and set widgets accordingly
setupWidgets();
}
void FlickrOP::setupWidgets()
{
const int minute = 60;
const int hour = 3600;
const int day = 86400;
m_general_page->m_interval_combo->setItemData( 0, 1 ); //seconds
m_general_page->m_interval_combo->setItemData( 1, minute ); // minutes
m_general_page->m_interval_combo->setItemData( 2, hour ); // hours
m_general_page->m_interval_combo->setItemData( 3, day ); // days
int interval = m_config.value("interval").toInt();
if ( interval > 0 && interval % day == 0 )
{
m_general_page->m_interval_value->setValue( interval / day );
m_general_page->m_interval_combo->setCurrentIndex( 3 );
}
else if ( interval > 0 && interval % hour == 0 )
{
m_general_page->m_interval_value->setValue( interval / hour );
m_general_page->m_interval_combo->setCurrentIndex( 2 );
}
else if ( interval > 0 && interval % minute == 0 )
{
m_general_page->m_interval_value->setValue( interval / minute );
m_general_page->m_interval_combo->setCurrentIndex( 1 );
}
else
{
// seconds
m_general_page->m_interval_value->setValue( interval );
m_general_page->m_interval_combo->setCurrentIndex( 0 );
}
m_general_page->m_size_combo->setItemData( 0, "s" );
m_general_page->m_size_combo->setItemData( 1, "t" );
m_general_page->m_size_combo->setItemData( 2, "m" );
m_general_page->m_size_combo->setItemData( 3, "" );
m_general_page->m_size_combo->setItemData( 4, "b" );
m_general_page->m_size_combo->setCurrentIndex( m_general_page->m_size_combo->findData( m_config["size"].toString() ) );
m_general_page->m_show_background_check->setChecked( m_show_background );
m_general_page->m_round_corner_check->setChecked( m_round_corners );
m_general_page->m_soft_borders_check->setChecked( m_soft_borders );
m_general_page->m_author_font_req->setFont( m_author_font );
m_general_page->m_colorbutton->setColor( m_author_color );
m_general_page->m_show_author_check->setChecked( m_show_author );
m_general_page->m_font_label->setEnabled( m_show_author );
m_general_page->m_author_font_req->setEnabled( m_show_author );
m_general_page->m_font_color_label->setEnabled( m_show_author );
m_general_page->m_colorbutton->setEnabled( m_show_author );
connect( m_general_page->m_show_author_check, SIGNAL( toggled( bool ) ), m_general_page->m_font_label, SLOT( setEnabled( bool ) ) );
connect( m_general_page->m_show_author_check, SIGNAL( toggled( bool ) ), m_general_page->m_author_font_req, SLOT( setEnabled( bool ) ) );
connect( m_general_page->m_show_author_check, SIGNAL( toggled( bool ) ), m_general_page->m_font_color_label, SLOT( setEnabled( bool ) ) );
connect( m_general_page->m_show_author_check, SIGNAL( toggled( bool ) ), m_general_page->m_colorbutton, SLOT( setEnabled( bool ) ) );
// streams page
connect( m_stream_page->m_interesting_radio, SIGNAL( toggled( bool ) ), this, SLOT( radioChanged() ) );
connect( m_stream_page->m_favorite_radio, SIGNAL( toggled( bool ) ), this, SLOT( radioChanged() ) );
connect( m_stream_page->m_photoset_radio, SIGNAL( toggled( bool ) ), this, SLOT( radioChanged() ) );
connect( m_stream_page->m_tag_radio, SIGNAL( toggled( bool ) ), this, SLOT( radioChanged() ) );
connect( m_stream_page->m_location_radio, SIGNAL( toggled( bool ) ), this, SLOT( radioChanged() ) );
m_stream_page->m_get_photoset_button->setEnabled( m_photoset_chosen );
m_stream_page->m_photoset_edit->setEnabled( false );
m_stream_page->m_photoset_edit->setEnabled( false );
m_stream_page->m_photoset_edit->setText( m_config["photoset-username"].toString() );
connect( m_stream_page->m_get_photoset_button, SIGNAL( clicked( bool ) ), SLOT( getPhotosets() ) );
connect( m_stream_page->m_photoset_edit, SIGNAL( textChanged( const QString & ) ), SLOT( photosetUserChanged( const QString & ) ) );
connect( m_stream_page->m_photoset_edit, SIGNAL( textEdited( const QString & ) ), SLOT( photosetUserEdited( const QString & ) ) );
connect( m_stream_page->m_photoset_edit, SIGNAL( returnPressed() ), SLOT( getPhotosets() ) );
connect( m_stream_page->m_get_cluster_button, SIGNAL( clicked( bool ) ), SLOT( getClusters() ) );
m_stream_page->m_get_cluster_button->setEnabled( m_cluster_chosen );
connect( m_stream_page->m_tag_edit, SIGNAL( textChanged( const QString & ) ), SLOT( tagTextChanged( const QString & ) ) );
connect( m_stream_page->m_tag_edit, SIGNAL( textEdited( const QString & ) ), SLOT( tagTextEdited( const QString & ) ) );
connect( m_stream_page->m_tag_edit, SIGNAL( returnPressed() ), SLOT( getClusters() ) );
m_stream_page->m_tag_edit->setEnabled( false );
connect( m_stream_page->m_get_location_button, SIGNAL( clicked( bool ) ), SLOT( showMarbleDialog() ) );
QString type = m_config["listtype"].toString();
m_stream_page->m_interesting_radio->setChecked( type == "interestingness" );
m_stream_page->m_favorite_radio->setChecked( type == "favorites" );
m_stream_page->m_photoset_radio->setChecked( type == "photoset" );
m_stream_page->m_photoset_edit->setEnabled( type == "photoset" );
m_stream_page->m_tag_radio->setChecked( type == "tag" );
m_stream_page->m_tag_edit->setEnabled( type == "tag" );
m_stream_page->m_location_radio->setChecked( type == "location" );
m_stream_page->m_get_location_button->setEnabled( type == "location" );
m_stream_page->m_tag_edit->setText( m_config["tag"].toString() );
// authentication
m_authentication_page->m_auth_button->setEnabled( !m_authenticated );
connect( m_authentication_page->m_auth_button, SIGNAL( clicked( bool ) ), SLOT( authenticate() ) );
}
QList FlickrOP::contextualActions()
{
return m_actions;
}
void FlickrOP::dataUpdated( const QString &p_sourceName, const DataEngine::Data &p_data )
{
if ( p_sourceName == "error" )
{
m_error.clear();
int type = p_data.value( "type" ).toInt();
QString message = p_data.value( "message" ).toString();
if ( type == ERR_APPLET )
{
// show on applet
m_error = message;
update();
}
else if ( type == ERR_MESSAGEBOX )
{
// delay it, such that we leave this function before it is called again
QMetaObject::invokeMethod( this, "showErrorBox", Qt::QueuedConnection, Q_ARG( QString, message ) );
}
else if ( !message.isEmpty() )
{
kDebug() << message << endl;
}
}
else if ( p_sourceName == "authentication" )
{
m_authenticated = p_data.value( "token_status" ).toBool();
m_config["token"] = p_data.value( "token" ).toString();
}
else if ( p_sourceName == "clusters" )
{
if ( m_clusterdialog )
{
m_clusterdialog->reset();
}
foreach( const QVariant &variant, p_data )
{
// filter out noise
if ( variant.type() != QVariant::StringList )
{
continue;
}
if ( !m_clusterdialog )
{
m_clusterdialog = new ClusterDialog();
connect( m_clusterdialog, SIGNAL( accepted() ), SLOT( clusterChosen() ) );
connect( m_config_dialog, SIGNAL( okClicked() ), m_clusterdialog, SLOT( deleteLater() ) );
}
m_clusterdialog->addCluster( variant.toStringList() );
}
QTimer::singleShot( 0, this, SLOT( showClusterDialog() ) );
}
else if ( p_sourceName == "nsid" && !p_data["nsid"].toString().isEmpty() )
{
m_nsid = p_data["nsid"].toString();
QMetaObject::invokeMethod( m_engine, "retrievePhotosets", Qt::DirectConnection, Q_ARG( QString, m_nsid ) );
}
else if ( p_sourceName == "photosets" )
{
if ( !p_data[ p_sourceName ].canConvert( QVariant::String ) )
{
if ( !m_photosetdialog )
{
m_photosetdialog = new PhotosetDialog();
connect( m_photosetdialog, SIGNAL( accepted() ), SLOT( photosetChosen() ) );
connect( m_config_dialog, SIGNAL( okClicked() ), m_photosetdialog, SLOT( deleteLater() ) );
}
m_photosetdialog->reset();
m_photosetdialog->addPhotosets( p_data );
QTimer::singleShot( 0, this, SLOT( showPhotosetDialog() ) );
}
}
else if ( p_sourceName == "flickr" && QString( p_data["flickr"].typeName() ) == "Photo" ) // flickr stream
{
m_error.clear();
m_photo = p_data.value( "flickr" ).value();
m_pixmapPhoto.load( m_photo.filename, "JPG" );
resetPixmapCache();
m_nextPhoto->setEnabled( true );
m_visitAuthor->setEnabled( true );
m_visitPhotoPage->setEnabled( true );
m_visitAuthorPhotos->setEnabled( true );
m_markFavorite->setEnabled( m_authenticated );
if ( m_oldPixmapCache.isNull() )
{
m_alpha = 1.0;
update();
}
else
{
// there's an old pixmap available, do a nice fadeout
m_timeline->start();
}
}
}
void FlickrOP::showErrorBox( const QString &p_message )
{
KMessageBox::error( 0, p_message );
}
void FlickrOP::nextPhoto()
{
m_nextPhoto->setEnabled( false );
QMetaObject::invokeMethod( m_engine, "nextPhoto", Qt::DirectConnection );
}
void FlickrOP::visitAuthor()
{
KRun::runUrl( m_photo.author.profileUrl, "text/html", 0 );
}
void FlickrOP::visitAuthorPhotos()
{
KRun::runUrl( m_photo.author.photosUrl, "text/html", 0 );
}
void FlickrOP::visitPhoto()
{
QString nsid = m_photo.author.nsid;
QString photoid = m_photo.id;
QString url = QString( "http://www.flickr.com/photos/%1/%2" ).arg( nsid ).arg( photoid );
KRun::runUrl( KUrl( url ), "text/html", 0 );
}
void FlickrOP::authenticate()
{
QMetaObject::invokeMethod( m_engine, "startAuthentication", Qt::QueuedConnection );
if ( KMessageBox::warningContinueCancel( 0, i18n( "A browser will open now with the request to authenticate Flickr On Plasma. When you accepted this request, press Continue." ) ) == KMessageBox::Continue )
{
QMetaObject::invokeMethod( m_engine, "continueAuthentication", Qt::DirectConnection );
}
}
void FlickrOP::markAsFavorite()
{
QMetaObject::invokeMethod( m_engine, "markAsFavorite", Qt::DirectConnection );
}
void FlickrOP::getClusters()
{
QMetaObject::invokeMethod( m_engine, "retrieveClusters", Qt::DirectConnection, Q_ARG( QString, m_stream_page->m_tag_edit->text() ) );
}
void FlickrOP::showClusterDialog()
{
if ( m_clusterdialog )
{
m_clusterdialog->exec();
}
}
void FlickrOP::showPhotosetDialog()
{
if ( m_photosetdialog )
{
m_photosetdialog->exec();
}
}
void FlickrOP::tagTextChanged( const QString &p_tag )
{
m_stream_page->m_get_cluster_button->setEnabled( !p_tag.isEmpty() );
}
void FlickrOP::tagTextEdited( const QString &p_tag )
{
Q_UNUSED( p_tag );
m_cluster_chosen = false;
setOkButton();
}
void FlickrOP::radioChanged()
{
bool photosetsSelected = m_stream_page->m_photoset_radio->isChecked();
m_stream_page->m_photoset_edit->setEnabled( photosetsSelected );
m_stream_page->m_get_photoset_button->setEnabled( photosetsSelected );
bool tagsSelected = m_stream_page->m_tag_radio->isChecked();
m_stream_page->m_tag_edit->setEnabled( tagsSelected );
m_stream_page->m_get_cluster_button->setEnabled( tagsSelected && !m_stream_page->m_tag_edit->text().isEmpty() );
m_stream_page->m_get_location_button->setEnabled( m_stream_page->m_location_radio->isChecked() );
setOkButton();
}
void FlickrOP::setOkButton()
{
if ( m_config_dialog )
{
m_config_dialog->enableButtonOk(
( !m_stream_page->m_tag_radio->isChecked() || m_cluster_chosen )
&& ( !m_stream_page->m_photoset_radio->isChecked() || m_photoset_chosen )
&& ( !m_stream_page->m_location_radio->isChecked() || m_location_chosen ) );
}
}
void FlickrOP::clusterChosen()
{
m_cluster_chosen = true;
setOkButton();
}
void FlickrOP::photosetUserChanged( const QString &p_username )
{
m_stream_page->m_get_photoset_button->setEnabled( !p_username.isEmpty() );
}
void FlickrOP::photosetUserEdited( const QString &p_username )
{
Q_UNUSED( p_username );
m_photoset_chosen = false;
setOkButton();
}
void FlickrOP::photosetChosen()
{
m_photoset_chosen = true;
setOkButton();
}
void FlickrOP::getPhotosets()
{
QMetaObject::invokeMethod( m_engine, "retrieveNSID", Qt::DirectConnection, Q_ARG( QString, m_stream_page->m_photoset_edit->text() ) );
}
void FlickrOP::showMarbleDialog()
{
if ( !m_locationdialog )
{
#ifdef WITH_MARBLE
m_locationdialog = new MarbleDialog();
#else
m_locationdialog = new CoordinateDialog();
#endif
connect( m_locationdialog, SIGNAL( accepted() ), SLOT( locationChosen() ) );
connect( m_config_dialog, SIGNAL( okClicked() ), m_locationdialog, SLOT( deleteLater() ) );
m_locationdialog->setLongitude( m_config["location-lon"].toDouble() );
m_locationdialog->setLatitude( m_config["location-lat"].toDouble() );
m_locationdialog->setAccuracy( m_config["location-accuracy"].toInt() );
}
m_locationdialog->exec();
}
void FlickrOP::locationChosen()
{
m_location_chosen = true;
setOkButton();
}
void FlickrOP::setAlpha( qreal p_value )
{
m_alpha = p_value;
update();
}
void FlickrOP::resetPixmapCache()
{
m_oldPixmapCache = m_pixmapCache;
m_pixmapCache = QPixmap();
}
K_EXPORT_PLASMA_APPLET(flickrop, FlickrOP)
flickrop-0.7.1/applet/flickrop.h 0000664 0000000 0000000 00000010665 11261733517 0016615 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef FLICKR_OP_H
#define FLICKR_OP_H
#include
#include
#include
#include
#include "ui_generalsettings.h"
#include "ui_streamsettings.h"
#include "ui_authenticationsettings.h"
#include "../engine/types.h"
class QTimeLine;
class KConfigDialog;
class ClusterDialog;
class PhotosetDialog;
class LocationDialog;
class FlickrOP : public Plasma::Applet
{
Q_OBJECT
public:
FlickrOP( QObject* p_parent, const QVariantList& p_args );
~FlickrOP();
protected:
QList contextualActions();
void createConfigurationInterface( KConfigDialog *p_parent );
void setupWidgets();
void init();
void paintCache( const QStyleOptionGraphicsItem *p_option, const QRect &p_contentsRect );
void paintInterface ( QPainter *p_painter, const QStyleOptionGraphicsItem *p_option, const QRect &p_contentsRect );
void resetPixmapCache();
void sendConfigurationToEngine();
void setSize( const QString &p_size );
protected slots:
void authenticate();
void clusterChosen();
void getClusters();
void getPhotosets();
void locationChosen();
void markAsFavorite();
void nextPhoto();
void photosetChosen();
void photosetUserChanged( const QString &p_username );
void photosetUserEdited( const QString &p_username );
void radioChanged();
void readConfig();
void setAlpha( qreal p_value );
void setOkButton();
void showClusterDialog();
void showErrorBox( const QString &p_message );
void showMarbleDialog();
void showPhotosetDialog();
void tagTextChanged( const QString &p_tag );
void tagTextEdited( const QString &p_tag );
void visitAuthor();
void visitAuthorPhotos();
void visitPhoto();
void writeConfig();
public slots:
void dataUpdated( const QString &p_sourceName, const Plasma::DataEngine::Data &p_data );
private:
QPixmap createMask( const QSize &p_size );
private:
// contains some data about the currently shown photo
Photo m_photo;
QString m_error;
QPixmap m_pixmapPhoto;
QPixmap m_pixmapCache;
QPixmap m_oldPixmapCache;
QList m_actions;
Plasma::DataEngine *m_engine;
QTimeLine *m_timeline;
qreal m_alpha;
bool m_authenticated;
bool m_cluster_chosen;
bool m_tag_edited;
bool m_photoset_chosen;
bool m_location_chosen;
QString m_nsid;
QPointer m_clusterdialog;
QPointer m_photosetdialog;
QPointer m_locationdialog;
// configuration pages
Ui::GeneralWidget *m_general_page;
Ui::StreamWidget *m_stream_page;
Ui::AuthenticationWidget *m_authentication_page;
// actions which require authorization
QAction *m_markFavorite;
QAction *m_nextPhoto;
QAction *m_visitAuthor;
QAction *m_visitPhotoPage;
QAction *m_visitAuthorPhotos;
// widgets
KConfigDialog *m_config_dialog;
// preferences
Plasma::DataEngine::Data m_config;
bool m_show_author;
bool m_round_corners;
bool m_show_background;
bool m_soft_borders;
QFont m_author_font;
QColor m_author_color;
int m_font_height;
};
#endif // FLICKR_OP_H
flickrop-0.7.1/applet/generalsettings.ui 0000664 0000000 0000000 00000012426 11261733517 0020365 0 ustar 00root root 0000000 0000000
GeneralWidget
0
0
442
261
Form
-
-
New photo every:
m_interval_value
-
-
1
-
0
0
-
seconds
-
minutes
-
hours
-
days
-
Photo size:
m_size_combo
-
-
Tiny
-
Thumbnail
-
Small
-
Medium
-
Large
-
Show background
-
Round corners
-
Soft borders
-
Show title and author
-
Font:
m_author_font_req
-
-
Color:
m_colorbutton
-
-
Qt::Vertical
20
0
KFontRequester
QWidget
KComboBox
QComboBox
KColorButton
QPushButton
KIntNumInput
QWidget
flickrop-0.7.1/applet/locationdialog.cpp 0000664 0000000 0000000 00000005304 11261733517 0020321 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include
#include
#include "locationdialog.h"
LocationDialog::LocationDialog( QWidget *p_parent )
: KDialog( p_parent )
, m_accuracy( s_default_accuracy )
{
/* Recorded accuracy level of the location information. Current range is 1-16 :
* World level is 1
* Country is ~3
* Region is ~6
* City is ~11
* Street is ~16
*
* http://www.flickr.com/services/api/flickr.photos.search.html
*/
m_accuracyCombo = new KComboBox( this );
connect( m_accuracyCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( accuracyChanged( int ) ) );
m_accuracyCombo->addItem( i18n( "World scale" ), 1 );
m_accuracyCombo->addItem( i18n( "Country scale" ), 3 );
m_accuracyCombo->addItem( i18n( "Region scale" ), 6 );
m_accuracyCombo->addItem( i18n( "City scale" ), 11 );
m_accuracyCombo->addItem( i18n( "Street scale" ), 16 );
}
LocationDialog::~LocationDialog()
{
}
int LocationDialog::getAccuracy() const
{
return m_accuracy;
}
void LocationDialog::setAccuracy( int p_accuracy )
{
m_accuracy = p_accuracy;
int index = m_accuracyCombo->findData( p_accuracy );
m_accuracyCombo->setCurrentIndex( index );
}
void LocationDialog::accuracyChanged( int p_index )
{
m_accuracy = m_accuracyCombo->itemData( p_index ).toInt();
}
flickrop-0.7.1/applet/locationdialog.h 0000664 0000000 0000000 00000004173 11261733517 0017771 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef LOCATIONDIALOG_H
#define LOCATIONDIALOG_H
#include
class KComboBox;
static const int s_default_accuracy = 11; // default to city level
class LocationDialog : public KDialog
{
Q_OBJECT
public:
LocationDialog( QWidget *p_parent = 0 );
virtual ~LocationDialog();
int getAccuracy() const;
virtual qreal getLatitude() const = 0;
virtual qreal getLongitude() const = 0;
void setAccuracy( int p_accuracy );
virtual void setLatitude( qreal p_latitude ) = 0;
virtual void setLongitude( qreal p_longitude ) = 0;
public slots:
void accuracyChanged( int p_accuracy );
protected:
int m_accuracy;
KComboBox *m_accuracyCombo;
};
#endif // LOCATIONDIALOG_H
flickrop-0.7.1/applet/marbledialog.cpp 0000664 0000000 0000000 00000006136 11261733517 0017757 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include
#include
#include
#include
#include
#include "marbledialog.h"
MarbleDialog::MarbleDialog( QWidget *p_parent )
: LocationDialog( p_parent )
{
QGroupBox *group = new QGroupBox( i18n("Select a location:" ), this );
QHBoxLayout *hlayout = new QHBoxLayout( group );
QVBoxLayout *vlayout = new QVBoxLayout( group );
m_marbleWidget = new Marble::MarbleWidget( group );
m_marbleWidget->setMapThemeId( "earth/plain/plain.dgml" );
m_marbleControl = new Marble::MarbleControlBox( group );
m_marbleControl->addMarbleWidget( m_marbleWidget );
hlayout->addWidget( m_marbleControl, 0 );
vlayout->addWidget( m_marbleWidget, 1 );
QHBoxLayout *hlayout2 = new QHBoxLayout( group );
QLabel *label = new QLabel( i18n( "Accuracy:" ), group );
label->setBuddy( m_accuracyCombo );
hlayout2->addWidget( label, 0 );
hlayout2->addWidget( m_accuracyCombo, 1 );
vlayout->addLayout( hlayout2, 0 );
hlayout->addLayout( vlayout, 1 );
setMainWidget( group );
setInitialSize( QSize( 800, 600 ) );
setButtons( KDialog::Ok | KDialog::Cancel );
setZoom( 1337 );
}
MarbleDialog::~MarbleDialog()
{
}
void MarbleDialog::setLongitude( qreal p_longitude )
{
return m_marbleWidget->setCenterLongitude( p_longitude );
}
void MarbleDialog::setLatitude( qreal p_latitude )
{
return m_marbleWidget->setCenterLatitude( p_latitude );
}
qreal MarbleDialog::getLongitude() const
{
return m_marbleWidget->centerLongitude();
}
qreal MarbleDialog::getLatitude() const
{
return m_marbleWidget->centerLatitude();
}
void MarbleDialog::setZoom( int p_zoomLevel )
{
m_marbleWidget->zoomView( p_zoomLevel );
}
flickrop-0.7.1/applet/marbledialog.h 0000664 0000000 0000000 00000004046 11261733517 0017422 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef LOCATION_DIALOG_H
#define LOCATION_DIALOG_H
#include
#include
#include "locationdialog.h"
class QRadioButton;
class QVBoxLayout;
class MarbleDialog : public LocationDialog
{
Q_OBJECT
public:
MarbleDialog( QWidget *p_parent = 0 );
~MarbleDialog();
qreal getLatitude() const;
qreal getLongitude() const;
void setLatitude( qreal p_latitude );
void setLongitude( qreal p_longitude );
void setZoom( int p_zoomLevel );
private:
Marble::MarbleWidget *m_marbleWidget;
Marble::MarbleControlBox *m_marbleControl;
};
#endif // LOCATION_DIALOG_H
flickrop-0.7.1/applet/photosetdialog.cpp 0000664 0000000 0000000 00000006344 11261733517 0020363 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include "photosetdialog.h"
#include
#include
#include
#include
using namespace Plasma;
PhotosetItem::PhotosetItem( const QString &p_text )
: QListWidgetItem( p_text )
{
}
PhotosetItem::~PhotosetItem()
{
}
QVariant PhotosetItem::data( int p_role ) const
{
return p_role == s_photoset_id ? m_data : QListWidgetItem::data( p_role );
}
void PhotosetItem::setData( int p_role, const QVariant &p_data )
{
if ( p_role == s_photoset_id)
{
m_data = p_data.toString();
}
else
{
QListWidgetItem::setData( p_role, p_data );
}
}
PhotosetDialog::PhotosetDialog( QWidget *p_parent )
: KDialog( p_parent )
{
QGroupBox *group = new QGroupBox( i18n( "Please select a photoset below:" ), this );
QVBoxLayout *layout = new QVBoxLayout( group );
m_list = new KListWidget( group );
connect( m_list, SIGNAL( itemSelectionChanged() ), this, SLOT( photosetChosen() ) );
m_list->setSelectionMode( QAbstractItemView::SingleSelection );
m_list->setMinimumSize( 300, 500 );
m_list->setSortingEnabled( true );
layout->addWidget( m_list );
setMainWidget( group );
setButtons( KDialog::Ok | KDialog::Cancel );
enableButtonOk( false );
}
PhotosetDialog::~PhotosetDialog()
{
}
void PhotosetDialog::addPhotosets( const DataEngine::Data &p_data )
{
DataEngine::Data::const_iterator it = p_data.begin();
for ( ; it != p_data.end(); ++it )
{
PhotosetItem *item = new PhotosetItem( it.value().toString() );
item->setData( s_photoset_id, it.key() );
m_list->addItem( item );
}
}
void PhotosetDialog::reset()
{
m_list->clear();
enableButtonOk( false );
}
QString PhotosetDialog::photoset() const
{
return m_list->currentItem()->data( s_photoset_id ).toString();
}
void PhotosetDialog::photosetChosen()
{
enableButtonOk( true );
}
flickrop-0.7.1/applet/photosetdialog.h 0000664 0000000 0000000 00000004357 11261733517 0020032 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef PHOTOSET_DIALOG_H
#define PHOTOSET_DIALOG_H
#include
#include
#include
static const int s_photoset_id = -1;
class QRadioButton;
class KListWidget;
class PhotosetItem : public QListWidgetItem
{
public:
PhotosetItem( const QString &p_text = QString::null );
~PhotosetItem();
QVariant data( int p_role = s_photoset_id ) const;
void setData( int p_role, const QVariant &p_value );
private:
QString m_data;
};
class PhotosetDialog : public KDialog
{
Q_OBJECT
public:
PhotosetDialog( QWidget *p_parent = 0 );
~PhotosetDialog();
void addPhotosets( const Plasma::DataEngine::Data &p_data );
QString photoset() const;
void reset();
protected slots:
void photosetChosen();
private:
KListWidget *m_list;
};
#endif // CLUSTER_DIALOG_H
flickrop-0.7.1/applet/plasma-applet-flickrop.desktop 0000664 0000000 0000000 00000001130 11261733517 0022560 0 ustar 00root root 0000000 0000000 [Desktop Entry]
Name=Flickr On Plasma
Comment=Displays interesting photos on Flickr.
Comment[nl]=Laat interessante foto's zien van Flickr.
Type=Service
Icon=camera-photo
X-KDE-ServiceTypes=Plasma/Applet
X-KDE-Library=plasma_applet_flickrop
X-KDE-PluginInfo-Author=Bram Schoenmakers
X-KDE-PluginInfo-Email=bramschoenmakers@kde.nl
X-KDE-PluginInfo-Name=plasma_applet_flickrop
X-KDE-PluginInfo-Version=0.7.1
X-KDE-PluginInfo-Website=http://www.bramschoenmakers.nl/node/556
X-KDE-PluginInfo-Category=Graphics
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
flickrop-0.7.1/applet/streamsettings.ui 0000664 0000000 0000000 00000010261 11261733517 0020236 0 ustar 00root root 0000000 0000000
StreamWidget
0
0
390
369
Form
-
Which photos to show?
-
Interesting photos
-
My favorite photos
-
-
Photoset
-
-
Get photosets...
-
By tag
-
0
0
-
0
0
Get clusters...
-
By location
-
Qt::Horizontal
40
20
-
Choose location...
-
Qt::Vertical
20
0
KLineEdit
QLineEdit
KPushButton
QPushButton
flickrop-0.7.1/engine/ 0000775 0000000 0000000 00000000000 11261733517 0014603 5 ustar 00root root 0000000 0000000 flickrop-0.7.1/engine/CMakeLists.txt 0000664 0000000 0000000 00000000721 11261733517 0017343 0 ustar 00root root 0000000 0000000 # We add our source code here
set(flickrop_engine_SRCS flickr_engine.cpp)
# Now make sure all files get to the right place
kde4_add_plugin(plasma_engine_flickrop ${flickrop_engine_SRCS})
target_link_libraries(plasma_engine_flickrop
${PLASMA_LIBS} ${KDE4_KIO_LIBS})
install(TARGETS plasma_engine_flickrop
DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-dataengine-flickrop.desktop
DESTINATION ${SERVICES_INSTALL_DIR}) flickrop-0.7.1/engine/flickr_engine.cpp 0000664 0000000 0000000 00000053066 11261733517 0020120 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include "flickr_engine.h"
using namespace Plasma;
static const char* s_flickr_auth = "http://www.flickr.com/services/auth/";
static const char* s_flickr_rest = "http://www.flickr.com/services/rest/";
// Flickr API key for Flickr On Plasma
static const char* s_apikey = "64dfce7e96302f412c7f0ece0897b1d2";
static const char* s_secret = "d7458fd6f08296e1";
static QHash< QString, PhotoListType > s_photoListTypes;
FlickrEngine::FlickrEngine( QObject *p_parent, const QVariantList &p_args )
: DataEngine( p_parent, p_args )
, m_waiting_for_retrieval( false )
, m_timer( 0 )
, m_type( INTERESTINGNESS )
{
KGlobal::locale()->insertCatalog("flickrop");
s_photoListTypes[ "interestingness" ] = INTERESTINGNESS;
s_photoListTypes[ "favorites" ] = FAVORITES;
s_photoListTypes[ "photoset" ] = PHOTOSET;
s_photoListTypes[ "tag" ] = TAG;
s_photoListTypes[ "location" ] = LOCATION;
}
FlickrEngine::~FlickrEngine()
{
}
void FlickrEngine::init()
{
m_timer = new QTimer( this );
connect( m_timer, SIGNAL( timeout() ), this, SLOT( nextPhoto() ) );
m_timer->setSingleShot( true );
setData( "flickr", "" );
setData( "error", "" );
setData( "authentication", "" );
setData( "clusters", "" );
setData( "nsid", "" );
setData( "photosets", "" );
// in 5 minutes, clean the cache. we'll wait with this because this is called when the machine is still launching the desktop.
QTimer::singleShot( 5 * 60 * 1000, this, SLOT( cleanCache() ) );
// and for those machines with long uptimes, set a daily timer to clean the cache
QTimer *cleanupTimer = new QTimer( this );
connect( cleanupTimer, SIGNAL( timeout() ), this, SLOT( cleanCache() ) );
cleanupTimer->start( 24 * 60 * 60 * 1000 );
// seed the RNG
qsrand( QDateTime::currentDateTime().time().msec() );
}
bool FlickrEngine::processResponse( KJob *p_job, QDomDocument *p_doc )
{
if ( p_job->error() )
{
setError( i18n( "An error occured while obtaining data from Flickr." ) );
}
else
{
KIO::StoredTransferJob *job = qobject_cast( p_job );
if ( job )
{
p_doc->setContent( job->data() );
return true;
}
}
return false;
}
QString FlickrEngine::signCall( const Params &p_arguments )
{
// Params is a QMap, the keys are sorted, just like Flickr Auth wants it.
QString signature = s_secret;
Params::const_iterator it = p_arguments.begin();
for ( ; it != p_arguments.end(); ++it )
{
signature += it.key();
signature += it.value();
}
KMD5 md5( signature.toUtf8() );
return QString::fromUtf8( md5.hexDigest().data() );
}
KUrl FlickrEngine::constructApiUrl( Params &p_arguments, bool p_signed )
{
// add the API key
p_arguments["api_key"] = s_apikey;
Params::const_iterator it;
if ( p_signed )
{
p_arguments["api_sig"] = signCall( p_arguments );
}
KUrl url( s_flickr_rest );
it = p_arguments.begin();
for ( ; it != p_arguments.end(); ++it )
{
url.addQueryItem( it.key(), it.value() );
}
return url;
}
void FlickrEngine::startAuthentication()
{
Params p;
p["method"] = "flickr.auth.getFrob";
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob* ) ), this, SLOT( frobJobDone( KJob * ) ) );
}
void FlickrEngine::frobJobDone( KJob *p_job )
{
if ( p_job->error() )
{
setError( i18n( "Could not initiate authentication." ) );
}
else
{
// obtain frob
KIO::StoredTransferJob *job = qobject_cast( p_job );
QByteArray data = job->data();
QDomDocument doc;
doc.setContent( job->data() );
m_frob = doc.elementsByTagName( "frob" ).item(0).toElement().text();
// sign it
Params p;
p["api_key"] = s_apikey;
p["perms"] = "write";
p["frob"] = m_frob;
QString sig = signCall( p );
// now, construct the URL and run the browser on it
KUrl url( s_flickr_auth );
url.addQueryItem( "api_key", s_apikey );
url.addQueryItem( "perms", "write" );
url.addQueryItem( "frob", m_frob );
url.addQueryItem( "api_sig", signCall( p ) );
KRun::runUrl( url, "text/html", 0 );
// show message box
}
}
void FlickrEngine::continueAuthentication()
{
// get token
Params p;
p["method"] = "flickr.auth.getToken";
p["frob"] = m_frob;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( tokenJobDone( KJob * ) ) );
}
void FlickrEngine::tokenJobDone( KJob *p_job )
{
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
m_token = doc.elementsByTagName( "token" ).item(0).toElement().text();
setData( "authentication", "token", m_token );
setData( "authentication", "token_status", true );
}
}
void FlickrEngine::checkToken()
{
Params p;
p["method"] = "flickr.auth.checkToken";
p["auth_token"] = m_token;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob* ) ), this, SLOT( tokenCheckDone( KJob * ) ) );
}
void FlickrEngine::tokenCheckDone( KJob *p_job )
{
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
setData( "authentication", "token_status", doc.elementsByTagName( "err" ).isEmpty() );
m_nsid = doc.elementsByTagName( "user" ).at( 0 ).toElement().attribute( "nsid" );
}
}
void FlickrEngine::retrievePhotos()
{
switch ( m_type )
{
case INTERESTINGNESS: retrieveInterestingnessList(); break;
case FAVORITES: retrieveUserFavoriteList(); break;
case PHOTOSET: retrievePhotoset( m_config["photoset-id"].toString() ); break;
case TAG: retrievePhotosByCluster( m_config["tag"].toString(), m_config["cluster-id"].toString() ); break;
case LOCATION: retrievePhotosByGeo( m_config["location-lon" ].toDouble(), m_config["location-lat"].toDouble(), m_config["location-accuracy"].toInt() ); break;
default: retrieveInterestingnessList(); break;
}
}
void FlickrEngine::retrieveInterestingnessList()
{
Params p;
p["method"] = "flickr.interestingness.getList";
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, false ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob* ) ), this, SLOT( listJobDone( KJob * ) ) );
}
void FlickrEngine::retrieveUserFavoriteList()
{
Params p;
p["method"] = "flickr.favorites.getList";
p["auth_token"] = m_token;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob* ) ), this, SLOT( listJobDone( KJob * ) ) );
}
void FlickrEngine::listJobDone( KJob *p_job )
{
m_waiting_for_retrieval = false;
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
processList( doc );
// sometimes Flickr returns empty photo lists
if ( m_photos.count() > 0 )
{
// retrieve first author
if ( m_type != PHOTOSET )
{
retrieveAuthor( *m_photo_it );
}
}
}
nextPhoto();
}
void FlickrEngine::cleanCache()
{
QDir d( KStandardDirs::locateLocal( "cache", "flickrop/" ), "*.jpg *.gif *.png", QDir::Time, QDir::Files );
QDateTime aweekago = QDateTime::currentDateTime().addDays( -7 );
QFileInfoList l = d.entryInfoList();
foreach( const QFileInfo &fi, l )
{
if ( fi.created() < aweekago )
{
d.remove( fi.fileName() );
}
}
}
void FlickrEngine::processList( const QDomDocument &p_doc )
{
// skip setProperty( "photoid", p_photo.id );
connect( job, SIGNAL( result( KJob* ) ), this, SLOT( authorJobDone( KJob * ) ) );
}
void FlickrEngine::authorJobDone( KJob *p_job )
{
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
QString photoid( p_job->property( "photoid" ).toString() );
QList::iterator it;
for ( it = m_photos.begin(); it != m_photos.end(); ++it )
{
if ( (*it).id == photoid )
{
break;
}
}
if ( it == m_photos.end() )
{
// the photo disappeared, perhaps a new list was retrieved in the meantime
return;
}
(*it).author.username = doc.elementsByTagName( "username" ).item(0).toElement().text();
(*it).author.profileUrl = doc.elementsByTagName( "profileurl" ).item(0).toElement().text();
(*it).author.photosUrl = doc.elementsByTagName( "photosurl" ).item(0).toElement().text();
(*it).authorRetrieved = true;
if ( (*it).photoRetrieved )
{
setPhoto( *it );
}
// otherwise wait for photoJobDone to finish
}
}
void FlickrEngine::nextPhoto()
{
// in case we force a photo update (i.e. the timer hasn't timed out yet)
m_timer->stop();
// the boolean makes sure to call this only once. for the frantics out there hitting Next Photo repeatedly.
if ( !m_waiting_for_retrieval && m_photos.isEmpty() )
{
// retrieving the photos has failed somehow. let's try again in 5
// minutes.
QTimer::singleShot( 5 * 60 * 1000, this, SLOT( retrievePhotos() ) );
m_waiting_for_retrieval = true; return;
}
else if ( m_waiting_for_retrieval )
{
// waiting, don't do anything now
return;
}
if ( m_photo_it == m_photos.end() )
{
// we ran out of photos, retrieve new photos
retrievePhotos();
return;
}
if ( !KStandardDirs::exists( (*m_photo_it).filename ) )
{
// not in cache, retrieve it
retrievePhoto( *m_photo_it );
}
else if ( (*m_photo_it).authorRetrieved )
{
// show photo from cache
setPhoto( *m_photo_it );
}
else // photo is in cache, but we're waiting for the author job to complete
{
(*m_photo_it).photoRetrieved = true;
}
++m_photo_it;
m_timer->start( m_config.value("interval").toInt() * 1000 );
// try to retrieve the next author in advance
if ( m_photo_it != m_photos.end() && m_type != PHOTOSET )
{
retrieveAuthor( *m_photo_it );
}
}
void FlickrEngine::retrievePhoto( const Photo &p_photo )
{
KIO::StoredTransferJob *job = KIO::storedGet( p_photo.url, KIO::NoReload, KIO::HideProgressInfo );
job->setProperty( "photoid", p_photo.id );
connect( job, SIGNAL( result( KJob * ) ), SLOT( photoJobDone( KJob * ) ) );
}
void FlickrEngine::photoJobDone( KJob *p_job )
{
if ( p_job->error() )
{
setError( i18n( "Could not retrieve the requested photo from Flickr." ), ERR_APPLET );
}
else
{
KIO::StoredTransferJob *job = qobject_cast( p_job );
// retrieve hash and reconstruct filename
QString photoid = job->property( "photoid" ).toString();
QList::iterator it;
for ( it = m_photos.begin(); it != m_photos.end(); ++it )
{
if ( (*it).id == photoid )
{
break;
}
}
Q_ASSERT( it != m_photos.end() );
// save data to cache
QFile file( (*it).filename );
file.open( QIODevice::WriteOnly );
QDataStream s( &file );
QByteArray ba = job->data();
s.writeRawData( ba.constData(), ba.size() );
file.close();
(*it).photoRetrieved = true;
if ( (*it).authorRetrieved )
{
setPhoto( *it );
}
// otherwise wait for authorJobDone to finish
}
}
void FlickrEngine::setPhoto( const Photo &p_photo )
{
QVariant data;
data.setValue( p_photo );
setData( "flickr", data );
}
void FlickrEngine::setError( const QString &p_error, ErrorType p_type )
{
DataEngine::Data data;
data["type"] = p_type;
data["message"] = p_error;
setData( "error", data );
}
#if QT_VERSION < 0x040500
DataEngine::Data FlickrEngine::config() const
{
return m_config;
}
void FlickrEngine::setConfig( const DataEngine::Data &p_config )
{
m_config = p_config;
#else
QVariant FlickrEngine::config() const
{
return m_config;
}
void FlickrEngine::setConfig( const QVariant &p_config )
{
m_config = p_config.toHash();
#endif
m_size = m_config.value( "size" ).toString();
m_token = m_config.value( "token" ).toString();
setData( "authentication", "token", m_token );
m_type = s_photoListTypes[ m_config.value( "listtype" ).toString() ];
if ( m_config.value( "check_token" ).toBool() )
{
checkToken();
}
if ( m_config.value( "force_reload" ).toBool() )
{
retrievePhotos();
}
static int s_interval = 0;
if ( s_interval != m_config.value( "interval" ).toInt() )
{
m_timer->stop();
s_interval = m_config.value( "interval" ).toInt();
m_timer->start( s_interval * 1000 );
}
}
void FlickrEngine::markAsFavorite()
{
Params p;
p["method"] = "flickr.favorites.add";
p["photo_id"] = ( *(m_photo_it - 1) ).id;
p["auth_token"] = m_token;
KIO::TransferJob *job = KIO::http_post( constructApiUrl( p, true ), QByteArray(), KIO::HideProgressInfo );
job->addMetaData( "content-type", "Content-Type: application/x-www-form-urlencoded" );
}
void FlickrEngine::retrieveClusters( const QString &p_tag )
{
Params p;
p["method"] = "flickr.tags.getClusters";
p["tag"] = p_tag;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, false ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), SLOT( clusterJobDone( KJob * ) ) );
}
void FlickrEngine::clusterJobDone( KJob *p_job )
{
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
QDomNodeList errors = doc.elementsByTagName( "err" );
if ( !errors.isEmpty() )
{
setError( i18n( "Could not retrieve clusters for given tag" ), ERR_MESSAGEBOX );
return;
}
DataEngine::Data data;
QDomNodeList clusters = doc.elementsByTagName( "cluster" );
for ( uint i = 0; i < clusters.length(); ++i )
{
QDomNodeList tagElements = clusters.item( i ).childNodes();
QStringList tags;
for ( uint j = 0; j < tagElements.length(); ++j )
{
tags += tagElements.item( j ).toElement().text();
}
QString key = QString( "cluster%1" ).arg( i );
data[ key ] = tags;
}
removeAllData( "clusters" );
setData( "clusters", data );
}
}
void FlickrEngine::retrievePhotosByCluster( const QString &p_tag, const QString &p_cluster_id )
{
Params p;
p["method"] = "flickr.tags.getClusterPhotos";
p["tag"] = p_tag;
p["cluster_id"] = p_cluster_id;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, false ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), SLOT( listJobDone( KJob * ) ) );
}
void FlickrEngine::retrieveNSID( const QString &p_username )
{
Params p;
p["method"] = "flickr.people.findByUsername";
p["username"] = p_username;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, false ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), SLOT( nsidJobDone( KJob * ) ) );
}
void FlickrEngine::nsidJobDone( KJob *p_job )
{
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
if ( !doc.elementsByTagName( "err" ).isEmpty() )
{
// error found
setError( i18n( "User not found" ), ERR_MESSAGEBOX );
return;
}
setData( "nsid", doc.elementsByTagName( "user" ).at( 0 ).toElement().attribute( "nsid" ) );
}
}
void FlickrEngine::retrievePhotosets( const QString &p_nsid )
{
Params p;
p["method"] = "flickr.photosets.getList";
p["auth_token"] = m_token;
p["user_id"] = p_nsid.isEmpty() ? m_nsid : p_nsid;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), SLOT( photosetJobDone( KJob * ) ) );
}
void FlickrEngine::photosetJobDone( KJob *p_job )
{
QDomDocument doc;
if ( processResponse( p_job, &doc ) )
{
DataEngine::Data data;
QDomNodeList photosets = doc.elementsByTagName( "photoset" );
if ( photosets.isEmpty() )
{
setError( i18n( "No (public) photosets were found for this user. This could occur when the user has uploaded restricted content. Please follow these steps if you want to access restricted content:- Create an account at Flickr if you don't have one already;
- Disable SafeSearch. Go to You\342\200\243Your Account\342\200\243Privacy & Permissions\342\200\243Edit Search settings\342\200\243SafeSearch off
- Authenticate Flickr On Plasma in the Authentication section.
" ), ERR_MESSAGEBOX );
return;
}
for ( uint i = 0; i < photosets.length(); ++i )
{
QDomElement photoset = photosets.item( i ).toElement();
QString title = photoset.firstChildElement( "title" ).text();
data[ photoset.attribute( "id" ) ] = title;
}
removeAllData( "photosets" );
setData( "photosets", data );
}
}
void FlickrEngine::retrievePhotoset( const QString &p_photoset_id )
{
Params p;
p["method"] = "flickr.photosets.getPhotos";
p["auth_token"] = m_token;
p["media"] = "photos";
p["photoset_id"] = p_photoset_id;
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), SLOT( listJobDone( KJob * ) ) );
}
void FlickrEngine::retrievePhotosByGeo( qreal p_longitude, qreal p_latitude, int p_accuracy )
{
Params p;
p["method"] = "flickr.photos.search";
p["lon"] = QString::number( p_longitude );
p["lat"] = QString::number( p_latitude );
p["accuracy"] = QString::number( p_accuracy );
KIO::StoredTransferJob *job = KIO::storedGet( constructApiUrl( p, true ), KIO::NoReload, KIO::HideProgressInfo );
connect( job, SIGNAL( result( KJob * ) ), SLOT( listJobDone( KJob * ) ) );
}
K_EXPORT_PLASMA_DATAENGINE(flickrop, FlickrEngine)
flickrop-0.7.1/engine/flickr_engine.h 0000664 0000000 0000000 00000010304 11261733517 0017551 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef FLICKR_ENGINE_H
#define FLICKR_ENGINE_H
#include
#include
#include
#include "types.h"
class KJob;
class FlickrEngine : public Plasma::DataEngine
{
Q_OBJECT
#if QT_VERSION < 0x040500
Q_PROPERTY( Plasma::DataEngine::Data config READ config WRITE setConfig )
#else
Q_PROPERTY( QVariant config READ config WRITE setConfig )
#endif
public:
FlickrEngine( QObject *p_parent, const QVariantList &p_args );
~FlickrEngine();
#if QT_VERSION < 0x040500
Plasma::DataEngine::Data config() const;
void setConfig( const Plasma::DataEngine::Data &p_config );
#else
QVariant config() const;
void setConfig( const QVariant &p_config );
#endif
protected:
void checkToken();
static KUrl constructApiUrl( Params &p_arguments, bool p_signed );
KUrl constructPhotoURL( const QString &p_id, const QString &p_farm, const QString &p_server, const QString &p_secret );
static QString hashPhoto( const Photo &p_photo );
void init();
void processList( const QDomDocument &p_doc );
void processPhoto( const QDomNode &p_photo );
bool processResponse( KJob *p_job, QDomDocument *p_doc );
void retrieveAuthor( const Photo &p_photo );
void retrievePhoto( const Photo &p_photo );
void retrievePhotoset( const QString &p_photoset_id );
void retrieveUserFavoriteList();
void retrieveInterestingnessList();
void setError( const QString &p_error, ErrorType p_type = ERR_ANY );
void setPhoto( const Photo &p_photo );
static QString signCall( const Params &p_arguments );
protected slots:
void authorJobDone( KJob *p_job );
void cleanCache();
void clusterJobDone( KJob *p_job );
void continueAuthentication();
void frobJobDone( KJob *p_job );
void listJobDone( KJob *p_job );
void markAsFavorite();
void nextPhoto();
void nsidJobDone( KJob *p_job );
void photoJobDone( KJob *p_job );
void photosetJobDone( KJob *p_job );
void retrieveClusters( const QString &p_tag );
void retrieveNSID( const QString &p_username );
void retrievePhotos();
void retrievePhotosets( const QString &p_nsid = QString::null );
void retrievePhotosByCluster( const QString &p_tag, const QString &p_cluster_id );
void retrievePhotosByGeo( qreal p_longitude, qreal p_latitude, int p_accuracy = 11 );
void startAuthentication();
void tokenCheckDone( KJob *p_job );
void tokenJobDone( KJob *p_job );
private:
bool m_waiting_for_retrieval;
Plasma::DataEngine::Data m_config;
PhotoList m_photos;
PhotoList::iterator m_photo_it;
QTimer *m_timer;
QString m_size;
// here the frob is stored during the authentication.
// More specifically, to keep it between startAuthentication() and continueAuthentication().
QString m_frob;
QString m_token;
QString m_nsid;
PhotoListType m_type;
};
#endif // FLICKR_OP_ENGINE_H
flickrop-0.7.1/engine/plasma-dataengine-flickrop.desktop 0000664 0000000 0000000 00000001140 11261733517 0023353 0 ustar 00root root 0000000 0000000 [Desktop Entry]
Name=Data Engine for Flickr On Plasma
Comment=Retrieves photos from Flickr
Comment[nl]=Haalt foto's op van Flickr
Type=Service
Icon=camera-photo
X-KDE-ServiceTypes=Plasma/DataEngine
X-KDE-Library=plasma_engine_flickrop
X-KDE-PluginInfo-Author=Bram Schoenmakers
X-KDE-PluginInfo-Email=bramschoenmakers@kde.nl
X-KDE-PluginInfo-Name=flickrop
X-KDE-PluginInfo-Version=0.7.1
X-KDE-PluginInfo-Website=http://www.bramschoenmakers.nl/node/556
X-KDE-PluginInfo-Category=Photos
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-EngineName=flickrop
flickrop-0.7.1/engine/types.h 0000664 0000000 0000000 00000004050 11261733517 0016117 0 ustar 00root root 0000000 0000000 /********************************************************************************
* Copyright (C) 2008-2009 by Bram Schoenmakers *
* *
* 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 . *
********************************************************************************/
#ifndef TYPES_H
#define TYPES_H
struct Author
{
QString nsid;
QString username;
KUrl profileUrl;
KUrl photosUrl;
};
struct Photo
{
QString id;
QString title;
bool authorRetrieved;
bool photoRetrieved;
Author author;
QString filename;
KUrl url;
};
enum PhotoListType
{
INTERESTINGNESS = 0,
FAVORITES,
PHOTOSET,
TAG,
LOCATION
};
enum ErrorType
{
ERR_ANY = 0,
ERR_MESSAGEBOX,
ERR_APPLET
};
// so that we can pass it with Plasma::DataEngine::setData()
Q_DECLARE_METATYPE( Photo );
typedef QList PhotoList;
typedef QMap Params;
#endif // TYPES_H
flickrop-0.7.1/po/ 0000775 0000000 0000000 00000000000 11261733517 0013754 5 ustar 00root root 0000000 0000000 flickrop-0.7.1/po/CMakeLists.txt 0000664 0000000 0000000 00000002004 11261733517 0016510 0 ustar 00root root 0000000 0000000 FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
MESSAGE( "NOTE: msgfmt not found. Translations will not be installed" )
ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
SET(catalogname flickrop)
ADD_CUSTOM_TARGET(translations ALL)
FILE(GLOB PO_FILES ${catalogname}*.po)
FOREACH(_poFile ${PO_FILES})
GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_poFileName} )
STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} )
IF( _langCode )
GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
ADD_CUSTOM_COMMAND(TARGET translations
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}
DEPENDS ${_poFile})
INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo)
ENDIF( _langCode )
ENDFOREACH(_poFile ${PO_FILES})
ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)
flickrop-0.7.1/po/Messages.sh 0000775 0000000 0000000 00000003112 11261733517 0016057 0 ustar 00root root 0000000 0000000 #!/bin/sh
BASEDIR="../" # root of translatable sources
COPYRIGHT="Bram Schoenmakers "
PROJECT_FULL="Flickr On Plasma"
PROJECT="flickrop" # project name
WDIR=`pwd` # working dir
echo "Preparing rc files"
cd ${BASEDIR}
# we use simple sorting to make sure the lines do not jump around too much from system to system
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list
xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
# additional string for KAboutData
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
cd ${WDIR}
echo "Done preparing rc files"
echo "Extracting messages"
cd ${BASEDIR}
# see above on sorting
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list
echo "rc.cpp" >> ${WDIR}/infiles.list
cd ${WDIR}
xgettext --package-name="${PROJECT_FULL}" --copyright-holder="${COPYRIGHT}" --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 --files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; }
echo "Done extracting messages"
echo "Merging translations"
catalogs=`find . -name '*.po'`
for cat in $catalogs; do
echo $cat
msgmerge -o $cat.new $cat ${PROJECT}.pot
mv $cat.new $cat
done
echo "Done merging translations"
echo "Cleaning up"
cd ${WDIR}
rm rcfiles.list
rm infiles.list
rm rc.cpp
echo "Done"
flickrop-0.7.1/po/flickrop.pot 0000664 0000000 0000000 00000024363 11261733517 0016321 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Bram Schoenmakers
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Flickr On Plasma\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-12 16:14+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: applet/clusterdialog.cpp:31
msgid "Select the cluster which you would like to see"
msgstr ""
#: applet/coordinatedialog.cpp:42 applet/marbledialog.cpp:32
msgid "Select a location:"
msgstr ""
#: applet/coordinatedialog.cpp:45
msgid "Longitude:"
msgstr ""
#: applet/coordinatedialog.cpp:53
msgid "Latitude:"
msgstr ""
#: applet/coordinatedialog.cpp:61 applet/marbledialog.cpp:47
msgid "Accuracy:"
msgstr ""
#: applet/flickrop.cpp:91
msgid "Ne&xt Photo"
msgstr ""
#: applet/flickrop.cpp:96
msgid "Mark As &Favorite"
msgstr ""
#: applet/flickrop.cpp:105
msgid "Visit &Author's Profile"
msgstr ""
#: applet/flickrop.cpp:110
msgid "Visit Aut&hor's Photos"
msgstr ""
#: applet/flickrop.cpp:115
msgid "Visit &Photo Page"
msgstr ""
#: applet/flickrop.cpp:187
msgctxt "author"
msgid "By %1"
msgstr ""
#: applet/flickrop.cpp:191
msgctxt "title and author"
msgid "\"%1\" by %2"
msgstr ""
#: applet/flickrop.cpp:467
msgid "General"
msgstr ""
#: applet/flickrop.cpp:471
msgid "Streams"
msgstr ""
#: applet/flickrop.cpp:475
msgid "Authentication"
msgstr ""
#: applet/flickrop.cpp:704
msgid ""
"A browser will open now with the request to authenticate Flickr On Plasma. "
"When you accepted this request, press Continue."
msgstr ""
#: applet/locationdialog.cpp:40
msgid "World scale"
msgstr ""
#: applet/locationdialog.cpp:41
msgid "Country scale"
msgstr ""
#: applet/locationdialog.cpp:42
msgid "Region scale"
msgstr ""
#: applet/locationdialog.cpp:43
msgid "City scale"
msgstr ""
#: applet/locationdialog.cpp:44
msgid "Street scale"
msgstr ""
#: applet/photosetdialog.cpp:59
msgid "Please select a photoset below:"
msgstr ""
#. i18n: file: applet/authenticationsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, AuthenticationWidget)
#. i18n: file: applet/generalsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, GeneralWidget)
#. i18n: file: applet/streamsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, StreamWidget)
#. i18n: file: applet/authenticationsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, AuthenticationWidget)
#. i18n: file: applet/generalsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, GeneralWidget)
#. i18n: file: applet/streamsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, StreamWidget)
#: build/applet/ui_authenticationsettings.h:73
#: build/applet/ui_generalsettings.h:161 build/applet/ui_streamsettings.h:149
#: po/rc.cpp:3 po/rc.cpp:12 po/rc.cpp:66 rc.cpp:3 rc.cpp:12 rc.cpp:66
msgid "Form"
msgstr ""
#. i18n: file: applet/authenticationsettings.ui:26
#. i18n: ectx: property (text), widget (QLabel, label)
#: build/applet/ui_authenticationsettings.h:74 po/rc.cpp:6 rc.cpp:6
msgid ""
"In order to use all functions in Flickr On Plasma, you have to authenticate "
"with Flickr. Press the button below to start the authentication."
msgstr ""
#: build/applet/ui_authenticationsettings.h:75
msgid "Autenticate"
msgstr ""
#. i18n: file: applet/generalsettings.ui:22
#. i18n: ectx: property (text), widget (QLabel, label)
#: build/applet/ui_generalsettings.h:162 po/rc.cpp:15 rc.cpp:15
msgid "New photo every:"
msgstr ""
#. i18n: file: applet/generalsettings.ui:44
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:165 po/rc.cpp:18 rc.cpp:18
msgid "seconds"
msgstr ""
#. i18n: file: applet/generalsettings.ui:49
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:166 po/rc.cpp:21 rc.cpp:21
msgid "minutes"
msgstr ""
#. i18n: file: applet/generalsettings.ui:54
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:167 po/rc.cpp:24 rc.cpp:24
msgid "hours"
msgstr ""
#. i18n: file: applet/generalsettings.ui:59
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:168 po/rc.cpp:27 rc.cpp:27
msgid "days"
msgstr ""
#. i18n: file: applet/generalsettings.ui:69
#. i18n: ectx: property (text), widget (QLabel, label_2)
#: build/applet/ui_generalsettings.h:170 po/rc.cpp:30 rc.cpp:30
msgid "Photo size:"
msgstr ""
#. i18n: file: applet/generalsettings.ui:80
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:173 po/rc.cpp:33 rc.cpp:33
msgid "Tiny"
msgstr ""
#. i18n: file: applet/generalsettings.ui:85
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:174 po/rc.cpp:36 rc.cpp:36
msgid "Thumbnail"
msgstr ""
#. i18n: file: applet/generalsettings.ui:90
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:175 po/rc.cpp:39 rc.cpp:39
msgid "Small"
msgstr ""
#. i18n: file: applet/generalsettings.ui:95
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:176 po/rc.cpp:42 rc.cpp:42
msgid "Medium"
msgstr ""
#. i18n: file: applet/generalsettings.ui:100
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:177 po/rc.cpp:45 rc.cpp:45
msgid "Large"
msgstr ""
#. i18n: file: applet/generalsettings.ui:108
#. i18n: ectx: property (text), widget (QCheckBox, m_show_background_check)
#: build/applet/ui_generalsettings.h:179 po/rc.cpp:48 rc.cpp:48
msgid "Show background"
msgstr ""
#. i18n: file: applet/generalsettings.ui:115
#. i18n: ectx: property (text), widget (QCheckBox, m_round_corner_check)
#: build/applet/ui_generalsettings.h:180 po/rc.cpp:51 rc.cpp:51
msgid "Round corners"
msgstr ""
#. i18n: file: applet/generalsettings.ui:122
#. i18n: ectx: property (text), widget (QCheckBox, m_soft_borders_check)
#: build/applet/ui_generalsettings.h:181 po/rc.cpp:54 rc.cpp:54
msgid "Soft borders"
msgstr ""
#. i18n: file: applet/generalsettings.ui:129
#. i18n: ectx: property (text), widget (QCheckBox, m_show_author_check)
#: build/applet/ui_generalsettings.h:182 po/rc.cpp:57 rc.cpp:57
msgid "Show title and author"
msgstr ""
#. i18n: file: applet/generalsettings.ui:136
#. i18n: ectx: property (text), widget (QLabel, m_font_label)
#: build/applet/ui_generalsettings.h:183 po/rc.cpp:60 rc.cpp:60
msgid "Font:"
msgstr ""
#. i18n: file: applet/generalsettings.ui:149
#. i18n: ectx: property (text), widget (QLabel, m_font_color_label)
#: build/applet/ui_generalsettings.h:184 po/rc.cpp:63 rc.cpp:63
msgid "Color:"
msgstr ""
#. i18n: file: applet/streamsettings.ui:20
#. i18n: ectx: property (title), widget (QGroupBox, groupBox)
#: build/applet/ui_streamsettings.h:150 po/rc.cpp:69 rc.cpp:69
msgid "Which photos to show?"
msgstr ""
#. i18n: file: applet/streamsettings.ui:26
#. i18n: ectx: property (text), widget (QRadioButton, m_interesting_radio)
#: build/applet/ui_streamsettings.h:151 po/rc.cpp:72 rc.cpp:72
msgid "Interesting photos"
msgstr ""
#. i18n: file: applet/streamsettings.ui:33
#. i18n: ectx: property (text), widget (QRadioButton, m_favorite_radio)
#: build/applet/ui_streamsettings.h:152 po/rc.cpp:75 rc.cpp:75
msgid "My favorite photos"
msgstr ""
#. i18n: file: applet/streamsettings.ui:42
#. i18n: ectx: property (text), widget (QRadioButton, m_photoset_radio)
#: build/applet/ui_streamsettings.h:153 po/rc.cpp:78 rc.cpp:78
msgid "Photoset"
msgstr ""
#. i18n: file: applet/streamsettings.ui:52
#. i18n: ectx: property (text), widget (KPushButton, m_get_photoset_button)
#: build/applet/ui_streamsettings.h:154 po/rc.cpp:81 rc.cpp:81
msgid "Get photosets..."
msgstr ""
#. i18n: file: applet/streamsettings.ui:59
#. i18n: ectx: property (text), widget (QRadioButton, m_tag_radio)
#: build/applet/ui_streamsettings.h:155 po/rc.cpp:84 rc.cpp:84
msgid "By tag"
msgstr ""
#. i18n: file: applet/streamsettings.ui:82
#. i18n: ectx: property (text), widget (KPushButton, m_get_cluster_button)
#: build/applet/ui_streamsettings.h:156 po/rc.cpp:87 rc.cpp:87
msgid "Get clusters..."
msgstr ""
#. i18n: file: applet/streamsettings.ui:89
#. i18n: ectx: property (text), widget (QRadioButton, m_location_radio)
#: build/applet/ui_streamsettings.h:157 po/rc.cpp:90 rc.cpp:90
msgid "By location"
msgstr ""
#. i18n: file: applet/streamsettings.ui:109
#. i18n: ectx: property (text), widget (QPushButton, m_get_location_button)
#: build/applet/ui_streamsettings.h:158 po/rc.cpp:93 rc.cpp:93
msgid "Choose location..."
msgstr ""
#: engine/flickr_engine.cpp:88
msgid "An error occured while obtaining data from Flickr."
msgstr ""
#: engine/flickr_engine.cpp:150
msgid "Could not initiate authentication."
msgstr ""
#: engine/flickr_engine.cpp:292
msgid "Flickr returned an invalid response."
msgstr ""
#: engine/flickr_engine.cpp:481
msgid "Could not retrieve the requested photo from Flickr."
msgstr ""
#: engine/flickr_engine.cpp:604
msgid "Could not retrieve clusters for given tag"
msgstr ""
#: engine/flickr_engine.cpp:655
msgid "User not found"
msgstr ""
#: engine/flickr_engine.cpp:683
msgid ""
"No (public) photosets were found for this user. This could occur when the "
"user has uploaded restricted content. Please follow these steps if you want "
"to access restricted content:- Create an account at Flickr if you "
"don't have one already;
- Disable SafeSearch. Go to You"
"em>‣Your Account‣Privacy & Permissions"
"em>‣Edit Search settings‣SafeSearch off"
"li>
- Authenticate Flickr On Plasma in the Authentication section.
"
msgstr ""
#. i18n: file: applet/authenticationsettings.ui:39
#. i18n: ectx: property (text), widget (KPushButton, m_auth_button)
#: po/rc.cpp:9 rc.cpp:9
msgid "Authenticate"
msgstr ""
#: po/rc.cpp:94 rc.cpp:94
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr ""
#: po/rc.cpp:95 rc.cpp:95
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr ""
flickrop-0.7.1/po/flickrop_es.po 0000664 0000000 0000000 00000030037 11261733517 0016617 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Bram Schoenmakers
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Flickr On Plasma\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-12 16:14+0200\n"
"PO-Revision-Date: 2009-09-26 13:22-0300\n"
"Last-Translator: Cristian Daniel Fadón \n"
"Language-Team: Spanish \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: applet/clusterdialog.cpp:31
msgid "Select the cluster which you would like to see"
msgstr "Seleccione el grupo que desea ver"
#: applet/coordinatedialog.cpp:42 applet/marbledialog.cpp:32
msgid "Select a location:"
msgstr "Seleccione una ubicación:"
#: applet/coordinatedialog.cpp:45
msgid "Longitude:"
msgstr "Longitud:"
#: applet/coordinatedialog.cpp:53
msgid "Latitude:"
msgstr "Latitud:"
#: applet/coordinatedialog.cpp:61 applet/marbledialog.cpp:47
msgid "Accuracy:"
msgstr "Precisión:"
#: applet/flickrop.cpp:91
msgid "Ne&xt Photo"
msgstr "Siguiente &foto"
#: applet/flickrop.cpp:96
msgid "Mark As &Favorite"
msgstr "Marcar como &favorita"
#: applet/flickrop.cpp:105
msgid "Visit &Author's Profile"
msgstr "Ir al perfil del &autor"
#: applet/flickrop.cpp:110
msgid "Visit Aut&hor's Photos"
msgstr "Ir a las fotos del &autor"
#: applet/flickrop.cpp:115
msgid "Visit &Photo Page"
msgstr "Ir a la &foto"
#: applet/flickrop.cpp:187
msgctxt "author"
msgid "By %1"
msgstr "Por %1"
#: applet/flickrop.cpp:191
msgctxt "title and author"
msgid "\"%1\" by %2"
msgstr "\"%1\" por %2"
#: applet/flickrop.cpp:467
msgid "General"
msgstr "General"
#: applet/flickrop.cpp:471
msgid "Streams"
msgstr "Opciones"
#: applet/flickrop.cpp:475
msgid "Authentication"
msgstr "Autentificación"
#: applet/flickrop.cpp:704
msgid ""
"A browser will open now with the request to authenticate Flickr On Plasma. "
"When you accepted this request, press Continue."
msgstr ""
"Deberá autentificar a la aplicación mediante el Navegador Web. "
"Cuando lo haya hecho, oprima continuar."
#: applet/locationdialog.cpp:40
msgid "World scale"
msgstr "Mundo entero"
#: applet/locationdialog.cpp:41
msgid "Country scale"
msgstr "Por país"
#: applet/locationdialog.cpp:42
msgid "Region scale"
msgstr "Por región"
#: applet/locationdialog.cpp:43
msgid "City scale"
msgstr "Por ciudad"
#: applet/locationdialog.cpp:44
msgid "Street scale"
msgstr "Por calle"
#: applet/photosetdialog.cpp:59
msgid "Please select a photoset below:"
msgstr "Por favor seleccione un álbum:"
#. i18n: file: applet/authenticationsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, AuthenticationWidget)
#. i18n: file: applet/generalsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, GeneralWidget)
#. i18n: file: applet/streamsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, StreamWidget)
#. i18n: file: applet/authenticationsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, AuthenticationWidget)
#. i18n: file: applet/generalsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, GeneralWidget)
#. i18n: file: applet/streamsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, StreamWidget)
#: build/applet/ui_authenticationsettings.h:73
#: build/applet/ui_generalsettings.h:161 build/applet/ui_streamsettings.h:149
#: po/rc.cpp:3 po/rc.cpp:12 po/rc.cpp:66 rc.cpp:3 rc.cpp:12 rc.cpp:66
msgid "Form"
msgstr "Forma"
#. i18n: file: applet/authenticationsettings.ui:26
#. i18n: ectx: property (text), widget (QLabel, label)
#: build/applet/ui_authenticationsettings.h:74 po/rc.cpp:6 rc.cpp:6
msgid ""
"In order to use all functions in Flickr On Plasma, you have to authenticate "
"with Flickr. Press the button below to start the authentication."
msgstr ""
"Para poder utilizar todas las funcioens de Flickr On Plasma, deberá autentificarla "
"en Flickr. Oprima el siguiente botón para comenzar el proceso."
#: build/applet/ui_authenticationsettings.h:75
msgid "Autenticate"
msgstr "Autentificar"
#. i18n: file: applet/generalsettings.ui:22
#. i18n: ectx: property (text), widget (QLabel, label)
#: build/applet/ui_generalsettings.h:162 po/rc.cpp:15 rc.cpp:15
msgid "New photo every:"
msgstr "Nueva foto cada:"
#. i18n: file: applet/generalsettings.ui:44
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:165 po/rc.cpp:18 rc.cpp:18
msgid "seconds"
msgstr "segundos"
#. i18n: file: applet/generalsettings.ui:49
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:166 po/rc.cpp:21 rc.cpp:21
msgid "minutes"
msgstr "minutos"
#. i18n: file: applet/generalsettings.ui:54
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:167 po/rc.cpp:24 rc.cpp:24
msgid "hours"
msgstr "horas"
#. i18n: file: applet/generalsettings.ui:59
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:168 po/rc.cpp:27 rc.cpp:27
msgid "days"
msgstr "días"
#. i18n: file: applet/generalsettings.ui:69
#. i18n: ectx: property (text), widget (QLabel, label_2)
#: build/applet/ui_generalsettings.h:170 po/rc.cpp:30 rc.cpp:30
msgid "Photo size:"
msgstr "Tamaño de foto:"
#. i18n: file: applet/generalsettings.ui:80
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:173 po/rc.cpp:33 rc.cpp:33
msgid "Tiny"
msgstr "Diminuta"
#. i18n: file: applet/generalsettings.ui:85
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:174 po/rc.cpp:36 rc.cpp:36
msgid "Thumbnail"
msgstr "Vista previa"
#. i18n: file: applet/generalsettings.ui:90
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:175 po/rc.cpp:39 rc.cpp:39
msgid "Small"
msgstr "Pequeña"
#. i18n: file: applet/generalsettings.ui:95
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:176 po/rc.cpp:42 rc.cpp:42
msgid "Medium"
msgstr "Mediana"
#. i18n: file: applet/generalsettings.ui:100
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:177 po/rc.cpp:45 rc.cpp:45
msgid "Large"
msgstr "Grande"
#. i18n: file: applet/generalsettings.ui:108
#. i18n: ectx: property (text), widget (QCheckBox, m_show_background_check)
#: build/applet/ui_generalsettings.h:179 po/rc.cpp:48 rc.cpp:48
msgid "Show background"
msgstr "Mostrar fondo"
#. i18n: file: applet/generalsettings.ui:115
#. i18n: ectx: property (text), widget (QCheckBox, m_round_corner_check)
#: build/applet/ui_generalsettings.h:180 po/rc.cpp:51 rc.cpp:51
msgid "Round corners"
msgstr "Esquinas redondeadas"
#. i18n: file: applet/generalsettings.ui:122
#. i18n: ectx: property (text), widget (QCheckBox, m_soft_borders_check)
#: build/applet/ui_generalsettings.h:181 po/rc.cpp:54 rc.cpp:54
msgid "Soft borders"
msgstr "Bordes suaves"
#. i18n: file: applet/generalsettings.ui:129
#. i18n: ectx: property (text), widget (QCheckBox, m_show_author_check)
#: build/applet/ui_generalsettings.h:182 po/rc.cpp:57 rc.cpp:57
msgid "Show title and author"
msgstr "Mostrar título y autor"
#. i18n: file: applet/generalsettings.ui:136
#. i18n: ectx: property (text), widget (QLabel, m_font_label)
#: build/applet/ui_generalsettings.h:183 po/rc.cpp:60 rc.cpp:60
msgid "Font:"
msgstr "Fuente:"
#. i18n: file: applet/generalsettings.ui:149
#. i18n: ectx: property (text), widget (QLabel, m_font_color_label)
#: build/applet/ui_generalsettings.h:184 po/rc.cpp:63 rc.cpp:63
msgid "Color:"
msgstr "Color:"
#. i18n: file: applet/streamsettings.ui:20
#. i18n: ectx: property (title), widget (QGroupBox, groupBox)
#: build/applet/ui_streamsettings.h:150 po/rc.cpp:69 rc.cpp:69
msgid "Which photos to show?"
msgstr "¿Qué fotos desea mostrar?"
#. i18n: file: applet/streamsettings.ui:26
#. i18n: ectx: property (text), widget (QRadioButton, m_interesting_radio)
#: build/applet/ui_streamsettings.h:151 po/rc.cpp:72 rc.cpp:72
msgid "Interesting photos"
msgstr "Fotos interesantes"
#. i18n: file: applet/streamsettings.ui:33
#. i18n: ectx: property (text), widget (QRadioButton, m_favorite_radio)
#: build/applet/ui_streamsettings.h:152 po/rc.cpp:75 rc.cpp:75
msgid "My favorite photos"
msgstr "Mis fotos favoritas"
#. i18n: file: applet/streamsettings.ui:42
#. i18n: ectx: property (text), widget (QRadioButton, m_photoset_radio)
#: build/applet/ui_streamsettings.h:153 po/rc.cpp:78 rc.cpp:78
msgid "Photoset"
msgstr "Álbum"
#. i18n: file: applet/streamsettings.ui:52
#. i18n: ectx: property (text), widget (KPushButton, m_get_photoset_button)
#: build/applet/ui_streamsettings.h:154 po/rc.cpp:81 rc.cpp:81
msgid "Get photosets..."
msgstr "Obtener álbumes..."
#. i18n: file: applet/streamsettings.ui:59
#. i18n: ectx: property (text), widget (QRadioButton, m_tag_radio)
#: build/applet/ui_streamsettings.h:155 po/rc.cpp:84 rc.cpp:84
msgid "By tag"
msgstr "Por palabra clave"
#. i18n: file: applet/streamsettings.ui:82
#. i18n: ectx: property (text), widget (KPushButton, m_get_cluster_button)
#: build/applet/ui_streamsettings.h:156 po/rc.cpp:87 rc.cpp:87
msgid "Get clusters..."
msgstr "Obtener grupo..."
#. i18n: file: applet/streamsettings.ui:89
#. i18n: ectx: property (text), widget (QRadioButton, m_location_radio)
#: build/applet/ui_streamsettings.h:157 po/rc.cpp:90 rc.cpp:90
msgid "By location"
msgstr "Por ubicación"
#. i18n: file: applet/streamsettings.ui:109
#. i18n: ectx: property (text), widget (QPushButton, m_get_location_button)
#: build/applet/ui_streamsettings.h:158 po/rc.cpp:93 rc.cpp:93
msgid "Choose location..."
msgstr "Seleccionar ubicación..."
#: engine/flickr_engine.cpp:88
msgid "An error occured while obtaining data from Flickr."
msgstr "Ha ocurrido un error cuando se obtenían datos de Flickr."
#: engine/flickr_engine.cpp:150
msgid "Could not initiate authentication."
msgstr "No ha podido autentificarse."
#: engine/flickr_engine.cpp:292
msgid "Flickr returned an invalid response."
msgstr "Flickr devolvió una dato inválido."
#: engine/flickr_engine.cpp:481
msgid "Could not retrieve the requested photo from Flickr."
msgstr "No pudo obtenerse la foto requerida desde Flickr."
#: engine/flickr_engine.cpp:604
msgid "Could not retrieve clusters for given tag"
msgstr "No se encontraron grupos para esa palabra clave"
#: engine/flickr_engine.cpp:655
msgid "User not found"
msgstr "Usuario no encontrado"
#: engine/flickr_engine.cpp:683
msgid ""
"No (public) photosets were found for this user. This could occur when the "
"user has uploaded restricted content. Please follow these steps if you want "
"to access restricted content:- Create an account at Flickr if you "
"don't have one already;
- Disable SafeSearch. Go to You"
"em>‣Your Account‣Privacy & Permissions"
"em>‣Edit Search settings‣SafeSearch off"
"li>
- Authenticate Flickr On Plasma in the Authentication section.
"
msgstr ""
"No se han encontrado álbumes públicos para este usuario. Esto puede pasar "
"cuando el usuario ha subido contenido restringido. Por favor, siga estos pasos si quiere "
"acceder al contenido restringido:- Crear una cuenta en Flickr si no tiene una;"
"
- Desactivar SafeSearch. Valla a Tú‣Tu cuenta‣"
"Privacidad y Permisos‣Editar Configuración de la"
" búsqueda‣SafeSearch desactivada
- Autentifique "
"Flickr On Plasma en la sección de autentificacón.
"
#. i18n: file: applet/authenticationsettings.ui:39
#. i18n: ectx: property (text), widget (KPushButton, m_auth_button)
#: po/rc.cpp:9 rc.cpp:9
msgid "Authenticate"
msgstr "Autentificar"
#: po/rc.cpp:94 rc.cpp:94
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Cristian Daniel Fadón"
#: po/rc.cpp:95 rc.cpp:95
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "admin@abciencia.com.ar"
flickrop-0.7.1/po/flickrop_nl.po 0000664 0000000 0000000 00000030211 11261733517 0016613 0 ustar 00root root 0000000 0000000 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Bram Schoenmakers , 2009.
msgid ""
msgstr ""
"Project-Id-Version: flickrop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-12 16:14+0200\n"
"PO-Revision-Date: 2009-07-12 16:15+0200\n"
"Last-Translator: Bram Schoenmakers \n"
"Language-Team: Dutch \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 0.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: applet/clusterdialog.cpp:31
msgid "Select the cluster which you would like to see"
msgstr "Selecteer de cluster die u wilt zien"
#: applet/coordinatedialog.cpp:42 applet/marbledialog.cpp:32
msgid "Select a location:"
msgstr "Selecteer een locatie:"
#: applet/coordinatedialog.cpp:45
msgid "Longitude:"
msgstr "Lengtegraad:"
#: applet/coordinatedialog.cpp:53
msgid "Latitude:"
msgstr "Breedtegraad:"
#: applet/coordinatedialog.cpp:61 applet/marbledialog.cpp:47
msgid "Accuracy:"
msgstr "Nauwkeurigheid:"
#: applet/flickrop.cpp:91
msgid "Ne&xt Photo"
msgstr "Volgende &foto"
#: applet/flickrop.cpp:96
msgid "Mark As &Favorite"
msgstr "Als &favoriet markeren"
#: applet/flickrop.cpp:105
msgid "Visit &Author's Profile"
msgstr "Profiel van auteur bezoeken"
#: applet/flickrop.cpp:110
msgid "Visit Aut&hor's Photos"
msgstr "Foto's van de auteur bezoeken"
#: applet/flickrop.cpp:115
msgid "Visit &Photo Page"
msgstr "Fotopagina bezoeken"
#: applet/flickrop.cpp:187
msgctxt "author"
msgid "By %1"
msgstr "Door %1"
#: applet/flickrop.cpp:191
msgctxt "title and author"
msgid "\"%1\" by %2"
msgstr "\"%1\" door %2"
#: applet/flickrop.cpp:467
msgid "General"
msgstr "Algemeen"
#: applet/flickrop.cpp:471
msgid "Streams"
msgstr "Kanalen"
#: applet/flickrop.cpp:475
msgid "Authentication"
msgstr "Authenticatie"
#: applet/flickrop.cpp:704
msgid ""
"A browser will open now with the request to authenticate Flickr On Plasma. "
"When you accepted this request, press Continue."
msgstr ""
"Er opent nu een browser met daarin het verzoek te authenticeren met Flickr "
"On Plasma. Wanneer u dit verzoek hebt geaccepteerd drukt u op Doorgaan."
#: applet/locationdialog.cpp:40
msgid "World scale"
msgstr "Wereldschaal"
#: applet/locationdialog.cpp:41
msgid "Country scale"
msgstr "Landschaal"
#: applet/locationdialog.cpp:42
msgid "Region scale"
msgstr "Regioschaal"
#: applet/locationdialog.cpp:43
msgid "City scale"
msgstr "Stadsschaal"
#: applet/locationdialog.cpp:44
msgid "Street scale"
msgstr "Straatschaal"
#: applet/photosetdialog.cpp:59
msgid "Please select a photoset below:"
msgstr "Selecteer hieronder een fotoset:"
#. i18n: file: applet/authenticationsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, AuthenticationWidget)
#. i18n: file: applet/generalsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, GeneralWidget)
#. i18n: file: applet/streamsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, StreamWidget)
#. i18n: file: applet/authenticationsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, AuthenticationWidget)
#. i18n: file: applet/generalsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, GeneralWidget)
#. i18n: file: applet/streamsettings.ui:14
#. i18n: ectx: property (windowTitle), widget (QWidget, StreamWidget)
#: build/applet/ui_authenticationsettings.h:73
#: build/applet/ui_generalsettings.h:161 build/applet/ui_streamsettings.h:149
#: po/rc.cpp:3 po/rc.cpp:12 po/rc.cpp:66 rc.cpp:3 rc.cpp:12 rc.cpp:66
msgid "Form"
msgstr "Formulier"
#. i18n: file: applet/authenticationsettings.ui:26
#. i18n: ectx: property (text), widget (QLabel, label)
#: build/applet/ui_authenticationsettings.h:74 po/rc.cpp:6 rc.cpp:6
msgid ""
"In order to use all functions in Flickr On Plasma, you have to authenticate "
"with Flickr. Press the button below to start the authentication."
msgstr ""
"Om alle functies van Flickr On Plasma te gebruiken, dient u te authenticeren "
"met Flickr. Druk op de onderstaande knop om de authenticatie te starten."
#: build/applet/ui_authenticationsettings.h:75
msgid "Autenticate"
msgstr "Authenticeren"
#. i18n: file: applet/generalsettings.ui:22
#. i18n: ectx: property (text), widget (QLabel, label)
#: build/applet/ui_generalsettings.h:162 po/rc.cpp:15 rc.cpp:15
msgid "New photo every:"
msgstr "Nieuwe foto iedere:"
#. i18n: file: applet/generalsettings.ui:44
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:165 po/rc.cpp:18 rc.cpp:18
msgid "seconds"
msgstr "seconden"
#. i18n: file: applet/generalsettings.ui:49
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:166 po/rc.cpp:21 rc.cpp:21
msgid "minutes"
msgstr "minuten"
#. i18n: file: applet/generalsettings.ui:54
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:167 po/rc.cpp:24 rc.cpp:24
msgid "hours"
msgstr "uren"
#. i18n: file: applet/generalsettings.ui:59
#. i18n: ectx: property (text), item, widget (KComboBox, m_interval_combo)
#: build/applet/ui_generalsettings.h:168 po/rc.cpp:27 rc.cpp:27
msgid "days"
msgstr "dagen"
#. i18n: file: applet/generalsettings.ui:69
#. i18n: ectx: property (text), widget (QLabel, label_2)
#: build/applet/ui_generalsettings.h:170 po/rc.cpp:30 rc.cpp:30
msgid "Photo size:"
msgstr "Fotogrootte:"
#. i18n: file: applet/generalsettings.ui:80
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:173 po/rc.cpp:33 rc.cpp:33
msgid "Tiny"
msgstr "Zeer klein"
#. i18n: file: applet/generalsettings.ui:85
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:174 po/rc.cpp:36 rc.cpp:36
msgid "Thumbnail"
msgstr "Kleiner"
#. i18n: file: applet/generalsettings.ui:90
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:175 po/rc.cpp:39 rc.cpp:39
msgid "Small"
msgstr "Klein"
#. i18n: file: applet/generalsettings.ui:95
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:176 po/rc.cpp:42 rc.cpp:42
msgid "Medium"
msgstr "Gemiddeld"
#. i18n: file: applet/generalsettings.ui:100
#. i18n: ectx: property (text), item, widget (KComboBox, m_size_combo)
#: build/applet/ui_generalsettings.h:177 po/rc.cpp:45 rc.cpp:45
msgid "Large"
msgstr "Groot"
#. i18n: file: applet/generalsettings.ui:108
#. i18n: ectx: property (text), widget (QCheckBox, m_show_background_check)
#: build/applet/ui_generalsettings.h:179 po/rc.cpp:48 rc.cpp:48
msgid "Show background"
msgstr "Achtergrond tonen"
#. i18n: file: applet/generalsettings.ui:115
#. i18n: ectx: property (text), widget (QCheckBox, m_round_corner_check)
#: build/applet/ui_generalsettings.h:180 po/rc.cpp:51 rc.cpp:51
msgid "Round corners"
msgstr "Ronde hoeken"
#. i18n: file: applet/generalsettings.ui:122
#. i18n: ectx: property (text), widget (QCheckBox, m_soft_borders_check)
#: build/applet/ui_generalsettings.h:181 po/rc.cpp:54 rc.cpp:54
msgid "Soft borders"
msgstr "Zachte randen"
#. i18n: file: applet/generalsettings.ui:129
#. i18n: ectx: property (text), widget (QCheckBox, m_show_author_check)
#: build/applet/ui_generalsettings.h:182 po/rc.cpp:57 rc.cpp:57
msgid "Show title and author"
msgstr "Titel en auteur tonen"
#. i18n: file: applet/generalsettings.ui:136
#. i18n: ectx: property (text), widget (QLabel, m_font_label)
#: build/applet/ui_generalsettings.h:183 po/rc.cpp:60 rc.cpp:60
msgid "Font:"
msgstr "Lettertype:"
#. i18n: file: applet/generalsettings.ui:149
#. i18n: ectx: property (text), widget (QLabel, m_font_color_label)
#: build/applet/ui_generalsettings.h:184 po/rc.cpp:63 rc.cpp:63
msgid "Color:"
msgstr "Kleur:"
#. i18n: file: applet/streamsettings.ui:20
#. i18n: ectx: property (title), widget (QGroupBox, groupBox)
#: build/applet/ui_streamsettings.h:150 po/rc.cpp:69 rc.cpp:69
msgid "Which photos to show?"
msgstr "Welke foto's te tonen?"
#. i18n: file: applet/streamsettings.ui:26
#. i18n: ectx: property (text), widget (QRadioButton, m_interesting_radio)
#: build/applet/ui_streamsettings.h:151 po/rc.cpp:72 rc.cpp:72
msgid "Interesting photos"
msgstr "Interessante foto's"
#. i18n: file: applet/streamsettings.ui:33
#. i18n: ectx: property (text), widget (QRadioButton, m_favorite_radio)
#: build/applet/ui_streamsettings.h:152 po/rc.cpp:75 rc.cpp:75
msgid "My favorite photos"
msgstr "Mijn favoriete foto's"
#. i18n: file: applet/streamsettings.ui:42
#. i18n: ectx: property (text), widget (QRadioButton, m_photoset_radio)
#: build/applet/ui_streamsettings.h:153 po/rc.cpp:78 rc.cpp:78
msgid "Photoset"
msgstr "Fotoset"
#. i18n: file: applet/streamsettings.ui:52
#. i18n: ectx: property (text), widget (KPushButton, m_get_photoset_button)
#: build/applet/ui_streamsettings.h:154 po/rc.cpp:81 rc.cpp:81
msgid "Get photosets..."
msgstr "Fotosets ophalen..."
#. i18n: file: applet/streamsettings.ui:59
#. i18n: ectx: property (text), widget (QRadioButton, m_tag_radio)
#: build/applet/ui_streamsettings.h:155 po/rc.cpp:84 rc.cpp:84
msgid "By tag"
msgstr "Tag"
#. i18n: file: applet/streamsettings.ui:82
#. i18n: ectx: property (text), widget (KPushButton, m_get_cluster_button)
#: build/applet/ui_streamsettings.h:156 po/rc.cpp:87 rc.cpp:87
msgid "Get clusters..."
msgstr "Clusters opvragen..."
#. i18n: file: applet/streamsettings.ui:89
#. i18n: ectx: property (text), widget (QRadioButton, m_location_radio)
#: build/applet/ui_streamsettings.h:157 po/rc.cpp:90 rc.cpp:90
msgid "By location"
msgstr "Op locatie"
#. i18n: file: applet/streamsettings.ui:109
#. i18n: ectx: property (text), widget (QPushButton, m_get_location_button)
#: build/applet/ui_streamsettings.h:158 po/rc.cpp:93 rc.cpp:93
msgid "Choose location..."
msgstr "Locatie kiezen..."
#: engine/flickr_engine.cpp:88
msgid "An error occured while obtaining data from Flickr."
msgstr "Er deed zich een fout voor bij het ophalen van gegevens van Flickr."
#: engine/flickr_engine.cpp:150
msgid "Could not initiate authentication."
msgstr "Kon de authenticatie niet starten."
#: engine/flickr_engine.cpp:292
msgid "Flickr returned an invalid response."
msgstr "Flickr gaf een ongeldig antwoord terug."
#: engine/flickr_engine.cpp:481
msgid "Could not retrieve the requested photo from Flickr."
msgstr "Kon de verzochte foto niet van Flickr ophalen."
#: engine/flickr_engine.cpp:604
msgid "Could not retrieve clusters for given tag"
msgstr "Kon geen clusters ophalen voor de opgegeven tag."
#: engine/flickr_engine.cpp:655
msgid "User not found"
msgstr "Gebruiker niet gevonden"
#: engine/flickr_engine.cpp:683
msgid ""
"No (public) photosets were found for this user. This could occur when the "
"user has uploaded restricted content. Please follow these steps if you want "
"to access restricted content:- Create an account at Flickr if you "
"don't have one already;
- Disable SafeSearch. Go to You"
"em>‣Your Account‣Privacy & Permissions"
"em>‣Edit Search settings‣SafeSearch off"
"li>
- Authenticate Flickr On Plasma in the Authentication section.
"
msgstr ""
"Er zijn geen (publieke) fotosets gevonden voor deze gebruiker. Dit kan "
"voorkomen wanneer de gebruiker foto's heeft geüpload met restrictieve "
"toegangsrechten. Volg de volgende stappen om deze foto's te benaderen: "
"- Maak een account aan bij Flickr als u dat nog niet hebt gedaan."
"li>
- Schakel SafeSearch uit. Ga naar You‣Your Account"
"em>‣Privacy & Permissions‣Edit Search "
"settings‣SafeSearch off
- Authenticeer Flickr On "
"Plasma in de sectie Authenticatie.
"
#. i18n: file: applet/authenticationsettings.ui:39
#. i18n: ectx: property (text), widget (KPushButton, m_auth_button)
#: po/rc.cpp:9 rc.cpp:9
msgid "Authenticate"
msgstr "Authenticeren"
#: po/rc.cpp:94 rc.cpp:94
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Bram Schoenmakers"
#: po/rc.cpp:95 rc.cpp:95
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "bramschoenmakers@kde.nl"