summaryrefslogtreecommitdiffstats
path: root/konq-plugins/sidebar/metabar
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /konq-plugins/sidebar/metabar
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/sidebar/metabar')
-rw-r--r--konq-plugins/sidebar/metabar/AUTHORS1
-rw-r--r--konq-plugins/sidebar/metabar/COPYING340
-rw-r--r--konq-plugins/sidebar/metabar/ChangeLog0
-rw-r--r--konq-plugins/sidebar/metabar/Doxyfile275
-rw-r--r--konq-plugins/sidebar/metabar/INSTALL167
-rw-r--r--konq-plugins/sidebar/metabar/Makefile.am1
-rw-r--r--konq-plugins/sidebar/metabar/NEWS0
-rw-r--r--konq-plugins/sidebar/metabar/README0
-rw-r--r--konq-plugins/sidebar/metabar/TODO0
-rw-r--r--konq-plugins/sidebar/metabar/config.h.in244
-rw-r--r--konq-plugins/sidebar/metabar/configure.in.in5
-rw-r--r--konq-plugins/sidebar/metabar/metabar.kdevelop213
-rw-r--r--konq-plugins/sidebar/metabar/metabar.kdevses47
-rw-r--r--konq-plugins/sidebar/metabar/src/Makefile.am28
-rw-r--r--konq-plugins/sidebar/metabar/src/configdialog.cpp611
-rw-r--r--konq-plugins/sidebar/metabar/src/configdialog.h114
-rw-r--r--konq-plugins/sidebar/metabar/src/default.css64
-rw-r--r--konq-plugins/sidebar/metabar/src/defaultplugin.cpp458
-rw-r--r--konq-plugins/sidebar/metabar/src/defaultplugin.h64
-rw-r--r--konq-plugins/sidebar/metabar/src/hi128-app-metabar.pngbin0 -> 11139 bytes
-rw-r--r--konq-plugins/sidebar/metabar/src/hi16-app-metabar.pngbin0 -> 735 bytes
-rw-r--r--konq-plugins/sidebar/metabar/src/hi32-app-metabar.pngbin0 -> 1710 bytes
-rw-r--r--konq-plugins/sidebar/metabar/src/hi48-app-metabar.pngbin0 -> 2912 bytes
-rw-r--r--konq-plugins/sidebar/metabar/src/hi64-app-metabar.pngbin0 -> 4318 bytes
-rw-r--r--konq-plugins/sidebar/metabar/src/hisc-app-metabar.svgzbin0 -> 5341 bytes
-rw-r--r--konq-plugins/sidebar/metabar/src/httpplugin.cpp119
-rw-r--r--konq-plugins/sidebar/metabar/src/httpplugin.h51
-rw-r--r--konq-plugins/sidebar/metabar/src/iconsrc4
-rw-r--r--konq-plugins/sidebar/metabar/src/layout.html48
-rw-r--r--konq-plugins/sidebar/metabar/src/metabar.cpp59
-rw-r--r--konq-plugins/sidebar/metabar/src/metabar.desktop81
-rw-r--r--konq-plugins/sidebar/metabar/src/metabar.h32
-rw-r--r--konq-plugins/sidebar/metabar/src/metabar_add.desktop70
-rw-r--r--konq-plugins/sidebar/metabar/src/metabarfunctions.cpp242
-rw-r--r--konq-plugins/sidebar/metabar/src/metabarfunctions.h59
-rw-r--r--konq-plugins/sidebar/metabar/src/metabarwidget.cpp592
-rw-r--r--konq-plugins/sidebar/metabar/src/metabarwidget.h88
-rw-r--r--konq-plugins/sidebar/metabar/src/protocolplugin.cpp157
-rw-r--r--konq-plugins/sidebar/metabar/src/protocolplugin.h60
-rw-r--r--konq-plugins/sidebar/metabar/src/remoteplugin.cpp52
-rw-r--r--konq-plugins/sidebar/metabar/src/remoteplugin.h37
-rw-r--r--konq-plugins/sidebar/metabar/src/serviceloader.cpp213
-rw-r--r--konq-plugins/sidebar/metabar/src/serviceloader.h59
-rw-r--r--konq-plugins/sidebar/metabar/src/settingsplugin.cpp201
-rw-r--r--konq-plugins/sidebar/metabar/src/settingsplugin.h56
-rw-r--r--konq-plugins/sidebar/metabar/stamp-h.in0
46 files changed, 4912 insertions, 0 deletions
diff --git a/konq-plugins/sidebar/metabar/AUTHORS b/konq-plugins/sidebar/metabar/AUTHORS
new file mode 100644
index 0000000..01255ff
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/AUTHORS
@@ -0,0 +1 @@
+Florian Roth <florian@synatic.net>
diff --git a/konq-plugins/sidebar/metabar/COPYING b/konq-plugins/sidebar/metabar/COPYING
new file mode 100644
index 0000000..5b6e7c6
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 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
+
+
+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) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/konq-plugins/sidebar/metabar/ChangeLog b/konq-plugins/sidebar/metabar/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/ChangeLog
diff --git a/konq-plugins/sidebar/metabar/Doxyfile b/konq-plugins/sidebar/metabar/Doxyfile
new file mode 100644
index 0000000..323c79e
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/Doxyfile
@@ -0,0 +1,275 @@
+# Doxyfile 1.4.1-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = metabar.kdevelop
+PROJECT_NUMBER = 0.1
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = /home/florian/metabar_widget/debug/src/
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = YES
+FILE_VERSION_FILTER =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = /home/florian/metabar
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.C \
+ *.CC \
+ *.C++ \
+ *.II \
+ *.I++ \
+ *.H \
+ *.HH \
+ *.H++ \
+ *.CS \
+ *.PHP \
+ *.PHP3 \
+ *.M \
+ *.MM \
+ *.C \
+ *.H \
+ *.tlh \
+ *.diff \
+ *.patch \
+ *.moc \
+ *.xpm \
+ *.dox
+RECURSIVE = yes
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS = *
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = YES
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = yes
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE = metabar.tag
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 1000
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/konq-plugins/sidebar/metabar/INSTALL b/konq-plugins/sidebar/metabar/INSTALL
new file mode 100644
index 0000000..02a4a07
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/INSTALL
@@ -0,0 +1,167 @@
+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. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 4. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'.
+
+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/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' 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/konq-plugins/sidebar/metabar/Makefile.am b/konq-plugins/sidebar/metabar/Makefile.am
new file mode 100644
index 0000000..af437a6
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/konq-plugins/sidebar/metabar/NEWS b/konq-plugins/sidebar/metabar/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/NEWS
diff --git a/konq-plugins/sidebar/metabar/README b/konq-plugins/sidebar/metabar/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/README
diff --git a/konq-plugins/sidebar/metabar/TODO b/konq-plugins/sidebar/metabar/TODO
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/TODO
diff --git a/konq-plugins/sidebar/metabar/config.h.in b/konq-plugins/sidebar/metabar/config.h.in
new file mode 100644
index 0000000..978129e
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/config.h.in
@@ -0,0 +1,244 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
+#undef HAVE_CARBON_CARBON_H
+
+/* Define if you have the CoreAudio API */
+#undef HAVE_COREAUDIO
+
+/* Define to 1 if you have the <crt_externs.h> header file. */
+#undef HAVE_CRT_EXTERNS_H
+
+/* Defines if your system has the crypt function */
+#undef HAVE_CRYPT
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have libjpeg */
+#undef HAVE_LIBJPEG
+
+/* Define if you have libpng */
+#undef HAVE_LIBPNG
+
+/* Define if you have a working libpthread (will enable threaded code) */
+#undef HAVE_LIBPTHREAD
+
+/* Define if you have libz */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if your system needs _NSGetEnviron to set up the environment */
+#undef HAVE_NSGETENVIRON
+
+/* Define if you have res_init */
+#undef HAVE_RES_INIT
+
+/* Define if you have the res_init prototype */
+#undef HAVE_RES_INIT_PROTO
+
+/* Define if you have a STL implementation by SGI */
+#undef HAVE_SGI_STL
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have strlcat */
+#undef HAVE_STRLCAT
+
+/* Define if you have the strlcat prototype */
+#undef HAVE_STRLCAT_PROTO
+
+/* Define if you have strlcpy */
+#undef HAVE_STRLCPY
+
+/* Define if you have the strlcpy prototype */
+#undef HAVE_STRLCPY_PROTO
+
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+#undef HAVE_SYS_BITYPES_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Suffix for lib directories */
+#undef KDELIBSUFF
+
+/* Define a safe value for MAXPATHLEN */
+#undef KDEMAXPATHLEN
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of a `char *', as computed by sizeof. */
+#undef SIZEOF_CHAR_P
+
+/* The size of a `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of a `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of a `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* The size of a `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Defined if compiling without arts */
+#undef WITHOUT_ARTS
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+/*
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
+ * headers and I'm too lazy to write a configure test as long as only
+ * unixware is related
+ */
+#ifdef _UNIXWARE
+#define HAVE_BOOLEAN
+#endif
+
+
+
+/*
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
+ * that defines bzero.
+ */
+
+#if defined(_AIX)
+#include <strings.h>
+#endif
+
+
+
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+# include <sys/time.h>
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+
+
+
+#if !defined(HAVE_RES_INIT_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+int res_init(void);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
+#if !defined(HAVE_STRLCAT_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+unsigned long strlcat(char*, const char*, unsigned long);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
+#if !defined(HAVE_STRLCPY_PROTO)
+#ifdef __cplusplus
+extern "C" {
+#endif
+unsigned long strlcpy(char*, const char*, unsigned long);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
+/*
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
+ */
+
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
+#if __STDC__
+#include <stdarg.h>
+#include <stdlib.h>
+#else
+#include <varargs.h>
+#endif
+#ifdef __cplusplus
+extern "C"
+#endif
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
+#ifdef __cplusplus
+extern "C"
+#endif
+int snprintf(char *str, size_t n, char const *fmt, ...);
+#endif
+
+
+
+#if defined(__SVR4) && !defined(__svr4__)
+#define __svr4__ 1
+#endif
+
+
+/* type to use in place of socklen_t if not defined */
+#undef kde_socklen_t
+
+/* type to use in place of socklen_t if not defined (deprecated, use
+ kde_socklen_t) */
+#undef ksize_t
diff --git a/konq-plugins/sidebar/metabar/configure.in.in b/konq-plugins/sidebar/metabar/configure.in.in
new file mode 100644
index 0000000..d2a3d40
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/configure.in.in
@@ -0,0 +1,5 @@
+#MIN_CONFIG(3.2.0)
+
+AM_INIT_AUTOMAKE(metabar, 0.1)
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
diff --git a/konq-plugins/sidebar/metabar/metabar.kdevelop b/konq-plugins/sidebar/metabar/metabar.kdevelop
new file mode 100644
index 0000000..e87e8d9
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/metabar.kdevelop
@@ -0,0 +1,213 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Florian Roth</author>
+ <email>florian@synatic.net</email>
+ <version>0.1</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>Kicker</keyword>
+ </keywords>
+ <ignoreparts/>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <versioncontrol>kdevsubversion</versioncontrol>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/konqsidebar_metabar.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full --prefix=`kde-config --prefix`</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ <envvars/>
+ <topsourcedir/>
+ <cppflags/>
+ <ldflags/>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
+ <cflags/>
+ <f77flags/>
+ </debug>
+ </configurations>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <prio>0</prio>
+ </make>
+ <run>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <mainprogram/>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <showvcsfields>false</showvcsfields>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen-Dokumentation</docsystem>
+ <docurl>sidebar.tag</docurl>
+ <usermanualurl/>
+ </projectdoc>
+ </kdevdocumentation>
+ <substmap>
+ <APPNAME>sidebar</APPNAME>
+ <APPNAMELC>sidebar</APPNAMELC>
+ <APPNAMESC>Sidebar</APPNAMESC>
+ <APPNAMEUC>SIDEBAR</APPNAMEUC>
+ <AUTHOR>Florian Roth</AUTHOR>
+ <EMAIL>florian@synatic.net</EMAIL>
+ <LICENSE>GPL</LICENSE>
+ <LICENSEFILE>COPYING</LICENSEFILE>
+ <VERSION>0.1</VERSION>
+ <YEAR>2005</YEAR>
+ <dest>/home/florian/sidebar</dest>
+ </substmap>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevcppsupport>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <creategettersetter>
+ <prefixGet/>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <references/>
+ <designerintegration>
+ <qtdesigner>
+ <implementation class="ThemeEditor" path="src/editor/themeeditor.ui" implementationpath="src/editor/themeeditor.h" />
+ <implementation class="ThemeEditor" path="src/editor/themeeditorui.ui" implementationpath="src/editor/themeeditor.h" />
+ </qtdesigner>
+ </designerintegration>
+ </kdevcppsupport>
+ <ctagspart>
+ <customArguments/>
+ <customTagfilePath/>
+ </ctagspart>
+</kdevelop>
diff --git a/konq-plugins/sidebar/metabar/metabar.kdevses b/konq-plugins/sidebar/metabar/metabar.kdevses
new file mode 100644
index 0000000..f28c20e
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/metabar.kdevses
@@ -0,0 +1,47 @@
+<?xml version = '1.0' encoding = 'UTF-8'?>
+<!DOCTYPE KDevPrjSession>
+<KDevPrjSession>
+ <DocsAndViews NumberOfDocuments="8" >
+ <Doc0 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/metabarwidget.cpp" >
+ <View0 Type="Source" />
+ </Doc0>
+ <Doc1 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/metabarwidget.h" >
+ <View0 line="84" Type="Source" />
+ </Doc1>
+ <Doc2 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/configdialog.cpp" >
+ <View0 line="109" Type="Source" />
+ </Doc2>
+ <Doc3 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/configdialog.h" >
+ <View0 line="69" Type="Source" />
+ </Doc3>
+ <Doc4 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/protocolplugin.cpp" >
+ <View0 line="69" Type="Source" />
+ </Doc4>
+ <Doc5 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/defaultplugin.cpp" >
+ <View0 line="343" Type="Source" />
+ </Doc5>
+ <Doc6 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/httpplugin.cpp" >
+ <View0 line="76" Type="Source" />
+ </Doc6>
+ <Doc7 NumberOfViews="1" URL="file:///home/florian/metabar/metabar/src/httpplugin.h" >
+ <View0 line="22" Type="Source" />
+ </Doc7>
+ </DocsAndViews>
+ <pluginList>
+ <kdevdebugger>
+ <breakpointList/>
+ </kdevdebugger>
+ <kdevbookmarks>
+ <bookmarks/>
+ </kdevbookmarks>
+ <kdevsubversion>
+ <subversion recurseresolve="1" recurserelocate="1" recursemerge="1" recursecommit="1" base="" recursepropget="1" recurseswitch="1" recurseupdate="1" recursepropset="1" recursediff="1" recurserevert="1" forcemove="1" recursecheckout="1" forceremove="1" recurseadd="1" recurseproplist="1" forcemerge="1" />
+ </kdevsubversion>
+ <kdevvalgrind>
+ <executable path="" params="" />
+ <valgrind path="" params="" />
+ <calltree path="calltree" params="" />
+ <kcachegrind path="/usr/kde/3.4/bin/kcachegrind" />
+ </kdevvalgrind>
+ </pluginList>
+</KDevPrjSession>
diff --git a/konq-plugins/sidebar/metabar/src/Makefile.am b/konq-plugins/sidebar/metabar/src/Makefile.am
new file mode 100644
index 0000000..cd18deb
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/Makefile.am
@@ -0,0 +1,28 @@
+INCLUDES = $(all_includes) -I$(kde_includes)/dom
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = konqsidebar_metabar.la
+
+KDE_ICON = AUTO
+
+konqsidebar_metabar_la_SOURCES = metabar.cpp metabarwidget.cpp configdialog.cpp \
+ serviceloader.cpp defaultplugin.cpp protocolplugin.cpp settingsplugin.cpp \
+ remoteplugin.cpp httpplugin.cpp metabarfunctions.cpp
+konqsidebar_metabar_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) -lkonqsidebarplugin
+konqsidebar_metabar_la_LIBADD = $(LIB_KIO) $(LIB_KHTML) $(LIB_KPARTS)
+
+metabar_entrydir = $(kde_datadir)/konqsidebartng/entries
+metabar_entry_DATA = metabar.desktop
+metabar_adddir = $(kde_datadir)/konqsidebartng/add
+metabar_add_DATA = metabar_add.desktop
+metabar_datadir = $(kde_datadir)/metabar
+metabar_data_DATA = iconsrc
+metabar_themedir = $(kde_datadir)/metabar/themes/default
+metabar_theme_DATA = default.css layout.html
+
+noinst_HEADERS = metabarwidget.h protocolplugin.h defaultplugin.h \
+ settingsplugin.h remoteplugin.h httpplugin.h metabarfunctions.h
+
+messages:
+ $(XGETTEXT) *.cpp *.h -o $(podir)/konqsidebar_metabar.pot
+
diff --git a/konq-plugins/sidebar/metabar/src/configdialog.cpp b/konq-plugins/sidebar/metabar/src/configdialog.cpp
new file mode 100644
index 0000000..a6ee429
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/configdialog.cpp
@@ -0,0 +1,611 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include <qtabwidget.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qmap.h>
+#include <qcstring.h>
+#include <qdatastream.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kicondialog.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+#include <ktar.h>
+#include <karchive.h>
+#include <dcopref.h>
+#include <dcopclient.h>
+
+#include "configdialog.h"
+
+LinkEntry::LinkEntry(QString name, QString url, QString icon){
+ LinkEntry::name = name;
+ LinkEntry::url = url;
+ LinkEntry::icon = icon;
+}
+
+ActionListItem::ActionListItem(QListBox *listbox, const QString &action, const QString &text, const QPixmap &pixmap) : QListBoxPixmap(listbox, pixmap)
+{
+ setAction(action);
+ setText(text);
+}
+
+ConfigDialog::ConfigDialog(QWidget *parent, const char *name) : QDialog(parent, name)
+{
+ topWidgetName = parent->topLevelWidget()->name();
+ config = new KConfig("metabarrc");
+ iconConfig = new KConfig(locate("data", "metabar/iconsrc"));
+
+ setCaption(i18n("Configuration - Metabar"));
+ setIcon(SmallIcon("metabar"));
+
+ ok = new KPushButton(KStdGuiItem::ok(), this);
+ connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
+
+ cancel = new KPushButton(KStdGuiItem::cancel(), this);
+ connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
+
+ QTabWidget *tab = new QTabWidget(this);
+
+ //general page
+ config->setGroup("General");
+ QWidget *general = new QWidget;
+
+ QGroupBox *entries_group = new QGroupBox(2, Qt::Horizontal, i18n("Items"), general);
+ entries_group->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+
+ QLabel *entries_label = new QLabel(i18n("Open with:"), entries_group);
+ max_entries = new KIntSpinBox(entries_group);
+ max_entries->setMinValue(1);
+ max_entries->setMaxValue(99);
+ max_entries->setLineStep(1);
+ max_entries->setValue(config->readNumEntry("MaxEntries", 3));
+ entries_label->setBuddy(max_entries);
+
+ QLabel *actions_label = new QLabel(i18n("Actions:"), entries_group);
+ max_actions = new KIntSpinBox(entries_group);
+ max_actions->setMinValue(1);
+ max_actions->setMaxValue(99);
+ max_actions->setLineStep(1);
+ max_actions->setValue(config->readNumEntry("MaxActions", 3));
+ actions_label->setBuddy(max_actions);
+
+
+ QGroupBox *appearance_group = new QGroupBox(1, Qt::Horizontal, i18n("Appearance"), general);
+ appearance_group->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+
+ animate = new QCheckBox(i18n("Animate resize"), appearance_group);
+ animate->setChecked(config->readBoolEntry("AnimateResize", false));
+
+ servicemenus = new QCheckBox(i18n("Show service menus"), appearance_group);
+ servicemenus->setChecked(config->readBoolEntry("ShowServicemenus", true));
+
+ showframe = new QCheckBox(i18n("Show frame"), appearance_group);
+ showframe->setChecked(config->readBoolEntry("ShowFrame", true));
+
+ QGroupBox *theme_group = new QGroupBox(2, Qt::Horizontal, i18n("Themes"), general);
+ theme_group->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+
+ themes = new KComboBox(theme_group);
+ themes->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+
+ install_theme = new KPushButton(i18n("Install New Theme..."), theme_group);
+ install_theme->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+ connect(install_theme, SIGNAL(clicked()), this, SLOT(installTheme()));
+
+ loadThemes();
+
+ //link page
+ QWidget *links = new QWidget;
+
+ link_create = new KPushButton(i18n("New..."), links);
+ connect(link_create, SIGNAL(clicked()), this, SLOT(createLink()));
+
+ link_delete = new KPushButton(i18n("Delete"), links);
+ connect(link_delete, SIGNAL(clicked()), this, SLOT(deleteLink()));
+
+ link_edit = new KPushButton(i18n("Edit..."), links);
+ connect(link_edit, SIGNAL(clicked()), this, SLOT(editLink()));
+
+ link_up = new KPushButton(links);
+ link_up->setIconSet(SmallIconSet("up"));
+ link_up->setEnabled(false);
+ connect(link_up, SIGNAL(clicked()), this, SLOT(moveLinkUp()));
+
+ link_down = new KPushButton(links);
+ link_down->setIconSet(SmallIconSet("down"));
+ link_down->setEnabled(false);
+ connect(link_down, SIGNAL(clicked()), this, SLOT(moveLinkDown()));
+
+ link_list = new KListView(links);
+ link_list->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ link_list->setSorting(-1);
+ link_list->setItemsMovable(TRUE);
+ link_list->addColumn(i18n("Name"));
+ link_list->addColumn(i18n("Address"));
+ connect(link_list, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(editLink(QListViewItem*)));
+ connect(link_list, SIGNAL(selectionChanged()), SLOT(updateArrows()));
+
+ QWidget *actionPage = new QWidget;
+
+ actionSelector = new KActionSelector(actionPage);
+ loadAvailableActions();
+
+ tab->addTab(general, i18n("General"));
+ tab->addTab(actionPage, i18n("Actions"));
+ tab->addTab(links, i18n("Links"));
+
+ //layout
+ QGridLayout *general_layout = new QGridLayout(general, 2, 2, 5, 5);
+ general_layout->addWidget(entries_group, 0, 0);
+ general_layout->addWidget(appearance_group, 0, 1);
+ general_layout->addMultiCellWidget(theme_group, 1, 1, 0, 1);
+ general_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding), 2, 0);
+ //general_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding), 0, 2);
+
+ QVBoxLayout *link_button_layout = new QVBoxLayout(0, 0, 5);
+ link_button_layout->addWidget(link_create);
+ link_button_layout->addWidget(link_edit);
+ link_button_layout->addWidget(link_delete);
+ link_button_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ link_button_layout->addWidget(link_up);
+ link_button_layout->addWidget(link_down);
+
+ QHBoxLayout *link_layout = new QHBoxLayout(links, 5, 5);
+ link_layout->addWidget(link_list);
+ link_layout->addLayout(link_button_layout);
+
+ QHBoxLayout *action_layout = new QHBoxLayout(actionPage, 5, 5);
+ action_layout->addWidget(actionSelector);
+
+ QHBoxLayout *bottom_layout = new QHBoxLayout(0, 5, 5);
+ bottom_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ bottom_layout->addWidget(ok);
+ bottom_layout->addWidget(cancel);
+
+ QVBoxLayout *main_layout = new QVBoxLayout(this, 5, 5);
+ main_layout->addWidget(tab);
+ main_layout->addLayout(bottom_layout);
+
+ //load config
+ config->setGroup("General");
+
+ QStringList _links = config->readListEntry("Links");
+
+ for(QStringList::Iterator it = _links.begin(); it != _links.end(); ++it){
+ config->setGroup("Link_" + (*it));
+
+ QString icon_str = config->readEntry("Icon", "folder");
+ QPixmap icon(icon_str);
+ if(icon.isNull()){
+ icon = SmallIcon(icon_str);
+ }
+
+ QListViewItem *item = new QListViewItem(link_list, link_list->lastItem(), config->readEntry("Name"), config->readEntry("URL"));
+ item->setPixmap(0, icon);
+
+ linkList.insert(item, new LinkEntry(config->readEntry("Name"), config->readEntry("URL"), icon_str));
+ }
+
+ config->setGroup("General");
+ QStringList actions = config->readListEntry("Actions");
+ for(QStringList::Iterator it = actions.begin(); it != actions.end(); ++it){
+ if((*it).startsWith("metabar/")){
+ if((*it).right((*it).length() - 8) == "share"){
+ QString text = i18n("Share");
+
+ ActionListItem *item = new ActionListItem(actionSelector->selectedListBox(), *it, text, SmallIcon("network"));
+
+ QListBoxItem *avItem = actionSelector->availableListBox()->findItem(text, Qt::ExactMatch);
+ if(avItem){
+ delete avItem;
+ }
+ }
+ }
+ else{
+ DCOPRef action(kapp->dcopClient()->appId(), QCString(topWidgetName).append("/action/").append((*it).utf8()));
+
+ QString text = action.call("plainText()");
+ QString icon = iconConfig->readEntry(*it, action.call("icon()"));
+
+ ActionListItem *item = new ActionListItem(actionSelector->selectedListBox(), QString(*it), text, SmallIcon(icon));
+
+ QListBoxItem *avItem = actionSelector->availableListBox()->findItem(text, Qt::ExactMatch);
+ if(avItem){
+ delete avItem;
+ }
+ }
+ }
+
+ resize(400, 300);
+}
+
+ConfigDialog::~ConfigDialog()
+{
+ delete config;
+ delete iconConfig;
+}
+
+void ConfigDialog::accept()
+{
+ QStringList groups = config->groupList();
+ for(QStringList::Iterator it = groups.begin(); it != groups.end(); ++it){
+ if((*it).startsWith("Link_")){
+ config->deleteGroup(*it);
+ }
+ }
+
+ QStringList links;
+ QPtrDictIterator<LinkEntry> it(linkList);
+
+ QListViewItem *item = link_list->firstChild();
+ while(item) {
+ LinkEntry *entry = linkList[item];
+ config->setGroup("Link_" + entry->name);
+ config->writeEntry("Name", entry->name);
+ config->writeEntry("URL", entry->url);
+ config->writeEntry("Icon", entry->icon);
+
+ links.append(entry->name);
+
+ item = item->nextSibling();
+ }
+
+ QStringList actions;
+ QListBox *box = actionSelector->selectedListBox();
+
+ for(int i = 0; i < box->numRows(); i++){
+ ActionListItem *item = static_cast<ActionListItem*>(box->item(i));
+ if(item){
+ actions.append(item->action());
+ }
+ }
+
+ config->setGroup("General");
+ config->writeEntry("Links", links);
+ config->writeEntry("Actions", actions);
+ config->writeEntry("Theme", themes->currentText());
+
+ config->writeEntry("MaxEntries", max_entries->value());
+ config->writeEntry("MaxActions", max_actions->value());
+
+ config->writeEntry("AnimateResize", animate->isChecked());
+ config->writeEntry("ShowServicemenus", servicemenus->isChecked());
+ config->writeEntry("ShowFrame", showframe->isChecked());
+
+ config->sync();
+
+ QDialog::accept();
+}
+
+void ConfigDialog::createLink()
+{
+ QDialog *main = new QDialog(this);
+ main->setCaption(i18n("Create Link"));
+ main->setIcon(SmallIcon("metabar"));
+
+ KPushButton *ok = new KPushButton(KStdGuiItem::ok(), main);
+ connect(ok, SIGNAL(clicked()), main, SLOT(accept()));
+
+ KPushButton *cancel = new KPushButton(KStdGuiItem::cancel(), main);
+ connect(cancel, SIGNAL(clicked()), main, SLOT(reject()));
+
+ QLineEdit *name = new QLineEdit(i18n("New link"), main);
+ QLineEdit *url = new QLineEdit("file:/", main);
+
+ KIconButton *icon = new KIconButton(main);
+ icon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ icon->setIconType(KIcon::Small, KIcon::Any);
+ icon->setStrictIconSize(true);
+ icon->setIcon("folder");
+
+ QHBoxLayout *bottom_layout = new QHBoxLayout(0, 0, 5);
+ bottom_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ bottom_layout->addWidget(ok);
+ bottom_layout->addWidget(cancel);
+
+ QGridLayout *layout = new QGridLayout(0, 2, 3, 0, 5);
+ layout->addMultiCellWidget(icon, 0, 1, 0, 0);
+ layout->addWidget(new QLabel(i18n("Name:"), main), 0, 1);
+ layout->addWidget(name, 0, 2);
+ layout->addWidget(new QLabel(i18n("URL:"), main), 1, 1);
+ layout->addWidget(url, 1, 2);
+
+ QVBoxLayout *main_layout = new QVBoxLayout(main, 5, 5);
+ main_layout->addLayout(layout);
+ main_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ main_layout->addLayout(bottom_layout);
+
+ main->resize(300, main->sizeHint().height());
+
+ if(main->exec() == QDialog::Accepted){
+ QString name_str = name->text();
+ QString url_str = url->text();
+ QString icon_str = icon->icon();
+
+ if(!name_str.isEmpty() && !url_str.isEmpty()){
+ if(icon_str.isEmpty()){
+ icon_str = kapp->iconLoader()->iconPath("folder", KIcon::Small);
+ }
+
+ QPixmap icon(icon_str);
+ if(icon.isNull()){
+ icon = SmallIcon(icon_str);
+ }
+
+ QListViewItem *item = new QListViewItem(link_list, link_list->lastItem(), name_str, url_str);
+ item->setPixmap(0, icon);
+
+ linkList.insert(item, new LinkEntry(name_str, url_str, icon_str));
+ updateArrows();
+ }
+ }
+
+ delete main;
+}
+
+void ConfigDialog::deleteLink()
+{
+ QListViewItem *item = link_list->selectedItem();
+ if(item){
+ linkList.remove(item);
+ delete item;
+ updateArrows();
+ }
+}
+
+void ConfigDialog::editLink()
+{
+ QListViewItem *item = link_list->selectedItem();
+ editLink(item);
+}
+
+void ConfigDialog::editLink(QListViewItem *item)
+{
+ if(item){
+ QDialog *main = new QDialog(this);
+ main->setCaption(i18n("Edit Link"));
+ main->setIcon(SmallIcon("metabar"));
+
+ KPushButton *ok = new KPushButton(KStdGuiItem::ok(), main);
+ connect(ok, SIGNAL(clicked()), main, SLOT(accept()));
+
+ KPushButton *cancel = new KPushButton(KStdGuiItem::cancel(), main);
+ connect(cancel, SIGNAL(clicked()), main, SLOT(reject()));
+
+ QLineEdit *name = new QLineEdit(linkList[item]->name, main);
+ QLineEdit *url = new QLineEdit(linkList[item]->url, main);
+
+ KIconButton *icon = new KIconButton(main);
+ icon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ icon->setIconType(KIcon::Small, KIcon::Any);
+ icon->setStrictIconSize(true);
+ icon->setIcon(linkList[item]->icon);
+
+ QHBoxLayout *bottom_layout = new QHBoxLayout(0, 0, 5);
+ bottom_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ bottom_layout->addWidget(ok);
+ bottom_layout->addWidget(cancel);
+
+ QGridLayout *layout = new QGridLayout(0, 2, 3, 0, 5);
+ layout->addMultiCellWidget(icon, 0, 1, 0, 0);
+ layout->addWidget(new QLabel(i18n("Name:"), main), 0, 1);
+ layout->addWidget(name, 0, 2);
+ layout->addWidget(new QLabel(i18n("URL:"), main), 1, 1);
+ layout->addWidget(url, 1, 2);
+
+ QVBoxLayout *main_layout = new QVBoxLayout(main, 5, 5);
+ main_layout->addLayout(layout);
+ main_layout->addItem(new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding));
+ main_layout->addLayout(bottom_layout);
+
+ main->resize(300, main->sizeHint().height());
+
+ if(main->exec() == QDialog::Accepted){
+ QString name_str = name->text();
+ QString url_str = url->text();
+ QString icon_str = icon->icon();
+
+ if(!name_str.isEmpty() && !url_str.isEmpty()){
+ if(icon_str.isEmpty()){
+ icon_str = kapp->iconLoader()->iconPath("folder", KIcon::Small);
+ }
+
+ QPixmap icon(icon_str);
+ if(icon.isNull()){
+ icon = SmallIcon(icon_str);
+ }
+
+ linkList[item]->name = name_str;
+ linkList[item]->url = url_str;
+ linkList[item]->icon = icon_str;
+
+ item->setText(0, name_str);
+ item->setText(1, url_str);
+ item->setPixmap(0, icon);
+ }
+ }
+
+ delete main;
+ }
+}
+
+void ConfigDialog::moveLinkUp()
+{
+ QListViewItem *item = link_list->selectedItem();
+ if(item){
+ if(link_list->itemIndex(item) > 0){
+
+ QListViewItem *after;
+ QListViewItem *above = item->itemAbove();
+ if(above){
+ after = above->itemAbove();
+ }
+
+ QString name = linkList[item]->name;
+ QString url = linkList[item]->url;
+ QString icon_str = linkList[item]->icon;
+
+ QPixmap icon(icon_str);
+ if(icon.isNull()){
+ icon = SmallIcon(icon_str);
+ }
+
+ delete linkList[item];
+ linkList.remove(item);
+ delete item;
+
+ QListViewItem *newItem = new QListViewItem(link_list, after, name, url);
+ newItem->setPixmap(0, icon);
+ link_list->setSelected(newItem, TRUE);
+
+ linkList.insert(newItem, new LinkEntry(name, url, icon_str));
+ updateArrows();
+ }
+ }
+}
+
+void ConfigDialog::moveLinkDown()
+{
+ QListViewItem *item = link_list->selectedItem();
+ if(item){
+ if(link_list->itemIndex(item) < linkList.count() - 1){
+
+ QListViewItem *after = item->itemBelow();
+
+ QString name = linkList[item]->name;
+ QString url = linkList[item]->url;
+ QString icon_str = linkList[item]->icon;
+
+ QPixmap icon(icon_str);
+ if(icon.isNull()){
+ icon = SmallIcon(icon_str);
+ }
+
+ delete linkList[item];
+ linkList.remove(item);
+ delete item;
+
+ QListViewItem *newItem = new QListViewItem(link_list, after, name, url);
+ newItem->setPixmap(0, icon);
+ link_list->setSelected(newItem, TRUE);
+
+ linkList.insert(newItem, new LinkEntry(name, url, icon_str));
+ updateArrows();
+ }
+ }
+}
+
+void ConfigDialog::loadAvailableActions()
+{
+ QListBox *box = actionSelector->availableListBox();
+
+ QByteArray data, replyData;
+ QCString replyType;
+
+ if(DCOPClient::mainClient()->call(kapp->dcopClient()->appId(), topWidgetName, "actionMap()", data, replyType, replyData)){
+ if(replyType == "QMap<QCString,DCOPRef>"){
+ QMap<QCString,DCOPRef> actionMap;
+
+ QDataStream reply(replyData, IO_ReadOnly);
+ reply >> actionMap;
+
+ iconConfig->setGroup("Icons");
+
+ QMap<QCString,DCOPRef>::Iterator it;
+ for(it = actionMap.begin(); it != actionMap.end(); ++it){
+ DCOPRef action = it.data();
+
+ QString text = action.call("plainText()");
+ QCString cname = action.call("name()");
+ QString icon = iconConfig->readEntry(QString(cname), action.call("icon()"));
+
+ ActionListItem *item = new ActionListItem(box, QString(cname), text, SmallIcon(icon));
+ }
+ }
+ }
+
+ //metabar's own actions
+ ActionListItem *item = new ActionListItem(box, "metabar/share", i18n("Share"), SmallIcon("network"));
+}
+
+void ConfigDialog::updateArrows()
+{
+ link_up->setEnabled( link_list->childCount()>1 && link_list->currentItem()!=link_list->firstChild() );
+ link_down->setEnabled( link_list->childCount()>1 && link_list->currentItem()!=link_list->lastItem() );
+}
+
+void ConfigDialog::loadThemes()
+{
+ themes->clear();
+
+ QString theme = config->readEntry("Theme", "default");
+ bool foundTheme = false;
+
+ QStringList dirs = kapp->dirs()->findDirs("data", "metabar/themes");
+ for(QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it){
+ QStringList theme_list = QDir(*it).entryList(QDir::Dirs);
+
+ theme_list.remove(".");
+ theme_list.remove("..");
+ themes->insertStringList(theme_list);
+
+ if(theme_list.find(theme) != theme_list.end()){
+ foundTheme = true;
+ }
+ }
+
+ if(foundTheme){
+ themes->setCurrentText(theme);
+ }
+ else{
+ themes->insertItem(theme);
+ }
+}
+
+void ConfigDialog::installTheme()
+{
+ QString file = KFileDialog::getOpenFileName();
+ if(file.isNull() && file.isEmpty()) return;
+
+ QString themedir = locateLocal("data", "metabar/themes");
+ if(themedir.isNull()) return;
+
+ KTar archive(file);
+ archive.open(IO_ReadOnly);
+ kapp->processEvents();
+
+ const KArchiveDirectory* rootDir = archive.directory();
+ rootDir->copyTo(themedir);
+
+ archive.close();
+ loadThemes();
+}
+
+#include "configdialog.moc"
diff --git a/konq-plugins/sidebar/metabar/src/configdialog.h b/konq-plugins/sidebar/metabar/src/configdialog.h
new file mode 100644
index 0000000..872bd8b
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/configdialog.h
@@ -0,0 +1,114 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef _CONFIGDIALOG_H_
+#define _CONFIGDIALOG_H_
+
+#include <qdialog.h>
+#include <kpushbutton.h>
+#include <klistview.h>
+#include <knuminput.h>
+#include <kconfig.h>
+#include <qptrdict.h>
+#include <qlistbox.h>
+#include <kactionselector.h>
+#include <qcheckbox.h>
+#include <kcombobox.h>
+
+class LinkEntry{
+ public:
+ LinkEntry(QString name, QString url, QString icon);
+
+ ~LinkEntry(){}
+
+ QString name;
+ QString url;
+ QString icon;
+};
+
+class ConfigDialog : public QDialog
+{
+ Q_OBJECT
+
+ public:
+ ConfigDialog(QWidget *parent = 0, const char *name = 0);
+ ~ConfigDialog();
+
+ protected:
+ KPushButton *ok;
+ KPushButton *cancel;
+
+ KPushButton *link_create;
+ KPushButton *link_delete;
+ KPushButton *link_edit;
+ KPushButton *link_up;
+ KPushButton *link_down;
+
+ KPushButton *install_theme;
+
+ KIntSpinBox *max_entries;
+ KIntSpinBox *max_actions;
+
+ QCheckBox *animate;
+ QCheckBox *servicemenus;
+ QCheckBox *showframe;
+
+ KListView *link_list;
+
+ KComboBox *themes;
+
+ QCString topWidgetName;
+
+ KActionSelector *actionSelector;
+
+ QPtrDict<LinkEntry> linkList;
+
+ KConfig *config;
+ KConfig *iconConfig;
+
+ protected slots:
+ void accept();
+ void createLink();
+ void deleteLink();
+ void editLink();
+ void editLink(QListViewItem *item);
+ void moveLinkUp();
+ void moveLinkDown();
+ void updateArrows();
+ void installTheme();
+
+ private:
+ void loadAvailableActions();
+ void loadThemes();
+};
+
+class ActionListItem : public QListBoxPixmap
+{
+ public:
+ ActionListItem(QListBox *listbox, const QString &action, const QString &text, const QPixmap &pixmap);
+ ~ActionListItem(){}
+
+ const QString action() { return act; }
+ void setAction(const QString act){ ActionListItem::act = act; }
+
+ private:
+ QString act;
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/default.css b/konq-plugins/sidebar/metabar/src/default.css
new file mode 100644
index 0000000..0bae4ab
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/default.css
@@ -0,0 +1,64 @@
+body {
+ background-color: window;
+ font-family: sans-serif;
+ font-size: 11px;
+ color: windowtext;
+}
+
+.frame {
+ background-color: threedface;
+ margin-bottom: 10px;
+ position: relative;
+
+}
+
+li {
+ list-style-type: none;
+ overflow: hidden;
+}
+
+li ul {
+ margin: 0px;
+ padding: 0px;
+ height: 20px;
+ white-space: nowrap;
+}
+
+a {
+ display: block;
+ padding-top: 5px;
+ padding-left: 24px;
+ background-position: 4px 2px;
+ background-repeat: no-repeat;
+
+ text-decoration: none;
+ color: buttontext;
+
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.title {
+ font-weight: bold;
+ border-bottom: solid 1px threeddarkshadow;
+ cursor: pointer;
+ height: 15px;
+ background-repeat: none;
+}
+
+a.infotitle {
+ font-weight: bold;
+ padding-left: 5px;
+ cursor: pointer;
+}
+
+.preview {
+ padding: 5px;
+ text-align: center;
+}
+
+ul.info {
+ padding-left: 5px;
+} \ No newline at end of file
diff --git a/konq-plugins/sidebar/metabar/src/defaultplugin.cpp b/konq-plugins/sidebar/metabar/src/defaultplugin.cpp
new file mode 100644
index 0000000..6c8dec3
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/defaultplugin.cpp
@@ -0,0 +1,458 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "defaultplugin.h"
+#include "metabarwidget.h"
+
+#include <kurl.h>
+#include <kstandarddirs.h>
+#include <kicontheme.h>
+#include <khtmlview.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kdesktopfile.h>
+#include <ktrader.h>
+#include <krun.h>
+#include <kfilemetainfo.h>
+#include <kconfig.h>
+#include <kimageio.h>
+#include <kdebug.h>
+#include <kmdcodec.h>
+
+#include <kio/previewjob.h>
+
+#include <dcopclient.h>
+#include <dcopref.h>
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qrect.h>
+#include <qpoint.h>
+#include <qbuffer.h>
+
+#include <dom_string.h>
+#include <html_image.h>
+
+#define EVENT_TYPE DOM::DOMString("click")
+#define MODIFICATION 1
+
+DefaultPlugin::DefaultPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name) : ProtocolPlugin (html, functions, name)
+{
+ services = new ServiceLoader(m_html->view(), "serviceloader");
+
+ preview_job = 0;
+}
+
+DefaultPlugin::~DefaultPlugin()
+{
+}
+
+void DefaultPlugin::killJobs(){
+ if(preview_job){
+ preview_job->kill();
+ preview_job = 0;
+ }
+}
+
+void DefaultPlugin::deactivate()
+{
+ m_functions->hide("actions");
+ m_functions->hide("open");
+ m_functions->hide("info");
+ m_functions->hide("preview");
+}
+
+void DefaultPlugin::loadActions(DOM::HTMLElement node)
+{
+ KFileItem *item = m_items.getFirst();
+ KURL url = item->url();
+
+ KConfig config("metabarrc", true, false);
+ config.setGroup("General");
+
+ KConfig iconConfig(locate("data", "metabar/iconsrc"));
+ iconConfig.setGroup("Icons");
+
+ DOM::DOMString innerHTML;
+
+ QStringList actions = config.readListEntry("Actions");
+ int maxActions = config.readNumEntry("MaxActions", 5);
+ int actionCount = 0;
+
+ for(QStringList::Iterator it = actions.begin(); it != actions.end(); ++it){
+ if((*it).startsWith("metabar/")){
+ if((*it).right((*it).length() - 8) == "share"){
+ MetabarWidget::addEntry(innerHTML, i18n("Share"), "action://" + *it, "network", QString::null, actionCount < maxActions ? QString::null : QString("hiddenaction"), actionCount >= maxActions);
+ actionCount++;
+ }
+ }
+ else{
+ DCOPRef action(kapp->dcopClient()->appId(), QCString(m_html->view()->topLevelWidget()->name()).append("/action/").append((*it).utf8()));
+
+ if(!action.isNull()){
+ if(action.call("enabled()")){
+ QString text = action.call("plainText()");
+ QString icon = iconConfig.readEntry(*it, action.call("icon()"));
+
+ MetabarWidget::addEntry(innerHTML, text, "action://" + *it, icon, QString::null, actionCount < maxActions ? QString::null : QString("hiddenaction"), actionCount >= maxActions);
+ actionCount++;
+ }
+ }
+ }
+ }
+
+ config.setGroup("General");
+ if(config.readBoolEntry("ShowServicemenus", true)){
+ services->loadServices(*(m_items.getFirst()), innerHTML, actionCount);
+ }
+
+ if(actionCount == 0) {
+ m_functions->hide("actions");
+ }
+ else{
+ if(actionCount > maxActions){
+ MetabarWidget::addEntry(innerHTML, i18n("More"), "more://hiddenaction", "1downarrow", "hiddenaction");
+ }
+
+ node.setInnerHTML(innerHTML);
+ m_functions->show("actions");
+ }
+}
+
+void DefaultPlugin::loadApplications(DOM::HTMLElement node)
+{
+ if(m_items.count() == 1){
+ KFileItem *item = m_items.getFirst();
+ KURL url = item->url();
+
+ QDir dir(url.path());
+ dir = dir.canonicalPath();
+
+ if(item->isDir() || dir.isRoot()){
+ m_functions->hide("open");
+ node.setInnerHTML(DOM::DOMString());
+ }
+ else{
+ DOM::DOMString innerHTML;
+
+ if(KDesktopFile::isDesktopFile(item->url().path())){ //Desktop file
+ KDesktopFile desktop(url.path(), TRUE);
+
+ if(desktop.hasApplicationType ()){
+ MetabarWidget::addEntry(innerHTML, i18n("Run %1").arg(desktop.readName()), "desktop://" + url.path(), desktop.readIcon());
+
+ m_functions->show("open");
+ }
+
+ else{
+ m_functions->hide("open");
+ }
+ }
+ else{ //other files
+ KTrader::OfferList offers;
+
+ offers = KTrader::self()->query(item->mimetype(), "Type == 'Application'");
+ if(!offers.isEmpty()){
+ KConfig config("metabarrc", true, false);
+ config.setGroup("General");
+
+ int id = 0;
+ int max = config.readNumEntry("MaxEntries", 5);
+
+ runMap.clear();
+ KTrader::OfferList::ConstIterator it = offers.begin();
+
+ for(; it != offers.end(); it++){
+ QString nam;
+ nam.setNum(id);
+
+ bool hide = id >= max;
+ MetabarWidget::addEntry(innerHTML, (*it)->name(), "exec://" + nam, (*it)->icon(), QString::null, hide ? QString("hiddenapp") : QString::null, hide);
+
+ runMap.insert(id, *it);
+ id++;
+ }
+
+ if(id > max){
+ MetabarWidget::addEntry(innerHTML, i18n("More"), "more://hiddenapp", "1downarrow", "hiddenapp");
+ }
+ }
+ else{
+ MetabarWidget::addEntry(innerHTML, i18n("Choose Application"), "openwith:///", "run");
+ }
+ }
+
+ node.setInnerHTML(innerHTML);
+
+ m_functions->show("open");
+ }
+ }
+ else{
+ m_functions->hide("open");
+ }
+}
+
+void DefaultPlugin::loadInformation(DOM::HTMLElement node)
+{
+ if(m_items.count() == 1){
+ KFileItem *item = m_items.getFirst();
+ KFileItem *that = const_cast<KFileItem *>(item);
+
+ DOM::DOMString innerHTML;
+ innerHTML += "<ul class=\"info\"><b>" + i18n("Type") + ": </b>";
+ innerHTML += that->determineMimeType()->comment();
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Size") + ": </b>";
+ innerHTML += KIO::convertSize(item->size());
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("User") + ": </b>";
+ innerHTML += item->user();
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Group") + ": </b>";
+ innerHTML += item->group();
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Permissions") + ": </b>";
+ innerHTML += (item->permissionsString());
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Modified") + ": </b>";
+ innerHTML += item->timeString(KIO::UDS_MODIFICATION_TIME);
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Accessed") + ": </b>";
+ innerHTML += item->timeString(KIO::UDS_ACCESS_TIME);
+ innerHTML += "</ul>";
+
+ if(item->isLink()){
+ innerHTML += "<ul class=\"info\"><b>" + i18n("Linktarget") + ": </b>";
+ innerHTML += item->linkDest();
+ innerHTML += "</ul>";
+ }
+
+ if(!item->isDir()){
+ const KFileMetaInfo &metaInfo = item->metaInfo();
+ if(metaInfo.isValid()){
+ QStringList groups = metaInfo.supportedGroups();
+
+ int id = 0;
+ QString nam;
+
+ for(QStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it){
+ KFileMetaInfoGroup group = metaInfo.group(*it);
+ if(group.isValid()){
+ nam.setNum(id);
+
+ innerHTML += "<ul class=\"info\"><a class=\"infotitle\" id=\"info_" + nam + "\" href=\"more://info_" + nam + "\">" + group.translatedName() + "</a></ul>";
+
+ QStringList keys = group.supportedKeys();
+
+ for(QStringList::ConstIterator it = keys.begin(); it != keys.end(); ++it){
+ const KFileMetaInfoItem metaInfoItem = group.item(*it);
+
+ if(metaInfoItem.isValid()){
+
+ innerHTML += "<ul class=\"info\" style=\"display:none\"><b name=\"info_" + nam + "\">" + metaInfoItem.translatedKey() + ": </b>";
+ innerHTML += metaInfoItem.string();
+ innerHTML += "</ul>";
+ }
+ }
+
+ id++;
+ }
+ }
+ }
+ }
+
+ node.setInnerHTML(innerHTML);
+ }
+ else{
+ KIO::filesize_t size = 0;
+ int files = 0;
+ int dirs = 0;
+
+ for(KFileItemListIterator it(m_items); it.current(); ++it){
+ size += (*it)->size();
+
+ if((*it)->isDir()){
+ dirs++;
+ }
+ else{
+ files++;
+ }
+ }
+
+ DOM::DOMString innerHTML;
+ innerHTML += "<ul class=\"info\"><b>" + i18n("Size") + ": </b>";
+ innerHTML += KIO::convertSize(size);
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Files") + ": </b>";
+ innerHTML += QString().setNum(files);
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Folders") + ": </b>";
+ innerHTML += QString().setNum(dirs);
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Total Entries") + ": </b>";
+ innerHTML += QString().setNum(m_items.count());
+ innerHTML += "</ul>";
+ node.setInnerHTML(innerHTML);
+ }
+ m_functions->show("info");
+}
+
+void DefaultPlugin::loadPreview(DOM::HTMLElement node)
+{
+ if(m_items.count() == 1){
+ KFileItem *item = m_items.getFirst();
+ KURL url = item->url();
+
+ QDir dir(url.path());
+ dir = dir.canonicalPath();
+
+ if(item->isDir() || dir.isRoot()){
+ m_functions->hide("preview");
+ }
+ else{
+ if(item->mimetype().startsWith("audio/")){
+ DOM::DOMString innerHTML("<ul><a class=\"previewdesc\" href=\"preview:///\">");
+ innerHTML += i18n("Click to start preview");
+ innerHTML += "</a></ul>";
+ node.setInnerHTML(innerHTML);
+
+ //m_functions->show("preview");
+ }
+ else{
+ DOM::DOMString innerHTML("<ul style=\"text-align-center\"><nobr>");
+ innerHTML += i18n("Creating preview");
+ innerHTML += "</nobr></ul>";
+ node.setInnerHTML(innerHTML);
+
+ //m_functions->show("preview");
+
+ preview_job = KIO::filePreview(KURL::List(url), m_html->view()->width() - 30);
+
+ connect(preview_job, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), this, SLOT(slotSetPreview(const KFileItem*, const QPixmap&)));
+ connect(preview_job, SIGNAL(failed(const KFileItem *)), this, SLOT(slotPreviewFailed(const KFileItem *)));
+ connect(preview_job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobFinished(KIO::Job *)));
+ }
+
+ m_functions->show("preview");
+ }
+ }
+ else{
+ m_functions->hide("preview");
+ }
+}
+
+void DefaultPlugin::loadBookmarks(DOM::HTMLElement node)
+{
+ m_functions->hide("bookmarks");
+}
+
+void DefaultPlugin::slotSetPreview(const KFileItem *item, const QPixmap &pix)
+{
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = doc.getElementById("preview");
+
+ QByteArray data;
+ QBuffer buffer(data);
+ buffer.open(IO_WriteOnly);
+ pix.save(&buffer, "PNG");
+
+ QString src = QString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data));
+ bool media = item->mimetype().startsWith("video/");
+
+ DOM::DOMString innerHTML;
+
+ innerHTML += QString("<ul style=\"height: %1px\"><a class=\"preview\"").arg(pix.height() + 15);
+
+ if(media){
+ innerHTML += " href=\"preview:///\"";
+ }
+ innerHTML +="><img id=\"previewimage\" src=\"";
+ innerHTML += src;
+ innerHTML += "\" width=\"";
+ innerHTML += QString().setNum(pix.width());
+ innerHTML += "\" height=\"";
+ innerHTML += QString().setNum(pix.height());
+ innerHTML += "\" /></a></ul>";
+
+ if(media){
+ innerHTML += "<ul><a class=\"previewdesc\" href=\"preview:///\">" + i18n("Click to start preview") + "</a></ul>";
+ }
+
+ node.setInnerHTML(innerHTML);
+
+ //script.append("adjustPreviewSize(" + height_str + ");");
+ m_functions->show("preview");
+ m_functions->adjustSize("preview");
+}
+
+void DefaultPlugin::slotPreviewFailed(const KFileItem *item)
+{
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement preview = static_cast<DOM::HTMLElement>(doc.getElementById("preview_image"));
+ if(!preview.isNull()){
+ preview.setAttribute(DOM::DOMString("src"), DOM::DOMString());
+ }
+
+ m_functions->hide("preview");
+}
+
+void DefaultPlugin::slotJobFinished(KIO::Job *job)
+{
+ if(preview_job && job == preview_job){
+ preview_job = 0;
+ }
+}
+
+bool DefaultPlugin::handleRequest(const KURL &url)
+{
+ QString protocol = url.protocol();
+
+ if(protocol == "exec"){
+ int id = url.host().toInt();
+
+ QMap<int,KService::Ptr>::Iterator it = runMap.find(id);
+ if(it != runMap.end()){
+
+ KFileItem *item = m_items.getFirst();
+ if(item){
+ KRun::run( **it, KURL::List(item->url()));
+ return true;
+ }
+ }
+ }
+
+ else if(protocol == "service"){
+ QString name = url.url().right(url.url().length() - 10);
+
+ services->runAction(name);
+ return true;
+ }
+
+ else if(protocol == "servicepopup"){
+ QString id = url.host();
+
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById("popup" + id));
+
+ if(!node.isNull()){
+ QRect rect = node.getRect();
+ QPoint p = m_html->view()->mapToGlobal(rect.bottomLeft());
+
+ services->showPopup(id, p);
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+#include "defaultplugin.moc"
diff --git a/konq-plugins/sidebar/metabar/src/defaultplugin.h b/konq-plugins/sidebar/metabar/src/defaultplugin.h
new file mode 100644
index 0000000..15b2e73
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/defaultplugin.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _DEFAULT_PLUGIN_H_
+#define _DEFAULT_PLUGIN_H_
+
+#include "protocolplugin.h"
+#include "serviceloader.h"
+
+#include <kio/previewjob.h>
+
+#include <qdict.h>
+#include <qmap.h>
+
+class DefaultPlugin : public ProtocolPlugin
+{
+ Q_OBJECT
+
+ public:
+ DefaultPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0);
+ ~DefaultPlugin();
+
+ void deactivate();
+ bool handleRequest(const KURL &url);
+
+ protected:
+ void killJobs();
+
+ void loadActions(DOM::HTMLElement node);
+ void loadApplications(DOM::HTMLElement node);
+ void loadInformation(DOM::HTMLElement node);
+ void loadPreview(DOM::HTMLElement node);
+ void loadBookmarks(DOM::HTMLElement node);
+
+ private:
+ QMap<int,KService::Ptr> runMap;
+ KIO::PreviewJob *preview_job;
+
+ ServiceLoader *services;
+
+ private slots:
+ void slotSetPreview(const KFileItem*, const QPixmap&);
+ void slotPreviewFailed(const KFileItem *item);
+ void slotJobFinished(KIO::Job *item);
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/hi128-app-metabar.png b/konq-plugins/sidebar/metabar/src/hi128-app-metabar.png
new file mode 100644
index 0000000..1ee89bf
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/hi128-app-metabar.png
Binary files differ
diff --git a/konq-plugins/sidebar/metabar/src/hi16-app-metabar.png b/konq-plugins/sidebar/metabar/src/hi16-app-metabar.png
new file mode 100644
index 0000000..c47b0b0
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/hi16-app-metabar.png
Binary files differ
diff --git a/konq-plugins/sidebar/metabar/src/hi32-app-metabar.png b/konq-plugins/sidebar/metabar/src/hi32-app-metabar.png
new file mode 100644
index 0000000..c0d6213
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/hi32-app-metabar.png
Binary files differ
diff --git a/konq-plugins/sidebar/metabar/src/hi48-app-metabar.png b/konq-plugins/sidebar/metabar/src/hi48-app-metabar.png
new file mode 100644
index 0000000..763ec38
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/hi48-app-metabar.png
Binary files differ
diff --git a/konq-plugins/sidebar/metabar/src/hi64-app-metabar.png b/konq-plugins/sidebar/metabar/src/hi64-app-metabar.png
new file mode 100644
index 0000000..89fa615
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/hi64-app-metabar.png
Binary files differ
diff --git a/konq-plugins/sidebar/metabar/src/hisc-app-metabar.svgz b/konq-plugins/sidebar/metabar/src/hisc-app-metabar.svgz
new file mode 100644
index 0000000..6b955f5
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/hisc-app-metabar.svgz
Binary files differ
diff --git a/konq-plugins/sidebar/metabar/src/httpplugin.cpp b/konq-plugins/sidebar/metabar/src/httpplugin.cpp
new file mode 100644
index 0000000..aec402a
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/httpplugin.cpp
@@ -0,0 +1,119 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "metabarwidget.h"
+#include "httpplugin.h"
+
+#include <kbookmark.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+#include <kicontheme.h>
+#include <khtmlview.h>
+#include <kurl.h>
+#include <klocale.h>
+
+#include <dcopref.h>
+#include <dcopclient.h>
+
+#include <qregexp.h>
+#include <qfile.h>
+
+#include <dom_node.h>
+#include <html_inline.h>
+
+HTTPPlugin::HTTPPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name) : ProtocolPlugin (html, functions, name)
+{
+}
+
+HTTPPlugin::~HTTPPlugin()
+{
+ //delete bookmarkManager;
+}
+
+void HTTPPlugin::deactivate()
+{
+ m_functions->hide("actions");
+ m_functions->hide("info");
+}
+
+void HTTPPlugin::killJobs()
+{
+}
+
+void HTTPPlugin::loadInformation(DOM::HTMLElement node)
+{
+ /*DOM::DOMString innerHTML;
+ innerHTML += "<form action=\"find:///\" method=\"GET\">";
+ innerHTML += "<ul>";
+ innerHTML += i18n("Keyword");
+ innerHTML += " <input onFocus=\"this.value = ''\" type=\"text\" name=\"find\" id=\"find_text\" value=\"";
+ innerHTML += i18n("Web search");
+ innerHTML += "\"></ul>";
+ innerHTML += "<ul><input type=\"submit\" id=\"find_button\" value=\"";
+ innerHTML += i18n("Find");
+ innerHTML += "\"></ul>";
+ innerHTML += "</form>";
+
+ node.setInnerHTML(innerHTML);
+ m_functions->show("info");*/
+
+ m_functions->hide("info");
+}
+
+void HTTPPlugin::loadActions(DOM::HTMLElement node)
+{
+ m_functions->hide("actions");
+}
+
+void HTTPPlugin::loadApplications(DOM::HTMLElement node)
+{
+ m_functions->hide("open");
+}
+
+void HTTPPlugin::loadPreview(DOM::HTMLElement node)
+{
+ m_functions->hide("preview");
+}
+
+void HTTPPlugin::loadBookmarks(DOM::HTMLElement node)
+{
+ m_functions->hide("bookmarks");
+}
+
+bool HTTPPlugin::handleRequest(const KURL &url)
+{
+ if(url.protocol() == "find"){
+ QString keyword = url.queryItem("find");
+ QString type = url.queryItem("type");
+
+ if(!keyword.isNull() && !keyword.isEmpty()){
+ KURL url("http://www.google.com/search");
+ url.addQueryItem("q", keyword);
+
+ DCOPRef ref(kapp->dcopClient()->appId(), m_html->view()->topLevelWidget()->name());
+ DCOPReply reply = ref.call("openURL", url.url());
+ }
+
+ return true;
+ }
+ return false;
+}
+
+#include "httpplugin.moc"
diff --git a/konq-plugins/sidebar/metabar/src/httpplugin.h b/konq-plugins/sidebar/metabar/src/httpplugin.h
new file mode 100644
index 0000000..c840e8f
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/httpplugin.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _HTTP_PLUGIN_H_
+#define _HTTP_PLUGIN_H_
+
+#include "protocolplugin.h"
+
+#include <kdirwatch.h>
+#include <kbookmarkmanager.h>
+
+#include <dom_string.h>
+
+class HTTPPlugin : public ProtocolPlugin
+{
+ Q_OBJECT
+
+ public:
+ HTTPPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0);
+ ~HTTPPlugin();
+
+ bool handleRequest(const KURL &url);
+ void deactivate();
+
+ protected:
+ void loadActions(DOM::HTMLElement node);
+ void loadApplications(DOM::HTMLElement node);
+ void loadPreview(DOM::HTMLElement node);
+ void loadBookmarks(DOM::HTMLElement node);
+ void loadInformation(DOM::HTMLElement node);
+ void killJobs();
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/iconsrc b/konq-plugins/sidebar/metabar/src/iconsrc
new file mode 100644
index 0000000..a30f532
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/iconsrc
@@ -0,0 +1,4 @@
+[Icons]
+rename=edit
+konq_create_dir=folder_new
+properties=messagebox_info \ No newline at end of file
diff --git a/konq-plugins/sidebar/metabar/src/layout.html b/konq-plugins/sidebar/metabar/src/layout.html
new file mode 100644
index 0000000..6bae311
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/layout.html
@@ -0,0 +1,48 @@
+<html>
+<head>
+<title></title>
+
+</head>
+
+<body>
+
+<div class="frame">
+ <div class="head"><a i18n image="wizard" class="title" onClick="this.blur();" href="function://toggle/actions">Actions</a></div>
+ <li id="actions" expanded="true" style="height:0px">
+ </li>
+</div>
+
+<div class="frame">
+ <div class="head"><a i18n image="run" class="title" onClick="this.blur();" href="function://toggle/open">Open With</a></div>
+ <li id="open" expanded="true" style="height:0px">
+ </li>
+</div>
+
+<div class="frame">
+ <div class="head"><a i18n image="bookmark" class="title" onClick="this.blur();" href="function://toggle/bookmarks">Bookmarks</a></div>
+ <li id="bookmarks" expanded="true" style="height:0px">
+ </li>
+</div>
+
+<div class="frame">
+ <div class="head"><a i18n image="browser" class="title" onClick="this.blur();" href="function://toggle/links">Links</a></div>
+ <li id="links" expanded="true" style="height:0px">
+ </li>
+</div>
+
+<div class="frame">
+ <div class="head"><a i18n image="messagebox_info" class="title" onClick="this.blur();" href="function://toggle/info">Information</a></div>
+<li id="info" expanded="true" style="height:0px">
+</li>
+</div>
+
+<div class="frame">
+ <div class="head"><a i18n image="player_play" class="title" onClick="this.blur();" href="function://toggle/preview">Preview</a></div>
+ <li id="preview" expanded="true" style="height:0px">
+ </li>
+</div>
+
+
+</body>
+
+</html>
diff --git a/konq-plugins/sidebar/metabar/src/metabar.cpp b/konq-plugins/sidebar/metabar/src/metabar.cpp
new file mode 100644
index 0000000..8181a11
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabar.cpp
@@ -0,0 +1,59 @@
+#include <kinstance.h>
+#include <qstring.h>
+#include <kimageio.h>
+#include <klocale.h>
+
+#include "metabarwidget.h"
+#include "metabar.h"
+#include "metabar.moc"
+
+Metabar::Metabar(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name):
+ KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name)
+{
+ KImageIO::registerFormats();
+ KGlobal::locale()->insertCatalogue( "konqsidebar_metabar" );
+
+ widget = new MetabarWidget(widgetParent, "metabarwidget");
+}
+
+
+Metabar::~Metabar()
+{
+}
+
+void Metabar::handleURL(const KURL &url)
+{
+ const KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url, true);
+ KFileItemList list;
+ list.append(item);
+
+ widget->setFileItems(list);
+}
+
+void Metabar::handlePreview(const KFileItemList &items)
+{
+ widget->setFileItems(items);
+}
+
+
+extern "C" {
+ bool add_konqsidebar_metabar(QString* fn, QString* param, QMap<QString,QString> *map) {
+ Q_UNUSED(param);
+
+ map->insert("Type", "Link");
+ map->insert("Icon", "metabar");
+ map->insert("Name", "Metabar");
+ map->insert("Open", "true");
+ map->insert("X-KDE-KonqSidebarModule","konqsidebar_metabar");
+ fn->setLatin1("metabar%1.desktop");
+ return true;
+ }
+}
+
+extern "C"
+{
+ void* create_konqsidebar_metabar(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name)
+ {
+ return new Metabar(instance,par,widp,desktopname,name);
+ }
+}
diff --git a/konq-plugins/sidebar/metabar/src/metabar.desktop b/konq-plugins/sidebar/metabar/src/metabar.desktop
new file mode 100644
index 0000000..9ea7917
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabar.desktop
@@ -0,0 +1,81 @@
+[Desktop Entry]
+Type=Link
+URL=
+Icon=metabar
+Comment=A konqueror navigation panel plugin called Metabar
+Comment[bg]=Приставка за навигация в браузъра Konqueror
+Comment[ca]=Un connector del plafó de navegació del konqueror anomenat Metabar
+Comment[cs]=Navigační panel pro Konqueror - Metabar
+Comment[da]=Et navigationspanel-plugin for konqueror der hedder Metabar
+Comment[de]=Metabar - Ein Modul für den Navigationsbereich von Konqueror
+Comment[el]=Ένα πρόσθετο πίνακα πλοήγησης του konqueror που ονομάζεται γραμμή μεταδεδομένων
+Comment[en_GB]=A Konqueror navigation panel plugin called Metabar
+Comment[eo]=Foliuma panela kromaĵo por Konkeranto nomata Metabar
+Comment[es]=Un complemento del panel de navegación de konqueror llamado metabarra
+Comment[et]=Konquerori navigeerimispaneeli plugin Metabar
+Comment[eu]=Metabar izeneko Konqueror-en arakatze-panelaren plugina
+Comment[fa]=وصلۀ تابلوی ناوش konqueror که فرامیله نام دارد
+Comment[fi]=Konquerorin Metabar-niminen selauspaneelin liitännäinen
+Comment[fr]=Un module pour le panneau de navigation de Konqueror appelé Metabar
+Comment[fy]=In plugin foar Konqueror's navigaasjebalke, neamd Metabalke
+Comment[ga]=Breiseán i bpainéal nascleanúna Konqueror darb ainm Metabar
+Comment[gl]=Un plugin de navegación para konqueror chamado Metabar
+Comment[hr]=Dodatak navigacijske ploče za Konqueror, zvan Metabar
+Comment[hu]=Metabar, egy navigációs bővítőmodul a Konqueror böngészőhöz
+Comment[is]=Konqueror leiðarstýrispjald íforrit sem kallast Metabar
+Comment[it]=Plugin di navigazione di Konqueror chiamato Metabar
+Comment[ja]=Konqueror メタバー ナビゲーションパネルプラグイン
+Comment[ka]=konqueror ნავიგაციის მოდული სახელად Metabar
+Comment[kk]=Metabar деген Konqueror панелінің плагин модулі
+Comment[km]=កម្មវិធី​ជំនួយ​បន្ទះ​​រុករក​​របស់ konqueror ​បាន​ហៅ​​របារ​មេតា
+Comment[lt]=Metabar - Konqueror navigacijos pulto priedas
+Comment[mk]=Приклучок за панел за навигација во konqueror наречен Metabar
+Comment[nb]=Et Konqueror programtillegg for navigasjonspanel, kalt Metabar
+Comment[nds]=En Sietpaneelmoduul för Konqueror, nöömt "Metabar"
+Comment[ne]=मेटाबार भनिने एउटा कन्क्वेरर नेभिगेसन प्यानल प्लगइन
+Comment[nl]=Een plugin voor Konqueror's navigatiebalk, genaamd Metabalk
+Comment[nn]=Eit programtillegg som gir Konqueror eit navigasjonpanel
+Comment[pl]=Panel nawigacyjny Metabar dla Konquerora
+Comment[pt]=Um 'plugin' de navegação do konqueror chamado Metabar
+Comment[pt_BR]=Um plugin de navegação para o Konqueror chamado de Metabar
+Comment[ru]=Панель сведений Konqueror
+Comment[sk]=Modul navigačného panelu pre Konqueror nazývaný Metabar
+Comment[sl]=Vstavek za Konqueror z navigacijskim pasom Metabar
+Comment[sr]=Прикључак за навигациону таблу konqueror-а назван Метапалета
+Comment[sr@Latn]=Priključak za navigacionu tablu konqueror-a nazvan Metapaleta
+Comment[sv]=Ett sidopanelinsticksprogram för Konqueror kallad Metarad
+Comment[tr]=Metabar isimli Konqueror gezinme paneli eklentisi
+Comment[uk]=Втулок навігаційної панелі для konqueror - Metabar
+Comment[vi]=Bổ sung bảng duyệt qua Konqueror tên Siêu Thanh
+Comment[zh_CN]=称为 Metabar 的 Konqueror 导航面板插件
+Comment[zh_TW]=叫做 Metabar 的 Konqueror 導覽面板外掛程式
+Name=metabar
+Name[de]=Metabar
+Name[el]=Γραμμή μεταδεδομένων
+Name[es]=metabarra
+Name[et]=Metabar
+Name[fa]=فرامیله
+Name[fi]=metapalkki
+Name[fr]=Metabar
+Name[fy]=metabalke
+Name[hu]=Metabar
+Name[ja]=メタバー
+Name[km]=របារ​មេតា
+Name[ne]=मेटाबार
+Name[nl]=metabalk
+Name[pa]=ਮੈਟਾ-ਪੱਟੀ
+Name[pl]=Metabar
+Name[pt_BR]=MetaBar
+Name[ru]=Сведения
+Name[sk]=Metabar
+Name[sl]=Metabar
+Name[sr]=метапалета
+Name[sr@Latn]=metapaleta
+Name[sv]=Metarad
+Name[tr]=Metabar
+Name[vi]=siêu thanh
+Name[zh_CN]=Metabar
+
+Open=false
+X-KDE-KonqSidebarModule=konqsidebar_metabar
+
diff --git a/konq-plugins/sidebar/metabar/src/metabar.h b/konq-plugins/sidebar/metabar/src/metabar.h
new file mode 100644
index 0000000..6d43592
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabar.h
@@ -0,0 +1,32 @@
+#ifndef METABAR_H
+#define METABAR_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <konqsidebarplugin.h>
+#include <qstring.h>
+#include <kconfig.h>
+
+
+class Metabar : public KonqSidebarPlugin
+{
+ Q_OBJECT
+
+ public:
+ Metabar(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name=0);
+ ~Metabar();
+
+ virtual QWidget *getWidget(){ return widget; }
+ virtual void *provides(const QString &) { return 0; }
+
+ protected:
+ MetabarWidget *widget;
+
+ void handleURL(const KURL &url);
+ void handlePreview(const KFileItemList &items);
+
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/metabar_add.desktop b/konq-plugins/sidebar/metabar/src/metabar_add.desktop
new file mode 100644
index 0000000..e7003e9
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabar_add.desktop
@@ -0,0 +1,70 @@
+[Desktop Entry]
+Comment=A konqueror navigation panel plugin called Metabar
+Comment[bg]=Приставка за навигация в браузъра Konqueror
+Comment[ca]=Un connector del plafó de navegació del konqueror anomenat Metabar
+Comment[cs]=Navigační panel pro Konqueror - Metabar
+Comment[da]=Et navigationspanel-plugin for konqueror der hedder Metabar
+Comment[de]=Metabar - Ein Modul für den Navigationsbereich von Konqueror
+Comment[el]=Ένα πρόσθετο πίνακα πλοήγησης του konqueror που ονομάζεται γραμμή μεταδεδομένων
+Comment[en_GB]=A Konqueror navigation panel plugin called Metabar
+Comment[eo]=Foliuma panela kromaĵo por Konkeranto nomata Metabar
+Comment[es]=Un complemento del panel de navegación de konqueror llamado metabarra
+Comment[et]=Konquerori navigeerimispaneeli plugin Metabar
+Comment[eu]=Metabar izeneko Konqueror-en arakatze-panelaren plugina
+Comment[fa]=وصلۀ تابلوی ناوش konqueror که فرامیله نام دارد
+Comment[fi]=Konquerorin Metabar -niminen selauspaneelin liitännäinen
+Comment[fr]=Un module pour le panneau de navigation de Konqueror appelé Metabar
+Comment[fy]=In plugin foar Konqueror's navigaasjebalke, neamd Metabalke
+Comment[ga]=Breiseán i bpainéal nascleanúna Konqueror darb ainm Metabar
+Comment[gl]=Un plugin de navegación para konqueror chamado Metabar
+Comment[hr]=Dodatak navigacijske trake za Konqueror, nazvan Metabar
+Comment[hu]=Metabar, egy navigációs bővítőmodul a Konqueror böngészőhöz
+Comment[is]=Konqueror leiðarstýrispjald íforrit sem kallast Metabar
+Comment[it]=Plugin di navigazione di Konqueror chiamato Metabar
+Comment[ja]=Konqueror メタバー ナビゲーションパネルプラグイン
+Comment[ka]=konqueror ნავიგაციის მოდული სახელად Metabar
+Comment[kk]=Metabar деген Konqueror панелінің плагин модулі
+Comment[km]=កម្មវិធី​ជំនួយ​បន្ទះ​​រុករក​របស់ konqueror បាន​​ហៅ​របារ​មេតា
+Comment[lt]=Metabar - Konqueror navigacijos pulto priedas
+Comment[mk]=Приклучок за панел за навигација во konqueror наречен Metabar
+Comment[nb]=Et Konqueror programtillegg for navigasjonspanel, kalt Metabar
+Comment[nds]=En Sietpaneel för Konqueror, nöömt "Metabar"
+Comment[ne]=मेटाबार भनिने एउटा कन्क्वेरर नेभिगेसन प्यानल प्लगइन
+Comment[nl]=Een plugin voor Konqueror's navigatiebalk, genaamd Metabalk
+Comment[nn]=Eit programtillegg som gir Konqueror eit navigasjonspanel
+Comment[pl]=Wtyczka panelu nawigacyjnego Metabar dla Konquerora
+Comment[pt]=Um 'plugin' de navegação do konqueror chamado Metabar
+Comment[pt_BR]=Um plugin de navegação para o Konqueror chamado de MetaBar
+Comment[ru]=Панель сведений Konqueror
+Comment[sk]=Modul navigačného panelu pre Konqueror nazývaný Metabar
+Comment[sl]=Vstavek za Konqueror z navigacijskim pasom Metabar
+Comment[sr]=Прикључак за навигациону таблу konqueror-а назван Метапалета
+Comment[sr@Latn]=Priključak za navigacionu tablu konqueror-a nazvan Metapaleta
+Comment[sv]=Ett sidopanelinsticksprogram för Konqueror kallad Metarad
+Comment[tr]=Metabar isimli Konqueror gezinme paneli eklentisi
+Comment[uk]=Втулок навігаційної панелі для konqueror - Metabar
+Comment[vi]=Bổ sung bảng duyệt qua Konqueror tên Siêu Thanh
+Comment[zh_CN]=称为 Metabar 的 Konqueror 导航面板插件
+Comment[zh_TW]=叫做 Metabar 的 Konqueror 導覽面板外掛程式
+Icon=metabar
+Name=Metabar
+Name[el]=Γραμμή μεταδεδομένων
+Name[eo]=MetaCrawler
+Name[es]=Metabarra
+Name[fa]=فرامیله
+Name[fy]=Metabalke
+Name[ja]=メタバー
+Name[km]=របារ​មេតា
+Name[ne]=मेटाबार
+Name[nl]=Metabalk
+Name[pa]=ਮੈਟਾ-ਪੱਟੀ
+Name[pt_BR]=MetaBar
+Name[ru]=Сведения
+Name[sr]=Метапалета
+Name[sr@Latn]=Metapaleta
+Name[sv]=Metarad
+Name[vi]=Siêu Thanh
+Open=false
+Type=Link
+URL=
+X-KDE-KonqSidebarAddModule=konqsidebar_metabar
diff --git a/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp b/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp
new file mode 100644
index 0000000..2d16e29
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabarfunctions.cpp
@@ -0,0 +1,242 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "metabarfunctions.h"
+
+#include <html_element.h>
+#include <html_document.h>
+#include <css_value.h>
+
+#include <kconfig.h>
+
+#include <qrect.h>
+
+#define CSS_PRIORITY "important"
+#define RESIZE_SPEED 5
+#define RESIZE_STEP 2
+
+MetabarFunctions::MetabarFunctions(KHTMLPart *html, QObject *parent, const char* name) : QObject(parent, name), m_html(html)
+{
+ timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
+}
+
+MetabarFunctions::~MetabarFunctions()
+{
+ if(timer->isActive()){
+ timer->stop();
+ }
+}
+
+void MetabarFunctions::handleRequest(const KURL &url)
+{
+ QString function = url.host();
+ QStringList params = QStringList::split(',', url.filename());
+
+ if(function == "toggle"){
+ if(params.size() == 1){
+ toggle(params.first());
+ }
+ }
+
+ else if(function == "adjustSize"){
+ if(params.size() == 1){
+ adjustSize(params.first());
+ }
+ }
+
+ else if(function == "show"){
+ if(params.size() == 1){
+ show(params.first());
+ }
+ }
+
+ else if(function == "hide"){
+ if(params.size() == 1){
+ hide(params.first());
+ }
+ }
+}
+
+void MetabarFunctions::toggle(DOM::DOMString item)
+{
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item));
+
+ if(!node.isNull()){
+ DOM::NodeList children = node.childNodes();
+ DOM::CSSStyleDeclaration style = node.style();
+ DOM::DOMString expanded = node.getAttribute("expanded");
+
+ bool isExpanded = expanded == "true";
+
+ int height = 0;
+ if(!isExpanded){
+ height = getHeight(node);
+ }
+
+ DOM::DOMString att = isExpanded ? "false" : "true";
+ node.setAttribute("expanded", att);
+
+ KConfig config("metabarrc");
+ config.setGroup("General");
+
+ if(config.readBoolEntry("AnimateResize", false)){
+ resizeMap[item.string()] = height;
+
+ if(!timer->isActive()){
+ timer->start(RESIZE_SPEED);
+ }
+ }
+ else{
+ style.setProperty("height", QString("%1px").arg(height), CSS_PRIORITY);
+ }
+ }
+}
+
+void MetabarFunctions::adjustSize(DOM::DOMString item)
+{
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item));
+
+ if(!node.isNull()){
+ DOM::NodeList children = node.childNodes();
+ DOM::CSSStyleDeclaration style = node.style();
+ DOM::DOMString expanded = node.getAttribute("expanded");
+
+ bool isExpanded = expanded == "true";
+
+ if(isExpanded){
+ int height = getHeight(node);
+
+ KConfig config("metabarrc");
+ config.setGroup("General");
+
+ if(config.readBoolEntry("AnimateResize", false)){
+ resizeMap[item.string()] = height;
+
+ if(!timer->isActive()){
+ timer->start(RESIZE_SPEED);
+ }
+ }
+ else{
+ style.setProperty("height", QString("%1px").arg(height), CSS_PRIORITY);
+ }
+ }
+ }
+}
+
+void MetabarFunctions::animate()
+{
+ QMap<QString, int>::Iterator it;
+ for(it = resizeMap.begin(); it != resizeMap.end(); ++it ) {
+ QString id = it.key();
+ int height = it.data();
+ int currentHeight = 0;
+
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(id));
+ DOM::CSSStyleDeclaration style = node.style();
+
+ QString currentHeightString = style.getPropertyValue("height").string();
+ if(currentHeightString.endsWith("px")){
+ currentHeight = currentHeightString.left(currentHeightString.length() - 2).toInt();
+ }
+
+ if(currentHeight == height){
+ resizeMap.remove(id);
+
+ if(resizeMap.isEmpty()){
+ timer->stop();
+ }
+ }
+ else{
+ int diff = kAbs(currentHeight - height);
+ int changeValue = RESIZE_STEP;
+
+ if(diff < RESIZE_STEP){
+ changeValue = diff;
+ }
+
+ int change = currentHeight < height ? changeValue : -changeValue;
+ style.setProperty("height", QString("%1px").arg(currentHeight + change), CSS_PRIORITY);
+ doc.updateRendering();
+ }
+ }
+}
+
+void MetabarFunctions::show(DOM::DOMString item)
+{
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item));
+ if(!node.isNull()){
+ DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(node.parentNode());
+
+ DOM::CSSStyleDeclaration style = parent.style();
+ style.setProperty("display", "block", CSS_PRIORITY);
+ }
+}
+
+void MetabarFunctions::hide(DOM::DOMString item)
+{
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item));
+ if(!node.isNull()){
+ DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(node.parentNode());
+
+ DOM::CSSStyleDeclaration style = parent.style();
+ style.setProperty("display", "none", CSS_PRIORITY);
+ }
+}
+
+int MetabarFunctions::getHeight(DOM::HTMLElement &element)
+{
+ int height = 0;
+ DOM::NodeList children = element.childNodes();
+ for(uint i = 0; i < children.length(); i++){
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(children.item(i));
+ DOM::CSSStyleDeclaration style = node.style();
+
+ DOM::DOMString css_height = style.getPropertyValue("height");
+ if(!css_height.isNull()){
+ height += css_height.string().left(css_height.string().length() - 2).toInt();
+ }
+ else{
+ int h = 0;
+ if(!node.isNull()){
+ h = node.getRect().height();
+ }
+
+ DOM::DOMString display = style.getPropertyValue("display");
+ if(display == "none"){
+ h = 0;
+ }
+ else if(h == 0){
+ h = 20;
+ }
+
+ height += h;
+ }
+ }
+
+ return height;
+}
+
+#include "metabarfunctions.moc"
diff --git a/konq-plugins/sidebar/metabar/src/metabarfunctions.h b/konq-plugins/sidebar/metabar/src/metabarfunctions.h
new file mode 100644
index 0000000..1c01998
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabarfunctions.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef METABAR_FUNCTIONS_H
+#define METABAR_FUNCTIONS_H
+
+#include <dom_string.h>
+
+#include <qtimer.h>
+#include <qmap.h>
+
+#include <kurl.h>
+#include <khtml_part.h>
+
+class MetabarFunctions : public QObject
+{
+ Q_OBJECT
+
+ public:
+ MetabarFunctions(KHTMLPart *html, QObject *parent = 0, const char* name=0);
+ ~MetabarFunctions();
+
+ void toggle(DOM::DOMString item);
+ void adjustSize(DOM::DOMString item);
+ void hide(DOM::DOMString item);
+ void show(DOM::DOMString item);
+ void handleRequest(const KURL &url);
+
+ protected:
+ KHTMLPart *m_html;
+
+ private:
+ QTimer *timer;
+
+ QMap<QString, int> resizeMap;
+ int getHeight(DOM::HTMLElement &element);
+
+ private slots:
+ void animate();
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/metabarwidget.cpp b/konq-plugins/sidebar/metabar/src/metabarwidget.cpp
new file mode 100644
index 0000000..f794353
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabarwidget.cpp
@@ -0,0 +1,592 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "metabarwidget.h"
+#include "configdialog.h"
+
+#include "defaultplugin.h"
+#include "settingsplugin.h"
+#include "remoteplugin.h"
+#include "httpplugin.h"
+
+#include <qwidget.h>
+#include <qlayout.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qvaluelist.h>
+#include <qurl.h>
+#include <qbuffer.h>
+
+#include <khtmlview.h>
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+#include <kicontheme.h>
+#include <ktrader.h>
+#include <klocale.h>
+#include <krun.h>
+#include <kdesktopfile.h>
+#include <kpropertiesdialog.h>
+#include <kaction.h>
+#include <kactioncollection.h>
+#include <kshortcut.h>
+#include <kmimetype.h>
+#include <kcmoduleinfo.h>
+#include <kmdcodec.h>
+
+#include <kparts/browserextension.h>
+
+#include <dom2_events.h>
+#include <dom2_views.h>
+#include <dom_doc.h>
+#include <dom_element.h>
+#include <dom_string.h>
+#include <html_element.h>
+#include <html_misc.h>
+#include <html_image.h>
+#include <css_value.h>
+
+#include <dcopref.h>
+#include <dcopclient.h>
+
+#define EVENT_TYPE DOM::DOMString("click")
+#define ACTIVATION 1
+
+MetabarWidget::MetabarWidget(QWidget *parent, const char *name) : QWidget(parent, name)
+{
+ skip = false;
+ loadComplete = false;
+
+ currentItems = new KFileItemList;
+ currentItems->setAutoDelete(true);
+
+ config = new KConfig("metabarrc");
+
+ dir_watch = new KDirWatch();
+ connect(dir_watch, SIGNAL(dirty(const QString&)), this, SLOT(slotUpdateCurrentInfo(const QString&)));
+ connect(dir_watch, SIGNAL(created(const QString&)), this, SLOT(slotUpdateCurrentInfo(const QString&)));
+ connect(dir_watch, SIGNAL(deleted(const QString&)), this, SLOT(slotDeleteCurrentInfo(const QString&)));
+
+ html = new KHTMLPart(this, "metabarhtmlpart");
+ html->setJScriptEnabled(true);
+ html->setPluginsEnabled(true);
+ html->setCaretVisible(false);
+ html->setDNDEnabled(false);
+ html->setJavaEnabled(false);
+ html->view()->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ html->view()->hide();
+
+ connect(html->browserExtension(), SIGNAL(openURLRequest( const KURL &, const KParts::URLArgs & )), this, SLOT(handleURLRequest(const KURL &, const KParts::URLArgs &)));
+ connect(html, SIGNAL(completed()), this, SLOT(loadCompleted()));
+ connect(html, SIGNAL(popupMenu(const QString &, const QPoint &)), this, SLOT(slotShowPopup(const QString&, const QPoint &)));
+
+ functions = new MetabarFunctions(html, this);
+
+ currentPlugin = 0;
+ defaultPlugin = new DefaultPlugin(html, functions);
+ HTTPPlugin *httpPlugin = new HTTPPlugin(html, functions);
+
+ //plugins.setAutoDelete(true);
+ plugins.insert("settings", new SettingsPlugin(html, functions));
+ plugins.insert("remote", new RemotePlugin(html, functions));
+ //plugins.insert("trash", new TrashPlugin(html, functions));
+ plugins.insert("http", httpPlugin);
+ plugins.insert("https", httpPlugin);
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ layout->addWidget(html->view());
+
+ popup = new KPopupMenu(0);
+ KAction *configAction = new KAction(i18n("Configure %1...").arg("Metabar"), "configure", KShortcut(), this, SLOT(slotShowConfig()), html->actionCollection(), "configure");
+ configAction->plug(popup);
+
+ KAction *reloadAction = new KAction(i18n("Reload Theme"), "reload", KShortcut(), this, SLOT(setTheme()), html->actionCollection(), "reload");
+ reloadAction->plug(popup);
+
+ setTheme();
+}
+
+MetabarWidget::~MetabarWidget()
+{
+ config->sync();
+ delete config;
+
+ delete dir_watch;
+ delete currentItems;
+}
+
+void MetabarWidget::setFileItems(const KFileItemList &items, bool check)
+{
+ if(!loadComplete){
+ return;
+ }
+
+ if(skip){
+ skip = false;
+ return;
+ }
+
+ if(check){
+ int count = items.count();
+
+ KURL url(getCurrentURL());
+
+ KFileItem *newItem = items.getFirst();
+ KFileItem *oldItem = currentItems->getFirst();
+
+ if(count == 0){
+ if(oldItem){
+ if(oldItem->url() == url){
+ return;
+ }
+ }
+
+ currentItems->clear();
+ currentItems->append(new KFileItem(S_IFDIR, KFileItem::Unknown, url, true));
+ }
+
+ else if(count == 1){
+ if(newItem){
+ if(newItem->url().isEmpty()){
+ return;
+ }
+
+ if(currentItems->count() == items.count() && oldItem){
+ if(newItem->url() == oldItem->url()){
+ return;
+ }
+ }
+ }
+
+ currentItems = new KFileItemList(items);
+ }
+
+ else{
+ if(currentItems && *currentItems == items){
+ return;
+ }
+ currentItems = new KFileItemList(items);
+ }
+ }
+ else{
+ currentItems = new KFileItemList(items);
+ }
+
+ if(currentPlugin){
+ currentPlugin->deactivate();
+ }
+
+ QString protocol = currentItems->getFirst()->url().protocol();
+ currentPlugin = plugins[protocol];
+
+ if(!currentPlugin){
+ currentPlugin = defaultPlugin;
+ }
+
+ ProtocolPlugin::activePlugin = currentPlugin;
+ currentPlugin->setFileItems(*currentItems);
+}
+
+QString MetabarWidget::getCurrentURL()
+{
+ DCOPRef ref(kapp->dcopClient()->appId(), this->topLevelWidget()->name());
+ DCOPReply reply = ref.call("currentURL()");
+
+ if (reply.isValid()) {
+ QString url;
+ reply.get(url, "QString");
+
+ if(!url.isNull() && !url.isEmpty()){
+ return url;
+ }
+ }
+ return 0;
+}
+
+void MetabarWidget::openURL(const QString &url)
+{
+ DCOPRef ref(kapp->dcopClient()->appId(), this->topLevelWidget()->name());
+ DCOPReply reply = ref.call("openURL", url);
+}
+
+void MetabarWidget::openTab(const QString &url)
+{
+ DCOPRef ref(kapp->dcopClient()->appId(), this->topLevelWidget()->name());
+ DCOPReply reply = ref.call("newTab", url);
+}
+
+void MetabarWidget::callAction(const QString &action)
+{
+ DCOPRef ref(kapp->dcopClient()->appId(), QString(this->topLevelWidget()->name()).append("/action/").append(action).utf8());
+ if(ref.call("enabled()")){
+ ref.call("activate()");
+ }
+}
+
+void MetabarWidget::loadLinks()
+{
+ config->setGroup("General");
+ QStringList links = config->readListEntry("Links");
+
+ if(links.count() == 0){
+ functions->hide("links");
+ }
+ else{
+ functions->show("links");
+
+ DOM::HTMLDocument doc = html->htmlDocument();
+ DOM::HTMLElement node = doc.getElementById("links");
+
+ if(!node.isNull()){
+ DOM::DOMString innerHTML;
+
+ for(QStringList::Iterator it = links.begin(); it != links.end(); ++it){
+ config->setGroup("Link_" + (*it));
+ addEntry(innerHTML, config->readEntry("Name"), config->readEntry("URL"), config->readEntry("Icon", "folder"));
+ }
+
+ node.setInnerHTML(innerHTML);
+ }
+
+ functions->adjustSize("links");
+ }
+}
+
+void MetabarWidget::loadCompleted()
+{
+ DOM::HTMLDocument doc = html->htmlDocument();
+
+ DOM::NodeList i18n_a_list = doc.getElementsByTagName("a");
+ for(uint i = 0; i < i18n_a_list.length(); i++){
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(i18n_a_list.item(i));
+ if(!node.isNull()){
+ if(node.hasAttribute("i18n")){
+ QString text = node.innerText().string();
+ node.setInnerText(DOM::DOMString(i18n(text.utf8().data())));
+ }
+
+ if(node.hasAttribute("image")){
+ QString icon = node.getAttribute("image").string();
+ QString url = getIconPath(icon);
+ QString style = QString("background-image: url(%1);").arg(url);
+
+ node.setAttribute("style", style);
+ }
+ }
+ }
+
+ DOM::NodeList i18n_ul_list = doc.getElementsByTagName("ul");
+ for(uint i = 0; i < i18n_ul_list.length(); i++){
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(i18n_ul_list.item(i));
+ if(!node.isNull()){
+ if(node.hasAttribute("i18n")){
+ QString text = node.innerText().string();
+ node.setInnerText(DOM::DOMString(i18n(text.utf8().data())));
+ }
+ }
+ }
+
+ config->setGroup("General");
+ QString file = locate("data", QString("metabar/themes/%1/default.css").arg(config->readEntry("Theme", "default")));
+ if(file.isNull()){
+ file = locate("data", QString("metabar/themes/default/default.css"));
+ }
+
+ QFile cssfile(file);
+ if(cssfile.open(IO_ReadOnly)){
+ QTextStream stream( &cssfile );
+ QString tmp = stream.read();
+ cssfile.close();
+
+ tmp.replace("./", KURL::fromPathOrURL(file).directory(false));
+ html->setUserStyleSheet(tmp);
+ }
+
+ loadComplete = true;
+ html->view()->setFrameShape(config->readBoolEntry("ShowFrame", true) ? QFrame::StyledPanel : QFrame::NoFrame);
+ html->view()->show();
+
+ if(currentItems && !currentItems->isEmpty()){
+ setFileItems(*currentItems, false);
+ }
+ else{
+ QString url = getCurrentURL();
+ KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, KURL(url), true);
+ KFileItemList list;
+ list.append(item);
+ setFileItems(list, false);
+ }
+
+ loadLinks();
+}
+
+void MetabarWidget::handleURLRequest(const KURL &url, const KParts::URLArgs &args)
+{
+ if(!currentPlugin){
+ return;
+ }
+
+ QString protocol = url.protocol();
+
+ if(currentPlugin->handleRequest(url)){
+ return;
+ }
+
+ if(protocol == "desktop"){
+ QString path = url.path();
+
+ if(KDesktopFile::isDesktopFile(path)){
+ KRun::run(new KDesktopFile(path, true), KURL::List());
+ }
+ }
+
+ else if(protocol == "kcmshell"){
+ QString module = url.path().remove('/');
+
+ KRun::runCommand("kcmshell " + module);
+ }
+
+ else if(protocol == "action"){
+ QString action = url.url().right(url.url().length() - 9);
+ if(action.startsWith("metabar/")){
+ QString newact = action.right(action.length() - 8);
+
+ if(newact == "share"){
+ slotShowSharingDialog();
+ }
+ }
+ else{
+ callAction(action);
+ }
+ }
+
+ else if(protocol == "preview"){
+ if(currentItems && !currentItems->isEmpty()){
+ KFileItem *item = currentItems->getFirst();
+
+ DOM::HTMLDocument doc = html->htmlDocument();
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById("preview"));
+ DOM::HTMLImageElement image = static_cast<DOM::HTMLImageElement>(doc.getElementById("previewimage"));
+
+ if(!node.isNull()){
+ skip = true; //needed to prevent some weired reload
+
+ DOM::DOMString innerHTML;
+ innerHTML += QString("<ul style=\"width: %1px; height: %1px\">").arg(image.width(), image.height());
+ innerHTML += "<object class=\"preview\" type=\"";
+ innerHTML += item->mimetype();
+ innerHTML += "\" data=\"";
+ innerHTML += item->url().url();
+ innerHTML += "\" width=\"";
+ innerHTML += QString().setNum(image.width());
+ innerHTML += "\" height=\"";
+ innerHTML += QString().setNum(image.height());
+ innerHTML += "\" /></ul>";
+ node.setInnerHTML(innerHTML);
+ }
+ }
+ }
+
+ else if(protocol == "more"){
+ QString name = url.host();
+
+ DOM::HTMLDocument doc = html->htmlDocument();
+ DOM::NodeList list = doc.getElementsByName(name);
+ DOM::HTMLElement element = static_cast<DOM::HTMLElement>(doc.getElementById(name));
+ bool showMore = true;
+
+ for(uint i = 0; i < list.length(); i++){
+ DOM::HTMLElement node = static_cast<DOM::HTMLElement>(list.item(i));
+ if(!node.isNull()){
+ DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(node.parentNode());
+ DOM::CSSStyleDeclaration style = parent.style();
+ DOM::DOMString display = style.getPropertyValue("display");
+ DOM::DOMString newDisplay = display == "none" ? "block" : "none";
+
+ style.setProperty("display", newDisplay, "important");
+
+ showMore = display == "block";
+ }
+ }
+
+ if(element.id().string().startsWith("hidden")){
+ QString style = QString("background-image: url(%1);").arg(getIconPath(showMore ? "1downarrow" : "1uparrow"));
+ element.setInnerText( showMore ? i18n("More") : i18n("Less") );
+ element.setAttribute("style", style);
+ }
+
+ DOM::HTMLElement parent = static_cast<DOM::HTMLElement>(element.parentNode().parentNode());
+ functions->adjustSize(parent.id());
+ }
+
+ else if(protocol == "function"){
+ functions->handleRequest(url);
+ }
+
+ else if(protocol == "configure"){
+ slotShowConfig();
+ }
+
+ else if(protocol == "openwith"){
+ if(currentItems && !currentItems->isEmpty()){
+ KFileItem *item = currentItems->getFirst();
+
+ KRun::displayOpenWithDialog(KURL::List(item->url()), false);
+ }
+ }
+
+ else{
+ if(args.newTab()){
+ openTab(url.url());
+ }
+ else{
+ openURL(url.url());
+ }
+ }
+}
+
+QString MetabarWidget::getIconPath(const QString &name)
+{
+ QPixmap icon = SmallIcon(name);
+
+ QByteArray data;
+ QBuffer buffer(data);
+ buffer.open(IO_WriteOnly);
+ icon.save(&buffer, "PNG");
+
+ return QString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data));
+}
+
+void MetabarWidget::slotShowSharingDialog()
+{
+ if(currentItems && currentItems->count() == 1){
+ KPropertiesDialog *dialog = new KPropertiesDialog(currentItems->first(), 0, 0, true);
+ dialog->showFileSharingPage();
+ }
+}
+
+void MetabarWidget::slotShowConfig()
+{
+ ConfigDialog *config_dialog = new ConfigDialog(this);
+ if(config_dialog->exec() == QDialog::Accepted){
+ config->reparseConfiguration();
+
+ setFileItems(*currentItems, false);
+ loadLinks();
+
+ setTheme();
+
+ html->view()->setFrameShape(config->readBoolEntry("ShowFrame", true) ? QFrame::StyledPanel : QFrame::NoFrame);
+ }
+
+ delete config_dialog;
+}
+
+void MetabarWidget::slotShowPopup(const QString &url, const QPoint &point)
+{
+ popup->exec(point);
+}
+
+void MetabarWidget::slotUpdateCurrentInfo(const QString &path)
+{
+ if(currentItems){
+ KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, KURL(path), true);
+
+ if(currentItems->count() == 1){
+ currentItems->clear();
+ currentItems->append(item);
+ }
+
+ setFileItems(*currentItems, false);
+ }
+}
+
+void MetabarWidget::slotDeleteCurrentInfo(const QString&)
+{
+ if(currentItems && currentItems->count() == 1){
+ QString url = getCurrentURL();
+ KURL currentURL;
+
+ if(currentItems){
+ currentURL = currentItems->getFirst()->url();
+ }
+
+ if(!currentURL.isEmpty() && KURL(url) != currentURL){
+ if(dir_watch->contains(currentURL.path())){
+ dir_watch->removeDir(currentURL.path());
+ }
+ dir_watch->addDir(url);
+
+ KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url, true);
+
+ currentItems->clear();
+ currentItems->append(item);
+
+ setFileItems(*currentItems, false);
+ }
+ }
+}
+
+void MetabarWidget::addEntry(DOM::DOMString &html, const QString name, const QString url, const QString icon, const QString id, const QString nameatt, bool hidden)
+{
+ html += "<ul";
+
+ if(hidden){
+ html += " style=\"display: none;\"";
+ }
+
+ html += "><a";
+
+ if(!id.isNull() && !id.isEmpty()){
+ html += " id=\"";
+ html += id;
+ html += "\"";
+ }
+
+ if(!nameatt.isNull() && !nameatt.isEmpty()){
+ html += " name=\"";
+ html += nameatt;
+ html += "\"";
+ }
+
+ html += " href=\"";
+ html += url;
+ html += "\" onClick=\"this.blur();\" style=\"background-image: url(";
+ html += getIconPath(icon);
+ html += ");\">";
+ html += name;
+ html += "</a></ul>";
+}
+
+void MetabarWidget::setTheme()
+{
+ loadComplete = false;
+
+ config->setGroup("General");
+ QString file = locate("data", QString("metabar/themes/%1/layout.html").arg(config->readEntry("Theme", "default")));
+
+ html->openURL(KURL(file));
+}
+
+#include "metabarwidget.moc"
diff --git a/konq-plugins/sidebar/metabar/src/metabarwidget.h b/konq-plugins/sidebar/metabar/src/metabarwidget.h
new file mode 100644
index 0000000..a0acb41
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabarwidget.h
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef METABAR_WIDGET_H
+#define METABAR_WIDGET_H
+
+#include <khtml_part.h>
+
+#include <kconfig.h>
+#include <kfileitem.h>
+#include <kurl.h>
+#include <kservice.h>
+#include <kpopupmenu.h>
+#include <kdirwatch.h>
+
+#include <qmap.h>
+
+#include "protocolplugin.h"
+#include "metabarfunctions.h"
+
+class MetabarWidget : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ MetabarWidget(QWidget *parent = 0, const char* name=0);
+ ~MetabarWidget();
+
+ void setFileItems(const KFileItemList &items, bool check = true);
+
+ static QString getIconPath(const QString &name);
+ static void addEntry(DOM::DOMString &html, const QString name, const QString url, const QString icon, const QString id = QString::null, const QString nameatt = QString::null, bool hidden = false);
+
+ private:
+ KFileItemList *currentItems;
+ KConfig *config;
+
+ KHTMLPart *html;
+
+ ProtocolPlugin *currentPlugin;
+ ProtocolPlugin *defaultPlugin;
+
+ MetabarFunctions *functions;
+
+ KDirWatch *dir_watch;
+ KPopupMenu *popup;
+
+ QDict<ProtocolPlugin> plugins;
+
+ bool skip;
+ bool loadComplete;
+
+ void callAction(const QString &action);
+ void openURL(const QString &url);
+ void openTab(const QString &url);
+ void loadLinks();
+
+ QString getCurrentURL();
+
+ private slots:
+ void loadCompleted();
+ void slotShowSharingDialog();
+ void slotShowConfig();
+ void slotShowPopup(const QString &url, const QPoint &pos);
+ void handleURLRequest(const KURL &url, const KParts::URLArgs &args);
+ void slotUpdateCurrentInfo(const QString &path);
+ void slotDeleteCurrentInfo(const QString &path);
+ void setTheme();
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/protocolplugin.cpp b/konq-plugins/sidebar/metabar/src/protocolplugin.cpp
new file mode 100644
index 0000000..10fd784
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/protocolplugin.cpp
@@ -0,0 +1,157 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "protocolplugin.h"
+
+#include <qbuffer.h>
+
+#include <kimageio.h>
+#include <kmdcodec.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include <html_document.h>
+#include <html_image.h>
+
+ProtocolPlugin* ProtocolPlugin::activePlugin = 0;
+
+ProtocolPlugin::ProtocolPlugin(KHTMLPart *html, MetabarFunctions *functions, const char* name) : QObject(html, name), m_html(html), m_functions(functions)
+{
+}
+
+ProtocolPlugin::~ProtocolPlugin()
+{
+}
+
+void ProtocolPlugin::setFileItems(const KFileItemList &items)
+{
+ m_items = items;
+
+ killJobs();
+
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement actions = doc.getElementById("actions");
+ DOM::HTMLElement applications = doc.getElementById("open");
+ DOM::HTMLElement info = doc.getElementById("info");
+ DOM::HTMLElement preview = doc.getElementById("preview");
+ DOM::HTMLElement bookmarks = doc.getElementById("bookmarks");
+
+ DOM::HTMLImageElement icon = (DOM::HTMLImageElement) doc.getElementById("icon");
+ DOM::HTMLElement name = doc.getElementById("name");
+ DOM::HTMLElement type = doc.getElementById("type");
+ DOM::HTMLElement size = doc.getElementById("size");
+
+ if(!icon.isNull()){
+ QPixmap pix;
+ if(m_items.count() == 1){
+ pix = m_items.getFirst()->pixmap(KIcon::SizeLarge);
+ }
+ else{
+ pix = DesktopIcon("kmultiple", KIcon::SizeLarge);
+ }
+
+ QByteArray data;
+ QBuffer buffer(data);
+ buffer.open(IO_WriteOnly);
+ pix.save(&buffer, "PNG");
+ QString icondata = QString::fromLatin1("data:image/png;base64,%1").arg(KCodecs::base64Encode(data));
+
+ icon.setSrc(icondata);
+ }
+
+ if(!name.isNull()){
+ if(m_items.count() == 1){
+ name.setInnerText(m_items.getFirst()->name());
+ }
+ else{
+ name.setInnerText(i18n("%1 Elements").arg(m_items.count()));
+ }
+ }
+
+ if(!type.isNull()){
+ if(m_items.count() == 1){
+ KFileItem *item = m_items.getFirst();
+ KFileItem *that = const_cast<KFileItem *>(item);
+
+ type.setInnerText(that->determineMimeType()->comment());
+ }
+ else{
+ int files = 0;
+ int dirs = 0;
+
+ for(KFileItemListIterator it(m_items); it.current(); ++it){
+ if((*it)->isDir()){
+ dirs++;
+ }
+ else{
+ files++;
+ }
+ }
+
+ type.setInnerText(i18n("%1 Folders, %2 Files").arg(dirs).arg(files));
+ }
+
+
+ }
+
+ if(!size.isNull()){
+ KIO::filesize_t s = 0;
+
+ for(KFileItemListIterator it(m_items); it.current(); ++it){
+ s += (*it)->size();
+ }
+
+ size.setInnerText(KIO::convertSize(s));
+ }
+
+ if(!actions.isNull()){
+ loadActions(actions);
+ m_functions->adjustSize("actions");
+ }
+
+ if(!applications.isNull()){
+ loadApplications(applications);
+ m_functions->adjustSize("open");
+ }
+
+ if(!info.isNull()){
+ loadInformation(info);
+ m_functions->adjustSize("info");
+ }
+
+ if(!preview.isNull()){
+ loadPreview(preview);
+ m_functions->adjustSize("preview");
+ }
+
+ if(!bookmarks.isNull()){
+ loadBookmarks(bookmarks);
+ m_functions->adjustSize("bookmarks");
+ }
+
+ doc.updateRendering();
+}
+
+bool ProtocolPlugin::isActive()
+{
+ return activePlugin == this;
+}
+
+#include "protocolplugin.moc"
diff --git a/konq-plugins/sidebar/metabar/src/protocolplugin.h b/konq-plugins/sidebar/metabar/src/protocolplugin.h
new file mode 100644
index 0000000..9202df3
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/protocolplugin.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _PROTOCOL_PLUGIN_H
+#define _PROTOCOL_PLUGIN_H
+
+#include <kfileitem.h>
+#include <khtml_part.h>
+
+#include <html_element.h>
+
+#include "metabarfunctions.h"
+
+class ProtocolPlugin : public QObject{
+ Q_OBJECT
+
+ public:
+ static ProtocolPlugin* activePlugin;
+
+ ProtocolPlugin(KHTMLPart *html, MetabarFunctions *functions, const char* name = 0);
+ ~ProtocolPlugin();
+
+ void setFileItems(const KFileItemList &items);
+ bool isActive();
+
+ virtual bool handleRequest(const KURL &url) = 0;
+ virtual void deactivate() = 0;
+
+ protected:
+ virtual void killJobs() = 0;
+
+ virtual void loadActions(DOM::HTMLElement node) = 0;
+ virtual void loadApplications(DOM::HTMLElement node) = 0;
+ virtual void loadInformation(DOM::HTMLElement node) = 0;
+ virtual void loadPreview(DOM::HTMLElement node) = 0;
+ virtual void loadBookmarks(DOM::HTMLElement node) = 0;
+
+ KFileItemList m_items;
+ KHTMLPart *m_html;
+ MetabarFunctions *m_functions;
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/remoteplugin.cpp b/konq-plugins/sidebar/metabar/src/remoteplugin.cpp
new file mode 100644
index 0000000..6d9a2dc
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/remoteplugin.cpp
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "remoteplugin.h"
+
+#include <kservice.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+RemotePlugin::RemotePlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name) : DefaultPlugin (html, functions, name)
+{
+}
+
+RemotePlugin::~RemotePlugin()
+{
+}
+
+void RemotePlugin::loadActions(DOM::HTMLElement node)
+{
+ KService::Ptr service = KService::serviceByDesktopName("knetattach");
+
+ if(service && service->isValid()){
+ DOM::DOMString innerHTML;
+ MetabarWidget::addEntry(innerHTML, i18n("Add a Network Folder"), "desktop://" + locate("apps", service->desktopEntryPath()), "wizard");
+ node.setInnerHTML(innerHTML);
+
+ m_functions->show("actions");
+ }
+
+ else{
+ m_functions->hide("actions");
+ }
+}
+
+#include "remoteplugin.moc"
diff --git a/konq-plugins/sidebar/metabar/src/remoteplugin.h b/konq-plugins/sidebar/metabar/src/remoteplugin.h
new file mode 100644
index 0000000..f77bbfd
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/remoteplugin.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _REMOTE_PLUGIN_H_
+#define _REMOTE_PLUGIN_H_
+
+#include "defaultplugin.h"
+
+class RemotePlugin : public DefaultPlugin
+{
+ Q_OBJECT
+
+ public:
+ RemotePlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0);
+ ~RemotePlugin();
+
+ void loadActions(DOM::HTMLElement node);
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/serviceloader.cpp b/konq-plugins/sidebar/metabar/src/serviceloader.cpp
new file mode 100644
index 0000000..7c7e544
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/serviceloader.cpp
@@ -0,0 +1,213 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "serviceloader.h"
+
+#include <qdir.h>
+#include <qvaluelist.h>
+#include <qptrlist.h>
+
+#include <dcopclient.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kactioncollection.h>
+#include <kiconloader.h>
+#include <kaction.h>
+#include <kshortcut.h>
+#include <ksimpleconfig.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+
+
+ServiceLoader::ServiceLoader(QWidget *parent, const char *name) : QObject(parent, name)
+{
+ popups.setAutoDelete(true);
+}
+
+ServiceLoader::~ServiceLoader()
+{
+}
+
+void ServiceLoader::loadServices(const KFileItem item, DOM::DOMString &html, int &count)
+{
+ popups.clear();
+
+ KURL url = item.url();
+ QString mimeType = item.mimetype();
+ QString mimeGroup = mimeType.left(mimeType.find('/'));
+
+ urlList.clear();
+ urlList.append(url);
+
+ QStringList dirs = KGlobal::dirs()->findDirs( "data", "konqueror/servicemenus/" );
+ KConfig config("metabarrc", true, false);
+ config.setGroup("General");
+ int maxActions = config.readNumEntry("MaxActions");
+ bool matchAll = false; // config.readBoolEntry("MatchAll");
+
+ int id = 0;
+ QString idString;
+
+ for(QStringList::Iterator dit = dirs.begin(); dit != dirs.end(); ++dit){
+ idString.setNum(id);
+
+ QDir dir(*dit);
+ QStringList entries = dir.entryList("*.desktop", QDir::Files);
+
+ for(QStringList::Iterator eit = entries.begin(); eit != entries.end(); ++eit){
+ KSimpleConfig cfg( *dit + *eit, true );
+ cfg.setDesktopGroup();
+
+ if(cfg.hasKey("X-KDE-ShowIfRunning" )){
+ const QString app = cfg.readEntry( "X-KDE-ShowIfRunning" );
+ if(!kapp->dcopClient()->isApplicationRegistered(app.utf8())){
+ continue;
+ }
+ }
+
+ if(cfg.hasKey("X-KDE-Protocol")){
+ const QString protocol = cfg.readEntry( "X-KDE-Protocol" );
+ if(protocol != url.protocol()){
+ continue;
+ }
+ }
+
+ else if(url.protocol() == "trash"){
+ continue;
+ }
+
+ if(cfg.hasKey("X-KDE-Require")){
+ const QStringList capabilities = cfg.readListEntry( "X-KDE-Require" );
+ if (capabilities.contains( "Write" )){
+ continue;
+ }
+ }
+
+ if ( cfg.hasKey( "Actions" ) && cfg.hasKey( "ServiceTypes" ) ){
+ const QStringList types = cfg.readListEntry( "ServiceTypes" );
+ const QStringList excludeTypes = cfg.readListEntry( "ExcludeServiceTypes" );
+ bool ok = false;
+
+ for (QStringList::ConstIterator it = types.begin(); it != types.end() && !ok; ++it){
+ bool checkTheMimetypes = false;
+
+ if(matchAll){
+ // first check if we have an all mimetype
+ if (*it == "all/all" || *it == "allfiles"){
+ checkTheMimetypes = true;
+ }
+
+ // next, do we match all files?
+ if (!ok && !item.isDir() && *it == "all/allfiles"){
+ checkTheMimetypes = true;
+ }
+ }
+
+ // if we have a mimetype, see if we have an exact or a type globbed match
+ if(!ok && (!mimeType.isEmpty() && *it == mimeType) ||
+ (!mimeGroup.isEmpty() && ((*it).right(1) == "*" && (*it).left((*it).find('/')) == mimeGroup)))
+ {
+ checkTheMimetypes = true;
+ }
+
+ if(checkTheMimetypes){
+ ok = true;
+
+ for(QStringList::ConstIterator itex = excludeTypes.begin(); itex != excludeTypes.end(); ++itex){
+ if( ((*itex).right(1) == "*" && (*itex).left((*itex).find('/')) == mimeGroup) ||
+ ((*itex) == mimeType))
+ {
+ ok = false;
+ break;
+ }
+ }
+ }
+ }
+ if (ok){
+ const QString priority = cfg.readEntry("X-KDE-Priority");
+ const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
+ bool usePopup = false;
+ KPopupMenu *popup;
+
+ if(!submenuName.isEmpty()){
+ usePopup = true;
+
+ if(popups[submenuName]){
+ popup = popups[submenuName];
+ }
+ else{
+ MetabarWidget::addEntry(html, submenuName, "servicepopup://" + idString, "1rightarrow", "popup" + idString, count < maxActions ? QString::null : QString("hiddenaction"), count >= maxActions);
+
+ popup = new KPopupMenu();
+ popups.insert(idString, popup);
+
+ count++;
+ }
+ }
+
+ QValueList<KDEDesktopMimeType::Service> list = KDEDesktopMimeType::userDefinedServices( *dit + *eit, url.isLocalFile());
+
+ for (QValueList<KDEDesktopMimeType::Service>::iterator it = list.begin(); it != list.end(); ++it){
+
+ if(usePopup){
+ KAction *action = new KAction((*it).m_strName, (*it).m_strIcon, KShortcut(), this, SLOT(runAction()), popup, idString.utf8());
+ action->plug(popup);
+ }
+ else{
+ MetabarWidget::addEntry(html, (*it).m_strName, "service://" + idString, (*it).m_strIcon, QString::null, count < maxActions ? QString::null : QString("hiddenaction"), count >= maxActions);
+ count++;
+ }
+
+ services.insert(idString, *it);
+ id++;
+ idString.setNum(id);
+ }
+ }
+ }
+ }
+ }
+}
+
+void ServiceLoader::runAction()
+{
+ KDEDesktopMimeType::Service s = services[sender()->name()];
+ if(!s.isEmpty()){
+ KDEDesktopMimeType::executeService(urlList, s);
+ }
+}
+
+void ServiceLoader::runAction(const QString& name)
+{
+ KDEDesktopMimeType::Service s = services[name];
+ if(!s.isEmpty()){
+ KDEDesktopMimeType::executeService(urlList, s);
+ }
+}
+
+void ServiceLoader::showPopup(const QString &popup, const QPoint &point)
+{
+ KPopupMenu *p = popups[popup];
+ if(p){
+ p->exec(point);
+ }
+}
+
+#include "serviceloader.moc"
diff --git a/konq-plugins/sidebar/metabar/src/serviceloader.h b/konq-plugins/sidebar/metabar/src/serviceloader.h
new file mode 100644
index 0000000..293ae6b
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/serviceloader.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _SERVICELOADER_H_
+#define _SERVICELOADER_H_
+
+#include <qstring.h>
+#include <qdict.h>
+#include <qmap.h>
+#include <qwidget.h>
+
+#include <kpopupmenu.h>
+#include <kfileitem.h>
+#include <kmimetype.h>
+#include <kurl.h>
+
+#include <dom_string.h>
+
+#include "metabarwidget.h"
+
+class ServiceLoader : public QObject
+{
+ Q_OBJECT
+
+ public:
+ ServiceLoader(QWidget *parent, const char *name = 0);
+ ~ServiceLoader();
+
+ void loadServices(const KFileItem item, DOM::DOMString &html, int &count);
+ void runAction(const QString &name);
+ void showPopup(const QString &popup, const QPoint &point);
+
+ private:
+ QDict<KPopupMenu> popups;
+ QMap<QString,KDEDesktopMimeType::Service> services;
+ KURL::List urlList;
+
+ private slots:
+ void runAction();
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/src/settingsplugin.cpp b/konq-plugins/sidebar/metabar/src/settingsplugin.cpp
new file mode 100644
index 0000000..1fb9e50
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/settingsplugin.cpp
@@ -0,0 +1,201 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "metabarwidget.h"
+#include "settingsplugin.h"
+
+#include <kcmoduleinfo.h>
+#include <kservice.h>
+#include <klocale.h>
+
+#include <html_document.h>
+#include <html_element.h>
+#include <dom_string.h>
+
+SettingsPlugin::SettingsPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name) : ProtocolPlugin (html, functions, name)
+{
+ list_job = 0;
+}
+
+SettingsPlugin::~SettingsPlugin()
+{
+}
+
+void SettingsPlugin::killJobs()
+{
+ if(list_job){
+ list_job->kill();
+ list_job = 0;
+ }
+}
+
+void SettingsPlugin::deactivate()
+{
+ m_functions->hide("actions");
+ m_functions->hide("info");
+}
+
+void SettingsPlugin::loadActions(DOM::HTMLElement node)
+{
+ KURL url = m_items.getFirst()->url();
+
+ if(url.path().endsWith("/")){
+ list_job = KIO::listDir(url, true, false);
+ connect(list_job, SIGNAL(entries(KIO::Job *, const KIO::UDSEntryList &)), this, SLOT(slotGotEntries(KIO::Job *, const KIO::UDSEntryList &)));
+ connect(list_job, SIGNAL(result(KIO::Job *)), this, SLOT(slotJobFinished(KIO::Job *)));
+
+ m_functions->show("actions");
+ }
+ else{
+ QString path = url.path();
+ QString name = url.filename();
+
+ KService::Ptr service = KService::serviceByStorageId(name);
+ if(service && service->isValid()){
+ KCModuleInfo kcminfo(service);
+
+ DOM::DOMString innerHTML;
+ MetabarWidget::addEntry(innerHTML, i18n("Run"), "kcmshell:/" + name, kcminfo.icon());
+ node.setInnerHTML(innerHTML);
+
+ m_functions->show("actions");
+ }
+ else{
+ m_functions->hide("actions");
+ }
+ }
+}
+
+void SettingsPlugin::loadInformation(DOM::HTMLElement node)
+{
+ KURL url = m_items.getFirst()->url();
+ if(url.path().endsWith("/")){
+ m_functions->hide("info");
+ }
+ else{
+ QString path = url.path();
+ QString name = url.filename();
+
+ KService::Ptr service = KService::serviceByStorageId(name);
+ if(service && service->isValid()){
+ KCModuleInfo kcminfo(service);
+
+ bool needsRoot = kcminfo.needsRootPrivileges();
+
+ DOM::DOMString innerHTML;
+ innerHTML += "<ul class=\"info\"><b>" + i18n("Name") + ": </b>";
+ innerHTML += kcminfo.moduleName();
+ innerHTML += "</ul><ul class=\"info\"><b>" + i18n("Comment") + ": </b>";
+ innerHTML += kcminfo.comment();
+ innerHTML += "</ul>";
+
+ if(needsRoot){
+ innerHTML += "<ul class=\"info\"><b>";
+ innerHTML += i18n("Needs root privileges");
+ innerHTML += "</b></ul>";
+ }
+ node.setInnerHTML(innerHTML);
+
+ m_functions->show("info");
+ }
+ else{
+ m_functions->hide("info");
+ }
+ }
+}
+
+void SettingsPlugin::loadApplications(DOM::HTMLElement node)
+{
+ m_functions->hide("open");
+}
+
+void SettingsPlugin::loadPreview(DOM::HTMLElement node)
+{
+ m_functions->hide("preview");
+}
+
+void SettingsPlugin::loadBookmarks(DOM::HTMLElement node)
+{
+ m_functions->hide("bookmarks");
+}
+
+bool SettingsPlugin::handleRequest(const KURL &)
+{
+ return false;
+}
+
+void SettingsPlugin::slotGotEntries(KIO::Job *job, const KIO::UDSEntryList &list)
+{
+ if(!job){
+ return;
+ }
+
+ DOM::HTMLDocument doc = m_html->htmlDocument();
+ DOM::HTMLElement node = doc.getElementById("actions");
+ DOM::DOMString innerHTML;
+
+ KIO::UDSEntryList::ConstIterator it = list.begin();
+ KIO::UDSEntryList::ConstIterator it_end = list.end();
+ for(; it != it_end; ++it){
+ QString name;
+ QString icon;
+ QString url;
+ long type;
+
+ KIO::UDSEntry::ConstIterator atomit = (*it).begin();
+ KIO::UDSEntry::ConstIterator atomit_end = (*it).end();
+ for(; atomit != atomit_end; ++atomit){
+ if((*atomit).m_uds == KIO::UDS_NAME){
+ name = (*atomit).m_str;
+ }
+ else if((*atomit).m_uds == KIO::UDS_ICON_NAME){
+ icon = (*atomit).m_str;
+ }
+ else if((*atomit).m_uds == KIO::UDS_URL){
+ url = (*atomit).m_str;
+ }
+
+ else if((*atomit).m_uds == KIO::UDS_FILE_TYPE){
+ type = (*atomit).m_long;
+ }
+ }
+
+ kdDebug() << url << endl;
+
+ if(type == S_IFREG){
+ url = "kcmshell:/" + KURL(url).filename();
+ }
+
+ MetabarWidget::addEntry(innerHTML, name, url, icon);
+ }
+
+ node.setInnerHTML(innerHTML);
+}
+
+void SettingsPlugin::slotJobFinished(KIO::Job *job)
+{
+ if(list_job && job == list_job){
+ list_job = 0;
+
+ m_functions->adjustSize("actions");
+ }
+}
+
+#include "settingsplugin.moc"
diff --git a/konq-plugins/sidebar/metabar/src/settingsplugin.h b/konq-plugins/sidebar/metabar/src/settingsplugin.h
new file mode 100644
index 0000000..27f1097
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/settingsplugin.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Florian Roth *
+ * florian@synatic.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _SETTINGS_PLUGIN_H_
+#define _SETTINGS_PLUGIN_H_
+
+#include "protocolplugin.h"
+
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+
+class SettingsPlugin : public ProtocolPlugin
+{
+ Q_OBJECT
+
+ public:
+ SettingsPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name = 0);
+ ~SettingsPlugin();
+
+ void deactivate();
+ bool handleRequest(const KURL &url);
+
+ protected:
+ void killJobs();
+ void loadActions(DOM::HTMLElement node);
+ void loadApplications(DOM::HTMLElement node);
+ void loadInformation(DOM::HTMLElement node);
+ void loadPreview(DOM::HTMLElement node);
+ void loadBookmarks(DOM::HTMLElement node);
+
+ private:
+ KIO::ListJob *list_job;
+
+ private slots:
+ void slotGotEntries(KIO::Job *job, const KIO::UDSEntryList &list);
+ void slotJobFinished(KIO::Job *job);
+};
+
+#endif
diff --git a/konq-plugins/sidebar/metabar/stamp-h.in b/konq-plugins/sidebar/metabar/stamp-h.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/stamp-h.in