commited initial version of Dolphin

svn path=/trunk/playground/utils/dolphin/; revision=606622
This commit is contained in:
Peter Penz 2006-11-21 06:02:05 +00:00
commit 5252c12db4
138 changed files with 18813 additions and 0 deletions

5
AUTHORS Normal file
View file

@ -0,0 +1,5 @@
Peter Penz <peter.penz@gmx.at>
Aaron J. Seigo <aseigo@kde.org>
Cvetoslav Ludmiloff <ludmiloff@gmail.com>
Stefan Monov <logixoul@gmail.com>

20
CMakeLists.txt Normal file
View file

@ -0,0 +1,20 @@
project(dolphin)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
# search packages used by KDE
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
include (MacroLibrary)
add_definitions (-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1)
link_directories (${KDE4_LIB_DIR})
include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
include (ConfigureChecks.cmake)
configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
add_subdirectory(src)
macro_display_feature_log()

346
COPYING Normal file
View file

@ -0,0 +1,346 @@
NOTE! The GPL below is copyrighted by the Free Software Foundation, but
the instance of code that it refers to (the kde programs) are copyrighted
by the authors who actually wrote it.
---------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
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
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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 Library General
Public License instead of this License.

397
COPYING-DOCS Normal file
View file

@ -0,0 +1,397 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation 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. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

47
ConfigureChecks.cmake Normal file
View file

@ -0,0 +1,47 @@
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckPrototypeExists)
include(CheckTypeSize)
include(MacroBoolTo01)
# The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
# definitions like _GNU_SOURCE that are needed on each platform.
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
macro_bool_to_01(KDE4_XMMS HAVE_XMMS)
#now check for dlfcn.h using the cmake supplied CHECK_include_FILE() macro
# If definitions like -D_GNU_SOURCE are needed for these checks they
# should be added to _KDE4_PLATFORM_DEFINITIONS when it is originally
# defined outside this file. Here we include these definitions in
# CMAKE_REQUIRED_DEFINITIONS so they will be included in the build of
# checks below.
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
if (WIN32)
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES} )
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES} )
endif (WIN32)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(ieeefp.h HAVE_IEEEFP_H)
check_include_files(mntent.h HAVE_MNTENT_H)
check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H)
check_include_files(sys/mnttab.h HAVE_SYS_MNTTAB_H)
check_include_files("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
check_include_files(sys/statfs.h HAVE_SYS_STATFS_H)
check_include_files(sys/statvfs.h HAVE_SYS_STATVFS_H)
check_include_files(sys/ucred.h HAVE_SYS_UCRED_H)
check_include_files(sys/vfs.h HAVE_SYS_VFS_H)
check_function_exists(isinf HAVE_FUNC_ISINF)
check_type_size("int" SIZEOF_INT)
check_type_size("char *" SIZEOF_CHAR_P)
check_type_size("long" SIZEOF_LONG)
check_type_size("short" SIZEOF_SHORT)
check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)

176
INSTALL Normal file
View file

@ -0,0 +1,176 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/kde/bin', `/usr/local/kde/lib', etc. You can specify an
installation prefix other than `/usr/local/kde' by giving `configure'
the option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

2
README Normal file
View file

@ -0,0 +1,2 @@
This version represents the KDE 4 port for Dolphin (see also http://enzosworld.gmxhome.de for details). It's a playground for testing some usability ideas for a file manager.

153
config.h.cmake Normal file
View file

@ -0,0 +1,153 @@
/* config.h. Generated by cmake from config.h.cmake */
/* If we have Apple PowerBook support */
/* #undef HAVE_POWERBOOK */
/* Name of package */
#define PACKAGE "kdeutils"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* The size of a `char *', as computed by sizeof. */
#define SIZEOF_CHAR_P ${SIZEOF_CHAR_P}
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT ${SIZEOF_INT}
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG ${SIZEOF_LONG}
/* The size of a `short', as computed by sizeof. */
#define SIZEOF_SHORT ${SIZEOF_SHORT}
/* The size of a `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T ${SIZEOF_SIZE_T}
/* The size of a `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG ${SIZEOF_UNSIGNED_LONG}
/* Version number of package */
#define VERSION "3.9.02"
/* Defined if compiling without arts */
#define WITHOUT_ARTS 1
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/*
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
* headers and I'm too lazy to write a configure test as long as only
* unixware is related
*/
#ifdef _UNIXWARE
#define HAVE_BOOLEAN
#endif
/*
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
* that defines bzero.
*/
#if defined(_AIX)
#include <strings.h>
#endif
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
# include <sys/time.h>
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
#endif
#if !defined(HAVE_RES_INIT_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
int res_init(void);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_SETENV_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
int setenv (const char *, const char *, int);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_STATFS_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
int statfs(const char *path, struct statfs *buffer)
;
#ifdef __cplusplus
}
#endif
#endif
/*
* On HP-UX, the declaration of vsnprintf() is needed every time !
*/
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
#if __STDC__
#include <stdarg.h>
#include <stdlib.h>
#else
#include <varargs.h>
#endif
#ifdef __cplusplus
extern "C"
#endif
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
#ifdef __cplusplus
extern "C"
#endif
int snprintf(char *str, size_t n, char const *fmt, ...);
#endif
#if defined(__SVR4) && !defined(__svr4__)
#define __svr4__ 1
#endif
/* type to use in place of socklen_t if not defined */
#define kde_socklen_t socklen_t
/* type to use in place of socklen_t if not defined (deprecated, use
kde_socklen_t) */
#define ksize_t socklen_t

140
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,140 @@
add_subdirectory( pics )
add_subdirectory( servicemenus )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(dolphin_SRCS
main.cpp
dolphin.cpp
dolphinview.cpp
urlnavigator.cpp
urlnavigatorbutton.cpp
viewpropertiesdialog.cpp
dolphinstatusbar.cpp
dolphindirlister.cpp
viewproperties.cpp
dolphindetailsview.cpp
dolphiniconsview.cpp
dolphinsettings.cpp
bookmarkselector.cpp
urlbutton.cpp
itemeffectsmanager.cpp
dolphincontextmenu.cpp
undomanager.cpp
progressindicator.cpp
iconsviewsettingspage.cpp
pixmapviewer.cpp
dolphinsettingsdialog.cpp
viewsettingspage.cpp
detailsviewsettingspage.cpp
statusbarmessagelabel.cpp
generalsettingspage.cpp
bookmarkssettingspage.cpp
editbookmarkdialog.cpp
settingspagebase.cpp
sidebar.cpp
sidebarpage.cpp
bookmarkssidebarpage.cpp
infosidebarpage.cpp
statusbarspaceinfo.cpp
renamedialog.cpp
filterbar.cpp
protocolcombo.cpp )
kde4_automoc(${dolphin_SRCS})
kde4_add_kcfg_files(dolphin_SRCS
directoryviewpropertysettings.kcfgc
generalsettings.kcfgc
iconsmodesettings.kcfgc
detailsmodesettings.kcfgc
previewsmodesettings.kcfgc
sidebarsettings.kcfgc )
kde4_add_executable(dolphin ${dolphin_SRCS})
target_link_libraries(dolphin ${KDE4_KDECORE_LIBS} ${KDE4_KDEPRINT_LIBS} )
install(TARGETS dolphin DESTINATION ${BIN_INSTALL_DIR})
########### install files ###############
install( FILES dolphin.desktop DESTINATION ${XDG_APPS_DIR} )
install( FILES directoryviewpropertysettings.kcfg generalsettings.kcfg iconsmodesettings.kcfg detailsmodesettings.kcfg previewsmodesettings.kcfg sidebarsettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES dolphinui.rc DESTINATION ${DATA_INSTALL_DIR}/dolphin )
install( FILES DESTINATION ${APPLNK_INSTALL_DIR}/System )
kde4_install_icons( ${ICON_INSTALL_DIR} )
#original Makefile.am contents follow:
### Makefile.am for dolphin
#
#SUBDIRS = pics servicemenus
#
## this is the program that gets installed. it's name is used for all
## of the other Makefile.am variables
#bin_PROGRAMS = dolphin
#
## set the include path for X, qt and KDE
#INCLUDES = $(all_includes)
#
## the library search path.
#dolphin_LDFLAGS = $(KDE_RPATH) $(all_libraries)
#
## the libraries to link against.
#dolphin_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT)
#
## which sources should be compiled for dolphin
#dolphin_SOURCES = main.cpp dolphin.cpp dolphinview.cpp urlnavigator.cpp directoryviewpropertysettings.kcfgc \
# urlnavigatorbutton.cpp viewpropertiesdialog.cpp dolphinstatusbar.cpp dolphindirlister.cpp \
# viewproperties.cpp dolphindetailsview.cpp dolphiniconsview.cpp dolphinsettings.cpp \
# bookmarkselector.cpp urlbutton.cpp itemeffectsmanager.cpp \
# dolphincontextmenu.cpp undomanager.cpp progressindicator.cpp \
# iconsviewsettingspage.cpp pixmapviewer.cpp dolphinsettingsdialog.cpp \
# viewsettingspage.cpp detailsviewsettingspage.cpp statusbarmessagelabel.cpp \
# generalsettingspage.cpp bookmarkssettingspage.cpp \
# editbookmarkdialog.cpp settingspagebase.cpp sidebar.cpp sidebarpage.cpp \
# bookmarkssidebarpage.cpp infosidebarpage.cpp statusbarspaceinfo.cpp renamedialog.cpp \
# filterbar.cpp protocolcombo.cpp generalsettings.kcfgc iconsmodesettings.kcfgc \
# detailsmodesettings.kcfgc previewsmodesettings.kcfgc sidebarsettings.kcfgc
#
## these are the headers for your project
#noinst_HEADERS = dolphin.h dolphinview.h urlnavigator.h urlnavigatorbutton.h \
# viewpropertiesdialog.h dolphinstatusbar.h dolphindirlister.h viewproperties.h \
# dolphindetailsview.h dolphiniconsview.h dolphinsettings.h bookmarkselector.h \
# urlbutton.h itemeffectsmanager.h dolphincontextmenu.h undomanager.h \
# iconsviewsettingspage.h pixmapviewer.h \
# dolphinsettingsdialog.h detailsviewsettingspage.h viewsettingspage.h statusbarmessagelabel.h \
# generalsettingspage.h bookmarkssettingspage.h editbookmarkdialog.h \
# settingspagebase.h statusbarspaceinfo.h renamedialog.h sidebar.h sidebarsettings.h sidebarpage.h \
# bookmarkssidebarpage.h infosidebarpage.h protocolcombo.h
# infosidebarpage.h filterbar.h protocolcombo.h
#
## let automoc handle all of the meta source files (moc)
#METASOURCES = AUTO
#
#messages: rc.cpp
# $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
# $(XGETTEXT) *.cpp -o $(podir)/dolphin.pot
#
## this is where the kdelnk file will go
#kdelnkdir = $(kde_appsdir)/System
#xdg_apps_DATA = dolphin.desktop
#
## this is where the XML-GUI resource file goes
#rcdir = $(kde_datadir)/dolphin
#rc_DATA = dolphinui.rc
#
#kde_kcfg_DATA = directoryviewpropertysettings.kcfg generalsettings.kcfg \
# iconsmodesettings.kcfg detailsmodesettings.kcfg previewsmodesettings.kcfg \
# sidebarsettings.kcfg
#
#KDE_ICON = AUTO

81
src/README Normal file
View file

@ -0,0 +1,81 @@
-----------------------------------------------
Kde application framework template quickstart
Author: Thomas Nagy
Date: 2004-03-22
-----------------------------------------------
This README file explains you basic things for starting with
this application template.
** Building and installing **
* Build the configure script by "make -f Makefile.cvs"
* To clean, use "make clean", and to clean everything
(remove the makefiles, etc), use "make distclean"
* To distribute your program, try "make dist".
This will make a compact tarball archive of your release with the
necessary scripts inside.
* Modifying the auto-tools scripts
for automake scripts there is an excellent tutorial there :
http://developer.kde.org/documentation/other/makefile_am_howto.html
* Simplify your life : install the project in your home directory for
testing purposes.
./configure --prefix=/home/user/dummyfolder/
In the end when you finished the development you can
rm -rf /home/user/dummyfolder/
without fear.
** Technologies **
* Build the menus of your application easily
kde applications now use an xml file (*ui.rc file) to build the menus.
This allow a great customization of the application. However, when
programming the menu is shown only after a "make install"
For more details, consult :
http://devel-home.kde.org/~larrosa/tutorial/p9.html
http://developer.kde.org/documentation/tutorials/xmlui/preface.html
* Use KConfig XT to create your configuration dialogs and make
them more maintainable.
For more details, consult :
http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
* With KParts, you can embed other kde components in your program, or make your program
embeddable in other apps. For example, the kmplayer kpart can be called to play videos
in your app.
For more details, consult :
http://www-106.ibm.com/developerworks/library/l-kparts/
http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
* With dcop, you can control your app from other applications
Make sure to include K_DCOP and a kdcop: section in your .h file
http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
** Documentation **
* For the translations :
1. Download a patched gettext which can be found at:
http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
2. Install that gettext in ~/bin/
3. cd ~/yourproject, export PATH=~/bin:$PATH, export
KDEDIR=/where_your_KDE3_is
4. make -f admin/Makefile.common package-messages
5. make package-messages
6. Translate the po files (not the pot!!) with kbabel or xemacs
* Do not forget to write the documentation for your kde app
edit the documentation template index.docbook in doc/

171
src/bookmarkselector.cpp Normal file
View file

@ -0,0 +1,171 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <assert.h>
#include <q3popupmenu.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <kiconloader.h>
#include <kglobalsettings.h>
#include <kbookmarkmanager.h>
#include "bookmarkselector.h"
#include "dolphinsettings.h"
#include "dolphinview.h"
#include "dolphin.h"
#include "urlnavigator.h"
BookmarkSelector::BookmarkSelector(URLNavigator* parent) :
URLButton(parent),
m_selectedIndex(0)
{
setFocusPolicy(QWidget::NoFocus);
m_bookmarksMenu = new Q3PopupMenu(this);
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
int i = 0;
while (!bookmark.isNull()) {
m_bookmarksMenu->insertItem(MainBarIcon(bookmark.icon()),
bookmark.text(),
i);
if (i == m_selectedIndex) {
QPixmap pixmap = SmallIcon(bookmark.icon());
setPixmap(pixmap);
setMinimumWidth(pixmap.width() + 2);
}
bookmark = root.next(bookmark);
++i;
}
connect(m_bookmarksMenu, SIGNAL(activated(int)),
this, SLOT(slotBookmarkActivated(int)));
setPopup(m_bookmarksMenu);
}
BookmarkSelector::~BookmarkSelector()
{
}
void BookmarkSelector::updateSelection(const KUrl& url)
{
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
int maxLength = 0;
m_selectedIndex = -1;
// Search the bookmark which is equal to the URL or at least is a parent URL.
// If there are more than one possible parent URL candidates, choose the bookmark
// which covers the bigger range of the URL.
int i = 0;
while (!bookmark.isNull()) {
const KUrl bookmarkURL = bookmark.url();
if (bookmarkURL.isParentOf(url)) {
const int length = bookmarkURL.prettyURL().length();
if (length > maxLength) {
m_selectedIndex = i;
setPixmap(SmallIcon(bookmark.icon()));
maxLength = length;
}
}
bookmark = root.next(bookmark);
++i;
}
if (m_selectedIndex < 0) {
// No bookmark has been found which matches to the given URL. Show
// a generic folder icon as pixmap for indication:
setPixmap(SmallIcon("folder"));
}
}
KBookmark BookmarkSelector::selectedBookmark() const
{
return DolphinSettings::instance().bookmark(m_selectedIndex);
}
void BookmarkSelector::drawButton(QPainter* painter)
{
const int buttonWidth = width();
const int buttonHeight = height();
QColor backgroundColor;
QColor foregroundColor;
const bool isHighlighted = isDisplayHintEnabled(EnteredHint) ||
isDisplayHintEnabled(DraggedHint);
if (isHighlighted) {
backgroundColor = KGlobalSettings::highlightColor();
foregroundColor = KGlobalSettings::highlightedTextColor();
}
else {
backgroundColor = colorGroup().background();
foregroundColor = KGlobalSettings::buttonTextColor();
}
// dimm the colors if the parent view does not have the focus
const DolphinView* parentView = urlNavigator()->dolphinView();
const Dolphin& dolphin = Dolphin::mainWin();
const bool isActive = (dolphin.activeView() == parentView);
if (!isActive) {
QColor dimmColor(colorGroup().background());
foregroundColor = mixColors(foregroundColor, dimmColor);
if (isHighlighted) {
backgroundColor = mixColors(backgroundColor, dimmColor);
}
}
if (!(isDisplayHintEnabled(ActivatedHint) && isActive) && !isHighlighted) {
// dimm the foreground color by mixing it with the background
foregroundColor = mixColors(foregroundColor, backgroundColor);
painter->setPen(foregroundColor);
}
// draw button backround
painter->setPen(NoPen);
painter->setBrush(backgroundColor);
painter->drawRect(0, 0, buttonWidth, buttonHeight);
// draw icon
const QPixmap* icon = pixmap();
if (icon != 0) {
const int x = (buttonWidth - icon->width()) / 2;
const int y = (buttonHeight - icon->height()) / 2;
painter->drawPixmap(x, y, *icon);
}
}
void BookmarkSelector::slotBookmarkActivated(int index)
{
m_selectedIndex = index;
KBookmark bookmark = selectedBookmark();
setPixmap(SmallIcon(bookmark.icon()));
emit bookmarkActivated(index);
}
#include "bookmarkselector.moc"

100
src/bookmarkselector.h Normal file
View file

@ -0,0 +1,100 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef BOOKMARKSELECTOR_H
#define BOOKMARKSELECTOR_H
#include <kbookmark.h>
#include <urlbutton.h>
//Added by qt3to4:
#include <Q3PopupMenu>
class URLNavigator;
class Q3PopupMenu;
class KUrl;
/**
* @brief Allows to select a bookmark from a popup menu.
*
* The icon from the current selected bookmark is shown
* inside the bookmark selector.
*
* @see URLNavigator
* @author Peter Penz <peter.penz@gmx.at>
*/
class BookmarkSelector : public URLButton
{
Q_OBJECT
public:
/**
* @param parent Parent widget where the bookmark selector
* is embedded into.
*/
BookmarkSelector(URLNavigator* parent);
virtual ~BookmarkSelector();
/**
* Updates the selection dependent from the given URL \a url. The
* URL must not match exactly to one of the available bookmarks:
* The bookmark which is equal to the URL or at least is a parent URL
* is selected. If there are more than one possible parent URL candidates,
* the bookmark which covers the bigger range of the URL is selected.
*/
void updateSelection(const KUrl& url);
/**
* Returns the index of the selected bookmark. To get
* the bookmark, use BookmarkSelector::selectedBookmark().
*/
int selectedIndex() const { return m_selectedIndex; }
/** Returns the selected bookmark. */
KBookmark selectedBookmark() const;
signals:
/**
* Is send when a bookmark has been activated by the user.
* @param index Index of the selected bookmark.
*/
void bookmarkActivated(int index);
protected:
/**
* Draws the icon of the selected URL as content of the URL
* selector.
*/
virtual void drawButton(QPainter* painter);
private slots:
/**
* Updates the selected index and the icon if a bookmark
* has been activated by the user.
*/
void slotBookmarkActivated(int index);
private:
int m_selectedIndex;
Q3PopupMenu* m_bookmarksMenu;
};
#endif

View file

@ -0,0 +1,318 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "bookmarkssettingspage.h"
#include <assert.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <q3vbox.h>
//Added by qt3to4:
#include <QPixmap>
#include <Q3VBoxLayout>
#include <kbookmark.h>
#include <kbookmarkmanager.h>
#include <kdialog.h>
#include <kiconloader.h>
#include <klistview.h>
#include <klocale.h>
#include <kpushbutton.h>
#include "dolphinsettings.h"
#include "editbookmarkdialog.h"
BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) :
SettingsPageBase(parent),
m_addButton(0),
m_removeButton(0),
m_moveUpButton(0),
m_moveDownButton(0)
{
Q3VBoxLayout* topLayout = new Q3VBoxLayout(parent, 2, KDialog::spacingHint());
const int spacing = KDialog::spacingHint();
Q3HBox* hBox = new Q3HBox(parent);
hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
hBox->setSpacing(spacing);
hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
m_listView = new KListView(hBox);
m_listView->addColumn(i18n("Icon"));
m_listView->addColumn(i18n("Name"));
m_listView->addColumn(i18n("Location"));
m_listView->setResizeMode(Q3ListView::LastColumn);
m_listView->setColumnAlignment(0, Qt::AlignHCenter);
m_listView->setAllColumnsShowFocus(true);
m_listView->setSorting(-1);
connect(m_listView, SIGNAL(selectionChanged()),
this, SLOT(updateButtons()));
connect(m_listView, SIGNAL(pressed(Q3ListViewItem*)),
this, SLOT(slotBookmarkPressed(Q3ListViewItem*)));
connect(m_listView, SIGNAL(doubleClicked(Q3ListViewItem*, const QPoint&, int)),
this, SLOT(slotBookmarkDoubleClicked(Q3ListViewItem*, const QPoint&, int)));
Q3VBox* buttonBox = new Q3VBox(hBox);
buttonBox->setSpacing(spacing);
const QSizePolicy buttonSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
m_addButton = new KPushButton(i18n("Add..."), buttonBox);
connect(m_addButton, SIGNAL(clicked()),
this, SLOT(slotAddButtonClicked()));
m_addButton->setSizePolicy(buttonSizePolicy);
m_editButton = new KPushButton(i18n("Edit..."), buttonBox);
connect(m_editButton, SIGNAL(clicked()),
this, SLOT(slotEditButtonClicked()));
m_editButton->setSizePolicy(buttonSizePolicy);
m_removeButton = new KPushButton(i18n("Remove"), buttonBox);
connect(m_removeButton, SIGNAL(clicked()),
this, SLOT(slotRemoveButtonClicked()));
m_removeButton->setSizePolicy(buttonSizePolicy);
m_moveUpButton = new KPushButton(i18n("Move Up"), buttonBox);
connect(m_moveUpButton, SIGNAL(clicked()),
this, SLOT(slotMoveUpButtonClicked()));
m_moveUpButton->setSizePolicy(buttonSizePolicy);
m_moveDownButton = new KPushButton(i18n("Move Down"), buttonBox);
connect(m_moveDownButton, SIGNAL(clicked()),
this, SLOT(slotMoveDownButtonClicked()));
m_moveDownButton->setSizePolicy(buttonSizePolicy);
// Add a dummy widget with no restriction regarding a vertical resizing.
// This assures that the spacing between the buttons is not increased.
new QWidget(buttonBox);
topLayout->addWidget(hBox);
// insert all editable bookmarks.
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
Q3ListViewItem* prev = 0;
while (!bookmark.isNull()) {
Q3ListViewItem* item = new Q3ListViewItem(m_listView);
item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
item->setText(NameIdx, bookmark.text());
item->setText(URLIdx, bookmark.url().prettyURL());
// add hidden column to be able to retrieve the icon name again
item->setText(IconIdx, bookmark.icon());
m_listView->insertItem(item);
if (prev != 0) {
item->moveItem(prev);
}
prev = item;
bookmark = root.next(bookmark);
}
m_listView->setSelected(m_listView->firstChild(), true);
updateButtons();
}
BookmarksSettingsPage::~BookmarksSettingsPage()
{
}
void BookmarksSettingsPage::applySettings()
{
// delete all bookmarks
KBookmarkManager* manager = DolphinSettings::instance().bookmarkManager();
KBookmarkGroup root = manager->root();
KBookmark bookmark = root.first();
while (!bookmark.isNull()) {
root.deleteBookmark(bookmark);
bookmark = root.first();
}
// add all items as bookmarks
Q3ListViewItem* item = m_listView->firstChild();
while (item != 0) {
root.addBookmark(manager,
item->text(NameIdx),
KURL(item->text(URLIdx)),
item->text(IconIdx)); // hidden column
item = item->itemBelow();
}
manager->emitChanged(root);
}
void BookmarksSettingsPage::updateButtons()
{
const Q3ListViewItem* selectedItem = m_listView->selectedItem();
const bool hasSelection = (selectedItem != 0);
m_editButton->setEnabled(hasSelection);
m_removeButton->setEnabled(hasSelection);
const bool enableMoveUp = hasSelection &&
(selectedItem != m_listView->firstChild());
m_moveUpButton->setEnabled(enableMoveUp);
const bool enableMoveDown = hasSelection &&
(selectedItem != m_listView->lastChild());
m_moveDownButton->setEnabled(enableMoveDown);
}
void BookmarksSettingsPage::slotBookmarkDoubleClicked(Q3ListViewItem*,
const QPoint&,
int)
{
slotEditButtonClicked();
}
void BookmarksSettingsPage::slotBookmarkPressed(Q3ListViewItem* item)
{
if (item == 0) {
m_listView->setSelected(m_listView->currentItem(), true);
}
}
void BookmarksSettingsPage::slotAddButtonClicked()
{
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add Bookmark"),
i18n("New bookmark"),
KURL(),
"bookmark");
if (!bookmark.isNull()) {
// insert bookmark into listview
Q3ListViewItem* item = new Q3ListViewItem(m_listView);
item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
item->setText(NameIdx, bookmark.text());
item->setText(URLIdx, bookmark.url().prettyURL());
item->setText(IconIdx, bookmark.icon());
m_listView->insertItem(item);
Q3ListViewItem* lastItem = m_listView->lastChild();
if (lastItem != 0) {
item->moveItem(lastItem);
}
m_listView->setSelected(item, true);
updateButtons();
}
}
void BookmarksSettingsPage::slotEditButtonClicked()
{
Q3ListViewItem* item = m_listView->selectedItem();
assert(item != 0); // 'edit' may not get invoked when having no items
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Edit Bookmark"),
item->text(NameIdx),
KURL(item->text(URLIdx)),
item->text(IconIdx));
if (!bookmark.isNull()) {
item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
item->setText(NameIdx, bookmark.text());
item->setText(URLIdx, bookmark.url().prettyURL());
item->setText(IconIdx, bookmark.icon());
}
}
void BookmarksSettingsPage::slotRemoveButtonClicked()
{
Q3ListViewItem* selectedItem = m_listView->selectedItem();
assert(selectedItem != 0);
Q3ListViewItem* nextItem = selectedItem->itemBelow();
if (nextItem == 0) {
nextItem = selectedItem->itemAbove();
}
m_listView->takeItem(selectedItem);
if (nextItem != 0) {
m_listView->setSelected(nextItem, true);
}
}
void BookmarksSettingsPage::slotMoveUpButtonClicked()
{
moveBookmark(-1);
}
void BookmarksSettingsPage::slotMoveDownButtonClicked()
{
moveBookmark(+1);
}
int BookmarksSettingsPage::selectedBookmarkIndex() const
{
int index = -1;
Q3ListViewItem* selectedItem = m_listView->selectedItem();
if (selectedItem != 0) {
index = 0;
Q3ListViewItem* item = m_listView->firstChild();
while (item != selectedItem) {
item = item->nextSibling();
++index;
}
}
return index;
}
void BookmarksSettingsPage::moveBookmark(int direction)
{
// this implementation currently only allows moving of bookmarks
// one step up or down
assert((direction >= -1) && (direction <= +1));
// swap bookmarks in listview
Q3ListViewItem* selectedItem = m_listView->selectedItem();
assert(selectedItem != 0);
Q3ListViewItem* item = (direction < 0) ? selectedItem->itemAbove() :
selectedItem->itemBelow();
assert(item != 0);
QPixmap pixmap;
if (item->pixmap(0) != 0) {
pixmap = *(item->pixmap(0));
}
QString name(item->text(NameIdx));
QString url(item->text(URLIdx));
QString icon(item->text(IconIdx));
if (selectedItem->pixmap(0) != 0) {
item->setPixmap(PixmapIdx, *(selectedItem->pixmap(0)));
}
item->setText(NameIdx, selectedItem->text(NameIdx));
item->setText(URLIdx, selectedItem->text(URLIdx));
item->setText(IconIdx, selectedItem->text(IconIdx));
selectedItem->setPixmap(PixmapIdx, pixmap);
selectedItem->setText(NameIdx, name);
selectedItem->setText(URLIdx, url);
selectedItem->setText(IconIdx, icon);
m_listView->setSelected(item, true);
}
#include "bookmarkssettingspage.moc"

View file

@ -0,0 +1,93 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef BOOKMARKSSETTINGSPAGE_H
#define BOOKMARKSSETTINGSPAGE_H
#include <settingspagebase.h>
#include <q3valuelist.h>
class KListView;
class KPushButton;
class Q3ListViewItem;
/**
* @brief Represents the page from the Dolphin Settings which allows
* to modify the bookmarks.
*/
class BookmarksSettingsPage : public SettingsPageBase
{
Q_OBJECT
public:
BookmarksSettingsPage(QWidget* parent);
virtual ~BookmarksSettingsPage();
/** @see SettingsPageBase::applySettings */
virtual void applySettings();
private slots:
void updateButtons();
void slotBookmarkDoubleClicked(Q3ListViewItem*, const QPoint&, int);
void slotAddButtonClicked();
void slotEditButtonClicked();
void slotRemoveButtonClicked();
void slotMoveUpButtonClicked();
void slotMoveDownButtonClicked();
/**
* Is connected with the signal QListView::pressed(QListViewItem* item)
* and assures that always one bookmarks stays selected although a
* click has been done on the viewport area.
* TODO: this is a workaround, possibly there is a more easy approach
* doing this...
*/
void slotBookmarkPressed(Q3ListViewItem* item);
private:
enum ColumnIndex {
PixmapIdx = 0,
NameIdx = 1,
URLIdx = 2,
IconIdx = 3
};
KListView* m_listView;
KPushButton* m_addButton;
KPushButton* m_editButton;
KPushButton* m_removeButton;
KPushButton* m_moveUpButton;
KPushButton* m_moveDownButton;
/**
* Returns the index of the selected bookmark
* inside the bookmarks listview.
*/
int selectedBookmarkIndex() const;
/**
* Moves the currently selected bookmark up, if 'direction'
* is < 0, otherwise the bookmark is moved down.
*/
void moveBookmark(int direction);
};
#endif

View file

@ -0,0 +1,277 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "bookmarkssidebarpage.h"
#include <q3listbox.h>
#include <qlayout.h>
#include <qpainter.h>
//Added by qt3to4:
#include <QPixmap>
#include <Q3VBoxLayout>
#include <QPaintEvent>
#include <assert.h>
#include <q3popupmenu.h>
#include <kbookmark.h>
#include <kbookmarkmanager.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <klocale.h>
#include "dolphinsettings.h"
#include "dolphin.h"
#include "dolphinview.h"
#include "editbookmarkdialog.h"
BookmarksSidebarPage::BookmarksSidebarPage(QWidget* parent) :
SidebarPage(parent)
{
Q3VBoxLayout* layout = new Q3VBoxLayout(this);
m_bookmarksList = new BookmarksListBox(this);
m_bookmarksList->setPaletteBackgroundColor(colorGroup().background());
layout->addWidget(m_bookmarksList);
connect(m_bookmarksList, SIGNAL(mouseButtonClicked(int, Q3ListBoxItem*, const QPoint&)),
this, SLOT(slotMouseButtonClicked(int, Q3ListBoxItem*)));
connect(m_bookmarksList, SIGNAL(contextMenuRequested(Q3ListBoxItem*, const QPoint&)),
this, SLOT(slotContextMenuRequested(Q3ListBoxItem*, const QPoint&)));
KBookmarkManager* manager = DolphinSettings::instance().bookmarkManager();
connect(manager, SIGNAL(changed(const QString&, const QString&)),
this, SLOT(updateBookmarks()));
updateBookmarks();
}
BookmarksSidebarPage::~BookmarksSidebarPage()
{
}
void BookmarksSidebarPage::activeViewChanged()
{
connectToActiveView();
}
void BookmarksSidebarPage::updateBookmarks()
{
m_bookmarksList->clear();
KIconLoader iconLoader;
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
while (!bookmark.isNull()) {
QPixmap icon(iconLoader.loadIcon(bookmark.icon(),
KIcon::NoGroup,
KIcon::SizeMedium));
BookmarkItem* item = new BookmarkItem(icon, bookmark.text());
m_bookmarksList->insertItem(item);
bookmark = root.next(bookmark);
}
connectToActiveView();
}
void BookmarksSidebarPage::slotMouseButtonClicked(int button, Q3ListBoxItem* item)
{
if ((button != Qt::LeftButton) || (item == 0)) {
return;
}
const int index = m_bookmarksList->index(item);
KBookmark bookmark = DolphinSettings::instance().bookmark(index);
Dolphin::mainWin().activeView()->setURL(bookmark.url());
}
void BookmarksSidebarPage::slotContextMenuRequested(Q3ListBoxItem* item,
const QPoint& pos)
{
const int insertID = 1;
const int editID = 2;
const int deleteID = 3;
const int addID = 4;
Q3PopupMenu* popup = new Q3PopupMenu();
if (item == 0) {
popup->insertItem(SmallIcon("filenew"), i18n("Add Bookmark..."), addID);
}
else {
popup->insertItem(SmallIcon("filenew"), i18n("Insert Bookmark..."), insertID);
popup->insertItem(SmallIcon("edit"), i18n("Edit..."), editID);
popup->insertItem(SmallIcon("editdelete"), i18n("Delete"), deleteID);
}
KBookmarkManager* manager = DolphinSettings::instance().bookmarkManager();
KBookmarkGroup root = manager->root();
const int index = m_bookmarksList->index(m_bookmarksList->selectedItem());
const int result = popup->exec(pos);
switch (result) {
case insertID: {
KBookmark newBookmark = EditBookmarkDialog::getBookmark(i18n("Insert Bookmark"),
"New bookmark",
KURL(),
"bookmark");
if (!newBookmark.isNull()) {
root.addBookmark(manager, newBookmark);
if (index > 0) {
KBookmark prevBookmark = DolphinSettings::instance().bookmark(index - 1);
root.moveItem(newBookmark, prevBookmark);
}
else {
// insert bookmark at first position (is a little bit tricky as KBookmarkGroup
// only allows to move items after existing items)
KBookmark firstBookmark = root.first();
root.moveItem(newBookmark, firstBookmark);
root.moveItem(firstBookmark, newBookmark);
}
manager->emitChanged(root);
}
break;
}
case editID: {
KBookmark oldBookmark = DolphinSettings::instance().bookmark(index);
KBookmark newBookmark = EditBookmarkDialog::getBookmark(i18n("Edit Bookmark"),
oldBookmark.text(),
oldBookmark.url(),
oldBookmark.icon());
if (!newBookmark.isNull()) {
root.addBookmark(manager, newBookmark);
root.moveItem(newBookmark, oldBookmark);
root.deleteBookmark(oldBookmark);
manager->emitChanged(root);
}
break;
}
case deleteID: {
KBookmark bookmark = DolphinSettings::instance().bookmark(index);
root.deleteBookmark(bookmark);
manager->emitChanged(root);
break;
}
case addID: {
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add Bookmark"),
"New bookmark",
KURL(),
"bookmark");
if (!bookmark.isNull()) {
root.addBookmark(manager, bookmark);
manager->emitChanged(root);
}
}
default: break;
}
delete popup;
popup = 0;
DolphinView* view = Dolphin::mainWin().activeView();
adjustSelection(view->url());
}
void BookmarksSidebarPage::adjustSelection(const KURL& url)
{
// TODO (remarked in dolphin/TODO): the following code is quite equal
// to BookmarkSelector::updateSelection().
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
int maxLength = 0;
int selectedIndex = -1;
// Search the bookmark which is equal to the URL or at least is a parent URL.
// If there are more than one possible parent URL candidates, choose the bookmark
// which covers the bigger range of the URL.
int i = 0;
while (!bookmark.isNull()) {
const KURL bookmarkURL = bookmark.url();
if (bookmarkURL.isParentOf(url)) {
const int length = bookmarkURL.prettyURL().length();
if (length > maxLength) {
selectedIndex = i;
maxLength = length;
}
}
bookmark = root.next(bookmark);
++i;
}
const bool block = m_bookmarksList->signalsBlocked();
m_bookmarksList->blockSignals(true);
if (selectedIndex < 0) {
// no bookmark matches, hence deactivate any selection
const int currentIndex = m_bookmarksList->index(m_bookmarksList->selectedItem());
m_bookmarksList->setSelected(currentIndex, false);
}
else {
// select the bookmark which is part of the current URL
m_bookmarksList->setSelected(selectedIndex, true);
}
m_bookmarksList->blockSignals(block);
}
void BookmarksSidebarPage::slotURLChanged(const KURL& url)
{
adjustSelection(url);
}
void BookmarksSidebarPage::connectToActiveView()
{
DolphinView* view = Dolphin::mainWin().activeView();
adjustSelection(view->url());
connect(view, SIGNAL(signalURLChanged(const KURL&)),
this, SLOT(slotURLChanged(const KURL&)));
}
BookmarksListBox::BookmarksListBox(QWidget* parent) :
Q3ListBox(parent)
{
}
BookmarksListBox::~BookmarksListBox()
{
}
void BookmarksListBox::paintEvent(QPaintEvent* /* event */)
{
// don't invoke QListBox::paintEvent(event) to prevent
// that any kind of frame is drawn
}
BookmarkItem::BookmarkItem(const QPixmap& pixmap, const QString& text) :
Q3ListBoxPixmap(pixmap, text)
{
}
BookmarkItem::~BookmarkItem()
{
}
int BookmarkItem::height(const Q3ListBox* listBox) const
{
return Q3ListBoxPixmap::height(listBox) + 8;
}

122
src/bookmarkssidebarpage.h Normal file
View file

@ -0,0 +1,122 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _BOOKMARKSSIDEBARPAGE_H_
#define _BOOKMARKSSIDEBARPAGE_H_
#include <sidebarpage.h>
#include <q3listbox.h>
//Added by qt3to4:
#include <QPaintEvent>
#include <QPixmap>
class KURL;
class BookmarksListBox;
/**
* @brief Sidebar page for accessing bookmarks.
*
* It is possible to add, remove and edit bookmarks
* by a context menu. The selection of the bookmark
* is automatically adjusted to the URL given by
* the active view.
*/
class BookmarksSidebarPage : public SidebarPage
{
Q_OBJECT
public:
BookmarksSidebarPage(QWidget* parent);
virtual ~BookmarksSidebarPage();
protected:
/** @see SidebarPage::activeViewChanged() */
virtual void activeViewChanged();
private slots:
/** Fills the listbox with the bookmarks stored in DolphinSettings. */
void updateBookmarks();
/**
* Checks whether the left mouse button has been clicked above a bookmark.
* If this is the case, the URL for the currently active view is adjusted.
*/
void slotMouseButtonClicked(int button, Q3ListBoxItem* item);
/** @see QListBox::slotContextMenuRequested */
void slotContextMenuRequested(Q3ListBoxItem* item, const QPoint& pos);
/**
* Is invoked whenever the URL of the active view has been changed. Adjusts
* the selection of the listbox to the bookmark which is part of the current URL.
*/
void slotURLChanged(const KURL& url);
private:
/**
* Updates the selection dependent from the given URL \a url. The
* URL must not match exactly to one of the available bookmarks:
* The bookmark which is equal to the URL or at least is a parent URL
* is selected. If there are more than one possible parent URL candidates,
* the bookmark which covers the bigger range of the URL is selected.
*/
void adjustSelection(const KURL& url);
/**
* Connects to signals from the currently active Dolphin view to get
* informed about URL and bookmark changes.
*/
void connectToActiveView();
BookmarksListBox* m_bookmarksList;
};
/**
* @brief Listbox which contains a list of bookmarks.
*
* Only QListBox::paintEvent() has been overwritten to prevent
* that a (not wanted) frameborder is drawn.
*/
class BookmarksListBox : public Q3ListBox
{
Q_OBJECT
public:
BookmarksListBox(QWidget* parent);
virtual ~BookmarksListBox();
protected:
/** @see QWidget::paintEvent() */
virtual void paintEvent(QPaintEvent* event);
};
/**
* @brief Item which can be added to a BookmarksListBox.
*
* Only QListBoxPixmap::height() has been overwritten to get
* a spacing between the items.
*/
class BookmarkItem : public Q3ListBoxPixmap
{
public:
BookmarkItem(const QPixmap& pixmap, const QString& text);
virtual ~BookmarkItem();
virtual int height(const Q3ListBox* listBox) const;
};
#endif // _BOOKMARKSSIDEBARPAGE_H_

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="dolphinrc"/>
<include>kiconloader.h</include>
<group name="DetailsMode">
<entry name="FontFamily" type="String">
<label>Font family</label>
<default code="true">KGlobalSettings::generalFont().family()</default>
</entry>
<entry name="FontSize" type="Int">
<label>Font size</label>
<default code="true">KGlobalSettings::generalFont().pointSize()</default>
</entry>
<entry name="IconSize" type="Int">
<label>Icon size</label>
<default code="true">KIcon::SizeSmall</default>
</entry>
<entry name="ShowDate" type="Bool">
<label>Show date</label>
<default>true</default>
</entry>
<entry name="ShowGroup" type="Bool">
<label>Show group</label>
<default>false</default>
</entry>
<entry name="ShowOwner" type="Bool">
<label>Show owner</label>
<default>false</default>
</entry>
<entry name="ShowPermissions" type="Bool">
<label>Show permissions</label>
<default>false</default>
</entry>
<entry name="ShowSize" type="Bool">
<label>Show size</label>
<default>false</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,4 @@
File=detailsmodesettings.kcfg
ClassName=DetailsModeSettings
Singleton=false
Mutators=true

View file

@ -0,0 +1,151 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "detailsviewsettingspage.h"
#include <qcheckbox.h>
#include <klocale.h>
#include <kdialog.h>
#include <kfontcombo.h>
#include <qspinbox.h>
#include <qlabel.h>
#include <q3grid.h>
#include <assert.h>
#include <q3buttongroup.h>
#include <qradiobutton.h>
#include <qcombobox.h>
#include <q3groupbox.h>
#include <q3groupbox.h>
#include "dolphinsettings.h"
#include "detailsmodesettings.h"
#include "dolphindetailsview.h"
DetailsViewSettingsPage::DetailsViewSettingsPage(QWidget *parent) :
Q3VBox(parent),
m_dateBox(0),
m_permissionsBox(0),
m_ownerBox(0),
m_groupBox(0),
m_smallIconSize(0),
m_mediumIconSize(0),
m_largeIconSize(0)
{
const int spacing = KDialog::spacingHint();
const int margin = KDialog::marginHint();
const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
setSpacing(spacing);
setMargin(margin);
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
assert(settings != 0);
// create "Columns" properties
Q3GroupBox* columnsGroup = new Q3GroupBox(4, Qt::Vertical, i18n("Columns"), this);
columnsGroup->setSizePolicy(sizePolicy);
columnsGroup->setMargin(margin);
Q3HBox* visibleColumnsLayout = new Q3HBox(columnsGroup);
m_dateBox = new QCheckBox(i18n("Date"), visibleColumnsLayout);
m_dateBox->setChecked(settings->showDate());
m_permissionsBox = new QCheckBox(i18n("Permissions"), visibleColumnsLayout);
m_permissionsBox->setChecked(settings->showPermissions());
m_ownerBox = new QCheckBox(i18n("Owner"), visibleColumnsLayout);
m_ownerBox->setChecked(settings->showOwner());
m_groupBox = new QCheckBox(i18n("Group"), visibleColumnsLayout);
m_groupBox->setChecked(settings->showGroup());
// Create "Icon" properties
Q3ButtonGroup* iconSizeGroup = new Q3ButtonGroup(3, Qt::Horizontal, i18n("Icon Size"), this);
iconSizeGroup->setSizePolicy(sizePolicy);
iconSizeGroup->setMargin(margin);
m_smallIconSize = new QRadioButton(i18n("Small"), iconSizeGroup);
m_mediumIconSize = new QRadioButton(i18n("Medium"), iconSizeGroup);
m_largeIconSize = new QRadioButton(i18n("Large"), iconSizeGroup);
switch (settings->iconSize()) {
case KIcon::SizeLarge:
m_largeIconSize->setChecked(true);
break;
case KIcon::SizeMedium:
m_mediumIconSize->setChecked(true);
break;
case KIcon::SizeSmall:
default:
m_smallIconSize->setChecked(true);
}
//new QLabel(i18n("Icon size:"), iconGroup);
//m_iconSizeBox = new QComboBox(iconGroup);
//m_iconSizeBox->insertItem(i18n("Small"));
//m_iconSizeBox->insertItem(i18n("Medium"));
//m_iconSizeBox->insertItem(i18n("Large"));
// create "Text" properties
Q3GroupBox* textGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Text"), this);
textGroup->setSizePolicy(sizePolicy);
textGroup->setMargin(margin);
new QLabel(i18n("Font family:"), textGroup);
m_fontFamilyBox = new KFontCombo(textGroup);
m_fontFamilyBox->setCurrentFont(settings->fontFamily());
new QLabel(i18n("Font size:"), textGroup);
m_fontSizeBox = new QSpinBox(6, 99, 1, textGroup);
m_fontSizeBox->setValue(settings->fontSize());
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
// is not stretched vertically.
new QWidget(this);
}
DetailsViewSettingsPage::~DetailsViewSettingsPage()
{
}
void DetailsViewSettingsPage::applySettings()
{
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
assert(settings != 0);
settings->setShowDate(m_dateBox->isChecked());
settings->setShowPermissions(m_permissionsBox->isChecked());
settings->setShowOwner(m_ownerBox->isChecked());
settings->setShowGroup(m_groupBox->isChecked());
int iconSize = KIcon::SizeSmall;
if (m_mediumIconSize->isChecked()) {
iconSize = KIcon::SizeMedium;
}
else if (m_largeIconSize->isChecked()) {
iconSize = KIcon::SizeLarge;
}
settings->setIconSize(iconSize);
settings->setFontFamily(m_fontFamilyBox->currentFont());
settings->setFontSize(m_fontSizeBox->value());
}
#include "detailsviewsettingspage.moc"

View file

@ -0,0 +1,65 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DETAILSVIEWSETTINGSPAGE_H
#define DETAILSVIEWSETTINGSPAGE_H
#include <q3vbox.h>
class QCheckBox;
class KFontCombo;
class QSpinBox;
class QComboBox;
class QRadioButton;
/**
* @brief Represents the page from the Dolphin Settings which allows
* to modify the settings for the details view.
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class DetailsViewSettingsPage : public Q3VBox
{
Q_OBJECT
public:
DetailsViewSettingsPage(QWidget* parent);
virtual ~DetailsViewSettingsPage();
/**
* Applies the settings for the details view.
* The settings are persisted automatically when
* closing Dolphin.
*/
void applySettings();
private:
QCheckBox* m_dateBox;
QCheckBox* m_permissionsBox;
QCheckBox* m_ownerBox;
QCheckBox* m_groupBox;
QRadioButton* m_smallIconSize;
QRadioButton* m_mediumIconSize;
QRadioButton* m_largeIconSize;
KFontCombo* m_fontFamilyBox;
QSpinBox* m_fontSizeBox;
};
#endif

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile arg="true" />
<group name="Settings">
<entry name="ShowHiddenFiles" key="ShowDotFiles" type="Bool" >
<label>Show hidden files</label>
<whatsthis>When this option is enabled hidden files, such as those starting with a '.', will be shown in the file view.</whatsthis>
<default>false</default>
</entry>
</group>
<group name="Dolphin">
<entry name="ViewMode" type="Int" >
<label>View Mode</label>
<whatsthis>This option controls the style of the view. Currently supported values include icons (0), details (1) and previews (2) views.</whatsthis>
<default>DolphinView::PreviewsView</default>
<min>0</min>
<max code="true">DolphinView::MaxModeEnum</max>
</entry>
<entry name="Sorting" type="Int" >
<label>Sort files by</label>
<whatsthis>This option defines which attribute (name, size, date, etc) sorting is performed on.</whatsthis>
<default code="true">DolphinView::SortByName</default>
<min>0</min>
<max code="true">DolphinView::MaxSortEnum</max>
</entry>
<entry name="SortOrder" type="Int" >
<label>Order to sort files in</label>
<default code="true">Qt::Ascending</default>
<min code="true">Qt::Ascending</min>
<max code="true">Qt::Descending</max>
</entry>
<entry name="ValidForSubDirs" type="Bool" >
<label>Apply view setting to sub-directories</label>
<default>false</default>
</entry>
<entry name="Timestamp" type="DateTime" >
<label>Properties last changed</label>
<whatsthis>The last time these properties were changed by the user.</whatsthis>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,6 @@
File=directoryviewpropertysettings.kcfg
Singleton=false
ClassName=ViewPropertySettings
Mutators=true
GlobalEnums=true
IncludeFiles=dolphinview.h,qnamespace.h

1676
src/dolphin.cpp Normal file

File diff suppressed because it is too large Load diff

11
src/dolphin.desktop Normal file
View file

@ -0,0 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Name=Dolphin
Exec=dolphin %i %m -caption "%c"
Icon=dolphin
Type=Application
DocPath=dolphin/dolphin.html
Categories=System;FileManager;
GenericName=File Manager
GenericName[de]=Datei Manager
Terminal=false

455
src/dolphin.h Normal file
View file

@ -0,0 +1,455 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com> *
* Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _DOLPHIN_H_
#define _DOLPHIN_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kapplication.h>
#include <kmainwindow.h>
#include <q3valuelist.h>
#include <q3ptrlist.h>
#include <qstring.h>
//Added by qt3to4:
#include <QCloseEvent>
#include <ksortablelist.h>
#include "dolphinview.h"
#include "undomanager.h"
class KPrinter;
class KUrl;
class QLineEdit;
class KFileIconView;
class Q3HBox;
class Q3IconViewItem;
class QSplitter;
class KAction;
class URLNavigator;
class Sidebar;
/**
* @short Main window for Dolphin.
*
* Handles the menus, toolbars and Dolphin views.
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class Dolphin : public KMainWindow
{
Q_OBJECT
public:
/**
* Returns the instance for the Dolphin main window.
*/
// KXMLGUIClient::instance() already in use :-(
static Dolphin& mainWin();
virtual ~Dolphin();
/**
* Activates the given view, which means that
* all menu actions are applied to this view. When
* having a split view setup the nonactive view
* is usually shown in darker colors.
*/
void setActiveView(DolphinView* view);
/**
* Returns the currently active view. See
* Dolphin::setActiveView() for more details.
*/
DolphinView* activeView() const { return m_activeView; }
/**
* Handles the dropping of URLs to the given
* destination. A context menu with the options
* 'Move Here', 'Copy Here', 'Link Here' and
* 'Cancel' is offered to the user.
* @param urls List of URLs which have been
* dropped.
* @param destination Destination URL, where the
* list or URLs should be moved,
* copied or linked to.
*/
void dropURLs(const KUrl::List& urls,
const KUrl& destination);
/**
* Returns 'true', if the clipboard contains data
* which has been cutted by the Cut action (Ctrl + X).
*/
bool clipboardContainsCutData() const { return m_clipboardContainsCutData; }
/**
* Returns the list of actions which are part of the file group
* of the 'Create New...' sub menu. Usually the list contains actions
* for creating folders, text files, HTML files etc.
*/
const Q3PtrList<KAction>& fileGroupActions() const { return m_fileGroupActions; }
//const QPtrList<KAction>& linkGroupActions() const { return m_linkGroupActions; }
//const QPtrList<KAction>& linkToDeviceActions() const { return m_linkToDeviceActions; }
/**
* Refreshs the views of the main window by recreating them dependent from
* the given Dolphin settings.
*/
void refreshViews();
signals:
/**
* Is send if the active view has been changed in
* the split view mode.
*/
void activeViewChanged();
/**
* Is send if the selection of the currently active view has
* been changed.
*/
void selectionChanged();
public slots:
/**
* Updates the state of the 'Back' and 'Forward' menu
* actions corresponding the the current history.
*/
void slotHistoryChanged();
/**
* Updates the caption of the main window and the state
* of all menu actions which depend from a changed URL.
*/
void slotURLChanged(const KUrl& url);
/**
* Go to the given URL.
*/
void slotURLChangeRequest(const KUrl& url);
/** Updates the state of all 'View' menu actions. */
void slotViewModeChanged();
/** Updates the state of the 'Show hidden files' menu action. */
void slotShowHiddenFilesChanged();
/** Updates the state of the 'Show filter bar' menu action. */
void slotShowFilterBarChanged();
/** Updates the state of the 'Sort by' actions. */
void slotSortingChanged(DolphinView::Sorting sorting);
/** Updates the state of the 'Sort Ascending/Descending' action. */
void slotSortOrderChanged(Qt::SortOrder order);
/** Updates the state of the 'Edit' menu actions. */
void slotSelectionChanged();
protected:
/** @see QMainWindow::closeEvent */
virtual void closeEvent(QCloseEvent* event);
/**
* This method is called when it is time for the app to save its
* properties for session management purposes.
*/
void saveProperties(KConfig*);
/**
* This method is called when this app is restored. The KConfig
* object points to the session management config file that was saved
* with @ref saveProperties
*/
void readProperties(KConfig*);
private slots:
/** Opens an input dialog for creating a new folder. */
void createFolder();
/** Creates a file with the MIME type given by the sender. */
void createFile();
/** Renames the selected item of the active view. */
void rename();
/** Moves the selected items of the active view to the trash. */
void moveToTrash();
/** Deletes the selected items of the active view. */
void deleteItems();
/**
* Opens the properties window for the selected items of the
* active view. The properties windows shows informations
* like name, size and permissions.
*/
void properties();
/** Stores all settings and quits Dolphin. */
void quit();
/**
* Shows the error information of the job \a job
* in the status bar.
*/
void slotHandleJobError(KIO::Job* job);
/**
* Indicates in the status bar that the delete operation
* of the job \a job has been finished.
*/
void slotDeleteFileFinished(KIO::Job* job);
/**
* Updates the state of the 'Undo' menu action dependent
* from the parameter \a available.
*/
void slotUndoAvailable(bool available);
/** Sets the text of the 'Undo' menu action to \a text. */
void slotUndoTextChanged(const QString& text);
/**
* Updates the state of the 'Redo' menu action dependent
* from the parameter \a available.
*/
void slotRedoAvailable(bool available);
/** Sets the text of the 'Redo' menu action to \a text. */
void slotRedoTextChanged(const QString& text);
/**
* Copies all selected items to the clipboard and marks
* the items as cutted.
*/
void cut();
/** Copies all selected items to the clipboard. */
void copy();
/** Pastes the clipboard data to the active view. */
void paste();
/**
* Updates the text of the paste action dependent from
* the number of items which are in the clipboard.
*/
void updatePasteAction();
/** Selects all items from the active view. */
void selectAll();
/**
* Inverts the selection of all items of the active view:
* Selected items get nonselected and nonselected items get
* selected.
*/
void invertSelection();
/** The current active view is switched to the icons mode. */
void setIconsView();
/** The current active view is switched to the details mode. */
void setDetailsView();
/** The current active view is switched to the previews mode. */
void setPreviewsView();
/** The sorting of the current view should be done by the name. */
void sortByName();
/** The sorting of the current view should be done by the size. */
void sortBySize();
/** The sorting of the current view should be done by the date. */
void sortByDate();
/** Switches between an ascending and descending sorting order. */
void toggleSortOrder();
/**
* Switches between one and two views:
* If one view is visible, it will get split into two views.
* If already two views are visible, the nonactivated view gets closed.
*/
void toggleSplitView();
/** Reloads the current active view. */
void reloadView();
/** Stops the loading process for the current active view. */
void stopLoading();
/**
* Switches between showing and hiding of hidden marked files dependent
* from the current state of the 'Show Hidden Files' menu toggle action.
*/
void showHiddenFiles();
/**
* Switches between showing and hiding of the filter bar dependent
* from the current state of the 'Show Filter Bar' menu toggle action.
*/
void showFilterBar();
/** Increases the size of the current set view mode. */
void zoomIn();
/** Decreases the size of the current set view mode. */
void zoomOut();
/**
* Toggles between edit and brose mode of the navigation bar.
*/
void toggleEditLocation();
/**
* Switches to the edit mode of the navigation bar. If the edit mode is
* already active, it is assured that the navigation bar get focused.
*/
void editLocation();
/**
* Opens the view properties dialog, which allows to modify the properties
* of the currently active view.
*/
void adjustViewProperties();
/** Goes back on step of the URL history. */
void goBack();
/** Goes forward one step of the URL history. */
void goForward();
/** Goes up one hierarchy of the current URL. */
void goUp();
/** Goes to the home URL. */
void goHome();
/** Opens a terminal for the current shown directory. */
void openTerminal();
/** Opens KFind for the current shown directory. */
void findFile();
/** Opens Kompare for 2 selected files. */
void compareFiles();
/** Opens the settings dialog for Dolphin. */
void editSettings();
/**
* Adds the undo operation given by \a job
* to the UndoManager.
*/
void addUndoOperation(KIO::Job* job);
void toggleSidebar();
/**
* Stores the current sidebar width and closes
* the sidebar.
*/
void closeSidebar();
private:
Dolphin();
void init();
void loadSettings();
void setupAccel();
void setupActions();
void setupCreateNewMenuActions();
void updateHistory();
void updateEditActions();
void updateViewActions();
void updateGoActions();
void updateViewProperties(const KUrl::List& urls);
void copyURLs(const KUrl::List& source, const KUrl& dest);
void moveURLs(const KUrl::List& source, const KUrl& dest);
void addPendingUndoJob(KIO::Job* job,
DolphinCommand::Type commandType,
const KUrl::List& source,
const KUrl& dest);
void clearStatusBar();
void openSidebar();
QSplitter* m_splitter;
Sidebar* m_sidebar;
DolphinView* m_activeView;
/**
* Dolphin supports only one or two views, which
* are handled internally as primary and secondary view.
*/
enum ViewIndex
{
PrimaryIdx = 0,
SecondaryIdx = 1
};
DolphinView* m_view[SecondaryIdx + 1];
/// If set to true, the clipboard contains data which should be cutted after pasting.
bool m_clipboardContainsCutData;
/**
* Asynchronous operations like 'Move' and 'Copy' may only be added as undo
* operation after they have been finished successfully. When an asynchronous
* operation is started, it is added to a pending undo jobs list in the meantime.
* As soon as the job has been finished, the operation is added to the undo mangager.
* @see UndoManager
* @see Dolphin::addPendingUndoJob
* @see Dolphin::addUndoOperation
*/
struct UndoInfo
{
int id;
DolphinCommand command;
};
Q3ValueList<UndoInfo> m_pendingUndoJobs;
/** Contains meta information for creating files. */
struct CreateFileEntry
{
QString name;
QString filePath;
QString templatePath;
QString icon;
QString comment;
};
Q3PtrList<KAction> m_fileGroupActions;
KSortableList<CreateFileEntry,QString> m_createFileTemplates;
// TODO: not used yet. See documentation of Dolphin::linkGroupActions()
// and Dolphin::linkToDeviceActions() in for details.
//QPtrList<KAction> m_linkGroupActions;
//QPtrList<KAction> m_linkToDeviceActions;
};
#endif // _DOLPHIN_H_

16
src/dolphin.lsm Normal file
View file

@ -0,0 +1,16 @@
Begin3
Title: Dolphin -- Some description
Version: 0.1
Entered-date:
Description:
Keywords: KDE Qt
Author: Peter Penz <peter.penz@gmx.at>
Maintained-by: Peter Penz <peter.penz@gmx.at>
Home-page:
Alternate-site:
Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils
xxxxxx dolphin-0.1.tar.gz
xxx dolphin-0.1.lsm
Platform: Linux. Needs KDE
Copying-policy: GPL
End

476
src/dolphincontextmenu.cpp Normal file
View file

@ -0,0 +1,476 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and *
* Cvetoslav Ludmiloff *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphincontextmenu.h"
#include <kactioncollection.h>
#include <kbookmarkmanager.h>
#include <kbookmark.h>
#include <ktrader.h>
#include <klocale.h>
#include <krun.h>
#include <qdir.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <kaction.h>
#include <kpropertiesdialog.h>
#include <kdesktopfile.h>
#include <assert.h>
#include <ksortablevaluelist.h>
#include <kio/netaccess.h>
#include "dolphin.h"
#include "dolphinview.h"
#include "editbookmarkdialog.h"
#include "dolphinsettings.h"
DolphinContextMenu::DolphinContextMenu(DolphinView* parent,
KFileItem* fileInfo,
const QPoint& pos) :
m_dolphinView(parent),
m_fileInfo(fileInfo),
m_pos(pos)
{
}
void DolphinContextMenu::open()
{
if (m_fileInfo == 0) {
openViewportContextMenu();
}
else {
openItemContextMenu();
}
}
DolphinContextMenu::~DolphinContextMenu()
{
}
void DolphinContextMenu::openViewportContextMenu()
{
// Parts of the following code have been taken
// from the class KonqOperations located in
// libqonq/konq_operations.h of Konqueror.
// (Copyright (C) 2000 David Faure <faure@kde.org>)
assert(m_fileInfo == 0);
const int propertiesID = 100;
const int bookmarkID = 101;
KPopupMenu* popup = new KPopupMenu(m_dolphinView);
Dolphin& dolphin = Dolphin::mainWin();
// setup 'Create New' menu
KPopupMenu* createNewMenu = new KPopupMenu();
KAction* createFolderAction = dolphin.actionCollection()->action("create_folder");
if (createFolderAction != 0) {
createFolderAction->plug(createNewMenu);
}
createNewMenu->insertSeparator();
KAction* action = 0;
Q3PtrListIterator<KAction> fileGrouptIt(dolphin.fileGroupActions());
while ((action = fileGrouptIt.current()) != 0) {
action->plug(createNewMenu);
++fileGrouptIt;
}
// TODO: not used yet. See documentation of Dolphin::linkGroupActions()
// and Dolphin::linkToDeviceActions() in the header file for details.
//
//createNewMenu->insertSeparator();
//
//QPtrListIterator<KAction> linkGroupIt(dolphin.linkGroupActions());
//while ((action = linkGroupIt.current()) != 0) {
// action->plug(createNewMenu);
// ++linkGroupIt;
//}
//
//KPopupMenu* linkToDeviceMenu = new KPopupMenu();
//QPtrListIterator<KAction> linkToDeviceIt(dolphin.linkToDeviceActions());
//while ((action = linkToDeviceIt.current()) != 0) {
// action->plug(linkToDeviceMenu);
// ++linkToDeviceIt;
//}
//
//createNewMenu->insertItem(i18n("Link to Device"), linkToDeviceMenu);
popup->insertItem(SmallIcon("filenew"), i18n("Create New"), createNewMenu);
popup->insertSeparator();
KAction* pasteAction = dolphin.actionCollection()->action(KStdAction::stdName(KStdAction::Paste));
pasteAction->plug(popup);
// setup 'View Mode' menu
KPopupMenu* viewModeMenu = new KPopupMenu();
KAction* iconsMode = dolphin.actionCollection()->action("icons");
iconsMode->plug(viewModeMenu);
KAction* detailsMode = dolphin.actionCollection()->action("details");
detailsMode->plug(viewModeMenu);
KAction* previewsMode = dolphin.actionCollection()->action("previews");
previewsMode->plug(viewModeMenu);
popup->insertItem(i18n("View Mode"), viewModeMenu);
popup->insertSeparator();
popup->insertItem(i18n("Bookmark this folder"), bookmarkID);
popup->insertSeparator();
popup->insertItem(i18n("Properties..."), propertiesID);
int id = popup->exec(m_pos);
if (id == propertiesID) {
new KPropertiesDialog(dolphin.activeView()->url());
}
else if (id == bookmarkID) {
const KURL& url = dolphin.activeView()->url();
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add folder as bookmark"),
url.filename(),
url,
"bookmark");
if (!bookmark.isNull()) {
KBookmarkManager* manager = DolphinSettings::instance().bookmarkManager();
KBookmarkGroup root = manager->root();
root.addBookmark(manager, bookmark);
manager->emitChanged(root);
}
}
popup->deleteLater();
}
void DolphinContextMenu::openItemContextMenu()
{
// Parts of the following code have been taken
// from the class KonqOperations located in
// libqonq/konq_operations.h of Konqueror.
// (Copyright (C) 2000 David Faure <faure@kde.org>)
assert(m_fileInfo != 0);
KPopupMenu* popup = new KPopupMenu(m_dolphinView);
Dolphin& dolphin = Dolphin::mainWin();
const KURL::List urls = m_dolphinView->selectedURLs();
// insert 'Cut', 'Copy' and 'Paste'
const KStdAction::StdAction actionNames[] = { KStdAction::Cut, KStdAction::Copy, KStdAction::Paste };
const int count = sizeof(actionNames) / sizeof(KStdAction::StdAction);
for (int i = 0; i < count; ++i) {
KAction* action = dolphin.actionCollection()->action(KStdAction::stdName(actionNames[i]));
if (action != 0) {
action->plug(popup);
}
}
popup->insertSeparator();
// insert 'Rename'
KAction* renameAction = dolphin.actionCollection()->action("rename");
renameAction->plug(popup);
// insert 'Move to Trash' for local URLs, otherwise insert 'Delete'
const KURL& url = dolphin.activeView()->url();
if (url.isLocalFile()) {
KAction* moveToTrashAction = dolphin.actionCollection()->action("move_to_trash");
moveToTrashAction->plug(popup);
}
else {
KAction* deleteAction = dolphin.actionCollection()->action("delete");
deleteAction->plug(popup);
}
// insert 'Bookmark this folder...' entry
// urls is a list of selected items, so insert boolmark menu if
// urls contains only one item, i.e. no multiple selection made
if (m_fileInfo->isDir() && (urls.count() == 1)) {
popup->insertItem(i18n("Bookmark this folder"), bookmarkID);
}
popup->insertSeparator();
// Insert 'Open With...' sub menu
Q3ValueVector<KService::Ptr> openWithVector;
const int openWithID = insertOpenWithItems(popup, openWithVector);
// Insert 'Actions' sub menu
Q3ValueVector<KDEDesktopMimeType::Service> actionsVector;
insertActionItems(popup, actionsVector);
// insert 'Properties...' entry
popup->insertSeparator();
KAction* propertiesAction = dolphin.actionCollection()->action("properties");
propertiesAction->plug(popup);
int id = popup->exec(m_pos);
if (id == bookmarkID) {
const KURL selectedURL(m_fileInfo->url());
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add folder as bookmark"),
selectedURL.filename(),
selectedURL,
"bookmark");
if (!bookmark.isNull()) {
KBookmarkManager* manager = DolphinSettings::instance().bookmarkManager();
KBookmarkGroup root = manager->root();
root.addBookmark(manager, bookmark);
manager->emitChanged(root);
}
}
else if (id >= actionsIDStart) {
// one of the 'Actions' items has been selected
KDEDesktopMimeType::executeService(urls, actionsVector[id - actionsIDStart]);
}
else if (id >= openWithIDStart) {
// one of the 'Open With' items has been selected
if (id == openWithID) {
// the item 'Other...' has been selected
KRun::displayOpenWithDialog(urls);
}
else {
KService::Ptr servicePtr = openWithVector[id - openWithIDStart];
KRun::run(*servicePtr, urls);
}
}
openWithVector.clear();
actionsVector.clear();
popup->deleteLater();
}
int DolphinContextMenu::insertOpenWithItems(KPopupMenu* popup,
Q3ValueVector<KService::Ptr>& openWithVector)
{
// Prepare 'Open With' sub menu. Usually a sub menu is created, where all applications
// are listed which are registered to open the item. As last entry "Other..." will be
// attached which allows to select a custom application. If no applications are registered
// no sub menu is created at all, only "Open With..." will be offered.
const KFileItemList* list = m_dolphinView->selectedItems();
assert(list != 0);
bool insertOpenWithItems = true;
const QString contextMimeType(m_fileInfo->mimetype());
KFileItemListIterator mimeIt(*list);
KFileItem* item = 0;
while (insertOpenWithItems && ((item = mimeIt.current()) != 0)) {
insertOpenWithItems = (contextMimeType == item->mimetype());
++mimeIt;
}
int openWithID = -1;
if (insertOpenWithItems) {
// fill the 'Open with' sub menu with application types
const KMimeType::Ptr mimePtr = KMimeType::findByURL(m_fileInfo->url());
KTrader::OfferList offers = KTrader::self()->query(mimePtr->name(),
"Type == 'Application'");
int index = openWithIDStart;
if (offers.count() > 0) {
KTrader::OfferList::Iterator it;
KPopupMenu* openWithMenu = new KPopupMenu();
for(it = offers.begin(); it != offers.end(); ++it) {
// The offer list from the KTrader returns duplicate
// application entries. Although this seems to be a configuration
// problem outside the scope of Dolphin, duplicated entries just
// will be skipped here.
const QString appName((*it)->name());
if (!containsEntry(openWithMenu, appName)) {
openWithMenu->insertItem((*it)->pixmap(KIcon::Small),
appName, index);
openWithVector.append(*it);
++index;
}
}
openWithMenu->insertSeparator();
openWithMenu->insertItem(i18n("&Other..."), index);
popup->insertItem(i18n("Open With"), openWithMenu);
}
else {
// No applications are registered, hence just offer
// a "Open With..." item instead of a sub menu containing
// only one entry.
popup->insertItem(i18n("Open With..."), openWithIDStart);
}
openWithID = index;
}
else {
// At least one of the selected items has a different MIME type. In this case
// just show a disabled "Open With..." entry.
popup->insertItem(i18n("Open With..."), openWithIDStart);
popup->setItemEnabled(openWithIDStart, false);
}
popup->setItemEnabled(openWithID, insertOpenWithItems);
return openWithID;
}
void DolphinContextMenu::insertActionItems(KPopupMenu* popup,
Q3ValueVector<KDEDesktopMimeType::Service>& actionsVector)
{
KPopupMenu* actionsMenu = new KPopupMenu();
int actionsIndex = 0;
QStringList dirs = KGlobal::dirs()->findDirs("data", "dolphin/servicemenus/");
KPopupMenu* menu = 0;
for (QStringList::ConstIterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) {
QDir dir(*dirIt);
QStringList entries = dir.entryList("*.desktop", QDir::Files);
for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
KSimpleConfig cfg(*dirIt + *entryIt, true);
cfg.setDesktopGroup();
if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
const QStringList types = cfg.readListEntry("ServiceTypes");
for (QStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
// check whether the mime type is equal or whether the
// mimegroup (e. g. image/*) is supported
bool insert = false;
if ((*it) == "all/allfiles") {
// The service type is valid for all files, but not for directories.
// Check whether the selected items only consist of files...
const KFileItemList* list = m_dolphinView->selectedItems();
assert(list != 0);
KFileItemListIterator mimeIt(*list);
KFileItem* item = 0;
insert = true;
while (insert && ((item = mimeIt.current()) != 0)) {
insert = !item->isDir();
++mimeIt;
}
}
if (!insert) {
// Check whether the MIME types of all selected files match
// to the mimetype of the service action. As soon as one MIME
// type does not match, no service menu is shown at all.
const KFileItemList* list = m_dolphinView->selectedItems();
assert(list != 0);
KFileItemListIterator mimeIt(*list);
KFileItem* item = 0;
insert = true;
while (insert && ((item = mimeIt.current()) != 0)) {
const QString mimeType((*mimeIt)->mimetype());
const QString mimeGroup(mimeType.left(mimeType.find('/')));
insert = (*it == mimeType) ||
((*it).right(1) == "*") &&
((*it).left((*it).find('/')) == mimeGroup);
++mimeIt;
}
}
if (insert) {
menu = actionsMenu;
const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
if (!submenuName.isEmpty()) {
menu = new KPopupMenu();
actionsMenu->insertItem(submenuName, menu, submenuID);
}
Q3ValueList<KDEDesktopMimeType::Service> userServices =
KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
Q3ValueList<KDEDesktopMimeType::Service>::Iterator serviceIt;
for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
KDEDesktopMimeType::Service service = (*serviceIt);
if (!service.m_strIcon.isEmpty()) {
menu->insertItem(SmallIcon(service.m_strIcon),
service.m_strName,
actionsIDStart + actionsIndex);
}
else {
menu->insertItem(service.m_strName,
actionsIDStart + actionsIndex);
}
actionsVector.append(service);
++actionsIndex;
}
}
}
}
}
}
const int itemsCount = actionsMenu->count();
if (itemsCount == 0) {
// no actions are available at all, hence show the "Actions"
// submenu disabled
actionsMenu->setEnabled(false);
}
if (itemsCount == 1) {
// Exactly one item is available. Instead of showing a sub menu with
// only one item, show the item directly in the root menu.
if (menu == actionsMenu) {
// The item is an action, hence show the action in the root menu.
const int id = actionsMenu->idAt(0);
const QString text(actionsMenu->text(id));
const QIcon* iconSet = actionsMenu->iconSet(id);
if (iconSet == 0) {
popup->insertItem(text, id);
}
else {
popup->insertItem(*iconSet, text, id);
}
}
else {
// The item is a sub menu, hence show the sub menu in the root menu.
popup->insertItem(actionsMenu->text(submenuID), menu);
}
actionsMenu->deleteLater();
actionsMenu = 0;
}
else {
popup->insertItem(i18n("Actions"), actionsMenu);
}
}
bool DolphinContextMenu::containsEntry(const KPopupMenu* menu,
const QString& entryName) const
{
assert(menu != 0);
const uint count = menu->count();
for (uint i = 0; i < count; ++i) {
const int id = menu->idAt(i);
if (menu->text(id) == entryName) {
return true;
}
}
return false;
}

128
src/dolphincontextmenu.h Normal file
View file

@ -0,0 +1,128 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINCONTEXTMENU_H
#define DOLPHINCONTEXTMENU_H
#include <qpoint.h>
#include <qstring.h>
#include <q3valuelist.h>
#include <kmountpoint.h>
#include <q3valuevector.h>
#include <kservice.h>
#include <kpropertiesdialog.h>
#include <kdedesktopmimetype.h>
class KPopupMenu;
class KFileItem;
class QPoint;
class QWidget;
class DolphinView;
/**
* @brief Represents the context menu which appears when doing a right
* click on an item or the viewport of the file manager.
*
* Beside static menu entries (e. g. 'Paste' or 'Properties') two
* dynamic sub menus are shown when opening a context menu above
* an item:
* - 'Open With': Contains all applications which are registered to
* open items of the given MIME type.
* - 'Actions': Contains all actions which can be applied to the
* given item.
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class DolphinContextMenu
{
public:
/**
* @parent Pointer to the dolphin view the context menu
* belongs to.
* @fileInfo Pointer to the file item the context menu
* is applied. If 0 is passed, the context menu
* is above the viewport.
* @pos Position of the upper left edge of the context menu.
*/
DolphinContextMenu(DolphinView* parent,
KFileItem* fileInfo,
const QPoint& pos);
virtual ~DolphinContextMenu();
/** Opens the context menu modal. */
void open();
private:
void openViewportContextMenu();
void openItemContextMenu();
/**
* Inserts the 'Open With...' submenu to \a popup.
* @param popup Menu where the 'Open With...' sub menu should
* be added.
* @param openWithVector Output parameter which contains all 'Open with...'
* services.
* @return Identifier of the first 'Open With...' entry.
* All succeeding identifiers have an increased value of 1
* to the predecessor.
*/
int insertOpenWithItems(KPopupMenu* popup,
Q3ValueVector<KService::Ptr>& openWithVector);
/**
* Inserts the 'Actions...' submenu to \a popup.
* @param popup Menu where the 'Actions...' sub menu should
* be added.
* @param openWithVector Output parameter which contains all 'Actions...'
* services.
*/
void insertActionItems(KPopupMenu* popup,
Q3ValueVector<KDEDesktopMimeType::Service>& actionsVector);
/**
* Returns true, if 'menu' contains already
* an entry with the name 'entryName'.
*/
bool containsEntry(const KPopupMenu* menu,
const QString& entryName) const;
enum {
submenuID = 90,
bookmarkID = 91,
openWithIDStart = 100,
actionsIDStart = 1000,
};
DolphinView* m_dolphinView;
KFileItem* m_fileInfo;
QPoint m_pos;
struct Entry {
int type;
QString name;
QString filePath; // empty for separator
QString templatePath; // same as filePath for template
QString icon;
QString comment;
};
};
#endif

815
src/dolphindetailsview.cpp Normal file
View file

@ -0,0 +1,815 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphindetailsview.h"
#include <kurldrag.h>
#include <qpainter.h>
#include <qobject.h>
#include <q3header.h>
#include <qclipboard.h>
#include <qpainter.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <QPixmap>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QResizeEvent>
#include <QMouseEvent>
#include <QEvent>
#include <QPaintEvent>
#include <klocale.h>
#include <kglobalsettings.h>
#include <qscrollbar.h>
#include <qcursor.h>
#include <qstyle.h>
#include <assert.h>
#include "dolphinview.h"
#include "viewproperties.h"
#include "dolphin.h"
#include "kiconeffect.h"
#include "dolphinsettings.h"
#include "dolphinstatusbar.h"
#include "detailsmodesettings.h"
DolphinDetailsView::DolphinDetailsView(DolphinView* parent) :
KFileDetailView(parent, 0),
m_dolphinView(parent),
m_resizeTimer(0),
m_scrollTimer(0),
m_rubber(0)
{
m_resizeTimer = new QTimer(this);
connect(m_resizeTimer, SIGNAL(timeout()),
this, SLOT(updateColumnsWidth()));
setAcceptDrops(true);
setSelectionMode(KFile::Extended);
setHScrollBarMode(Q3ScrollView::AlwaysOff);
setColumnAlignment(SizeColumn, Qt::AlignRight);
for (int i = DateColumn; i <= GroupColumn; ++i) {
setColumnAlignment(i, Qt::AlignHCenter);
}
Dolphin& dolphin = Dolphin::mainWin();
connect(this, SIGNAL(onItem(Q3ListViewItem*)),
this, SLOT(slotOnItem(Q3ListViewItem*)));
connect(this, SIGNAL(onViewport()),
this, SLOT(slotOnViewport()));
connect(this, SIGNAL(contextMenuRequested(Q3ListViewItem*, const QPoint&, int)),
this, SLOT(slotContextMenuRequested(Q3ListViewItem*, const QPoint&, int)));
connect(this, SIGNAL(selectionChanged()),
&dolphin, SLOT(slotSelectionChanged()));
connect(&dolphin, SIGNAL(activeViewChanged()),
this, SLOT(slotActivationUpdate()));
connect(this, SIGNAL(itemRenamed(Q3ListViewItem*, const QString&, int)),
this, SLOT(slotItemRenamed(Q3ListViewItem*, const QString&, int)));
connect(this, SIGNAL(dropped(QDropEvent*, const KURL::List&, const KURL&)),
parent, SLOT(slotURLListDropped(QDropEvent*, const KURL::List&, const KURL&)));
QClipboard* clipboard = QApplication::clipboard();
connect(clipboard, SIGNAL(dataChanged()),
this, SLOT(slotUpdateDisabledItems()));
Q3Header* viewHeader = header();
viewHeader->setResizeEnabled(false);
viewHeader->setMovingEnabled(false);
connect(viewHeader, SIGNAL(clicked(int)),
this, SLOT(slotHeaderClicked(int)));
setMouseTracking(true);
setDefaultRenameAction(Q3ListView::Accept);
refreshSettings();
}
DolphinDetailsView::~DolphinDetailsView()
{
delete m_rubber;
m_rubber = 0;
}
void DolphinDetailsView::beginItemUpdates()
{
}
void DolphinDetailsView::endItemUpdates()
{
updateDisabledItems();
// Restore the current item. Use the information stored in the history if
// available. Otherwise use the first item as current item.
const KFileListViewItem* item = static_cast<const KFileListViewItem*>(firstChild());
if (item != 0) {
setCurrentItem(item->fileInfo());
}
int index = 0;
const Q3ValueList<URLNavigator::HistoryElem> history = m_dolphinView->urlHistory(index);
if (!history.isEmpty()) {
KFileView* fileView = static_cast<KFileView*>(this);
fileView->setCurrentItem(history[index].currentFileName());
setContentsPos(history[index].contentsX(), history[index].contentsY());
}
updateColumnsWidth();
}
void DolphinDetailsView::insertItem(KFileItem* fileItem)
{
KFileView::insertItem(fileItem);
DolphinListViewItem* item = new DolphinListViewItem(static_cast<Q3ListView*>(this), fileItem);
QDir::SortSpec spec = KFileView::sorting();
if (spec & QDir::Time) {
item->setKey(sortingKey(fileItem->time(KIO::UDS_MODIFICATION_TIME),
fileItem->isDir(),
spec));
}
else if (spec & QDir::Size) {
item->setKey(sortingKey(fileItem->size(), fileItem->isDir(), spec));
}
else {
item->setKey(sortingKey(fileItem->text(), fileItem->isDir(), spec));
}
fileItem->setExtraData(this, item);
}
bool DolphinDetailsView::isOnFilename(const Q3ListViewItem* item, const QPoint& pos) const
{
const QPoint absPos(mapToGlobal(QPoint(0, 0)));
return (pos.x() - absPos.x()) <= filenameWidth(item);
}
void DolphinDetailsView::refreshSettings()
{
const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
assert(settings != 0);
if (!settings->showGroup()) {
removeColumn(GroupColumn);
}
if (!settings->showOwner()) {
removeColumn(OwnerColumn);
}
if (!settings->showPermissions()) {
removeColumn(PermissionsColumn);
}
if (!settings->showDate()) {
removeColumn(DateColumn);
}
QFont adjustedFont(font());
adjustedFont.setFamily(settings->fontFamily());
adjustedFont.setPointSize(settings->fontSize());
setFont(adjustedFont);
updateView(true);
}
void DolphinDetailsView::zoomIn()
{
if (isZoomInPossible()) {
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
switch (settings->iconSize()) {
case KIcon::SizeSmall: settings->setIconSize(KIcon::SizeMedium); break;
case KIcon::SizeMedium: settings->setIconSize(KIcon::SizeLarge); break;
default: assert(false); break;
}
ItemEffectsManager::zoomIn();
}
}
void DolphinDetailsView::zoomOut()
{
if (isZoomOutPossible()) {
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
switch (settings->iconSize()) {
case KIcon::SizeLarge: settings->setIconSize(KIcon::SizeMedium); break;
case KIcon::SizeMedium: settings->setIconSize(KIcon::SizeSmall); break;
default: assert(false); break;
}
ItemEffectsManager::zoomOut();
}
}
bool DolphinDetailsView::isZoomInPossible() const
{
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
return settings->iconSize() < KIcon::SizeLarge;
}
bool DolphinDetailsView::isZoomOutPossible() const
{
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
return settings->iconSize() > KIcon::SizeSmall;
}
void DolphinDetailsView::resizeContents(int width, int height)
{
KFileDetailView::resizeContents(width, height);
// When loading several 1000 items a punch of resize events
// drops in. As updating the column width is a quite expensive
// operation, this operation will be postponed until there is
// no resize event for at least 50 milliseconds.
m_resizeTimer->stop();
m_resizeTimer->start(50, true);
}
void DolphinDetailsView::slotOnItem(Q3ListViewItem* item)
{
if (isOnFilename(item, QCursor::pos())) {
activateItem(item);
KFileItem* fileItem = static_cast<KFileListViewItem*>(item)->fileInfo();
m_dolphinView->requestItemInfo(fileItem->url());
}
else {
resetActivatedItem();
}
}
void DolphinDetailsView::slotOnViewport()
{
resetActivatedItem();
m_dolphinView->requestItemInfo(KURL());
}
void DolphinDetailsView::setContextPixmap(void* context,
const QPixmap& pixmap)
{
reinterpret_cast<KFileListViewItem*>(context)->setPixmap(0, pixmap);
}
const QPixmap* DolphinDetailsView::contextPixmap(void* context)
{
return reinterpret_cast<KFileListViewItem*>(context)->pixmap(0);
}
void* DolphinDetailsView::firstContext()
{
return reinterpret_cast<void*>(firstChild());
}
void* DolphinDetailsView::nextContext(void* context)
{
KFileListViewItem* listViewItem = reinterpret_cast<KFileListViewItem*>(context);
return reinterpret_cast<void*>(listViewItem->nextSibling());
}
KFileItem* DolphinDetailsView::contextFileInfo(void* context)
{
return reinterpret_cast<KFileListViewItem*>(context)->fileInfo();
}
void DolphinDetailsView::contentsDragMoveEvent(QDragMoveEvent* event)
{
KFileDetailView::contentsDragMoveEvent(event);
// If a dragging is done above a directory, show the icon as 'active' for
// a visual feedback
KFileListViewItem* item = static_cast<KFileListViewItem*>(itemAt(event->pos()));
bool showActive = false;
if (item != 0) {
const KFileItem* fileInfo = item->fileInfo();
showActive = (fileInfo != 0) && fileInfo->isDir();
}
if (showActive) {
slotOnItem(item);
}
else {
slotOnViewport();
}
}
void DolphinDetailsView::resizeEvent(QResizeEvent* event)
{
KFileDetailView::resizeEvent(event);
// When loading several 1000 items a punch of resize events
// drops in. As updating the column width is a quite expensive
// operation, this operation will be postponed until there is
// no resize event for at least 50 milliseconds.
m_resizeTimer->stop();
m_resizeTimer->start(50, true);
}
bool DolphinDetailsView::acceptDrag(QDropEvent* event) const
{
bool accept = KURLDrag::canDecode(event) &&
(event->action() == QDropEvent::Copy ||
event->action() == QDropEvent::Move ||
event->action() == QDropEvent::Link);
if (accept) {
if (static_cast<const QWidget*>(event->source()) == this) {
KFileListViewItem* item = static_cast<KFileListViewItem*>(itemAt(event->pos()));
accept = (item != 0);
if (accept) {
KFileItem* fileItem = item->fileInfo();
accept = fileItem->isDir();
}
}
}
return accept;
}
void DolphinDetailsView::contentsDropEvent(QDropEvent* event)
{
// KFileDetailView::contentsDropEvent does not care whether the mouse
// cursor is above a filename or not, the destination URL is always
// the URL of the item. This is fixed here in a way that the destination
// URL is only the URL of the item if the cursor is above the filename.
const QPoint pos(QCursor::pos());
const QPoint viewportPos(viewport()->mapToGlobal(QPoint(0, 0)));
Q3ListViewItem* item = itemAt(QPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
if ((item == 0) || ((item != 0) && isOnFilename(item, pos))) {
// dropping is done on the viewport or directly above a filename
KFileDetailView::contentsDropEvent(event);
return;
}
// Dropping is done above an item, but the mouse cursor is not above the file name.
// In this case the signals of the base implementation will be blocked and send
// in a corrected manner afterwards.
assert(item != 0);
const bool block = signalsBlocked();
blockSignals(true);
KFileDetailView::contentsDropEvent(event);
blockSignals(block);
if (!acceptDrag(event)) {
return;
}
emit dropped(event, 0);
KURL::List urls;
if (KURLDrag::decode(event, urls) && !urls.isEmpty()) {
emit dropped(event, urls, KURL());
sig->dropURLs(0, event, urls);
}
}
void DolphinDetailsView::contentsMousePressEvent(QMouseEvent* event)
{
if (m_rubber != 0) {
drawRubber();
delete m_rubber;
m_rubber = 0;
}
// Swallow the base implementation of the mouse press event
// if the mouse cursor is not above the filename. This prevents
// that the item gets selected and simulates an equal usability
// like in the icon view.
const QPoint pos(QCursor::pos());
const QPoint viewportPos(viewport()->mapToGlobal(QPoint(0, 0)));
Q3ListViewItem* item = itemAt(QPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
if ((item != 0) && isOnFilename(item, pos)) {
KFileDetailView::contentsMousePressEvent(event);
}
else if (event->button() == Qt::LeftButton) {
const ButtonState keyboardState = KApplication::keyboardMouseState();
const bool isSelectionActive = (keyboardState & ShiftButton) ||
(keyboardState & ControlButton);
if (!isSelectionActive) {
clearSelection();
}
assert(m_rubber == 0);
m_rubber = new QRect(event->x(), event->y(), 0, 0);
}
resetActivatedItem();
emit signalRequestActivation();
m_dolphinView->statusBar()->clear();
}
void DolphinDetailsView::contentsMouseMoveEvent(QMouseEvent* event)
{
if (m_rubber != 0) {
slotAutoScroll();
return;
}
KFileDetailView::contentsMouseMoveEvent(event);
const QPoint& pos = event->globalPos();
const QPoint viewportPos = viewport()->mapToGlobal(QPoint(0, 0));
Q3ListViewItem* item = itemAt(QPoint(pos.x() - viewportPos.x(), pos.y() - viewportPos.y()));
if ((item != 0) && isOnFilename(item, pos)) {
activateItem(item);
}
else {
resetActivatedItem();
}
}
void DolphinDetailsView::contentsMouseReleaseEvent(QMouseEvent* event)
{
if (m_rubber != 0) {
drawRubber();
delete m_rubber;
m_rubber = 0;
}
if (m_scrollTimer != 0) {
disconnect(m_scrollTimer, SIGNAL(timeout()),
this, SLOT(slotAutoScroll()));
m_scrollTimer->stop();
delete m_scrollTimer;
m_scrollTimer = 0;
}
KFileDetailView::contentsMouseReleaseEvent(event);
}
void DolphinDetailsView::paintEmptyArea(QPainter* painter, const QRect& rect)
{
if (m_dolphinView->isActive()) {
KFileDetailView::paintEmptyArea(painter, rect);
}
else {
const QBrush brush(colorGroup().background());
painter->fillRect(rect, brush);
}
}
void DolphinDetailsView::drawRubber()
{
// Parts of the following code have been taken
// from the class KonqBaseListViewWidget located in
// konqueror/listview/konq_listviewwidget.h of Konqueror.
// (Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
// 2001, 2002, 2004 Michael Brade <brade@kde.org>)
if (m_rubber == 0) {
return;
}
QPainter p;
p.begin(viewport());
p.setRasterOp(NotROP);
p.setPen(QPen(color0, 1));
p.setBrush(NoBrush);
QPoint point(m_rubber->x(), m_rubber->y());
point = contentsToViewport(point);
style().drawPrimitive(QStyle::PE_FocusRect, &p,
QRect(point.x(), point.y(), m_rubber->width(), m_rubber->height()),
colorGroup(), QStyle::Style_Default, colorGroup().base());
p.end();
}
void DolphinDetailsView::viewportPaintEvent(QPaintEvent* paintEvent)
{
drawRubber();
KFileDetailView::viewportPaintEvent(paintEvent);
drawRubber();
}
void DolphinDetailsView::leaveEvent(QEvent* event)
{
KFileDetailView::leaveEvent(event);
slotOnViewport();
}
void DolphinDetailsView::slotActivationUpdate()
{
update();
// TODO: there must be a simpler way to say
// "update all children"
const QObjectList* list = children();
if (list == 0) {
return;
}
QObjectListIterator it(*list);
QObject* object = 0;
while ((object = it.current()) != 0) {
if (object->inherits("QWidget")) {
QWidget* widget = static_cast<QWidget*>(object);
widget->update();
}
++it;
}
}
void DolphinDetailsView::slotContextMenuRequested(Q3ListViewItem* item,
const QPoint& pos,
int /* col */)
{
KFileItem* fileInfo = 0;
if ((item != 0) && isOnFilename(item, pos)) {
fileInfo = static_cast<KFileListViewItem*>(item)->fileInfo();
}
m_dolphinView->openContextMenu(fileInfo, pos);
}
void DolphinDetailsView::slotUpdateDisabledItems()
{
updateDisabledItems();
}
void DolphinDetailsView::slotAutoScroll()
{
// Parts of the following code have been taken
// from the class KonqBaseListViewWidget located in
// konqueror/listview/konq_listviewwidget.h of Konqueror.
// (Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
// 2001, 2002, 2004 Michael Brade <brade@kde.org>)
const QPoint pos(viewport()->mapFromGlobal(QCursor::pos()));
const QPoint vc(viewportToContents(pos));
if (vc == m_rubber->bottomRight()) {
return;
}
drawRubber();
m_rubber->setBottomRight(vc);
Q3ListViewItem* item = itemAt(QPoint(0,0));
const bool block = signalsBlocked();
blockSignals(true);
const QRect rubber(m_rubber->normalize());
const int bottom = contentsY() + visibleHeight() - 1;
// select all items which intersect with the rubber, deselect all others
bool bottomReached = false;
while ((item != 0) && !bottomReached) {
QRect rect(itemRect(item));
rect.setWidth(filenameWidth(item));
rect = QRect(viewportToContents(rect.topLeft()),
viewportToContents(rect.bottomRight()));
if (rect.isValid() && (rect.top() <= bottom)) {
const KFileItem* fileItem = static_cast<KFileListViewItem*>(item)->fileInfo();
setSelected(fileItem, rect.intersects(rubber));
item = item->itemBelow();
}
else {
bottomReached = true;
}
}
blockSignals(block);
emit selectionChanged();
drawRubber();
// scroll the viewport if the top or bottom margin is reached
const int scrollMargin = 40;
ensureVisible(vc.x(), vc.y(), scrollMargin, scrollMargin);
const bool scroll = !QRect(scrollMargin,
scrollMargin,
viewport()->width() - 2 * scrollMargin,
viewport()->height() - 2 * scrollMargin).contains(pos);
if (scroll) {
if (m_scrollTimer == 0) {
m_scrollTimer = new QTimer( this );
connect(m_scrollTimer, SIGNAL(timeout()),
this, SLOT(slotAutoScroll()));
m_scrollTimer->start(100, false);
}
}
else if (m_scrollTimer != 0) {
disconnect(m_scrollTimer, SIGNAL(timeout()),
this, SLOT(slotAutoScroll()));
m_scrollTimer->stop();
delete m_scrollTimer;
m_scrollTimer = 0;
}
}
void DolphinDetailsView::updateColumnsWidth()
{
const int columnCount = columns();
int requiredWidth = 0;
for (int i = 1; i < columnCount; ++i) {
// When a directory contains no items, a minimum width for
// the column must be available, so that the header is readable.
// TODO: use header data instead of the hardcoded 64 value...
int columnWidth = 64;
QFontMetrics fontMetrics(font());
for (Q3ListViewItem* item = firstChild(); item != 0; item = item->nextSibling()) {
const int width = item->width(fontMetrics, this, i);
if (width > columnWidth) {
columnWidth = width;
}
}
columnWidth += 16; // add custom margin
setColumnWidth(i, columnWidth);
requiredWidth += columnWidth;
}
// resize the first column in a way that the
// whole available width is used
int firstColumnWidth = visibleWidth() - requiredWidth;
if (firstColumnWidth < 128) {
firstColumnWidth = 128;
}
setColumnWidth(0, firstColumnWidth);
}
void DolphinDetailsView::slotItemRenamed(Q3ListViewItem* item,
const QString& name,
int /* column */)
{
KFileItem* fileInfo = static_cast<KFileListViewItem*>(item)->fileInfo();
m_dolphinView->rename(KURL(fileInfo->url()), name);
}
void DolphinDetailsView::slotHeaderClicked(int /* section */)
{
// The sorting has already been changed in QListView if this slot is
// invoked, but Dolphin was not informed about this (no signal is available
// which indicates a change of the sorting). This is bypassed by changing
// the sorting and sort order to a temporary other value and readjust it again.
const int column = sortColumn();
if (column <= DateColumn) {
DolphinView::Sorting sorting = DolphinView::SortByName;
switch (column) {
case SizeColumn: sorting = DolphinView::SortBySize; break;
case DateColumn: sorting = DolphinView::SortByDate; break;
case NameColumn:
default: break;
}
const Qt::SortOrder currSortOrder = sortOrder();
// temporary adjust the sorting and sort order to different values...
const DolphinView::Sorting tempSorting = (sorting == DolphinView::SortByName) ?
DolphinView::SortBySize :
DolphinView::SortByName;
m_dolphinView->setSorting(tempSorting);
const Qt::SortOrder tempSortOrder = (currSortOrder == Qt::Ascending) ?
Qt::Descending : Qt::Ascending;
m_dolphinView->setSortOrder(tempSortOrder);
// ... so that setting them again results in storing the new setting.
m_dolphinView->setSorting(sorting);
m_dolphinView->setSortOrder(currSortOrder);
}
}
DolphinDetailsView::DolphinListViewItem::DolphinListViewItem(Q3ListView* parent,
KFileItem* fileItem) :
KFileListViewItem(parent, fileItem)
{
const int iconSize = DolphinSettings::instance().detailsModeSettings()->iconSize();
KFileItem* info = fileInfo();
setPixmap(DolphinDetailsView::NameColumn, info->pixmap(iconSize));
// The base class KFileListViewItem represents the column 'Size' only as byte values.
// Adjust those values in a way that a mapping to GBytes, MBytes, KBytes and Bytes
// is done. As the file size for directories is useless (only the size of the directory i-node
// is given), it is removed completely.
if (fileItem->isDir()) {
setText(SizeColumn, " - ");
}
else {
QString sizeText(KIO::convertSize(fileItem->size()));
sizeText.append(" ");
setText(SizeColumn, sizeText);
}
// Dolphin allows to remove specific columns, but the base class KFileListViewItem
// is not aware about this (or at least the class KFileDetailView does not react on
// QListView::remove()). Therefore the columns are rearranged here.
const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
assert(settings != 0);
int column_idx = DateColumn; // the columns for 'name' and 'size' cannot get removed
for (int i = DolphinDetailsView::DateColumn; i <= DolphinDetailsView::GroupColumn; ++i) {
if (column_idx < i) {
setText(column_idx, text(i));
}
bool inc = false;
switch (i) {
case DateColumn: inc = settings->showDate(); break;
case PermissionsColumn: inc = settings->showPermissions(); break;
case OwnerColumn: inc = settings->showOwner(); break;
case GroupColumn: inc = settings->showGroup(); break;
default: break;
}
if (inc) {
++column_idx;
}
}
}
DolphinDetailsView::DolphinListViewItem::~DolphinListViewItem()
{
}
void DolphinDetailsView::DolphinListViewItem::paintCell(QPainter* painter,
const QColorGroup& colorGroup,
int column,
int cellWidth,
int alignment)
{
const Q3ListView* view = listView();
const bool isActive = view->parent() == Dolphin::mainWin().activeView();
if (isSelected()) {
// Per default the selection is drawn above the whole width of the item. As a consistent
// behavior with the icon view is wanted, only the the column containing the file name
// should be shown as selected.
QColorGroup defaultColorGroup(colorGroup);
const QColor highlightColor(isActive ? backgroundColor(column) : view->colorGroup().background());
defaultColorGroup.setColor(QColorGroup::Highlight , highlightColor);
defaultColorGroup.setColor(QColorGroup::HighlightedText, colorGroup.color(QColorGroup::Text));
KFileListViewItem::paintCell(painter, defaultColorGroup, column, cellWidth, alignment);
if (column == 0) {
// draw the selection only on the first column
Q3ListView* parent = listView();
const int itemWidth = width(parent->fontMetrics(), parent, 0);
if (isActive) {
KFileListViewItem::paintCell(painter, colorGroup, column, itemWidth, alignment);
}
else {
Q3ListViewItem::paintCell(painter, colorGroup, column, itemWidth, alignment);
}
}
}
else {
if (isActive) {
KFileListViewItem::paintCell(painter, colorGroup, column, cellWidth, alignment);
}
else {
Q3ListViewItem::paintCell(painter, colorGroup, column, cellWidth, alignment);
}
}
if (column < listView()->columns() - 1) {
// draw a separator between columns
painter->setPen(KGlobalSettings::buttonBackground());
painter->drawLine(cellWidth - 1, 0, cellWidth - 1, height() - 1);
}
}
void DolphinDetailsView::DolphinListViewItem::paintFocus(QPainter* painter,
const QColorGroup& colorGroup,
const QRect& rect)
{
// draw the focus consistently with the selection (see implementation notes
// in DolphinListViewItem::paintCell)
Q3ListView* parent = listView();
int visibleWidth = width(parent->fontMetrics(), parent, 0);
const int colWidth = parent->columnWidth(0);
if (visibleWidth > colWidth) {
visibleWidth = colWidth;
}
QRect focusRect(rect);
focusRect.setWidth(visibleWidth);
KFileListViewItem::paintFocus(painter, colorGroup, focusRect);
}
int DolphinDetailsView::filenameWidth(const Q3ListViewItem* item) const
{
assert(item != 0);
int visibleWidth = item->width(fontMetrics(), this, 0);
const int colWidth = columnWidth(0);
if (visibleWidth > colWidth) {
visibleWidth = colWidth;
}
return visibleWidth;
}
#include "dolphindetailsview.moc"

224
src/dolphindetailsview.h Normal file
View file

@ -0,0 +1,224 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINDETAILSVIEW_H
#define DOLPHINDETAILSVIEW_H
#include <kfiledetailview.h>
#include <itemeffectsmanager.h>
//Added by qt3to4:
#include <QPixmap>
#include <QResizeEvent>
#include <QEvent>
#include <QDropEvent>
#include <QMouseEvent>
#include <QDragMoveEvent>
#include <QPaintEvent>
class QRect;
class QTimer;
class DolphinView;
/**
* @brief Represents the details view which shows the name, size,
* date, permissions, owner and group of an item.
*
* The width of the columns are automatically adjusted in a way
* that full available width of the view is used by stretching the width
* of the name column.
*
* @author Peter Penz
*/
class DolphinDetailsView : public KFileDetailView, public ItemEffectsManager
{
Q_OBJECT
public:
/**
* Maps the column indices of KFileDetailView to a
* descriptive column name.
*/
enum ColumnName {
NameColumn = 0,
SizeColumn = 1,
DateColumn = 2,
PermissionsColumn = 3,
OwnerColumn = 4,
GroupColumn = 5
};
DolphinDetailsView(DolphinView* parent);
virtual ~DolphinDetailsView();
/** @see ItemEffectsManager::updateItems */
virtual void beginItemUpdates();
/** @see ItemEffectsManager::updateItems */
virtual void endItemUpdates();
/** @see KFileView::insertItem */
virtual void insertItem(KFileItem* fileItem);
/**
* @return True, if the position \a pos is above the name of
* item \a item.
*/
bool isOnFilename(const Q3ListViewItem* item, const QPoint& pos) const;
/**
* Reads out the dolphin settings for the details view and refreshs
* the details view.
*/
// TODO: Other view implementations use a similar interface. When using
// Interview in Qt4 this method should be moved to a base class (currently
// not possible due to having different base classes for the views).
void refreshSettings();
/** @see ItemEffectsManager::zoomIn() */
virtual void zoomIn();
/** @see ItemEffectsManager::zoomOut() */
virtual void zoomOut();
/** @see ItemEffectsManager::isZoomInPossible() */
virtual bool isZoomInPossible() const;
/** @see ItemEffectsManager::isZoomOutPossible() */
virtual bool isZoomOutPossible() const;
signals:
/**
* Is send, if the details view should be activated. Usually an activation
* is triggered by a mouse click.
*/
void signalRequestActivation();
public slots:
/** @see KFileDetailView::resizeContents */
virtual void resizeContents(int width, int height);
/** Is connected to the onItem-signal from KFileDetailView. */
void slotOnItem(Q3ListViewItem* item);
/** Is connected to the onViewport-signal from KFileDetailView. */
void slotOnViewport();
protected:
/** @see ItemEffectsManager::setContextPixmap() */
virtual void setContextPixmap(void* context,
const QPixmap& pixmap);
/** @see ItemEffectsManager::setContextPixmap() */
virtual const QPixmap* contextPixmap(void* context);
/** @see ItemEffectsManager::setContextPixmap() */
virtual void* firstContext();
/** @see ItemEffectsManager::setContextPixmap() */
virtual void* nextContext(void* context);
/** @see ItemEffectsManager::setContextPixmap() */
virtual KFileItem* contextFileInfo(void* context);
/** @see KFileDetailView::contentsDragMoveEvent() */
virtual void contentsDragMoveEvent(QDragMoveEvent* event);
/** @see KFileDetailView::resizeEvent() */
virtual void resizeEvent(QResizeEvent* event);
/** @see KFileDetailView::acceptDrag() */
virtual bool acceptDrag (QDropEvent* event) const;
/** @see KFileDetailView::contentsDropEvent() */
virtual void contentsDropEvent(QDropEvent* event);
/** @see KFileDetailView::contentsMousePressEvent() */
virtual void contentsMousePressEvent(QMouseEvent* event);
/** @see KFileDetailView::contentsMouseMoveEvent() */
virtual void contentsMouseMoveEvent(QMouseEvent* event);
/** @see KFileDetailView::contentsMouseReleaseEvent() */
virtual void contentsMouseReleaseEvent(QMouseEvent* event);
/** @see QListView::paintEmptyArea() */
virtual void paintEmptyArea(QPainter* painter, const QRect& rect);
/** Draws the selection rubber. */
void drawRubber();
/** @see QListView::viewportPaintEvent() */
virtual void viewportPaintEvent(QPaintEvent* paintEvent);
/** @see QWidget::leaveEvent() */
virtual void leaveEvent(QEvent* event);
private slots:
void slotActivationUpdate();
void slotContextMenuRequested(Q3ListViewItem* item,
const QPoint& pos,
int col);
void slotUpdateDisabledItems();
void slotAutoScroll();
void updateColumnsWidth();
void slotItemRenamed(Q3ListViewItem* item,
const QString& name,
int column);
/**
* Is invoked when a section from the header has
* been clicked and stores the sort column and sort
* order.
*/
void slotHeaderClicked(int section);
private:
class DolphinListViewItem : public KFileListViewItem {
public:
DolphinListViewItem(Q3ListView* parent,
KFileItem* fileItem);
virtual ~DolphinListViewItem();
virtual void paintCell(QPainter* painter,
const QColorGroup& colorGroup,
int column,
int cellWidth,
int alignment);
virtual void paintFocus(QPainter* painter,
const QColorGroup& colorGroup,
const QRect& rect);
};
DolphinView* m_dolphinView;
QTimer* m_resizeTimer;
QTimer* m_scrollTimer;
QRect* m_rubber;
/**
* Returns the width of the filename in pixels including
* the icon. It is assured that the returned width is
* <= the width of the filename column.
*/
int filenameWidth(const Q3ListViewItem* item) const;
};
#endif

42
src/dolphindirlister.cpp Normal file
View file

@ -0,0 +1,42 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphindirlister.h"
#include <kio/jobclasses.h>
// TODO:
#include <stdio.h>
DolphinDirLister::DolphinDirLister() :
KDirLister(true)
{
}
DolphinDirLister::~DolphinDirLister()
{
}
void DolphinDirLister::handleError(KIO::Job* job)
{
// TODO: some error texts should be adjusted manually
emit errorMessage(job->errorString());
}
#include "dolphindirlister.moc"

48
src/dolphindirlister.h Normal file
View file

@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINDIRLISTER_H
#define DOLPHINDIRLISTER_H
#include <kdirlister.h>
/**
* @brief Extends the class KDirLister by emitting an error
* signal containing text.
*
* @author Peter Penz
*/
class DolphinDirLister : public KDirLister
{
Q_OBJECT
public:
DolphinDirLister();
virtual ~DolphinDirLister();
signals:
/** Is emitted whenever an error occured. */
void errorMessage(const QString& msg);
protected:
virtual void handleError(KIO::Job* job);
};
#endif

509
src/dolphiniconsview.cpp Normal file
View file

@ -0,0 +1,509 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphiniconsview.h"
#include <qpainter.h>
//Added by qt3to4:
#include <QDragMoveEvent>
#include <QDropEvent>
#include <Q3ValueList>
#include <QPixmap>
#include <QMouseEvent>
#include <QDragEnterEvent>
#include <kiconeffect.h>
#include <kapplication.h>
#include <qobject.h>
#include <kglobalsettings.h>
#include <kurldrag.h>
#include <qclipboard.h>
#include <assert.h>
#include <kaction.h>
#include <kstdaction.h>
#include <kfileitem.h>
#include "dolphinview.h"
#include "viewproperties.h"
#include "dolphin.h"
#include "dolphinstatusbar.h"
#include "dolphinsettings.h"
#include "iconsmodesettings.h"
DolphinIconsView::DolphinIconsView(DolphinView* parent, LayoutMode layoutMode) :
KFileIconView(parent, 0),
m_previewIconSize(-1),
m_layoutMode(layoutMode),
m_dolphinView(parent)
{
setAcceptDrops(true);
setMode(KIconView::Execute);
setSelectionMode(KFile::Extended);
Dolphin& dolphin = Dolphin::mainWin();
connect(this, SIGNAL(onItem(Q3IconViewItem*)),
this, SLOT(slotOnItem(Q3IconViewItem*)));
connect(this, SIGNAL(onViewport()),
this, SLOT(slotOnViewport()));
connect(this, SIGNAL(contextMenuRequested(Q3IconViewItem*, const QPoint&)),
this, SLOT(slotContextMenuRequested(Q3IconViewItem*, const QPoint&)));
connect(this, SIGNAL(selectionChanged()),
&dolphin, SLOT(slotSelectionChanged()));
connect(&dolphin, SIGNAL(activeViewChanged()),
this, SLOT(slotActivationUpdate()));
connect(this, SIGNAL(itemRenamed(Q3IconViewItem*, const QString&)),
this, SLOT(slotItemRenamed(Q3IconViewItem*, const QString&)));
connect(this, SIGNAL(dropped(QDropEvent*, const KURL::List&, const KURL&)),
parent, SLOT(slotURLListDropped(QDropEvent*, const KURL::List&, const KURL&)));
QClipboard* clipboard = QApplication::clipboard();
connect(clipboard, SIGNAL(dataChanged()),
this, SLOT(slotUpdateDisabledItems()));
// KFileIconView creates two actions for zooming, which are directly connected to the
// slots KFileIconView::zoomIn() and KFileIconView::zoomOut(). As this behavior is not
// wanted and the slots are not virtual, the actions are disabled here.
KAction* zoomInAction = actionCollection()->action("zoomIn");
assert(zoomInAction != 0);
zoomInAction->setEnabled(false);
KAction* zoomOutAction = actionCollection()->action("zoomOut");
assert(zoomOutAction != 0);
zoomOutAction->setEnabled(false);
setItemsMovable(true);
setWordWrapIconText(true);
if (m_layoutMode == Previews) {
showPreviews();
}
refreshSettings();
}
DolphinIconsView::~DolphinIconsView()
{
}
void DolphinIconsView::setLayoutMode(LayoutMode mode)
{
if (m_layoutMode != mode) {
m_layoutMode = mode;
refreshSettings();
}
}
void DolphinIconsView::beginItemUpdates()
{
}
void DolphinIconsView::endItemUpdates()
{
arrangeItemsInGrid();
// TODO: KFileIconView does not emit any signal when the preview
// has been finished. Using a delay of 300 ms is a temporary workaround
// until the DolphinIconsView will implement the previews by it's own in
// future releases.
QTimer::singleShot(300, this, SLOT(slotUpdateDisabledItems()));
const KFileIconViewItem* item = static_cast<const KFileIconViewItem*>(firstItem());
if (item != 0) {
setCurrentItem(item->fileInfo());
}
int index = 0;
const Q3ValueList<URLNavigator::HistoryElem> history = m_dolphinView->urlHistory(index);
if (!history.isEmpty()) {
KFileView* fileView = static_cast<KFileView*>(this);
fileView->setCurrentItem(history[index].currentFileName());
setContentsPos(history[index].contentsX(), history[index].contentsY());
}
}
void DolphinIconsView::refreshSettings()
{
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
assert(settings != 0);
setIconSize(settings->iconSize());
const Q3IconView::Arrangement arrangement = settings->arrangement() == "LeftToRight" ? // TODO: use enum directly in settings
Q3IconView::LeftToRight : Q3IconView::TopToBottom;
const Q3IconView::ItemTextPos textPos = (arrangement == Q3IconView::LeftToRight) ?
Q3IconView::Bottom :
Q3IconView::Right;
setArrangement(arrangement);
setItemTextPos(textPos);
// TODO: tempory crash; will get changed anyway for KDE 4
/*setGridX(settings->gridWidth());
setGridY(settings->gridHeight());
setSpacing(settings->gridSpacing());*/
QFont adjustedFont(font());
adjustedFont.setFamily(settings->fontFamily());
adjustedFont.setPointSize(settings->fontSize());
setFont(adjustedFont);
setIconTextHeight(settings->numberOfTexlines());
if (m_layoutMode == Previews) {
// There is no getter method for the current size in KFileIconView. To
// prevent a flickering the current size is stored in m_previewIconSize and
// setPreviewSize is only invoked if the size really has changed.
showPreviews();
const int size = settings->previewSize();
if (size != m_previewIconSize) {
m_previewIconSize = size;
setPreviewSize(size);
}
}
}
void DolphinIconsView::zoomIn()
{
if (isZoomInPossible()) {
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
const int textWidthHint = DolphinSettings::instance().textWidthHint(); // TODO: remove for KDE4
const int iconSize = increasedIconSize(settings->iconSize());
settings->setIconSize(iconSize);
if (m_layoutMode == Previews) {
const int previewSize = increasedIconSize(settings->previewSize());
settings->setPreviewSize(previewSize);
}
DolphinSettings::instance().calculateGridSize(textWidthHint); // TODO: remove for KDE4
ItemEffectsManager::zoomIn();
}
}
void DolphinIconsView::zoomOut()
{
if (isZoomOutPossible()) {
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
const int textWidthHint = DolphinSettings::instance().textWidthHint(); // TODO: remove for KDE4
const int iconSize = decreasedIconSize(settings->iconSize());
settings->setIconSize(iconSize);
if (m_layoutMode == Previews) {
const int previewSize = decreasedIconSize(settings->previewSize());
settings->setPreviewSize(previewSize);
}
DolphinSettings::instance().calculateGridSize(textWidthHint); // TODO: remove for KDE4
ItemEffectsManager::zoomOut();
}
}
bool DolphinIconsView::isZoomInPossible() const
{
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
const int size = (m_layoutMode == Icons) ? settings->iconSize() : settings->previewSize();
return size < KIcon::SizeEnormous;
}
bool DolphinIconsView::isZoomOutPossible() const
{
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
return settings->iconSize() > KIcon::SizeSmall;
}
void DolphinIconsView::arrangeItemsInGrid( bool updated )
{
KFileIconView::arrangeItemsInGrid(updated);
if (m_layoutMode == Previews) {
// The class KFileIconView has a bug when the size of the previews differs from the size
// of the icons: For specific MIME types the y-position and the height is calculated in
// a wrong manner. The following code bypasses this issue. No bugreport has been submitted
// as this functionality is not used by any KDE3 application and the core developers are
// busy enough for KDE4 now :-)
KFileIconViewItem* item = static_cast<KFileIconViewItem*>(Q3IconView::firstItem());
QString mimetype;
while (item != 0) {
mimetype = item->fileInfo()->mimetype();
const bool fixSize = mimetype.contains("text") ||
mimetype.contains("application/x-");
if (fixSize) {
item->setPixmapSize(QSize(m_previewIconSize, m_previewIconSize));
}
item = static_cast<KFileIconViewItem *>(item->nextItem());
}
}
}
void DolphinIconsView::setContextPixmap(void* context,
const QPixmap& pixmap)
{
reinterpret_cast<KFileIconViewItem*>(context)->setPixmap(pixmap);
}
const QPixmap* DolphinIconsView::contextPixmap(void* context)
{
return reinterpret_cast<KFileIconViewItem*>(context)->pixmap();
}
void* DolphinIconsView::firstContext()
{
return reinterpret_cast<void*>(firstItem());
}
void* DolphinIconsView::nextContext(void* context)
{
KFileIconViewItem* iconViewItem = reinterpret_cast<KFileIconViewItem*>(context);
return reinterpret_cast<void*>(iconViewItem->nextItem());
}
KFileItem* DolphinIconsView::contextFileInfo(void* context)
{
return reinterpret_cast<KFileIconViewItem*>(context)->fileInfo();
}
void DolphinIconsView::contentsMousePressEvent(QMouseEvent* event)
{
KFileIconView::contentsMousePressEvent(event);
resetActivatedItem();
emit signalRequestActivation();
m_dolphinView->statusBar()->clear();
}
void DolphinIconsView::contentsMouseReleaseEvent(QMouseEvent* event)
{
KFileIconView::contentsMouseReleaseEvent(event);
// The KFileIconView does not send any selectionChanged signal if
// a selection is done by using the "select-during-button-pressed" feature.
// Hence inform Dolphin about the selection change manually:
Dolphin::mainWin().slotSelectionChanged();
}
void DolphinIconsView::drawBackground(QPainter* painter, const QRect& rect)
{
if (m_dolphinView->isActive()) {
KFileIconView::drawBackground(painter, rect);
}
else {
const QBrush brush(colorGroup().background());
painter->fillRect(0, 0, width(), height(), brush);
}
}
Q3DragObject* DolphinIconsView::dragObject()
{
KURL::List urls;
KFileItemListIterator it(*KFileView::selectedItems());
while (it.current() != 0) {
urls.append((*it)->url());
++it;
}
QPixmap pixmap;
if(urls.count() > 1) {
pixmap = DesktopIcon("kmultiple", iconSize());
}
else {
KFileIconViewItem* item = static_cast<KFileIconViewItem*>(currentItem());
if ((item != 0) && (item->pixmap() != 0)) {
pixmap = *(item->pixmap());
}
}
if (pixmap.isNull()) {
pixmap = currentFileItem()->pixmap(iconSize());
}
Q3DragObject* dragObj = new KURLDrag(urls, widget());
dragObj->setPixmap(pixmap);
return dragObj;
}
void DolphinIconsView::contentsDragEnterEvent(QDragEnterEvent* event)
{
// TODO: The method KFileIconView::contentsDragEnterEvent() does
// not allow drag and drop inside itself, which prevents the possability
// to move a file into a directory. As the method KFileIconView::acceptDrag()
// is not virtual, we must overwrite the method
// KFileIconView::contentsDragEnterEvent() and do some cut/copy/paste for this
// usecase. Corresponding to the documentation the method KFileIconView::acceptDrag()
// will get virtual in KDE 4, which will simplify the code.
if (event->source() != this) {
KFileIconView::contentsDragEnterEvent(event);
return;
}
const bool accept = KURLDrag::canDecode(event) &&
(event->action() == QDropEvent::Copy ||
event->action() == QDropEvent::Move ||
event->action() == QDropEvent::Link );
if (accept) {
event->acceptAction();
}
else {
event->ignore();
}
}
void DolphinIconsView::contentsDragMoveEvent(QDragMoveEvent* event)
{
KFileIconView::contentsDragMoveEvent(event);
// If a dragging is done above a directory, show the icon as 'active' for
// a visual feedback
KFileIconViewItem* item = static_cast<KFileIconViewItem*>(findItem(contentsToViewport(event->pos())));
bool showActive = false;
if (item != 0) {
const KFileItem* fileInfo = item->fileInfo();
showActive = (fileInfo != 0) && fileInfo->isDir();
}
if (showActive) {
slotOnItem(item);
}
else {
slotOnViewport();
}
}
void DolphinIconsView::contentsDropEvent(QDropEvent* event)
{
// TODO: Most of the following code is a copy of
// KFileIconView::contentsDropEvent. See comment in
// DolphinIconsView::contentsDragEnterEvent for details.
if (event->source() != this) {
KFileIconView::contentsDropEvent(event);
return;
}
KFileIconViewItem* item = static_cast<KFileIconViewItem*>(findItem(contentsToViewport(event->pos())));
const bool accept = KURLDrag::canDecode(event) &&
(event->action() == QDropEvent::Copy ||
event->action() == QDropEvent::Move ||
event->action() == QDropEvent::Link ) &&
(item != 0);
if (!accept) {
return;
}
KFileItem* fileItem = item->fileInfo();
if (!fileItem->isDir()) {
// the file is not a directory, hence don't accept any drop
return;
}
emit dropped(event, fileItem);
KURL::List urls;
if (KURLDrag::decode(event, urls) && !urls.isEmpty()) {
emit dropped(event, urls, fileItem != 0 ? fileItem->url() : KURL());
sig->dropURLs(fileItem, event, urls);
}
}
void DolphinIconsView::slotOnItem(Q3IconViewItem* item)
{
assert(item != 0);
activateItem(reinterpret_cast<void*>(item));
KFileItem* fileItem = static_cast<KFileIconViewItem*>(item)->fileInfo();
m_dolphinView->requestItemInfo(fileItem->url());
}
void DolphinIconsView::slotOnViewport()
{
resetActivatedItem();
m_dolphinView->requestItemInfo(KURL());
}
void DolphinIconsView::slotContextMenuRequested(Q3IconViewItem* item,
const QPoint& pos)
{
KFileItem* fileInfo = 0;
if (item != 0) {
fileInfo = static_cast<KFileIconViewItem*>(item)->fileInfo();
}
m_dolphinView->openContextMenu(fileInfo, pos);
}
void DolphinIconsView::slotItemRenamed(Q3IconViewItem* item,
const QString& name)
{
KFileItem* fileInfo = static_cast<KFileIconViewItem*>(item)->fileInfo();
m_dolphinView->rename(KURL(fileInfo->url()), name);
}
void DolphinIconsView::slotActivationUpdate()
{
update();
// TODO: there must be a simpler way to say
// "update all children"
const QObjectList* list = children();
if (list == 0) {
return;
}
QObjectListIterator it(*list);
QObject* object = 0;
while ((object = it.current()) != 0) {
if (object->inherits("QWidget")) {
QWidget* widget = static_cast<QWidget*>(object);
widget->update();
}
++it;
}
}
void DolphinIconsView::slotUpdateDisabledItems()
{
updateDisabledItems();
}
int DolphinIconsView::increasedIconSize(int size) const
{
int incSize = 0;
switch (size) {
case KIcon::SizeSmall: incSize = KIcon::SizeSmallMedium; break;
case KIcon::SizeSmallMedium: incSize = KIcon::SizeMedium; break;
case KIcon::SizeMedium: incSize = KIcon::SizeLarge; break;
case KIcon::SizeLarge: incSize = KIcon::SizeHuge; break;
case KIcon::SizeHuge: incSize = KIcon::SizeEnormous; break;
default: assert(false); break;
}
return incSize;
}
int DolphinIconsView::decreasedIconSize(int size) const
{
int decSize = 0;
switch (size) {
case KIcon::SizeSmallMedium: decSize = KIcon::SizeSmall; break;
case KIcon::SizeMedium: decSize = KIcon::SizeSmallMedium; break;
case KIcon::SizeLarge: decSize = KIcon::SizeMedium; break;
case KIcon::SizeHuge: decSize = KIcon::SizeLarge; break;
case KIcon::SizeEnormous: decSize = KIcon::SizeHuge; break;
default: assert(false); break;
}
return decSize;
}
#include "dolphiniconsview.moc"

173
src/dolphiniconsview.h Normal file
View file

@ -0,0 +1,173 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINICONSVIEW_H
#define DOLPHINICONSVIEW_H
#include <kfileiconview.h>
#include <qpixmap.h>
//Added by qt3to4:
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMouseEvent>
#include <QDragMoveEvent>
#include <kurl.h>
#include <itemeffectsmanager.h>
class DolphinView;
/**
* @brief Represents the view, where each item is shown as an icon.
*
* It is also possible that instead of the icon a preview of the item
* content is shown.
*
* @author Peter Penz
*/
class DolphinIconsView : public KFileIconView, public ItemEffectsManager
{
Q_OBJECT
public:
enum LayoutMode {
Icons,
Previews
};
DolphinIconsView(DolphinView *parent, LayoutMode layoutMode);
virtual ~DolphinIconsView();
void setLayoutMode(LayoutMode mode);
LayoutMode layoutMode() const { return m_layoutMode; }
/** @see ItemEffectsManager::updateItems */
virtual void beginItemUpdates();
/** @see ItemEffectsManager::updateItems */
virtual void endItemUpdates();
/**
* Reads out the dolphin settings for the icons view and refreshs
* the details view.
*/
// TODO: Other view implementations use a similar interface. When using
// Interview in Qt4 this method should be moved to a base class (currently
// not possible due to having different base classes for the views).
void refreshSettings();
/** @see ItemEffectsManager::zoomIn() */
virtual void zoomIn();
/** @see ItemEffectsManager::zoomOut() */
virtual void zoomOut();
/** @see ItemEffectsManager::isZoomInPossible() */
virtual bool isZoomInPossible() const;
/** @see ItemEffectsManager::isZoomOutPossible() */
virtual bool isZoomOutPossible() const;
public slots:
/**
* Bypass a layout issue in KFileIconView in combination with previews.
* @see KFileIconView::arrangeItemsInGrid
*/
virtual void arrangeItemsInGrid(bool updated = true);
signals:
/**
* Is send, if the details view should be activated. Usually an activation
* is triggered by a mouse click.
*/
void signalRequestActivation();
protected:
/** @see ItemEffectsManager::setContextPixmap */
virtual void setContextPixmap(void* context,
const QPixmap& pixmap);
/** @see ItemEffectsManager::contextPixmap */
virtual const QPixmap* contextPixmap(void* context);
/** @see ItemEffectsManager::firstContext */
virtual void* firstContext();
/** @see ItemEffectsManager::nextContext */
virtual void* nextContext(void* context);
/** @see ItemEffectsManager::contextFileInfo */
virtual KFileItem* contextFileInfo(void* context);
/** @see KFileIconView::contentsMousePressEvent */
virtual void contentsMousePressEvent(QMouseEvent* event);
/** @see KFileIconView::contentsMouseReleaseEvent */
virtual void contentsMouseReleaseEvent(QMouseEvent* event);
/** @see KFileIconView::drawBackground */
virtual void drawBackground(QPainter* painter, const QRect& rect);
/** @see KFileIconView::dragObject */
virtual Q3DragObject* dragObject();
/** @see KFileIconView::contentsDragEnterEvent */
virtual void contentsDragEnterEvent(QDragEnterEvent* event);
/** @see KFileIconView::contentsDragMoveEvent */
virtual void contentsDragMoveEvent(QDragMoveEvent* event);
/** @see KFileIconView::contentsDropEvent */
virtual void contentsDropEvent(QDropEvent* event);
private slots:
/** Is connected to the onItem-signal from KFileIconView. */
void slotOnItem(Q3IconViewItem* item);
/** Is connected to the onViewport-signal from KFileIconView. */
void slotOnViewport();
/**
* Opens the context menu for the item \a item on the given
* position \a pos.
*/
void slotContextMenuRequested(Q3IconViewItem* item,
const QPoint& pos);
/** Renames the item \a item to the name \a name. */
void slotItemRenamed(Q3IconViewItem* item,
const QString& name);
void slotActivationUpdate();
void slotUpdateDisabledItems();
private:
int m_previewIconSize;
LayoutMode m_layoutMode;
DolphinView* m_dolphinView;
/** Returns the increased icon size for the size \a size. */
int increasedIconSize(int size) const;
/** Returns the decreased icon size for the size \a size. */
int decreasedIconSize(int size) const;
};
#endif

184
src/dolphinsettings.cpp Normal file
View file

@ -0,0 +1,184 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at), *
* Cvetoslav Ludmiloff and Patrice Tremblay *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphinsettings.h"
#include <assert.h>
#include <qdir.h>
#include <kapplication.h>
#include <kbookmark.h>
#include <kbookmarkmanager.h>
#include <kicontheme.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include "dolphin.h"
#include "generalsettings.h"
#include "iconsmodesettings.h"
#include "previewsmodesettings.h"
#include "detailsmodesettings.h"
#include "sidebarsettings.h"
DolphinSettings& DolphinSettings::instance()
{
static DolphinSettings* instance = 0;
if (instance == 0) {
instance = new DolphinSettings();
}
return *instance;
}
KBookmark DolphinSettings::bookmark(int index) const
{
int i = 0;
KBookmarkGroup root = bookmarkManager()->root();
KBookmark bookmark = root.first();
while (!bookmark.isNull()) {
if (i == index) {
return bookmark;
}
++i;
bookmark = root.next(bookmark);
}
return KBookmark();
}
KBookmarkManager* DolphinSettings::bookmarkManager() const
{
QString basePath = KGlobal::instance()->instanceName();
basePath.append("/bookmarks.xml");
const QString file = locateLocal("data", basePath);
return KBookmarkManager::managerForFile(file, false);
}
void DolphinSettings::save()
{
m_generalSettings->writeConfig();
m_iconsModeSettings->writeConfig();
m_previewsModeSettings->writeConfig();
m_detailsModeSettings->writeConfig();
m_sidebarSettings->writeConfig();
QString basePath = KGlobal::instance()->instanceName();
basePath.append("/bookmarks.xml");
const QString file = locateLocal( "data", basePath);
KBookmarkManager* manager = KBookmarkManager::managerForFile(file, false);
manager->save(false);
}
void DolphinSettings::calculateGridSize(int hint)
{
// TODO: remove in KDE4
const int previewSize = m_iconsModeSettings->previewSize();
const int iconSize = m_iconsModeSettings->iconSize();
const int maxSize = (previewSize > iconSize) ? previewSize : iconSize;
const Q3IconView::Arrangement arrangement = (m_iconsModeSettings->arrangement() == "LeftToRight") ?
Q3IconView::LeftToRight : Q3IconView::TopToBottom;
int gridWidth = 0;
int gridHeight = 0;
if (arrangement == Q3IconView::LeftToRight) {
int widthUnit = maxSize + (maxSize / 2);
if (widthUnit < KIcon::SizeLarge) {
widthUnit = KIcon::SizeLarge;
}
gridWidth = widthUnit + hint * KIcon::SizeLarge;
gridHeight = iconSize;
if (gridHeight <= KIcon::SizeMedium) {
gridHeight = gridHeight * 2;
}
else {
gridHeight += maxSize / 2;
}
}
else {
assert(arrangement == Q3IconView::TopToBottom);
gridWidth = maxSize + (hint + 1) * (8 * m_iconsModeSettings->fontSize());
// The height-setting is ignored yet by KFileIconView if the TopToBottom
// arrangement is active. Anyway write the setting to have a defined value.
gridHeight = maxSize;
}
m_iconsModeSettings->setGridWidth(gridWidth);
m_iconsModeSettings->setGridHeight(gridHeight);
}
int DolphinSettings::textWidthHint() const
{
// TODO: remove in KDE4
const int previewSize = m_iconsModeSettings->previewSize();
const int iconSize = m_iconsModeSettings->iconSize();
const Q3IconView::Arrangement arrangement = (m_iconsModeSettings->arrangement() == "LeftToRight") ?
Q3IconView::LeftToRight : Q3IconView::TopToBottom;
const int gridWidth = m_iconsModeSettings->gridWidth();
const int maxSize = (previewSize > iconSize) ? previewSize : iconSize;
int hint = 0;
if (arrangement == Q3IconView::LeftToRight) {
int widthUnit = maxSize + (maxSize / 2);
if (widthUnit < KIcon::SizeLarge) {
widthUnit = KIcon::SizeLarge;
}
hint = (gridWidth - widthUnit) / KIcon::SizeLarge;
}
else {
assert(arrangement == Q3IconView::TopToBottom);
hint = (gridWidth - maxSize) / (8 * m_iconsModeSettings->fontSize()) - 1;
if (hint > 2) {
hint = 2;
}
}
return hint;
}
DolphinSettings::DolphinSettings()
{
m_generalSettings = new GeneralSettings();
m_iconsModeSettings = new IconsModeSettings();
m_previewsModeSettings = new PreviewsModeSettings();
m_detailsModeSettings = new DetailsModeSettings();
m_sidebarSettings = new SidebarSettings();
}
DolphinSettings::~DolphinSettings()
{
delete m_generalSettings;
m_generalSettings = 0;
delete m_iconsModeSettings;
m_iconsModeSettings = 0;
delete m_previewsModeSettings;
m_previewsModeSettings = 0;
delete m_detailsModeSettings;
m_detailsModeSettings = 0;
delete m_sidebarSettings;
m_sidebarSettings = 0;
}

103
src/dolphinsettings.h Normal file
View file

@ -0,0 +1,103 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINSETTINGS_H
#define DOLPHINSETTINGS_H
class KBookmark;
class KBookmarkManager;
class GeneralSettings;
class IconsModeSettings;
class PreviewsModeSettings;
class DetailsModeSettings;
class SidebarSettings;
/**
* @brief Manages and stores all settings from Dolphin.
*
* The following properties are stored:
* - home URL
* - default view mode
* - URL navigator state (editable or not)
* - split view
* - bookmarks
* - properties for icons and details view
*/
class DolphinSettings {
public:
static DolphinSettings& instance();
GeneralSettings* generalSettings() const { return m_generalSettings; }
IconsModeSettings* iconsModeSettings() const { return m_iconsModeSettings; }
PreviewsModeSettings* previewsModeSettings() const { return m_previewsModeSettings; }
DetailsModeSettings* detailsModeSettings() const { return m_detailsModeSettings; }
SidebarSettings* sidebarSettings() const { return m_sidebarSettings; }
KBookmarkManager* bookmarkManager() const;
// TODO: should this really belong here or get moved to a derived KBookmarkManager?
// Dolphin uses some lists where an index is given and the corresponding bookmark
// should get retrieved...
KBookmark bookmark(int index) const;
/** @see DolphinSettingsBase::save */
virtual void save();
/**
* TODO: just temporary until the port to KDE4 has been done
*
* Calculates the width and the height of the grid dependant from \a hint and
* the current settings. The hint gives information about the wanted text
* width, where a lower value indicates a smaller text width. Currently
* in Dolphin the values 0, 1 and 2 are used. See also
* DolhinIconsViewSettings::textWidthHint.
*
* The calculation of the grid width and grid height is a little bit tricky,
* as the user model does not fit to the implementation model of QIconView. The user model
* allows to specify icon-, preview- and text width sizes, whereas the implementation
* model expects only a grid width and height. The nasty thing is that the specified
* width and height varies dependant from the arrangement (e. g. the height is totally
* ignored for the top-to-bottom arrangement inside QIconView).
*/
void calculateGridSize(int hint);
/**
* TODO: just temporary until the port to KDE4 has been done
*
* Returns the text width hint dependant from the given settings.
* A lower value indicates a smaller text width. Currently
* in Dolphin the values 0, 1 and 2 are used. The text width hint can
* be used later for DolphinIconsViewSettings::calculateGridSize().
*/
int textWidthHint() const;
protected:
DolphinSettings();
virtual ~DolphinSettings();
private:
GeneralSettings* m_generalSettings;
IconsModeSettings* m_iconsModeSettings;
PreviewsModeSettings* m_previewsModeSettings;
DetailsModeSettings* m_detailsModeSettings;
SidebarSettings* m_sidebarSettings;
};
#endif

View file

@ -0,0 +1,79 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphinsettingsdialog.h"
#include <klocale.h>
#include <kiconloader.h>
#include "generalsettingspage.h"
#include "viewsettingspage.h"
#include "bookmarkssettingspage.h"
#include "dolphin.h"
//Added by qt3to4:
#include <Q3Frame>
DolphinSettingsDialog::DolphinSettingsDialog() :
KDialogBase(IconList, i18n("Dolphin Preferences"),
Ok|Apply|Cancel, Ok)
{
KIconLoader iconLoader;
Q3Frame* generalSettingsFrame = addPage(i18n("General"), 0,
iconLoader.loadIcon("exec",
KIcon::NoGroup,
KIcon::SizeMedium));
m_generalSettingsPage = new GeneralSettingsPage(generalSettingsFrame);
Q3Frame* viewSettingsFrame = addPage(i18n("View Modes"), 0,
iconLoader.loadIcon("view_choose",
KIcon::NoGroup,
KIcon::SizeMedium));
m_viewSettingsPage = new ViewSettingsPage(viewSettingsFrame);
Q3Frame* bookmarksSettingsFrame = addPage(i18n("Bookmarks"), 0,
iconLoader.loadIcon("bookmark",
KIcon::NoGroup,
KIcon::SizeMedium));
m_bookmarksSettingsPage = new BookmarksSettingsPage(bookmarksSettingsFrame);
}
DolphinSettingsDialog::~DolphinSettingsDialog()
{
}
void DolphinSettingsDialog::slotOk()
{
applySettings();
KDialogBase::slotOk();
}
void DolphinSettingsDialog::slotApply()
{
applySettings();
KDialogBase::slotApply();
}
void DolphinSettingsDialog::applySettings()
{
m_generalSettingsPage->applySettings();
m_viewSettingsPage->applySettings();
m_bookmarksSettingsPage->applySettings();
Dolphin::mainWin().refreshViews();
}
#include "dolphinsettingsdialog.moc"

View file

@ -0,0 +1,56 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINSETTINGSDIALOG_H
#define DOLPHINSETTINGSDIALOG_H
#include <kdialog.h>
class GeneralSettingsPage;
class ViewSettingsPage;
class BookmarksSettingsPage;
/**
* @brief Settings dialog for Dolphin.
*
* Contains the pages for general settings, view settings and
* bookmark settings.
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class DolphinSettingsDialog : public KDialog {
Q_OBJECT
public:
DolphinSettingsDialog();
virtual ~DolphinSettingsDialog();
protected slots:
virtual void slotOk();
virtual void slotApply();
private:
GeneralSettingsPage* m_generalSettingsPage;
ViewSettingsPage* m_viewSettingsPage;
BookmarksSettingsPage* m_bookmarksSettingsPage;
void applySettings();
};
#endif

166
src/dolphinstatusbar.cpp Normal file
View file

@ -0,0 +1,166 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphinstatusbar.h"
#include <qprogressbar.h>
#include <qlabel.h>
#include <qtimer.h>
#include <kiconloader.h>
#include "dolphinview.h"
#include "statusbarmessagelabel.h"
#include "statusbarspaceinfo.h"
DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
Q3HBox(parent),
m_messageLabel(0),
m_spaceInfo(0),
m_progressBar(0),
m_progress(100)
{
m_messageLabel = new StatusBarMessageLabel(this);
m_messageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
m_spaceInfo = new StatusBarSpaceInfo(this);
m_spaceInfo->setURL(parent->url());
m_progressText = new QLabel(this);
m_progressText->hide();
m_progressBar = new QProgressBar(this);
m_progressBar->hide();
m_progressTimer = new QTimer(this);
connect(m_progressTimer, SIGNAL(timeout()),
this, SLOT(slotProgressTimer()));
const QSize size(m_progressBar->sizeHint());
m_progressBar->setMaximumWidth(size.width());
setMinimumHeight(size.height());
m_messageLabel->setMinimumTextHeight(size.height());
connect(parent, SIGNAL(signalURLChanged(const KUrl&)),
this, SLOT(slotURLChanged(const KUrl&)));
}
DolphinStatusBar::~DolphinStatusBar()
{
}
void DolphinStatusBar::setMessage(const QString& msg,
Type type)
{
m_messageLabel->setText(msg);
if (msg.isEmpty() || (msg == m_defaultText)) {
type = Default;
}
m_messageLabel->setType(type);
if ((type == Error) && (m_progress < 100)) {
// If an error message is shown during a progress is ongoing,
// the (never finishing) progress information should be hidden immediately
// (invoking 'setProgress(100)' only leads to a delayed hiding).
m_progressBar->hide();
m_progressText->hide();
setProgress(100);
}
}
DolphinStatusBar::Type DolphinStatusBar::type() const
{
return m_messageLabel->type();
}
QString DolphinStatusBar::message() const
{
return m_messageLabel->text();
}
void DolphinStatusBar::setProgressText(const QString& text)
{
m_progressText->setText(text);
}
QString DolphinStatusBar::progressText() const
{
return m_progressText->text();
}
void DolphinStatusBar::setProgress(int percent)
{
if (percent < 0) {
percent = 0;
}
else if (percent > 100) {
percent = 100;
}
m_progress = percent;
m_progressBar->setValue(m_progress);
m_progressTimer->start(300, true);
const QString msg(m_messageLabel->text());
if (msg.isEmpty() || (msg == m_defaultText)) {
if (percent == 0) {
m_messageLabel->setText(QString::null);
m_messageLabel->setType(Default);
}
else if (percent == 100) {
m_messageLabel->setText(m_defaultText);
}
}
}
void DolphinStatusBar::clear()
{
// TODO: check for timeout, so that it's prevented that
// a message is cleared too early.
m_messageLabel->setText(m_defaultText);
m_messageLabel->setType(Default);
}
void DolphinStatusBar::setDefaultText(const QString& text)
{
m_defaultText = text;
}
void DolphinStatusBar::slotProgressTimer()
{
if (m_progress < 100) {
// progress should be shown
m_progressBar->show();
m_progressText->show();
m_spaceInfo->hide();
}
else {
// progress should not be shown anymore
m_progressBar->hide();
m_progressText->hide();
m_spaceInfo->show();
}
}
void DolphinStatusBar::slotURLChanged(const KUrl& url)
{
m_spaceInfo->setURL(url);
}
#include "dolphinstatusbar.moc"

135
src/dolphinstatusbar.h Normal file
View file

@ -0,0 +1,135 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef DOLPHINSTATUSBAR_H
#define DOLPHINSTATUSBAR_H
#include <q3hbox.h>
//Added by qt3to4:
#include <QLabel>
class QProgressBar;
class QLabel;
class QTimer;
class StatusBarMessageLabel;
class StatusBarSpaceInfo;
class DolphinView;
class KUrl;
/**
* @brief Represents the statusbar of a Dolphin view.
*
* The statusbar allows to show messages and progress
* information.
*
* @author Peter Penz
*/
class DolphinStatusBar : public Q3HBox {
Q_OBJECT
public:
/**
* Describes the type of the message text. Dependent
* from the type a corresponding icon and color is
* used for the message text.
*/
enum Type {
Default,
OperationCompleted,
Information,
Error
};
DolphinStatusBar(DolphinView* parent = 0);
virtual ~DolphinStatusBar();
/**
* Sets the message text to \a msg. Dependant
* from the given type \a type an icon is shown and
* the color of the text is adjusted. The height of
* the statusbar is automatically adjusted in a way,
* that the full text fits into the available width.
*
* If a progress is ongoing and a message
* with the type Type::Error is set, the progress
* is cleared automatically.
*/
void setMessage(const QString& msg, Type type);
QString message() const;
Type type() const;
/**
* Sets the text for the progress information.
* The text is shown with a delay of 300 milliseconds:
* if the progress set by DolphinStatusBar::setProgress()
* does reach 100 % within 300 milliseconds,
* the progress text is not shown at all. This assures that
* no flickering occurs for showing a progress of fast
* operations.
*/
void setProgressText(const QString& text);
QString progressText() const;
/**
* Sets the progress in percent (0 - 100). The
* progress is shown with a delay of 300 milliseconds:
* if the progress does reach 100 % within 300 milliseconds,
* the progress is not shown at all. This assures that
* no flickering occurs for showing a progress of fast
* operations.
*/
void setProgress(int percent);
int progress() const { return m_progress; }
/**
* Clears the message text of the status bar by replacing
* the message with the default text, which can be set
* by DolphinStatusBar::setDefaultText(). The progress
* information is not cleared.
*/
void clear();
/**
* Sets the default text, which is shown if the status bar
* is cleared by DolphinStatusBar::clear().
*/
void setDefaultText(const QString& text);
const QString& defaultText() const { return m_defaultText; }
private slots:
void slotProgressTimer();
/**
* Is invoked, when the URL of the DolphinView, where the
* statusbar belongs too, has been changed.
*/
void slotURLChanged(const KUrl& url);
private:
StatusBarMessageLabel* m_messageLabel;
StatusBarSpaceInfo* m_spaceInfo;
QLabel* m_progressText;
QProgressBar* m_progressBar;
QTimer* m_progressTimer;
int m_progress;
QString m_defaultText;
};
#endif

109
src/dolphinui.rc Normal file
View file

@ -0,0 +1,109 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui version="1" name="dolphin" >
<MenuBar>
<Menu name="file" >
<Menu name="create_new" >
<text>Create New</text>
<Action name="create_folder" />
<Separator/>
<ActionList name="create_file_group" />
</Menu>
<Separator/>
<Action name="rename" />
<Action name="move_to_trash" />
<Action name="delete" />
<Separator/>
<Action name="properties" />
</Menu>
<Menu name="edit" >
<Action name="select_all" />
<Action name="invert_selection" />
</Menu>
<Menu name="view" >
<Menu name="view_mode" >
<text>View Mode</text>
<Action name="icons" />
<Action name="details" />
<Action name="previews" />
</Menu>
<Menu name="sort" >
<text>Sort</text>
<Action name="by_name" />
<Action name="by_size" />
<Action name="by_date" />
<Separator/>
<Action name="descending" />
</Menu>
<Action name="show_hidden_files" />
<Separator/>
<Action name="split_view" />
<Action name="reload" />
<Action name="stop" />
<Separator/>
<Menu name="navigation_bar" >
<text>Navigation Bar</text>
<Action name="editable_location" />
<Action name="edit_location" />
</Menu>
<Action name="sidebar" />
<Action name="view_properties" />
</Menu>
<Menu name="tools">
<Action name="open_terminal" />
<Action name="find_file" />
<Action name="show_filter_bar" />
<Action name="compare_files" />
</Menu>
</MenuBar>
<State name="new_file" >
<disable>
<Action name="edit_undo" />
<Action name="edit_redo" />
<Action name="edit_cut" />
<Action name="edit_copy" />
<Action name="rename" />
<Action name="move_to_trash" />
<Action name="delete" />
<Action name="invert_selection" />
<Separator/>
<Action name="properties" />
<Action name="go_back" />
<Action name="go_forward" />
</disable>
</State>
<State name="has_selection" >
<enable>
<Action name="edit_cut" />
<Action name="edit_copy" />
<Action name="move_to_trash" />
<Action name="delete" />
<Action name="properties" />
<Action name="invert_selection" />
</enable>
</State>
<State name="has_no_selection" >
<disable>
<Action name="edit_cut" />
<Action name="edit_copy" />
<Action name="rename" />
<Action name="move_to_trash" />
<Action name="delete" />
<Action name="properties" />
<Action name="invert_selection" />
</disable>
</State>
<ToolBar noMerge="1" name="mainToolBar" >
<text>Main Toolbar</text>
<Action name="go_back" />
<Action name="go_forward" />
<Separator name="separator_1" />
<Action name="icons" />
<Action name="details" />
<Action name="previews" />
<Separator name="separator_0" />
<Action name="split_view" />
</ToolBar>
<ActionProperties>
<Action shortcut="Backspace;XF86Back" name="go_back" />
</ActionProperties>
</kpartgui>

1087
src/dolphinview.cpp Normal file

File diff suppressed because it is too large Load diff

458
src/dolphinview.h Normal file
View file

@ -0,0 +1,458 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _DOLPHINVIEW_H_
#define _DOLPHINVIEW_H_
#include <qwidget.h>
//Added by qt3to4:
#include <QDropEvent>
#include <Q3ValueList>
#include <QMouseEvent>
#include <Q3VBoxLayout>
#include <kparts/part.h>
#include <kfileitem.h>
#include <kfileiconview.h>
#include <kio/job.h>
#include <urlnavigator.h>
class QPainter;
class KUrl;
class QLineEdit;
class URLNavigator;
class QTimer;
class Q3IconViewItem;
class Q3ListViewItem;
class Q3VBoxLayout;
class KFileView;
class Dolphin;
class DolphinDirLister;
class DolphinStatusBar;
class DolphinIconsView;
class DolphinDetailsView;
class ViewProperties;
class Q3ScrollView;
class KProgress;
class ItemEffectsManager;
class FilterBar;
/**
* @short Represents a view for the directory content
* including the navigation bar and status bar.
*
* View modes for icons, details and previews are supported. Currently
* Dolphin allows to have up to two views inside the main window.
*
* @see DolphinIconsView
* @see DolphinDetailsView
* @see URLNavigator
* @see DolphinStatusBar
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class DolphinView : public QWidget
{
Q_OBJECT
public:
/**
* Defines the view mode for a directory. The view mode
* can be defined when constructing a DolphinView. The
* view mode is automatically updated if the directory itself
* defines a view mode (see class ViewProperties for details).
*/
enum Mode
{
/**
* The directory items are shown as icons including an
* icon name. */
IconsView = 0,
/**
* The icon, the name and at least the size of the directory
* items are shown in a table. It is possible to add columns
* for date, group and permissions.
*/
DetailsView = 1,
/**
* The directory items are shown as preview if possible. As
* fallback the items are shown as icons.
*/
PreviewsView = 2,
MaxModeEnum = PreviewsView
};
/** Defines the sort order for the items of a directory. */
enum Sorting
{
SortByName = 0,
SortBySize = 1,
SortByDate = 2,
MaxSortEnum = SortByDate
};
DolphinView(QWidget* parent,
const KUrl& url,
Mode mode = IconsView,
bool showHiddenFiles = false);
virtual ~DolphinView();
/**
* Sets the current active URL.
* The signals URLNavigator::urlChanged and URLNavigator::historyChanged
* are submitted.
*/
void setURL(const KUrl& url);
/** Returns the current active URL. */
const KUrl& url() const;
void requestActivation();
bool isActive() const;
void setMode(Mode mode);
Mode mode() const;
void setShowHiddenFilesEnabled(bool show);
bool isShowHiddenFilesEnabled() const;
void setViewProperties(const ViewProperties& props);
/**
* Triggers the renaming of the currently selected items, where
* the user must input a new name for the items.
*/
void renameSelectedItems();
/**
* Selects all items.
* @see DolphinView::selectedItems()
*/
void selectAll();
/**
* Inverts the current selection: selected items get unselected,
* unselected items get selected.
* @see DolphinView::selectedItems()
*/
void invertSelection();
/**
* Goes back one step in the URL history. The signals
* URLNavigator::urlChanged and URLNavigator::historyChanged
* are submitted.
*/
void goBack();
/**
* Goes forward one step in the URL history. The signals
* URLNavigator::urlChanged and URLNavigator::historyChanged
* are submitted.
*/
void goForward();
/**
* Goes up one step of the URL path. The signals
* URLNavigator::urlChanged and URLNavigator::historyChanged
* are submitted.
*/
void goUp();
/**
* Goes to the home URL. The signals URLNavigator::urlChanged
* and URLNavigator::historyChanged are submitted.
*/
void goHome();
/**
* Sets the URL of the navigation bar to an editable state
* if \a editable is true. If \a editable is false, each part of
* the location is presented by a button for a fast navigation.
*/
void setURLEditable(bool editable);
/**
* Returns the complete URL history. The index 0 indicates the oldest
* history element.
* @param index Output parameter which indicates the current
* index of the location.
*/
const Q3ValueList<URLNavigator::HistoryElem> urlHistory(int& index) const;
/**
* Returns true, if at least one item is selected.
*/
bool hasSelection() const;
/**
* Returns the selected items. 0 is returned, if no item
* is selected.
* @see DolphinView::selectedURLs()
*/
const KFileItemList* selectedItems() const;
/**
* Returns a list of URLs for all selected items. An empty list
* is returned, if no item is selected.
* @see DolphinView::selectedItems()
*/
KUrl::List selectedURLs() const;
/**
* Returns the current item, where the cursor is. 0 is returned, if there is no
* current item (e. g. if the view is empty). Note that the current item must
* not be a selected item.
* @see DolphinView::selectedItems()
*/
const KFileItem* currentFileItem() const;
/**
* Opens the context menu for the item indicated by \a fileInfo
* on the position \a pos. If 0 is passed for the file info, a context
* menu for the viewport is opened.
*/
void openContextMenu(KFileItem* fileInfo, const QPoint& pos);
/**
* Renames the filename of the source URL by the new file name.
* If the new file name already exists, a dialog is opened which
* asks the user to enter a new name.
*/
void rename(const KUrl& source, const QString& newName);
/** Returns the status bar of the view. */
DolphinStatusBar* statusBar() const;
/**
* Returns the x-position of the view content.
* The content of the view might be larger than the visible area
* and hence a scrolling must be done.
*/
int contentsX() const;
/**
* Returns the y-position of the view content.
* The content of the view might be larger than the visible area
* and hence a scrolling must be done.
*/
int contentsY() const;
/**
* Returns true, if the URL shown by the navigation bar is editable.
* @see URLNavigator
*/
bool isURLEditable() const;
/** Increases the size of the current set view mode. */
void zoomIn();
/** Decreases the size of the current set view mode. */
void zoomOut();
/**
* Returns true, if zooming in is possible. If false is returned,
* the minimal zoom size is possible.
*/
bool isZoomInPossible() const;
/**
* Returns true, if zooming out is possible. If false is returned,
* the maximum zoom size is possible.
*/
bool isZoomOutPossible() const;
/** Sets the sort order of the items inside a directory (see DolphinView::Sorting). */
void setSorting(Sorting sorting);
/** Returns the sort order of the items inside a directory (see DolphinView::Sorting). */
Sorting sorting() const;
/** Sets the sort order (Qt::Ascending or Qt::Descending) for the items. */
void setSortOrder(Qt::SortOrder order);
/** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
Qt::SortOrder sortOrder() const;
/** Refreshs the view settings by reading out the stored settings. */
void refreshSettings();
/**
* Updates the number of items (= number of files + number of
* directories) in the statusbar. If files are selected, the number
* of selected files and the sum of the filesize is shown.
*/
void updateStatusBar();
/** Returns the URLNavigator of the view for read access. */
const URLNavigator* urlNavigator() const { return m_urlNavigator; }
/**
* Triggers to request user information for the item given
* by the URL \a url. The signal signalRequestItemInfo is emitted,
* which provides a way for widgets to get an indication to update
* the item information.
*/
void requestItemInfo(const KUrl& url);
/**
* Checks if the filter bar is visible.
*
* @return @c true Filter bar is visible.
* @return @c false Filter bar is not visible.
*/
bool isFilterBarVisible();
public slots:
void reload();
void slotURLListDropped(QDropEvent* event,
const KUrl::List& urls,
const KUrl& url);
/**
* Slot that popups the filter bar like FireFox popups his Search bar.
*/
void slotShowFilterBar(bool show);
signals:
/** Is emitted if URL of the view has been changed to \a url. */
void signalURLChanged(const KUrl& url);
/**
* Is emitted if the view mode (IconsView, DetailsView,
* PreviewsView) has been changed.
*/
void signalModeChanged();
/** Is emitted if the 'show hidden files' property has been changed. */
void signalShowHiddenFilesChanged();
/** Is emitted if the sorting by name, size or date has been changed. */
void signalSortingChanged(DolphinView::Sorting sorting);
/** Is emitted if the sort order (ascending or descending) has been changed. */
void signalSortOrderChanged(Qt::SortOrder order);
/**
* Is emitted if information of an item is requested to be shown e. g. in the sidebar.
* It the URL is empty, no item information request is pending.
*/
void signalRequestItemInfo(const KUrl& url);
/** Is emitted if the contents has been moved to \a x, \a y. */
void contentsMoved(int x, int y);
/**
* Is emitted whenever the selection has been changed. The current selection can
* be retrieved by Dolphin::mainWin().activeView()->selectedItems() or by
* Dolphin::mainWin().activeView()->selectedURLs().
*/
void signalSelectionChanged();
/**
* Is emitted whenever the directory view is redirected by an ioslave
*/
void redirection(const KUrl& oldUrl, const KUrl& newUrl);
protected:
/** @see QWidget::mouseReleaseEvent */
virtual void mouseReleaseEvent(QMouseEvent* event);
private slots:
void slotURLChanged(const KUrl& kurl);
void triggerIconsViewItem(Q3IconViewItem *item);
void triggerDetailsViewItem(Q3ListViewItem* item,
const QPoint& pos,
int column);
void triggerDetailsViewItem(Q3ListViewItem* item);
void updateURL();
void slotPercent(int percent);
void slotClear();
void slotDeleteItem(KFileItem* item);
void slotCompleted();
void slotDelayedUpdate();
void slotInfoMessage(const QString& msg);
void slotErrorMessage(const QString& msg);
void slotRefreshItems(const KFileItemList& list);
void slotAddItems(const KFileItemList& list);
void slotGrabActivation();
/**
* Is invoked shortly before the contents of a view implementation
* has been moved and emits the signal contentsMoved. Note that no
* signal is emitted when the contents moving is only temporary by
* e. g. reloading a directory.
*/
void slotContentsMoving(int x, int y);
/**
* Filters the currently shown items by \a nameFilter. All items
* which contain the given filter string will be shown.
*/
void slotChangeNameFilter(const QString& nameFilter);
private:
void createView();
KFileView* fileView() const;
Q3ScrollView* scrollView() const;
ItemEffectsManager* itemEffectsManager() const;
void startDirLister(const KUrl& url, bool reload = false);
/**
* Returns the default text of the status bar, if no item is
* selected.
*/
QString defaultStatusBarText() const;
/**
* Returns the text for the status bar, if at least one item
* is selected.
*/
QString selectionStatusBarText() const;
/**
* Returns the string representation for the index \a index
* for renaming \itemCount items.
*/
QString renameIndexPresentation(int index, int itemCount) const;
bool m_refreshing;
bool m_showProgress;
Mode m_mode;
Q3VBoxLayout* m_topLayout;
URLNavigator* m_urlNavigator;
DolphinIconsView* m_iconsView;
DolphinDetailsView* m_detailsView;
DolphinStatusBar* m_statusBar;
int m_iconSize;
int m_folderCount;
int m_fileCount;
DolphinDirLister* m_dirLister;
FilterBar *m_filterBar;
};
#endif // _DOLPHINVIEW_H_

122
src/editbookmarkdialog.cpp Normal file
View file

@ -0,0 +1,122 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "editbookmarkdialog.h"
#include <q3grid.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <klocale.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qlayout.h>
#include <kiconloader.h>
#include <qpushbutton.h>
#include <kurl.h>
#include <kfiledialog.h>
#include <kicondialog.h>
#include <q3hbox.h>
EditBookmarkDialog::~EditBookmarkDialog()
{
}
KBookmark EditBookmarkDialog::getBookmark(const QString& title,
const QString& name,
const KURL& url,
const QString& icon)
{
EditBookmarkDialog dialog(title, name, url, icon);
dialog.exec();
return dialog.m_bookmark;
}
void EditBookmarkDialog::slotOk()
{
m_bookmark = KBookmark::standaloneBookmark(m_name->text(),
KURL(m_location->text()),
m_iconName);
KDialogBase::slotOk();
}
EditBookmarkDialog::EditBookmarkDialog(const QString& title,
const QString& name,
const KURL& url,
const QString& icon) :
KDialogBase(Plain, title, Ok|Cancel, Ok),
m_iconButton(0),
m_name(0),
m_location(0)
{
Q3VBoxLayout* topLayout = new Q3VBoxLayout(plainPage(), 0, spacingHint());
Q3Grid* grid = new Q3Grid(2, Qt::Horizontal, plainPage());
grid->setSpacing(spacingHint());
// create icon widgets
new QLabel(i18n("Icon:"), grid);
m_iconName = icon;
m_iconButton = new QPushButton(SmallIcon(m_iconName), QString::null, grid);
m_iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(m_iconButton, SIGNAL(clicked()),
this, SLOT(selectIcon()));
// create name widgets
new QLabel(i18n("Name:"), grid);
m_name = new QLineEdit(name, grid);
m_name->selectAll();
m_name->setFocus();
// create location widgets
new QLabel(i18n("Location:"), grid);
Q3HBox* locationBox = new Q3HBox(grid);
locationBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
locationBox->setSpacing(spacingHint());
m_location = new QLineEdit(url.prettyURL(), locationBox);
m_location->setMinimumWidth(320);
QPushButton* selectLocationButton = new QPushButton(SmallIcon("folder"), QString::null, locationBox);
selectLocationButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(selectLocationButton, SIGNAL(clicked()),
this, SLOT(selectLocation()));
topLayout->addWidget(grid);
}
void EditBookmarkDialog::selectIcon()
{
const QString iconName(KIconDialog::getIcon(KIcon::Small, KIcon::FileSystem));
if (!iconName.isEmpty()) {
m_iconName = iconName;
m_iconButton->setIconSet(SmallIcon(iconName));
}
}
void EditBookmarkDialog::selectLocation()
{
const QString location(m_location->text());
KURL url(KFileDialog::getExistingURL(location));
if (!url.isEmpty()) {
m_location->setText(url.prettyURL());
}
}
#include "editbookmarkdialog.moc"

82
src/editbookmarkdialog.h Normal file
View file

@ -0,0 +1,82 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef EDITBOOKMARKDIALOG_H
#define EDITBOOKMARKDIALOG_H
#include <kbookmark.h>
#include <kdialogbase.h>
class Bookmark;
class QLineEdit;
class QPushButton;
/**
* @brief Allows to edit the icon, URL and name of a bookmark.
*
* The default usage is like this:
* \code
* KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Add Bookmark"),
* i18n("New bookmark"),
* KURL(),
* "bookmark");
* if (!bookmark.isNull()) {
* // ...
* }
* \endcode
*/
class EditBookmarkDialog : public KDialogBase
{
Q_OBJECT
public:
virtual ~EditBookmarkDialog();
/**
* Opens a dialog where the current icon, URL and name of
* an URL are editable. The title of the dialog is set to \a title.
* @return A valid bookmark, if the user has pressed OK. Otherwise
* a null bookmark is returned (see Bookmark::isNull()).
*/
static KBookmark getBookmark(const QString& title,
const QString& name,
const KURL& url,
const QString& icon);
protected slots:
virtual void slotOk();
protected:
EditBookmarkDialog(const QString& title,
const QString& name,
const KURL& url,
const QString& icon);
private slots:
void selectIcon();
void selectLocation();
private:
QString m_iconName;
QPushButton* m_iconButton;
QLineEdit* m_name;
QLineEdit* m_location;
KBookmark m_bookmark;
};
#endif

94
src/filterbar.cpp Normal file
View file

@ -0,0 +1,94 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "filterbar.h"
#include <qlabel.h>
#include <qlayout.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <QKeyEvent>
#include <Q3HBoxLayout>
#include <kdialog.h>
#include <klocale.h>
#include <kpushbutton.h>
#include <klineedit.h>
#include <kiconloader.h>
#include "dolphin.h"
FilterBar::FilterBar(QWidget *parent, const char *name) :
QWidget(parent, name)
{
const int gap = 3;
Q3VBoxLayout* foo = new Q3VBoxLayout(this);
foo->addSpacing(gap);
Q3HBoxLayout* layout = new Q3HBoxLayout(foo);
layout->addSpacing(gap);
m_filter = new QLabel(i18n("Filter:"), this);
layout->addWidget(m_filter);
layout->addSpacing(KDialog::spacingHint());
m_filterInput = new KLineEdit(this);
layout->addWidget(m_filterInput);
m_close = new KPushButton(this);
m_close->setIconSet(SmallIcon("fileclose"));
m_close->setFlat(true);
layout->addWidget(m_close);
layout->addSpacing(gap);
connect(m_filterInput, SIGNAL(textChanged(const QString&)),
this, SIGNAL(signalFilterChanged(const QString&)));
connect(m_close, SIGNAL(clicked()), this, SLOT(hide()));
connect(m_close, SIGNAL(clicked()),
&Dolphin::mainWin(), SLOT(slotShowFilterBarChanged()));
}
FilterBar::~FilterBar()
{
}
void FilterBar::hide()
{
m_filterInput->clear();
m_filterInput->clearFocus();
QWidget::hide();
}
void FilterBar::show()
{
m_filterInput->setFocus();
QWidget::show();
}
void FilterBar::keyReleaseEvent(QKeyEvent* event)
{
QWidget::keyReleaseEvent(event);
if ((event->key() == Qt::Key_Escape)) {
hide();
Dolphin::mainWin().slotShowFilterBarChanged();
}
}
#include "filterbar.moc"

68
src/filterbar.h Normal file
View file

@ -0,0 +1,68 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef FILTERBAR_H
#define FILTERBAR_H
#include <qwidget.h>
//Added by qt3to4:
#include <QKeyEvent>
#include <QLabel>
class QLabel;
class KLineEdit;
class KPushButton;
/**
* @brief Provides an input field for filtering the currently shown items.
*
* @author Gregor Kališnik <gregor@podnapisi.net>
*/
class FilterBar : public QWidget
{
Q_OBJECT
public:
FilterBar(QWidget *parent = 0, const char *name = 0);
virtual ~FilterBar();
signals:
/**
* Signal that reports the name filter has been
* changed to \a nameFilter.
*/
void signalFilterChanged(const QString& nameFilter);
public slots:
/** @see QWidget::hide() */
virtual void hide();
/** @see QWidget::show() */
virtual void show();
protected:
virtual void keyReleaseEvent(QKeyEvent* event);
private:
QLabel* m_filter;
KLineEdit* m_filterInput;
KPushButton* m_close;
};
#endif

27
src/generalsettings.kcfg Normal file
View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="dolphinrc"/>
<group name="General">
<entry name="DefaultViewMode" type="Int">
<label>Default view mode</label>
<default>0</default>
</entry>
<entry name="EditableURL" type="Bool">
<label>Should the URL be editable for the user</label>
<default>false</default>
</entry>
<entry name="FirstRun" type="Bool">
<label>Is the application started the first time</label>
<default>true</default>
</entry>
<entry name="HomeURL" type="String">
<label>Home URL</label>
<default>~</default>
</entry>
<entry name="SplitView" type="Bool">
<label>Split the view into two panes</label>
<default>false</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,4 @@
File=generalsettings.kcfg
ClassName=GeneralSettings
Singleton=false
Mutators=true

169
src/generalsettingspage.cpp Normal file
View file

@ -0,0 +1,169 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and *
* and Patrice Tremblay *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "generalsettingspage.h"
#include <qlayout.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <kdialog.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <q3vbox.h>
#include <q3grid.h>
#include <q3groupbox.h>
#include <klocale.h>
#include <qcheckbox.h>
#include <q3buttongroup.h>
#include <qpushbutton.h>
#include <kfiledialog.h>
#include <qradiobutton.h>
#include "dolphinsettings.h"
#include "dolphin.h"
#include "dolphinview.h"
#include "generalsettings.h"
GeneralSettingsPage::GeneralSettingsPage(QWidget* parent) :
SettingsPageBase(parent),
m_homeURL(0),
m_startSplit(0),
m_startEditable(0)
{
Q3VBoxLayout* topLayout = new Q3VBoxLayout(parent, 2, KDialog::spacingHint());
const int spacing = KDialog::spacingHint();
const int margin = KDialog::marginHint();
const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
Q3VBox* vBox = new Q3VBox(parent);
vBox->setSizePolicy(sizePolicy);
vBox->setSpacing(spacing);
vBox->setMargin(margin);
vBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
// create 'Home URL' editor
Q3GroupBox* homeGroup = new Q3GroupBox(1, Qt::Horizontal, i18n("Home URL"), vBox);
homeGroup->setSizePolicy(sizePolicy);
homeGroup->setMargin(margin);
Q3HBox* homeURLBox = new Q3HBox(homeGroup);
homeURLBox->setSizePolicy(sizePolicy);
homeURLBox->setSpacing(spacing);
new QLabel(i18n("Location:"), homeURLBox);
m_homeURL = new QLineEdit(settings->homeURL(), homeURLBox);
QPushButton* selectHomeURLButton = new QPushButton(SmallIcon("folder"), QString::null, homeURLBox);
connect(selectHomeURLButton, SIGNAL(clicked()),
this, SLOT(selectHomeURL()));
Q3HBox* buttonBox = new Q3HBox(homeGroup);
buttonBox->setSizePolicy(sizePolicy);
buttonBox->setSpacing(spacing);
QPushButton* useCurrentButton = new QPushButton(i18n("Use current location"), buttonBox);
connect(useCurrentButton, SIGNAL(clicked()),
this, SLOT(useCurrentLocation()));
QPushButton* useDefaultButton = new QPushButton(i18n("Use default location"), buttonBox);
connect(useDefaultButton, SIGNAL(clicked()),
this, SLOT(useDefaulLocation()));
// create 'Default View Mode' group
Q3ButtonGroup* buttonGroup = new Q3ButtonGroup(3, Qt::Vertical, i18n("Default View Mode"), vBox);
buttonGroup->setSizePolicy(sizePolicy);
buttonGroup->setMargin(margin);
m_iconsView = new QRadioButton(i18n("Icons"), buttonGroup);
m_detailsView = new QRadioButton(i18n("Details"), buttonGroup);
m_previewsView = new QRadioButton(i18n("Previews"), buttonGroup);
switch (settings->defaultViewMode()) {
case DolphinView::IconsView: m_iconsView->setChecked(true); break;
case DolphinView::DetailsView: m_detailsView->setChecked(true); break;
case DolphinView::PreviewsView: m_previewsView->setChecked(true); break;
}
// create 'Start with split view' checkbox
m_startSplit = new QCheckBox(i18n("Start with split view"), vBox);
m_startSplit->setChecked(settings->splitView());
// create 'Start with editable navigation bar' checkbox
m_startEditable = new QCheckBox(i18n("Start with editable navigation bar"), vBox);
m_startEditable->setChecked(settings->editableURL());
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
// is not stretched vertically.
new QWidget(vBox);
topLayout->addWidget(vBox);
}
GeneralSettingsPage::~GeneralSettingsPage()
{
}
void GeneralSettingsPage::applySettings()
{
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
const KURL url(m_homeURL->text());
KFileItem fileItem(S_IFDIR, KFileItem::Unknown, url);
if (url.isValid() && fileItem.isDir()) {
settings->setHomeURL(url.prettyURL());
}
DolphinView::Mode viewMode = DolphinView::IconsView;
if (m_detailsView->isChecked()) {
viewMode = DolphinView::DetailsView;
}
else if (m_previewsView->isChecked()) {
viewMode = DolphinView::PreviewsView;
}
settings->setDefaultViewMode(viewMode);
settings->setSplitView(m_startSplit->isChecked());
settings->setEditableURL(m_startEditable->isChecked());
}
void GeneralSettingsPage::selectHomeURL()
{
const QString homeURL(m_homeURL->text());
KURL url(KFileDialog::getExistingURL(homeURL));
if (!url.isEmpty()) {
m_homeURL->setText(url.prettyURL());
}
}
void GeneralSettingsPage::useCurrentLocation()
{
const DolphinView* view = Dolphin::mainWin().activeView();
m_homeURL->setText(view->url().prettyURL());
}
void GeneralSettingsPage::useDefaulLocation()
{
m_homeURL->setText("file://" + QDir::homeDirPath());
}
#include "generalsettingspage.moc"

62
src/generalsettingspage.h Normal file
View file

@ -0,0 +1,62 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef GENERALSETTINGSPAGE_H
#define GENERALSETTINGSPAGE_H
#include <settingspagebase.h>
class QLineEdit;
class QRadioButton;
class QCheckBox;
/**
* @brief Page for the 'General' settings of the Dolphin settings dialog.
*
* The general settings allow to set the home URL, the default view mode
* and the split view mode.
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class GeneralSettingsPage : public SettingsPageBase
{
Q_OBJECT
public:
GeneralSettingsPage(QWidget* parent);
virtual ~GeneralSettingsPage();
/** @see SettingsPageBase::applySettings */
virtual void applySettings();
private slots:
void selectHomeURL();
void useCurrentLocation();
void useDefaulLocation();
private:
QLineEdit* m_homeURL;
QRadioButton* m_iconsView;
QRadioButton* m_detailsView;
QRadioButton* m_previewsView;
QCheckBox* m_startSplit;
QCheckBox* m_startEditable;
};
#endif

BIN
src/hi128-app-dolphin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
src/hi16-app-dolphin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/hi22-app-dolphin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
src/hi32-app-dolphin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
src/hi48-app-dolphin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
src/hi64-app-dolphin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="dolphinrc"/>
<include>kiconloader.h</include>
<group name="IconsMode">
<entry name="Arrangement" type="String">
<label>Arrangement</label>
<default>LeftToRight</default>
</entry>
<entry name="FontFamily" type="String">
<label>Font family</label>
<default code="true">KGlobalSettings::generalFont().family()</default>
</entry>
<entry name="FontSize" type="Int">
<label>Font size</label>
<default code="true">KGlobalSettings::generalFont().pointSize()</default>
</entry>
<entry name="GridHeight" type="Int">
<label>Grid height</label>
<default code="true">KIcon::SizeMedium</default>
</entry>
<entry name="GridWidth" type="Int">
<label>Grid width</label>
<default>0</default>
</entry>
<entry name="GridSpacing" type="Int">
<label>Grid spacing</label>
</entry>
<entry name="IconSize" type="Int">
<label>Icon size</label>
<default code="true">KIcon::SizeMedium</default>
</entry>
<entry name="NumberOfTexlines" type="Int">
<label>Number of textlines</label>
<default>2</default>
</entry>
<entry name="PreviewSize" type="Int">
<label>Preview size</label>
<default code="true">KIcon::SizeMedium</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,4 @@
File=iconsmodesettings.kcfg
ClassName=IconsModeSettings
Singleton=false
Mutators=true

View file

@ -0,0 +1,262 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "iconsviewsettingspage.h"
#include <qlabel.h>
#include <qslider.h>
#include <q3buttongroup.h>
#include <qradiobutton.h>
#include <qspinbox.h>
#include <kiconloader.h>
#include <kfontcombo.h>
#include <kdialog.h>
#include <klocale.h>
#include <assert.h>
#include "iconsmodesettings.h"
#include "dolphinsettings.h"
#include "pixmapviewer.h"
#define GRID_SPACING_BASE 8
#define GRID_SPACING_INC 12
IconsViewSettingsPage::IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
QWidget* parent) :
Q3VBox(parent),
m_mode(mode),
m_iconSizeSlider(0),
m_previewSizeSlider(0),
m_textWidthBox(0),
m_gridSpacingBox(0),
m_fontFamilyBox(0),
m_fontSizeBox(0),
m_textlinesCountBox(0),
m_arrangementBox(0)
{
const int spacing = KDialog::spacingHint();
const int margin = KDialog::marginHint();
const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
setSpacing(spacing);
setMargin(margin);
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
assert(settings != 0);
Q3HBox* sizesLayout = new Q3HBox(this);
sizesLayout->setSpacing(spacing);
sizesLayout->setSizePolicy(sizePolicy);
// create 'Icon Size' group including slider and preview
Q3GroupBox* iconSizeGroup = new Q3GroupBox(2, Qt::Vertical, i18n("Icon Size"), sizesLayout);
iconSizeGroup->setSizePolicy(sizePolicy);
iconSizeGroup->setMargin(margin);
const QColor iconBackgroundColor(KGlobalSettings::baseColor());
Q3HBox* iconSizeVBox = new Q3HBox(iconSizeGroup);
iconSizeVBox->setSpacing(spacing);
new QLabel(i18n("Small"), iconSizeVBox);
m_iconSizeSlider = new QSlider(0, 5, 1, 0, Qt::Horizontal, iconSizeVBox);
m_iconSizeSlider->setValue(sliderValue(settings->iconSize()));
m_iconSizeSlider->setTickmarks(QSlider::Below);
connect(m_iconSizeSlider, SIGNAL(valueChanged(int)),
this, SLOT(slotIconSizeChanged(int)));
new QLabel(i18n("Large"), iconSizeVBox);
m_iconSizeViewer = new PixmapViewer(iconSizeGroup);
m_iconSizeViewer->setMinimumWidth(KIcon::SizeEnormous);
m_iconSizeViewer->setFixedHeight(KIcon::SizeEnormous);
m_iconSizeViewer->setEraseColor(iconBackgroundColor);
slotIconSizeChanged(m_iconSizeSlider->value());
if (m_mode == DolphinIconsView::Previews) {
// create 'Preview Size' group including slider and preview
Q3GroupBox* previewSizeGroup = new Q3GroupBox(2, Qt::Vertical, i18n("Preview Size"), sizesLayout);
previewSizeGroup->setSizePolicy(sizePolicy);
previewSizeGroup->setMargin(margin);
Q3HBox* previewSizeVBox = new Q3HBox(previewSizeGroup);
previewSizeVBox->setSpacing(spacing);
new QLabel(i18n("Small"), previewSizeVBox);
m_previewSizeSlider = new QSlider(0, 5, 1, 0, Qt::Horizontal, previewSizeVBox);
m_previewSizeSlider->setValue(sliderValue(settings->previewSize()));
m_previewSizeSlider->setTickmarks(QSlider::Below);
connect(m_previewSizeSlider, SIGNAL(valueChanged(int)),
this, SLOT(slotPreviewSizeChanged(int)));
new QLabel(i18n("Large"), previewSizeVBox);
m_previewSizeViewer = new PixmapViewer(previewSizeGroup);
m_previewSizeViewer->setMinimumWidth(KIcon::SizeEnormous);
m_previewSizeViewer->setFixedHeight(KIcon::SizeEnormous);
m_previewSizeViewer->setEraseColor(iconBackgroundColor);
slotPreviewSizeChanged(m_previewSizeSlider->value());
}
Q3GroupBox* textGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Text"), this);
textGroup->setSizePolicy(sizePolicy);
textGroup->setMargin(margin);
new QLabel(i18n("Font family:"), textGroup);
m_fontFamilyBox = new KFontCombo(textGroup);
m_fontFamilyBox->setCurrentFont(settings->fontFamily());
new QLabel(i18n("Font size:"), textGroup);
m_fontSizeBox = new QSpinBox(6, 99, 1, textGroup);
m_fontSizeBox->setValue(settings->fontSize());
new QLabel(i18n("Number of lines:"), textGroup);
m_textlinesCountBox = new QSpinBox(1, 5, 1, textGroup);
m_textlinesCountBox->setValue(settings->numberOfTexlines());
new QLabel(i18n("Text width:"), textGroup);
m_textWidthBox = new QComboBox(textGroup);
m_textWidthBox->insertItem(i18n("Small"));
m_textWidthBox->insertItem(i18n("Medium"));
m_textWidthBox->insertItem(i18n("Large"));
Q3GroupBox* gridGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Grid"), this);
gridGroup->setSizePolicy(sizePolicy);
gridGroup->setMargin(margin);
const bool leftToRightArrangement = (settings->arrangement() == Q3IconView::LeftToRight);
new QLabel(i18n("Arrangement:"), gridGroup);
m_arrangementBox = new QComboBox(gridGroup);
m_arrangementBox->insertItem(i18n("Left to right"));
m_arrangementBox->insertItem(i18n("Top to bottom"));
m_arrangementBox->setCurrentItem(leftToRightArrangement ? 0 : 1);
new QLabel(i18n("Grid spacing:"), gridGroup);
m_gridSpacingBox = new QComboBox(gridGroup);
m_gridSpacingBox->insertItem(i18n("Small"));
m_gridSpacingBox->insertItem(i18n("Medium"));
m_gridSpacingBox->insertItem(i18n("Large"));
m_gridSpacingBox->setCurrentItem((settings->gridSpacing() - GRID_SPACING_BASE) / GRID_SPACING_INC);
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
// is not stretched vertically.
new QWidget(this);
adjustTextWidthSelection();
}
IconsViewSettingsPage::~IconsViewSettingsPage()
{
}
void IconsViewSettingsPage::applySettings()
{
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
assert(settings != 0);
const int defaultSize = iconSize(m_iconSizeSlider->value());
settings->setIconSize(defaultSize);
int previewSize = (m_mode == DolphinIconsView::Previews) ?
iconSize(m_previewSizeSlider->value()) :
defaultSize;
if (previewSize < defaultSize) {
// assure that the preview size is never smaller than the icon size
previewSize = defaultSize;
}
settings->setPreviewSize(previewSize);
const int fontSize = m_fontSizeBox->value();
QString arrangement = (m_arrangementBox->currentItem() == 0) ?
"LeftToRight" :
"TopToBottom";
settings->setArrangement(arrangement);
DolphinSettings::instance().calculateGridSize(m_textWidthBox->currentItem());
settings->setFontFamily(m_fontFamilyBox->currentFont());
settings->setFontSize(fontSize);
settings->setNumberOfTexlines(m_textlinesCountBox->value());
settings->setGridSpacing(GRID_SPACING_BASE +
m_gridSpacingBox->currentItem() * GRID_SPACING_INC);
}
void IconsViewSettingsPage::slotIconSizeChanged(int value)
{
KIconLoader iconLoader;
m_iconSizeViewer->setPixmap(iconLoader.loadIcon("folder", KIcon::Desktop, iconSize(value)));
if (m_previewSizeSlider != 0) {
int previewSizeValue = m_previewSizeSlider->value();
if (previewSizeValue < value) {
// assure that the preview size is never smaller than the icon size
previewSizeValue = value;
}
slotPreviewSizeChanged(previewSizeValue);
}
}
void IconsViewSettingsPage::slotPreviewSizeChanged(int value)
{
KIconLoader iconLoader;
const int iconSizeValue = m_iconSizeSlider->value();
if (value < iconSizeValue) {
// assure that the preview size is never smaller than the icon size
value = iconSizeValue;
}
m_previewSizeViewer->setPixmap(iconLoader.loadIcon("preview", KIcon::Desktop, iconSize(value)));
}
int IconsViewSettingsPage::iconSize(int sliderValue) const
{
int size = KIcon::SizeMedium;
switch (sliderValue) {
case 0: size = KIcon::SizeSmall; break;
case 1: size = KIcon::SizeSmallMedium; break;
case 2: size = KIcon::SizeMedium; break;
case 3: size = KIcon::SizeLarge; break;
case 4: size = KIcon::SizeHuge; break;
case 5: size = KIcon::SizeEnormous; break;
}
return size;
}
int IconsViewSettingsPage::sliderValue(int iconSize) const
{
int value = 0;
switch (iconSize) {
case KIcon::SizeSmall: value = 0; break;
case KIcon::SizeSmallMedium: value = 1; break;
case KIcon::SizeMedium: value = 2; break;
case KIcon::SizeLarge: value = 3; break;
case KIcon::SizeHuge: value = 4; break;
case KIcon::SizeEnormous: value = 5; break;
default: break;
}
return value;
}
void IconsViewSettingsPage::adjustTextWidthSelection()
{
IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
assert(settings != 0);
m_textWidthBox->setCurrentItem(DolphinSettings::instance().textWidthHint());
}
#include "iconsviewsettingspage.moc"

View file

@ -0,0 +1,99 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef ICONSVIEWSETTINGSPAGE_H
#define ICONSVIEWSETTINGSPAGE_H
#include <q3vbox.h>
#include <dolphiniconsview.h>
class QSlider;
class QComboBox;
class QCheckBox;
class QPushButton;
class QSpinBox;
class KFontCombo;
class PixmapViewer;
/**
* @brief Tab page for the 'Icons Mode' and 'Previews Mode' settings
* of the Dolphin settings dialog.
*
* Allows to set:
* - icon size
* - preview size
* - text width
* - grid spacing
* - font family
* - font size
* - number of text lines
* - arrangement
*
* @see DolphinIconsViewSettings
* @author Peter Penz <peter.penz@gmx.at>
*/
class IconsViewSettingsPage : public Q3VBox
{
Q_OBJECT
public:
IconsViewSettingsPage(DolphinIconsView::LayoutMode mode,
QWidget* parent);
virtual ~IconsViewSettingsPage();
/**
* Applies the settings for the icons view.
* The settings are persisted automatically when
* closing Dolphin.
*/
void applySettings();
private slots:
void slotIconSizeChanged(int value);
void slotPreviewSizeChanged(int value);
private:
DolphinIconsView::LayoutMode m_mode;
QSlider* m_iconSizeSlider;
PixmapViewer* m_iconSizeViewer;
QSlider* m_previewSizeSlider;
PixmapViewer* m_previewSizeViewer;
QComboBox* m_textWidthBox;
QComboBox* m_gridSpacingBox;
KFontCombo* m_fontFamilyBox;
QSpinBox* m_fontSizeBox;
QSpinBox* m_textlinesCountBox;
QComboBox* m_arrangementBox;
/** Returns the icon size for the given slider value. */
int iconSize(int sliderValue) const;
/** Returns the slider value for the given icon size. */
int sliderValue(int iconSize) const;
/**
* Adjusts the selection of the text width combo box dependant
* from the grid width and grid height settings.
*/
void adjustTextWidthSelection();
};
#endif

634
src/infosidebarpage.cpp Normal file
View file

@ -0,0 +1,634 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "infosidebarpage.h"
#include <assert.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <qlabel.h>
#include <qtimer.h>
#include <qpushbutton.h>
#include <q3vbox.h>
#include <q3vgroupbox.h>
#include <q3popupmenu.h>
#include <qpainter.h>
#include <qfontmetrics.h>
#include <q3grid.h>
#include <q3hgroupbox.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <QEvent>
#include <Q3VBoxLayout>
#include <kbookmarkmanager.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kio/previewjob.h>
#include <kfileitem.h>
#include <kdialog.h>
#include <kglobalsettings.h>
#include <kfilemetainfo.h>
#include "dolphin.h"
#include "pixmapviewer.h"
#include "dolphinsettings.h"
InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
SidebarPage(parent),
m_multipleSelection(false),
m_pendingPreview(false),
m_timer(0),
m_preview(0),
m_name(0),
m_currInfoLineIdx(0),
m_infoGrid(0),
m_actionBox(0)
{
const int spacing = KDialog::spacingHint();
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()),
this, SLOT(slotTimeout()));
Q3VBoxLayout* layout = new Q3VBoxLayout(this);
layout->setSpacing(spacing);
// preview
m_preview = new PixmapViewer(this);
m_preview->setMinimumWidth(KIcon::SizeEnormous);
m_preview->setFixedHeight(KIcon::SizeEnormous);
// name
m_name = new QLabel(this);
m_name->setTextFormat(Qt::RichText);
m_name->setAlignment(m_name->alignment() | Qt::AlignHCenter);
QFontMetrics fontMetrics(m_name->font());
m_name->setMinimumHeight(fontMetrics.height() * 3);
m_name->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
QWidget* sep1 = new Q3HGroupBox(this); // TODO: check whether default widget exist for this?
sep1->setFixedHeight(1);
// general information
m_infoGrid = new Q3Grid(2, this);
m_infoGrid->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
QWidget* sep2 = new Q3HGroupBox(this); // TODO: check whether default widget exist for this?
sep2->setFixedHeight(1);
// actions
m_actionBox = new Q3VBox(this);
m_actionBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
// Add a dummy widget with no restriction regarding a vertical resizing.
// This assures that information is always top aligned.
QWidget* dummy = new QWidget(this);
layout->addItem(new QSpacerItem(spacing, spacing, QSizePolicy::Preferred, QSizePolicy::Fixed));
layout->addWidget(m_preview);
layout->addWidget(m_name);
layout->addWidget(sep1);
layout->addWidget(m_infoGrid);
layout->addWidget(sep2);
layout->addWidget(m_actionBox);
layout->addWidget(dummy);
connect(&Dolphin::mainWin(), SIGNAL(selectionChanged()),
this, SLOT(showItemInfo()));
connectToActiveView();
}
InfoSidebarPage::~InfoSidebarPage()
{
}
void InfoSidebarPage::activeViewChanged()
{
connectToActiveView();
}
void InfoSidebarPage::requestDelayedItemInfo(const KURL& url)
{
cancelRequest();
if (!url.isEmpty() && !m_multipleSelection) {
m_urlCandidate = url;
m_timer->start(300, true);
}
}
void InfoSidebarPage::requestItemInfo(const KURL& url)
{
cancelRequest();
if (!url.isEmpty() && !m_multipleSelection) {
m_shownURL = url;
showItemInfo();
}
}
void InfoSidebarPage::showItemInfo()
{
cancelRequest();
m_multipleSelection = false;
// show the preview...
DolphinView* view = Dolphin::mainWin().activeView();
const KFileItemList* selectedItems = view->selectedItems();
if ((selectedItems != 0) && selectedItems->count() > 1) {
m_multipleSelection = true;
}
if (m_multipleSelection) {
KIconLoader iconLoader;
QPixmap icon = iconLoader.loadIcon("exec",
KIcon::NoGroup,
KIcon::SizeEnormous);
m_preview->setPixmap(icon);
m_name->setText(i18n("%1 items selected").arg(selectedItems->count()));
}
else if (!applyBookmark()) {
// try to get a preview pixmap from the item...
KURL::List list;
list.append(m_shownURL);
m_pendingPreview = true;
m_preview->setPixmap(QPixmap());
KIO::PreviewJob* job = KIO::filePreview(list,
m_preview->width(),
KIcon::SizeEnormous);
connect(job, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
this, SLOT(gotPreview(const KFileItem*, const QPixmap&)));
connect(job, SIGNAL(failed(const KFileItem*)),
this, SLOT(slotPreviewFailed(const KFileItem*)));
QString text("<b>");
text.append(m_shownURL.fileName());
text.append("</b>");
m_name->setText(text);
}
createMetaInfo();
insertActions();
}
void InfoSidebarPage::slotTimeout()
{
m_shownURL = m_urlCandidate;
showItemInfo();
}
void InfoSidebarPage::slotPreviewFailed(const KFileItem* item)
{
m_pendingPreview = false;
if (!applyBookmark()) {
m_preview->setPixmap(item->pixmap(KIcon::SizeEnormous));
}
}
void InfoSidebarPage::gotPreview(const KFileItem* /* item */,
const QPixmap& pixmap)
{
if (m_pendingPreview) {
m_preview->setPixmap(pixmap);
m_pendingPreview = false;
}
}
void InfoSidebarPage::startService(int index)
{
DolphinView* view = Dolphin::mainWin().activeView();
if (view->hasSelection()) {
KURL::List selectedURLs = view->selectedURLs();
KDEDesktopMimeType::executeService(selectedURLs, m_actionsVector[index]);
}
else {
KDEDesktopMimeType::executeService(m_shownURL, m_actionsVector[index]);
}
}
void InfoSidebarPage::connectToActiveView()
{
cancelRequest();
DolphinView* view = Dolphin::mainWin().activeView();
connect(view, SIGNAL(signalRequestItemInfo(const KURL&)),
this, SLOT(requestDelayedItemInfo(const KURL&)));
connect(view, SIGNAL(signalURLChanged(const KURL&)),
this, SLOT(requestItemInfo(const KURL&)));
m_shownURL = view->url();
showItemInfo();
}
bool InfoSidebarPage::applyBookmark()
{
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
while (!bookmark.isNull()) {
if (m_shownURL.equals(bookmark.url(), true)) {
QString text("<b>");
text.append(bookmark.text());
text.append("</b>");
m_name->setText(text);
KIconLoader iconLoader;
QPixmap icon = iconLoader.loadIcon(bookmark.icon(),
KIcon::NoGroup,
KIcon::SizeEnormous);
m_preview->setPixmap(icon);
return true;
}
bookmark = root.next(bookmark);
}
return false;
}
void InfoSidebarPage::cancelRequest()
{
m_timer->stop();
m_pendingPreview = false;
}
void InfoSidebarPage::createMetaInfo()
{
// To prevent a flickering it's important to reuse available
// labels instead of deleting them and recreate them afterwards.
// The methods beginInfoLines(), addInfoLine() and endInfoLines()
// take care of this.
beginInfoLines();
DolphinView* view = Dolphin::mainWin().activeView();
if (!view->hasSelection()) {
KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownURL);
fileItem.refresh();
if (fileItem.isDir()) {
addInfoLine(i18n("Type:"), i18n("Directory"));
}
else {
addInfoLine(i18n("Type:"), fileItem.mimeComment());
QString sizeText(KIO::convertSize(fileItem.size()));
addInfoLine(i18n("Size:"), sizeText);
addInfoLine(i18n("Modified:"), fileItem.timeString());
const KFileMetaInfo& metaInfo = fileItem.metaInfo();
if (metaInfo.isValid()) {
QStringList keys = metaInfo.supportedKeys();
for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) {
if (showMetaInfo(*it)) {
KFileMetaInfoItem metaInfoItem = metaInfo.item(*it);
addInfoLine(*it, metaInfoItem.string());
}
}
}
}
}
endInfoLines();
}
void InfoSidebarPage::beginInfoLines()
{
m_currInfoLineIdx = 0;
}
void InfoSidebarPage::endInfoLines()
{
if (m_currInfoLineIdx <= 0) {
return;
}
// remove labels which have not been used
if (m_currInfoLineIdx < static_cast<int>(m_infoWidgets.count())) {
Q3PtrListIterator<QLabel> deleteIter(m_infoWidgets);
deleteIter += m_currInfoLineIdx;
QWidget* widget = 0;
int removeCount = 0;
while ((widget = deleteIter.current()) != 0) {
widget->close();
widget->deleteLater();
++deleteIter;
++removeCount;
}
for (int i = 0; i < removeCount; ++i) {
m_infoWidgets.removeLast();
}
}
}
bool InfoSidebarPage::showMetaInfo(const QString& key) const
{
// sorted list of keys, where it's data should be shown
static const char* keys[] = {
"Album",
"Artist",
"Author",
"Bitrate",
"Date",
"Dimensions",
"Genre",
"Length",
"Lines",
"Pages",
"Title",
"Words"
};
// do a binary search for the key...
int top = 0;
int bottom = sizeof(keys) / sizeof(char*) - 1;
while (top < bottom) {
const int middle = (top + bottom) / 2;
const int result = key.compare(keys[middle]);
if (result < 0) {
bottom = middle - 1;
}
else if (result > 0) {
top = middle + 1;
}
else {
return true;
}
}
return false;
}
void InfoSidebarPage::addInfoLine(const QString& labelText, const QString& infoText)
{
QString labelStr("<b>");
labelStr.append(labelText);
labelStr.append("</b>&nbsp;");
const int count = m_infoWidgets.count();
if (m_currInfoLineIdx < count - 1) {
// reuse available labels
m_infoWidgets.at(m_currInfoLineIdx++)->setText(labelStr);
m_infoWidgets.at(m_currInfoLineIdx++)->setText(infoText);
}
else {
// no labels are available anymore, hence create 2 new ones
QLabel* label = new QLabel(labelStr, m_infoGrid);
label->setTextFormat(Qt::RichText);
label->setAlignment(Qt::AlignRight |
Qt::AlignTop);
label->show();
m_infoWidgets.append(label);
QLabel* info = new QLabel(infoText, m_infoGrid);
info->setTextFormat(Qt::RichText);
info->setAlignment(Qt::AlignTop | Qt::WordBreak);
info->show();
m_infoWidgets.append(info);
m_currInfoLineIdx += 2;
}
}
void InfoSidebarPage::insertActions()
{
// delete all existing action widgets
// TODO: just use children() from QObject...
Q3PtrListIterator<QWidget> deleteIter(m_actionWidgets);
QWidget* widget = 0;
while ((widget = deleteIter.current()) != 0) {
widget->close();
widget->deleteLater();
++deleteIter;
}
m_actionWidgets.clear();
m_actionsVector.clear();
int actionsIndex = 0;
// The algorithm for searching the available actions works on a list
// of KFileItems. If no selection is given, a temporary KFileItem
// by the given URL 'url' is created and added to the list.
KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownURL);
KFileItemList localList;
const KFileItemList* itemList = Dolphin::mainWin().activeView()->selectedItems();
if ((itemList == 0) || itemList->isEmpty()) {
fileItem.refresh();
localList.append(&fileItem);
itemList = &localList;
}
// 'itemList' contains now all KFileItems, where an item information should be shown.
// TODO: the following algorithm is quite equal to DolphinContextMenu::insertActionItems().
// It's open yet whether they should be merged or whether they have to work slightly different.
QStringList dirs = KGlobal::dirs()->findDirs("data", "dolphin/servicemenus/");
for (QStringList::ConstIterator dirIt = dirs.begin(); dirIt != dirs.end(); ++dirIt) {
QDir dir(*dirIt);
QStringList entries = dir.entryList("*.desktop", QDir::Files);
for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
KSimpleConfig cfg(*dirIt + *entryIt, true);
cfg.setDesktopGroup();
if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
const QStringList types = cfg.readListEntry("ServiceTypes");
for (QStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
// check whether the mime type is equal or whether the
// mimegroup (e. g. image/*) is supported
bool insert = false;
if ((*it) == "all/allfiles") {
// The service type is valid for all files, but not for directories.
// Check whether the selected items only consist of files...
KFileItemListIterator mimeIt(*itemList);
KFileItem* item = 0;
insert = true;
while (insert && ((item = mimeIt.current()) != 0)) {
insert = !item->isDir();
++mimeIt;
}
}
if (!insert) {
// Check whether the MIME types of all selected files match
// to the mimetype of the service action. As soon as one MIME
// type does not match, no service menu is shown at all.
KFileItemListIterator mimeIt(*itemList);
KFileItem* item = 0;
insert = true;
while (insert && ((item = mimeIt.current()) != 0)) {
const QString mimeType((*mimeIt)->mimetype());
const QString mimeGroup(mimeType.left(mimeType.find('/')));
insert = (*it == mimeType) ||
((*it).right(1) == "*") &&
((*it).left((*it).find('/')) == mimeGroup);
++mimeIt;
}
}
if (insert) {
const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
Q3PopupMenu* popup = 0;
if (!submenuName.isEmpty()) {
// create a sub menu containing all actions
popup = new Q3PopupMenu();
connect(popup, SIGNAL(activated(int)),
this, SLOT(startService(int)));
QPushButton* button = new QPushButton(submenuName, m_actionBox);
button->setFlat(true);
button->setPopup(popup);
button->show();
m_actionWidgets.append(button);
}
Q3ValueList<KDEDesktopMimeType::Service> userServices =
KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
// iterate through all actions and add them to a widget
Q3ValueList<KDEDesktopMimeType::Service>::Iterator serviceIt;
for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
KDEDesktopMimeType::Service service = (*serviceIt);
if (popup == 0) {
ServiceButton* button = new ServiceButton(SmallIcon(service.m_strIcon),
service.m_strName,
m_actionBox,
actionsIndex);
connect(button, SIGNAL(requestServiceStart(int)),
this, SLOT(startService(int)));
m_actionWidgets.append(button);
button->show();
}
else {
popup->insertItem(SmallIcon(service.m_strIcon), service.m_strName, actionsIndex);
}
m_actionsVector.append(service);
++actionsIndex;
}
}
}
}
}
}
}
ServiceButton::ServiceButton(const QIcon& icon,
const QString& text,
QWidget* parent,
int index) :
QPushButton(icon, text, parent),
m_hover(false),
m_index(index)
{
setEraseColor(colorGroup().background());
setFocusPolicy(Qt::NoFocus);
connect(this, SIGNAL(released()),
this, SLOT(slotReleased()));
}
ServiceButton::~ServiceButton()
{
}
void ServiceButton::drawButton(QPainter* painter)
{
const int buttonWidth = width();
const int buttonHeight = height();
QColor backgroundColor;
QColor foregroundColor;
if (m_hover) {
backgroundColor = KGlobalSettings::highlightColor();
foregroundColor = KGlobalSettings::highlightedTextColor();
}
else {
backgroundColor = colorGroup().background();
foregroundColor = KGlobalSettings::buttonTextColor();
}
// draw button background
painter->setPen(NoPen);
painter->setBrush(backgroundColor);
painter->drawRect(0, 0, buttonWidth, buttonHeight);
const int spacing = KDialog::spacingHint();
// draw icon
int x = spacing;
const int y = (buttonHeight - KIcon::SizeSmall) / 2;
const QIcon* set = iconSet();
if (set != 0) {
painter->drawPixmap(x, y, set->pixmap(QIcon::Small, QIcon::Normal));
}
x += KIcon::SizeSmall + spacing;
// draw text
painter->setPen(foregroundColor);
const int textWidth = buttonWidth - x;
QFontMetrics fontMetrics(font());
const bool clipped = fontMetrics.width(text()) >= textWidth;
//const int align = clipped ? Qt::AlignVCenter : Qt::AlignCenter;
painter->drawText(QRect(x, 0, textWidth, buttonHeight), Qt::AlignVCenter, text());
if (clipped) {
// Blend the right area of the text with the background, as the
// text is clipped.
// TODO #1: use alpha blending in Qt4 instead of drawing the text that often
// TODO #2: same code as in URLNavigatorButton::drawButton() -> provide helper class?
const int blendSteps = 16;
QColor blendColor(backgroundColor);
const int redInc = (foregroundColor.red() - backgroundColor.red()) / blendSteps;
const int greenInc = (foregroundColor.green() - backgroundColor.green()) / blendSteps;
const int blueInc = (foregroundColor.blue() - backgroundColor.blue()) / blendSteps;
for (int i = 0; i < blendSteps; ++i) {
painter->setClipRect(QRect(x + textWidth - i, 0, 1, buttonHeight));
painter->setPen(blendColor);
painter->drawText(QRect(x, 0, textWidth, buttonHeight), Qt::AlignVCenter, text());
blendColor.setRgb(blendColor.red() + redInc,
blendColor.green() + greenInc,
blendColor.blue() + blueInc);
}
}
}
void ServiceButton::enterEvent(QEvent* event)
{
QPushButton::enterEvent(event);
m_hover = true;
update();
}
void ServiceButton::leaveEvent(QEvent* event)
{
QPushButton::leaveEvent(event);
m_hover = false;
update();
}
void ServiceButton::slotReleased()
{
emit requestServiceStart(m_index);
}

199
src/infosidebarpage.h Normal file
View file

@ -0,0 +1,199 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at>
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _INFOSIDEBARPAGE_H_
#define _INFOSIDEBARPAGE_H_
#include <sidebarpage.h>
#include <q3valuevector.h>
#include <qpushbutton.h>
//Added by qt3to4:
#include <QPixmap>
#include <QEvent>
#include <QLabel>
#include <Q3PtrList>
#include <kurl.h>
#include <ksortablevaluelist.h>
#include <kmimetype.h>
namespace KIO {
class Job;
};
class QPixmap;
class QIcon;
class QString;
class QPainter;
class KFileItem;
class QLabel;
class Q3VBox;
class Q3Grid;
class PixmapViewer;
/**
* @brief Prototype for a information sidebar.
*
* Will be exchanged in future releases by pluggable sidebar pages...
*/
class InfoSidebarPage : public SidebarPage
{
Q_OBJECT
public:
InfoSidebarPage(QWidget* parent);
virtual ~InfoSidebarPage();
protected:
/** @see SidebarPage::activeViewChanged() */
virtual void activeViewChanged();
private slots:
/**
* Does a delayed request of information for the item of the given URL and
* provides default actions.
*
* @see InfoSidebarPage::showItemInfo()
*/
void requestDelayedItemInfo(const KURL& url);
/**
* Does a request of information for the item of the given URL and
* provides default actions.
*
* @see InfoSidebarPage::showItemInfo()
*/
void requestItemInfo(const KURL& url);
/**
* Shows the information for the item of the URL which has been provided by
* InfoSidebarPage::requestItemInfo() and provides default actions.
*/
void showItemInfo();
/**
* Triggered if the request for item information has timed out.
* @see InfoSidebarPage::requestDelayedItemInfo()
*/
void slotTimeout();
/**
* Is invoked if no preview is available for the item. In this
* case the icon will be shown.
*/
void slotPreviewFailed(const KFileItem* item);
/**
* Is invoked if a preview is available for the item. The preview
* \a pixmap is shown inside the info page.
*/
void gotPreview(const KFileItem* item, const QPixmap& pixmap);
/**
* Starts the service of m_actionsVector with the index \index on
* the shown URL (or the selected items if available).
*/
void startService(int index);
private:
/**
* Connects to signals from the currently active Dolphin view to get
* informed about highlighting changes.
*/
void connectToActiveView();
/**
* Checks whether the current URL is repesented by a bookmark. If yes,
* then the bookmark icon and name are shown instead of a preview.
* @return True, if the URL represents exactly a bookmark.
*/
bool applyBookmark();
/** Assures that any pending item information request is cancelled. */
void cancelRequest();
// TODO: the following methods are just a prototypes for meta
// info generation...
void createMetaInfo();
void addInfoLine(const QString& labelText,
const QString& infoText);
void beginInfoLines();
void endInfoLines();
/**
* Returns true, if the string \a key represents a meta information
* that should be shown.
*/
bool showMetaInfo(const QString& key) const;
/**
* Inserts the available actions to the info page for the given item.
*/
void insertActions();
bool m_multipleSelection;
bool m_pendingPreview;
QTimer* m_timer;
KURL m_shownURL;
KURL m_urlCandidate;
PixmapViewer* m_preview;
QLabel* m_name;
int m_currInfoLineIdx;
Q3Grid* m_infoGrid;
Q3PtrList<QLabel> m_infoWidgets; // TODO: use children() from QObject instead
Q3VBox* m_actionBox;
Q3PtrList<QWidget> m_actionWidgets; // TODO: use children() from QObject instead
Q3ValueVector<KDEDesktopMimeType::Service> m_actionsVector;
};
// TODO #1: move to SidebarPage?
// TODO #2: quite same button from the optical point of view as URLNavigatorButton
// -> provide helper class or common base class
class ServiceButton : public QPushButton
{
Q_OBJECT
public:
ServiceButton(const QIcon& icon,
const QString& text,
QWidget* parent,
int index);
virtual ~ServiceButton();
signals:
void requestServiceStart(int index);
protected:
virtual void drawButton(QPainter* painter);
virtual void enterEvent(QEvent* event);
virtual void leaveEvent(QEvent* event);
private slots:
void slotReleased();
private:
bool m_hover;
int m_index;
};
#endif // _INFOSIDEBARPAGE_H_

191
src/itemeffectsmanager.cpp Normal file
View file

@ -0,0 +1,191 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "itemeffectsmanager.h"
#include <kiconeffect.h>
#include <kapplication.h>
#include <qobject.h>
//Added by qt3to4:
#include <QPixmap>
#include <kglobalsettings.h>
#include <qclipboard.h>
#include <kurldrag.h>
#include <klocale.h>
#include "dolphin.h"
#include "dolphinstatusbar.h"
ItemEffectsManager::ItemEffectsManager()
{
m_pixmapCopy = new QPixmap();
}
ItemEffectsManager::~ItemEffectsManager()
{
delete m_pixmapCopy;
m_pixmapCopy = 0;
m_highlightedURL = 0;
}
void ItemEffectsManager::zoomIn()
{
Dolphin::mainWin().refreshViews();
}
void ItemEffectsManager::zoomOut()
{
Dolphin::mainWin().refreshViews();
}
void ItemEffectsManager::activateItem(void* context)
{
KFileItem* fileInfo = contextFileInfo(context);
const KUrl itemURL(fileInfo->url());
if (m_highlightedURL == itemURL) {
// the item is already highlighted
return;
}
resetActivatedItem();
const QPixmap* itemPixmap = contextPixmap(context);
if (itemPixmap != 0) {
// remember the pixmap and item to be able to
// restore it to the old state later
*m_pixmapCopy = *itemPixmap;
m_highlightedURL = itemURL;
// apply an icon effect to the item below the mouse pointer
KIconEffect iconEffect;
QPixmap pixmap = iconEffect.apply(*itemPixmap,
KIcon::Desktop,
KIcon::ActiveState);
setContextPixmap(context, pixmap);
}
if (!Dolphin::mainWin().activeView()->hasSelection()) {
DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar();
statusBar->setMessage(statusBarText(fileInfo), DolphinStatusBar::Default);
}
}
void ItemEffectsManager::resetActivatedItem()
{
if (m_highlightedURL.isEmpty()) {
return;
}
for (void* context = firstContext(); context != 0; context = nextContext(context)) {
KUrl itemURL(contextFileInfo(context)->url());
if (itemURL == m_highlightedURL) {
// the highlighted item has been found and is restored to the default state
KIconEffect iconEffect;
QPixmap pixmap = iconEffect.apply(*m_pixmapCopy,
KIcon::Desktop,
KIcon::DefaultState);
// TODO: KFileIconView does not emit any signal when the preview has been finished.
// Hence check the size to prevent that a preview is hidden by restoring a
// non-preview pixmap.
const QPixmap* highlightedPixmap = contextPixmap(context);
const bool restore = (pixmap.width() == highlightedPixmap->width()) &&
(pixmap.height() == highlightedPixmap->height());
if (restore) {
setContextPixmap(context, pixmap);
}
break;
}
}
m_highlightedURL = 0;
DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar();
statusBar->clear();
}
void ItemEffectsManager::updateDisabledItems()
{
if (!m_disabledItems.isEmpty()) {
// restore all disabled items with their original pixmap
for (void* context = firstContext(); context != 0; context = nextContext(context)) {
const KFileItem* fileInfo = contextFileInfo(context);
const KUrl& fileURL = fileInfo->url();
Q3ValueListIterator<DisabledItem> it = m_disabledItems.begin();
while (it != m_disabledItems.end()) {
if (fileURL == (*it).url) {
setContextPixmap(context, (*it).pixmap);
}
++it;
}
}
m_disabledItems.clear();
}
if (!Dolphin::mainWin().clipboardContainsCutData()) {
return;
}
QClipboard* clipboard = QApplication::clipboard();
QMimeSource* data = clipboard->data();
if (!KUrlDrag::canDecode(data)) {
return;
}
// The clipboard contains items, which have been cutted. Change the pixmaps of all those
// items to the disabled state.
KUrl::List urls;
KUrlDrag::decode(data, urls);
for (void* context = firstContext(); context != 0; context = nextContext(context)) {
const KFileItem* fileInfo = contextFileInfo(context);
const KUrl& fileURL = fileInfo->url();
for(KUrl::List::ConstIterator it = urls.begin(); it != urls.end(); ++it) {
if (fileURL == (*it)) {
const QPixmap* itemPixmap = contextPixmap(context);
if (itemPixmap != 0) {
// remember old pixmap
DisabledItem disabledItem;
disabledItem.url = fileURL;
disabledItem.pixmap = *itemPixmap;
m_disabledItems.append(disabledItem);
KIconEffect iconEffect;
QPixmap disabledPixmap = iconEffect.apply(*itemPixmap,
KIcon::Desktop,
KIcon::DisabledState);
setContextPixmap(context, disabledPixmap);
}
break;
}
}
}
}
QString ItemEffectsManager::statusBarText(KFileItem* fileInfo) const
{
if (fileInfo->isDir()) {
// KFileItem::getStatusBar() returns "MyDocuments/ Folder" as
// status bar text for a folder 'MyDocuments'. This is adjusted
// to "MyDocuments (Folder)" in Dolphin.
return i18n("%1 (Folder)").arg(fileInfo->name());
}
return fileInfo->getStatusBarInfo();
}

120
src/itemeffectsmanager.h Normal file
View file

@ -0,0 +1,120 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef ITEMEFFECTSMANAGER_H
#define ITEMEFFECTSMANAGER_H
#include <qobject.h>
#include <qpixmap.h>
#include <kurl.h>
#include <q3valuelist.h>
class KFileItem;
/**
* @brief Abstract class to implement item effects for a Dolphin view.
*
* Derived classes must implement the following pure virtual methods:
* - ItemEffectsManager::setContextPixmap()
* - ItemEffectsManager::contextPixmap()
* - ItemEffectsManager::firstContext()
* - ItemEffectsManager::nextContext()
* - ItemEffectsManager::contextFileInfo()
*
* The item effects manager highlights currently active items and also
* respects cutted items. A 'context' is defined as abstract data type,
* which usually is represented by a KFileListViewItem or
* a KFileIconViewItem.
*
* In Qt4 the item effects manager should get integrated as part of Interview
* and hence no abstract context handling should be necessary anymore. The main
* purpose of the current interface is to prevent code duplication as there is
* no common model shared by QListView and QIconView of Qt3.
*
* @see DolphinIconsView
* @see DolphinDetailsView
* @author Peter Penz <peter.penz@gmx.at>
*/
class ItemEffectsManager
{
public:
ItemEffectsManager();
virtual ~ItemEffectsManager();
/** Is invoked before the items get updated. */
virtual void beginItemUpdates() = 0;
/** Is invoked after the items have been updated. */
virtual void endItemUpdates() = 0;
/**
* Increases the size of the current set view mode and refreshes
* all views. Derived implementations must invoke the base implementation
* if zooming in had been done.
*/
virtual void zoomIn();
/**
* Decreases the size of the current set view mode and refreshes
* all views. Derived implementations must invoke the base implementation
* if zooming out had been done.
*/
virtual void zoomOut();
/**
* Returns true, if zooming in is possible. If false is returned,
* the minimal zoom size is possible.
*/
virtual bool isZoomInPossible() const = 0;
/**
* Returns true, if zooming in is possible. If false is returned,
* the minimal zoom size is possible.
*/
virtual bool isZoomOutPossible() const = 0;
protected:
virtual void setContextPixmap(void* context,
const QPixmap& pixmap) = 0;
virtual const QPixmap* contextPixmap(void* context) = 0;
virtual void* firstContext() = 0;
virtual void* nextContext(void* context) = 0;
virtual KFileItem* contextFileInfo(void* context) = 0;
void activateItem(void* context);
void resetActivatedItem();
void updateDisabledItems();
private:
struct DisabledItem {
KUrl url;
QPixmap pixmap;
};
QPixmap* m_pixmapCopy;
KUrl m_highlightedURL;
// contains all items which have been disabled by a 'cut' operation
Q3ValueList<DisabledItem> m_disabledItems;
/** Returns the text for the statusbar for an activated item. */
QString statusBarText(KFileItem* fileInfo) const;
};
#endif

81
src/main.cpp Normal file
View file

@ -0,0 +1,81 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
* Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "dolphin.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <krun.h>
static KCmdLineOptions options[] =
{
{ "+[URL]", I18N_NOOP( "Document to open" ), 0 },
KCmdLineLastOption
};
int main(int argc, char **argv)
{
KAboutData about("dolphin",
I18N_NOOP("Dolphin"),
"0.8.0",
I18N_NOOP("File Manager"),
KAboutData::License_GPL,
"(C) 2006 Peter Penz");
about.setHomepage("http://enzosworld.gmxhome.de");
about.setBugAddress("peter.penz@gmx.at");
about.addAuthor("Peter Penz", I18N_NOOP("Maintainer and developer"), "peter.penz@gmx.at");
about.addAuthor("Cvetoslav Ludmiloff", I18N_NOOP("Developer"), "ludmiloff@gmail.com");
about.addAuthor("Stefan Monov", I18N_NOOP("Developer"), "logixoul@gmail.com");
about.addAuthor("Michael Austin", I18N_NOOP("Documentation"), "tuxedup@users.sourceforge.net");
about.addAuthor("Orville Bennett", I18N_NOOP("Documentation"), "obennett@hartford.edu");
about.addCredit("Aaron J. Seigo", I18N_NOOP("... for the great support and the amazing patches"));
about.addCredit("Patrice Tremblay and Gregor Kalisnik", I18N_NOOP("... for their patches"));
about.addCredit("Ain, Itai, Ivan, Stephane, Patrice, Piotr and Stefano",
I18N_NOOP("... for their translations"));
KCmdLineArgs::init(argc, argv, &about);
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
Dolphin& mainWin = Dolphin::mainWin();
mainWin.show();
if (false /* KDE4-TODO: app.isRestored() */) {
int n = 1;
while (KMainWindow::canBeRestored(n)){
Dolphin::mainWin().restore(n);
++n;
}
} else {
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
if (args->count() > 0) {
mainWin.activeView()->setURL(args->url(0));
for (int i = 1; i < args->count(); ++i) {
KRun::run("dolphin", args->url(i));
}
}
args->clear();
}
return app.exec();
}

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES preview.png DESTINATION ${DATA_INSTALL_DIR}/dolphin/icons/hicolor/128x128/actions )
#original Makefile.am contents follow:
#iconsdir = $(kde_datadir)/dolphin/icons/hicolor/128x128/actions
#icons_DATA = preview.png
#

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES preview.png editurl.png DESTINATION ${DATA_INSTALL_DIR}/dolphin/icons/hicolor/16x16/actions )
#original Makefile.am contents follow:
#iconsdir = $(kde_datadir)/dolphin/icons/hicolor/16x16/actions
#icons_DATA = preview.png editurl.png
#

BIN
src/pics/16x16/editurl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
src/pics/16x16/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES preview.png DESTINATION ${DATA_INSTALL_DIR}/dolphin/icons/hicolor/22x22/actions )
#original Makefile.am contents follow:
#iconsdir = $(kde_datadir)/dolphin/icons/hicolor/22x22/actions
#icons_DATA = preview.png
#

BIN
src/pics/22x22/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES preview.png DESTINATION ${DATA_INSTALL_DIR}/dolphin/icons/hicolor/32x32/actions )
#original Makefile.am contents follow:
#iconsdir = $(kde_datadir)/dolphin/icons/hicolor/32x32/actions
#icons_DATA = preview.png
#

BIN
src/pics/32x32/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES preview.png DESTINATION ${DATA_INSTALL_DIR}/dolphin/icons/hicolor/48x48/actions )
#original Makefile.am contents follow:
#iconsdir = $(kde_datadir)/dolphin/icons/hicolor/48x48/actions
#icons_DATA = preview.png
#

BIN
src/pics/48x48/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES preview.png DESTINATION ${DATA_INSTALL_DIR}/dolphin/icons/hicolor/64x64/actions )
#original Makefile.am contents follow:
#iconsdir = $(kde_datadir)/dolphin/icons/hicolor/64x64/actions
#icons_DATA = preview.png
#

BIN
src/pics/64x64/preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

19
src/pics/CMakeLists.txt Normal file
View file

@ -0,0 +1,19 @@
add_subdirectory( 128x128 )
add_subdirectory( 64x64 )
add_subdirectory( 48x48 )
add_subdirectory( 32x32 )
add_subdirectory( 22x22 )
add_subdirectory( 16x16 )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
#original Makefile.am contents follow:
#SUBDIRS = 128x128 64x64 48x48 32x32 22x22 16x16

59
src/pixmapviewer.cpp Normal file
View file

@ -0,0 +1,59 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "pixmapviewer.h"
#include <kglobalsettings.h>
#include <kiconloader.h>
#include <qpainter.h>
//Added by qt3to4:
#include <QPixmap>
#include <QPaintEvent>
PixmapViewer::PixmapViewer(QWidget* parent) :
QWidget(parent)
{
setMinimumWidth(KIcon::SizeEnormous);
setMinimumWidth(KIcon::SizeEnormous);
}
PixmapViewer::~PixmapViewer()
{
}
void PixmapViewer::setPixmap(const QPixmap& pixmap)
{
m_pixmap = pixmap;
update();
}
void PixmapViewer::paintEvent(QPaintEvent* event)
{
QWidget::paintEvent(event);
QPainter painter;
painter.begin(this);
const int x = (width() - m_pixmap.width()) / 2;
const int y = (height() - m_pixmap.height()) / 2;
painter.drawPixmap(x, y, m_pixmap);
painter.end();
}
#include "pixmapviewer.moc"

52
src/pixmapviewer.h Normal file
View file

@ -0,0 +1,52 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef PIXMAPVIEWER_H
#define PIXMAPVIEWER_H
#include <qwidget.h>
#include <qpixmap.h>
//Added by qt3to4:
#include <QPaintEvent>
/**
* @brief Widget which shows a pixmap centered inside the boundaries.
*
* @see IconsViewSettingsPage
* @author Peter Penz <peter.penz@gmx.at>
*/
class PixmapViewer : public QWidget
{
Q_OBJECT
public:
PixmapViewer(QWidget* parent);
virtual ~PixmapViewer();
void setPixmap(const QPixmap& pixmap);
const QPixmap& pixmap() const { return m_pixmap; }
protected:
virtual void paintEvent(QPaintEvent* event);
private:
QPixmap m_pixmap;
};
#endif

445
src/portinglog.txt Normal file
View file

@ -0,0 +1,445 @@
Log for qt3to4 on Mo Nov 13 07:24:50 2006. Number of log entries: 101
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkselector.h at line 30 column 16: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkselector.h at line 67 column 14: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkselector.h: Added the following include directives:
#include <Q3PopupMenu>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.h at line 25 column 20: qvaluelist.h -> q3valuelist.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.h at line 29 column 19: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.h at line 46 column 48: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.h at line 54 column 42: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h at line 26 column 18: qlistbox.h -> q3listbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h at line 49 column 56: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h at line 52 column 46: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h at line 68 column 40: QListBox -> Q3ListBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h at line 82 column 42: QListBoxPixmap -> Q3ListBoxPixmap
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h at line 87 column 37: QListBox -> Q3ListBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.h: Added the following include directives:
#include <QPaintEvent> #include <QPixmap>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.h at line 24 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.h at line 32 column 44: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.h at line 27 column 20: qvaluelist.h -> q3valuelist.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.h at line 29 column 22: qvaluevector.h -> q3valuevector.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.h at line 59 column 40: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.h at line 63 column 38: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h at line 69 column 41: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h at line 98 column 33: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h at line 155 column 47: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h at line 161 column 38: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h at line 171 column 37: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h at line 191 column 41: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.h: Added the following include directives:
#include <QPixmap> #include <QResizeEvent> #include <QEvent> #include <QDropEvent> #include <QMouseEvent> #include <QDragMoveEvent> #include <QPaintEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindirlister.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 33 column 20: qvaluelist.h -> q3valuelist.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 34 column 18: qptrlist.h -> q3ptrlist.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 45 column 11: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 46 column 19: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 78 column 18: QPtrList -> Q3PtrList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 315 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h at line 327 column 12: QPtrList -> Q3PtrList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.h: Added the following include directives:
#include <QCloseEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.h at line 113 column 23: QDragObject -> Q3DragObject
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.h at line 126 column 33: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.h at line 132 column 47: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.h at line 136 column 38: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.h: Added the following include directives:
#include <QDragEnterEvent> #include <QDropEvent> #include <QMouseEvent> #include <QDragMoveEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettingsdialog.h
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinstatusbar.h at line 26 column 15: qhbox.h -> q3hbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinstatusbar.h at line 36 column 37: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinstatusbar.h: Added the following include directives:
#include <QLabel>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 42 column 19: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 43 column 19: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 44 column 17: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 52 column 17: QScrollView -> Q3ScrollView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 133 column 20: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 247 column 43: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 248 column 45: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 251 column 45: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 275 column 15: QScrollView -> Q3ScrollView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h at line 292 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.h: Added the following include directives:
#include <QDropEvent> #include <Q3ValueList> #include <QMouseEvent> #include <Q3VBoxLayout>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/filterbar.h: Added the following include directives:
#include <QKeyEvent> #include <QLabel>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.h at line 24 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.h at line 36 column 42: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 30 column 22: qvaluevector.h -> q3valuevector.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 42 column 14: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 47 column 11: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 48 column 11: QGrid -> Q3Grid
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 120 column 9: QGrid -> Q3Grid
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 121 column 12: QPtrList -> Q3PtrList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 123 column 9: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 124 column 12: QPtrList -> Q3PtrList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 125 column 16: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h at line 136 column 32: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.h: Added the following include directives:
#include <QPixmap> #include <QEvent> #include <QLabel> #include <Q3PtrList>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/itemeffectsmanager.h at line 27 column 20: qvaluelist.h -> q3valuelist.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/itemeffectsmanager.h at line 77 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/pixmapviewer.h: Added the following include directives:
#include <QPaintEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/progressindicator.h
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/protocolcombo.h
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/renamedialog.h
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/settingspagebase.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebar.h at line 30 column 17: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebar.h at line 56 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebar.h: Added the following include directives:
#include <Q3VBoxLayout>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebarpage.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarmessagelabel.h: Added the following include directives:
#include <QPaintEvent> #include <QResizeEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarspaceinfo.h: Added the following include directives:
#include <QPaintEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/undomanager.h at line 25 column 20: qvaluelist.h -> q3valuelist.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/undomanager.h at line 117 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.h: Added the following include directives:
#include <QEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigatorbutton.h: Added the following include directives:
#include <QEvent> #include <QDragLeaveEvent> #include <QDropEvent> #include <QDragEnterEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 29 column 15: qhbox.h -> q3hbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 36 column 16: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 48 column 18: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 50 column 33: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 93 column 20: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 143 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h at line 150 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.h: Added the following include directives:
#include <QLabel> #include <Q3ValueList> #include <QKeyEvent> #include <Q3PopupMenu>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.h at line 26 column 18: QButtonGroup -> Q3ButtonGroup
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewproperties.h
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewsettingspage.h
Log for qt3to4 on Mo Nov 13 07:25:00 2006. Number of log entries: 301
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkselector.cpp at line 23 column 20: qpopupmenu.h -> q3popupmenu.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkselector.cpp at line 43 column 36: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 31 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 51 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 51 column 44: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 55 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 55 column 27: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 64 column 39: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 70 column 52: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 71 column 56: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 72 column 58: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 73 column 62: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 75 column 9: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 75 column 32: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 115 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 117 column 21: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 117 column 47: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 155 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 169 column 23: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 184 column 67: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 191 column 61: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 206 column 21: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 206 column 47: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 213 column 21: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 225 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 242 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 244 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 269 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 272 column 21: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 289 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp at line 291 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssettingspage.cpp: Added the following include directives:
#include <QPixmap> #include <Q3VBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 26 column 18: qlistbox.h -> q3listbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 30 column 20: qpopupmenu.h -> q3popupmenu.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 46 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 46 column 41: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 51 column 72: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 52 column 63: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 53 column 69: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 54 column 60: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 93 column 74: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 104 column 64: QListBoxItem -> Q3ListBoxItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 112 column 14: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 112 column 38: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 251 column 12: QListBox -> Q3ListBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 265 column 18: QListBoxPixmap -> Q3ListBoxPixmap
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 273 column 39: QListBox -> Q3ListBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp at line 275 column 25: QListBoxPixmap -> Q3ListBoxPixmap
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/bookmarkssidebarpage.cpp: Added the following include directives:
#include <QPixmap> #include <Q3VBoxLayout> #include <QPaintEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 28 column 15: qgrid.h -> q3grid.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 30 column 22: qbuttongroup.h -> q3buttongroup.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 33 column 19: qgroupbox.h -> q3groupbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 34 column 19: qgroupbox.h -> q3groupbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 40 column 9: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 60 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 60 column 43: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 64 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 64 column 43: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 78 column 16: QButtonGroup -> Q3ButtonGroup
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 78 column 50: QButtonGroup -> Q3ButtonGroup
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 105 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/detailsviewsettingspage.cpp at line 105 column 40: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 97 column 20: QPtrListIterator -> Q3PtrListIterator
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 219 column 16: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 223 column 16: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 268 column 56: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 336 column 55: QValueVector -> Q3ValueVector
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 404 column 34: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 407 column 34: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp at line 442 column 26: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphincontextmenu.cpp: Added the following include directives:
#include <Q3ValueList>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp at line 59 column 21: qdragobject.h -> q3dragobject.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp at line 632 column 15: QDragObject -> Q3DragObject
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp at line 640 column 15: QDragObject -> Q3DragObject
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp at line 990 column 18: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp at line 991 column 24: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp at line 1452 column 20: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphin.cpp: Added the following include directives:
#include <Q3ValueList> #include <QCloseEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 34 column 21: qobjectlist.h -> qobject.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 35 column 17: qheader.h -> q3header.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 66 column 33: QScrollView -> Q3ScrollView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 75 column 45: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 76 column 47: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 79 column 59: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 80 column 61: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 85 column 50: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 86 column 52: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 94 column 11: QHeader -> Q3Header
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 101 column 36: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 129 column 20: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 143 column 77: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 161 column 57: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 243 column 49: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 351 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 393 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 426 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 525 column 63: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 561 column 17: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 625 column 26: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 645 column 54: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 686 column 70: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 744 column 19: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 758 column 21: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 764 column 29: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 773 column 25: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 790 column 13: QListView -> Q3ListView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp at line 803 column 57: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindetailsview.cpp: Added the following include directives:
#include <Q3ValueList> #include <QPixmap> #include <QDragMoveEvent> #include <QDropEvent> #include <QResizeEvent> #include <QMouseEvent> #include <QEvent> #include <QPaintEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphindirlister.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 32 column 21: qobjectlist.h -> qobject.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 59 column 45: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 60 column 47: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 63 column 59: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 64 column 61: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 69 column 50: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 70 column 52: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 129 column 20: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 144 column 19: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 145 column 56: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 145 column 81: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 146 column 19: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 146 column 68: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 147 column 52: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 148 column 52: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 238 column 75: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 308 column 11: QDragObject -> Q3DragObject
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 332 column 15: QDragObject -> Q3DragObject
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 420 column 47: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 435 column 61: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp at line 445 column 52: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphiniconsview.cpp: Added the following include directives:
#include <QDragMoveEvent> #include <QDropEvent> #include <Q3ValueList> #include <QPixmap> #include <QMouseEvent> #include <QDragEnterEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 96 column 19: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 97 column 56: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 97 column 81: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 101 column 32: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 118 column 39: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 135 column 19: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 136 column 56: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 136 column 81: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 142 column 32: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettings.cpp at line 150 column 39: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettingsdialog.cpp at line 36 column 10: QFrame -> Q3Frame
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettingsdialog.cpp at line 42 column 10: QFrame -> Q3Frame
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettingsdialog.cpp at line 48 column 10: QFrame -> Q3Frame
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinsettingsdialog.cpp: Added the following include directives:
#include <Q3Frame>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinstatusbar.cpp at line 32 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 66 column 33: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 283 column 25: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 488 column 16: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 648 column 52: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 650 column 21: ButtonState -> Qt::ButtonState
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 651 column 64: ShiftButton -> Qt::ShiftModifier
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 652 column 66: ControlButton -> Qt::ControlModifier
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 661 column 54: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 680 column 54: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 849 column 58: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 850 column 61: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 851 column 63: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 852 column 61: QIconViewItem -> Q3IconViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 867 column 60: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 868 column 63: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 869 column 65: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 870 column 63: QListViewItem -> Q3ListViewItem
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 894 column 11: QScrollView -> Q3ScrollView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 896 column 60: QScrollView -> Q3ScrollView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp at line 897 column 60: QScrollView -> Q3ScrollView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/dolphinview.cpp: Added the following include directives:
#include <Q3ValueList> #include <QDropEvent> #include <QMouseEvent> #include <Q3VBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 24 column 15: qgrid.h -> q3grid.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 34 column 15: qhbox.h -> q3hbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 68 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 68 column 44: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 70 column 9: QGrid -> Q3Grid
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 70 column 27: QGrid -> Q3Grid
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 90 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp at line 90 column 34: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/editbookmarkdialog.cpp: Added the following include directives:
#include <Q3VBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/filterbar.cpp at line 42 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/filterbar.cpp at line 42 column 38: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/filterbar.cpp at line 45 column 15: QHBoxLayout -> Q3HBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/filterbar.cpp at line 45 column 41: QHBoxLayout -> Q3HBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/filterbar.cpp: Added the following include directives:
#include <Q3VBoxLayout> #include <QKeyEvent> #include <Q3HBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 29 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 30 column 15: qgrid.h -> q3grid.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 31 column 19: qgroupbox.h -> q3groupbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 34 column 22: qbuttongroup.h -> q3buttongroup.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 50 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 50 column 44: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 58 column 9: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 58 column 27: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 65 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 65 column 40: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 69 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 69 column 33: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 80 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 80 column 32: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 91 column 16: QButtonGroup -> Q3ButtonGroup
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp at line 91 column 48: QButtonGroup -> Q3ButtonGroup
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/generalsettingspage.cpp: Added the following include directives:
#include <Q3VBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 25 column 22: qbuttongroup.h -> q3buttongroup.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 43 column 9: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 64 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 64 column 34: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 69 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 69 column 44: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 75 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 75 column 35: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 93 column 17: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 93 column 51: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 97 column 13: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 97 column 42: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 115 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 115 column 40: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 137 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 137 column 40: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/iconsviewsettingspage.cpp at line 141 column 77: QIconView -> Q3IconView
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 32 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 33 column 20: qvgroupbox.h -> q3vgroupbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 34 column 20: qpopupmenu.h -> q3popupmenu.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 37 column 15: qgrid.h -> q3grid.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 38 column 20: qhgroupbox.h -> q3hgroupbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 70 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 70 column 41: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 86 column 34: QHGroupBox -> Q3HGroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 90 column 26: QGrid -> Q3Grid
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 93 column 34: QHGroupBox -> Q3HGroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 97 column 27: QVBox -> Q3VBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 324 column 24: QPtrListIterator -> Q3PtrListIterator
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 414 column 20: QPtrListIterator -> Q3PtrListIterator
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 489 column 34: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 492 column 50: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 503 column 34: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 507 column 34: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 534 column 43: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 543 column 26: QWidget -> Qt
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 578 column 18: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 580 column 54: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp at line 580 column 71: QIconSet -> QIcon
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/infosidebarpage.cpp: Added the following include directives:
#include <Q3ValueList> #include <QEvent> #include <Q3VBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/itemeffectsmanager.cpp at line 26 column 21: qobjectlist.h -> qobject.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/itemeffectsmanager.cpp at line 131 column 30: QValueListIterator -> Q3ValueListIterator
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/itemeffectsmanager.cpp: Added the following include directives:
#include <QPixmap>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/main.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/pixmapviewer.cpp: Added the following include directives:
#include <QPixmap> #include <QPaintEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/progressindicator.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/protocolcombo.cpp at line 20 column 20: qpopupmenu.h -> q3popupmenu.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/protocolcombo.cpp at line 33 column 13: qHeapSort -> qSort
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/protocolcombo.cpp at line 36 column 14: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/protocolcombo.cpp at line 36 column 37: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/renamedialog.cpp at line 27 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/renamedialog.cpp at line 37 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/renamedialog.cpp at line 37 column 44: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/renamedialog.cpp: Added the following include directives:
#include <Q3VBoxLayout>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/settingspagebase.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebar.cpp at line 43 column 30: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebar.cpp: Added the following include directives:
#include <Q3VBoxLayout>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/sidebarpage.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarmessagelabel.cpp at line 200 column 74: WordBreak -> TextWordWrap
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarmessagelabel.cpp: Added the following include directives:
#include <QPixmap> #include <QResizeEvent> #include <QPaintEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarspaceinfo.cpp: Added the following include directives:
#include <QPaintEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/undomanager.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 42 column 26: QWidget -> Qt
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 94 column 17: red -> Qt::red
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 94 column 29: red -> Qt::red
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 94 column 42: red -> Qt::red
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 95 column 19: green -> Qt::green
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 95 column 31: green -> Qt::green
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 95 column 44: green -> Qt::green
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 96 column 18: blue -> Qt::blue
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 96 column 30: blue -> Qt::blue
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 96 column 43: blue -> Qt::blue
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 97 column 21: red -> Qt::red
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 97 column 28: green -> Qt::green
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp at line 97 column 34: blue -> Qt::blue
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlbutton.cpp: Added the following include directives:
#include <QEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigatorbutton.cpp at line 338 column 14: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigatorbutton.cpp at line 338 column 41: QPopupMenu -> Q3PopupMenu
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigatorbutton.cpp: Added the following include directives:
#include <QDropEvent> #include <QDragLeaveEvent> #include <Q3PopupMenu> #include <QEvent> #include <QDragEnterEvent>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 32 column 18: qlistbox.h -> q3listbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 34 column 21: qobjectlist.h -> qobject.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 35 column 20: qpopupmenu.h -> q3popupmenu.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 81 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 164 column 28: QValueListIterator -> Q3ValueListIterator
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 202 column 16: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 271 column 9: QHBox -> Q3HBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 360 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp at line 443 column 14: QValueList -> Q3ValueList
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigator.cpp: Added the following include directives:
#include <Q3ValueList> #include <QKeyEvent>
No changes made to file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewproperties.cpp
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 27 column 15: qvbox.h -> q3vbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 28 column 22: qbuttongroup.h -> q3buttongroup.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 33 column 19: qgroupbox.h -> q3groupbox.h
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 57 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 57 column 44: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 60 column 13: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 60 column 41: QGroupBox -> Q3GroupBox
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 97 column 16: QButtonGroup -> Q3ButtonGroup
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp at line 97 column 48: QButtonGroup -> Q3ButtonGroup
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewpropertiesdialog.cpp: Added the following include directives:
#include <Q3VBoxLayout>
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewsettingspage.cpp at line 38 column 15: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewsettingspage.cpp at line 38 column 44: QVBoxLayout -> Q3VBoxLayout
In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/viewsettingspage.cpp: Added the following include directives:
#include <Q3VBoxLayout>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="dolphinrc"/>
<include>kiconloader.h</include>
<group name="PreviewsMode">
<entry name="Arrangement" type="String">
<label>Arrangement</label>
<default>LeftToRight</default>
</entry>
<entry name="FontFamily" type="String">
<label>Font family</label>
<default code="true">KGlobalSettings::generalFont().family()</default>
</entry>
<entry name="FontSize" type="Int">
<label>Font size</label>
<default code="true">KGlobalSettings::generalFont().pointSize()</default>
</entry>
<entry name="GridHeight" type="Int">
<label>Grid height</label>
</entry>
<entry name="GridWidth" type="Int">
<label>Grid width</label>
</entry>
<entry name="GridSpacing" type="Int">
<label>Grid spacing</label>
</entry>
<entry name="IconSize" type="Int">
<label>Icon size</label>
<default code="true">KIcon::SizeMedium</default>
</entry>
<entry name="NumberOfTexlines" type="Int">
<label>Number of textlines</label>
<default>2</default>
</entry>
<entry name="PreviewSize" type="Int">
<label>Preview size</label>
<default code="true">KIcon::SizeMedium</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,4 @@
File=previewsmodesettings.kcfg
ClassName=PreviewsModeSettings
Singleton=false
Mutators=true

80
src/progressindicator.cpp Normal file
View file

@ -0,0 +1,80 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "progressindicator.h"
#include "dolphin.h"
#include "dolphinstatusbar.h"
ProgressIndicator::ProgressIndicator(const QString& progressText,
const QString& finishedText,
int operationsCount)
: m_showProgress(false),
m_operationsCount(operationsCount),
m_operationsIndex(0),
m_startTime(QTime::currentTime()),
m_finishedText(finishedText)
{
DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar();
statusBar->clear();
statusBar->setProgressText(progressText);
statusBar->setProgress(0);
}
ProgressIndicator::~ProgressIndicator()
{
DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar();
statusBar->setProgressText(QString::null);
statusBar->setProgress(100);
statusBar->setMessage(m_finishedText, DolphinStatusBar::OperationCompleted);
if (m_showProgress) {
Dolphin::mainWin().setEnabled(true);
}
}
void ProgressIndicator::execOperation()
{
++m_operationsIndex;
if (!m_showProgress) {
const int elapsed = m_startTime.msecsTo(QTime::currentTime());
if (elapsed > 500) {
// the operations took already more than 500 milliseconds,
// therefore show a progress indication
Dolphin::mainWin().setEnabled(false);
m_showProgress = true;
}
}
if (m_showProgress) {
const QTime currentTime = QTime::currentTime();
if (m_startTime.msecsTo(currentTime) > 100) {
m_startTime = currentTime;
DolphinStatusBar* statusBar = Dolphin::mainWin().activeView()->statusBar();
statusBar->setProgress((m_operationsIndex * 100) / m_operationsCount);
kapp->processEvents();
statusBar->repaint();
}
}
}

78
src/progressindicator.h Normal file
View file

@ -0,0 +1,78 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef PROGRESSINDICATOR_H
#define PROGRESSINDICATOR_H
#include <qdatetime.h>
/**
* Allows to show a progress of synchronous operations. Sample code:
* \code
* const int operationsCount = 100;
* ProgressIndicator progressIndicator(i18n("Loading..."),
* i18n("Loading finished."),
* operationsCount);
* for (int i = 0; i < operationsCount; ++i) {
* progressIndicator.execOperation();
* // do synchronous operation...
* }
* \endcode
* The progress indicator takes care to show the progress bar only after
* a delay of around 500 milliseconds. This means if all operations are
* executing within 500 milliseconds, no progress bar is shown at all.
* As soon as the progress bar is shown, the application still may process
* events, but the the Dolphin main widget is disabled.
*
* @author Peter Penz <peter.penz@gmx.at>
*/
class ProgressIndicator
{
public:
/**
* @param progressText Text for the progress bar (e. g. "Loading...").
* @param finishedText Text which is displayed after the operations have been finished
* (e. g. "Loading finished.").
* @param operationsCount Number of operations.
*/
ProgressIndicator(const QString& progressText,
const QString& finishedText,
int operationsCount);
/**
* Sets the progress to 100 % and displays the 'finishedText' property
* in the status bar.
*/
~ProgressIndicator();
/**
* Increases the progress and should be invoked
* before each operation.
*/
void execOperation();
private:
bool m_showProgress;
int m_operationsCount;
int m_operationsIndex;
QTime m_startTime;
QString m_finishedText;
};
#endif

114
src/protocolcombo.cpp Normal file
View file

@ -0,0 +1,114 @@
/***************************************************************************
* Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <q3popupmenu.h>
#include <kdebug.h>
#include <kprotocolinfo.h>
#include "protocolcombo.h"
const static int customProtocolIndex = 0;
ProtocolCombo::ProtocolCombo(const QString& protocol, URLNavigator* parent)
: URLNavigatorButton(-1, parent),
m_protocols(KProtocolInfo::protocols())
{
qSort(m_protocols);
QStringList::iterator it = m_protocols.begin();
QStringList::iterator itEnd = m_protocols.end();
Q3PopupMenu* menu = new Q3PopupMenu(this);
while (it != itEnd)
{
//kdDebug() << "info for " << *it << " "
// << KProtocolInfo::protocolClass(*it) << endl;
//TODO: wow this is ugly. or .. is it? ;) we need a way to determine
// if a protocol is appropriate for use in a file manager. hum!
//if (KProtocolInfo::capabilities(*it).findIndex("filemanager") == -1)
if (KProtocolInfo::protocolClass(*it) == ":" ||
!KProtocolInfo::supportsWriting(*it))
{
//kdDebug() << "!!! removing " << *it << endl;
QStringList::iterator tempIt = it;
++tempIt;
m_protocols.remove(it);
it = tempIt;
}
else
{
++it;
}
}
// setEditable(true);
// menu->insertItem("", customProtocolIndex);
// menu->insertStringList(m_protocols);
int i = 0;
for (QStringList::const_iterator it = m_protocols.constBegin();
it != m_protocols.constEnd();
++it, ++i)
{
menu->insertItem(*it, i);
}
//menu->insertItems(m_protocols);
connect(menu, SIGNAL(activated(int)), this, SLOT(setProtocol(int)));
setText(protocol);
setPopup(menu);
setFlat(true);
}
// #include <kurl.h>
// #include "urlnavigator.h"
void ProtocolCombo::setProtocol(const QString& protocol)
{
setText(protocol);
// if (KProtocolInfo::isKnownProtocol(protocol))
// int index = m_protocols.findIndex(protocol);
// if (index == -1)
// {
// changeItem(protocol, customProtocolIndex);
// setCurrentItem(customProtocolIndex);
// }
// else
// {
// setCurrentItem(index + 1);
// }
}
void ProtocolCombo::setProtocol(int index)
{
if (index < 0 || index > m_protocols.count())
{
return;
}
QString protocol = m_protocols[index];
kdDebug() << "setProtocol " << index << " " << protocol << endl;
setText(protocol);
emit activated(protocol);
/* */
}
QString ProtocolCombo::currentProtocol() const
{
return text(); //currentText();
}
#include "protocolcombo.moc"

51
src/protocolcombo.h Normal file
View file

@ -0,0 +1,51 @@
/***************************************************************************
* Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef PROTOCOLCOMBO_H
#define PROTOCOLCOMBO_H
//#include <qcombobox.h>
#include "urlbutton.h"
#include "urlnavigatorbutton.h"
class URLNavigator;
/**
* A combobox listing available protocols
*/
class ProtocolCombo : public URLNavigatorButton
{
Q_OBJECT
public:
ProtocolCombo(const QString& protocol, URLNavigator* parent = 0);
QString currentProtocol() const;
public slots:
void setProtocol(const QString& protocol);
void setProtocol(int index);
signals:
void activated(const QString& protocol);
private:
QStringList m_protocols;
};
#endif

91
src/renamedialog.cpp Normal file
View file

@ -0,0 +1,91 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "renamedialog.h"
#include <klocale.h>
#include <qlabel.h>
#include <qlayout.h>
#include <q3vbox.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <assert.h>
#include <klineedit.h>
RenameDialog::RenameDialog(const KUrl::List& items) :
KDialogBase(Plain, i18n("Rename Items"),
Ok|Cancel, Ok)
{
setButtonOK(KGuiItem(i18n("Rename"), "apply"));
Q3VBoxLayout* topLayout = new Q3VBoxLayout(plainPage(), 0, spacingHint());
topLayout->setMargin(KDialog::marginHint());
const int itemCount = items.count();
QLabel* editLabel = new QLabel(i18n("Rename the %1 selected items to:").arg(itemCount),
plainPage());
m_lineEdit = new KLineEdit(plainPage());
m_newName = i18n("New name #");
assert(itemCount > 1);
QString postfix(items[0].prettyURL().section('.',1));
if (postfix.length() > 0) {
// The first item seems to have a postfix (e. g. 'jpg' or 'txt'). Now
// check whether all other items have the same postfix. If this is the
// case, add this postfix to the name suggestion.
postfix.insert(0, '.');
for (int i = 1; i < itemCount; ++i) {
if (!items[i].prettyURL().contains(postfix)) {
// at least one item does not have the same postfix
postfix.truncate(0);
break;
}
}
}
const int selectionLength = m_newName.length();
if (postfix.length() > 0) {
m_newName.append(postfix);
}
m_lineEdit->setText(m_newName);
m_lineEdit->setSelection(0, selectionLength - 1);
m_lineEdit->setFocus();
QLabel* infoLabel = new QLabel(i18n("(# will be replaced by ascending numbers)"), plainPage());
topLayout->addWidget(editLabel);
topLayout->addWidget(m_lineEdit);
topLayout->addWidget(infoLabel);
}
RenameDialog::~RenameDialog()
{
}
void RenameDialog::slotOk()
{
m_newName = m_lineEdit->text();
if (m_newName.contains('#') != 1) {
m_newName.truncate(0);
}
KDialogBase::slotOk();
}
#include "renamedialog.moc"

67
src/renamedialog.h Normal file
View file

@ -0,0 +1,67 @@
/***************************************************************************
* Copyright (C) 2006 by Peter Penz *
* peter.penz@gmx.at *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef RENAMEDIALOG_H
#define RENAMEDIALOG_H
#include <kdialog.h>
#include <kurl.h>
#include <qstring.h>
class KLineEdit;
/**
* @brief Dialog for renaming a variable number of files.
*
* The renaming is not done by the dialog, the invoker
* must do this itself:
* \code
* RenameDialog dialog(...);
* if (dialog.exec() == QDialog::Accepted) {
* const QString& newName = dialog.newName();
* // ... rename items corresponding to the new name
* }
* \endcode
* @author Peter Penz
*/
class RenameDialog : public KDialog
{
Q_OBJECT
public:
RenameDialog(const KUrl::List& items);
virtual ~RenameDialog();
/**
* Returns the new name of the items. If the returned string is not empty,
* then it is assured that the string contains exactly one character #,
* which should be replaced by ascending numbers. An empty string indicates
* that the user has removed the # character.
*/
const QString& newName() const { return m_newName; }
protected slots:
virtual void slotOk();
private:
KLineEdit* m_lineEdit;
QString m_newName;
};
#endif

View file

@ -0,0 +1,15 @@
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install( FILES amarok_append.desktop ark_compress.desktop ark_extract.desktop floppy_format.desktop imageconverter.desktop installfont.desktop isoservice.desktop jpegorient.desktop k3b_create_audio_cd.desktop k3b_create_video_cd.desktop k3b_write_bin_image.desktop k3b_write_iso_image.desktop mail_as_attachment.desktop media_eject.desktop media_mount.desktop media_realfolder.desktop media_safelyremove.desktop media_unmount.desktop open_in_digikam.desktop dolphin_su.desktop DESTINATION ${DATA_INSTALL_DIR}/dolphin/servicemenus )
#original Makefile.am contents follow:
#servicemenusdir = $(kde_datadir)/dolphin/servicemenus
#servicemenus_DATA = amarok_append.desktop ark_compress.desktop ark_extract.desktop floppy_format.desktop imageconverter.desktop installfont.desktop isoservice.desktop jpegorient.desktop k3b_create_audio_cd.desktop k3b_create_video_cd.desktop k3b_write_bin_image.desktop k3b_write_iso_image.desktop mail_as_attachment.desktop media_eject.desktop media_mount.desktop media_realfolder.desktop media_safelyremove.desktop media_unmount.desktop open_in_digikam.desktop dolphin_su.desktop
#

View file

@ -0,0 +1,93 @@
[Desktop Entry]
ServiceTypes=application/asx,audio/*
Actions=appendToPlaylist;appendAndPlay;queueTrack;
X-KDE-Submenu=Amarok
X-KDE-Submenu[bn]=
X-KDE-Submenu[pa]=
X-KDE-Submenu[xx]=xxAmarokxx
[Desktop Action appendToPlaylist]
Name=Append to Playlist
Name[bg]=Добавяне към списъка с песни
Name[bn]=-ি
Name[br]=Ouzhpennañ d'ar roll tonioù
Name[cs]=Přidat do seznamu skladeb
Name[da]=Tilføj til spilleliste
Name[de]=An Amarok-Wiedergabeliste anhängen
Name[el]=Προσθήκη στη λίστα αναπαραγωγής
Name[et]=Lisa lugude nimekirja
Name[fi]=Lisää soittolistaan
Name[fr]=Ajouter à la liste de lecture
Name[ga]=Iarcheangail le Seinmliosta
Name[it]=Aggiungi alla playlist
Name[ja]=
Name[km]=
Name[nl]=Toevoegen aanafspeellijst
Name[pa]=- '
Name[pl]=Dołącz do listy odtwarzania
Name[pt]=Adicionar à Lista do Amarok
Name[pt_BR]=Anexar à Lista de Músicas
Name[sv]=Lägg till i spellistan
Name[uk]=Додати до списку композицій
Name[uz]=Қўшиқ рўйхатига қўшиш
Name[xx]=xxAppend to Playlistxx
Name[zh_CN]=
Icon=amarok
Exec=amarok -e %U
[Desktop Action appendAndPlay]
Name=Append & Play
Name[bg]=Добавяне и възпроизвеждане
Name[bn]=
Name[br]=Ouzhpennañ ha seniñ
Name[cs]=Připojit a hrát
Name[da]=Tilføj og spil
Name[de]=Anhängen und abspielen
Name[el]=Προσθήκη & αναπαραγωγή
Name[et]=Lisa ja esita
Name[fi]=Lisää soittolistaan ja toista
Name[fr]=Ajouter & Écouter
Name[ga]=Iarcheangail & Seinn
Name[it]=Aggiungi & Riproduci
Name[ja]=
Name[km]= &
Name[nl]=Toevoegen en afspelen
Name[pa]=
Name[pl]=Dołącz i odtwórz
Name[pt]=Adicionar & Reproduzir
Name[pt_BR]=Anexar & Reproduzir
Name[sv]=Lägg till och spela
Name[uk]=Додати і програти
Name[uz]=Қўшиш ва ўйнаш
Name[xx]=xxAppend & Playxx
Name[zh_CN]=
Icon=amarok
Exec=dcop amarok playlist playMedia %U
[Desktop Action queueTrack]
Name=Queue Track
Name[bg]=Добавяне и възпроизвеждане
Name[bn]= ি
Name[cs]=Zařadit skladbu
Name[da]=Sæt spor i kø
Name[de]=Stück in Warteschlange einstellen
Name[el]=Εισαγωγή του κομματιού στην ουρά
Name[et]=Sea pala järjekorda
Name[fi]=Lisää jonoon
Name[fr]=Ajouter à la file d'attente
Name[ga]=Ciúáil Amhrán
Name[it]=Accoda traccia
Name[ja]=
Name[km]=
Name[nl]=Track in wachtrij plaatsen
Name[pa]= '
Name[pl]=Wstaw utwór do kolejki
Name[pt]=Pôr a Faixa na Fila
Name[pt_BR]=Faixa para Fila
Name[sv]=Köa spår
Name[uk]=Додати доріжку в чергу
Name[uz]=Навбатга қўйиш
Name[xx]=xxQueue Trackxx
Name[zh_CN]=
Icon=amarok
Exec=amarok --queue %U

View file

@ -0,0 +1,11 @@
[Desktop Entry]
X-SuSE-translate=true
Encoding=UTF-8
ServiceTypes=inode/directory
Actions=compressHere
[Desktop Action compressHere]
Name=Compress Here
Name[de]=Hierher komprimieren
Exec=ark --add-to %u %u.tar.gz
Icon=ark

View file

@ -0,0 +1,13 @@
[Desktop Entry]
X-SuSE-translate=true
Encoding=UTF-8
ServiceTypes=application/x-tbz,application/x-tgz
Actions=extractHere
[Desktop Action extractHere]
Name=Extract Here
Name[de]=Hierher extrahieren
Exec=ark --extract-to %d %u
Icon=ark

View file

@ -0,0 +1,10 @@
[Desktop Entry]
ServiceTypes=inode/directory
Actions=DolphinSU;
[Desktop Action DolphinSU]
ServiceTypes=inode/directory
Name=Open as Root
Name[de]=Öffne als Root
Icon=dolphin
Exec=kdesu -c 'dolphin %U'

View file

@ -0,0 +1,36 @@
[Desktop Action Format]
Exec=kfloppy %u
Icon=kfloppy
Name=Format
Name[bg]=Форматиране
Name[br]=Furmadiñ
Name[ca]=Dona format
Name[cs]=Formátovat
Name[cy]=Fformat
Name[de]=Formatieren
Name[eo]=Formato
Name[es]=Formatear
Name[fr]=Formater
Name[ga]=Formáid
Name[it]=Formatta
Name[ja]=
Name[lt]=Formatas
Name[nl]=Formatteren
Name[pa]=ਿ
Name[pl]=Formatuj
Name[pt]=Formatar
Name[pt_BR]=Formatar
Name[ru]=Форматирование дискет
Name[rw]=Imiterere
Name[sr]=Форматирај
Name[sr@Latn]=Formatiraj
Name[sv]=Formatera
Name[uk]=Форматування
Name[xx]=xxFormatxx
Name[zh_CN]=
[Desktop Entry]
Actions=Format;
ServiceTypes=media/floppy_unmounted,media/floppy5_unmounted
X-KDE-Priority=TopLevel
X-KDE-MediaNotifierHide=true

View file

@ -0,0 +1,61 @@
#
# Servicemenu image converter, by Jens Benecke <jens-kde@spamfreemail.de>.
# Released under the same license as the KDE core distribution (GPL 2.0).
#
[Desktop Entry]
ServiceTypes=image/*
Actions=convToJPEG;convToPNG;convToGIF;convToTIF;
X-KDE-Submenu=Convert To
X-KDE-Submenu[bg]=Конвертиране в
X-KDE-Submenu[ca]=Converteix a
X-KDE-Submenu[cs]=Převést na
X-KDE-Submenu[da]=Konvertér til
X-KDE-Submenu[de]=Konvertieren nach
X-KDE-Submenu[es]=Convertir a
X-KDE-Submenu[fi]=Muunna
X-KDE-Submenu[fr]=Convertir en
X-KDE-Submenu[hu]=Átalakítás
X-KDE-Submenu[is]=Umbreyta í
X-KDE-Submenu[it]=Converti in
X-KDE-Submenu[nb]=Konverter til
X-KDE-Submenu[nl]=Converteren naar
X-KDE-Submenu[pl]=Konwertuj do
X-KDE-Submenu[pt]=Converter Para
X-KDE-Submenu[pt_BR]=Converter Para
X-KDE-Submenu[ru]=Сохранить как
X-KDE-Submenu[sr]=Претвори у
X-KDE-Submenu[sr@Latn]=Pretvori u
X-KDE-Submenu[sv]=Konvertera till
X-KDE-Submenu[uk]=Перетворити в
X-KDE-Submenu[xx]=xxConvert Toxx
X-KDE-Submenu[zh_CN]=
TryExec=convert
[Desktop Action convToJPEG]
Name=JPEG
Name[hi]=
Name[xx]=xxJPEGxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.jpg"
[Desktop Action convToPNG]
Name=PNG
Name[hi]=
Name[xx]=xxPNGxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.png"
[Desktop Action convToTIF]
Name=TIF
Name[hi]=ि
Name[xx]=xxTIFxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.tif"
[Desktop Action convToGIF]
Name=GIF
Name[hi]=ि
Name[xx]=xxGIFxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.gif"

View file

@ -0,0 +1,143 @@
[Desktop Entry]
ServiceTypes=application/x-font-ttf,application/x-font-type1,application/x-font-speedo,application/x-font-bdf,application/x-font-pcf,application/x-font-snf,application/x-font-otf,application/x-font-ttc,application/x-afm
Actions=installFont;
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
X-SuSE-translate=true
[Desktop Action installFont]
Name=Install
Name[af]=Installeer
Name[be]=Усталяваць
Name[bg]=Инсталиране
Name[bn]=
Name[br]=Staliañ
Name[bs]=Instaliraj
Name[ca]=Instal·la
Name[cs]=Instalovat
Name[cy]=Gosod
Name[da]=Installér
Name[de]=Installieren
Name[el]=Εγκατάσταση
Name[eo]=Instalu
Name[es]=Instalar
Name[et]=Paigaldamine
Name[eu]=Instalatu
Name[fa]=نصب
Name[fi]=Asenna
Name[fr]=Installer
Name[fy]=Ynstallearje
Name[ga]=Suiteáil
Name[gl]=Instalar
Name[he]=התקנה
Name[hi]=ि
#SUSE-Overwrite Name[hr]=Instaliraj
Name[hu]=Telepítő
Name[is]=Setja upp
Name[it]=Installa
Name[ja]=
Name[km]=
Name[lt]=Įdiegti
Name[lv]=Instalēt
Name[mk]=Инсталирај
Name[ms]=Pasang
Name[mt]=Installa
Name[nb]=Installer
Name[nds]=Installeren
Name[nl]=Installeren
Name[nn]=Installer
Name[pa]=
#SUSE-Overwrite Name[pl]=Instaluj
Name[pl]=Zainstaluj
Name[pt]=Instalar
Name[pt_BR]=Instalar
Name[ro]=Instalare
Name[ru]=Установка
Name[rw]=Kwinjizaporogaramu
Name[se]=Sajáiduhte
Name[sk]=Inštalácia
Name[sl]=Namesti
Name[sr]=Инсталирај
Name[sr@Latn]=Instaliraj
Name[sv]=Installera
Name[ta]=ிி
Name[tg]=Гузоштан
Name[th]=
Name[tr]=Kur
Name[tt]=Quyu
Name[uk]=Встановлення
Name[uz]=Ўрнатиш
#SUSE-Overwrite Name[vi]=Cài đt
Name[zh_CN]=
Name[zh_TW]=
Icon=fonts
Exec=kfmclient copy %U fonts:/

View file

@ -0,0 +1,14 @@
[Desktop Entry]
Encoding=UTF-8
Actions=OpenISO
ServiceTypes=inode/blockdevice,application/x-iso
[Desktop Action OpenISO]
Comment=ISO9660 View
Comment[hu]=ISO9660 Nézet
Comment[fr]=Lecteur ISO9660
Icon=cd
Name=ISO9660 View
Name[hu]=ISO9660 Nézet
Name[fr]=Lecteur ISO9660
Exec=

Some files were not shown because too many files have changed in this diff Show more