From 5252c12db4929886dbe502013e0a1fee6500f568 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 21 Nov 2006 06:02:05 +0000 Subject: [PATCH] commited initial version of Dolphin svn path=/trunk/playground/utils/dolphin/; revision=606622 --- AUTHORS | 5 + CMakeLists.txt | 20 + COPYING | 346 ++++ COPYING-DOCS | 397 +++++ ConfigureChecks.cmake | 47 + INSTALL | 176 ++ README | 2 + config.h.cmake | 153 ++ src/CMakeLists.txt | 140 ++ src/README | 81 + src/bookmarkselector.cpp | 171 ++ src/bookmarkselector.h | 100 ++ src/bookmarkssettingspage.cpp | 318 ++++ src/bookmarkssettingspage.h | 93 + src/bookmarkssidebarpage.cpp | 277 +++ src/bookmarkssidebarpage.h | 122 ++ src/detailsmodesettings.kcfg | 40 + src/detailsmodesettings.kcfgc | 4 + src/detailsviewsettingspage.cpp | 151 ++ src/detailsviewsettingspage.h | 65 + src/directoryviewpropertysettings.kcfg | 59 + src/directoryviewpropertysettings.kcfgc | 6 + src/dolphin.cpp | 1676 ++++++++++++++++++ src/dolphin.desktop | 11 + src/dolphin.h | 455 +++++ src/dolphin.lsm | 16 + src/dolphincontextmenu.cpp | 476 +++++ src/dolphincontextmenu.h | 128 ++ src/dolphindetailsview.cpp | 815 +++++++++ src/dolphindetailsview.h | 224 +++ src/dolphindirlister.cpp | 42 + src/dolphindirlister.h | 48 + src/dolphiniconsview.cpp | 509 ++++++ src/dolphiniconsview.h | 173 ++ src/dolphinsettings.cpp | 184 ++ src/dolphinsettings.h | 103 ++ src/dolphinsettingsdialog.cpp | 79 + src/dolphinsettingsdialog.h | 56 + src/dolphinstatusbar.cpp | 166 ++ src/dolphinstatusbar.h | 135 ++ src/dolphinui.rc | 109 ++ src/dolphinview.cpp | 1087 ++++++++++++ src/dolphinview.h | 458 +++++ src/editbookmarkdialog.cpp | 122 ++ src/editbookmarkdialog.h | 82 + src/filterbar.cpp | 94 + src/filterbar.h | 68 + src/generalsettings.kcfg | 27 + src/generalsettings.kcfgc | 4 + src/generalsettingspage.cpp | 169 ++ src/generalsettingspage.h | 62 + src/hi128-app-dolphin.png | Bin 0 -> 65877 bytes src/hi16-app-dolphin.png | Bin 0 -> 1147 bytes src/hi22-app-dolphin.png | Bin 0 -> 2065 bytes src/hi32-app-dolphin.png | Bin 0 -> 4235 bytes src/hi48-app-dolphin.png | Bin 0 -> 9383 bytes src/hi64-app-dolphin.png | Bin 0 -> 16579 bytes src/iconsmodesettings.kcfg | 43 + src/iconsmodesettings.kcfgc | 4 + src/iconsviewsettingspage.cpp | 262 +++ src/iconsviewsettingspage.h | 99 ++ src/infosidebarpage.cpp | 634 +++++++ src/infosidebarpage.h | 199 +++ src/itemeffectsmanager.cpp | 191 ++ src/itemeffectsmanager.h | 120 ++ src/main.cpp | 81 + src/pics/128x128/CMakeLists.txt | 15 + src/pics/128x128/preview.png | Bin 0 -> 49440 bytes src/pics/16x16/CMakeLists.txt | 15 + src/pics/16x16/editurl.png | Bin 0 -> 228 bytes src/pics/16x16/preview.png | Bin 0 -> 867 bytes src/pics/22x22/CMakeLists.txt | 15 + src/pics/22x22/preview.png | Bin 0 -> 1557 bytes src/pics/32x32/CMakeLists.txt | 15 + src/pics/32x32/preview.png | Bin 0 -> 3187 bytes src/pics/48x48/CMakeLists.txt | 15 + src/pics/48x48/preview.png | Bin 0 -> 7043 bytes src/pics/64x64/CMakeLists.txt | 15 + src/pics/64x64/preview.png | Bin 0 -> 12447 bytes src/pics/CMakeLists.txt | 19 + src/pixmapviewer.cpp | 59 + src/pixmapviewer.h | 52 + src/portinglog.txt | 445 +++++ src/previewsmodesettings.kcfg | 41 + src/previewsmodesettings.kcfgc | 4 + src/progressindicator.cpp | 80 + src/progressindicator.h | 78 + src/protocolcombo.cpp | 114 ++ src/protocolcombo.h | 51 + src/renamedialog.cpp | 91 + src/renamedialog.h | 67 + src/servicemenus/CMakeLists.txt | 15 + src/servicemenus/amarok_append.desktop | 93 + src/servicemenus/ark_compress.desktop | 11 + src/servicemenus/ark_extract.desktop | 13 + src/servicemenus/dolphin_su.desktop | 10 + src/servicemenus/floppy_format.desktop | 36 + src/servicemenus/imageconverter.desktop | 61 + src/servicemenus/installfont.desktop | 143 ++ src/servicemenus/isoservice.desktop | 14 + src/servicemenus/jpegorient.desktop | 222 +++ src/servicemenus/k3b_create_audio_cd.desktop | 124 ++ src/servicemenus/k3b_create_video_cd.desktop | 125 ++ src/servicemenus/k3b_write_bin_image.desktop | 124 ++ src/servicemenus/k3b_write_iso_image.desktop | 124 ++ src/servicemenus/mail_as_attachment.desktop | 10 + src/servicemenus/media_eject.desktop | 158 ++ src/servicemenus/media_mount.desktop | 155 ++ src/servicemenus/media_realfolder.desktop | 114 ++ src/servicemenus/media_safelyremove.desktop | 132 ++ src/servicemenus/media_unmount.desktop | 155 ++ src/servicemenus/open_in_digikam.desktop | 29 + src/settingspagebase.cpp | 33 + src/settingspagebase.h | 46 + src/sidebar.cpp | 110 ++ src/sidebar.h | 66 + src/sidebarpage.cpp | 36 + src/sidebarpage.h | 49 + src/sidebarsettings.kcfg | 19 + src/sidebarsettings.kcfgc | 4 + src/statusbarmessagelabel.cpp | 219 +++ src/statusbarmessagelabel.h | 95 + src/statusbarspaceinfo.cpp | 195 ++ src/statusbarspaceinfo.h | 81 + src/undomanager.cpp | 402 +++++ src/undomanager.h | 196 ++ src/urlbutton.cpp | 98 + src/urlbutton.h | 71 + src/urlnavigator.cpp | 611 +++++++ src/urlnavigator.h | 233 +++ src/urlnavigatorbutton.cpp | 387 ++++ src/urlnavigatorbutton.h | 87 + src/viewproperties.cpp | 208 +++ src/viewproperties.h | 87 + src/viewpropertiesdialog.cpp | 236 +++ src/viewpropertiesdialog.h | 78 + src/viewsettingspage.cpp | 68 + src/viewsettingspage.h | 55 + 138 files changed, 18813 insertions(+) create mode 100644 AUTHORS create mode 100644 CMakeLists.txt create mode 100644 COPYING create mode 100644 COPYING-DOCS create mode 100644 ConfigureChecks.cmake create mode 100644 INSTALL create mode 100644 README create mode 100644 config.h.cmake create mode 100644 src/CMakeLists.txt create mode 100644 src/README create mode 100644 src/bookmarkselector.cpp create mode 100644 src/bookmarkselector.h create mode 100644 src/bookmarkssettingspage.cpp create mode 100644 src/bookmarkssettingspage.h create mode 100644 src/bookmarkssidebarpage.cpp create mode 100644 src/bookmarkssidebarpage.h create mode 100644 src/detailsmodesettings.kcfg create mode 100644 src/detailsmodesettings.kcfgc create mode 100644 src/detailsviewsettingspage.cpp create mode 100644 src/detailsviewsettingspage.h create mode 100644 src/directoryviewpropertysettings.kcfg create mode 100644 src/directoryviewpropertysettings.kcfgc create mode 100644 src/dolphin.cpp create mode 100644 src/dolphin.desktop create mode 100644 src/dolphin.h create mode 100644 src/dolphin.lsm create mode 100644 src/dolphincontextmenu.cpp create mode 100644 src/dolphincontextmenu.h create mode 100644 src/dolphindetailsview.cpp create mode 100644 src/dolphindetailsview.h create mode 100644 src/dolphindirlister.cpp create mode 100644 src/dolphindirlister.h create mode 100644 src/dolphiniconsview.cpp create mode 100644 src/dolphiniconsview.h create mode 100644 src/dolphinsettings.cpp create mode 100644 src/dolphinsettings.h create mode 100644 src/dolphinsettingsdialog.cpp create mode 100644 src/dolphinsettingsdialog.h create mode 100644 src/dolphinstatusbar.cpp create mode 100644 src/dolphinstatusbar.h create mode 100644 src/dolphinui.rc create mode 100644 src/dolphinview.cpp create mode 100644 src/dolphinview.h create mode 100644 src/editbookmarkdialog.cpp create mode 100644 src/editbookmarkdialog.h create mode 100644 src/filterbar.cpp create mode 100644 src/filterbar.h create mode 100644 src/generalsettings.kcfg create mode 100644 src/generalsettings.kcfgc create mode 100644 src/generalsettingspage.cpp create mode 100644 src/generalsettingspage.h create mode 100644 src/hi128-app-dolphin.png create mode 100644 src/hi16-app-dolphin.png create mode 100644 src/hi22-app-dolphin.png create mode 100644 src/hi32-app-dolphin.png create mode 100644 src/hi48-app-dolphin.png create mode 100644 src/hi64-app-dolphin.png create mode 100644 src/iconsmodesettings.kcfg create mode 100644 src/iconsmodesettings.kcfgc create mode 100644 src/iconsviewsettingspage.cpp create mode 100644 src/iconsviewsettingspage.h create mode 100644 src/infosidebarpage.cpp create mode 100644 src/infosidebarpage.h create mode 100644 src/itemeffectsmanager.cpp create mode 100644 src/itemeffectsmanager.h create mode 100644 src/main.cpp create mode 100644 src/pics/128x128/CMakeLists.txt create mode 100644 src/pics/128x128/preview.png create mode 100644 src/pics/16x16/CMakeLists.txt create mode 100644 src/pics/16x16/editurl.png create mode 100644 src/pics/16x16/preview.png create mode 100644 src/pics/22x22/CMakeLists.txt create mode 100644 src/pics/22x22/preview.png create mode 100644 src/pics/32x32/CMakeLists.txt create mode 100644 src/pics/32x32/preview.png create mode 100644 src/pics/48x48/CMakeLists.txt create mode 100644 src/pics/48x48/preview.png create mode 100644 src/pics/64x64/CMakeLists.txt create mode 100644 src/pics/64x64/preview.png create mode 100644 src/pics/CMakeLists.txt create mode 100644 src/pixmapviewer.cpp create mode 100644 src/pixmapviewer.h create mode 100644 src/portinglog.txt create mode 100644 src/previewsmodesettings.kcfg create mode 100644 src/previewsmodesettings.kcfgc create mode 100644 src/progressindicator.cpp create mode 100644 src/progressindicator.h create mode 100644 src/protocolcombo.cpp create mode 100644 src/protocolcombo.h create mode 100644 src/renamedialog.cpp create mode 100644 src/renamedialog.h create mode 100644 src/servicemenus/CMakeLists.txt create mode 100644 src/servicemenus/amarok_append.desktop create mode 100644 src/servicemenus/ark_compress.desktop create mode 100644 src/servicemenus/ark_extract.desktop create mode 100644 src/servicemenus/dolphin_su.desktop create mode 100644 src/servicemenus/floppy_format.desktop create mode 100644 src/servicemenus/imageconverter.desktop create mode 100644 src/servicemenus/installfont.desktop create mode 100644 src/servicemenus/isoservice.desktop create mode 100644 src/servicemenus/jpegorient.desktop create mode 100644 src/servicemenus/k3b_create_audio_cd.desktop create mode 100644 src/servicemenus/k3b_create_video_cd.desktop create mode 100644 src/servicemenus/k3b_write_bin_image.desktop create mode 100644 src/servicemenus/k3b_write_iso_image.desktop create mode 100644 src/servicemenus/mail_as_attachment.desktop create mode 100644 src/servicemenus/media_eject.desktop create mode 100644 src/servicemenus/media_mount.desktop create mode 100644 src/servicemenus/media_realfolder.desktop create mode 100644 src/servicemenus/media_safelyremove.desktop create mode 100644 src/servicemenus/media_unmount.desktop create mode 100644 src/servicemenus/open_in_digikam.desktop create mode 100644 src/settingspagebase.cpp create mode 100644 src/settingspagebase.h create mode 100755 src/sidebar.cpp create mode 100755 src/sidebar.h create mode 100644 src/sidebarpage.cpp create mode 100644 src/sidebarpage.h create mode 100644 src/sidebarsettings.kcfg create mode 100644 src/sidebarsettings.kcfgc create mode 100644 src/statusbarmessagelabel.cpp create mode 100644 src/statusbarmessagelabel.h create mode 100644 src/statusbarspaceinfo.cpp create mode 100644 src/statusbarspaceinfo.h create mode 100644 src/undomanager.cpp create mode 100644 src/undomanager.h create mode 100644 src/urlbutton.cpp create mode 100644 src/urlbutton.h create mode 100644 src/urlnavigator.cpp create mode 100644 src/urlnavigator.h create mode 100644 src/urlnavigatorbutton.cpp create mode 100644 src/urlnavigatorbutton.h create mode 100644 src/viewproperties.cpp create mode 100644 src/viewproperties.h create mode 100644 src/viewpropertiesdialog.cpp create mode 100644 src/viewpropertiesdialog.h create mode 100644 src/viewsettingspage.cpp create mode 100644 src/viewsettingspage.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..150860b9f --- /dev/null +++ b/AUTHORS @@ -0,0 +1,5 @@ +Peter Penz +Aaron J. Seigo + +Cvetoslav Ludmiloff +Stefan Monov \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..dee3c0557 --- /dev/null +++ b/CMakeLists.txt @@ -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() diff --git a/COPYING b/COPYING new file mode 100644 index 000000000..5185fd3f3 --- /dev/null +++ b/COPYING @@ -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. + + + Copyright (C) 19yy + + 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. + + , 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. diff --git a/COPYING-DOCS b/COPYING-DOCS new file mode 100644 index 000000000..4a0fe1c8d --- /dev/null +++ b/COPYING-DOCS @@ -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. diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 000000000..7870a16a2 --- /dev/null +++ b/ConfigureChecks.cmake @@ -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) + diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..f8bad0c14 --- /dev/null +++ b/INSTALL @@ -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. + diff --git a/README b/README new file mode 100644 index 000000000..a27fb6180 --- /dev/null +++ b/README @@ -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. + diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 000000000..b50c3fa7a --- /dev/null +++ b/config.h.cmake @@ -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 + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif + + + +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# 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 +#include +#else +#include +#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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..648fa96ae --- /dev/null +++ b/src/CMakeLists.txt @@ -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 diff --git a/src/README b/src/README new file mode 100644 index 000000000..f04a5635f --- /dev/null +++ b/src/README @@ -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/ + + + diff --git a/src/bookmarkselector.cpp b/src/bookmarkselector.cpp new file mode 100644 index 000000000..4c091d33b --- /dev/null +++ b/src/bookmarkselector.cpp @@ -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 +#include +#include +#include + +#include +#include +#include + +#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" + diff --git a/src/bookmarkselector.h b/src/bookmarkselector.h new file mode 100644 index 000000000..209cf7310 --- /dev/null +++ b/src/bookmarkselector.h @@ -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 +#include +//Added by qt3to4: +#include + +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 + */ +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 diff --git a/src/bookmarkssettingspage.cpp b/src/bookmarkssettingspage.cpp new file mode 100644 index 000000000..58b06534b --- /dev/null +++ b/src/bookmarkssettingspage.cpp @@ -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 + +#include +#include +#include +#include +//Added by qt3to4: +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#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" diff --git a/src/bookmarkssettingspage.h b/src/bookmarkssettingspage.h new file mode 100644 index 000000000..8636ad7e8 --- /dev/null +++ b/src/bookmarkssettingspage.h @@ -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 +#include + +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 diff --git a/src/bookmarkssidebarpage.cpp b/src/bookmarkssidebarpage.cpp new file mode 100644 index 000000000..deb311914 --- /dev/null +++ b/src/bookmarkssidebarpage.cpp @@ -0,0 +1,277 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * * + * 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 +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#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; +} + diff --git a/src/bookmarkssidebarpage.h b/src/bookmarkssidebarpage.h new file mode 100644 index 000000000..3292eaec0 --- /dev/null +++ b/src/bookmarkssidebarpage.h @@ -0,0 +1,122 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz + * * + * 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 +#include +//Added by qt3to4: +#include +#include + +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_ diff --git a/src/detailsmodesettings.kcfg b/src/detailsmodesettings.kcfg new file mode 100644 index 000000000..160ca260f --- /dev/null +++ b/src/detailsmodesettings.kcfg @@ -0,0 +1,40 @@ + + + + + kiconloader.h + + + + KGlobalSettings::generalFont().family() + + + + KGlobalSettings::generalFont().pointSize() + + + + KIcon::SizeSmall + + + + true + + + + false + + + + false + + + + false + + + + false + + + \ No newline at end of file diff --git a/src/detailsmodesettings.kcfgc b/src/detailsmodesettings.kcfgc new file mode 100644 index 000000000..4853c37d0 --- /dev/null +++ b/src/detailsmodesettings.kcfgc @@ -0,0 +1,4 @@ +File=detailsmodesettings.kcfg +ClassName=DetailsModeSettings +Singleton=false +Mutators=true \ No newline at end of file diff --git a/src/detailsviewsettingspage.cpp b/src/detailsviewsettingspage.cpp new file mode 100644 index 000000000..d0025501e --- /dev/null +++ b/src/detailsviewsettingspage.cpp @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#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" diff --git a/src/detailsviewsettingspage.h b/src/detailsviewsettingspage.h new file mode 100644 index 000000000..742868de8 --- /dev/null +++ b/src/detailsviewsettingspage.h @@ -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 +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 + */ +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 diff --git a/src/directoryviewpropertysettings.kcfg b/src/directoryviewpropertysettings.kcfg new file mode 100644 index 000000000..7af729d28 --- /dev/null +++ b/src/directoryviewpropertysettings.kcfg @@ -0,0 +1,59 @@ + + + + + + + + + + When this option is enabled hidden files, such as those starting with a '.', will be shown in the file view. + false + + + + + + + + + This option controls the style of the view. Currently supported values include icons (0), details (1) and previews (2) views. + DolphinView::PreviewsView + 0 + DolphinView::MaxModeEnum + + + + + This option defines which attribute (name, size, date, etc) sorting is performed on. + DolphinView::SortByName + 0 + DolphinView::MaxSortEnum + + + + + Qt::Ascending + Qt::Ascending + Qt::Descending + + + + + false + + + + + + The last time these properties were changed by the user. + + + + + + + diff --git a/src/directoryviewpropertysettings.kcfgc b/src/directoryviewpropertysettings.kcfgc new file mode 100644 index 000000000..09a91d8d1 --- /dev/null +++ b/src/directoryviewpropertysettings.kcfgc @@ -0,0 +1,6 @@ +File=directoryviewpropertysettings.kcfg +Singleton=false +ClassName=ViewPropertySettings +Mutators=true +GlobalEnums=true +IncludeFiles=dolphinview.h,qnamespace.h diff --git a/src/dolphin.cpp b/src/dolphin.cpp new file mode 100644 index 000000000..602dafa2c --- /dev/null +++ b/src/dolphin.cpp @@ -0,0 +1,1676 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Stefan Monov * + * Copyright (C) 2006 by 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 "dolphin.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +//Added by qt3to4: +#include +#include +#include + +#include "urlnavigator.h" +#include "viewpropertiesdialog.h" +#include "viewproperties.h" +#include "dolphinsettings.h" +#include "dolphinsettingsdialog.h" +#include "dolphinstatusbar.h" +#include "undomanager.h" +#include "progressindicator.h" +#include "dolphinsettings.h" +#include "sidebar.h" +#include "sidebarsettings.h" +#include "generalsettings.h" + +Dolphin& Dolphin::mainWin() +{ + static Dolphin* instance = 0; + if (instance == 0) { + instance = new Dolphin(); + instance->init(); + } + return *instance; +} + +Dolphin::~Dolphin() +{ +} + +void Dolphin::setActiveView(DolphinView* view) +{ + assert((view == m_view[PrimaryIdx]) || (view == m_view[SecondaryIdx])); + if (m_activeView == view) { + return; + } + + m_activeView = view; + + updateHistory(); + updateEditActions(); + updateViewActions(); + updateGoActions(); + + setCaption(m_activeView->url().fileName()); + + emit activeViewChanged(); +} + +void Dolphin::dropURLs(const KUrl::List& urls, + const KUrl& destination) +{ + int selectedIndex = -1; + + /* KDE4-TODO + const ButtonState keyboardState = KApplication::keyboardMouseState(); + const bool shiftPressed = (keyboardState & ShiftButton) > 0; + const bool controlPressed = (keyboardState & ControlButton) > 0; + + + + if (shiftPressed && controlPressed) { + // shortcut for 'Linke Here' is used + selectedIndex = 2; + } + else if (controlPressed) { + // shortcut for 'Copy Here' is used + selectedIndex = 1; + } + else if (shiftPressed) { + // shortcut for 'Move Here' is used + selectedIndex = 0; + } + else*/ { + // no shortcut is used, hence open a popup menu + KMenu popup(this); + + popup.insertItem(SmallIcon("goto"), i18n("&Move Here") + "\t" /* KDE4-TODO: + KKey::modFlagLabel(KKey::SHIFT)*/, 0); + popup.insertItem(SmallIcon("editcopy"), i18n( "&Copy Here" ) /* KDE4-TODO + "\t" + KKey::modFlagLabel(KKey::CTRL)*/, 1); + popup.insertItem(i18n("&Link Here") /* KDE4-TODO + "\t" + KKey::modFlagLabel((KKey::ModFlag)(KKey::CTRL|KKey::SHIFT)) */, 2); + popup.insertSeparator(); + popup.insertItem(SmallIcon("stop"), i18n("Cancel"), 3); + popup.setAccel(i18n("Escape"), 3); + + /* KDE4-TODO: selectedIndex = popup.exec(QCursor::pos()); */ + popup.exec(QCursor::pos()); + selectedIndex = 0; // KD4-TODO: use QAction instead of switch below + } + + if (selectedIndex < 0) { + return; + } + + switch (selectedIndex) { + case 0: { + // 'Move Here' has been selected + updateViewProperties(urls); + moveURLs(urls, destination); + break; + } + + case 1: { + // 'Copy Here' has been selected + updateViewProperties(urls); + copyURLs(urls, destination); + break; + } + + case 2: { + // 'Link Here' has been selected + KIO::Job* job = KIO::link(urls, destination); + addPendingUndoJob(job, DolphinCommand::Link, urls, destination); + break; + } + + default: + // 'Cancel' has been selected + break; + } +} + +void Dolphin::refreshViews() +{ + const bool split = DolphinSettings::instance().generalSettings()->splitView(); + const bool isPrimaryViewActive = (m_activeView == m_view[PrimaryIdx]); + KUrl url; + for (int i = PrimaryIdx; i <= SecondaryIdx; ++i) { + if (m_view[i] != 0) { + url = m_view[i]->url(); + + // delete view instance... + m_view[i]->close(); + m_view[i]->deleteLater(); + m_view[i] = 0; + } + + if (split || (i == PrimaryIdx)) { + // ... and recreate it + ViewProperties props(url); + m_view[i] = new DolphinView(m_splitter, + url, + props.viewMode(), + props.isShowHiddenFilesEnabled()); + m_view[i]->show(); + } + } + + m_activeView = isPrimaryViewActive ? m_view[PrimaryIdx] : m_view[SecondaryIdx]; + assert(m_activeView != 0); + + updateViewActions(); + emit activeViewChanged(); +} + +void Dolphin::slotHistoryChanged() +{ + updateHistory(); +} + +void Dolphin::slotURLChanged(const KUrl& url) +{ + updateEditActions(); + updateGoActions(); + setCaption(url.fileName()); +} + +void Dolphin::slotURLChangeRequest(const KUrl& url) +{ + clearStatusBar(); + m_activeView->setURL(url); +} + +void Dolphin::slotViewModeChanged() +{ + updateViewActions(); +} + +void Dolphin::slotShowHiddenFilesChanged() +{ + KToggleAction* showHiddenFilesAction = + static_cast(actionCollection()->action("show_hidden_files")); + showHiddenFilesAction->setChecked(m_activeView->isShowHiddenFilesEnabled()); +} + +void Dolphin::slotShowFilterBarChanged() +{ + KToggleAction* showFilterBarAction = + static_cast(actionCollection()->action("show_filter_bar")); + showFilterBarAction->setChecked(m_activeView->isFilterBarVisible()); +} + +void Dolphin::slotSortingChanged(DolphinView::Sorting sorting) +{ + KAction* action = 0; + switch (sorting) { + case DolphinView::SortByName: + action = actionCollection()->action("by_name"); + break; + case DolphinView::SortBySize: + action = actionCollection()->action("by_size"); + break; + case DolphinView::SortByDate: + action = actionCollection()->action("by_date"); + break; + default: + break; + } + + if (action != 0) { + KToggleAction* toggleAction = static_cast(action); + toggleAction->setChecked(true); + } +} + +void Dolphin::slotSortOrderChanged(Qt::SortOrder order) +{ + KToggleAction* descending = static_cast(actionCollection()->action("descending")); + const bool sortDescending = (order == Qt::Descending); + descending->setChecked(sortDescending); +} + +void Dolphin::slotSelectionChanged() +{ + updateEditActions(); + + assert(m_view[PrimaryIdx] != 0); + int selectedURLsCount = m_view[PrimaryIdx]->selectedURLs().count(); + if (m_view[SecondaryIdx] != 0) { + selectedURLsCount += m_view[SecondaryIdx]->selectedURLs().count(); + } + + KAction* compareFilesAction = actionCollection()->action("compare_files"); + compareFilesAction->setEnabled(selectedURLsCount == 2); + + m_activeView->updateStatusBar(); + + emit selectionChanged(); +} + +void Dolphin::closeEvent(QCloseEvent* event) +{ + // KDE4-TODO + //KConfig* config = kapp->config(); + //config->setGroup("General"); + //config->writeEntry("First Run", false); + + DolphinSettings& settings = DolphinSettings::instance(); + GeneralSettings* generalSettings = settings.generalSettings(); + generalSettings->setFirstRun(false); + + SidebarSettings* sidebarSettings = settings.sidebarSettings(); + const bool isSidebarVisible = (m_sidebar != 0); + sidebarSettings->setVisible(isSidebarVisible); + if (isSidebarVisible) { + sidebarSettings->setWidth(m_sidebar->width()); + } + + settings.save(); + + KMainWindow::closeEvent(event); +} + +void Dolphin::saveProperties(KConfig* config) +{ + config->setGroup("Primary view"); + config->writeEntry("URL", m_view[PrimaryIdx]->url().url()); + config->writeEntry("Editable URL", m_view[PrimaryIdx]->isURLEditable()); + if (m_view[SecondaryIdx] != 0) { + config->setGroup("Secondary view"); + config->writeEntry("URL", m_view[SecondaryIdx]->url().url()); + config->writeEntry("Editable URL", m_view[SecondaryIdx]->isURLEditable()); + } +} + +void Dolphin::readProperties(KConfig* config) +{ + config->setGroup("Primary view"); + m_view[PrimaryIdx]->setURL(config->readEntry("URL")); + m_view[PrimaryIdx]->setURLEditable(config->readBoolEntry("Editable URL")); + if (config->hasGroup("Secondary view")) { + config->setGroup("Secondary view"); + if (m_view[SecondaryIdx] == 0) { + toggleSplitView(); + } + m_view[SecondaryIdx]->setURL(config->readEntry("URL")); + m_view[SecondaryIdx]->setURLEditable(config->readBoolEntry("Editable URL")); + } + else if (m_view[SecondaryIdx] != 0) { + toggleSplitView(); + } +} + +void Dolphin::createFolder() +{ + // Parts of the following code have been taken + // from the class KonqPopupMenu located in + // libqonq/konq_popupmenu.h of Konqueror. + // (Copyright (C) 2000 David Faure , + // Copyright (C) 2001 Holger Freyther ) + + clearStatusBar(); + + DolphinStatusBar* statusBar = m_activeView->statusBar(); + const KUrl baseURL(m_activeView->url()); + + QString name(i18n("New Folder")); + baseURL.path(KUrl::AddTrailingSlash); + + + if (baseURL.isLocalFile() && QFileInfo(baseURL.path(KUrl::AddTrailingSlash) + name).exists()) { + name = KIO::RenameDlg::suggestName(baseURL, i18n("New Folder")); + } + + bool ok = false; + name = KInputDialog::getText(i18n("New Folder"), + i18n("Enter folder name:" ), + name, + &ok, + this); + + if (!ok) { + // the user has pressed 'Cancel' + return; + } + + assert(!name.isEmpty()); + + KUrl url; + if ((name[0] == '/') || (name[0] == '~')) { + url.setPath(KShell::tildeExpand(name)); + } + else { + name = KIO::encodeFileName(name); + url = baseURL; + url.addPath(name); + } + ok = KIO::NetAccess::mkdir(url, this); + + // TODO: provide message type hint + if (ok) { + statusBar->setMessage(i18n("Created folder %1.").arg(url.path()), + DolphinStatusBar::OperationCompleted); + + DolphinCommand command(DolphinCommand::CreateFolder, KUrl::List(), url); + UndoManager::instance().addCommand(command); + } + else { + // Creating of the folder has been failed. Check whether the creating + // has been failed because a folder with the same name exists... + if (KIO::NetAccess::exists(url, true, this)) { + statusBar->setMessage(i18n("A folder named %1 already exists.").arg(url.path()), + DolphinStatusBar::Error); + } + else { + statusBar->setMessage(i18n("Creating of folder %1 failed.").arg(url.path()), + DolphinStatusBar::Error); + } + + } +} + +void Dolphin::createFile() +{ + // Parts of the following code have been taken + // from the class KonqPopupMenu located in + // libqonq/konq_popupmenu.h of Konqueror. + // (Copyright (C) 2000 David Faure , + // Copyright (C) 2001 Holger Freyther ) + + clearStatusBar(); + + // TODO: const Entry& entry = m_createFileTemplates[QString(sender->name())]; + // should be enough. Anyway: the implemantation of [] does a linear search internally too. + KSortableList::ConstIterator it = m_createFileTemplates.begin(); + KSortableList::ConstIterator end = m_createFileTemplates.end(); + + const QString senderName(sender()->name()); + bool found = false; + CreateFileEntry entry; + while (!found && (it != end)) { + if ((*it).index() == senderName) { + entry = (*it).value(); + found = true; + } + else { + ++it; + } + } + + DolphinStatusBar* statusBar = m_activeView->statusBar(); + if (!found || !QFile::exists(entry.templatePath)) { + statusBar->setMessage(i18n("Could not create file."), DolphinStatusBar::Error); + return; + } + + // Get the source path of the template which should be copied. + // The source path is part of the URL entry of the desktop file. + const int pos = entry.templatePath.findRev('/'); + QString sourcePath(entry.templatePath.left(pos + 1)); + sourcePath += KDesktopFile(entry.templatePath, true).readPathEntry("URL"); + + QString name(i18n(entry.name.ascii())); + // Most entry names end with "..." (e. g. "HTML File..."), which is ok for + // menus but no good choice for a new file name -> remove the dots... + name.replace("...", QString::null); + + // add the file extension to the name + name.append(sourcePath.right(sourcePath.length() - sourcePath.findRev('.'))); + + // Check whether a file with the current name already exists. If yes suggest automatically + // a unique file name (e. g. "HTML File" will be replaced by "HTML File_1"). + const KUrl viewURL(m_activeView->url()); + const bool fileExists = viewURL.isLocalFile() && + QFileInfo(viewURL.path(KUrl::AddTrailingSlash) + KIO::encodeFileName(name)).exists(); + if (fileExists) { + name = KIO::RenameDlg::suggestName(viewURL, name); + } + + // let the user change the suggested file name + bool ok = false; + name = KInputDialog::getText(entry.name, + entry.comment, + name, + &ok, + this); + if (!ok) { + // the user has pressed 'Cancel' + return; + } + + // before copying the template to the destination path check whether a file + // with the given name already exists + const QString destPath(viewURL.pathOrUrl() + "/" + KIO::encodeFileName(name)); + const KUrl destURL(destPath); + if (KIO::NetAccess::exists(destURL, false, this)) { + statusBar->setMessage(i18n("A file named %1 already exists.").arg(name), + DolphinStatusBar::Error); + return; + } + + // copy the template to the destination path + const KUrl sourceURL(sourcePath); + KIO::CopyJob* job = KIO::copyAs(sourceURL, destURL); + job->setDefaultPermissions(true); + if (KIO::NetAccess::synchronousRun(job, this)) { + statusBar->setMessage(i18n("Created file %1.").arg(name), + DolphinStatusBar::OperationCompleted); + + KUrl::List list; + list.append(sourceURL); + DolphinCommand command(DolphinCommand::CreateFile, list, destURL); + UndoManager::instance().addCommand(command); + + } + else { + statusBar->setMessage(i18n("Creating of file %1 failed.").arg(name), + DolphinStatusBar::Error); + } +} + +void Dolphin::rename() +{ + clearStatusBar(); + m_activeView->renameSelectedItems(); +} + +void Dolphin::moveToTrash() +{ + clearStatusBar(); + KUrl::List selectedURLs = m_activeView->selectedURLs(); + KIO::Job* job = KIO::trash(selectedURLs); + addPendingUndoJob(job, DolphinCommand::Trash, selectedURLs, m_activeView->url()); +} + +void Dolphin::deleteItems() +{ + clearStatusBar(); + + KUrl::List list = m_activeView->selectedURLs(); + const uint itemCount = list.count(); + assert(itemCount >= 1); + + QString text; + if (itemCount > 1) { + text = i18n("Do you really want to delete the %1 selected items?").arg(itemCount); + } + else { + const KUrl& url = list.first(); + text = i18n("Do you really want to delete '%1'?").arg(url.fileName()); + } + + const bool del = KMessageBox::warningContinueCancel(this, + text, + QString::null, + KGuiItem(i18n("Delete"), SmallIcon("editdelete")) + ) == KMessageBox::Continue; + if (del) { + KIO::Job* job = KIO::del(list); + connect(job, SIGNAL(result(KIO::Job*)), + this, SLOT(slotHandleJobError(KIO::Job*))); + connect(job, SIGNAL(result(KIO::Job*)), + this, SLOT(slotDeleteFileFinished(KIO::Job*))); + } +} + +void Dolphin::properties() +{ + const KFileItemList* sourceList = m_activeView->selectedItems(); + if (sourceList == 0) { + return; + } + + KFileItemList list; + KFileItemList::const_iterator it = sourceList->begin(); + const KFileItemList::const_iterator end = sourceList->end(); + KFileItem* item = 0; + while (it != end) { + list.append(item); + ++it; + } + + new KPropertiesDialog(list, this); +} + +void Dolphin::quit() +{ + close(); +} + +void Dolphin::slotHandleJobError(KIO::Job* job) +{ + if (job->error() != 0) { + m_activeView->statusBar()->setMessage(job->errorString(), + DolphinStatusBar::Error); + } +} + +void Dolphin::slotDeleteFileFinished(KIO::Job* job) +{ + if (job->error() == 0) { + m_activeView->statusBar()->setMessage(i18n("Delete operation completed."), + DolphinStatusBar::OperationCompleted); + + // TODO: In opposite to the 'Move to Trash' operation in the class KFileIconView + // no rearranging of the item position is done when a file has been deleted. + // This is bypassed by reloading the view, but it might be worth to investigate + // deeper for the root of this issue. + m_activeView->reload(); + } +} + +void Dolphin::slotUndoAvailable(bool available) +{ + KAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo)); + if (undoAction != 0) { + undoAction->setEnabled(available); + } +} + +void Dolphin::slotUndoTextChanged(const QString& text) +{ + KAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo)); + if (undoAction != 0) { + undoAction->setText(text); + } +} + +void Dolphin::slotRedoAvailable(bool available) +{ + KAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo)); + if (redoAction != 0) { + redoAction->setEnabled(available); + } +} + +void Dolphin::slotRedoTextChanged(const QString& text) +{ + KAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo)); + if (redoAction != 0) { + redoAction->setText(text); + } +} + +void Dolphin::cut() +{ + m_clipboardContainsCutData = true; + /* KDE4-TODO: Q3DragObject* data = new KURLDrag(m_activeView->selectedURLs(), + widget()); + QApplication::clipboard()->setData(data);*/ +} + +void Dolphin::copy() +{ + m_clipboardContainsCutData = false; + /* KDE4-TODO: + Q3DragObject* data = new KUrlDrag(m_activeView->selectedURLs(), + widget()); + QApplication::clipboard()->setData(data);*/ +} + +void Dolphin::paste() +{ + /* KDE4-TODO: + QClipboard* clipboard = QApplication::clipboard(); + QMimeSource* data = clipboard->data(); + if (!KUrlDrag::canDecode(data)) { + return; + } + + clearStatusBar(); + + KUrl::List sourceURLs; + KUrlDrag::decode(data, sourceURLs); + + // per default the pasting is done into the current URL of the view + KUrl destURL(m_activeView->url()); + + // check whether the pasting should be done into a selected directory + KUrl::List selectedURLs = m_activeView->selectedURLs(); + if (selectedURLs.count() == 1) { + const KFileItem fileItem(S_IFDIR, + KFileItem::Unknown, + selectedURLs.first(), + true); + if (fileItem.isDir()) { + // only one item is selected which is a directory, hence paste + // into this directory + destURL = selectedURLs.first(); + } + } + + + updateViewProperties(sourceURLs); + if (m_clipboardContainsCutData) { + moveURLs(sourceURLs, destURL); + m_clipboardContainsCutData = false; + clipboard->clear(); + } + else { + copyURLs(sourceURLs, destURL); + }*/ +} + +void Dolphin::updatePasteAction() +{ + KAction* pasteAction = actionCollection()->action(KStdAction::stdName(KStdAction::Paste)); + if (pasteAction == 0) { + return; + } + + QString text(i18n("Paste")); + QClipboard* clipboard = QApplication::clipboard(); + QMimeSource* data = clipboard->data(); + /* KDE4-TODO: + if (KUrlDrag::canDecode(data)) { + pasteAction->setEnabled(true); + + KUrl::List urls; + KUrlDrag::decode(data, urls); + const int count = urls.count(); + if (count == 1) { + pasteAction->setText(i18n("Paste 1 File")); + } + else { + pasteAction->setText(i18n("Paste %1 Files").arg(count)); + } + } + else {*/ + pasteAction->setEnabled(false); + pasteAction->setText(i18n("Paste")); + //} + + if (pasteAction->isEnabled()) { + KUrl::List urls = m_activeView->selectedURLs(); + const uint count = urls.count(); + if (count > 1) { + // pasting should not be allowed when more than one file + // is selected + pasteAction->setEnabled(false); + } + else if (count == 1) { + // Only one file is selected. Pasting is only allowed if this + // file is a directory. + const KFileItem fileItem(S_IFDIR, + KFileItem::Unknown, + urls.first(), + true); + pasteAction->setEnabled(fileItem.isDir()); + } + } +} + +void Dolphin::selectAll() +{ + clearStatusBar(); + m_activeView->selectAll(); +} + +void Dolphin::invertSelection() +{ + clearStatusBar(); + m_activeView->invertSelection(); +} +void Dolphin::setIconsView() +{ + m_activeView->setMode(DolphinView::IconsView); +} + +void Dolphin::setDetailsView() +{ + m_activeView->setMode(DolphinView::DetailsView); +} + +void Dolphin::setPreviewsView() +{ + m_activeView->setMode(DolphinView::PreviewsView); +} + +void Dolphin::sortByName() +{ + m_activeView->setSorting(DolphinView::SortByName); +} + +void Dolphin::sortBySize() +{ + m_activeView->setSorting(DolphinView::SortBySize); +} + +void Dolphin::sortByDate() +{ + m_activeView->setSorting(DolphinView::SortByDate); +} + +void Dolphin::toggleSortOrder() +{ + const Qt::SortOrder order = (m_activeView->sortOrder() == Qt::Ascending) ? + Qt::Descending : + Qt::Ascending; + m_activeView->setSortOrder(order); +} + +void Dolphin::toggleSplitView() +{ + if (m_view[SecondaryIdx] == 0) { + // create a secondary view + m_view[SecondaryIdx] = new DolphinView(m_splitter, + m_view[PrimaryIdx]->url(), + m_view[PrimaryIdx]->mode(), + m_view[PrimaryIdx]->isShowHiddenFilesEnabled()); + m_view[SecondaryIdx]->show(); + } + else { + // remove secondary view + if (m_activeView == m_view[PrimaryIdx]) { + m_view[SecondaryIdx]->close(); + m_view[SecondaryIdx]->deleteLater(); + m_view[SecondaryIdx] = 0; + setActiveView(m_view[PrimaryIdx]); + } + else { + // The secondary view is active, hence from the users point of view + // the content of the secondary view should be moved to the primary view. + // From an implementation point of view it is more efficient to close + // the primary view and exchange the internal pointers afterwards. + m_view[PrimaryIdx]->close(); + m_view[PrimaryIdx]->deleteLater(); + m_view[PrimaryIdx] = m_view[SecondaryIdx]; + m_view[SecondaryIdx] = 0; + setActiveView(m_view[PrimaryIdx]); + } + } +} + +void Dolphin::reloadView() +{ + clearStatusBar(); + m_activeView->reload(); +} + +void Dolphin::stopLoading() +{ +} + +void Dolphin::showHiddenFiles() +{ + clearStatusBar(); + + const KToggleAction* showHiddenFilesAction = + static_cast(actionCollection()->action("show_hidden_files")); + const bool show = showHiddenFilesAction->isChecked(); + m_activeView->setShowHiddenFilesEnabled(show); +} + +void Dolphin::showFilterBar() +{ + const KToggleAction* showFilterBarAction = + static_cast(actionCollection()->action("show_filter_bar")); + const bool show = showFilterBarAction->isChecked(); + m_activeView->slotShowFilterBar(show); +} + +void Dolphin::zoomIn() +{ + m_activeView->zoomIn(); + updateViewActions(); +} + +void Dolphin::zoomOut() +{ + m_activeView->zoomOut(); + updateViewActions(); +} + +void Dolphin::toggleEditLocation() +{ + clearStatusBar(); + + KToggleAction* action = static_cast(actionCollection()->action("editable_location")); + + bool editOrBrowse = action->isChecked(); +// action->setChecked(action->setChecked); + m_activeView->setURLEditable(editOrBrowse); +} + +void Dolphin::editLocation() +{ + KToggleAction* action = static_cast(actionCollection()->action("editable_location")); + action->setChecked(true); + m_activeView->setURLEditable(true); +} + +void Dolphin::adjustViewProperties() +{ + clearStatusBar(); + ViewPropertiesDialog dlg(m_activeView); + dlg.exec(); +} + +void Dolphin::goBack() +{ + clearStatusBar(); + m_activeView->goBack(); +} + +void Dolphin::goForward() +{ + clearStatusBar(); + m_activeView->goForward(); +} + +void Dolphin::goUp() +{ + clearStatusBar(); + m_activeView->goUp(); +} + +void Dolphin::goHome() +{ + clearStatusBar(); + m_activeView->goHome(); +} + +void Dolphin::openTerminal() +{ + QString command("konsole --workdir \""); + command.append(m_activeView->url().path()); + command.append('\"'); + + KRun::runCommand(command, "Konsole", "konsole"); +} + +void Dolphin::findFile() +{ + KRun::run("kfind", m_activeView->url()); +} + +void Dolphin::compareFiles() +{ + // The method is only invoked if exactly 2 files have + // been selected. The selected files may be: + // - both in the primary view + // - both in the secondary view + // - one in the primary view and the other in the secondary + // view + assert(m_view[PrimaryIdx] != 0); + + KUrl urlA; + KUrl urlB; + KUrl::List urls = m_view[PrimaryIdx]->selectedURLs(); + + switch (urls.count()) { + case 0: { + assert(m_view[SecondaryIdx] != 0); + urls = m_view[SecondaryIdx]->selectedURLs(); + assert(urls.count() == 2); + urlA = urls[0]; + urlB = urls[1]; + break; + } + + case 1: { + urlA = urls[0]; + assert(m_view[SecondaryIdx] != 0); + urls = m_view[SecondaryIdx]->selectedURLs(); + assert(urls.count() == 1); + urlB = urls[0]; + break; + } + + case 2: { + urlA = urls[0]; + urlB = urls[1]; + break; + } + + default: { + // may not happen: compareFiles may only get invoked if 2 + // files are selected + assert(false); + } + } + + QString command("kompare -c \""); + command.append(urlA.pathOrUrl()); + command.append("\" \""); + command.append(urlB.pathOrUrl()); + command.append('\"'); + KRun::runCommand(command, "Kompare", "kompare"); + +} + +void Dolphin::editSettings() +{ + // TODO: make a static method for opening the settings dialog + DolphinSettingsDialog dlg; + dlg.exec(); +} + +void Dolphin::addUndoOperation(KIO::Job* job) +{ + if (job->error() != 0) { + slotHandleJobError(job); + } + else { + const int id = job->progressId(); + + // set iterator to the executed command with the current id... + Q3ValueList::Iterator it = m_pendingUndoJobs.begin(); + const Q3ValueList::Iterator end = m_pendingUndoJobs.end(); + bool found = false; + while (!found && (it != end)) { + if ((*it).id == id) { + found = true; + } + else { + ++it; + } + } + + if (found) { + DolphinCommand command = (*it).command; + if (command.type() == DolphinCommand::Trash) { + // To be able to perform an undo for the 'Move to Trash' operation + // all source URLs must be updated with the trash URL. E. g. when moving + // a file "test.txt" and a second file "test.txt" to the trash, + // then the filenames in the trash are "0-test.txt" and "1-test.txt". + QMap metaData = job->metaData(); + KUrl::List newSourceURLs; + + KUrl::List sourceURLs = command.source(); + KUrl::List::Iterator sourceIt = sourceURLs.begin(); + const KUrl::List::Iterator sourceEnd = sourceURLs.end(); + + while (sourceIt != sourceEnd) { + QMap::ConstIterator metaIt = metaData.find("trashURL-" + (*sourceIt).path()); + if (metaIt != metaData.end()) { + newSourceURLs.append(KUrl(metaIt.data())); + } + ++sourceIt; + } + command.setSource(newSourceURLs); + } + + UndoManager::instance().addCommand(command); + m_pendingUndoJobs.erase(it); + + DolphinStatusBar* statusBar = m_activeView->statusBar(); + switch (command.type()) { + case DolphinCommand::Copy: + statusBar->setMessage(i18n("Copy operation completed."), + DolphinStatusBar::OperationCompleted); + break; + case DolphinCommand::Move: + statusBar->setMessage(i18n("Move operation completed."), + DolphinStatusBar::OperationCompleted); + break; + case DolphinCommand::Trash: + statusBar->setMessage(i18n("Move to trash operation completed."), + DolphinStatusBar::OperationCompleted); + break; + default: + break; + } + } + } +} + +void Dolphin::toggleSidebar() +{ + if (m_sidebar == 0) { + openSidebar(); + } + else { + closeSidebar(); + } + + KToggleAction* sidebarAction = static_cast(actionCollection()->action("sidebar")); + sidebarAction->setChecked(m_sidebar != 0); +} + +void Dolphin::closeSidebar() +{ + if (m_sidebar == 0) { + // the sidebar has already been closed + return; + } + + // store width of sidebar and remember that the sidebar has been closed + SidebarSettings* settings = DolphinSettings::instance().sidebarSettings(); + settings->setVisible(false); + settings->setWidth(m_sidebar->width()); + + m_sidebar->deleteLater(); + m_sidebar = 0; +} + +Dolphin::Dolphin() : + KMainWindow(0, "Dolphin"), + m_splitter(0), + m_sidebar(0), + m_activeView(0), + m_clipboardContainsCutData(false) +{ + m_view[PrimaryIdx] = 0; + m_view[SecondaryIdx] = 0; + + m_fileGroupActions.setAutoDelete(true); + + // TODO: the following members are not used yet. See documentation + // of Dolphin::linkGroupActions() and Dolphin::linkToDeviceActions() + // in the header file for details. + //m_linkGroupActions.setAutoDelete(true); + //m_linkToDeviceActions.setAutoDelete(true); +} + +void Dolphin::init() +{ + // Check whether Dolphin runs the first time. If yes then + // a proper default window size is given at the end of Dolphin::init(). + GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings(); + const bool firstRun = generalSettings->firstRun(); + + setAcceptDrops(true); + + m_splitter = new QSplitter(this); + + DolphinSettings& settings = DolphinSettings::instance(); + + KBookmarkManager* manager = settings.bookmarkManager(); + assert(manager != 0); + KBookmarkGroup root = manager->root(); + if (root.first().isNull()) { + root.addBookmark(manager, i18n("Home"), settings.generalSettings()->homeURL(), "folder_home"); + root.addBookmark(manager, i18n("Storage Media"), KUrl("media:/"), "blockdevice"); + root.addBookmark(manager, i18n("Network"), KUrl("remote:/"), "network_local"); + root.addBookmark(manager, i18n("Root"), KUrl("/"), "folder_red"); + root.addBookmark(manager, i18n("Trash"), KUrl("trash:/"), "trashcan_full"); + } + + setupActions(); + setupGUI(Keys|Save|Create|ToolBar); + + const KUrl& homeURL = root.first().url(); + setCaption(homeURL.fileName()); + ViewProperties props(homeURL); + m_view[PrimaryIdx] = new DolphinView(m_splitter, + homeURL, + props.viewMode(), + props.isShowHiddenFilesEnabled()); + + m_activeView = m_view[PrimaryIdx]; + + setCentralWidget(m_splitter); + + // open sidebar + SidebarSettings* sidebarSettings = settings.sidebarSettings(); + assert(sidebarSettings != 0); + if (sidebarSettings->visible()) { + openSidebar(); + } + + createGUI(); + + stateChanged("new_file"); + setAutoSaveSettings(); + + QClipboard* clipboard = QApplication::clipboard(); + connect(clipboard, SIGNAL(dataChanged()), + this, SLOT(updatePasteAction())); + updatePasteAction(); + updateGoActions(); + + setupCreateNewMenuActions(); + + loadSettings(); + + if (firstRun) { + // assure a proper default size if Dolphin runs the first time + resize(640, 480); + } +} + +void Dolphin::loadSettings() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + + KToggleAction* splitAction = static_cast(actionCollection()->action("split_view")); + if (settings->splitView()) { + splitAction->setChecked(true); + toggleSplitView(); + } + + updateViewActions(); +} + +void Dolphin::setupActions() +{ + // setup 'File' menu + //KAction* createFolder = new KAction(i18n("Folder..."), "Ctrl+N", + // this, SLOT(createFolder()), + // actionCollection(), "create_folder"); + KAction* createFolder = new KAction(i18n("Folder..."), actionCollection(), "create_folder"); + createFolder->setIcon(KIcon("folder")); + createFolder->setShortcut(Qt::Key_N); + connect(createFolder, SIGNAL(triggered()), this, SLOT(createFolder())); + + //new KAction(i18n("Rename"), KKey(Key_F2), + // this, SLOT(rename()), + // actionCollection(), "rename"); + KAction* rename = new KAction(i18n("Rename"), actionCollection(), "rename"); + rename->setShortcut(Qt::Key_F2); + connect(rename, SIGNAL(triggered()), this, SLOT(rename())); + + //KAction* moveToTrashAction = new KAction(i18n("Move to Trash"), KKey(Key_Delete), + // this, SLOT(moveToTrash()), + // actionCollection(), "move_to_trash"); + //moveToTrashAction->setIcon("edittrash"); + KAction* moveToTrash = new KAction(i18n("Move to Trash"), actionCollection(), "move_to_trash"); + moveToTrash->setIcon(KIcon("edittrash")); + moveToTrash->setShortcut(QKeySequence::Delete); + connect(moveToTrash, SIGNAL(triggered()), this, SLOT(moveToTrash())); + + //KAction* deleteAction = new KAction(i18n("Delete"), "Shift+Delete", + // this, SLOT(deleteItems()), + // actionCollection(), "delete"); + //deleteAction->setIcon("editdelete"); + KAction* deleteAction = new KAction(i18n("Delete"), actionCollection(), "delete"); + deleteAction->setShortcut(Qt::ALT | Qt::Key_Delete); + deleteAction->setIcon(KIcon("editdelete")); + connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItems())); + + //new KAction(i18n("Propert&ies"), "Alt+Return", + // this, SLOT(properties()), + // actionCollection(), "properties"); + KAction* properties = new KAction(i18n("Propert&ies"), actionCollection(), "properties"); + properties->setShortcut(Qt::Key_Alt | Qt::Key_Return); + connect(properties, SIGNAL(triggered()), this, SLOT(properties())); + + KStdAction::quit(this, SLOT(quit()), actionCollection()); + + // setup 'Edit' menu + UndoManager& undoManager = UndoManager::instance(); + KStdAction::undo(&undoManager, + SLOT(undo()), + actionCollection()); + connect(&undoManager, SIGNAL(undoAvailable(bool)), + this, SLOT(slotUndoAvailable(bool))); + connect(&undoManager, SIGNAL(undoTextChanged(const QString&)), + this, SLOT(slotUndoTextChanged(const QString&))); + + KStdAction::redo(&undoManager, + SLOT(redo()), + actionCollection()); + connect(&undoManager, SIGNAL(redoAvailable(bool)), + this, SLOT(slotRedoAvailable(bool))); + connect(&undoManager, SIGNAL(redoTextChanged(const QString&)), + this, SLOT(slotRedoTextChanged(const QString&))); + + KStdAction::cut(this, SLOT(cut()), actionCollection()); + KStdAction::copy(this, SLOT(copy()), actionCollection()); + KStdAction::paste(this, SLOT(paste()), actionCollection()); + + //new KAction(i18n("Select All"), "Ctrl+A", + // this, SLOT(selectAll()), + // actionCollection(), "select_all"); + KAction* selectAll = new KAction(i18n("Select All"), actionCollection(), "select_all"); + selectAll->setShortcut(Qt::CTRL + Qt::Key_A); + connect(selectAll, SIGNAL(triggered()), this, SLOT(selectAll())); + + //new KAction(i18n("Invert Selection"), "Ctrl+Shift+A", + // this, SLOT(invertSelection()), + // actionCollection(), "invert_selection"); + KAction* invertSelection = new KAction(i18n("Invert Selection"), actionCollection(), "invert_selection"); + invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A); + connect(invertSelection, SIGNAL(triggered()), this, SLOT(invertSelection())); + + // setup 'View' menu + KStdAction::zoomIn(this, + SLOT(zoomIn()), + actionCollection()); + + KStdAction::zoomOut(this, + SLOT(zoomOut()), + actionCollection()); + + //KAction* iconsView = new KRadioAction(i18n("Icons"), "Ctrl+1", + // this, SLOT(setIconsView()), + // actionCollection(), "icons"); + KAction* iconsView = new KAction(i18n("Icons"), actionCollection(), "icons"); + iconsView->setShortcut(Qt::CTRL | Qt::Key_1); + iconsView->setIcon(KIcon("view_icon")); + connect(iconsView, SIGNAL(triggered()), this, SLOT(setIconsView())); + + //KRadioAction* detailsView = new KRadioAction(i18n("Details"), "Ctrl+2", + // this, SLOT(setDetailsView()), + // actionCollection(), "details"); + KAction* detailsView = new KAction(i18n("Details"), actionCollection(), "details"); + detailsView->setShortcut(Qt::CTRL | Qt::Key_2); + detailsView->setIcon(KIcon("view_text")); + connect(detailsView, SIGNAL(triggered()), this, SLOT(setIconsView())); + + //KRadioAction* previewsView = new KRadioAction(i18n("Previews"), "Ctrl+3", + // this, SLOT(setPreviewsView()), + // actionCollection(), "previews"); + KAction* previewsView = new KAction(i18n("Previews"), actionCollection(), "previews"); + previewsView->setShortcut(Qt::CTRL | Qt::Key_3); + previewsView->setIcon(KIcon("gvdirpart")); + connect(previewsView, SIGNAL(triggered()), this, SLOT(setPreviewsView())); + + QActionGroup* viewModeGroup = new QActionGroup(this); + viewModeGroup->addAction(iconsView); + viewModeGroup->addAction(detailsView); + viewModeGroup->addAction(previewsView); + + KAction* sortByName = new KAction(i18n("By Name"), actionCollection(), "by_name"); + connect(sortByName, SIGNAL(triggered()), this, SLOT(sortByName())); + + KAction* sortBySize = new KAction(i18n("By Size"), actionCollection(), "by_name"); + connect(sortBySize, SIGNAL(triggered()), this, SLOT(sortBySize())); + + KAction* sortByDate = new KAction(i18n("By Date"), actionCollection(), "by_name"); + connect(sortByDate, SIGNAL(triggered()), this, SLOT(sortByDate())); + + QActionGroup* sortGroup = new QActionGroup(this); + sortGroup->addAction(sortByName); + sortGroup->addAction(sortBySize); + sortGroup->addAction(sortByDate); + + KToggleAction* sortDescending = new KToggleAction(i18n("Descending"), actionCollection(), "descending"); + connect(sortDescending, SIGNAL(triggered()), this, SLOT(toggleSortOrder())); + + KToggleAction* showHiddenFiles = new KToggleAction(i18n("Show Hidden Files"), actionCollection(), "show_hidden_files"); + //showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_ KDE4-TODO: what Qt-Key represents '.'? + connect(showHiddenFiles, SIGNAL(triggered()), this, SLOT(showHiddenFiles())); + + KToggleAction* split = new KToggleAction(i18n("Split View"), actionCollection(), "split_view"); + split->setShortcut(Qt::Key_F10); + split->setIcon(KIcon("view_left_right")); + connect(split, SIGNAL(triggered()), this, SLOT(toggleSplitView())); + + KAction* reload = new KAction(i18n("Reload"), "F5", actionCollection(), "reload"); + reload->setShortcut(Qt::Key_F5); + reload->setIcon(KIcon("reload")); + connect(reload, SIGNAL(triggered()), this, SLOT(reloadView())); + + KAction* stop = new KAction(i18n("Stop"), actionCollection(), "stop"); + stop->setIcon(KIcon("stop")); + connect(stop, SIGNAL(triggered()), this, SLOT(stopLoading())); + + KToggleAction* showFullLocation = new KToggleAction(i18n("Show Full Location"), actionCollection(), "editable_location"); + showFullLocation->setShortcut(Qt::CTRL | Qt::Key_L); + connect(showFullLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation())); + + KToggleAction* editLocation = new KToggleAction(i18n("Edit Location"), actionCollection(), "edit_location"); + editLocation->setShortcut(Qt::Key_F6); + connect(editLocation, SIGNAL(triggered()), this, SLOT(editLocation())); + + KToggleAction* sidebar = new KToggleAction(i18n("Sidebar"), actionCollection(), "sidebar"); + sidebar->setShortcut(Qt::Key_F9); + connect(sidebar, SIGNAL(triggered()), this, SLOT(toggleSidebar())); + + KAction* adjustViewProps = new KAction(i18n("Adjust View Properties..."), actionCollection(), "view_properties"); + connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(adjustViewProperties())); + + // setup 'Go' menu + KStdAction::back(this, SLOT(goBack()), actionCollection()); + KStdAction::forward(this, SLOT(goForward()), actionCollection()); + KStdAction::up(this, SLOT(goUp()), actionCollection()); + KStdAction::home(this, SLOT(goHome()), actionCollection()); + + // setup 'Tools' menu + KAction* openTerminal = new KAction(i18n("Open Terminal"), actionCollection(), "open_terminal"); + openTerminal->setShortcut(Qt::Key_F4); + openTerminal->setIcon(KIcon("konsole")); + connect(openTerminal, SIGNAL(triggered()), this, SLOT(openTerminal())); + + KAction* findFile = new KAction(i18n("Find File..."), actionCollection(), "find_file"); + findFile->setShortcut(Qt::Key_F); + findFile->setIcon(KIcon("filefind")); + connect(findFile, SIGNAL(triggered()), this, SLOT(findFile())); + + KToggleAction* showFilterBar = new KToggleAction(i18n("Show Filter Bar"), actionCollection(), "show_filter_bar"); + showFilterBar->setShortcut(Qt::Key_Slash); + connect(showFilterBar, SIGNAL(triggered()), this, SLOT(showFilterBar())); + + KAction* compareFiles = new KAction(i18n("Compare Files"), actionCollection(), "compare_files"); + compareFiles->setIcon(KIcon("kompare")); + compareFiles->setEnabled(false); + connect(compareFiles, SIGNAL(triggered()), this, SLOT(compareFiles())); + + // setup 'Settings' menu + KStdAction::preferences(this, SLOT(editSettings()), actionCollection()); +} + +void Dolphin::setupCreateNewMenuActions() +{ + // Parts of the following code have been taken + // from the class KNewMenu located in + // libqonq/knewmenu.h of Konqueror. + // Copyright (C) 1998, 1999 David Faure + // 2003 Sven Leiber + + QStringList files = actionCollection()->instance()->dirs()->findAllResources("templates"); + for (QStringList::Iterator it = files.begin() ; it != files.end(); ++it) { + if ((*it)[0] != '.' ) { + KSimpleConfig config(*it, true); + config.setDesktopGroup(); + + // tricky solution to ensure that TextFile is at the beginning + // because this filetype is the most used (according kde-core discussion) + const QString name(config.readEntry("Name")); + QString key(name); + + const QString path(config.readPathEntry("URL")); + if (!path.endsWith("emptydir")) { + if (path.endsWith("TextFile.txt")) { + key = "1" + key; + } + else if (!KDesktopFile::isDesktopFile(path)) { + key = "2" + key; + } + else if (path.endsWith("URL.desktop")){ + key = "3" + key; + } + else if (path.endsWith("Program.desktop")){ + key = "4" + key; + } + else { + key = "5"; + } + + const QString icon(config.readEntry("Icon")); + const QString comment(config.readEntry("Comment")); + const QString type(config.readEntry("Type")); + + const QString filePath(*it); + + + if (type == "Link") { + CreateFileEntry entry; + entry.name = name; + entry.icon = icon; + entry.comment = comment; + entry.templatePath = filePath; + m_createFileTemplates.insert(key, entry); + } + } + } + } + m_createFileTemplates.sort(); + + unplugActionList("create_actions"); + KSortableList::ConstIterator it = m_createFileTemplates.begin(); + KSortableList::ConstIterator end = m_createFileTemplates.end(); + /* KDE4-TODO: + while (it != end) { + CreateFileEntry entry = (*it).value(); + KAction* action = new KAction(entry.name); + action->setIcon(entry.icon); + action->setName((*it).index()); + connect(action, SIGNAL(activated()), + this, SLOT(createFile())); + + const QChar section = ((*it).index()[0]); + switch (section) { + case '1': + case '2': { + m_fileGroupActions.append(action); + break; + } + + case '3': + case '4': { + // TODO: not used yet. See documentation of Dolphin::linkGroupActions() + // and Dolphin::linkToDeviceActions() in the header file for details. + //m_linkGroupActions.append(action); + break; + } + + case '5': { + // TODO: not used yet. See documentation of Dolphin::linkGroupActions() + // and Dolphin::linkToDeviceActions() in the header file for details. + //m_linkToDeviceActions.append(action); + break; + } + default: + break; + } + ++it; + } + + plugActionList("create_file_group", m_fileGroupActions); + //plugActionList("create_link_group", m_linkGroupActions); + //plugActionList("link_to_device", m_linkToDeviceActions);*/ +} + +void Dolphin::updateHistory() +{ + int index = 0; + const Q3ValueList list = m_activeView->urlHistory(index); + + KAction* backAction = actionCollection()->action("go_back"); + if (backAction != 0) { + backAction->setEnabled(index < static_cast(list.count()) - 1); + } + + KAction* forwardAction = actionCollection()->action("go_forward"); + if (forwardAction != 0) { + forwardAction->setEnabled(index > 0); + } +} + +void Dolphin::updateEditActions() +{ + const KFileItemList* list = m_activeView->selectedItems(); + if ((list == 0) || (*list).isEmpty()) { + stateChanged("has_no_selection"); + } + else { + stateChanged("has_selection"); + + KAction* renameAction = actionCollection()->action("rename"); + if (renameAction != 0) { + renameAction->setEnabled(list->count() >= 1); + } + + bool enableMoveToTrash = true; + + KFileItemList::const_iterator it = list->begin(); + const KFileItemList::const_iterator end = list->end(); + KFileItem* item = 0; + while (it != end) { + const KUrl& url = item->url(); + // only enable the 'Move to Trash' action for local files + if (!url.isLocalFile()) { + enableMoveToTrash = false; + } + ++it; + } + + KAction* moveToTrashAction = actionCollection()->action("move_to_trash"); + moveToTrashAction->setEnabled(enableMoveToTrash); + } + updatePasteAction(); +} + +void Dolphin::updateViewActions() +{ + KAction* zoomInAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomIn)); + if (zoomInAction != 0) { + zoomInAction->setEnabled(m_activeView->isZoomInPossible()); + } + + KAction* zoomOutAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomOut)); + if (zoomOutAction != 0) { + zoomOutAction->setEnabled(m_activeView->isZoomOutPossible()); + } + + KAction* action = 0; + switch (m_activeView->mode()) { + case DolphinView::IconsView: + action = actionCollection()->action("icons"); + break; + case DolphinView::DetailsView: + action = actionCollection()->action("details"); + break; + case DolphinView::PreviewsView: + action = actionCollection()->action("previews"); + break; + default: + break; + } + + if (action != 0) { + KToggleAction* toggleAction = static_cast(action); + toggleAction->setChecked(true); + } + + slotSortingChanged(m_activeView->sorting()); + slotSortOrderChanged(m_activeView->sortOrder()); + + KToggleAction* showFilterBarAction = + static_cast(actionCollection()->action("show_filter_bar")); + showFilterBarAction->setChecked(m_activeView->isFilterBarVisible()); + + KToggleAction* showHiddenFilesAction = + static_cast(actionCollection()->action("show_hidden_files")); + showHiddenFilesAction->setChecked(m_activeView->isShowHiddenFilesEnabled()); + + KToggleAction* splitAction = static_cast(actionCollection()->action("split_view")); + splitAction->setChecked(m_view[SecondaryIdx] != 0); + + KToggleAction* sidebarAction = static_cast(actionCollection()->action("sidebar")); + sidebarAction->setChecked(m_sidebar != 0); +} + +void Dolphin::updateGoActions() +{ + KAction* goUpAction = actionCollection()->action(KStdAction::stdName(KStdAction::Up)); + const KUrl& currentURL = m_activeView->url(); + goUpAction->setEnabled(currentURL.upUrl() != currentURL); +} + +void Dolphin::updateViewProperties(const KUrl::List& urls) +{ + if (urls.isEmpty()) { + return; + } + + // Updating the view properties might take up to several seconds + // when dragging several thousand URLs. Writing a KIO slave for this + // use case is not worth the effort, but at least the main widget + // must be disabled and a progress should be shown. + ProgressIndicator progressIndicator(i18n("Updating view properties..."), + QString::null, + urls.count()); + + KUrl::List::ConstIterator end = urls.end(); + for(KUrl::List::ConstIterator it = urls.begin(); it != end; ++it) { + progressIndicator.execOperation(); + + ViewProperties props(*it); + props.save(); + } +} + +void Dolphin::copyURLs(const KUrl::List& source, const KUrl& dest) +{ + KIO::Job* job = KIO::copy(source, dest); + addPendingUndoJob(job, DolphinCommand::Copy, source, dest); +} + +void Dolphin::moveURLs(const KUrl::List& source, const KUrl& dest) +{ + KIO::Job* job = KIO::move(source, dest); + addPendingUndoJob(job, DolphinCommand::Move, source, dest); +} + +void Dolphin::addPendingUndoJob(KIO::Job* job, + DolphinCommand::Type commandType, + const KUrl::List& source, + const KUrl& dest) +{ + connect(job, SIGNAL(result(KIO::Job*)), + this, SLOT(addUndoOperation(KIO::Job*))); + + UndoInfo undoInfo; + undoInfo.id = job->progressId(); + undoInfo.command = DolphinCommand(commandType, source, dest); + m_pendingUndoJobs.append(undoInfo); +} + +void Dolphin::clearStatusBar() +{ + m_activeView->statusBar()->clear(); +} + +void Dolphin::openSidebar() +{ + if (m_sidebar != 0) { + // the sidebar is already open + return; + } + + m_sidebar = new Sidebar(m_splitter); + m_sidebar->show(); + + connect(m_sidebar, SIGNAL(urlChanged(const KUrl&)), + this, SLOT(slotURLChangeRequest(const KUrl&))); + m_splitter->setCollapsible(m_sidebar, false); + m_splitter->setResizeMode(m_sidebar, QSplitter::KeepSize); + m_splitter->moveToFirst(m_sidebar); + + SidebarSettings* settings = DolphinSettings::instance().sidebarSettings(); + settings->setVisible(true); +} + +#include "dolphin.moc" diff --git a/src/dolphin.desktop b/src/dolphin.desktop new file mode 100644 index 000000000..9159e478e --- /dev/null +++ b/src/dolphin.desktop @@ -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 diff --git a/src/dolphin.h b/src/dolphin.h new file mode 100644 index 000000000..4ad709643 --- /dev/null +++ b/src/dolphin.h @@ -0,0 +1,455 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Stefan Monov * + * Copyright (C) 2006 by 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. * + ***************************************************************************/ + +#ifndef _DOLPHIN_H_ +#define _DOLPHIN_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include + +#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 +*/ +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& fileGroupActions() const { return m_fileGroupActions; } + //const QPtrList& linkGroupActions() const { return m_linkGroupActions; } + //const QPtrList& 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 m_pendingUndoJobs; + + /** Contains meta information for creating files. */ + struct CreateFileEntry + { + QString name; + QString filePath; + QString templatePath; + QString icon; + QString comment; + }; + + Q3PtrList m_fileGroupActions; + KSortableList m_createFileTemplates; + + // TODO: not used yet. See documentation of Dolphin::linkGroupActions() + // and Dolphin::linkToDeviceActions() in for details. + //QPtrList m_linkGroupActions; + //QPtrList m_linkToDeviceActions; +}; + +#endif // _DOLPHIN_H_ + diff --git a/src/dolphin.lsm b/src/dolphin.lsm new file mode 100644 index 000000000..67332582d --- /dev/null +++ b/src/dolphin.lsm @@ -0,0 +1,16 @@ +Begin3 +Title: Dolphin -- Some description +Version: 0.1 +Entered-date: +Description: +Keywords: KDE Qt +Author: Peter Penz +Maintained-by: Peter Penz +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 diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp new file mode 100644 index 000000000..51ce6bb60 --- /dev/null +++ b/src/dolphincontextmenu.cpp @@ -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 +#include +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 ) + + 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 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 linkGroupIt(dolphin.linkGroupActions()); + //while ((action = linkGroupIt.current()) != 0) { + // action->plug(createNewMenu); + // ++linkGroupIt; + //} + // + //KPopupMenu* linkToDeviceMenu = new KPopupMenu(); + //QPtrListIterator 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 ) + + 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 openWithVector; + const int openWithID = insertOpenWithItems(popup, openWithVector); + + // Insert 'Actions' sub menu + Q3ValueVector 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& 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& 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 userServices = + KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true); + + Q3ValueList::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; +} diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h new file mode 100644 index 000000000..43e3fca9d --- /dev/null +++ b/src/dolphincontextmenu.h @@ -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 +#include +#include +#include +#include +#include +#include +#include + +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 + */ +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& 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& 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 diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp new file mode 100644 index 000000000..1c779b8dc --- /dev/null +++ b/src/dolphindetailsview.cpp @@ -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 +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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(firstChild()); + if (item != 0) { + setCurrentItem(item->fileInfo()); + } + + int index = 0; + const Q3ValueList history = m_dolphinView->urlHistory(index); + if (!history.isEmpty()) { + KFileView* fileView = static_cast(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(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(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(context)->setPixmap(0, pixmap); +} + +const QPixmap* DolphinDetailsView::contextPixmap(void* context) +{ + return reinterpret_cast(context)->pixmap(0); +} + +void* DolphinDetailsView::firstContext() +{ + return reinterpret_cast(firstChild()); +} + +void* DolphinDetailsView::nextContext(void* context) +{ + KFileListViewItem* listViewItem = reinterpret_cast(context); + return reinterpret_cast(listViewItem->nextSibling()); +} + +KFileItem* DolphinDetailsView::contextFileInfo(void* context) +{ + return reinterpret_cast(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(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(event->source()) == this) { + KFileListViewItem* item = static_cast(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 + // 2001, 2002, 2004 Michael Brade ) + 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(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(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 + // 2001, 2002, 2004 Michael Brade ) + + 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(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(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" diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h new file mode 100644 index 000000000..86f579cce --- /dev/null +++ b/src/dolphindetailsview.h @@ -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 +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include + +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 diff --git a/src/dolphindirlister.cpp b/src/dolphindirlister.cpp new file mode 100644 index 000000000..160c4193d --- /dev/null +++ b/src/dolphindirlister.cpp @@ -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 + +// TODO: +#include + +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" diff --git a/src/dolphindirlister.h b/src/dolphindirlister.h new file mode 100644 index 000000000..d42594284 --- /dev/null +++ b/src/dolphindirlister.h @@ -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 + +/** + * @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 diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp new file mode 100644 index 000000000..2576abba8 --- /dev/null +++ b/src/dolphiniconsview.cpp @@ -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 +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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(firstItem()); + if (item != 0) { + setCurrentItem(item->fileInfo()); + } + + int index = 0; + const Q3ValueList history = m_dolphinView->urlHistory(index); + if (!history.isEmpty()) { + KFileView* fileView = static_cast(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(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(item->nextItem()); + } + } +} + +void DolphinIconsView::setContextPixmap(void* context, + const QPixmap& pixmap) +{ + reinterpret_cast(context)->setPixmap(pixmap); +} + +const QPixmap* DolphinIconsView::contextPixmap(void* context) +{ + return reinterpret_cast(context)->pixmap(); +} + +void* DolphinIconsView::firstContext() +{ + return reinterpret_cast(firstItem()); +} + +void* DolphinIconsView::nextContext(void* context) +{ + KFileIconViewItem* iconViewItem = reinterpret_cast(context); + return reinterpret_cast(iconViewItem->nextItem()); +} + +KFileItem* DolphinIconsView::contextFileInfo(void* context) +{ + return reinterpret_cast(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(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(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(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(item)); + + KFileItem* fileItem = static_cast(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(item)->fileInfo(); + } + m_dolphinView->openContextMenu(fileInfo, pos); +} + +void DolphinIconsView::slotItemRenamed(Q3IconViewItem* item, + const QString& name) +{ + KFileItem* fileInfo = static_cast(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(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" diff --git a/src/dolphiniconsview.h b/src/dolphiniconsview.h new file mode 100644 index 000000000..30ab3140d --- /dev/null +++ b/src/dolphiniconsview.h @@ -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 +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include + +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 diff --git a/src/dolphinsettings.cpp b/src/dolphinsettings.cpp new file mode 100644 index 000000000..8e040d767 --- /dev/null +++ b/src/dolphinsettings.cpp @@ -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 +#include + +#include +#include +#include +#include +#include +#include + +#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; +} diff --git a/src/dolphinsettings.h b/src/dolphinsettings.h new file mode 100644 index 000000000..a9dcb8b62 --- /dev/null +++ b/src/dolphinsettings.h @@ -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 diff --git a/src/dolphinsettingsdialog.cpp b/src/dolphinsettingsdialog.cpp new file mode 100644 index 000000000..d1bb2765d --- /dev/null +++ b/src/dolphinsettingsdialog.cpp @@ -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 +#include +#include "generalsettingspage.h" +#include "viewsettingspage.h" +#include "bookmarkssettingspage.h" +#include "dolphin.h" +//Added by qt3to4: +#include + +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" diff --git a/src/dolphinsettingsdialog.h b/src/dolphinsettingsdialog.h new file mode 100644 index 000000000..8c9ac3cdb --- /dev/null +++ b/src/dolphinsettingsdialog.h @@ -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 +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 + */ +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 diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp new file mode 100644 index 000000000..44b6e2345 --- /dev/null +++ b/src/dolphinstatusbar.cpp @@ -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 +#include +#include +#include + +#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" diff --git a/src/dolphinstatusbar.h b/src/dolphinstatusbar.h new file mode 100644 index 000000000..903e1cdff --- /dev/null +++ b/src/dolphinstatusbar.h @@ -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 +//Added by qt3to4: +#include +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 diff --git a/src/dolphinui.rc b/src/dolphinui.rc new file mode 100644 index 000000000..6e5e27401 --- /dev/null +++ b/src/dolphinui.rc @@ -0,0 +1,109 @@ + + + + + + Create New + + + + + + + + + + + + + + + + + + View Mode + + + + + + Sort + + + + + + + + + + + + + + Navigation Bar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Main Toolbar + + + + + + + + + + + + + diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp new file mode 100644 index 000000000..d6dc75d23 --- /dev/null +++ b/src/dolphinview.cpp @@ -0,0 +1,1087 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Gregor KaliÅ¡nik * + * * + * 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 "dolphinview.h" + +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "urlnavigator.h" +#include "dolphinstatusbar.h" +#include "dolphin.h" +#include "dolphindirlister.h" +#include "viewproperties.h" +#include "dolphindetailsview.h" +#include "dolphiniconsview.h" +#include "dolphincontextmenu.h" +#include "undomanager.h" +#include "renamedialog.h" +#include "progressindicator.h" + +#include "filterbar.h" + +DolphinView::DolphinView(QWidget *parent, + const KUrl& url, + Mode mode, + bool showHiddenFiles) : + QWidget(parent), + m_refreshing(false), + m_showProgress(false), + m_mode(mode), + m_iconsView(0), + m_detailsView(0), + m_statusBar(0), + m_iconSize(0), + m_folderCount(0), + m_fileCount(0), + m_filterBar(0) +{ + setFocusPolicy(Qt::StrongFocus); + m_topLayout = new Q3VBoxLayout(this); + + Dolphin& dolphin = Dolphin::mainWin(); + + connect(this, SIGNAL(signalModeChanged()), + &dolphin, SLOT(slotViewModeChanged())); + connect(this, SIGNAL(signalShowHiddenFilesChanged()), + &dolphin, SLOT(slotShowHiddenFilesChanged())); + connect(this, SIGNAL(signalSortingChanged(DolphinView::Sorting)), + &dolphin, SLOT(slotSortingChanged(DolphinView::Sorting))); + connect(this, SIGNAL(signalSortOrderChanged(Qt::SortOrder)), + &dolphin, SLOT(slotSortOrderChanged(Qt::SortOrder))); + + m_urlNavigator = new URLNavigator(url, this); + connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)), + this, SLOT(slotURLChanged(const KUrl&))); + connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)), + &dolphin, SLOT(slotURLChanged(const KUrl&))); + connect(m_urlNavigator, SIGNAL(historyChanged()), + &dolphin, SLOT(slotHistoryChanged())); + + m_statusBar = new DolphinStatusBar(this); + + m_dirLister = new DolphinDirLister(); + m_dirLister->setAutoUpdate(true); + m_dirLister->setMainWindow(this); + m_dirLister->setShowingDotFiles(showHiddenFiles); + connect(m_dirLister, SIGNAL(clear()), + this, SLOT(slotClear())); + connect(m_dirLister, SIGNAL(percent(int)), + this, SLOT(slotPercent(int))); + connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)), + this, SLOT(slotDeleteItem(KFileItem*))); + connect(m_dirLister, SIGNAL(completed()), + this, SLOT(slotCompleted())); + connect(m_dirLister, SIGNAL(infoMessage(const QString&)), + this, SLOT(slotInfoMessage(const QString&))); + connect(m_dirLister, SIGNAL(errorMessage(const QString&)), + this, SLOT(slotErrorMessage(const QString&))); + connect(m_dirLister, SIGNAL(refreshItems(const KFileItemList&)), + this, SLOT(slotRefreshItems(const KFileItemList&))); + connect(m_dirLister, SIGNAL(redirection(const KUrl&, const KUrl&)), + this, SIGNAL(redirection(const KUrl&, const KUrl&))); + connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)), + this, SLOT(slotAddItems(const KFileItemList&))); + + m_iconSize = K3Icon::SizeMedium; + + m_topLayout->addWidget(m_urlNavigator); + createView(); + + m_filterBar = new FilterBar(this); + m_filterBar->hide(); + m_topLayout->addWidget(m_filterBar); + connect(m_filterBar, SIGNAL(signalFilterChanged(const QString&)), + this, SLOT(slotChangeNameFilter(const QString&))); + + m_topLayout->addWidget(m_statusBar); +} + +DolphinView::~DolphinView() +{ + delete m_dirLister; + m_dirLister = 0; +} + +void DolphinView::setURL(const KUrl& url) +{ + m_urlNavigator->setURL(url); +} + +const KUrl& DolphinView::url() const +{ + return m_urlNavigator->url(); +} + +void DolphinView::requestActivation() +{ + Dolphin::mainWin().setActiveView(this); +} + +bool DolphinView::isActive() const +{ + return (Dolphin::mainWin().activeView() == this); +} + +void DolphinView::setMode(Mode mode) +{ + if (mode == m_mode) { + return; // the wished mode is already set + } + + QWidget* view = (m_iconsView != 0) ? static_cast(m_iconsView) : + static_cast(m_detailsView); + if (view != 0) { + m_topLayout->remove(view); + view->close(); + view->deleteLater(); + m_iconsView = 0; + m_detailsView = 0; + } + + m_mode = mode; + + createView(); + + ViewProperties props(m_urlNavigator->url()); + props.setViewMode(m_mode); + + emit signalModeChanged(); +} + +DolphinView::Mode DolphinView::mode() const +{ + return m_mode; +} + +void DolphinView::setShowHiddenFilesEnabled(bool show) +{ + if (m_dirLister->showingDotFiles() == show) { + return; + } + + ViewProperties props(m_urlNavigator->url()); + props.setShowHiddenFilesEnabled(show); + props.save(); + + m_dirLister->setShowingDotFiles(show); + + emit signalShowHiddenFilesChanged(); + + reload(); +} + +bool DolphinView::isShowHiddenFilesEnabled() const +{ + return m_dirLister->showingDotFiles(); +} + +void DolphinView::setViewProperties(const ViewProperties& props) +{ + setMode(props.viewMode()); + setSorting(props.sorting()); + setSortOrder(props.sortOrder()); + setShowHiddenFilesEnabled(props.isShowHiddenFilesEnabled()); +} + +void DolphinView::renameSelectedItems() +{ + const KUrl::List urls = selectedURLs(); + if (urls.count() > 1) { + // More than one item has been selected for renaming. Open + // a rename dialog and rename all items afterwards. + RenameDialog dialog(urls); + if (dialog.exec() == QDialog::Rejected) { + return; + } + + DolphinView* view = Dolphin::mainWin().activeView(); + const QString& newName = dialog.newName(); + if (newName.isEmpty()) { + view->statusBar()->setMessage(i18n("The new item name is invalid."), + DolphinStatusBar::Error); + } + else { + UndoManager& undoMan = UndoManager::instance(); + undoMan.beginMacro(); + + assert(newName.contains('#')); + + const int urlsCount = urls.count(); + ProgressIndicator* progressIndicator = + new ProgressIndicator(i18n("Renaming items..."), + i18n("Renaming finished."), + urlsCount); + + // iterate through all selected items and rename them... + const int replaceIndex = newName.find('#'); + assert(replaceIndex >= 0); + for (int i = 0; i < urlsCount; ++i) { + const KUrl& source = urls[i]; + QString name(newName); + name.replace(replaceIndex, 1, renameIndexPresentation(i + 1, urlsCount)); + + if (source.fileName() != name) { + KUrl dest(source.upUrl()); + dest.addPath(name); + + const bool destExists = KIO::NetAccess::exists(dest, false, view); + if (destExists) { + delete progressIndicator; + progressIndicator = 0; + view->statusBar()->setMessage(i18n("Renaming failed (item '%1' already exists).").arg(name), + DolphinStatusBar::Error); + break; + } + else if (KIO::NetAccess::file_move(source, dest)) { + // TODO: From the users point of view he executed one 'rename n files' operation, + // but internally we store it as n 'rename 1 file' operations for the undo mechanism. + DolphinCommand command(DolphinCommand::Rename, source, dest); + undoMan.addCommand(command); + } + } + + progressIndicator->execOperation(); + } + delete progressIndicator; + progressIndicator = 0; + + undoMan.endMacro(); + } + } + else { + // Only one item has been selected for renaming. Use the custom + // renaming mechanism from the views. + assert(urls.count() == 1); + if (m_mode == DetailsView) { + Q3ListViewItem* item = m_detailsView->firstChild(); + while (item != 0) { + if (item->isSelected()) { + m_detailsView->rename(item, DolphinDetailsView::NameColumn); + break; + } + item = item->nextSibling(); + } + } + else { + KFileIconViewItem* item = static_cast(m_iconsView->firstItem()); + while (item != 0) { + if (item->isSelected()) { + item->rename(); + break; + } + item = static_cast(item->nextItem()); + } + } + } +} + +void DolphinView::selectAll() +{ + fileView()->selectAll(); +} + +void DolphinView::invertSelection() +{ + fileView()->invertSelection(); +} + +DolphinStatusBar* DolphinView::statusBar() const +{ + return m_statusBar; +} + +int DolphinView::contentsX() const +{ + return scrollView()->contentsX(); +} + +int DolphinView::contentsY() const +{ + return scrollView()->contentsY(); +} + +void DolphinView::refreshSettings() +{ + if (m_iconsView != 0) { + m_iconsView->refreshSettings(); + } + + if (m_detailsView != 0) { + // TODO: There is no usable interface in QListView/KFileDetailView + // to hide/show columns. The easiest approach is to delete + // the current instance and recreate a new one, which automatically + // refreshs the settings. If a proper interface is available in Qt4 + // m_detailsView->refreshSettings() would be enough. + m_topLayout->remove(m_detailsView); + m_detailsView->close(); + m_detailsView->deleteLater(); + m_detailsView = 0; + + createView(); + } +} + +void DolphinView::updateStatusBar() +{ + // As the item count information is less important + // in comparison with other messages, it should only + // be shown if: + // - the status bar is empty or + // - shows already the item count information or + // - shows only a not very important information + // - if any progress is given don't show the item count info at all + const QString msg(m_statusBar->message()); + const bool updateStatusBarMsg = (msg.isEmpty() || + (msg == m_statusBar->defaultText()) || + (m_statusBar->type() == DolphinStatusBar::Information)) && + (m_statusBar->progress() == 100); + + const QString text(hasSelection() ? selectionStatusBarText() : defaultStatusBarText()); + m_statusBar->setDefaultText(text); + + if (updateStatusBarMsg) { + m_statusBar->setMessage(text, DolphinStatusBar::Default); + } +} + +void DolphinView::requestItemInfo(const KUrl& url) +{ + emit signalRequestItemInfo(url); +} + +bool DolphinView::isURLEditable() const +{ + return m_urlNavigator->isURLEditable(); +} + +void DolphinView::zoomIn() +{ + itemEffectsManager()->zoomIn(); +} + +void DolphinView::zoomOut() +{ + itemEffectsManager()->zoomOut(); +} + +bool DolphinView::isZoomInPossible() const +{ + return itemEffectsManager()->isZoomInPossible(); +} + +bool DolphinView::isZoomOutPossible() const +{ + return itemEffectsManager()->isZoomOutPossible(); +} + +void DolphinView::setSorting(Sorting sorting) +{ + if (sorting != this->sorting()) { + KFileView* view = fileView(); + int spec = view->sorting() & ~QDir::Name & ~QDir::Size & ~QDir::Time & ~QDir::Unsorted; + + switch (sorting) { + case SortByName: spec = spec | QDir::Name; break; + case SortBySize: spec = spec | QDir::Size; break; + case SortByDate: spec = spec | QDir::Time; break; + default: break; + } + + ViewProperties props(url()); + props.setSorting(sorting); + + view->setSorting(static_cast(spec)); + + emit signalSortingChanged(sorting); + } +} + +DolphinView::Sorting DolphinView::sorting() const +{ + const QDir::SortSpec spec = fileView()->sorting(); + + if (spec & QDir::Time) { + return SortByDate; + } + + if (spec & QDir::Size) { + return SortBySize; + } + + return SortByName; +} + +void DolphinView::setSortOrder(Qt::SortOrder order) +{ + if (sortOrder() != order) { + KFileView* view = fileView(); + int sorting = view->sorting(); + sorting = (order == Qt::Ascending) ? (sorting & ~QDir::Reversed) : + (sorting | QDir::Reversed); + + ViewProperties props(url()); + props.setSortOrder(order); + + view->setSorting(static_cast(sorting)); + + emit signalSortOrderChanged(order); + } +} + +Qt::SortOrder DolphinView::sortOrder() const +{ + return fileView()->isReversed() ? Qt::Descending : Qt::Ascending; +} + +void DolphinView::goBack() +{ + m_urlNavigator->goBack(); +} + +void DolphinView::goForward() +{ + m_urlNavigator->goForward(); +} + +void DolphinView::goUp() +{ + m_urlNavigator->goUp(); +} + +void DolphinView::goHome() +{ + m_urlNavigator->goHome(); +} + +void DolphinView::setURLEditable(bool editable) +{ + m_urlNavigator->editURL(editable); +} + +const Q3ValueList DolphinView::urlHistory(int& index) const +{ + return m_urlNavigator->history(index); +} + +bool DolphinView::hasSelection() const +{ + const KFileItemList* list = selectedItems(); + return (list != 0) && !list->isEmpty(); +} + +const KFileItemList* DolphinView::selectedItems() const +{ + return fileView()->selectedItems(); +} + +KUrl::List DolphinView::selectedURLs() const +{ + KUrl::List urls; + + const KFileItemList* list = fileView()->selectedItems(); + if (list != 0) { + KFileItemList::const_iterator it = list->begin(); + const KFileItemList::const_iterator end = list->end(); + KFileItem* item = 0; + while (it != end) { + urls.append(item->url()); + ++it; + } + } + + return urls; +} + +const KFileItem* DolphinView::currentFileItem() const +{ + return fileView()->currentFileItem(); +} + +void DolphinView::openContextMenu(KFileItem* fileInfo, const QPoint& pos) +{ + DolphinContextMenu contextMenu(this, fileInfo, pos); + contextMenu.open(); +} + +void DolphinView::rename(const KUrl& source, const QString& newName) +{ + bool ok = false; + + if (newName.isEmpty() || (source.fileName() == newName)) { + return; + } + + KUrl dest(source.upUrl()); + dest.addPath(newName); + + const bool destExists = KIO::NetAccess::exists(dest, + false, + Dolphin::mainWin().activeView()); + if (destExists) { + // the destination already exists, hence ask the user + // how to proceed... + KIO::RenameDlg renameDialog(this, + i18n("File Already Exists"), + source.path(), + dest.path(), + KIO::M_OVERWRITE); + switch (renameDialog.exec()) { + case KIO::R_OVERWRITE: + // the destination should be overwritten + ok = KIO::NetAccess::file_move(source, dest, -1, true); + break; + + case KIO::R_RENAME: { + // a new name for the destination has been used + KUrl newDest(renameDialog.newDestUrl()); + ok = KIO::NetAccess::file_move(source, newDest); + break; + } + + default: + // the renaming operation has been canceled + reload(); + return; + } + } + else { + // no destination exists, hence just move the file to + // do the renaming + ok = KIO::NetAccess::file_move(source, dest); + } + + if (ok) { + m_statusBar->setMessage(i18n("Renamed file '%1' to '%2'.").arg(source.fileName(), dest.fileName()), + DolphinStatusBar::OperationCompleted); + + DolphinCommand command(DolphinCommand::Rename, source, dest); + UndoManager::instance().addCommand(command); + } + else { + m_statusBar->setMessage(i18n("Renaming of file '%1' to '%2' failed.").arg(source.fileName(), dest.fileName()), + DolphinStatusBar::Error); + reload(); + } +} + +void DolphinView::reload() +{ + startDirLister(m_urlNavigator->url(), true); +} + +void DolphinView::slotURLListDropped(QDropEvent* /* event */, + const KUrl::List& urls, + const KUrl& url) +{ + KUrl destination(url); + if (destination.isEmpty()) { + destination = m_urlNavigator->url(); + } + else { + // Check whether the destination URL is a directory. If this is not the + // case, use the navigator URL as destination (otherwise the destination, + // which represents a file, would be replaced by a copy- or move-operation). + KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, destination); + if (!fileItem.isDir()) { + destination = m_urlNavigator->url(); + } + } + + Dolphin::mainWin().dropURLs(urls, destination); +} + +void DolphinView::mouseReleaseEvent(QMouseEvent* event) +{ + QWidget::mouseReleaseEvent(event); + Dolphin::mainWin().setActiveView(this); +} + +void DolphinView::slotURLChanged(const KUrl& url) +{ + const ViewProperties props(url); + setMode(props.viewMode()); + + const bool showHiddenFiles = props.isShowHiddenFilesEnabled(); + setShowHiddenFilesEnabled(showHiddenFiles); + m_dirLister->setShowingDotFiles(showHiddenFiles); + + setSorting(props.sorting()); + setSortOrder(props.sortOrder()); + + startDirLister(url); + + // The selectionChanged signal is not emitted when a new view object is + // created. The application does not care whether a view is represented by a + // different instance, hence inform the application that the selection might have + // changed so that it can update it's actions. + Dolphin::mainWin().slotSelectionChanged(); + + emit signalURLChanged(url); +} + +void DolphinView::triggerIconsViewItem(Q3IconViewItem* item) +{ + /* KDE4-TODO: + const Qt::ButtonState keyboardState = KApplication::keyboardMouseState(); + const bool isSelectionActive = ((keyboardState & Qt::ShiftModifier) > 0) || + ((keyboardState & Qt::ControlModifier) > 0);*/ + const bool isSelectionActive = false; + if ((item != 0) && !isSelectionActive) { + // Updating the URL must be done outside the scope of this slot, + // as iconview items will get deleted. + QTimer::singleShot(0, this, SLOT(updateURL())); + Dolphin::mainWin().setActiveView(this); + } +} + +void DolphinView::triggerDetailsViewItem(Q3ListViewItem* item, + const QPoint& pos, + int /* column */) +{ + if (item == 0) { + return; + } + + if (m_detailsView->isOnFilename(item, pos)) { + // Updating the URL must be done outside the scope of this slot, + // as listview items will get deleted. + QTimer::singleShot(0, this, SLOT(updateURL())); + Dolphin::mainWin().setActiveView(this); + } + else { + m_detailsView->clearSelection(); + } +} + +void DolphinView::triggerDetailsViewItem(Q3ListViewItem* item) +{ + const QPoint pos(0, item->itemPos()); + triggerDetailsViewItem(item, pos, 0); +} + +void DolphinView::updateURL() +{ + KFileView* fileView = (m_iconsView != 0) ? static_cast(m_iconsView) : + static_cast(m_detailsView); + + KFileItem* fileItem = fileView->currentFileItem(); + if (fileItem == 0) { + return; + } + + if (fileItem->isDir()) { + // Prefer the local path over the URL. This assures that the + // volume space information is correct. Assuming that the URL is media:/sda1, + // and the local path is /windows/C: For the URL the space info is related + // to the root partition (and hence wrong) and for the local path the space + // info is related to the windows partition (-> correct). + const QString localPath(fileItem->localPath()); + if (localPath.isEmpty()) { + setURL(fileItem->url()); + } + else { + setURL(KUrl(localPath)); + } + } + else { + fileItem->run(); + } +} + +void DolphinView::slotPercent(int percent) +{ + if (m_showProgress) { + m_statusBar->setProgress(percent); + } +} + +void DolphinView::slotClear() +{ + fileView()->clearView(); + updateStatusBar(); +} + +void DolphinView::slotDeleteItem(KFileItem* item) +{ + fileView()->removeItem(item); + updateStatusBar(); +} + +void DolphinView::slotCompleted() +{ + m_refreshing = true; + + KFileView* view = fileView(); + view->clearView(); + + // TODO: in Qt4 the code should get a lot + // simpler and nicer due to Interview... + if (m_iconsView != 0) { + m_iconsView->beginItemUpdates(); + } + if (m_detailsView != 0) { + m_detailsView->beginItemUpdates(); + } + + if (m_showProgress) { + m_statusBar->setProgressText(QString::null); + m_statusBar->setProgress(100); + m_showProgress = false; + } + + KFileItemList items(m_dirLister->items()); + KFileItemList::const_iterator it = items.begin(); + const KFileItemList::const_iterator end = items.end(); + + m_fileCount = 0; + m_folderCount = 0; + + KFileItem* item = 0; + while (it != end) { + view->insertItem(item); + if (item->isDir()) { + ++m_folderCount; + } + else { + ++m_fileCount; + } + ++it; + } + + updateStatusBar(); + + if (m_iconsView != 0) { + // Prevent a flickering of the icon view widget by giving a small + // timeslot to swallow asynchronous update events. + m_iconsView->setUpdatesEnabled(false); + QTimer::singleShot(10, this, SLOT(slotDelayedUpdate())); + } + + if (m_detailsView != 0) { + m_detailsView->endItemUpdates(); + m_refreshing = false; + } +} + +void DolphinView::slotDelayedUpdate() +{ + if (m_iconsView != 0) { + m_iconsView->setUpdatesEnabled(true); + m_iconsView->endItemUpdates(); + } + m_refreshing = false; +} + +void DolphinView::slotInfoMessage(const QString& msg) +{ + m_statusBar->setMessage(msg, DolphinStatusBar::Information); +} + +void DolphinView::slotErrorMessage(const QString& msg) +{ + m_statusBar->setMessage(msg, DolphinStatusBar::Error); +} + +void DolphinView::slotRefreshItems(const KFileItemList& /* list */) +{ + QTimer::singleShot(0, this, SLOT(reload())); +} + +void DolphinView::slotAddItems(const KFileItemList& list) +{ + fileView()->addItemList(list); + fileView()->updateView(); +} + +void DolphinView::slotGrabActivation() +{ + Dolphin::mainWin().setActiveView(this); +} + +void DolphinView::slotContentsMoving(int x, int y) +{ + if (!m_refreshing) { + // Only emit a 'contents moved' signal if the user + // moved the content by adjusting the sliders. Adjustments + // resulted by refreshing a directory should not be respected. + emit contentsMoved(x, y); + } +} + +void DolphinView::createView() +{ + assert(m_iconsView == 0); + assert(m_detailsView == 0); + + switch (m_mode) { + case IconsView: + case PreviewsView: { + const DolphinIconsView::LayoutMode layoutMode = (m_mode == IconsView) ? + DolphinIconsView::Icons : + DolphinIconsView::Previews; + m_iconsView = new DolphinIconsView(this, layoutMode); + m_topLayout->insertWidget(1, m_iconsView); + setFocusProxy(m_iconsView); + + connect(m_iconsView, SIGNAL(executed(Q3IconViewItem*)), + this, SLOT(triggerIconsViewItem(Q3IconViewItem*))); + connect(m_iconsView, SIGNAL(returnPressed(Q3IconViewItem*)), + this, SLOT(triggerIconsViewItem(Q3IconViewItem*))); + connect(m_iconsView, SIGNAL(signalRequestActivation()), + this, SLOT(slotGrabActivation())); + + m_iconsView->endItemUpdates(); + m_iconsView->show(); + m_iconsView->setFocus(); + break; + } + + case DetailsView: { + m_detailsView = new DolphinDetailsView(this); + m_topLayout->insertWidget(1, m_detailsView); + setFocusProxy(m_detailsView); + + connect(m_detailsView, SIGNAL(executed(Q3ListViewItem*, const QPoint&, int)), + this, SLOT(triggerDetailsViewItem(Q3ListViewItem*, const QPoint&, int))); + connect(m_detailsView, SIGNAL(returnPressed(Q3ListViewItem*)), + this, SLOT(triggerDetailsViewItem(Q3ListViewItem*))); + connect(m_detailsView, SIGNAL(signalRequestActivation()), + this, SLOT(slotGrabActivation())); + m_detailsView->show(); + m_detailsView->setFocus(); + break; + } + + default: + break; + } + + connect(scrollView(), SIGNAL(contentsMoving(int, int)), + this, SLOT(slotContentsMoving(int, int))); + + startDirLister(m_urlNavigator->url()); +} + +KFileView* DolphinView::fileView() const +{ + return (m_mode == DetailsView) ? static_cast(m_detailsView) : + static_cast(m_iconsView); +} + +Q3ScrollView* DolphinView::scrollView() const +{ + return (m_mode == DetailsView) ? static_cast(m_detailsView) : + static_cast(m_iconsView); +} + +ItemEffectsManager* DolphinView::itemEffectsManager() const +{ + return (m_mode == DetailsView) ? static_cast(m_detailsView) : + static_cast(m_iconsView); +} + +void DolphinView::startDirLister(const KUrl& url, bool reload) +{ + if (!url.isValid()) { + const QString location(url.pathOrUrl()); + if (location.isEmpty()) { + m_statusBar->setMessage(i18n("The location is empty."), DolphinStatusBar::Error); + } + else { + m_statusBar->setMessage(i18n("The location '%1' is invalid.").arg(location), + DolphinStatusBar::Error); + } + return; + } + + // Only show the directory loading progress if the status bar does + // not contain another progress information. This means that + // the directory loading progress information has the lowest priority. + const QString progressText(m_statusBar->progressText()); + m_showProgress = progressText.isEmpty() || + (progressText == i18n("Loading directory...")); + if (m_showProgress) { + m_statusBar->setProgressText(i18n("Loading directory...")); + m_statusBar->setProgress(0); + } + + m_refreshing = true; + m_dirLister->stop(); + m_dirLister->openUrl(url, false, reload); +} + +QString DolphinView::defaultStatusBarText() const +{ + // TODO: the following code is not suitable for languages where multiple forms + // of plurals are given (e. g. in Poland three forms of plurals exist). + const int itemCount = m_folderCount + m_fileCount; + + QString text; + if (itemCount == 1) { + text = i18n("1 Item"); + } + else { + text = i18n("%1 Items").arg(itemCount); + } + + text += " ("; + + if (m_folderCount == 1) { + text += i18n("1 Folder"); + } + else { + text += i18n("%1 Folders").arg(m_folderCount); + } + + text += ", "; + + if (m_fileCount == 1) { + text += i18n("1 File"); + } + else { + text += i18n("%1 Files").arg(m_fileCount); + } + + text += ")"; + + return text; +} + +QString DolphinView::selectionStatusBarText() const +{ + // TODO: the following code is not suitable for languages where multiple forms + // of plurals are given (e. g. in Poland three forms of plurals exist). + QString text; + const KFileItemList* list = selectedItems(); + assert((list != 0) && !list->isEmpty()); + + int fileCount = 0; + int folderCount = 0; + KIO::filesize_t byteSize = 0; + KFileItemList::const_iterator it = list->begin(); + const KFileItemList::const_iterator end = list->end(); + while (it != end){ + KFileItem* item = *it; + if (item->isDir()) { + ++folderCount; + } + else { + ++fileCount; + byteSize += item->size(); + } + ++it; + } + + if (folderCount == 1) { + text = i18n("1 Folder selected"); + } + else if (folderCount > 1) { + text = i18n("%1 Folders selected").arg(folderCount); + } + + if ((fileCount > 0) && (folderCount > 0)) { + text += ", "; + } + + const QString sizeText(KIO::convertSize(byteSize)); + if (fileCount == 1) { + text += i18n("1 File selected (%1)").arg(sizeText); + } + else if (fileCount > 1) { + text += i18n("%1 Files selected (%1)").arg(fileCount).arg(sizeText); + } + + return text; +} + +QString DolphinView::renameIndexPresentation(int index, int itemCount) const +{ + // assure that the string reprentation for all indicess have the same + // number of characters based on the given number of items + QString str(QString::number(index)); + int chrCount = 1; + while (itemCount >= 10) { + ++chrCount; + itemCount /= 10; + } + str.reserve(chrCount); + + const int insertCount = chrCount - str.length(); + for (int i = 0; i < insertCount; ++i) { + str.insert(0, '0'); + } + return str; +} + +void DolphinView::slotShowFilterBar(bool show) +{ + assert(m_filterBar != 0); + if (show) { + m_filterBar->show(); + } + else { + m_filterBar->hide(); + } +} + +void DolphinView::slotChangeNameFilter(const QString& nameFilter) +{ + // The name filter of KDirLister does a 'hard' filtering, which + // means that only the items are shown where the names match + // exactly the filter. This is non-transparent for the user, which + // just wants to have a 'soft' filtering: does the name contain + // the filter string? + QString adjustedFilter(nameFilter); + adjustedFilter.insert(0, '*'); + adjustedFilter.append('*'); + + m_dirLister->setNameFilter(adjustedFilter); + m_dirLister->emitChanges(); + + // TODO: this is a workaround for QIconView: the item position + // stay as they are by filtering, only an inserting of an item + // results to an automatic adjusting of the item position. In Qt4/KDE4 + // this workaround should get obsolete due to Interview. + KFileView* view = fileView(); + if (view == m_iconsView) { + KFileItem* first = view->firstFileItem(); + if (first != 0) { + view->removeItem(first); + view->insertItem(first); + } + } +} + +bool DolphinView::isFilterBarVisible() +{ + return m_filterBar->isVisible(); +} + +#include "dolphinview.moc" diff --git a/src/dolphinview.h b/src/dolphinview.h new file mode 100644 index 000000000..fbde8245c --- /dev/null +++ b/src/dolphinview.h @@ -0,0 +1,458 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Gregor KaliÅ¡nik * + * * + * 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 +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 + */ +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 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_ diff --git a/src/editbookmarkdialog.cpp b/src/editbookmarkdialog.cpp new file mode 100644 index 000000000..d467db15d --- /dev/null +++ b/src/editbookmarkdialog.cpp @@ -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 +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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" diff --git a/src/editbookmarkdialog.h b/src/editbookmarkdialog.h new file mode 100644 index 000000000..e3578a940 --- /dev/null +++ b/src/editbookmarkdialog.h @@ -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 +#include + +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 diff --git a/src/filterbar.cpp b/src/filterbar.cpp new file mode 100644 index 000000000..eb7be1b2d --- /dev/null +++ b/src/filterbar.cpp @@ -0,0 +1,94 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Gregor KaliÅ¡nik * + * * + * 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 +#include +//Added by qt3to4: +#include +#include +#include + +#include +#include +#include +#include +#include + +#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" diff --git a/src/filterbar.h b/src/filterbar.h new file mode 100644 index 000000000..5f5ca9dc1 --- /dev/null +++ b/src/filterbar.h @@ -0,0 +1,68 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Gregor KaliÅ¡nik * + * * + * 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 +//Added by qt3to4: +#include +#include + +class QLabel; +class KLineEdit; +class KPushButton; + +/** + * @brief Provides an input field for filtering the currently shown items. + * + * @author Gregor KaliÅ¡nik + */ +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 diff --git a/src/generalsettings.kcfg b/src/generalsettings.kcfg new file mode 100644 index 000000000..5b6470db7 --- /dev/null +++ b/src/generalsettings.kcfg @@ -0,0 +1,27 @@ + + + + + + + + 0 + + + + false + + + + true + + + + ~ + + + + false + + + \ No newline at end of file diff --git a/src/generalsettings.kcfgc b/src/generalsettings.kcfgc new file mode 100644 index 000000000..96d4c1fb5 --- /dev/null +++ b/src/generalsettings.kcfgc @@ -0,0 +1,4 @@ +File=generalsettings.kcfg +ClassName=GeneralSettings +Singleton=false +Mutators=true \ No newline at end of file diff --git a/src/generalsettingspage.cpp b/src/generalsettingspage.cpp new file mode 100644 index 000000000..d1d22eb48 --- /dev/null +++ b/src/generalsettingspage.cpp @@ -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 +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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" diff --git a/src/generalsettingspage.h b/src/generalsettingspage.h new file mode 100644 index 000000000..eb889a872 --- /dev/null +++ b/src/generalsettingspage.h @@ -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 +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 + */ +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 diff --git a/src/hi128-app-dolphin.png b/src/hi128-app-dolphin.png new file mode 100644 index 0000000000000000000000000000000000000000..e01c24b0d22d5b44bf5f8ee4c40d87d658df26d3 GIT binary patch literal 65877 zcmeHw2Vh*q@%P;6PQ5p)*ph7A3t(a!OflF%=q+>-dP@O9NPzICnh+9NfY7T$3ng?M zx(i@%!@XBYmSy$cPrAGB_uKdO-Mdrq$;RM(F!tW=&d!#%Gdnw5-qSs&o_tI~Y)-6* zBpi3_QNMtH2VHa|e!rS>@nU$9mz;3SQR3&nf6aRJ5ny7jJ@(u`io~VSIppbQvqTEy zxTB_?@n?q|amSq79e%$bbU(q5wFg{$aEHV3V}1Vb<+-!YoSiH_-@_Pcr(kp@`F*|; zZ(H@fHJ_aKJQ~mr=lfn7Vpd`w^v>_I;vZvO*=Nq4F5)i|hw}mqwIoB|ItDqTGagBt zcp6p z{%f@3Yq$>6?dfK9EB_|}=+-5>hsZg5)_9Eehs5ug0e%+*FG1e` zM~T~I_(=eEq3iN4_;M=d`573TF!0DEkweC$%8h65BjbleTP41=PUOS22GcDh0`IRf z1z=f~INS;OuB2f(38T*P#pE6Npdad9m5D+RgVFf+E62#tY_}}g)GA+sp5Tnh91U+7 zToarZZkORF0q959<1E`@!G^|~-#t>Yd0mO8MVwJxE=OFXGWpO1M`WrN z0BV5Uf}aGSm+l*K`GSiv)NjYq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n8kdjA_K_;?4gqmRYMXl~dhQXzGiX z)h>MK#kTG9`#aa``hQfuT?6bb0^mqK;EKG2(dW*0INjN?c$eORUA0_X5cv3}5z5G8 zqi5mUyEp&4NbM*x?!y|tanL`l4;f%gr4w@o2U0 z%)$rBj~n(@0U%dma(?mllM!*57sNpe&_Kw+A4ufh098NLy|<&erg7an|E`(;@LVL5 z>D%Er>UlY0mv+OD??(lDvj8{~_q`-9VbnRFM5m+-cSRXXLN=JpZ!cT^S>@cnzV4|j z}o+j<@?|7fggG&@PEGtci{<6zilYb?;ktvsHtbz kvpepP+qv@jLE*A1AE{nC=TUB<%5g`ZeAL_1F1qvo0ibBj8UO$Q literal 0 HcmV?d00001 diff --git a/src/hi16-app-dolphin.png b/src/hi16-app-dolphin.png new file mode 100644 index 0000000000000000000000000000000000000000..d3d48de000be338dfb8e960e8278c942291a8d65 GIT binary patch literal 1147 zcmb7DQAiX~6g{)eE}LZ<^$|%#LHL!KRQ9)4E4o;w6@p5Ufk=d?C52&9lEp#tG7JZcNuC=VQvoo`=d*941iTcqS-o5kAyZ78P_q_?$R9EEY zY|R0X8>sZ3AfM0E>mj>6E}F=B&Q(?TA^3Up_Gv#MYuhX9F9GW|@l^0&cnhEw1pJ3i z9o(qot1&~NAUR4pXE_lJ2t`_nPu$s+jj3t&oz1)Z*4@ z@w%@N@sxu(#WNa;a%X|oDIo|@=#erVrIY=86cttqaU)BZeGzF&Z~@&NM3%&pYI8wt7RL`9LQTjGBN{n z-3<{z+Oic;rS6-{D>XF~;Pn0t80)wqzyD)RQ1&9jMhXlp=s@t+1Ol}sxW^adpJ6Q~ zFxJ?J-80W6YR%8#)$xZ==%}rfK?+PAG3tS(r|=^RoE&ztxl2^D{{2-Pp=5V+kK8C8 z>cv9Zizj7+Fm>Jjgg>Of(vtWYqZmFv9z@XmsU7>iK9k9LZPz9In`{}8aNxLBXE%}W zfJp?ggp9Gzh=`7T8OSCNwA5l}zKTHb1;TT`P&RTO*5+y^FpwYxhL*t04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hg}dTnbBfJtfK(o^f~zJ zc9$@P$F=i~_q*5$@ZEzYgXeGd9?(Q2xvNirNCQ*TZM`fN*pd(A%+JASY6c{lqY?{%5DcdTgFd7(^%(g28C?-H{?R=Kp{@PHgs{zusAOuVYw9fC!WF z??mGEg-~^*VX*OjU-vjzz*MUi(-V29R9qCQ_*s^vt7%-G_ISb}>+KzG$v)d=HRj|_ z)8g{&!ARwSt97To-e0-EVYuRQxx6hctxj(sq6)@mgsYDsnD<2~Or4#6sHxaks W@cP{wb8ZwW>#~(=ihnHHw(lPk>u9Y2 literal 0 HcmV?d00001 diff --git a/src/hi32-app-dolphin.png b/src/hi32-app-dolphin.png new file mode 100644 index 0000000000000000000000000000000000000000..6747c6b8af7269bea0096fe226b1487fbc19940b GIT binary patch literal 4235 zcmb_e32;-_6+QZrti_Tgd65?^?<}SUW2lor6N8Nj_5dag&;lhLAj33_JA`2$m`p;Z z8MaQLG)z(&z%%WHvXlU!ffQmJFce(8L2L|O2sU_;E!&c;US>xs|uRL7c{et&7Lw#4QdV6|~6wZnvQIDR@p5 zok*ApQYiyxGNK2je{3d~dRF>fo?v%xXG!_{FBHnO2FyItt>?X-b&(p`ngyu_ zok}T1!IePxH(lHBwOcRAbg`=@#RbjFPLG5_Cxz7o)IW6L-u*V@r0Adc4gpwSHU(pWDU;HC)s$pc<`_f$9gU~@D( z(GX?7Hs@6Wze`GN8Hfb~A7fOW+BaXTPl@E7Ta0L`55+g>e7X9Cd&yyuxn3<@+uV+M}yj_C(v=0U(kfFnMXo}SbsZ0Uh&uIi-fSc2& zPNp#y29bZF0fNu_$jWNfcSsNIQX%nUoJoPo)+Yf6!Fd*Zrc7u}!QqBPB7-22X?Tyq zFHwXf(Fm*PA`e6ZC_kHB&tX7oH;>FQ8q{0JtpqZXiiXhY5*EWAH|?CfO3J(-@oN=a zK*$6d2_$8Q2)L|69qVF@`nTc??C-Zrd4mlTMyX(CEPu-7ga1VjFmS6EypIP@9Rd+a zDklTv0b2M&0%c(tE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cDoay0UktzQCX%aw8?ll94@%sZn_`(s7<$-r(`G#hV={WSN67aJbt*hp~;Hl z|289y-2Sw5*(e_egrl0l*veDlrbMeTnFt?E*{Rpj;YYx%`pL;6dJ~nOl#vWzU-%je z=IuFG^6=hmI)b~Y@C=vY$}Z$=D;wVRyzQqs_Y4PyFXVKzl;_KouUtA(Y{9ym5cE>{ z-F>nVhtE{r>#02axBL(PSw$1h4xh9j+$12VQ)2LQu($-i=5mqKZfRo|5K;2;^QpQ# zzbHm6I<^1BZPmh;6+J@6=3Dl#tPhUT^hKl@q)DVKK+o)q`kqU^%NjNw6u{=gp U^~8y&f3Qipv+}Y}Wi5aIzbrpG-T(jq literal 0 HcmV?d00001 diff --git a/src/hi48-app-dolphin.png b/src/hi48-app-dolphin.png new file mode 100644 index 0000000000000000000000000000000000000000..ab9c66571e9ea55d6a367010f8f3ba066bc5fe35 GIT binary patch literal 9383 zcmc&)33OCdn*QEi`Hg4Uvj;+qv&Y9^sqvv== z=Zv#-YoBpJZEdyNBX+xiiVK@GB8wz3ED2f2Mv_WZs#1H^dvE^xQdK4pZ0s}i+?-qY zzFYU*`+fg*m&)U7SFf;JN-O~Em;Ye-RaDloY?A5oIzIWYRLC1wu2>G8{k{0{Yrmov z^Ur>8!vlb|fMpKPJU0QDjLVlVx%$TvS66+gnWIksZ>i+^9lWk(iUkf=LDS~P!-HD} zKe+x61Sol~pu}_S_bj}ZN;$L5iLaUi&Omq52cGXf zTE)q($4rWJdor1H=;`QTHQW*#57%E!1C<+h$vT8N63^XQQlQ+hYC*AW_Kafe>k-h> z3~-tVO*DxU7XRYuX;sB#OX>lk6W7_#Kqfr;|AE1gd}h1+S@@Dw=rR zM3-{=vO14%&Wu8Y1uM3-10j-YBA!N1ryqrG8EY5LsJNiq8ai|$+55yBy$L`x>1xVB z?=!4_eF7YhTR8}KE}i9>cH^=M)_&cL;~^fWLgcCBs{Z~6+KzRiwnV`CmF4*KFcOcy z-q+IFmkJ4Kvy;+cr>;hsb zk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 0 HcmV?d00001 diff --git a/src/hi64-app-dolphin.png b/src/hi64-app-dolphin.png new file mode 100644 index 0000000000000000000000000000000000000000..b25e754e7ffa7c996adec19b726375ec1f78648a GIT binary patch literal 16579 zcmdU12Y^)7x&H3-wlmusWm$S#6oZObD2hl#MPdPy7}1!BEe4aAs4uoyV)85zOCrV+ ziBV$#8)66+qOepc3(ErAV9RVT)60F|e`oG8yA(lviTUBo>F1um|L5Ebzny*lj5J4~ z13=o$bIzK>e2OHSg}<*X_~~9|mMhPlaTZkh^W4gp9%GCBrgP@q3^=nSDfrXkd|(h} zo;CHNUnau5~eRZ@!vhKaPCLx zYCO77Rh9o4kYhu2oe!3r@uRtqA2YQweJLXRR}i4zyj2S+)xY+*teyqu4Z?y8`r*D8 z_TsTu{F8`yf2JT)XWs1PckMlDT)ENXG@-4-0Oz=c^}a1K65UKH z(;?v-Nr0j&J{b>Hc_gmlj7g)@amyt`pgL`M=rf?9ow810&$QDVswzCk{pfmATK;Ia z-ITWA{9@cNyD*x2{s$(5bHF9Ucq>zgNhINr@Qors@s*zxLowb-u3z3i%Zht0ABLfW zU3jw$C}R@Db*QKbVfe5tR5#jBo=54p|LUPw`dMpj@fF*u6xDn(Vqq)CdYHsWezOTM z^qO_)@mO>rpxl^dGkJdYok6&0au(jH0G55)8}VQODBr#tP4$hKG%6j7ZWs%jCDw87 z?d27#xB0pZ25a07V+`hWx;~hh3`~cG|F{GUyLR1tRaGB`!RWbpb`idRRxUno2JT+n z8}Ud4sNC&E^`08ojVcyhKL(S=rsJ*`efaacwYyb>I$*R#Osd1Gs9hn&AX%rN8czdR0^>1N!%6!>%(9eWCq($XAgZS78HD|KB}j4{=& z#*{dp1IyqaoDkmo{0`zEb|7We0j!RR0H;4zTdcxx6QA<~@jz-U))@`@-fj47$uDZ& zx~HDYrr7DkLrQ*CmN0OtdZXK6_ROD>hpVP#VhwHci?r;K*n!PRX?s~4%6HX+ii|rh z9fV6KrQ@NM!0QxwAxvL~ZnY;QT!E_}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.kcfg new file mode 100644 index 000000000..18625237a --- /dev/null +++ b/src/iconsmodesettings.kcfg @@ -0,0 +1,43 @@ + + + + + kiconloader.h + + + + LeftToRight + + + + KGlobalSettings::generalFont().family() + + + + KGlobalSettings::generalFont().pointSize() + + + + KIcon::SizeMedium + + + + 0 + + + + + + + KIcon::SizeMedium + + + + 2 + + + + KIcon::SizeMedium + + + \ No newline at end of file diff --git a/src/iconsmodesettings.kcfgc b/src/iconsmodesettings.kcfgc new file mode 100644 index 000000000..31f564a2a --- /dev/null +++ b/src/iconsmodesettings.kcfgc @@ -0,0 +1,4 @@ +File=iconsmodesettings.kcfg +ClassName=IconsModeSettings +Singleton=false +Mutators=true \ No newline at end of file diff --git a/src/iconsviewsettingspage.cpp b/src/iconsviewsettingspage.cpp new file mode 100644 index 000000000..ad95155a8 --- /dev/null +++ b/src/iconsviewsettingspage.cpp @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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" diff --git a/src/iconsviewsettingspage.h b/src/iconsviewsettingspage.h new file mode 100644 index 000000000..ed6637e9c --- /dev/null +++ b/src/iconsviewsettingspage.h @@ -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 +#include + +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 + */ +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 diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp new file mode 100644 index 000000000..4419817b9 --- /dev/null +++ b/src/infosidebarpage.cpp @@ -0,0 +1,634 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * * + * 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 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#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(""); + text.append(m_shownURL.fileName()); + text.append(""); + 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(""); + text.append(bookmark.text()); + text.append(""); + 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(m_infoWidgets.count())) { + Q3PtrListIterator 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(""); + labelStr.append(labelText); + labelStr.append(" "); + + 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 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 userServices = + KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true); + + // iterate through all actions and add them to a widget + Q3ValueList::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); +} + diff --git a/src/infosidebarpage.h b/src/infosidebarpage.h new file mode 100644 index 000000000..4b2152764 --- /dev/null +++ b/src/infosidebarpage.h @@ -0,0 +1,199 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz + * * + * 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 + +#include +#include +//Added by qt3to4: +#include +#include +#include +#include + +#include +#include +#include + +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 m_infoWidgets; // TODO: use children() from QObject instead + + Q3VBox* m_actionBox; + Q3PtrList m_actionWidgets; // TODO: use children() from QObject instead + Q3ValueVector 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_ diff --git a/src/itemeffectsmanager.cpp b/src/itemeffectsmanager.cpp new file mode 100644 index 000000000..f47c43998 --- /dev/null +++ b/src/itemeffectsmanager.cpp @@ -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 +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +#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 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(); +} diff --git a/src/itemeffectsmanager.h b/src/itemeffectsmanager.h new file mode 100644 index 000000000..7f5f3814f --- /dev/null +++ b/src/itemeffectsmanager.h @@ -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 +#include +#include +#include +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 + */ +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 m_disabledItems; + + /** Returns the text for the statusbar for an activated item. */ + QString statusBarText(KFileItem* fileInfo) const; +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 000000000..00e6aeb99 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * Copyright (C) 2006 by Stefan Monov * + * * + * 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 +#include +#include +#include +#include + +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(); +} diff --git a/src/pics/128x128/CMakeLists.txt b/src/pics/128x128/CMakeLists.txt new file mode 100644 index 000000000..b5f616202 --- /dev/null +++ b/src/pics/128x128/CMakeLists.txt @@ -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 +# diff --git a/src/pics/128x128/preview.png b/src/pics/128x128/preview.png new file mode 100644 index 0000000000000000000000000000000000000000..d97c893c205dd9b2dc5c495dd4ed6fffcc1abed5 GIT binary patch literal 49440 zcma&PS*&eadYCo)Zq3#2=A5(7x#!%j>Q>{rRpl}j8!IHn5L+07h{a1#gv1*Uyzs&U z5)lsw1W0itkRS4b6boV^M_42{p%UA1T(~OL`qu65J>5RLU+rA8Z~6W)*FJR-h3ny5@oCAkrdvE{yf!6Oy(OKyuG374OCCNAbtCsw&!ed-;aS?zZ26GO zpjwsHw7Ra{mr+?d{bdy-cbaW<1Dmuil*axgSF35I)@@6@=`?g*L7X3w}xf` z;s)?Bx>g!Cd1joneA_skB#}y0mjrhFNPY55jq+`1Oc+nn+rD7|Yujg$BA>nFk@9_o zeIZ>2!zA&B*6B2Ps7GDWYbM*)wOV?u8rO8&&;m>M^v;n%{mZY42~gnfVMIlJ`_d8B zP|JL%0m$=yY^nMz*ItaDL65A7l;YQ^;4=^)74Z6yd;xMI$)7R-q-(?tdM&ZH-O_xnMD7Mf%0f!3uZ)2a<^>1Mz(+PAQ;{Qu{R{5>S4 z5j6&Zn4pLt)60VDPNxI?O`mQw(l5aR>7Xjk7kQWia>$=xI_M#g-6u$5tzJ==vB&*x z;AkU9kE<>vXRT2)KoBqs+JbsuvfNQt;ekMo_GAjUXkV5`kNX05e(098O6w+f6jJr* zrsbPmsV13MbdDO-M5={v2n8_r!%sp?n4^o26tJbWWb;m1rhJp@ zSj>1xlU^z)GKKJ;qk(pvbWNi-`?snuGHrCTZ%pdk4_Au+^kTHE06`x$B=tfN0~#_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P#DnDg>u@R zN9vMHm0NqsRKBvYrGv;$IRYMk0UbH-Go1fA|~! I;Q#pl04t{x&;S4c literal 0 HcmV?d00001 diff --git a/src/pics/16x16/CMakeLists.txt b/src/pics/16x16/CMakeLists.txt new file mode 100644 index 000000000..6c5745d38 --- /dev/null +++ b/src/pics/16x16/CMakeLists.txt @@ -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 +# diff --git a/src/pics/16x16/editurl.png b/src/pics/16x16/editurl.png new file mode 100644 index 0000000000000000000000000000000000000000..5b4675bedbfb9f1a70755ec12d7e7d44da9815e5 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPmr;wQ(ZR9;*z`??=t(~$o z{&ZT0&S5XfrjUt?O3XByzObIPwK*Waih1V(z66J~XIoa!RLl%vP%qeGe)Vp;#ahu# zw;R_moYP8R&$ueD!MrVfbJ02fFp0EdYZ??enI~LPPC6AS)No(&$EhEJ2U*2SG~btG SzYGCd&fw|l=d#Wzp$Pz_txHG% literal 0 HcmV?d00001 diff --git a/src/pics/16x16/preview.png b/src/pics/16x16/preview.png new file mode 100644 index 0000000000000000000000000000000000000000..b25d18b0ee3b8e1cc240d3dd5b490bf60cacdf7b GIT binary patch literal 867 zcmW+!y^mZq5Fgv~Y`@)o+1-1)+=*P23Peejp6DXDCLoj+iISfGfC@V3DEJE~DBuJV z5{e=eK0*?jKv0Opoj5opd%N%L?fdYz@iMY!?D5b3jc4Ygw{E^(3|<@nKymoS!Q07B zwo}riKmO#sYss+puOHr$QvP}J=5g9xK0J8s)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7e%_b*r|kr8oazP!oN$=<6QuP;erG2twegX0--|j=osycshUpP Y_doyii;uIkALg|;E}Xx7?t@SM2QNFSMgRZ+ literal 0 HcmV?d00001 diff --git a/src/pics/32x32/CMakeLists.txt b/src/pics/32x32/CMakeLists.txt new file mode 100644 index 000000000..fac3d9022 --- /dev/null +++ b/src/pics/32x32/CMakeLists.txt @@ -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 +# diff --git a/src/pics/32x32/preview.png b/src/pics/32x32/preview.png new file mode 100644 index 0000000000000000000000000000000000000000..93d736f35637148723012122751e7b03cc079b54 GIT binary patch literal 3187 zcmYjTS&JOk6~24j+IpGp(TqKcB_+bx76b=lOdew#VqtJX@DIqFpF{pZ-a`ID9s&V_ zA#un{Fd<-rk@tXQ96a$z_DC9emhS1L)?0VYsU9n&=&rh5eeZYn@0{QL;?Rw^ zD8KpgOTUEY)&469-0kl9pWs1%^Wx3dq?8Buetw8hcH`ztKY8ut9AC}8De)U0H9iE& zF{hM8a7UaWju8?4T?j-miU^_vr2>JJlp+j}2-O}fG_nr4fWqd@#d}zWfE+>*MZqE_ z1f|5gfI)_!h=70%F2G>;Y)-<%VBVnk5K@2&M)-cu#Wui&3)V411fz*SwL>h9 z@ZOj%Yt(^E)`La@Ns1il*RT&PK&(Gk2BaLKpaG~4iu+!1%KCfoy`+l^Tn8%pfbJgG zxBl@SOJ&F;ZsBj!L&JH&P{L5-dR=+};1k?~!WkWUr5)|p|GWBF5M(z3;0P#D8e}bc z|Lt2J{N>L~d3>}+ocHc#8^43f-uKpk$#~;&0T3I+uu;u`gW&?OM`GX!zre%Rg}Mu$ zefZ_=ci;Kq?Y~j0SzXk8l!AhQ%V5`c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;(5AJFqEGBR!&F<=~c(Jh-;u&e;~IF#gcYqGsp#;C6V#f$@W zk)WU@vIijn`2^1>*0o0OH7Vk)ak6MsF+w6y0mYyq&=k~?*J3g@X#qw>25-PrV75__ zV!{RG9-j;?Np_!mX@6_9e0Q~OG4};6kQm~k1>lg2AYsHT871wO6KNY!=W9%Ua_Gzgo6Wo}P3{ z?`;=x5rb@kS6?r|E7|dBeRF?`5fJ(@;98upY93}-$d%ArA-4m^)L}pY?nGnAbX(=b zQStPg7`|7QG6pU8bvzJcP%_&Zh5=m|_Xx7IoRWjR?NKf;jRH}ZO@(iCpvdi; z2cS#J*lJaQ?%sN7m&NJsEY1=D8+6dX8)twTY+4iy1Pbi{dH{d{eql!3f)}ALrRh75 zRKC4;^W(4ji?@bVqtxp7q+8R2*FXJg63Nu8e(zv!G6gfnNT3FCXxU)O13RNt8V0aJ zzqM0l1!9Oh4~!QHilV}pj7z0PBN&09nuiR=sL^Q@Qm~8&Y5$46nbu%AC{4DP8ffvj zqP^cKc5dIib(^m5=e|w?>f~?z>hZmMzwTwdvn#IeO(x?K;SY{s5N$}Iwr#r}^%WZe zmrt^!00b52KR_4<5hc{AB+jf=q5go*p@}r%Rf^FCCa=K7C_YU`w?l2^YMu?95!U(7vRenn_c|P{P;iq@tb!7Ccp8gU;4to Je*UX}|9=$j1HS+O literal 0 HcmV?d00001 diff --git a/src/pics/64x64/CMakeLists.txt b/src/pics/64x64/CMakeLists.txt new file mode 100644 index 000000000..da692c397 --- /dev/null +++ b/src/pics/64x64/CMakeLists.txt @@ -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 +# diff --git a/src/pics/64x64/preview.png b/src/pics/64x64/preview.png new file mode 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S z;ihM|(R5~j>EYs|2TxG7S0RaJ;cYC=U@IMa*i6 z1kVna#flrNv*LgL@RsRbdgZk*decqz;JY>o{hI5}7JAQb{Csim_MKa|?!5HZKk572 za+_cRGnyiTvl8@G)0o@rh6W3UEU8{D-kFH3c_|A z83zi7Xl5%QLg#K3=rY1wU9(>u-aXtu1-bpqi&yLXESaC7yTNVWa(yfhRUgdEQoRTy z7u6kJ954KMBaDXGI_Oqr{+3^!&}<|-cuNv#k880G-%1!%@ZL0XVKMUoWZbnJO?4K@H^5|xo*`2I+g ziPoXk(auiKh#4h|a(8D0Ub|eSsBYV?wx}tA+Iw^|ZN1YG<5kPlpjDEffr2bxP>>_e zYJP~cZif;1)ZPSHsqGCgLR*)nH$VRDE1!6NbJL?1cWgcI*Fj-p0j;j;FQ6dar1f$I zKs23fBd`E?;q?(T6;KJGsqNV?$lUU0KB$Liw#XKFHitKQ0eT8?v;af(FTVIn z9LJm6+vt5Ed9$8pJY}sh2A5?8!DtFL6WFlj4CQiH7cdbsjH9&;a0`s*U}C@*qKa29 zxZ^Es#n)5ALbT2i=HP>MwgiHYBN#nBeDVbQg93wh=Hq(@J3A5HWI*Icg^GNP>|whj zcn&BZ#9@?+s1!^;O3sc=REb7t#_Ojayun%Jg|j?6O-l*DPyX50|IP$~T)idTJ((W? zGdX4$*)bZ5Sdk9}_n@8t^(_|&cs#M=*a;l;mKs*Bl4IodwaK=D_u23^g&{#X)?nSx zBt?r65Zv)hCqRnm(E|aCruUP{1a&CJLX81iLeCJ5P!x-JfyWDDyto0DDvHLSC_r+l zS0h9hjW DKn3dr literal 0 HcmV?d00001 diff --git a/src/pics/CMakeLists.txt b/src/pics/CMakeLists.txt new file mode 100644 index 000000000..bfbe8915d --- /dev/null +++ b/src/pics/CMakeLists.txt @@ -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 diff --git a/src/pixmapviewer.cpp b/src/pixmapviewer.cpp new file mode 100644 index 000000000..575f3eda1 --- /dev/null +++ b/src/pixmapviewer.cpp @@ -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 +#include +#include +//Added by qt3to4: +#include +#include + +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" diff --git a/src/pixmapviewer.h b/src/pixmapviewer.h new file mode 100644 index 000000000..5f9df88a9 --- /dev/null +++ b/src/pixmapviewer.h @@ -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 +#include +//Added by qt3to4: +#include + +/** + * @brief Widget which shows a pixmap centered inside the boundaries. + * + * @see IconsViewSettingsPage + * @author Peter Penz + */ +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 diff --git a/src/portinglog.txt b/src/portinglog.txt new file mode 100644 index 000000000..bef50128f --- /dev/null +++ b/src/portinglog.txt @@ -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 +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 #include +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 #include #include #include #include #include #include +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 +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 #include #include #include +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 +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 #include #include #include +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 #include +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 #include #include #include +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 +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 +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 #include +In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarspaceinfo.h: Added the following include directives: + #include +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 +In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/urlnavigatorbutton.h: Added the following include directives: + #include #include #include #include +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 #include #include #include +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 #include +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 #include #include +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 +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 #include +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 #include #include #include #include #include #include #include +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 #include #include #include #include #include +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 +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 #include #include #include +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 +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 #include #include +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 +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 #include #include +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 +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 #include +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 +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 +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 #include #include +In file /home/kde4peter/Temp/dolphin_svn/dolphin/src/statusbarspaceinfo.cpp: Added the following include directives: + #include +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 +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 #include #include #include #include +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 #include +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 +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 + diff --git a/src/previewsmodesettings.kcfg b/src/previewsmodesettings.kcfg new file mode 100644 index 000000000..70c6d8cae --- /dev/null +++ b/src/previewsmodesettings.kcfg @@ -0,0 +1,41 @@ + + + + + kiconloader.h + + + + LeftToRight + + + + KGlobalSettings::generalFont().family() + + + + KGlobalSettings::generalFont().pointSize() + + + + + + + + + + + + + KIcon::SizeMedium + + + + 2 + + + + KIcon::SizeMedium + + + \ No newline at end of file diff --git a/src/previewsmodesettings.kcfgc b/src/previewsmodesettings.kcfgc new file mode 100644 index 000000000..780a6d539 --- /dev/null +++ b/src/previewsmodesettings.kcfgc @@ -0,0 +1,4 @@ +File=previewsmodesettings.kcfg +ClassName=PreviewsModeSettings +Singleton=false +Mutators=true \ No newline at end of file diff --git a/src/progressindicator.cpp b/src/progressindicator.cpp new file mode 100644 index 000000000..a09552c06 --- /dev/null +++ b/src/progressindicator.cpp @@ -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(); + } + } +} + + diff --git a/src/progressindicator.h b/src/progressindicator.h new file mode 100644 index 000000000..cc5c64ad4 --- /dev/null +++ b/src/progressindicator.h @@ -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 + +/** + * 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 + */ +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 diff --git a/src/protocolcombo.cpp b/src/protocolcombo.cpp new file mode 100644 index 000000000..b91b102cd --- /dev/null +++ b/src/protocolcombo.cpp @@ -0,0 +1,114 @@ +/*************************************************************************** + * Copyright (C) 2006 by Aaron J. Seigo () * + * * + * 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 + +#include +#include + +#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 +// #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" diff --git a/src/protocolcombo.h b/src/protocolcombo.h new file mode 100644 index 000000000..b043cc404 --- /dev/null +++ b/src/protocolcombo.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2006 by Aaron J. Seigo () * + * * + * 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 +#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 diff --git a/src/renamedialog.cpp b/src/renamedialog.cpp new file mode 100644 index 000000000..301c02713 --- /dev/null +++ b/src/renamedialog.cpp @@ -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 +#include +#include +#include +//Added by qt3to4: +#include +#include +#include + +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" diff --git a/src/renamedialog.h b/src/renamedialog.h new file mode 100644 index 000000000..5686d1f6b --- /dev/null +++ b/src/renamedialog.h @@ -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 +#include +#include + +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 diff --git a/src/servicemenus/CMakeLists.txt b/src/servicemenus/CMakeLists.txt new file mode 100644 index 000000000..19711968e --- /dev/null +++ b/src/servicemenus/CMakeLists.txt @@ -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 +# diff --git a/src/servicemenus/amarok_append.desktop b/src/servicemenus/amarok_append.desktop new file mode 100644 index 000000000..75fddf89d --- /dev/null +++ b/src/servicemenus/amarok_append.desktop @@ -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 diff --git a/src/servicemenus/ark_compress.desktop b/src/servicemenus/ark_compress.desktop new file mode 100644 index 000000000..d4c0680ed --- /dev/null +++ b/src/servicemenus/ark_compress.desktop @@ -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 diff --git a/src/servicemenus/ark_extract.desktop b/src/servicemenus/ark_extract.desktop new file mode 100644 index 000000000..50c04e8a7 --- /dev/null +++ b/src/servicemenus/ark_extract.desktop @@ -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 + + diff --git a/src/servicemenus/dolphin_su.desktop b/src/servicemenus/dolphin_su.desktop new file mode 100644 index 000000000..a2d8bd490 --- /dev/null +++ b/src/servicemenus/dolphin_su.desktop @@ -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' diff --git a/src/servicemenus/floppy_format.desktop b/src/servicemenus/floppy_format.desktop new file mode 100644 index 000000000..b175347b6 --- /dev/null +++ b/src/servicemenus/floppy_format.desktop @@ -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 diff --git a/src/servicemenus/imageconverter.desktop b/src/servicemenus/imageconverter.desktop new file mode 100644 index 000000000..941a20ba7 --- /dev/null +++ b/src/servicemenus/imageconverter.desktop @@ -0,0 +1,61 @@ +# +# Servicemenu image converter, by Jens Benecke . +# 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" + diff --git a/src/servicemenus/installfont.desktop b/src/servicemenus/installfont.desktop new file mode 100644 index 000000000..3ca14faf4 --- /dev/null +++ b/src/servicemenus/installfont.desktop @@ -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:/ + diff --git a/src/servicemenus/isoservice.desktop b/src/servicemenus/isoservice.desktop new file mode 100644 index 000000000..c637edd07 --- /dev/null +++ b/src/servicemenus/isoservice.desktop @@ -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= \ No newline at end of file diff --git a/src/servicemenus/jpegorient.desktop b/src/servicemenus/jpegorient.desktop new file mode 100644 index 000000000..5b25d245b --- /dev/null +++ b/src/servicemenus/jpegorient.desktop @@ -0,0 +1,222 @@ +[Desktop Entry] +ServiceTypes=image/jpeg +Actions=jpegRot90;jpegRot270;jpegFlipV;jpegFlipH; +X-KDE-Submenu=Transform Image +X-KDE-Submenu[bg]=Конвертиране на изображението +X-KDE-Submenu[ca]=Transforma la imatge +X-KDE-Submenu[cs]=Převést obrázek +X-KDE-Submenu[da]=Transformér billede +X-KDE-Submenu[de]=Bild transformieren +X-KDE-Submenu[es]=Transformar imagen +X-KDE-Submenu[fi]=Muuta kuva +X-KDE-Submenu[fr]=Transformer l'image +X-KDE-Submenu[hu]=Képátalakítás +X-KDE-Submenu[is]=Ummynda +X-KDE-Submenu[it]=Trasforma immagine +X-KDE-Submenu[nb]=Transformer bilde +X-KDE-Submenu[nl]=Afbeelding transformeren +X-KDE-Submenu[pl]=Przekształć obrazek +X-KDE-Submenu[pt]=Transformar a Imagem +X-KDE-Submenu[pt_BR]=Transformar Imagem +X-KDE-Submenu[ru]=Преобразовать +X-KDE-Submenu[sr]=Трансформиши слику +X-KDE-Submenu[sr@Latn]=TransformiÅ¡i sliku +X-KDE-Submenu[sv]=Ändra bild +X-KDE-Submenu[uk]=Перетворити зображення +X-KDE-Submenu[xx]=xxTransform Imagexx +X-KDE-Submenu[zh_CN]=图像变形 +X-KDE-Require=Write + +[Desktop Action jpegRot90] +Name=Rotate Clockwise +Name[ar]=تدوير في اتجاه الساعة +Name[az]=Saat Əqrəbi İstiqamətində Fırlat +Name[bg]=Завъртане по посока на часов. стрелка +Name[ca]=Gira 90 graus +Name[cs]=Rotovat ve směru hod. ručiček +Name[cy]=Cylchdroi yn Glocwedd +Name[da]=Rotér med uret +Name[de]=Im Uhrzeigersinn drehen (nach rechts) +Name[el]=Περιστροφή δεξιόστροφα +Name[es]=Girar en el sentido de las agujas del reloj +Name[et]=Pööra päripäeva +Name[eu]=Biratu erloju orratzen norabidean +Name[fi]=Käännä myötäpäivään +Name[fr]=Tourner en sens horaire +Name[ga]=Rothlaigh go Deisealach +Name[he]=סובב עם כיוון השעון +Name[hi]=घड़ी की दिशा में घुमाएँ +Name[hu]=Forgatás jobbra +Name[is]=Snúa réttsælis +Name[it]=Ruota in senso orario +Name[ja]=右回りに回転します +Name[nb]=Roter medurs +Name[nl]=Klokgewijs draaien +Name[nn]=Roter med klokka +Name[pa]=ਸੱਜਾ ਦਾਅ ਘੁੰਮਾਉ +Name[pl]=Obróć zgodnie z ruchem wskazówek zegara +Name[pt]=Rodar no Sentido Horário +Name[pt_BR]=Rodar Relógio Sentido Horário +Name[ro]=Roteşte la dreapta +Name[ru]=Повернуть по часовой стрелке +Name[sk]=OtočiÅ¥ v smere hodinových ručičiek +Name[sl]=Zasuči v smeri urinega kazalca +Name[sr]=Ротирај у смеру казаљке на часовнику +Name[sr@Latn]=Rotiraj u smeru kazaljke na časovniku +Name[sv]=Rotera medurs +Name[ta]=வலதுபுறமாக சுழற்று +Name[tg]=Чархиш бо ақрабаки соат +Name[tr]=Saat Yönünde Döndürme +Name[uk]=Обернути за годинниковою стрілкою +Name[uz]=Соат кўрсатгичи бўйича айлантириш +Name[xx]=xxRotate Clockwisexx +Name[zh_CN]=顺时针旋转 +Icon=rotate_cw +Exec=jpegorient +90 %F + +[Desktop Action jpegRot270] +Name=Rotate Counter-Clockwise +Name[ar]=تدوير عكس اتجاه الساعة +Name[az]=Saat Əqrəbinə Tərs İstiqamətdə Fırlat +Name[bg]=Завъртане обратно на часов. стрелка +Name[ca]=Gira 270 graus +Name[cs]=Rotovat proti směru hod. ručiček +Name[cy]=Cylchdroi yn Wrthglocwedd +Name[da]=Rotér mod uret +Name[de]=Gegen den Uhrzeigersinn drehen (nach links) +Name[el]=Περιστροφή αριστερόστροφα +Name[en_GB]=Rotate Anti-Clockwise +Name[es]=Girar en el sentido contrario a las agujas del reloj +Name[et]=Pööra vastupäeva +Name[eu]=Biratu erloju orratzen aurkako norabidean +Name[fi]=Käännä vastapäivään +Name[fr]=Tourner en sens anti-horaire +Name[ga]=Rothlaigh go Tuathalach +Name[he]=סובב נגד כיוון השעון +Name[hi]=घड़ी की उलटी दिशा में घुमाएँ +Name[hu]=Forgatás balra +Name[is]=Snúa rangsælis +Name[it]=Ruota in senso anti-orario +Name[ja]=左回りに回転します +Name[nb]=Roter moturs +Name[nl]=Anti-klokgewijs draaien +Name[nn]=Roter mot klokka +Name[pa]=ਖੱਬੇ ਦਾਅ ਘੁੰਮਾਓ +Name[pl]=Obróć przeciwnie do ruchu wskazówek zegara +Name[pt]=Rodar no Sentido Anti-horário +Name[pt_BR]=Rodar Contador de Relógio +Name[ro]=Roteşte la stînga +Name[ru]=Повернуть против часовой стрелки +Name[sk]=OtočiÅ¥ proti smeru hodinových ručičiek +Name[sl]=Zasuči v nasportni smeri urinega kazalca +Name[sr]=Ротирај супротно смеру казаљке на часовнику +Name[sr@Latn]=Rotiraj suprotno smeru kazaljke na časovniku +Name[sv]=Rotera moturs +Name[ta]=கடிகார ஓட்டத்திற்கெதிராக சுழற்று +Name[tg]=Чархиш ба муқобили ақрабаки соат +Name[tr]=Sayacı Saat Yönünde Döndürme +Name[uk]=Обернути проти годинникової стрілки +Name[uz]=Соат кўрсатгичига қарши айлантириш +Name[xx]=xxRotate Counter-Clockwisexx +Name[zh_CN]=逆时针旋转 +Icon=rotate_ccw +Exec=jpegorient +270 %F + +#[Desktop Action jpegRot180] +#Name=Rotate 180 +#Icon=misc +#Exec=jpegorient +180 %F + +[Desktop Action jpegFlipV] +Name=Flip Vertically +Name[ar]=تدوير رأسي +Name[az]=Şaquli Olaraq Çevir +Name[bg]=Вертикално обръщане +Name[ca]=Torna vertical +Name[cs]=Převrátit svisle +Name[cy]=Troi Drosodd yn Fertigol +Name[da]=Flip lodret +Name[de]=Vertikal kippen +Name[el]=Αναστροφή κατακόρυφα +Name[es]=Reflejar verticalmente +Name[et]=Keera ümber vertikaalselt +Name[eu]=Buruz behera ipini +Name[fi]=Käännä pystysuorassa +Name[fr]=Retourner verticalement +Name[ga]=Smeach go hIngearach +Name[he]=שקף אנכית +Name[hi]=खड़ा पलटें +Name[hu]=Tükrözés függőlegesen +Name[is]=Snúa við um miðju lóðrétt +Name[it]=Fletti verticalmente +Name[ja]=縦のフリップ +Name[nb]=Speilvend loddrett +Name[nl]=Verticaal omdraaien +Name[nn]=Snu loddrett +Name[pa]=ਲੰਬਕਾਰੀ ਝਟਕੋ +Name[pl]=Odwróć pionowo +Name[pt]=Trocar Verticalmente +Name[pt_BR]=Refletir Verticalmente +Name[ro]=Întoarce pe verticală +Name[ru]=Отразить вертикально +Name[sk]=PreklopiÅ¥ vertikálne +Name[sl]=Obrni navpično +Name[sr]=Преврни усправно +Name[sr@Latn]=Prevrni uspravno +Name[sv]=Vänd vertikalt +Name[ta]=மேல்கீழாக திருப்பு +Name[tg]=Баргардондан ба амудӣ +Name[tr]=Dik Olarak Dağıtma +Name[uk]=Перекинути вертикально +Name[uz]=Эни бўйича айлантириш +Name[xx]=xxFlip Verticallyxx +Name[zh_CN]=上下翻转 +Icon=2uparrow +Exec=jpegorient v %F + +[Desktop Action jpegFlipH] +Name=Flip Horizontally +Name[ar]=تدوير أفقي +Name[az]=Üfüqi Olaraq Çevir +Name[bg]=Хоризонтално обръщане +Name[ca]=Torna horitzontal +Name[cs]=Převrátit vodorovně +Name[cy]=Troi Drosodd yn Llorweddol +Name[da]=Flip vandret +Name[de]=Horizontal kippen +Name[el]=Αναστροφή οριζόντια +Name[es]=Reflejar horizontalmente +Name[et]=Keera ümber horisontaalselt +Name[eu]=Biratu horizontalki +Name[fi]=Käännä vaakasuorassa +Name[fr]=Retourner horizontalement +Name[ga]=Smeach go Cothrománach +Name[he]=שקף אופקית +Name[hi]=आड़ा पलटें +Name[hu]=Tükrözés vízszintesen +Name[is]=Snúa við um miðju lárétt +Name[it]=Fletti orizzontalmente +Name[ja]=水平にフリップ +Name[nb]=Speilvend vannrett +Name[nl]=Horizontaal omdraaien +Name[nn]=Snu vassrett +Name[pa]=ਖਿਤਿਜੀ ਝਟਕੋ +Name[pl]=Odwróć poziomo +Name[pt]=Trocar Horizontalmente +Name[pt_BR]=Refletir Horizontalmente +Name[ro]=Întoarce pe orizontală +Name[ru]=Отразить горизонтально +Name[sk]=PreklopiÅ¥ horizontálne +Name[sl]=Obrni vodoravno +Name[sr]=Преврни водоравно +Name[sr@Latn]=Prevrni vodoravno +Name[sv]=Vänd horisontellt +Name[ta]=இடம்வலமாக திருப்புக +Name[tg]=Баргардондан ба уфуқӣ +Name[tr]=Yatay Olarak Dağıtma +Name[uk]=Перекинути горизонтально +Name[uz]=Бўйи бўйича айлантириш +Name[xx]=xxFlip Horizontallyxx +Name[zh_CN]=左右翻转 +Icon=2rightarrow +Exec=jpegorient h %F diff --git a/src/servicemenus/k3b_create_audio_cd.desktop b/src/servicemenus/k3b_create_audio_cd.desktop new file mode 100644 index 000000000..efc1a7943 --- /dev/null +++ b/src/servicemenus/k3b_create_audio_cd.desktop @@ -0,0 +1,124 @@ +[Desktop Entry] +Actions=CreateK3bAudioProject; +Encoding=UTF-8 +ServiceTypes=audio/x-mp3,audio/x-vorbis,application/x-ogg,audio/x-mp2,audio/x-mpegurl,audio/x-wav,media/blankcd + +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 CreateK3bAudioProject] +Exec=k3b --audiocd %U +Name=Create Audio CD with K3b... +Name[af]=Skep oudio CD met K3b... +Name[bg]=Създаване на аудио CD с K3b... +Name[bn]=কে-থ্রি-বি দিয়ে অডিও সিডি তৈরি করো... +Name[br]=Krouiñ ur CD klevet gant K3b ... +Name[bs]=Napravio audio CD koristeći K3b... +Name[ca]=Crea CD d'àudio amb K3b... +Name[cs]=Vytvořit zvukové CD... +#SUSE-Overwrite Name[da]=Lav lyd-cd med K3b... +Name[da]=Lav lyd-CD med K3b... +Name[de]=Audio-CD mit K3b erstellen ... +Name[el]=Δημιουργία μουσικού CD με το K3b... +Name[es]=Crear CD de audio con K3b... +Name[et]=Kirjuta audio-CD K3b abil... +Name[eu]=Sortu audio cdak K3b-rekin... +Name[fr]=Créer un CD audio avec K3b... +Name[he]=צור תקליטור שמע בעזרת K3b... +Name[hi]=के3बी के साथ ऑडियो सीडी बनाए... +Name[hu]=Hang-CD létrehozása a K3b-vel... +Name[is]=Búa til hljóðdisk með K3b... +Name[it]=Crea CD audio con K3b... +#SUSE-Overwrite Name[ja]=オーディオ CD を K3b で作成... +Name[ja]=K3bによるオーディオCDの作成... +Name[lt]=Kurkite audio CD su K3b... +Name[mk]=Креирајте аудио-CD со K3b... +#SUSE-Overwrite Name[nb]=Lag lyd-CD med K3b . . . +Name[nb]=Brenn lyd-CD-er med K3b... +Name[nl]=Audio-cd aanmaken met K3b... +Name[pa]=K3b ਨਾਲ ਆਡੀਓ CD ਬਣਾਓ... +Name[pl]=Stwórz płytę CD Audio za pomocą K3b... +Name[pt]=Criar um CD de Áudio com o K3b... +Name[pt_BR]=Criar CD de Áudio com K3b... +Name[ru]=Записать аудио компакт-диск, используя K3b... +Name[sl]=Ustvari avdio CD s K3b ... +Name[sr]=Направи аудио CD помоћу K3b-а... +Name[sr@Latn]=Napravi audio CD pomoću K3b-a... +Name[sv]=Skapa ljud-cd med K3b... +Name[ta]=ஒலிக் குறுந்தகட்டோடு K3bயை உருவாக்குக... +Name[tr]=K3b ile Ses CD'si oluştur... +Name[uk]=Створити аудіо-КД за допомогою K3b... +Name[zh_CN]=用 K3b 创建音频 CD... +Icon=k3b + +Name[fi]=Luo ääni-CD K3b:llä +Name[km]=បង្កើត​ស៊ីឌី​អូឌីយ៉ូ​ជាមួយ K3b... +Name[zh_TW]=以 K3b 建立音效 CD... diff --git a/src/servicemenus/k3b_create_video_cd.desktop b/src/servicemenus/k3b_create_video_cd.desktop new file mode 100644 index 000000000..45cca6a88 --- /dev/null +++ b/src/servicemenus/k3b_create_video_cd.desktop @@ -0,0 +1,125 @@ +[Desktop Entry] +Actions=CreateK3bVcdProject; +Encoding=UTF-8 +ServiceTypes=video/mpeg + +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 CreateK3bVcdProject] +Exec=k3b --videocd %F +Name=Create Video CD with K3b... +Name[af]=Skep video CD met K3b... +Name[bg]=Създаване на видео CD с K3b... +Name[bn]=কে-থ্রি-বি দিয়ে ভিডিও সিডি তৈরি করো... +Name[br]=Krouiñ ur CD video gant K3b ... +Name[bs]=Napravi video CD koristeći K3b... +Name[ca]=Crea CD de vídeo amb K3b... +Name[cs]=Vytvořit video CD... +#SUSE-Overwrite Name[da]=Lav video-cd med K3b... +Name[da]=Lav Video CD med K3b... +Name[de]=Video-CD mit K3b erstellen ... +Name[el]=Δημιουργία Video CD με το K3b... +Name[es]=Crear Video CD con K3b... +Name[et]=Kirjuta video-CD K3b abil... +Name[eu]=Sortu Bideo CDak K3b-rekin... +Name[fr]=Créer un CD vidéo avec K3b... +Name[he]=צור תקליטורי וידאו VCD בעזרת K3b... +Name[hi]=के3बी के साथ वीडियो सीडी बनाए... +Name[hu]=Video-CD létrehozása a K3b-vel... +Name[is]=Búa til vídeódisk með K3b... +Name[it]=Crea Video CD con K3b... +#SUSE-Overwrite Name[ja]=Video CD を K3b で作成... +Name[ja]=K3bによるビデオCDの作成... +Name[lt]=Kurkite video CD su K3b... +Name[mk]=Креирајте видео-CD со K3b... +#SUSE-Overwrite Name[nb]=Lag video-CD med K3b . . . +Name[nb]=Brenn video-CD-er med K3b... +Name[nl]=Video-cd aanmaken K3b... +#SUSE-Overwrite Name[pa]=K3b ਨਾਲ ਵੀਡਿਓ CD ਬਣਾਓ... +Name[pa]=K3b ਨਾਲ ਵੀਡਿਓ CD ਬਣਾਓ +Name[pl]=Stwórz płytę Video CD za pomocą K3b... +Name[pt]=Criar um Video CD com o K3b... +Name[pt_BR]=Criar CD de Vídeo com K3b... +Name[ru]=Записать видео компакт-диск, используя K3b... +Name[sl]=Ustvari video CD s K3b ... +Name[sr]=Направи видео CD помоћу K3b-а... +Name[sr@Latn]=Napravi video CD pomoću K3b-a... +Name[sv]=Skapa video-cd med K3b... +Name[ta]=ஒளிக் குறுந்தகட்டோடு K3bஐ உருவாக்குக... +Name[tr]=K3b ile Video CD'si oluştur... +Name[uk]=Створити відео-КД за допомогою K3b... +Name[zh_CN]=用 K3b 创建视频 CD... +Icon=k3b + +Name[fi]=Luo video-CD K3b:llä +Name[km]=បង្កើត​ស៊ីឌី​វីដេអូ​ជាមួយ K3b... +Name[zh_TW]=以 K3b 建立視訊 CD... diff --git a/src/servicemenus/k3b_write_bin_image.desktop b/src/servicemenus/k3b_write_bin_image.desktop new file mode 100644 index 000000000..aaf7967a4 --- /dev/null +++ b/src/servicemenus/k3b_write_bin_image.desktop @@ -0,0 +1,124 @@ +[Desktop Entry] +Actions=WriteCdImage; +Encoding=UTF-8 +ServiceTypes=application/x-cue + +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 WriteCdImage] +Exec=k3b --cdimage %F +Name=Write CD Image with K3b... +Name[af]=Skryf CD beeld met K3b... +Name[bg]=Запис на CD образ с K3b... +Name[bn]=কে-থ্রি-বি দিয়ে সিডি ইমেজ লেখো... +Name[br]=srivañ ar skeudenn CD gant K3b ... +Name[bs]=ZapiÅ¡i CD image koristeći K3b... +Name[ca]=Escriu imatge per a CD amb K3b... +Name[cs]=Vypálit obraz CD... +#SUSE-Overwrite Name[da]=Skriv cd-billede med K3b... +Name[da]=Skriv CD-billede med K3b... +Name[de]=CD-Abbild mit K3b brennen ... +Name[el]=Εγγραφή εικόνας CD με το K3b... +Name[es]=Escribir imagen de CD con K3b... +Name[et]=Kirjuta tõmmis K3b abil plaadile... +Name[eu]=Idatzi CD irudiak K3b-rekin... +Name[fr]=Graver une image CD avec K3b... +Name[he]=כתוב תבנית CD בעזרת K3b... +Name[hi]=के3बी के साथ सीडी इमेज लिखें... +Name[hu]=CD-képmásfájl írása a K3b-vel... +Name[is]=Skrifa diskmynd með K3b... +Name[it]=Scrivi immagine CD con K3b... +#SUSE-Overwrite Name[ja]=CD イメージを K3b で書き込み... +Name[ja]=K3bによるCDイメージの書込み... +Name[lt]=Ä®raÅ¡ykite CD atvaizdą su K3b... +Name[mk]=Запишете CD-слика со K3b... +#SUSE-Overwrite Name[nb]=Skriv CD-bilde med K3b . . . +Name[nb]=Brenn diskbilde pÃ¥ CD med K3b... +Name[nl]=CD-image schrijven met K3b... +Name[pa]=K3b ਨਾਲ CD ਪ੍ਰਤੀਬਿੰਬ ਲਿਖੋ... +Name[pl]=Stwórz obraz płyty CD za pomocą K3b... +Name[pt]=Escrever uma Imagem de CD com o K3b... +Name[pt_BR]=Gravar Imagem em CD com K3b... +Name[ru]=Записать образ CD, используя K3b... +Name[sl]=ZapiÅ¡i sliko CD-ja s K3b ... +Name[sr]=Направи одраз CD-а помоћу K3b-а... +Name[sr@Latn]=Napravi odraz CD-a pomoću K3b-a... +Name[sv]=Skriv cd-avbild med K3b... +Name[ta]=குறுந்தகட்டு நிழலுடன் K3bஐ உருவாக்குக... +Name[tr]=K3b ile CD Kalıbı yazdır... +Name[uk]=Записати штамп КД за допомогою K3b... +Name[zh_CN]=用 K3b 刻录 CD 映像... +Icon=k3b + +Name[fi]=Kirjoita CD-levynkuva K3b:llä +Name[km]=សរសេរ​រូបភាព​ស៊ីឌី​ជាមួយ K3b... +Name[zh_TW]=以 K3b 燒錄 CD 映像... diff --git a/src/servicemenus/k3b_write_iso_image.desktop b/src/servicemenus/k3b_write_iso_image.desktop new file mode 100644 index 000000000..8808f8004 --- /dev/null +++ b/src/servicemenus/k3b_write_iso_image.desktop @@ -0,0 +1,124 @@ +[Desktop Entry] +Actions=WriteCdImage; +Encoding=UTF-8 +ServiceTypes=application/x-iso,inode/ISO-image + +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 WriteCdImage] +Exec=k3b --image %F +Name=Write CD Image with K3b... +Name[af]=Skryf CD beeld met K3b... +Name[bg]=Запис на CD образ с K3b... +Name[bn]=কে-থ্রি-বি দিয়ে সিডি ইমেজ লেখো... +Name[br]=srivañ ar skeudenn CD gant K3b ... +Name[bs]=ZapiÅ¡i CD image koristeći K3b... +Name[ca]=Escriu imatge per a CD amb K3b... +Name[cs]=Vypálit obraz CD... +#SUSE-Overwrite Name[da]=Skriv cd-billede med K3b... +Name[da]=Skriv CD-billede med K3b... +Name[de]=CD-Abbild mit K3b brennen ... +Name[el]=Εγγραφή εικόνας CD με το K3b... +Name[es]=Escribir imagen de CD con K3b... +Name[et]=Kirjuta tõmmis K3b abil plaadile... +Name[eu]=Idatzi CD irudiak K3b-rekin... +Name[fr]=Graver une image CD avec K3b... +Name[he]=כתוב תבנית CD בעזרת K3b... +Name[hi]=के3बी के साथ सीडी इमेज लिखें... +Name[hu]=CD-képmásfájl írása a K3b-vel... +Name[is]=Skrifa diskmynd með K3b... +Name[it]=Scrivi immagine CD con K3b... +#SUSE-Overwrite Name[ja]=CD イメージを K3b で書き込み... +Name[ja]=K3bによるCDイメージの書込み... +Name[lt]=Ä®raÅ¡ykite CD atvaizdą su K3b... +Name[mk]=Запишете CD-слика со K3b... +#SUSE-Overwrite Name[nb]=Skriv CD-bilde med K3b . . . +Name[nb]=Brenn diskbilde pÃ¥ CD med K3b... +Name[nl]=CD-image schrijven met K3b... +Name[pa]=K3b ਨਾਲ CD ਪ੍ਰਤੀਬਿੰਬ ਲਿਖੋ... +Name[pl]=Stwórz obraz płyty CD za pomocą K3b... +Name[pt]=Escrever uma Imagem de CD com o K3b... +Name[pt_BR]=Gravar Imagem em CD com K3b... +Name[ru]=Записать образ CD, используя K3b... +Name[sl]=ZapiÅ¡i sliko CD-ja s K3b ... +Name[sr]=Направи одраз CD-а помоћу K3b-а... +Name[sr@Latn]=Napravi odraz CD-a pomoću K3b-a... +Name[sv]=Skriv cd-avbild med K3b... +Name[ta]=குறுந்தகட்டு நிழலுடன் K3bஐ உருவாக்குக... +Name[tr]=K3b ile CD Kalıbı yazdır... +Name[uk]=Записати штамп КД за допомогою K3b... +Name[zh_CN]=用 K3b 刻录 CD 映像... +Icon=k3b + +Name[fi]=Kirjoita CD-levynkuva K3b:llä +Name[km]=សរសេរ​រូបភាព​ស៊ីឌី​ជាមួយ K3b... +Name[zh_TW]=以 K3b 燒錄 CD 映像... diff --git a/src/servicemenus/mail_as_attachment.desktop b/src/servicemenus/mail_as_attachment.desktop new file mode 100644 index 000000000..f8a7c2309 --- /dev/null +++ b/src/servicemenus/mail_as_attachment.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +ServiceTypes=all/allfiles +Actions=mail_as_attachment + +[Desktop Action mail_as_attachment] +Name=Mail as Attachment... +Name[de]=Verschicken als Anhang... +Icon=mail_send +Exec=kmail --attach %U diff --git a/src/servicemenus/media_eject.desktop b/src/servicemenus/media_eject.desktop new file mode 100644 index 000000000..151790f78 --- /dev/null +++ b/src/servicemenus/media_eject.desktop @@ -0,0 +1,158 @@ +[Desktop Entry] +ServiceTypes=media/cdrom_mounted,media/cdrom_unmounted,media/cdwriter_mounted,media/cdwriter_unmounted,media/dvd_mounted,media/dvd_unmounted,media/audiocd,media/blankcd,media/blankdvd,media/dvdvideo,media/svcd,media/vcd +Actions=MediaEject; +X-KDE-Priority=TopLevel +X-KDE-MediaNotifierHide=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 +X-SuSE-translate=true +[Desktop Action MediaEject] +Name=Eject +Name[af]=Uitskiet +Name[ar]=اخراج +Name[az]=Çıxart +Name[be]=Выняць +Name[bg]=Изваждане +Name[bn]=ইজেক্ট +Name[br]=Stlepel +Name[bs]=Izbaci +Name[ca]=Expulsa +Name[cs]=Vysunout +Name[cy]=Allfwrw +Name[da]=Skub ud +Name[de]=Auswerfen +Name[el]=Εξαγωγή +Name[eo]=Eligo +Name[es]=Expulsar +Name[et]=Väljastamine +Name[eu]=Kanporatu +Name[fa]=اخراج +Name[fi]=Poista +Name[fr]=Éjecter +Name[fy]=Utsmytknop +Name[ga]=Díchuir +Name[gl]=Expulsar +Name[he]=הוצא +Name[hi]=बाहर +Name[hr]=Izbaci +#SUSE-Overwrite Name[hu]=Kidobás +Name[hu]=Kiadás +Name[is]=Henda út +Name[it]=Espelli +Name[ja]=取り出し +#SUSE-Overwrite Name[km]=ច្រាន​ចេញ +Name[km]=ច្រានចេញ +Name[ko]=꺼내기 +Name[lo]=ເອົາແຜ່ນອອກ +Name[lt]=IÅ¡mesti +Name[lv]=Izņemt +Name[mk]=Извади +Name[mn]=Гаргах +Name[ms]=Lenting +Name[mt]=Iftaħ +Name[nb]=Løs ut +Name[nds]=Rutsmieten +Name[nl]=Uitwerpen +Name[nn]=Løys ut +Name[nso]=Ntsha +Name[oc]=Expulsa +Name[pa]=ਬਾਹਰ ਕੱਢੋ +Name[pl]=Wysuń +Name[pt]=Ejectar +Name[pt_BR]=Ejetar +Name[ro]=Ejectează +Name[ru]=Извлечь CD +Name[rw]=Gusohora +Name[se]=Bálkes olggos +Name[sk]=Vysunúť +Name[sl]=Izvrzi +Name[sr]=Избаци +Name[sr@Latn]=Izbaci +Name[ss]=Khafuna +Name[sv]=Mata ut +Name[ta]=வெளித்தள் +Name[tg]=Ихроҷ +Name[th]=เอาแผ่นออก +Name[tr]=Çıkart +Name[tt]=Çığar +Name[uk]=Виштовхнути +Name[uz]=Чиқариш +Name[ven]=Bvisa +Name[vi]=Đẩy ra +Name[wa]=Fé rexhe +Name[xh]=Khuphela ngaphandle +Name[zh_CN]=弹出 +Name[zh_TW]=退出 +Name[zu]=Khipha +Exec=kio_media_mounthelper -e %u + + diff --git a/src/servicemenus/media_mount.desktop b/src/servicemenus/media_mount.desktop new file mode 100644 index 000000000..12fa54590 --- /dev/null +++ b/src/servicemenus/media_mount.desktop @@ -0,0 +1,155 @@ +[Desktop Entry] +ServiceTypes=media/cdrom_unmounted,media/cdwriter_unmounted,media/dvd_unmounted,media/floppy5_unmounted,media/floppy_unmounted,media/hdd_unmounted,media/nfs_unmounted,media/removable_unmounted,media/smb_unmounted,media/zip_unmounted,media/camera_unmounted +Actions=MediaMount; +X-KDE-Priority=TopLevel +X-KDE-MediaNotifierHide=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 +X-SuSE-translate=true +[Desktop Action MediaMount] +Name=Mount +Name[af]=Koppel +Name[ar]=حمّل +Name[az]=Bağla +Name[bg]=Монтиране +Name[bn]=মাউন্ট +Name[br]=Marc'hañ +Name[bs]=Montiraj +Name[ca]=Munta +Name[cs]=Připojit +Name[cy]=Gosod +Name[da]=Montér +Name[de]=Laufwerk einbinden +Name[el]=Προσάρτηση +Name[eo]=Kroĉo +Name[es]=Montar +Name[et]=Ühenda +Name[eu]=Muntatu +Name[fa]=سوارکردن +Name[fi]=Liitä +Name[fr]=Monter +Name[fy]=Oankeppelje (mount) +Name[ga]=Feistigh +Name[gl]=Montar +Name[he]=חבר +Name[hi]=माउन्ट +Name[hr]=Montiraj +Name[hsb]=montować +Name[hu]=Csatlakoztatás +Name[is]=Tengja +Name[it]=Monta +Name[ja]=マウント +#SUSE-Overwrite Name[km]=រៀបចំ +Name[km]=ម៉ោន +Name[lo]=ຈໍພາບ +Name[lt]=Montuoti +Name[lv]=Piemontēt +Name[mk]=Монтирај +Name[mn]=Залгах +Name[ms]=Lekap +Name[mt]=Immonta +Name[nb]=Monter +Name[nds]=Inhangen +Name[nl]=Aankoppelen (mount) +Name[nn]=Monter +Name[nso]=Nameletsa +#SUSE-Overwrite Name[pa]=ਮਾਊਟ +Name[pa]=ਮਾਊਂਟ +Name[pl]=Zamontuj +Name[pt]=Montar +Name[pt_BR]=Montar +Name[ro]=Montează +Name[ru]=Монтировать +Name[rw]=Gushyiramo +Name[se]=Čana +Name[sk]=PripojiÅ¥ +Name[sl]=Priklopi +Name[sr]=Монтирај +Name[sr@Latn]=Montiraj +Name[sv]=Montera +Name[ta]=ஏற்று +Name[tg]=Васл кунӣ +Name[th]=เม้าทน์ +Name[tr]=Bağla +Name[tt]=Bäyläp quy +Name[uk]=Змонтувати +Name[uz]=Улаш +Name[ven]=Gonya +Name[vi]=Gắn kết +Name[wa]=Monter +Name[xh]=Layisha +Name[zh_CN]=挂载 +Name[zh_TW]=掛載 +Name[zu]=Yenyusa +Exec=kio_media_mounthelper -m %u + + diff --git a/src/servicemenus/media_realfolder.desktop b/src/servicemenus/media_realfolder.desktop new file mode 100644 index 000000000..b53f5467e --- /dev/null +++ b/src/servicemenus/media_realfolder.desktop @@ -0,0 +1,114 @@ +[Desktop Entry] +ServiceTypes=media/cdrom_mounted,media/cdwriter_mounted,media/dvd_mounted,media/floppy5_mounted,media/floppy_mounted,media/hdd_mounted,media/nfs_mounted,media/smb_mounted,media/removable_mounted,media/zip_mounted +Actions=MediaRealFolder +X-KDE-Priority=TopLevel +X-KDE-MediaNotifierHide=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 +X-SuSE-translate=true +[Desktop Action MediaRealFolder] +Name=Open Medium System Folder +Name[ca]=Obre la carpeta de mitjans del sistema +Name[cs]=Otevřít systémovou složku média +Name[da]=Åbn medium-system-mappen +Name[de]=Systemordner des Mediums öffnen +Name[el]=Άνοιγμα του φακέλου συστήματος του μέσου +Name[es]=Abrir la carpeta del administrador de medios... +Name[et]=Ava andmekandja süsteemi kataloog +Name[eu]=Ireki euskarriaren kudeatzailea +Name[fi]=Avaa mediajärjestelmän kansio +Name[fr]=Dossier système d'ouverture de média +Name[he]=פתח את תיקיית מדיית המערכת +Name[hu]=A médiaanyagok rendszerkönyvtárának megnyitása +Name[is]=Opin miðils kerfismappa +Name[it]=Cartella di sistema per l'apertura di supporti +Name[lt]=Atverti sisteminį įrenginio aplanką +Name[nb]=Åpne systemmappe for medie +Name[nl]=Systeemmap medium openen +#SUSE-Overwrite Name[pa]=ਮੀਡੀਅਮ ਸਿਸਟਮ ਫੋਲਡਰ ਖੋਲੋ +Name[pa]=ਮੀਡਿਅਮ ਸਿਸਟਮ ਫੋਲਡਰ ਖੋਲੋ +Name[pl]=Otwórz folder systemowy mediów +Name[pt]=Pasta de Sistema Média Aberto +Name[pt_BR]=Abrir a Pasta de Mídias do Sistema +Name[ru]=Открыть системную папку +Name[sr]=Отвори системску фасциклу медијума +Name[sr@Latn]=Otvori sistemsku fasciklu medijuma +Name[sv]=Öppna mediumsystemkatalog +Name[uk]=Відкрити системну теку носія +Name[zh_CN]=打开介质系统文件夹 +Exec=kio_media_realfolder %u + + +Name[bg]=Системна папка на Open Medium +Name[ja]=オープン メディアシステムフォルダ +Name[km]=បើក​ថត​ប្រព័ន្ធ​មេឌៀ +Name[zh_TW]=開啟媒體系統資料夾 diff --git a/src/servicemenus/media_safelyremove.desktop b/src/servicemenus/media_safelyremove.desktop new file mode 100644 index 000000000..7d1ccc211 --- /dev/null +++ b/src/servicemenus/media_safelyremove.desktop @@ -0,0 +1,132 @@ +[Desktop Entry] +ServiceTypes=media/removable_mounted,media/removable_unmounted,media/camera_mounted,media/camera_unmounted +Actions=MediaSafelyRemove; +X-KDE-Priority=TopLevel +X-KDE-MediaNotifierHide=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 +X-SuSE-translate=true +[Desktop Action MediaSafelyRemove] +Name=Safely Remove +Name[af]=Verwyder veilig +Name[bg]=Безопасно изваждане +Name[bn]=নিরাপদভাবে সরাও +Name[ca]=Extreu amb seguretat +Name[cs]=Bezpečně odstranit +Name[da]=Fjern sikkert +Name[de]=Sicher entfernen +Name[el]=Ασφαλής αφαίρεση +Name[es]=Extracción segura +Name[et]=Eemalda turvaliselt +Name[eu]=Atera arriskurik gabe +Name[fi]=Poista turvallisesti +Name[fr]=Enlever en toute sécurité +Name[fy]=Feilich ferwiderje +Name[gl]=Eliminar de Maneira Segura +Name[he]=שליפה בבטחה +Name[hu]=Biztonságos leválasztás +Name[is]=Fjarlægja öruggt +Name[it]=Rimozione sicura +Name[ja]=安全に取り除く +#SUSE-Overwrite Name[km]=យកចេញ​ដោយ​សុវត្ថិភាព +Name[km]=យក​ចេញ​ដោយ​សុវត្ថិភាព +Name[lt]=Saugiai paÅ¡alinti +Name[mk]=Отстрани безбедно +Name[ms]=Buang Dengan Selamat +Name[nb]=Sikker fjerning +Name[nds]=Seker rutnehmen +Name[nl]=Veilig verwijderen +Name[nn]=Trygg fjerning +#SUSE-Overwrite Name[pa]=ਸੁਰੱਖਿਅਤ ਹਟਾਓ +Name[pa]=ਸੁਰੱਖਿਅਤ ਰੂਪ 'ਚ ਹਟਾਓ +Name[pl]=Usuń w sposób bezpieczny +Name[pt]=Retirar com Segurança +Name[pt_BR]=Remover de Modo Seguro +Name[ro]=Scoate în siguranţă +Name[ru]=Безопасно извлечь +Name[rw]=Gukuramo Neza +Name[se]=DorvvoÅ¡laÅ¡ eretváldin +Name[sl]=Varno odstrani +Name[sr]=Безбедно уклони +Name[sr@Latn]=Bezbedno ukloni +Name[sv]=Säker urkoppling +Name[ta]=பாதுகாப்பாக நீக்கு +Name[th]=ถอดออกได้อย่างปลอดภัย +Name[tr]=Güvenli Kaldır +Name[tt]=İmin Çığaru +Name[uk]=Безпечно вилучити +Name[uz]=Эҳтиётлик билан узиш +Name[zh_CN]=安全删除 +Name[zh_TW]=安全的移除 +Exec=kio_media_mounthelper -s %u + + diff --git a/src/servicemenus/media_unmount.desktop b/src/servicemenus/media_unmount.desktop new file mode 100644 index 000000000..b70e3a5c5 --- /dev/null +++ b/src/servicemenus/media_unmount.desktop @@ -0,0 +1,155 @@ +[Desktop Entry] +ServiceTypes=media/cdrom_mounted,media/cdwriter_mounted,media/dvd_mounted,media/floppy5_mounted,media/floppy_mounted,media/hdd_mounted,media/nfs_mounted,media/smb_mounted,media/zip_mounted,media/vcd,media/svcd,media/dvdvideo +Actions=MediaUnmount; +X-KDE-Priority=TopLevel +X-KDE-MediaNotifierHide=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 +X-SuSE-translate=true +[Desktop Action MediaUnmount] +Name=Unmount +Name[af]=Ontkoppel +Name[ar]=أزل التحميل +Name[az]=Ayır +Name[bg]=Демонтиране +Name[bn]=আনমাউন্ট +Name[br]=Divarc'hañ +Name[bs]=Demontiraj +Name[ca]= Desmunta +Name[cs]=Odpojit +Name[cy]=Dadosod +Name[da]=Afmontér +Name[de]=Laufwerkeinbindung lösen +Name[el]=Αποπροσάρτηση +Name[eo]=Malkroĉo +Name[es]=Desmontar +Name[et]=Lahuta +Name[eu]=Desmuntatu +Name[fa]=پیاده کردن +Name[fi]=Irrota +Name[fr]=Démonter (enlever de l'arborescence Linux) +Name[fy]=Ofkeppelje (unmount) +Name[ga]=Dífheistigh +Name[gl]=Desmontar +Name[he]=נתק +Name[hi]=अनमाउन्ट +Name[hr]=Demontiraj +Name[hsb]=Wotmontować +Name[hu]=Leválasztás +Name[is]=Aftengja +Name[it]=Smonta +Name[ja]=マウント解除 +#SUSE-Overwrite Name[km]=មិន​រៀបចំ +Name[km]=មិន​ម៉ោន +Name[lo]=ຫັງກາລີ +Name[lt]=IÅ¡montuoti +Name[lv]=Nomontēt +Name[mk]=Демонтирај +Name[mn]=Салгах +Name[ms]=Nyahlekap +Name[mt]=Å»monta +Name[nb]=Avmonter +Name[nds]=Afhangen +Name[nl]=Afkoppelen (unmount) +Name[nn]=Avmonter +Name[nso]=Theosa +#SUSE-Overwrite Name[pa]=ਅਨਮਾਉਟ +Name[pa]=ਅਣ-ਮਾਊਂਟ +Name[pl]=Odmontuj +Name[pt]=Desmontar +Name[pt_BR]=Desmontar +Name[ro]=Demontează +Name[ru]=Отмонтировать +Name[rw]=Gukuramo +Name[se]=Gálgga +Name[sk]=OdpojiÅ¥ +Name[sl]=Odklopi +Name[sr]=Демонтирај +Name[sr@Latn]=Demontiraj +Name[sv]=Avmontera +Name[ta]=வெளியேற்று +Name[tg]=Ҷудо кунӣ +Name[th]=ยกเลิกเม้าทน์ +Name[tr]=Ayır +Name[tt]=Bäyläwne çiş +Name[uk]=Демонтувати +Name[uz]=Узиш +Name[ven]=Usa gonya +Name[vi]=Gỡ +Name[wa]=Dismonter +Name[xh]=Sukuyilayisha +Name[zh_CN]=卸载 +Name[zh_TW]=未掛載 +Name[zu]=Yehlisa +Exec=kio_media_mounthelper -u %u + + diff --git a/src/servicemenus/open_in_digikam.desktop b/src/servicemenus/open_in_digikam.desktop new file mode 100644 index 000000000..658df9172 --- /dev/null +++ b/src/servicemenus/open_in_digikam.desktop @@ -0,0 +1,29 @@ +[Desktop Action OpenDigikam] +Exec=digikam --download-from %u +Icon=digikam +Name=Open in Digikam + +Name[bg]=Отваряне в digiKam +Name[cs]=Otevřít v digiKamu +Name[el]=Άνοιξε στο Digikam +Name[es]=Abrir en digiKam +Name[fi]=Avaa digiKamissa +Name[fr]=Ouvert dans Digikam +Name[hu]=Megnyitás Digikammel +Name[ja]=Digikamでオープン +Name[km]=បើក​ក្នុង Digikam +Name[nb]=Åpne i digiKam +Name[nl]=Openen in digiKam +Name[pa]=ਡਿਜ਼ੀਕੈਮ 'ਚ ਖੋਲੋ +Name[pl]=Otwórz w Digikam +Name[pt]=Abrir no DigiKam +Name[pt_BR]=Aberto no Digikam +Name[sv]=Öppna med Digikam +Name[uk]=Відкрити в Digikam +Name[zh_CN]=在 Digikam 中打开 +Name[zh_TW]=在 Digikam 中開啟 +[Desktop Entry] +Actions=OpenDigikam; +ServiceTypes=media/gphoto2camera,media/camera_mounted,media/camera_unmounted + +X-SuSE-translate=true diff --git a/src/settingspagebase.cpp b/src/settingspagebase.cpp new file mode 100644 index 000000000..40821c1d5 --- /dev/null +++ b/src/settingspagebase.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * 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 "settingspagebase.h" + +SettingsPageBase::SettingsPageBase(QWidget* parent) : + QWidget(parent) +{ +} + +SettingsPageBase::~SettingsPageBase() +{ +} + + +#include "settingspagebase.moc" diff --git a/src/settingspagebase.h b/src/settingspagebase.h new file mode 100644 index 000000000..953be02b8 --- /dev/null +++ b/src/settingspagebase.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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 SETTINGSPAGEBASE_H +#define SETTINGSPAGEBASE_H + +#include + +/** + * @brief Base class for the settings pages of the Dolphin settings dialog. + * + * @author Peter Penz + */ +class SettingsPageBase : public QWidget +{ + Q_OBJECT + +public: + SettingsPageBase(QWidget* parent); + virtual ~SettingsPageBase(); + + /** + * Must be implemented by a derived class to + * persistently store the settings. + */ + virtual void applySettings() = 0; +}; + +#endif diff --git a/src/sidebar.cpp b/src/sidebar.cpp new file mode 100755 index 000000000..de5b7be9b --- /dev/null +++ b/src/sidebar.cpp @@ -0,0 +1,110 @@ +/*************************************************************************** + * Copyright (C) 2006 by 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 "sidebar.h" + +#include +#include +//Added by qt3to4: +#include +#include +#include +#include + +#include "dolphinsettings.h" +#include "sidebarsettings.h" +#include "bookmarkssidebarpage.h" +#include "infosidebarpage.h" + +#include + +Sidebar::Sidebar(QWidget* parent) : + QWidget(parent), + m_pagesSelector(0), + m_page(0), + m_layout(0) +{ + m_layout = new Q3VBoxLayout(this); + + m_pagesSelector = new QComboBox(this); + m_pagesSelector->insertItem(i18n("Information")); + m_pagesSelector->insertItem(i18n("Bookmarks")); + + // Assure that the combo box has the same height as the URL navigator for + // a clean layout. + // TODO: the following 2 lines have been copied from the URLNavigator + // constructor (-> provide a shared height setting?) + QFontMetrics fontMetrics(font()); + m_pagesSelector->setMinimumHeight(fontMetrics.height() + 8); + + SidebarSettings* settings = DolphinSettings::instance().sidebarSettings(); + const int selectedIndex = indexForName(settings->selectedPage()); + m_pagesSelector->setCurrentItem(selectedIndex); + m_layout->addWidget(m_pagesSelector); + + createPage(selectedIndex); + + connect(m_pagesSelector, SIGNAL(activated(int)), + this, SLOT(createPage(int))); +} + +Sidebar::~Sidebar() +{ +} + +QSize Sidebar::sizeHint() const +{ + QSize size(QWidget::sizeHint()); + + SidebarSettings* settings = DolphinSettings::instance().sidebarSettings(); + size.setWidth(settings->width()); + return size; +} + +void Sidebar::createPage(int index) +{ + if (m_page != 0) { + m_page->deleteLater(); + m_page = 0; + } + + switch (index) { + case 0: m_page = new InfoSidebarPage(this); break; + case 1: m_page = new BookmarksSidebarPage(this); break; + default: break; + } + + m_layout->addWidget(m_page); + m_page->show(); + + SidebarSettings* settings = DolphinSettings::instance().sidebarSettings(); + settings->setSelectedPage(m_pagesSelector->text(index)); +} + +int Sidebar::indexForName(const QString& name) const +{ + const int count = m_pagesSelector->count(); + for (int i = 0; i < count; ++i) { + if (m_pagesSelector->text(i) == name) { + return i; + } + } + + return 0; +} diff --git a/src/sidebar.h b/src/sidebar.h new file mode 100755 index 000000000..2ba984e38 --- /dev/null +++ b/src/sidebar.h @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (C) 2006 by Cvetoslav Ludmiloff * + * Copyright (C) 2006 by Peter Penz + * * + * 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 _SIDEBAR_H_ +#define _SIDEBAR_H_ + +#include +//Added by qt3to4: +#include + +class KURL; +class QComboBox; +class Q3VBoxLayout; +class SidebarPage; + +/** + * @brief The sidebar allows to access bookmarks, history items and TODO... + * + * TODO + */ +class Sidebar : public QWidget +{ + Q_OBJECT + +public: + Sidebar(QWidget* parent); + virtual ~Sidebar(); + + virtual QSize sizeHint() const; + +signals: + /** + * The user selected an item on sidebar widget and item has + * URL property, so inform the parent togo to this URL; + */ + void urlChanged(const KURL& url); + +private slots: + void createPage(int index); + +private: + int indexForName(const QString& name) const; + + QComboBox* m_pagesSelector; + SidebarPage* m_page; + Q3VBoxLayout* m_layout; +}; + +#endif // _SIDEBAR_H_ diff --git a/src/sidebarpage.cpp b/src/sidebarpage.cpp new file mode 100644 index 000000000..c58025c25 --- /dev/null +++ b/src/sidebarpage.cpp @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (C) 2006 by 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 "sidebarpage.h" +#include "dolphin.h" + +SidebarPage::SidebarPage(QWidget* parent) : + QWidget(parent) +{ + connect(&Dolphin::mainWin(), SIGNAL(activeViewChanged()), + this, SLOT(activeViewChanged())); +} + +SidebarPage::~SidebarPage() +{ +} + +void SidebarPage::activeViewChanged() +{ +} diff --git a/src/sidebarpage.h b/src/sidebarpage.h new file mode 100644 index 000000000..50a7b598f --- /dev/null +++ b/src/sidebarpage.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2006 by Cvetoslav Ludmiloff * + * Copyright (C) 2006 by Peter Penz + * * + * 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 _SIDEBARPAGE_H_ +#define _SIDEBARPAGE_H_ + +#include + +class Sidebar; + +/** + * @brief Base widget for all pages that can be embedded into the Sidebar. + * + * TODO + */ +class SidebarPage : public QWidget +{ + Q_OBJECT + +public: + SidebarPage(QWidget* parent); + virtual ~SidebarPage(); + +protected slots: + /** + * Is invoked whenever the active view from Dolphin has been changed. + * The active view can be retrieved by Dolphin::mainWin().activeView(); + */ + virtual void activeViewChanged(); +}; + +#endif // _SIDEBARPAGE_H_ diff --git a/src/sidebarsettings.kcfg b/src/sidebarsettings.kcfg new file mode 100644 index 000000000..e3f72114c --- /dev/null +++ b/src/sidebarsettings.kcfg @@ -0,0 +1,19 @@ + + + + + + + + Information + + + + true + + + + 150 + + + \ No newline at end of file diff --git a/src/sidebarsettings.kcfgc b/src/sidebarsettings.kcfgc new file mode 100644 index 000000000..2b6e07873 --- /dev/null +++ b/src/sidebarsettings.kcfgc @@ -0,0 +1,4 @@ +File=sidebarsettings.kcfg +ClassName=SidebarSettings +Singleton=false +Mutators=true \ No newline at end of file diff --git a/src/statusbarmessagelabel.cpp b/src/statusbarmessagelabel.cpp new file mode 100644 index 000000000..9465f6de3 --- /dev/null +++ b/src/statusbarmessagelabel.cpp @@ -0,0 +1,219 @@ +/*************************************************************************** + * 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 "statusbarmessagelabel.h" +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) : + QWidget(parent), + m_type(DolphinStatusBar::Default), + m_state(Default), + m_illumination(0), + m_minTextHeight(-1), + m_timer(0) +{ + setMinimumHeight(KIcon::SizeSmall); + + m_timer = new QTimer(this); + connect(m_timer, SIGNAL(timeout()), + this, SLOT(timerDone())); +} + +StatusBarMessageLabel::~StatusBarMessageLabel() +{ +} + +void StatusBarMessageLabel::setType(DolphinStatusBar::Type type) +{ + if (type != m_type) { + m_type = type; + + m_timer->stop(); + m_illumination = 0; + m_state = Default; + + const char* iconName = 0; + QPixmap pixmap; + switch (type) { + case DolphinStatusBar::OperationCompleted: + iconName = "ok"; + break; + + case DolphinStatusBar::Information: + iconName = "info"; + break; + + case DolphinStatusBar::Error: + iconName = "error"; + m_timer->start(100); + m_state = Illuminate; + break; + + case DolphinStatusBar::Default: + default: break; + } + + m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName); + assureVisibleText(); + update(); + } +} + +void StatusBarMessageLabel::setText(const QString& text) +{ + if (text != m_text) { + if (m_type == DolphinStatusBar::Error) { + m_timer->start(100); + m_illumination = 0; + m_state = Illuminate; + } + m_text = text; + assureVisibleText(); + update(); + } +} + +void StatusBarMessageLabel::setMinimumTextHeight(int min) +{ + if (min != m_minTextHeight) { + m_minTextHeight = min; + setMinimumHeight(min); + } +} + +void StatusBarMessageLabel::paintEvent(QPaintEvent* /* event */) +{ + QPixmap buffer(size()); + QPainter painter(&buffer); + + // draw background + QColor backgroundColor(colorGroup().background()); + QColor foregroundColor(KGlobalSettings::textColor()); + if (m_illumination > 0) { + backgroundColor = mixColors(backgroundColor, QColor(255, 255, 64), m_illumination); + foregroundColor = mixColors(foregroundColor, QColor(0, 0, 0), m_illumination); + } + painter.setBrush(backgroundColor); + painter.setPen(backgroundColor); + painter.drawRect(QRect(0, 0, width(), height())); + + // draw pixmap + int x = pixmapGap(); + int y = (height() - m_pixmap.height()) / 2; + + if (!m_pixmap.isNull()) { + painter.drawPixmap(x, y, m_pixmap); + x += m_pixmap.width() + pixmapGap(); + } + + // draw text + painter.setPen(foregroundColor); + painter.drawText(QRect(x, 0, width() - x, height()), Qt::AlignVCenter | Qt::WordBreak, m_text); + painter.end(); + + bitBlt(this, 0, 0, &buffer); +} + +void StatusBarMessageLabel::resizeEvent(QResizeEvent* event) +{ + QWidget::resizeEvent(event); + QTimer::singleShot(0, this, SLOT(assureVisibleText())); +} + +void StatusBarMessageLabel::timerDone() +{ + switch (m_state) { + case Illuminate: { + // increase the illumination + if (m_illumination < 100) { + m_illumination += 20; + update(); + } + else { + m_state = Illuminated; + m_timer->start(1000); + } + break; + } + + case Illuminated: { + // start desaturation + m_state = Desaturate; + m_timer->start(100); + break; + } + + case Desaturate: { + // desaturate + if (m_illumination > 0) { + m_illumination -= 5; + update(); + } + else { + m_state = Default; + m_timer->stop(); + } + break; + } + + default: + break; + } +} + +void StatusBarMessageLabel::assureVisibleText() +{ + if (m_text.isEmpty()) { + return; + } + + + int availableWidth = width() - m_pixmap.width() - pixmapGap() * 2; + + QFontMetrics fontMetrics(font()); + QRect bounds(fontMetrics.boundingRect(0, 0, availableWidth, height(), + Qt::AlignVCenter | Qt::TextWordWrap, + m_text)); + int requiredHeight = bounds.height(); + if (requiredHeight < m_minTextHeight) { + requiredHeight = m_minTextHeight; + } + setMinimumHeight(requiredHeight); + updateGeometry(); +} + +QColor StatusBarMessageLabel::mixColors(const QColor& c1, + const QColor& c2, + int percent) const +{ + const int recip = 100 - percent; + const int red = (c1.red() * recip + c2.red() * percent) / 100; + const int green = (c1.green() * recip + c2.green() * percent) / 100; + const int blue = (c1.blue() * recip + c2.blue() * percent) / 100; + return QColor(red, green, blue); +} diff --git a/src/statusbarmessagelabel.h b/src/statusbarmessagelabel.h new file mode 100644 index 000000000..456dab8ba --- /dev/null +++ b/src/statusbarmessagelabel.h @@ -0,0 +1,95 @@ +/*************************************************************************** + * 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 STATUSBARMESSAGELABEL_H +#define STATUSBARMESSAGELABEL_H + +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +class QTimer; + +/** + * @brief Represents a message text label as part of the status bar. + * + * Dependant from the given type automatically a corresponding icon + * is shown in front of the text. For message texts having the type + * DolphinStatusBar::Error a dynamic color blending is done to get the + * attention from the user. + * + * @author Peter Penz + */ +class StatusBarMessageLabel : public QWidget +{ + Q_OBJECT + +public: + StatusBarMessageLabel(QWidget* parent); + virtual ~StatusBarMessageLabel(); + + void setType(DolphinStatusBar::Type type); + DolphinStatusBar::Type type() const { return m_type; } + + void setText(const QString& text); + const QString& text() const { return m_text; } + + // TODO: maybe a better approach is possible with the size hint + void setMinimumTextHeight(int min); + int minimumTextHeight() const { return m_minTextHeight; } + +protected: + /** @see QWidget::paintEvent */ + virtual void paintEvent(QPaintEvent* event); + + /** @see QWidget::resizeEvent */ + virtual void resizeEvent(QResizeEvent* event); + +private slots: + void timerDone(); + void assureVisibleText(); + +private: + enum State { + Default, + Illuminate, + Illuminated, + Desaturate + }; + + DolphinStatusBar::Type m_type; + State m_state; + int m_illumination; + int m_minTextHeight; + QTimer* m_timer; + QString m_text; + QPixmap m_pixmap; + + QColor mixColors(const QColor& c1, + const QColor& c2, + int percent) const; + + int pixmapGap() const { return 3; } +}; + +#endif diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp new file mode 100644 index 000000000..ddcf1b761 --- /dev/null +++ b/src/statusbarspaceinfo.cpp @@ -0,0 +1,195 @@ +/*************************************************************************** + * 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 "statusbarspaceinfo.h" + +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) : + QWidget(parent), + m_gettingSize(false), + m_kBSize(0), + m_kBAvailable(0) +{ + setMinimumWidth(200); + + // Update the space information each 10 seconds. Polling is useful + // here, as files can be deleted/added outside the scope of Dolphin. + QTimer* timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(refresh())); + timer->start(10000); +} + +StatusBarSpaceInfo::~StatusBarSpaceInfo() +{ +} + +void StatusBarSpaceInfo::setURL(const KUrl& url) +{ + m_url = url; + refresh(); + update(); +} + +void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */) +{ + QPainter painter(this); + const int barWidth = width(); + const int barTop = 2; + const int barHeight = height() - 4; + + QString text; + + const int widthDec = 3; // visual decrement for the available width + + const QColor c1 = colorGroup().background(); + const QColor c2 = KGlobalSettings::buttonTextColor(); + const QColor frameColor((c1.red() + c2.red()) / 2, + (c1.green() + c2.green()) / 2, + (c1.blue() + c2.blue()) / 2); + painter.setPen(frameColor); + + const QColor backgrColor = KGlobalSettings::baseColor(); + painter.setBrush(backgrColor); + + painter.drawRect(QRect(0, barTop + 1 , barWidth - widthDec, barHeight)); + + if ((m_kBSize > 0) && (m_kBAvailable > 0)) { + // draw 'used size' bar + painter.setPen(Qt::NoPen); + painter.setBrush(progressColor(backgrColor)); + int usedWidth = barWidth - static_cast((m_kBAvailable * + static_cast(barWidth)) / m_kBSize); + const int left = 1; + int right = usedWidth - (widthDec + 1); + if (right < left) { + right = left; + } + painter.drawRect(QRect(left, barTop + 2, right, barHeight - 2)); + + text = i18n("%1% of %2 used") + .arg( 100 - (int)(100.0 * m_kBAvailable / m_kBSize)) + .arg(KIO::convertSizeFromKB(m_kBSize)); + } + else { + if (m_gettingSize) { + text = i18n("Getting size..."); + } + else { + text = ""; + QTimer::singleShot(0, this, SLOT(hide())); + } + } + + // draw text (usually 'X% of Y GB used') + painter.setPen(KGlobalSettings::textColor()); + painter.drawText(QRect(1, 1, barWidth - 2, barHeight + 4), + Qt::AlignHCenter | Qt::AlignVCenter | Qt::WordBreak, + text); +} + + +void StatusBarSpaceInfo::slotFoundMountPoint(const unsigned long& kBSize, + const unsigned long& /* kBUsed */, + const unsigned long& kBAvailable, + const QString& /* mountPoint */) +{ + m_gettingSize = false; + m_kBSize = kBSize; + m_kBAvailable = kBAvailable; + + // Bypass a the issue (?) of KDiskFreeSp that for protocols like + // FTP, SMB the size of root partition is returned. + // TODO: check whether KDiskFreeSp is buggy or Dolphin uses it in a wrong way + const QString protocol(m_url.protocol()); + if (!protocol.isEmpty() && (protocol != "file")) { + m_kBSize = 0; + m_kBAvailable = 0; + } + + update(); +} + +void StatusBarSpaceInfo::slotDone() +{ + m_gettingSize = false; + if ((m_kBSize > 0) && (m_kBAvailable > 0)) { + show(); + } + + update(); +} + +void StatusBarSpaceInfo::refresh() +{ + m_gettingSize = true; + m_kBSize = 0; + m_kBAvailable = 0; + + const QString mountPoint(KIO::findPathMountPoint(m_url.path())); + + KDiskFreeSp* job = new KDiskFreeSp(this); + connect(job, SIGNAL(foundMountPoint(const unsigned long&, + const unsigned long&, + const unsigned long&, + const QString& )), + this, SLOT(slotFoundMountPoint(const unsigned long&, + const unsigned long&, + const unsigned long&, + const QString& ))); + connect(job, SIGNAL(done()), + this, SLOT(slotDone())); + + job->readDF(mountPoint); +} + +QColor StatusBarSpaceInfo::progressColor(const QColor& bgColor) const +{ + QColor color = KGlobalSettings::buttonBackground(); + + // assure that enough contrast is given between the background color + // and the progressbar color + int bgRed = bgColor.red(); + int bgGreen = bgColor.green(); + int bgBlue = bgColor.blue(); + + const int backgrBrightness = qGray(bgRed, bgGreen, bgBlue); + const int progressBrightness = qGray(color.red(), color.green(), color.blue()); + + const int limit = 32; + const int diff = backgrBrightness - progressBrightness; + bool adjustColor = ((diff >= 0) && (diff < limit)) || + ((diff < 0) && (diff > -limit)); + if (adjustColor) { + const int inc = (backgrBrightness < 2 * limit) ? (2 * limit) : -limit; + color = QColor(bgRed + inc, bgGreen + inc, bgBlue + inc); + } + + return color; +} + +#include "statusbarspaceinfo.moc" diff --git a/src/statusbarspaceinfo.h b/src/statusbarspaceinfo.h new file mode 100644 index 000000000..195c1971b --- /dev/null +++ b/src/statusbarspaceinfo.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * 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. * + ***************************************************************************/ +#ifndef STATUSBARSPACEINFO_H +#define STATUSBARSPACEINFO_H + +#include +#include +//Added by qt3to4: +#include +#include +#include + +class KDiskFreeSp; + +/** + * @short Shows the available space for the current volume as part + * of the status bar. + */ +class StatusBarSpaceInfo : public QWidget +{ + Q_OBJECT + +public: + StatusBarSpaceInfo(QWidget* parent); + virtual ~StatusBarSpaceInfo(); + + void setURL(const KUrl& url); + const KUrl& url() const { return m_url; } + +protected: + /** @see QWidget::paintEvent */ + virtual void paintEvent(QPaintEvent* event); + +private slots: + /** + * The strange signature of this method is due to a compiler + * bug (?). More details are given inside the class KDiskFreeSp (see + * KDE Libs documentation). + */ + void slotFoundMountPoint(const unsigned long& kBSize, + const unsigned long& kBUsed, + const unsigned long& kBAvailable, + const QString& mountPoint); + void slotDone(); + + /** Refreshs the space information for the current set URL. */ + void refresh(); + +private: + /** + * Returns a color for the progress bar by respecting + * the given background color \a bgColor. It is assured + * that enough contrast is given to have a visual indication. + */ + QColor progressColor(const QColor& bgColor) const; + + KUrl m_url; + bool m_gettingSize; + unsigned long m_kBSize; + unsigned long m_kBAvailable; + +}; + +#endif diff --git a/src/undomanager.cpp b/src/undomanager.cpp new file mode 100644 index 000000000..4173b3c5e --- /dev/null +++ b/src/undomanager.cpp @@ -0,0 +1,402 @@ +/*************************************************************************** + * 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 "undomanager.h" +#include +#include +#include +#include + +#include "dolphin.h" +#include "dolphinstatusbar.h" +#include "progressindicator.h" + +DolphinCommand::DolphinCommand() : + m_type(Copy), + m_macroIndex(-1) +{ + // Implementation note: DolphinCommands are stored in a QValueList, whereas + // QValueList requires a default constructor of the added class. + // Instead of expressing this implementation detail to the interface by adding a + // Type::Undefined just Type::Copy is used to assure that all members have + // a defined state. +} + +DolphinCommand::DolphinCommand(Type type, + const KUrl::List& source, + const KUrl& dest) : + m_type(type), + m_macroIndex(-1), + m_source(source), + m_dest(dest) +{ +} + +DolphinCommand::~DolphinCommand() +{ +} + +DolphinCommand& DolphinCommand::operator = (const DolphinCommand& command) +{ + m_type = command.m_type; + m_source = command.m_source; + m_dest = command.m_dest; + return *this; +} + +UndoManager& UndoManager::instance() +{ + static UndoManager* instance = 0; + if (instance == 0) { + instance = new UndoManager(); + } + return *instance; +} + +void UndoManager::addCommand(const DolphinCommand& command) +{ + ++m_historyIndex; + + if (m_recordMacro) { + DolphinCommand macroCommand = command; + macroCommand.m_macroIndex = m_macroCounter; + m_history.insert(m_history.at(m_historyIndex), macroCommand); + } + else { + m_history.insert(m_history.at(m_historyIndex), command); + } + + emit undoAvailable(true); + emit undoTextChanged(i18n("Undo: %1").arg(commandText(command))); + + // prevent an endless growing of the Undo history + if (m_historyIndex > 10000) { + m_history.erase(m_history.begin()); + --m_historyIndex; + } +} + +void UndoManager::beginMacro() +{ + assert(!m_recordMacro); + m_recordMacro = true; + ++m_macroCounter; +} + +void UndoManager::endMacro() +{ + assert(m_recordMacro); + m_recordMacro = false; +} + +void UndoManager::undo() +{ + if (m_recordMacro) { + endMacro(); + } + + if (m_historyIndex < 0) { + return; + } + + int progressCount = 0; + int macroCount = 1; + calcStepsCount(macroCount, progressCount); + + m_progressIndicator = new ProgressIndicator(i18n("Executing undo operation..."), + i18n("Executed undo operation."), + progressCount); + + for (int i = 0; i < macroCount; ++i) { + const DolphinCommand command = m_history[m_historyIndex]; + --m_historyIndex; + if (m_historyIndex < 0) { + emit undoAvailable(false); + emit undoTextChanged(i18n("Undo")); + } + else { + emit undoTextChanged(i18n("Undo: %1").arg(commandText(m_history[m_historyIndex]))); + } + + if (m_historyIndex < static_cast(m_history.count()) - 1) { + emit redoAvailable(true); + emit redoTextChanged(i18n("Redo: %1").arg(commandText(command))); + } + else { + emit redoAvailable(false); + emit redoTextChanged(i18n("Redo")); + } + + KUrl::List sourceURLs = command.source(); + KUrl::List::Iterator it = sourceURLs.begin(); + const KUrl::List::Iterator end = sourceURLs.end(); + const QString destURL(command.destination().prettyURL(+1)); + + KIO::Job* job = 0; + switch (command.type()) { + case DolphinCommand::Link: + case DolphinCommand::Copy: { + KUrl::List list; + while (it != end) { + const KUrl deleteURL(destURL + (*it).filename()); + list.append(deleteURL); + ++it; + } + job = KIO::del(list, false, false); + break; + } + + case DolphinCommand::Move: { + KUrl::List list; + const KUrl newDestURL((*it).directory()); + while (it != end) { + const KUrl newSourceURL(destURL + (*it).filename()); + list.append(newSourceURL); + ++it; + } + job = KIO::move(list, newDestURL, false); + break; + } + + case DolphinCommand::Rename: { + assert(sourceURLs.count() == 1); + KIO::NetAccess::move(command.destination(), (*it)); + break; + } + + case DolphinCommand::Trash: { + while (it != end) { + // TODO: use KIO::special for accessing the trash protocol. See + // also Dolphin::slotJobResult() for further details. + const QString originalFileName((*it).filename().section('-', 1)); + KUrl newDestURL(destURL + originalFileName); + KIO::NetAccess::move(*it, newDestURL); + ++it; + + m_progressIndicator->execOperation(); + } + break; + } + + case DolphinCommand::CreateFolder: + case DolphinCommand::CreateFile: { + KIO::NetAccess::del(command.destination(), &Dolphin::mainWin()); + break; + } + } + + if (job != 0) { + // Execute the jobs in a synchronous manner and forward the progress + // information to the Dolphin statusbar. + connect(job, SIGNAL(percent(KIO::Job*, unsigned long)), + this, SLOT(slotPercent(KIO::Job*, unsigned long))); + KIO::NetAccess::synchronousRun(job, &Dolphin::mainWin()); + } + + m_progressIndicator->execOperation(); + } + + delete m_progressIndicator; + m_progressIndicator = 0; +} + +void UndoManager::redo() +{ + if (m_recordMacro) { + endMacro(); + } + + const int maxHistoryIndex = m_history.count() - 1; + if (m_historyIndex >= maxHistoryIndex) { + return; + } + ++m_historyIndex; + + int progressCount = 0; + int macroCount = 1; + calcStepsCount(macroCount, progressCount); + + m_progressIndicator = new ProgressIndicator(i18n("Executing redo operation..."), + i18n("Executed redo operation."), + progressCount); + + for (int i = 0; i < macroCount; ++i) { + const DolphinCommand command = m_history[m_historyIndex]; + if (m_historyIndex >= maxHistoryIndex) { + emit redoAvailable(false); + emit redoTextChanged(i18n("Redo")); + } + else { + emit redoTextChanged(i18n("Redo: %1").arg(commandText(m_history[m_historyIndex + 1]))); + } + + emit undoAvailable(true); + emit undoTextChanged(i18n("Undo: %1").arg(commandText(command))); + + Dolphin& dolphin = Dolphin::mainWin(); + + KUrl::List sourceURLs = command.source(); + KUrl::List::Iterator it = sourceURLs.begin(); + const KUrl::List::Iterator end = sourceURLs.end(); + + KIO::Job* job = 0; + switch (command.type()) { + case DolphinCommand::Link: { + job = KIO::link(sourceURLs, command.destination(), false); + break; + } + + case DolphinCommand::Copy: { + job = KIO::copy(sourceURLs, command.destination(), false); + break; + } + + case DolphinCommand::Rename: + case DolphinCommand::Move: { + job = KIO::move(sourceURLs, command.destination(), false); + break; + } + + case DolphinCommand::Trash: { + const QString destURL(command.destination().prettyURL()); + while (it != end) { + // TODO: use KIO::special for accessing the trash protocol. See + // also Dolphin::slotJobResult() for further details. + const QString originalFileName((*it).filename().section('-', 1)); + KUrl originalSourceURL(destURL + "/" + originalFileName); + KIO::Job* moveToTrashJob = KIO::trash(originalSourceURL); + KIO::NetAccess::synchronousRun(moveToTrashJob, &dolphin); + ++it; + + m_progressIndicator->execOperation(); + } + break; + } + + case DolphinCommand::CreateFolder: { + KIO::NetAccess::mkdir(command.destination(), &dolphin); + break; + } + + case DolphinCommand::CreateFile: { + m_progressIndicator->execOperation(); + KUrl::List::Iterator it = sourceURLs.begin(); + assert(sourceURLs.count() == 1); + KIO::CopyJob* copyJob = KIO::copyAs(*it, command.destination(), false); + copyJob->setDefaultPermissions(true); + job = copyJob; + break; + } + } + + if (job != 0) { + // Execute the jobs in a synchronous manner and forward the progress + // information to the Dolphin statusbar. + connect(job, SIGNAL(percent(KIO::Job*, unsigned long)), + this, SLOT(slotPercent(KIO::Job*, unsigned long))); + KIO::NetAccess::synchronousRun(job, &dolphin); + } + + ++m_historyIndex; + m_progressIndicator->execOperation(); + } + + --m_historyIndex; + + delete m_progressIndicator; + m_progressIndicator = 0; +} + +UndoManager::UndoManager() : + m_recordMacro(false), + m_historyIndex(-1), + m_macroCounter(0), + m_progressIndicator(0) +{ +} + +UndoManager::~UndoManager() +{ + delete m_progressIndicator; + m_progressIndicator = 0; +} + +QString UndoManager::commandText(const DolphinCommand& command) const +{ + QString text; + switch (command.type()) { + case DolphinCommand::Copy: text = i18n("Copy"); break; + case DolphinCommand::Move: text = i18n("Move"); break; + case DolphinCommand::Link: text = i18n("Link"); break; + case DolphinCommand::Rename: text = i18n("Rename"); break; + case DolphinCommand::Trash: text = i18n("Move to Trash"); break; + case DolphinCommand::CreateFolder: text = i18n("Create New Folder"); break; + case DolphinCommand::CreateFile: text = i18n("Create New File"); break; + default: break; + } + return text; +} + +void UndoManager::slotPercent(KIO::Job* /* job */, unsigned long /* percent */) +{ + // It is not allowed to update the progress indicator in the context + // of this slot, hence do an asynchronous triggering. + QTimer::singleShot(0, this, SLOT(updateProgress())); +} + +void UndoManager::updateProgress() +{ + m_progressIndicator->execOperation(); +} + +void UndoManager::calcStepsCount(int& macroCount, int& progressCount) +{ + progressCount = 0; + macroCount = 0; + + const int macroIndex = m_history[m_historyIndex].m_macroIndex; + if (macroIndex < 0) { + // default use case: no macro has been recorded + macroCount = 1; + progressCount = m_history[m_historyIndex].source().count(); + return; + } + + // iterate backward for undo... + int i = m_historyIndex; + while ((i >= 0) && (m_history[i].m_macroIndex == macroIndex)) { + ++macroCount; + progressCount += m_history[i].source().count(); + --i; + } + + // iterate forward for redo... + const int max = m_history.count() - 1; + i = m_historyIndex + 1; + while ((i <= max) && (m_history[i].m_macroIndex == macroIndex)) { + ++macroCount; + progressCount += m_history[i].source().count(); + ++i; + } +} + +#include "undomanager.moc" + + diff --git a/src/undomanager.h b/src/undomanager.h new file mode 100644 index 000000000..30a4aba39 --- /dev/null +++ b/src/undomanager.h @@ -0,0 +1,196 @@ +/*************************************************************************** + * 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 UNDOMANAGER_H +#define UNDOMANAGER_H + +#include +#include +#include +#include + +class ProgressIndicator; + +/** + * @short Represents a file manager command which can be undone and redone. + * + * A command is specified by a type, a list of source URLs and a + * destination URL. + * + * Due to the fixed set of commands a file manager offers this class is + * a very simplified version of the classic command pattern. + * + * @see UndoManager + * @author Peter Penz + */ +class DolphinCommand +{ +public: + enum Type { + Copy, + Move, + Link, + Rename, + Trash, + CreateFolder, + CreateFile + }; + + DolphinCommand(); + DolphinCommand(Type type, const KUrl::List& source, const KUrl& dest); + ~DolphinCommand(); // non-virtual + + DolphinCommand& operator = (const DolphinCommand& command); + Type type() const { return m_type; } + void setSource(const KUrl::List source) { m_source = source; } + const KUrl::List& source() const { return m_source; } + const KUrl& destination() const { return m_dest; } + +private: + Type m_type; + int m_macroIndex; + KUrl::List m_source; + KUrl m_dest; + + friend class UndoManager; // allow to modify m_macroIndex +}; + +/** + * @short Stores all file manager commands which can be undone and redone. + * + * During the undo and redo operations a progress information is + * shown in the status bar. + * + * @author Peter Penz + */ +class UndoManager : public QObject +{ + Q_OBJECT + +public: + static UndoManager& instance(); + + /** + * Adds the command \a command to the undo list. The command + * can be undone by invoking UndoManager::undo(). + */ + void addCommand(const DolphinCommand& command); + + /** + * Allows to summarize several commands into one macro, which + * can be undo in one stop by UndoManager::undo(). Example + * \code + * UndoManager& undoMan = UndoManager.instance(); + * undoMan.beginMacro(); + * undoMan.addCommand(...); + * undoMan.addCommand(...); + * undoMan.addCommand(...); + * undoMan.endMacro(); + * \endcode + * It is not allowed to do nested macro recordings. + */ + void beginMacro(); + + /** + * Marks the end of a macro command. See UndoManager::beginMacro() + * for sample code. + */ + void endMacro(); + +public slots: + /** + * Performs an undo operation on the last command which has + * been added by UndoManager::addCommand(). + */ + void undo(); + + /** + * Performs a redo operation on the last command where an undo + * operation has been applied. + */ + void redo(); + +signals: + /** + * Is emitted if whenever the availability state + * of the current undo operation changes. + */ + void undoAvailable(bool available); + + /** + * Is emitted whenever the text of the current + * undo operation changes + * (e. g. from 'Undo: Delete' to 'Undo: Copy') + */ + void undoTextChanged(const QString& text); + + /** + * Is emitted if whenever the availability state + * of the current redo operation changes. + */ + void redoAvailable(bool available); + + /** + * Is emitted whenever the text of the current + * redo operation changes + * (e. g. from 'Redo: Delete' to 'Redo: Copy') + */ + void redoTextChanged(const QString& text); + +protected: + UndoManager(); + virtual ~UndoManager(); + QString commandText(const DolphinCommand& command) const; + +private slots: + /** + * Slot for the percent information of the I/O slaves. + * Delegates the updating of the progress information + * to UndoManager::updateProgress(). + */ + void slotPercent(KIO::Job* job, unsigned long percent); + + /** + * Updates the progress information of the statusbar + * by accessing the progress indicator information. + */ + void updateProgress(); + +private: + bool m_recordMacro; + int m_historyIndex; + int m_macroCounter; + Q3ValueList m_history; + ProgressIndicator* m_progressIndicator; + + /** + * Dependent from the current history index \a m_historyIndex + * the number of macro commands is written to the output + * parameter \a macroCount. The number of steps for all macro + * commands is written to the output parameter \a progressCount. + * + * Per default \a macroCount is 1 and \a progressCount represents + * the number of operations for one command. + */ + void calcStepsCount(int& macroCount, + int& progressCount); +}; + +#endif diff --git a/src/urlbutton.cpp b/src/urlbutton.cpp new file mode 100644 index 000000000..d441ab184 --- /dev/null +++ b/src/urlbutton.cpp @@ -0,0 +1,98 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * + * Copyright (C) 2006 by Aaron J. Seigo () * + * * + * 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 "urlnavigatorbutton.h" +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +#include "urlnavigator.h" +#include "dolphin.h" + + +URLButton::URLButton(URLNavigator* parent) +: QPushButton(parent), + m_displayHint(0), + m_urlNavigator(parent) +{ + setFocusPolicy(Qt::NoFocus); + setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); + setMinimumHeight(parent->minimumHeight()); + + connect(this, SIGNAL(clicked()), parent, SLOT(slotRequestActivation())); + connect(&Dolphin::mainWin(), SIGNAL(activeViewChanged()), + this, SLOT(update())); +} + +URLButton::~URLButton() +{ +} + +URLNavigator* URLButton::urlNavigator() const +{ + return m_urlNavigator; +} + +void URLButton::setDisplayHintEnabled(DisplayHint hint, + bool enable) +{ + if (enable) { + m_displayHint = m_displayHint | hint; + } + else { + m_displayHint = m_displayHint & ~hint; + } + update(); +} + +bool URLButton::isDisplayHintEnabled(DisplayHint hint) const +{ + return (m_displayHint & hint) > 0; +} + +void URLButton::enterEvent(QEvent* event) +{ + QPushButton::enterEvent(event); + setDisplayHintEnabled(EnteredHint, true); + update(); +} + +void URLButton::leaveEvent(QEvent* event) +{ + QPushButton::leaveEvent(event); + setDisplayHintEnabled(EnteredHint, false); + update(); +} + +QColor URLButton::mixColors(const QColor& c1, + const QColor& c2) const +{ + const int Qt::red = (c1.Qt::red() + c2.Qt::red()) / 2; + const int Qt::green = (c1.Qt::green() + c2.Qt::green()) / 2; + const int Qt::blue = (c1.Qt::blue() + c2.Qt::blue()) / 2; + return QColor(Qt::red, Qt::green, Qt::blue); +} diff --git a/src/urlbutton.h b/src/urlbutton.h new file mode 100644 index 000000000..c1833b290 --- /dev/null +++ b/src/urlbutton.h @@ -0,0 +1,71 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * + * Copyright (C) 2006 by Aaron J. Seigo () * + * * + * 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 URLBUTTON_H +#define URLBUTTON_H + +#include +//Added by qt3to4: +#include + +class KURL; +class URLNavigator; +class QPainter; + +/** + * @brief Base class for buttons of the URL navigator. + * + * Each button of the URL navigator contains an URL, which + * is set as soon as the button has been clicked. +* + * @author Peter Penz + */ +class URLButton : public QPushButton +{ + Q_OBJECT + +public: + URLButton(URLNavigator* parent); + virtual ~URLButton(); + + URLNavigator* urlNavigator() const; + +protected: + enum DisplayHint { + ActivatedHint = 1, + EnteredHint = 2, + DraggedHint = 4, + PopupActiveHint = 8 + }; + + void setDisplayHintEnabled(DisplayHint hint, bool enable); + bool isDisplayHintEnabled(DisplayHint hint) const; + + virtual void enterEvent(QEvent* event); + virtual void leaveEvent(QEvent* event); + + QColor mixColors(const QColor& c1, const QColor& c2) const; + +private: + int m_displayHint; + URLNavigator* m_urlNavigator; +}; + +#endif diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp new file mode 100644 index 000000000..e1afa3ffc --- /dev/null +++ b/src/urlnavigator.cpp @@ -0,0 +1,611 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * + * Copyright (C) 2006 by Aaron J. Seigo () * + * Copyright (C) 2006 by 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 "urlnavigator.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bookmarkselector.h" +#include "dolphin.h" +#include "dolphinsettings.h" +#include "dolphinstatusbar.h" +#include "dolphinview.h" +#include "generalsettings.h" +#include "protocolcombo.h" +#include "urlnavigatorbutton.h" + +URLNavigator::HistoryElem::HistoryElem() + : m_url(), + m_currentFileName(), + m_contentsX(0), + m_contentsY(0) +{ +} + +URLNavigator::HistoryElem::HistoryElem(const KUrl& url) + : m_url(url), + m_currentFileName(), + m_contentsX(0), + m_contentsY(0) +{ +} + +URLNavigator::HistoryElem::~HistoryElem() +{ +} + +URLNavigator::URLNavigator(const KUrl& url, + DolphinView* dolphinView) : + Q3HBox(dolphinView), + m_historyIndex(0), + m_dolphinView(dolphinView), + m_protocols(0), + m_protocolSeparator(0), + m_host(0) +{ + m_history.prepend(HistoryElem(url)); + + QFontMetrics fontMetrics(font()); + setMinimumHeight(fontMetrics.height() + 8); + + m_toggleButton = new QCheckBox(this); + //m_toggleButton->setFlat(true); + //m_toggleButton->setToggleButton(true); + m_toggleButton->setFocusPolicy(Qt::NoFocus); + m_toggleButton->setMinimumHeight(minimumHeight()); + connect(m_toggleButton, SIGNAL(clicked()), + this, SLOT(slotClicked())); + if (DolphinSettings::instance().generalSettings()->editableURL()) { + m_toggleButton->toggle(); + } + + m_bookmarkSelector = new BookmarkSelector(this); + connect(m_bookmarkSelector, SIGNAL(bookmarkActivated(int)), + this, SLOT(slotBookmarkActivated(int))); + + m_pathBox = new KUrlComboBox(KUrlComboBox::Directories, true, this); + + KUrlCompletion* kurlCompletion = new KUrlCompletion(KUrlCompletion::DirCompletion); + m_pathBox->setCompletionObject(kurlCompletion); + m_pathBox->setAutoDeleteCompletionObject(true); + + connect(m_pathBox, SIGNAL(returnPressed(const QString&)), + this, SLOT(slotReturnPressed(const QString&))); + connect(m_pathBox, SIGNAL(urlActivated(const KUrl&)), + this, SLOT(slotURLActivated(const KUrl&))); + + connect(dolphinView, SIGNAL(contentsMoved(int, int)), + this, SLOT(slotContentsMoved(int, int))); + connect(dolphinView, SIGNAL(redirection(const KUrl&, const KUrl&)), + this, SLOT(slotRedirection(const KUrl&, const KUrl&))); +/* connect(dolphinView, SIGNAL(redirection(const KUrl&)), + this, SLOT(slotRedirection(const KUrl&)));*/ + updateContent(); +} + +URLNavigator::~URLNavigator() +{ +} + +void URLNavigator::setURL(const KUrl& url) +{ + QString urlStr(url.pathOrUrl()); + //kdDebug() << "setURL(" << url << ")" << endl; + if (urlStr.at(0) == '~') { + // replace '~' by the home directory + urlStr.remove(0, 1); + urlStr.insert(0, QDir::home().path()); + } + + const KUrl transformedURL(urlStr); + + if (m_historyIndex > 0) { + // Check whether the previous element of the history has the same URL. + // If yes, just go forward instead of inserting a duplicate history + // element. + const KUrl& nextURL = m_history[m_historyIndex - 1].url(); + if (transformedURL == nextURL) { + goForward(); +// kdDebug() << "goin' forward in history" << endl; + return; + } + } + + const KUrl& currURL = m_history[m_historyIndex].url(); + if (currURL == transformedURL) { + // don't insert duplicate history elements +// kdDebug() << "currURL == transformedURL" << endl; + return; + } + + updateHistoryElem(); + + const Q3ValueListIterator it = m_history.at(m_historyIndex); + m_history.insert(it, HistoryElem(transformedURL)); + + updateContent(); + + emit urlChanged(transformedURL); + emit historyChanged(); + + // Prevent an endless growing of the history: remembering + // the last 100 URLs should be enough... + if (m_historyIndex > 100) { + m_history.erase(m_history.begin()); + --m_historyIndex; + } + +/* kdDebug() << "history starting ====================" << endl; + int i = 0; + for (QValueListIterator it = m_history.begin(); + it != m_history.end(); + ++it, ++i) + { + kdDebug() << i << ": " << (*it).url() << endl; + } + kdDebug() << "history done ========================" << endl;*/ +} + +const KUrl& URLNavigator::url() const +{ + assert(!m_history.empty()); + return m_history[m_historyIndex].url(); +} + +KUrl URLNavigator::url(int index) const +{ + assert(index >= 0); + QString path(url().pathOrUrl()); + path = path.section('/', 0, index); + + if (path.at(path.length()) != '/') + { + path.append('/'); + } + + return path; +} + +const Q3ValueList& URLNavigator::history(int& index) const +{ + index = m_historyIndex; + return m_history; +} + +void URLNavigator::goBack() +{ + updateHistoryElem(); + + const int count = m_history.count(); + if (m_historyIndex < count - 1) { + ++m_historyIndex; + updateContent(); + emit urlChanged(url()); + emit historyChanged(); + } +} + +void URLNavigator::goForward() +{ + if (m_historyIndex > 0) { + --m_historyIndex; + updateContent(); + emit urlChanged(url()); + emit historyChanged(); + } +} + +void URLNavigator::goUp() +{ + setURL(url().upUrl()); +} + +void URLNavigator::goHome() +{ + setURL(DolphinSettings::instance().generalSettings()->homeURL()); +} + +void URLNavigator::setURLEditable(bool editable) +{ + if (isURLEditable() != editable) { + m_toggleButton->toggle(); + slotClicked(); + } +} + +bool URLNavigator::isURLEditable() const +{ + return m_toggleButton->isChecked(); +} + +void URLNavigator::editURL(bool editOrBrowse) +{ + setURLEditable(editOrBrowse); + + if (editOrBrowse) + { + m_pathBox->setFocus(); + } +} + +DolphinView* URLNavigator::dolphinView() const +{ + return m_dolphinView; +} + +void URLNavigator::keyReleaseEvent(QKeyEvent* event) +{ + Q3HBox::keyReleaseEvent(event); + if (isURLEditable() && (event->key() == Qt::Key_Escape)) { + setURLEditable(false); + } +} + +void URLNavigator::slotReturnPressed(const QString& text) +{ + // Parts of the following code have been taken + // from the class KateFileSelector located in + // kate/app/katefileselector.hpp of Kate. + // Copyright (C) 2001 Christoph Cullmann + // Copyright (C) 2001 Joseph Wenninger + // Copyright (C) 2001 Anders Lund + + KUrl typedURL(text); + if (typedURL.hasPass()) { + typedURL.setPass(QString::null); + } + + QStringList urls = m_pathBox->urls(); + urls.remove(typedURL.url()); + urls.prepend(typedURL.url()); + m_pathBox->setUrls(urls, KUrlComboBox::RemoveBottom); + + setURL(typedURL); + // The URL might have been adjusted by URLNavigator::setURL(), hence + // synchronize the result in the path box. + m_pathBox->setUrl(url()); +} + +void URLNavigator::slotURLActivated(const KUrl& url) +{ + setURL(url); +} + +void URLNavigator::slotRemoteHostActivated() +{ + KUrl u = url(); + + QString host = m_host->text(); + QString user; + + int marker = host.find("@"); + if (marker != -1) + { + user = host.left(marker); + u.setUser(user); + host = host.right(host.length() - marker - 1); + } + + marker = host.find("/"); + if (marker != -1) + { + u.setPath(host.right(host.length() - marker)); + host.truncate(marker); + } + else + { + u.setPath(""); + } + + if (m_protocols->currentProtocol() != u.protocol() || + host != u.host() || + user != u.user()) + { + u.setProtocol(m_protocols->currentProtocol()); + u.setHost(m_host->text()); + + //TODO: get rid of this HACK for file:///! + if (u.protocol() == "file") + { + u.setHost(""); + if (u.path().isEmpty()) + { + u.setPath("/"); + } + } + + setURL(u); + } +} + +void URLNavigator::slotProtocolChanged(const QString& protocol) +{ + KUrl url; + url.setProtocol(protocol); + //url.setPath(KProtocolInfo::protocolClass(protocol) == ":local" ? "/" : ""); + url.setPath("/"); + Q3ValueList::const_iterator it = m_navButtons.constBegin(); + while (it != m_navButtons.constEnd()) { + (*it)->close(); + (*it)->deleteLater(); + ++it; + } + m_navButtons.clear(); + + if (KProtocolInfo::protocolClass(protocol) == ":local") { + setURL(url); + } + else { + if (!m_host) { + m_protocolSeparator = new QLabel("://", this); + m_host = new QLineEdit(this); + + connect(m_host, SIGNAL(lostFocus()), + this, SLOT(slotRemoteHostActivated())); + connect(m_host, SIGNAL(returnPressed()), + this, SLOT(slotRemoteHostActivated())); + } + else { + m_host->setText(""); + } + m_protocolSeparator->show(); + m_host->show(); + m_host->setFocus(); + } +} + +void URLNavigator::slotRequestActivation() +{ + m_dolphinView->requestActivation(); +} + +void URLNavigator::slotBookmarkActivated(int index) +{ + m_dolphinView->statusBar()->clear(); + m_dolphinView->requestActivation(); + + KBookmark bookmark = DolphinSettings::instance().bookmark(index); + m_dolphinView->setURL(bookmark.url()); +} + +void URLNavigator::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl) +{ +// kdDebug() << "received redirection to " << newUrl << endl; +kdDebug() << "received redirection from " << oldUrl << " to " << newUrl << endl; +/* UrlStack::iterator it = m_urls.find(oldUrl); + if (it != m_urls.end()) + { + m_urls.erase(++it, m_urls.end()); + } + + m_urls.append(newUrl);*/ +} + +void URLNavigator::slotContentsMoved(int x, int y) +{ + m_history[m_historyIndex].setContentsX(x); + m_history[m_historyIndex].setContentsY(y); +} + +void URLNavigator::slotClicked() +{ + if (isURLEditable()) { + m_pathBox->setFocus(); + updateContent(); + } + else { + setURL(m_pathBox->currentText()); + m_dolphinView->setFocus(); + } +} + +void URLNavigator::updateHistoryElem() +{ + assert(m_historyIndex >= 0); + const KFileItem* item = m_dolphinView->currentFileItem(); + if (item != 0) { + m_history[m_historyIndex].setCurrentFileName(item->name()); + } + m_history[m_historyIndex].setContentsX(m_dolphinView->contentsX()); + m_history[m_historyIndex].setContentsY(m_dolphinView->contentsY()); +} + +void URLNavigator::updateContent() +{ + // delete all existing URL navigator buttons + Q3ValueList::const_iterator it = m_navButtons.constBegin(); + while (it != m_navButtons.constEnd()) { + (*it)->close(); + (*it)->deleteLater(); + ++it; + } + m_navButtons.clear(); + + m_bookmarkSelector->updateSelection(url()); + + QToolTip::remove(m_toggleButton); + QString path(url().pathOrUrl()); + const KAction* action = Dolphin::mainWin().actionCollection()->action("editable_location"); + // TODO: registry of default shortcuts + QString shortcut = action? action->shortcutText() : "Ctrl+L"; + if (m_toggleButton->isChecked()) { + delete m_protocols; m_protocols = 0; + delete m_protocolSeparator; m_protocolSeparator = 0; + delete m_host; m_host = 0; + + QToolTip::add(m_toggleButton, i18n("Browse (%1, Escape)").arg(shortcut)); + + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); + m_pathBox->show(); + m_pathBox->setUrl(url()); + } + else { + QToolTip::add(m_toggleButton, i18n("Edit location (%1)").arg(shortcut)); + + setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + m_pathBox->hide(); + QString dir_name; + + // get the data from the currently selected bookmark + KBookmark bookmark = m_bookmarkSelector->selectedBookmark(); + //int bookmarkIndex = m_bookmarkSelector->selectedIndex(); + + QString bookmarkPath; + if (bookmark.isNull()) { + // No bookmark is a part of the current URL. + // The following code tries to guess the bookmark + // path. E. g. "fish://root@192.168.0.2/var/lib" writes + // "fish://root@192.168.0.2" to 'bookmarkPath', which leads to the + // navigation indication 'Custom Path > var > lib". + int idx = path.find(QString("//")); + idx = path.find("/", (idx < 0) ? 0 : idx + 2); + bookmarkPath = (idx < 0) ? path : path.left(idx); + } + else { + bookmarkPath = bookmark.url().pathOrUrl(); + } + const uint len = bookmarkPath.length(); + + // calculate the start point for the URL navigator buttons by counting + // the slashs inside the bookmark URL + int slashCount = 0; + for (uint i = 0; i < len; ++i) { + if (bookmarkPath.at(i) == QChar('/')) { + ++slashCount; + } + } + if ((len > 0) && bookmarkPath.at(len - 1) == QChar('/')) { + assert(slashCount > 0); + --slashCount; + } + + if (!url().isLocalFile() && bookmark.isNull()) { + QString protocol = url().protocol(); + if (!m_protocols) { + m_protocols = new ProtocolCombo(protocol, this); + connect(m_protocols, SIGNAL(activated(const QString&)), + this, SLOT(slotProtocolChanged(const QString&))); + } + else { + m_protocols->setProtocol(protocol); + } + m_protocols->show(); + + if (KProtocolInfo::protocolClass(protocol) != ":local") + { + QString hostText = url().host(); + + if (!url().user().isEmpty()) + { + hostText = url().user() + "@" + hostText; + } + + if (!m_host) { + m_protocolSeparator = new QLabel("://", this); + m_host = new QLineEdit(hostText, this); + + connect(m_host, SIGNAL(lostFocus()), + this, SLOT(slotRemoteHostActivated())); + connect(m_host, SIGNAL(returnPressed()), + this, SLOT(slotRemoteHostActivated())); + } + else { + m_host->setText(hostText); + } + m_protocolSeparator->show(); + m_host->show(); + } + else { + delete m_protocolSeparator; m_protocolSeparator = 0; + delete m_host; m_host = 0; + } + } + else if (m_protocols) { + m_protocols->hide(); + + if (m_host) { + m_protocolSeparator->hide(); + m_host->hide(); + } + } + + // create URL navigator buttons + int idx = slashCount; + bool hasNext = true; + do { + dir_name = path.section('/', idx, idx); + const bool isFirstButton = (idx == slashCount); + hasNext = isFirstButton || !dir_name.isEmpty(); + if (hasNext) { + URLNavigatorButton* button = new URLNavigatorButton(idx, this); + if (isFirstButton) { + // the first URL navigator button should get the name of the + // bookmark instead of the directory name + QString text = bookmark.text(); + if (text.isEmpty()) { + if (url().isLocalFile()) + { + text = i18n("Custom Path"); + } + else + { + delete button; + ++idx; + continue; + } + } + button->setText(text); + } + button->show(); + m_navButtons.append(button); + ++idx; + } + } while (hasNext); + } +} + +#include "urlnavigator.moc" diff --git a/src/urlnavigator.h b/src/urlnavigator.h new file mode 100644 index 000000000..35ae5454a --- /dev/null +++ b/src/urlnavigator.h @@ -0,0 +1,233 @@ +/*************************************************************************** +* 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 URLNAVIGATOR_H +#define URLNAVIGATOR_H + +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include + +class QComboBox; +class QLabel; +class QLineEdit; +class Q3PopupMenu; +class QCheckBox; + +class KUrl; +class KFileItem; +class KUrlComboBox; + +class BookmarkSelector; +class DolphinView; +class ProtocolCombo; + +/** + * @brief Navigation bar which contains the current shown URL. + * + * The URL navigator offers two modes: + * - Editable: Represents the 'classic' mode, where the current URL + * is editable inside a line editor. + * - Non editable: The URL is represented by a number of buttons, where + * clicking on a button results in activating the URL + * the button represents. This mode also supports drag + * and drop of items. + * + * The mode can be changed by a toggle button located on the left side of + * the navigator. + * + * The URL navigator also remembers the URL history and allows to go + * back and forward within this history. + * + * @author Peter Penz +*/ + +typedef Q3ValueList UrlStack; + +class URLNavigator : public Q3HBox +{ + Q_OBJECT + +public: + /** + * @brief Represents the history element of an URL. + * + * A history element contains the URL, the name of the current file + * (the 'current file' is the file where the cursor is located) and + * the x- and y-position of the content. + */ + class HistoryElem { + public: + HistoryElem(); + HistoryElem(const KUrl& url); + ~HistoryElem(); // non virtual + + const KUrl& url() const { return m_url; } + + void setCurrentFileName(const QString& name) { m_currentFileName = name; } + const QString& currentFileName() const { return m_currentFileName; } + + void setContentsX(int x) { m_contentsX = x; } + int contentsX() const { return m_contentsX; } + + void setContentsY(int y) { m_contentsY = y; } + int contentsY() const { return m_contentsY; } + + private: + KUrl m_url; + QString m_currentFileName; + int m_contentsX; + int m_contentsY; + }; + + URLNavigator(const KUrl& url, DolphinView* dolphinView);; + virtual ~URLNavigator(); + + /** + * 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; + + /** Returns the portion of the current active URL up to the button at index. */ + KUrl url(int index) const; + + /** + * 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& history(int& index) const; + + /** + * 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(); + + /** + * @return True, if the URL is editable by the user within a line editor. + * If false is returned, each part of the URL is presented by a button + * for fast navigation. + */ + bool isURLEditable() const; + + /** + * Switches to the edit mode and assures that the keyboard focus + * is assigned. + */ + void editURL(bool editOrBrowse); //TODO: switch to an enum + + DolphinView* dolphinView() const; + +signals: + void urlChanged(const KUrl& url); + void historyChanged(); + +protected: + /** If the Escape key is pressed, the navigation bar should switch + to the browse mode. */ + virtual void keyReleaseEvent(QKeyEvent* event); + +private slots: + void slotReturnPressed(const QString& text); + void slotURLActivated(const KUrl& url); + void slotRemoteHostActivated(); + void slotProtocolChanged(const QString& protocol); + + void slotRequestActivation(); + void slotBookmarkActivated(int index); + + void slotRedirection(const KUrl&, const KUrl&); + + /** + * Stores the coordinates of the moved content into + * the current history element. Is usually triggered + * by the signal 'contentsMoved' emitted by DolphinView. + */ + void slotContentsMoved(int x, int y); + + /** + * Switches the navigation bar between the editable and noneditable + * state (see setURLEditable()) and is connected to the clicked signal + * of the navigation bar button. + */ + void slotClicked(); + +private: + int m_historyIndex; + DolphinView* m_dolphinView; + Q3ValueList m_history; + QCheckBox* m_toggleButton; + BookmarkSelector* m_bookmarkSelector; + KUrlComboBox* m_pathBox; + ProtocolCombo* m_protocols; + QLabel* m_protocolSeparator; + QLineEdit* m_host; + Q3ValueList m_navButtons; + //UrlStack m_urls; + + /** + * Allows to edit the URL of the navigation bar if \a editable + * is true. If \a editable is false, each part of + * the URL is presented by a button for a fast navigation. + */ + void setURLEditable(bool editable); + + /** + * Updates the history element with the current file item + * and the contents position. + */ + void updateHistoryElem(); + void updateContent(); +}; + +#endif diff --git a/src/urlnavigatorbutton.cpp b/src/urlnavigatorbutton.cpp new file mode 100644 index 000000000..cd13ca571 --- /dev/null +++ b/src/urlnavigatorbutton.cpp @@ -0,0 +1,387 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * + * Copyright (C) 2006 by Aaron J. Seigo () * + * * + * 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 "urlnavigatorbutton.h" +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "urlnavigator.h" +#include "dolphinview.h" +#include "dolphin.h" + +URLNavigatorButton::URLNavigatorButton(int index, URLNavigator* parent) : + URLButton(parent), + m_index(-1), + m_listJob(0) +{ + setAcceptDrops(true); + setMinimumWidth(arrowWidth()); + setIndex(index); + connect(this, SIGNAL(clicked()), this, SLOT(updateNavigatorURL())); + + m_popupDelay = new QTimer(this); + connect(m_popupDelay, SIGNAL(timeout()), this, SLOT(startListJob())); + connect(this, SIGNAL(pressed()), this, SLOT(startPopupDelay())); +} + +URLNavigatorButton::~URLNavigatorButton() +{ +} + +void URLNavigatorButton::setIndex(int index) +{ + m_index = index; + + if (m_index < 0) { + return; + } + + QString path(urlNavigator()->url().pathOrUrl()); + setText(path.section('/', index, index)); + + // Check whether the button indicates the full path of the URL. If + // this is the case, the button is marked as 'active'. + ++index; + QFont adjustedFont(font()); + if (path.section('/', index, index).isEmpty()) { + setDisplayHintEnabled(ActivatedHint, true); + adjustedFont.setBold(true); + } + else { + setDisplayHintEnabled(ActivatedHint, false); + adjustedFont.setBold(false); + } + + setFont(adjustedFont); + update(); +} + +int URLNavigatorButton::index() const +{ + return m_index; +} + +void URLNavigatorButton::drawButton(QPainter* painter) +{ + const int buttonWidth = width(); + const int buttonHeight = height(); + + QColor backgroundColor; + QColor foregroundColor; + const bool isHighlighted = isDisplayHintEnabled(EnteredHint) || + isDisplayHintEnabled(DraggedHint) || + isDisplayHintEnabled(PopupActiveHint); + 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); + } + } + + // draw button background + painter->setPen(Qt::NoPen); + painter->setBrush(backgroundColor); + painter->drawRect(0, 0, buttonWidth, buttonHeight); + + int textWidth = buttonWidth; + if (isDisplayHintEnabled(ActivatedHint) && isActive || isHighlighted) { + painter->setPen(foregroundColor); + } + else { + // dimm the foreground color by mixing it with the background + foregroundColor = mixColors(foregroundColor, backgroundColor); + painter->setPen(foregroundColor); + } + + if (!isDisplayHintEnabled(ActivatedHint)) { + // draw arrow + const int border = 2; // horizontal border + const int middleY = height() / 2; + const int width = arrowWidth(); + const int startX = (buttonWidth - width) - (2 * border); + const int startTopY = middleY - (width - 1); + const int startBottomY = middleY + (width - 1); + for (int i = 0; i < width; ++i) { + painter->drawLine(startX, startTopY + i, startX + i, startTopY + i); + painter->drawLine(startX, startBottomY - i, startX + i, startBottomY - i); + } + + textWidth = startX - border; + } + + const bool clipped = isTextClipped(); + const int align = clipped ? Qt::AlignVCenter : Qt::AlignCenter; + painter->drawText(QRect(0, 0, textWidth, buttonHeight), align, text()); + + if (clipped) { + // Blend the right area of the text with the background, as the + // text is clipped. + // TODO: use alpha blending in Qt4 instead of drawing the text that often + 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(textWidth - i, 0, 1, buttonHeight)); + painter->setPen(blendColor); + painter->drawText(QRect(0, 0, textWidth, buttonHeight), align, text()); + + blendColor.setRgb(blendColor.red() + redInc, + blendColor.green() + greenInc, + blendColor.blue() + blueInc); + } + } +} + +void URLNavigatorButton::enterEvent(QEvent* event) +{ + URLButton::enterEvent(event); + + // if the text is clipped due to a small window width, the text should + // be shown as tooltip + if (isTextClipped()) { + QToolTip::add(this, text()); + } +} + +void URLNavigatorButton::leaveEvent(QEvent* event) +{ + URLButton::leaveEvent(event); + QToolTip::remove(this); +} + +void URLNavigatorButton::dropEvent(QDropEvent* event) +{ + if (m_index < 0) { + return; + } + + KUrl::List urls; + /* KDE4-TODO: + if (KUrlDrag::decode(event, urls) && !urls.isEmpty()) { + setDisplayHintEnabled(DraggedHint, true); + + QString path(urlNavigator()->url().prettyURL()); + path = path.section('/', 0, m_index); + + Dolphin::mainWin().dropURLs(urls, KUrl(path)); + + setDisplayHintEnabled(DraggedHint, false); + update(); + }*/ +} + +void URLNavigatorButton::dragEnterEvent(QDragEnterEvent* event) +{ + /* KDE4-TODO: + event->accept(KUrlDrag::canDecode(event)); + + setDisplayHintEnabled(DraggedHint, true);*/ + update(); +} + +void URLNavigatorButton::dragLeaveEvent(QDragLeaveEvent* event) +{ + URLButton::dragLeaveEvent(event); + + setDisplayHintEnabled(DraggedHint, false); + update(); +} + + +void URLNavigatorButton::updateNavigatorURL() +{ + if (m_index < 0) { + return; + } + + URLNavigator* navigator = urlNavigator(); + assert(navigator != 0); + navigator->setURL(navigator->url(m_index)); +} + +void URLNavigatorButton::startPopupDelay() +{ + if (m_popupDelay->isActive() || m_listJob || m_index < 0) { + return; + } + + m_popupDelay->start(300, true); +} + +void URLNavigatorButton::stopPopupDelay() +{ + m_popupDelay->stop(); + if (m_listJob) { + m_listJob->kill(); + m_listJob = 0; + } +} + +void URLNavigatorButton::startListJob() +{ + if (m_listJob) { + return; + } + + KUrl url = urlNavigator()->url(m_index); + m_listJob = KIO::listDir(url, false, false); + m_subdirs.clear(); // just to be ++safe + + connect(m_listJob, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList &)), + this, SLOT(entriesList(KIO::Job*, const KIO::UDSEntryList&))); + connect(m_listJob, SIGNAL(result(KIO::Job*)), this, SLOT(listJobFinished(KIO::Job*))); +} + +void URLNavigatorButton::entriesList(KIO::Job* job, const KIO::UDSEntryList& entries) +{ + if (job != m_listJob) { + return; + } + + KIO::UDSEntryList::const_iterator it = entries.constBegin(); + KIO::UDSEntryList::const_iterator itEnd = entries.constEnd(); + while (it != itEnd) { + QString name; + bool isDir = false; + KIO::UDSEntry entry = *it; + + /* KDE3 reference: + KIO::UDSEntry::const_iterator atomIt = entry.constBegin(); + KIO::UDSEntry::const_iterator atomEndIt = entry.constEnd(); + + while (atomIt != atomEndIt) { + switch ((*atomIt).m_uds) { + case KIO::UDS_NAME: + name = (*atomIt).m_str; + break; + case KIO::UDS_FILE_TYPE: + isDir = S_ISDIR((*atomIt).m_long); + break; + default: + break; + } + ++atomIt; + } + if (isDir) { + m_subdirs.append(name); + } + */ + + if (entry.isDir()) { + m_subdirs.append(entry.stringValue(KIO::UDS_NAME)); + } + + ++it; + } + + m_subdirs.sort(); +} + +void URLNavigatorButton::listJobFinished(KIO::Job* job) +{ + if (job != m_listJob) { + return; + } + + if (job->error() || m_subdirs.isEmpty()) { + // clear listing + return; + } + + setDisplayHintEnabled(PopupActiveHint, true); + update(); // ensure the button is drawn highlighted + Q3PopupMenu* dirsMenu = new Q3PopupMenu(this); + //setPopup(dirsMenu); + QStringList::const_iterator it = m_subdirs.constBegin(); + QStringList::const_iterator itEnd = m_subdirs.constEnd(); + int i = 0; + while (it != itEnd) { + dirsMenu->insertItem(*it, i); + ++i; + ++it; + } + + int result = dirsMenu->exec(urlNavigator()->mapToGlobal(geometry().bottomLeft())); + + if (result != -1) { + KUrl url = urlNavigator()->url(m_index); + url.addPath(m_subdirs[result]); + urlNavigator()->setURL(url); + } + + m_listJob = 0; + m_subdirs.clear(); + delete dirsMenu; + setDisplayHintEnabled(PopupActiveHint, false); +} + +int URLNavigatorButton::arrowWidth() const +{ + int width = (height() / 2) - 7; + if (width < 4) { + width = 4; + } + return width; +} + +bool URLNavigatorButton::isTextClipped() const +{ + int availableWidth = width(); + if (!isDisplayHintEnabled(ActivatedHint)) { + availableWidth -= arrowWidth() + 1; + } + + QFontMetrics fontMetrics(font()); + return fontMetrics.width(text()) >= availableWidth; +} diff --git a/src/urlnavigatorbutton.h b/src/urlnavigatorbutton.h new file mode 100644 index 000000000..f7d2c547b --- /dev/null +++ b/src/urlnavigatorbutton.h @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * + * Copyright (C) 2006 by Aaron J. Seigo () * + * * + * 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 URLNAVIGATORBUTTON_H +#define URLNAVIGATORBUTTON_H + +#include +//Added by qt3to4: +#include +#include +#include +#include + +#include + +#include + +class KUrl; +class URLNavigator; +class QPainter; + +namespace KIO +{ + class Job; +} + +/** + * @brief Button of the URL navigator which contains one part of an URL. + * + * It is possible to drop a various number of items to an URL button. In this case + * a context menu is opened where the user must select whether he wants + * to copy, move or link the dropped items to the URL part indicated by + * the button. + */ +class URLNavigatorButton : public URLButton +{ + Q_OBJECT + +public: + URLNavigatorButton(int index, URLNavigator* parent = 0); + virtual ~URLNavigatorButton(); + void setIndex(int index); + int index() const; + +protected: + virtual void drawButton(QPainter* painter); + virtual void enterEvent(QEvent* event); + virtual void leaveEvent(QEvent* event); + virtual void dropEvent(QDropEvent* event); + virtual void dragEnterEvent(QDragEnterEvent* event); + virtual void dragLeaveEvent(QDragLeaveEvent* event); + +private slots: + void updateNavigatorURL(); + void startPopupDelay(); + void stopPopupDelay(); + void startListJob(); + void entriesList(KIO::Job* job, const KIO::UDSEntryList& entries); + void listJobFinished(KIO::Job* job); + +private: + int arrowWidth() const; + bool isTextClipped() const; + + int m_index; + QTimer* m_popupDelay; + KIO::Job* m_listJob; + QStringList m_subdirs; +}; + +#endif diff --git a/src/viewproperties.cpp b/src/viewproperties.cpp new file mode 100644 index 000000000..52129bd80 --- /dev/null +++ b/src/viewproperties.cpp @@ -0,0 +1,208 @@ +/*************************************************************************** + * 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 + +#include +#include +#include + +#include +#include +#include + +#include "viewproperties.h" + +#include "dolphinsettings.h" + +#define FILE_NAME "/.directory" + +ViewProperties::ViewProperties(KUrl url) : + m_changedProps(false), + m_autoSave(true), + m_subDirValidityHidden(false), + m_node(0) +{ + url.cleanPath(true); + m_filepath = url.path(); + + if ((m_filepath.length() < 1) || (m_filepath.at(0) != QChar('/'))) { + m_node = new ViewPropertySettings(); + return; + } + + // we try and save it to a file in the directory being viewed + // if the directory is not writable by the user or the directory is not local + // we store the properties information in a local file + QString rootDir("/"); // TODO: should this be set to the root of the bookmark, if any? + if (url.isLocalFile()) { + QFileInfo info(m_filepath); + + if (!info.isWritable()) { + QString basePath = KGlobal::instance()->instanceName(); + basePath.append("/view_properties/local"); + rootDir = locateLocal("data", basePath); + m_filepath = rootDir + m_filepath; + } + } + else { + QString basePath = KGlobal::instance()->instanceName(); + basePath.append("/view_properties/remote/").append(url.host()); + rootDir = locateLocal("data", basePath); + m_filepath = rootDir + m_filepath; + } + + m_node = new ViewPropertySettings(KSharedConfig::openConfig(m_filepath + FILE_NAME)); + + QDir dir(m_filepath); + const bool isValidForSubDirs = m_node->validForSubDirs(); + while ((dir.path() != rootDir) && dir.cdUp()) { + QString parentPath(dir.path() + FILE_NAME); + + if (!QFile::exists(parentPath)) + { + continue; + } + + ViewPropertySettings parentNode(KSharedConfig::openConfig(dir.path() + FILE_NAME)); + const bool inheritProps = parentNode.validForSubDirs() && + (parentNode.timestamp() > m_node->timestamp()); + + if (inheritProps) { + *m_node = parentNode; + break; + } + } + + if (isValidForSubDirs) { + m_subDirValidityHidden = true; + } +} + +ViewProperties::~ViewProperties() +{ + if (m_changedProps && m_autoSave) { + save(); + } + + delete m_node; +} + +void ViewProperties::setViewMode(DolphinView::Mode mode) +{ + if (m_node->viewMode() != mode) { + m_node->setViewMode(mode); + updateTimeStamp(); + } +} + +DolphinView::Mode ViewProperties::viewMode() const +{ + return static_cast(m_node->viewMode()); +} + +void ViewProperties::setShowHiddenFilesEnabled(bool show) +{ + if (m_node->showHiddenFiles() != show) { + m_node->setShowHiddenFiles(show); + updateTimeStamp(); + } +} + +bool ViewProperties::isShowHiddenFilesEnabled() const +{ + return m_node->showHiddenFiles(); +} + +void ViewProperties::setSorting(DolphinView::Sorting sorting) +{ + if (m_node->sorting() != sorting) { + m_node->setSorting(sorting); + updateTimeStamp(); + } +} + +DolphinView::Sorting ViewProperties::sorting() const +{ + return static_cast(m_node->sorting()); +} + +void ViewProperties::setSortOrder(Qt::SortOrder sortOrder) +{ + if (m_node->sortOrder() != sortOrder) { + m_node->setSortOrder(sortOrder); + updateTimeStamp(); + } +} + +Qt::SortOrder ViewProperties::sortOrder() const +{ + return static_cast(m_node->sortOrder()); +} + +void ViewProperties::setValidForSubDirs(bool valid) +{ + if (m_node->validForSubDirs() != valid) { + m_node->setValidForSubDirs(valid); + updateTimeStamp(); + } +} + +bool ViewProperties::isValidForSubDirs() const +{ + return m_node->validForSubDirs(); +} + +void ViewProperties::setAutoSaveEnabled(bool autoSave) +{ + m_autoSave = autoSave; +} + +bool ViewProperties::isAutoSaveEnabled() const +{ + return m_autoSave; +} + +void ViewProperties::updateTimeStamp() +{ + m_changedProps = true; + m_node->setTimestamp(QDateTime::currentDateTime()); +} + +void ViewProperties::save() +{ + KStandardDirs::makeDir(m_filepath); + m_node->writeConfig(); + m_changedProps = false; +} + +ViewProperties& ViewProperties::operator = (const ViewProperties& props) +{ + if (&props != this) { + m_changedProps = props.m_changedProps; + m_autoSave = props.m_autoSave; + m_subDirValidityHidden = props.m_subDirValidityHidden; + m_filepath = props.m_filepath; + m_node = new ViewPropertySettings(); + //*m_node = *(props.m_node); + } + + return *this; +} diff --git a/src/viewproperties.h b/src/viewproperties.h new file mode 100644 index 000000000..1524707f8 --- /dev/null +++ b/src/viewproperties.h @@ -0,0 +1,87 @@ +/*************************************************************************** + * 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 VIEWPROPERTIES_H +#define VIEWPROPERTIES_H + +#include +#include +#include + +#include "directoryviewpropertysettings.h" + +class QFile; + +/** + * @short Maintains the view properties like 'view mode' or 'show hidden files' for a directory. + * + * The view properties are automatically stored inside + * the directory as hidden file called '.dolphinview'. To read out the view properties + * just construct an instance by passing the URL of the directory: + * \code + * ViewProperties props(KUrl("/home/peter/Documents")); + * const DolphinView::Mode mode = props.viewMode(); + * const bool showHiddenFiles = props.isShowHiddenFilesEnabled(); + * \endcode + * When modifying a view property, the '.dolphinview' file is automatically updated + * inside the destructor. + * + * @author Peter Penz + */ +// TODO: provide detailed design description, as mapping the user model to +// the physical modal is not trivial. +class ViewProperties +{ +public: + ViewProperties(KUrl url); + virtual ~ViewProperties(); + + void setViewMode(DolphinView::Mode mode); + DolphinView::Mode viewMode() const; + + void setShowHiddenFilesEnabled(bool show); + bool isShowHiddenFilesEnabled() const; + + void setSorting(DolphinView::Sorting sorting); + DolphinView::Sorting sorting() const; + + void setSortOrder(Qt::SortOrder sortOrder); + Qt::SortOrder sortOrder() const; + + void setValidForSubDirs(bool valid); + bool isValidForSubDirs() const; + + void setAutoSaveEnabled(bool autoSave); + bool isAutoSaveEnabled() const; + + void updateTimeStamp(); + void save(); + + ViewProperties& operator = (const ViewProperties& props); + +private: + bool m_changedProps; + bool m_autoSave; + bool m_subDirValidityHidden; + QString m_filepath; + ViewPropertySettings* m_node; +}; + +#endif diff --git a/src/viewpropertiesdialog.cpp b/src/viewpropertiesdialog.cpp new file mode 100644 index 000000000..f72e6fc40 --- /dev/null +++ b/src/viewpropertiesdialog.cpp @@ -0,0 +1,236 @@ +/*************************************************************************** + * 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 "viewpropertiesdialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include + +#include "viewproperties.h" +#include "dolphinview.h" + +ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : + KDialog(dolphinView, static_cast(Ok /* KDE4-TODO: Apply | Cancel*/)), + m_isDirty(false), + m_dolphinView(dolphinView) +{ + assert(dolphinView != 0); + + const int margin = KDialog::marginHint(); + const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + + const KUrl& url = dolphinView->url(); + m_viewProps = new ViewProperties(url); + m_viewProps->setAutoSaveEnabled(false); + + Q3VBoxLayout* topLayout = new Q3VBoxLayout(mainWidget(), 0, spacingHint()); + + // create 'Properties' group containing view mode, sorting, sort order and show hidden files + Q3GroupBox* propsGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Properties"), mainWidget()); + propsGroup->setSizePolicy(sizePolicy); + propsGroup->setMargin(margin); + + new QLabel(i18n("View mode:"), propsGroup); + m_viewMode = new QComboBox(propsGroup); + m_viewMode->insertItem(SmallIcon("view_icon"), i18n("Icons")); + m_viewMode->insertItem(SmallIcon("view_text"), i18n("Details")); + m_viewMode->insertItem(SmallIcon("gvdirpart"), i18n("Previews")); + const int index = static_cast(m_viewProps->viewMode()); + m_viewMode->setCurrentItem(index); + + new QLabel(i18n("Sorting:"), propsGroup); + m_sorting = new QComboBox(propsGroup); + m_sorting->insertItem("By Name"); + m_sorting->insertItem("By Size"); + m_sorting->insertItem("By Date"); + int sortingIdx = 0; + switch (m_viewProps->sorting()) { + case DolphinView::SortByName: sortingIdx = 0; break; + case DolphinView::SortBySize: sortingIdx = 1; break; + case DolphinView::SortByDate: sortingIdx = 2; break; + default: break; + } + m_sorting->setCurrentItem(sortingIdx); + + new QLabel(i18n("Sort order:"), propsGroup); + m_sortOrder = new QComboBox(propsGroup); + m_sortOrder->insertItem(i18n("Ascending")); + m_sortOrder->insertItem(i18n("Descending")); + const int sortOrderIdx = (m_viewProps->sortOrder() == Qt::Ascending) ? 0 : 1; + m_sortOrder->setCurrentItem(sortOrderIdx); + + m_showHiddenFiles = new QCheckBox(i18n("Show hidden files"), propsGroup); + m_showHiddenFiles->setChecked(m_viewProps->isShowHiddenFilesEnabled()); + + // create 'Apply view properties to:' group + Q3ButtonGroup* buttonGroup = new Q3ButtonGroup(3, + Qt::Vertical, + i18n("Apply view properties to:"), + mainWidget()); + buttonGroup->setSizePolicy(sizePolicy); + buttonGroup->setMargin(margin); + + m_applyToCurrentFolder = new QRadioButton(i18n("Current folder"), buttonGroup); + buttonGroup->insert(m_applyToCurrentFolder); + + m_applyToSubFolders = new QRadioButton(i18n("Current folder including all sub folders"), buttonGroup); + buttonGroup->insert(m_applyToSubFolders); + + m_applyToAllFolders = new QRadioButton(i18n("All folders"), buttonGroup); + buttonGroup->insert(m_applyToAllFolders); + + if (m_viewProps->isValidForSubDirs()) { + m_applyToSubFolders->setChecked(true); + } + else { + m_applyToCurrentFolder->setChecked(true); + } + + topLayout->addWidget(propsGroup); + topLayout->addWidget(buttonGroup); + + connect(m_viewMode, SIGNAL(activated(int)), + this, SLOT(slotViewModeChanged(int))); + connect(m_sorting, SIGNAL(activated(int)), + this, SLOT(slotSortingChanged(int))); + connect(m_sortOrder, SIGNAL(activated(int)), + this, SLOT(slotSortOrderChanged(int))); + connect(m_showHiddenFiles, SIGNAL(clicked()), + this, SLOT(slotShowHiddenFilesChanged())); + connect(m_applyToCurrentFolder, SIGNAL(clicked()), + this, SLOT(slotApplyToCurrentFolder())); + connect(m_applyToSubFolders, SIGNAL(clicked()), + this, SLOT(slotApplyToSubFolders())); + connect(m_applyToAllFolders, SIGNAL(clicked()), + this, SLOT(slotApplyToAllFolders())); +} + +ViewPropertiesDialog::~ViewPropertiesDialog() +{ + m_isDirty = false; + delete m_viewProps; + m_viewProps = 0; +} + +void ViewPropertiesDialog::slotOk() +{ + applyViewProperties(); + // KDE4-TODO: KDialog::slotOk(); +} + +void ViewPropertiesDialog::slotApply() +{ + applyViewProperties(); + // KDE4-TODO: KDialog::slotApply(); +} + +void ViewPropertiesDialog::slotViewModeChanged(int index) +{ + assert((index >= 0) && (index <= 2)); + m_viewProps->setViewMode(static_cast(index)); + m_isDirty = true; +} + +void ViewPropertiesDialog::slotSortingChanged(int index) +{ + DolphinView::Sorting sorting = DolphinView::SortByName; + switch (index) { + case 1: sorting = DolphinView::SortBySize; break; + case 2: sorting = DolphinView::SortByDate; break; + default: break; + } + m_viewProps->setSorting(sorting); + m_isDirty = true; +} + +void ViewPropertiesDialog::slotSortOrderChanged(int index) +{ + Qt::SortOrder sortOrder = (index == 0) ? Qt::Ascending : Qt::Descending; + m_viewProps->setSortOrder(sortOrder); + m_isDirty = true; +} + +void ViewPropertiesDialog::slotShowHiddenFilesChanged() +{ + const bool show = m_showHiddenFiles->isChecked(); + m_viewProps->setShowHiddenFilesEnabled(show); + m_isDirty = true; +} + +void ViewPropertiesDialog::slotApplyToCurrentFolder() +{ + m_viewProps->setValidForSubDirs(false); + m_isDirty = true; +} + +void ViewPropertiesDialog::slotApplyToSubFolders() +{ + m_viewProps->setValidForSubDirs(true); + m_isDirty = true; +} + +void ViewPropertiesDialog::slotApplyToAllFolders() +{ + m_isDirty = true; +} + +void ViewPropertiesDialog::applyViewProperties() +{ + if (m_applyToAllFolders->isChecked()) { + if (m_isDirty) { + const QString text(i18n("The view properties of all folders will be replaced. Do you want to continue?")); + if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) { + return; + } + } + + ViewProperties props(QDir::homeDirPath()); + props.setViewMode(m_viewProps->viewMode()); + props.setSorting(m_viewProps->sorting()); + props.setSortOrder(m_viewProps->sortOrder()); + props.setShowHiddenFilesEnabled(m_viewProps->isShowHiddenFilesEnabled()); + props.setValidForSubDirs(true); + } + else if (m_applyToSubFolders->isChecked() && m_isDirty) { + const QString text(i18n("The view properties of all sub folders will be replaced. Do you want to continue?")); + if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) { + return; + } + } + + m_viewProps->save(); + m_dolphinView->setViewProperties(*m_viewProps); + m_isDirty = false; +} + +#include "viewpropertiesdialog.moc" diff --git a/src/viewpropertiesdialog.h b/src/viewpropertiesdialog.h new file mode 100644 index 000000000..103a93b57 --- /dev/null +++ b/src/viewpropertiesdialog.h @@ -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 VIEWPROPERTIESDIALOG_H +#define VIEWPROPERTIESDIALOG_H + +#include + +class QCheckBox; +class Q3ButtonGroup; +class QComboBox; +class QRadioButton; +class ViewProperties; +class DolphinView; + +/** + * @brief Dialog for changing the current view properties of a directory. + * + * It is possible to specify the view mode and whether hidden files + * should be shown. The properties can be assigned to the current folder, + * recursively to all sub folders or to all folders. + * + * @author Peter Penz + */ +class ViewPropertiesDialog : public KDialog +{ + Q_OBJECT + +public: + ViewPropertiesDialog(DolphinView* dolphinView); + virtual ~ViewPropertiesDialog(); + +protected slots: + virtual void slotOk(); + virtual void slotApply(); + +private slots: + void slotViewModeChanged(int index); + void slotSortingChanged(int index); + void slotSortOrderChanged(int index); + void slotShowHiddenFilesChanged(); + void slotApplyToCurrentFolder(); + void slotApplyToSubFolders(); + void slotApplyToAllFolders(); + +private: + bool m_isDirty; + DolphinView* m_dolphinView; + ViewProperties* m_viewProps; + + QComboBox* m_viewMode; + QComboBox* m_sorting; + QComboBox* m_sortOrder; + QCheckBox* m_showHiddenFiles; + QRadioButton* m_applyToCurrentFolder; + QRadioButton* m_applyToSubFolders; + QRadioButton* m_applyToAllFolders; + + void applyViewProperties(); +}; + +#endif diff --git a/src/viewsettingspage.cpp b/src/viewsettingspage.cpp new file mode 100644 index 000000000..2ad44d103 --- /dev/null +++ b/src/viewsettingspage.cpp @@ -0,0 +1,68 @@ +/*************************************************************************** + * 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 "viewsettingspage.h" +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include "iconsviewsettingspage.h" +#include "detailsviewsettingspage.h" + +ViewSettingsPage::ViewSettingsPage(QWidget *parent) : + SettingsPageBase(parent), + m_iconsPage(0), + m_detailsPage(0), + m_previewsPage(0) +{ + Q3VBoxLayout* topLayout = new Q3VBoxLayout(parent, 0, KDialog::spacingHint()); + + QTabWidget* tabWidget = new QTabWidget(parent); + + // initialize 'Icons' tab + m_iconsPage = new IconsViewSettingsPage(DolphinIconsView::Icons, tabWidget); + tabWidget->addTab(m_iconsPage, SmallIcon("view_icon"), i18n("Icons")); + + // initialize 'Details' tab + m_detailsPage = new DetailsViewSettingsPage(tabWidget); + tabWidget->addTab(m_detailsPage, SmallIcon("view_text"), i18n("Details")); + + // initialize 'Previews' tab + m_previewsPage = new IconsViewSettingsPage(DolphinIconsView::Previews, tabWidget); + tabWidget->addTab(m_previewsPage, SmallIcon("gvdirpart"), i18n("Previews")); + + topLayout->addWidget(tabWidget, 0, 0 ); +} + +ViewSettingsPage::~ViewSettingsPage() +{ +} + +void ViewSettingsPage::applySettings() +{ + m_iconsPage->applySettings(); + m_detailsPage->applySettings(); + m_previewsPage->applySettings(); +} + +#include "viewsettingspage.moc" diff --git a/src/viewsettingspage.h b/src/viewsettingspage.h new file mode 100644 index 000000000..786abf0b1 --- /dev/null +++ b/src/viewsettingspage.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * 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 VIEWSETTINGSPAGE_H +#define VIEWSETTINGSPAGE_H + +#include +#include + +class IconsViewSettingsPage; +class DetailsViewSettingsPage; + +/** + * @brief Page for the 'View' settings of the Dolphin settings dialog. + * + * The views settings allow to set the properties for the icons mode, + * the details mode and the previews mode. + * + * @author Peter Penz + */ +class ViewSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + ViewSettingsPage(QWidget* parent); + + virtual ~ViewSettingsPage(); + + /** @see SettingsPageBase::applySettings */ + virtual void applySettings(); + +private: + IconsViewSettingsPage* m_iconsPage; + DetailsViewSettingsPage* m_detailsPage; + IconsViewSettingsPage* m_previewsPage; +}; + +#endif -- 2.47.3