From dba036816b279bc1539a9f3894fbc414665d2bce Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 21 Apr 2019 23:22:20 +0900 Subject: Removed unnecessary and/or TDE-unrelated code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michele Calgaro Signed-off-by: Slávek Banko --- tqtinterface/qt4/tools/assistant/LICENSE.GPL | 280 ----- tqtinterface/qt4/tools/assistant/assistant.icns | Bin 58954 -> 0 bytes tqtinterface/qt4/tools/assistant/assistant.ico | Bin 10134 -> 0 bytes tqtinterface/qt4/tools/assistant/assistant.pro | 72 -- tqtinterface/qt4/tools/assistant/assistant.rc | 1 - tqtinterface/qt4/tools/assistant/assistant_de.qm | Bin 13929 -> 0 bytes tqtinterface/qt4/tools/assistant/assistant_de.ts | 1084 ------------------ tqtinterface/qt4/tools/assistant/assistant_fr.ts | 426 ------- .../qt4/tools/assistant/book/assistant.book | 6 - .../qt4/tools/assistant/book/assistant.leaf | 563 ---------- .../qt4/tools/assistant/book/images/assistant.png | Bin 57297 -> 0 bytes .../qt4/tools/assistant/book/images/docwindow.png | Bin 10137 -> 0 bytes .../qt4/tools/assistant/book/images/general.png | Bin 11424 -> 0 bytes .../qt4/tools/assistant/book/images/pdf1.png | Bin 8675 -> 0 bytes .../qt4/tools/assistant/book/images/search.png | Bin 6273 -> 0 bytes .../qt4/tools/assistant/book/images/sidebar.png | Bin 5244 -> 0 bytes .../qt4/tools/assistant/book/images/toolbar1.png | Bin 4236 -> 0 bytes .../qt4/tools/assistant/book/images/web.png | Bin 12017 -> 0 bytes tqtinterface/qt4/tools/assistant/config.cpp | 379 ------- tqtinterface/qt4/tools/assistant/config.h | 152 --- tqtinterface/qt4/tools/assistant/docuparser.cpp | 397 ------- tqtinterface/qt4/tools/assistant/docuparser.h | 151 --- tqtinterface/qt4/tools/assistant/finddialog.ui | 292 ----- tqtinterface/qt4/tools/assistant/finddialog.ui.h | 108 -- tqtinterface/qt4/tools/assistant/helpdialog.ui | 506 --------- .../qt4/tools/assistant/helpdialogimpl.cpp | 1161 -------------------- tqtinterface/qt4/tools/assistant/helpdialogimpl.h | 173 --- tqtinterface/qt4/tools/assistant/helpwindow.cpp | 282 ----- tqtinterface/qt4/tools/assistant/helpwindow.h | 88 -- tqtinterface/qt4/tools/assistant/images/addtab.png | Bin 469 -> 0 bytes .../qt4/tools/assistant/images/appicon.png | Bin 2353 -> 0 bytes .../qt4/tools/assistant/images/assistant.png | Bin 1349 -> 0 bytes tqtinterface/qt4/tools/assistant/images/book.png | Bin 861 -> 0 bytes .../qt4/tools/assistant/images/closetab.png | Bin 533 -> 0 bytes .../qt4/tools/assistant/images/d_closetab.png | Bin 398 -> 0 bytes .../qt4/tools/assistant/images/designer.png | Bin 1367 -> 0 bytes .../qt4/tools/assistant/images/editcopy.png | Bin 492 -> 0 bytes tqtinterface/qt4/tools/assistant/images/find.png | Bin 856 -> 0 bytes tqtinterface/qt4/tools/assistant/images/home.png | Bin 1081 -> 0 bytes .../qt4/tools/assistant/images/linguist.png | Bin 1157 -> 0 bytes tqtinterface/qt4/tools/assistant/images/next.png | Bin 541 -> 0 bytes .../qt4/tools/assistant/images/previous.png | Bin 542 -> 0 bytes tqtinterface/qt4/tools/assistant/images/print.png | Bin 766 -> 0 bytes tqtinterface/qt4/tools/assistant/images/qt.png | Bin 975 -> 0 bytes tqtinterface/qt4/tools/assistant/images/splash.png | Bin 52411 -> 0 bytes .../qt4/tools/assistant/images/whatsthis.xpm | 26 - tqtinterface/qt4/tools/assistant/images/zoomin.png | Bin 900 -> 0 bytes .../qt4/tools/assistant/images/zoomout.png | Bin 919 -> 0 bytes tqtinterface/qt4/tools/assistant/index.cpp | 526 --------- tqtinterface/qt4/tools/assistant/index.h | 132 --- tqtinterface/qt4/tools/assistant/lib/lib.pro | 23 - .../qt4/tools/assistant/lib/tqassistantclient.cpp | 334 ------ .../qt4/tools/assistant/lib/tqassistantclient.h | 81 -- tqtinterface/qt4/tools/assistant/main.cpp | 344 ------ tqtinterface/qt4/tools/assistant/mainwindow.ui | 670 ----------- tqtinterface/qt4/tools/assistant/mainwindow.ui.h | 697 ------------ tqtinterface/qt4/tools/assistant/profile.cpp | 124 --- tqtinterface/qt4/tools/assistant/profile.h | 130 --- tqtinterface/qt4/tools/assistant/settingsdialog.ui | 516 --------- .../qt4/tools/assistant/settingsdialogimpl.cpp | 122 -- .../qt4/tools/assistant/settingsdialogimpl.h | 64 -- tqtinterface/qt4/tools/assistant/tabbedbrowser.ui | 141 --- .../qt4/tools/assistant/tabbedbrowser.ui.h | 347 ------ tqtinterface/qt4/tools/assistant/topicchooser.ui | 182 --- .../qt4/tools/assistant/topicchooserimpl.cpp | 70 -- .../qt4/tools/assistant/topicchooserimpl.h | 60 - 66 files changed, 10710 deletions(-) delete mode 100644 tqtinterface/qt4/tools/assistant/LICENSE.GPL delete mode 100644 tqtinterface/qt4/tools/assistant/assistant.icns delete mode 100644 tqtinterface/qt4/tools/assistant/assistant.ico delete mode 100644 tqtinterface/qt4/tools/assistant/assistant.pro delete mode 100644 tqtinterface/qt4/tools/assistant/assistant.rc delete mode 100644 tqtinterface/qt4/tools/assistant/assistant_de.qm delete mode 100644 tqtinterface/qt4/tools/assistant/assistant_de.ts delete mode 100644 tqtinterface/qt4/tools/assistant/assistant_fr.ts delete mode 100644 tqtinterface/qt4/tools/assistant/book/assistant.book delete mode 100644 tqtinterface/qt4/tools/assistant/book/assistant.leaf delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/assistant.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/docwindow.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/general.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/pdf1.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/search.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/sidebar.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/toolbar1.png delete mode 100644 tqtinterface/qt4/tools/assistant/book/images/web.png delete mode 100644 tqtinterface/qt4/tools/assistant/config.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/config.h delete mode 100644 tqtinterface/qt4/tools/assistant/docuparser.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/docuparser.h delete mode 100644 tqtinterface/qt4/tools/assistant/finddialog.ui delete mode 100644 tqtinterface/qt4/tools/assistant/finddialog.ui.h delete mode 100644 tqtinterface/qt4/tools/assistant/helpdialog.ui delete mode 100644 tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/helpdialogimpl.h delete mode 100644 tqtinterface/qt4/tools/assistant/helpwindow.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/helpwindow.h delete mode 100644 tqtinterface/qt4/tools/assistant/images/addtab.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/appicon.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/assistant.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/book.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/closetab.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/d_closetab.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/designer.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/editcopy.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/find.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/home.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/linguist.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/next.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/previous.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/print.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/qt.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/splash.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/whatsthis.xpm delete mode 100644 tqtinterface/qt4/tools/assistant/images/zoomin.png delete mode 100644 tqtinterface/qt4/tools/assistant/images/zoomout.png delete mode 100644 tqtinterface/qt4/tools/assistant/index.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/index.h delete mode 100644 tqtinterface/qt4/tools/assistant/lib/lib.pro delete mode 100644 tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h delete mode 100644 tqtinterface/qt4/tools/assistant/main.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/mainwindow.ui delete mode 100644 tqtinterface/qt4/tools/assistant/mainwindow.ui.h delete mode 100644 tqtinterface/qt4/tools/assistant/profile.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/profile.h delete mode 100644 tqtinterface/qt4/tools/assistant/settingsdialog.ui delete mode 100644 tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/settingsdialogimpl.h delete mode 100644 tqtinterface/qt4/tools/assistant/tabbedbrowser.ui delete mode 100644 tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h delete mode 100644 tqtinterface/qt4/tools/assistant/topicchooser.ui delete mode 100644 tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp delete mode 100644 tqtinterface/qt4/tools/assistant/topicchooserimpl.h (limited to 'tqtinterface/qt4/tools/assistant') diff --git a/tqtinterface/qt4/tools/assistant/LICENSE.GPL b/tqtinterface/qt4/tools/assistant/LICENSE.GPL deleted file mode 100644 index 3221c03..0000000 --- a/tqtinterface/qt4/tools/assistant/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tqtinterface/qt4/tools/assistant/assistant.icns b/tqtinterface/qt4/tools/assistant/assistant.icns deleted file mode 100644 index a6dbcdd..0000000 Binary files a/tqtinterface/qt4/tools/assistant/assistant.icns and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/assistant.ico b/tqtinterface/qt4/tools/assistant/assistant.ico deleted file mode 100644 index eb43249..0000000 Binary files a/tqtinterface/qt4/tools/assistant/assistant.ico and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/assistant.pro b/tqtinterface/qt4/tools/assistant/assistant.pro deleted file mode 100644 index 1d8ba5c..0000000 --- a/tqtinterface/qt4/tools/assistant/assistant.pro +++ /dev/null @@ -1,72 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ -TARGET = assistant - -CONFIG += qt warn_off - -PROJECTNAME = Assistant -DESTDIR = ../../bin - -SOURCES += main.cpp \ - helpwindow.cpp \ - topicchooserimpl.cpp \ - docuparser.cpp \ - helpdialogimpl.cpp \ - settingsdialogimpl.cpp \ - index.cpp \ - profile.cpp \ - config.cpp - -HEADERS += helpwindow.h \ - topicchooserimpl.h \ - docuparser.h \ - helpdialogimpl.h \ - settingsdialogimpl.h \ - index.h \ - profile.h \ - config.h - -#DEFINES += QT_PALMTOPCENTER_DOCS -DEFINES += QT_INTERNAL_NETWORK QT_INTERNAL_XML -include( ../../src/qt_professional.pri ) - -win32:RC_FILE = assistant.rc -mac:RC_FILE = assistant.icns - -target.path = $$bins.path -INSTALLS += target - -assistanttranslations.files = *.qm -assistanttranslations.path = $$translations.path -INSTALLS += assistanttranslations - -TRANSLATIONS = assistant_de.ts \ - assistant_fr.ts - -unix:!zlib:LIBS += -lz - -FORMS = mainwindow.ui \ - topicchooser.ui \ - finddialog.ui \ - helpdialog.ui \ - settingsdialog.ui \ - tabbedbrowser.ui -IMAGES = images/editcopy.png \ - images/find.png \ - images/home.png \ - images/next.png \ - images/previous.png \ - images/print.png \ - images/whatsthis.xpm \ - images/book.png \ - images/designer.png \ - images/assistant.png \ - images/linguist.png \ - images/qt.png \ - images/zoomin.png \ - images/zoomout.png \ - images/splash.png \ - images/appicon.png \ - images/addtab.png \ - images/closetab.png \ - images/d_closetab.png diff --git a/tqtinterface/qt4/tools/assistant/assistant.rc b/tqtinterface/qt4/tools/assistant/assistant.rc deleted file mode 100644 index b4786ce..0000000 --- a/tqtinterface/qt4/tools/assistant/assistant.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "assistant.ico" diff --git a/tqtinterface/qt4/tools/assistant/assistant_de.qm b/tqtinterface/qt4/tools/assistant/assistant_de.qm deleted file mode 100644 index c50e90f..0000000 Binary files a/tqtinterface/qt4/tools/assistant/assistant_de.qm and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/assistant_de.ts b/tqtinterface/qt4/tools/assistant/assistant_de.ts deleted file mode 100644 index 15b0b97..0000000 --- a/tqtinterface/qt4/tools/assistant/assistant_de.ts +++ /dev/null @@ -1,1084 +0,0 @@ - - - Assistant - - Welcome to the <b>Qt Assistant</b>. Qt Assistant will give you quicker access to help and tips while using applications like Qt Designer. - Wilkommen bei <b>Qt Assistant</b>. Qt Assistant ermöglicht einen schnellen Zugriff der Onlinehilfe während dem Arbeiten mit Programmen wie dem Qt Designer. - - - Qt Assistant - Qt Assistant - - - - AssistantServer - - Qt Assistant - Qt Assistant - - - Failed to bind to port %1 - Kann Port %1 nicht binden - - - - FindDialog - - Find Text - Textsuche - - - &Find: - &Suchen: - - - &Find - &Suchen - - - Close - Schließen - - - &Direction - Rich&tung - - - Forwar&d - &Vorwärts - - - &Backward - &Rückwärts - - - &Options - &Optionen - - - &Whole words only - &Ganze Wörter - - - &Case sensitive - Groß- und &Kleinschreibung beachten - - - Qt Assistant - Find Text - Qt Assistant - Textsuche - - - Enter the text you are looking for. - Geben Sie den Suchtext ein. - - - Search reached end of the document - Die Suche hat das Ende des Dokuments erreicht - - - Search reached start of the document - Die Suche hat den Anfang des Dokuments erreicht - - - Text not found - Text nicht gefunden - - - Fo&rward - Vo&rwärts - - - F&ind: - Su&chen: - - - C&lose - Sch&ließen - - - Alt+L - - - - Alt+F - - - - - HelpDialog - - Index - Index - - - Bookmarks - Lesezeichen - - - Con&tents - Inhal&t - - - Qt Reference Documentation - Qt Referenzdokumentation - - - Qt Designer Manual - Qt Designer Handbuch - - - Qt Linguist Manual - Qt Linguist Handbuch - - - Qt Assistant Manual - Qt Assistant Handbuch - - - Qt Assistant - Qt Assistant - - - Open Link in Current Window - Öffne Link im aktuellen Fenster - - - Open Link in New Window - Öffne Link in neuem Fenster - - - Contents - Inhalt - - - Search - Suche - - - Prepare... - Initialisiere... - - - Cannot open the index file %1 - Kann Indexdatei %1 nicht öffnen - - - Warning - Warnung - - - Documentation file %1 does not exist! -Skipping file. - Dokumentation %1 existiert nicht! -Überspringe Datei. - - - Parse Error - Syntaxfehler - - - Done - Fertig - - - Indexing files... - Indiziere Dokumentation... - - - Reading dictionary... - Lese Suchindex... - - - Full Text Search - Volltextsuche - - - Using a wildcard within phrases is not allowed. - Wildcards innerhalb von Phrasen sind nicht zugelassen. - - - The closing quotation mark is missing. - Das schließende Anführungszeichen fehlt. - - - Open Link in Current Tab - Link im Aktuellen Tab öffnen - - - Open Link in New Tab - Link in einem neuen Tab öffnen - - - Failed to load keyword index file -Assistant will not work! - Die Indexdatei konnte nicht geladen werden. -Der Assistent ist nicht einsatzbereit! - - - Documentation file %1 is not compatible! -Skipping file. - Dokumentation %1 ist nicht kompatibel! Datei wird übersprungen. - - - Failed to save fulltext search index -Assistant will not work! - Der Index für die Volltextsuche konnte nicht gespeichert werden. -Der Assistent ist nicht einsatzbereit! - - - - HelpDialogBase - - Help - Hilfe - - - <b>Help</b><p>Choose the topic you need help for from the contents list, or search the index for keywords.</p> - <b>Hilfe</b><p>Wählen Sie ein Thema vom Inhaltsverzeichnis oder suchen Sie im Index nach Schlüsselwörtern.</p> - - - Displays help topics organized by category, index or bookmarks - Zeigt die Hilfethemen unterteilt in Kategorien, Indizes oder Lesezeichen an - - - Con&tents - Inhal&t - - - Column 1 - Spalte 1 - - - <b>Help topics organized by category.</b><p>Double-click an item to see which topics are in that category. To view a topic, select it, and then click <b>Display</b>.</p> - <b>Die Hilfethemen sind nach Kategorien organisiert.</b><p>Ein Doppelklick auf einen Eintrag zeigt die Themen dieser Kategorie an. Um ein Thema anzuzeigen, wählen Sie es aus und drücken Sie <b>Anzeigen</b>.</p> - - - &Index - &Index - - - &Look For: - Suchen &nach: - - - Enter keyword - Geben Sie ein Schlüsselwort ein - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>Geben Sie ein Schlüsselwort ein.</b><p>Es wird dann der Eintrag aus der Liste ausgewählt, der am besten mit dem eingegebenen Begriff übereinstimmt.</p> - - - <b>List of available help topics.</b><p>Double-click on an item to open up the help page for this topic. You will have to choose the right page if more than one are found.</p> - <b>Liste aller verfügbaren Hilfethemen.</b><p>Ein Doppelklick auf einen Eintrag öffnet die dazugehörige Hilfeseite. Wenn es mehrere Seiten zu einem Eintrag gibt, wählen Sie die gewünschte aus.</p> - - - &Bookmarks - L&esezeichen - - - Displays the list of bookmarks. - Zeigt alle Lesezeichen an. - - - &New Bookmark - &Neues Lesezeichen - - - Add new bookmark - Füge neues Lesezeichen hinzu - - - Add the current displayed page as new bookmark to the list. - Füge die aktuelle Seite als Lesezeichen hinzu. - - - D&elete Bookmark - &Lösche Lesezeichen - - - Delete bookmark - Lösche Lesezeichen - - - Delete the selected bookmark from the list. - Lösche markiertes Lesezeichen. - - - Preparing... - Initialisiere... - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>Hilfe</b><p>Wählen Sie ein Hilfethema aus dem Inhalt oder suchen Sie im Index nach Schlüsselwörtern.</p> - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - Zeigt Hilfethemen geordnet nach Kategorie, Index oder Lesezeichen an. Ein weiterer Abschnitt enthält die Volltextsuche. - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>Hilfethemen geordnet nach Kategorie.</b><p>Doppelklicken Sie einen Eintrag, um die Themen dieser Kategorie zu sehen. Doppelklicken Sie ein Thema, um es angezeigt zu bekommen.</p> - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>Liste aller verfügbaren Hilfethemen.</b><p>Doppelklicken Sie auf einen Eintrag, um die Hilfe zu öffnen. Wenn mehr als eine Seite gefunden wurde, wählen Sie die gewünschte Seite aus.</p> - - - &New - &Neu - - - Add the currently displayed page as a new bookmark. - Füge aktuelle Seite zu den Lesezeichen hinzu. - - - &Delete - &Löschen - - - Delete the selected bookmark. - Lösche markiertes Lesezeichen. - - - &Search - &Suche - - - Searching f&or: - Suche &nach: - - - Enter searchword(s). - Suchebegriff(e). - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>Geben Sie Suchbegriffe ein.</b><p>Geben Sie hier die gesuchten Begriffe ein. Die Begriffe können Wildcards (*) enthalten. Eine Phrase muß in Anführungszeichen stehen.</p> - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>Gefundene Dokumente</b><p>Diese Liste beinhaltet alle gefundenen Dokumente der letzten Suche. Die Dokumente sind nach der Häufigkeit der Treffer geordnet.</p> - - - Found &Documents: - Gefundene &Dokumente: - - - He&lp - Hi&lfe - - - Display the help page. - Zeigt die Hilfe an. - - - Display the help page for the full text search. - Zeigt die Hilfeseite für die Volltextsuche an. - - - Start searching. - Starte Suche. - - - Pressing this button starts the search. - Startet die Suche. - - - - HelpWindow - - Qt Assistant by Trolltech - %1 - Qt Assistant von Trolltech - %1 - - - Help - Hilfe - - - Can't load and display non-local file -%1 - Kann gewünschte Datei nicht laden: -%1 - - - Open Link in New WindowShift+LMB - Öffne Link in neuem Fenster - - - Currently no Web browser is selected. -Please use the settings dialog to specify one! - - Es ist kein Webbrowser ausgewählt. -Öffnen Sie bitten den "Einstellungen" Dialog um einen Webbrowser auszuwählen. - - - - Qt Assistant by Trolltech - %1%2 - Qt Assistant von Trolltech - %1%2 - - - No PDF Viewer has been specified -Please use the settings dialog to specify one! - - Es wurde kein PDF Betrachter angegeben. -Bitte diesen im Menue Einstellungen festlegen! - - - - Qt Assistant is unable to start the PDF Viewer - -%1 - -Please make sure that the executable exists and is located at -the specified location. - Der Qt Assistent konnte den PDF betrachter -%1 nicht laden. -Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert. - - - Open Link in New Tab - Link in einenm neuen Tab öffnen - - - - Index - - Untitled - Unbenannt - - - - MainWindow - - Qt Assistant by Trolltech - Qt Assistant von Trolltech - - - Toolbar - Werkzeugleiste - - - Print - Drucken - - - &Print... - &Drucken... - - - Exit - Beenden - - - E&xit - &Beenden - - - Copy - Kopieren - - - &Copy - &Kopieren - - - Find in Text - Textsuche - - - &Find in Text... - Text&suche... - - - Home - Startseite - - - &Home - St&artseite - - - Previous - Vorherige - - - &Previous - &Vorherige - - - Next - Nächste - - - &Next - &Nächste - - - About - Über - - - About Qt - Über Qt - - - Qt Class Reference - Qt Klassenreferenz - - - Qt Designer Manual - Qt Designer Handbuch - - - Zoom in - Vergrößern - - - Zoom &in - Ver&größern - - - Zoom out - Verkleinern - - - Zoom &out - Ver&kleinern - - - Qt Linguist Manual - Qt Linguist Handbuch - - - &Settings - &Einstellungen - - - &Settings... - &Einstellungen... - - - New Window - Neues Fenster - - - New Window... - Neues Fenster... - - - Close - Schließen - - - Vie&ws - A&nsicht - - - Ctrl+T - Strg+T - - - - Ctrl+I - Strg+I - - - Ctrl+B - Strg+E - - - Qt Assistant - Qt Assistant - - - &Add Bookmark - &Füge Lesezeichen hinzu - - - Qt Reference Documentation - Qt Referenzdokumention - - - &File - &Datei - - - &Edit - &Bearbeiten - - - &View - &Ansicht - - - &Go - &Gehe zu - - - Boo&kmarks - &Lesezeichen - - - &Help - &Hilfe - - - Print the currently displayed page. - Drucke aktuelle Seite. - - - Ctrl+P - Strg+P - - - Quit Qt Assistant. - Beende Qt Assistant. - - - Ctrl+Q - Strg+Q - - - Copy the selected text to the clipboard. - Kopiere den markierten Text in die Zwischenablage. - - - Ctrl+C - Strg+C - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - Öffne den Suchdialog. Qt Assistant sucht in der aktuellen Seite nach dem eingegebenen Text. - - - Ctrl+F - Strg+F - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - Gehe zur Startseite. Qt Assistants Startseite ist die Qt Referenzdokumentation. - - - Ctrl+Home - Strg+Pos1 - - - Go to the previous page. - Gehe zur vorherigen Seite. - - - Alt+Left - Alt+Links - - - Go to the next page. - Gehe zur nächsten Seite. - - - Alt+Right - Alt+Rechts - - - Display further information about Qt Assistant. - Zeigt weitere Informationen zu Qt Assistant an. - - - Display further information about Qt. - Zeigt weitere Informationen zu Qt an. - - - Display the Qt Reference Documentation. - Zeigt die Qt Referenzdokumentation an. - - - Display the Qt Designer manual. - Zeigt das Qt Designer Handbuch an. - - - Zoom in on the document, i.e. increase the font size. - Vergrößert die Schrift. - - - Ctrl++ - Strg++ - - - Zoom out on the document, i.e. decrease the font size. - Verkleinert die Schrift. - - - Ctrl+- - Strg+- - - - Display the Guide to the Qt Translation Tools. - Zeigt die Anleitung zu den Qt Übersetzungswerkzeugen an. - - - Open the settings dialog. - Öffnet den "Einstellungen" Dialog. - - - Open a new window. - Öffnet ein neues Fenster. - - - Ctrl+N - Strg+N - - - &Close - &Schließen - - - Close the current window. - Schließt das aktuelle Fenster. - - - Qt Assistant Manual - Qt Assistant Handbuch - - - Display the Qt Assistant manual. - Zeigt das Qt Assistant Handbuch an. - - - F1 - F1 - - - Add the currently displayed page as a new bookmark. - Füge aktuelle Seite zu den Lesezeichen hinzu. - - - What's This? - Direkthilfe - - - "What's This?" context sensitive help. - Kontextbezogene Direkthilfe. - - - Shift+F1 - Umschalt+F1 - - - Ctrl+S - Strg+S - - - Initializing Qt Assistant... - Initialisiere Qt Assistant... - - - Go - Gehe zu - - - Find &Next - &Nächste finden - - - Find Next - Nächste finden - - - F3 - F3 - - - Find &Previous - &Vorigen finden - - - Find Previous - Vorigen finden - - - Shift+F3 - Umschalt+F3 - - - About Qt Assistant - Über den Qt Assistent - - - Settings - Einstellungen - - - Add Bookmark - Lesezeichen einfügen - - - Add Tab - Tab einfügen - - - Ctrl+Alt+N - - - - Next Tab - Nächster Tab - - - Ctrl+Alt+Right - - - - Previous Tab - Voriger Tab - - - Ctrl+Alt+Left - - - - Close Tab - Tab schließen - - - Ctrl+Alt+Q - - - - Failed to open about application contents in file: '%1' - - - - Failed to open link: '%1' - Der Link '%1' konnte nicht geöffnet werden - - - <div align="center"><h1>The page could not be found!</h1><br><h3>'%1'</h3></div> - <div align="Hauptseite nicht gefunden!</h1> - - - Error... - Fehler ... - - - - SettingsDialog - - all - Alle - - - Qt Assistant - Add Documentation - Qt Assistant - Hinzufügen von Dokumentation - - - Qt Assistant - Qt Assistant - - - Parse Error - Syntaxfehler - - - This item can not be deleted! - Dieser Eintrag kann nicht gelöscht werden! - - - This branch is not empty! -Firstly, all contents have to be removed. - Dieser Zweig ist nicht leer! -Es müssen zuerst alle Inhalte gelöscht werden. - - - Qt Assistant - Set Web Browser - Qt Assistant - Setze Webbrowser - - - Qt Assistant - Set PDF Browser - Qt Assistent - Setze PDF Betrachter - - - Qt Assistant - Set Homepage - Qt Assistent - Setzte Startseite - - - - SettingsDialogBase - - Settings - Einstellungen - - - Font: - Schriften: - - - Link color: - Linkfarbe: - - - Underline links - Unterstreiche Links - - - OK - OK - - - Cancel - Abbrechen - - - Fixed font: - Nicht-proportionale Schrift: - - - Qt Assistant - Settings - Qt Assistant - Einstellungen - - - General - Allgemein - - - Fix&ed font: - &Nicht-proportionale Schrift: - - - &Font: - &Schrift: - - - &Underline links - &Unterstreiche Links - - - Web - Web - - - &Web Browser Application: - &Webbrowser Anwendung: - - - ... - ... - - - Documentation - Dokumentation - - - &Delete - &Lösche - - - &Add... - &Hinzufügen... - - - Categories - Kategorien - - - Category &Name: - Kategorie&name: - - - &Add - &Hinzufügen - - - &OK - &OK - - - &Cancel - &Abbrechen - - - &General - &Haupt - - - &Web - &Web - - - Web &Browser Application: - Web&browser: - - - &Home page - &Startseite - - - &PDF - &PDF - - - PDF &Application - PDF &Betrachter - - - - TabbedBrowser - - TabbedBrowser - - - - Untitled - Unbenannt - - - Add page - Seite einfügen - - - Close page - Seite schließen - - - - TopicChooser - - Choose a topic for <b>%1</b> - Wählen Sie ein Thema für <b>%1</b> - - - - TopicChooserBase - - Choose Topic - Thema wählen - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - Wählen Sie ein Thema aus der Liste aus und klicken Sie <b>Anzeigen</b> um die Hilfe zu öffnen. - - - &Topics - &Themen - - - Displays a list of available help topics for the keyword. - Zeigt eine Liste der verfügbaren Hilfethemen für diesen Begriff an. - - - &Display - &Anzeigen - - - Open the topic selected in the list. - Öffne das gewählte Thema aus der Liste. - - - &Close - &Schließen - - - Close the Dialog. - Schließt den Dialog. - - - diff --git a/tqtinterface/qt4/tools/assistant/assistant_fr.ts b/tqtinterface/qt4/tools/assistant/assistant_fr.ts deleted file mode 100644 index 0dfa69f..0000000 --- a/tqtinterface/qt4/tools/assistant/assistant_fr.ts +++ /dev/null @@ -1,426 +0,0 @@ - - - Assistant - - Welcome to the <b>Qt Assistant</b>. Qt Assistant will give you quicker access to help and tips while using applications like Qt Designer. - - - - Qt Assistant - - - - - FindDialog - - Find Text - - - - &Find: - - - - &Find - - - - Close - - - - &Direction - - - - Forwar&d - - - - &Backward - - - - &Options - - - - &Whole words only - - - - &Case sensitive - - - - - HelpDialog - - Index - - - - Bookmarks - - - - Con&tents - - - - Qt Reference Documentation - - - - Qt Designer Manual - - - - Qt Linguist Manual - - - - Qt Assistant Manual - - - - Qt Assistant - - - - - HelpDialogBase - - Help - - - - <b>Help</b><p>Choose the topic you need help for from the contents list, or search the index for keywords.</p> - - - - Displays help topics organized by category, index or bookmarks - - - - Con&tents - - - - Column 1 - - - - <b>Help topics organized by category.</b><p>Double-click an item to see which topics are in that category. To view a topic, select it, and then click <b>Display</b>.</p> - - - - &Index - - - - &Look For: - - - - Enter keyword - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open up the help page for this topic. You will have to choose the right page if more than one are found.</p> - - - - &Bookmarks - - - - Displays the list of bookmarks. - - - - &New Bookmark - - - - Add new bookmark - - - - Add the current displayed page as new bookmark to the list. - - - - D&elete Bookmark - - - - Delete bookmark - - - - Delete the selected bookmark from the list. - - - - Preparing... - - - - - HelpWindow - - Qt Assistant by Trolltech - %1 - - - - Help - - - - Can't load and display non-local file -%1 - - - - Open Link in New WindowShift+LMB - - - - - MainWindow - - Qt Assistant by Trolltech - - - - Toolbar - - - - Print - - - - &Print... - - - - Exit - - - - E&xit - - - - Copy - - - - &Copy - - - - Find in Text - - - - &Find in Text... - - - - Home - - - - &Home - - - - Previous - - - - &Previous - - - - Next - - - - &Next - - - - About - - - - About - - - - About Qt - - - - About Qt - - - - Qt Class Reference - - - - Qt Designer Manual - - - - Zoom in - - - - Zoom &in - - - - Zoom out - - - - Zoom &out - - - - Qt Linguist Manual - - - - &Settings - - - - &Settings... - - - - New Window - - - - New Window... - - - - Close - - - - Vie&ws - - - - Ctrl+T - - - - Ctrl+I - - - - Ctrl+B - - - - Qt Assistant - - - - &Add Bookmark - - - - Qt Reference Documentation - - - - - SettingsDialogBase - - Settings - - - - Font: - - - - Link color: - - - - Underline links - - - - OK - - - - Cancel - - - - Fixed font: - - - - - TopicChooser - - Choose a topic for <b>%1</b> - - - - - TopicChooserBase - - Choose Topic - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - - - - &Topics - - - - Displays a list of available help topics for the keyword. - - - - &Display - - - - Open the topic selected in the list. - - - - &Close - - - - Close the Dialog. - - - - diff --git a/tqtinterface/qt4/tools/assistant/book/assistant.book b/tqtinterface/qt4/tools/assistant/book/assistant.book deleted file mode 100644 index feb6588..0000000 --- a/tqtinterface/qt4/tools/assistant/book/assistant.book +++ /dev/null @@ -1,6 +0,0 @@ -\title Qt Assistant Manual - -\granularity chapter - -\input assistant.leaf - diff --git a/tqtinterface/qt4/tools/assistant/book/assistant.leaf b/tqtinterface/qt4/tools/assistant/book/assistant.leaf deleted file mode 100644 index 57bab4c..0000000 --- a/tqtinterface/qt4/tools/assistant/book/assistant.leaf +++ /dev/null @@ -1,563 +0,0 @@ -\chapter Introduction - -This document introduces \QA, a tool for presenting on-line -documentation. It also introduces the Qt Reference Documentation which -is accessible using \QA, or with a web browser. The document is -divided into the following sections: - -\list -\i Introduction to the Qt Reference Documentation -\i The 1 Minute Guide to using Qt Assistant -\i Qt Assistant in More Detail -\i Full Text Searching -\i Customizing Qt Assistant -\endlist - -\chapter Introduction to the Qt Reference Documentation - -The documentation for the Qt library is written in-line in the \File -.cpp files by the developers themselves. The documentation team -revises the documentation to ensure that it is accurate and usable, -and to provide quality control. The documentation team also writes the -larger texts, such as the class descriptions that introduce a class -along with the concepts the class uses, as well as introducing the -functions and properties that the class provides. - -The documentation focuses on the API rather than the internals, since -we make great efforts to keep our API consistent and compatible with -each new version, but we may change the internals considerably to improve -performance and enhance functionality. - -The Qt Reference Documentation consists of almost 1,500 HTML pages -(over 2,500 printed pages). The overwhelming majority of pages -document Qt classes. Since developers differ in the way they -think and work we provide a variety of approaches to navigating the -documentation set: - -\list - -\i The \link classes.html All Classes\endlink page lists every class -in Qt's public API, and consists of several hundred classes. - -\i The \link mainclasses.html Main Classes\endlink page lists the -classes you're most likely to use most often, and provides a much -shorter and more managable list than the All Classes list. - -\i The \link groups.html Grouped Classes\endlink page presents a list -of groups, each of which leads to a list of related classes, for -example, the \link advanced.html Advanced Widgets\endlink list. - -\i The \link hierarchy.html Inheritance Hierarchy\endlink page -presents a list of classes in terms of the hierarchy of Qt classes. - -\i The \link functions.html All Functions\endlink page lists all the -functions provided by Qt classes, each one with links to the class(es) -in which it appears. - -\endlist - -No matter where you find yourself in the Qt documentation, you will -find extensive cross-referencing. Even snippets of example code -contain clickable links, so that for example, if you come across a -class declaration in a code example, the class name will be a -clickable link to the class's documentation. - -In addition to the class documentation some of Qt's modules have -extensive descriptions, and there are many overview documents which -describe various aspects of the Qt library; all these are linked from -the reference documentation home page. There are also two tutorials -and numerous example programs in the examples subdirectory of the Qt -distribution. - -\chapter The 1 Minute Guide to Using Qt Assistant - -Under Windows, \QA is available as a menu option on the Qt menu. On -Unix, run \c{assistant} from an xterm. - -When you start up \QA, you will be presented with a standard -main-window style application, with a menu bar and toolbar. Below -these, on the left hand side is a navigation window called the \e -Sidebar, and on the right, taking up most of the space, is the -documentation window. By default, the Qt Reference Documentation's home -page is shown in the documentation window. - -\QA works in a similar way to a web browser. If you click underlined -text (which signifies a cross-reference), the documentation window will -present the relevant page. You can bookmark pages of particular -interest and you can click the \Toolbutton Previous and \Toolbutton -Next toolbar buttons to navigate within the pages you've visited. - -Although \QA can be used just like a web browser to navigate through -the Qt documentation set, \QA offers a powerful means of navigation -that web browsers don't provide. \QA uses an intelligent algorithm to -index all the pages in the documentation sets that it presents so that -you can search for particular words and phrases. - -To perform an index search, click the \Toolbutton Index tab on the Sidebar -(or click \Key Ctrl+I). In the 'Look For' line edit enter a word, e.g. -'homedirpath'. As you type, words are found and highlighted in a list -beneath the line edit. If the highlighted text matches what you're -looking for, double click it, (or press \Key Enter) and the -documentation window will display the relevant page. You rarely have -to type in the whole word before \QA finds a match. Note that for some -words there may be more than one possible page that is relevant. - -\QA also provides full text searching for finding specific words in -the documentation. Documents with the highest occurrences of the word -that you are looking for appear first, and every occurrence of the -word within the documentation is highlighted. - -\omit -For example, enter 'setenabled' in the 'Look For' line edit. -As you type, words are found and highlighted in the list beneath the -line edit, as before. Once the highlighted text matches what you're -looking for, double click it, (or press \Key Enter). In the case of -setEnabled, it is a function name which occurs in several classes, so -a dialog pops up listing the possible choices. Click the choice you're -interested in (or move to it using the \Key Up and \Key Down arrow -keys and press \Key Enter). The relevant page will display in the -documentation window. -\endomit - -\QA can be customized by creating profiles, a collection of -documentation. Profiles can be created for your own use, or for an -application you will distribute. With profiles, you can select which -documentation you want the end user of your application to be able to -view. - -\chapter Qt Assistant in More Detail - -\img assistant.png -\caption Qt Assistant - -\section1 The Sidebar - -\img sidebar.png - -The sidebar provides four ways of navigating documentation: -\list 1 -\i The \Toolbutton Contents tab presents a tree view of the -documentation sets that are available. If you click an item, its -documentation will appear in the documentation window. If you double -click an item or click a '+' sign to the left of an item, the item's -sub-items will appear. Click a sub-item to make its page appear in the -documentation window. Click a '-' sign to the left of an item to hide -its sub-items. -\i The \Toolbutton Index tab is used to look up key words or phrases. -See \l{The 1 Minute Guide to using Qt Assistant} for how to use this -tab. -\i The \Toolbutton Bookmarks tab lists any bookmarks you've made. -Double click a bookmark to make its page appear in the documentation -window. The \Toolbutton Bookmarks tab has a \Button{New Bookmark} -button and a \Button{Delete Bookmark} button at the bottom. Click -\Button{New Bookmark} to bookmark the page that is showing in the -documentation window. Click a bookmark in the list, then click -\Button{Delete Bookmark} to delete the highlighted bookmark. -\i The \Toolbutton Search tab provides full text search of \e all -the documents. See \l{Full Text Searching} for more information about -this feature. -\endlist - -If you want the documentation window to use as much space as possible, -you can easily hide or show the Sidebar. If the Sidebar is showing, -press \Key Ctrl+T, \Key Ctrl+I, \Key Ctrl+B or \Key Ctrl+S to hide it. -If the Sidebar is hidden, press \Key Ctrl+T to show it on the Contents -tab, or press \Key Ctrl+I to show it on the Index tab (with the focus -in the 'Look For' line edit box), or press \Key Ctrl+B to show it on -the Bookmarks tab, or press \Key Ctrl+S to show it on the (full text) -Search tab. - -The Sidebar is a dock window, so you can drag it to the top, left, -right or bottom of \QA's window, or you can drag it outside \QA to -float it. - -\section1 The Documentation Window - -\img docwindow.png - -The documentation window offers a feature for viewing documentation by -enabling you to create tabs for each documentation page that you view. -Click the \Button {Add Tab} button and a new tab will appear with the -page name as the tab's caption. This makes it convenient to switch -between pages when you are working with different documentation. You -can delete a tab by clicking the \Button {Close Tab} button located -on the right side of the documentation window. - -\section1 The Toolbar - -\img toolbar1.png - -The toolbar provides fast access to the most common actions. -\list -\i \Toolbutton Previous takes you to the previous page. The menu -option is \Menu Go|Previous and the keyboard shortcut is \Key{Alt+Left -Arrow}. -\i \Toolbutton Next takes you to the next page. The menu -option is \Menu Go|Next and the keyboard shortcut is \Key{Alt+Right -Arrow}. -\i \Toolbutton Home takes you to the home page (normally the home page -of the Qt Reference Documentation). The menu -option is \Menu Go|Home and the keyboard shortcut is \Key{Ctrl+Home}. -\i \Toolbutton Copy copies any selected text to the clipboard. The menu -option is \Menu Edit|Copy and the keyboard shortcut is \Key{Ctrl+C}. -\i \Toolbutton{Find in Text} invokes the \Dialog{Find Text} dialog. The menu -option is \Menu{Edit|Find in Text} and the keyboard shortcut is \Key{Ctrl+F}. -\i \Toolbutton{Print} invokes the \Dialog{Print} dialog. The menu -option is \Menu{File|Print} and the keyboard shortcut is \Key{Ctrl+P}. -\i \Toolbutton{Zoom in} increases the font size. The menu -option is \Menu{View|Zoom in} and the keyboard shortcut is \Key{Ctrl++}. -\i \Toolbutton{Zoom out} decreases the font size. The menu -option is \Menu{View|Zoom out} and the keyboard shortcut is \Key{Ctrl+-}. -\i \Toolbutton{What's This?} provides a description of a \QA feature. -The menu option is \Menu{Help|What's This?} and the keyboard shortcut -is \Key{Shift+F1}. -\endlist - -The remaining toolbar buttons are bookmarks and will vary depending on -your configuration. - -\section1 The Menus - -\section2 The File Menu - -\list -\i \Menu{File|Print} invokes the \Dialog{Print} dialog. -\i \Menu{File|Exit} terminates \QA. -\endlist - -\section2 The Edit Menu - -\list -\i \Menu{Edit|Copy} copies any selected text to the clipboard. -\i \Menu{Edit|Find in Text} invokes the \Dialog{Find Text} dialog. -\i \Menu{Edit|Settings} invokes the \Dialog{Settings} dialog. -\endlist - -\section2 The View Menu - -\list -\i \Menu{View|Zoom in} increases the font size. -\i \Menu{View|Zoom out} decreases the font size. -\i \Menu{View|Views|Sidebar} toggles the display of the Sidebar. -\i \Menu{View|Views|Toolbar} toggles the display of the Toolbar. -\i \Menu{View|Views|Line up} lines up the toolbar buttons in the -Toolbar. -\endlist - -\section2 The Go Menu - -\list -\i \Menu{Go|Previous} displays the previous page. -\i \Menu{Go|Next} displays the next page. -\i \Menu{Go|home} goes to the home page. -\endlist -This menu also has additional items; these are pre-defined bookmarks -that vary depending on your configuration. - -\section2 The Bookmarks Menu - -\list -\i \Menu{Bookmarks|Add} adds the current page to the list of bookmarks. -\endlist -This menu may have additional items, i.e. any bookmarks that you have -already made. If you want to delete a bookmark go to the Bookmarks tab -on the Sidebar. - -\section1 The Dialogs - -\section2 The Print Dialog - -This dialog is platform-specific. It gives access to various printer -options and can be used to print the current page. - -\section2 The Find Text Dialog - -This dialog is used to find text in the current page. Enter the text -you want to find in the Find line edit. If you check the 'Whole words -only' checkbox, the search will only consider whole words, i.e. if you -search for 'spin' with this checkbox checked it will not match -'spinbox', but will match 'spin'. If you check the 'Case sensitive' -check box then, for example, 'spin' will match 'spin' but not 'Spin'. -You can search Forward or Backward from your current position in the -page by clicking one of the Direction radio buttons. Click the \Button -Find button to search (or search again), and click the \Button Close -button to finish. - -\section2 The Settings Dialog - -The Settings dialog is used to set your preferences for \QA. The -dialog has four tabs: General Settings, Web Settings, PDF Settings, -and Profiles. \QA will remember your settings between sessions, -including window sizes and positions, and which pages you have open. -Each of the tabs is discussed as follows: - -\list -\i General Settings - -\img general.png - -To change the base font used throughout \QA, select a -font type from the Font combobox. To choose a new fixed-width -font, for example, to show code snippets, choose a font type from -the 'Fixed font' combobox. To change the color of hypertext -links, click the 'Link color' color button. Uncheck the -'Underline links' checkbox if you don't want underlined links. - -\i Web Settings - -\img web.png - -Some pages contain links to external web pages. In order to display -these links, you must specify a web browser. Type the name of your -browser's executable in the Web Browser Application line edit. -Alternatively, click the \Button {(ellipsis)} button to invoke the -\Widget {Set Web Browser} dialog and navigate until you find the web -browser you want to use. Click \Button {Save} to accept the selection. - -To change \QA's default home page, enter the file name in the Home -Page line edit. Alternatively, click the \Button {(ellipsis)} button -to invoke the \Widget {Set Homepage} dialog. Navigate until you find -the home page file you want to use and then click \Button {Save} to -accept the selection. - -\i PDF Settings - -\img pdf1.png - -Some pages contain links to PDF documents. In order to display these -links, you must specify a PDF viewer. Type in the name of your PDF viewer's -executable in the line edit. Alternatively, click the \Button {(ellipsis)} -button to invoke the \Widget {Set PDF Browser} dialog and navigate -until you find the PDF viewer you want to use. Click \Button Save to -accept the selection. - -\chapter Full Text Searching - -\img search.png - -\QA provides a powerful full text search engine. To search -for certain words or text, click the 'Search' tab in the sidebar. Then -enter the text you want to look for and press \Key Enter or click -\Button Search. The search is not case sensitive, so Foo, fOo and -FOO are all treated as the same. The following are examples of common search -patterns: - -\list -\i \c deep -- lists all the documents that contain the word 'deep' - -\i \c{deep*} -- lists all the documents that contain a word beginning -with 'deep' - -\i \c{deep copy} -- lists all documents that contain both 'deep' \e -and 'copy' - -\i \c{"deep copy"} -- list all documents that contain the phrase 'deep copy' -\endlist - -The wildcard (*) character cannot be used within quotes. - -The list of documents found is ordered according to the number of -occurrences of the search text they contain, therefore those with the -highest number of occurrences appearing first. Simply click any -document in the list to display it in the document window. - -If the documentation has changed, i.e. if documents have been added or -removed, \QA will reindex. - -\chapter Customizing Qt Assistant - -\QA can be customized by adding and removing documentation from its -documentation set. In addition, \QA introduces the profiles option, -which enables its properties to change, for example, the default -startup page, and application icon. - -\section1 Modifying the Default Documentation Set - -When it is started without any options, \QA displays a default set of -documentation. When Qt is installed, the default documentation set in -\QA contains the Qt reference documentation as well as the tools that -come with Qt, such as \QD and qmake. - -Documentation can be added or removed from \QA by -adding and removing the content files. The format of the content files are -specified below. To add a content file, type the following command line -option: \c{-addContentFile docfile}. To remove a content file from the -default set, type the following command line option: -\c{-removeContentFile docfile}. For example: - -\code -1: > assistant -addContentFile file.dcf -2: > assistant -3: > assistant -removeContentFile file.dcf -\endcode - -In line one, we add the content file \c file.dcf. In line two, we start -\QA. The default set will now be extended with the doc file -\c file.dcf. In line three we remove the file \c file.dcf from the default -documentation set so that subsequent use of \QA will not contain this -file. - -\section2 Documentation Content File Format - -The Documentation Content File must contain the documentation's table -of contents and all important keywords for the index. In addition, it -may inherit an icon for the documentation which is displayed in the -\QA toolbar. You can also specify an extra directory path for -additional images used in the documentation. - -An example of a content file that uses all the available tags and -attributes is shown below: -\code - - -
-
- foo - bla -
-
-
-
-
-
-
-
-
-
-
- foo -
-
- - -\endcode - -Sections may be nested as deeply as necessary. All references should -be related. - -Note that any \c keyword tags for a given section must appear \e -before any sections nested within the given section. - -The paths in the \c refs attribute are always written Unix-style -(forward slashes) and are relative to the location of the -documentation content file itself. - -Since the introduction of the new root tag \c assistantconfig in the -fileformat from Qt version 3.2.0, it is possible to specify multiple DCF tags in -one file. Note that the old document contents file format, used up to -Qt 3.2 is still valid. - -\section1 Profiles - -Profiles enable \QA to act as a specialized help tool for displaying -documentation for applications. With profiles, the documentation -writer can change properties such as \QA's title, application icons, and -'about' dialogs. In addition, profiles can be used to run specialized -documentation sets that are separate from the Qt docs. \QA can be -customized by changing the following properties: - -\list - -\i Name- This property is used to name the profile. If multiple -profiles are used for the same installation of \QA, this -parameter is crucial to keep their profile specific settings -apart. The property name is \c name - -\i Title- This property is used to specify a caption for \QA. The -property name is \c title - -\i Application Icon- This property describes an icon that will be used -as \QA application icon. The location of the icon is relative to the -location of the profile. The property name is \c applicationicon - -\i Start Page- This property specifies which page \QA should initially -display when the profile is used. Usually, this is the HTML file which -contains the documentation's table of contents. This property also -describes the default location to go to when pressing the home button -in \QA's main user interface. The start page is specified relative to -the location of the profile. The property name is \c startpage - -\i About Menu Text- This property describes the text that appears in -the \Menu Help menu, e.g. About Application. The property name is \c -aboutmenutext - -\i About URL- This property can be used to point to an HTML file that -describes the contents in the About dialog that is opened for the -\Menu Help menu, e.g. About Application. The url is specified relative -to the location of the profile. The property name is \c abouturl - -\i \QA Documentation- This property describes the location of -the \QA documentation. This is required since \QA provides -self help, such as the full text search help and the \QA -Manual option in the \Menu Help menu. The location is a directory -relative to the location of the profile. The property name is \c -assistantdocs. - -\endlist - -To define a profile, one needs to specify a \QA Document -Profile, usually abbreviated \c{.adp}. The profile is an extension of -the Documentation Content File described above. We add a \c profile -tag containing \c property tags to the format. - -An example of a document profile file is shown below: - -\c helpdemo.adp - -\code - - - - HelpExample - Help Example - logo.png - index.html - About Help - ../about.txt - ../../../doc/html - - - -
- Install Docs - Example Profile - Hide Sidebar - Open - Close - Display -
-
- -
-\endcode - -These files are XML files. Characters such as \c{<}, \c{>}, and \c{&} -must be written as entities (e.g., \c{<}, \c{>}, \c{&}). - -\section2 Using Profiles - -To use a profile, run \QA with the option \c {-profile filename}. -This will load the profile specified in the file and will customize -\QA accordingly. For example, to run \QA with the example -file above, \c helpdemo.adp, we would run the command as follows: - -\code -> assistant -profile helpdemo.adp -\endcode - -See the HelpDemo example in the Qt distribution for a demonstration -on how to use \QA with profiles for your own applications. - -When distributing \QA with your application, you will also need to -copy the icon files from the \c QTDIR/tools/assistant/images -directory so that \QA finds its icons. - -\omit -For small documentation sets, the sidebar may not be necessary. You -can hide the sidebar on startup with the following: -\code -assistant -hideSidebar -\endcode -\endomit - diff --git a/tqtinterface/qt4/tools/assistant/book/images/assistant.png b/tqtinterface/qt4/tools/assistant/book/images/assistant.png deleted file mode 100644 index a283fcb..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/assistant.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/docwindow.png b/tqtinterface/qt4/tools/assistant/book/images/docwindow.png deleted file mode 100644 index a49b3d5..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/docwindow.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/general.png b/tqtinterface/qt4/tools/assistant/book/images/general.png deleted file mode 100644 index 841a6b6..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/general.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/pdf1.png b/tqtinterface/qt4/tools/assistant/book/images/pdf1.png deleted file mode 100644 index ead5d84..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/pdf1.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/search.png b/tqtinterface/qt4/tools/assistant/book/images/search.png deleted file mode 100644 index 84f8ce4..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/search.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/sidebar.png b/tqtinterface/qt4/tools/assistant/book/images/sidebar.png deleted file mode 100644 index a55c670..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/sidebar.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/toolbar1.png b/tqtinterface/qt4/tools/assistant/book/images/toolbar1.png deleted file mode 100644 index ab91b1e..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/toolbar1.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/book/images/web.png b/tqtinterface/qt4/tools/assistant/book/images/web.png deleted file mode 100644 index 57e25b9..0000000 Binary files a/tqtinterface/qt4/tools/assistant/book/images/web.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/config.cpp b/tqtinterface/qt4/tools/assistant/config.cpp deleted file mode 100644 index 1cbccbc..0000000 --- a/tqtinterface/qt4/tools/assistant/config.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "config.h" -#include "profile.h" -#include "docuparser.h" - -#include -#include -#include -#include -#include -#include - -static Config *static_configuration = 0; - -inline TQString getVersionString() -{ - return TQString::number( (TQT_VERSION >> 16) & 0xff ) - + "." + TQString::number( (TQT_VERSION >> 8) & 0xff ); -} - -Config::Config() - : hideSidebar( FALSE ), profil( 0 ), maximized(FALSE) -{ - fontSiz = tqApp->font().pointSize(); - if( !static_configuration ) { - static_configuration = this; - } else { - qWarning( "Multiple configurations not allowed!" ); - } -} - -Config *Config::loadConfig(const TQString &profileFileName) -{ - Config *config = new Config(); - - if (profileFileName.isEmpty()) { // no profile - config->profil = Profile::createDefaultProfile(); - config->load(); - config->loadDefaultProfile(); - return config; - } - - TQFile file(profileFileName); - if (!file.exists()) { - qWarning( "File does not exist: " + profileFileName ); - return 0; - } - DocuParser *parser = DocuParser::createParser( profileFileName ); - if (!parser) { - qWarning( "Failed to create parser for file: " + profileFileName ); - return 0; - } - if (parser->parserVersion() < DocuParser::TQt320) { - qWarning( "File does not contain profile information" ); - return 0; - } - DocuParser320 *profileParser = static_cast(parser); - parser->parse(&file); - config->profil = profileParser->profile(); - if (!config->profil) { - qWarning( "Config::loadConfig(), no profile in: " + profileFileName ); - return 0; - } - config->profil->setProfileType(Profile::UserProfile); - config->profil->setDocuParser(profileParser); - config->load(); - return config; -} - -Config *Config::configuration() -{ - TQ_ASSERT( static_configuration ); - return static_configuration; -} - -void Config::load() -{ - const TQString key = "/TQt Assistant/" + getVersionString() + "/"; - const TQString profkey = key + "Profile/" + profil->props["name"] + "/"; - - TQSettings settings; - settings.insertSearchPath( TQSettings::Windows, "/Trolltech" ); - - webBrows = settings.readEntry( key + "Webbrowser" ); - home = settings.readEntry( profkey + "Homepage" ); - pdfApp = settings.readEntry( key + "PDFApplication" ); - linkUnder = settings.readBoolEntry( key + "LinkUnderline", TRUE ); - linkCol = settings.readEntry( key + "LinkColor", "#0000FF" ); - src = settings.readListEntry( profkey + "Source" ); - sideBar = settings.readNumEntry( key + "SideBarPage" ); - if (tqApp->type() != TQApplication::Tty) { - fontFam = settings.readEntry( key + "Family", tqApp->font().family() ); - - fontFix = settings.readEntry( key + "FixedFamily", "courier" ); - fontSiz = settings.readNumEntry( key + "Size", -1 ); - if ( fontSiz < 4 ) { - fontSiz = tqApp->font().pointSize(); - } - - geom.setRect( settings.readNumEntry( key + "GeometryX", TQApplication::desktop()->availableGeometry().x() ), - settings.readNumEntry( key + "GeometryY", TQApplication::desktop()->availableGeometry().y() ), - settings.readNumEntry( key + "GeometryWidth", 800 ), - settings.readNumEntry( key + "GeometryHeight", 600 ) ); - maximized = settings.readBoolEntry( key + "GeometryMaximized", FALSE ); - } - mainWinLayout = settings.readEntry( key + "MainwindowLayout" ); - rebuildDocs = settings.readBoolEntry( key + "RebuildDocDB", TRUE ); - - profileNames = settings.entryList( key + "Profile" ); -} - -void Config::save() -{ - saveSettings(); - saveProfile( profil ); -} - -void Config::saveSettings() -{ - const TQString key = "/TQt Assistant/" + getVersionString() + "/"; - const TQString profkey = key + "Profile/" + profil->props["name"] + "/"; - - TQSettings settings; - settings.insertSearchPath( TQSettings::Windows, "/Trolltech" ); - - settings.writeEntry( key + "Webbrowser", webBrows ); - settings.writeEntry( profkey + "Homepage", home ); - settings.writeEntry( key + "PDFApplication", pdfApp ); - settings.writeEntry( key + "LinkUnderline", linkUnder ); - settings.writeEntry( key + "LinkColor", linkCol ); - settings.writeEntry( profkey + "Source", src ); - settings.writeEntry( key + "SideBarPage", sideBarPage() ); - if (tqApp->type() != TQApplication::Tty) { - settings.writeEntry( key + "GeometryX", geom.x() ); - settings.writeEntry( key + "GeometryY", geom.y() ); - settings.writeEntry( key + "GeometryWidth", geom.width() ); - settings.writeEntry( key + "GeometryHeight", geom.height() ); - settings.writeEntry( key + "GeometryMaximized", maximized ); - settings.writeEntry( key + "Family", fontFam ); - settings.writeEntry( key + "Size", fontSiz < 4 ? tqApp->font().pointSize() : fontSiz ); - settings.writeEntry( key + "FixedFamily", fontFix ); - } - if ( !hideSidebar ) - settings.writeEntry( key + "MainwindowLayout", mainWinLayout ); - settings.writeEntry( key + "RebuildDocDB", rebuildDocs ); -} - -#ifdef ASSISTANT_DEBUG -static void dumpmap( const TQMap &m, const TQString &header ) -{ - qDebug( header ); - TQMap::ConstIterator it = m.begin(); - while (it != m.end()) { - qDebug( " " + it.key() + ":\t\t" + *it ); - ++it; - } -} -#endif - -void Config::loadDefaultProfile() -{ - TQSettings settings; - settings.insertSearchPath( TQSettings::Windows, "/Trolltech" ); - const TQString key = "/TQt Assistant/" + TQString(TQT_VERSION_STR) + "/Profile"; - const TQString profKey = key + "/default/"; - - if( settings.entryList( key + "/default" ).count() == 0 ) { - return; - } - - // Override the defaults with settings in registry. - profil->icons.clear(); - profil->indexPages.clear(); - profil->imageDirs.clear(); - profil->docs.clear(); - profil->dcfTitles.clear(); - - TQStringList titles = settings.readListEntry( profKey + "Titles" ); - TQStringList iconLst = settings.readListEntry( profKey + "DocIcons" ); - TQStringList indexLst = settings.readListEntry( profKey + "IndexPages" ); - TQStringList imgDirLst = settings.readListEntry( profKey + "ImageDirs" ); - TQStringList dcfs = settings.readListEntry( profKey + "DocFiles" ); - - TQStringList::ConstIterator it = titles.begin(); - TQValueListConstIterator iconIt = iconLst.begin(); - TQValueListConstIterator indexIt = indexLst.begin(); - TQValueListConstIterator imageIt = imgDirLst.begin(); - TQValueListConstIterator dcfIt = dcfs.begin(); - for( ; it != titles.end(); - ++it, ++iconIt, ++indexIt, ++imageIt, ++dcfIt ) - { - profil->addDCFIcon( *it, *iconIt ); - profil->addDCFIndexPage( *it, *indexIt ); - profil->addDCFImageDir( *it, *imageIt ); - profil->addDCFTitle( *dcfIt, *it ); - } -#if ASSISTANT_DEBUG - dumpmap( profil->icons, "Icons" ); - dumpmap( profil->indexPages, "IndexPages" ); - dumpmap( profil->imageDirs, "ImageDirs" ); - dumpmap( profil->dcfTitles, "dcfTitles" ); - qDebug( "Docfiles: \n " + profil->docs.join( "\n " ) ); -#endif -} - -void Config::saveProfile( Profile *profile ) -{ - if (profil && profil->profileType() == Profile::UserProfile) - return; - TQSettings settings; - settings.insertSearchPath( TQSettings::Windows, "/Trolltech" ); - TQString versionString = (profile->props["name"] == "default") - ? TQString(TQT_VERSION_STR) - : getVersionString(); - const TQString key = "/TQt Assistant/" + versionString + "/"; - const TQString profKey = key + "Profile/" + profile->props["name"] + "/"; - - TQStringList indexes, icons, imgDirs, dcfs; - TQValueList titles = profile->dcfTitles.keys(); - TQValueListConstIterator it = titles.begin(); - for ( ; it != titles.end(); ++it ) { - indexes << profile->indexPages[*it]; - icons << profile->icons[*it]; - imgDirs << profile->imageDirs[*it]; - dcfs << profile->dcfTitles[*it]; - } - - settings.writeEntry( profKey + "Titles", titles ); - settings.writeEntry( profKey + "DocFiles", dcfs ); - settings.writeEntry( profKey + "IndexPages", indexes ); - settings.writeEntry( profKey + "DocIcons", icons ); - settings.writeEntry( profKey + "ImageDirs", imgDirs ); - -#if ASSISTANT_DEBUG - qDebug( "Titles:\n - " + ( (TQStringList*) &titles )->join( "\n - " ) ); - qDebug( "Docfiles:\n - " + dcfs.join( "\n - " ) ); - qDebug( "IndexPages:\n - " + indexes.join( "\n - " ) ); - qDebug( "DocIcons:\n - " + icons.join( "\n - " ) ); - qDebug( "ImageDirs:\n - " + imgDirs.join( "\n - " ) ); -#endif -} - -TQStringList Config::mimePaths() -{ - static TQStringList lst; - - if( lst.count() > 0 ) - return lst; - - for (TQMap::ConstIterator it = profil->dcfTitles.begin(); - it != profil->dcfTitles.end(); ++it ) { - - // Mime source for .dcf file path - TQFileInfo info( *it ); - TQString dcfPath = info.dirPath(TRUE); - if (lst.contains(dcfPath) == 0) - lst << dcfPath; - - // Image dir for .dcf - TQString imgDir = TQDir::convertSeparators( dcfPath + TQDir::separator() - + profil->imageDirs[it.key()] ); - if (lst.contains(imgDir) == 0) - lst << imgDir; - } - return lst; -} - -TQStringList Config::profiles() const -{ - return profileNames; -} - -TQString Config::title() const -{ - return profil->props[ "title" ]; -} - -TQString Config::aboutApplicationMenuText() const -{ - return profil->props[ "aboutmenutext" ]; -} - -TQString Config::aboutURL() const -{ - return profil->props[ "abouturl" ]; -} - -TQString Config::homePage() const -{ - return home.isEmpty() ? profil->props["startpage"] : home; -} - -TQStringList Config::source() const -{ - return src.size() == 0 ? TQStringList(profil->props["startpage"]) : src; -} - -TQStringList Config::docFiles() const -{ - return profil->docs; -} - -TQPixmap Config::docIcon( const TQString &title ) const -{ - // ### To allow qdoc generated dcf files to reference the doc icons from qmake_image_col - if (!TQFile::exists(profil->icons[title])) - return TQPixmap::fromMimeSource( TQFileInfo(profil->icons[title]).fileName() ); - return TQPixmap::fromMimeSource( profil->icons[title] ); -} - -TQPixmap Config::applicationIcon() const -{ - return TQPixmap::fromMimeSource( profil->props["applicationicon"] ); -} - -TQStringList Config::docTitles() const -{ - return TQStringList(profil->indexPages.keys()); -} - -TQString Config::docImageDir( const TQString &docfile ) const -{ - return profil->imageDirs[docfile]; -} - -TQString Config::indexPage( const TQString &title ) const -{ - return profil->indexPages - [title]; -} - -void Config::hideSideBar( bool b ) -{ - hideSidebar = b; -} - -bool Config::sideBarHidden() const -{ - return hideSidebar; -} - -TQString Config::assistantDocPath() const -{ - return profil->props["assistantdocs"].isEmpty() - ? TQString( qInstallPathDocs() ) + "/html" - : profil->props["assistantdocs"]; -} diff --git a/tqtinterface/qt4/tools/assistant/config.h b/tqtinterface/qt4/tools/assistant/config.h deleted file mode 100644 index 56e9f70..0000000 --- a/tqtinterface/qt4/tools/assistant/config.h +++ /dev/null @@ -1,152 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "profile.h" - -#include -#include -#include -#include - -class Profile; - -class Config -{ -public: - - Config(); - - void load(); - void save(); - Profile *profile() const { return profil; } - TQString profileName() const { return profil->props["name"]; } - bool validProfileName() const; - void hideSideBar( bool b ); - bool sideBarHidden() const; - TQStringList mimePaths(); - - // From profile, read only - TQStringList docFiles() const; - TQStringList docTitles() const; - TQString indexPage( const TQString &title ) const; - TQString docImageDir( const TQString &title ) const; - TQPixmap docIcon( const TQString &title ) const; - - TQStringList profiles() const; - TQString title() const; - TQString aboutApplicationMenuText() const; - TQString aboutURL() const; - TQPixmap applicationIcon() const; - - // From TQSettings, read / write - TQString webBrowser() const { return webBrows; } - void setWebBrowser( const TQString &cmd ) { webBrows = cmd; } - - TQString homePage() const; - void setHomePage( const TQString &hom ) { home = hom; } - - TQString pdfReader() const { return pdfApp; } - void setPdfReader( const TQString &cmd ) { pdfApp = cmd; } - - int fontSize() const { return fontSiz; } - void setFontSize( int size ) { fontSiz = size; } - - TQString fontFamily() const { return fontFam; } - void setFontFamily( const TQString &fam ) { fontFam = fam; } - - TQString fontFixedFamily() const { return fontFix; } - void setFontFixedFamily( const TQString &fn ) { fontFix = fn; } - - TQString linkColor() const { return linkCol; } - void setLinkColor( const TQString &col ) { linkCol = col; } - - TQStringList source() const; - void setSource( const TQStringList &s ) { src = s; } - - int sideBarPage() const { return sideBar; } - void setSideBarPage( int sbp ) { sideBar = sbp; } - - TQRect tqgeometry() const { return geom; } - void setGeometry( const TQRect &geo ) { geom = geo; } - - bool isMaximized() const { return maximized; } - void setMaximized( bool max ) { maximized = max; } - - bool isLinkUnderline() const { return linkUnder; } - void setLinkUnderline( bool ul ) { linkUnder = ul; } - - TQString mainWindowLayout() const { return mainWinLayout; } - void setMainWindowLayout( const TQString &tqlayout ) { mainWinLayout = tqlayout; } - - TQString assistantDocPath() const; - - bool docRebuild() const { return rebuildDocs; } - void setDocRebuild( bool rb ) { rebuildDocs = rb; } - - void saveProfile( Profile *profile ); - void loadDefaultProfile(); - - static Config *configuration(); - static Config *loadConfig(const TQString &profileFileName); - -private: - Config( const Config &c ); - Config& operator=( const Config &c ); - - void saveSettings(); - -private: - Profile *profil; - - TQStringList profileNames; - TQString webBrows; - TQString home; - TQString pdfApp; - TQString fontFam; - TQString fontFix; - TQString linkCol; - TQStringList src; - TQString mainWinLayout; - TQRect geom; - int sideBar; - int fontSiz; - bool maximized; - bool linkUnder; - bool hideSidebar; - bool rebuildDocs; -}; - -#endif diff --git a/tqtinterface/qt4/tools/assistant/docuparser.cpp b/tqtinterface/qt4/tools/assistant/docuparser.cpp deleted file mode 100644 index a64fb47..0000000 --- a/tqtinterface/qt4/tools/assistant/docuparser.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "docuparser.h" -#include "profile.h" - -#include -#include -#include -#include -#include -#include - -TQDataStream &operator>>( TQDataStream &s, ContentItem &ci ) -{ - s >> ci.title; - s >> ci.reference; - s >> ci.depth; - return s; -} - -TQDataStream &operator<<( TQDataStream &s, const ContentItem &ci ) -{ - s << ci.title; - s << ci.reference; - s << ci.depth; - return s; -} - -const TQString DocuParser::DocumentKey = "/TQt Assistant/" + TQString(TQT_VERSION_STR) + "/"; - -DocuParser *DocuParser::createParser( const TQString &fileName ) -{ - TQFile file( fileName ); - if( !file.open( IO_ReadOnly ) ) { - return 0; - } - - TQString str; - int read = 0; - int maxlen = 1024; - int majVer = 0, minVer = 0, serVer = 0; - static TQRegExp re( "assistantconfig +version=\"(\\d)\\.(\\d)\\.(\\d)\"", FALSE ); - TQ_ASSERT( re.isValid() ); - while( read != -1 ) { - read = file.readLine( str, maxlen ); - if( re.search( str ) >= 0 ) { - majVer = re.cap( 1 ).toInt(); - minVer = re.cap( 2 ).toInt(); - serVer = re.cap( 3 ).toInt(); - } - } - - if( majVer == 3 && minVer >= 2 ) - return new DocuParser320; - - return new DocuParser310; -} - - -bool DocuParser::parse( TQFile *file ) -{ - TQXmlInputSource source( TQT_TQIODEVICE(file) ); - TQXmlSimpleReader reader; - reader.setContentHandler( this ); - reader.setErrorHandler( this ); - setFileName( TQFileInfo( *file ).absFilePath() ); - return reader.parse( source ); -} - - -TQString DocuParser::errorProtocol() const -{ - return errorProt; -} - - -TQValueList DocuParser::getContentItems() -{ - return contentList; -} - - -TQPtrList DocuParser::getIndexItems() -{ - return indexList; -} - -TQString DocuParser::absolutify( const TQString &name ) const -{ - TQFileInfo orgPath( name ); - if( orgPath.isRelative() ) - return TQFileInfo( fname ).dirPath() + TQDir::separator() + name; - return name; -} - - -void DocuParser310::addTo( Profile *p ) -{ - p->addDCFTitle( fname, docTitle ); - p->addDCFIcon( docTitle, iconName ); - p->addDCFIndexPage( docTitle, conURL ); -} - - -bool DocuParser310::startDocument() -{ - state = StateInit; - errorProt = ""; - - contentRef = ""; - indexRef = ""; - depth = 0; - contentList.clear(); - indexList.clear(); - - return TRUE; -} - - -bool DocuParser310::startElement( const TQString &, const TQString &, - const TQString &qname, - const TQXmlAttributes &attr ) -{ - if (qname == "DCF" && state == StateInit) { - state = StateContent; - contentRef = absolutify( attr.value( "ref" ) ); - conURL = contentRef; - docTitle = attr.value( "title" ); - iconName = absolutify( attr.value( "icon" ) ); - contentList.append( ContentItem( docTitle, contentRef, depth ) ); - } else if (qname == "section" && (state == StateContent || state == StateSect)) { - state = StateSect; - contentRef = absolutify( attr.value( "ref" ) ); - title = attr.value( "title" ); - depth++; - contentList.append( ContentItem( title, contentRef, depth ) ); - } else if (qname == "keyword" && state == StateSect) { - state = StateKeyword; - indexRef = absolutify( attr.value( "ref" ) ); - } else - return FALSE; - return TRUE; -} - -bool DocuParser310::endElement( const TQString &nameSpace, const TQString &localName, - const TQString &qName ) -{ - switch( state ) { - case StateInit: - break; - case StateContent: - state = StateInit; - break; - case StateSect: - state = --depth ? StateSect : StateContent; - break; - case StateKeyword: - state = StateSect; - break; - } - return TRUE; -} - - -bool DocuParser310::characters( const TQString& ch ) -{ - TQString str = ch.simplifyWhiteSpace(); - if ( str.isEmpty() ) - return TRUE; - - switch ( state ) { - case StateInit: - case StateContent: - case StateSect: - return FALSE; - break; - case StateKeyword: - indexList.append( new IndexItem( str, indexRef ) ); - break; - default: - return FALSE; - } - return TRUE; -} - - -bool DocuParser310::fatalError( const TQXmlParseException& exception ) -{ - errorProt += TQString( "fatal parsing error: %1 in line %2, column %3\n" ) - .arg( exception.message() ) - .arg( exception.lineNumber() ) - .arg( exception.columnNumber() ); - - return TQXmlDefaultHandler::fatalError( exception ); -} - - -DocuParser320::DocuParser320() - : prof( new Profile ) -{ -} - - -void DocuParser320::addTo( Profile *p ) -{ - TQMap::ConstIterator it; - - for (it = prof->dcfTitles.begin(); it != prof->dcfTitles.end(); ++it) - p->dcfTitles[it.key()] = *it; - - for (it = prof->icons.begin(); it != prof->icons.end(); ++it) - p->icons[it.key()] = *it; - - for (it = prof->indexPages.begin(); it != prof->indexPages.end(); ++it) - p->indexPages[it.key()] = *it; -} - - -bool DocuParser320::startDocument() -{ - state = StateInit; - errorProt = ""; - - contentRef = ""; - indexRef = ""; - depth = 0; - contentList.clear(); - indexList.clear(); - - prof->addDCF( fname ); - - return TRUE; -} - -bool DocuParser320::startElement( const TQString &, const TQString &, - const TQString &qname, - const TQXmlAttributes &attr ) -{ - TQString lower = qname.lower(); - - switch( state ) { - - case StateInit: - if( lower == "assistantconfig" ) - state = StateDocRoot; - break; - - case StateDocRoot: - if( lower == "dcf" ) { - state = StateContent; - contentRef = absolutify( attr.value( "ref" ) ); - conURL = contentRef; - docTitle = attr.value( "title" ); - iconName = absolutify( attr.value( "icon" ) ); - contentList.append( ContentItem( docTitle, contentRef, depth ) ); - } else if( lower == "profile" ) { - state = StateProfile; - } - break; - - case StateSect: - if ( lower == "keyword" && state == StateSect ) { - state = StateKeyword; - indexRef = absolutify( attr.value( "ref" ) ); - break; - } // else if (lower == "section") - case StateContent: - if( lower == "section" ) { - state = StateSect; - contentRef = absolutify( attr.value( "ref" ) ); - title = attr.value( "title" ); - depth++; - contentList.append( ContentItem( title, contentRef, depth ) ); - } - break; - - case StateProfile: - if( lower == "property" ) { - state = StateProperty; - propertyName = attr.value( "name" ); - } - break; - - case StateProperty: - break; - } - - return TRUE; -} - -bool DocuParser320::endElement( const TQString &nameSpace, - const TQString &localName, - const TQString &qName ) -{ - switch( state ) { - case StateInit: - break; - case StateDocRoot: - state = StateInit; - break; - case StateProfile: - state = StateDocRoot; - break; - case StateProperty: - state = StateProfile; - if( propertyName.isEmpty() || propertyValue.isEmpty() ) - return FALSE; - { - static const TQStringList lst = TQStringList() << "startpage" << "abouturl" - << "applicationicon" << "assistantdocs"; - if (lst.contains(propertyName)) - propertyValue = absolutify( propertyValue ); - } - prof->addProperty( propertyName, propertyValue ); - break; - case StateContent: - if( !iconName.isEmpty() ) prof->addDCFIcon( docTitle, iconName ); - if( contentRef.isEmpty() ) - return FALSE; - prof->addDCFIndexPage( docTitle, conURL ); - prof->addDCFTitle( fname, docTitle ); - state = StateDocRoot; - break; - case StateSect: - state = --depth ? StateSect : StateContent; - break; - case StateKeyword: - state = StateSect; - break; - } - return TRUE; -} - -bool DocuParser320::characters( const TQString& ch ) -{ - TQString str = ch.simplifyWhiteSpace(); - if ( str.isEmpty() ) - return TRUE; - - switch ( state ) { - case StateInit: - case StateContent: - case StateSect: - return FALSE; - break; - case StateKeyword: - indexList.append( new IndexItem( str, indexRef ) ); - break; - case StateProperty: - propertyValue = ch; - break; - default: - return FALSE; - } - return TRUE; -} - -bool DocuParser320::fatalError( const TQXmlParseException& exception ) -{ - errorProt += TQString( "fatal parsing error: %1 in line %2, column %3\n" ) - .arg( exception.message() ) - .arg( exception.lineNumber() ) - .arg( exception.columnNumber() ); - - return TQXmlDefaultHandler::fatalError( exception ); -} diff --git a/tqtinterface/qt4/tools/assistant/docuparser.h b/tqtinterface/qt4/tools/assistant/docuparser.h deleted file mode 100644 index 0ca4d61..0000000 --- a/tqtinterface/qt4/tools/assistant/docuparser.h +++ /dev/null @@ -1,151 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef DOCUPARSER_H -#define DOCUPARSER_H - -#include -#include -#include - -class Profile; - -struct ContentItem { - ContentItem() - : title( TQString() ), reference( TQString() ), depth( 0 ) {} - ContentItem( const TQString &t, const TQString &r, int d ) - : title( t ), reference( r ), depth( d ) {} - TQString title; - TQString reference; - int depth; - TQ_DUMMY_COMPARISON_OPERATOR(ContentItem) -}; - -TQDataStream &operator>>( TQDataStream &s, ContentItem &ci ); -TQDataStream &operator<<( TQDataStream &s, const ContentItem &ci ); - -struct IndexItem { - IndexItem( const TQString &k, const TQString &r ) - : keyword( k ), reference( r ) {} - TQString keyword; - TQString reference; -}; - - - -class DocuParser : public TQXmlDefaultHandler -{ -public: - enum ParserVersion { TQt310, TQt320 }; - // Since We don't want problems with documentation - // from version to version, this string stores the correct - // version string to save documents. - static const TQString DocumentKey; - - static DocuParser *createParser( const TQString &fileName ); - - virtual bool parse( TQFile *file ); - - TQValueList getContentItems(); - TQPtrList getIndexItems(); - - TQString errorProtocol() const; - TQString contentsURL() const { return conURL; } - - virtual ParserVersion parserVersion() const = 0; - virtual void addTo( Profile *p ) = 0; - - TQString fileName() const { return fname; } - void setFileName( const TQString &file ) { fname = file; } - -protected: - TQString absolutify( const TQString &input ) const; - - TQString contentRef, indexRef, errorProt, conURL; - TQString docTitle, title, iconName; - TQValueList contentList; - TQPtrList indexList; - TQString fname; -}; - - -class DocuParser310 : public DocuParser -{ -public: - enum States{ StateInit, StateContent, StateSect, StateKeyword }; - - bool startDocument(); - bool startElement( const TQString&, const TQString&, const TQString& , - const TQXmlAttributes& ); - bool endElement( const TQString&, const TQString&, const TQString& ); - bool characters( const TQString & ); - bool fatalError( const TQXmlParseException& exception ); - - virtual ParserVersion parserVersion() const { return TQt310; } - virtual void addTo( Profile *p ); - -private: - States state; - int depth; -}; - - -class DocuParser320 : public DocuParser -{ -public: - enum States { StateInit, StateDocRoot, StateProfile, StateProperty, - StateContent, StateSect, StateKeyword }; - - DocuParser320(); - - bool startDocument(); - bool startElement( const TQString&, const TQString&, const TQString& , - const TQXmlAttributes& ); - bool endElement( const TQString&, const TQString&, const TQString& ); - bool characters( const TQString & ); - bool fatalError( const TQXmlParseException& exception ); - - virtual ParserVersion parserVersion() const { return TQt320; } - virtual void addTo( Profile *p ); - Profile *profile() const { return prof; } - -private: - - States state; - int depth; - int docfileCounter; - TQString propertyValue; - TQString propertyName; - Profile *prof; -}; -#endif //DOCUPARSER_H diff --git a/tqtinterface/qt4/tools/assistant/finddialog.ui b/tqtinterface/qt4/tools/assistant/finddialog.ui deleted file mode 100644 index c34ceae..0000000 --- a/tqtinterface/qt4/tools/assistant/finddialog.ui +++ /dev/null @@ -1,292 +0,0 @@ - -FindDialog -********************************************************************* - -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. - -** - -** This file is part of Qt Assistant. - -** - -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** - -********************************************************************* - - - FindDialog - - - - 0 - 0 - 362 - 156 - - - - Qt Assistant - Find Text - - - - unnamed - - - 0 - - - - Layout5 - - - - unnamed - - - 11 - - - - ButtonGroup2 - - - &Direction - - - - unnamed - - - 11 - - - 6 - - - - radioForward - - - Fo&rward - - - true - - - - - radioBackward - - - &Backward - - - - - - - Layout1 - - - - unnamed - - - 0 - - - 6 - - - - TextLabel1 - - - F&ind: - - - comboFind - - - - - comboFind - - - - 7 - 0 - 0 - 0 - - - - true - - - false - - - - - - - Spacer2 - - - Vertical - - - Expanding - - - - 31 - 0 - - - - - - PushButton2 - - - C&lose - - - Alt+L - - - - - ButtonGroup1 - - - &Options - - - - unnamed - - - 11 - - - 6 - - - - checkWords - - - &Whole words only - - - - - checkCase - - - &Case sensitive - - - - - - - PushButton1 - - - &Find - - - Alt+F - - - true - - - - - - - - - PushButton1 - clicked() - FindDialog - doFind() - - - PushButton2 - clicked() - FindDialog - reject() - - - - comboFind - checkWords - checkCase - radioForward - radioBackward - PushButton1 - PushButton2 - - - tqstatusbar.h - tqtextbrowser.h - mainwindow.h - tabbedbrowser.h - finddialog.ui.h - - - class TQTextBrowser; - class TQStatusBar; - class MainWindow; - - - TQStatusBar *sb; - bool onceFound; - TQString findExpr; - TQTextBrowser *lastBrowser; - - - init() - destroy() - doFind() - doFind(bool) - statusMessage(const TQString &message) - - - mainWindow() - hasFindExpression() - - - diff --git a/tqtinterface/qt4/tools/assistant/finddialog.ui.h b/tqtinterface/qt4/tools/assistant/finddialog.ui.h deleted file mode 100644 index c95c413..0000000 --- a/tqtinterface/qt4/tools/assistant/finddialog.ui.h +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include - -void FindDialog::init() -{ - lastBrowser = 0; - onceFound = FALSE; - findExpr = ""; - sb = new TQStatusBar( this ); - FindDialogLayout->addWidget( sb ); - sb->message( tr( "Enter the text you are looking for." ) ); -} - -void FindDialog::destroy() -{ -} - -void FindDialog::doFind() -{ - doFind(radioForward->isChecked()); -} - -void FindDialog::doFind(bool forward) -{ - TQTextBrowser *browser = (TQTextBrowser*) mainWindow()->browsers()->currentBrowser(); - sb->clear(); - - if (comboFind->currentText() != findExpr || lastBrowser != browser) - onceFound = false; - findExpr = comboFind->currentText(); - - bool found; - if (browser->hasSelectedText()) { // Search either forward or backward from cursor. - found = browser->find(findExpr, checkCase->isChecked(), checkWords->isChecked(), - forward); - } else { - int para = forward ? 0 : INT_MAX; - int index = forward ? 0 : INT_MAX; - found = browser->find(findExpr, checkCase->isChecked(), checkWords->isChecked(), - forward, ¶, &index); - } - - if (!found) { - if (onceFound) { - if (forward) - statusMessage(tr("Search reached end of the document")); - else - statusMessage(tr("Search reached start of the document")); - } else { - statusMessage(tr( "Text not found" )); - } - } - onceFound |= found; - lastBrowser = browser; -} - - - -MainWindow* FindDialog::mainWindow() -{ - return (MainWindow*) parent(); -} - -bool FindDialog::hasFindExpression() -{ - return !findExpr.isEmpty(); -} - -void FindDialog::statusMessage(const TQString &message) -{ - if (isVisible()) - sb->message(message); - else - ((MainWindow*) parent())->statusBar()->message(message, 2000); - -} diff --git a/tqtinterface/qt4/tools/assistant/helpdialog.ui b/tqtinterface/qt4/tools/assistant/helpdialog.ui deleted file mode 100644 index e81008f..0000000 --- a/tqtinterface/qt4/tools/assistant/helpdialog.ui +++ /dev/null @@ -1,506 +0,0 @@ - -HelpDialogBase -********************************************************************* -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of Qt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -********************************************************************* - - - HelpDialogBase - - - - 0 - 0 - 268 - 448 - - - - Help - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - - - - unnamed - - - 0 - - - 6 - - - - tabWidget - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - - - - contentPage - - - Con&tents - - - - unnamed - - - 5 - - - 6 - - - - - Column 1 - - - true - - - true - - - - listContents - - - true - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - - - - - - - Widget8 - - - &Index - - - - unnamed - - - 5 - - - 6 - - - - TextLabel1 - - - &Look For: - - - editIndex - - - - - editIndex - - - Enter keyword - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - - - - - listIndex - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - - - - - - - Widget9 - - - &Bookmarks - - - - unnamed - - - 5 - - - 6 - - - - - Column 1 - - - true - - - true - - - - listBookmarks - - - Displays the list of bookmarks. - - - - - Layout3 - - - - unnamed - - - 0 - - - 6 - - - - Spacer1 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - buttonAdd - - - &New - - - Add new bookmark - - - Add the currently displayed page as a new bookmark. - - - - - buttonRemove - - - &Delete - - - Delete bookmark - - - Delete the selected bookmark. - - - - - - - - - searchTab - - - &Search - - - - unnamed - - - 5 - - - 6 - - - - Spacer3 - - - Vertical - - - Fixed - - - - 20 - 20 - - - - - - TextLabel1_2 - - - Searching f&or: - - - termsEdit - - - - - termsEdit - - - Enter searchword(s). - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - - - - - resultBox - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - - - - - TextLabel2 - - - Found &Documents: - - - resultBox - - - - - Layout2 - - - - unnamed - - - - helpButton - - - He&lp - - - Display the help page. - - - Display the help page for the full text search. - - - - - Spacer2 - - - Horizontal - - - Expanding - - - - 61 - 21 - - - - - - searchButton - - - &Search - - - Start searching. - - - Pressing this button starts the search. - - - - - - - - - - framePrepare - - - StyledPanel - - - Raised - - - - unnamed - - - 3 - - - 6 - - - - labelPrepare - - - Preparing... - - - - - progressPrepare - - - - - - - - - buttonAdd - clicked() - HelpDialogBase - addBookmark() - - - buttonRemove - clicked() - HelpDialogBase - removeBookmark() - - - termsEdit - returnPressed() - searchButton - animateClick() - - - helpButton - clicked() - HelpDialogBase - showSearchHelp() - - - searchButton - clicked() - HelpDialogBase - startSearch() - - - resultBox - returnPressed(TQListBoxItem*) - HelpDialogBase - showResultPage(TQListBoxItem*) - - - resultBox - mouseButtonClicked(int, TQListBoxItem*, const TQPoint &) - HelpDialogBase - showResultPage(int, TQListBoxItem*, const TQPoint & ) - - - - tabWidget - listContents - editIndex - listIndex - listBookmarks - buttonAdd - buttonRemove - termsEdit - searchButton - helpButton - resultBox - - - init() - destroy() - addBookmark() - currentBookmarkChanged( TQListViewItem * ) - currentIndexChanged( TQListBoxItem * ) - currentTabChanged( const TQString & ) - loadIndexFile() - currentContentsChanged( TQListViewItem * ) - removeBookmark() - searchInIndex( const TQString & ) - showTopic() - showTopic( int, TQListBoxItem *, const TQPoint & ) - showSearchHelp() - startSearch() - showResultPage( TQListBoxItem * ) - showResultPage( int, TQListBoxItem *, const TQPoint & ) - showResultPage( int, TQListViewItem *, const TQPoint & ) - - - diff --git a/tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp b/tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp deleted file mode 100644 index db7b0af..0000000 --- a/tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp +++ /dev/null @@ -1,1161 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "helpdialogimpl.h" -#include "helpwindow.h" -#include "topicchooserimpl.h" -#include "docuparser.h" -#include "mainwindow.h" -#include "config.h" -#include "tabbedbrowser.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static TQString stripAmpersand( const TQString &str ) -{ - TQString s( str ); - s = s.replace( '&', "" ); - return s; -} - -static bool verifyDirectory(const TQString &str) -{ - TQFileInfo dirInfo(str); - if (!dirInfo.exists()) - return TQDir().mkdir(str); - if (!dirInfo.isDir()) { - qWarning("'%s' exists but is not a directory", str.latin1()); - return FALSE; - } - return TRUE; -} - -struct IndexKeyword { - IndexKeyword( const TQString &kw, const TQString &l ) - : keyword( kw ), link( l ) {} - IndexKeyword() : keyword( TQString() ), link( TQString() ) {} - bool operator<( const IndexKeyword &ik ) const { - return keyword.lower() < ik.keyword.lower(); - } - bool operator<=( const IndexKeyword &ik ) const { - return keyword.lower() <= ik.keyword.lower(); - } - bool operator>( const IndexKeyword &ik ) const { - return keyword.lower() > ik.keyword.lower(); - } - TQ_DUMMY_COMPARISON_OPERATOR( IndexKeyword ) - TQString keyword; - TQString link; -}; - -TQDataStream &operator>>( TQDataStream &s, IndexKeyword &ik ) -{ - s >> ik.keyword; - s >> ik.link; - return s; -} - -TQDataStream &operator<<( TQDataStream &s, const IndexKeyword &ik ) -{ - s << ik.keyword; - s << ik.link; - return s; -} - -TQValidator::State SearchValidator::validate( TQString &str, int & ) const -{ - for ( int i = 0; i < (int) str.length(); ++i ) { - TQChar c = str[i]; - if ( !c.isLetterOrNumber() && c != '\'' && c != '`' - && c != '\"' && c != ' ' && c != '-' && c != '_' - && c!= '*' ) - return TQValidator::Invalid; - } - return TQValidator::Acceptable; -} - -HelpNavigationListItem::HelpNavigationListItem( TQListBox *ls, const TQString &txt ) - : TQListBoxText( ls, txt ) -{ -} - -void HelpNavigationListItem::addLink( const TQString &link ) -{ - int hash = link.find( '#' ); - if ( hash == -1 ) { - linkList << link; - return; - } - - TQString preHash = link.left( hash ); - if ( linkList.grep( preHash, FALSE ).count() > 0 ) - return; - linkList << link; -} - -HelpNavigationContentsItem::HelpNavigationContentsItem( TQListView *v, TQListViewItem *after ) - : TQListViewItem( v, after ) -{ -} - -HelpNavigationContentsItem::HelpNavigationContentsItem( TQListViewItem *v, TQListViewItem *after ) - : TQListViewItem( v, after ) -{ -} - -void HelpNavigationContentsItem::setLink( const TQString &lnk ) -{ - theLink = lnk; -} - -TQString HelpNavigationContentsItem::link() const -{ - return theLink; -} - - - -HelpDialog::HelpDialog( TQWidget *parent, MainWindow *h ) - : HelpDialogBase( parent, 0, FALSE ), lwClosed( FALSE ), help( h ) -{ -} - -void HelpDialog::initialize() -{ - connect( tabWidget, TQT_SIGNAL( selected(const TQString&) ), - this, TQT_SLOT( currentTabChanged(const TQString&) ) ); - connect( listContents, TQT_SIGNAL( mouseButtonClicked(int, TQListViewItem*, const TQPoint &, int ) ), - this, TQT_SLOT( showTopic(int,TQListViewItem*, const TQPoint &) ) ); - connect( listContents, TQT_SIGNAL( currentChanged(TQListViewItem*) ), - this, TQT_SLOT( currentContentsChanged(TQListViewItem*) ) ); - connect( listContents, TQT_SIGNAL( selectionChanged(TQListViewItem*) ), - this, TQT_SLOT( currentContentsChanged(TQListViewItem*) ) ); - connect( listContents, TQT_SIGNAL( doubleClicked(TQListViewItem*) ), - this, TQT_SLOT( showTopic(TQListViewItem*) ) ); - connect( listContents, TQT_SIGNAL( returnPressed(TQListViewItem*) ), - this, TQT_SLOT( showTopic(TQListViewItem*) ) ); - connect( listContents, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), - this, TQT_SLOT( showItemMenu( TQListViewItem*, const TQPoint& ) ) ); - connect( editIndex, TQT_SIGNAL( returnPressed() ), - this, TQT_SLOT( showTopic() ) ); - connect( editIndex, TQT_SIGNAL( textChanged(const TQString&) ), - this, TQT_SLOT( searchInIndex(const TQString&) ) ); - - connect( listIndex, TQT_SIGNAL( selectionChanged(TQListBoxItem*) ), - this, TQT_SLOT( currentIndexChanged(TQListBoxItem*) ) ); - connect( listIndex, TQT_SIGNAL( returnPressed(TQListBoxItem*) ), - this, TQT_SLOT( showTopic() ) ); - connect( listIndex, TQT_SIGNAL( mouseButtonClicked(int, TQListBoxItem*, const TQPoint &) ), - this, TQT_SLOT( showTopic( int, TQListBoxItem *, const TQPoint & ) ) ); - connect( listIndex, TQT_SIGNAL( currentChanged(TQListBoxItem*) ), - this, TQT_SLOT( currentIndexChanged(TQListBoxItem*) ) ); - connect( listIndex, TQT_SIGNAL( contextMenuRequested( TQListBoxItem*, const TQPoint& ) ), - this, TQT_SLOT( showItemMenu( TQListBoxItem*, const TQPoint& ) ) ); - - connect( listBookmarks, TQT_SIGNAL( mouseButtonClicked(int, TQListViewItem*, const TQPoint&, int ) ), - this, TQT_SLOT( showTopic(int, TQListViewItem*, const TQPoint &) ) ); - connect( listBookmarks, TQT_SIGNAL( returnPressed(TQListViewItem*) ), - this, TQT_SLOT( showTopic(TQListViewItem*) ) ); - connect( listBookmarks, TQT_SIGNAL( selectionChanged(TQListViewItem*) ), - this, TQT_SLOT( currentBookmarkChanged(TQListViewItem*) ) ); - connect( listBookmarks, TQT_SIGNAL( currentChanged(TQListViewItem*) ), - this, TQT_SLOT( currentBookmarkChanged(TQListViewItem*) ) ); - connect( listBookmarks, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ), - this, TQT_SLOT( showItemMenu( TQListViewItem*, const TQPoint& ) ) ); - connect( resultBox, TQT_SIGNAL( contextMenuRequested( TQListBoxItem*, const TQPoint& ) ), - this, TQT_SLOT( showItemMenu( TQListBoxItem*, const TQPoint& ) ) ); - - cacheFilesPath = TQDir::homeDirPath() + "/.assistant/"; //### Find a better location for the dbs - - editIndex->installEventFilter( this ); - listBookmarks->header()->hide(); - listBookmarks->header()->setStretchEnabled( TRUE ); - listContents->header()->hide(); - listContents->header()->setStretchEnabled( TRUE ); - framePrepare->hide(); - connect( tqApp, TQT_SIGNAL(lastWindowClosed()), TQT_SLOT(lastWinClosed()) ); - - termsEdit->setValidator( new SearchValidator( TQT_TQOBJECT(termsEdit) ) ); - - itemPopup = new TQPopupMenu( this ); - itemPopup->insertItem( tr( "Open Link in Current Tab" ), 0 ); - itemPopup->insertItem( tr( "Open Link in New Window" ), 1 ); - itemPopup->insertItem( tr( "Open Link in New Tab" ), 2 ); - - contentList.setAutoDelete( TRUE ); - contentList.clear(); - - initDoneMsgShown = FALSE; - fullTextIndex = 0; - indexDone = FALSE; - titleMapDone = FALSE; - contentsInserted = FALSE; - bookmarksInserted = FALSE; - setupTitleMap(); -} - - -void HelpDialog::processEvents() -{ - tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); -} - - -void HelpDialog::lastWinClosed() -{ - lwClosed = TRUE; -} - - -void HelpDialog::removeOldCacheFiles() -{ - TQString dir = cacheFilesPath; // ### remove the last '/' ? - if (!verifyDirectory(cacheFilesPath)) { - qWarning( "Failed to created assistant directory" ); - return; - } - TQString pname = "." + Config::configuration()->profileName(); - - TQStringList fileList; - fileList << "indexdb" << "indexdb.dict" << "indexdb.doc" << "contentdb"; - TQStringList::iterator it = fileList.begin(); - for ( ; it != fileList.end(); ++it ) { - if ( TQFile::exists( cacheFilesPath + *it + pname ) ) { - TQFile f( cacheFilesPath + *it + pname ); - f.remove(); - } - } -} - -void HelpDialog::timerEvent(TQTimerEvent *e) -{ - static int opacity = 255; - // To allow patching of 3.2.3 assistant for qsa. -#if TQT_VERSION >= 0x030300 - help->setWindowOpacity((opacity-=4)/255.0); - if (opacity<=0) -#endif - tqApp->quit(); -} - - -void HelpDialog::loadIndexFile() -{ - if ( indexDone ) - return; - - setCursor( Qt::WaitCursor ); - indexDone = TRUE; - labelPrepare->setText( tr( "Prepare..." ) ); - framePrepare->show(); - processEvents(); - - TQProgressBar *bar = progressPrepare; - bar->setTotalSteps( 100 ); - bar->setProgress( 0 ); - - keywordDocuments.clear(); - TQValueList lst; - TQFile indexFile( cacheFilesPath + "indexdb." + - Config::configuration()->profileName() ); - if ( !indexFile.open( IO_ReadOnly ) ) { - buildKeywordDB(); - processEvents(); - if( lwClosed ) - return; - if (!indexFile.open(IO_ReadOnly)) { - TQMessageBox::warning(help, tr("TQt Assistant"), tr("Failed to load keyword index file\n" - "Assistant will not work!")); -#if defined TQ_WS_WIN || defined TQ_WS_MACX - startTimer(50); -#endif - return; - } - } - - editIndex->setEnabled(FALSE); - - TQDataStream ds( &indexFile ); - TQ_UINT32 fileAges; - ds >> fileAges; - if ( fileAges != getFileAges() ) { - indexFile.close(); - buildKeywordDB(); - if ( !indexFile.open( IO_ReadOnly ) ) { - TQMessageBox::warning( help, tr( "TQt Assistant" ), - tr( "Cannot open the index file %1" ).arg( TQFileInfo( indexFile ).absFilePath() ) ); - editIndex->setEnabled(TRUE); - return; - } - ds.setDevice( &indexFile ); - ds >> fileAges; - } - ds >> lst; - indexFile.close(); - - bar->setProgress( bar->totalSteps() ); - processEvents(); - - listIndex->clear(); - HelpNavigationListItem *lastItem = 0; - TQString lastKeyword = TQString(); - TQValueList::ConstIterator it = lst.begin(); - for ( ; it != lst.end(); ++it ) { - if ( lastKeyword.lower() != (*it).keyword.lower() ) - lastItem = new HelpNavigationListItem( listIndex, (*it).keyword ); - lastItem->addLink( (*it).link ); - lastKeyword = (*it).keyword; - - TQString lnk = (*it).link; - int i = lnk.findRev('#'); - if ( i > -1 ) - lnk = lnk.left( i ); - if (!keywordDocuments.contains(lnk)) - keywordDocuments.append(lnk); - } - framePrepare->hide(); - showInitDoneMessage(); - setCursor( Qt::ArrowCursor ); - editIndex->setEnabled(TRUE); -} - -TQ_UINT32 HelpDialog::getFileAges() -{ - TQStringList addDocuFiles = Config::configuration()->docFiles(); - TQStringList::const_iterator i = addDocuFiles.begin(); - - TQ_UINT32 fileAges = 0; - for( ; i != addDocuFiles.end(); ++i ) { - TQFileInfo fi( *i ); - if ( fi.exists() ) - fileAges += fi.lastModified().toTime_t(); - } - - return fileAges; -} - -void HelpDialog::buildKeywordDB() -{ - TQStringList addDocuFiles = Config::configuration()->docFiles(); - TQStringList::iterator i = addDocuFiles.begin(); - - int steps = 0; - for( ; i != addDocuFiles.end(); i++ ) - steps += TQFileInfo( *i ).size(); - - labelPrepare->setText( tr( "Prepare..." ) ); - progressPrepare->setTotalSteps( steps ); - progressPrepare->setProgress( 0 ); - processEvents(); - - TQValueList lst; - TQ_UINT32 fileAges = 0; - for( i = addDocuFiles.begin(); i != addDocuFiles.end(); i++ ){ - TQFile file( *i ); - if ( !file.exists() ) { - TQMessageBox::warning( this, tr( "Warning" ), - tr( "Documentation file %1 does not exist!\n" - "Skipping file." ).arg( TQFileInfo( file ).absFilePath() ) ); - continue; - } - fileAges += TQFileInfo( file ).lastModified().toTime_t(); - DocuParser *handler = DocuParser::createParser( *i ); - bool ok = handler->parse( &file ); - file.close(); - if( !ok ){ - TQString msg = TQString( "In file %1:\n%2" ) - .arg( TQFileInfo( file ).absFilePath() ) - .arg( handler->errorProtocol() ); - TQMessageBox::critical( this, tr( "Parse Error" ), tr( msg ) ); - delete handler; - continue; - } - - TQPtrList indLst = handler->getIndexItems(); - TQPtrListIterator it( indLst ); - IndexItem *indItem; - int counter = 0; - while ( ( indItem = it.current() ) != 0 ) { - TQFileInfo fi( indItem->reference ); - lst.append( IndexKeyword( indItem->keyword, fi.absFilePath() ) ); - if ( progressPrepare ) - progressPrepare->setProgress( progressPrepare->progress() + - int(fi.absFilePath().length() * 1.6) ); - - if( ++counter%100 == 0 ) { - processEvents(); - if( lwClosed ) { - return; - } - } - ++it; - } - delete handler; - } - if ( !lst.isEmpty() ) - qHeapSort( lst ); - - TQFile indexout( cacheFilesPath + "indexdb." + Config::configuration()->profileName() ); - if ( verifyDirectory(cacheFilesPath) && indexout.open( IO_WriteOnly ) ) { - TQDataStream s( &indexout ); - s << fileAges; - s << lst; - indexout.close(); - } -} - -void HelpDialog::setupTitleMap() -{ - if ( titleMapDone ) - return; - if ( Config::configuration()->docRebuild() ) { - removeOldCacheFiles(); - Config::configuration()->setDocRebuild( FALSE ); - Config::configuration()->saveProfile( Config::configuration()->profile() ); - } - if ( contentList.isEmpty() ) - getAllContents(); - - titleMapDone = TRUE; - titleMap.clear(); - TQDictIterator lstIt( contentList ); - for ( ; lstIt.current(); ++lstIt ) { - TQValueList &lst = *(lstIt.current()); - TQValueListConstIterator it; - for ( it = lst.begin(); it != lst.end(); ++it ) { - TQFileInfo link( (*it).reference.simplifyWhiteSpace() ); - titleMap[ link.absFilePath() ] = (*it).title.stripWhiteSpace(); - } - } - processEvents(); -} - -void HelpDialog::getAllContents() -{ - TQFile contentFile( cacheFilesPath + "contentdb." + Config::configuration()->profileName() ); - contentList.clear(); - if ( !contentFile.open( IO_ReadOnly ) ) { - buildContentDict(); - return; - } - - TQDataStream ds( &contentFile ); - TQ_UINT32 fileAges; - ds >> fileAges; - if ( fileAges != getFileAges() ) { - contentFile.close(); - buildContentDict(); - return; - } - TQString key; - TQValueList lst; - while ( !ds.atEnd() ) { - ds >> key; - ds >> lst; - contentList.insert( key, new TQValueList( lst ) ); - } - contentFile.close(); - processEvents(); - -} - -void HelpDialog::buildContentDict() -{ - TQStringList docuFiles = Config::configuration()->docFiles(); - - TQ_UINT32 fileAges = 0; - for( TQStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++ ) { - TQFile file( *it ); - if ( !file.exists() ) { - TQMessageBox::warning( this, tr( "Warning" ), - tr( "Documentation file %1 does not exist!\n" - "Skipping file." ).arg( TQFileInfo( file ).absFilePath() ) ); - continue; - } - fileAges += TQFileInfo( file ).lastModified().toTime_t(); - DocuParser *handler = DocuParser::createParser( *it ); - if( !handler ) { - TQMessageBox::warning( this, tr( "Warning" ), - tr( "Documentation file %1 is not compatible!\n" - "Skipping file." ).arg( TQFileInfo( file ).absFilePath() ) ); - continue; - } - bool ok = handler->parse( &file ); - file.close(); - if( ok ) { - contentList.insert( *it, new TQValueList( handler->getContentItems() ) ); - delete handler; - } else { - TQString msg = TQString( "In file %1:\n%2" ) - .arg( TQFileInfo( file ).absFilePath() ) - .arg( handler->errorProtocol() ); - TQMessageBox::critical( this, tr( "Parse Error" ), tr( msg ) ); - continue; - } - } - - TQString pname = Config::configuration()->profileName(); - TQFile contentOut( cacheFilesPath + "contentdb." + pname ); - TQFile::remove( cacheFilesPath + "indexdb.dict." + pname ); - TQFile::remove( cacheFilesPath + "indexdb.doc." + pname ); - if ( contentOut.open( IO_WriteOnly ) ) { - TQDataStream s( &contentOut ); - s << fileAges; - TQDictIterator it( contentList ); - for ( ; it.current(); ++it ) { - s << it.currentKey(); - s << *(it.current()); - } - contentOut.close(); - } -} - -void HelpDialog::currentTabChanged( const TQString &s ) -{ - if ( stripAmpersand( s ).contains( tr( "Index" ) ) ) - TQTimer::singleShot( 0, this, TQT_SLOT( loadIndexFile() ) ); - else if ( stripAmpersand( s ).contains( tr( "Bookmarks" ) ) ) - insertBookmarks(); - else if ( stripAmpersand( s ).contains( tr( "Contents" ) ) ) - TQTimer::singleShot( 0, this, TQT_SLOT( insertContents() ) ); - else if ( stripAmpersand( s ).contains( tr( "Search" ) ) ) - TQTimer::singleShot( 0, this, TQT_SLOT( setupFullTextIndex() ) ); -} - -void HelpDialog::showInitDoneMessage() -{ - if ( initDoneMsgShown ) - return; - initDoneMsgShown = TRUE; - help->statusBar()->message( tr( "Done" ), 3000 ); -} - -void HelpDialog::currentIndexChanged( TQListBoxItem * ) -{ -} - - -void HelpDialog::showTopic( int button, TQListBoxItem *item, - const TQPoint & ) -{ - if( button == Qt::LeftButton && item ) - showTopic(); -} - -void HelpDialog::showTopic( int button, TQListViewItem *item, - const TQPoint & ) -{ - if( button == Qt::LeftButton && item ) - showTopic(); -} - -void HelpDialog::showTopic( TQListViewItem *item ) -{ - if( item ) - showTopic(); -} - -void HelpDialog::showTopic() -{ - if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).contains( tr( "Index" ) ) ) - showIndexTopic(); - else if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).contains( tr( "Bookmarks" ) ) ) - showBookmarkTopic(); - else if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).contains( tr( "Contents" ) ) ) - showContentsTopic(); -} - -void HelpDialog::showIndexTopic() -{ - TQListBoxItem *i = listIndex->item( listIndex->currentItem() ); - if ( !i ) - return; - - editIndex->blockSignals( TRUE ); - editIndex->setText( i->text() ); - editIndex->blockSignals( FALSE ); - - HelpNavigationListItem *item = (HelpNavigationListItem*)i; - - TQStringList links = item->links(); - if ( links.count() == 1 ) { - emit showLink( links.first() ); - } else { - qHeapSort( links ); - TQStringList::Iterator it = links.begin(); - TQStringList linkList; - TQStringList linkNames; - for ( ; it != links.end(); ++it ) { - linkList << *it; - linkNames << titleOfLink( *it ); - } - TQString link = TopicChooser::getLink( this, linkNames, linkList, i->text() ); - if ( !link.isEmpty() ) - emit showLink( link ); - } -} - -void HelpDialog::searchInIndex( const TQString &s ) -{ - TQListBoxItem *i = listIndex->firstItem(); - TQString sl = s.lower(); - while ( i ) { - TQString t = i->text(); - if ( t.length() >= sl.length() && - i->text().left(s.length()).lower() == sl ) { - listIndex->setCurrentItem( i ); - listIndex->setTopItem(listIndex->index(i)); - break; - } - i = i->next(); - } -} - -TQString HelpDialog::titleOfLink( const TQString &link ) -{ - TQString s( link ); - s.remove( s.find( '#' ), s.length() ); - s = titleMap[ s ]; - if ( s.isEmpty() ) - return link; - return s; -} - -bool HelpDialog::eventFilter( TQObject * o, TQEvent * e ) -{ - if ( !o || !e ) - return TRUE; - - if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(editIndex) && e->type() == TQEvent::KeyPress ) { - TQKeyEvent *ke = (TQKeyEvent*)e; - if ( ke->key() == Qt::Key_Up ) { - int i = listIndex->currentItem(); - if ( --i >= 0 ) { - listIndex->setCurrentItem( i ); - editIndex->blockSignals( TRUE ); - editIndex->setText( listIndex->currentText() ); - editIndex->blockSignals( FALSE ); - } - return TRUE; - } else if ( ke->key() == Qt::Key_Down ) { - int i = listIndex->currentItem(); - if ( ++i < int(listIndex->count()) ) { - listIndex->setCurrentItem( i ); - editIndex->blockSignals( TRUE ); - editIndex->setText( listIndex->currentText() ); - editIndex->blockSignals( FALSE ); - } - return TRUE; - } else if ( ke->key() == TQt::Key_Next || ke->key() == TQt::Key_Prior ) { - TQApplication::sendEvent( listIndex, e); - editIndex->blockSignals( TRUE ); - editIndex->setText( listIndex->currentText() ); - editIndex->blockSignals( FALSE ); - } - } - - return TQWidget::eventFilter( o, e ); -} - -void HelpDialog::addBookmark() -{ - if ( !bookmarksInserted ) - insertBookmarks(); - TQString link = TQUrl( help->browsers()->currentBrowser()->context(), - help->browsers()->currentBrowser()->source() ).path(); - TQString title = help->browsers()->currentBrowser()->documentTitle(); - if ( title.isEmpty() ) - title = titleOfLink( link ); - HelpNavigationContentsItem *i = new HelpNavigationContentsItem( listBookmarks, 0 ); - i->setText( 0, title ); - i->setLink( link ); - saveBookmarks(); - help->updateBookmarkMenu(); -} - -void HelpDialog::removeBookmark() -{ - if ( !listBookmarks->currentItem() ) - return; - - delete listBookmarks->currentItem(); - saveBookmarks(); - if ( listBookmarks->firstChild() ) { - listBookmarks->setSelected( listBookmarks->firstChild(), TRUE ); - } - help->updateBookmarkMenu(); -} - -void HelpDialog::insertBookmarks() -{ - if ( bookmarksInserted ) - return; - bookmarksInserted = TRUE; - listBookmarks->clear(); - TQFile f( cacheFilesPath + "bookmarks." + Config::configuration()->profileName() ); - if ( !f.open( IO_ReadOnly ) ) - return; - TQTextStream ts( &f ); - while ( !ts.atEnd() ) { - HelpNavigationContentsItem *i = new HelpNavigationContentsItem( listBookmarks, 0 ); - i->setText( 0, ts.readLine() ); - i->setLink( ts.readLine() ); - } - help->updateBookmarkMenu(); - showInitDoneMessage(); -} - -void HelpDialog::currentBookmarkChanged( TQListViewItem * ) -{ -} - -void HelpDialog::showBookmarkTopic() -{ - if ( !listBookmarks->currentItem() ) - return; - - HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)listBookmarks->currentItem(); - TQString absPath = ""; - if ( TQFileInfo( i->link() ).isRelative() ) - absPath = documentationPath + "/"; - emit showLink( absPath + i->link() ); -} - -void HelpDialog::saveBookmarks() -{ - TQFile f( cacheFilesPath + "bookmarks." + Config::configuration()->profileName() ); - if ( !f.open( IO_WriteOnly ) ) - return; - TQTextStream ts( &f ); - TQListViewItemIterator it( listBookmarks ); - for ( ; it.current(); ++it ) { - HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)it.current(); - ts << i->text( 0 ) << endl; - ts << i->link() << endl; - } - f.close(); -} - -void HelpDialog::insertContents() -{ - if ( contentsInserted ) - return; - - if ( contentList.isEmpty() ) - getAllContents(); - - contentsInserted = TRUE; - listContents->clear(); - setCursor( Qt::WaitCursor ); - if ( !titleMapDone ) - setupTitleMap(); - - listContents->setSorting( -1 ); - - TQDictIterator lstIt( contentList ); - for ( ; lstIt.current(); ++lstIt ) { - HelpNavigationContentsItem *newEntry; - - HelpNavigationContentsItem *contentEntry = 0; - TQPtrStack stack; - stack.clear(); - int depth = 0; - bool root = FALSE; - - HelpNavigationContentsItem *lastItem[64]; - for( int j = 0; j < 64; ++j ) - lastItem[j] = 0; - - - TQValueList &lst = *(lstIt.current()); - TQValueListConstIterator it; - for( it = lst.begin(); it != lst.end(); ++it ){ - ContentItem item = *it; - if( item.depth == 0 ){ - newEntry = new HelpNavigationContentsItem( listContents, 0 ); - newEntry->setPixmap( 0, TQPixmap::fromMimeSource( "book.png" ) ); - newEntry->setText( 0, item.title ); - newEntry->setLink( item.reference ); - stack.push( newEntry ); - depth = 1; - root = TRUE; - } - else{ - if( (item.depth > depth) && root ) { - depth = item.depth; - stack.push( contentEntry ); - } - if( item.depth == depth ) { - contentEntry = new HelpNavigationContentsItem( stack.top(), lastItem[ depth ] ); - lastItem[ depth ] = contentEntry; - contentEntry->setText( 0, item.title ); - contentEntry->setLink( item.reference ); - } - else if( item.depth < depth ) { - stack.pop(); - depth--; - item = *(--it); - } - } - } - processEvents(); - } - setCursor( Qt::ArrowCursor ); - showInitDoneMessage(); -} - -void HelpDialog::currentContentsChanged( TQListViewItem * ) -{ -} - -void HelpDialog::showContentsTopic() -{ - HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)listContents->currentItem(); - if ( !i ) - return; - emit showLink( i->link() ); -} - -void HelpDialog::toggleContents() -{ - if ( !isVisible() || tabWidget->currentPageIndex() != 0 ) { - tabWidget->setCurrentPage( 0 ); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleIndex() -{ - if ( !isVisible() || tabWidget->currentPageIndex() != 1 || !editIndex->hasFocus() ) { - tabWidget->setCurrentPage( 1 ); - parentWidget()->show(); - editIndex->setFocus(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleBookmarks() -{ - if ( !isVisible() || tabWidget->currentPageIndex() != 2 ) { - tabWidget->setCurrentPage( 2 ); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleSearch() -{ - if ( !isVisible() || tabWidget->currentPageIndex() != 3 ) { - tabWidget->setCurrentPage( 3 ); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::setupFullTextIndex() -{ - if ( fullTextIndex ) - return; - - TQStringList documentList; - TQString pname = Config::configuration()->profileName(); - fullTextIndex = new Index( documentList, TQDir::homeDirPath() ); // ### Is this correct ? - if (!verifyDirectory(cacheFilesPath)) { - TQMessageBox::warning(help, tr("TQt Assistant"), - tr("Failed to save fulltext search index\n" - "Assistant will not work!")); - return; - } - searchButton->setEnabled(FALSE); - helpButton->setEnabled(FALSE); - termsEdit->setEnabled(FALSE); - - fullTextIndex->setDictionaryFile( cacheFilesPath + "indexdb.dict." + pname ); - fullTextIndex->setDocListFile( cacheFilesPath + "indexdb.doc." + pname ); - processEvents(); - - connect( fullTextIndex, TQT_SIGNAL( indexingProgress( int ) ), - this, TQT_SLOT( setIndexingProgress( int ) ) ); - TQFile f( cacheFilesPath + "indexdb.dict." + pname ); - if ( !f.exists() ) { - TQMap::ConstIterator it = titleMap.begin(); - TQString documentName; - for ( ; it != titleMap.end(); ++it ) { - documentName = it.key(); - int i = documentName.findRev('#'); - if ( i > -1 ) - documentName = documentName.left( i ); - - if (!documentList.contains(documentName)) - documentList << documentName; - } - loadIndexFile(); - for (TQStringList::Iterator it2 = keywordDocuments.begin(); it2 != keywordDocuments.end(); ++it2) { - if (!documentList.contains(*it2)) - documentList << *it2; - } - fullTextIndex->setDocList( documentList ); - - help->statusBar()->clear(); - setCursor( Qt::WaitCursor ); - labelPrepare->setText( tr( "Indexing files..." ) ); - progressPrepare->setTotalSteps( 100 ); - progressPrepare->reset(); - progressPrepare->show(); - framePrepare->show(); - processEvents(); - if ( fullTextIndex->makeIndex() != -1 ) { - fullTextIndex->writeDict(); - progressPrepare->setProgress( 100 ); - framePrepare->hide(); - setCursor( Qt::ArrowCursor ); - showInitDoneMessage(); - keywordDocuments.clear(); - } - } else { - setCursor( Qt::WaitCursor ); - help->statusBar()->message( tr( "Reading dictionary..." ) ); - processEvents(); - fullTextIndex->readDict(); - help->statusBar()->message( tr( "Done" ), 3000 ); - setCursor( Qt::ArrowCursor ); - } - searchButton->setEnabled(TRUE); - termsEdit->setEnabled(TRUE); - helpButton->setEnabled(TRUE); -} - -void HelpDialog::setIndexingProgress( int prog ) -{ - progressPrepare->setProgress( prog ); - processEvents(); -} - -void HelpDialog::startSearch() -{ - TQString str = termsEdit->text(); - str = str.replace( "\'", "\"" ); - str = str.replace( "`", "\"" ); - TQString buf = str; - str = str.replace( "-", " " ); - str = str.replace( TQRegExp( "\\s[\\S]?\\s" ), " " ); - terms = TQStringList::split( " ", str ); - TQStringList termSeq; - TQStringList seqWords; - TQStringList::iterator it = terms.begin(); - for ( ; it != terms.end(); ++it ) { - (*it) = (*it).simplifyWhiteSpace(); - (*it) = (*it).lower(); - (*it) = (*it).replace( "\"", "" ); - } - if ( str.contains( '\"' ) ) { - if ( (str.contains( '\"' ))%2 == 0 ) { - int beg = 0; - int end = 0; - TQString s; - beg = str.find( '\"', beg ); - while ( beg != -1 ) { - beg++; - end = str.find( '\"', beg ); - s = str.mid( beg, end - beg ); - s = s.lower(); - s = s.simplifyWhiteSpace(); - if ( s.contains( '*' ) ) { - TQMessageBox::warning( this, tr( "Full Text Search" ), - tr( "Using a wildcard within phrases is not allowed." ) ); - return; - } - seqWords += TQStringList::split( ' ', s ); - termSeq << s; - beg = str.find( '\"', end + 1); - } - } else { - TQMessageBox::warning( this, tr( "Full Text Search" ), - tr( "The closing quotation mark is missing." ) ); - return; - } - } - setCursor( Qt::WaitCursor ); - foundDocs.clear(); - foundDocs = fullTextIndex->query( terms, termSeq, seqWords ); - TQString msg( TQString( "%1 documents found." ).arg( foundDocs.count() ) ); - help->statusBar()->message( tr( msg ), 3000 ); - resultBox->clear(); - for ( it = foundDocs.begin(); it != foundDocs.end(); ++it ) - resultBox->insertItem( fullTextIndex->getDocumentTitle( *it ) ); - - terms.clear(); - bool isPhrase = FALSE; - TQString s = ""; - for ( int i = 0; i < (int)buf.length(); ++i ) { - if ( buf[i] == '\"' ) { - isPhrase = !isPhrase; - s = s.simplifyWhiteSpace(); - if ( !s.isEmpty() ) - terms << s; - s = ""; - } else if ( buf[i] == ' ' && !isPhrase ) { - s = s.simplifyWhiteSpace(); - if ( !s.isEmpty() ) - terms << s; - s = ""; - } else - s += buf[i]; - } - if ( !s.isEmpty() ) - terms << s; - - setCursor( Qt::ArrowCursor ); -} - -void HelpDialog::showSearchHelp() -{ - emit showLink( Config::configuration()->assistantDocPath() + "/assistant-5.html" ); -} - -void HelpDialog::showResultPage( int button, TQListBoxItem *i, const TQPoint & ) -{ - if( button == Qt::LeftButton ) { - showResultPage( i ); - } -} - -void HelpDialog::showResultPage( TQListBoxItem *i ) -{ - if( !i ) - return; - emit showSearchLink( foundDocs[resultBox->index( i )], terms ); -} - -void HelpDialog::showItemMenu( TQListBoxItem *item, const TQPoint &pos ) -{ - if ( !item ) - return; - int id = itemPopup->exec( pos ); - if ( id == 0 ) { - if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).contains( tr( "Index" ) ) ) - showTopic(); - else { - showResultPage( item ); - } - } else if ( id > 0 ) { - HelpWindow *hw = help->browsers()->currentBrowser(); - if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).contains( tr( "Index" ) ) ) { - editIndex->blockSignals( TRUE ); - editIndex->setText( item->text() ); - editIndex->blockSignals( FALSE ); - - HelpNavigationListItem *hi = (HelpNavigationListItem*)item; - - TQStringList links = hi->links(); - if ( links.count() == 1 ) { - if ( id == 1 ) - hw->openLinkInNewWindow( links.first() ); - else - hw->openLinkInNewPage( links.first() ); - } else { - TQStringList::Iterator it = links.begin(); - TQStringList linkList; - TQStringList linkNames; - for ( ; it != links.end(); ++it ) { - linkList << *it; - linkNames << titleOfLink( *it ); - } - TQString link = TopicChooser::getLink( this, linkNames, linkList, item->text() ); - if ( !link.isEmpty() ) { - if ( id == 1 ) - hw->openLinkInNewWindow( link ); - else - hw->openLinkInNewPage( link ); - } - } - } else { - TQString link = foundDocs[ resultBox->index( item ) ]; - if ( id == 1 ) - hw->openLinkInNewWindow( link ); - else - hw->openLinkInNewPage( link ); - } - } -} - -void HelpDialog::showItemMenu( TQListViewItem *item, const TQPoint &pos ) -{ - if ( !item ) - return; - int id = itemPopup->exec( pos ); - if ( id == 0 ) { - if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).contains( tr( "Contents" ) ) ) - showContentsTopic(); - else - showBookmarkTopic(); - } else if ( id > 0 ) { - HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)item; - if ( id == 1 ) - help->browsers()->currentBrowser()->openLinkInNewWindow( i->link() ); - else - help->browsers()->currentBrowser()->openLinkInNewPage( i->link() ); - } -} diff --git a/tqtinterface/qt4/tools/assistant/helpdialogimpl.h b/tqtinterface/qt4/tools/assistant/helpdialogimpl.h deleted file mode 100644 index 6dd5c62..0000000 --- a/tqtinterface/qt4/tools/assistant/helpdialogimpl.h +++ /dev/null @@ -1,173 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef HELPDIALOGIMPL_H -#define HELPDIALOGIMPL_H - -#include "helpdialog.h" -#include "index.h" -#include "helpwindow.h" -#include "docuparser.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -class TQProgressBar; -class MainWindow; -class TQTextBrowser; - -class HelpNavigationListItem : public TQListBoxText -{ -public: - HelpNavigationListItem( TQListBox *ls, const TQString &txt ); - - void addLink( const TQString &link ); - TQStringList links() const { return linkList; } -private: - TQStringList linkList; - -}; - -class SearchValidator : public TQValidator -{ - Q_OBJECT - TQ_OBJECT -public: - SearchValidator( TQObject *parent, const char *name = 0 ) - : TQValidator( parent, name ) {} - ~SearchValidator() {} - TQValidator::State validate( TQString &str, int & ) const; -}; - -class HelpNavigationContentsItem : public TQListViewItem -{ -public: - HelpNavigationContentsItem( TQListView *v, TQListViewItem *after ); - HelpNavigationContentsItem( TQListViewItem *v, TQListViewItem *after ); - - void setLink( const TQString &lnk ); - TQString link() const; - -private: - TQString theLink; -}; - -class HelpDialog : public HelpDialogBase -{ - Q_OBJECT - TQ_OBJECT - -public: - HelpDialog( TQWidget *parent, MainWindow *h ); - - TQString titleOfLink( const TQString &link ); - bool eventFilter( TQObject *, TQEvent * ); - bool lastWindowClosed() { return lwClosed; } - - void timerEvent(TQTimerEvent *e); - -protected Q_SLOTS: - void showTopic( int, TQListBoxItem *, const TQPoint & ); - void showTopic( int, TQListViewItem *, const TQPoint & ); - void showTopic( TQListViewItem * ); - void loadIndexFile(); - void insertContents(); - void setupFullTextIndex(); - void currentTabChanged( const TQString &s ); - void currentIndexChanged( TQListBoxItem *i ); - void showTopic(); - void searchInIndex( const TQString &s ); - void addBookmark(); - void removeBookmark(); - void currentBookmarkChanged( TQListViewItem *i ); - void currentContentsChanged( TQListViewItem *i ); - void startSearch(); - void showSearchHelp(); - -public Q_SLOTS: - void initialize(); - void toggleContents(); - void toggleIndex(); - void toggleBookmarks(); - void toggleSearch(); - - -Q_SIGNALS: - void showLink( const TQString &s ); - void showSearchLink( const TQString &s, const TQStringList &terms ); - -private Q_SLOTS: - void lastWinClosed(); - void showResultPage( int button, TQListBoxItem *i, const TQPoint &p ); - void showResultPage( TQListBoxItem *i ); - void setIndexingProgress( int prog ); - void showItemMenu( TQListBoxItem *item, const TQPoint &pos ); - void showItemMenu( TQListViewItem *item, const TQPoint &pos ); - void insertBookmarks(); - void processEvents(); - -private: - typedef TQValueList ContentList; - void removeOldCacheFiles(); - void buildKeywordDB(); - TQ_UINT32 getFileAges(); - void showIndexTopic(); - void showBookmarkTopic(); - void setupTitleMap(); - void saveBookmarks(); - void showContentsTopic(); - void showInitDoneMessage(); - void buildContentDict(); - - TQMap titleMap; - bool indexDone, bookmarksInserted, titleMapDone, contentsInserted; - bool lwClosed; - MainWindow *help; - TQString documentationPath; - Index *fullTextIndex; - TQStringList terms, foundDocs; - bool initDoneMsgShown; - void getAllContents(); - TQDict contentList; - TQPopupMenu *itemPopup; - TQString cacheFilesPath; - TQStringList keywordDocuments; -}; - -#endif diff --git a/tqtinterface/qt4/tools/assistant/helpwindow.cpp b/tqtinterface/qt4/tools/assistant/helpwindow.cpp deleted file mode 100644 index bf338a9..0000000 --- a/tqtinterface/qt4/tools/assistant/helpwindow.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "helpwindow.h" -#include "mainwindow.h" -#include "tabbedbrowser.h" -#include "helpdialogimpl.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(TQ_OS_WIN32) -#include -#endif - -HelpWindow::HelpWindow( MainWindow *w, TQWidget *parent, const char *name ) - : TQTextBrowser( parent, name ), mw( w ), blockScroll( FALSE ), - shiftPressed( FALSE ), newWindow( FALSE ) -{ - connect(this, TQT_SIGNAL(forwardAvailable(bool)), this, TQT_SLOT(updateForward(bool))); - connect(this, TQT_SIGNAL(backwardAvailable(bool)), this, TQT_SLOT(updateBackward(bool))); -} - -void HelpWindow::setSource( const TQString &name ) -{ - if ( name.isEmpty() ) - return; - - if (newWindow || shiftPressed) { - removeSelection(); - mw->saveSettings(); - mw->saveToolbarSettings(); - MainWindow *nmw = new MainWindow; - - TQFileInfo currentInfo( source() ); - TQFileInfo linkInfo( name ); - TQString target = name; - if( linkInfo.isRelative() ) - target = currentInfo.dirPath( TRUE ) + "/" + name; - - nmw->setup(); - nmw->move( mw->tqgeometry().topLeft() ); - if ( mw->isMaximized() ) - nmw->showMaximized(); - else - nmw->show(); - nmw->showLink( target ); - return; - } - - if ( name.left( 7 ) == "http://" || name.left( 6 ) == "ftp://" ) { - TQString webbrowser = Config::configuration()->webBrowser(); - if ( webbrowser.isEmpty() ) { -#if defined(TQ_OS_WIN32) - TQT_WA( { - ShellExecute( winId(), 0, (TCHAR*)name.ucs2(), 0, 0, SW_SHOWNORMAL ); - } , { - ShellExecuteA( winId(), 0, name.local8Bit(), 0, 0, SW_SHOWNORMAL ); - } ); -#elif defined(TQ_OS_MACX) - webbrowser = "/usr/bin/open"; -#else - int result = TQMessageBox::information( mw, tr( "Help" ), - tr( "Currently no Web browser is selected.\nPlease use the settings dialog to specify one!\n" ), - "Open", "Cancel" ); - if ( result == 0 ) { - emit chooseWebBrowser(); - webbrowser = Config::configuration()->webBrowser(); - } -#endif - if ( webbrowser.isEmpty() ) - return; - } - TQProcess *proc = new TQProcess(TQT_TQOBJECT(this)); - - proc->addArgument( webbrowser ); - TQObject::connect(proc, TQT_SIGNAL(processExited()), proc, TQT_SLOT(deleteLater())); - proc->addArgument( name ); - proc->start(); - return; - } - - if ( name.right( 3 ) == "pdf" ) { - TQString pdfbrowser = Config::configuration()->pdfReader(); - if ( pdfbrowser.isEmpty() ) { -#if defined(TQ_OS_MACX) - pdfbrowser = "/usr/bin/open"; -#else - TQMessageBox::information( mw, - tr( "Help" ), - tr( "No PDF Viewer has been specified\n" - "Please use the settings dialog to specify one!\n" ) ); - return; -#endif - } - TQFileInfo info( pdfbrowser ); - if( !info.exists() ) { - TQMessageBox::information( mw, - tr( "Help" ), - tr( "TQt Assistant is unable to start the PDF Viewer\n\n" - "%1\n\n" - "Please make sure that the executable exists and is located at\n" - "the specified location." ).arg( pdfbrowser ) ); - return; - } - TQProcess *proc = new TQProcess(TQT_TQOBJECT(this)); - TQObject::connect(proc, TQT_SIGNAL(processExited()), proc, TQT_SLOT(deleteLater())); - proc->addArgument( pdfbrowser ); - proc->addArgument( name ); - proc->start(); - - return; - } - - TQUrl u( context(), name ); - if ( !u.isLocalFile() ) { - TQMessageBox::information( mw, tr( "Help" ), tr( "Can't load and display non-local file\n" - "%1" ).arg( name ) ); - return; - } - - setText(""); - TQTextBrowser::setSource( name ); -} - - -void HelpWindow::openLinkInNewWindow() -{ - if ( lastAnchor.isEmpty() ) - return; - newWindow = TRUE; - setSource(lastAnchor); - newWindow = FALSE; -} - -void HelpWindow::openLinkInNewWindow( const TQString &link ) -{ - lastAnchor = link; - openLinkInNewWindow(); -} - -void HelpWindow::openLinkInNewPage() -{ - if( lastAnchor.isEmpty() ) - return; - mw->browsers()->newTab( lastAnchor ); - lastAnchor = TQString(); -} - -void HelpWindow::openLinkInNewPage( const TQString &link ) -{ - lastAnchor = link; - openLinkInNewPage(); -} - -TQPopupMenu *HelpWindow::createPopupMenu( const TQPoint& pos ) -{ - TQPopupMenu *m = new TQPopupMenu(0); - lastAnchor = anchorAt( pos ); - if ( !lastAnchor.isEmpty() ) { - if ( lastAnchor.at( 0 ) == '#' ) { - TQString src = source(); - int hsh = src.find( '#' ); - lastAnchor = ( hsh>=0 ? src.left( hsh ) : src ) + lastAnchor; - } - m->insertItem( tr("Open Link in New Window\tShift+LMB"), - this, TQT_SLOT( openLinkInNewWindow() ) ); - m->insertItem( tr("Open Link in New Tab"), - this, TQT_SLOT( openLinkInNewPage() ) ); - } - mw->actionNewWindow->addTo( m ); - mw->actionOpenPage->addTo( m ); - mw->actionClosePage->addTo( m ); - m->insertSeparator(); - mw->actionGoPrevious->addTo( m ); - mw->actionGoNext->addTo( m ); - mw->actionGoHome->addTo( m ); - m->insertSeparator(); - mw->actionZoomIn->addTo( m ); - mw->actionZoomOut->addTo( m ); - m->insertSeparator(); - mw->actionEditCopy->addTo( m ); - mw->actionEditFind->addTo( m ); - return m; -} - -void HelpWindow::blockScrolling( bool b ) -{ - blockScroll = b; -} - -void HelpWindow::ensureCursorVisible() -{ - if ( !blockScroll ) - TQTextBrowser::ensureCursorVisible(); -} - -void HelpWindow::contentsMousePressEvent(TQMouseEvent *e) -{ - shiftPressed = ( e->state() & ShiftButton ); - TQTextBrowser::contentsMousePressEvent(e); -} - -void HelpWindow::keyPressEvent(TQKeyEvent *e) -{ - shiftPressed = ( e->state() & ShiftButton ); - TQTextBrowser::keyPressEvent(e); -} - -void HelpWindow::copy() -{ - if (textFormat() == TQt::PlainText) { - TQTextEdit::copy(); - } else { - TQt::TextFormat oldTf = textFormat(); - setTextFormat(TQt::PlainText); - TQString selectText = selectedText(); - selectText.replace("
", "\n"); - selectText.replace("\xa0", " "); - selectText.replace(">", ">"); - selectText.replace("<", "<"); - selectText.replace("&", "&"); - - TQClipboard *cb = TQApplication::tqclipboard(); - if (cb->supportsSelection()) - cb->setText(selectText, TQClipboard::Selection); - cb->setText(selectText, TQClipboard::Clipboard); - setTextFormat(oldTf); - } -} - -void HelpWindow::updateForward(bool fwd) -{ - fwdAvail = fwd; -} - -void HelpWindow::updateBackward(bool back) -{ - backAvail = back; -} diff --git a/tqtinterface/qt4/tools/assistant/helpwindow.h b/tqtinterface/qt4/tools/assistant/helpwindow.h deleted file mode 100644 index 5ae2d5e..0000000 --- a/tqtinterface/qt4/tools/assistant/helpwindow.h +++ /dev/null @@ -1,88 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef HELPWINDOW_H -#define HELPWINDOW_H - -#include - -class MainWindow; -class TQKeyEvent; -class TQMime; -class TQMouseEvent; - -class HelpWindow : public TQTextBrowser -{ - Q_OBJECT - TQ_OBJECT -public: - HelpWindow( MainWindow *m, TQWidget *parent = 0, const char *name = 0 ); - void setSource( const TQString &name ); - TQPopupMenu *createPopupMenu( const TQPoint& pos ); - void blockScrolling( bool b ); - void openLinkInNewWindow( const TQString &link ); - void openLinkInNewPage( const TQString &link ); - void addMimePath( const TQString &path ); - - void contentsMousePressEvent(TQMouseEvent *e); - void keyPressEvent(TQKeyEvent *); - - bool isBackwardAvailable() const { return backAvail; } - bool isForwardAvailable() const { return fwdAvail; } - -Q_SIGNALS: - void chooseWebBrowser(); - -public Q_SLOTS: - void copy(); -protected Q_SLOTS: - void ensureCursorVisible(); - -private Q_SLOTS: - void openLinkInNewWindow(); - void openLinkInNewPage(); - void updateForward(bool); - void updateBackward(bool); - -private: - MainWindow *mw; - TQString lastAnchor; - bool blockScroll; - bool shiftPressed; - bool newWindow; - TQMimeSourceFactory *mimeSourceFactory; - bool fwdAvail; - bool backAvail; -}; - -#endif diff --git a/tqtinterface/qt4/tools/assistant/images/addtab.png b/tqtinterface/qt4/tools/assistant/images/addtab.png deleted file mode 100644 index a88697f..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/addtab.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/appicon.png b/tqtinterface/qt4/tools/assistant/images/appicon.png deleted file mode 100644 index a50dc9c..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/appicon.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/assistant.png b/tqtinterface/qt4/tools/assistant/images/assistant.png deleted file mode 100644 index 1d245a5..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/assistant.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/book.png b/tqtinterface/qt4/tools/assistant/images/book.png deleted file mode 100644 index d33c0c3..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/book.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/closetab.png b/tqtinterface/qt4/tools/assistant/images/closetab.png deleted file mode 100644 index 61ac034..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/closetab.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/d_closetab.png b/tqtinterface/qt4/tools/assistant/images/d_closetab.png deleted file mode 100644 index d8d583f..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/d_closetab.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/designer.png b/tqtinterface/qt4/tools/assistant/images/designer.png deleted file mode 100644 index 2803191..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/designer.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/editcopy.png b/tqtinterface/qt4/tools/assistant/images/editcopy.png deleted file mode 100644 index a49eeec..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/editcopy.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/find.png b/tqtinterface/qt4/tools/assistant/images/find.png deleted file mode 100644 index b846909..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/find.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/home.png b/tqtinterface/qt4/tools/assistant/images/home.png deleted file mode 100644 index 506e5df..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/home.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/linguist.png b/tqtinterface/qt4/tools/assistant/images/linguist.png deleted file mode 100644 index 1042753..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/linguist.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/next.png b/tqtinterface/qt4/tools/assistant/images/next.png deleted file mode 100644 index f896f84..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/next.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/previous.png b/tqtinterface/qt4/tools/assistant/images/previous.png deleted file mode 100644 index 0d8ac4f..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/previous.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/print.png b/tqtinterface/qt4/tools/assistant/images/print.png deleted file mode 100644 index 27a52af..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/print.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/qt.png b/tqtinterface/qt4/tools/assistant/images/qt.png deleted file mode 100644 index 112d799..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/qt.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/splash.png b/tqtinterface/qt4/tools/assistant/images/splash.png deleted file mode 100644 index b2dfc76..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/splash.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/whatsthis.xpm b/tqtinterface/qt4/tools/assistant/images/whatsthis.xpm deleted file mode 100644 index 799b599..0000000 --- a/tqtinterface/qt4/tools/assistant/images/whatsthis.xpm +++ /dev/null @@ -1,26 +0,0 @@ -/* XPM */ -static char *whatsthis[] = { -/* width height ncolors chars_per_pixel */ -"16 16 3 1", -/* colors */ -"# c None", -". c #000000", -"a c #000083", -/* pixels */ -".########aaaaa##", -"..######aaa#aaa#", -"...####aaa###aaa", -"....###aa#####aa", -".....##aa#####aa", -"......##a####aaa", -".......#####aaa#", -"........###aaa##", -".........#aaa###", -".....#####aaa###", -"..#...##########", -".##...####aaa###", -"####...###aaa###", -"####...#########", -"#####...########", -"#####...########" -}; diff --git a/tqtinterface/qt4/tools/assistant/images/zoomin.png b/tqtinterface/qt4/tools/assistant/images/zoomin.png deleted file mode 100644 index 25f231b..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/zoomin.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/images/zoomout.png b/tqtinterface/qt4/tools/assistant/images/zoomout.png deleted file mode 100644 index 8ab8ece..0000000 Binary files a/tqtinterface/qt4/tools/assistant/images/zoomout.png and /dev/null differ diff --git a/tqtinterface/qt4/tools/assistant/index.cpp b/tqtinterface/qt4/tools/assistant/index.cpp deleted file mode 100644 index 7ed1a4f..0000000 --- a/tqtinterface/qt4/tools/assistant/index.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "index.h" - -#include -#include -#include -#include -#include - -#include - -int TermList::compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 ) -{ - if( ( (Term*)i1 )->frequency == ( (Term*)i2 )->frequency ) - return 0; - if( ( (Term*)i1 )->frequency < ( (Term*)i2 )->frequency ) - return -1; - return 1; -} - -TQDataStream &operator>>( TQDataStream &s, Document &l ) -{ - s >> l.docNumber; - s >> l.frequency; - return s; -} - -TQDataStream &operator<<( TQDataStream &s, const Document &l ) -{ - s << (TQ_INT16)l.docNumber; - s << (TQ_INT16)l.frequency; - return s; -} - -Index::Index( const TQString &dp, const TQString &hp ) - : TQObject( 0, 0 ), dict( 8999 ), docPath( dp ) -{ - alreadyHaveDocList = FALSE; - lastWindowClosed = FALSE; - connect( tqApp, TQT_SIGNAL( lastWindowClosed() ), - this, TQT_SLOT( setLastWinClosed() ) ); -} - -Index::Index( const TQStringList &dl, const TQString &hp ) - : TQObject( 0, 0 ), dict( 8999 ) -{ - docList = dl; - alreadyHaveDocList = TRUE; - lastWindowClosed = FALSE; - connect( tqApp, TQT_SIGNAL( lastWindowClosed() ), - this, TQT_SLOT( setLastWinClosed() ) ); -} - -void Index::setLastWinClosed() -{ - lastWindowClosed = TRUE; -} - -void Index::setDictionaryFile( const TQString &f ) -{ - dictFile = f; -} - -void Index::setDocListFile( const TQString &f ) -{ - docListFile = f; -} - -void Index::setDocList( const TQStringList &lst ) -{ - docList = lst; -} - -int Index::makeIndex() -{ - if ( !alreadyHaveDocList ) - setupDocumentList(); - if ( docList.isEmpty() ) - return 1; - TQStringList::Iterator it = docList.begin(); - int steps = docList.count() / 100; - if ( !steps ) - steps++; - int prog = 0; - for ( int i = 0; it != docList.end(); ++it, ++i ) { - if ( lastWindowClosed ) { - return -1; - } - parseDocument( *it, i ); - if ( i%steps == 0 ) { - prog++; - emit indexingProgress( prog ); - } - } - return 0; -} - -void Index::setupDocumentList() -{ - TQDir d( docPath ); - TQStringList lst = d.entryList( "*.html" ); - TQStringList::ConstIterator it = lst.begin(); - for ( ; it != lst.end(); ++it ) - docList.append( docPath + "/" + *it ); -} - -void Index::insertInDict( const TQString &str, int docNum ) -{ - if ( strcmp( str, "amp" ) == 0 || strcmp( str, "nbsp" ) == 0 ) - return; - Entry *e = 0; - if ( dict.count() ) - e = dict[ str ]; - - if ( e ) { - if ( e->documents.first().docNumber != docNum ) - e->documents.prepend( Document( docNum, 1 ) ); - else - e->documents.first().frequency++; - } else { - dict.insert( str, new Entry( docNum ) ); - } -} - -void Index::parseDocument( const TQString &filename, int docNum ) -{ - TQFile file( filename ); - if ( !file.open( IO_ReadOnly ) ) { - qWarning( "can not open file " + filename ); - return; - } - - TQTextStream s( &file ); - TQString text = s.read(); - if (text.isNull()) - return; - - bool valid = TRUE; - const TQChar *buf = text.tqunicode(); - TQChar str[64]; - TQChar c = buf[0]; - int j = 0; - int i = 0; - while ( (uint)j < text.length() ) { - if ( c == '<' || c == '&' ) { - valid = FALSE; - if ( i > 1 ) - insertInDict( TQString(str,i), docNum ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == '>' || c == ';' ) && !valid ) { - valid = TRUE; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == '_' ) && i < 63 ) { - str[i] = c.lower(); - ++i; - } else { - if ( i > 1 ) - insertInDict( TQString(str,i), docNum ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - insertInDict( TQString(str,i), docNum ); - file.close(); -} - -void Index::writeDict() -{ - TQDictIterator it( dict ); - TQFile f( dictFile ); - if ( !f.open( IO_WriteOnly ) ) - return; - TQDataStream s( &f ); - for( ; it.current(); ++it ) { - Entry *e = it.current(); - s << it.currentKey(); - s << e->documents; - } - f.close(); - writeDocumentList(); -} - -void Index::writeDocumentList() -{ - TQFile f( docListFile ); - if ( !f.open( IO_WriteOnly ) ) - return; - TQDataStream s( &f ); - s << docList; -} - -void Index::readDict() -{ - TQFile f( dictFile ); - if ( !f.open( IO_ReadOnly ) ) - return; - - dict.clear(); - TQDataStream s( &f ); - TQString key; - TQValueList docs; - while ( !s.atEnd() ) { - s >> key; - s >> docs; - dict.insert( key, new Entry( docs ) ); - } - f.close(); - readDocumentList(); -} - -void Index::readDocumentList() -{ - TQFile f( docListFile ); - if ( !f.open( IO_ReadOnly ) ) - return; - TQDataStream s( &f ); - s >> docList; -} - -TQStringList Index::query( const TQStringList &terms, const TQStringList &termSeq, const TQStringList &seqWords ) -{ - TermList termList; - - TQStringList::ConstIterator it = terms.begin(); - for ( it = terms.begin(); it != terms.end(); ++it ) { - Entry *e = 0; - if ( (*it).contains( '*' ) ) { - TQValueList wcts = setupDummyTerm( getWildcardTerms( *it ) ); - termList.append( new Term( "dummy", wcts.count(), wcts ) ); - } else if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( new Term( *it, e->documents.count(), e->documents ) ); - } else { - return TQStringList(); - } - } - termList.sort(); - - Term *minTerm = termList.first(); - if ( !termList.count() ) - return TQStringList(); - termList.removeFirst(); - - TQValueList minDocs = minTerm->documents; - TQValueList::iterator C; - TQValueList::ConstIterator It; - Term *t = termList.first(); - for ( ; t; t = termList.next() ) { - TQValueList docs = t->documents; - C = minDocs.begin(); - while ( C != minDocs.end() ) { - bool found = FALSE; - for ( It = docs.begin(); It != docs.end(); ++It ) { - if ( (*C).docNumber == (*It).docNumber ) { - (*C).frequency += (*It).frequency; - found = TRUE; - break; - } - } - if ( !found ) - C = minDocs.remove( C ); - else - ++C; - } - } - - TQStringList results; - qHeapSort( minDocs ); - if ( termSeq.isEmpty() ) { - for ( C = minDocs.begin(); C != minDocs.end(); ++C ) - results << docList[ (int)(*C).docNumber ]; - return results; - } - - TQString fileName; - for ( C = minDocs.begin(); C != minDocs.end(); ++C ) { - fileName = docList[ (int)(*C).docNumber ]; - if ( searchForPattern( termSeq, seqWords, fileName ) ) - results << fileName; - } - return results; -} - -TQString Index::getDocumentTitle( const TQString &fileName ) -{ - TQFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { - qWarning( "cannot open file " + fileName ); - return fileName; - } - TQTextStream s( &file ); - TQString text = s.read(); - - int start = text.find( "", 0, FALSE ) + 7; - int end = text.find( "", 0, FALSE ); - - TQString title = ( end - start <= 0 ? tr("Untitled") : text.mid( start, end - start ) ); - return title; -} - -TQStringList Index::getWildcardTerms( const TQString &term ) -{ - TQStringList lst; - TQStringList terms = split( term ); - TQValueList::iterator iter; - - TQDictIterator it( dict ); - for( ; it.current(); ++it ) { - int index = 0; - bool found = FALSE; - TQString text( it.currentKey() ); - for ( iter = terms.begin(); iter != terms.end(); ++iter ) { - if ( *iter == "*" ) { - found = TRUE; - continue; - } - if ( iter == terms.begin() && (*iter)[0] != text[0] ) { - found = FALSE; - break; - } - index = text.find( *iter, index ); - if ( *iter == terms.last() && index != (int)text.length()-1 ) { - index = text.findRev( *iter ); - if ( index != (int)text.length() - (int)(*iter).length() ) { - found = FALSE; - break; - } - } - if ( index != -1 ) { - found = TRUE; - index += (*iter).length(); - continue; - } else { - found = FALSE; - break; - } - } - if ( found ) - lst << text; - } - - return lst; -} - -TQStringList Index::split( const TQString &str ) -{ - TQStringList lst; - int j = 0; - int i = str.find( '*', j ); - - while ( i != -1 ) { - if ( i > j && i <= (int)str.length() ) { - lst << str.mid( j, i - j ); - lst << "*"; - } - j = i + 1; - i = str.find( '*', j ); - } - - int l = str.length() - 1; - if ( str.mid( j, l - j + 1 ).length() > 0 ) - lst << str.mid( j, l - j + 1 ); - - return lst; -} - -TQValueList Index::setupDummyTerm( const TQStringList &terms ) -{ - TermList termList; - TQStringList::ConstIterator it = terms.begin(); - for ( ; it != terms.end(); ++it ) { - Entry *e = 0; - if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( new Term( *it, e->documents.count(), e->documents ) ); - } - } - termList.sort(); - - TQValueList maxList; - - if ( !termList.count() ) - return maxList; - maxList = termList.last()->documents; - termList.removeLast(); - - TQValueList::iterator docIt; - Term *t = termList.first(); - while ( t ) { - TQValueList docs = t->documents; - for ( docIt = docs.begin(); docIt != docs.end(); ++docIt ) { - if ( maxList.findIndex( *docIt ) == -1 ) - maxList.append( *docIt ); - } - t = termList.next(); - } - return maxList; -} - -void Index::buildMiniDict( const TQString &str ) -{ - if ( miniDict[ str ] ) - miniDict[ str ]->positions.append( wordNum ); - ++wordNum; -} - -bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &words, const TQString &fileName ) -{ - TQFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { - qWarning( "cannot open file " + fileName ); - return FALSE; - } - - wordNum = 3; - miniDict.clear(); - TQStringList::ConstIterator cIt = words.begin(); - for ( ; cIt != words.end(); ++cIt ) - miniDict.insert( *cIt, new PosEntry( 0 ) ); - - TQTextStream s( &file ); - TQString text = s.read(); - bool valid = TRUE; - const TQChar *buf = text.tqunicode(); - TQChar str[64]; - TQChar c = buf[0]; - int j = 0; - int i = 0; - while ( (uint)j < text.length() ) { - if ( c == '<' || c == '&' ) { - valid = FALSE; - if ( i > 1 ) - buildMiniDict( TQString(str,i) ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == '>' || c == ';' ) && !valid ) { - valid = TRUE; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == '_' ) && i < 63 ) { - str[i] = c.lower(); - ++i; - } else { - if ( i > 1 ) - buildMiniDict( TQString(str,i) ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - buildMiniDict( TQString(str,i) ); - file.close(); - - TQStringList::ConstIterator patIt = patterns.begin(); - TQStringList wordLst; - TQValueList a, b; - TQValueList::iterator aIt; - for ( ; patIt != patterns.end(); ++patIt ) { - wordLst = TQStringList::split( ' ', *patIt ); - a = miniDict[ wordLst[0] ]->positions; - for ( int j = 1; j < (int)wordLst.count(); ++j ) { - b = miniDict[ wordLst[j] ]->positions; - aIt = a.begin(); - while ( aIt != a.end() ) { - if ( b.find( *aIt + 1 ) != b.end() ) { - (*aIt)++; - ++aIt; - } else { - aIt = a.remove( aIt ); - } - } - } - } - if ( a.count() ) - return TRUE; - return FALSE; -} diff --git a/tqtinterface/qt4/tools/assistant/index.h b/tqtinterface/qt4/tools/assistant/index.h deleted file mode 100644 index 8526ba0..0000000 --- a/tqtinterface/qt4/tools/assistant/index.h +++ /dev/null @@ -1,132 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef INDEX_H -#define INDEX_H - -#include -#include -#include -#include - -struct Document { - Document( int d, int f ) : docNumber( d ), frequency( f ) {} - Document() : docNumber( -1 ), frequency( 0 ) {} - bool operator==( const Document &doc ) const { - return docNumber == doc.docNumber; - } - bool operator<( const Document &doc ) const { - return frequency > doc.frequency; - } - bool operator<=( const Document &doc ) const { - return frequency >= doc.frequency; - } - bool operator>( const Document &doc ) const { - return frequency < doc.frequency; - } - TQ_INT16 docNumber; - TQ_INT16 frequency; -}; - -TQDataStream &operator>>( TQDataStream &s, Document &l ); -TQDataStream &operator<<( TQDataStream &s, const Document &l ); - -class Index : public TQObject -{ - Q_OBJECT - TQ_OBJECT -public: - struct Entry { - Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( TQValueList l ) : documents( l ) {} - TQValueList documents; - }; - struct PosEntry { - PosEntry( int p ) { positions.append( p ); } - TQValueList positions; - }; - - Index( const TQString &dp, const TQString &hp ); - Index( const TQStringList &dl, const TQString &hp ); - void writeDict(); - void readDict(); - int makeIndex(); - TQStringList query( const TQStringList&, const TQStringList&, const TQStringList& ); - TQString getDocumentTitle( const TQString& ); - void setDictionaryFile( const TQString& ); - void setDocListFile( const TQString& ); - void setDocList( const TQStringList & ); - -Q_SIGNALS: - void indexingProgress( int ); - -private Q_SLOTS: - void setLastWinClosed(); - -private: - void setupDocumentList(); - void parseDocument( const TQString&, int ); - void insertInDict( const TQString&, int ); - void writeDocumentList(); - void readDocumentList(); - TQStringList getWildcardTerms( const TQString& ); - TQStringList split( const TQString& ); - TQValueList setupDummyTerm( const TQStringList& ); - bool searchForPattern( const TQStringList&, const TQStringList&, const TQString& ); - void buildMiniDict( const TQString& ); - TQStringList docList; - TQDict dict; - TQDict miniDict; - uint wordNum; - TQString docPath; - TQString dictFile, docListFile; - bool alreadyHaveDocList; - bool lastWindowClosed; -}; - -struct Term { - Term( const TQString &t, int f, TQValueList l ) - : term( t ), frequency( f ), documents( l ) {} - TQString term; - int frequency; - TQValueListdocuments; -}; - -class TermList : public TQPtrList -{ -public: - TermList() : TQPtrList() {} - int compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 ); -}; - -#endif diff --git a/tqtinterface/qt4/tools/assistant/lib/lib.pro b/tqtinterface/qt4/tools/assistant/lib/lib.pro deleted file mode 100644 index 75ad1d3..0000000 --- a/tqtinterface/qt4/tools/assistant/lib/lib.pro +++ /dev/null @@ -1,23 +0,0 @@ -TEMPLATE = lib -TARGET = tqassistantclient -VERSION = 1.0 - -CONFIG += qt warn_on release -CONFIG += staticlib -CONFIG -= dll - -SOURCES = tqassistantclient.cpp -HEADERS += $$QT_SOURCE_TREE/include/tqassistantclient.h - - -DEFINES += QT_INTERNAL_NETWORK -include( ../../../src/qt_professional.pri ) - -DESTDIR = ../../../lib - -unix { - target.path=$$libs.path - TQMAKE_CFLAGS += $$TQMAKE_CFLAGS_SHLIB - TQMAKE_CXXFLAGS += $$TQMAKE_CXXFLAGS_SHLIB - INSTALLS += target -} diff --git a/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp b/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp deleted file mode 100644 index b642bc3..0000000 --- a/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp +++ /dev/null @@ -1,334 +0,0 @@ -/********************************************************************** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQAssistantClient library. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "tqassistantclient.h" - -#include -#include -#include -#include -#include - -class TQAssistantClientPrivate -{ - friend class TQAssistantClient; - TQStringList arguments; -}; - -static TQMap *dpointers = 0; - -static TQAssistantClientPrivate *data( const TQAssistantClient *client, bool create=FALSE ) -{ - if( !dpointers ) - dpointers = new TQMap; - TQAssistantClientPrivate *d = (*dpointers)[client]; - if( !d && create ) { - d = new TQAssistantClientPrivate; - dpointers->insert( client, d ); - } - return d; -} - -/*! - \class TQAssistantClient - \brief The TQAssistantClient class provides a means of using TQt - Assistant as an application's help tool. - - Using TQt Assistant is simple: Create a TQAssistantClient instance, - then call showPage() as often as necessary to show your help - pages. When you call showPage(), TQt Assistant will be launched if - it isn't already running. - - The TQAssistantClient instance can open (openAssistant()) or close - (closeAssistant()) TQt Assistant whenever required. If TQt Assistant - is open, isOpen() returns TRUE. - - One TQAssistantClient instance interacts with one TQt Assistant - instance, so every time you call openAssistant(), showPage() or - closeAssistant() they are applied to the particular TQt Assistant - instance associated with the TQAssistantClient. - - When you call openAssistant() the assistantOpened() signal is - emitted. Similarly when closeAssistant() is called, - assistantClosed() is emitted. In either case, if an error occurs, - error() is emitted. - - This class is not included in the TQt library itself. To use it you - must link against \c libqassistantclient.a (Unix) or \c - qassistantclient.lib (Windows), which is built into \c INSTALL/lib - if you built the TQt tools (\c INSTALL is the directory where TQt is - installed). If you use qmake, then you can simply add the following - line to your pro file: - - \code - LIBS += -lqassistantclient - \endcode - - See also "Adding Documentation to TQt Assistant" in the \link - assistant.book TQt Assistant manual\endlink. -*/ - -/*! - \fn void TQAssistantClient::assistantOpened() - - This signal is emitted when TQt Assistant is open and the - client-server communication is set up. -*/ - -/*! - \fn void TQAssistantClient::assistantClosed() - - This signal is emitted when the connection to TQt Assistant is - closed. This happens when the user exits TQt Assistant, or when an - error in the server or client occurs, or if closeAssistant() is - called. -*/ - -/*! - \fn void TQAssistantClient::error( const TQString &msg ) - - This signal is emitted if TQt Assistant cannot be started or if an - error occurs during the initialization of the connection between - TQt Assistant and the calling application. The \a msg provides an - explanation of the error. -*/ - -/*! - Constructs an assistant client object. The \a path specifies the - path to the TQt Assistant executable. If \a path is an empty - string the system path (\c{%PATH%} or \c $PATH) is used. - - The assistant client object is a child of \a parent and is called - \a name. -*/ -TQAssistantClient::TQAssistantClient( const TQString &path, TQObject *parent, const char *name ) - : TQObject( parent, name ), host ( "localhost" ) -{ - if ( path.isEmpty() ) - assistantCommand = "assistant"; - else { - TQFileInfo fi( path ); - if ( fi.isDir() ) - assistantCommand = path + "/assistant"; - else - assistantCommand = path; - } - -#if defined(TQ_OS_MACX) - assistantCommand += ".app/Contents/MacOS/assistant"; -#elif defined(TQ_WS_WIN) - if (!assistantCommand.endsWith(".exe")) - assistantCommand += ".exe"; -#endif - socket = new TQSocket( this ); - connect( socket, TQT_SIGNAL( connected() ), - TQT_SLOT( socketConnected() ) ); - connect( socket, TQT_SIGNAL( connectionClosed() ), - TQT_SLOT( socketConnectionClosed() ) ); - connect( socket, TQT_SIGNAL( error( int ) ), - TQT_SLOT( socketError( int ) ) ); - opened = FALSE; - proc = new TQProcess( this ); - port = 0; - pageBuffer = ""; - connect( proc, TQT_SIGNAL( readyReadStderr() ), - this, TQT_SLOT( readStdError() ) ); -} - -/*! - Destroys the assistant client object and frees up all allocated - resources. -*/ -TQAssistantClient::~TQAssistantClient() -{ - if ( proc && proc->isRunning() ) { - proc->tryTerminate(); - proc->kill(); - } - - if( dpointers ) { - TQAssistantClientPrivate *d = (*dpointers)[ this ]; - if( d ) { - dpointers->remove( this ); - delete d; - if( dpointers->isEmpty() ) { - delete dpointers; - dpointers = 0; - } - } - } -} - -/*! - This function opens TQt Assistant and sets up the client-server - communiction between the application and TQt Assistant. If it is - already open, this function does nothing. If an error occurs, - error() is emitted. - - \sa assistantOpened() -*/ -void TQAssistantClient::openAssistant() -{ - if ( proc->isRunning() ) - return; - proc->clearArguments(); - proc->addArgument( assistantCommand ); - proc->addArgument( "-server" ); - if( !pageBuffer.isEmpty() ) { - proc->addArgument( "-file" ); - proc->addArgument( pageBuffer ); - } - - TQAssistantClientPrivate *d = data( this ); - if( d ) { - TQStringList::ConstIterator it = d->arguments.begin(); - while( it!=d->arguments.end() ) { - proc->addArgument( *it ); - ++it; - } - } - - if ( !proc->launch( TQString() ) ) { - emit error( tr( "Cannot start TQt Assistant '%1'" ) - .arg( proc->arguments().join( " " ) ) ); - return; - } - connect( proc, TQT_SIGNAL( readyReadStdout() ), - this, TQT_SLOT( readPort() ) ); -} - -void TQAssistantClient::readPort() -{ - TQString p = proc->readLineStdout(); - TQ_UINT16 port = p.toUShort(); - if ( port == 0 ) { - emit error( tr( "Cannot connect to TQt Assistant." ) ); - return; - } - socket->connectToHost( host, port ); - disconnect( proc, TQT_SIGNAL( readyReadStdout() ), - this, TQT_SLOT( readPort() ) ); -} - -/*! - Use this function to close TQt Assistant. - - \sa assistantClosed() -*/ -void TQAssistantClient::closeAssistant() -{ - if ( !opened ) - return; - proc->tryTerminate(); - proc->kill(); -} - -/*! - Call this function to make TQt Assistant show a particular \a page. - The \a page is a filename (e.g. \c myhelpfile.html). See "Adding - Documentation to TQt Assistant" in the \link assistant.book TQt - Assistant manual\endlink for further information. - - If TQt Assistant hasn't been \link openAssistant() opened\endlink - yet, this function will do nothing. You can use isOpen() to - determine whether TQt Assistant is up and running, or you can - connect to the asssistantOpened() signal. - - \sa isOpen(), assistantOpened() -*/ -void TQAssistantClient::showPage( const TQString &page ) -{ - if ( !opened ) { - pageBuffer = page; - openAssistant(); - pageBuffer = TQString(); - return; - } - TQTextStream os( socket ); - os << page << "\n"; -} - -/*! - \property TQAssistantClient::open - \brief Whether TQt Assistant is open. - -*/ -bool TQAssistantClient::isOpen() const -{ - return opened; -} - -void TQAssistantClient::socketConnected() -{ - opened = TRUE; - if ( !pageBuffer.isEmpty() ) - showPage( pageBuffer ); - emit assistantOpened(); -} - -void TQAssistantClient::socketConnectionClosed() -{ - opened = FALSE; - emit assistantClosed(); -} - -void TQAssistantClient::socketError( int i ) -{ - if ( i == TQSocket::ErrConnectionRefused ) - emit error( tr( "Could not connect to Assistant: Connection refused" ) ); - else if ( i == TQSocket::ErrHostNotFound ) - emit error( tr( "Could not connect to Assistant: Host not found" ) ); - else - emit error( tr( "Communication error" ) ); -} - -void TQAssistantClient::readStdError() -{ - TQString errmsg; - while ( proc->canReadLineStderr() ) { - errmsg += proc->readLineStderr(); - errmsg += "\n"; - } - if (!errmsg.isEmpty()) - emit error( tr( errmsg.simplifyWhiteSpace() ) ); -} - -/*! - Sets the command line arguments used when TQt Assistant is - started to \a args. -*/ -void TQAssistantClient::setArguments( const TQStringList &args ) -{ - TQAssistantClientPrivate *d = data( this, TRUE ); - d->arguments = args; -} diff --git a/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h b/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h deleted file mode 100644 index faf3351..0000000 --- a/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h +++ /dev/null @@ -1,81 +0,0 @@ -/********************************************************************** -** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQAssistantClient library. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQASSISTANTCLIENT_H -#define TQASSISTANTCLIENT_H - -#include - -class TQSocket; -class TQProcess; - -class TQAssistantClient : public TQObject -{ - Q_OBJECT - TQ_OBJECT - Q_PROPERTY( bool open READ isOpen ) - -public: - TQAssistantClient( const TQString &path, TQObject *parent = 0, const char *name = 0 ); - ~TQAssistantClient(); - - bool isOpen() const; - - void setArguments( const TQStringList &args ); - -public Q_SLOTS: - virtual void openAssistant(); - virtual void closeAssistant(); - virtual void showPage( const TQString &page ); - -Q_SIGNALS: - void assistantOpened(); - void assistantClosed(); - void error( const TQString &msg ); - -private Q_SLOTS: - void socketConnected(); - void socketConnectionClosed(); - void readPort(); - void socketError( int ); - void readStdError(); - -private: - TQSocket *socket; - TQProcess *proc; - TQ_UINT16 port; - TQString host, assistantCommand, pageBuffer; - bool opened; -}; - -#endif diff --git a/tqtinterface/qt4/tools/assistant/main.cpp b/tqtinterface/qt4/tools/assistant/main.cpp deleted file mode 100644 index 2c861c8..0000000 --- a/tqtinterface/qt4/tools/assistant/main.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "mainwindow.h" -#include "helpdialogimpl.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef TQ_WS_WIN -#define INDEX_CHECK( text ) if( i+1 >= argc ) { TQMessageBox::information( 0, "TQt Assistant", text ); return 1; } -#else -#define INDEX_CHECK( text ) if( i+1 >= argc ) { fprintf( stderr, text "\n" ); return 1; } -#endif - -static bool allowFirstRun = TRUE; - -class AssistantSocket : public TQSocket -{ - Q_OBJECT - TQ_OBJECT -public: - AssistantSocket( int sock, TQObject *parent = 0 ); - ~AssistantSocket() {} - -Q_SIGNALS: - void showLinkRequest( const TQString& ); - -private Q_SLOTS: - void readClient(); - void connectionClosed(); -}; - - -class AssistantServer : public TQServerSocket -{ - Q_OBJECT - TQ_OBJECT -public: - AssistantServer( TQObject* parent = 0 ); - void newConnection( int socket ); - TQ_UINT16 getPort() const; - -Q_SIGNALS: - void showLinkRequest( const TQString& ); - void newConnect(); - -private: - TQ_UINT16 p; -}; - - -AssistantSocket::AssistantSocket( int sock, TQObject *parent ) - : TQSocket( parent, 0 ) -{ - connect( this, TQT_SIGNAL( readyRead() ), - TQT_SLOT( readClient() ) ); - connect( this, TQT_SIGNAL( connectionClosed() ), - TQT_SLOT( connectionClosed() ) ); - setSocket( sock ); -} - -void AssistantSocket::readClient() -{ - TQString link = TQString(); - while ( canReadLine() ) - link = readLine(); - if ( !link.isNull() ) { - link = link.replace( "\n", "" ); - link = link.replace( "\r", "" ); - emit showLinkRequest( link ); - } -} - -void AssistantSocket::connectionClosed() -{ - delete this; -} - -AssistantServer::AssistantServer( TQObject *parent ) - : TQServerSocket( 0x7f000001, 0, 1, parent ) -{ - if ( !ok() ) { - TQMessageBox::critical( 0, tr( "TQt Assistant" ), - tr( "Failed to bind to port %1" ).arg( port() ) ); - exit( 1 ); - } - p = port(); -} - -TQ_UINT16 AssistantServer::getPort() const -{ - return p; -} - -void AssistantServer::newConnection( int socket ) -{ - AssistantSocket *as = new AssistantSocket( socket, this ); - connect( as, TQT_SIGNAL( showLinkRequest( const TQString& ) ), - this, TQT_SIGNAL( showLinkRequest( const TQString& ) ) ); - emit newConnect(); -} - -int main( int argc, char ** argv ) -{ - bool withGUI = TRUE; - if ( argc > 1 ) { - TQString arg( argv[1] ); - arg = arg.lower(); - if ( arg == "-addcontentfile" - || arg == "-removecontentfile" -#ifndef TQ_WS_WIN - || arg == "-help" -#endif - ) - withGUI = FALSE; - } - TQApplication a(argc, argv, withGUI); - - TQString resourceDir; - AssistantServer *as = 0; - TQStringList catlist; - TQString file, profileName, aDocPath; - bool server = FALSE; - bool hideSidebar = FALSE; - bool startClean = FALSE; - bool configLoaded = FALSE; - if ( argc == 2 ) { - if ( (argv[1])[0] != '-' ) - file = argv[1]; - } - if ( file.isEmpty() ) { - for ( int i = 1; i < argc; i++ ) { - if ( TQString( argv[i] ).lower() == "-file" ) { - INDEX_CHECK( "Missing file argument!" ); - i++; - file = argv[i]; - } else if ( TQString( argv[i] ).lower() == "-server" ) { - server = TRUE; - } else if ( TQString( argv[i] ).lower() == "-profile" ) { - INDEX_CHECK( "Missing profile argument!" ); - profileName = argv[++i]; - } else if ( TQString( argv[i] ).lower() == "-addcontentfile" ) { - INDEX_CHECK( "Missing content file!" ); - Config *c = Config::loadConfig( TQString() ); - TQFileInfo file( argv[i+1] ); - if( !file.exists() ) { - fprintf( stderr, "Could not locate content file: '%s'\n", - file.absFilePath().latin1() ); - fflush( stderr ); - return 1; - } - DocuParser *parser = DocuParser::createParser( file.absFilePath() ); - if( parser ) { - TQFile f( argv[i+1] ); - if( !parser->parse( &f ) ) { - fprintf( stderr, "Failed to parse file: '%s'\n, ", - file.absFilePath().latin1() ); - fflush( stderr ); - return 1; - } - parser->addTo( c->profile() ); - c->setDocRebuild( TRUE ); - c->save(); - } - return 0; - } else if ( TQString( argv[i] ).lower() == "-removecontentfile" ) { - INDEX_CHECK( "Missing content file!" ); - Config *c = Config::loadConfig( TQString() ); - Profile *profile = c->profile(); - TQStringList entries = profile->docs.grep(argv[i+1]); - if (entries.count() == 0) { - fprintf(stderr, "Could not locate content file: '%s'\n", - argv[i+1]); - fflush(stderr); - return 1; - } else if (entries.count() > 1) { - fprintf(stderr, "More than one entry matching file name found, " - "please specify full path to file"); - fflush(stderr); - return 1; - } else { - TQFileInfo file(entries[0]); - if( !file.exists() ) { - fprintf( stderr, "Could not locate content file: '%s'\n", - file.absFilePath().latin1() ); - fflush( stderr ); - return 1; - } - profile->removeDocFileEntry( file.absFilePath() ); - c->setDocRebuild( TRUE ); - c->save(); - } - return 0; - } else if ( TQString( argv[i] ).lower() == "-docpath" ) { - INDEX_CHECK( "Missing path!" ); - TQDir dir( argv[i+1] ); - if ( dir.exists() ) { - Config *c = Config::loadConfig( TQString() ); - c->saveProfile(Profile::createDefaultProfile(dir.absPath())); - c->loadDefaultProfile(); - c->setDocRebuild( TRUE ); - c->save(); - configLoaded = TRUE; - ++i; - } else { - fprintf( stderr, "The specified path does not exist!\n"); - fflush( stderr ); - return 1; - } - } else if ( TQString( argv[i] ).lower() == "-hidesidebar" ) { - hideSidebar = TRUE; - } else if ( TQString( argv[i] ).lower() == "-help" ) { - TQString helpText( "Usage: assistant [option]\n" - "Options:\n" - " -file Filename assistant opens the specified file\n" - " -server reads commands from a socket after\n" - " assistant has started\n" - " -profile fileName starts assistant and displays the\n" - " profile specified in the file fileName.\n" - " -addContentFile file adds the content file 'file' to the set of\n" - " documentation available by default\n" - " -removeContentFile file removes the content file 'file' from the\n" - " documentation available by default\n" - " -docPath path sets the TQt documentation root path to\n" - " 'path' and starts assistant\n" - " -hideSidebar assistant will hide the sidebar.\n" - " -resourceDir assistant will load translations from\n" - " this directory.\n" - " -help shows this help."); -#ifdef TQ_WS_WIN - TQMessageBox::information( 0, "TQt Assistant", "
" + helpText + "
" ); -#else - printf( "%s\n", helpText.latin1() ); -#endif - exit( 0 ); - } else if ( TQString( argv[i] ).lower() == "-resourcedir" ) { - INDEX_CHECK( "Missing resource directory argument!" ); - resourceDir = TQString( argv[++i] ); - } else { - fprintf( stderr, "Unrecognized option '%s'. Try -help to get help.\n", - argv[i] ); - fflush( stderr ); - return 1; - } - } - } - - if( resourceDir.isNull() ) - resourceDir = qInstallPathTranslations(); - - TQTranslator translator( 0 ); - translator.load( TQString("assistant_") + TQTextCodec::locale(), resourceDir ); - a.installTranslator( &translator ); - - TQTranslator qtTranslator( 0 ); - qtTranslator.load( TQString("qt_") + TQTextCodec::locale(), resourceDir ); - a.installTranslator( &qtTranslator ); - - - Config *conf = 0; - if (configLoaded) - conf = Config::configuration(); - else - conf = Config::loadConfig( profileName ); - if (!conf) { - fprintf( stderr, "Profile '%s' does not exist!\n", profileName.latin1() ); - fflush( stderr ); - return -1; - } - - bool max = conf->isMaximized(); - TQStringList links = conf->source(); - conf->hideSideBar( hideSidebar ); - - TQGuardedPtr mw = new MainWindow( 0, "Assistant" ); - - if ( server ) { - as = new AssistantServer(); - printf("%d\n", as->port() ); - fflush( stdout ); - as->connect( as, TQT_SIGNAL( showLinkRequest( const TQString& ) ), - mw, TQT_SLOT( showLinkFromClient( const TQString& ) ) ); - } - - if ( max ) - mw->showMaximized(); - else - mw->show(); - - if ( !file.isEmpty() ) - mw->showLink( file ); - else if ( file.isEmpty() ) - mw->showLinks( links ); - - a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) ); - - int appExec = a.exec(); - delete (MainWindow*)mw; - return appExec; -} - -#include "main.tqmoc" diff --git a/tqtinterface/qt4/tools/assistant/mainwindow.ui b/tqtinterface/qt4/tools/assistant/mainwindow.ui deleted file mode 100644 index 3074838..0000000 --- a/tqtinterface/qt4/tools/assistant/mainwindow.ui +++ /dev/null @@ -1,670 +0,0 @@ - -MainWindow -********************************************************************* -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of Qt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -********************************************************************* - - - MainWindow - - - - 0 - 0 - 949 - 670 - - - - Qt Assistant by Trolltech - - - - - menubar - - - - 0 - 0 - 949 - 29 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Toolbar - - - Toolbar - - - - - - - - - - - - - - - - - goActionToolbar - - - Go - - - - - - - actionFilePrint - - - print.png - - - Print - - - &Print... - - - Print the currently displayed page. - - - Ctrl+P - - - - - actionFileExit - - - Exit - - - E&xit - - - Quit Qt Assistant. - - - Ctrl+Q - - - - - actionEditCopy - - - editcopy.png - - - Copy - - - &Copy - - - Copy the selected text to the clipboard. - - - Ctrl+C - - - - - actionEditFind - - - find.png - - - Find in Text - - - &Find in Text... - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - - - Ctrl+F - - - - - actionEditFindAgain - - - Find &Next - - - Find Next - - - F3 - - - - - actionEditFindAgainPrev - - - Find &Previous - - - Find Previous - - - Shift+F3 - - - - - actionGoHome - - - home.png - - - Home - - - &Home - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - - - Ctrl+Home - - - - - actionGoPrevious - - - previous.png - - - Previous - - - &Previous - - - Go to the previous page. - - - Alt+Left - - - - - actionGoNext - - - next.png - - - Next - - - &Next - - - Go to the next page. - - - Alt+Right - - - - - helpAbout_Qt_AssistantAction - - - About Qt Assistant - - - About Qt Assistant - - - Display further information about Qt Assistant. - - - - - actionAboutApplication - - - - - actionZoomIn - - - zoomin.png - - - Zoom in - - - Zoom &in - - - Zoom in on the document, i.e. increase the font size. - - - Ctrl++ - - - - - actionZoomOut - - - zoomout.png - - - Zoom out - - - Zoom &out - - - Zoom out on the document, i.e. decrease the font size. - - - Ctrl+- - - - - - actionSettings - - - Settings - - - &Settings... - - - Open the settings dialog. - - - - - actionNewWindow - - - New Window - - - New Window - - - Open a new window. - - - Ctrl+N - - - - - actionClose - - - Close - - - &Close - - - Close the current window. - - - - - actionAddBookmark - - - Add Bookmark - - - &Add Bookmark - - - Add the currently displayed page as a new bookmark. - - - - - actionHelpWhatsThis - - - whatsthis.xpm - - - What's This? - - - "What's This?" context sensitive help. - - - "What's This?" context sensitive help. - - - Shift+F1 - - - - - actionOpenPage - - - Add Tab - - - Ctrl+Alt+N - - - - - actionNextPage - - - Next Tab - - - Ctrl+Alt+Right - - - - - actionPrevPage - - - Previous Tab - - - Ctrl+Alt+Left - - - - - actionClosePage - - - Close Tab - - - Ctrl+Alt+Q - - - - - actionHelpAssistant - - - assistant.png - - - Qt Assistant Manual - - - F1 - - - - - - actionGoHome - activated() - MainWindow - goHome() - - - helpAbout_Qt_AssistantAction - activated() - MainWindow - about() - - - actionEditFind - activated() - MainWindow - find() - - - actionEditFindAgain - activated() - MainWindow - findAgain() - - - actionEditFindAgainPrev - activated() - MainWindow - findAgainPrev() - - - actionFilePrint - activated() - MainWindow - print() - - - actionSettings - activated() - MainWindow - showSettingsDialog() - - - actionNewWindow - activated() - MainWindow - newWindow() - - - actionClose - activated() - MainWindow - close() - - - actionHelpWhatsThis - activated() - MainWindow - whatsThis() - - - actionHelpAssistant - activated() - MainWindow - showAssistantHelp() - - - actionAboutApplication - activated() - MainWindow - aboutApplication() - - - - tqtoolbutton.h - settingsdialogimpl.h - tqmessagebox.h - tqfontdatabase.h - tqaccel.h - tqcombobox.h - tqpaintdevicemetrics.h - tqsimplerichtext.h - tqfileinfo.h - tqtextstream.h - tqdockwindow.h - stdlib.h - tqmime.h - helpwindow.h - tqstylesheet.h - tqapplication.h - helpdialogimpl.h - tqdir.h - tqprinter.h - tqpainter.h - tqurl.h - tqstatusbar.h - tqlineedit.h - tqsettings.h - tqcheckbox.h - tabbedbrowser.h - tqptrlist.h - tqguardedptr.h - tqmap.h - finddialog.h - tqstringlist.h - helpwindow.h - mainwindow.ui.h - - - class SettingsDialog; - class HelpDialog; - class TabbedBrowser; - class TQTimerEvent; - - - TQPtrList<TQAction> *goActions; - int setupCompleted:1; - TabbedBrowser *tabs; - SettingsDialog * settingsDia; - TQMap<int, TQString> bookmarks; - HelpDialog *helpDock; - TQDockWindow *dw; - TQGuardedPtr<FindDialog> findDialog; - static TQPtrList<MainWindow> *windows; - TQMap<TQAction*,TQString> *goActionDocFiles; - TQStringList pendingLinks; - TQPtrList<HelpWindow> pendingBrowsers - - - init() - setup() - destroy() - about() - aboutApplication() - find() - findAgain() - findAgainPrev() - goHome() - print() - updateBookmarkMenu() - setupBookmarkMenu() - showBookmark( int id ) - showLinkFromClient( const TQString & link ) - showLink( const TQString & link ) - showLinks( const TQStringList & links ) - showQtHelp() - showSettingsDialog() - showWebBrowserSettings() - showSettingsDialog( int page ) - hide() - newWindow() - saveSettings() - saveToolbarSettings() - showSearchLink( const TQString & link, const TQStringList & terms ) - showGoActionLink() - showAssistantHelp() - updateProfileSettings() - backwardAvailable(bool) - forwardAvailable(bool) - browserTabChanged() - - - setupGoActions() - insertActionSeparator() - close( bool alsoDelete ) - browsers() - helpDialog() - timerEvent(TQTimerEvent *) - - - - diff --git a/tqtinterface/qt4/tools/assistant/mainwindow.ui.h b/tqtinterface/qt4/tools/assistant/mainwindow.ui.h deleted file mode 100644 index 68fcb95..0000000 --- a/tqtinterface/qt4/tools/assistant/mainwindow.ui.h +++ /dev/null @@ -1,697 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -TQPtrList *MainWindow::windows = 0; - -#if defined(TQ_WS_WIN) -extern TQ_EXPORT int qt_ntfs_permission_lookup; -#endif - -void MainWindow::init() -{ -#if defined(TQ_WS_WIN) - // Workaround for TQMimeSourceFactory failing in TQFileInfo::isReadable() for - // certain user configs. See task: 34372 - qt_ntfs_permission_lookup = 0; -#endif - setupCompleted = FALSE; - - goActions = new TQPtrList; - goActionDocFiles = new TQMap; - goActions->setAutoDelete( TRUE ); - - if ( !windows ) - windows = new TQPtrList; - windows->append( this ); - tabs = new TabbedBrowser( this, "qt_assistant_tabbedbrowser" ); - setCentralWidget( tabs ); - settingsDia = 0; - - Config *config = Config::configuration(); - - updateProfileSettings(); - - dw = new TQDockWindow( TQDockWindow::InDock, this ); - helpDock = new HelpDialog( dw, this ); - dw->setResizeEnabled( TRUE ); - dw->setCloseMode( TQDockWindow::Always ); - addDockWindow( dw, TQt::DockLeft ); - dw->setWidget( helpDock ); - dw->setCaption( "Sidebar" ); - dw->setFixedExtentWidth( 320 ); - - // read tqgeometry configuration - setupGoActions(); - - if ( !config->isMaximized() ) { - TQRect geom = config->tqgeometry(); - if( geom.isValid() ) { - resize(geom.size()); - move(geom.topLeft()); - } - } - - TQString mainWindowLayout = config->mainWindowLayout(); - - TQTextStream ts( &mainWindowLayout, IO_ReadOnly ); - ts >> *this; - - if ( config->sideBarHidden() ) - dw->hide(); - - tabs->setup(); - TQTimer::singleShot( 0, this, TQT_SLOT( setup() ) ); -#if defined(TQ_OS_MACX) - // Use the same forward and backward browser shortcuts as Safari and Internet Explorer do - // on the Mac. This means that if you have access to one of those cool Intellimice, the thing - // works just fine, since that's how Microsoft hacked it. - actionGoPrevious->setAccel(TQKeySequence(TQt::CTRL|TQt::Key_Left)); - actionGoNext->setAccel(TQKeySequence(TQt::CTRL|TQt::Key_Right)); -#endif -} - -void MainWindow::setup() -{ - if( setupCompleted ) - return; - - tqApp->setOverrideCursor( TQCursor( TQt::WaitCursor ) ); - statusBar()->message( tr( "Initializing TQt Assistant..." ) ); - setupCompleted = TRUE; - helpDock->initialize(); - connect( actionGoPrevious, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( backward() ) ); - connect( actionGoNext, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( forward() ) ); - connect( actionEditCopy, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( copy() ) ); - connect( actionFileExit, TQT_SIGNAL( activated() ), tqApp, TQT_SLOT( closeAllWindows() ) ); - connect( actionAddBookmark, TQT_SIGNAL( activated() ), - helpDock, TQT_SLOT( addBookmark() ) ); - connect( helpDock, TQT_SIGNAL( showLink( const TQString& ) ), - this, TQT_SLOT( showLink( const TQString& ) ) ); - connect( helpDock, TQT_SIGNAL( showSearchLink( const TQString&, const TQStringList& ) ), - this, TQT_SLOT( showSearchLink( const TQString&, const TQStringList&) ) ); - - connect( bookmarkMenu, TQT_SIGNAL( activated( int ) ), - this, TQT_SLOT( showBookmark( int ) ) ); - connect( actionZoomIn, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( zoomIn() ) ); - connect( actionZoomOut, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( zoomOut() ) ); - - connect( actionOpenPage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( newTab() ) ); - connect( actionClosePage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( closeTab() ) ); - connect( actionNextPage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( nextTab() ) ); - connect( actionPrevPage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( previousTab() ) ); - - - -#if defined(TQ_OS_WIN32) || defined(TQ_OS_WIN64) - TQAccel *acc = new TQAccel( this ); -// acc->connectItem( acc->insertItem( Key_F5 ), browser, TQT_SLOT( reload() ) ); - acc->connectItem( acc->insertItem( TQKeySequence("SHIFT+CTRL+=") ), actionZoomIn, TQT_SIGNAL(activated()) ); -#endif - - TQAccel *a = new TQAccel( this, dw ); - a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+T") ) ), - helpDock, TQT_SLOT( toggleContents() ) ); - a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+I") ) ), - helpDock, TQT_SLOT( toggleIndex() ) ); - a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+B") ) ), - helpDock, TQT_SLOT( toggleBookmarks() ) ); - a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+S") ) ), - helpDock, TQT_SLOT( toggleSearch() ) ); - - Config *config = Config::configuration(); - - setupBookmarkMenu(); - PopupMenu->insertItem( tqtr( "Vie&ws" ), createDockWindowMenu() ); - helpDock->tabWidget->setCurrentPage( config->sideBarPage() ); - - tqApp->restoreOverrideCursor(); - actionGoPrevious->setEnabled( FALSE ); - actionGoNext->setEnabled( FALSE ); -} - -void MainWindow::setupGoActions() -{ - Config *config = Config::configuration(); - TQStringList titles = config->docTitles(); - TQAction *action = 0; - - static bool separatorInserted = FALSE; - - TQAction *cur = goActions->first(); - while( cur ) { - cur->removeFrom( goMenu ); - cur->removeFrom( goActionToolbar ); - cur = goActions->next(); - } - goActions->clear(); - goActionDocFiles->clear(); - - int addCount = 0; - - TQStringList::ConstIterator it = titles.begin(); - for ( ; it != titles.end(); ++it ) { - TQString title = *it; - TQPixmap pix = config->docIcon( title ); - if( !pix.isNull() ) { - if( !separatorInserted ) { - goMenu->insertSeparator(); - separatorInserted = TRUE; - } - action = new TQAction( title, TQIconSet( pix ), title, 0, 0 ); - action->addTo( goMenu ); - action->addTo( goActionToolbar ); - goActions->append( action ); - goActionDocFiles->insert( action, config->indexPage( title ) ); - connect( action, TQT_SIGNAL( activated() ), - this, TQT_SLOT( showGoActionLink() ) ); - ++addCount; - } - } - if( !addCount ) - goActionToolbar->hide(); - else - goActionToolbar->show(); - -} - -void MainWindow::browserTabChanged() -{ - if (tabs->currentBrowser()) { - actionGoPrevious->setEnabled(tabs->currentBrowser()->isBackwardAvailable()); - actionGoNext->setEnabled(tabs->currentBrowser()->isForwardAvailable()); - } -} - -bool MainWindow::insertActionSeparator() -{ - goMenu->insertSeparator(); - Toolbar->addSeparator(); - return TRUE; -} - -bool MainWindow::close( bool alsoDelete ) -{ - saveSettings(); - return TQMainWindow::close( alsoDelete ); -} - -void MainWindow::destroy() -{ - windows->removeRef( this ); - if ( windows->isEmpty() ) { - delete windows; - windows = 0; - } - delete goActions; - delete goActionDocFiles; -} - -void MainWindow::about() -{ - TQMessageBox box( this ); - box.setText( "
" - "

Version " + TQString(TQT_VERSION_STR) + "

" - "

Copyright (C) 2000-2008 Trolltech ASA. All rights reserved." - "

" - "

TQt Commercial Edition license holders: This program is" - " licensed to you under the terms of the TQt Commercial License" - " Agreement. For details, see the file LICENSE that came with" - " this software distribution.

" - "

TQt Open Source Edition users: This program is licensed to you" - " under the terms of the GNU General Public License Version 2." - " For details, see the file LICENSE.GPL that came with this" - " software distribution.

The program is provided AS IS" - " with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF" - " DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE." - "

" ); - box.setCaption( tr( "TQt Assistant" ) ); - box.setIcon( TQMessageBox::NoIcon ); - box.exec(); -} - -void MainWindow::aboutApplication() -{ - TQString url = Config::configuration()->aboutURL(); - if ( url == "about_qt" ) { - TQMessageBox::aboutTQt( this, "TQt Assistant" ); - return; - } - TQString text; - TQFile file( url ); - if( file.exists() && file.open( IO_ReadOnly ) ) - text = TQString( file.readAll() ); - if( text.isNull() ) - text = tr( "Failed to open about application contents in file: '%1'" ).arg( url ); - - TQMessageBox box( this ); - box.setText( text ); - box.setCaption( Config::configuration()->aboutApplicationMenuText() ); - box.setIcon( TQMessageBox::NoIcon ); - box.exec(); -} - -void MainWindow::find() -{ - if ( !findDialog ) - findDialog = new FindDialog( this ); - findDialog->comboFind->setFocus(); - findDialog->comboFind->lineEdit()->setSelection( - 0, findDialog->comboFind->lineEdit()->text().length() ); - findDialog->show(); -} - -void MainWindow::findAgain() -{ - if (!findDialog || !findDialog->hasFindExpression()) { - find(); - return; - } - findDialog->doFind(TRUE); -} - -void MainWindow::findAgainPrev() -{ - if (!findDialog || !findDialog->hasFindExpression()) { - find(); - return; - } - findDialog->doFind(FALSE); -} - -void MainWindow::goHome() -{ - showLink( Config::configuration()->homePage() ); -} - -void MainWindow::print() -{ - TQPrinter printer( TQPrinter::HighResolution ); - printer.setFullPage( TRUE ); - if ( printer.setup( this ) ) { - TQPainter p; - if ( !p.begin( &printer ) ) - return; - - tqApp->setOverrideCursor( TQCursor( TQt::WaitCursor ) ); - tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - - TQPaintDeviceMetrics metrics(p.tqdevice()); - TQTextBrowser *browser = tabs->currentBrowser(); - int dpiy = metrics.logicalDpiY(); - int margin = (int) ( (2/2.54)*dpiy ); - TQRect view( margin, - margin, - metrics.width() - 2 * margin, - metrics.height() - 2 * margin ); - TQSimpleRichText richText( browser->text(), browser->TQWidget::font(), browser->context(), - browser->styleSheet(), browser->mimeSourceFactory(), - view.height(), TQt::black, FALSE ); - richText.setWidth( &p, view.width() ); - int page = 1; - do { - tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - - richText.draw( &p, margin, margin, view, tqpalette().active() ); - view.moveBy( 0, view.height() ); - p.translate( 0 , -view.height() ); - p.drawText( view.right() - p.fontMetrics().width( TQString::number(page) ), - view.bottom() + p.fontMetrics().ascent() + 5, TQString::number(page) ); - if ( view.top() - margin >= richText.height() ) - break; - printer.newPage(); - page++; - } while (TRUE); - - tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput ); - tqApp->restoreOverrideCursor(); - } -} - -void MainWindow::updateBookmarkMenu() -{ - for ( MainWindow *mw = windows->first(); mw; mw = windows->next() ) - mw->setupBookmarkMenu(); -} - -void MainWindow::setupBookmarkMenu() -{ - bookmarkMenu->clear(); - bookmarks.clear(); - actionAddBookmark->addTo( bookmarkMenu ); - - TQFile f( TQDir::homeDirPath() + "/.assistant/bookmarks." + - Config::configuration()->profileName() ); - if ( !f.open( IO_ReadOnly ) ) - return; - TQTextStream ts( &f ); - bookmarkMenu->insertSeparator(); - while ( !ts.atEnd() ) { - TQString title = ts.readLine(); - TQString link = ts.readLine(); - bookmarks.insert( bookmarkMenu->insertItem( title ), link ); - } -} - -void MainWindow::showBookmark( int id ) -{ - if ( bookmarks.find( id ) != bookmarks.end() ) - showLink( *bookmarks.find( id ) ); -} - -void MainWindow::showLinkFromClient( const TQString &link ) -{ - setWindowState(windowState() & ~TQt::WindowMinimized); - raise(); - setActiveWindow(); - showLink( link ); -} - -void MainWindow::showLink( const TQString &link ) -{ - if( link.isEmpty() ) { - qWarning( "The link is empty!" ); - } - - int find = link.find( '#' ); - TQString name = find >= 0 ? link.left( find ) : link; - - TQString absLink = link; - TQFileInfo fi( name ); - if ( fi.isRelative() ) { - if ( find >= 0 ) - absLink = fi.absFilePath() + link.right( link.length() - find ); - else - absLink = fi.absFilePath(); - } - if( fi.exists() ) { - tabs->setSource( absLink ); - tabs->currentBrowser()->setFocus(); - } else { - // ### Default 404 site! - statusBar()->message( tr( "Failed to open link: '%1'" ).arg( link ), 5000 ); - tabs->currentBrowser()->setText( tr( "

The page could not be found!


" - "

'%1'

").arg( link ) ); - tabs->updateTitle( tr( "Error..." ) ); - } -} - -void MainWindow::showLinks( const TQStringList &links ) -{ - if ( links.size() == 0 ) { - qWarning( "MainWindow::showLinks() - Empty link" ); - return; - } - - if ( links.size() == 1 ) { - showLink( links.first() ); - return; - } - - pendingLinks = links; - - TQStringList::ConstIterator it = pendingLinks.begin(); - // Initial showing, The tab is empty so update that without creating it first - if ( tabs->currentBrowser()->source().isEmpty() ) { - pendingBrowsers.append(tabs->currentBrowser()); - tabs->setTitle(tabs->currentBrowser(), pendingLinks.first()); - } - ++it; - - while( it != pendingLinks.end() ) { - pendingBrowsers.append( tabs->newBackgroundTab(*it) ); - ++it; - } - - startTimer(50); - return; -} - -void MainWindow::timerEvent(TQTimerEvent *e) -{ - TQString link = pendingLinks.first(); - HelpWindow *win = pendingBrowsers.first(); - pendingLinks.pop_front(); - pendingBrowsers.removeFirst(); - if (pendingLinks.size() == 0) - killTimer(e->timerId()); - win->setSource(link); -} - -void MainWindow::showQtHelp() -{ - showLink( TQString( qInstallPathDocs() ) + "/html/index.html" ); -} - -void MainWindow::showSettingsDialog() -{ - showSettingsDialog( -1 ); -} - -void MainWindow::showWebBrowserSettings() -{ - showSettingsDialog( 1 ); -} - -void MainWindow::showSettingsDialog( int page ) -{ - if ( !settingsDia ){ - settingsDia = new SettingsDialog( this ); - } - TQFontDatabase fonts; - settingsDia->fontCombo->clear(); - settingsDia->fontCombo->insertStringList( TQT_TQSTRINGLIST_OBJECT(fonts.families()) ); - settingsDia->fontCombo->lineEdit()->setText( tabs->browserFont().family() ); - settingsDia->fixedfontCombo->clear(); - settingsDia->fixedfontCombo->insertStringList( TQT_TQSTRINGLIST_OBJECT(fonts.families()) ); - settingsDia->fixedfontCombo->lineEdit()->setText( tabs->styleSheet()->item( "pre" )->fontFamily() ); - settingsDia->linkUnderlineCB->setChecked( tabs->linkUnderline() ); - settingsDia->colorButton->setPaletteBackgroundColor( tabs->palette().color( TQPalette::Active, TQColorGroup::Link ) ); - if ( page != -1 ) - settingsDia->settingsTab->setCurrentPage( page ); - - int ret = settingsDia->exec(); - - if ( ret != TQDialog::Accepted ) - return; - - TQObject *obj; - for ( obj = Toolbar->childrenListObject().last(); obj; obj = Toolbar->childrenListObject().prev() ) { - if ( obj->isA( "TQToolBarSeparator" ) ) { - delete obj; - obj = 0; - break; - } - } - - setupGoActions(); - - TQFont fnt( tabs->browserFont() ); - fnt.setFamily( settingsDia->fontCombo->currentText() ); - tabs->setBrowserFont( fnt ); - tabs->setLinkUnderline( settingsDia->linkUnderlineCB->isChecked() ); - - TQPalette pal = tabs->palette(); - TQColor lc = settingsDia->colorButton->paletteBackgroundColor(); - pal.setColor( TQPalette::Active, TQColorGroup::Link, lc ); - pal.setColor( TQPalette::Inactive, TQColorGroup::Link, lc ); - pal.setColor( TQPalette::Disabled, TQColorGroup::Link, lc ); - tabs->setPalette( pal ); - - TQString family = settingsDia->fixedfontCombo->currentText(); - - TQStyleSheet *sh = tabs->styleSheet(); - sh->item( "pre" )->setFontFamily( family ); - sh->item( "code" )->setFontFamily( family ); - sh->item( "tt" )->setFontFamily( family ); - tabs->currentBrowser()->setText( tabs->currentBrowser()->text() ); - showLink( tabs->currentBrowser()->source() ); -} - -void MainWindow::hide() -{ - saveToolbarSettings(); - TQMainWindow::hide(); -} - -MainWindow* MainWindow::newWindow() -{ - saveSettings(); - saveToolbarSettings(); - MainWindow *mw = new MainWindow; - mw->move( tqgeometry().topLeft() ); - if ( isMaximized() ) - mw->showMaximized(); - else - mw->show(); - mw->goHome(); - return mw; -} - -void MainWindow::saveSettings() -{ - Config *config = Config::configuration(); - config->setFontFamily( tabs->browserFont().family() ); - config->setFontSize( tabs->currentBrowser()->font().pointSize() ); - config->setFontFixedFamily( tabs->styleSheet()->item( "pre" )->fontFamily() ); - config->setLinkUnderline( tabs->linkUnderline() ); - config->setLinkColor( tabs->palette().color( TQPalette::Active, TQColorGroup::Link ).name() ); - config->setSideBarPage( helpDock->tabWidget->currentPageIndex() ); - config->setGeometry( TQRect( x(), y(), width(), height() ) ); - config->setMaximized( isMaximized() ); - - // Create list of the tab urls - TQStringList lst; - TQPtrList browsers = tabs->browsers(); - HelpWindow *browser = browsers.first(); - while (browser) { - lst << browser->source(); - browser = browsers.next(); - } - config->setSource(lst); - config->save(); -} - -void MainWindow::saveToolbarSettings() -{ - TQString mainWindowLayout; - TQTextStream ts( &mainWindowLayout, IO_WriteOnly ); - ts << *this; - Config::configuration()->setMainWindowLayout( mainWindowLayout ); -} - -TabbedBrowser* MainWindow::browsers() -{ - return tabs; -} - -void MainWindow::showSearchLink( const TQString &link, const TQStringList &terms ) -{ - HelpWindow * hw = tabs->currentBrowser(); - hw->blockScrolling( TRUE ); - hw->setCursor( tqwaitCursor ); - if ( hw->source() == link ) - hw->reload(); - else - showLink( link ); - hw->sync(); - hw->setCursor( tqarrowCursor ); - - hw->viewport()->setUpdatesEnabled( FALSE ); - int minPar = INT_MAX; - int minIndex = INT_MAX; - TQStringList::ConstIterator it = terms.begin(); - for ( ; it != terms.end(); ++it ) { - int para = 0; - int index = 0; - bool found = hw->find( *it, FALSE, TRUE, TRUE, ¶, &index ); - while ( found ) { - if ( para < minPar ) { - minPar = para; - minIndex = index; - } - hw->setColor( Qt::red ); - found = hw->find( *it, FALSE, TRUE, TRUE ); - } - } - hw->blockScrolling( FALSE ); - hw->viewport()->setUpdatesEnabled( TRUE ); - hw->setCursorPosition( minPar, minIndex ); - hw->updateContents(); -} - - -void MainWindow::showGoActionLink() -{ - const TQObject *origin = TQT_TQOBJECT(sender()); - if( !origin || - origin->tqmetaObject()->className() != TQString( "TQAction" ) ) - return; - - TQAction *action = (TQAction*) origin; - TQString docfile = *( goActionDocFiles->find( action ) ); - showLink( docfile ); -} - -void MainWindow::showAssistantHelp() -{ - showLink( Config::configuration()->assistantDocPath() + "/assistant.html" ); -} - -HelpDialog* MainWindow::helpDialog() -{ - return helpDock; -} - -void MainWindow::backwardAvailable( bool enable ) -{ - actionGoPrevious->setEnabled( enable ); -} - -void MainWindow::forwardAvailable( bool enable ) -{ - actionGoNext->setEnabled( enable ); -} - -void MainWindow::updateProfileSettings() -{ - Config *config = Config::configuration(); -#ifndef TQ_WS_MACX - setIcon( config->applicationIcon() ); -#endif - helpMenu->clear(); - actionHelpAssistant->addTo( helpMenu ); - helpMenu->insertSeparator(); - helpAbout_Qt_AssistantAction->addTo( helpMenu ); - if ( !config->aboutApplicationMenuText().isEmpty() ) - actionAboutApplication->addTo( helpMenu ); - helpMenu->insertSeparator(); - actionHelpWhatsThis->addTo( helpMenu ); - - actionAboutApplication->setMenuText( config->aboutApplicationMenuText() ); - - if( !config->title().isNull() ) - setCaption( config->title() ); -} diff --git a/tqtinterface/qt4/tools/assistant/profile.cpp b/tqtinterface/qt4/tools/assistant/profile.cpp deleted file mode 100644 index 6215d39..0000000 --- a/tqtinterface/qt4/tools/assistant/profile.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ -#include "profile.h" -#include -#include -#include -#include -#include - -#define TQT_TITLE "TQt Reference Documentation" -#define DESIGNER_TITLE "TQt Designer Manual" -#define ASSISTANT_TITLE "TQt Assistant Manual" -#define LINGUIST_TITLE "Guide to the TQt Translation Tools" -#define TQMAKE_TITLE "qmake User Guide" - -Profile *Profile::createDefaultProfile( const TQString &docPath ) -{ - TQString path = qInstallPathDocs(); - if ( !docPath.isEmpty() ) - path = docPath; - path = path + "/html/"; - Profile *profile = new Profile; - profile->valid = TRUE; - profile->type = DefaultProfile; - profile->props["name"] = "default"; - profile->props["applicationicon"] = "appicon.png"; - profile->props["aboutmenutext"] = "About TQt"; - profile->props["abouturl"] = "about_qt"; - profile->props["title"] = "TQt Assistant"; - profile->props["basepath"] = path; - profile->props["startpage"] = path + "index.html"; - - profile->addDCFTitle( path + "qt.dcf", TQT_TITLE ); - profile->addDCFTitle( path + "designer.dcf", DESIGNER_TITLE ); - profile->addDCFTitle( path + "assistant.dcf", ASSISTANT_TITLE ); - profile->addDCFTitle( path + "linguist.dcf", LINGUIST_TITLE ); - profile->addDCFTitle( path + "qmake.dcf", TQMAKE_TITLE ); - - profile->addDCFIcon( TQT_TITLE, "qt.png" ); - profile->addDCFIcon( DESIGNER_TITLE, "designer.png" ); - profile->addDCFIcon( ASSISTANT_TITLE, "assistant.png" ); - profile->addDCFIcon( LINGUIST_TITLE, "linguist.png" ); - - profile->addDCFIndexPage( TQT_TITLE, path + "index.html" ); - profile->addDCFIndexPage( DESIGNER_TITLE, path + "designer-manual.html" ); - profile->addDCFIndexPage( ASSISTANT_TITLE, path + "assistant.html" ); - profile->addDCFIndexPage( LINGUIST_TITLE, path + "linguist-manual.html" ); - profile->addDCFIndexPage( TQMAKE_TITLE, path + "qmake-manual.html" ); - - profile->addDCFImageDir( TQT_TITLE, "../../gif/" ); - profile->addDCFImageDir( DESIGNER_TITLE, "../../gif/" ); - profile->addDCFImageDir( ASSISTANT_TITLE, "../../gif/" ); - profile->addDCFImageDir( LINGUIST_TITLE, "../../gif/" ); - profile->addDCFImageDir( TQMAKE_TITLE, "../../gif/" ); - - return profile; -} - - -Profile::Profile() - : valid( TRUE ), dparser( 0 ) -{ -} - - -void Profile::removeDocFileEntry( const TQString &docfile ) -{ - docs.remove( docfile ); - - TQStringList titles; - - for( TQMap::Iterator it = dcfTitles.begin(); - it != dcfTitles.end(); ++it ) { - if( (*it) == docfile ) { - indexPages.remove( *it ); - icons.remove( *it ); - imageDirs.remove( *it ); - titles << it.key(); - } - } - - for( TQStringList::ConstIterator title = titles.begin(); - title != titles.end(); ++title ) { - - dcfTitles.remove( *title ); - } - -#ifdef ASSISTANT_DEBUG - qDebug( "docs:\n - " + docs.join( "\n - " ) ); - qDebug( "titles:\n - " + titles.join( "\n - " ) ); - qDebug( "keys:\n - " + ( (TQStringList*) &(dcfTitles.keys()) )->join( "\n - " ) ); - qDebug( "values:\n - " + ( (TQStringList*) &(dcfTitles.values()) )->join( "\n - " ) ); -#endif -} diff --git a/tqtinterface/qt4/tools/assistant/profile.h b/tqtinterface/qt4/tools/assistant/profile.h deleted file mode 100644 index 91b0904..0000000 --- a/tqtinterface/qt4/tools/assistant/profile.h +++ /dev/null @@ -1,130 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef PROFILE_H -#define PROFILE_H - -#include -#include -#include -#include - -class DocuParser; - -class Profile -{ -public: - enum ProfileType { DefaultProfile, UserProfile }; - Profile(); - - inline bool isValid() const; - - inline void addDCF( const TQString &docfile ); - inline void addDCFIcon( const TQString title, const TQString &icon ); - inline void addDCFIndexPage( const TQString title, const TQString &indexPage ); - inline void addDCFImageDir( const TQString title, const TQString &imgDir ); - inline void addDCFTitle( const TQString &dcf, const TQString &title ); - inline void addProperty( const TQString &name, const TQString &value ); - inline bool hasDocFile( const TQString &docFile ); - void removeDocFileEntry( const TQString &title ); - - inline ProfileType profileType() const { return type; } - inline void setProfileType( ProfileType t ) { type = t; } - - inline DocuParser *docuParser() const { return dparser; } - inline void setDocuParser( DocuParser *dp ) { dparser = dp; } - - static Profile* createDefaultProfile( const TQString &docPath = TQString() ); - static TQString makeRelativePath( const TQString &base, const TQString &path ); - - int valid:1; - ProfileType type; - DocuParser *dparser; - TQMap props; - TQMap icons; - TQMap indexPages; - TQMap imageDirs; - TQMap dcfTitles; - TQStringList docs; -}; - - -inline bool Profile::isValid() const -{ - return valid; -} - -inline void Profile::addDCFTitle(const TQString &dcf, const TQString &title) -{ - TQString absdcf = TQFileInfo(dcf).absFilePath(); - dcfTitles[title] = absdcf; - if (docs.contains(absdcf) == 0) - docs << absdcf; -} - -inline void Profile::addDCF( const TQString &docfile ) -{ - if( !docs.contains( docfile ) == 0 ) - docs << docfile; -} - -inline void Profile::addDCFIcon( const TQString docfile, - const TQString &icon ) -{ - icons[docfile] = icon; -} - -inline void Profile::addDCFIndexPage( const TQString title, - const TQString &indexPage ) -{ - indexPages[title] = indexPage; -} - -inline void Profile::addDCFImageDir( const TQString docfile, - const TQString &imgDir ) -{ - imageDirs[docfile] = imgDir; -} - -inline void Profile::addProperty( const TQString &name, - const TQString &value ) -{ - props[name] = value; -} - -inline bool Profile::hasDocFile( const TQString &name ) -{ - return docs.contains( name ) > 0; -} - -#endif diff --git a/tqtinterface/qt4/tools/assistant/settingsdialog.ui b/tqtinterface/qt4/tools/assistant/settingsdialog.ui deleted file mode 100644 index f2ae9b2..0000000 --- a/tqtinterface/qt4/tools/assistant/settingsdialog.ui +++ /dev/null @@ -1,516 +0,0 @@ - -SettingsDialogBase -********************************************************************* -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of Qt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -********************************************************************* - - - SettingsDialogBase - - - - 0 - 0 - 389 - 253 - - - - Qt Assistant - Settings - - - true - - - - unnamed - - - - settingsTab - - - - 5 - 5 - 0 - 0 - - - - - tab - - - &General - - - - unnamed - - - - Layout2 - - - - unnamed - - - - fixedfontCombo - - - - 7 - 0 - 0 - 0 - - - - true - - - - - TextLabel1 - - - Fix&ed font: - - - fixedfontCombo - - - - - TextLabel2 - - - Link color: - - - - - fontCombo - - - - 7 - 0 - 0 - 0 - - - - true - - - - - fontLabel - - - &Font: - - - fontCombo - - - - - linkUnderlineCB - - - &Underline links - - - true - - - - - colorButton - - - - 0 - 0 - 0 - 0 - - - - - 40 - 20 - - - - - 255 - 0 - 0 - - - - TabFocus - - - - - - - - - - - - tab - - - &Web - - - - unnamed - - - - Spacer11 - - - Vertical - - - Expanding - - - - 20 - 30 - - - - - - TextLabel1_3 - - - Web &Browser Application: - - - browserApp - - - - - Layout9 - - - - unnamed - - - - browserApp - - - - - buttonBrowse - - - - 1 - 0 - 0 - 0 - - - - - 30 - 32767 - - - - ... - - - - - - - TextLabel1_3_3 - - - &Home page - - - homePage - - - - - tqlayout8 - - - - unnamed - - - - homePage - - - - - buttonHome - - - - 1 - 0 - 0 - 0 - - - - - 30 - 32767 - - - - ... - - - - - - - - - pdfTab - - - &PDF - - - - unnamed - - - - TextLabel1_3_2 - - - PDF &Application - - - pdfApp - - - - - spacer10 - - - Vertical - - - Expanding - - - - 20 - 81 - - - - - - tqlayout9 - - - - unnamed - - - - pdfApp - - - - - buttonPDF - - - - 1 - 0 - 0 - 0 - - - - - 30 - 32767 - - - - ... - - - - - - - - - - Layout1 - - - - unnamed - - - - Horizontal Spacing2 - - - Horizontal - - - Expanding - - - - 0 - 20 - - - - - - buttonOk - - - &OK - - - true - - - true - - - - - buttonCancel - - - &Cancel - - - true - - - - - - - - - buttonOk - clicked() - SettingsDialogBase - accept() - - - buttonCancel - clicked() - SettingsDialogBase - reject() - - - colorButton - clicked() - SettingsDialogBase - selectColor() - - - buttonBrowse - clicked() - SettingsDialogBase - browseWebApp() - - - buttonHome - clicked() - SettingsDialogBase - browseHomepage() - - - buttonPDF - clicked() - SettingsDialogBase - browsePDFApplication() - - - - settingsTab - fontCombo - fixedfontCombo - colorButton - linkUnderlineCB - browserApp - buttonBrowse - homePage - buttonHome - pdfApp - buttonPDF - buttonOk - buttonCancel - - - selectColor() - browseWebApp() - browsePDFApplication() - browseHomepage() - - - diff --git a/tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp b/tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp deleted file mode 100644 index 287bb37..0000000 --- a/tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "settingsdialogimpl.h" -#include "docuparser.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -SettingsDialog::SettingsDialog( TQWidget *parent, const char* name ) - : SettingsDialogBase( parent, name ) -{ - init(); -} - -void SettingsDialog::init() -{ - Config *config = Config::configuration(); - - browserApp->setText( config->webBrowser() ); - homePage->setText( config->homePage() ); - pdfApp->setText( config->pdfReader() ); -} - -void SettingsDialog::selectColor() -{ - TQColor c = TQColorDialog::getColor( colorButton->paletteBackgroundColor(), this ); - colorButton->setPaletteBackgroundColor( c ); -} - -void SettingsDialog::browseWebApp() -{ - setFile( browserApp, tr( "TQt Assistant - Set Web Browser" ) ); -} - -void SettingsDialog::browsePDFApplication() -{ - setFile( pdfApp, tr( "TQt Assistant - Set PDF Browser" ) ); -} - -void SettingsDialog::browseHomepage() -{ - setFile( homePage, tr( "TQt Assistant - Set Homepage" ) ); -} - -void SettingsDialog::setFile( TQLineEdit *le, const TQString &caption ) -{ - TQFileDialog *fd = new TQFileDialog( this ); - fd->setCaption( caption ); - fd->setMode( TQFileDialog::AnyFile ); - fd->setDir( TQDir::homeDirPath() ); - - if ( fd->exec() == TQDialog::Accepted ) { - if ( !fd->selectedFile().isEmpty() ) - le->setText( fd->selectedFile() ); - } -} - -void SettingsDialog::accept() -{ - Config *config = Config::configuration(); - - config->setWebBrowser( browserApp->text() ); - config->setHomePage( homePage->text() ); - config->setPdfReader( pdfApp->text() ); - - hide(); - done( Accepted ); -} - -void SettingsDialog::reject() -{ - init(); - done( Rejected ); -} diff --git a/tqtinterface/qt4/tools/assistant/settingsdialogimpl.h b/tqtinterface/qt4/tools/assistant/settingsdialogimpl.h deleted file mode 100644 index 2e07a48..0000000 --- a/tqtinterface/qt4/tools/assistant/settingsdialogimpl.h +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef SETTINGSDIALOGIMPL_H -#define SETTINGSDIALOGIMPL_H - -#include "settingsdialog.h" - -#include -#include -#include - -class SettingsDialog : public SettingsDialogBase -{ - Q_OBJECT - TQ_OBJECT - -public: - SettingsDialog( TQWidget *parent, const char* name = 0 ); - -protected Q_SLOTS: - void selectColor(); - void browseWebApp(); - void browsePDFApplication(); - void browseHomepage(); - void accept(); - void reject(); - -private: - void init(); - void setFile( TQLineEdit *le, const TQString &caption ); -}; - -#endif diff --git a/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui b/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui deleted file mode 100644 index 79fec26..0000000 --- a/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui +++ /dev/null @@ -1,141 +0,0 @@ - -TabbedBrowser -********************************************************************* -** Copyright (C) 2003-2008 Trolltech ASA. All rights reserved. -** -** This file is part of Qt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -********************************************************************* - - - TabbedBrowser - - - - 0 - 0 - 710 - 681 - - - - TabbedBrowser - - - - unnamed - - - 0 - - - 0 - - - - tab - - - - frontpage - - - Untitled - - - - unnamed - - - - - - - - tqsettings.h - helpwindow.h - mainwindow.h - tqstylesheet.h - tqmime.h - tabbedbrowser.ui.h - - - class HelpWindow; - class MainWindow; - class TQStyleSheet; - class TQMimeSourceFactory; - - - TQStyleSheet *tabStyleSheet; - bool tabLinkUnderline; - TQMimeSourceFactory *mimeSourceFactory; - TQWidget *lastCurrentTab; - TQFont tabFont; - - - forward() - backward() - setSource( const TQString & ref ) - reload() - home() - nextTab() - previousTab() - newTab( const TQString & lnk ) - zoomIn() - zoomOut() - updateTitle( const TQString & title ) - newTab() - transferFocus() - initHelpWindow( HelpWindow * win ) - setup() - setLinkUnderline( bool uline ) - setPalette( const TQPalette & pal ) - copy() - closeTab() - sourceChanged() - - - currentBrowser() - init() - mainWindow() - styleSheet() - linkUnderline() - sources() - setMimePath( TQStringList lst ) - setMimeExtension( const TQString & ext ) - setBrowserFont( const TQFont & fnt ) - browserFont() - browsers() const - newBackgroundTab( const TQString & url ) - createHelpWindow(const TQString &) - setTitle(HelpWindow*, const TQString &) - - - - diff --git a/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h b/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h deleted file mode 100644 index 5f16dd1..0000000 --- a/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h +++ /dev/null @@ -1,347 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you wish to add, delete or rename functions or Q_SLOTS use -** TQt Designer which will update this file, preserving your code. Create an -** init() function in place of a constructor, and a destroy() function in -** place of a destructor. -*****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "config.h" - -static TQString reduceLabelLength( const TQString &s ) -{ - uint maxLength = 16; - TQString str = s; - if ( str.length() < maxLength ) - return str; - str = str.left( maxLength - 3 ); - str += "..."; - return str; -} - -void TabbedBrowser::forward() -{ - currentBrowser()->forward(); -} - -void TabbedBrowser::backward() -{ - currentBrowser()->backward(); -} - -void TabbedBrowser::setSource( const TQString &ref ) -{ - HelpWindow * win = currentBrowser(); - win->setSource(ref); -} - -void TabbedBrowser::reload() -{ - currentBrowser()->reload(); -} - -void TabbedBrowser::home() -{ - currentBrowser()->home(); -} - -HelpWindow * TabbedBrowser::currentBrowser() -{ - return (HelpWindow*) tab->currentPage(); -} - -void TabbedBrowser::nextTab() -{ - if( tab->currentPageIndex()<=tab->count()-1 ) - tab->setCurrentPage( tab->currentPageIndex()+1 ); -} - -void TabbedBrowser::previousTab() -{ - int idx = tab->currentPageIndex()-1; - if( idx>=0 ) - tab->setCurrentPage( idx ); -} - -HelpWindow *TabbedBrowser::createHelpWindow(const TQString &title) -{ - MainWindow *mainWin = mainWindow(); - HelpWindow *win = new HelpWindow( mainWin, this, "qt_assistant_helpwin" ); - win->setFont( browserFont() ); - win->setPalette( palette() ); - win->setLinkUnderline( tabLinkUnderline ); - win->setStyleSheet( tabStyleSheet ); - win->setMimeSourceFactory( mimeSourceFactory ); - tab->addTab(win, reduceLabelLength(title)); - connect( win, TQT_SIGNAL( highlighted( const TQString & ) ), - (const TQObject*) (mainWin->statusBar()), TQT_SLOT( message( const TQString & ) ) ); - connect( win, TQT_SIGNAL( chooseWebBrowser() ), mainWin, TQT_SLOT( showWebBrowserSettings() ) ); - connect( win, TQT_SIGNAL( backwardAvailable(bool) ), - mainWin, TQT_SLOT( backwardAvailable(bool) ) ); - connect( win, TQT_SIGNAL( forwardAvailable(bool) ), - mainWin, TQT_SLOT( forwardAvailable(bool) ) ); - connect( win, TQT_SIGNAL( sourceChanged(const TQString &) ), this, TQT_SLOT( sourceChanged() )); - - tab->cornerWidget( TQt::TopRight )->setEnabled( tab->count() > 1 ); - return win; -} - -HelpWindow *TabbedBrowser::newBackgroundTab( const TQString &url ) -{ - HelpWindow *win = createHelpWindow(url); - return win; -} - -void TabbedBrowser::newTab( const TQString &lnk ) -{ - TQString link( lnk ); - if( link.isNull() ) { - HelpWindow *w = currentBrowser(); - if( w ) - link = w->source(); - } - HelpWindow *win = createHelpWindow(link); - tab->showPage( win ); - if( !link.isNull() ) { - win->setSource( link ); - } -} - -void TabbedBrowser::zoomIn() -{ - currentBrowser()->zoomIn(); -} - -void TabbedBrowser::zoomOut() -{ - currentBrowser()->zoomOut(); -} - -void TabbedBrowser::init() -{ - tabLinkUnderline = FALSE; - tabStyleSheet = new TQStyleSheet( TQStyleSheet::defaultSheet() ); - lastCurrentTab = 0; - while( tab->count() ) - tab->removePage( tab->page(0) ); - - mimeSourceFactory = new TQMimeSourceFactory(); - mimeSourceFactory->setExtensionType("html","text/html;charset=UTF-8"); - mimeSourceFactory->setExtensionType("htm","text/html;charset=UTF-8"); - mimeSourceFactory->setExtensionType("png", "image/png" ); - mimeSourceFactory->setExtensionType("jpg", "image/jpeg" ); - mimeSourceFactory->setExtensionType("jpeg", "image/jpeg" ); - setMimePath( Config::configuration()->mimePaths() ); - - connect( tab, TQT_SIGNAL( currentChanged( TQWidget* ) ), - this, TQT_SLOT( transferFocus() ) ); - connect( tab, TQT_SIGNAL( currentChanged( TQWidget* ) ), - mainWindow(), TQT_SLOT( browserTabChanged() ) ); - - TQTabBar *tabBar = (TQTabBar*)tab->child( 0, "TQTabBar", FALSE ); - int m = ( tabBar ? tqstyle().tqpixelMetric( TQStyle::PM_TabBarTabVSpace, (TQWidget*)tabBar ) - + tqstyle().tqpixelMetric( TQStyle::PM_TabBarBaseHeight, (TQWidget*)tabBar ) : 0 ); - int s = tab->height() - m; - - // workaround for sgi style - TQPalette pal = palette(); - pal.setColor(TQPalette::Active, TQColorGroup::Button, pal.active().background()); - pal.setColor(TQPalette::Disabled, TQColorGroup::Button, pal.disabled().background()); - pal.setColor(TQPalette::Inactive, TQColorGroup::Button, pal.inactive().background()); - - TQToolButton *newTabButton = new TQToolButton( this ); - newTabButton->setPalette(pal); - tab->setCornerWidget( newTabButton, TQt::TopLeft ); - newTabButton->setCursor( tqarrowCursor ); - newTabButton->setAutoRaise( TRUE ); - newTabButton->setPixmap( TQPixmap::fromMimeSource( "addtab.png" ) ); - newTabButton->setFixedSize( s, s ); - TQObject::connect( newTabButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( newTab() ) ); - TQToolTip::add( newTabButton, tr( "Add page" ) ); - - TQToolButton *closeTabButton = new TQToolButton( this ); - closeTabButton->setPalette(pal); - tab->setCornerWidget( closeTabButton, TQt::TopRight ); - closeTabButton->setCursor( tqarrowCursor ); - closeTabButton->setAutoRaise( TRUE ); - TQIconSet is( TQPixmap::fromMimeSource( "closetab.png") ); - TQPixmap disabledPix = TQPixmap::fromMimeSource( "d_closetab.png" ); - is.setPixmap( disabledPix, TQIconSet::Small, TQIconSet::Disabled ); - closeTabButton->setIconSet( is ); - closeTabButton->setFixedSize( s, s ); - TQObject::connect( closeTabButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( closeTab() ) ); - TQToolTip::add( closeTabButton, tr( "Close page" ) ); - closeTabButton->setEnabled( FALSE ); -} - -void TabbedBrowser::setMimePath( TQStringList lst ) -{ - mimeSourceFactory->setFilePath( lst ); -} - -void TabbedBrowser::setMimeExtension( const TQString &ext ) -{ - mimeSourceFactory->setExtensionType( "html", ext ); - mimeSourceFactory->setExtensionType( "htm", ext ); -} - -void TabbedBrowser::updateTitle( const TQString &title ) -{ - tab->changeTab( currentBrowser(), title ); -} - -MainWindow* TabbedBrowser::mainWindow() -{ - return (MainWindow*) parent(); -} - -void TabbedBrowser::newTab() -{ - newTab( TQString() ); -} - -void TabbedBrowser::transferFocus() -{ - if( currentBrowser() ) { - currentBrowser()->setFocus(); - } - mainWindow()->setCaption(Config::configuration()->title() - + " - " + currentBrowser()->documentTitle()); -} - -void TabbedBrowser::initHelpWindow( HelpWindow * /*win*/ ) -{ -} - -void TabbedBrowser::setup() -{ - Config *config = Config::configuration(); - - TQFont fnt( font() ); - TQFontInfo fntInfo( fnt ); - fnt.setFamily( config->fontFamily() ); - fnt.setPointSize( config->fontSize() ); - setBrowserFont( fnt ); - - TQPalette pal = palette(); - TQColor lc( config->linkColor() ); - pal.setColor( TQPalette::Active, TQColorGroup::Link, lc ); - pal.setColor( TQPalette::Inactive, TQColorGroup::Link, lc ); - pal.setColor( TQPalette::Disabled, TQColorGroup::Link, lc ); - setPalette( pal ); - - tabLinkUnderline = config->isLinkUnderline(); - - TQString family = config->fontFixedFamily(); - tabStyleSheet->item( "pre" )->setFontFamily( family ); - tabStyleSheet->item( "code" )->setFontFamily( family ); - tabStyleSheet->item( "tt" )->setFontFamily( family ); - - newTab( TQString() ); -} - -void TabbedBrowser::setLinkUnderline( bool uline ) -{ - if( uline==tabLinkUnderline ) - return; - tabLinkUnderline = uline; - int cnt = tab->count(); - for( int i=0; ipage( i ) )->setLinkUnderline( tabLinkUnderline ); -} - -TQFont TabbedBrowser::browserFont() -{ - return tabFont; -} - -void TabbedBrowser::setBrowserFont( const TQFont &fnt ) -{ - if( tabFont == fnt ) - return; - tabFont = fnt; - int cnt = tab->count(); - for( int i=0; ipage( i ) )->setFont( fnt ); -} - -void TabbedBrowser::setPalette( const TQPalette &pal ) -{ - if( palette()==pal ) - return; - TQWidget::setPalette( pal ); - int cnt = tab->count(); - for( int i=0; ipage( i ) )->setPalette( pal ); -} - -TQStyleSheet* TabbedBrowser::styleSheet() -{ - return tabStyleSheet; -} - -bool TabbedBrowser::linkUnderline() -{ - return tabLinkUnderline; -} - -void TabbedBrowser::copy() -{ - currentBrowser()->copy(); -} - -void TabbedBrowser::closeTab() -{ - if( tab->count()==1 ) - return; - HelpWindow *win = currentBrowser(); - tab->removePage( win ); - TQTimer::singleShot(0, win, TQT_SLOT(deleteLater())); - tab->cornerWidget( TQt::TopRight )->setEnabled( tab->count() > 1 ); -} - -TQStringList TabbedBrowser::sources() -{ - TQStringList lst; - int cnt = tab->count(); - for( int i=0; ipage(i) )->source() ); - } - return lst; -} - -TQPtrList TabbedBrowser::browsers() const -{ - TQPtrList list; - for (int i=0; icount(); ++i) { - TQ_ASSERT(::tqqt_cast(tab->page(i))); - list.append(::tqqt_cast(tab->page(i))); - } - return list; -} - -void TabbedBrowser::sourceChanged() -{ - HelpWindow *win = ::tqqt_cast( sender() ); - TQ_ASSERT( win ); - TQString docTitle(win->documentTitle()); - if (docTitle.isEmpty()) - docTitle = "..."; - setTitle(win, docTitle); -} - -void TabbedBrowser::setTitle(HelpWindow *win, const TQString &title) -{ - tab->setTabLabel(win, reduceLabelLength(title)); - if (win == currentBrowser()) - mainWindow()->setCaption(Config::configuration()->title() + " - " + title); -} - diff --git a/tqtinterface/qt4/tools/assistant/topicchooser.ui b/tqtinterface/qt4/tools/assistant/topicchooser.ui deleted file mode 100644 index 364e23f..0000000 --- a/tqtinterface/qt4/tools/assistant/topicchooser.ui +++ /dev/null @@ -1,182 +0,0 @@ - -TopicChooserBase -********************************************************************* -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of Qt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -********************************************************************* - - - TopicChooserBase - - - - 0 - 0 - 391 - 223 - - - - Choose Topic - - - true - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - - - - unnamed - - - 11 - - - 6 - - - - label - - - &Topics - - - listbox - - - - - listbox - - - Displays a list of available help topics for the keyword. - - - - - Layout16 - - - - unnamed - - - 0 - - - 6 - - - - Horizontal Spacing2 - - - Horizontal - - - Expanding - - - - 20 - 20 - - - - - - buttonDisplay - - - &Display - - - true - - - true - - - Open the topic selected in the list. - - - - - buttonCancel - - - &Close - - - true - - - Close the Dialog. - - - - - - - - - buttonDisplay - clicked() - TopicChooserBase - accept() - - - buttonCancel - clicked() - TopicChooserBase - reject() - - - listbox - doubleClicked(QListBoxItem*) - TopicChooserBase - accept() - - - listbox - returnPressed(QListBoxItem*) - TopicChooserBase - accept() - - - - init() - destroy() - - - diff --git a/tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp b/tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp deleted file mode 100644 index d6048d2..0000000 --- a/tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "topicchooserimpl.h" - -#include -#include -#include - -TopicChooser::TopicChooser( TQWidget *parent, const TQStringList &lnkNames, - const TQStringList &lnks, const TQString &title ) - : TopicChooserBase( parent, 0, TRUE ), links( lnks ), linkNames( lnkNames ) -{ - label->setText( tr( "Choose a topic for %1" ).arg( title ) ); - listbox->insertStringList( linkNames ); - listbox->setCurrentItem( listbox->firstItem() ); - listbox->setFocus(); -} - -TQString TopicChooser::link() const -{ - if ( listbox->currentItem() == -1 ) - return TQString(); - TQString s = listbox->currentText(); - if ( s.isEmpty() ) - return s; - int i = linkNames.findIndex( s ); - return links[ i ]; -} - -TQString TopicChooser::getLink( TQWidget *parent, const TQStringList &lnkNames, - const TQStringList &lnks, const TQString &title ) -{ - TopicChooser *dlg = new TopicChooser( parent, lnkNames, lnks, title ); - TQString lnk; - if ( dlg->exec() == TQDialog::Accepted ) - lnk = dlg->link(); - delete dlg; - return lnk; -} diff --git a/tqtinterface/qt4/tools/assistant/topicchooserimpl.h b/tqtinterface/qt4/tools/assistant/topicchooserimpl.h deleted file mode 100644 index 8b3af6d..0000000 --- a/tqtinterface/qt4/tools/assistant/topicchooserimpl.h +++ /dev/null @@ -1,60 +0,0 @@ -/********************************************************************** -** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. -** -** This file is part of TQt Assistant. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** Licensees holding valid TQt Commercial licenses may use this file in -** accordance with the TQt Commercial License Agreement provided with -** the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TOPICCHOOSERIMPL_H -#define TOPICCHOOSERIMPL_H - -#include "topicchooser.h" - -#include - -class TopicChooser : public TopicChooserBase -{ - TQ_OBJECT - -public: - TopicChooser( TQWidget *parent, const TQStringList &lnkNames, - const TQStringList &lnks, const TQString &title ); - - TQString link() const; - - static TQString getLink( TQWidget *parent, const TQStringList &lnkNames, - const TQStringList &lnks, const TQString &title ); - -private: - TQString theLink; - TQStringList links, linkNames; - -}; - -#endif -- cgit v1.2.1