git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kchmviewer@1090662 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
commit
3133bbc63a
@ -0,0 +1,291 @@
|
||||
2007-06-16 tim <gyunaev@ulduzsoft.com>
|
||||
- Fixed locale and .desktop installation directory for Gentoo (thx Peter Volkov)
|
||||
- Increased the speed of search engine indexing (thx Kai Londenberg)
|
||||
- Fixed the problem when kchmviewer is called from a browser with URL like file://.
|
||||
- Fixed the unability to run the program when the last opened file does not exist anymore,
|
||||
and the LoadLatestFileOnStartup is set to 1.
|
||||
- Fixed CHMs with Unicode index/topic filenames inside CHM file (thx hephooey).
|
||||
- Fixed showing book images in QTextBrowser when file path contains urlencoded symbols.
|
||||
- Fixed 64bit platforms compilation if system chmlib is not present.
|
||||
- Version 3.1 (Qt3) released.
|
||||
|
||||
2007-03-14 tim <gyunaev@ulduzsoft.com>
|
||||
- Version 3.0 released
|
||||
- Added a lot of decoded entities.
|
||||
- Fixed incorrect saving of the settings file which result of this file not being loaded.
|
||||
- Added FAQ.
|
||||
- Added command-line options to search in index and in search window.
|
||||
|
||||
2007-03-09 tim <gyunaev@ulduzsoft.com>
|
||||
- Added improved custom search engine.
|
||||
- Added DCOP support for KDE version.
|
||||
|
||||
2007-03-08 tim <gyunaev@ulduzsoft.com>
|
||||
- KDE version now shows KDE about dialog
|
||||
- Fixed 'copy' in KDE browser
|
||||
- Version changed to 3.0
|
||||
- Removed duplicated application title in KDE.
|
||||
- Gentoo installation issues fixed.
|
||||
- KDE version sometime didn't kill the process after quit; thanks Norberto Bensa for fix.
|
||||
- Fixed popup menu popping in a wrong place when using QTextBrowser if the scrollbar
|
||||
position is not at the top of the document.
|
||||
- KHTMLPart options sometime were not disabled while QTextBrowser was choosen.
|
||||
|
||||
2007-03-01 tim <gyunaev@ulduzsoft.com>
|
||||
- The design changed; created the chm files processing library, and moved it outside the source
|
||||
to improve and simplify Okular integration.
|
||||
- Changed URL2Topic search, the result - startup and opening times increased up to 20 times
|
||||
for large chm files!
|
||||
- Index multiple URL entry also opens now faster.
|
||||
- Added support for new autotools.
|
||||
|
||||
2006-12-01 tim <gyunaev@ulduzsoft.com>
|
||||
- Version changed to 2.7.
|
||||
- You can now switch between tabs using Alt+<tab number>, thanks Bobi Jam.
|
||||
- Kchmviewer should now work correctly on non-x86 platforms, including the codepage
|
||||
autodetection.
|
||||
- Added a warning when the browser or browser settings are changed that the application
|
||||
restart is required for changes to take effect.
|
||||
- Fixed the i18n compilation problem in kchmviewwindow.cpp.
|
||||
- If the TOC directory entry did not have an associated page, it was not possible to select it.
|
||||
- TOC directory entries now could be opened/closed with double-click on the entry name/icon,
|
||||
not just +/- icons. Credits to Ludo for the ideas.
|
||||
- No more duplicate entries in previous file history.
|
||||
- The window title is now truncated if too long.
|
||||
- Tab close icon now positioned correctly.
|
||||
- Now current window size and splitter position is also stored on exit - separately
|
||||
for each chm file.
|
||||
- Window selection with multiple tabs now works.
|
||||
- Czech translation added, thanks Hynek Fabian.
|
||||
- Dutch translation updated, thanks Rinse de Vries.
|
||||
|
||||
2006-04-05 tim <gyunaev@ulduzsoft.com>
|
||||
- Version changed to 2.6
|
||||
- Fixed gcc 4.x compilation.
|
||||
- Added shortcut help in context menus.
|
||||
- Right-click menu is now available in Contents, Search, Index and Favorites windows.
|
||||
- Fixed navigation buttons 'What's this' messages.
|
||||
- Fixed compilation on Zaurus and Debian.
|
||||
|
||||
2006-04-05 tim <gyunaev@ulduzsoft.com>
|
||||
- Application icon should now be correctly installed.
|
||||
- Fixed handling of mailto: urls.
|
||||
- 'Locate in content' button now opens a Contents tab, if hidden.
|
||||
- Version 2.5 release.
|
||||
|
||||
2006-04-02 tim <gyunaev@ulduzsoft.com>
|
||||
- A tooltip is now shows the full text in all the tree and list views if truncated on screen.
|
||||
- Fixed content tree parser, now the content table should be parsed correctly.
|
||||
- Fixed crash after the encoding is changed, if any tree item is clicked.
|
||||
- Added a bookmark menu. Ctrl-B is a shortcut to add a bookmark.
|
||||
|
||||
2006-04-01 tim <gyunaev@ulduzsoft.com>
|
||||
- Added tab browsing. Use right-click and 'Open in new tab'.
|
||||
- Added right-click content menu to open pages in a new tab.
|
||||
- Control-click on link or table of contents opens a page in a new tab in background.
|
||||
- Shift-click on link or table of contents opens a page in a new tab in foreground.
|
||||
|
||||
2006-03-31 tim <gyunaev@ulduzsoft.com>
|
||||
- 'Setup' menu renamed to 'Settings'
|
||||
- Fixed various navigation errors when 'Locate' button didn't locate the appropriate topic.
|
||||
- Fixed forward navigation, and saved scroll position.
|
||||
- Added tab browsing.
|
||||
|
||||
2006-02-07 tim <gyunaev@ulduzsoft.com>
|
||||
- Navigation history rewritten, now it stores text position too.
|
||||
- Version changed to 2.1.
|
||||
|
||||
2006-02-06 tim <gyunaev@ulduzsoft.com>
|
||||
- Added 'Extract CHM content' menu item to extract the whole CHM file into a directory.
|
||||
|
||||
2006-02-02 tim <gyunaev@ulduzsoft.com>
|
||||
- Added i18n calls for complete internationalization. pot file created.
|
||||
- Switched to a new, correct automake file structure.
|
||||
- Fixed autotest.
|
||||
- Version changed to 2.0.
|
||||
|
||||
2006-02-01 tim <gyunaev@ulduzsoft.com>
|
||||
- Now kchmviewer uses system libchm if found, and no --with-builtin-chmlib configure switch defined.
|
||||
- Made configure more compatible with newest autoconf and Debian - thanks to Jose Luis Tallon.
|
||||
- Added an application icon - thanks to Jose Luis Tallon.
|
||||
- Fixed index parser for PHP manual - thanks to Dmitry Bakshaev.
|
||||
- In full screen mode the menu bar and status bar are now hidden.
|
||||
|
||||
2006-01-30 tim <gyunaev@ulduzsoft.com>
|
||||
- Added 'locate in content window' button to open currently opened topic in the content window.
|
||||
- Fixed compilation with gcc 4.1 - thanks to Jan Jitse Venselaar.
|
||||
- The algorithm to detect the valid root offset in contents page is changed. Now there should be less
|
||||
"CHMFile::ParseAndFillTopicsTree: child entry 1 with no root entry!" errors.
|
||||
- Pages with images only are now shown correctly.
|
||||
|
||||
2005-12-30 tim <gyunaev@ulduzsoft.com>
|
||||
- Fixed kqrunprocess.h compilation bug on some platforms.
|
||||
|
||||
2005-11-27 tim <gyunaev@ulduzsoft.com>
|
||||
- Version 1.3 RELEASE
|
||||
|
||||
2005-11-25 tim <gyunaev@ulduzsoft.com>
|
||||
- Fixed error message when CHM file cannot be opened.
|
||||
- Added Fullscreen mode (shortcut F11), and option to show/hide contents window (F9).
|
||||
|
||||
2005-11-22 tim <gyunaev@ulduzsoft.com>
|
||||
- Added possibility to view HTML source in external viewer/editor
|
||||
|
||||
2005-11-21 tim <gyunaev@ulduzsoft.com>
|
||||
- File names containing non-English characters now open correctly.
|
||||
- Changed copyright notices.
|
||||
|
||||
2005-11-21 tim <gyunaev@ulduzsoft.com>
|
||||
- Fixed browser page update for QTextBrowser when current encoding changes.
|
||||
- Changed encoding selectore. Now it compiles on x86_64.
|
||||
- version 1.2 RELEASE
|
||||
|
||||
2005-11-20 tim <gyunaev@ulduzsoft.com>
|
||||
- Added 'next page' and 'prev page' buttons.
|
||||
- Added extra charset encodings for Japanese, Chinese, Russian and Ukrainian languages.
|
||||
- Added UTF-8 and UTF-16 encodings to country 'Unicode' :)
|
||||
- Added special KOI8 encoding to Russian and Ukrainian languages. 'Special' means that
|
||||
TOC is in CP1251 encoding, while content is in KOI8 encoding. There were some CHM files
|
||||
with such weird encoding, so it is kinda hack.
|
||||
- Fixed language selection bug - application crashed when you select the last language in any submenu.
|
||||
- 'Set encoding' menu renamed to 'Set Language'.
|
||||
- Added a new 'Set codepage' menu, which allows experienced people to send needed text code page directly.
|
||||
- Added Ctrl-F shortcut to move cursor focus onto the search input combo box.
|
||||
- Fixed navigation in some CHM files, which have spaces in filenames.
|
||||
|
||||
2005-10-30 tim <gyunaev@ulduzsoft.com>
|
||||
- fixed security bug - chmlib-0.35 updated to 0.37
|
||||
- version 1.1 RELEASE released.
|
||||
|
||||
2005-09-27 tim <gyunaev@ulduzsoft.com>
|
||||
- fixed bug with incorrect embedded image shown - thanks to XinWei Hu.
|
||||
- fixed bug with non-working decrease font size - thanks to anonymous Sourceforge user.
|
||||
- copy in KDE version worked through Ctrl-C or 'copy' in content menu.
|
||||
|
||||
|
||||
2005-07-28 tim <gyunaev@ulduzsoft.com>
|
||||
- Version 1.0 RELEASE released.
|
||||
- Fixed -h option for Qt version.
|
||||
- Fixed search messagebox on '?' button.
|
||||
- Added F3 shortcut for 'next search in page' action.
|
||||
|
||||
2005-06-30 tim <gyunaev@ulduzsoft.com>
|
||||
- version 0.92 RELEASE CANDIDATE 2 released.
|
||||
- fixed Slackware 10 compilation (one more time)
|
||||
|
||||
2005-06-25 tim <gyunaev@ulduzsoft.com>
|
||||
- more namespace cleanups and bugfixes.
|
||||
- context and search windows are not shown if the opened file doesn't have it.
|
||||
- removed 'search in results' checkbox.
|
||||
- the last used directory is also stored.
|
||||
|
||||
2005-06-21 tim <gyunaev@ulduzsoft.com>
|
||||
- fixed 'View HTML source' bug.
|
||||
- fixed "Select All/Copy" popup menu bugs.
|
||||
- fixed bug with duplicated WhatsIs icon on every toolbar.
|
||||
- added several keyboard shortcuts for menu commands.
|
||||
- added extra shortcuts: Ctrl+1 opens the contents page, Ctrl+2 opens Index page,
|
||||
Ctrl+3 opens the Search page, and Ctrl+4 opens the Bookmarks page.
|
||||
- added command-line options to search in pages, in index and in bookmarks.
|
||||
|
||||
2005-06-20 Luca 'Ziabice' Gambetta <ziabice@ziabice.net>
|
||||
- fix for AMD64 platform (confirmed to work)
|
||||
|
||||
2005-06-18 tim <gyunaev@ulduzsoft.com>
|
||||
- version 0.91 RELEASE CANDIDATE 1 released.
|
||||
|
||||
2005-06-18 tim <gyunaev@ulduzsoft.com>
|
||||
- all configuration settings are now used.
|
||||
- history is saved, loaded and cleaned up correctly.
|
||||
- chm data (size/time) is now stored inside the history file, not in file name.
|
||||
|
||||
2005-06-17 tim <gyunaev@ulduzsoft.com>
|
||||
- some of configuration settings are now used.
|
||||
- new browser is now running on Qt version when external URL is opening.
|
||||
|
||||
2005-06-16 tim <gyunaev@ulduzsoft.com>
|
||||
- added the configuration dialog, configuration settings are now saved and loaded.
|
||||
|
||||
2005-06-12 tim <gyunaev@ulduzsoft.com>
|
||||
- fixed compilation on Slackware 10.
|
||||
- fixed internal links following for QTextBrowser.
|
||||
|
||||
2005-06-11 Gregorio Guidi <greg_g@gentoo.org>
|
||||
- fixed possible problem - linking static chmlib against non-static executable.
|
||||
- added --without-kde option.
|
||||
|
||||
2005-06-07 tim <gyunaev@ulduzsoft.com>
|
||||
- preparing to release version 0.9beta.
|
||||
- version 0.9beta released.
|
||||
|
||||
2005-06-07 tim <gyunaev@ulduzsoft.com>
|
||||
- added a full-featured search engine with complex query support.
|
||||
|
||||
2005-06-02 tim <gyunaev@ulduzsoft.com>
|
||||
- added copy/selectall functionality to KHTML browser, including a popup menu.
|
||||
- fixed storing scrollbar position for KHTML browser.
|
||||
- fixed window refresh on encoding change, encoding change now works for KHTML browser.
|
||||
- zoom in/out buttons also work for KHTML browser.
|
||||
|
||||
2005-06-01 tim <gyunaev@ulduzsoft.com>
|
||||
- clicking on links (in-book navigation) now works for KHTML browser.
|
||||
- full links (ms-its:) in chm files are now supported.
|
||||
|
||||
2005-05-10 tim <gyunaev@ulduzsoft.com>
|
||||
- switched to KPopupMenu for KDE.
|
||||
- fixed search/print for KHTMLPart.
|
||||
- fixed status bar in KDE window.
|
||||
- added QWhatsThis for every toolbar icon.
|
||||
- fixed command-line parsing for KDE app, remove external GetOpt class.
|
||||
- fixed build outside the work directory.
|
||||
|
||||
2005-05-04 tim <gyunaev@ulduzsoft.com>
|
||||
- KDE integration continues. Now we support printing from KHTML.
|
||||
- KIO-slave now works.
|
||||
- switched to KTabWidget for KDE.
|
||||
- fixed search/print for QTextBrowser.
|
||||
|
||||
2005-05-03 tim <gyunaev@ulduzsoft.com>
|
||||
- Reimplemented browser history in a more convinient way.
|
||||
- KDE integration continues. Now we support KHTML.
|
||||
- Added a KIO-slave to handle CHMs.
|
||||
- Now it is possible to open files with non-latin filenames.
|
||||
- Added support for CHM urls containing anchors.
|
||||
- It is possible to use QTextBrowser even for a KDE application.
|
||||
|
||||
2005-04-27 tim <gyunaev@ulduzsoft.com>
|
||||
- KDE integration started. Now we support KApplication, KMainWindow and KFileDialog.
|
||||
|
||||
2005-04-24 tim <gyunaev@ulduzsoft.com>
|
||||
- version 0.2 released.
|
||||
|
||||
2005-04-24 tim <gyunaev@ulduzsoft.com>
|
||||
- added index fields identation according to .hhk file.
|
||||
- index entries with multiple links are now supported. A dialog is opened when such a link is clicked.
|
||||
- index "see also" links are now supported.
|
||||
- added red color for index entries with multiple links, and grey color for "see also" links.
|
||||
- chmlib interface redesigned for a great code cleanup and a little speedup.
|
||||
- fixed bug when search history and bookmark list grow up every start.
|
||||
- fixed garbage at the end of some HTML pages.
|
||||
- fixed bug when search results do not open in page.
|
||||
- fixed compilation on earlier Qt version (remove qvector.h dependency).
|
||||
- fixed compilation on glibc without off_t.
|
||||
|
||||
2005-04-23 tim <gyunaev@ulduzsoft.com>
|
||||
- TOC parser rewritten, got about 30% speedup on TOC parsing. Note that TOC parser becomes stricter; please report any warnings.
|
||||
- Fixed chinese encoding TOC bugs, chinese files are now also shown correctly.
|
||||
- Added ” entity to the entities list.
|
||||
|
||||
2005-04-19 tim <gyunaev@ulduzsoft.com>
|
||||
- added support for built-in images, including custom images for folders;
|
||||
- re-merged toolbar images into the executable as PNGs (uses less space);
|
||||
- switched to autoconf/automake from qmake to simplify building and distribution, and to simplify KDEing;
|
||||
|
||||
2005-04-05 tim <gyunaev@ulduzsoft.com>
|
||||
- version 0.1alpha released
|
||||
- fixed slowdown on big files;
|
||||
|
||||
2005-04-05 tim <gyunaev@ulduzsoft.com>
|
||||
- images merged into the main executable
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
kchmviewer supports the following DCOP bindings:
|
||||
|
||||
Interface name: KCHMDCOPIface
|
||||
|
||||
Bingings:
|
||||
|
||||
// Loads a CHM file filename , and opens the URL url. Use URL "/" to open default homepage
|
||||
void loadHelpFile( String filename, String url );
|
||||
|
||||
// Opens a specific url inside the loaded CHM file
|
||||
void openPage( String url );
|
||||
|
||||
// Tries to find word in index, opening the index window and scrolling it there
|
||||
void guiFindInIndex( String word );
|
||||
|
||||
// Executes a search in GUI. query contains the complete search query.
|
||||
void guiSearchQuery( String query );
|
||||
|
||||
// Executes a search; GUI is not involved and user sees nothing.
|
||||
// query contains the complete search query.
|
||||
// Returns a list of URLs, or empty array if nothing os
|
||||
StringList searchQuery( String query );
|
@ -0,0 +1,275 @@
|
||||
# Doxyfile 1.4.1-KDevelop
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = kchmviewer.kdevelop
|
||||
PROJECT_NUMBER = 0.1
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = /home/tim/
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = /home/tim/work/kchmviewer
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.java \
|
||||
*.ii \
|
||||
*.ixx \
|
||||
*.ipp \
|
||||
*.i++ \
|
||||
*.inl \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++ \
|
||||
*.idl \
|
||||
*.odl \
|
||||
*.cs \
|
||||
*.php \
|
||||
*.php3 \
|
||||
*.inc \
|
||||
*.m \
|
||||
*.mm \
|
||||
*.dox \
|
||||
*.C \
|
||||
*.CC \
|
||||
*.C++ \
|
||||
*.II \
|
||||
*.I++ \
|
||||
*.H \
|
||||
*.HH \
|
||||
*.H++ \
|
||||
*.CS \
|
||||
*.PHP \
|
||||
*.PHP3 \
|
||||
*.M \
|
||||
*.MM \
|
||||
*.C \
|
||||
*.H \
|
||||
*.tlh \
|
||||
*.diff \
|
||||
*.patch \
|
||||
*.moc \
|
||||
*.xpm \
|
||||
*.dox
|
||||
RECURSIVE = yes
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = YES
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = yes
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = kchmviewer.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
@ -0,0 +1,7 @@
|
||||
AUTOMAKE_OPTIONS = foreign 1.6
|
||||
|
||||
SUBDIRS = lib src po
|
||||
|
||||
package-messages:
|
||||
$(MAKE) -f admin/Makefile.common package-messages
|
||||
$(MAKE) -C po merge
|
@ -0,0 +1,11 @@
|
||||
all:
|
||||
@echo "This Makefile is only for the CVS repository"
|
||||
@echo "This will be deleted before making the distribution"
|
||||
@echo ""
|
||||
$(MAKE) -f admin/Makefile.common cvs
|
||||
rm -rf autom4te.cache
|
||||
|
||||
dist:
|
||||
$(MAKE) -f admin/Makefile.common dist
|
||||
|
||||
.SILENT:
|
@ -0,0 +1,123 @@
|
||||
1. OVERVIEW
|
||||
|
||||
KchmViewer is a chm (MS HTML help file format) viewer, written in C++. Unlike most existing CHM viewers for Unix,
|
||||
it uses Trolltech Qt widget library, and does not depend on KDE or Gnome. However, it may be compiled with full
|
||||
KDE support, including KDE widgets and KIO/KHTML.
|
||||
|
||||
The main advantage of KchmViewer is extended support for non-English languages. Unlike others, KchmViewer in most
|
||||
cases correctly detects chm file encoding, correctly shows tables of context of Russian, Korean, Chinese and
|
||||
Japanese help files, and correctly searches in non-English help files (search for MBCS languages - ja/ko/ch is
|
||||
still in progress).
|
||||
|
||||
KchmViewer is written by Georgy Yunaev (gyunaev@ulduzsoft.com), and is licensed under GNU GPL license. Please
|
||||
do NOT use this email for bug reporting; see below.
|
||||
|
||||
2. FEATURES
|
||||
|
||||
- Standalone viewer, depends on Qt only. Does not require KDE, Gnome or wxWindows toolkit.
|
||||
- A KDE viewer can be compiled optionally, with KIO slave, KHTML and K*Widget support.
|
||||
- Completely safe and harmless. Does not support JavaScript in any way, optionally warns you before opening an
|
||||
external web page, or switching to another help file.
|
||||
- Correctly detects and shows encoding of any valid chm file.
|
||||
- Correctly shows non-English chm files, including cyrillic, chinese, japanese and others.
|
||||
- Correctly searches in non-English chm files using chm built-in search index.
|
||||
- Shows an appropriate image for every TOC entry.
|
||||
- Has complete chm index support, including multiple index entries, cross-links and parent/child entries in index.
|
||||
- Persistent bookmarks support. Allows to store bookmarks even if "Favorites" window was not enabled for this chm
|
||||
file. Also stores the screen position for every bookmark. You can also edit/delete bookmarks.
|
||||
- For any opened chm file, stores the last opened window, search history, bookmark history, font size and so on, so
|
||||
when you open this file again, everything is always on the place.
|
||||
- Has easy and powerful search-in-page support.
|
||||
- Allows to increase or decrease the font size, so physically handicapped people can read texts easily.
|
||||
- Has standard Back/Forward/Home navigation.
|
||||
- Can print the opened pages on a standard printer (usually via CUPS).
|
||||
- Has complex search query support. You can use search queries like "lazy people" + learn -not.
|
||||
|
||||
|
||||
3. INSTALLATION
|
||||
|
||||
Usually kchmviewer is distributed in source code archive, so you need to compile it first. It compiles with Qt 3.x,
|
||||
but recommended Qt version is 3.3.4 and above. This is due to font resizing bug existing in previous Qt versions,
|
||||
so if you use pre-3.3.4, you will have problems with font sizes. Note that you need to install qt3-devel package,
|
||||
not only qt package.
|
||||
|
||||
3.1. Qt-only version
|
||||
|
||||
To compile Qt-only version of kchmviewer, follow the simple procedure:
|
||||
|
||||
> tar zxf kchmviewer-<version>.tar.gzi
|
||||
> cd kchmviewer-<version>
|
||||
> ./configure
|
||||
> make
|
||||
> sudo make install
|
||||
|
||||
The last step is optional; you can use kchmviewer binary without installation.
|
||||
|
||||
3.2 KDE version
|
||||
|
||||
This procedure will create the Qt-only executable, which does not use KDE. If you want to compile executable
|
||||
for KDE, add --with-kde to configure options. For KDE version, 'make install' is required to work with KHTML
|
||||
browser. Note that you need kdelibs-devel package installed.
|
||||
|
||||
> tar zxf kchmviewer-<version>.tar.gz
|
||||
> cd kchmviewer-<version>
|
||||
> ./configure --with-kde
|
||||
> make
|
||||
> sudo make install
|
||||
|
||||
3.3 x86-64 version
|
||||
|
||||
To compile kchmviewer version for x86-64, make sure that you have installed 64-bit qt and qt-devel libraries,
|
||||
and specify the path to them with --with-qt-libraries= configure switch:
|
||||
|
||||
> tar zxf kchmviewer-<version>.tar.gz
|
||||
> cd kchmviewer-<version>
|
||||
> ./configure --with-qt-libraries=/usr/lib/qt3/lib64 [--with-kde (optional)]
|
||||
> make
|
||||
> sudo make install
|
||||
|
||||
If you experience any link error, make sure you have all 64bit libraries installed. Look careful on error
|
||||
messages; usually they point you to right direction.
|
||||
|
||||
|
||||
4. USAGE
|
||||
|
||||
Usage of kchmviewer is simple:
|
||||
|
||||
> kchmviewer mychmfile.chm
|
||||
|
||||
for the rest of command-line options, see kchmviewer --help
|
||||
|
||||
|
||||
5. BUG REPORTING
|
||||
|
||||
Please use kchmviewer@ulduzsoft.com for bug reporting.
|
||||
|
||||
|
||||
6. THANKS
|
||||
|
||||
Thanks to:
|
||||
- Jed Wing, the author of chmlib. This library is used by kchmviewer to access chm content.
|
||||
- Razvan Cojocaru, the author of xchm. I used some ideas and chm processing code from xchm.
|
||||
- All the users, who report bugs, and suggest features. You help making kchnviewer better.
|
||||
|
||||
|
||||
7. LICENSE
|
||||
|
||||
kchmviewer is distributed under GNU GPL license.
|
||||
Copyright (C) 2004-2007 Georgy (George) Yunaev
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,863 @@
|
||||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.9.6])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])
|
||||
AC_SUBST([$1_FALSE])
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# So let's grep whole file.
|
||||
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.58])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
||||
test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
||||
#
|
||||
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
||||
# created by `make install' are always world readable, even if the
|
||||
# installer happens to have an overly restrictive umask (e.g. 077).
|
||||
# This was a mistake. There are at least two reasons why we must not
|
||||
# use `-m 0755':
|
||||
# - it causes special bits like SGID to be ignored,
|
||||
# - it may be too restrictive (some setups expect 775 directories).
|
||||
#
|
||||
# Do not use -m 0755 and let people choose whatever they expect by
|
||||
# setting umask.
|
||||
#
|
||||
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
|
||||
# Some implementations (such as Solaris 8's) are not thread-safe: if a
|
||||
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
|
||||
# concurrently, both version can detect that a/ is missing, but only
|
||||
# one can create it and the other will error out. Consequently we
|
||||
# restrict ourselves to GNU make (using the --version option ensures
|
||||
# this.)
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
# We used to keeping the `.' as first argument, in order to
|
||||
# allow $(mkdir_p) to be used without argument. As in
|
||||
# $(mkdir_p) $(somedir)
|
||||
# where $(somedir) is conditionally defined. However this is wrong
|
||||
# for two reasons:
|
||||
# 1. if the package is installed by a user who cannot write `.'
|
||||
# make install will fail,
|
||||
# 2. the above comment should most certainly read
|
||||
# $(mkdir_p) $(DESTDIR)$(somedir)
|
||||
# so it does not work when $(somedir) is undefined and
|
||||
# $(DESTDIR) is not.
|
||||
# To support the latter case, we have to write
|
||||
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
|
||||
# so the `.' trick is pointless.
|
||||
mkdir_p='mkdir -p --'
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
for d in ./-p ./--version;
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
||||
if test -f "$ac_aux_dir/mkinstalldirs"; then
|
||||
mkdir_p='$(mkinstalldirs)'
|
||||
else
|
||||
mkdir_p='$(install_sh) -d'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([mkdir_p])])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([acinclude.m4])
|
@ -0,0 +1 @@
|
||||
/usr/share/misc/config.guess
|
@ -0,0 +1 @@
|
||||
/usr/share/misc/config.sub
|
@ -0,0 +1 @@
|
||||
configure.in.in
|
@ -0,0 +1,161 @@
|
||||
dnl =======================================================
|
||||
dnl FILE: configure.in.in
|
||||
dnl =======================================================
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl Most of this file was shamelessly stolen from Licq Qt plugin, which has similar configuration options
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
AC_CONFIG_AUX_DIR(admin)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
dnl All versioning is done via the following line
|
||||
AM_CONFIG_HEADER(src/config.h)
|
||||
AM_INIT_AUTOMAKE(kchmviewer, 3.1)
|
||||
|
||||
dnl Chuck #defines for PACKAGE and VERSION into config.h
|
||||
AC_DEFINE_UNQUOTED(APP_NAME, "$PACKAGE", [ Application name ] )
|
||||
AC_DEFINE_UNQUOTED(APP_VERSION, "$VERSION", [ Application version as text ])
|
||||
AC_DEFINE_UNQUOTED(APP_INT_VERSION,$INT_VERSION, [ Application version as integer ])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_CHECK_COMPILERS
|
||||
|
||||
dnl Check for X and extra X libs needed
|
||||
AC_PATH_XTRA
|
||||
if test "$no_x" = yes; then
|
||||
AC_MSG_ERROR(You need to have the X11 libraries and headers installed)
|
||||
fi
|
||||
|
||||
KDE_PROG_LIBTOOL
|
||||
AC_ENABLE_SHARED(yes)
|
||||
AC_ENABLE_STATIC(no)
|
||||
AC_PATH_QT
|
||||
|
||||
CHMLIBDIR="lib/chmlib"
|
||||
EXTRA_SUBDIRS=""
|
||||
|
||||
AC_ARG_WITH(kde, AC_HELP_STRING([--with-kde],[enable KDE support]))
|
||||
|
||||
if test "x$with_kde" = "xyes"; then
|
||||
KDE_SET_PREFIX
|
||||
AC_PATH_KDE
|
||||
AM_KDE_WITH_NLS
|
||||
AC_DEFINE(USE_KDE, 1, [use KDE support])
|
||||
fi
|
||||
|
||||
if test "x$with_kde" != "xyes"; then
|
||||
include_ARTS_FALSE="yes"
|
||||
AC_PREFIX_DEFAULT(${prefix:-/usr/local})
|
||||
KDE_SET_DEFAULT_PATHS([default])
|
||||
eval "$kde_cv_all_paths"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([AMC_USE_KDE], [test "x$with_kde" = "xyes"])
|
||||
|
||||
dnl Checking whether to use built-in, or system-wide chmlib
|
||||
dnl First check for --with-builtin-chmlib configure option - no more checks needed
|
||||
USE_BUILTIN_CHMLIB="0"
|
||||
AC_ARG_WITH(builtin-chmlib,
|
||||
AC_HELP_STRING([--with-builtin-chmlib],[link with built-in chmlib]),
|
||||
[ USE_BUILTIN_CHMLIB="1" ])
|
||||
|
||||
dnl Check for the libchm in system
|
||||
if test "$USE_BUILTIN_CHMLIB" = "0"; then
|
||||
AC_CHECK_LIB(chm, chm_open, [USE_BUILTIN_CHMLIB="0"], [USE_BUILTIN_CHMLIB="1"])
|
||||
fi
|
||||
|
||||
if test "$USE_BUILTIN_CHMLIB" = "1"; then
|
||||
CHM_INCLUDES="-I\$(top_srcdir)/$CHMLIBDIR"
|
||||
CHM_LIBS="\$(top_builddir)/$CHMLIBDIR/libchm.la"
|
||||
USE_LIB_CHM="internal"
|
||||
EXTRA_SUBDIRS="chmlib $EXTRA_SUBDIRS"
|
||||
AC_DEFINE(USE_BUILTIN_CHMLIB, 1, [use builtin chmlib])
|
||||
else
|
||||
CHM_LIBS="-lchm"
|
||||
USE_LIB_CHM="system"
|
||||
AC_DEFINE(USE_BUILTIN_CHMLIB, 0, [use builtin chmlib])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([AMC_BUILD_CHMLIB], [test "$USE_BUILTIN_CHMLIB" = "1"])
|
||||
|
||||
# libchmfile is built unconditionally
|
||||
LIBCHMFILE_INCLUDES="-I\$(top_srcdir)/lib/libchmfile -I\$(top_srcdir)/src"
|
||||
LIBCHMFILE_LIBS="\$(top_builddir)/lib/libchmfile/libchmfile.a"
|
||||
|
||||
AC_SUBST([EXTRA_SUBDIRS])
|
||||
AC_SUBST(CHM_INCLUDES)
|
||||
AC_SUBST(USE_KDE)
|
||||
AC_SUBST(CHM_LIBS)
|
||||
AC_SUBST(LIBCHMFILE_INCLUDES)
|
||||
AC_SUBST(LIBCHMFILE_LIBS)
|
||||
|
||||
echo ""
|
||||
echo "Please remember to use GNU make, often installed as gmake."
|
||||
echo ""
|
||||
echo "Install prefix : $prefix"
|
||||
if test "$have_kde" = yes; then
|
||||
echo "KDE support : includes in $kde_includes, libs in $kde_libraries"
|
||||
else
|
||||
echo "KDE support : disabled."
|
||||
fi
|
||||
echo "Qt includes : $QT_INCLUDES"
|
||||
echo "Qt libraries : $LIB_QT"
|
||||
echo "chmlib to link : $USE_LIB_CHM"
|
||||
KDE_CREATE_SUBDIRSLIST
|
||||
AC_CONFIG_FILES([ Makefile ])
|
||||
AC_CONFIG_FILES([ lib/Makefile ])
|
||||
AC_CONFIG_FILES([ lib/chmlib/Makefile ])
|
||||
AC_CONFIG_FILES([ lib/kio-msits/Makefile ])
|
||||
AC_CONFIG_FILES([ lib/libchmfile/Makefile ])
|
||||
AC_CONFIG_FILES([ po/Makefile ])
|
||||
AC_CONFIG_FILES([ src/Makefile ])
|
||||
AC_CONFIG_FILES([ src/kde/Makefile ])
|
||||
AC_CONFIG_FILES([ src/pics/Makefile ])
|
||||
AC_OUTPUT
|
||||
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
|
||||
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
|
||||
# And if so, warn when they don't match
|
||||
if test "$kde_libs_prefix" != "$given_prefix"; then
|
||||
# And if kde doesn't know about the prefix yet
|
||||
echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
|
||||
if test $? -ne 0; then
|
||||
echo ""
|
||||
echo "Warning: you chose to install this package in $given_prefix,"
|
||||
echo "but KDE was found in $kde_libs_prefix."
|
||||
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
|
||||
echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
|
||||
echo "Then restart KDE."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
|
||||
echo ""
|
||||
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
|
||||
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
|
||||
echo ""
|
||||
echo "For better performance, consider including the Qt visibility supporting patch"
|
||||
echo "located at:"
|
||||
echo ""
|
||||
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
|
||||
echo ""
|
||||
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
|
||||
echo "everything will continue to work just fine without it."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if test "$all_tests" = "bad"; then
|
||||
if test ! "$cache_file" = "/dev/null"; then
|
||||
echo ""
|
||||
echo "Please remove the file $cache_file after changing your setup"
|
||||
echo "so that configure will find the changes next time."
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
echo "Good - your configure finished. Start make now"
|
||||
echo ""
|
||||
fi
|
@ -0,0 +1,101 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl Most of this file was shamelessly stolen from Licq Qt plugin, which has similar configuration options
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
AC_CONFIG_AUX_DIR(admin)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
dnl All versioning is done via the following line
|
||||
AM_CONFIG_HEADER(src/config.h)
|
||||
AM_INIT_AUTOMAKE(kchmviewer, 3.1)
|
||||
|
||||
dnl Chuck #defines for PACKAGE and VERSION into config.h
|
||||
AC_DEFINE_UNQUOTED(APP_NAME, "$PACKAGE", [ Application name ] )
|
||||
AC_DEFINE_UNQUOTED(APP_VERSION, "$VERSION", [ Application version as text ])
|
||||
AC_DEFINE_UNQUOTED(APP_INT_VERSION,$INT_VERSION, [ Application version as integer ])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_CHECK_COMPILERS
|
||||
|
||||
dnl Check for X and extra X libs needed
|
||||
AC_PATH_XTRA
|
||||
if test "$no_x" = yes; then
|
||||
AC_MSG_ERROR(You need to have the X11 libraries and headers installed)
|
||||
fi
|
||||
|
||||
KDE_PROG_LIBTOOL
|
||||
AC_ENABLE_SHARED(yes)
|
||||
AC_ENABLE_STATIC(no)
|
||||
AC_PATH_QT
|
||||
|
||||
CHMLIBDIR="lib/chmlib"
|
||||
EXTRA_SUBDIRS=""
|
||||
|
||||
AC_ARG_WITH(kde, AC_HELP_STRING([--with-kde],[enable KDE support]))
|
||||
|
||||
if test "x$with_kde" = "xyes"; then
|
||||
KDE_SET_PREFIX
|
||||
AC_PATH_KDE
|
||||
AM_KDE_WITH_NLS
|
||||
AC_DEFINE(USE_KDE, 1, [use KDE support])
|
||||
fi
|
||||
|
||||
if test "x$with_kde" != "xyes"; then
|
||||
include_ARTS_FALSE="yes"
|
||||
AC_PREFIX_DEFAULT(${prefix:-/usr/local})
|
||||
KDE_SET_DEFAULT_PATHS([default])
|
||||
eval "$kde_cv_all_paths"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([AMC_USE_KDE], [test "x$with_kde" = "xyes"])
|
||||
|
||||
dnl Checking whether to use built-in, or system-wide chmlib
|
||||
dnl First check for --with-builtin-chmlib configure option - no more checks needed
|
||||
USE_BUILTIN_CHMLIB="0"
|
||||
AC_ARG_WITH(builtin-chmlib,
|
||||
AC_HELP_STRING([--with-builtin-chmlib],[link with built-in chmlib]),
|
||||
[ USE_BUILTIN_CHMLIB="1" ])
|
||||
|
||||
dnl Check for the libchm in system
|
||||
if test "$USE_BUILTIN_CHMLIB" = "0"; then
|
||||
AC_CHECK_LIB(chm, chm_open, [USE_BUILTIN_CHMLIB="0"], [USE_BUILTIN_CHMLIB="1"])
|
||||
fi
|
||||
|
||||
if test "$USE_BUILTIN_CHMLIB" = "1"; then
|
||||
CHM_INCLUDES="-I\$(top_srcdir)/$CHMLIBDIR"
|
||||
CHM_LIBS="\$(top_builddir)/$CHMLIBDIR/libchm.la"
|
||||
USE_LIB_CHM="internal"
|
||||
EXTRA_SUBDIRS="chmlib $EXTRA_SUBDIRS"
|
||||
AC_DEFINE(USE_BUILTIN_CHMLIB, 1, [use builtin chmlib])
|
||||
else
|
||||
CHM_LIBS="-lchm"
|
||||
USE_LIB_CHM="system"
|
||||
AC_DEFINE(USE_BUILTIN_CHMLIB, 0, [use builtin chmlib])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([AMC_BUILD_CHMLIB], [test "$USE_BUILTIN_CHMLIB" = "1"])
|
||||
|
||||
# libchmfile is built unconditionally
|
||||
LIBCHMFILE_INCLUDES="-I\$(top_srcdir)/lib/libchmfile -I\$(top_srcdir)/src"
|
||||
LIBCHMFILE_LIBS="\$(top_builddir)/lib/libchmfile/libchmfile.a"
|
||||
|
||||
AC_SUBST([EXTRA_SUBDIRS])
|
||||
AC_SUBST(CHM_INCLUDES)
|
||||
AC_SUBST(USE_KDE)
|
||||
AC_SUBST(CHM_LIBS)
|
||||
AC_SUBST(LIBCHMFILE_INCLUDES)
|
||||
AC_SUBST(LIBCHMFILE_LIBS)
|
||||
|
||||
echo ""
|
||||
echo "Please remember to use GNU make, often installed as gmake."
|
||||
echo ""
|
||||
echo "Install prefix : $prefix"
|
||||
if test "$have_kde" = yes; then
|
||||
echo "KDE support : includes in $kde_includes, libs in $kde_libraries"
|
||||
else
|
||||
echo "KDE support : disabled."
|
||||
fi
|
||||
echo "Qt includes : $QT_INCLUDES"
|
||||
echo "Qt libraries : $LIB_QT"
|
||||
echo "chmlib to link : $USE_LIB_CHM"
|
@ -0,0 +1,272 @@
|
||||
<?xml version = '1.0'?>
|
||||
<kdevelop>
|
||||
<general>
|
||||
<author>tim</author>
|
||||
<email>tim@krasnogorsk.ru</email>
|
||||
<version>0.1</version>
|
||||
<projectmanagement>KDevAutoProject</projectmanagement>
|
||||
<primarylanguage>C++</primarylanguage>
|
||||
<keywords>
|
||||
<keyword>C++</keyword>
|
||||
<keyword>Code</keyword>
|
||||
</keywords>
|
||||
<ignoreparts/>
|
||||
<projectdirectory>.</projectdirectory>
|
||||
<absoluteprojectpath>false</absoluteprojectpath>
|
||||
<description/>
|
||||
<versioncontrol/>
|
||||
<projectname>kchmviewer</projectname>
|
||||
<defaultencoding/>
|
||||
</general>
|
||||
<kdevautoproject>
|
||||
<general>
|
||||
<activetarget>src/kchmviewer</activetarget>
|
||||
<useconfiguration>debug</useconfiguration>
|
||||
</general>
|
||||
<run>
|
||||
<mainprogram>/home/tim/work/kchmviewer/build/src/kchmviewer</mainprogram>
|
||||
<terminal>false</terminal>
|
||||
<directoryradio>build</directoryradio>
|
||||
<runarguments>
|
||||
<kchmviewer/>
|
||||
</runarguments>
|
||||
<customdirectory>/</customdirectory>
|
||||
<programargs/>
|
||||
<autocompile>true</autocompile>
|
||||
<envvars/>
|
||||
<globaldebugarguments/>
|
||||
<globalcwd>/home/tim/work/kchmviewer/build</globalcwd>
|
||||
<useglobalprogram>false</useglobalprogram>
|
||||
<autoinstall>false</autoinstall>
|
||||
<autokdesu>false</autokdesu>
|
||||
</run>
|
||||
<configurations>
|
||||
<optimized>
|
||||
<builddir>build</builddir>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevg77options</f77compiler>
|
||||
<cxxflags>-O2 -g0</cxxflags>
|
||||
<envvars/>
|
||||
<configargs/>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cflags/>
|
||||
<f77flags/>
|
||||
</optimized>
|
||||
<debug>
|
||||
<configargs>--enable-debug=full --with-kde</configargs>
|
||||
<builddir>build</builddir>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevg77options</f77compiler>
|
||||
<cxxflags>-O0 -g3</cxxflags>
|
||||
<envvars/>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cflags>-g</cflags>
|
||||
<f77flags/>
|
||||
</debug>
|
||||
<default>
|
||||
<envvars/>
|
||||
<configargs/>
|
||||
<builddir>build</builddir>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevg77options</f77compiler>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cflags/>
|
||||
<cxxflags/>
|
||||
<f77flags/>
|
||||
</default>
|
||||
</configurations>
|
||||
<make>
|
||||
<envvars/>
|
||||
<abortonerror>true</abortonerror>
|
||||
<numberofjobs>1</numberofjobs>
|
||||
<dontact>false</dontact>
|
||||
<makebin/>
|
||||
<prio>0</prio>
|
||||
<runmultiplejobs>false</runmultiplejobs>
|
||||
</make>
|
||||
</kdevautoproject>
|
||||
<kdevdoctreeview>
|
||||
<ignoretocs>
|
||||
<toc>ada</toc>
|
||||
<toc>ada_bugs_gcc</toc>
|
||||
<toc>bash</toc>
|
||||
<toc>bash_bugs</toc>
|
||||
<toc>clanlib</toc>
|
||||
<toc>w3c-dom-level2-html</toc>
|
||||
<toc>fortran_bugs_gcc</toc>
|
||||
<toc>gnome1</toc>
|
||||
<toc>gnustep</toc>
|
||||
<toc>gtk</toc>
|
||||
<toc>gtk_bugs</toc>
|
||||
<toc>haskell</toc>
|
||||
<toc>haskell_bugs_ghc</toc>
|
||||
<toc>java_bugs_gcc</toc>
|
||||
<toc>java_bugs_sun</toc>
|
||||
<toc>kde2book</toc>
|
||||
<toc>opengl</toc>
|
||||
<toc>pascal_bugs_fp</toc>
|
||||
<toc>php</toc>
|
||||
<toc>php_bugs</toc>
|
||||
<toc>perl</toc>
|
||||
<toc>perl_bugs</toc>
|
||||
<toc>python</toc>
|
||||
<toc>python_bugs</toc>
|
||||
<toc>qt-kdev3</toc>
|
||||
<toc>ruby</toc>
|
||||
<toc>ruby_bugs</toc>
|
||||
<toc>sdl</toc>
|
||||
<toc>w3c-svg</toc>
|
||||
<toc>sw</toc>
|
||||
<toc>w3c-uaag10</toc>
|
||||
<toc>wxwidgets_bugs</toc>
|
||||
</ignoretocs>
|
||||
<ignoreqt_xml>
|
||||
<toc>Guide to the Qt Translation Tools</toc>
|
||||
<toc>Qt Assistant Manual</toc>
|
||||
<toc>Qt Designer Manual</toc>
|
||||
<toc>Qt Reference Documentation</toc>
|
||||
<toc>qmake User Guide</toc>
|
||||
</ignoreqt_xml>
|
||||
<ignoredoxygen>
|
||||
<toc>KDE Libraries (Doxygen)</toc>
|
||||
</ignoredoxygen>
|
||||
</kdevdoctreeview>
|
||||
<kdevfilecreate>
|
||||
<filetypes/>
|
||||
<useglobaltypes>
|
||||
<type ext="cpp" />
|
||||
<type ext="h" />
|
||||
</useglobaltypes>
|
||||
</kdevfilecreate>
|
||||
<kdevfileview>
|
||||
<groups>
|
||||
<group pattern="*.h" name="Header files" />
|
||||
<group pattern="*.cpp" name="Source files" />
|
||||
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||
<hidenonlocation>false</hidenonlocation>
|
||||
</groups>
|
||||
<tree>
|
||||
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
|
||||
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||
</tree>
|
||||
</kdevfileview>
|
||||
<kdevdocumentation>
|
||||
<projectdoc>
|
||||
<docsystem>Doxygen Documentation Collection</docsystem>
|
||||
<docurl>kchmviewer.tag</docurl>
|
||||
<usermanualurl/>
|
||||
</projectdoc>
|
||||
</kdevdocumentation>
|
||||
<substmap>
|
||||
<APPNAME>kchmviewer</APPNAME>
|
||||
<APPNAMELC>kchmviewer</APPNAMELC>
|
||||
<APPNAMESC>Kchmviewer</APPNAMESC>
|
||||
<APPNAMEUC>KCHMVIEWER</APPNAMEUC>
|
||||
<AUTHOR>tim</AUTHOR>
|
||||
<EMAIL>tim@krasnogorsk.ru</EMAIL>
|
||||
<LICENSE>GPL</LICENSE>
|
||||
<LICENSEFILE>COPYING</LICENSEFILE>
|
||||
<VERSION>0.1</VERSION>
|
||||
<YEAR>2005</YEAR>
|
||||
<dest>/home/tim/work/kchmviewer</dest>
|
||||
</substmap>
|
||||
<kdevcppsupport>
|
||||
<references/>
|
||||
<codecompletion>
|
||||
<includeGlobalFunctions>true</includeGlobalFunctions>
|
||||
<includeTypes>true</includeTypes>
|
||||
<includeEnums>true</includeEnums>
|
||||
<includeTypedefs>false</includeTypedefs>
|
||||
<automaticCodeCompletion>true</automaticCodeCompletion>
|
||||
<automaticArgumentsHint>true</automaticArgumentsHint>
|
||||
<automaticHeaderCompletion>true</automaticHeaderCompletion>
|
||||
<codeCompletionDelay>250</codeCompletionDelay>
|
||||
<argumentsHintDelay>400</argumentsHintDelay>
|
||||
<headerCompletionDelay>250</headerCompletionDelay>
|
||||
<showOnlyAccessibleItems>false</showOnlyAccessibleItems>
|
||||
<completionBoxItemOrder>0</completionBoxItemOrder>
|
||||
<howEvaluationContextMenu>true</howEvaluationContextMenu>
|
||||
<showCommentWithArgumentHint>true</showCommentWithArgumentHint>
|
||||
<statusBarTypeEvaluation>true</statusBarTypeEvaluation>
|
||||
<namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
|
||||
<processPrimaryTypes>true</processPrimaryTypes>
|
||||
<processFunctionArguments>false</processFunctionArguments>
|
||||
<preProcessAllHeaders>true</preProcessAllHeaders>
|
||||
<parseMissingHeaders>false</parseMissingHeaders>
|
||||
<resolveIncludePaths>true</resolveIncludePaths>
|
||||
<alwaysParseInBackground>true</alwaysParseInBackground>
|
||||
<usePermanentCaching>true</usePermanentCaching>
|
||||
<alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
|
||||
<includePaths>.;</includePaths>
|
||||
</codecompletion>
|
||||
<creategettersetter>
|
||||
<prefixGet/>
|
||||
<prefixSet>set</prefixSet>
|
||||
<prefixVariable>m_,_</prefixVariable>
|
||||
<parameterName>theValue</parameterName>
|
||||
<inlineGet>true</inlineGet>
|
||||
<inlineSet>true</inlineSet>
|
||||
</creategettersetter>
|
||||
<qt>
|
||||
<used>true</used>
|
||||
<version>3</version>
|
||||
<root>/usr/lib/qt3</root>
|
||||
<includestyle>3</includestyle>
|
||||
<designerintegration>EmbeddedKDevDesigner</designerintegration>
|
||||
<qmake>/usr/lib/qt3/bin/qmake</qmake>
|
||||
<designer>/usr/lib/qt3/bin/designer</designer>
|
||||
<designerpluginpaths/>
|
||||
</qt>
|
||||
<splitheadersource>
|
||||
<enabled>false</enabled>
|
||||
<synchronize>true</synchronize>
|
||||
<orientation>Vertical</orientation>
|
||||
</splitheadersource>
|
||||
</kdevcppsupport>
|
||||
<cppsupportpart>
|
||||
<filetemplates>
|
||||
<interfacesuffix>.h</interfacesuffix>
|
||||
<implementationsuffix>.cpp</implementationsuffix>
|
||||
</filetemplates>
|
||||
</cppsupportpart>
|
||||
<kdevdebugger>
|
||||
<general>
|
||||
<programargs/>
|
||||
<gdbpath/>
|
||||
<dbgshell/>
|
||||
<configGdbScript/>
|
||||
<runShellScript/>
|
||||
<runGdbScript/>
|
||||
<breakonloadinglibs>false</breakonloadinglibs>
|
||||
<separatetty>false</separatetty>
|
||||
<floatingtoolbar>false</floatingtoolbar>
|
||||
</general>
|
||||
<display>
|
||||
<staticmembers>false</staticmembers>
|
||||
<demanglenames>true</demanglenames>
|
||||
<outputradix>16</outputradix>
|
||||
</display>
|
||||
</kdevdebugger>
|
||||
<ctagspart>
|
||||
<customArguments/>
|
||||
<customTagfilePath/>
|
||||
</ctagspart>
|
||||
</kdevelop>
|
Binary file not shown.
@ -0,0 +1,74 @@
|
||||
<?xml version = '1.0' encoding = 'UTF-8'?>
|
||||
<!DOCTYPE KDevPrjSession>
|
||||
<KDevPrjSession>
|
||||
<DocsAndViews NumberOfDocuments="15" >
|
||||
<Doc0 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmmainwindow.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc0>
|
||||
<Doc1 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmsearchwindow.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc1>
|
||||
<Doc2 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/lib/libchmfile/libchmfile.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc2>
|
||||
<Doc3 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/lib/libchmfile/libchmfile.cpp" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc3>
|
||||
<Doc4 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/lib/libchmfile/libchmfileimpl.cpp" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc4>
|
||||
<Doc5 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmmainwindow.cpp" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc5>
|
||||
<Doc6 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmviewwindow_qtextbrowser.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc6>
|
||||
<Doc7 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmsourcefactory.cpp" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc7>
|
||||
<Doc8 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmviewwindow.cpp" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc8>
|
||||
<Doc9 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmviewwindow.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc9>
|
||||
<Doc10 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmviewwindowmgr.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc10>
|
||||
<Doc11 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/lib/kio-msits/msits.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc11>
|
||||
<Doc12 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/lib/libchmfile/lchmurlhandler.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc12>
|
||||
<Doc13 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/lib/libchmfile/libchmurlfactory.h" >
|
||||
<View0 Encoding="ISO 8859-1" Type="Source" />
|
||||
</Doc13>
|
||||
<Doc14 NumberOfViews="1" URL="file:///home/tim/work/kchmviewer/src/kchmviewwindow_qtextbrowser.cpp" >
|
||||
<View0 Encoding="ISO 8859-1" line="224" Type="Source" />
|
||||
</Doc14>
|
||||
</DocsAndViews>
|
||||
<pluginList>
|
||||
<kdevdebugger>
|
||||
<breakpointList>
|
||||
<breakpoint0 location="/home/tim/work/kchmviewer/src/kchmmainwindow.cpp:329" type="1" tracingFormatString="" traceFormatStringEnabled="0" condition="" tracingEnabled="0" enabled="1" >
|
||||
<tracedExpressions/>
|
||||
</breakpoint0>
|
||||
</breakpointList>
|
||||
<showInternalCommands value="0" />
|
||||
</kdevdebugger>
|
||||
<kdevastyle>
|
||||
<Extensions ext="*.cpp *.h,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm" />
|
||||
<AStyle IndentPreprocessors="1" FillCount="4" PadParenthesesOut="1" IndentNamespaces="0" IndentLabels="1" Fill="Tabs" MaxStatement="40" Brackets="Break" MinConditional="-1" IndentBrackets="0" PadParenthesesUn="1" BlockBreak="1" KeepStatements="1" KeepBlocks="1" BlockIfElse="0" IndentSwitches="1" PadOperators="1" FStyle="UserDefined" IndentCases="1" FillEmptyLines="0" BracketsCloseHeaders="0" BlockBreakAll="0" PadParenthesesIn="1" IndentClasses="1" IndentBlocks="0" FillForce="1" />
|
||||
</kdevastyle>
|
||||
<kdevbookmarks>
|
||||
<bookmarks/>
|
||||
</kdevbookmarks>
|
||||
<kdevvalgrind>
|
||||
<executable path="" params="" />
|
||||
<valgrind path="" params="" />
|
||||
<calltree path="" params="" />
|
||||
<kcachegrind path="" />
|
||||
</kdevvalgrind>
|
||||
</pluginList>
|
||||
</KDevPrjSession>
|
@ -0,0 +1,17 @@
|
||||
if AMC_USE_KDE
|
||||
SUBDIR_KIO = kio-msits
|
||||
endif
|
||||
|
||||
if AMC_BUILD_CHMLIB
|
||||
SUBDIR_CHMLIB = chmlib
|
||||
endif
|
||||
|
||||
SUBDIRS = $(SUBDIR_CHMLIB) $(SUBDIR_KIO) libchmfile
|
||||
DIST_SUBDIRS = chmlib kio-msits libchmfile
|
||||
|
||||
package-messages:
|
||||
$(MAKE) -f admin/Makefile.common package-messages
|
||||
$(MAKE) -C po merge
|
||||
|
||||
# Uncomment this line before opening the project in kdevelop for the first time!
|
||||
#SUBDIRS = chmlib kio-msits libchmfile
|
@ -0,0 +1,18 @@
|
||||
Jed Wing <jedwin@ugcs.caltech.edu>
|
||||
includes modified LZX code from cabextract-0.5 by Stuart Caie.
|
||||
|
||||
Thanks to:
|
||||
iDEFENSE for reporting the stack overflow vulnerability.
|
||||
Palasik Sandor for reporting and fixing the LZX buffer overrun vulnerability.
|
||||
David Huseby for enhancements to the chm_enumerate functionality.
|
||||
Vitaly Bursov for compilation fixes for x86-64.
|
||||
Vadim Zeitlin for a patch to clean up and fix some deficiencies in the
|
||||
configure script.
|
||||
Stan Tobias for bugfixes and index-page improvement to chm_http.
|
||||
Andrew Hodgetts for major portability improvement.
|
||||
Rich Erwin for his work towards Windows CE support.
|
||||
Pabs for bug fixes and suggestions.
|
||||
Antony Dovgal for setting up autoconf/automake based build process.
|
||||
Ragnar Hojland Espinosa for patches to make chm_http more useful.
|
||||
Razvan Cojocaru for forwarding along information regarding building on OS X.
|
||||
Anyone else I've forgotten.
|
@ -0,0 +1,236 @@
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script). Here is a another example:
|
||||
|
||||
/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
|
||||
configuration-related scripts to be executed by `/bin/bash'.
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
@ -0,0 +1,3 @@
|
||||
noinst_LTLIBRARIES = libchm.la
|
||||
noinst_HEADERS = chm_lib.h lzx.h
|
||||
libchm_la_SOURCES = chm_lib.c lzx.c
|
@ -0,0 +1,68 @@
|
||||
Changes from 0.37 to 0.38
|
||||
- Fix for reading some chm files. Running over a large directory of chm
|
||||
files, about 1% of them turned out to be unreadable. This resulted from
|
||||
an incomplete understanding of one of the header fields (index_root).
|
||||
Apparently, this can take negative values other than -1.
|
||||
|
||||
- Security fix for extract_chmLib. Pathnames containing a ".." element
|
||||
will not be extracted. There doesn't seem to be a legitimate reason to
|
||||
use ".." as a path element in a chm file.
|
||||
|
||||
Changes from 0.36 to 0.37
|
||||
- Major security fix for stack overflow vulnerability:
|
||||
http://www.sven-tantau.de/public_files/chmlib/chmlib_20051126.txt
|
||||
- Corrected the broken Makefile.in.
|
||||
|
||||
Changes from 0.35 to 0.36
|
||||
- Major security fix (iDEFENSE Security Advisory IDEF1099 - Stack Overflow
|
||||
Vulnerability)
|
||||
- Major security fix from Palasik Sandor (LZX decompression buffer overrun)
|
||||
- Bugfix/enhancement from David Huseby to make the "what" flags to
|
||||
chm_enumerate work correctly, and to pass the flags along to the callback
|
||||
function (via the chmUnitInfo structure) so that the callback doesn't
|
||||
need to re-parse the filename.
|
||||
- Compilation fixes for x86-64 from Vitaly V. Bursov.
|
||||
- Miscellaneous fixes to the configure script, including some significant
|
||||
cleanup by Vadim Zeitlin. The changes from Vadim should also allow the
|
||||
configure script to correctly configure the build on OS X, where it was
|
||||
previously failing to note that pread64 doesn't work.
|
||||
- Minor update to the Makefile.in to do a mkdir before the install, in case
|
||||
the specified INSTALLPREFIX directory is non-existent
|
||||
|
||||
Changes from 0.32 to 0.35
|
||||
- UTF-8 filenames, while still not handled correctly, are handled a little
|
||||
more gracefully. That is to say, the library doesn't fail to open files
|
||||
with filenames using characters outside the ASCII subset. I'm very
|
||||
interested in any information as to the "right" way to handle filenames
|
||||
of this sort.
|
||||
- Files not containing a compressed section are handled properly, such as
|
||||
.chw files. These files seem to contain information about compression,
|
||||
but the information is invalid or empty. The library deals gracefully
|
||||
with this now.
|
||||
- Files compressed with different options were not being decompressed
|
||||
properly. In particular, if the "reset interval" for the compressed
|
||||
section was other than 2 block sizes, it could fail to read some of the
|
||||
files.
|
||||
- The caching system was improved slightly, in conjunction with this
|
||||
previous bugfix.
|
||||
|
||||
Changes from 0.3 to 0.32:
|
||||
- [Rich Erwin] Minor portability fixes for Windows CE.
|
||||
- [Pabs] Minor bugfix regarding detecting directory entries versus empty files.
|
||||
- [Antony Dovgal] autoconf-based build process
|
||||
- [Ragnar Hojland Espinosa] Feature additions for chm_http:
|
||||
* Use SO_REUSEADDR
|
||||
* Allow --bind= and --port= command line arguments
|
||||
- Simple makefile has been fixed (finally) to use gcc instead of gcc-3.2. (Sorry, everybody!)
|
||||
|
||||
Changes from 0.2 to 0.3:
|
||||
|
||||
- initial attempt at portability to Win32.
|
||||
- bugfixes from Stan Tobias:
|
||||
* memory corruption error with caching system
|
||||
* case insensitivity, to match with the Windows semantics
|
||||
- modification to chm_http by Stan Tobias:
|
||||
* when the user requests the page '/', they get a page with links to
|
||||
all of the files in the archive
|
||||
- Andrew Hodgetts has ported the library to Solaris and Irix. See README for details.
|
||||
- Stuart Caie has granted permission to relicense under the LGPL.
|
@ -0,0 +1,141 @@
|
||||
CHMLIB 0.38
|
||||
===========
|
||||
|
||||
-------
|
||||
SUMMARY
|
||||
-------
|
||||
chmlib is a small library designed for accessing MS ITSS files. The ITSS file
|
||||
format is used for Microsoft Html Help files (.chm), which have been the
|
||||
predominant medium for software documentation from Microsoft during the past
|
||||
several years, having superceded the previously used .hlp file format.
|
||||
|
||||
Note that this is NOT the same as the OLE structured storage file format used
|
||||
by MS Excel, Word, and so on. Instead, it is a different file format which
|
||||
fulfills a similar purpose. Both file formats may be accessed via instances
|
||||
of the IStorage COM interface, which is essentially an "acts like a
|
||||
filesystem" interface.
|
||||
|
||||
-------
|
||||
FILE FORMAT SUPPORT
|
||||
-------
|
||||
|
||||
Lookup of files in the archive is supported, and should be relatively quick.
|
||||
Reading of files in the archive is also supported.
|
||||
Writing is not supported, but may be added in the future.
|
||||
|
||||
In terms of support for the ITSS file format, there are a few places in which
|
||||
the support provided by this library is not fully general:
|
||||
|
||||
1. ITSS files whose names contain UTF-8 characters which are not part of the
|
||||
ASCII subset will not currently be dealt with gracefully. Currently, the
|
||||
filenames are not converted from UTF-8, but are instead returned as-is. I'm
|
||||
very interested in hearing any suggestions as to the "right" way to handle
|
||||
this.
|
||||
|
||||
2. Only version 3 ITSS files are supported at present, though some work has
|
||||
gone towards divining the differences between different versions of the
|
||||
file format. It is possible that version 2 ITSS files might work properly
|
||||
with this library, but unconfirmed.
|
||||
|
||||
3. Archives larger than 4 GB should be supported just fine, but if they
|
||||
contain files larger than 4GB, this library may break. Fortunately, this
|
||||
seems somewhat unlikely.
|
||||
|
||||
If you run into .chm files (or files you suspect are ITSS files) that this
|
||||
library doesn't work with, please contact me so I can fix the library.
|
||||
|
||||
-------
|
||||
PORTABILITY
|
||||
-------
|
||||
|
||||
This software was originally developed on a Intel x86 Debian Linux machine,
|
||||
using gcc 3.0. It has since been compiled on various flavors of RedHat as
|
||||
well, and using versions of gcc from 2.95 through 3.2. Basic Win32 support
|
||||
should be in this release. (While a port to Win32 may _seem_ like a funny
|
||||
idea, given that Windows ships with libraries for CHM access, it turns out that
|
||||
Win CE does not; I've gotten a request for a port to Windows CE.)
|
||||
|
||||
Chmlib apparently works on OS X, with some tweaks. In particular, disabling
|
||||
pread and io64 apparently works.
|
||||
|
||||
Finally, Andrew Hodgetts has ported to Solaris and IRIX:
|
||||
|
||||
On Monday, 7 Oct 2002, Andrew Hodgetts wrote:
|
||||
> Solaris(Sun):
|
||||
>
|
||||
> I used both SunProC and GCC on the solaris machines to compile. They
|
||||
> both worked ok.
|
||||
> However, both required -lsocket on the link line of the Makefile or you
|
||||
> recieve linking errors.
|
||||
>
|
||||
> I have this working on CPUs ranging from Sun4m (Sparc5) through to
|
||||
> UltraSparcIII (SunFireV880).
|
||||
>
|
||||
> Irix (SGI):
|
||||
>
|
||||
> I only testing with the MIPS compiler (not GCC). All worked ok - lots of
|
||||
> warning messages, but it always does that.
|
||||
|
||||
He further noted that:
|
||||
|
||||
> ... for NON GCC compilers, a little tweaking may be required, but nothing too
|
||||
> complex. ie SunProC doesn't understand -fPIC for library building. Irix
|
||||
> required -n32 (new 32bit libraries) etc. These are things that someone who
|
||||
> uses the OS and compiler should be used to dealing with.
|
||||
|
||||
-------
|
||||
CREDITS
|
||||
-------
|
||||
|
||||
* Stuart Caie: the LZX decompression code, and for granting permission to
|
||||
re-license under the LGPL.
|
||||
|
||||
* Sven Tantau: identification of a stack-overflow security flaw and a quick fix
|
||||
for the problem; identification of a possible security danger in the example
|
||||
program "extract_chmLib"
|
||||
|
||||
* iDEFENSE Labs: identification of a nasty stack-overflow security flaw
|
||||
|
||||
* Palasik Sandor: identification of a potential security flaw in lzx.c as well
|
||||
as a quick fix for the problem
|
||||
|
||||
* David Huseby: An excellent patch to the chm_enumerate functionality, relating
|
||||
to the "what" flags, which didn't work entirely correctly before
|
||||
|
||||
* Vadim Zeitlin: Configure script cleanup, including an important update to
|
||||
allow detection of platforms where pread64 doesn't work. (OS X)
|
||||
|
||||
* Vitaly V. Bursov: Compilation on x86-64.
|
||||
|
||||
* mc: A suggestion to add a "mkdir" to the install step.
|
||||
|
||||
* Stan Tobias: bugfixes and the added 'index page' feature of chm_http.
|
||||
|
||||
* Andrew Hodgetts: porting to Solaris and IRIX, as well as fixing some
|
||||
little-endian biases in the code.
|
||||
|
||||
* Rich Erwin: Windows CE support.
|
||||
|
||||
* Pabs: bug fixes and suggestions.
|
||||
|
||||
* Antony Dovgal: setting up autoconf/automake based build process.
|
||||
|
||||
* Ragnar Hojland Espinosa: patches to make chm_http more useful.
|
||||
|
||||
* Razvan Cojocaru: forwarding along information regarding building on OS X.
|
||||
|
||||
* Julien Lemoine: creating and maintaining the Debian package of chmlib.
|
||||
|
||||
* Prarit Bhargava: Compilation on ia64
|
||||
|
||||
* Jean-Marc Vanel: elimination of compilation warnings in extract_chmLib
|
||||
|
||||
* Sisyphus & Matej Spiller-Muys: Compilation under MinGW32
|
||||
|
||||
* Kyle Davenport: helper script for using chm_http with mozilla
|
||||
|
||||
* Matthew Daniel & Mark Rosenstand: help to sort out issues with the build
|
||||
system.
|
||||
|
||||
* Anyone else I've forgotten. (?)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,144 @@
|
||||
/* $Id: chm_lib.h 148 2007-03-07 09:22:36Z gyunaev $ */
|
||||
/***************************************************************************
|
||||
* chm_lib.h - CHM archive manipulation routines *
|
||||
* ------------------- *
|
||||
* *
|
||||
* author: Jed Wing <jedwin@ugcs.caltech.edu> *
|
||||
* version: 0.3 *
|
||||
* notes: These routines are meant for the manipulation of microsoft *
|
||||
* .chm (compiled html help) files, but may likely be used *
|
||||
* for the manipulation of any ITSS archive, if ever ITSS *
|
||||
* archives are used for any other purpose. *
|
||||
* *
|
||||
* Note also that the section names are statically handled. *
|
||||
* To be entirely correct, the section names should be read *
|
||||
* from the section names meta-file, and then the various *
|
||||
* content sections and the "transforms" to apply to the data *
|
||||
* they contain should be inferred from the section name and *
|
||||
* the meta-files referenced using that name; however, all of *
|
||||
* the files I've been able to get my hands on appear to have *
|
||||
* only two sections: Uncompressed and MSCompressed. *
|
||||
* Additionally, the ITSS.DLL file included with Windows does *
|
||||
* not appear to handle any different transforms than the *
|
||||
* simple LZX-transform. Furthermore, the list of transforms *
|
||||
* to apply is broken, in that only half the required space *
|
||||
* is allocated for the list. (It appears as though the *
|
||||
* space is allocated for ASCII strings, but the strings are *
|
||||
* written as unicode. As a result, only the first half of *
|
||||
* the string appears.) So this is probably not too big of *
|
||||
* a deal, at least until CHM v4 (MS .lit files), which also *
|
||||
* incorporate encryption, of some description. *
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as *
|
||||
* published by the Free Software Foundation; either version 2.1 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDED_CHMLIB_H
|
||||
#define INCLUDED_CHMLIB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* RWE 6/12/1002 */
|
||||
#ifdef PPC_BSTR
|
||||
#include <wtypes.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef __MINGW32__
|
||||
#define __int64 long long
|
||||
#endif
|
||||
typedef unsigned __int64 LONGUINT64;
|
||||
typedef __int64 LONGINT64;
|
||||
#else
|
||||
typedef unsigned long long LONGUINT64;
|
||||
typedef long long LONGINT64;
|
||||
#endif
|
||||
|
||||
/* the two available spaces in a CHM file */
|
||||
/* N.B.: The format supports arbitrarily many spaces, but only */
|
||||
/* two appear to be used at present. */
|
||||
#define CHM_UNCOMPRESSED (0)
|
||||
#define CHM_COMPRESSED (1)
|
||||
|
||||
/* structure representing an ITS (CHM) file stream */
|
||||
struct chmFile;
|
||||
|
||||
/* structure representing an element from an ITS file stream */
|
||||
#define CHM_MAX_PATHLEN (512)
|
||||
struct chmUnitInfo
|
||||
{
|
||||
LONGUINT64 start;
|
||||
LONGUINT64 length;
|
||||
int space;
|
||||
int flags;
|
||||
char path[CHM_MAX_PATHLEN+1];
|
||||
};
|
||||
|
||||
/* open an ITS archive */
|
||||
#ifdef PPC_BSTR
|
||||
/* RWE 6/12/2003 */
|
||||
struct chmFile* chm_open(BSTR filename);
|
||||
#else
|
||||
struct chmFile* chm_open(const char *filename);
|
||||
#endif
|
||||
|
||||
/* close an ITS archive */
|
||||
void chm_close(struct chmFile *h);
|
||||
|
||||
/* methods for ssetting tuning parameters for particular file */
|
||||
#define CHM_PARAM_MAX_BLOCKS_CACHED 0
|
||||
void chm_set_param(struct chmFile *h,
|
||||
int paramType,
|
||||
int paramVal);
|
||||
|
||||
/* resolve a particular object from the archive */
|
||||
#define CHM_RESOLVE_SUCCESS (0)
|
||||
#define CHM_RESOLVE_FAILURE (1)
|
||||
int chm_resolve_object(struct chmFile *h,
|
||||
const char *objPath,
|
||||
struct chmUnitInfo *ui);
|
||||
|
||||
/* retrieve part of an object from the archive */
|
||||
LONGINT64 chm_retrieve_object(struct chmFile *h,
|
||||
const struct chmUnitInfo *ui,
|
||||
unsigned char *buf,
|
||||
LONGUINT64 addr,
|
||||
LONGINT64 len);
|
||||
|
||||
/* enumerate the objects in the .chm archive */
|
||||
typedef int (*CHM_ENUMERATOR)(struct chmFile *h,
|
||||
struct chmUnitInfo *ui,
|
||||
void *context);
|
||||
#define CHM_ENUMERATE_NORMAL (1)
|
||||
#define CHM_ENUMERATE_META (2)
|
||||
#define CHM_ENUMERATE_SPECIAL (4)
|
||||
#define CHM_ENUMERATE_FILES (8)
|
||||
#define CHM_ENUMERATE_DIRS (16)
|
||||
#define CHM_ENUMERATE_ALL (31)
|
||||
#define CHM_ENUMERATOR_FAILURE (0)
|
||||
#define CHM_ENUMERATOR_CONTINUE (1)
|
||||
#define CHM_ENUMERATOR_SUCCESS (2)
|
||||
int chm_enumerate(struct chmFile *h,
|
||||
int what,
|
||||
CHM_ENUMERATOR e,
|
||||
void *context);
|
||||
|
||||
int chm_enumerate_dir(struct chmFile *h,
|
||||
const char *prefix,
|
||||
int what,
|
||||
CHM_ENUMERATOR e,
|
||||
void *context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLUDED_CHMLIB_H */
|
@ -0,0 +1,812 @@
|
||||
/* $Id: lzx.c 148 2007-03-07 09:22:36Z gyunaev $ */
|
||||
/***************************************************************************
|
||||
* lzx.c - LZX decompression routines *
|
||||
* ------------------- *
|
||||
* *
|
||||
* maintainer: Jed Wing <jedwin@ugcs.caltech.edu> *
|
||||
* source: modified lzx.c from cabextract v0.5 *
|
||||
* notes: This file was taken from cabextract v0.5, which was, *
|
||||
* itself, a modified version of the lzx decompression code *
|
||||
* from unlzx. *
|
||||
* *
|
||||
* platforms: In its current incarnation, this file has been tested on *
|
||||
* two different Linux platforms (one, redhat-based, with a *
|
||||
* 2.1.2 glibc and gcc 2.95.x, and the other, Debian, with *
|
||||
* 2.2.4 glibc and both gcc 2.95.4 and gcc 3.0.2). Both were *
|
||||
* Intel x86 compatible machines. *
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. Note that an exemption to this *
|
||||
* license has been granted by Stuart Caie for the purposes of *
|
||||
* distribution with chmlib. This does not, to the best of my *
|
||||
* knowledge, constitute a change in the license of this (the LZX) code *
|
||||
* in general. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "lzx.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define memcpy __builtin_memcpy
|
||||
#endif
|
||||
|
||||
/* sized types */
|
||||
typedef unsigned char UBYTE; /* 8 bits exactly */
|
||||
typedef unsigned short UWORD; /* 16 bits (or more) */
|
||||
typedef unsigned int ULONG; /* 32 bits (or more) */
|
||||
typedef signed int LONG; /* 32 bits (or more) */
|
||||
|
||||
/* some constants defined by the LZX specification */
|
||||
#define LZX_MIN_MATCH (2)
|
||||
#define LZX_MAX_MATCH (257)
|
||||
#define LZX_NUM_CHARS (256)
|
||||
#define LZX_BLOCKTYPE_INVALID (0) /* also blocktypes 4-7 invalid */
|
||||
#define LZX_BLOCKTYPE_VERBATIM (1)
|
||||
#define LZX_BLOCKTYPE_ALIGNED (2)
|
||||
#define LZX_BLOCKTYPE_UNCOMPRESSED (3)
|
||||
#define LZX_PRETREE_NUM_ELEMENTS (20)
|
||||
#define LZX_ALIGNED_NUM_ELEMENTS (8) /* aligned offset tree #elements */
|
||||
#define LZX_NUM_PRIMARY_LENGTHS (7) /* this one missing from spec! */
|
||||
#define LZX_NUM_SECONDARY_LENGTHS (249) /* length tree #elements */
|
||||
|
||||
/* LZX huffman defines: tweak tablebits as desired */
|
||||
#define LZX_PRETREE_MAXSYMBOLS (LZX_PRETREE_NUM_ELEMENTS)
|
||||
#define LZX_PRETREE_TABLEBITS (6)
|
||||
#define LZX_MAINTREE_MAXSYMBOLS (LZX_NUM_CHARS + 50*8)
|
||||
#define LZX_MAINTREE_TABLEBITS (12)
|
||||
#define LZX_LENGTH_MAXSYMBOLS (LZX_NUM_SECONDARY_LENGTHS+1)
|
||||
#define LZX_LENGTH_TABLEBITS (12)
|
||||
#define LZX_ALIGNED_MAXSYMBOLS (LZX_ALIGNED_NUM_ELEMENTS)
|
||||
#define LZX_ALIGNED_TABLEBITS (7)
|
||||
|
||||
#define LZX_LENTABLE_SAFETY (64) /* we allow length table decoding overruns */
|
||||
|
||||
#define LZX_DECLARE_TABLE(tbl) \
|
||||
UWORD tbl##_table[(1<<LZX_##tbl##_TABLEBITS) + (LZX_##tbl##_MAXSYMBOLS<<1)];\
|
||||
UBYTE tbl##_len [LZX_##tbl##_MAXSYMBOLS + LZX_LENTABLE_SAFETY]
|
||||
|
||||
struct LZXstate
|
||||
{
|
||||
UBYTE *window; /* the actual decoding window */
|
||||
ULONG window_size; /* window size (32Kb through 2Mb) */
|
||||
ULONG actual_size; /* window size when it was first allocated */
|
||||
ULONG window_posn; /* current offset within the window */
|
||||
ULONG R0, R1, R2; /* for the LRU offset system */
|
||||
UWORD main_elements; /* number of main tree elements */
|
||||
int header_read; /* have we started decoding at all yet? */
|
||||
UWORD block_type; /* type of this block */
|
||||
ULONG block_length; /* uncompressed length of this block */
|
||||
ULONG block_remaining; /* uncompressed bytes still left to decode */
|
||||
ULONG frames_read; /* the number of CFDATA blocks processed */
|
||||
LONG intel_filesize; /* magic header value used for transform */
|
||||
LONG intel_curpos; /* current offset in transform space */
|
||||
int intel_started; /* have we seen any translatable data yet? */
|
||||
|
||||
LZX_DECLARE_TABLE(PRETREE);
|
||||
LZX_DECLARE_TABLE(MAINTREE);
|
||||
LZX_DECLARE_TABLE(LENGTH);
|
||||
LZX_DECLARE_TABLE(ALIGNED);
|
||||
};
|
||||
|
||||
/* LZX decruncher */
|
||||
|
||||
/* Microsoft's LZX document and their implementation of the
|
||||
* com.ms.util.cab Java package do not concur.
|
||||
*
|
||||
* In the LZX document, there is a table showing the correlation between
|
||||
* window size and the number of position slots. It states that the 1MB
|
||||
* window = 40 slots and the 2MB window = 42 slots. In the implementation,
|
||||
* 1MB = 42 slots, 2MB = 50 slots. The actual calculation is 'find the
|
||||
* first slot whose position base is equal to or more than the required
|
||||
* window size'. This would explain why other tables in the document refer
|
||||
* to 50 slots rather than 42.
|
||||
*
|
||||
* The constant NUM_PRIMARY_LENGTHS used in the decompression pseudocode
|
||||
* is not defined in the specification.
|
||||
*
|
||||
* The LZX document does not state the uncompressed block has an
|
||||
* uncompressed length field. Where does this length field come from, so
|
||||
* we can know how large the block is? The implementation has it as the 24
|
||||
* bits following after the 3 blocktype bits, before the alignment
|
||||
* padding.
|
||||
*
|
||||
* The LZX document states that aligned offset blocks have their aligned
|
||||
* offset huffman tree AFTER the main and length trees. The implementation
|
||||
* suggests that the aligned offset tree is BEFORE the main and length
|
||||
* trees.
|
||||
*
|
||||
* The LZX document decoding algorithm states that, in an aligned offset
|
||||
* block, if an extra_bits value is 1, 2 or 3, then that number of bits
|
||||
* should be read and the result added to the match offset. This is
|
||||
* correct for 1 and 2, but not 3, where just a huffman symbol (using the
|
||||
* aligned tree) should be read.
|
||||
*
|
||||
* Regarding the E8 preprocessing, the LZX document states 'No translation
|
||||
* may be performed on the last 6 bytes of the input block'. This is
|
||||
* correct. However, the pseudocode provided checks for the *E8 leader*
|
||||
* up to the last 6 bytes. If the leader appears between -10 and -7 bytes
|
||||
* from the end, this would cause the next four bytes to be modified, at
|
||||
* least one of which would be in the last 6 bytes, which is not allowed
|
||||
* according to the spec.
|
||||
*
|
||||
* The specification states that the huffman trees must always contain at
|
||||
* least one element. However, many CAB files contain blocks where the
|
||||
* length tree is completely empty (because there are no matches), and
|
||||
* this is expected to succeed.
|
||||
*/
|
||||
|
||||
|
||||
/* LZX uses what it calls 'position slots' to represent match offsets.
|
||||
* What this means is that a small 'position slot' number and a small
|
||||
* offset from that slot are encoded instead of one large offset for
|
||||
* every match.
|
||||
* - position_base is an index to the position slot bases
|
||||
* - extra_bits states how many bits of offset-from-base data is needed.
|
||||
*/
|
||||
static const UBYTE extra_bits[51] = {
|
||||
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
|
||||
7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14,
|
||||
15, 15, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
|
||||
17, 17, 17
|
||||
};
|
||||
|
||||
static const ULONG position_base[51] = {
|
||||
0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192,
|
||||
256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152,
|
||||
65536, 98304, 131072, 196608, 262144, 393216, 524288, 655360, 786432, 917504, 1048576, 1179648, 1310720, 1441792, 1572864, 1703936,
|
||||
1835008, 1966080, 2097152
|
||||
};
|
||||
|
||||
struct LZXstate *LZXinit(int window)
|
||||
{
|
||||
struct LZXstate *pState=NULL;
|
||||
ULONG wndsize = 1 << window;
|
||||
int i, posn_slots;
|
||||
|
||||
/* LZX supports window sizes of 2^15 (32Kb) through 2^21 (2Mb) */
|
||||
/* if a previously allocated window is big enough, keep it */
|
||||
if (window < 15 || window > 21) return NULL;
|
||||
|
||||
/* allocate state and associated window */
|
||||
pState = (struct LZXstate *)malloc(sizeof(struct LZXstate));
|
||||
if (!(pState->window = (UBYTE *)malloc(wndsize)))
|
||||
{
|
||||
free(pState);
|
||||
return NULL;
|
||||
}
|
||||
pState->actual_size = wndsize;
|
||||
pState->window_size = wndsize;
|
||||
|
||||
/* calculate required position slots */
|
||||
if (window == 20) posn_slots = 42;
|
||||
else if (window == 21) posn_slots = 50;
|
||||
else posn_slots = window << 1;
|
||||
|
||||
/** alternatively **/
|
||||
/* posn_slots=i=0; while (i < wndsize) i += 1 << extra_bits[posn_slots++]; */
|
||||
|
||||
/* initialize other state */
|
||||
pState->R0 = pState->R1 = pState->R2 = 1;
|
||||
pState->main_elements = LZX_NUM_CHARS + (posn_slots << 3);
|
||||
pState->header_read = 0;
|
||||
pState->frames_read = 0;
|
||||
pState->block_remaining = 0;
|
||||
pState->block_type = LZX_BLOCKTYPE_INVALID;
|
||||
pState->intel_curpos = 0;
|
||||
pState->intel_started = 0;
|
||||
pState->window_posn = 0;
|
||||
|
||||
/* initialise tables to 0 (because deltas will be applied to them) */
|
||||
for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS; i++) pState->MAINTREE_len[i] = 0;
|
||||
for (i = 0; i < LZX_LENGTH_MAXSYMBOLS; i++) pState->LENGTH_len[i] = 0;
|
||||
|
||||
return pState;
|
||||
}
|
||||
|
||||
void LZXteardown(struct LZXstate *pState)
|
||||
{
|
||||
if (pState)
|
||||
{
|
||||
if (pState->window)
|
||||
free(pState->window);
|
||||
free(pState);
|
||||
}
|
||||
}
|
||||
|
||||
int LZXreset(struct LZXstate *pState)
|
||||
{
|
||||
int i;
|
||||
|
||||
pState->R0 = pState->R1 = pState->R2 = 1;
|
||||
pState->header_read = 0;
|
||||
pState->frames_read = 0;
|
||||
pState->block_remaining = 0;
|
||||
pState->block_type = LZX_BLOCKTYPE_INVALID;
|
||||
pState->intel_curpos = 0;
|
||||
pState->intel_started = 0;
|
||||
pState->window_posn = 0;
|
||||
|
||||
for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS + LZX_LENTABLE_SAFETY; i++) pState->MAINTREE_len[i] = 0;
|
||||
for (i = 0; i < LZX_LENGTH_MAXSYMBOLS + LZX_LENTABLE_SAFETY; i++) pState->LENGTH_len[i] = 0;
|
||||
|
||||
return DECR_OK;
|
||||
}
|
||||
|
||||
|
||||
/* Bitstream reading macros:
|
||||
*
|
||||
* INIT_BITSTREAM should be used first to set up the system
|
||||
* READ_BITS(var,n) takes N bits from the buffer and puts them in var
|
||||
*
|
||||
* ENSURE_BITS(n) ensures there are at least N bits in the bit buffer
|
||||
* PEEK_BITS(n) extracts (without removing) N bits from the bit buffer
|
||||
* REMOVE_BITS(n) removes N bits from the bit buffer
|
||||
*
|
||||
* These bit access routines work by using the area beyond the MSB and the
|
||||
* LSB as a free source of zeroes. This avoids having to mask any bits.
|
||||
* So we have to know the bit width of the bitbuffer variable. This is
|
||||
* sizeof(ULONG) * 8, also defined as ULONG_BITS
|
||||
*/
|
||||
|
||||
/* number of bits in ULONG. Note: This must be at multiple of 16, and at
|
||||
* least 32 for the bitbuffer code to work (ie, it must be able to ensure
|
||||
* up to 17 bits - that's adding 16 bits when there's one bit left, or
|
||||
* adding 32 bits when there are no bits left. The code should work fine
|
||||
* for machines where ULONG >= 32 bits.
|
||||
*/
|
||||
#define ULONG_BITS (sizeof(ULONG)<<3)
|
||||
|
||||
#define INIT_BITSTREAM do { bitsleft = 0; bitbuf = 0; } while (0)
|
||||
|
||||
#define ENSURE_BITS(n) \
|
||||
while (bitsleft < (n)) { \
|
||||
bitbuf |= ((inpos[1]<<8)|inpos[0]) << (ULONG_BITS-16 - bitsleft); \
|
||||
bitsleft += 16; inpos+=2; \
|
||||
}
|
||||
|
||||
#define PEEK_BITS(n) (bitbuf >> (ULONG_BITS - (n)))
|
||||
#define REMOVE_BITS(n) ((bitbuf <<= (n)), (bitsleft -= (n)))
|
||||
|
||||
#define READ_BITS(v,n) do { \
|
||||
ENSURE_BITS(n); \
|
||||
(v) = PEEK_BITS(n); \
|
||||
REMOVE_BITS(n); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* Huffman macros */
|
||||
|
||||
#define TABLEBITS(tbl) (LZX_##tbl##_TABLEBITS)
|
||||
#define MAXSYMBOLS(tbl) (LZX_##tbl##_MAXSYMBOLS)
|
||||
#define SYMTABLE(tbl) (pState->tbl##_table)
|
||||
#define LENTABLE(tbl) (pState->tbl##_len)
|
||||
|
||||
/* BUILD_TABLE(tablename) builds a huffman lookup table from code lengths.
|
||||
* In reality, it just calls make_decode_table() with the appropriate
|
||||
* values - they're all fixed by some #defines anyway, so there's no point
|
||||
* writing each call out in full by hand.
|
||||
*/
|
||||
#define BUILD_TABLE(tbl) \
|
||||
if (make_decode_table( \
|
||||
MAXSYMBOLS(tbl), TABLEBITS(tbl), LENTABLE(tbl), SYMTABLE(tbl) \
|
||||
)) { return DECR_ILLEGALDATA; }
|
||||
|
||||
|
||||
/* READ_HUFFSYM(tablename, var) decodes one huffman symbol from the
|
||||
* bitstream using the stated table and puts it in var.
|
||||
*/
|
||||
#define READ_HUFFSYM(tbl,var) do { \
|
||||
ENSURE_BITS(16); \
|
||||
hufftbl = SYMTABLE(tbl); \
|
||||
if ((i = hufftbl[PEEK_BITS(TABLEBITS(tbl))]) >= MAXSYMBOLS(tbl)) { \
|
||||
j = 1 << (ULONG_BITS - TABLEBITS(tbl)); \
|
||||
do { \
|
||||
j >>= 1; i <<= 1; i |= (bitbuf & j) ? 1 : 0; \
|
||||
if (!j) { return DECR_ILLEGALDATA; } \
|
||||
} while ((i = hufftbl[i]) >= MAXSYMBOLS(tbl)); \
|
||||
} \
|
||||
j = LENTABLE(tbl)[(var) = i]; \
|
||||
REMOVE_BITS(j); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* READ_LENGTHS(tablename, first, last) reads in code lengths for symbols
|
||||
* first to last in the given table. The code lengths are stored in their
|
||||
* own special LZX way.
|
||||
*/
|
||||
#define READ_LENGTHS(tbl,first,last) do { \
|
||||
lb.bb = bitbuf; lb.bl = bitsleft; lb.ip = inpos; \
|
||||
if (lzx_read_lens(pState, LENTABLE(tbl),(first),(last),&lb)) { \
|
||||
return DECR_ILLEGALDATA; \
|
||||
} \
|
||||
bitbuf = lb.bb; bitsleft = lb.bl; inpos = lb.ip; \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* make_decode_table(nsyms, nbits, length[], table[])
|
||||
*
|
||||
* This function was coded by David Tritscher. It builds a fast huffman
|
||||
* decoding table out of just a canonical huffman code lengths table.
|
||||
*
|
||||
* nsyms = total number of symbols in this huffman tree.
|
||||
* nbits = any symbols with a code length of nbits or less can be decoded
|
||||
* in one lookup of the table.
|
||||
* length = A table to get code lengths from [0 to syms-1]
|
||||
* table = The table to fill up with decoded symbols and pointers.
|
||||
*
|
||||
* Returns 0 for OK or 1 for error
|
||||
*/
|
||||
|
||||
static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) {
|
||||
register UWORD sym;
|
||||
register ULONG leaf;
|
||||
register UBYTE bit_num = 1;
|
||||
ULONG fill;
|
||||
ULONG pos = 0; /* the current position in the decode table */
|
||||
ULONG table_mask = 1 << nbits;
|
||||
ULONG bit_mask = table_mask >> 1; /* don't do 0 length codes */
|
||||
ULONG next_symbol = bit_mask; /* base of allocation for long codes */
|
||||
|
||||
/* fill entries for codes short enough for a direct mapping */
|
||||
while (bit_num <= nbits) {
|
||||
for (sym = 0; sym < nsyms; sym++) {
|
||||
if (length[sym] == bit_num) {
|
||||
leaf = pos;
|
||||
|
||||
if((pos += bit_mask) > table_mask) return 1; /* table overrun */
|
||||
|
||||
/* fill all possible lookups of this symbol with the symbol itself */
|
||||
fill = bit_mask;
|
||||
while (fill-- > 0) table[leaf++] = sym;
|
||||
}
|
||||
}
|
||||
bit_mask >>= 1;
|
||||
bit_num++;
|
||||
}
|
||||
|
||||
/* if there are any codes longer than nbits */
|
||||
if (pos != table_mask) {
|
||||
/* clear the remainder of the table */
|
||||
for (sym = pos; sym < table_mask; sym++) table[sym] = 0;
|
||||
|
||||
/* give ourselves room for codes to grow by up to 16 more bits */
|
||||
pos <<= 16;
|
||||
table_mask <<= 16;
|
||||
bit_mask = 1 << 15;
|
||||
|
||||
while (bit_num <= 16) {
|
||||
for (sym = 0; sym < nsyms; sym++) {
|
||||
if (length[sym] == bit_num) {
|
||||
leaf = pos >> 16;
|
||||
for (fill = 0; fill < bit_num - nbits; fill++) {
|
||||
/* if this path hasn't been taken yet, 'allocate' two entries */
|
||||
if (table[leaf] == 0) {
|
||||
table[(next_symbol << 1)] = 0;
|
||||
table[(next_symbol << 1) + 1] = 0;
|
||||
table[leaf] = next_symbol++;
|
||||
}
|
||||
/* follow the path and select either left or right for next bit */
|
||||
leaf = table[leaf] << 1;
|
||||
if ((pos >> (15-fill)) & 1) leaf++;
|
||||
}
|
||||
table[leaf] = sym;
|
||||
|
||||
if ((pos += bit_mask) > table_mask) return 1; /* table overflow */
|
||||
}
|
||||
}
|
||||
bit_mask >>= 1;
|
||||
bit_num++;
|
||||
}
|
||||
}
|
||||
|
||||
/* full table? */
|
||||
if (pos == table_mask) return 0;
|
||||
|
||||
/* either erroneous table, or all elements are 0 - let's find out. */
|
||||
for (sym = 0; sym < nsyms; sym++) if (length[sym]) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct lzx_bits {
|
||||
ULONG bb;
|
||||
int bl;
|
||||
UBYTE *ip;
|
||||
};
|
||||
|
||||
static int lzx_read_lens(struct LZXstate *pState, UBYTE *lens, ULONG first, ULONG last, struct lzx_bits *lb) {
|
||||
ULONG i,j, x,y;
|
||||
int z;
|
||||
|
||||
register ULONG bitbuf = lb->bb;
|
||||
register int bitsleft = lb->bl;
|
||||
UBYTE *inpos = lb->ip;
|
||||
UWORD *hufftbl;
|
||||
|
||||
for (x = 0; x < 20; x++) {
|
||||
READ_BITS(y, 4);
|
||||
LENTABLE(PRETREE)[x] = y;
|
||||
}
|
||||
BUILD_TABLE(PRETREE);
|
||||
|
||||
for (x = first; x < last; ) {
|
||||
READ_HUFFSYM(PRETREE, z);
|
||||
if (z == 17) {
|
||||
READ_BITS(y, 4); y += 4;
|
||||
while (y--) lens[x++] = 0;
|
||||
}
|
||||
else if (z == 18) {
|
||||
READ_BITS(y, 5); y += 20;
|
||||
while (y--) lens[x++] = 0;
|
||||
}
|
||||
else if (z == 19) {
|
||||
READ_BITS(y, 1); y += 4;
|
||||
READ_HUFFSYM(PRETREE, z);
|
||||
z = lens[x] - z; if (z < 0) z += 17;
|
||||
while (y--) lens[x++] = z;
|
||||
}
|
||||
else {
|
||||
z = lens[x] - z; if (z < 0) z += 17;
|
||||
lens[x++] = z;
|
||||
}
|
||||
}
|
||||
|
||||
lb->bb = bitbuf;
|
||||
lb->bl = bitsleft;
|
||||
lb->ip = inpos;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LZXdecompress(struct LZXstate *pState, unsigned char *inpos, unsigned char *outpos, int inlen, int outlen) {
|
||||
UBYTE *endinp = inpos + inlen;
|
||||
UBYTE *window = pState->window;
|
||||
UBYTE *runsrc, *rundest;
|
||||
UWORD *hufftbl; /* used in READ_HUFFSYM macro as chosen decoding table */
|
||||
|
||||
ULONG window_posn = pState->window_posn;
|
||||
ULONG window_size = pState->window_size;
|
||||
ULONG R0 = pState->R0;
|
||||
ULONG R1 = pState->R1;
|
||||
ULONG R2 = pState->R2;
|
||||
|
||||
register ULONG bitbuf;
|
||||
register int bitsleft;
|
||||
ULONG match_offset, i,j,k; /* ijk used in READ_HUFFSYM macro */
|
||||
struct lzx_bits lb; /* used in READ_LENGTHS macro */
|
||||
|
||||
int togo = outlen, this_run, main_element, aligned_bits;
|
||||
int match_length, length_footer, extra, verbatim_bits;
|
||||
|
||||
INIT_BITSTREAM;
|
||||
|
||||
/* read header if necessary */
|
||||
if (!pState->header_read) {
|
||||
i = j = 0;
|
||||
READ_BITS(k, 1); if (k) { READ_BITS(i,16); READ_BITS(j,16); }
|
||||
pState->intel_filesize = (i << 16) | j; /* or 0 if not encoded */
|
||||
pState->header_read = 1;
|
||||
}
|
||||
|
||||
/* main decoding loop */
|
||||
while (togo > 0) {
|
||||
/* last block finished, new block expected */
|
||||
if (pState->block_remaining == 0) {
|
||||
if (pState->block_type == LZX_BLOCKTYPE_UNCOMPRESSED) {
|
||||
if (pState->block_length & 1) inpos++; /* realign bitstream to word */
|
||||
INIT_BITSTREAM;
|
||||
}
|
||||
|
||||
READ_BITS(pState->block_type, 3);
|
||||
READ_BITS(i, 16);
|
||||
READ_BITS(j, 8);
|
||||
pState->block_remaining = pState->block_length = (i << 8) | j;
|
||||
|
||||
switch (pState->block_type) {
|
||||
case LZX_BLOCKTYPE_ALIGNED:
|
||||
for (i = 0; i < 8; i++) { READ_BITS(j, 3); LENTABLE(ALIGNED)[i] = j; }
|
||||
BUILD_TABLE(ALIGNED);
|
||||
/* rest of aligned header is same as verbatim */
|
||||
|
||||
case LZX_BLOCKTYPE_VERBATIM:
|
||||
READ_LENGTHS(MAINTREE, 0, 256);
|
||||
READ_LENGTHS(MAINTREE, 256, pState->main_elements);
|
||||
BUILD_TABLE(MAINTREE);
|
||||
if (LENTABLE(MAINTREE)[0xE8] != 0) pState->intel_started = 1;
|
||||
|
||||
READ_LENGTHS(LENGTH, 0, LZX_NUM_SECONDARY_LENGTHS);
|
||||
BUILD_TABLE(LENGTH);
|
||||
break;
|
||||
|
||||
case LZX_BLOCKTYPE_UNCOMPRESSED:
|
||||
pState->intel_started = 1; /* because we can't assume otherwise */
|
||||
ENSURE_BITS(16); /* get up to 16 pad bits into the buffer */
|
||||
if (bitsleft > 16) inpos -= 2; /* and align the bitstream! */
|
||||
R0 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;
|
||||
R1 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;
|
||||
R2 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;
|
||||
break;
|
||||
|
||||
default:
|
||||
return DECR_ILLEGALDATA;
|
||||
}
|
||||
}
|
||||
|
||||
/* buffer exhaustion check */
|
||||
if (inpos > endinp) {
|
||||
/* it's possible to have a file where the next run is less than
|
||||
* 16 bits in size. In this case, the READ_HUFFSYM() macro used
|
||||
* in building the tables will exhaust the buffer, so we should
|
||||
* allow for this, but not allow those accidentally read bits to
|
||||
* be used (so we check that there are at least 16 bits
|
||||
* remaining - in this boundary case they aren't really part of
|
||||
* the compressed data)
|
||||
*/
|
||||
if (inpos > (endinp+2) || bitsleft < 16) return DECR_ILLEGALDATA;
|
||||
}
|
||||
|
||||
while ((this_run = pState->block_remaining) > 0 && togo > 0) {
|
||||
if (this_run > togo) this_run = togo;
|
||||
togo -= this_run;
|
||||
pState->block_remaining -= this_run;
|
||||
|
||||
/* apply 2^x-1 mask */
|
||||
window_posn &= window_size - 1;
|
||||
/* runs can't straddle the window wraparound */
|
||||
if ((window_posn + this_run) > window_size)
|
||||
return DECR_DATAFORMAT;
|
||||
|
||||
switch (pState->block_type) {
|
||||
|
||||
case LZX_BLOCKTYPE_VERBATIM:
|
||||
while (this_run > 0) {
|
||||
READ_HUFFSYM(MAINTREE, main_element);
|
||||
|
||||
if (main_element < LZX_NUM_CHARS) {
|
||||
/* literal: 0 to LZX_NUM_CHARS-1 */
|
||||
window[window_posn++] = main_element;
|
||||
this_run--;
|
||||
}
|
||||
else {
|
||||
/* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */
|
||||
main_element -= LZX_NUM_CHARS;
|
||||
|
||||
match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;
|
||||
if (match_length == LZX_NUM_PRIMARY_LENGTHS) {
|
||||
READ_HUFFSYM(LENGTH, length_footer);
|
||||
match_length += length_footer;
|
||||
}
|
||||
match_length += LZX_MIN_MATCH;
|
||||
|
||||
match_offset = main_element >> 3;
|
||||
|
||||
if (match_offset > 2) {
|
||||
/* not repeated offset */
|
||||
if (match_offset != 3) {
|
||||
extra = extra_bits[match_offset];
|
||||
READ_BITS(verbatim_bits, extra);
|
||||
match_offset = position_base[match_offset] - 2 + verbatim_bits;
|
||||
}
|
||||
else {
|
||||
match_offset = 1;
|
||||
}
|
||||
|
||||
/* update repeated offset LRU queue */
|
||||
R2 = R1; R1 = R0; R0 = match_offset;
|
||||
}
|
||||
else if (match_offset == 0) {
|
||||
match_offset = R0;
|
||||
}
|
||||
else if (match_offset == 1) {
|
||||
match_offset = R1;
|
||||
R1 = R0; R0 = match_offset;
|
||||
}
|
||||
else /* match_offset == 2 */ {
|
||||
match_offset = R2;
|
||||
R2 = R0; R0 = match_offset;
|
||||
}
|
||||
|
||||
rundest = window + window_posn;
|
||||
runsrc = rundest - match_offset;
|
||||
window_posn += match_length;
|
||||
if (window_posn > window_size) return DECR_ILLEGALDATA;
|
||||
this_run -= match_length;
|
||||
|
||||
/* copy any wrapped around source data */
|
||||
while ((runsrc < window) && (match_length-- > 0)) {
|
||||
*rundest++ = *(runsrc + window_size); runsrc++;
|
||||
}
|
||||
/* copy match data - no worries about destination wraps */
|
||||
while (match_length-- > 0) *rundest++ = *runsrc++;
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LZX_BLOCKTYPE_ALIGNED:
|
||||
while (this_run > 0) {
|
||||
READ_HUFFSYM(MAINTREE, main_element);
|
||||
|
||||
if (main_element < LZX_NUM_CHARS) {
|
||||
/* literal: 0 to LZX_NUM_CHARS-1 */
|
||||
window[window_posn++] = main_element;
|
||||
this_run--;
|
||||
}
|
||||
else {
|
||||
/* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */
|
||||
main_element -= LZX_NUM_CHARS;
|
||||
|
||||
match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;
|
||||
if (match_length == LZX_NUM_PRIMARY_LENGTHS) {
|
||||
READ_HUFFSYM(LENGTH, length_footer);
|
||||
match_length += length_footer;
|
||||
}
|
||||
match_length += LZX_MIN_MATCH;
|
||||
|
||||
match_offset = main_element >> 3;
|
||||
|
||||
if (match_offset > 2) {
|
||||
/* not repeated offset */
|
||||
extra = extra_bits[match_offset];
|
||||
match_offset = position_base[match_offset] - 2;
|
||||
if (extra > 3) {
|
||||
/* verbatim and aligned bits */
|
||||
extra -= 3;
|
||||
READ_BITS(verbatim_bits, extra);
|
||||
match_offset += (verbatim_bits << 3);
|
||||
READ_HUFFSYM(ALIGNED, aligned_bits);
|
||||
match_offset += aligned_bits;
|
||||
}
|
||||
else if (extra == 3) {
|
||||
/* aligned bits only */
|
||||
READ_HUFFSYM(ALIGNED, aligned_bits);
|
||||
match_offset += aligned_bits;
|
||||
}
|
||||
else if (extra > 0) { /* extra==1, extra==2 */
|
||||
/* verbatim bits only */
|
||||
READ_BITS(verbatim_bits, extra);
|
||||
match_offset += verbatim_bits;
|
||||
}
|
||||
else /* extra == 0 */ {
|
||||
/* ??? */
|
||||
match_offset = 1;
|
||||
}
|
||||
|
||||
/* update repeated offset LRU queue */
|
||||
R2 = R1; R1 = R0; R0 = match_offset;
|
||||
}
|
||||
else if (match_offset == 0) {
|
||||
match_offset = R0;
|
||||
}
|
||||
else if (match_offset == 1) {
|
||||
match_offset = R1;
|
||||
R1 = R0; R0 = match_offset;
|
||||
}
|
||||
else /* match_offset == 2 */ {
|
||||
match_offset = R2;
|
||||
R2 = R0; R0 = match_offset;
|
||||
}
|
||||
|
||||
rundest = window + window_posn;
|
||||
runsrc = rundest - match_offset;
|
||||
window_posn += match_length;
|
||||
if (window_posn > window_size) return DECR_ILLEGALDATA;
|
||||
this_run -= match_length;
|
||||
|
||||
/* copy any wrapped around source data */
|
||||
while ((runsrc < window) && (match_length-- > 0)) {
|
||||
*rundest++ = *(runsrc + window_size); runsrc++;
|
||||
}
|
||||
/* copy match data - no worries about destination wraps */
|
||||
while (match_length-- > 0) *rundest++ = *runsrc++;
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LZX_BLOCKTYPE_UNCOMPRESSED:
|
||||
if ((inpos + this_run) > endinp) return DECR_ILLEGALDATA;
|
||||
memcpy(window + window_posn, inpos, (size_t) this_run);
|
||||
inpos += this_run; window_posn += this_run;
|
||||
break;
|
||||
|
||||
default:
|
||||
return DECR_ILLEGALDATA; /* might as well */
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (togo != 0) return DECR_ILLEGALDATA;
|
||||
memcpy(outpos, window + ((!window_posn) ? window_size : window_posn) - outlen, (size_t) outlen);
|
||||
|
||||
pState->window_posn = window_posn;
|
||||
pState->R0 = R0;
|
||||
pState->R1 = R1;
|
||||
pState->R2 = R2;
|
||||
|
||||
/* intel E8 decoding */
|
||||
if ((pState->frames_read++ < 32768) && pState->intel_filesize != 0) {
|
||||
if (outlen <= 6 || !pState->intel_started) {
|
||||
pState->intel_curpos += outlen;
|
||||
}
|
||||
else {
|
||||
UBYTE *data = outpos;
|
||||
UBYTE *dataend = data + outlen - 10;
|
||||
LONG curpos = pState->intel_curpos;
|
||||
LONG filesize = pState->intel_filesize;
|
||||
LONG abs_off, rel_off;
|
||||
|
||||
pState->intel_curpos = curpos + outlen;
|
||||
|
||||
while (data < dataend) {
|
||||
if (*data++ != 0xE8) { curpos++; continue; }
|
||||
abs_off = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24);
|
||||
if ((abs_off >= -curpos) && (abs_off < filesize)) {
|
||||
rel_off = (abs_off >= 0) ? abs_off - curpos : abs_off + filesize;
|
||||
data[0] = (UBYTE) rel_off;
|
||||
data[1] = (UBYTE) (rel_off >> 8);
|
||||
data[2] = (UBYTE) (rel_off >> 16);
|
||||
data[3] = (UBYTE) (rel_off >> 24);
|
||||
}
|
||||
data += 4;
|
||||
curpos += 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return DECR_OK;
|
||||
}
|
||||
|
||||
#ifdef LZX_CHM_TESTDRIVER
|
||||
int main(int c, char **v)
|
||||
{
|
||||
FILE *fin, *fout;
|
||||
struct LZXstate state;
|
||||
UBYTE ibuf[16384];
|
||||
UBYTE obuf[32768];
|
||||
int ilen, olen;
|
||||
int status;
|
||||
int i;
|
||||
int count=0;
|
||||
int w = atoi(v[1]);
|
||||
LZXinit(&state, w);
|
||||
fout = fopen(v[2], "wb");
|
||||
for (i=3; i<c; i++)
|
||||
{
|
||||
fin = fopen(v[i], "rb");
|
||||
ilen = fread(ibuf, 1, 16384, fin);
|
||||
status = LZXdecompress(&state, ibuf, obuf, ilen, 32768);
|
||||
switch (status)
|
||||
{
|
||||
case DECR_OK:
|
||||
printf("ok\n");
|
||||
fwrite(obuf, 1, 32768, fout);
|
||||
break;
|
||||
case DECR_DATAFORMAT:
|
||||
printf("bad format\n");
|
||||
break;
|
||||
case DECR_ILLEGALDATA:
|
||||
printf("illegal data\n");
|
||||
break;
|
||||
case DECR_NOMEMORY:
|
||||
printf("no memory\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
fclose(fin);
|
||||
if (++count == 2)
|
||||
{
|
||||
count = 0;
|
||||
LZXreset(&state);
|
||||
}
|
||||
}
|
||||
fclose(fout);
|
||||
}
|
||||
#endif
|
@ -0,0 +1,62 @@
|
||||
/* $Id: lzx.h 148 2007-03-07 09:22:36Z gyunaev $ */
|
||||
/***************************************************************************
|
||||
* lzx.h - LZX decompression routines *
|
||||
* ------------------- *
|
||||
* *
|
||||
* maintainer: Jed Wing <jedwin@ugcs.caltech.edu> *
|
||||
* source: modified lzx.c from cabextract v0.5 *
|
||||
* notes: This file was taken from cabextract v0.5, which was, *
|
||||
* itself, a modified version of the lzx decompression code *
|
||||
* from unlzx. *
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. Note that an exemption to this *
|
||||
* license has been granted by Stuart Caie for the purposes of *
|
||||
* distribution with chmlib. This does not, to the best of my *
|
||||
* knowledge, constitute a change in the license of this (the LZX) code *
|
||||
* in general. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDED_LZX_H
|
||||
#define INCLUDED_LZX_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* return codes */
|
||||
#define DECR_OK (0)
|
||||
#define DECR_DATAFORMAT (1)
|
||||
#define DECR_ILLEGALDATA (2)
|
||||
#define DECR_NOMEMORY (3)
|
||||
|
||||
/* opaque state structure */
|
||||
struct LZXstate;
|
||||
|
||||
/* create an lzx state object */
|
||||
struct LZXstate *LZXinit(int window);
|
||||
|
||||
/* destroy an lzx state object */
|
||||
void LZXteardown(struct LZXstate *pState);
|
||||
|
||||
/* reset an lzx stream */
|
||||
int LZXreset(struct LZXstate *pState);
|
||||
|
||||
/* decompress an LZX compressed block */
|
||||
int LZXdecompress(struct LZXstate *pState,
|
||||
unsigned char *inpos,
|
||||
unsigned char *outpos,
|
||||
int inlen,
|
||||
int outlen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLUDED_LZX_H */
|
@ -0,0 +1,14 @@
|
||||
METASOURCES = AUTO
|
||||
INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES) $(LIBCHMFILE_INCLUDES)
|
||||
|
||||
kde_module_LTLIBRARIES = kio_msits.la
|
||||
|
||||
kio_msits_la_SOURCES = msits.cpp
|
||||
kio_msits_la_LIBADD = -lkio $(CHM_LIBS)
|
||||
kio_msits_la_LDFLAGS = -module -avoid-version $(QT_LIBS) $(KDE_LDFLAGS) $(KDE_LIBS) $(KDE_PLUGIN)
|
||||
|
||||
protocol_DATA = msits.protocol
|
||||
protocoldir = $(kde_servicesdir)
|
||||
|
||||
# Put it here to avoid creating another directory
|
||||
kde_apps_DATA = kchmviewer.desktop
|
@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Categories=Qt;KDE;Utility;
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Exec=kchmviewer %U
|
||||
Icon=kchmviewer.png
|
||||
Comment=
|
||||
Terminal=0
|
||||
Name=KchmViewer
|
||||
Comment=A viewer of CHM (MS-Help) files
|
||||
MimeType=application/chm
|
@ -0,0 +1,320 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kdebug.h>
|
||||
#include <kinstance.h>
|
||||
#include <kurl.h>
|
||||
#include <kmimemagic.h>
|
||||
|
||||
#include <qfile.h>
|
||||
#include <qbitarray.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#include "msits.h"
|
||||
#include "libchmurlfactory.h"
|
||||
|
||||
using namespace KIO;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int kdemain( int argc, char **argv )
|
||||
{
|
||||
kdDebug() << "*** kio_msits Init" << endl;
|
||||
|
||||
KInstance instance( "kio_msits" );
|
||||
|
||||
if ( argc != 4 )
|
||||
{
|
||||
kdDebug() << "Usage: kio_msits protocol domain-socket1 domain-socket2" << endl;
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
ProtocolMSITS slave ( argv[2], argv[3] );
|
||||
slave.dispatchLoop();
|
||||
|
||||
kdDebug() << "*** kio_msits Done" << endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ProtocolMSITS::ProtocolMSITS (const QCString &pool_socket, const QCString &app_socket)
|
||||
: SlaveBase ("kio_msits", pool_socket, app_socket)
|
||||
{
|
||||
m_chmFile = 0;
|
||||
}
|
||||
|
||||
ProtocolMSITS::~ProtocolMSITS()
|
||||
{
|
||||
if ( !m_chmFile )
|
||||
return;
|
||||
|
||||
chm_close (m_chmFile);
|
||||
m_chmFile = 0;
|
||||
}
|
||||
|
||||
// A simple stat() wrapper
|
||||
static bool isDirectory ( const QString & filename )
|
||||
{
|
||||
return filename[filename.length() - 1] == '/';
|
||||
}
|
||||
|
||||
|
||||
void ProtocolMSITS::get( const KURL& url )
|
||||
{
|
||||
QString htmdata, fileName;
|
||||
chmUnitInfo ui;
|
||||
QByteArray buf;
|
||||
|
||||
kdDebug() << "kio_msits::get() " << url.path() << endl;
|
||||
|
||||
if ( !parseLoadAndLookup ( url, fileName ) )
|
||||
return; // error() has been called by parseLoadAndLookup
|
||||
|
||||
kdDebug() << "kio_msits::get: parseLoadAndLookup returned " << fileName << endl;
|
||||
|
||||
if ( LCHMUrlFactory::handleFileType( url.path(), htmdata ) )
|
||||
{
|
||||
buf = htmdata.utf8();
|
||||
kdDebug() << "Using special handling for image pages: " << htmdata << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDirectory (fileName) )
|
||||
{
|
||||
error( KIO::ERR_IS_DIRECTORY, url.prettyURL() );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !ResolveObject ( fileName, &ui) )
|
||||
{
|
||||
kdDebug() << "kio_msits::get: could not resolve filename " << fileName << endl;
|
||||
error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
|
||||
return;
|
||||
}
|
||||
|
||||
buf.resize( ui.length );
|
||||
|
||||
if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 )
|
||||
{
|
||||
kdDebug() << "kio_msits::get: could not retrieve filename " << fileName << endl;
|
||||
error( KIO::ERR_NO_CONTENT, url.prettyURL() );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
totalSize( buf.size() );
|
||||
KMimeMagicResult * result = KMimeMagic::self()->findBufferFileType( buf, fileName );
|
||||
kdDebug() << "Emitting mimetype " << result->mimeType() << endl;
|
||||
|
||||
mimeType( result->mimeType() );
|
||||
data( buf );
|
||||
processedSize( buf.size() );
|
||||
|
||||
finished();
|
||||
}
|
||||
|
||||
|
||||
bool ProtocolMSITS::parseLoadAndLookup ( const KURL& url, QString& abspath )
|
||||
{
|
||||
kdDebug() << "ProtocolMSITS::parseLoadAndLookup (const KURL&) " << url.path() << endl;
|
||||
|
||||
int pos = url.path().find ("::");
|
||||
|
||||
if ( pos == -1 )
|
||||
{
|
||||
error( KIO::ERR_MALFORMED_URL, url.prettyURL() );
|
||||
return false;
|
||||
}
|
||||
|
||||
QString filename = url.path().left (pos);
|
||||
abspath = url.path().mid (pos + 2); // skip ::
|
||||
|
||||
// Some buggy apps add ms-its:/ to the path as well
|
||||
if ( abspath.startsWith( "ms-its:" ) )
|
||||
abspath = abspath.mid( 7 );
|
||||
|
||||
kdDebug() << "ProtocolMSITS::parseLoadAndLookup: filename " << filename << ", path " << abspath << endl;
|
||||
|
||||
if ( filename.isEmpty() )
|
||||
{
|
||||
error( KIO::ERR_MALFORMED_URL, url.prettyURL() );
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the file has been already loaded, nothing to do.
|
||||
if ( m_chmFile && filename == m_openedFile )
|
||||
return true;
|
||||
|
||||
kdDebug() << "Opening a new CHM file " << filename << endl;
|
||||
|
||||
// First try to open a temporary file
|
||||
chmFile * tmpchm;
|
||||
|
||||
if ( (tmpchm = chm_open ( QFile::encodeName (filename))) == 0 )
|
||||
{
|
||||
error( KIO::ERR_COULD_NOT_READ, url.prettyURL() );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Replace an existing file by a new one
|
||||
if ( m_chmFile )
|
||||
chm_close (m_chmFile);
|
||||
|
||||
m_chmFile = tmpchm;
|
||||
m_openedFile = filename;
|
||||
|
||||
kdDebug() << "A CHM file " << filename << " has beed opened successfully" << endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Shamelessly stolen from a KDE KIO tutorial
|
||||
*/
|
||||
static void app_entry(UDSEntry& e, unsigned int uds, const QString& str)
|
||||
{
|
||||
UDSAtom a;
|
||||
a.m_uds = uds;
|
||||
a.m_str = str;
|
||||
e.append(a);
|
||||
}
|
||||
|
||||
// appends an int with the UDS-ID uds
|
||||
static void app_entry(UDSEntry& e, unsigned int uds, long l)
|
||||
{
|
||||
UDSAtom a;
|
||||
a.m_uds = uds;
|
||||
a.m_long = l;
|
||||
e.append(a);
|
||||
}
|
||||
|
||||
// internal function
|
||||
// fills a directory item with its name and size
|
||||
static void app_dir(UDSEntry& e, const QString & name)
|
||||
{
|
||||
e.clear();
|
||||
app_entry(e, KIO::UDS_NAME, name);
|
||||
app_entry(e, KIO::UDS_FILE_TYPE, S_IFDIR);
|
||||
app_entry(e, KIO::UDS_SIZE, 1);
|
||||
}
|
||||
|
||||
// internal function
|
||||
// fills a file item with its name and size
|
||||
static void app_file(UDSEntry& e, const QString & name, size_t size)
|
||||
{
|
||||
e.clear();
|
||||
app_entry(e, KIO::UDS_NAME, name);
|
||||
app_entry(e, KIO::UDS_FILE_TYPE, S_IFREG);
|
||||
app_entry(e, KIO::UDS_SIZE, size);
|
||||
}
|
||||
|
||||
void ProtocolMSITS::stat (const KURL & url)
|
||||
{
|
||||
QString fileName;
|
||||
chmUnitInfo ui;
|
||||
|
||||
kdDebug() << "kio_msits::stat (const KURL& url) " << url.path() << endl;
|
||||
|
||||
if ( !parseLoadAndLookup ( url, fileName ) )
|
||||
return; // error() has been called by parseLoadAndLookup
|
||||
|
||||
if ( !ResolveObject ( fileName, &ui ) )
|
||||
{
|
||||
error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
|
||||
return;
|
||||
}
|
||||
|
||||
kdDebug() << "kio_msits::stat: adding an entry for " << fileName << endl;
|
||||
UDSEntry entry;
|
||||
|
||||
if ( isDirectory ( fileName ) )
|
||||
app_dir(entry, fileName);
|
||||
else
|
||||
app_file(entry, fileName, ui.length);
|
||||
|
||||
statEntry (entry);
|
||||
|
||||
finished();
|
||||
}
|
||||
|
||||
|
||||
// A local CHMLIB enumerator
|
||||
static int chmlib_enumerator (struct chmFile *, struct chmUnitInfo *ui, void *context)
|
||||
{
|
||||
((QValueVector<QString> *) context)->push_back (QString::fromLocal8Bit (ui->path));
|
||||
return CHM_ENUMERATOR_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
void ProtocolMSITS::listDir (const KURL & url)
|
||||
{
|
||||
QString filepath;
|
||||
|
||||
kdDebug() << "kio_msits::listDir (const KURL& url) " << url.path() << endl;
|
||||
|
||||
if ( !parseLoadAndLookup ( url, filepath ) )
|
||||
return; // error() has been called by parseLoadAndLookup
|
||||
|
||||
filepath += "/";
|
||||
|
||||
if ( !isDirectory (filepath) )
|
||||
{
|
||||
error(KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path());
|
||||
return;
|
||||
}
|
||||
|
||||
kdDebug() << "kio_msits::listDir: enumerating directory " << filepath << endl;
|
||||
|
||||
QValueVector<QString> listing;
|
||||
|
||||
if ( chm_enumerate_dir ( m_chmFile,
|
||||
filepath.local8Bit(),
|
||||
CHM_ENUMERATE_NORMAL | CHM_ENUMERATE_FILES | CHM_ENUMERATE_DIRS,
|
||||
chmlib_enumerator,
|
||||
&listing ) != 1 )
|
||||
{
|
||||
error(KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path());
|
||||
return;
|
||||
}
|
||||
|
||||
UDSEntry entry;
|
||||
unsigned int striplength = filepath.length();
|
||||
|
||||
for ( unsigned int i = 0; i < listing.size(); i++ )
|
||||
{
|
||||
// Strip the direcroty name
|
||||
QString ename = listing[i].mid (striplength);
|
||||
|
||||
if ( isDirectory ( ename ) )
|
||||
app_dir(entry, ename);
|
||||
else
|
||||
app_file(entry, ename, 0);
|
||||
|
||||
listEntry(entry, false);
|
||||
}
|
||||
|
||||
listEntry(entry, true);
|
||||
finished();
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2005 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MSITS_H
|
||||
#define MSITS_H
|
||||
|
||||
|
||||
#include <kio/slavebase.h>
|
||||
#include <kurl.h>
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qcstring.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "chm_lib.h"
|
||||
|
||||
|
||||
class ProtocolMSITS : public KIO::SlaveBase
|
||||
{
|
||||
public:
|
||||
ProtocolMSITS ( const QCString&, const QCString& );
|
||||
virtual ~ProtocolMSITS();
|
||||
|
||||
virtual void get ( const KURL& );
|
||||
virtual void listDir (const KURL & url);
|
||||
virtual void stat (const KURL & url);
|
||||
|
||||
private:
|
||||
// This function does next thing:
|
||||
// - parses the URL to get a file name and URL inside the file;
|
||||
// - loads a new CHM file, if needed;
|
||||
// - returns the parsed URL inside the file;
|
||||
bool parseLoadAndLookup ( const KURL&, QString& abspath );
|
||||
|
||||
// Resolve an object inside a CHM file
|
||||
inline bool ResolveObject (const QString& fileName, chmUnitInfo *ui)
|
||||
{
|
||||
return m_chmFile != NULL && ::chm_resolve_object(m_chmFile, fileName.utf8(), ui) == CHM_RESOLVE_SUCCESS;
|
||||
}
|
||||
|
||||
// Retrieve an object from the CHM file
|
||||
inline size_t RetrieveObject (const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize)
|
||||
{
|
||||
#if USE_BUILTIN_CHMLIB
|
||||
return ::chm_retrieve_object(m_chmFile, ui, buffer,
|
||||
fileOffset, bufferSize);
|
||||
#else
|
||||
return ::chm_retrieve_object(m_chmFile, const_cast<chmUnitInfo*>(ui),
|
||||
buffer, fileOffset, bufferSize);
|
||||
#endif
|
||||
}
|
||||
|
||||
// An opened file name, if presend
|
||||
QString m_openedFile;
|
||||
|
||||
// a CHM structure file pointer (from chmlib)
|
||||
chmFile * m_chmFile;
|
||||
};
|
||||
|
||||
|
||||
#endif /* MSITS_H */
|
@ -0,0 +1,10 @@
|
||||
lib_LIBRARIES=libchmfile.a
|
||||
libchmfile_a_SOURCES = libchmfile.cpp libchmfile_search.cpp libchmfileimpl.cpp \
|
||||
libchmtextencoding.cpp libchmtocimage.cpp
|
||||
noinst_HEADERS = libchmfile.h bitfiddle.h libchmfileimpl.h libchmtextencoding.h \
|
||||
libchmtocimage.h libchmurlfactory.h
|
||||
|
||||
INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES)
|
||||
|
||||
METASOURCES = AUTO
|
||||
KDE_OPTIONS = qtonly
|
@ -0,0 +1,155 @@
|
||||
/*
|
||||
|
||||
Copyright (C) 2003 Razvan Cojocaru <razvanco@gmx.net>
|
||||
Most of the code in this file is a modified version of code from
|
||||
Pabs' GPL chmdeco project, credits and thanks go to him.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#define UINT16ARRAY(x) ((unsigned char)(x)[0] | ((u_int16_t)(x)[1] << 8))
|
||||
#define UINT32ARRAY(x) (UINT16ARRAY(x) | ((u_int32_t)(x)[2] << 16) \
|
||||
| ((u_int32_t)(x)[3] << 24))
|
||||
|
||||
inline unsigned int get_int32_le( void *addr)
|
||||
{
|
||||
unsigned char *p = (unsigned char*) addr;
|
||||
return (unsigned int) ( p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24) );
|
||||
}
|
||||
|
||||
|
||||
inline u_int64_t be_encint(unsigned char* buffer, size_t& length)
|
||||
{
|
||||
u_int64_t result = 0;
|
||||
int shift=0;
|
||||
length = 0;
|
||||
|
||||
do {
|
||||
result |= ((*buffer) & 0x7f) << shift;
|
||||
shift += 7;
|
||||
++length;
|
||||
|
||||
} while (*(buffer++) & 0x80);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Finds the first unset bit in memory. Returns the number of set bits found.
|
||||
Returns -1 if the buffer runs out before we find an unset bit.
|
||||
*/
|
||||
inline int ffus(unsigned char* byte, int* bit, size_t& length)
|
||||
{
|
||||
int bits = 0;
|
||||
length = 0;
|
||||
|
||||
while(*byte & (1 << *bit)){
|
||||
if(*bit)
|
||||
--(*bit);
|
||||
else {
|
||||
++byte;
|
||||
++length;
|
||||
*bit = 7;
|
||||
}
|
||||
++bits;
|
||||
}
|
||||
|
||||
if(*bit)
|
||||
--(*bit);
|
||||
else {
|
||||
++length;
|
||||
*bit = 7;
|
||||
}
|
||||
|
||||
return bits;
|
||||
}
|
||||
|
||||
|
||||
inline u_int64_t sr_int(unsigned char* byte, int* bit,
|
||||
unsigned char s, unsigned char r, size_t& length)
|
||||
{
|
||||
u_int64_t ret;
|
||||
unsigned char mask;
|
||||
int n, n_bits, num_bits, base, count;
|
||||
length = 0;
|
||||
size_t fflen;
|
||||
|
||||
if(!bit || *bit > 7 || s != 2)
|
||||
return ~(u_int64_t)0;
|
||||
ret = 0;
|
||||
|
||||
count = ffus(byte, bit, fflen);
|
||||
length += fflen;
|
||||
byte += length;
|
||||
|
||||
n_bits = n = r + (count ? count-1 : 0) ;
|
||||
|
||||
while(n > 0) {
|
||||
num_bits = n > *bit ? *bit : n-1;
|
||||
base = n > *bit ? 0 : *bit - (n-1);
|
||||
|
||||
switch(num_bits){
|
||||
case 0:
|
||||
mask = 1;
|
||||
break;
|
||||
case 1:
|
||||
mask = 3;
|
||||
break;
|
||||
case 2:
|
||||
mask = 7;
|
||||
break;
|
||||
case 3:
|
||||
mask = 0xf;
|
||||
break;
|
||||
case 4:
|
||||
mask = 0x1f;
|
||||
break;
|
||||
case 5:
|
||||
mask = 0x3f;
|
||||
break;
|
||||
case 6:
|
||||
mask = 0x7f;
|
||||
break;
|
||||
case 7:
|
||||
mask = 0xff;
|
||||
break;
|
||||
default:
|
||||
mask = 0xff;
|
||||
break;
|
||||
}
|
||||
|
||||
mask <<= base;
|
||||
ret = (ret << (num_bits+1)) |
|
||||
(u_int64_t)((*byte & mask) >> base);
|
||||
|
||||
if( n > *bit ){
|
||||
++byte;
|
||||
++length;
|
||||
n -= *bit+1;
|
||||
*bit = 7;
|
||||
} else {
|
||||
*bit -= n;
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(count)
|
||||
ret |= (u_int64_t)1 << n_bits;
|
||||
|
||||
return ret;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2005 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
#include "lchmurlhandler.h"
|
||||
|
||||
LCHMUrlHandler::LCHMUrlHandler()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LCHMUrlHandler::~LCHMUrlHandler()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LCHMURLHANDLER_H
|
||||
#define LCHMURLHANDLER_H
|
||||
|
||||
/**
|
||||
@author tim <tim@krasnogorsk.ru>
|
||||
*/
|
||||
class LCHMUrlHandler{
|
||||
public:
|
||||
LCHMUrlHandler();
|
||||
|
||||
~LCHMUrlHandler();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,125 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "libchmfile.h"
|
||||
#include "libchmfileimpl.h"
|
||||
|
||||
|
||||
LCHMFile::LCHMFile( )
|
||||
{
|
||||
m_impl = new LCHMFileImpl();
|
||||
}
|
||||
|
||||
LCHMFile::~ LCHMFile( )
|
||||
{
|
||||
delete m_impl;
|
||||
}
|
||||
|
||||
bool LCHMFile::loadFile( const QString & archiveName )
|
||||
{
|
||||
return m_impl->loadFile( archiveName );
|
||||
}
|
||||
|
||||
void LCHMFile::closeAll( )
|
||||
{
|
||||
m_impl->closeAll();
|
||||
}
|
||||
|
||||
QString LCHMFile::title( ) const
|
||||
{
|
||||
return m_impl->title();
|
||||
}
|
||||
|
||||
QString LCHMFile::homeUrl( ) const
|
||||
{
|
||||
QString url = m_impl->homeUrl();
|
||||
return url.isNull() ? "/" : url;
|
||||
}
|
||||
|
||||
bool LCHMFile::hasTableOfContents( ) const
|
||||
{
|
||||
return !m_impl->m_topicsFile.isNull();
|
||||
}
|
||||
|
||||
bool LCHMFile::hasIndexTable( ) const
|
||||
{
|
||||
return !m_impl->m_indexFile.isNull();
|
||||
}
|
||||
|
||||
bool LCHMFile::hasSearchTable( ) const
|
||||
{
|
||||
return m_impl->m_searchAvailable;
|
||||
}
|
||||
|
||||
bool LCHMFile::parseTableOfContents( QT34VECTOR< LCHMParsedEntry > * topics ) const
|
||||
{
|
||||
return m_impl->parseFileAndFillArray( m_impl->m_topicsFile, topics, false );
|
||||
}
|
||||
|
||||
bool LCHMFile::parseIndex( QT34VECTOR< LCHMParsedEntry > * indexes ) const
|
||||
{
|
||||
return m_impl->parseFileAndFillArray( m_impl->m_indexFile, indexes, true );
|
||||
}
|
||||
|
||||
bool LCHMFile::getFileContentAsString( QString * str, const QString & url )
|
||||
{
|
||||
return m_impl->getFileContentAsString( str, url );
|
||||
}
|
||||
|
||||
bool LCHMFile::getFileContentAsBinary( QByteArray * data, const QString & url )
|
||||
{
|
||||
return m_impl->getFileContentAsBinary( data, url );
|
||||
}
|
||||
|
||||
bool LCHMFile::enumerateFiles( QStringList * files )
|
||||
{
|
||||
return m_impl->enumerateFiles( files );
|
||||
}
|
||||
|
||||
QString LCHMFile::getTopicByUrl( const QString & url )
|
||||
{
|
||||
return m_impl->getTopicByUrl( url );
|
||||
}
|
||||
|
||||
const QPixmap * LCHMFile::getBookIconPixmap( unsigned int imagenum )
|
||||
{
|
||||
return m_impl->getBookIconPixmap( imagenum );
|
||||
}
|
||||
|
||||
const LCHMTextEncoding * LCHMFile::currentEncoding( ) const
|
||||
{
|
||||
return m_impl->m_currentEncoding;
|
||||
}
|
||||
|
||||
bool LCHMFile::setCurrentEncoding( const LCHMTextEncoding * encoding )
|
||||
{
|
||||
return m_impl->setCurrentEncoding( encoding );
|
||||
}
|
||||
|
||||
QString LCHMFile::normalizeUrl( const QString & url ) const
|
||||
{
|
||||
return m_impl->normalizeUrl( url );
|
||||
}
|
||||
|
||||
bool LCHMFile::getFileSize(unsigned int * size, const QString & url)
|
||||
{
|
||||
return m_impl->getFileSize( size, url );
|
||||
}
|
@ -0,0 +1,290 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_LIBCHMFILE_H
|
||||
#define INCLUDE_LIBCHMFILE_H
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qcstring.h>
|
||||
#include <qlistview.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qmap.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qtextcodec.h>
|
||||
|
||||
#include "libchmtextencoding.h"
|
||||
|
||||
// Qt3/Qt4 compatibility: in Qt3 QVector stores pointers, not values - so QValueVector should be used.
|
||||
// In Qt4 QVector stores values, so we can use QVector
|
||||
#if defined (USE_QT_4)
|
||||
#define QT34VECTOR QVector
|
||||
#else
|
||||
#define QT34VECTOR QValueVector
|
||||
#endif
|
||||
|
||||
|
||||
//! Contains different (non-standard) image types
|
||||
namespace LCHMBookIcons
|
||||
{
|
||||
const int IMAGE_NONE = -1;
|
||||
const int IMAGE_AUTO = -2;
|
||||
const int IMAGE_INDEX = -3;
|
||||
|
||||
const int MAX_BUILTIN_ICONS = 42;
|
||||
};
|
||||
|
||||
|
||||
//! Contains a single index or TOC entry. See LCHMFile::parseTOC() and LCHMFile::parseIndex()
|
||||
typedef struct
|
||||
{
|
||||
//! Entry name
|
||||
QString name;
|
||||
|
||||
//! Entry URLs. The TOC entry should have only one URL; the index entry could have several.
|
||||
QStringList urls;
|
||||
|
||||
//! Associated image number. Used for TOC only; indexes does not have the image.
|
||||
//! Use LCHMFile::getBookIconPixmap() to get associated pixmap icon
|
||||
int imageid;
|
||||
|
||||
//! Indentation level for this entry.
|
||||
int indent;
|
||||
|
||||
} LCHMParsedEntry;
|
||||
|
||||
|
||||
// forward declaration
|
||||
class LCHMFileImpl;
|
||||
|
||||
//! CHM files processor, heavily based on chmlib. Used search code from xchm.
|
||||
class LCHMFile
|
||||
{
|
||||
public:
|
||||
//! Default constructor and destructor.
|
||||
LCHMFile();
|
||||
~LCHMFile();
|
||||
|
||||
/*!
|
||||
* \brief Attempts to load a .chm file.
|
||||
* \param archiveName The .chm filename.
|
||||
* \return true on success, false on failure.
|
||||
*
|
||||
* Loads a CHM file. Could internally load more than one file, if files linked to
|
||||
* this one are present locally (like MSDN).
|
||||
* \ingroup init
|
||||
*/
|
||||
bool loadFile( const QString& archiveName );
|
||||
|
||||
/*!
|
||||
* \brief Closes all the files, and frees the appropriate data.
|
||||
* \ingroup init
|
||||
*/
|
||||
void closeAll();
|
||||
|
||||
/*!
|
||||
* \brief Gets the title name of the opened .chm.
|
||||
* \return The name of the opened document, or an empty string if no .chm has been loaded.
|
||||
* \ingroup information
|
||||
*/
|
||||
QString title() const;
|
||||
|
||||
/*!
|
||||
* \brief Gets the URL of the default page in the chm archive.
|
||||
* \return The home page name, with a '/' added in front and relative to
|
||||
* the root of the archive filesystem. If no .chm has been opened,
|
||||
* returns "/".
|
||||
* \ingroup information
|
||||
*/
|
||||
QString homeUrl() const;
|
||||
|
||||
/*!
|
||||
* \brief Checks whether the Table of Contents is present in this file.
|
||||
* \return true if it is available; false otherwise.
|
||||
* \ingroup information
|
||||
*/
|
||||
bool hasTableOfContents() const;
|
||||
|
||||
/*!
|
||||
* \brief Checks whether the Index Table is present in this file.
|
||||
* \return true if it is available; false otherwise.
|
||||
* \ingroup information
|
||||
*/
|
||||
bool hasIndexTable() const;
|
||||
|
||||
/*!
|
||||
* \brief Checks whether the Search Table is available in this file.
|
||||
* \return true if it is available; false otherwise.
|
||||
* \ingroup information
|
||||
*
|
||||
* If the search table is not available, the search is not possible.
|
||||
*/
|
||||
bool hasSearchTable() const;
|
||||
|
||||
/*!
|
||||
* \brief Parses the Table of Contents (TOC)
|
||||
* \param topics A pointer to the container which will store the parsed results.
|
||||
* Will be cleaned before parsing.
|
||||
* \return true if the tree is present and parsed successfully, false otherwise.
|
||||
* The parser is built to be error-prone, however it still can abort with qFatal()
|
||||
* by really buggy chm file; please report a bug if the file is opened ok under Windows.
|
||||
* \ingroup fileparsing
|
||||
*/
|
||||
bool parseTableOfContents( QT34VECTOR< LCHMParsedEntry > * topics ) const;
|
||||
|
||||
/*!
|
||||
* \brief Parses the Index Table
|
||||
* \param indexes A pointer to the container which will store the parsed results.
|
||||
* Will be cleaned before parsing.
|
||||
* \return true if the tree is present and parsed successfully, false otherwise.
|
||||
* The parser is built to be error-prone, however it still can abort with qFatal()
|
||||
* by really buggy chm file; so far it never happened on indexes.
|
||||
* \ingroup fileparsing
|
||||
*/
|
||||
bool parseIndex( QT34VECTOR< LCHMParsedEntry > * indexes ) const;
|
||||
|
||||
/*!
|
||||
* \brief Retrieves the content from url in current chm file to QString.
|
||||
* \param str A string where the retreived content should be stored.
|
||||
* \param url An URL in chm file to retreive content from. Must be absolute.
|
||||
* \return true if the content is successfully received; false otherwise.
|
||||
*
|
||||
* This function retreives the file content (mostly for HTML pages) from the chm archive
|
||||
* opened by load() function. Because the content in chm file is not stored in Unicode, it
|
||||
* will be recoded according to current encoding. Do not use for binary data.
|
||||
*
|
||||
* \sa setCurrentEncoding() currentEncoding() getFileContentAsBinary()
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
bool getFileContentAsString( QString * str, const QString& url );
|
||||
|
||||
/*!
|
||||
* \brief Retrieves the content from url in current chm file to QByteArray.
|
||||
* \param data A data array where the retreived content should be stored.
|
||||
* \param url An URL in chm file to retreive content from. Must be absolute.
|
||||
* \return true if the content is successfully received; false otherwise.
|
||||
*
|
||||
* This function retreives the file content from the chm archive opened by load()
|
||||
* function. The content is not encoded.
|
||||
*
|
||||
* \sa getFileContentAsString()
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
bool getFileContentAsBinary( QByteArray * data, const QString& url );
|
||||
|
||||
/*!
|
||||
* \brief Retrieves the content size.
|
||||
* \param size A pointer where the size will be stored.
|
||||
* \param url An URL in chm file to retreive content from. Must be absolute.
|
||||
* \return true if the content size is successfully stored; false otherwise.
|
||||
*
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
bool getFileSize( unsigned int * size, const QString& url );
|
||||
|
||||
/*!
|
||||
* \brief Obtains the list of all the files in current chm file archive.
|
||||
* \param files An array to store list of URLs (file names) present in chm archive.
|
||||
* \return true if the enumeration succeed; false otherwise (I could hardly imagine a reason).
|
||||
*
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
bool enumerateFiles( QStringList * files );
|
||||
|
||||
/*!
|
||||
* \brief Gets the Title of the HTML page referenced by url.
|
||||
* \param url An URL in chm file to get title from. Must be absolute.
|
||||
* \return The title, or QString::null if the URL cannot be found or not a HTML page.
|
||||
*
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
QString getTopicByUrl ( const QString& url );
|
||||
|
||||
/*!
|
||||
* \brief Gets the appropriate CHM pixmap icon.
|
||||
* \param imagenum The image number from TOC.
|
||||
* \return The pixmap to show in TOC tree.
|
||||
*
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
const QPixmap * getBookIconPixmap( unsigned int imagenum );
|
||||
|
||||
/*!
|
||||
* \brief Normalizes the URL, converting relatives, adding "/" in front and removing ..
|
||||
* \param url The URL to normalize.
|
||||
* \return The normalized, cleaned up URL.
|
||||
*
|
||||
* \ingroup dataretrieve
|
||||
*/
|
||||
QString normalizeUrl( const QString& url ) const;
|
||||
|
||||
/*!
|
||||
* \brief Gets the current CHM archive encoding (set or autodetected)
|
||||
* \return The current encoding.
|
||||
*
|
||||
* \ingroup encoding
|
||||
*/
|
||||
const LCHMTextEncoding * currentEncoding() const;
|
||||
|
||||
/*!
|
||||
* \brief Sets the CHM archive encoding to use
|
||||
* \param encoding An encoding to use.
|
||||
*
|
||||
* \ingroup encoding
|
||||
*/
|
||||
bool setCurrentEncoding ( const LCHMTextEncoding * encoding );
|
||||
|
||||
/*!
|
||||
* \brief Execute a search query, return the results.
|
||||
* \param query A search query.
|
||||
* \param results An array to store URLs where the query was found.
|
||||
* \return true if search was successful (this does not mean that it returned any results);
|
||||
* false otherwise.
|
||||
*
|
||||
* This function executes a standard search query. The query should consist of one of more
|
||||
* words separated by a space with a possible prefix. A prefix may be:
|
||||
* + Plus indicates that the word is required; any page without this word is excluded from the result.
|
||||
* - Minus indicates that the word is required to be absent; any page with this word is excluded from
|
||||
* the result.
|
||||
* "." Quotes indicates a phrase. Anything between quotes is a phrase, which is set of space-separated
|
||||
* words. Will be in result only if the words in phrase are in page in the same sequence, and
|
||||
* follow each other.
|
||||
*
|
||||
* If there is no prefix, the word considered as required.
|
||||
* \ingroup search
|
||||
*/
|
||||
bool searchQuery ( const QString& query, QStringList * results, unsigned int limit = 100 );
|
||||
|
||||
//! Access to implementation
|
||||
LCHMFileImpl * impl() { return m_impl; }
|
||||
|
||||
private:
|
||||
//! No copy construction allowed.
|
||||
LCHMFile( const LCHMFile& );
|
||||
|
||||
//! No assignments allowed.
|
||||
LCHMFile& operator=( const LCHMFile& );
|
||||
|
||||
//! Implementation
|
||||
LCHMFileImpl * m_impl;
|
||||
};
|
||||
|
||||
|
||||
#endif // INCLUDE_LIBCHMFILE_H
|
@ -0,0 +1,289 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qregexp.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
#include "libchmfileimpl.h"
|
||||
|
||||
//#define DEBUG_SEARCH(A) qDebug A
|
||||
#define DEBUG_SEARCH(A)
|
||||
|
||||
|
||||
static inline void validateWord ( QString & word, bool & query_valid )
|
||||
{
|
||||
QRegExp rxvalid ("[^\\d\\w_\\.]+");
|
||||
|
||||
QString orig = word;
|
||||
word.remove ( rxvalid );
|
||||
|
||||
if ( word != orig )
|
||||
query_valid = false;
|
||||
}
|
||||
|
||||
static inline void validateWords ( QStringList & wordlist, bool & query_valid )
|
||||
{
|
||||
QRegExp rxvalid ("[^\\d\\w_\\.]+");
|
||||
|
||||
for ( unsigned int i = 0; i < wordlist.size(); i++ )
|
||||
validateWord ( wordlist[i], query_valid );
|
||||
}
|
||||
|
||||
|
||||
inline static void mergeResults ( LCHMSearchProgressResults & results, const LCHMSearchProgressResults & src, bool add )
|
||||
{
|
||||
if ( results.empty() && add )
|
||||
{
|
||||
results = src;
|
||||
return;
|
||||
}
|
||||
|
||||
for ( unsigned int s1 = 0; s1 < results.size(); s1++ )
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
for ( unsigned int s2 = 0; s2 < src.size(); s2++ )
|
||||
{
|
||||
if ( results[s1].urloff == src[s2].urloff )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If we're adding, we only add the items found (i.e. any item, which is not found, is removed.
|
||||
// But if we're removing, we only remove the items found.
|
||||
if ( (found && !add) || (!found && add) )
|
||||
{
|
||||
results.erase ( results.begin() + s1 );
|
||||
s1--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void findNextWords ( QT34VECTOR<u_int64_t> & src, const QT34VECTOR<u_int64_t> & needle )
|
||||
{
|
||||
for ( unsigned int s1 = 0; s1 < src.size(); s1++ )
|
||||
{
|
||||
bool found = false;
|
||||
u_int64_t target_offset = src[s1] + 1;
|
||||
|
||||
DEBUG_SEARCH (("Offset loop: offset at %u is %u, target %u", (unsigned int) s1,
|
||||
(unsigned int) src[s1], (unsigned int) target_offset));
|
||||
|
||||
// Search in the offsets list in attempt to find next word
|
||||
for ( unsigned int s2 = 0; s2 < needle.size(); s2++ )
|
||||
{
|
||||
if ( needle[s2] == target_offset )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !found )
|
||||
{
|
||||
// Remove this offset, we don't need it anymore
|
||||
DEBUG_SEARCH (("Offset loop failed: offset %u not found", (unsigned int) target_offset));
|
||||
src.erase ( src.begin() + s1 );
|
||||
s1--;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_SEARCH (("Offset loop succeed: offset %u found", (unsigned int) target_offset));
|
||||
src[s1]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline bool searchPhrase( LCHMFileImpl * impl, const QStringList & phrase, LCHMSearchProgressResults & results )
|
||||
{
|
||||
// Accumulate the phrase data here.
|
||||
LCHMSearchProgressResults phrasekeeper;
|
||||
|
||||
// On the first word, just fill the phrasekeeper with every occupence of the first word
|
||||
DEBUG_SEARCH (("Search word(0): '%s'", phrase[0].ascii()));
|
||||
if ( !impl->searchWord ( phrase[0], true, false, phrasekeeper, true ) )
|
||||
return false; // the word not found, so the whole phrase is not found either.
|
||||
|
||||
for ( unsigned int i = 1; i < phrase.size(); i++ )
|
||||
{
|
||||
LCHMSearchProgressResults srchtmp;
|
||||
|
||||
DEBUG_SEARCH (("Search word(%d): '%s'", i, phrase[i].ascii()));
|
||||
if ( !impl->searchWord ( phrase[i], true, false, srchtmp, true ) )
|
||||
return false; // the ith word not found, so the whole phrase is not found either.
|
||||
|
||||
// Iterate the both arrays, and remove every word in phrasekeeper, which is not found
|
||||
// in the srchtmp, or is found on a different position.
|
||||
for ( unsigned int p1 = 0; p1 < phrasekeeper.size(); p1++ )
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
DEBUG_SEARCH (("Ext loop (it %d): urloff %d", p1, phrasekeeper[p1].urloff));
|
||||
|
||||
for ( unsigned int p2 = 0; p2 < srchtmp.size(); p2++ )
|
||||
{
|
||||
// look up for words on the the same page
|
||||
if ( srchtmp[p2].urloff != phrasekeeper[p1].urloff )
|
||||
continue;
|
||||
|
||||
// Now check every offset to find the one which is 1 bigger than the
|
||||
findNextWords ( phrasekeeper[p1].offsets, srchtmp[p2].offsets );
|
||||
|
||||
// If at least one next word is found, we leave the block intact, otherwise remove it.
|
||||
if ( !phrasekeeper[p1].offsets.empty() )
|
||||
found = true;
|
||||
}
|
||||
|
||||
if ( !found )
|
||||
{
|
||||
DEBUG_SEARCH (("Ext loop: this word not found on %d, remove it", phrasekeeper[p1].urloff));
|
||||
phrasekeeper.erase ( phrasekeeper.begin() + p1 );
|
||||
p1--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( unsigned int o = 0; o < phrasekeeper.size(); o++ )
|
||||
results.push_back ( LCHMSearchProgressResult (phrasekeeper[o].titleoff, phrasekeeper[o].urloff) );
|
||||
|
||||
return !results.empty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool LCHMFile::searchQuery( const QString& inquery, QStringList * searchresults, unsigned int limit )
|
||||
{
|
||||
QStringList words_must_exist, words_must_not_exist, words_highlight;
|
||||
QT34VECTOR<QStringList> phrases_must_exist;
|
||||
QString query = inquery;
|
||||
bool query_valid = true;
|
||||
LCHMSearchProgressResults results;
|
||||
int pos;
|
||||
unsigned int i;
|
||||
|
||||
/*
|
||||
* Parse the search query with a simple state machine.
|
||||
* Query should consist of one of more words separated by a space with a possible prefix.
|
||||
* A prefix may be:
|
||||
* + indicates that the word is required; any page without this word is excluded from the result.
|
||||
* - indicates that the word is required to be absent; any page with this word is excluded from
|
||||
* the result.
|
||||
* "." indicates a phrase. Anything between quotes indicates a phrase, which is set of space-separated
|
||||
* words. Will be in result only if the words in phrase are in page in the same sequence, and
|
||||
* follow each other.
|
||||
* If there is no prefix, the word considered as required.
|
||||
*/
|
||||
|
||||
QRegExp rxphrase( "\"(.*)\"" );
|
||||
QRegExp rxword( "([^\\s]+)" );
|
||||
rxphrase.setMinimal( TRUE );
|
||||
|
||||
// First, get the phrase queries
|
||||
while ( (pos = rxphrase.search (query, 0)) != -1 )
|
||||
{
|
||||
// A phrase query found. Locate its boundaries, and parse it.
|
||||
QStringList plist = QStringList::split ( QRegExp ("\\s+"), rxphrase.cap ( 1 ));
|
||||
|
||||
validateWords ( plist, query_valid );
|
||||
|
||||
if ( plist.size() > 0 )
|
||||
phrases_must_exist.push_back( plist );
|
||||
|
||||
query.remove (pos, rxphrase.matchedLength());
|
||||
}
|
||||
|
||||
// Then, parse the rest query
|
||||
while ( (pos = rxword.search (query, 0)) != -1 )
|
||||
{
|
||||
// A phrase query found. Locate its boundaries, and parse it.
|
||||
QString word = rxword.cap ( 1 );
|
||||
QChar type = '+';
|
||||
|
||||
if ( word[0] == '-' || word[0] == '+' )
|
||||
{
|
||||
type = word[0];
|
||||
word.remove (0, 1);
|
||||
}
|
||||
|
||||
validateWord ( word, query_valid );
|
||||
|
||||
if ( type == '-' )
|
||||
words_must_not_exist.push_back ( word );
|
||||
else
|
||||
words_must_exist.push_back ( word );
|
||||
|
||||
query.remove (pos, rxword.matchedLength());
|
||||
}
|
||||
|
||||
#if defined (DUMP_SEARCH_QUERY)
|
||||
// Dump the search query
|
||||
QString qdump;
|
||||
for ( i = 0; i < phrases_must_exist.size(); i++ )
|
||||
qdump += QString(" \"") + phrases_must_exist[i].join (" ") + QString ("\"");
|
||||
|
||||
for ( i = 0; i < words_must_not_exist.size(); i++ )
|
||||
qdump += QString (" -") + words_must_not_exist[i];
|
||||
|
||||
for ( i = 0; i < words_must_exist.size(); i++ )
|
||||
qdump += QString (" +") + words_must_exist[i];
|
||||
|
||||
qDebug ("Search query dump: %s", qdump.ascii());
|
||||
#endif
|
||||
|
||||
// First search for phrases
|
||||
if ( phrases_must_exist.size() > 0 )
|
||||
{
|
||||
LCHMSearchProgressResults tempres;
|
||||
|
||||
for ( i = 0; i < phrases_must_exist.size(); i++ )
|
||||
{
|
||||
if ( !searchPhrase ( impl(), phrases_must_exist[i], tempres ) )
|
||||
return false;
|
||||
|
||||
mergeResults ( results, tempres, true );
|
||||
}
|
||||
}
|
||||
|
||||
for ( i = 0; i < words_must_exist.size(); i++ )
|
||||
{
|
||||
LCHMSearchProgressResults tempres;
|
||||
|
||||
if ( !m_impl->searchWord ( words_must_exist[i], true, false, tempres, false ) )
|
||||
return false;
|
||||
|
||||
mergeResults ( results, tempres, true );
|
||||
}
|
||||
|
||||
for ( i = 0; i < words_must_not_exist.size(); i++ )
|
||||
{
|
||||
LCHMSearchProgressResults tempres;
|
||||
|
||||
m_impl->searchWord ( words_must_not_exist[i], true, false, tempres, false );
|
||||
mergeResults ( results, tempres, false );
|
||||
}
|
||||
|
||||
m_impl->getSearchResults( results, searchresults, limit );
|
||||
return true;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,286 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Portions Copyright (C) 2003 Razvan Cojocaru <razvanco@gmx.net> *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "chm_lib.h"
|
||||
|
||||
#include "libchmfile.h"
|
||||
#include "libchmtocimage.h"
|
||||
|
||||
#include <sys/types.h> /* for u_int{32,64}_t */
|
||||
|
||||
//! Keeps the intermediate search result
|
||||
class LCHMSearchProgressResult
|
||||
{
|
||||
public:
|
||||
inline LCHMSearchProgressResult() {}
|
||||
inline LCHMSearchProgressResult( u_int32_t t, u_int32_t u ) : titleoff(t),urloff(u) {}
|
||||
|
||||
QValueVector<u_int64_t> offsets;
|
||||
u_int32_t titleoff;
|
||||
u_int32_t urloff;
|
||||
};
|
||||
|
||||
//! An array to keeps the intermediate search results
|
||||
typedef QT34VECTOR<LCHMSearchProgressResult> LCHMSearchProgressResults;
|
||||
|
||||
|
||||
//! CHM files processor; the implementation
|
||||
class LCHMFileImpl
|
||||
{
|
||||
public:
|
||||
LCHMFileImpl();
|
||||
~LCHMFileImpl();
|
||||
|
||||
// Implementations for LCHMFile members
|
||||
bool loadFile( const QString& archiveName );
|
||||
void closeAll();
|
||||
|
||||
QString title() const { return encodeWithCurrentCodec( m_title ); }
|
||||
QString homeUrl() const { return encodeWithCurrentCodec( m_home ); }
|
||||
|
||||
bool getFileContentAsString( QString * str, const QString& url, bool internal_encoding = false );
|
||||
bool getFileContentAsBinary( QByteArray * data, const QString& url ) const;
|
||||
bool getFileSize( unsigned int * size, const QString& url );
|
||||
|
||||
bool enumerateFiles( QStringList * files );
|
||||
QString getTopicByUrl ( const QString& url ) const;
|
||||
|
||||
const QPixmap * getBookIconPixmap( unsigned int imagenum );
|
||||
|
||||
bool setCurrentEncoding( const LCHMTextEncoding * encoding );
|
||||
|
||||
//! Parse the HHC or HHS file, and fill the context (asIndex is false) or index (asIndex is true) array.
|
||||
bool parseFileAndFillArray (const QString& file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex );
|
||||
|
||||
/*!
|
||||
* \brief Fast search using the $FIftiMain file in the .chm.
|
||||
* \param text The text we're looking for.
|
||||
* \param wholeWords Are we looking for whole words only?
|
||||
* \param titlesOnly Are we looking for titles only?
|
||||
* \param results A string-string hashmap that will hold
|
||||
* the results in case of successful search. The keys are
|
||||
* the URLs and the values are the page titles.
|
||||
* \param phrase_search Indicates that word offset information should be kept.
|
||||
* \return true if the search found something, false otherwise.
|
||||
*/
|
||||
bool searchWord( const QString& word,
|
||||
bool wholeWords,
|
||||
bool titlesOnly,
|
||||
LCHMSearchProgressResults& results,
|
||||
bool phrase_search );
|
||||
|
||||
/*!
|
||||
* \brief Finalize the search, resolve the matches, the and generate the results array.
|
||||
* \param tempres Temporary search results from SearchWord.
|
||||
* \param results A string-string hashmap that will hold the results in case of successful search.
|
||||
* The keys are the URLs and the values are the page titles.
|
||||
*/
|
||||
void getSearchResults( const LCHMSearchProgressResults& tempres,
|
||||
QStringList * results,
|
||||
unsigned int limit_results = 500 );
|
||||
|
||||
//! Looks up fileName in the archive.
|
||||
bool ResolveObject( const QString& fileName, chmUnitInfo *ui ) const;
|
||||
|
||||
//! Retrieves an uncompressed chunk of a file in the .chm.
|
||||
size_t RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) const;
|
||||
|
||||
//! Encode the string with the currently selected text codec, if possible. Or return as-is, if not.
|
||||
inline QString encodeWithCurrentCodec (const QString& str) const
|
||||
{
|
||||
return (m_textCodec ? m_textCodec->toUnicode (str) : str);
|
||||
}
|
||||
|
||||
//! Encode the string with the currently selected text codec, if possible. Or return as-is, if not.
|
||||
inline QString encodeWithCurrentCodec (const char * str) const
|
||||
{
|
||||
return (m_textCodec ? m_textCodec->toUnicode (str) : (QString) str);
|
||||
}
|
||||
|
||||
//! Encode the string from internal files with the currently selected text codec, if possible.
|
||||
//! Or return as-is, if not.
|
||||
inline QString encodeInternalWithCurrentCodec (const QString& str) const
|
||||
{
|
||||
return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : str);
|
||||
}
|
||||
|
||||
//! Encode the string from internal files with the currently selected text codec, if possible.
|
||||
//! Or return as-is, if not.
|
||||
inline QString encodeInternalWithCurrentCodec (const char * str) const
|
||||
{
|
||||
return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : (QString) str);
|
||||
}
|
||||
|
||||
//! Helper. Translates from Win32 encodings to generic wxWidgets ones.
|
||||
const char * GetFontEncFromCharSet (const QString& font) const;
|
||||
|
||||
//! Helper. Returns the $FIftiMain offset of leaf node or 0.
|
||||
u_int32_t GetLeafNodeOffset(const QString& text,
|
||||
u_int32_t initalOffset,
|
||||
u_int32_t buffSize,
|
||||
u_int16_t treeDepth );
|
||||
|
||||
//! Helper. Processes the word location code entries while searching.
|
||||
bool ProcessWLC(u_int64_t wlc_count,
|
||||
u_int64_t wlc_size,
|
||||
u_int32_t wlc_offset,
|
||||
unsigned char ds,
|
||||
unsigned char dr,
|
||||
unsigned char cs,
|
||||
unsigned char cr,
|
||||
unsigned char ls,
|
||||
unsigned char lr,
|
||||
LCHMSearchProgressResults& results,
|
||||
bool phrase_search );
|
||||
|
||||
//! Looks up as much information as possible from #WINDOWS/#STRINGS.
|
||||
bool getInfoFromWindows();
|
||||
|
||||
//! Looks up as much information as possible from #SYSTEM.
|
||||
bool getInfoFromSystem();
|
||||
|
||||
//! Fill the topic-url map
|
||||
void fillTopicsUrlMap();
|
||||
|
||||
//! Sets up textCodec
|
||||
void setupTextCodec (const char * name);
|
||||
|
||||
//! Guess used text encoding, using m_detectedLCID and m_font. Set up m_textCodec
|
||||
bool guessTextEncoding ();
|
||||
|
||||
//! Change the current CHM encoding for internal files and texts.
|
||||
//! Encoding could be either simple Qt codepage, or set like CP1251/KOI8, which allows to
|
||||
//! set up encodings separately for text (first) and internal files (second)
|
||||
bool changeFileEncoding( const char *qtencoding );
|
||||
|
||||
//! Convert the word, so it has an appropriate encoding
|
||||
QCString convertSearchWord ( const QString &src );
|
||||
|
||||
/*!
|
||||
* Helper procedure in TOC parsing, decodes the string between the quotes (first or last) with decoding HTML
|
||||
* entities like í
|
||||
*/
|
||||
int findStringInQuotes (const QString& tag, int offset, QString& value, bool firstquote, bool decodeentities );
|
||||
|
||||
/*!
|
||||
* Decodes Unicode HTML entities according to current encoding.
|
||||
*/
|
||||
QString decodeEntity (const QString& entity );
|
||||
|
||||
/*!
|
||||
* \brief Returns the list of all available text encodings.
|
||||
* \return A pointer to the beginning of the text encoding table. The table could be
|
||||
* enumerated until language == 0, which means end of table.
|
||||
*
|
||||
* \ingroup encoding
|
||||
*/
|
||||
static const LCHMTextEncoding * getTextEncodingTable();
|
||||
|
||||
/*!
|
||||
* \brief Looks up for encoding by LCID
|
||||
* \param lcid LCID to look up
|
||||
* \return A pointer to encoding structure.
|
||||
*
|
||||
* \ingroup encoding
|
||||
*/
|
||||
static const LCHMTextEncoding * lookupByLCID( short lcid );
|
||||
|
||||
/*!
|
||||
* \brief Get the encoding index
|
||||
* \param enc Encoding
|
||||
* \return An index in encoding table. getTextEncodingTable() + i gets the encoding.
|
||||
*
|
||||
* \ingroup encoding
|
||||
*/
|
||||
static int getEncodingIndex( const LCHMTextEncoding * enc);
|
||||
|
||||
/*!
|
||||
* Normalizes path to search in internal arrays
|
||||
*/
|
||||
QString normalizeUrl (const QString& path ) const;
|
||||
|
||||
|
||||
// Members
|
||||
|
||||
//! Pointer to the chmlib structure
|
||||
chmFile * m_chmFile;
|
||||
|
||||
//! Opened file name
|
||||
QString m_filename;
|
||||
|
||||
//! Home url, got from CHM file
|
||||
QString m_home;
|
||||
|
||||
//! Context tree filename. Got from CHM file
|
||||
QString m_topicsFile;
|
||||
|
||||
//! Index filename. Got from CHM file
|
||||
QString m_indexFile;
|
||||
|
||||
//! Chm Title. Got from CHM file
|
||||
QString m_title;
|
||||
|
||||
// Localization stuff
|
||||
//! LCID from CHM file, used in encoding detection
|
||||
short m_detectedLCID;
|
||||
|
||||
//! font charset from CHM file, used in encoding detection
|
||||
QString m_font;
|
||||
|
||||
//! Chosen text codec
|
||||
QTextCodec * m_textCodec;
|
||||
QTextCodec * m_textCodecForSpecialFiles;
|
||||
|
||||
//! Current encoding
|
||||
const LCHMTextEncoding * m_currentEncoding;
|
||||
|
||||
//! Map to decode HTML entitles like ´ based on current encoding
|
||||
QMap<QString, QString> m_entityDecodeMap;
|
||||
|
||||
//! TRUE if /#TOPICS, /#STRINGS, /#URLTBL and /#URLSTR are resolved, and the members below are valid
|
||||
bool m_lookupTablesValid;
|
||||
|
||||
//! pointer to /#TOPICS
|
||||
chmUnitInfo m_chmTOPICS;
|
||||
|
||||
//! pointer to /#STRINGS
|
||||
chmUnitInfo m_chmSTRINGS;
|
||||
|
||||
//! pointer to /#URLTBL
|
||||
chmUnitInfo m_chmURLTBL;
|
||||
|
||||
//! pointer to /#URLSTR
|
||||
chmUnitInfo m_chmURLSTR;
|
||||
|
||||
//! Indicates whether the built-in search is available. This is true only when m_lookupTablesValid
|
||||
//! is TRUE, and m_chmFIftiMain is resolved.
|
||||
bool m_searchAvailable;
|
||||
|
||||
//! pointer to /$FIftiMain
|
||||
chmUnitInfo m_chmFIftiMain;
|
||||
|
||||
//! Book TOC icon images storage
|
||||
LCHMTocImageKeeper m_imagesKeeper;
|
||||
|
||||
//! Map url->topic
|
||||
QMap< QString, QString > m_url2topics;
|
||||
};
|
@ -0,0 +1,197 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "libchmfileimpl.h"
|
||||
#include "libchmtextencoding.h"
|
||||
|
||||
static const LCHMTextEncoding text_encoding_table [] =
|
||||
{
|
||||
{ "Afrikaans",0, 0x0436, 1252, 0, "CP1252" },
|
||||
{ "Albanian", 0, 0x041C, 1250, 238, "CP1250" },
|
||||
{ "Arabic", "Algeria", 0x1401, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Bahrain", 0x3C01, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Egypt", 0x0C01, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Iraq", 0x0801, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Jordan", 0x2C01, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Kuwait", 0x3401, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Lebanon", 0x3001, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Libya", 0x1001, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Morocco", 0x1801, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Oman", 0x2001, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Qatar", 0x4001, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Saudi Arabia", 0x0401, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Syria", 0x2801, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "Tunisia", 0x1C01, 1256, 0, "CP1256" },
|
||||
{ "Arabic", "United Arab Emirates", 0x3801, 1256, 178, "CP1256" },
|
||||
{ "Arabic", "Yemen", 0x2401, 1256, 0, "CP1256" },
|
||||
{ "Armenian", 0, 0x042B, 0, 0, "Latin1" },
|
||||
{ "Azeri", "Cyrillic", 0x082C, 1251, 0, "CP1251" },
|
||||
{ "Azeri", "Latin", 0x042C, 1254, 162, "CP1254" },
|
||||
{ "Basque", 0, 0x042D, 1252, 0, "CP1252" },
|
||||
{ "Belarusian", 0, 0x0423, 1251, 0, "CP1251" },
|
||||
{ "Bulgarian", 0, 0x0402, 1251, 0, "CP1251" },
|
||||
{ "Catalan", 0, 0x0403, 1252, 0, "CP1252" },
|
||||
{ "Chinese", "China", 0x0804, 936, 134, "GBK" },
|
||||
{ "Chinese", "Hong Kong SAR", 0x0C04, 950, 136, "Big5" },
|
||||
{ "Chinese", "Macau SAR", 0x1404, 950, 136, "Big5" },
|
||||
{ "Chinese", "Singapore", 0x1004, 936, 134, "GB2313" },
|
||||
{ "Chinese", "Taiwan", 0x0404, 950, 136, "Big5" }, // traditional
|
||||
{ "Chinese", "Taiwan - Big5-HKSCS", 0x0404, 950, 136, "Big5-HKSCS" },
|
||||
{ "Chinese", "Taiwan - GB18030", 0x0404, 950, 136, "GB18030" },
|
||||
{ "Croatian", 0, 0x041A, 1250, 238, "CP1250" },
|
||||
{ "Czech", 0, 0x0405, 1250, 238, "CP1250" },
|
||||
{ "Danish", 0, 0x0406, 1252, 0, "CP1252" },
|
||||
{ "Dutch", "Belgium", 0x0813, 1252, 0, "CP1252" },
|
||||
{ "Dutch", "The Netherlands", 0x0413, 1252, 0, "CP1252" },
|
||||
{ "English", "Australia", 0x0C09, 1252, 0, "CP1252" },
|
||||
{ "English", "Belize", 0x2809, 1252, 0, "CP1252" },
|
||||
{ "English", "Canada", 0x1009, 1252, 0, "CP1252" },
|
||||
{ "English", "Caribbean", 0x2409, 1252, 0, "CP1252" },
|
||||
{ "English", "Ireland", 0x1809, 1252, 0, "CP1252" },
|
||||
{ "English", "Jamaica", 0x2009, 1252, 0, "CP1252" },
|
||||
{ "English", "New Zealand", 0x1409, 1252, 0, "CP1252" },
|
||||
{ "English", "Phillippines", 0x3409, 1252, 0, "CP1252" },
|
||||
{ "English", "South Africa", 0x1C09, 1252, 0, "CP1252" },
|
||||
{ "English", "Trinidad", 0x2C09, 1252, 0, "CP1252" },
|
||||
{ "English", "United Kingdom", 0x0809, 1252, 0, "CP1252" },
|
||||
{ "English", "United States", 0x0409, 1252, 0, "CP1252" },
|
||||
{ "Estonian", 0, 0x0425, 1257, 186, "CP1257" },
|
||||
{ "FYRO Macedonian", 0, 0x042F, 1251, 0, "CP1251" },
|
||||
{ "Faroese", 0, 0x0438, 1252, 0, "CP1252" },
|
||||
{ "Farsi", 0, 0x0429, 1256, 178, "CP1256" },
|
||||
{ "Finnish", 0, 0x040B, 1252, 0, "CP1252" },
|
||||
{ "French", "Belgium", 0x080C, 1252, 0, "CP1252" },
|
||||
{ "French", "Canada", 0x0C0C, 1252, 0, "CP1252" },
|
||||
{ "French", "France", 0x040C, 1252, 0, "CP1252" },
|
||||
{ "French", "Luxembourg", 0x140C, 1252, 0, "CP1252" },
|
||||
{ "French", "Switzerland", 0x100C, 1252, 0, "CP1252" },
|
||||
{ "German", "Austria", 0x0C07, 1252, 0, "CP1252" },
|
||||
{ "German", "Germany", 0x0407, 1252, 0, "CP1252" },
|
||||
{ "German", "Liechtenstein", 0x1407, 1252, 0, "CP1252" },
|
||||
{ "German", "Luxembourg", 0x1007, 1252, 0, "CP1252" },
|
||||
{ "German", "Switzerland", 0x0807, 1252, 0, "CP1252" },
|
||||
{ "Greek", 0, 0x0408, 1253, 161, "CP1253" },
|
||||
{ "Hebrew", 0, 0x040D, 1255, 177, "CP1255" },
|
||||
{ "Hindi", 0, 0x0439, 0, 0, "Latin1" },
|
||||
{ "Hungarian", 0, 0x040E, 1250, 238, "CP1250" },
|
||||
{ "Icelandic", 0, 0x040F, 1252, 0, "CP1252" },
|
||||
{ "Indonesian", 0, 0x0421, 1252, 0, "CP1252" },
|
||||
{ "Italian", "Italy", 0x0410, 1252, 0, "CP1252" },
|
||||
{ "Italian", "Switzerland", 0x0810, 1252, 0, "CP1252" },
|
||||
{ "Japanese", "Shift-JIS", 0x0411, 932, 128, "Shift-JIS" },
|
||||
{ "Japanese", "JIS7", 0x0411, 932, 128, "JIS7" },
|
||||
{ "Japanese", "eucJP", 0x0411, 932, 128, "eucJP" },
|
||||
{ "Korean", 0, 0x0412, 949, 129, "eucKR" },
|
||||
{ "Latvian", 0, 0x0426, 1257, 186, "CP1257" },
|
||||
{ "Lithuanian", 0, 0x0427, 1257, 186, "CP1257" },
|
||||
{ "Malay", "Brunei", 0x083E, 1252, 0, "CP1252" },
|
||||
{ "Malay", "Malaysia", 0x043E, 1252, 0, "CP1252" },
|
||||
{ "Maltese", 0, 0x043A, 0, 0, "Latin1" },
|
||||
{ "Marathi", 0, 0x044E, 0, 0, "Latin1" },
|
||||
{ "Norwegian", "Bokmal", 0x0414, 1252, 0, "CP1252" },
|
||||
{ "Norwegian", "Nynorsk", 0x0814, 1252, 0, "CP1252" },
|
||||
{ "Polish", 0, 0x0415, 1250, 238, "CP1250" },
|
||||
{ "Portuguese", "Brazil", 0x0416, 1252, 0, "CP1252" },
|
||||
{ "Portuguese", "Portugal", 0x0816, 1252, 0, "CP1252" },
|
||||
{ "Romanian", "Romania", 0x0418, 1250, 238, "CP1250" },
|
||||
{ "Russian", "Cyrillic", 0x0419, 1251, 204, "CP1251" },
|
||||
{ "Russian", "KOI-8", 0x7001, 2251, 204, "KOI8-R" },
|
||||
{ "Russian", "KOI-8 (TOC 1251)", 0x7002, 3251, 0, "CP1251/KOI8-R" },
|
||||
{ "Russian", "Cyrillic (TOC KOI8)", 0x7003, 3251, 0, "KOI8-R/CP1251" },
|
||||
{ "Sanskrit", 0, 0x044F, 0, 0, "Latin1" },
|
||||
{ "Serbian", "Cyrillic", 0x0C1A, 1251, 0, "CP1251" },
|
||||
{ "Serbian", "Latin", 0x081A, 1250, 238, "CP1250" },
|
||||
{ "Setsuana", 0, 0x0432, 1252, 0, "CP1252" },
|
||||
{ "Slovak", 0, 0x041B, 1250, 238, "CP1250" },
|
||||
{ "Slovenian", 0, 0x0424, 1250, 238, "CP1250" },
|
||||
{ "Spanish", "Argentina", 0x2C0A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Bolivia", 0x400A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Chile", 0x340A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Colombia", 0x240A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Costa Rica", 0x140A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Dominican Republic", 0x1C0A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Ecuador", 0x300A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "El Salvador", 0x440A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Guatemala", 0x100A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Honduras", 0x480A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Mexico", 0x080A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Nicaragua", 0x4C0A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Panama", 0x180A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Paraguay", 0x3C0A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Peru", 0x280A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Puerto Rico", 0x500A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Spain", 0x0C0A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Uruguay", 0x380A, 1252, 0, "CP1252" },
|
||||
{ "Spanish", "Venezuela", 0x200A, 1252, 0, "CP1252" },
|
||||
{ "Swahili", 0, 0x0441, 1252, 0, "CP1252" },
|
||||
{ "Swedish", "Finland", 0x081D, 1252, 0, "CP1252" },
|
||||
{ "Swedish", "Sweden", 0x041D, 1252, 0, "CP1252" },
|
||||
{ "Tamil", 0, 0x0449, 0, 0, "TSCII" },
|
||||
{ "Tatar", 0, 0x0444, 1251, 204, "CP1251" },
|
||||
{ "Thai", 0, 0x041E, 874, 222, "TIS-620" },
|
||||
{ "Turkish", 0, 0x041F, 1254, 162, "CP1254" },
|
||||
{ "Ukrainian", "Cyrillic", 0x0422, 1251, 0, "CP1251" },
|
||||
{ "Ukrainian", "KOI-8", 0x8422, 2251, 204, "KOI8-U" },
|
||||
{ "Unicode", "UTF-8", 0x7010, 0, 0, "UTF-8" },
|
||||
{ "Unicode", "UTF-16", 0x7011, 0, 0, "UTF-16" },
|
||||
{ "Urdu", 0, 0x0420, 1256, 178, "CP1256" },
|
||||
{ "Uzbek", "Cyrillic", 0x0843, 1251, 0, "CP1251" },
|
||||
{ "Uzbek", "Latin", 0x0443, 1254, 162, "CP1254" },
|
||||
{ "Vietnamese", 0, 0x042A, 1258, 163, "CP1258" },
|
||||
{ "Xhosa", 0, 0x0434, 1252, 0, "CP1252" },
|
||||
{ "Zulu", 0, 0x0435, 1252, 0, "CP1252" },
|
||||
{ 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
const LCHMTextEncoding * LCHMFileImpl::getTextEncodingTable()
|
||||
{
|
||||
return text_encoding_table;
|
||||
}
|
||||
|
||||
const LCHMTextEncoding * LCHMFileImpl::lookupByLCID( short lcid )
|
||||
{
|
||||
for ( const LCHMTextEncoding * t = text_encoding_table; t->language; t++ )
|
||||
if ( t->winlcid == lcid )
|
||||
return t;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
const LCHMTextEncoding * LCHMFileImpl::lookupByWinCharset( int charset )
|
||||
{
|
||||
for ( const text_encoding_t * t = text_encoding_table; t->charset; t++ )
|
||||
if ( t->wincharset == charset )
|
||||
return t;
|
||||
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int LCHMFileImpl::getEncodingIndex( const LCHMTextEncoding * enc)
|
||||
{
|
||||
for ( int i = 0; text_encoding_table[i].language; i++ )
|
||||
if ( (text_encoding_table + i) == enc )
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LIBCHMTEXTENCODING_H
|
||||
#define LIBCHMTEXTENCODING_H
|
||||
|
||||
|
||||
/*!
|
||||
* Represents a text encoding of CHM file; also has some useful routines.
|
||||
*/
|
||||
typedef struct LCHMTextEncoding
|
||||
{
|
||||
const char * language; //! French, English, etc. language == 0 represents the end of table.
|
||||
const char * sublanguage; //! French:Canada, French:France etc. May be 0 - no sublanguage
|
||||
int winlcid; //! Windows LCID for this language
|
||||
int wincodepage; //! Windows codepage for this language.
|
||||
int wincharset; //! Windows charset.
|
||||
const char * qtcodec; //! Qt text codec to use
|
||||
};
|
||||
|
||||
|
||||
#endif /* LIBCHMTEXTENCODING_H */
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,32 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
//! This class is used to retrieve the book TOC icons associated with images
|
||||
class LCHMTocImageKeeper
|
||||
{
|
||||
public:
|
||||
LCHMTocImageKeeper();
|
||||
const QPixmap * getImage( int id );
|
||||
|
||||
private:
|
||||
QPixmap m_images[LCHMBookIcons::MAX_BUILTIN_ICONS];
|
||||
};
|
@ -0,0 +1,122 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qdir.h>
|
||||
#include <qstring.h>
|
||||
#include <qregexp.h>
|
||||
|
||||
namespace LCHMUrlFactory
|
||||
{
|
||||
|
||||
static inline bool isRemoteURL( const QString & url, QString & protocol )
|
||||
{
|
||||
// Check whether the URL is external
|
||||
QRegExp uriregex ( "^(\\w+):\\/\\/" );
|
||||
QRegExp mailtoregex ( "^(mailto):" );
|
||||
|
||||
// mailto: can also have different format, so handle it
|
||||
if ( url.startsWith( "mailto:" ) )
|
||||
{
|
||||
protocol = "mailto";
|
||||
return true;
|
||||
}
|
||||
else if ( uriregex.search ( url ) != -1 )
|
||||
{
|
||||
QString proto = uriregex.cap ( 1 ).lower();
|
||||
|
||||
// Filter the URLs which need to be opened by a browser
|
||||
if ( proto == "http"
|
||||
|| proto == "ftp"
|
||||
|| proto == "mailto"
|
||||
|| proto == "news" )
|
||||
{
|
||||
protocol = proto;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Some JS urls start with javascript://
|
||||
static inline bool isJavascriptURL( const QString & url )
|
||||
{
|
||||
return url.startsWith ("javascript://");
|
||||
}
|
||||
|
||||
// Parse urls like "ms-its:file name.chm::/topic.htm"
|
||||
static inline bool isNewChmURL( const QString & url, QString & chmfile, QString & page )
|
||||
{
|
||||
QRegExp uriregex ( "^ms-its:(.*)::(.*)$" );
|
||||
|
||||
if ( uriregex.search ( url ) != -1 )
|
||||
{
|
||||
chmfile = uriregex.cap ( 1 );
|
||||
page = uriregex.cap ( 2 );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline QString makeURLabsoluteIfNeeded( const QString & url )
|
||||
{
|
||||
QString p1, p2, newurl = url;
|
||||
|
||||
if ( !isRemoteURL (url, p1)
|
||||
&& !isJavascriptURL (url)
|
||||
&& !isNewChmURL (url, p1, p2) )
|
||||
{
|
||||
newurl = QDir::cleanDirPath (url);
|
||||
|
||||
// Normalize url, so it becomes absolute
|
||||
if ( newurl[0] != '/' )
|
||||
newurl = "/" + newurl;
|
||||
}
|
||||
|
||||
//qDebug ("makeURLabsolute (%s) -> (%s)", url.ascii(), newurl.ascii());
|
||||
return newurl;
|
||||
}
|
||||
|
||||
|
||||
// Returns a special string, which allows the kio-slave, or viewwindow-browser iteraction
|
||||
// to regognize our own internal urls, which is necessary to show image-only pages.
|
||||
static inline QString getInternalUriExtension()
|
||||
{
|
||||
return ".KCHMVIEWER_SPECIAL_HANDLER";
|
||||
}
|
||||
|
||||
|
||||
static inline bool handleFileType( const QString& link, QString& generated )
|
||||
{
|
||||
QString intext = getInternalUriExtension();
|
||||
|
||||
if ( !link.endsWith( intext ) )
|
||||
return false;
|
||||
|
||||
QString filelink = link.left( link.length() - strlen( intext ) );
|
||||
generated = "<html><body><img src=\"" + filelink + "\"></body></html>";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
};
|
@ -0,0 +1,259 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Albert Astals Cid, aacid@kde.org *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qdir.h>
|
||||
|
||||
#include "qt34.h"
|
||||
|
||||
LIBCHMCString::LIBCHMCString()
|
||||
{
|
||||
}
|
||||
|
||||
LIBCHMCString::LIBCHMCString(const char *string)
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
cs = QByteArray(string);
|
||||
#else
|
||||
cs = QCString(string);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
const char *LIBCHMCString::toCString() const
|
||||
{
|
||||
return cs.data();
|
||||
}
|
||||
|
||||
|
||||
void LIBCHMCString::clear()
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
cs = QByteArray();
|
||||
#else
|
||||
cs = QCString();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool LIBCHMCString::operator==(const QString &string) const
|
||||
{
|
||||
return QString(cs) == string;
|
||||
}
|
||||
|
||||
uint LIBCHMCString::length() const
|
||||
{
|
||||
return cs.length();
|
||||
}
|
||||
|
||||
bool LIBCHMCString::isEmpty() const
|
||||
{
|
||||
return cs.isEmpty();
|
||||
}
|
||||
|
||||
void LIBCHMCString::prepend(char c)
|
||||
{
|
||||
cs = c + cs;
|
||||
}
|
||||
|
||||
char LIBCHMCString::at(uint i) const
|
||||
{
|
||||
return cs.at(i);
|
||||
}
|
||||
|
||||
void LIBCHMCString::replace(uint index, uint len, const char *str)
|
||||
{
|
||||
cs.replace(index, len, str);
|
||||
}
|
||||
|
||||
void LIBCHMCString::remove(uint index, uint len)
|
||||
{
|
||||
cs.remove(index, len);
|
||||
}
|
||||
|
||||
LIBCHMCString LIBCHMCString::lower()
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return cs.toLower().data();
|
||||
#else
|
||||
return cs.lower().data();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
LIBCHMRegExp::LIBCHMRegExp(const QString ®exp)
|
||||
{
|
||||
re = QRegExp(regexp);
|
||||
}
|
||||
|
||||
int LIBCHMRegExp::search(const QString &str, int offset)
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return re.indexIn(str, offset);
|
||||
#else
|
||||
return re.search(str, offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString LIBCHMRegExp::cap(int nth)
|
||||
{
|
||||
return re.cap(nth);
|
||||
}
|
||||
|
||||
void LIBCHMRegExp::setMinimal(bool minimal)
|
||||
{
|
||||
return re.setMinimal(minimal);
|
||||
}
|
||||
|
||||
int LIBCHMRegExp::matchedLength() const
|
||||
{
|
||||
return re.matchedLength();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
LIBCHMString::LIBCHMString()
|
||||
{
|
||||
}
|
||||
|
||||
LIBCHMString::LIBCHMString(const QString &string)
|
||||
{
|
||||
s = string;
|
||||
}
|
||||
|
||||
LIBCHMString::LIBCHMString(const char *string)
|
||||
{
|
||||
s = QString(string);
|
||||
}
|
||||
|
||||
QString LIBCHMString::lower() const
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return s.toLower();
|
||||
#else
|
||||
return s.lower();
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *LIBCHMString::ascii() const
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return s.toAscii();
|
||||
#else
|
||||
return s.ascii();
|
||||
#endif
|
||||
}
|
||||
|
||||
int LIBCHMString::find(char c, int index) const
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return s.indexOf(c, index);
|
||||
#else
|
||||
return s.find(c, index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int LIBCHMString::find(const QChar &c, int index) const
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return s.indexOf(c, index);
|
||||
#else
|
||||
return s.find(c, index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int LIBCHMString::find(const QString &string, int index, bool cs) const
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
Qt::CaseSensitivity cse;
|
||||
if (cs) cse = Qt::CaseSensitive;
|
||||
else cse = Qt::CaseInsensitive;
|
||||
return s.indexOf(string, index, cse);
|
||||
#else
|
||||
return s.find(string, index, cs);
|
||||
#endif
|
||||
}
|
||||
|
||||
int LIBCHMString::findRev(char c) const
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return s.lastIndexOf(c);
|
||||
#else
|
||||
return s.findRev(c);
|
||||
#endif
|
||||
}
|
||||
|
||||
QChar LIBCHMString::at(uint i) const
|
||||
{
|
||||
return s.at(i);
|
||||
}
|
||||
|
||||
QString LIBCHMString::left(uint len) const
|
||||
{
|
||||
return s.left(len);
|
||||
}
|
||||
|
||||
LIBCHMString LIBCHMString::mid(uint index, uint len) const
|
||||
{
|
||||
return s.mid(index, len);
|
||||
}
|
||||
|
||||
bool LIBCHMString::isEmpty() const
|
||||
{
|
||||
return s.isEmpty();
|
||||
}
|
||||
|
||||
QString LIBCHMString::toString() const
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
bool LIBCHMString::operator==(const QString &string) const
|
||||
{
|
||||
return s == string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString LIBCHMDir::cleanDirPath(const QString &dir)
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return QDir::cleanPath(dir);
|
||||
#else
|
||||
return QDir::cleanDirPath(dir);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool LIBCHMStringList::contains(const QStringList &list, const QString &string)
|
||||
{
|
||||
return list.contains(string);
|
||||
}
|
||||
|
||||
QStringList LIBCHMStringList::split(const QRegExp ®exp, const QString &string)
|
||||
{
|
||||
#if defined (USE_QT_4)
|
||||
return string.split(regexp, QString::SkipEmptyParts);
|
||||
#else
|
||||
return QStringList::split(regexp, string);
|
||||
#endif
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Albert Astals Cid, aacid@kde.org *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_QT34_H
|
||||
#define INCLUDE_QT34_H
|
||||
|
||||
#include <qregexp.h>
|
||||
#include <qstring.h>
|
||||
|
||||
// Qt3/Qt4 compatibility: in Qt3 QVector stores pointers, not values - so QValueVector should be used.
|
||||
// In Qt4 QVector stores values, so we can use QVector
|
||||
#if defined (USE_QT_4)
|
||||
#define LIBCHMVector QVector
|
||||
#else
|
||||
#include <qvaluevector.h>
|
||||
#define LIBCHMVector QValueVector
|
||||
#endif
|
||||
|
||||
#if defined (USE_QT_4)
|
||||
#define LIBCHMMemArray QVector
|
||||
#else
|
||||
#define LIBCHMMemArray QMemArray
|
||||
#endif
|
||||
|
||||
class LIBCHMCString
|
||||
{
|
||||
public:
|
||||
LIBCHMCString();
|
||||
LIBCHMCString(const char *string);
|
||||
|
||||
const char *toCString() const;
|
||||
|
||||
void clear();
|
||||
|
||||
bool operator==(const QString &string) const;
|
||||
uint length() const;
|
||||
bool isEmpty() const;
|
||||
void prepend(char c);
|
||||
char at(uint i) const;
|
||||
void replace(uint index, uint len, const char *str);
|
||||
void remove(uint index, uint len);
|
||||
LIBCHMCString lower();
|
||||
|
||||
private:
|
||||
#if defined (USE_QT_4)
|
||||
QByteArray cs;
|
||||
#else
|
||||
QCString cs;
|
||||
#endif
|
||||
};
|
||||
|
||||
class LIBCHMRegExp
|
||||
{
|
||||
public:
|
||||
LIBCHMRegExp(const QString ®exp);
|
||||
|
||||
int search(const QString &str, int offset = 0);
|
||||
QString cap(int nth);
|
||||
void setMinimal(bool minimal);
|
||||
int matchedLength() const;
|
||||
|
||||
private:
|
||||
QRegExp re;
|
||||
};
|
||||
|
||||
class LIBCHMString
|
||||
{
|
||||
public:
|
||||
LIBCHMString();
|
||||
LIBCHMString(const QString &string);
|
||||
LIBCHMString(const char *string);
|
||||
|
||||
QString lower() const;
|
||||
const char *ascii() const;
|
||||
int find(char c, int index = -1) const;
|
||||
int find(const QChar &c, int index) const;
|
||||
int find(const QString &string, int index, bool cs) const;
|
||||
int findRev(char c) const;
|
||||
QChar at(uint i) const;
|
||||
QString left(uint len) const;
|
||||
LIBCHMString mid(uint index, uint len = 0xffffffff) const;
|
||||
bool isEmpty() const;
|
||||
|
||||
QString toString() const;
|
||||
|
||||
bool operator==(const QString &string) const;
|
||||
|
||||
private:
|
||||
QString s;
|
||||
};
|
||||
|
||||
class LIBCHMDir
|
||||
{
|
||||
public:
|
||||
static QString cleanDirPath(const QString &dir);
|
||||
};
|
||||
|
||||
class LIBCHMStringList
|
||||
{
|
||||
public:
|
||||
static bool contains(const QStringList &list, const QString &string);
|
||||
static QStringList split(const QRegExp ®exp, const QString &string);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1 @@
|
||||
POFILES = AUTO
|
@ -0,0 +1,845 @@
|
||||
# translation of kchmviewer.po to
|
||||
# This file is put in the public domain.
|
||||
#
|
||||
# Hynek Fabian <hynek.fabian@mobilbonus.cz>, 2006.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: kchmviewer\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-03-13 20:31-0700\n"
|
||||
"PO-Revision-Date: 2006-08-31 20:54+0200\n"
|
||||
"Last-Translator: Hynek Fabian <hynek.fabian@mobilbonus.cz>\n"
|
||||
"Language-Team: <cs@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.2\n"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 24
|
||||
#: rc.cpp:3
|
||||
#, no-c-format
|
||||
msgid "KchmViewer settings"
|
||||
msgstr "Nastavení KchmViewer"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 54
|
||||
#: rc.cpp:6
|
||||
#, no-c-format
|
||||
msgid "General behavior"
|
||||
msgstr "Běžné chovaní"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 73
|
||||
#: rc.cpp:9
|
||||
#, no-c-format
|
||||
msgid "If no arguments given on load"
|
||||
msgstr "Bez parametrů při spučtení"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 84
|
||||
#: rc.cpp:12
|
||||
#, no-c-format
|
||||
msgid "Open the 'open CHM file' dialog"
|
||||
msgstr "Ukaž dialog 'Výběr CHM souboru'"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 92
|
||||
#: rc.cpp:15
|
||||
#, no-c-format
|
||||
msgid "Open the &last used CHM file, if exist"
|
||||
msgstr "Otevři pos&lední používaný CHM soubor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 95
|
||||
#: rc.cpp:18
|
||||
#, no-c-format
|
||||
msgid "Alt+L"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 105
|
||||
#: rc.cpp:21
|
||||
#, no-c-format
|
||||
msgid "History"
|
||||
msgstr "Historie"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 124
|
||||
#: rc.cpp:24
|
||||
#, no-c-format
|
||||
msgid "Store history information for"
|
||||
msgstr "Uschovat informace o historii posledních"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 143
|
||||
#: rc.cpp:28
|
||||
#, no-c-format
|
||||
msgid "latest files"
|
||||
msgstr "souborů"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 153
|
||||
#: rc.cpp:31
|
||||
#, no-c-format
|
||||
msgid "R&emember extra information for history files"
|
||||
msgstr "Pamatovat si &extra informace souborů historie"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 156
|
||||
#: rc.cpp:34
|
||||
#, no-c-format
|
||||
msgid "Alt+E"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 159
|
||||
#: rc.cpp:37
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Remembers the information about the files, which were opened. Remembers last "
|
||||
"opened page, search history, font size, bookmarks and so on."
|
||||
msgstr ""
|
||||
"Pamatuje si poslední otevřenou stránku, historii hledání, velikost písma, "
|
||||
"záložky a podobné informace o prohlížených souborech."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 171
|
||||
#: rc.cpp:40
|
||||
#, no-c-format
|
||||
msgid "CHM security settings"
|
||||
msgstr "Bezpečnostní volby"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 182
|
||||
#: rc.cpp:43
|
||||
#, no-c-format
|
||||
msgid "When external link clicked"
|
||||
msgstr "Při kliknutí na externí odkaz"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 193
|
||||
#: rc.cpp:46
|
||||
#, no-c-format
|
||||
msgid "Alwa&ys open it in external browser"
|
||||
msgstr "Vžd&y otevřít v externím prohlížeči"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 196
|
||||
#: rc.cpp:49
|
||||
#, no-c-format
|
||||
msgid "Alt+Y"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 204
|
||||
#. i18n: file kchmsetupdialog.ui line 244
|
||||
#: rc.cpp:52 rc.cpp:65
|
||||
#, no-c-format
|
||||
msgid "Ask for confirmation"
|
||||
msgstr "Vyžádat si potvrzení"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 212
|
||||
#: rc.cpp:55
|
||||
#, no-c-format
|
||||
msgid "Do not open the link"
|
||||
msgstr "Neotevírat odkaz"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 225
|
||||
#: rc.cpp:59
|
||||
#, no-c-format
|
||||
msgid "When link pointed to a new CHM file clicked"
|
||||
msgstr "Při kliknutí na odkaz na jiný CHM soubor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 236
|
||||
#: rc.cpp:62
|
||||
#, no-c-format
|
||||
msgid "Always open a new CHM file"
|
||||
msgstr "Otevřít odkazovaný CHM soubor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 252
|
||||
#: rc.cpp:68
|
||||
#, no-c-format
|
||||
msgid "Do not open a new CHM file"
|
||||
msgstr "Neotvírat odkazovaný soubor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 266
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid "Version-specific settings"
|
||||
msgstr "Zvláštní nastavení verzí"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 277
|
||||
#: rc.cpp:74
|
||||
#, no-c-format
|
||||
msgid "Qt version settings"
|
||||
msgstr "Nastavení Qt verze"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 299
|
||||
#: rc.cpp:77
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Enter the path to the program, which will be used as a browser for external "
|
||||
"links. A <i>%s</i> symbol will be replaced by the URL clicked."
|
||||
msgstr ""
|
||||
"Cesta k externímu prohlížeči. Symbol <i>%s</i> bude nahrazen volanou URL."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 325
|
||||
#: rc.cpp:80
|
||||
#, no-c-format
|
||||
msgid "KDE version settings"
|
||||
msgstr "Nastavení KDE verze"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 336
|
||||
#: rc.cpp:83
|
||||
#, no-c-format
|
||||
msgid "To show HTML content, use"
|
||||
msgstr "HTML obsah zobrazit pomocí"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 347
|
||||
#: rc.cpp:86
|
||||
#, no-c-format
|
||||
msgid "&QTextBrowser-based widget"
|
||||
msgstr "&QTextBrowser prvku"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 350
|
||||
#: rc.cpp:89
|
||||
#, no-c-format
|
||||
msgid "Alt+Q"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 358
|
||||
#: rc.cpp:92
|
||||
#, no-c-format
|
||||
msgid "&KHTMLPart-based widget"
|
||||
msgstr "&KHTMLPart prvku"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 361
|
||||
#: rc.cpp:95
|
||||
#, no-c-format
|
||||
msgid "Alt+K"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 371
|
||||
#: rc.cpp:98
|
||||
#, no-c-format
|
||||
msgid "KHTMLPart security"
|
||||
msgstr "Zabezpečení KHTMLPart"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 382
|
||||
#: rc.cpp:101
|
||||
#, no-c-format
|
||||
msgid "Enable Java&Script"
|
||||
msgstr "Povolit Java&Script"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 385
|
||||
#: rc.cpp:104
|
||||
#, no-c-format
|
||||
msgid "Alt+S"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 393
|
||||
#: rc.cpp:107
|
||||
#, no-c-format
|
||||
msgid "Enable &plugins"
|
||||
msgstr "&Povolit moduly"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 396
|
||||
#: rc.cpp:110
|
||||
#, no-c-format
|
||||
msgid "Alt+P"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 404
|
||||
#: rc.cpp:113
|
||||
#, no-c-format
|
||||
msgid "Enable &Java"
|
||||
msgstr "Povolit &Javu"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 407
|
||||
#: rc.cpp:116
|
||||
#, no-c-format
|
||||
msgid "Alt+J"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 415
|
||||
#: rc.cpp:119
|
||||
#, no-c-format
|
||||
msgid "Enable &refresh"
|
||||
msgstr "Povolit obnovení"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 418
|
||||
#: rc.cpp:122
|
||||
#, no-c-format
|
||||
msgid "Alt+R"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 432
|
||||
#: rc.cpp:125
|
||||
#, no-c-format
|
||||
msgid "Advanced"
|
||||
msgstr "Rozšířené nastavení"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 443
|
||||
#: rc.cpp:128
|
||||
#, no-c-format
|
||||
msgid "View HTML source command uses"
|
||||
msgstr "Prohlížeč zdrojového kódu HTML"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 454
|
||||
#: rc.cpp:131
|
||||
#, no-c-format
|
||||
msgid "Built-in HTML source viewer"
|
||||
msgstr "Zabudovaný prohlížeč zdrojového kódu"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 465
|
||||
#: rc.cpp:135
|
||||
#, no-c-format
|
||||
msgid "E&xternal program, specified below"
|
||||
msgstr "E&xterní program uvedený níže"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 468
|
||||
#: rc.cpp:138
|
||||
#, no-c-format
|
||||
msgid "Alt+X"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 484
|
||||
#: rc.cpp:141
|
||||
#, no-c-format
|
||||
msgid "External program:"
|
||||
msgstr "Externí prohlížeč:"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 501
|
||||
#: rc.cpp:144
|
||||
#, fuzzy, no-c-format
|
||||
msgid "Search engine to use"
|
||||
msgstr "Hledání nevedlo k žádnému výsledku"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 528
|
||||
#: rc.cpp:148
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use the search based on internal CHM index. This engine cannot search for "
|
||||
"any symbols except underscode, does not support multibyte languages, and is "
|
||||
"not always available."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 555
|
||||
#: rc.cpp:152
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use new kchmviewer internal search engine (recommended). This engine "
|
||||
"indexes symbols, so it is possible to search for special symbols (like \"C++"
|
||||
"\"). All languages are supported. The index will be generated before the "
|
||||
"first search."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 588
|
||||
#: rc.cpp:158
|
||||
#, no-c-format
|
||||
msgid "F1"
|
||||
msgstr ""
|
||||
|
||||
#: _translatorinfo.cpp:1
|
||||
msgid ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Your names"
|
||||
msgstr "Hynek Fabian"
|
||||
|
||||
#: _translatorinfo.cpp:3
|
||||
msgid ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"Your emails"
|
||||
msgstr "radonek@gmail.com"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:44
|
||||
msgid "&Add"
|
||||
msgstr "Přid&at"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:46
|
||||
msgid "&Del"
|
||||
msgstr "O&dstranit"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:88
|
||||
msgid "%1 - add a bookmark"
|
||||
msgstr "%1 - vložení záložky"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:89 kchmbookmarkwindow.cpp:131
|
||||
msgid "Enter the name for this bookmark:"
|
||||
msgstr "Zadejte jméno záložky"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:130
|
||||
msgid "%1 - edit the bookmark name"
|
||||
msgstr "%1 - změna názvu záložky"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:201
|
||||
msgid "&Add bookmark"
|
||||
msgstr "Přid&at záložku"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:34
|
||||
msgid "Topics"
|
||||
msgstr "Témata"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:39
|
||||
msgid "Please select one of the topics below:"
|
||||
msgstr "Zvolte si jedno z níže uvedených témat:"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:43
|
||||
msgid "&Ok"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:122
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"%1 version %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2004-2007\n"
|
||||
"http://www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Licensed under GNU GPL license.\n"
|
||||
"\n"
|
||||
"Please check my another project, http://www.transientmail.com - temporary e-"
|
||||
"mail address, which expires automatically."
|
||||
msgstr ""
|
||||
"%1 verze %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2005-2006\n"
|
||||
"www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Licencováno GNU GPL.\n"
|
||||
"\n"
|
||||
"Zkuste náš další projekt, www.transientmail.com - dočasná adresa "
|
||||
"elektronické pošty která časem sama zaniká."
|
||||
|
||||
#: kchmmainwindow.cpp:139
|
||||
msgid "*.chm|Compressed Help Manual (*.chm)"
|
||||
msgstr "*.chm|Soubory nápovědy (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:141
|
||||
msgid "Compressed Help Manual (*.chm)"
|
||||
msgstr "Soubory nápovědy (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:151
|
||||
msgid "Loading aborted"
|
||||
msgstr "Načítaní přerušeno"
|
||||
|
||||
#: kchmmainwindow.cpp:261
|
||||
msgid "%1 - failed to load the chm file"
|
||||
msgstr "%1 - načtení souboru s nápovědou se nezdařilo"
|
||||
|
||||
#: kchmmainwindow.cpp:262
|
||||
msgid "Unable to load the chm file %1"
|
||||
msgstr "Nepovedlo se načíst soubor nápovědy %1"
|
||||
|
||||
#: kchmmainwindow.cpp:272
|
||||
msgid "Could not load file %1"
|
||||
msgstr "Nelze číst soubor %1"
|
||||
|
||||
#: kchmmainwindow.cpp:288
|
||||
msgid "About %1"
|
||||
msgstr "O aplikaci %1"
|
||||
|
||||
#: kchmmainwindow.cpp:374
|
||||
msgid "%1 - remote link clicked - %2"
|
||||
msgstr "%1 - aktivován externí odkaz - %2"
|
||||
|
||||
#: kchmmainwindow.cpp:375
|
||||
msgid ""
|
||||
"A remote link %1 will start the external program to open it.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"Odkaz %1 bude otevřen v externím prohlížeči.\n"
|
||||
"\n"
|
||||
"Přejete si pokračovat?"
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&Yes"
|
||||
msgstr "&Ano"
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&No"
|
||||
msgstr "&Ne"
|
||||
|
||||
#: kchmmainwindow.cpp:400
|
||||
msgid "%1 - JavsScript link clicked"
|
||||
msgstr "%1 - aktivován JavaScript odkaz"
|
||||
|
||||
#: kchmmainwindow.cpp:401
|
||||
msgid ""
|
||||
"You have clicked a JavaScript link.\n"
|
||||
"To prevent security-related issues JavaScript URLs are disabled in CHM files."
|
||||
msgstr ""
|
||||
"Kliknuli jste na JavaScriptový odkaz\n"
|
||||
"Z bezpečnostních důvodů je použití JavaScriptových adres v souborech "
|
||||
"nápovědy potlačeno."
|
||||
|
||||
#: kchmmainwindow.cpp:409
|
||||
msgid "%1 - link to a new CHM file clicked"
|
||||
msgstr "%1 - aktivován odkaz na CHM soubor"
|
||||
|
||||
#: kchmmainwindow.cpp:410
|
||||
msgid ""
|
||||
"You have clicked a link, which leads to a new CHM file %1.\n"
|
||||
"The current file will be closed.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"Kliknuli jste na odkaz ukazující na soubor nápovědy %1.\n"
|
||||
"Aktuální soubor bude uzavřen.\n"
|
||||
"\n"
|
||||
"Přejete si pokračovat ?"
|
||||
|
||||
#: kchmmainwindow.cpp:474
|
||||
msgid "File Operations"
|
||||
msgstr "Práce se soubory"
|
||||
|
||||
#: kchmmainwindow.cpp:478
|
||||
msgid "Open File"
|
||||
msgstr "Otevřít"
|
||||
|
||||
#: kchmmainwindow.cpp:484
|
||||
msgid "Click this button to open an existing chm file."
|
||||
msgstr "Výběr existujícího souboru nápovědy k prohlížení"
|
||||
|
||||
#: kchmmainwindow.cpp:489
|
||||
msgid "Print File"
|
||||
msgstr "Tisk"
|
||||
|
||||
#: kchmmainwindow.cpp:495
|
||||
msgid "Click this button to print the current page"
|
||||
msgstr "Stiskem toho tlačítka vytisknete současnou stránku"
|
||||
|
||||
#: kchmmainwindow.cpp:510
|
||||
msgid "E&xtract CHM content..."
|
||||
msgstr "Ro&zbalit..."
|
||||
|
||||
#: kchmmainwindow.cpp:511
|
||||
msgid ""
|
||||
"Click this button to extract the whole CHM file content into a specific "
|
||||
"directory"
|
||||
msgstr ""
|
||||
"Tímto tlačítkem extrahujete obsah souboru nápovědy do zadaného adresáře"
|
||||
|
||||
#: kchmmainwindow.cpp:517
|
||||
msgid "&Recent files"
|
||||
msgstr "Ot&evřít nedávný"
|
||||
|
||||
#: kchmmainwindow.cpp:526
|
||||
msgid "&Select all"
|
||||
msgstr "&Vybrat vše"
|
||||
|
||||
#: kchmmainwindow.cpp:544
|
||||
msgid "&Change settings..."
|
||||
msgstr "&Změnit nastavení"
|
||||
|
||||
#: kchmmainwindow.cpp:551
|
||||
msgid "About &Qt"
|
||||
msgstr "O &Qt"
|
||||
|
||||
#: kchmmainwindow.cpp:553
|
||||
msgid "What's &This"
|
||||
msgstr "Co je &tohle ?"
|
||||
|
||||
#: kchmmainwindow.cpp:836
|
||||
msgid ""
|
||||
"Changing browser view options or search engine used\n"
|
||||
"requires restarting the application to take effect."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:954
|
||||
msgid "Index"
|
||||
msgstr "Obsah"
|
||||
|
||||
#: kchmmainwindow.cpp:977 kchmsearchengine.cpp:246
|
||||
msgid "Search"
|
||||
msgstr "Hledání"
|
||||
|
||||
#: kchmmainwindow.cpp:1044
|
||||
msgid "Could not locate opened topic in content window"
|
||||
msgstr "Téma nebylo nalezeno"
|
||||
|
||||
#: kchmmainwindow.cpp:1056 kchmmainwindow.cpp:1062
|
||||
msgid "Choose a directory to store CHM content"
|
||||
msgstr "Zvolte cílový adresář"
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting CHM content"
|
||||
msgstr "Rozbaluji soubor nápovědy"
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting files..."
|
||||
msgstr "Extrakce souborů..."
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Abort"
|
||||
msgstr "Přerušit"
|
||||
|
||||
#: kchmnavtoolbar.cpp:33
|
||||
msgid "Navigation"
|
||||
msgstr "Navigace"
|
||||
|
||||
#: kchmnavtoolbar.cpp:37
|
||||
msgid "Move backward in history"
|
||||
msgstr "Předchozí"
|
||||
|
||||
#: kchmnavtoolbar.cpp:42
|
||||
msgid "Click this button to move backward in browser history"
|
||||
msgstr "Přesun v historii o krok zpět"
|
||||
|
||||
#: kchmnavtoolbar.cpp:46
|
||||
msgid "Move forward in history"
|
||||
msgstr "Vpřed"
|
||||
|
||||
#: kchmnavtoolbar.cpp:51
|
||||
msgid "Click this button to move forward in browser history"
|
||||
msgstr "Přesun v historii o krok vpřed"
|
||||
|
||||
#: kchmnavtoolbar.cpp:55
|
||||
msgid "Go to the home page"
|
||||
msgstr "Úvodní stránka"
|
||||
|
||||
#: kchmnavtoolbar.cpp:60
|
||||
msgid "Click this button to move to the home page"
|
||||
msgstr "Přesun na úvodní stranu"
|
||||
|
||||
#: kchmsearchengine.cpp:246
|
||||
msgid "A closing quote character is missing."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:50
|
||||
msgid "Find in page"
|
||||
msgstr "Hledání na stránce"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:67
|
||||
msgid "Enter here the text to search in the current page."
|
||||
msgstr "Zde zadaný text bude vyhledán na aktuální stránce"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:74
|
||||
msgid "Previous search result"
|
||||
msgstr "Předešlý výsledek hledání"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:79
|
||||
msgid "Click this button to find previous search result."
|
||||
msgstr "Stiskem toho tlačítka se vrátíte předešlý nalezený výraz"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:83
|
||||
msgid "Next search result"
|
||||
msgstr "Další výsledek hledání"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:88
|
||||
msgid "Click this button to find next search result."
|
||||
msgstr "Stiskem tohoto tlačítka se přesunete na další výskyt hledaného výrazu"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:92
|
||||
msgid "Locate this topic in content window"
|
||||
msgstr "Vyhledej toto téma"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:97
|
||||
msgid ""
|
||||
"Click this button to find current topic in the content window, and open it."
|
||||
msgstr "Stiskem tohoto tlačítka otevřete okno s obsahem na aktuálním tématu"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:101
|
||||
msgid "Increase font size"
|
||||
msgstr "Zvětšit písmo"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:106
|
||||
msgid "Click this button to increase the font size."
|
||||
msgstr "Toto tlačítko zvětší velikost použitého písma"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:110
|
||||
msgid "Decrease font size"
|
||||
msgstr "Zmenšit písmo"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:115
|
||||
msgid "Click this button to decrease the font size."
|
||||
msgstr "Toto tlačítko zmenší velikost použítého písma"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:119
|
||||
msgid "View HTML source"
|
||||
msgstr "Zobrazit zdrojový kód"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:124
|
||||
msgid "Click this button to open a separate window with the page HTML source."
|
||||
msgstr ""
|
||||
"Stisknutím tohoto tlačítka otevřete okno s HTML zdrojovým kódem stránky"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:128
|
||||
msgid "Add to bookmarks"
|
||||
msgstr "Přidat k záložkám"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:133
|
||||
msgid "Click this button to add the current page to the bookmarks list."
|
||||
msgstr "Tímto čudlíkem přidáte aktuální stránku mezi záložky"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:136
|
||||
msgid "Prev page in TOC"
|
||||
msgstr "Předchozí stránka"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:141
|
||||
msgid "Click this button to go to previous page in Table Of Content."
|
||||
msgstr "Přesun na obsahově předcházející stránku"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:144
|
||||
msgid "Next page in TOC"
|
||||
msgstr "Následující stránka"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:149
|
||||
msgid "Click this button to go to next page in Table of Content."
|
||||
msgstr "Přesun na obsahově následující stránku"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:155
|
||||
msgid "&Increase font"
|
||||
msgstr "Z&většit písmo"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:156
|
||||
msgid "&Decrease font"
|
||||
msgstr "Z&menšit písmo"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:157
|
||||
msgid "&View HTML source"
|
||||
msgstr "&Zobrazit zdroj"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:160
|
||||
msgid "&Bookmark this page"
|
||||
msgstr "&Přidat záložku"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:163
|
||||
msgid "&Full screen"
|
||||
msgstr "&Celá obrazovka"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:165
|
||||
msgid "&Show contents window"
|
||||
msgstr "&Okno obsahu"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:167
|
||||
msgid "&Locate in contents window"
|
||||
msgstr "&Najít v obsahu"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:220
|
||||
msgid "&Set language"
|
||||
msgstr "Vybrat &jazyk"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:243
|
||||
msgid "&Set codepage"
|
||||
msgstr "Vybrat &kódování"
|
||||
|
||||
#: kchmsearchwindow.cpp:43
|
||||
msgid "Type in word(s) to search for:"
|
||||
msgstr "Zadejte hledaná slova:"
|
||||
|
||||
#: kchmsearchwindow.cpp:46
|
||||
msgid "<a href=\"q\"><b>Help</b></a>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:58
|
||||
msgid "Go"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:66
|
||||
msgid "Title"
|
||||
msgstr "Titul"
|
||||
|
||||
#: kchmsearchwindow.cpp:67
|
||||
msgid "Location"
|
||||
msgstr "Umístění"
|
||||
|
||||
#: kchmsearchwindow.cpp:130
|
||||
msgid "Search returned %1 result(s)"
|
||||
msgstr "Nalezeno %1 výsledků"
|
||||
|
||||
#: kchmsearchwindow.cpp:133
|
||||
msgid "Search returned no results"
|
||||
msgstr "Hledání nevedlo k žádnému výsledku"
|
||||
|
||||
#: kchmsearchwindow.cpp:136 kchmviewwindow_qtextbrowser.cpp:211
|
||||
msgid "Search failed"
|
||||
msgstr "Hledání se nezdařilo"
|
||||
|
||||
#: kchmsearchwindow.cpp:169 kchmsearchwindow.cpp:175
|
||||
msgid "How to use search"
|
||||
msgstr "Jak používat vyhledávání"
|
||||
|
||||
#: kchmsearchwindow.cpp:170
|
||||
msgid ""
|
||||
"<html><p>The improved search engine allows you to search for a word, symbol "
|
||||
"or phrase, which is set of words and symbols included in quotes. Only the "
|
||||
"documents which include all the terms speficide in th search query are "
|
||||
"shown; no prefixes needed.<p>Unlike MS CHM internal search index, my "
|
||||
"improved search engine indexes everything, including special symbols. "
|
||||
"Therefore it is possible to search (and find!) for something like <i>$q = "
|
||||
"new ChmFile();</i>. This search also fully supports Unicode, which means "
|
||||
"that you can search in non-English documents.<p>If you want to search for a "
|
||||
"quote symbol, use quotation mark instead. The engine treats a quote and a "
|
||||
"quotation mark as the same symbol, which allows to use them in phrases.</"
|
||||
"html>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:176
|
||||
msgid ""
|
||||
"The search query can contain a few prefixes.\n"
|
||||
"A set of words inside the quote marks mean that you are searching for exact "
|
||||
"phrase.\n"
|
||||
"A word with minus sign means that it should be absent in the search result.\n"
|
||||
"A word with plus mark or without any mark means that it must be present in "
|
||||
"the search result.\n"
|
||||
"\n"
|
||||
"Note that only letters and digits are indexed.\n"
|
||||
"You cannot search for non-character symbols other than underscope, and those "
|
||||
"symbols will be removed from the search query.\n"
|
||||
"For example, search for 'C' will give the same result as searching for 'C++'."
|
||||
msgstr ""
|
||||
"Hledaný výraz může obsahovat několik prefixů.\n"
|
||||
"Vložení několika slov do uvozovek značí že chcete najít přesnou frázi.\n"
|
||||
"Slovo se znaménkem minus se ve výsledku nebude vyskytovat.\n"
|
||||
"Slovo se znaménkem plus nebo bez znaménka musí být ve výsledku přítomno.\n"
|
||||
"\n"
|
||||
"Hledání bere v úvahu pouze písmena, číslice a znak podtržítka.\n"
|
||||
"Ostatní znaky budou z hledaného výrazu odstraněny.\n"
|
||||
"Například hledání 'C' povede ke stejným výsledkům jako hledaní 'C++'."
|
||||
|
||||
#: kchmsearchwindow.cpp:226
|
||||
#, fuzzy
|
||||
msgid "Search is not available"
|
||||
msgstr "Hledání se nezdařilo"
|
||||
|
||||
#: kchmsearchwindow.cpp:227
|
||||
msgid ""
|
||||
"<p>The search feature is not avaiable for this chm file.<p>The old search "
|
||||
"engine depends on indexes present in chm files itself. Not every chm file "
|
||||
"has an index; it is set up during chm file creation. Therefore if the search "
|
||||
"index was not created during chm file creation, this makes search impossible."
|
||||
"<p>Solution: use new search engine (menu Settings/Advanced), which generates "
|
||||
"its own index."
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:171
|
||||
msgid "Printing (page %1)..."
|
||||
msgstr "Probíhá tisk strany %1 ..."
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:179
|
||||
msgid "Printing completed"
|
||||
msgstr "Tisk dokončen"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:183
|
||||
msgid "Printing aborted"
|
||||
msgstr "Tisk přerušen"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:189
|
||||
msgid "%1 - could not print"
|
||||
msgstr "%1 - nelze tisknout"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:190
|
||||
msgid ""
|
||||
"Could not print.\n"
|
||||
"Your Qt library has been compiled without printing support"
|
||||
msgstr ""
|
||||
"Není možné tisknout.\n"
|
||||
"Vaše knihovna Qt byla přeložena bez podpory tisku."
|
||||
|
||||
#: kchmviewwindowmgr.cpp:65
|
||||
msgid "&Window"
|
||||
msgstr "&Okno"
|
||||
|
||||
#: main.cpp:46
|
||||
msgid ""
|
||||
"'--search <query>' specifies the search query to search, and activate the "
|
||||
"first entry if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:47
|
||||
msgid ""
|
||||
"'--sindex <word>' specifies the word to find in index, and activate if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:54
|
||||
msgid "CHM file viewer"
|
||||
msgstr "Prohlížeč CHM souborů"
|
||||
|
||||
#~ msgid "Match similar words"
|
||||
#~ msgstr "Podobná slova"
|
@ -0,0 +1,870 @@
|
||||
# translation of du.po to
|
||||
# This file is put in the public domain.
|
||||
#
|
||||
# Rinse de Vries <rinsedevries@kde.nl>, 2006.
|
||||
# Rinse de Vries <rinsedevries@home.nl>, 2006.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: du\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-03-13 20:31-0700\n"
|
||||
"PO-Revision-Date: 2006-09-09 22:48+0200\n"
|
||||
"Last-Translator: Rinse de Vries <rinsedevries@home.nl>\n"
|
||||
"Language-Team: <nl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 24
|
||||
#: rc.cpp:3
|
||||
#, no-c-format
|
||||
msgid "KchmViewer settings"
|
||||
msgstr "KchmViewer instellen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 54
|
||||
#: rc.cpp:6
|
||||
#, no-c-format
|
||||
msgid "General behavior"
|
||||
msgstr "Algemeen gedrag"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 73
|
||||
#: rc.cpp:9
|
||||
#, no-c-format
|
||||
msgid "If no arguments given on load"
|
||||
msgstr "Als er geen argumenten zijn meegegeven bij het laden"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 84
|
||||
#: rc.cpp:12
|
||||
#, no-c-format
|
||||
msgid "Open the 'open CHM file' dialog"
|
||||
msgstr "Open de dialoog 'CHM-bestand openen'"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 92
|
||||
#: rc.cpp:15
|
||||
#, no-c-format
|
||||
msgid "Open the &last used CHM file, if exist"
|
||||
msgstr "Open het &laatstgebruikte CHM-bestand, als dat bestaat"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 95
|
||||
#: rc.cpp:18
|
||||
#, no-c-format
|
||||
msgid "Alt+L"
|
||||
msgstr "Alt+L"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 105
|
||||
#: rc.cpp:21
|
||||
#, no-c-format
|
||||
msgid "History"
|
||||
msgstr "Geschiedenis"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 124
|
||||
#: rc.cpp:24
|
||||
#, no-c-format
|
||||
msgid "Store history information for"
|
||||
msgstr "Geschiedenis opslaan voor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 143
|
||||
#: rc.cpp:28
|
||||
#, no-c-format
|
||||
msgid "latest files"
|
||||
msgstr "laatste bestanden"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 153
|
||||
#: rc.cpp:31
|
||||
#, no-c-format
|
||||
msgid "R&emember extra information for history files"
|
||||
msgstr "Extra info&rmatie voor geschiedenisbestanden onthouden"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 156
|
||||
#: rc.cpp:34
|
||||
#, no-c-format
|
||||
msgid "Alt+E"
|
||||
msgstr "Alt+E"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 159
|
||||
#: rc.cpp:37
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Remembers the information about the files, which were opened. Remembers last "
|
||||
"opened page, search history, font size, bookmarks and so on."
|
||||
msgstr ""
|
||||
"Onthoudt de informatie over de bestanden die geopend zijn. Onthoudt de "
|
||||
"laatstgeopende pagina, zoekgeschiedenis, tekengrootte, bladwijzers, etc."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 171
|
||||
#: rc.cpp:40
|
||||
#, no-c-format
|
||||
msgid "CHM security settings"
|
||||
msgstr "CHM-beveiliging instellen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 182
|
||||
#: rc.cpp:43
|
||||
#, no-c-format
|
||||
msgid "When external link clicked"
|
||||
msgstr "Wanneer externe koppelingen aangeklikt worden"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 193
|
||||
#: rc.cpp:46
|
||||
#, no-c-format
|
||||
msgid "Alwa&ys open it in external browser"
|
||||
msgstr "Altijd openen in e&xterne browser"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 196
|
||||
#: rc.cpp:49
|
||||
#, no-c-format
|
||||
msgid "Alt+Y"
|
||||
msgstr "Alt+Y"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 204
|
||||
#. i18n: file kchmsetupdialog.ui line 244
|
||||
#: rc.cpp:52 rc.cpp:65
|
||||
#, no-c-format
|
||||
msgid "Ask for confirmation"
|
||||
msgstr "Om bevestiging vragen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 212
|
||||
#: rc.cpp:55
|
||||
#, no-c-format
|
||||
msgid "Do not open the link"
|
||||
msgstr "Koppeling niet volgen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 225
|
||||
#: rc.cpp:59
|
||||
#, no-c-format
|
||||
msgid "When link pointed to a new CHM file clicked"
|
||||
msgstr ""
|
||||
"Als een koppeling die naar een nieuw CHM-bestand verwijst wordt aangeklikt"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 236
|
||||
#: rc.cpp:62
|
||||
#, no-c-format
|
||||
msgid "Always open a new CHM file"
|
||||
msgstr "Altijd een nieuw CHM-bestand openen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 252
|
||||
#: rc.cpp:68
|
||||
#, no-c-format
|
||||
msgid "Do not open a new CHM file"
|
||||
msgstr "Geen nieuw CHM-bestand openen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 266
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid "Version-specific settings"
|
||||
msgstr "Versiespecifieke instellingen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 277
|
||||
#: rc.cpp:74
|
||||
#, no-c-format
|
||||
msgid "Qt version settings"
|
||||
msgstr "Qt-versie instellen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 299
|
||||
#: rc.cpp:77
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Enter the path to the program, which will be used as a browser for external "
|
||||
"links. A <i>%s</i> symbol will be replaced by the URL clicked."
|
||||
msgstr ""
|
||||
"Voer het pad naar het programma in dat zal worden gebruikt als externe "
|
||||
"browser voor externe koppelingen. De plaatshouder <i>%s</i> zal worden "
|
||||
"vervangen door het URL-adres dat is aangeklikt."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 325
|
||||
#: rc.cpp:80
|
||||
#, no-c-format
|
||||
msgid "KDE version settings"
|
||||
msgstr "KDE-versie instellen"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 336
|
||||
#: rc.cpp:83
|
||||
#, no-c-format
|
||||
msgid "To show HTML content, use"
|
||||
msgstr "Om HTML-inhoud te tonen, gebruik"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 347
|
||||
#: rc.cpp:86
|
||||
#, no-c-format
|
||||
msgid "&QTextBrowser-based widget"
|
||||
msgstr "&QTextBrowser-gebaseerde widget"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 350
|
||||
#: rc.cpp:89
|
||||
#, no-c-format
|
||||
msgid "Alt+Q"
|
||||
msgstr "Alt+Q"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 358
|
||||
#: rc.cpp:92
|
||||
#, no-c-format
|
||||
msgid "&KHTMLPart-based widget"
|
||||
msgstr "&KHTMLPart-gebaseerde widget"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 361
|
||||
#: rc.cpp:95
|
||||
#, no-c-format
|
||||
msgid "Alt+K"
|
||||
msgstr "Alt+K"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 371
|
||||
#: rc.cpp:98
|
||||
#, no-c-format
|
||||
msgid "KHTMLPart security"
|
||||
msgstr "Veiligheid voor KHTMLPart"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 382
|
||||
#: rc.cpp:101
|
||||
#, no-c-format
|
||||
msgid "Enable Java&Script"
|
||||
msgstr "Java&Script activeren"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 385
|
||||
#: rc.cpp:104
|
||||
#, no-c-format
|
||||
msgid "Alt+S"
|
||||
msgstr "Alt+S"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 393
|
||||
#: rc.cpp:107
|
||||
#, no-c-format
|
||||
msgid "Enable &plugins"
|
||||
msgstr "&Plugins activeren"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 396
|
||||
#: rc.cpp:110
|
||||
#, no-c-format
|
||||
msgid "Alt+P"
|
||||
msgstr "Alt+P"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 404
|
||||
#: rc.cpp:113
|
||||
#, no-c-format
|
||||
msgid "Enable &Java"
|
||||
msgstr "&Java activeren"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 407
|
||||
#: rc.cpp:116
|
||||
#, no-c-format
|
||||
msgid "Alt+J"
|
||||
msgstr "Alt+J"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 415
|
||||
#: rc.cpp:119
|
||||
#, no-c-format
|
||||
msgid "Enable &refresh"
|
||||
msgstr "Ve&rversen activeren"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 418
|
||||
#: rc.cpp:122
|
||||
#, no-c-format
|
||||
msgid "Alt+R"
|
||||
msgstr "Alt+R"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 432
|
||||
#: rc.cpp:125
|
||||
#, no-c-format
|
||||
msgid "Advanced"
|
||||
msgstr "Geavanceerd"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 443
|
||||
#: rc.cpp:128
|
||||
#, no-c-format
|
||||
msgid "View HTML source command uses"
|
||||
msgstr "Commando 'HTML-bron tonen' gebruikt"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 454
|
||||
#: rc.cpp:131
|
||||
#, no-c-format
|
||||
msgid "Built-in HTML source viewer"
|
||||
msgstr "Ingebouwde viewer voor HTML-bron"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 465
|
||||
#: rc.cpp:135
|
||||
#, no-c-format
|
||||
msgid "E&xternal program, specified below"
|
||||
msgstr "E&xtern programma, hieronder opgegeven"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 468
|
||||
#: rc.cpp:138
|
||||
#, no-c-format
|
||||
msgid "Alt+X"
|
||||
msgstr "Alt+X"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 484
|
||||
#: rc.cpp:141
|
||||
#, no-c-format
|
||||
msgid "External program:"
|
||||
msgstr "Extern programma:"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 501
|
||||
#: rc.cpp:144
|
||||
#, fuzzy, no-c-format
|
||||
msgid "Search engine to use"
|
||||
msgstr "Zoekopdracht gaf geen resultaten"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 528
|
||||
#: rc.cpp:148
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use the search based on internal CHM index. This engine cannot search for "
|
||||
"any symbols except underscode, does not support multibyte languages, and is "
|
||||
"not always available."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 555
|
||||
#: rc.cpp:152
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use new kchmviewer internal search engine (recommended). This engine "
|
||||
"indexes symbols, so it is possible to search for special symbols (like \"C++"
|
||||
"\"). All languages are supported. The index will be generated before the "
|
||||
"first search."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 588
|
||||
#: rc.cpp:158
|
||||
#, no-c-format
|
||||
msgid "F1"
|
||||
msgstr "F1"
|
||||
|
||||
#: _translatorinfo.cpp:1
|
||||
msgid ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Your names"
|
||||
msgstr "Rinse de Vries"
|
||||
|
||||
#: _translatorinfo.cpp:3
|
||||
msgid ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"Your emails"
|
||||
msgstr "rinsedevries@kde.nl"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:44
|
||||
msgid "&Add"
|
||||
msgstr "&Toev."
|
||||
|
||||
#: kchmbookmarkwindow.cpp:46
|
||||
msgid "&Del"
|
||||
msgstr "&Verw."
|
||||
|
||||
#: kchmbookmarkwindow.cpp:88
|
||||
msgid "%1 - add a bookmark"
|
||||
msgstr "%1 - voeg een bladwijzer toe"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:89 kchmbookmarkwindow.cpp:131
|
||||
msgid "Enter the name for this bookmark:"
|
||||
msgstr "Voer de naam in van deze bladwijzer:"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:130
|
||||
msgid "%1 - edit the bookmark name"
|
||||
msgstr "%1 - bewerk de bladwijzernaam"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:201
|
||||
msgid "&Add bookmark"
|
||||
msgstr "Bl&adwijzer toevoegen"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:34
|
||||
msgid "Topics"
|
||||
msgstr "Onderwerpen"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:39
|
||||
msgid "Please select one of the topics below:"
|
||||
msgstr "Selecteer hieronder een van de onderwerpen:"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:43
|
||||
msgid "&Ok"
|
||||
msgstr "&OK"
|
||||
|
||||
#: kchmmainwindow.cpp:122
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"%1 version %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2004-2007\n"
|
||||
"http://www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Licensed under GNU GPL license.\n"
|
||||
"\n"
|
||||
"Please check my another project, http://www.transientmail.com - temporary e-"
|
||||
"mail address, which expires automatically."
|
||||
msgstr ""
|
||||
"%1 versie %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2005-2006\n"
|
||||
"www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Gelicenseerd onder de GNU GPL-licentie.\n"
|
||||
"\n"
|
||||
"Probeer ook ons andere project, www.transientmail.com - tijdelijk e-"
|
||||
"mailadres dat automatisch verloopt."
|
||||
|
||||
#: kchmmainwindow.cpp:139
|
||||
msgid "*.chm|Compressed Help Manual (*.chm)"
|
||||
msgstr "*.chm|Compressed Help Manual (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:141
|
||||
msgid "Compressed Help Manual (*.chm)"
|
||||
msgstr "Compressed Help Manual (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:151
|
||||
msgid "Loading aborted"
|
||||
msgstr "Laden afgebroken"
|
||||
|
||||
#: kchmmainwindow.cpp:261
|
||||
msgid "%1 - failed to load the chm file"
|
||||
msgstr "%1 - laden van chm-bestand is mislukt"
|
||||
|
||||
#: kchmmainwindow.cpp:262
|
||||
msgid "Unable to load the chm file %1"
|
||||
msgstr "chm-bestand %1 kon niet worden geladen"
|
||||
|
||||
#: kchmmainwindow.cpp:272
|
||||
msgid "Could not load file %1"
|
||||
msgstr "Kon het bestand %1 niet laden."
|
||||
|
||||
#: kchmmainwindow.cpp:288
|
||||
msgid "About %1"
|
||||
msgstr "Info over %1"
|
||||
|
||||
#: kchmmainwindow.cpp:374
|
||||
msgid "%1 - remote link clicked - %2"
|
||||
msgstr "%1 - externe koppeling aangeklikt %2"
|
||||
|
||||
#: kchmmainwindow.cpp:375
|
||||
msgid ""
|
||||
"A remote link %1 will start the external program to open it.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"De externe koppeling %1 zal het externe programma starten om haar te "
|
||||
"openen.\n"
|
||||
"\n"
|
||||
"Wilt u doorgaan?"
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&Yes"
|
||||
msgstr "&Ja"
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&No"
|
||||
msgstr "&Nee"
|
||||
|
||||
#: kchmmainwindow.cpp:400
|
||||
msgid "%1 - JavsScript link clicked"
|
||||
msgstr "%1 - JavaScript-koppeling aangeklikt"
|
||||
|
||||
#: kchmmainwindow.cpp:401
|
||||
msgid ""
|
||||
"You have clicked a JavaScript link.\n"
|
||||
"To prevent security-related issues JavaScript URLs are disabled in CHM files."
|
||||
msgstr ""
|
||||
"U hebt op een JavaScript-koppeling geklikt.\n"
|
||||
"Om veiligheidgerelateerde problemen te voorkomen zijn JavaScript-koppelingen "
|
||||
"uitgeschakeld in CHM-bestanden."
|
||||
|
||||
#: kchmmainwindow.cpp:409
|
||||
msgid "%1 - link to a new CHM file clicked"
|
||||
msgstr "%1 - koppeling naar nieuw CHM-bestand aangeklikt"
|
||||
|
||||
#: kchmmainwindow.cpp:410
|
||||
msgid ""
|
||||
"You have clicked a link, which leads to a new CHM file %1.\n"
|
||||
"The current file will be closed.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"U hebt op een koppeling geklikt die leidt naar het nieuwe CHM-bestand %1.\n"
|
||||
"Het huidige bestand zal worden gesloten.\n"
|
||||
"\n"
|
||||
"Wilt u doorgaan?"
|
||||
|
||||
#: kchmmainwindow.cpp:474
|
||||
msgid "File Operations"
|
||||
msgstr "Bestandsoperaties"
|
||||
|
||||
#: kchmmainwindow.cpp:478
|
||||
msgid "Open File"
|
||||
msgstr "Bestand openen"
|
||||
|
||||
#: kchmmainwindow.cpp:484
|
||||
msgid "Click this button to open an existing chm file."
|
||||
msgstr "Klik op deze knop om een bestaand CHM-bestand te openen."
|
||||
|
||||
#: kchmmainwindow.cpp:489
|
||||
msgid "Print File"
|
||||
msgstr "Bestand afdrukken"
|
||||
|
||||
#: kchmmainwindow.cpp:495
|
||||
msgid "Click this button to print the current page"
|
||||
msgstr "Klik op deze knop om de huidige pagina af te drukken"
|
||||
|
||||
#: kchmmainwindow.cpp:510
|
||||
msgid "E&xtract CHM content..."
|
||||
msgstr "CHM-inhoud &uitpakken..."
|
||||
|
||||
#: kchmmainwindow.cpp:511
|
||||
msgid ""
|
||||
"Click this button to extract the whole CHM file content into a specific "
|
||||
"directory"
|
||||
msgstr ""
|
||||
"Klik op deze knop om het hele CHM-bestand uit te pakken naar een specifieke "
|
||||
"map"
|
||||
|
||||
#: kchmmainwindow.cpp:517
|
||||
msgid "&Recent files"
|
||||
msgstr "&Recente bestanden"
|
||||
|
||||
#: kchmmainwindow.cpp:526
|
||||
msgid "&Select all"
|
||||
msgstr "Alles &selecteren"
|
||||
|
||||
#: kchmmainwindow.cpp:544
|
||||
msgid "&Change settings..."
|
||||
msgstr "Instellingen wij&zigen..."
|
||||
|
||||
#: kchmmainwindow.cpp:551
|
||||
msgid "About &Qt"
|
||||
msgstr "Over &Qt"
|
||||
|
||||
#: kchmmainwindow.cpp:553
|
||||
msgid "What's &This"
|
||||
msgstr "Wat is di&t"
|
||||
|
||||
#: kchmmainwindow.cpp:836
|
||||
msgid ""
|
||||
"Changing browser view options or search engine used\n"
|
||||
"requires restarting the application to take effect."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:954
|
||||
msgid "Index"
|
||||
msgstr "Index"
|
||||
|
||||
#: kchmmainwindow.cpp:977 kchmsearchengine.cpp:246
|
||||
msgid "Search"
|
||||
msgstr "Zoeken"
|
||||
|
||||
#: kchmmainwindow.cpp:1044
|
||||
msgid "Could not locate opened topic in content window"
|
||||
msgstr "Het geopende onderwerp kon niet in het tekstvender gevonden worden"
|
||||
|
||||
#: kchmmainwindow.cpp:1056 kchmmainwindow.cpp:1062
|
||||
msgid "Choose a directory to store CHM content"
|
||||
msgstr "Kies een map om de CHM-inhoud in op te slaan"
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting CHM content"
|
||||
msgstr "CHM-inhoud uitpakken"
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting files..."
|
||||
msgstr "Bestanden uitpakken..."
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Abort"
|
||||
msgstr "Afbreken"
|
||||
|
||||
#: kchmnavtoolbar.cpp:33
|
||||
msgid "Navigation"
|
||||
msgstr "Navigatie"
|
||||
|
||||
#: kchmnavtoolbar.cpp:37
|
||||
msgid "Move backward in history"
|
||||
msgstr "Ga terug in de geschiedenis"
|
||||
|
||||
#: kchmnavtoolbar.cpp:42
|
||||
msgid "Click this button to move backward in browser history"
|
||||
msgstr "Klik op deze knop om terug in de bladergeschiedenis te gaan."
|
||||
|
||||
#: kchmnavtoolbar.cpp:46
|
||||
msgid "Move forward in history"
|
||||
msgstr "Ga vooruit in de geschiedenis"
|
||||
|
||||
#: kchmnavtoolbar.cpp:51
|
||||
msgid "Click this button to move forward in browser history"
|
||||
msgstr "Klik op deze knop om vooruit in de bladergeschiedenis te gaan"
|
||||
|
||||
#: kchmnavtoolbar.cpp:55
|
||||
msgid "Go to the home page"
|
||||
msgstr "Ga naar de beginpagina"
|
||||
|
||||
#: kchmnavtoolbar.cpp:60
|
||||
msgid "Click this button to move to the home page"
|
||||
msgstr "Klik op deze knop om naar de beginpagina te gaan"
|
||||
|
||||
#: kchmsearchengine.cpp:246
|
||||
msgid "A closing quote character is missing."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:50
|
||||
msgid "Find in page"
|
||||
msgstr "Zoeken in pagina"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:67
|
||||
msgid "Enter here the text to search in the current page."
|
||||
msgstr "Voer hier de tekst in waarna u in de huidige pagina wilt zoeken"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:74
|
||||
msgid "Previous search result"
|
||||
msgstr "Vorig zoekresultaat"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:79
|
||||
msgid "Click this button to find previous search result."
|
||||
msgstr "Klik op deze knop om naar het vorige zoekresultaat te gaan"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:83
|
||||
msgid "Next search result"
|
||||
msgstr "Volgend zoekresultaat"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:88
|
||||
msgid "Click this button to find next search result."
|
||||
msgstr "Klik op deze knop om naar het volgende zoekresultaat te gaan."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:92
|
||||
msgid "Locate this topic in content window"
|
||||
msgstr "Zoek dit onderwerp op in het tekstvenster"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:97
|
||||
msgid ""
|
||||
"Click this button to find current topic in the content window, and open it."
|
||||
msgstr ""
|
||||
"Klik op deze knop om het huidige onderwerp op te zoeken in het tekstvenster "
|
||||
"en te openen."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:101
|
||||
msgid "Increase font size"
|
||||
msgstr "Lettertekens vergroten"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:106
|
||||
msgid "Click this button to increase the font size."
|
||||
msgstr "Klik op deze knop om de tekst te vergroten."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:110
|
||||
msgid "Decrease font size"
|
||||
msgstr "Lettertekens verkleinen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:115
|
||||
msgid "Click this button to decrease the font size."
|
||||
msgstr "Klik op deze knop om de tekst te verkleinen."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:119
|
||||
msgid "View HTML source"
|
||||
msgstr "HTML-bron tonen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:124
|
||||
msgid "Click this button to open a separate window with the page HTML source."
|
||||
msgstr ""
|
||||
"Klik op deze knop om een apart venster te openen waarin de HTML-broncode "
|
||||
"wordt weergegeven."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:128
|
||||
msgid "Add to bookmarks"
|
||||
msgstr "Aan bladwijzers toevoegen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:133
|
||||
msgid "Click this button to add the current page to the bookmarks list."
|
||||
msgstr ""
|
||||
"Klik op deze knop om de huidige pagina toe te voegen aan de lijst met "
|
||||
"bladwijzers."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:136
|
||||
msgid "Prev page in TOC"
|
||||
msgstr "Vorige pagina in inhoudsopgave"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:141
|
||||
msgid "Click this button to go to previous page in Table Of Content."
|
||||
msgstr ""
|
||||
"Klik op deze knop om naar de vorige pagina in de inhoudsopgave te gaan."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:144
|
||||
msgid "Next page in TOC"
|
||||
msgstr "Volgende pagina in inhoudsopgave"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:149
|
||||
msgid "Click this button to go to next page in Table of Content."
|
||||
msgstr ""
|
||||
"Klik op deze knop om naar de volgende pagina in de inhoudsopgave te gaan."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:155
|
||||
msgid "&Increase font"
|
||||
msgstr "Lettertekens ver&groten"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:156
|
||||
msgid "&Decrease font"
|
||||
msgstr "Lettertekens ver&kleinen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:157
|
||||
msgid "&View HTML source"
|
||||
msgstr "HTML-bron &tonen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:160
|
||||
msgid "&Bookmark this page"
|
||||
msgstr "&Bladwijzer voor deze pagina"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:163
|
||||
msgid "&Full screen"
|
||||
msgstr "&Volledig scherm"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:165
|
||||
msgid "&Show contents window"
|
||||
msgstr "Tek&stvenster tonen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:167
|
||||
msgid "&Locate in contents window"
|
||||
msgstr "Zoeken in inhou&dsopgave"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:220
|
||||
msgid "&Set language"
|
||||
msgstr "Taal in&stellen"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:243
|
||||
msgid "&Set codepage"
|
||||
msgstr "Codepagina in&stellen"
|
||||
|
||||
#: kchmsearchwindow.cpp:43
|
||||
msgid "Type in word(s) to search for:"
|
||||
msgstr "Voer de woorden in waarnaar u wilt zoeken:"
|
||||
|
||||
#: kchmsearchwindow.cpp:46
|
||||
msgid "<a href=\"q\"><b>Help</b></a>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:58
|
||||
msgid "Go"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:66
|
||||
msgid "Title"
|
||||
msgstr "Titel"
|
||||
|
||||
#: kchmsearchwindow.cpp:67
|
||||
msgid "Location"
|
||||
msgstr "Locatie"
|
||||
|
||||
#: kchmsearchwindow.cpp:130
|
||||
msgid "Search returned %1 result(s)"
|
||||
msgstr "Zoekopdracht gaf %1 resultaten"
|
||||
|
||||
#: kchmsearchwindow.cpp:133
|
||||
msgid "Search returned no results"
|
||||
msgstr "Zoekopdracht gaf geen resultaten"
|
||||
|
||||
#: kchmsearchwindow.cpp:136 kchmviewwindow_qtextbrowser.cpp:211
|
||||
msgid "Search failed"
|
||||
msgstr "Zoekopdracht is mislukt"
|
||||
|
||||
#: kchmsearchwindow.cpp:169 kchmsearchwindow.cpp:175
|
||||
msgid "How to use search"
|
||||
msgstr "Hoe de zoekopdracht te gebruiken"
|
||||
|
||||
#: kchmsearchwindow.cpp:170
|
||||
msgid ""
|
||||
"<html><p>The improved search engine allows you to search for a word, symbol "
|
||||
"or phrase, which is set of words and symbols included in quotes. Only the "
|
||||
"documents which include all the terms speficide in th search query are "
|
||||
"shown; no prefixes needed.<p>Unlike MS CHM internal search index, my "
|
||||
"improved search engine indexes everything, including special symbols. "
|
||||
"Therefore it is possible to search (and find!) for something like <i>$q = "
|
||||
"new ChmFile();</i>. This search also fully supports Unicode, which means "
|
||||
"that you can search in non-English documents.<p>If you want to search for a "
|
||||
"quote symbol, use quotation mark instead. The engine treats a quote and a "
|
||||
"quotation mark as the same symbol, which allows to use them in phrases.</"
|
||||
"html>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:176
|
||||
msgid ""
|
||||
"The search query can contain a few prefixes.\n"
|
||||
"A set of words inside the quote marks mean that you are searching for exact "
|
||||
"phrase.\n"
|
||||
"A word with minus sign means that it should be absent in the search result.\n"
|
||||
"A word with plus mark or without any mark means that it must be present in "
|
||||
"the search result.\n"
|
||||
"\n"
|
||||
"Note that only letters and digits are indexed.\n"
|
||||
"You cannot search for non-character symbols other than underscope, and those "
|
||||
"symbols will be removed from the search query.\n"
|
||||
"For example, search for 'C' will give the same result as searching for 'C++'."
|
||||
msgstr ""
|
||||
"De zoekopdracht kan enkele voorvoegsels bevatten.\n"
|
||||
"Een set woorden tussen aanhalingstekens betekent dat u zoekt naar de exacte "
|
||||
"woordcombinatie.\n"
|
||||
"Een woord met het min-teken ervoor betekent dat dit woord niet in het "
|
||||
"zoekresultaat mag voorkomen.\n"
|
||||
"Een woord met het plus-teken ervoor betekent dat het in het zoekresultaat "
|
||||
"moet voorkomen.\n"
|
||||
"\n"
|
||||
"Onthoud dat alleen letters en cijfers worden geïndexeerd.\n"
|
||||
"U kunt niet zoeken naar symbolen (liggend streepje uitgezonderd), deze "
|
||||
"zullen uit de zoekopdracht worden verwijderd.\n"
|
||||
"Bijvoorbeeld, zoeken naar 'C' zal dezelfde resultaten geven als zoeken naar "
|
||||
"'C++'."
|
||||
|
||||
#: kchmsearchwindow.cpp:226
|
||||
#, fuzzy
|
||||
msgid "Search is not available"
|
||||
msgstr "Zoekopdracht is mislukt"
|
||||
|
||||
#: kchmsearchwindow.cpp:227
|
||||
msgid ""
|
||||
"<p>The search feature is not avaiable for this chm file.<p>The old search "
|
||||
"engine depends on indexes present in chm files itself. Not every chm file "
|
||||
"has an index; it is set up during chm file creation. Therefore if the search "
|
||||
"index was not created during chm file creation, this makes search impossible."
|
||||
"<p>Solution: use new search engine (menu Settings/Advanced), which generates "
|
||||
"its own index."
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:171
|
||||
msgid "Printing (page %1)..."
|
||||
msgstr "Afdrukken (pagina %1)..."
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:179
|
||||
msgid "Printing completed"
|
||||
msgstr "Afdrukken voltooid"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:183
|
||||
msgid "Printing aborted"
|
||||
msgstr "Afdrukken afgebroken"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:189
|
||||
msgid "%1 - could not print"
|
||||
msgstr "%1 - kon niet afdrukken"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:190
|
||||
msgid ""
|
||||
"Could not print.\n"
|
||||
"Your Qt library has been compiled without printing support"
|
||||
msgstr ""
|
||||
"Kon niet afdrukken.\n"
|
||||
"Uw Qt-bibliotheek is gecompileerd zonder ondersteuning voor afdrukken"
|
||||
|
||||
#: kchmviewwindowmgr.cpp:65
|
||||
msgid "&Window"
|
||||
msgstr "&Venster"
|
||||
|
||||
#: main.cpp:46
|
||||
msgid ""
|
||||
"'--search <query>' specifies the search query to search, and activate the "
|
||||
"first entry if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:47
|
||||
msgid ""
|
||||
"'--sindex <word>' specifies the word to find in index, and activate if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:54
|
||||
msgid "CHM file viewer"
|
||||
msgstr "CHM-bestandsviewer"
|
||||
|
||||
#~ msgid "Match similar words"
|
||||
#~ msgstr "Incl. overeenkomende woorden"
|
||||
|
||||
#~ msgid "Shift+Enter"
|
||||
#~ msgstr "Shift+Enter"
|
||||
|
||||
#~ msgid "Ctrl+Enter"
|
||||
#~ msgstr "Ctrl+Enter"
|
@ -0,0 +1,878 @@
|
||||
# translation of kchmviewer.po to Fr_fr
|
||||
# This file is put in the public domain.
|
||||
#
|
||||
# Stephan Bellegy <stephan@bellegy.org>, 2006.
|
||||
# Sun Wukong <sun.wukong@rx3.net>, 2006.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: kchmviewer\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-03-13 20:31-0700\n"
|
||||
"PO-Revision-Date: 2006-08-18 00:31+0200\n"
|
||||
"Last-Translator: Sun Wukong <sun.wukong@rx3.net>\n"
|
||||
"Language-Team: Fr_fr <kde-francophone@kde.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 24
|
||||
#: rc.cpp:3
|
||||
#, no-c-format
|
||||
msgid "KchmViewer settings"
|
||||
msgstr "Paramétrage de KchmViewer"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 54
|
||||
#: rc.cpp:6
|
||||
#, no-c-format
|
||||
msgid "General behavior"
|
||||
msgstr "Comportement général"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 73
|
||||
#: rc.cpp:9
|
||||
#, no-c-format
|
||||
msgid "If no arguments given on load"
|
||||
msgstr "Si aucun argument n'a été spécifié au démarrage"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 84
|
||||
#: rc.cpp:12
|
||||
#, no-c-format
|
||||
msgid "Open the 'open CHM file' dialog"
|
||||
msgstr "Ouvrir la boîte de dialogue «Ouvrir un fichier CHM»"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 92
|
||||
#: rc.cpp:15
|
||||
#, no-c-format
|
||||
msgid "Open the &last used CHM file, if exist"
|
||||
msgstr "Ouvrir le &dernier fichier CHM s'il existe"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 95
|
||||
#: rc.cpp:18
|
||||
#, no-c-format
|
||||
msgid "Alt+L"
|
||||
msgstr "Alt+D"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 105
|
||||
#: rc.cpp:21
|
||||
#, no-c-format
|
||||
msgid "History"
|
||||
msgstr "Historique"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 124
|
||||
#: rc.cpp:24
|
||||
#, no-c-format
|
||||
msgid "Store history information for"
|
||||
msgstr "Mémoriser l'historique pour"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 143
|
||||
#: rc.cpp:28
|
||||
#, no-c-format
|
||||
msgid "latest files"
|
||||
msgstr "les derniers fichiers"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 153
|
||||
#: rc.cpp:31
|
||||
#, no-c-format
|
||||
msgid "R&emember extra information for history files"
|
||||
msgstr "Se rapp&eler les informations complémentaires pour l'historique"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 156
|
||||
#: rc.cpp:34
|
||||
#, no-c-format
|
||||
msgid "Alt+E"
|
||||
msgstr "Alt+E"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 159
|
||||
#: rc.cpp:37
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Remembers the information about the files, which were opened. Remembers last "
|
||||
"opened page, search history, font size, bookmarks and so on."
|
||||
msgstr ""
|
||||
"Se rappelle les informations concernant les fichiers précédemment ouverts. "
|
||||
"Se rappelle la dernière page consultée, la dernière recherche effectuée, la "
|
||||
"taille de la police, les marque-pages, etc."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 171
|
||||
#: rc.cpp:40
|
||||
#, no-c-format
|
||||
msgid "CHM security settings"
|
||||
msgstr "Paramètres de sécurité CHM"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 182
|
||||
#: rc.cpp:43
|
||||
#, no-c-format
|
||||
msgid "When external link clicked"
|
||||
msgstr "Quand un lien externe est cliqué"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 193
|
||||
#: rc.cpp:46
|
||||
#, no-c-format
|
||||
msgid "Alwa&ys open it in external browser"
|
||||
msgstr "Toujours l'ouvrir dans un navigateur e&xterne"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 196
|
||||
#: rc.cpp:49
|
||||
#, no-c-format
|
||||
msgid "Alt+Y"
|
||||
msgstr "Alt+X"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 204
|
||||
#. i18n: file kchmsetupdialog.ui line 244
|
||||
#: rc.cpp:52 rc.cpp:65
|
||||
#, no-c-format
|
||||
msgid "Ask for confirmation"
|
||||
msgstr "Demander la confirmation"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 212
|
||||
#: rc.cpp:55
|
||||
#, no-c-format
|
||||
msgid "Do not open the link"
|
||||
msgstr "Ne pas ouvrir le lien"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 225
|
||||
#: rc.cpp:59
|
||||
#, no-c-format
|
||||
msgid "When link pointed to a new CHM file clicked"
|
||||
msgstr "Lorsqu'un lien sur un fichier externe est cliqué "
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 236
|
||||
#: rc.cpp:62
|
||||
#, no-c-format
|
||||
msgid "Always open a new CHM file"
|
||||
msgstr "Toujours ouvrir un nouveau fichier CHM"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 252
|
||||
#: rc.cpp:68
|
||||
#, no-c-format
|
||||
msgid "Do not open a new CHM file"
|
||||
msgstr "Ne pas ouvrir un nouveau fichier CHM"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 266
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid "Version-specific settings"
|
||||
msgstr "Paramètres spécifiques à la version"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 277
|
||||
#: rc.cpp:74
|
||||
#, no-c-format
|
||||
msgid "Qt version settings"
|
||||
msgstr "Paramètres spécifiques à la version de Qt"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 299
|
||||
#: rc.cpp:77
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Enter the path to the program, which will be used as a browser for external "
|
||||
"links. A <i>%s</i> symbol will be replaced by the URL clicked."
|
||||
msgstr ""
|
||||
"Entrer le chemin du navigateur qui sera utilisé pour afficher les liens "
|
||||
"externes. Un symbole <i>%s</i> sera remplacé par l'URL cliquée."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 325
|
||||
#: rc.cpp:80
|
||||
#, no-c-format
|
||||
msgid "KDE version settings"
|
||||
msgstr "Paramètres spécifiques à la version de KDE"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 336
|
||||
#: rc.cpp:83
|
||||
#, no-c-format
|
||||
msgid "To show HTML content, use"
|
||||
msgstr "Pour afficher le contenu HTML, utiliser"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 347
|
||||
#: rc.cpp:86
|
||||
#, no-c-format
|
||||
msgid "&QTextBrowser-based widget"
|
||||
msgstr "un widget basé sur &QTtextBrowser"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 350
|
||||
#: rc.cpp:89
|
||||
#, no-c-format
|
||||
msgid "Alt+Q"
|
||||
msgstr "Alt+Q"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 358
|
||||
#: rc.cpp:92
|
||||
#, no-c-format
|
||||
msgid "&KHTMLPart-based widget"
|
||||
msgstr "un widget basé sur &KHTMLPart"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 361
|
||||
#: rc.cpp:95
|
||||
#, no-c-format
|
||||
msgid "Alt+K"
|
||||
msgstr "Alt+K"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 371
|
||||
#: rc.cpp:98
|
||||
#, no-c-format
|
||||
msgid "KHTMLPart security"
|
||||
msgstr "Sécurité pour KHTMLPart"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 382
|
||||
#: rc.cpp:101
|
||||
#, no-c-format
|
||||
msgid "Enable Java&Script"
|
||||
msgstr "Activer le support Java&Script"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 385
|
||||
#: rc.cpp:104
|
||||
#, no-c-format
|
||||
msgid "Alt+S"
|
||||
msgstr "Alt+S"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 393
|
||||
#: rc.cpp:107
|
||||
#, no-c-format
|
||||
msgid "Enable &plugins"
|
||||
msgstr "Activer les &greffons"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 396
|
||||
#: rc.cpp:110
|
||||
#, no-c-format
|
||||
msgid "Alt+P"
|
||||
msgstr "Alt+G"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 404
|
||||
#: rc.cpp:113
|
||||
#, no-c-format
|
||||
msgid "Enable &Java"
|
||||
msgstr "Activer le support &Java"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 407
|
||||
#: rc.cpp:116
|
||||
#, no-c-format
|
||||
msgid "Alt+J"
|
||||
msgstr "Alt+J"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 415
|
||||
#: rc.cpp:119
|
||||
#, no-c-format
|
||||
msgid "Enable &refresh"
|
||||
msgstr "Permettre le &rafraîchissement"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 418
|
||||
#: rc.cpp:122
|
||||
#, no-c-format
|
||||
msgid "Alt+R"
|
||||
msgstr "Alt+R"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 432
|
||||
#: rc.cpp:125
|
||||
#, no-c-format
|
||||
msgid "Advanced"
|
||||
msgstr "Paramétrage avancé"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 443
|
||||
#: rc.cpp:128
|
||||
#, no-c-format
|
||||
msgid "View HTML source command uses"
|
||||
msgstr "Pour voir le source code HTML, utiliser : "
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 454
|
||||
#: rc.cpp:131
|
||||
#, no-c-format
|
||||
msgid "Built-in HTML source viewer"
|
||||
msgstr "le visionneur intégré de code source HTML"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 465
|
||||
#: rc.cpp:135
|
||||
#, no-c-format
|
||||
msgid "E&xternal program, specified below"
|
||||
msgstr "Un programme e&xterne, spécifié ci-dessous"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 468
|
||||
#: rc.cpp:138
|
||||
#, no-c-format
|
||||
msgid "Alt+X"
|
||||
msgstr "Alt+X"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 484
|
||||
#: rc.cpp:141
|
||||
#, no-c-format
|
||||
msgid "External program:"
|
||||
msgstr "Programme externe :"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 501
|
||||
#: rc.cpp:144
|
||||
#, fuzzy, no-c-format
|
||||
msgid "Search engine to use"
|
||||
msgstr "La recherche ne renvoie pas de résultat"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 528
|
||||
#: rc.cpp:148
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use the search based on internal CHM index. This engine cannot search for "
|
||||
"any symbols except underscode, does not support multibyte languages, and is "
|
||||
"not always available."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 555
|
||||
#: rc.cpp:152
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use new kchmviewer internal search engine (recommended). This engine "
|
||||
"indexes symbols, so it is possible to search for special symbols (like \"C++"
|
||||
"\"). All languages are supported. The index will be generated before the "
|
||||
"first search."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 588
|
||||
#: rc.cpp:158
|
||||
#, no-c-format
|
||||
msgid "F1"
|
||||
msgstr "F1"
|
||||
|
||||
#: _translatorinfo.cpp:1
|
||||
msgid ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Your names"
|
||||
msgstr ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Stéphan BELLEGY"
|
||||
|
||||
#: _translatorinfo.cpp:3
|
||||
msgid ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"Your emails"
|
||||
msgstr ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"stephan@bellegy.org"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:44
|
||||
msgid "&Add"
|
||||
msgstr "&Ajouter"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:46
|
||||
msgid "&Del"
|
||||
msgstr "&Supprimer"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:88
|
||||
msgid "%1 - add a bookmark"
|
||||
msgstr "%1 - ajouter un marque-page"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:89 kchmbookmarkwindow.cpp:131
|
||||
msgid "Enter the name for this bookmark:"
|
||||
msgstr "Entrer le nom du marque-page :"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:130
|
||||
msgid "%1 - edit the bookmark name"
|
||||
msgstr "%1 - modifier le nom du marque-page"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:201
|
||||
msgid "&Add bookmark"
|
||||
msgstr "&Ajouter un marque-page"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:34
|
||||
msgid "Topics"
|
||||
msgstr "Thèmes"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:39
|
||||
msgid "Please select one of the topics below:"
|
||||
msgstr "Choisissez l'un des thèmes suivants :"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:43
|
||||
msgid "&Ok"
|
||||
msgstr "&Ok"
|
||||
|
||||
#: kchmmainwindow.cpp:122
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"%1 version %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2004-2007\n"
|
||||
"http://www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Licensed under GNU GPL license.\n"
|
||||
"\n"
|
||||
"Please check my another project, http://www.transientmail.com - temporary e-"
|
||||
"mail address, which expires automatically."
|
||||
msgstr ""
|
||||
"%1 version %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2005-2006\n"
|
||||
"www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Ce programme est distribué selon les termes de la licence GNU GPL.\n"
|
||||
"\n"
|
||||
"Essayez notre autre projet, www.transientmail.com - un distributeur "
|
||||
"d'adresses électroniques temporaires qui expirent automatiquement."
|
||||
|
||||
#: kchmmainwindow.cpp:139
|
||||
msgid "*.chm|Compressed Help Manual (*.chm)"
|
||||
msgstr "*.chm|Manuel d'aide compressé (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:141
|
||||
msgid "Compressed Help Manual (*.chm)"
|
||||
msgstr "Manuel d'aide compressé (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:151
|
||||
msgid "Loading aborted"
|
||||
msgstr "Chargement interrompu"
|
||||
|
||||
#: kchmmainwindow.cpp:261
|
||||
msgid "%1 - failed to load the chm file"
|
||||
msgstr "%1 - Échec lors de la lecture du fichier chm %1"
|
||||
|
||||
#: kchmmainwindow.cpp:262
|
||||
msgid "Unable to load the chm file %1"
|
||||
msgstr "Impossible de lire le fichier chm %1"
|
||||
|
||||
#: kchmmainwindow.cpp:272
|
||||
msgid "Could not load file %1"
|
||||
msgstr "Impossible de lire le fichier chm %1 "
|
||||
|
||||
#: kchmmainwindow.cpp:288
|
||||
msgid "About %1"
|
||||
msgstr "A propos de %1"
|
||||
|
||||
#: kchmmainwindow.cpp:374
|
||||
msgid "%1 - remote link clicked - %2"
|
||||
msgstr "%1 - un lien externe a été cliqué - %2"
|
||||
|
||||
#: kchmmainwindow.cpp:375
|
||||
msgid ""
|
||||
"A remote link %1 will start the external program to open it.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"Un clic sur un lien externe %1 lancera l'ouverture du navigateur externe.\n"
|
||||
"\n"
|
||||
"Voulez-vous continuer ?"
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&Yes"
|
||||
msgstr "&Oui"
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&No"
|
||||
msgstr "&Non"
|
||||
|
||||
# Stéphan Bellegy : wrong spelling for JavaScript
|
||||
#: kchmmainwindow.cpp:400
|
||||
msgid "%1 - JavsScript link clicked"
|
||||
msgstr "%1 - un lien sur un JavaScript a été cliqué"
|
||||
|
||||
#: kchmmainwindow.cpp:401
|
||||
msgid ""
|
||||
"You have clicked a JavaScript link.\n"
|
||||
"To prevent security-related issues JavaScript URLs are disabled in CHM files."
|
||||
msgstr ""
|
||||
"Vous avez cliqué sur un lien JavaScript.\n"
|
||||
"Pour des raisons de sécurité, les URL JavaScript sont désactivées dans les "
|
||||
"fichiers CHM."
|
||||
|
||||
#: kchmmainwindow.cpp:409
|
||||
msgid "%1 - link to a new CHM file clicked"
|
||||
msgstr "%1 - un lien sur un nouveau fichier CHM a été cliqué"
|
||||
|
||||
#: kchmmainwindow.cpp:410
|
||||
msgid ""
|
||||
"You have clicked a link, which leads to a new CHM file %1.\n"
|
||||
"The current file will be closed.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"Vous avez cliqué sur un lien pointant sur un nouveau fichier CHM %1.\n"
|
||||
"Le fichier actuel sera fermé.\n"
|
||||
"\n"
|
||||
"Voulez-vous continuer ?"
|
||||
|
||||
#: kchmmainwindow.cpp:474
|
||||
msgid "File Operations"
|
||||
msgstr "Opérations sur les fichiers"
|
||||
|
||||
#: kchmmainwindow.cpp:478
|
||||
msgid "Open File"
|
||||
msgstr "Ouvrir un fichier "
|
||||
|
||||
#: kchmmainwindow.cpp:484
|
||||
msgid "Click this button to open an existing chm file."
|
||||
msgstr "Cliquer sur ce bouton pour ouvrir un fichier CHM existant."
|
||||
|
||||
#: kchmmainwindow.cpp:489
|
||||
msgid "Print File"
|
||||
msgstr "Imprimer un fichier"
|
||||
|
||||
#: kchmmainwindow.cpp:495
|
||||
msgid "Click this button to print the current page"
|
||||
msgstr "Cliquer sur ce bouton pour imprimer la page courante"
|
||||
|
||||
#: kchmmainwindow.cpp:510
|
||||
msgid "E&xtract CHM content..."
|
||||
msgstr "E&xtraire le contenu du fichier CHM..."
|
||||
|
||||
#: kchmmainwindow.cpp:511
|
||||
msgid ""
|
||||
"Click this button to extract the whole CHM file content into a specific "
|
||||
"directory"
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour extraire le contenu entier du fichier CHM dans un "
|
||||
"dossier"
|
||||
|
||||
#: kchmmainwindow.cpp:517
|
||||
msgid "&Recent files"
|
||||
msgstr "Fichiers &récents"
|
||||
|
||||
#: kchmmainwindow.cpp:526
|
||||
msgid "&Select all"
|
||||
msgstr "Tout &Sélectionner"
|
||||
|
||||
#: kchmmainwindow.cpp:544
|
||||
msgid "&Change settings..."
|
||||
msgstr "&Modifier les paramètres..."
|
||||
|
||||
#: kchmmainwindow.cpp:551
|
||||
msgid "About &Qt"
|
||||
msgstr "A propos de &Qt"
|
||||
|
||||
#: kchmmainwindow.cpp:553
|
||||
msgid "What's &This"
|
||||
msgstr "Qu'es&t-ce que c'est"
|
||||
|
||||
#: kchmmainwindow.cpp:836
|
||||
msgid ""
|
||||
"Changing browser view options or search engine used\n"
|
||||
"requires restarting the application to take effect."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:954
|
||||
msgid "Index"
|
||||
msgstr "Index"
|
||||
|
||||
#: kchmmainwindow.cpp:977 kchmsearchengine.cpp:246
|
||||
msgid "Search"
|
||||
msgstr "Chercher"
|
||||
|
||||
#: kchmmainwindow.cpp:1044
|
||||
msgid "Could not locate opened topic in content window"
|
||||
msgstr ""
|
||||
"Impossible de trouver le sujet sélectionné dans le contenu de la fenêtre"
|
||||
|
||||
#: kchmmainwindow.cpp:1056 kchmmainwindow.cpp:1062
|
||||
msgid "Choose a directory to store CHM content"
|
||||
msgstr "Choisir un dossier pour y sauvegarder le contenu du fichier CHM"
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting CHM content"
|
||||
msgstr "Extraction du contenu du fichier CHM"
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting files..."
|
||||
msgstr "Extraction des fichiers..."
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Abort"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: kchmnavtoolbar.cpp:33
|
||||
msgid "Navigation"
|
||||
msgstr "Navigation"
|
||||
|
||||
#: kchmnavtoolbar.cpp:37
|
||||
msgid "Move backward in history"
|
||||
msgstr "Revenir en arrière dans l'historique"
|
||||
|
||||
#: kchmnavtoolbar.cpp:42
|
||||
msgid "Click this button to move backward in browser history"
|
||||
msgstr "Cliquer sur ce bouton pour revenir en arrière dans l'historique"
|
||||
|
||||
#: kchmnavtoolbar.cpp:46
|
||||
msgid "Move forward in history"
|
||||
msgstr "Avancer dans l'historique"
|
||||
|
||||
#: kchmnavtoolbar.cpp:51
|
||||
msgid "Click this button to move forward in browser history"
|
||||
msgstr "Cliquer sur ce bouton pour avancer dans l'historique"
|
||||
|
||||
#: kchmnavtoolbar.cpp:55
|
||||
msgid "Go to the home page"
|
||||
msgstr "Aller à la page d'accueil"
|
||||
|
||||
#: kchmnavtoolbar.cpp:60
|
||||
msgid "Click this button to move to the home page"
|
||||
msgstr "Cliquer sur ce bouton pour aller à la page d'accueil"
|
||||
|
||||
#: kchmsearchengine.cpp:246
|
||||
msgid "A closing quote character is missing."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:50
|
||||
msgid "Find in page"
|
||||
msgstr "Chercher dans la page"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:67
|
||||
msgid "Enter here the text to search in the current page."
|
||||
msgstr "Saisir ici le texte à rechercher dans la page courante."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:74
|
||||
msgid "Previous search result"
|
||||
msgstr "Résultats de la recherche antérieure"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:79
|
||||
msgid "Click this button to find previous search result."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour trouver les résultats de la recherche antérieure."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:83
|
||||
msgid "Next search result"
|
||||
msgstr "Résultats de la recherche suivante"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:88
|
||||
msgid "Click this button to find next search result."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour trouver les résultats de la recherche suivante."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:92
|
||||
msgid "Locate this topic in content window"
|
||||
msgstr "Chercher ce sujet dans le contenu de la fenêtre"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:97
|
||||
msgid ""
|
||||
"Click this button to find current topic in the content window, and open it."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour trouver le sujet actuel dans le contenu de la "
|
||||
"fenêtre et l'ouvrir."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:101
|
||||
msgid "Increase font size"
|
||||
msgstr "Augmenter la taille de la police de caractères"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:106
|
||||
msgid "Click this button to increase the font size."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour augmenter la taille de la police de caractères."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:110
|
||||
msgid "Decrease font size"
|
||||
msgstr "Diminuer la taille de la police de caractères"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:115
|
||||
msgid "Click this button to decrease the font size."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour diminuer la taille de la police de caractères."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:119
|
||||
msgid "View HTML source"
|
||||
msgstr "Visualiser le code source HTML"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:124
|
||||
msgid "Click this button to open a separate window with the page HTML source."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour ouvrir une nouvelle fenêtre contenant le code "
|
||||
"source HTML de la page."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:128
|
||||
msgid "Add to bookmarks"
|
||||
msgstr "Ajouter aux marque-pages"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:133
|
||||
msgid "Click this button to add the current page to the bookmarks list."
|
||||
msgstr "Cliquer sur ce bouton pour ajouter un marque-page."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:136
|
||||
msgid "Prev page in TOC"
|
||||
msgstr "Page précédente de la TdM"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:141
|
||||
msgid "Click this button to go to previous page in Table Of Content."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour aller à la page précédente de la Table des "
|
||||
"Matières."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:144
|
||||
msgid "Next page in TOC"
|
||||
msgstr "Page suivante de la TdM"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:149
|
||||
msgid "Click this button to go to next page in Table of Content."
|
||||
msgstr ""
|
||||
"Cliquer sur ce bouton pour aller à la page suivante de la Table des Matières."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:155
|
||||
msgid "&Increase font"
|
||||
msgstr "&Augmenter la taille de la police"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:156
|
||||
msgid "&Decrease font"
|
||||
msgstr "&Diminuer la taille de la police"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:157
|
||||
msgid "&View HTML source"
|
||||
msgstr "&Visionner le code source HTML"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:160
|
||||
msgid "&Bookmark this page"
|
||||
msgstr "Ajouter un Marque-&Page"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:163
|
||||
msgid "&Full screen"
|
||||
msgstr "Pl&ein Écran"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:165
|
||||
msgid "&Show contents window"
|
||||
msgstr "A&fficher la fenêtre des contenus"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:167
|
||||
msgid "&Locate in contents window"
|
||||
msgstr "&Chercher dans la fenêtre des contenus"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:220
|
||||
msgid "&Set language"
|
||||
msgstr "Définir le &Langage"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:243
|
||||
msgid "&Set codepage"
|
||||
msgstr "Définir le &Codepage"
|
||||
|
||||
#: kchmsearchwindow.cpp:43
|
||||
msgid "Type in word(s) to search for:"
|
||||
msgstr "Entrer un/des mot(s) à rechercher :"
|
||||
|
||||
#: kchmsearchwindow.cpp:46
|
||||
msgid "<a href=\"q\"><b>Help</b></a>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:58
|
||||
msgid "Go"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:66
|
||||
msgid "Title"
|
||||
msgstr "Titre"
|
||||
|
||||
#: kchmsearchwindow.cpp:67
|
||||
msgid "Location"
|
||||
msgstr "Position"
|
||||
|
||||
#: kchmsearchwindow.cpp:130
|
||||
msgid "Search returned %1 result(s)"
|
||||
msgstr "La recherche renvoie %1 occurrence(s)"
|
||||
|
||||
#: kchmsearchwindow.cpp:133
|
||||
msgid "Search returned no results"
|
||||
msgstr "La recherche ne renvoie pas de résultat"
|
||||
|
||||
#: kchmsearchwindow.cpp:136 kchmviewwindow_qtextbrowser.cpp:211
|
||||
msgid "Search failed"
|
||||
msgstr "La recherche a échoué"
|
||||
|
||||
#: kchmsearchwindow.cpp:169 kchmsearchwindow.cpp:175
|
||||
msgid "How to use search"
|
||||
msgstr "Comment effectuer une recherche"
|
||||
|
||||
#: kchmsearchwindow.cpp:170
|
||||
msgid ""
|
||||
"<html><p>The improved search engine allows you to search for a word, symbol "
|
||||
"or phrase, which is set of words and symbols included in quotes. Only the "
|
||||
"documents which include all the terms speficide in th search query are "
|
||||
"shown; no prefixes needed.<p>Unlike MS CHM internal search index, my "
|
||||
"improved search engine indexes everything, including special symbols. "
|
||||
"Therefore it is possible to search (and find!) for something like <i>$q = "
|
||||
"new ChmFile();</i>. This search also fully supports Unicode, which means "
|
||||
"that you can search in non-English documents.<p>If you want to search for a "
|
||||
"quote symbol, use quotation mark instead. The engine treats a quote and a "
|
||||
"quotation mark as the same symbol, which allows to use them in phrases.</"
|
||||
"html>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:176
|
||||
msgid ""
|
||||
"The search query can contain a few prefixes.\n"
|
||||
"A set of words inside the quote marks mean that you are searching for exact "
|
||||
"phrase.\n"
|
||||
"A word with minus sign means that it should be absent in the search result.\n"
|
||||
"A word with plus mark or without any mark means that it must be present in "
|
||||
"the search result.\n"
|
||||
"\n"
|
||||
"Note that only letters and digits are indexed.\n"
|
||||
"You cannot search for non-character symbols other than underscope, and those "
|
||||
"symbols will be removed from the search query.\n"
|
||||
"For example, search for 'C' will give the same result as searching for 'C++'."
|
||||
msgstr ""
|
||||
"L'interrogation peut contenir quelques préfixes.\n"
|
||||
"Un ensemble de mots entre côtes signifie que l'on recherche une phrase "
|
||||
"exacte.\n"
|
||||
"Un mot précédé du signe moins (-) indique que ce mot doit être absent du "
|
||||
"résultat.\n"
|
||||
"Un mot précédé du signe plus (+) ou précédé d'aucun signe indique qu'il doit "
|
||||
"être présent dans le résultat.\n"
|
||||
"\n"
|
||||
"Seuls les chiffres et les lettres sont indexés pour la recherche.\n"
|
||||
"Il est impossible de rechercher d'autres caractères que les chiffres, les "
|
||||
"lettres et le souligné (_). Les autres caractères seront exclus de la "
|
||||
"recherche.\n"
|
||||
"Par exemple, une recherche sur 'C' donnera les mêmes résultats qu'une "
|
||||
"recherche sur 'C++'."
|
||||
|
||||
#: kchmsearchwindow.cpp:226
|
||||
#, fuzzy
|
||||
msgid "Search is not available"
|
||||
msgstr "La recherche a échoué"
|
||||
|
||||
#: kchmsearchwindow.cpp:227
|
||||
msgid ""
|
||||
"<p>The search feature is not avaiable for this chm file.<p>The old search "
|
||||
"engine depends on indexes present in chm files itself. Not every chm file "
|
||||
"has an index; it is set up during chm file creation. Therefore if the search "
|
||||
"index was not created during chm file creation, this makes search impossible."
|
||||
"<p>Solution: use new search engine (menu Settings/Advanced), which generates "
|
||||
"its own index."
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:171
|
||||
msgid "Printing (page %1)..."
|
||||
msgstr "Impression (page %1)..."
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:179
|
||||
msgid "Printing completed"
|
||||
msgstr "Impression terminée"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:183
|
||||
msgid "Printing aborted"
|
||||
msgstr "Impression interrompue"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:189
|
||||
msgid "%1 - could not print"
|
||||
msgstr "%1 - impossible d'imprimer"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:190
|
||||
msgid ""
|
||||
"Could not print.\n"
|
||||
"Your Qt library has been compiled without printing support"
|
||||
msgstr ""
|
||||
"Impossible d'imprimer.\n"
|
||||
"La librairie Qt de votre système a été compilée sans la capacité à imprimer"
|
||||
|
||||
#: kchmviewwindowmgr.cpp:65
|
||||
msgid "&Window"
|
||||
msgstr "&Fenêtre"
|
||||
|
||||
#: main.cpp:46
|
||||
msgid ""
|
||||
"'--search <query>' specifies the search query to search, and activate the "
|
||||
"first entry if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:47
|
||||
msgid ""
|
||||
"'--sindex <word>' specifies the word to find in index, and activate if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:54
|
||||
msgid "CHM file viewer"
|
||||
msgstr "Visionneur de fichiers CHM"
|
||||
|
||||
#~ msgid "Match similar words"
|
||||
#~ msgstr "Ressemble aux mots "
|
||||
|
||||
#~ msgid "Shift+Enter"
|
||||
#~ msgstr "Majuscule+Entrée"
|
||||
|
||||
#~ msgid "Ctrl+Enter"
|
||||
#~ msgstr "Contrôle+Entrée"
|
@ -0,0 +1,723 @@
|
||||
# translation of hu1.po to
|
||||
# translation of hu.po to
|
||||
# translation of kchmviewer.po to
|
||||
# This file is put in the public domain.
|
||||
#
|
||||
# Csaba Zakarias <csaba.zakarias@gmail.hu>, 2006.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: hu1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2006-02-04 02:25-0800\n"
|
||||
"PO-Revision-Date: 2006-04-11 13:44+0200\n"
|
||||
"Last-Translator: Csaba Zakarias <csaba.zakarias@gmail.hu>\n"
|
||||
"Language-Team: <hu@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.1\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 24
|
||||
#: rc.cpp:3
|
||||
#, no-c-format
|
||||
msgid "KchmViewer settings"
|
||||
msgstr "KchmViewer beállítások"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 54
|
||||
#: rc.cpp:6
|
||||
#, no-c-format
|
||||
msgid "General behavior"
|
||||
msgstr "Általános beállítások"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 73
|
||||
#: rc.cpp:9
|
||||
#, no-c-format
|
||||
msgid "If no arguments given on load"
|
||||
msgstr "Ha nem ad meg jellemzőt a betöltéskor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 84
|
||||
#: rc.cpp:12
|
||||
#, no-c-format
|
||||
msgid "Open the 'open CHM file' dialog"
|
||||
msgstr "A 'CHM fájl megnyitása' dialógus ablak megnyitása"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 92
|
||||
#: rc.cpp:15
|
||||
#, no-c-format
|
||||
msgid "Open the &last used CHM file, if exist"
|
||||
msgstr "&Legutóbbi CHM fájl megnyitása, ha létezik"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 95
|
||||
#: rc.cpp:18
|
||||
#, no-c-format
|
||||
msgid "Alt+L"
|
||||
msgstr "Alt+L"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 105
|
||||
#: rc.cpp:21
|
||||
#, no-c-format
|
||||
msgid "History"
|
||||
msgstr "Előzmények"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 124
|
||||
#: rc.cpp:24
|
||||
#, no-c-format
|
||||
msgid "Store history information for"
|
||||
msgstr "Előzmény információ tárolása"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 143
|
||||
#: rc.cpp:28
|
||||
#, no-c-format
|
||||
msgid "latest files"
|
||||
msgstr "legutóbbi fájlok"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 153
|
||||
#: rc.cpp:31
|
||||
#, no-c-format
|
||||
msgid "R&emember extra information for history files"
|
||||
msgstr "&Emlékezzen az előzmények fájlok különleges információira"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 156
|
||||
#: rc.cpp:34
|
||||
#, no-c-format
|
||||
msgid "Alt+E"
|
||||
msgstr "Alt+E"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 159
|
||||
#: rc.cpp:37
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Remembers the information about the files, which were opened. Remembers last "
|
||||
"opened page, search history, font size, bookmarks and so on."
|
||||
msgstr "Emlékezzen a megnyitott fájlok információira. Emlékezzen az utoljára megnyitott oldalra, keresési előzményekre, betűméretre, könyvjelzőkre és így tovább."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 171
|
||||
#: rc.cpp:40
|
||||
#, no-c-format
|
||||
msgid "CHM security settings"
|
||||
msgstr "CHM biztonsági beállítások"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 182
|
||||
#: rc.cpp:43
|
||||
#, no-c-format
|
||||
msgid "When external link clicked"
|
||||
msgstr "Külső kapcsolatra kattintáskor"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 193
|
||||
#: rc.cpp:46
|
||||
#, no-c-format
|
||||
msgid "Alwa&ys open it in external browser"
|
||||
msgstr "&Mindig külső böngészőben nyissa meg"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 196
|
||||
#: rc.cpp:49
|
||||
#, no-c-format
|
||||
msgid "Alt+Y"
|
||||
msgstr "Alt+Y"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 204
|
||||
#. i18n: file kchmsetupdialog.ui line 244
|
||||
#: rc.cpp:52 rc.cpp:65
|
||||
#, no-c-format
|
||||
msgid "Ask for confirmation"
|
||||
msgstr "Megerősítés kérése"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 212
|
||||
#: rc.cpp:55
|
||||
#, no-c-format
|
||||
msgid "Do not open the link"
|
||||
msgstr "Kapcsolatot ne nyissa meg"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 225
|
||||
#: rc.cpp:59
|
||||
#, no-c-format
|
||||
msgid "When link pointed to a new CHM file clicked"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 236
|
||||
#: rc.cpp:62
|
||||
#, no-c-format
|
||||
msgid "Always open a new CHM file"
|
||||
msgstr "Mindig nyissa meg azúj CHM fájlt"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 252
|
||||
#: rc.cpp:68
|
||||
#, no-c-format
|
||||
msgid "Do not open a new CHM file"
|
||||
msgstr "Ne nyissa meg az új CHM fájlt"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 266
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid "Version-specific settings"
|
||||
msgstr "Verzió függő beállítások"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 277
|
||||
#: rc.cpp:74
|
||||
#, no-c-format
|
||||
msgid "Qt version settings"
|
||||
msgstr "Qt verzió beállítások"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 299
|
||||
#: rc.cpp:77
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Enter the path to the program, which will be used as a browser for external "
|
||||
"links. A <i>%s</i> symbol will be replaced by the URL clicked."
|
||||
msgstr "Adja meg a program elérési útját a belső linkek megnyitásához egy böngésző ablakban. <i>%s</i> szimbólumot lecseréljük az URL-re kattintáskor."
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 325
|
||||
#: rc.cpp:80
|
||||
#, no-c-format
|
||||
msgid "KDE version settings"
|
||||
msgstr "KDE verzió beállítások"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 336
|
||||
#: rc.cpp:83
|
||||
#, no-c-format
|
||||
msgid "To show HTML content, use"
|
||||
msgstr "HTML tartalom megjelenítéséhez használja"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 347
|
||||
#: rc.cpp:86
|
||||
#, no-c-format
|
||||
msgid "&QTextBrowser-based widget"
|
||||
msgstr "&QTextBrowser-alapú widget"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 350
|
||||
#: rc.cpp:89
|
||||
#, no-c-format
|
||||
msgid "Alt+Q"
|
||||
msgstr "Alt+Q"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 358
|
||||
#: rc.cpp:92
|
||||
#, no-c-format
|
||||
msgid "&KHTMLPart-based widget"
|
||||
msgstr "&KHTMLPart-alapú widget"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 361
|
||||
#: rc.cpp:95
|
||||
#, no-c-format
|
||||
msgid "Alt+K"
|
||||
msgstr "Alt+K"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 371
|
||||
#: rc.cpp:98
|
||||
#, no-c-format
|
||||
msgid "KHTMLPart security"
|
||||
msgstr "KHTMLPart biztonság"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 382
|
||||
#: rc.cpp:101
|
||||
#, no-c-format
|
||||
msgid "Enable Java&Script"
|
||||
msgstr "Java&Szkript engedélyezése"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 385
|
||||
#: rc.cpp:104
|
||||
#, no-c-format
|
||||
msgid "Alt+S"
|
||||
msgstr "Alt+S"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 393
|
||||
#: rc.cpp:107
|
||||
#, no-c-format
|
||||
msgid "Enable &plugins"
|
||||
msgstr "&Beépülő modulok engedélyezése"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 396
|
||||
#: rc.cpp:110
|
||||
#, no-c-format
|
||||
msgid "Alt+P"
|
||||
msgstr "Alt+P"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 404
|
||||
#: rc.cpp:113
|
||||
#, no-c-format
|
||||
msgid "Enable &Java"
|
||||
msgstr "&Java engedélyezése"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 407
|
||||
#: rc.cpp:116
|
||||
#, no-c-format
|
||||
msgid "Alt+J"
|
||||
msgstr "Alt+J"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 415
|
||||
#: rc.cpp:119
|
||||
#, no-c-format
|
||||
msgid "Enable &refresh"
|
||||
msgstr "&Frissítés engedélyezése"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 418
|
||||
#: rc.cpp:122
|
||||
#, no-c-format
|
||||
msgid "Alt+R"
|
||||
msgstr "Alt+R"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 432
|
||||
#: rc.cpp:125
|
||||
#, no-c-format
|
||||
msgid "Advanced"
|
||||
msgstr "További"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 443
|
||||
#: rc.cpp:128
|
||||
#, no-c-format
|
||||
msgid "View HTML source command uses"
|
||||
msgstr "HTML forrás parancsok megtekintése"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 454
|
||||
#: rc.cpp:131
|
||||
#, no-c-format
|
||||
msgid "Built-in HTML source viewer"
|
||||
msgstr "Beépített HTML forrás megjelenítő"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 465
|
||||
#: rc.cpp:135
|
||||
#, no-c-format
|
||||
msgid "E&xternal program, specified below"
|
||||
msgstr "&Külső program, alább adaj meg"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 468
|
||||
#: rc.cpp:138
|
||||
#, no-c-format
|
||||
msgid "Alt+X"
|
||||
msgstr "Alt+X"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 484
|
||||
#: rc.cpp:141
|
||||
#, no-c-format
|
||||
msgid "External program:"
|
||||
msgstr "Külső program:"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 521
|
||||
#: rc.cpp:147
|
||||
#, no-c-format
|
||||
msgid "F1"
|
||||
msgstr "F1"
|
||||
|
||||
#: _translatorinfo.cpp:1
|
||||
msgid ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Your names"
|
||||
msgstr "Zakariás Csaba"
|
||||
|
||||
#: _translatorinfo.cpp:3
|
||||
msgid ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"Your emails"
|
||||
msgstr "csaba.zakarias@gmail.com"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:39
|
||||
msgid "&Add"
|
||||
msgstr "&Hozzáadás"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:41
|
||||
msgid "&Del"
|
||||
msgstr "&Törlés"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:64
|
||||
msgid "%1 - add a bookmark"
|
||||
msgstr "%1 - hozzáadás a könyvjelzőhöz"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:65 kchmbookmarkwindow.cpp:101
|
||||
msgid "Enter the name for this bookmark:"
|
||||
msgstr "Adja meg a könyvjelző nevét:"
|
||||
|
||||
#: kchmbookmarkwindow.cpp:100
|
||||
msgid "%1 - edit the bookmark name"
|
||||
msgstr "%1 - könyvjelző név szerkesztése"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:34
|
||||
msgid "Topics"
|
||||
msgstr "Témák"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:39
|
||||
msgid "Please select one of the topics below:"
|
||||
msgstr "Jelölje ki az egyik alábbi témát:"
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:43
|
||||
msgid "&Ok"
|
||||
msgstr "&OK"
|
||||
|
||||
#: kchmmainwindow.cpp:122
|
||||
msgid "*.chm|Compressed Help Manual (*.chm)"
|
||||
msgstr "Tömörített Súgó Kézikönyv (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:124
|
||||
msgid "Compressed Help Manual (*.chm)"
|
||||
msgstr "Tömörített Súgó Kézikönyv (*.chm)"
|
||||
|
||||
#: kchmmainwindow.cpp:134
|
||||
msgid "Loading aborted"
|
||||
msgstr "Betöltés sikertelen"
|
||||
|
||||
#: kchmmainwindow.cpp:231
|
||||
msgid "%1 - failed to load the chm file"
|
||||
msgstr "%1 - hiba a chm fájl betöltésekor"
|
||||
|
||||
#: kchmmainwindow.cpp:232
|
||||
msgid "Unable to load the chm file %1"
|
||||
msgstr "%1 chm fájl nem tölthető be"
|
||||
|
||||
#: kchmmainwindow.cpp:242
|
||||
msgid "Could not load file %1"
|
||||
msgstr "%1 fájl nem tölthető be"
|
||||
|
||||
#: kchmmainwindow.cpp:258
|
||||
msgid "About %1"
|
||||
msgstr "%1 névjegye"
|
||||
|
||||
#: kchmmainwindow.cpp:259
|
||||
msgid ""
|
||||
"%1 version %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2005-2006\n"
|
||||
"www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Licensed under GNU GPL license.\n"
|
||||
"\n"
|
||||
"Please try our another project, www.transientmail.com - temporary e-mail "
|
||||
"address, which expires automatically."
|
||||
msgstr ""
|
||||
"%1 verzió %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2005-2006\n"
|
||||
"www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"GNU GPL licensz.\n"
|
||||
"\n"
|
||||
"Kérem, próbálja ki más projektünket is, ww.transientmail.com."
|
||||
|
||||
#: kchmmainwindow.cpp:330
|
||||
msgid "%1 - remote link clicked - %2"
|
||||
msgstr "%1 - távoli kapcsolatra kattintás - %2"
|
||||
|
||||
#: kchmmainwindow.cpp:331
|
||||
msgid ""
|
||||
"A remote link %1 will start the external program to open it.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"%1 távoli kapcsolat megnyitásához külső programot indít.\n"
|
||||
"\n"
|
||||
"Akarja folytatni?"
|
||||
|
||||
#: kchmmainwindow.cpp:332 kchmmainwindow.cpp:368
|
||||
msgid "&Yes"
|
||||
msgstr "&Igen"
|
||||
|
||||
#: kchmmainwindow.cpp:332 kchmmainwindow.cpp:368
|
||||
msgid "&No"
|
||||
msgstr "&Nem"
|
||||
|
||||
#: kchmmainwindow.cpp:356
|
||||
msgid "%1 - JavsScript link clicked"
|
||||
msgstr "%1 - JavaSzkriptre kattintás"
|
||||
|
||||
#: kchmmainwindow.cpp:357
|
||||
msgid ""
|
||||
"You have clicked a JavaScript link.\n"
|
||||
"To prevent security-related issues JavaScript URLs are disabled in CHM files."
|
||||
msgstr ""
|
||||
"JavaSzkriptet akart elindítani.\n"
|
||||
"Biztonsági okoból a JavaSzkript le van tiltva a CHM fájlokban."
|
||||
|
||||
#: kchmmainwindow.cpp:366
|
||||
msgid "%1 - link to a new CHM file clicked"
|
||||
msgstr "%1 - új CHM fájlra mutató kapcsolatra kattintás"
|
||||
|
||||
#: kchmmainwindow.cpp:367
|
||||
msgid ""
|
||||
"You have clicked a link, which leads to a new CHM file %1.\n"
|
||||
"The current file will be closed.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
"A %1 új CHM fájlra mutató kapcsolatra kattintott.\n"
|
||||
"A jelenlegi fájl bezárul.\n"
|
||||
"\n"
|
||||
"Akarja folytatni?"
|
||||
|
||||
#: kchmmainwindow.cpp:428
|
||||
msgid "File Operations"
|
||||
msgstr "Fájl műveletek"
|
||||
|
||||
#: kchmmainwindow.cpp:432
|
||||
msgid "Open File"
|
||||
msgstr "Fájl megnyitása"
|
||||
|
||||
#: kchmmainwindow.cpp:438
|
||||
msgid "Click this button to open an existing chm file."
|
||||
msgstr "Létező chm fájl megnyitásához kattintson erre a gombra."
|
||||
|
||||
#: kchmmainwindow.cpp:443
|
||||
msgid "Print File"
|
||||
msgstr "Fájl nyomtatása"
|
||||
|
||||
#: kchmmainwindow.cpp:449
|
||||
msgid "Click this button to print the current page"
|
||||
msgstr "Az aktuális oldal kinyomtatásához kattintson erre a gombra."
|
||||
|
||||
#: kchmmainwindow.cpp:453
|
||||
msgid "Navigation"
|
||||
msgstr "Navigáció"
|
||||
|
||||
#: kchmmainwindow.cpp:457
|
||||
msgid "Move backward in history"
|
||||
msgstr "Az előzményekben hátrébb mozgatása"
|
||||
|
||||
#: kchmmainwindow.cpp:462
|
||||
msgid "Click this button to move backward in browser history"
|
||||
msgstr "A böngésző előzmények közötti visszafelé mozgáshoz kattintson erre a gombra."
|
||||
|
||||
#: kchmmainwindow.cpp:466
|
||||
msgid "Move forward in history"
|
||||
msgstr "Az előzményekben előrébb mozgatása"
|
||||
|
||||
#: kchmmainwindow.cpp:471
|
||||
msgid "Click this button to move forward in browser history"
|
||||
msgstr "A böngésző előzmények közötti előrefelé mozgáshoz kattintson erre a gombra."
|
||||
|
||||
#: kchmmainwindow.cpp:475
|
||||
msgid "Go to the home page"
|
||||
msgstr "Alapoldalra ugrás"
|
||||
|
||||
#: kchmmainwindow.cpp:480
|
||||
msgid "Click this button to move to the home page"
|
||||
msgstr "Az alapoldalra ugráshoz kattintson erre a gombra."
|
||||
|
||||
#: kchmmainwindow.cpp:498
|
||||
msgid "&Recent files"
|
||||
msgstr "&Legutóbbi fájlok"
|
||||
|
||||
#: kchmmainwindow.cpp:507 kchmviewwindow_khtmlpart.cpp:163
|
||||
msgid "&Select all"
|
||||
msgstr "&Minden kijelölése"
|
||||
|
||||
#: kchmmainwindow.cpp:515
|
||||
msgid "&Setup"
|
||||
msgstr "&Beállítás"
|
||||
|
||||
#: kchmmainwindow.cpp:516
|
||||
msgid "&Change settings..."
|
||||
msgstr "&Beállítások megváltoztatása"
|
||||
|
||||
#: kchmmainwindow.cpp:522
|
||||
msgid "About &Qt"
|
||||
msgstr "&Qt névjegye"
|
||||
|
||||
#: kchmmainwindow.cpp:524
|
||||
msgid "What's &This"
|
||||
msgstr "&Mi ez?"
|
||||
|
||||
#: kchmmainwindow.cpp:893
|
||||
msgid "Index"
|
||||
msgstr "Index"
|
||||
|
||||
#: kchmmainwindow.cpp:916
|
||||
msgid "Search"
|
||||
msgstr "Keresés"
|
||||
|
||||
#: kchmmainwindow.cpp:972
|
||||
msgid "Could not locate opened topic in content window"
|
||||
msgstr "Nem található a megnyitott téma a tartalom albakban"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:45
|
||||
msgid "Find in page"
|
||||
msgstr "Keresés az oldalon"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:62
|
||||
msgid "Enter here the text to search in the current page."
|
||||
msgstr "Adja meg az aktuális oldalon keresendő szöveget."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:69
|
||||
msgid "Previous search result"
|
||||
msgstr "Előző keresési eredmény"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:74
|
||||
msgid "Click this button to find previous search result."
|
||||
msgstr "Az előző keresési eredmény megjelenítéséhez kattintson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:78
|
||||
msgid "Next search result"
|
||||
msgstr "Következő keresési eredmény"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:83
|
||||
msgid "Click this button to find next search result."
|
||||
msgstr "A következő keresési eredmény megjelenítéséhez kattintson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:87
|
||||
msgid "Locate this topic in content window"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:92
|
||||
msgid "Click this button to find current topic in the content window, and open it."
|
||||
msgstr "Kattintson a gombra a jelenlegi témának a tartalom ablakban történő megkereséséhez és megnyitásához."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:96
|
||||
msgid "Increase font size"
|
||||
msgstr "Betűméret növelése"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:101
|
||||
msgid "Click this button to increase the font size."
|
||||
msgstr "A betűméret növeléséhez kattinson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:105
|
||||
msgid "Decrease font size"
|
||||
msgstr "Betűméret csökkentése"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:110
|
||||
msgid "Click this button to decrease the font size."
|
||||
msgstr "A betűméret csökkentéséhez kattinson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:114
|
||||
msgid "View HTML source"
|
||||
msgstr "HTML forrás megtekintése"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:119
|
||||
msgid "Click this button to open a separate window with the page HTML source."
|
||||
msgstr "Az oldal HTML forrásának külön ablakban történő megnyitásához kattintson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:123
|
||||
msgid "Add to bookmarks"
|
||||
msgstr "Hozzáadás a könyvjelzőhöz"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:128
|
||||
msgid "Click this button to add the current page to the bookmarks list."
|
||||
msgstr "Kattintson a gomba az aktuális oldal könyvjelző listához való hozzáadására."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:131
|
||||
msgid "Prev page in TOC"
|
||||
msgstr "Előző oldal a tartalomjegyzékben"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:136
|
||||
msgid "Click this button to go to previous page in Table Of Content."
|
||||
msgstr "A tartalomjegyzékben az előző oldalra ugráshoz kattintson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:139
|
||||
msgid "Next page in TOC"
|
||||
msgstr "Következő oldal a tartalomjegyzékben"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:144
|
||||
msgid "Click this button to go to next page in Table of Content."
|
||||
msgstr "A tartalomjegyzékben a következő oldalra ugráshoz kattintson erre a gombra."
|
||||
|
||||
#: kchmsearchtoolbar.cpp:150
|
||||
msgid "&Increase font"
|
||||
msgstr "&Betűméret növelése"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:151
|
||||
msgid "&Decrease font"
|
||||
msgstr "&Betűméret csökkentése"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:152
|
||||
msgid "&View HTML source"
|
||||
msgstr "&HTML forrás megtekintése"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:155
|
||||
msgid "&Bookmark this page"
|
||||
msgstr "&Oldal berakása a könyvjelzőbe"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:158
|
||||
msgid "&Full screen"
|
||||
msgstr "&Teljes képernyő"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:160
|
||||
msgid "&Show contents window"
|
||||
msgstr "&Tartalom ablak mutatása"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:162
|
||||
msgid "&Locate in contents window"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:215
|
||||
msgid "&Set language"
|
||||
msgstr "&Nyelv beállítása"
|
||||
|
||||
#: kchmsearchtoolbar.cpp:238
|
||||
msgid "&Set codepage"
|
||||
msgstr "&Kódlap beállítása"
|
||||
|
||||
#: kchmsearchwindow.cpp:36
|
||||
msgid "Type in word(s) to search for:"
|
||||
msgstr "Adja meg a keresendő szavakat:"
|
||||
|
||||
#: kchmsearchwindow.cpp:51
|
||||
msgid "Title"
|
||||
msgstr "Cím"
|
||||
|
||||
#: kchmsearchwindow.cpp:52
|
||||
msgid "Location"
|
||||
msgstr "Hely"
|
||||
|
||||
#: kchmsearchwindow.cpp:60
|
||||
msgid "Match similar words"
|
||||
msgstr "Hasonló szavak keresése"
|
||||
|
||||
#: kchmsearchwindow.cpp:93
|
||||
msgid "Search returned %1 result(s)"
|
||||
msgstr "Keresés %1 eredményt adott"
|
||||
|
||||
#: kchmsearchwindow.cpp:96
|
||||
msgid "Search returned no results"
|
||||
msgstr "Keresés nem adott vissza eredményt"
|
||||
|
||||
#: kchmsearchwindow.cpp:99 kchmviewwindow_qtextbrowser.cpp:216
|
||||
msgid "Search failed"
|
||||
msgstr "Keresés érvénytelen"
|
||||
|
||||
#: kchmsearchwindow.cpp:395
|
||||
msgid "How to use search"
|
||||
msgstr "Hogyan használja a keresőt"
|
||||
|
||||
#: kchmsearchwindow.cpp:396
|
||||
msgid ""
|
||||
"The search query can contain a few prefixes.\n"
|
||||
"A set of words inside the quote marks mean that you are searching for exact "
|
||||
"phrase.\n"
|
||||
"A word with minus sign means that it should be absent in the search result.\n"
|
||||
"A word with plus mark or without any mark means that it must be present in "
|
||||
"the search result.\n"
|
||||
"\n"
|
||||
"Note that only letters and digits are indexed.\n"
|
||||
"You cannot search for symbols other than underscope, and these symbols will "
|
||||
"be removed from the search query.\n"
|
||||
"For example, search for 'C' will give the same result as searching for 'C++'."
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_khtmlpart.cpp:161
|
||||
msgid "Editor"
|
||||
msgstr "Szerkesztő"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:176
|
||||
msgid "Printing (page %1)..."
|
||||
msgstr "Nyomtatás (%1 oldal)..."
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:184
|
||||
msgid "Printing completed"
|
||||
msgstr "Nyomtatás kész"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:188
|
||||
msgid "Printing aborted"
|
||||
msgstr "Nyomtatás megszakítva"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:194
|
||||
msgid "%1 - could not print"
|
||||
msgstr "%1 - nem nyomtatható"
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:195
|
||||
msgid ""
|
||||
"Could not print.\n"
|
||||
"Your Qt library has been compiled without printing support"
|
||||
msgstr ""
|
||||
"Nem nyomtatható.\n"
|
||||
"A Qt könyvtár nyomtatás támogatás nélkül lett lefordítva."
|
||||
|
||||
#: main.cpp:50
|
||||
msgid "CHM file viewer"
|
||||
msgstr "CHM fájl megjelenítő"
|
||||
|
@ -0,0 +1,806 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# This file is put in the public domain.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-03-13 20:31-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 24
|
||||
#: rc.cpp:3
|
||||
#, no-c-format
|
||||
msgid "KchmViewer settings"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 54
|
||||
#: rc.cpp:6
|
||||
#, no-c-format
|
||||
msgid "General behavior"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 73
|
||||
#: rc.cpp:9
|
||||
#, no-c-format
|
||||
msgid "If no arguments given on load"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 84
|
||||
#: rc.cpp:12
|
||||
#, no-c-format
|
||||
msgid "Open the 'open CHM file' dialog"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 92
|
||||
#: rc.cpp:15
|
||||
#, no-c-format
|
||||
msgid "Open the &last used CHM file, if exist"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 95
|
||||
#: rc.cpp:18
|
||||
#, no-c-format
|
||||
msgid "Alt+L"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 105
|
||||
#: rc.cpp:21
|
||||
#, no-c-format
|
||||
msgid "History"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 124
|
||||
#: rc.cpp:24
|
||||
#, no-c-format
|
||||
msgid "Store history information for"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 143
|
||||
#: rc.cpp:28
|
||||
#, no-c-format
|
||||
msgid "latest files"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 153
|
||||
#: rc.cpp:31
|
||||
#, no-c-format
|
||||
msgid "R&emember extra information for history files"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 156
|
||||
#: rc.cpp:34
|
||||
#, no-c-format
|
||||
msgid "Alt+E"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 159
|
||||
#: rc.cpp:37
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Remembers the information about the files, which were opened. Remembers last "
|
||||
"opened page, search history, font size, bookmarks and so on."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 171
|
||||
#: rc.cpp:40
|
||||
#, no-c-format
|
||||
msgid "CHM security settings"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 182
|
||||
#: rc.cpp:43
|
||||
#, no-c-format
|
||||
msgid "When external link clicked"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 193
|
||||
#: rc.cpp:46
|
||||
#, no-c-format
|
||||
msgid "Alwa&ys open it in external browser"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 196
|
||||
#: rc.cpp:49
|
||||
#, no-c-format
|
||||
msgid "Alt+Y"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 204
|
||||
#. i18n: file kchmsetupdialog.ui line 244
|
||||
#: rc.cpp:52 rc.cpp:65
|
||||
#, no-c-format
|
||||
msgid "Ask for confirmation"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 212
|
||||
#: rc.cpp:55
|
||||
#, no-c-format
|
||||
msgid "Do not open the link"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 225
|
||||
#: rc.cpp:59
|
||||
#, no-c-format
|
||||
msgid "When link pointed to a new CHM file clicked"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 236
|
||||
#: rc.cpp:62
|
||||
#, no-c-format
|
||||
msgid "Always open a new CHM file"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 252
|
||||
#: rc.cpp:68
|
||||
#, no-c-format
|
||||
msgid "Do not open a new CHM file"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 266
|
||||
#: rc.cpp:71
|
||||
#, no-c-format
|
||||
msgid "Version-specific settings"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 277
|
||||
#: rc.cpp:74
|
||||
#, no-c-format
|
||||
msgid "Qt version settings"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 299
|
||||
#: rc.cpp:77
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Enter the path to the program, which will be used as a browser for external "
|
||||
"links. A <i>%s</i> symbol will be replaced by the URL clicked."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 325
|
||||
#: rc.cpp:80
|
||||
#, no-c-format
|
||||
msgid "KDE version settings"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 336
|
||||
#: rc.cpp:83
|
||||
#, no-c-format
|
||||
msgid "To show HTML content, use"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 347
|
||||
#: rc.cpp:86
|
||||
#, no-c-format
|
||||
msgid "&QTextBrowser-based widget"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 350
|
||||
#: rc.cpp:89
|
||||
#, no-c-format
|
||||
msgid "Alt+Q"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 358
|
||||
#: rc.cpp:92
|
||||
#, no-c-format
|
||||
msgid "&KHTMLPart-based widget"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 361
|
||||
#: rc.cpp:95
|
||||
#, no-c-format
|
||||
msgid "Alt+K"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 371
|
||||
#: rc.cpp:98
|
||||
#, no-c-format
|
||||
msgid "KHTMLPart security"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 382
|
||||
#: rc.cpp:101
|
||||
#, no-c-format
|
||||
msgid "Enable Java&Script"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 385
|
||||
#: rc.cpp:104
|
||||
#, no-c-format
|
||||
msgid "Alt+S"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 393
|
||||
#: rc.cpp:107
|
||||
#, no-c-format
|
||||
msgid "Enable &plugins"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 396
|
||||
#: rc.cpp:110
|
||||
#, no-c-format
|
||||
msgid "Alt+P"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 404
|
||||
#: rc.cpp:113
|
||||
#, no-c-format
|
||||
msgid "Enable &Java"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 407
|
||||
#: rc.cpp:116
|
||||
#, no-c-format
|
||||
msgid "Alt+J"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 415
|
||||
#: rc.cpp:119
|
||||
#, no-c-format
|
||||
msgid "Enable &refresh"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 418
|
||||
#: rc.cpp:122
|
||||
#, no-c-format
|
||||
msgid "Alt+R"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 432
|
||||
#: rc.cpp:125
|
||||
#, no-c-format
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 443
|
||||
#: rc.cpp:128
|
||||
#, no-c-format
|
||||
msgid "View HTML source command uses"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 454
|
||||
#: rc.cpp:131
|
||||
#, no-c-format
|
||||
msgid "Built-in HTML source viewer"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 465
|
||||
#: rc.cpp:135
|
||||
#, no-c-format
|
||||
msgid "E&xternal program, specified below"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 468
|
||||
#: rc.cpp:138
|
||||
#, no-c-format
|
||||
msgid "Alt+X"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 484
|
||||
#: rc.cpp:141
|
||||
#, no-c-format
|
||||
msgid "External program:"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 501
|
||||
#: rc.cpp:144
|
||||
#, no-c-format
|
||||
msgid "Search engine to use"
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 528
|
||||
#: rc.cpp:148
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use the search based on internal CHM index. This engine cannot search for "
|
||||
"any symbols except underscode, does not support multibyte languages, and is "
|
||||
"not always available."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 555
|
||||
#: rc.cpp:152
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
"Use new kchmviewer internal search engine (recommended). This engine "
|
||||
"indexes symbols, so it is possible to search for special symbols (like \"C++"
|
||||
"\"). All languages are supported. The index will be generated before the "
|
||||
"first search."
|
||||
msgstr ""
|
||||
|
||||
#. i18n: file kchmsetupdialog.ui line 588
|
||||
#: rc.cpp:158
|
||||
#, no-c-format
|
||||
msgid "F1"
|
||||
msgstr ""
|
||||
|
||||
#: _translatorinfo.cpp:1
|
||||
msgid ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Your names"
|
||||
msgstr ""
|
||||
|
||||
#: _translatorinfo.cpp:3
|
||||
msgid ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"Your emails"
|
||||
msgstr ""
|
||||
|
||||
#: kchmbookmarkwindow.cpp:44
|
||||
msgid "&Add"
|
||||
msgstr ""
|
||||
|
||||
#: kchmbookmarkwindow.cpp:46
|
||||
msgid "&Del"
|
||||
msgstr ""
|
||||
|
||||
#: kchmbookmarkwindow.cpp:88
|
||||
msgid "%1 - add a bookmark"
|
||||
msgstr ""
|
||||
|
||||
#: kchmbookmarkwindow.cpp:89 kchmbookmarkwindow.cpp:131
|
||||
msgid "Enter the name for this bookmark:"
|
||||
msgstr ""
|
||||
|
||||
#: kchmbookmarkwindow.cpp:130
|
||||
msgid "%1 - edit the bookmark name"
|
||||
msgstr ""
|
||||
|
||||
#: kchmbookmarkwindow.cpp:201
|
||||
msgid "&Add bookmark"
|
||||
msgstr ""
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:34
|
||||
msgid "Topics"
|
||||
msgstr ""
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:39
|
||||
msgid "Please select one of the topics below:"
|
||||
msgstr ""
|
||||
|
||||
#: kchmdialogchooseurlfromlist.cpp:43
|
||||
msgid "&Ok"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:122
|
||||
msgid ""
|
||||
"%1 version %2\n"
|
||||
"\n"
|
||||
"Copyright (C) George Yunaev,gyunaev@ulduzsoft.com, 2004-2007\n"
|
||||
"http://www.kchmviewer.net\n"
|
||||
"\n"
|
||||
"Licensed under GNU GPL license.\n"
|
||||
"\n"
|
||||
"Please check my another project, http://www.transientmail.com - temporary e-"
|
||||
"mail address, which expires automatically."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:139
|
||||
msgid "*.chm|Compressed Help Manual (*.chm)"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:141
|
||||
msgid "Compressed Help Manual (*.chm)"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:151
|
||||
msgid "Loading aborted"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:261
|
||||
msgid "%1 - failed to load the chm file"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:262
|
||||
msgid "Unable to load the chm file %1"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:272
|
||||
msgid "Could not load file %1"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:288
|
||||
msgid "About %1"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:374
|
||||
msgid "%1 - remote link clicked - %2"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:375
|
||||
msgid ""
|
||||
"A remote link %1 will start the external program to open it.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&Yes"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:376 kchmmainwindow.cpp:411
|
||||
msgid "&No"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:400
|
||||
msgid "%1 - JavsScript link clicked"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:401
|
||||
msgid ""
|
||||
"You have clicked a JavaScript link.\n"
|
||||
"To prevent security-related issues JavaScript URLs are disabled in CHM files."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:409
|
||||
msgid "%1 - link to a new CHM file clicked"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:410
|
||||
msgid ""
|
||||
"You have clicked a link, which leads to a new CHM file %1.\n"
|
||||
"The current file will be closed.\n"
|
||||
"\n"
|
||||
"Do you want to continue?"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:474
|
||||
msgid "File Operations"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:478
|
||||
msgid "Open File"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:484
|
||||
msgid "Click this button to open an existing chm file."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:489
|
||||
msgid "Print File"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:495
|
||||
msgid "Click this button to print the current page"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:510
|
||||
msgid "E&xtract CHM content..."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:511
|
||||
msgid ""
|
||||
"Click this button to extract the whole CHM file content into a specific "
|
||||
"directory"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:517
|
||||
msgid "&Recent files"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:526
|
||||
msgid "&Select all"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:544
|
||||
msgid "&Change settings..."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:551
|
||||
msgid "About &Qt"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:553
|
||||
msgid "What's &This"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:836
|
||||
msgid ""
|
||||
"Changing browser view options or search engine used\n"
|
||||
"requires restarting the application to take effect."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:954
|
||||
msgid "Index"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:977 kchmsearchengine.cpp:246
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:1044
|
||||
msgid "Could not locate opened topic in content window"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:1056 kchmmainwindow.cpp:1062
|
||||
msgid "Choose a directory to store CHM content"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting CHM content"
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Extracting files..."
|
||||
msgstr ""
|
||||
|
||||
#: kchmmainwindow.cpp:1075
|
||||
msgid "Abort"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:33
|
||||
msgid "Navigation"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:37
|
||||
msgid "Move backward in history"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:42
|
||||
msgid "Click this button to move backward in browser history"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:46
|
||||
msgid "Move forward in history"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:51
|
||||
msgid "Click this button to move forward in browser history"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:55
|
||||
msgid "Go to the home page"
|
||||
msgstr ""
|
||||
|
||||
#: kchmnavtoolbar.cpp:60
|
||||
msgid "Click this button to move to the home page"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchengine.cpp:246
|
||||
msgid "A closing quote character is missing."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:50
|
||||
msgid "Find in page"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:67
|
||||
msgid "Enter here the text to search in the current page."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:74
|
||||
msgid "Previous search result"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:79
|
||||
msgid "Click this button to find previous search result."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:83
|
||||
msgid "Next search result"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:88
|
||||
msgid "Click this button to find next search result."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:92
|
||||
msgid "Locate this topic in content window"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:97
|
||||
msgid ""
|
||||
"Click this button to find current topic in the content window, and open it."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:101
|
||||
msgid "Increase font size"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:106
|
||||
msgid "Click this button to increase the font size."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:110
|
||||
msgid "Decrease font size"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:115
|
||||
msgid "Click this button to decrease the font size."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:119
|
||||
msgid "View HTML source"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:124
|
||||
msgid "Click this button to open a separate window with the page HTML source."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:128
|
||||
msgid "Add to bookmarks"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:133
|
||||
msgid "Click this button to add the current page to the bookmarks list."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:136
|
||||
msgid "Prev page in TOC"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:141
|
||||
msgid "Click this button to go to previous page in Table Of Content."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:144
|
||||
msgid "Next page in TOC"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:149
|
||||
msgid "Click this button to go to next page in Table of Content."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:155
|
||||
msgid "&Increase font"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:156
|
||||
msgid "&Decrease font"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:157
|
||||
msgid "&View HTML source"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:160
|
||||
msgid "&Bookmark this page"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:163
|
||||
msgid "&Full screen"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:165
|
||||
msgid "&Show contents window"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:167
|
||||
msgid "&Locate in contents window"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:220
|
||||
msgid "&Set language"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchtoolbar.cpp:243
|
||||
msgid "&Set codepage"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:43
|
||||
msgid "Type in word(s) to search for:"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:46
|
||||
msgid "<a href=\"q\"><b>Help</b></a>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:58
|
||||
msgid "Go"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:66
|
||||
msgid "Title"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:67
|
||||
msgid "Location"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:130
|
||||
msgid "Search returned %1 result(s)"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:133
|
||||
msgid "Search returned no results"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:136 kchmviewwindow_qtextbrowser.cpp:211
|
||||
msgid "Search failed"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:169 kchmsearchwindow.cpp:175
|
||||
msgid "How to use search"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:170
|
||||
msgid ""
|
||||
"<html><p>The improved search engine allows you to search for a word, symbol "
|
||||
"or phrase, which is set of words and symbols included in quotes. Only the "
|
||||
"documents which include all the terms speficide in th search query are "
|
||||
"shown; no prefixes needed.<p>Unlike MS CHM internal search index, my "
|
||||
"improved search engine indexes everything, including special symbols. "
|
||||
"Therefore it is possible to search (and find!) for something like <i>$q = "
|
||||
"new ChmFile();</i>. This search also fully supports Unicode, which means "
|
||||
"that you can search in non-English documents.<p>If you want to search for a "
|
||||
"quote symbol, use quotation mark instead. The engine treats a quote and a "
|
||||
"quotation mark as the same symbol, which allows to use them in phrases.</"
|
||||
"html>"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:176
|
||||
msgid ""
|
||||
"The search query can contain a few prefixes.\n"
|
||||
"A set of words inside the quote marks mean that you are searching for exact "
|
||||
"phrase.\n"
|
||||
"A word with minus sign means that it should be absent in the search result.\n"
|
||||
"A word with plus mark or without any mark means that it must be present in "
|
||||
"the search result.\n"
|
||||
"\n"
|
||||
"Note that only letters and digits are indexed.\n"
|
||||
"You cannot search for non-character symbols other than underscope, and those "
|
||||
"symbols will be removed from the search query.\n"
|
||||
"For example, search for 'C' will give the same result as searching for 'C++'."
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:226
|
||||
msgid "Search is not available"
|
||||
msgstr ""
|
||||
|
||||
#: kchmsearchwindow.cpp:227
|
||||
msgid ""
|
||||
"<p>The search feature is not avaiable for this chm file.<p>The old search "
|
||||
"engine depends on indexes present in chm files itself. Not every chm file "
|
||||
"has an index; it is set up during chm file creation. Therefore if the search "
|
||||
"index was not created during chm file creation, this makes search impossible."
|
||||
"<p>Solution: use new search engine (menu Settings/Advanced), which generates "
|
||||
"its own index."
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:171
|
||||
msgid "Printing (page %1)..."
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:179
|
||||
msgid "Printing completed"
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:183
|
||||
msgid "Printing aborted"
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:189
|
||||
msgid "%1 - could not print"
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindow_qtextbrowser.cpp:190
|
||||
msgid ""
|
||||
"Could not print.\n"
|
||||
"Your Qt library has been compiled without printing support"
|
||||
msgstr ""
|
||||
|
||||
#: kchmviewwindowmgr.cpp:65
|
||||
msgid "&Window"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:46
|
||||
msgid ""
|
||||
"'--search <query>' specifies the search query to search, and activate the "
|
||||
"first entry if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:47
|
||||
msgid ""
|
||||
"'--sindex <word>' specifies the word to find in index, and activate if found"
|
||||
msgstr ""
|
||||
|
||||
#: main.cpp:54
|
||||
msgid "CHM file viewer"
|
||||
msgstr ""
|
@ -0,0 +1,39 @@
|
||||
if AMC_USE_KDE
|
||||
LIB_KDEEXTRADIR = kde
|
||||
LIB_KDEEXTRA = kde/libkdeextra.a
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = kchmviewer
|
||||
kchmviewer_SOURCES = iconstorage.cpp kchmbookmarkwindow.cpp kchmconfig.cpp \
|
||||
kchmindexwindow.cpp kchmmainwindow.cpp kchmsearchtoolbar.cpp kchmsearchwindow.cpp \
|
||||
kchmsettings.cpp kchmsourcefactory.cpp kchmtreeviewitem.cpp kchmviewwindow.cpp main.cpp \
|
||||
kchmdialogchooseurlfromlist.cpp kde-qt.cpp kchmviewwindow_qtextbrowser.cpp \
|
||||
kchmsetupdialog.ui kqtempfile.cpp kchmnavtoolbar.cpp kchmviewwindowmgr.cpp \
|
||||
kchmkeyeventfilter.cpp kchmcontentswindow.cpp kchmsearchengine_impl.cpp \
|
||||
kchmsearchengine.cpp
|
||||
|
||||
# set the include path found by configure
|
||||
INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES) $(LIBCHMFILE_INCLUDES)
|
||||
|
||||
SUBDIRS = $(LIB_KDEEXTRADIR) . pics
|
||||
|
||||
# the library search path.
|
||||
kchmviewer_LDADD = $(top_builddir)/lib/libchmfile/libchmfile.a $(LIB_KDEEXTRA) \
|
||||
$(CHM_LIBS) $(LIB_QT) $(LIB_KDEUI) $(LIB_KHTML)
|
||||
kchmviewer_LDFLAGS = $(QT_LDFLAGS) $(KDE_LDFLAGS) -L../lib/chmlib/
|
||||
|
||||
METASOURCES = AUTO
|
||||
KDE_OPTIONS = qtonly
|
||||
KDE_ICON = AUTO
|
||||
noinst_HEADERS = kchmsettings.h forwarddeclarations.h kchmsourcefactory.h \
|
||||
iconstorage.h kchmbookmarkwindow.h kchmconfig.h kchmtreeviewitem.h \
|
||||
kchmdialogchooseurlfromlist.h kchmviewwindow.h kchmindexwindow.h \
|
||||
kchmmainwindow.h kchmviewwindow_qtextbrowser.h kchmsearchtoolbar.h kde-qt.h \
|
||||
kchmsearchwindow.h kqtempfile.h kqrunprocess.h kchmnavtoolbar.h kchmviewwindowmgr.h \
|
||||
kchmkeyeventfilter.h kchmcontentswindow.h kchmlistitemtooltip.h kchmsearchengine_impl.h \
|
||||
kchmsearchengine.h
|
||||
|
||||
messages: rc.cpp
|
||||
$(EXTRACTRC) *.rc > rc.cpp
|
||||
$(EXTRACTRC) *.ui >> rc.cpp
|
||||
$(XGETTEXT) rc.cpp *.h *.cpp -o $(podir)/kchmviewer.pot
|
@ -0,0 +1,255 @@
|
||||
/* src/config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Application version as integer */
|
||||
#undef APP_INT_VERSION
|
||||
|
||||
/* Application name */
|
||||
#undef APP_NAME
|
||||
|
||||
/* Application version as text */
|
||||
#undef APP_VERSION
|
||||
|
||||
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
|
||||
#undef HAVE_CARBON_CARBON_H
|
||||
|
||||
/* Define if you have the CoreAudio API */
|
||||
#undef HAVE_COREAUDIO
|
||||
|
||||
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||
#undef HAVE_CRT_EXTERNS_H
|
||||
|
||||
/* Defines if your system has the crypt function */
|
||||
#undef HAVE_CRYPT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have libjpeg */
|
||||
#undef HAVE_LIBJPEG
|
||||
|
||||
/* Define if you have libpng */
|
||||
#undef HAVE_LIBPNG
|
||||
|
||||
/* Define if you have a working libpthread (will enable threaded code) */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define if you have libz */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if your system needs _NSGetEnviron to set up the environment */
|
||||
#undef HAVE_NSGETENVIRON
|
||||
|
||||
/* Define if you have res_init */
|
||||
#undef HAVE_RES_INIT
|
||||
|
||||
/* Define if you have the res_init prototype */
|
||||
#undef HAVE_RES_INIT_PROTO
|
||||
|
||||
/* Define if you have a STL implementation by SGI */
|
||||
#undef HAVE_SGI_STL
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have strlcat */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define if you have the strlcat prototype */
|
||||
#undef HAVE_STRLCAT_PROTO
|
||||
|
||||
/* Define if you have strlcpy */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the strlcpy prototype */
|
||||
#undef HAVE_STRLCPY_PROTO
|
||||
|
||||
/* Define to 1 if you have the <sys/bitypes.h> header file. */
|
||||
#undef HAVE_SYS_BITYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Suffix for lib directories */
|
||||
#undef KDELIBSUFF
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `char *', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR_P
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
/* The size of `unsigned long', as computed by sizeof. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* use builtin chmlib */
|
||||
#undef USE_BUILTIN_CHMLIB
|
||||
|
||||
/* use KDE support */
|
||||
#undef USE_KDE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Defined if compiling without arts */
|
||||
#undef WITHOUT_ARTS
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/*
|
||||
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
|
||||
* headers and I'm too lazy to write a configure test as long as only
|
||||
* unixware is related
|
||||
*/
|
||||
#ifdef _UNIXWARE
|
||||
#define HAVE_BOOLEAN
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
|
||||
* that defines bzero.
|
||||
*/
|
||||
|
||||
#if defined(_AIX)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
|
||||
# include <sys/time.h>
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_RES_INIT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int res_init(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCAT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcat(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCPY_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcpy(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* On HP-UX, the declaration of vsnprintf() is needed every time !
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int snprintf(char *str, size_t n, char const *fmt, ...);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__SVR4) && !defined(__svr4__)
|
||||
#define __svr4__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* type to use in place of socklen_t if not defined */
|
||||
#undef kde_socklen_t
|
||||
|
||||
/* type to use in place of socklen_t if not defined (deprecated, use
|
||||
kde_socklen_t) */
|
||||
#undef ksize_t
|
@ -0,0 +1,48 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef FORWARD_DECLARATIONS_H
|
||||
#define FORWARD_DECLARATIONS_H
|
||||
|
||||
class QComboBox;
|
||||
class QListView;
|
||||
class QListBox;
|
||||
class QListViewItem;
|
||||
class QListViewItemIterator;
|
||||
class QLineEdit;
|
||||
class QTabWidget;
|
||||
class QToolButton;
|
||||
|
||||
class KCHMMainWindow;
|
||||
class KCHMViewWindow;
|
||||
class KCHMIndexWindow;
|
||||
class KCHMSearchWindow;
|
||||
class KCHMBookmarkWindow;
|
||||
class KCHMSettings;
|
||||
class KCHMSearchAndViewToolbar;
|
||||
class KCHMNavToolbar;
|
||||
class KCHMViewWindow;
|
||||
class KCHMViewWindowMgr;
|
||||
class KCHMContentsWindow;
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#endif /* FORWARD_DECLARATIONS_H */
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,71 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef ICON_STORAGE_H
|
||||
#define ICON_STORAGE_H
|
||||
|
||||
#include <qmap.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
|
||||
class KCHMIconStorage
|
||||
{
|
||||
public:
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
const char * data;
|
||||
} png_memory_image_t;
|
||||
|
||||
enum pixmap_index_t
|
||||
{
|
||||
back = 1000,
|
||||
bookmark_add,
|
||||
fileopen,
|
||||
print,
|
||||
findnext,
|
||||
findprev,
|
||||
forward,
|
||||
gohome,
|
||||
viewsource,
|
||||
view_decrease,
|
||||
view_increase,
|
||||
next_page,
|
||||
prev_page,
|
||||
locate_in_content
|
||||
};
|
||||
|
||||
KCHMIconStorage();
|
||||
const QPixmap * getToolbarPixmap (pixmap_index_t pix);
|
||||
const QPixmap * getApplicationIcon();
|
||||
const QPixmap * getCloseWindowIcon();
|
||||
|
||||
private:
|
||||
const QPixmap * returnOrLoadImage (unsigned int id, const png_memory_image_t * image);
|
||||
|
||||
QMap<unsigned int, QPixmap*> m_iconMap;
|
||||
QPixmap * m_iconApplication;
|
||||
QPixmap * m_iconCloseWindow;
|
||||
};
|
||||
|
||||
extern KCHMIconStorage gIconStorage;
|
||||
|
||||
#endif /* ICON_STORAGE_H */
|
@ -0,0 +1,239 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kchmbookmarkwindow.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmlistitemtooltip.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
|
||||
#include "kchmbookmarkwindow.moc"
|
||||
|
||||
KCHMBookmarkWindow::KCHMBookmarkWindow(QWidget *parent, const char *name)
|
||||
: QWidget(parent, name)
|
||||
{
|
||||
QVBoxLayout * layout = new QVBoxLayout (this);
|
||||
layout->setMargin (5);
|
||||
|
||||
m_bookmarkList = new KQListView (this);
|
||||
m_bookmarkList->addColumn( "bookmark" ); // no need to i18n - the column is hidden
|
||||
m_bookmarkList->header()->hide();
|
||||
layout->addWidget (m_bookmarkList);
|
||||
|
||||
new KCHMListItemTooltip( m_bookmarkList );
|
||||
|
||||
QHBoxLayout * hlayout = new QHBoxLayout (layout);
|
||||
QPushButton * add = new QPushButton ( i18n( "&Add" ), this);
|
||||
QPushButton * edit = new QPushButton ( i18n( "&Edit" ), this);
|
||||
QPushButton * del = new QPushButton ( i18n( "&Del" ), this);
|
||||
|
||||
hlayout->addWidget (add);
|
||||
hlayout->addWidget (edit);
|
||||
hlayout->addWidget (del);
|
||||
|
||||
connect( m_bookmarkList,
|
||||
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ),
|
||||
this,
|
||||
SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) );
|
||||
|
||||
connect( add,
|
||||
SIGNAL( clicked () ),
|
||||
this,
|
||||
SLOT( onAddBookmarkPressed( ) ) );
|
||||
|
||||
connect( del,
|
||||
SIGNAL( clicked () ),
|
||||
this,
|
||||
SLOT( onDelBookmarkPressed( ) ) );
|
||||
|
||||
connect( edit,
|
||||
SIGNAL( clicked () ),
|
||||
this,
|
||||
SLOT( onEditBookmarkPressed( ) ) );
|
||||
|
||||
connect( m_bookmarkList,
|
||||
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ),
|
||||
this,
|
||||
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) );
|
||||
|
||||
m_menuBookmarks = 0;
|
||||
m_contextMenu = 0;
|
||||
m_listChanged = false;
|
||||
}
|
||||
|
||||
void KCHMBookmarkWindow::onAddBookmarkPressed( )
|
||||
{
|
||||
bool ok;
|
||||
QString url = ::mainWindow->currentBrowser()->getOpenedPage();
|
||||
QString title = ::mainWindow->chmFile()->getTopicByUrl(url);
|
||||
QString name = QInputDialog::getText(
|
||||
i18n( "%1 - add a bookmark") . arg(APP_NAME),
|
||||
i18n( "Enter the name for this bookmark:" ),
|
||||
QLineEdit::Normal,
|
||||
title,
|
||||
&ok,
|
||||
this);
|
||||
|
||||
if ( !ok || name.isEmpty() )
|
||||
return;
|
||||
|
||||
KCHMBookmarkTreeViewItem * item = new KCHMBookmarkTreeViewItem (
|
||||
m_bookmarkList,
|
||||
name,
|
||||
url,
|
||||
::mainWindow->currentBrowser()->getScrollbarPosition() );
|
||||
|
||||
item->menuid = m_menuBookmarks->insertItem( name );
|
||||
m_listChanged = true;
|
||||
}
|
||||
|
||||
|
||||
void KCHMBookmarkWindow::onDelBookmarkPressed( )
|
||||
{
|
||||
KCHMBookmarkTreeViewItem * item = (KCHMBookmarkTreeViewItem *) m_bookmarkList->selectedItem();
|
||||
|
||||
if ( item )
|
||||
{
|
||||
m_menuBookmarks->removeItem( item->menuid );
|
||||
delete item;
|
||||
m_listChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMBookmarkWindow::onEditBookmarkPressed( )
|
||||
{
|
||||
KCHMBookmarkTreeViewItem * item = (KCHMBookmarkTreeViewItem *) m_bookmarkList->selectedItem();
|
||||
|
||||
if ( item )
|
||||
{
|
||||
bool ok;
|
||||
QString name = QInputDialog::getText(
|
||||
i18n( "%1 - edit the bookmark name") . arg(APP_NAME),
|
||||
i18n( "Enter the name for this bookmark:" ),
|
||||
QLineEdit::Normal,
|
||||
item->name,
|
||||
&ok,
|
||||
this);
|
||||
|
||||
if ( !ok || name.isEmpty() )
|
||||
return;
|
||||
|
||||
item->setText (0, name);
|
||||
m_menuBookmarks->changeItem( item->menuid, name );
|
||||
m_listChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMBookmarkWindow::onDoubleClicked( QListViewItem * item, const QPoint &, int )
|
||||
{
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
KCHMBookmarkTreeViewItem * treeitem = (KCHMBookmarkTreeViewItem *) item;
|
||||
|
||||
if ( ::mainWindow->currentBrowser()->getOpenedPage() != treeitem->url )
|
||||
::mainWindow->openPage( treeitem->url, OPF_CONTENT_TREE | OPF_ADD2HISTORY );
|
||||
|
||||
::mainWindow->currentBrowser()->setScrollbarPosition(treeitem->scroll_y);
|
||||
}
|
||||
|
||||
|
||||
void KCHMBookmarkWindow::restoreSettings( const KCHMSettings::bookmark_saved_settings_t & settings )
|
||||
{
|
||||
for ( unsigned int i = 0; i < settings.size(); i++ )
|
||||
{
|
||||
KCHMBookmarkTreeViewItem * item = new KCHMBookmarkTreeViewItem (m_bookmarkList, settings[i].name, settings[i].url, settings[i].scroll_y);
|
||||
|
||||
item->menuid = m_menuBookmarks->insertItem( settings[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMBookmarkWindow::saveSettings( KCHMSettings::bookmark_saved_settings_t & settings )
|
||||
{
|
||||
QListViewItemIterator it (m_bookmarkList);
|
||||
|
||||
settings.clear();
|
||||
|
||||
for ( ; it.current(); it++ )
|
||||
{
|
||||
KCHMBookmarkTreeViewItem * treeitem = (KCHMBookmarkTreeViewItem *) it.current();
|
||||
settings.push_back (KCHMSettings::SavedBookmark(treeitem->name, treeitem->url, treeitem->scroll_y));
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMBookmarkWindow::invalidate( )
|
||||
{
|
||||
QListViewItemIterator it( m_bookmarkList );
|
||||
|
||||
for ( ; it.current(); it++ )
|
||||
m_menuBookmarks->removeItem( ((KCHMBookmarkTreeViewItem *) it.current())->menuid );
|
||||
|
||||
m_bookmarkList->clear();
|
||||
}
|
||||
|
||||
void KCHMBookmarkWindow::createMenu( KCHMMainWindow * parent )
|
||||
{
|
||||
// Create the main Bookmark menu
|
||||
m_menuBookmarks = new KQPopupMenu( parent );
|
||||
parent->menuBar()->insertItem( i18n( "&Bookmarks"), m_menuBookmarks );
|
||||
|
||||
m_menuBookmarks->insertItem( i18n( "&Add bookmark"), this, SLOT(onAddBookmarkPressed()), CTRL+Key_B );
|
||||
m_menuBookmarks->insertSeparator();
|
||||
|
||||
connect( m_menuBookmarks, SIGNAL( activated(int) ), this, SLOT ( onBookmarkSelected(int) ));
|
||||
}
|
||||
|
||||
void KCHMBookmarkWindow::onBookmarkSelected( int bookmark )
|
||||
{
|
||||
QListViewItemIterator it( m_bookmarkList );
|
||||
|
||||
for ( ; it.current(); it++ )
|
||||
{
|
||||
if ( ((KCHMBookmarkTreeViewItem *) it.current())->menuid == bookmark )
|
||||
{
|
||||
KCHMBookmarkTreeViewItem * treeitem = (KCHMBookmarkTreeViewItem *) it.current();
|
||||
|
||||
if ( ::mainWindow->currentBrowser()->getOpenedPage() != treeitem->url )
|
||||
::mainWindow->openPage( treeitem->url, OPF_CONTENT_TREE | OPF_ADD2HISTORY );
|
||||
|
||||
::mainWindow->currentBrowser()->setScrollbarPosition(treeitem->scroll_y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMBookmarkWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int )
|
||||
{
|
||||
if ( !m_contextMenu )
|
||||
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
|
||||
|
||||
if( item )
|
||||
{
|
||||
KCHMBookmarkTreeViewItem * treeitem = (KCHMBookmarkTreeViewItem *) item;
|
||||
|
||||
::mainWindow->currentBrowser()->setTabKeeper( treeitem->url );
|
||||
m_contextMenu->popup( point );
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,63 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMBOOKMARKWINDOW_H
|
||||
#define KCHMBOOKMARKWINDOW_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "forwarddeclarations.h"
|
||||
#include "kchmsettings.h"
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMBookmarkWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMBookmarkWindow(QWidget *parent = 0, const char *name = 0);
|
||||
virtual ~KCHMBookmarkWindow() {};
|
||||
|
||||
void createMenu( KCHMMainWindow * parent );
|
||||
|
||||
void restoreSettings (const KCHMSettings::bookmark_saved_settings_t& settings);
|
||||
void saveSettings (KCHMSettings::bookmark_saved_settings_t& settings);
|
||||
void invalidate();
|
||||
|
||||
public slots:
|
||||
void onAddBookmarkPressed ();
|
||||
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column );
|
||||
|
||||
private slots:
|
||||
void onBookmarkSelected( int );
|
||||
void onDelBookmarkPressed( );
|
||||
void onEditBookmarkPressed( );
|
||||
void onDoubleClicked ( QListViewItem *, const QPoint &, int );
|
||||
|
||||
private:
|
||||
KQPopupMenu * m_menuBookmarks;
|
||||
KQListView * m_bookmarkList;
|
||||
QString m_bookmarkFileName;
|
||||
bool m_listChanged;
|
||||
KQPopupMenu * m_contextMenu;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,215 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmsettings.h"
|
||||
#include "kchmmainwindow.h"
|
||||
|
||||
|
||||
KCHMConfig appConfig;
|
||||
|
||||
const char * APP_PATHINUSERDIR = ".kchmviewer";
|
||||
|
||||
|
||||
KCHMConfig::KCHMConfig()
|
||||
{
|
||||
QDir dir;
|
||||
m_datapath = QDir::homeDirPath() + "/" + APP_PATHINUSERDIR;
|
||||
|
||||
dir.setPath (m_datapath);
|
||||
|
||||
if ( !dir.exists() && !dir.mkdir(m_datapath) )
|
||||
qWarning ("Could not create directory %s", m_datapath.ascii());
|
||||
|
||||
m_LoadLatestFileOnStartup = false;
|
||||
m_onNewChmClick = ACTION_ASK_USER;
|
||||
m_onExternalLinkClick = ACTION_ASK_USER;
|
||||
m_HistorySize = 10;
|
||||
m_HistoryStoreExtra = true;
|
||||
m_useSearchEngine = SEARCH_USE_MINE;
|
||||
|
||||
m_QtBrowserPath = "viewurl-netscape.sh '%s'";
|
||||
m_kdeUseQTextBrowser = false;
|
||||
m_kdeEnableJS = false;
|
||||
m_kdeEnableJava = false;
|
||||
m_kdeEnablePlugins = true;
|
||||
m_kdeEnableRefresh = false;
|
||||
|
||||
m_advUseInternalEditor = true;
|
||||
m_advExternalEditorPath = "kate '%s'";
|
||||
|
||||
m_lastOpenedDir = "";
|
||||
}
|
||||
|
||||
|
||||
KCHMConfig::~KCHMConfig()
|
||||
{
|
||||
}
|
||||
|
||||
bool KCHMConfig::load()
|
||||
{
|
||||
QFile file (m_datapath + "/config");
|
||||
if ( !file.open (IO_ReadOnly) )
|
||||
return false; // no error message - not actually a problem
|
||||
|
||||
QString line;
|
||||
char readbuf[4096];
|
||||
bool getting_history = false;
|
||||
m_History.clear();
|
||||
|
||||
while ( file.readLine( readbuf, sizeof(readbuf) - 1 ) > 0 )
|
||||
{
|
||||
line = QString::fromUtf8( readbuf ).stripWhiteSpace();
|
||||
|
||||
// skip empty lines and comments
|
||||
if ( line.isEmpty() || line[0] == '#' )
|
||||
continue;
|
||||
|
||||
QRegExp rxsection ("^\\[(\\w+)\\]$"), rxkeypair ("^(\\w+)\\s*=\\s*(.*)$");
|
||||
|
||||
if ( rxsection.search ( line ) != -1 )
|
||||
{
|
||||
if ( rxsection.cap (1) == "settings" )
|
||||
getting_history = false;
|
||||
else if ( rxsection.cap (1) == "history" )
|
||||
getting_history = true;
|
||||
else
|
||||
qWarning ("Unknown configuration section: %s", rxsection.cap (1).ascii());
|
||||
|
||||
continue;
|
||||
}
|
||||
else if ( !getting_history && rxkeypair.search ( line ) != -1 )
|
||||
{
|
||||
QString key (rxkeypair.cap (1)), value (rxkeypair.cap(2));
|
||||
|
||||
if ( key == "LoadLatestFileOnStartup" )
|
||||
m_LoadLatestFileOnStartup = value.toInt() ? true : false;
|
||||
else if ( key == "onNewChmClick" )
|
||||
m_onNewChmClick = (choose_action_t) value.toInt();
|
||||
else if ( key == "onExternalLinkClick" )
|
||||
m_onExternalLinkClick = (choose_action_t) value.toInt();
|
||||
else if ( key == "HistorySize" )
|
||||
m_HistorySize = value.toInt();
|
||||
else if ( key == "HistoryStoreExtra" )
|
||||
m_HistoryStoreExtra = value.toInt() ? true : false;
|
||||
else if ( key == "QtBrowserPath" )
|
||||
m_QtBrowserPath = value;
|
||||
else if ( key == "kdeUseQTextBrowser" )
|
||||
m_kdeUseQTextBrowser = value.toInt() ? true : false;
|
||||
else if ( key == "kdeEnableJS" )
|
||||
m_kdeEnableJS = value.toInt() ? true : false;
|
||||
else if ( key == "kdeEnableJava" )
|
||||
m_kdeEnableJava = value.toInt() ? true : false;
|
||||
else if ( key == "kdeEnablePlugins" )
|
||||
m_kdeEnablePlugins = value.toInt() ? true : false;
|
||||
else if ( key == "kdeEnableRefresh" )
|
||||
m_kdeEnableRefresh = value.toInt() ? true : false;
|
||||
else if ( key == "LastOpenedDir" )
|
||||
m_lastOpenedDir = value;
|
||||
else if ( key == "advUseInternalEditor" )
|
||||
m_advUseInternalEditor = value.toInt() ? true : false;
|
||||
else if ( key == "advExternalEditorPath" )
|
||||
m_advExternalEditorPath = value;
|
||||
else if ( key == "useSearchEngine" )
|
||||
m_useSearchEngine = (use_search_engine) value.toInt();
|
||||
else
|
||||
qWarning ("Unknown key=value pair: %s", line.ascii());
|
||||
}
|
||||
else if ( getting_history )
|
||||
{
|
||||
if ( m_History.size() < m_HistorySize )
|
||||
addFileToHistory( line );
|
||||
}
|
||||
else
|
||||
qWarning ("Unknown line in configuration: %s", line.ascii());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool KCHMConfig::save( )
|
||||
{
|
||||
QFile file (m_datapath + "/config");
|
||||
if ( !file.open (IO_WriteOnly) )
|
||||
{
|
||||
qWarning ("Could not write settings into file %s: %s", file.name().ascii(), file.errorString().ascii());
|
||||
return false;
|
||||
}
|
||||
|
||||
QTextStream stream( &file );
|
||||
stream.setEncoding( QTextStream::UnicodeUTF8 );
|
||||
stream << "[settings]\n";
|
||||
stream << "LoadLatestFileOnStartup=" << m_LoadLatestFileOnStartup << "\n";
|
||||
|
||||
stream << "onNewChmClick=" << m_onNewChmClick << "\n";
|
||||
stream << "onExternalLinkClick=" << m_onExternalLinkClick << "\n";
|
||||
stream << "HistorySize=" << m_HistorySize << "\n";
|
||||
stream << "HistoryStoreExtra=" << m_HistoryStoreExtra << "\n";
|
||||
|
||||
stream << "QtBrowserPath=" << m_QtBrowserPath << "\n";
|
||||
stream << "kdeUseQTextBrowser=" << m_kdeUseQTextBrowser << "\n";
|
||||
stream << "kdeEnableJS=" << m_kdeEnableJS << "\n";
|
||||
stream << "kdeEnableJava=" << m_kdeEnableJava << "\n";
|
||||
stream << "kdeEnablePlugins=" << m_kdeEnablePlugins << "\n";
|
||||
stream << "kdeEnableRefresh=" << m_kdeEnableRefresh << "\n";
|
||||
stream << "advUseInternalEditor=" << m_advUseInternalEditor << "\n";
|
||||
stream << "advExternalEditorPath=" << m_advExternalEditorPath << "\n";
|
||||
stream << "useSearchEngine=" << m_useSearchEngine << "\n";
|
||||
|
||||
stream << "LastOpenedDir=" << m_lastOpenedDir << "\n";
|
||||
|
||||
stream << "\n[history]\n";
|
||||
|
||||
// Do not write all the history, but only the needed amount
|
||||
for ( unsigned int i = 0; i < m_History.size(); i++ )
|
||||
stream << m_History[m_History.size() - 1 - i] << "\n";
|
||||
|
||||
// m_History
|
||||
return true;
|
||||
}
|
||||
|
||||
void KCHMConfig::addFileToHistory( const QString & file )
|
||||
{
|
||||
QStringList::Iterator itr = m_History.find( file );
|
||||
|
||||
// check whether file already exists in history - more it forward
|
||||
if ( itr != m_History.end() )
|
||||
{
|
||||
m_History.erase( itr );
|
||||
m_History.push_back(file);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_History.size() < m_HistorySize )
|
||||
{
|
||||
m_History.push_back( file );
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove a file from the front
|
||||
QString filetoremove = m_History[0];
|
||||
m_History.erase( m_History.begin() );
|
||||
m_History.push_back( file );
|
||||
|
||||
// And remove the appropriate history file
|
||||
mainWindow->currentSettings()->removeSettings ( filetoremove );
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMCONFIG_H
|
||||
#define KCHMCONFIG_H
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
extern const char * APP_PATHINUSERDIR;
|
||||
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMConfig
|
||||
{
|
||||
public:
|
||||
enum choose_action_t
|
||||
{
|
||||
ACTION_ALWAYS_OPEN,
|
||||
ACTION_ASK_USER,
|
||||
ACTION_DONT_OPEN
|
||||
};
|
||||
|
||||
enum use_search_engine
|
||||
{
|
||||
SEARCH_USE_CHM,
|
||||
SEARCH_USE_MINE,
|
||||
};
|
||||
|
||||
KCHMConfig();
|
||||
~KCHMConfig();
|
||||
|
||||
bool load();
|
||||
bool save();
|
||||
|
||||
void addFileToHistory ( const QString& file );
|
||||
|
||||
public:
|
||||
QString m_datapath;
|
||||
QString m_lastOpenedDir;
|
||||
|
||||
bool m_LoadLatestFileOnStartup;
|
||||
choose_action_t m_onNewChmClick;
|
||||
choose_action_t m_onExternalLinkClick;
|
||||
unsigned int m_HistorySize;
|
||||
bool m_HistoryStoreExtra;
|
||||
use_search_engine m_useSearchEngine;
|
||||
|
||||
QString m_QtBrowserPath;
|
||||
bool m_kdeUseQTextBrowser;
|
||||
bool m_kdeEnableJS;
|
||||
bool m_kdeEnableJava;
|
||||
bool m_kdeEnablePlugins;
|
||||
bool m_kdeEnableRefresh;
|
||||
|
||||
bool m_advUseInternalEditor;
|
||||
QString m_advExternalEditorPath;
|
||||
|
||||
QStringList m_History;
|
||||
};
|
||||
|
||||
extern KCHMConfig appConfig;
|
||||
|
||||
#endif
|
@ -0,0 +1,95 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "libchmfile.h"
|
||||
|
||||
#include "kchmcontentswindow.h"
|
||||
#include "kchmlistitemtooltip.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
|
||||
#include "kchmcontentswindow.moc"
|
||||
|
||||
KCHMContentsWindow::KCHMContentsWindow(QWidget *parent, const char *name)
|
||||
: KQListView(parent, name)
|
||||
{
|
||||
m_contextMenu = 0;
|
||||
|
||||
addColumn( "Contents" ); // no i18n - this column is hidden
|
||||
setSorting(-1);
|
||||
setFocus();
|
||||
setRootIsDecorated(true);
|
||||
header()->hide();
|
||||
setShowToolTips( false );
|
||||
|
||||
connect( this, SIGNAL( onItem ( QListViewItem * ) ), this, SLOT( slotOnItem( QListViewItem * ) ) );
|
||||
connect( this,
|
||||
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ),
|
||||
this,
|
||||
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) );
|
||||
|
||||
|
||||
new KCHMListItemTooltip( this );
|
||||
}
|
||||
|
||||
KCHMContentsWindow::~KCHMContentsWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void KCHMContentsWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int )
|
||||
{
|
||||
if ( !m_contextMenu )
|
||||
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
|
||||
|
||||
if( item )
|
||||
{
|
||||
KCHMIndTocItem * treeitem = (KCHMIndTocItem*) item;
|
||||
::mainWindow->currentBrowser()->setTabKeeper( treeitem->getUrl() );
|
||||
m_contextMenu->popup( point );
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMContentsWindow::refillTableOfContents( )
|
||||
{
|
||||
QValueVector< LCHMParsedEntry > data;
|
||||
|
||||
if ( !::mainWindow->chmFile()->parseTableOfContents( &data )
|
||||
|| data.size() == 0 )
|
||||
{
|
||||
qWarning ("CHM toc present but is empty; wrong parsing?");
|
||||
return;
|
||||
}
|
||||
|
||||
kchmFillListViewWithParsedData( this, data, &m_urlListMap );
|
||||
}
|
||||
|
||||
KCHMIndTocItem * KCHMContentsWindow::getTreeItem( const QString & url )
|
||||
{
|
||||
QString fixedstr = ::mainWindow->chmFile()->normalizeUrl( url );
|
||||
QMap<QString, KCHMIndTocItem*>::const_iterator it = m_urlListMap.find( fixedstr );
|
||||
|
||||
if ( it == m_urlListMap.end() )
|
||||
return 0;
|
||||
|
||||
return *it;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_KCHMCONTENTSWINDOW_H
|
||||
#define INCLUDE_KCHMCONTENTSWINDOW_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
|
||||
/**
|
||||
@author tim
|
||||
*/
|
||||
class KCHMContentsWindow : public KQListView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMContentsWindow( QWidget *parent = 0, const char *name = 0 );
|
||||
~KCHMContentsWindow();
|
||||
|
||||
QRect tip( const QPoint & p );
|
||||
|
||||
void refillTableOfContents();
|
||||
|
||||
KCHMIndTocItem * getTreeItem( const QString& url );
|
||||
|
||||
public slots:
|
||||
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column );
|
||||
|
||||
private:
|
||||
KQPopupMenu * m_contextMenu;
|
||||
QMap<QString, KCHMIndTocItem*> m_urlListMap;
|
||||
};
|
||||
|
||||
#endif /* INCLUDE_KCHMCONTENTSWINDOW_H */
|
@ -0,0 +1,70 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "kchmdialogchooseurlfromlist.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
|
||||
KCHMDialogChooseUrlFromList::KCHMDialogChooseUrlFromList(const QStringList& urls, const QStringList& titles, QWidget* parent)
|
||||
: QDialog(parent, 0, true)
|
||||
{
|
||||
QVBoxLayout * layout = new QVBoxLayout (this);
|
||||
layout->setMargin (5);
|
||||
|
||||
QListView * m_urlsList = new QListView (this);
|
||||
m_urlsList->addColumn( i18n( "Topics" ) );
|
||||
|
||||
for ( unsigned int i = 0; i < urls.size(); i++ )
|
||||
new KCHMSingleTreeViewItem (m_urlsList, titles[i], urls[i]);
|
||||
|
||||
layout->addWidget ( new QLabel( i18n( "Please select one of the topics below:"), this) );
|
||||
layout->addWidget ( m_urlsList );
|
||||
|
||||
QHBoxLayout * hlayout = new QHBoxLayout (layout);
|
||||
QPushButton * bok = new QPushButton( i18n( "&Ok" ), this);
|
||||
QPushButton * bcancel = new QPushButton( i18n( "&Cancel" ), this);
|
||||
|
||||
hlayout->addWidget (bok);
|
||||
hlayout->addWidget (bcancel);
|
||||
|
||||
connect( m_urlsList, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), this, SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) );
|
||||
connect( m_urlsList, SIGNAL( currentChanged ( QListViewItem *) ), this, SLOT( onCurrentChanged ( QListViewItem *) ) );
|
||||
|
||||
connect( bok, SIGNAL( clicked () ), this, SLOT( accept() ) );
|
||||
connect( bcancel, SIGNAL( clicked () ), this, SLOT( reject() ) );
|
||||
m_acceptedurl = QString::null;
|
||||
}
|
||||
|
||||
void KCHMDialogChooseUrlFromList::onDoubleClicked( QListViewItem * , const QPoint &, int )
|
||||
{
|
||||
accept();
|
||||
}
|
||||
|
||||
void KCHMDialogChooseUrlFromList::onCurrentChanged( QListViewItem * item )
|
||||
{
|
||||
if ( item )
|
||||
m_acceptedurl = ((KCHMSingleTreeViewItem *) item)->getUrl();
|
||||
else
|
||||
m_acceptedurl = QString::null;
|
||||
}
|
||||
|
||||
#include "kchmdialogchooseurlfromlist.moc"
|
@ -0,0 +1,47 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMDIALOGCHOOSEURLFROMLIST_H
|
||||
#define KCHMDIALOGCHOOSEURLFROMLIST_H
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qlistview.h>
|
||||
|
||||
/**
|
||||
@author tim
|
||||
*/
|
||||
class KCHMDialogChooseUrlFromList : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMDialogChooseUrlFromList (const QStringList& urls, const QStringList& titles, QWidget* parent);
|
||||
QString getSelectedItemUrl() { return m_acceptedurl; }
|
||||
|
||||
private slots:
|
||||
void onDoubleClicked( QListViewItem * item, const QPoint &, int );
|
||||
void onCurrentChanged ( QListViewItem * item);
|
||||
|
||||
private:
|
||||
QListView * m_urlsList;
|
||||
QString m_acceptedurl;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,179 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qlayout.h>
|
||||
#include <qheader.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmindexwindow.h"
|
||||
#include "kchmlistitemtooltip.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
|
||||
#include "kchmindexwindow.moc"
|
||||
|
||||
KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f )
|
||||
: QWidget (parent, name, f)
|
||||
{
|
||||
QVBoxLayout * layout = new QVBoxLayout (this);
|
||||
layout->setMargin (5);
|
||||
|
||||
m_indexFinder = new QLineEdit (this);
|
||||
m_indexFinder->setFocus();
|
||||
|
||||
m_indexList = new KQListView (this);
|
||||
m_indexList->addColumn( "idx" ); // it is hidden anyway
|
||||
m_indexList->header()->hide();
|
||||
m_indexList->setTreeStepSize (10);
|
||||
m_indexList->setShowToolTips(true);
|
||||
//m_indexList->setSorting( 0, true );
|
||||
|
||||
layout->addWidget (m_indexFinder);
|
||||
layout->addSpacing (10);
|
||||
layout->addWidget (m_indexList);
|
||||
|
||||
connect( m_indexFinder,
|
||||
SIGNAL( textChanged (const QString &) ),
|
||||
this,
|
||||
SLOT( onTextChanged(const QString &) ) );
|
||||
|
||||
connect( m_indexFinder,
|
||||
SIGNAL( returnPressed() ),
|
||||
this,
|
||||
SLOT( onReturnPressed() ) );
|
||||
|
||||
connect( m_indexList,
|
||||
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ),
|
||||
this,
|
||||
SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) );
|
||||
|
||||
connect( m_indexList,
|
||||
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ),
|
||||
this,
|
||||
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) );
|
||||
|
||||
m_indexListFilled = false;
|
||||
m_lastSelectedItem = 0;
|
||||
m_contextMenu = 0;
|
||||
|
||||
new KCHMListItemTooltip( m_indexList );
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::onTextChanged ( const QString & newvalue)
|
||||
{
|
||||
m_lastSelectedItem = m_indexList->findItem (newvalue, 0, Qt::BeginsWith);
|
||||
|
||||
if ( m_lastSelectedItem )
|
||||
{
|
||||
m_indexList->ensureItemVisible (m_lastSelectedItem);
|
||||
m_indexList->setCurrentItem (m_lastSelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::showEvent( QShowEvent * )
|
||||
{
|
||||
if ( !::mainWindow->chmFile() || m_indexListFilled )
|
||||
return;
|
||||
|
||||
m_indexListFilled = true;
|
||||
refillIndex();
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::onReturnPressed( )
|
||||
{
|
||||
emit ::mainWindow->slotOnTreeClicked ( m_lastSelectedItem );
|
||||
}
|
||||
|
||||
|
||||
void KCHMIndexWindow::invalidate( )
|
||||
{
|
||||
m_indexList->clear();
|
||||
m_indexListFilled = false;
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int )
|
||||
{
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
KCHMIndTocItem * treeitem = (KCHMIndTocItem*) item;
|
||||
|
||||
QString url = treeitem->getUrl();
|
||||
|
||||
if ( !url )
|
||||
return;
|
||||
|
||||
if ( url[0] == ':' ) // 'see also' link
|
||||
{
|
||||
m_lastSelectedItem = m_indexList->findItem (url.mid(1), 0);
|
||||
if ( m_lastSelectedItem )
|
||||
{
|
||||
m_indexList->ensureItemVisible (m_lastSelectedItem);
|
||||
m_indexList->setCurrentItem (m_lastSelectedItem);
|
||||
}
|
||||
}
|
||||
else
|
||||
::mainWindow->openPage( url, OPF_CONTENT_TREE | OPF_ADD2HISTORY );
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int )
|
||||
{
|
||||
if ( !m_contextMenu )
|
||||
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
|
||||
|
||||
if( item )
|
||||
{
|
||||
KCHMIndTocItem * treeitem = (KCHMIndTocItem*) item;
|
||||
|
||||
::mainWindow->currentBrowser()->setTabKeeper( treeitem->getUrl() );
|
||||
m_contextMenu->popup( point );
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::refillIndex( )
|
||||
{
|
||||
QValueVector< LCHMParsedEntry > data;
|
||||
|
||||
if ( !::mainWindow->chmFile()->parseIndex( &data )
|
||||
|| data.size() == 0 )
|
||||
{
|
||||
qWarning ("CHM index present but is empty; wrong parsing?");
|
||||
return;
|
||||
}
|
||||
|
||||
kchmFillListViewWithParsedData( m_indexList, data, 0 );
|
||||
}
|
||||
|
||||
void KCHMIndexWindow::search( const QString & index )
|
||||
{
|
||||
if ( !::mainWindow->chmFile() )
|
||||
return;
|
||||
|
||||
if ( !m_indexListFilled )
|
||||
{
|
||||
m_indexListFilled = true;
|
||||
refillIndex();
|
||||
}
|
||||
|
||||
m_indexFinder->setText( index );
|
||||
onTextChanged( index );
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMINDEXWINDOW_H
|
||||
#define KCHMINDEXWINDOW_H
|
||||
|
||||
|
||||
#include <qlineedit.h>
|
||||
#include <qlistview.h>
|
||||
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMIndexWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMIndexWindow ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
|
||||
|
||||
void invalidate();
|
||||
void search( const QString& index );
|
||||
|
||||
public slots:
|
||||
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column );
|
||||
|
||||
private slots:
|
||||
void onTextChanged ( const QString & newvalue);
|
||||
void onReturnPressed ();
|
||||
void onDoubleClicked ( QListViewItem *, const QPoint &, int);
|
||||
|
||||
private:
|
||||
virtual void showEvent ( QShowEvent * );
|
||||
|
||||
void refillIndex();
|
||||
|
||||
QLineEdit * m_indexFinder;
|
||||
KQListView * m_indexList;
|
||||
KQPopupMenu * m_contextMenu;
|
||||
QListViewItem * m_lastSelectedItem;
|
||||
bool m_indexListFilled;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,53 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kchmkeyeventfilter.h"
|
||||
|
||||
KCHMKeyEventFilter gKeyEventFilter;
|
||||
|
||||
KCHMKeyEventFilter::KCHMKeyEventFilter()
|
||||
: QObject()
|
||||
{
|
||||
m_shiftPressed = false;
|
||||
m_ctrlPressed = false;
|
||||
}
|
||||
|
||||
bool KCHMKeyEventFilter::eventFilter( QObject *, QEvent *e )
|
||||
{
|
||||
// Handle KeyPress and KeyRelease events
|
||||
if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease )
|
||||
{
|
||||
bool * ptr = 0;
|
||||
QKeyEvent *k = (QKeyEvent *) e;
|
||||
|
||||
// We're interested only in Shift and Control
|
||||
if ( k->key() == Qt::Key_Shift )
|
||||
ptr = &m_shiftPressed;
|
||||
else if ( k->key() == Qt::Key_Control )
|
||||
ptr = &m_ctrlPressed;
|
||||
|
||||
// Set it
|
||||
if ( ptr )
|
||||
*ptr = e->type() == QEvent::KeyPress ? true : false;
|
||||
}
|
||||
|
||||
return FALSE; // Standard event processing
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_KCHMKEYEVENTFILTER_H
|
||||
#define INCLUDE_KCHMKEYEVENTFILTER_H
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
/*!*
|
||||
* This class must be installed as a global event handler. Its responsibility
|
||||
* is to intercept keyboard events, and store the Shift and Ctrl keys state information.
|
||||
* Unfortunately it seems to be the only way to do it in Qt.
|
||||
*/
|
||||
class KCHMKeyEventFilter : public QObject
|
||||
{
|
||||
public:
|
||||
KCHMKeyEventFilter();
|
||||
|
||||
bool isShiftPressed() const { return m_shiftPressed; }
|
||||
bool isCtrlPressed() const { return m_ctrlPressed; }
|
||||
|
||||
private:
|
||||
bool eventFilter( QObject *, QEvent *e );
|
||||
|
||||
bool m_shiftPressed;
|
||||
bool m_ctrlPressed;
|
||||
};
|
||||
|
||||
extern KCHMKeyEventFilter gKeyEventFilter;
|
||||
|
||||
#endif /* INCLUDE_KCHMKEYEVENTFILTER_H */
|
@ -0,0 +1,72 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_KCHMLISTITEMTOOLTIP_H
|
||||
#define INCLUDE_KCHMLISTITEMTOOLTIP_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "forwarddeclarations.h"
|
||||
|
||||
/**
|
||||
@author tim
|
||||
*/
|
||||
class KCHMListItemTooltip : public QToolTip
|
||||
{
|
||||
public:
|
||||
KCHMListItemTooltip( KQListView *parent )
|
||||
: QToolTip( parent->viewport() ) { m_pParent = parent; }
|
||||
|
||||
virtual ~KCHMListItemTooltip() {};
|
||||
|
||||
void maybeTip ( const QPoint & pos )
|
||||
{
|
||||
QListViewItem *it = m_pParent->itemAt( pos );
|
||||
|
||||
if ( !it )
|
||||
return;
|
||||
|
||||
// Get the section the mouse is in
|
||||
int section = m_pParent->header()->sectionAt (pos.x ());
|
||||
|
||||
// Get the rect of the whole item (the row for the tip)
|
||||
QRect itemRect = m_pParent->itemRect( it );
|
||||
|
||||
// Get the rect of the whole section (the column for the tip)
|
||||
QRect headerRect = m_pParent->header ()->sectionRect (section);
|
||||
|
||||
// "Intersect" row and column to get exact rect for the tip
|
||||
QRect destRect( headerRect.left (), itemRect.top(), headerRect.width(), itemRect.height() );
|
||||
|
||||
int item_width = it->width( m_pParent->fontMetrics(), m_pParent, 0 )
|
||||
+ it->depth() * m_pParent->treeStepSize();
|
||||
|
||||
if ( m_pParent->rootIsDecorated() )
|
||||
item_width += m_pParent->treeStepSize();
|
||||
|
||||
if ( item_width > m_pParent->viewport()->width() )
|
||||
tip( destRect, it->text(0) );
|
||||
}
|
||||
|
||||
private:
|
||||
KQListView * m_pParent;
|
||||
};
|
||||
|
||||
#endif /* INCLUDE_KCHMLISTITEMTOOLTIP_H */
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,191 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMMAINWINDOW_H
|
||||
#define KCHMMAINWINDOW_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "libchmfile.h"
|
||||
|
||||
#include "forwarddeclarations.h"
|
||||
#include "kchmviewwindow.h"
|
||||
|
||||
|
||||
#define ENABLE_AUTOTEST_SUPPORT
|
||||
|
||||
//! OpenPage extra flags, specifying extra behavior
|
||||
|
||||
//! Locate this page in the content tree, and move the cursor there
|
||||
static const unsigned int OPF_CONTENT_TREE = 1 << 0;
|
||||
//! Add the previous page into the history
|
||||
static const unsigned int OPF_ADD2HISTORY = 1 << 1;
|
||||
//! Open the page in a new tab
|
||||
static const unsigned int OPF_NEW_TAB = 1 << 2;
|
||||
//! Open the page in a new tab in background
|
||||
static const unsigned int OPF_BACKGROUND = 1 << 3;
|
||||
|
||||
//! Those events could be sent to main window to do useful things. See handleUserEvents()
|
||||
class KCHMUserEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
KCHMUserEvent( const QString& action, const QStringList& args = QStringList())
|
||||
: QEvent( QEvent::User ), m_action(action), m_args(args) {};
|
||||
|
||||
QString m_action;
|
||||
QStringList m_args;
|
||||
};
|
||||
|
||||
|
||||
class KCHMMainWindow : public KQMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KCHMMainWindow();
|
||||
~KCHMMainWindow();
|
||||
|
||||
bool openPage ( const QString &url, unsigned int flags = OPF_CONTENT_TREE );
|
||||
|
||||
LCHMFile * chmFile() const { return m_chmFile; }
|
||||
const QString& getOpenedFileName () { return m_chmFilename; }
|
||||
|
||||
KCHMViewWindow * currentBrowser() const;
|
||||
KCHMContentsWindow * contentsWindow() const { return m_contentsWindow; }
|
||||
KCHMSettings * currentSettings() const { return m_currentSettings; }
|
||||
KCHMViewWindowMgr* viewWindowMgr() const { return m_viewWindowMgr; }
|
||||
KCHMNavToolbar * navigationToolbar() const { return m_navToolbar; }
|
||||
KCHMSearchWindow * searchWindow() const { return m_searchWindow; }
|
||||
|
||||
void showInStatusBar (const QString& text) { statusBar()->message( text, 2000 ); }
|
||||
void setTextEncoding (const LCHMTextEncoding * enc);
|
||||
|
||||
public slots:
|
||||
void slotOnTreeClicked( QListViewItem *item );
|
||||
void slotOnTreeDoubleClicked( QListViewItem *item, const QPoint &, int );
|
||||
|
||||
void slotAddBookmark ( );
|
||||
void slotOpenPageInNewTab( );
|
||||
void slotOpenPageInNewBackgroundTab( );
|
||||
void slotEnableFullScreenMode( bool enable );
|
||||
void slotShowContentsWindow( bool show );
|
||||
void slotLocateInContentWindow( );
|
||||
void slotBrowserChanged( KCHMViewWindow * newbrowser );
|
||||
|
||||
private slots:
|
||||
void slotLinkClicked ( const QString & link, bool& follow_link );
|
||||
|
||||
void slotOpenMenuItemActivated();
|
||||
void slotPrintMenuItemActivated();
|
||||
|
||||
void slotAboutMenuItemActivated();
|
||||
void slotAboutQtMenuItemActivated();
|
||||
|
||||
void slotActivateContentTab();
|
||||
void slotActivateIndexTab();
|
||||
void slotActivateSearchTab();
|
||||
void slotActivateBookmarkTab();
|
||||
|
||||
void slotBrowserSelectAll();
|
||||
void slotBrowserCopy();
|
||||
void slotExtractCHM();
|
||||
|
||||
void slotChangeSettingsMenuItemActivated();
|
||||
void slotHistoryMenuItemActivated ( int );
|
||||
|
||||
void slotToggleFullScreenMode( );
|
||||
|
||||
void slotNavigateBack() { currentBrowser()->navigateBack(); }
|
||||
void slotNavigateHome() { currentBrowser()->navigateHome(); }
|
||||
void slotNavigateForward(){ currentBrowser()->navigateForward(); }
|
||||
|
||||
private:
|
||||
bool parseCmdLineArgs();
|
||||
void showEvent( QShowEvent * );
|
||||
void closeEvent ( QCloseEvent * e );
|
||||
void setupSignals ();
|
||||
|
||||
void setupToolbarsAndMenu ( );
|
||||
bool loadChmFile ( const QString &fileName, bool call_open_page = true );
|
||||
void closeChmFile();
|
||||
void refreshCurrentBrowser();
|
||||
void updateHistoryMenu();
|
||||
|
||||
void showOrHideContextWindow( int tabindex );
|
||||
void showOrHideIndexWindow( int tabindex );
|
||||
void showOrHideSearchWindow( int tabindex );
|
||||
|
||||
// User events
|
||||
bool event ( QEvent * e );
|
||||
bool handleUserEvent( const KCHMUserEvent * event );
|
||||
|
||||
void locateInContentTree( const QString& url );
|
||||
|
||||
QString m_chmFilename;
|
||||
QString m_aboutDlgMenuText; // to show in KDE or Qt about dialogs
|
||||
|
||||
KCHMViewWindowMgr * m_viewWindowMgr;
|
||||
KCHMIndexWindow * m_indexWindow;
|
||||
KCHMSearchWindow * m_searchWindow;
|
||||
KCHMBookmarkWindow * m_bookmarkWindow;
|
||||
KCHMContentsWindow * m_contentsWindow;
|
||||
|
||||
KQTabWidget * m_tabWidget;
|
||||
QSplitter * m_windowSplitter;
|
||||
|
||||
KCHMSearchAndViewToolbar * m_searchToolbar;
|
||||
KCHMNavToolbar * m_navToolbar;
|
||||
|
||||
KCHMSettings * m_currentSettings;
|
||||
|
||||
LCHMFile * m_chmFile;
|
||||
bool m_FirstTimeShow;
|
||||
|
||||
KQPopupMenu * m_menuHistory;
|
||||
|
||||
int m_tabContextPage;
|
||||
int m_tabIndexPage;
|
||||
int m_tabSearchPage;
|
||||
int m_tabBookmarkPage;
|
||||
|
||||
#if defined (ENABLE_AUTOTEST_SUPPORT)
|
||||
enum auto_test_state_t
|
||||
{
|
||||
STATE_OFF,
|
||||
STATE_INITIAL,
|
||||
STATE_CONTENTS_OPENNEXTPAGE,
|
||||
STATE_OPEN_INDEX,
|
||||
STATE_SHUTDOWN
|
||||
};
|
||||
|
||||
bool m_useShortAutotest;
|
||||
auto_test_state_t m_autoteststate;
|
||||
QListViewItemIterator m_autotestlistiterator;
|
||||
|
||||
private slots:
|
||||
void runAutoTest();
|
||||
#endif /* defined (ENABLE_AUTOTEST_SUPPORT) */
|
||||
|
||||
};
|
||||
|
||||
extern KCHMMainWindow * mainWindow;
|
||||
|
||||
#endif // KCHMMAINWINDOW_H
|
@ -0,0 +1,75 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "kchmnavtoolbar.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindow.h"
|
||||
#include "iconstorage.h"
|
||||
|
||||
|
||||
KCHMNavToolbar::KCHMNavToolbar( KCHMMainWindow *parent )
|
||||
: QToolBar( parent )
|
||||
{
|
||||
// Initialize toolbar
|
||||
setLabel( i18n( "Navigation") );
|
||||
|
||||
QPixmap iconBackward (*gIconStorage.getToolbarPixmap(KCHMIconStorage::back));
|
||||
m_toolbarIconBackward = new QToolButton (iconBackward,
|
||||
i18n( "Move backward in history"),
|
||||
QString::null,
|
||||
parent,
|
||||
SLOT( slotNavigateBack() ),
|
||||
this);
|
||||
QWhatsThis::add( m_toolbarIconBackward, i18n( "Click this button to move backward in browser history") );
|
||||
|
||||
QPixmap iconForward (*gIconStorage.getToolbarPixmap(KCHMIconStorage::forward));
|
||||
m_toolbarIconForward = new QToolButton (iconForward,
|
||||
i18n( "Move forward in history"),
|
||||
QString::null,
|
||||
parent,
|
||||
SLOT( slotNavigateForward() ),
|
||||
this);
|
||||
QWhatsThis::add( m_toolbarIconForward, i18n( "Click this button to move forward in browser history") );
|
||||
|
||||
QPixmap iconHome = (*gIconStorage.getToolbarPixmap(KCHMIconStorage::gohome));
|
||||
QToolButton * hb = new QToolButton (iconHome,
|
||||
i18n( "Go to the home page"),
|
||||
QString::null,
|
||||
parent,
|
||||
SLOT( slotNavigateHome() ),
|
||||
this);
|
||||
QWhatsThis::add( hb, i18n( "Click this button to move to the home page") );
|
||||
}
|
||||
|
||||
|
||||
KCHMNavToolbar::~KCHMNavToolbar()
|
||||
{
|
||||
}
|
||||
|
||||
void KCHMNavToolbar::updateIconStatus( bool enable_backward, bool enable_forward )
|
||||
{
|
||||
m_toolbarIconBackward->setEnabled( enable_backward );
|
||||
m_toolbarIconForward->setEnabled ( enable_forward );
|
||||
}
|
||||
|
||||
|
||||
#include "kchmnavtoolbar.moc"
|
@ -0,0 +1,42 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_KCHMNAVHISTORY_H
|
||||
#define INCLUDE_KCHMNAVHISTORY_H
|
||||
|
||||
#include "forwarddeclarations.h"
|
||||
|
||||
class KCHMNavToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMNavToolbar( KCHMMainWindow *parent );
|
||||
~KCHMNavToolbar();
|
||||
|
||||
public slots:
|
||||
void updateIconStatus( bool enable_backward, bool enable_forward );
|
||||
|
||||
private:
|
||||
QToolButton * m_toolbarIconBackward;
|
||||
QToolButton * m_toolbarIconForward;
|
||||
};
|
||||
|
||||
#endif /* INCLUDE_KCHMNAVHISTORY_H */
|
@ -0,0 +1,257 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qapplication.h>
|
||||
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmsearchengine.h"
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmsettings.h"
|
||||
#include "libchmurlfactory.h"
|
||||
|
||||
#include "kchmsearchengine_impl.h"
|
||||
|
||||
#include "kchmsearchengine.moc"
|
||||
|
||||
|
||||
|
||||
KCHMSearchEngine::KCHMSearchEngine()
|
||||
{
|
||||
m_Index = 0;
|
||||
m_progressDlg = 0;
|
||||
}
|
||||
|
||||
|
||||
KCHMSearchEngine::~KCHMSearchEngine()
|
||||
{
|
||||
delete m_Index;
|
||||
delete m_progressDlg;
|
||||
}
|
||||
|
||||
void KCHMSearchEngine::processEvents( )
|
||||
{
|
||||
// Do it twice; some events generate other events
|
||||
qApp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput );
|
||||
qApp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput );
|
||||
}
|
||||
|
||||
|
||||
void KCHMSearchEngine::cancelButtonPressed( )
|
||||
{
|
||||
m_Index->setLastWinClosed();
|
||||
}
|
||||
|
||||
|
||||
bool KCHMSearchEngine::loadOrGenerateIndex( )
|
||||
{
|
||||
if ( m_Index )
|
||||
return true;
|
||||
|
||||
QString indexfiledict = ::mainWindow->currentSettings()->searchIndexDictFilename();
|
||||
QString indexfiledoc = ::mainWindow->currentSettings()->searchIndexDocFilename();
|
||||
QStringList documents;
|
||||
|
||||
m_Index = new QtAs::Index( documents, appConfig.m_datapath );
|
||||
m_Index->setDictionaryFile( indexfiledict );
|
||||
m_Index->setDocListFile( indexfiledoc );
|
||||
|
||||
m_progressDlg = new QProgressDialog( 0 );
|
||||
connect( m_progressDlg, SIGNAL( canceled() ), this, SLOT( cancelButtonPressed() ) );
|
||||
|
||||
connect( m_Index, SIGNAL( indexingProgress( int ) ), this, SLOT( setIndexingProgress( int ) ) );
|
||||
KCHMShowWaitCursor waitcursor;
|
||||
|
||||
QFile f( indexfiledict );
|
||||
if ( !f.exists() )
|
||||
{
|
||||
::mainWindow->statusBar()->message( tr( "Generating search index..." ) );
|
||||
|
||||
// Get the list of files in CHM archive
|
||||
QStringList alldocuments;
|
||||
|
||||
m_progressDlg->setCaption( tr( "Generating search index..." ) );
|
||||
m_progressDlg->setLabelText( tr( "Generating search index..." ) );
|
||||
m_progressDlg->setTotalSteps( 100 );
|
||||
m_progressDlg->reset();
|
||||
m_progressDlg->show();
|
||||
processEvents();
|
||||
|
||||
if ( !::mainWindow->chmFile()->enumerateFiles( &alldocuments ) )
|
||||
{
|
||||
delete m_progressDlg;
|
||||
m_progressDlg = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Process the list keeping only HTML documents there
|
||||
for ( unsigned int i = 0; i < alldocuments.size(); i++ )
|
||||
if ( alldocuments[i].endsWith( ".html", false ) || alldocuments[i].endsWith( ".htm", false ) )
|
||||
documents.push_back( LCHMUrlFactory::makeURLabsoluteIfNeeded( alldocuments[i] ) );
|
||||
|
||||
m_Index->setDocList( documents );
|
||||
|
||||
if ( m_Index->makeIndex() != -1 )
|
||||
{
|
||||
m_Index->writeDict();
|
||||
m_keywordDocuments.clear();
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
::mainWindow->statusBar()->message( tr( "Reading dictionary..." ) );
|
||||
processEvents();
|
||||
|
||||
m_Index->readDict();
|
||||
}
|
||||
|
||||
::mainWindow->statusBar()->message( tr( "Done" ), 3000 );
|
||||
delete m_progressDlg;
|
||||
m_progressDlg = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void KCHMSearchEngine::setIndexingProgress( int progress )
|
||||
{
|
||||
if ( progress <= 100 )
|
||||
m_progressDlg->setProgress( progress );
|
||||
|
||||
processEvents();
|
||||
}
|
||||
|
||||
// Helper class to simplity state management and data keeping
|
||||
class SearchDataKeeper
|
||||
{
|
||||
public:
|
||||
SearchDataKeeper() { m_inPhrase = false; }
|
||||
|
||||
void beginPhrase()
|
||||
{
|
||||
phrase_terms.clear();
|
||||
m_inPhrase = true;
|
||||
}
|
||||
|
||||
void endPhrase()
|
||||
{
|
||||
m_inPhrase = false;
|
||||
phrasewords += phrase_terms;
|
||||
phrases.push_back( phrase_terms.join(" ") );
|
||||
}
|
||||
|
||||
bool isInPhrase() const { return m_inPhrase; }
|
||||
|
||||
void addTerm( const QString& term )
|
||||
{
|
||||
if ( !term.isEmpty() )
|
||||
{
|
||||
terms.push_back( term );
|
||||
|
||||
if ( m_inPhrase )
|
||||
phrase_terms.push_back( term );
|
||||
}
|
||||
}
|
||||
|
||||
// Should contain all the search terms present in query, includind those from phrases. One element - one term .
|
||||
QStringList terms;
|
||||
|
||||
// Should contain phrases present in query without quotes. One element - one phrase.
|
||||
QStringList phrases;
|
||||
|
||||
// Should contain all the terms present in all the phrases (but not outside).
|
||||
QStringList phrasewords;
|
||||
|
||||
private:
|
||||
bool m_inPhrase;
|
||||
QStringList phrase_terms;
|
||||
};
|
||||
|
||||
|
||||
bool KCHMSearchEngine::searchQuery( const QString & query, QStringList * results, unsigned int limit )
|
||||
{
|
||||
// Characters which split the words. We need to make them separate tokens
|
||||
QString splitChars = m_Index->getCharsSplit();
|
||||
|
||||
// Characters which are part of the word. We should keep them apart.
|
||||
QString partOfWordChars = m_Index->getCharsPartOfWord();
|
||||
|
||||
SearchDataKeeper keeper;
|
||||
|
||||
// State machine variables
|
||||
QString term;
|
||||
|
||||
for ( unsigned int i = 0; i < query.length(); i++ )
|
||||
{
|
||||
QChar ch = query[i].lower();
|
||||
|
||||
// a quote either begins or ends the phrase
|
||||
if ( ch == '"' )
|
||||
{
|
||||
keeper.addTerm( term );
|
||||
|
||||
if ( keeper.isInPhrase() )
|
||||
keeper.endPhrase();
|
||||
else
|
||||
keeper.beginPhrase();
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// If new char does not stop the word, add ot and continue
|
||||
if ( ch.isLetterOrNumber() || partOfWordChars.find( ch ) != -1 )
|
||||
{
|
||||
term.append( ch );
|
||||
continue;
|
||||
}
|
||||
|
||||
// If it is a split char, add this term and split char as separate term
|
||||
if ( splitChars.find( ch ) != -1 )
|
||||
{
|
||||
// Add existing term if present
|
||||
keeper.addTerm( term );
|
||||
|
||||
// Change the term variable, so it will be added when we exit this block
|
||||
term = ch;
|
||||
}
|
||||
|
||||
// Just add the word; it is most likely a space or terminated by tokenizer.
|
||||
keeper.addTerm( term );
|
||||
term = QString::null;
|
||||
}
|
||||
|
||||
keeper.addTerm( term );
|
||||
|
||||
if ( keeper.isInPhrase() )
|
||||
{
|
||||
QMessageBox::warning( 0, i18n( "Search" ), i18n( "A closing quote character is missing." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
KCHMShowWaitCursor waitcursor;
|
||||
QStringList foundDocs = m_Index->query( keeper.terms, keeper.phrases, keeper.phrasewords );
|
||||
|
||||
for ( QStringList::iterator it = foundDocs.begin(); it != foundDocs.end() && limit > 0; ++it, limit-- )
|
||||
results->push_back( *it );
|
||||
|
||||
return true;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMSEARCHENGINE_H
|
||||
#define KCHMSEARCHENGINE_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qmap.h>
|
||||
#include <qstring.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qprogressdialog.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
|
||||
namespace QtAs { class Index; };
|
||||
|
||||
|
||||
class KCHMSearchEngine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KCHMSearchEngine();
|
||||
~KCHMSearchEngine();
|
||||
|
||||
bool loadOrGenerateIndex();
|
||||
bool searchQuery ( const QString& query, QStringList * results, unsigned int limit = 100 );
|
||||
|
||||
|
||||
private slots:
|
||||
void setIndexingProgress( int progress );
|
||||
void cancelButtonPressed();
|
||||
|
||||
private:
|
||||
void processEvents();
|
||||
|
||||
// Used during the index generation
|
||||
QProgressDialog * m_progressDlg;
|
||||
QStringList m_keywordDocuments;
|
||||
QtAs::Index * m_Index;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,572 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Portions Copyright (C) 2000-2005 Trolltech AS. *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include <qfile.h>
|
||||
#include <qdir.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qdict.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "kchmsearchengine_impl.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "libchmfileimpl.h"
|
||||
|
||||
|
||||
namespace QtAs {
|
||||
|
||||
// Those characters are splitters (i.e. split the word), but added themselves into dictionary too.
|
||||
// This makes the dictionary MUCH larger, but ensure that for the piece of "window->print" both
|
||||
// search for "print" and "->print" will find it.
|
||||
static const char SPLIT_CHARACTERS[] = "!()*&^%#@[]{}':;,.?/|/?<>\\-+=~`";
|
||||
|
||||
// Those characters are parts of word - for example, '_' is here, and search for _debug will find only _debug.
|
||||
static const char WORD_CHARACTERS[] = "$_";
|
||||
|
||||
|
||||
int TermList::compareItems( QPtrCollection::Item i1, QPtrCollection::Item i2 )
|
||||
{
|
||||
if( ( (Term*)i1 )->frequency == ( (Term*)i2 )->frequency )
|
||||
return 0;
|
||||
if( ( (Term*)i1 )->frequency < ( (Term*)i2 )->frequency )
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
QDataStream &operator>>( QDataStream &s, Document &l )
|
||||
{
|
||||
s >> l.docNumber;
|
||||
s >> l.frequency;
|
||||
return s;
|
||||
}
|
||||
|
||||
QDataStream &operator<<( QDataStream &s, const Document &l )
|
||||
{
|
||||
s << (Q_INT16)l.docNumber;
|
||||
s << (Q_INT16)l.frequency;
|
||||
return s;
|
||||
}
|
||||
|
||||
Index::Index( const QString &dp, const QString & )
|
||||
: QObject( 0, 0 ), dict( 8999 ), docPath( dp )
|
||||
{
|
||||
lastWindowClosed = false;
|
||||
connect( qApp, SIGNAL( lastWindowClosed() ),
|
||||
this, SLOT( setLastWinClosed() ) );
|
||||
}
|
||||
|
||||
Index::Index( const QStringList &dl, const QString & )
|
||||
: QObject( 0, 0 ), dict( 20011 )
|
||||
{
|
||||
docList = dl;
|
||||
lastWindowClosed = false;
|
||||
connect( qApp, SIGNAL( lastWindowClosed() ),
|
||||
this, SLOT( setLastWinClosed() ) );
|
||||
}
|
||||
|
||||
void Index::setLastWinClosed()
|
||||
{
|
||||
lastWindowClosed = true;
|
||||
}
|
||||
|
||||
void Index::setDictionaryFile( const QString &f )
|
||||
{
|
||||
dictFile = f;
|
||||
}
|
||||
|
||||
void Index::setDocListFile( const QString &f )
|
||||
{
|
||||
docListFile = f;
|
||||
}
|
||||
|
||||
void Index::setDocList( const QStringList &lst )
|
||||
{
|
||||
docList = lst;
|
||||
}
|
||||
|
||||
bool Index::makeIndex()
|
||||
{
|
||||
if ( docList.isEmpty() )
|
||||
return false;
|
||||
|
||||
QStringList::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 false;
|
||||
|
||||
parseDocument( *it, i );
|
||||
|
||||
if ( i%steps == 0 )
|
||||
{
|
||||
prog++;
|
||||
emit indexingProgress( prog );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Index::insertInDict( const QString &str, int docNum )
|
||||
{
|
||||
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 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Index::parseDocumentToStringlist( const QString & filename, QStringList & tokenlist )
|
||||
{
|
||||
QString parsedbuf, parseentity;
|
||||
QString text;
|
||||
|
||||
if ( !::mainWindow->chmFile()->getFileContentAsString( &text, filename ) )
|
||||
{
|
||||
qWarning( "Index::parseDocument: Could not retrieve the content at %s", filename.ascii() );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( text.isNull() )
|
||||
{
|
||||
qWarning( "Index::parseDocument: Retrieved content for %s is empty", filename.ascii() );
|
||||
return false;
|
||||
}
|
||||
|
||||
m_charssplit = SPLIT_CHARACTERS;
|
||||
m_charsword = WORD_CHARACTERS;
|
||||
|
||||
tokenlist.clear();
|
||||
|
||||
// State machine states
|
||||
enum state_t
|
||||
{
|
||||
STATE_OUTSIDE_TAGS, // outside HTML tags; parse text
|
||||
STATE_IN_HTML_TAG, // inside HTML tags; wait for end tag
|
||||
STATE_IN_QUOTES, // inside HTML tags and inside quotes; wait for end quote (in var QuoteChar)
|
||||
STATE_IN_HTML_ENTITY, // inside HTML entity; parse the entity
|
||||
};
|
||||
|
||||
state_t state = STATE_OUTSIDE_TAGS;
|
||||
QChar QuoteChar; // used in STATE_IN_QUOTES
|
||||
|
||||
for ( unsigned int j = 0; j < text.length(); j++ )
|
||||
{
|
||||
QChar ch = text[j];
|
||||
|
||||
if ( (j % 20000) == 0 )
|
||||
qApp->processEvents( QEventLoop::ExcludeUserInput );
|
||||
|
||||
if ( state == STATE_IN_HTML_TAG )
|
||||
{
|
||||
// We are inside HTML tag.
|
||||
// Ignore everything until we see '>' (end of HTML tag) or quote char (quote start)
|
||||
if ( ch == '"' || ch == '\'' )
|
||||
{
|
||||
state = STATE_IN_QUOTES;
|
||||
QuoteChar = ch;
|
||||
}
|
||||
else if ( ch == '>' )
|
||||
state = STATE_OUTSIDE_TAGS;
|
||||
|
||||
continue;
|
||||
}
|
||||
else if ( state == STATE_IN_QUOTES )
|
||||
{
|
||||
// We are inside quoted text inside HTML tag.
|
||||
// Ignore everything until we see the quote character again
|
||||
if ( ch == QuoteChar )
|
||||
state = STATE_IN_HTML_TAG;
|
||||
|
||||
continue;
|
||||
}
|
||||
else if ( state == STATE_IN_HTML_ENTITY )
|
||||
{
|
||||
// We are inside encoded HTML entity (like ).
|
||||
// Collect to parsedbuf everything until we see ;
|
||||
if ( ch.isLetterOrNumber() )
|
||||
{
|
||||
// get next character of this entity
|
||||
parseentity.append( ch );
|
||||
continue;
|
||||
}
|
||||
|
||||
// The entity ended
|
||||
state = STATE_OUTSIDE_TAGS;
|
||||
|
||||
// Some shitty HTML does not terminate entities correctly. Screw it.
|
||||
if ( ch != ';' && ch != '<' )
|
||||
{
|
||||
if ( parseentity.isEmpty() )
|
||||
{
|
||||
// straight '&' symbol. Add and continue.
|
||||
parsedbuf += "&";
|
||||
}
|
||||
else
|
||||
qWarning( "Index::parseDocument: incorrectly terminated HTML entity '&%s%c', ignoring", parseentity.ascii(), ch.latin1() );
|
||||
|
||||
j--; // parse this character again, but in different state
|
||||
continue;
|
||||
}
|
||||
|
||||
// Don't we have a space?
|
||||
if ( parseentity.lower() != "nbsp" )
|
||||
{
|
||||
QString entity = ::mainWindow->chmFile()->impl()->decodeEntity( parseentity );
|
||||
|
||||
if ( entity.isNull() )
|
||||
{
|
||||
// decodeEntity() already printed error message
|
||||
//qWarning( "Index::parseDocument: failed to decode entity &%s;", parsedbuf.ascii() );
|
||||
continue;
|
||||
}
|
||||
|
||||
parsedbuf += entity;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
ch = ' '; // We got a space, so treat it like it, and not add it to parsebuf
|
||||
}
|
||||
|
||||
//
|
||||
// Now process STATE_OUTSIDE_TAGS
|
||||
//
|
||||
|
||||
// Check for start of HTML tag, and switch to STATE_IN_HTML_TAG if it is
|
||||
if ( ch == '<' )
|
||||
{
|
||||
state = STATE_IN_HTML_TAG;
|
||||
goto tokenize_buf;
|
||||
}
|
||||
|
||||
// Check for start of HTML entity
|
||||
if ( ch == '&' )
|
||||
{
|
||||
state = STATE_IN_HTML_ENTITY;
|
||||
parseentity = QString::null;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Replace quote by ' - quotes are used in search window to set the phrase
|
||||
if ( ch == '"' )
|
||||
ch = '\'';
|
||||
|
||||
// Ok, we have a valid character outside HTML tags, and probably some in buffer already.
|
||||
// If it is char or letter, add it and continue
|
||||
if ( ch.isLetterOrNumber() || m_charsword.find( ch ) != -1 )
|
||||
{
|
||||
parsedbuf.append( ch );
|
||||
continue;
|
||||
}
|
||||
|
||||
// If it is a split char, add the word to the dictionary, and then add the char itself.
|
||||
if ( m_charssplit.find( ch ) != -1 )
|
||||
{
|
||||
if ( !parsedbuf.isEmpty() )
|
||||
tokenlist.push_back( parsedbuf.lower() );
|
||||
|
||||
tokenlist.push_back( ch.lower() );
|
||||
parsedbuf = QString::null;
|
||||
continue;
|
||||
}
|
||||
|
||||
tokenize_buf:
|
||||
// Just add the word; it is most likely a space or terminated by tokenizer.
|
||||
if ( !parsedbuf.isEmpty() )
|
||||
{
|
||||
tokenlist.push_back( parsedbuf.lower() );
|
||||
parsedbuf = QString::null;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the last word if still here - for broken htmls.
|
||||
if ( !parsedbuf.isEmpty() )
|
||||
tokenlist.push_back( parsedbuf.lower() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Index::parseDocument( const QString &filename, int docNum )
|
||||
{
|
||||
QStringList terms;
|
||||
|
||||
if ( !parseDocumentToStringlist( filename, terms ) )
|
||||
return;
|
||||
|
||||
for ( QStringList::Iterator it = terms.begin(); it != terms.end(); ++it )
|
||||
insertInDict( *it, docNum );
|
||||
}
|
||||
|
||||
|
||||
void Index::writeDict()
|
||||
{
|
||||
QDictIterator<Entry> it( dict );
|
||||
QFile f( dictFile );
|
||||
|
||||
if ( !f.open( IO_WriteOnly ) )
|
||||
{
|
||||
qWarning( "Index::writeDict: could not write dictionary file %s", dictFile.ascii() );
|
||||
return;
|
||||
}
|
||||
|
||||
QDataStream s( &f );
|
||||
s << (int) 1; // version
|
||||
s << m_charssplit;
|
||||
s << m_charsword;
|
||||
|
||||
for( ; it.current(); ++it )
|
||||
{
|
||||
Entry *e = it.current();
|
||||
s << it.currentKey();
|
||||
s << e->documents;
|
||||
}
|
||||
|
||||
f.close();
|
||||
writeDocumentList();
|
||||
}
|
||||
|
||||
void Index::writeDocumentList()
|
||||
{
|
||||
QFile f( docListFile );
|
||||
if ( !f.open( IO_WriteOnly ) )
|
||||
{
|
||||
qWarning( "Index::writeDocumentList: could not write dictionary file %s", docListFile.ascii() );
|
||||
return;
|
||||
}
|
||||
QDataStream s( &f );
|
||||
s << docList;
|
||||
}
|
||||
|
||||
bool Index::readDict()
|
||||
{
|
||||
QFile f( dictFile );
|
||||
if ( !f.open( IO_ReadOnly ) )
|
||||
return false;
|
||||
|
||||
dict.clear();
|
||||
QDataStream s( &f );
|
||||
QString key;
|
||||
int version;
|
||||
QValueList<Document> docs;
|
||||
|
||||
s >> version;
|
||||
s >> m_charssplit;
|
||||
s >> m_charsword;
|
||||
|
||||
while ( !s.atEnd() )
|
||||
{
|
||||
s >> key;
|
||||
s >> docs;
|
||||
dict.insert( key, new Entry( docs ) );
|
||||
}
|
||||
|
||||
f.close();
|
||||
return dict.size() > 0 && readDocumentList();
|
||||
}
|
||||
|
||||
bool Index::readDocumentList()
|
||||
{
|
||||
QFile f( docListFile );
|
||||
if ( !f.open( IO_ReadOnly ) )
|
||||
return false;
|
||||
QDataStream s( &f );
|
||||
s >> docList;
|
||||
return true;
|
||||
}
|
||||
|
||||
QStringList Index::query( const QStringList &terms, const QStringList &termSeq, const QStringList &seqWords )
|
||||
{
|
||||
TermList termList;
|
||||
|
||||
QStringList::ConstIterator it = terms.begin();
|
||||
for ( it = terms.begin(); it != terms.end(); ++it )
|
||||
{
|
||||
Entry *e = 0;
|
||||
|
||||
if ( dict[ *it ] )
|
||||
{
|
||||
e = dict[ *it ];
|
||||
termList.append( new Term( *it, e->documents.count(), e->documents ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
}
|
||||
|
||||
termList.sort();
|
||||
|
||||
Term *minTerm = termList.first();
|
||||
|
||||
if ( !termList.count() )
|
||||
return QStringList();
|
||||
|
||||
termList.removeFirst();
|
||||
|
||||
QValueList<Document> minDocs = minTerm->documents;
|
||||
QValueList<Document>::iterator C;
|
||||
QValueList<Document>::ConstIterator It;
|
||||
Term *t = termList.first();
|
||||
|
||||
for ( ; t; t = termList.next() )
|
||||
{
|
||||
QValueList<Document> 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;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList results;
|
||||
qHeapSort( minDocs );
|
||||
|
||||
if ( termSeq.isEmpty() )
|
||||
{
|
||||
for ( C = minDocs.begin(); C != minDocs.end(); ++C )
|
||||
results << docList[ (int)(*C).docNumber ];
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
QString fileName;
|
||||
|
||||
for ( C = minDocs.begin(); C != minDocs.end(); ++C )
|
||||
{
|
||||
fileName = docList[ (int)(*C).docNumber ];
|
||||
|
||||
if ( searchForPhrases( termSeq, seqWords, fileName ) )
|
||||
results << fileName;
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
bool Index::searchForPhrases( const QStringList &phrases, const QStringList &words, const QString &filename )
|
||||
{
|
||||
QStringList parsed_document;
|
||||
|
||||
if ( !parseDocumentToStringlist( filename, parsed_document ) )
|
||||
return false;
|
||||
|
||||
miniDict.clear();
|
||||
|
||||
// Initialize the dictionary with the words in phrase(s)
|
||||
for ( QStringList::ConstIterator cIt = words.begin(); cIt != words.end(); ++cIt )
|
||||
miniDict.insert( *cIt, new PosEntry( 0 ) );
|
||||
|
||||
// Fill the dictionary with the words from the document
|
||||
unsigned int word_offset = 3;
|
||||
for ( QStringList::ConstIterator it = parsed_document.begin(); it != parsed_document.end(); it++, word_offset++ )
|
||||
{
|
||||
PosEntry * entry = miniDict[ *it ];
|
||||
|
||||
if ( entry )
|
||||
entry->positions.append( word_offset );
|
||||
}
|
||||
|
||||
// Dump it
|
||||
/*
|
||||
QDictIterator<PosEntry> it( miniDict );
|
||||
for( ; it.current(); ++it )
|
||||
{
|
||||
QString text( it.currentKey() );
|
||||
QValueList<uint> pos = miniDict[text]->positions;
|
||||
for ( unsigned int i = 1; i < pos.size(); i++ )
|
||||
text += " " + QString::number( pos[i] );
|
||||
|
||||
qDebug( "%s", text.ascii());
|
||||
}
|
||||
*/
|
||||
|
||||
QValueList<uint> first_word_positions;
|
||||
|
||||
for ( QStringList::ConstIterator phrase_it = phrases.begin(); phrase_it != phrases.end(); phrase_it++ )
|
||||
{
|
||||
QStringList phrasewords = QStringList::split( ' ', *phrase_it );
|
||||
first_word_positions = miniDict[ phrasewords[0] ]->positions;
|
||||
|
||||
for ( unsigned int j = 1; j < phrasewords.count(); ++j )
|
||||
{
|
||||
QValueList<uint> next_word_it = miniDict[ phrasewords[j] ]->positions;
|
||||
QValueList<uint>::iterator dict_it = first_word_positions.begin();
|
||||
|
||||
while ( dict_it != first_word_positions.end() )
|
||||
{
|
||||
if ( next_word_it.find( *dict_it + 1 ) != next_word_it.end() )
|
||||
{
|
||||
(*dict_it)++;
|
||||
++dict_it;
|
||||
}
|
||||
else
|
||||
dict_it = first_word_positions.remove( dict_it );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( first_word_positions.count() )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
};
|
@ -0,0 +1,151 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Portions Copyright (C) 2000-2005 Trolltech AS. *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QASSISTANTINDEX_H
|
||||
#define QASSISTANTINDEX_H
|
||||
|
||||
#include <qstringlist.h>
|
||||
#include <qdict.h>
|
||||
#include <qdatastream.h>
|
||||
#include <qobject.h>
|
||||
|
||||
namespace QtAs
|
||||
{
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Q_INT16 docNumber;
|
||||
Q_INT16 frequency;
|
||||
};
|
||||
|
||||
QDataStream &operator>>( QDataStream &s, Document &l );
|
||||
QDataStream &operator<<( QDataStream &s, const Document &l );
|
||||
|
||||
class Index : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
struct Entry
|
||||
{
|
||||
Entry( int d ) { documents.append( Document( d, 1 ) ); }
|
||||
Entry( QValueList<Document> l ) : documents( l ) {}
|
||||
QValueList<Document> documents;
|
||||
};
|
||||
|
||||
struct PosEntry
|
||||
{
|
||||
PosEntry( int p ) { positions.append( p ); }
|
||||
QValueList<uint> positions;
|
||||
};
|
||||
|
||||
Index( const QString &dp, const QString &hp );
|
||||
Index( const QStringList &dl, const QString &hp );
|
||||
|
||||
void writeDict();
|
||||
bool readDict();
|
||||
bool makeIndex();
|
||||
QStringList query( const QStringList&, const QStringList&, const QStringList& );
|
||||
|
||||
void setDictionaryFile( const QString& );
|
||||
void setDocListFile( const QString& );
|
||||
void setDocList( const QStringList & );
|
||||
QString getCharsSplit() const { return m_charssplit; }
|
||||
QString getCharsPartOfWord() const { return m_charsword; }
|
||||
|
||||
signals:
|
||||
void indexingProgress( int );
|
||||
|
||||
public slots:
|
||||
void setLastWinClosed();
|
||||
|
||||
private:
|
||||
void setupDocumentList();
|
||||
bool parseDocumentToStringlist( const QString& filename, QStringList& tokenlist );
|
||||
void parseDocument( const QString& filename, int docnum );
|
||||
void insertInDict( const QString&, int );
|
||||
|
||||
void writeDocumentList();
|
||||
bool readDocumentList();
|
||||
|
||||
QStringList getWildcardTerms( const QString& );
|
||||
QStringList split( const QString& );
|
||||
QValueList<Document> setupDummyTerm( const QStringList& );
|
||||
bool searchForPhrases( const QStringList &phrases, const QStringList &words, const QString &filename );
|
||||
|
||||
QStringList docList;
|
||||
QDict<Entry> dict;
|
||||
QDict<PosEntry> miniDict;
|
||||
QString docPath;
|
||||
QString dictFile;
|
||||
QString docListFile;
|
||||
bool lastWindowClosed;
|
||||
|
||||
// Those characters are splitters (i.e. split the word), but added themselves into dictionary too.
|
||||
// This makes the dictionary MUCH larger, but ensure that for the piece of "window->print" both
|
||||
// search for "print" and "->print" will find it.
|
||||
QString m_charssplit;
|
||||
|
||||
// Those characters are parts of word - for example, '_' is here, and search for _debug will find only _debug.
|
||||
QString m_charsword;
|
||||
};
|
||||
|
||||
struct Term
|
||||
{
|
||||
Term( const QString &t, int f, QValueList<Document> l ) : term( t ), frequency( f ), documents( l ) {}
|
||||
|
||||
QString term;
|
||||
int frequency;
|
||||
QValueList<Document> documents;
|
||||
};
|
||||
|
||||
class TermList : public QPtrList<Term>
|
||||
{
|
||||
public:
|
||||
TermList() : QPtrList<Term>() {}
|
||||
int compareItems( QPtrCollection::Item i1, QPtrCollection::Item i2 );
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif /* QASSISTANTINDEX_H */
|
@ -0,0 +1,438 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtoolbutton.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qtextedit.h>
|
||||
#include <qaccel.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qmenubar.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
#include "libchmfileimpl.h"
|
||||
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmsearchtoolbar.h"
|
||||
#include "kqrunprocess.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
#include "kchmcontentswindow.h"
|
||||
#include "iconstorage.h"
|
||||
|
||||
#include "kchmsearchtoolbar.moc"
|
||||
|
||||
static KQPopupMenu *menu_langlist, *menu_enclist;
|
||||
|
||||
KCHMSearchAndViewToolbar::KCHMSearchAndViewToolbar( KCHMMainWindow * parent )
|
||||
: QToolBar (parent)
|
||||
{
|
||||
// Toolbar label
|
||||
setLabel( i18n( "Find in page") );
|
||||
|
||||
// Load the pixmaps
|
||||
QPixmap iconPrev (*gIconStorage.getToolbarPixmap(KCHMIconStorage::findprev));
|
||||
QPixmap iconNext (*gIconStorage.getToolbarPixmap(KCHMIconStorage::findnext));
|
||||
QPixmap iconFontInc (*gIconStorage.getToolbarPixmap(KCHMIconStorage::view_increase));
|
||||
QPixmap iconFontDec (*gIconStorage.getToolbarPixmap(KCHMIconStorage::view_decrease));
|
||||
QPixmap iconViewSource (*gIconStorage.getToolbarPixmap(KCHMIconStorage::viewsource));
|
||||
QPixmap iconAddBookmark (*gIconStorage.getToolbarPixmap(KCHMIconStorage::bookmark_add));
|
||||
QPixmap iconNextPage (*gIconStorage.getToolbarPixmap(KCHMIconStorage::next_page));
|
||||
QPixmap iconPrevPage (*gIconStorage.getToolbarPixmap(KCHMIconStorage::prev_page));
|
||||
QPixmap iconLocateInContent (*gIconStorage.getToolbarPixmap(KCHMIconStorage::locate_in_content));
|
||||
|
||||
// Create the combobox to enter the find text
|
||||
m_findBox = new QComboBox (TRUE, this);
|
||||
m_findBox->setMinimumWidth (200);
|
||||
connect( m_findBox->lineEdit(), SIGNAL( returnPressed() ), this, SLOT( onReturnPressed() ) );
|
||||
QWhatsThis::add( m_findBox, i18n( "Enter here the text to search in the current page.") );
|
||||
|
||||
QAccel *acc = new QAccel( this );
|
||||
acc->connectItem( acc->insertItem(Key_F+CTRL), this, SLOT( onAccelFocusSearchField() ) );
|
||||
|
||||
// Button 'prevous search result'
|
||||
m_buttonPrev = new QToolButton (iconPrev,
|
||||
i18n( "Previous search result"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnPrevSearchResult()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonPrev, i18n( "Click this button to find previous search result.") );
|
||||
|
||||
// Button 'next search result'
|
||||
m_buttonNext = new QToolButton (iconNext,
|
||||
i18n( "Next search result"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnNextSearchResult()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonNext, i18n( "Click this button to find next search result.") );
|
||||
|
||||
// Button 'locate in content'
|
||||
m_buttonLocateInContent = new QToolButton( iconLocateInContent,
|
||||
i18n( "Locate this topic in content window"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT( onBtnLocateInContentWindow() ),
|
||||
this );
|
||||
QWhatsThis::add( m_buttonLocateInContent, i18n( "Click this button to find current topic in the content window, and open it.") );
|
||||
|
||||
// Button 'increase font size'
|
||||
m_buttonFontInc = new QToolButton (iconFontInc,
|
||||
i18n( "Increase font size"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnFontInc()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonFontInc, i18n( "Click this button to increase the font size.") );
|
||||
|
||||
// Button 'decrease font size'
|
||||
m_buttonFontDec = new QToolButton (iconFontDec,
|
||||
i18n( "Decrease font size"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnFontDec()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonFontDec, i18n( "Click this button to decrease the font size.") );
|
||||
|
||||
// Button 'view HTML source'
|
||||
m_buttonViewSource = new QToolButton (iconViewSource,
|
||||
i18n( "View HTML source"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnViewSource()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonViewSource, i18n( "Click this button to open a separate window with the page HTML source.") );
|
||||
|
||||
// Button 'add a bookmark'
|
||||
m_buttonAddBookmark = new QToolButton (iconAddBookmark,
|
||||
i18n( "Add to bookmarks"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnAddBookmark()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to add the current page to the bookmarks list.") );
|
||||
|
||||
m_buttonPrevPageInTOC = new QToolButton( iconPrevPage,
|
||||
i18n( "Prev page in TOC"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnPrevPageInToc()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to go to previous page in Table Of Content.") );
|
||||
|
||||
m_buttonNextPageInTOC = new QToolButton (iconNextPage,
|
||||
i18n( "Next page in TOC"),
|
||||
QString::null,
|
||||
this,
|
||||
SLOT(onBtnNextPageInToc()),
|
||||
this);
|
||||
QWhatsThis::add( m_buttonAddBookmark, i18n( "Click this button to go to next page in Table of Content.") );
|
||||
|
||||
// Create the approptiate menu entries in 'View' main menu
|
||||
m_MenuView = new KQPopupMenu( parent );
|
||||
parent->menuBar()->insertItem( i18n( "&View"), m_MenuView );
|
||||
|
||||
m_MenuView->insertItem( i18n( "&Increase font"), this, SLOT(onBtnFontInc()), CTRL+Key_Plus );
|
||||
m_MenuView->insertItem( i18n( "&Decrease font"), this, SLOT(onBtnFontDec()), CTRL+Key_Minus );
|
||||
m_MenuView->insertItem( i18n( "&View HTML source"), this, SLOT(onBtnViewSource()), CTRL+Key_U );
|
||||
|
||||
m_MenuView->insertSeparator();
|
||||
m_MenuView->insertItem( i18n( "&Bookmark this page"), this, SLOT(onBtnAddBookmark()), CTRL+Key_T );
|
||||
m_MenuView->insertSeparator();
|
||||
|
||||
m_menuShowFullscreenMenuID = m_MenuView->insertItem( i18n( "&Full screen"), this,
|
||||
SLOT(onBtnFullScreen()), Key_F11 );
|
||||
m_menuShowContentWindowMenuID = m_MenuView->insertItem( i18n( "&Show contents window"), this,
|
||||
SLOT(onBtnToggleContentWindow()), Key_F9 );
|
||||
m_MenuView->insertItem( i18n( "&Locate in contents window"), this,
|
||||
SLOT(onBtnLocateInContentWindow()), CTRL+Key_L );
|
||||
|
||||
m_MenuView->setItemChecked( m_menuShowFullscreenMenuID, false );
|
||||
m_MenuView->setItemChecked( m_menuShowContentWindowMenuID, true );
|
||||
m_MenuView->insertSeparator();
|
||||
|
||||
// Create the language selection menu.
|
||||
menu_langlist = new KQPopupMenu( parent );
|
||||
KQPopupMenu * menu_sublang = 0;
|
||||
|
||||
// Because the encoding menu is very large, it is not reasonable to have a slot for every item.
|
||||
// It is simplier just to use a single slot for any menu item of this submenu.
|
||||
connect (menu_langlist, SIGNAL( activated(int) ), this, SLOT ( onMenuActivated(int) ));
|
||||
|
||||
// Add the language entries
|
||||
const LCHMTextEncoding * enctable = LCHMFileImpl::getTextEncodingTable();
|
||||
int idx;
|
||||
|
||||
for ( idx = 0; (enctable + idx)->language; idx++ )
|
||||
{
|
||||
// See the next item; does is have the same charset as current?
|
||||
const LCHMTextEncoding * item = enctable + idx;
|
||||
const LCHMTextEncoding * nextitem = enctable + idx + 1;
|
||||
|
||||
if ( nextitem->language
|
||||
&& !strcmp( item->language, nextitem->language) )
|
||||
{
|
||||
// If charset is the same as next one, create a new popup menu.
|
||||
// If the menu is already created, add to it
|
||||
if ( !menu_sublang )
|
||||
{
|
||||
menu_sublang = new KQPopupMenu( menu_langlist );
|
||||
connect (menu_sublang, SIGNAL( activated(int) ), this, SLOT ( onMenuActivated(int) ));
|
||||
}
|
||||
|
||||
menu_sublang->insertItem( item->sublanguage, idx );
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the next charset differs from this one,
|
||||
// add a submenu if menu_sublang is already created.
|
||||
// otherwise, just add an item
|
||||
if ( menu_sublang )
|
||||
{
|
||||
menu_sublang->insertItem( item->sublanguage, idx );
|
||||
menu_langlist->insertItem( item->language, menu_sublang );
|
||||
menu_sublang = 0;
|
||||
}
|
||||
else
|
||||
menu_langlist->insertItem( item->language, idx );
|
||||
}
|
||||
|
||||
m_MenuView->insertItem( i18n( "&Set language"), menu_langlist );
|
||||
m_checkedEncodingInMenu = -1;
|
||||
m_checkedLanguageInMenu = -1;
|
||||
|
||||
// Special menu for very smart people just to select codepage
|
||||
QMap<QString,bool> addedCharsets;
|
||||
menu_enclist = new KQPopupMenu( parent );
|
||||
|
||||
connect (menu_enclist, SIGNAL( activated(int) ), this, SLOT ( onMenuActivated(int) ));
|
||||
|
||||
// Add the codepage entries
|
||||
for ( idx = 0; (enctable + idx)->language; idx++ )
|
||||
{
|
||||
const LCHMTextEncoding * item = enctable + idx;
|
||||
|
||||
// This menu is only for charsets, so we won't add duplicate charset twice
|
||||
if ( addedCharsets.find( item->qtcodec ) != addedCharsets.end() )
|
||||
continue;
|
||||
|
||||
addedCharsets[ item->qtcodec ] = true;
|
||||
menu_enclist->insertItem( item->qtcodec, idx );
|
||||
}
|
||||
|
||||
m_MenuView->insertItem( i18n( "&Set codepage"), menu_enclist );
|
||||
|
||||
QWhatsThis::whatsThisButton( this );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::setEnabled( bool enable )
|
||||
{
|
||||
m_findBox->setEnabled (enable);
|
||||
m_buttonPrev->setEnabled (enable);
|
||||
m_buttonNext->setEnabled (enable);
|
||||
m_buttonFontInc->setEnabled (enable);
|
||||
m_buttonFontDec->setEnabled (enable);
|
||||
m_buttonViewSource->setEnabled (enable);
|
||||
m_buttonAddBookmark->setEnabled (enable);
|
||||
|
||||
bool enable_toc_nav_buttons = ::mainWindow->contentsWindow() && enable;
|
||||
m_buttonNextPageInTOC->setEnabled( enable_toc_nav_buttons );
|
||||
m_buttonPrevPageInTOC->setEnabled( enable_toc_nav_buttons );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onReturnPressed( )
|
||||
{
|
||||
search( true );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnPrevSearchResult( )
|
||||
{
|
||||
search( false );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnNextSearchResult( )
|
||||
{
|
||||
search( true );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::search( bool search_forward )
|
||||
{
|
||||
QString searchexpr = m_findBox->lineEdit()->text();
|
||||
|
||||
if ( searchexpr.isEmpty() )
|
||||
return;
|
||||
|
||||
::mainWindow->currentBrowser()->searchWord( searchexpr, search_forward, false );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnFontInc( )
|
||||
{
|
||||
::mainWindow->currentBrowser()->addZoomFactor(1);
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnFontDec( )
|
||||
{
|
||||
::mainWindow->currentBrowser()->addZoomFactor(-1);
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnViewSource( )
|
||||
{
|
||||
QString text;
|
||||
|
||||
if ( !::mainWindow->chmFile()->getFileContentAsString( &text, ::mainWindow->currentBrowser()->getOpenedPage() ) )
|
||||
return;
|
||||
|
||||
if ( appConfig.m_advUseInternalEditor )
|
||||
{
|
||||
QTextEdit * editor = new QTextEdit ( 0 );
|
||||
editor->setTextFormat ( Qt::PlainText );
|
||||
editor->setText (text);
|
||||
editor->setCaption ( QString(APP_NAME) + " - view HTML source of " + ::mainWindow->currentBrowser()->getOpenedPage() );
|
||||
editor->resize (800, 600);
|
||||
editor->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
QFile file;
|
||||
m_tempFileKeeper.generateTempFile( file );
|
||||
|
||||
file.writeBlock( text.utf8() );
|
||||
run_process( appConfig.m_advExternalEditorPath, file.name() );
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnAddBookmark( )
|
||||
{
|
||||
emit ::mainWindow->slotAddBookmark();
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onMenuActivated( int id )
|
||||
{
|
||||
const LCHMTextEncoding * enc = LCHMFileImpl::getTextEncodingTable() + id;
|
||||
::mainWindow->setTextEncoding( enc );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::setChosenEncodingInMenu( const LCHMTextEncoding * enc)
|
||||
{
|
||||
if ( m_checkedEncodingInMenu != -1 )
|
||||
menu_enclist->setItemChecked( m_checkedEncodingInMenu, false );
|
||||
|
||||
if ( m_checkedLanguageInMenu != -1 )
|
||||
menu_langlist->setItemChecked( m_checkedLanguageInMenu, false );
|
||||
|
||||
int idx = LCHMFileImpl::getEncodingIndex( enc );
|
||||
if ( idx == -1 )
|
||||
return;
|
||||
|
||||
menu_langlist->setItemChecked( idx, true );
|
||||
m_checkedLanguageInMenu = idx;
|
||||
|
||||
// For encoding, we need to set up charset!
|
||||
const LCHMTextEncoding * enctable = LCHMFileImpl::getTextEncodingTable();
|
||||
for ( idx = 0; (enctable + idx)->language; idx++ )
|
||||
{
|
||||
// See the next item; does is have the same charset as current?
|
||||
const LCHMTextEncoding * item = enctable + idx;
|
||||
|
||||
// This menu is only for charsets, so we won't add duplicate charset twice
|
||||
if ( !strcmp( item->qtcodec, enc->qtcodec ) )
|
||||
{
|
||||
menu_enclist->setItemChecked ( idx, true);
|
||||
m_checkedEncodingInMenu = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnNextPageInToc()
|
||||
{
|
||||
KCHMContentsWindow * cwnd = ::mainWindow->contentsWindow();
|
||||
|
||||
if ( !cwnd )
|
||||
return;
|
||||
|
||||
// Try to find current list item
|
||||
KCHMIndTocItem * current = cwnd->getTreeItem( ::mainWindow->currentBrowser()->getOpenedPage() );
|
||||
|
||||
if ( !current )
|
||||
return;
|
||||
|
||||
QListViewItemIterator lit( current );
|
||||
lit++;
|
||||
|
||||
if ( lit.current() )
|
||||
::mainWindow->openPage( ((KCHMIndTocItem *) lit.current() )->getUrl(), OPF_CONTENT_TREE | OPF_ADD2HISTORY );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnPrevPageInToc()
|
||||
{
|
||||
KCHMContentsWindow * cwnd = ::mainWindow->contentsWindow();
|
||||
|
||||
if ( !cwnd )
|
||||
return;
|
||||
|
||||
// Try to find current list item
|
||||
KCHMIndTocItem * current = cwnd->getTreeItem( ::mainWindow->currentBrowser()->getOpenedPage() );
|
||||
|
||||
if ( !current )
|
||||
return;
|
||||
|
||||
QListViewItemIterator lit( current );
|
||||
lit--;
|
||||
|
||||
if ( lit.current() )
|
||||
::mainWindow->openPage( ((KCHMIndTocItem *) lit.current() )->getUrl(), OPF_CONTENT_TREE | OPF_ADD2HISTORY );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onAccelFocusSearchField( )
|
||||
{
|
||||
m_findBox->setFocus();
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnToggleContentWindow( )
|
||||
{
|
||||
showContentsWindow( !m_MenuView->isItemChecked( m_menuShowContentWindowMenuID ) );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnFullScreen( )
|
||||
{
|
||||
setFullScreen( !m_MenuView->isItemChecked( m_menuShowFullscreenMenuID ) );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::setFullScreen( bool enable )
|
||||
{
|
||||
::mainWindow->slotEnableFullScreenMode( enable );
|
||||
m_MenuView->setItemChecked( m_menuShowFullscreenMenuID, enable );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::showContentsWindow( bool enable )
|
||||
{
|
||||
::mainWindow->slotShowContentsWindow( enable );
|
||||
m_MenuView->setItemChecked( m_menuShowContentWindowMenuID, enable );
|
||||
}
|
||||
|
||||
void KCHMSearchAndViewToolbar::onBtnLocateInContentWindow( )
|
||||
{
|
||||
::mainWindow->slotLocateInContentWindow( );
|
||||
}
|
||||
|
@ -0,0 +1,87 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMSEARCHTOOLBAR_H
|
||||
#define KCHMSEARCHTOOLBAR_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "forwarddeclarations.h"
|
||||
|
||||
#include "kqtempfile.h"
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMSearchAndViewToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMSearchAndViewToolbar (KCHMMainWindow *parent);
|
||||
|
||||
void setEnabled (bool enable);
|
||||
void setChosenEncodingInMenu( const LCHMTextEncoding * encoding );
|
||||
|
||||
private slots:
|
||||
void onReturnPressed();
|
||||
void onBtnPrevSearchResult();
|
||||
void onBtnNextSearchResult();
|
||||
void onAccelFocusSearchField();
|
||||
|
||||
void onBtnFontInc();
|
||||
void onBtnFontDec();
|
||||
void onBtnViewSource();
|
||||
void onBtnAddBookmark();
|
||||
void onBtnNextPageInToc();
|
||||
void onBtnPrevPageInToc();
|
||||
void onMenuActivated ( int id );
|
||||
void onBtnFullScreen();
|
||||
void onBtnLocateInContentWindow();
|
||||
void onBtnToggleContentWindow();
|
||||
|
||||
void setFullScreen( bool enable );
|
||||
void showContentsWindow( bool enable );
|
||||
|
||||
private:
|
||||
void search (bool forward);
|
||||
|
||||
KQPopupMenu * m_MenuView;
|
||||
QComboBox * m_findBox;
|
||||
QToolButton * m_buttonPrev;
|
||||
QToolButton * m_buttonNext;
|
||||
QToolButton * m_buttonFontInc;
|
||||
QToolButton * m_buttonFontDec;
|
||||
QToolButton * m_buttonViewSource;
|
||||
QToolButton * m_buttonAddBookmark;
|
||||
QToolButton * m_buttonNextPageInTOC;
|
||||
QToolButton * m_buttonPrevPageInTOC;
|
||||
QToolButton * m_buttonLocateInContent;
|
||||
|
||||
int m_checkedLanguageInMenu;
|
||||
int m_checkedEncodingInMenu;
|
||||
|
||||
int m_menuShowFullscreenMenuID;
|
||||
int m_menuShowContentWindowMenuID;
|
||||
|
||||
KQTempFileKeeper m_tempFileKeeper;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,246 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "libchmfile.h"
|
||||
|
||||
#include "kchmsearchwindow.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmlistitemtooltip.h"
|
||||
#include "kchmtreeviewitem.h"
|
||||
#include "kchmsearchengine.h"
|
||||
|
||||
#include "kchmsearchwindow.moc"
|
||||
|
||||
|
||||
KCHMSearchWindow::KCHMSearchWindow( QWidget * parent, const char * name, WFlags f )
|
||||
: QWidget (parent, name, f)
|
||||
{
|
||||
QVBoxLayout * layout = new QVBoxLayout (this);
|
||||
layout->setMargin(6);
|
||||
layout->setSpacing(6);
|
||||
|
||||
// Labels <type words to search> and <help>
|
||||
QHBoxLayout * labellayout = new QHBoxLayout();
|
||||
labellayout->addWidget( new QLabel( i18n( "Type in word(s) to search for:"), this) );
|
||||
labellayout->addStretch( 10 );
|
||||
|
||||
KCHMClickableLabel * helplink = new KCHMClickableLabel( i18n( "<a href=\"q\"><b>Help</b></a>"), this );
|
||||
connect( helplink, SIGNAL( clicked() ), this, SLOT( onHelpClicked() ) );
|
||||
helplink->setCursor( QCursor( Qt::PointingHandCursor ) );
|
||||
|
||||
labellayout->addWidget ( helplink );
|
||||
layout->addLayout( labellayout );
|
||||
|
||||
m_searchQuery = new QComboBox (TRUE, this);
|
||||
m_searchQuery->setFocus();
|
||||
m_searchQuery->setMaxCount (10);
|
||||
m_searchQuery->setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
|
||||
|
||||
QPushButton * searchButton = new QPushButton ( i18n("Go"), this);
|
||||
searchButton->setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
|
||||
|
||||
QHBoxLayout * hlayout = new QHBoxLayout ( layout );
|
||||
hlayout->addWidget ( m_searchQuery );
|
||||
hlayout->addWidget ( searchButton );
|
||||
|
||||
m_searchList = new KQListView (this);
|
||||
m_searchList->addColumn( i18n( "Title" ) );
|
||||
m_searchList->addColumn( i18n( "Location" ) );
|
||||
m_searchList->setShowToolTips(true);
|
||||
|
||||
connect( searchButton,
|
||||
SIGNAL( clicked () ),
|
||||
this,
|
||||
SLOT( onReturnPressed() ) );
|
||||
|
||||
connect( m_searchQuery->lineEdit(),
|
||||
SIGNAL( returnPressed() ),
|
||||
this,
|
||||
SLOT( onReturnPressed() ) );
|
||||
|
||||
connect( m_searchList,
|
||||
SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ),
|
||||
this,
|
||||
SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) );
|
||||
|
||||
connect( m_searchList,
|
||||
SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ),
|
||||
this,
|
||||
SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) );
|
||||
|
||||
//layout->addSpacing (10);
|
||||
layout->addWidget (m_searchList);
|
||||
|
||||
new KCHMListItemTooltip( m_searchList );
|
||||
m_contextMenu = 0;
|
||||
m_searchEngine = 0;
|
||||
}
|
||||
|
||||
void KCHMSearchWindow::invalidate( )
|
||||
{
|
||||
m_searchList->clear();
|
||||
m_searchQuery->clear();
|
||||
m_searchQuery->lineEdit()->clear();
|
||||
|
||||
delete m_searchEngine;
|
||||
m_searchEngine = 0;
|
||||
}
|
||||
|
||||
void KCHMSearchWindow::onReturnPressed( )
|
||||
{
|
||||
QStringList results;
|
||||
QString text = m_searchQuery->lineEdit()->text();
|
||||
|
||||
if ( text.isEmpty() )
|
||||
return;
|
||||
|
||||
m_searchList->clear();
|
||||
|
||||
if ( searchQuery( text, &results ) )
|
||||
{
|
||||
if ( !results.empty() )
|
||||
{
|
||||
for ( unsigned int i = 0; i < results.size(); i++ )
|
||||
{
|
||||
new KCMSearchTreeViewItem ( m_searchList,
|
||||
::mainWindow->chmFile()->getTopicByUrl( results[i] ),
|
||||
results[i],
|
||||
results[i] );
|
||||
}
|
||||
|
||||
::mainWindow->showInStatusBar( i18n( "Search returned %1 result(s)" ) . arg(results.size()) );
|
||||
}
|
||||
else
|
||||
::mainWindow->showInStatusBar( i18n( "Search returned no results") );
|
||||
}
|
||||
else
|
||||
::mainWindow->showInStatusBar( i18n( "Search failed") );
|
||||
}
|
||||
|
||||
|
||||
void KCHMSearchWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int)
|
||||
{
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
KCMSearchTreeViewItem * treeitem = (KCMSearchTreeViewItem *) item;
|
||||
::mainWindow->openPage( treeitem->getUrl(), OPF_ADD2HISTORY );
|
||||
}
|
||||
|
||||
void KCHMSearchWindow::restoreSettings( const KCHMSettings::search_saved_settings_t & settings )
|
||||
{
|
||||
for ( unsigned int i = 0; i < settings.size(); i++ )
|
||||
m_searchQuery->insertItem (settings[i]);
|
||||
}
|
||||
|
||||
void KCHMSearchWindow::saveSettings( KCHMSettings::search_saved_settings_t & settings )
|
||||
{
|
||||
settings.clear();
|
||||
|
||||
for ( int i = 0; i < m_searchQuery->count(); i++ )
|
||||
settings.push_back (m_searchQuery->text(i));
|
||||
}
|
||||
|
||||
|
||||
void KCHMSearchWindow::onHelpClicked( )
|
||||
{
|
||||
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
|
||||
{
|
||||
QMessageBox::information ( this,
|
||||
i18n( "How to use search"),
|
||||
i18n( "<html><p>The improved search engine allows you to search for a word, symbol or phrase, which is set of words and symbols included in quotes. Only the documents which include all the terms speficide in th search query are shown; no prefixes needed.<p>Unlike MS CHM internal search index, my improved search engine indexes everything, including special symbols. Therefore it is possible to search (and find!) for something like <i>$q = new ChmFile();</i>. This search also fully supports Unicode, which means that you can search in non-English documents.<p>If you want to search for a quote symbol, use quotation mark instead. The engine treats a quote and a quotation mark as the same symbol, which allows to use them in phrases.</html>") );
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information ( this,
|
||||
i18n( "How to use search"),
|
||||
i18n( "The search query can contain a few prefixes.\nA set of words inside the quote marks mean that you are searching for exact phrase.\nA word with minus sign means that it should be absent in the search result.\nA word with plus mark or without any mark means that it must be present in the search result.\n\nNote that only letters and digits are indexed.\nYou cannot search for non-character symbols other than underscope, and those symbols will be removed from the search query.\nFor example, search for 'C' will give the same result as searching for 'C++'.") );
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMSearchWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int )
|
||||
{
|
||||
if ( !m_contextMenu )
|
||||
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
|
||||
|
||||
if( item )
|
||||
{
|
||||
KCMSearchTreeViewItem * treeitem = (KCMSearchTreeViewItem *) item;
|
||||
|
||||
::mainWindow->currentBrowser()->setTabKeeper( treeitem->getUrl() );
|
||||
m_contextMenu->popup( point );
|
||||
}
|
||||
}
|
||||
|
||||
bool KCHMSearchWindow::initSearchEngine( )
|
||||
{
|
||||
m_searchEngine = new KCHMSearchEngine();
|
||||
|
||||
if ( !m_searchEngine->loadOrGenerateIndex() )
|
||||
{
|
||||
delete m_searchEngine;
|
||||
m_searchEngine = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void KCHMSearchWindow::execSearchQueryInGui( const QString & query )
|
||||
{
|
||||
m_searchQuery->lineEdit()->setText( query );
|
||||
onReturnPressed();
|
||||
}
|
||||
|
||||
|
||||
bool KCHMSearchWindow::searchQuery( const QString & query, QStringList * results )
|
||||
{
|
||||
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
|
||||
{
|
||||
if ( !m_searchEngine && !initSearchEngine() )
|
||||
return false;
|
||||
}
|
||||
else if ( !::mainWindow->chmFile()->hasSearchTable() )
|
||||
{
|
||||
QMessageBox::information ( this,
|
||||
i18n( "Search is not available" ),
|
||||
i18n( "<p>The search feature is not avaiable for this chm file."
|
||||
"<p>The old search engine depends on indexes present in chm files itself. Not every chm file has an index; it is set up"
|
||||
" during chm file creation. Therefore if the search index was not created during chm file creation, this makes search "
|
||||
"impossible.<p>Solution: use new search engine (menu Settings/Advanced), which generates its own index.") );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( query.isEmpty() )
|
||||
return false;
|
||||
|
||||
KCHMShowWaitCursor waitcursor;
|
||||
bool result;
|
||||
|
||||
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
|
||||
result = m_searchEngine->searchQuery( query, results );
|
||||
else
|
||||
result = ::mainWindow->chmFile()->searchQuery( query, results );
|
||||
|
||||
return result;
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMSEARCHWINDOW_H
|
||||
#define KCHMSEARCHWINDOW_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "kchmsettings.h"
|
||||
#include "forwarddeclarations.h"
|
||||
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMSearchEngine;
|
||||
|
||||
|
||||
class KCHMClickableLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMClickableLabel( const QString& label, QWidget * parent )
|
||||
: QLabel( label, parent ) {};
|
||||
|
||||
virtual ~KCHMClickableLabel() {};
|
||||
|
||||
signals:
|
||||
void clicked();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent ( QMouseEvent * ) { emit clicked(); }
|
||||
};
|
||||
|
||||
|
||||
class KCHMSearchWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMSearchWindow ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
|
||||
|
||||
void invalidate();
|
||||
void restoreSettings (const KCHMSettings::search_saved_settings_t& settings);
|
||||
void saveSettings (KCHMSettings::search_saved_settings_t& settings);
|
||||
void execSearchQueryInGui( const QString& query );
|
||||
bool searchQuery( const QString& query, QStringList * results );
|
||||
|
||||
public slots:
|
||||
void slotContextMenuRequested ( QListViewItem *item, const QPoint &point, int column );
|
||||
|
||||
private slots:
|
||||
void onHelpClicked();
|
||||
void onReturnPressed ();
|
||||
void onDoubleClicked ( QListViewItem *, const QPoint &, int);
|
||||
|
||||
private:
|
||||
bool initSearchEngine();
|
||||
|
||||
private:
|
||||
QComboBox * m_searchQuery;
|
||||
KQListView * m_searchList;
|
||||
KQPopupMenu * m_contextMenu;
|
||||
|
||||
KCHMSearchEngine* m_searchEngine;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,298 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qfile.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qdatastream.h>
|
||||
|
||||
#include "kchmsettings.h"
|
||||
#include "kchmconfig.h"
|
||||
|
||||
static Q_INT32 SETTINGS_MAGIC = 0xD8AB4E76;
|
||||
static Q_INT32 SETTINGS_VERSION = 4;
|
||||
|
||||
/*
|
||||
* The order is important!
|
||||
* To be compatible with next versions, you may add items ONLY before the MARKER_END!
|
||||
*/
|
||||
enum marker_t
|
||||
{
|
||||
MARKER_FILESIZE = 1,
|
||||
MARKER_FILETIME,
|
||||
|
||||
MARKER_ACTIVETABSYSTEM,
|
||||
MARKER_ACTIVETABWINDOW,
|
||||
MARKER_ACTIVEENCODING,
|
||||
MARKER_SEARCHHISTORY,
|
||||
MARKER_WINDOW_SIZE,
|
||||
|
||||
MARKER_BOOKMARKS,
|
||||
MARKER_VIEWINDOWS,
|
||||
|
||||
MARKER_CONTENTSDATA,
|
||||
MARKER_INDEXDATA,
|
||||
|
||||
// This should be the last
|
||||
MARKER_END = 0x7FFF
|
||||
};
|
||||
|
||||
// Helpers for serialization of SavedBookmark through QDataStream
|
||||
static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::SavedBookmark& b )
|
||||
{
|
||||
s << b.name;
|
||||
s << b.url;
|
||||
s << b.scroll_y;
|
||||
return s;
|
||||
}
|
||||
|
||||
static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedBookmark& b )
|
||||
{
|
||||
s >> b.name;
|
||||
s >> b.url;
|
||||
s >> b.scroll_y;
|
||||
return s;
|
||||
}
|
||||
|
||||
// Helpers for serialization of SavedViewWindow through QDataStream
|
||||
static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::SavedViewWindow& b )
|
||||
{
|
||||
// Store the version first. Later we can increase it when adding new members.
|
||||
s << 1;
|
||||
s << b.url;
|
||||
s << b.scroll_y;
|
||||
s << b.zoom;
|
||||
return s;
|
||||
}
|
||||
|
||||
static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedViewWindow& b )
|
||||
{
|
||||
Q_INT32 version;
|
||||
|
||||
s >> version;
|
||||
s >> b.url;
|
||||
s >> b.scroll_y;
|
||||
s >> b.zoom;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
KCHMSettings::KCHMSettings( )
|
||||
{
|
||||
m_activetabsystem = 0;
|
||||
m_activetabwindow = 0;
|
||||
m_activeencodinglcid = 0;
|
||||
|
||||
m_window_size_x = 700;
|
||||
m_window_size_y = 500;
|
||||
m_window_size_splitter = 200;
|
||||
}
|
||||
|
||||
|
||||
bool KCHMSettings::loadSettings( const QString & filename )
|
||||
{
|
||||
m_activetabsystem = 0;
|
||||
m_activetabwindow = 0;
|
||||
m_activeencodinglcid = 0;
|
||||
|
||||
m_searchhistory.clear();
|
||||
m_bookmarks.clear();
|
||||
m_viewwindows.clear();
|
||||
|
||||
QFileInfo finfo ( filename );
|
||||
|
||||
m_settingsFile = QString::null;
|
||||
m_searchDictFile = QString::null;
|
||||
m_searchDocFile = QString::null;
|
||||
|
||||
if ( !finfo.size() )
|
||||
return false;
|
||||
|
||||
// Init those params, as they'll be used during save the first time even if the file is not here
|
||||
m_currentfilesize = finfo.size();
|
||||
m_currentfiledate = finfo.lastModified().toTime_t();
|
||||
|
||||
getFilenames( filename, &m_settingsFile, &m_searchDictFile, &m_searchDocFile );
|
||||
|
||||
QFile file( m_settingsFile );
|
||||
|
||||
if ( !file.open (IO_ReadOnly) )
|
||||
return false; // it's ok, file may not exist
|
||||
|
||||
QDataStream stream (&file);
|
||||
|
||||
// Read and check header
|
||||
Q_INT32 data;
|
||||
bool complete_read = false;
|
||||
stream >> data; // magic
|
||||
|
||||
if ( data != SETTINGS_MAGIC )
|
||||
{
|
||||
qWarning ("file %s has bad magic value, ignoring it.", file.name().ascii());
|
||||
return false;
|
||||
}
|
||||
|
||||
stream >> data; // version
|
||||
if ( data > SETTINGS_VERSION )
|
||||
{
|
||||
qWarning ("file %s has unsupported data version %d, ignoring it.", file.name().ascii(), data);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read everything by marker
|
||||
while ( 1 )
|
||||
{
|
||||
stream >> data; // marker
|
||||
if ( data == MARKER_END )
|
||||
{
|
||||
complete_read = true;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (data)
|
||||
{
|
||||
case MARKER_FILESIZE:
|
||||
stream >> m_currentfilesize;
|
||||
if ( m_currentfilesize != finfo.size() )
|
||||
{
|
||||
m_currentfilesize = finfo.size();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case MARKER_FILETIME:
|
||||
stream >> m_currentfiledate;
|
||||
if ( m_currentfiledate != finfo.lastModified().toTime_t() )
|
||||
{
|
||||
m_currentfiledate = finfo.lastModified().toTime_t();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case MARKER_ACTIVETABSYSTEM:
|
||||
stream >> m_activetabsystem;
|
||||
break;
|
||||
|
||||
case MARKER_ACTIVETABWINDOW:
|
||||
stream >> m_activetabwindow;
|
||||
break;
|
||||
|
||||
case MARKER_ACTIVEENCODING:
|
||||
stream >> m_activeencodinglcid;
|
||||
break;
|
||||
|
||||
case MARKER_WINDOW_SIZE:
|
||||
stream >> m_window_size_x;
|
||||
stream >> m_window_size_y;
|
||||
stream >> m_window_size_splitter;
|
||||
break;
|
||||
|
||||
case MARKER_SEARCHHISTORY:
|
||||
stream >> m_searchhistory;
|
||||
break;
|
||||
|
||||
case MARKER_BOOKMARKS:
|
||||
stream >> m_bookmarks;
|
||||
break;
|
||||
|
||||
case MARKER_VIEWINDOWS:
|
||||
stream >> m_viewwindows;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return complete_read;
|
||||
}
|
||||
|
||||
|
||||
bool KCHMSettings::saveSettings( )
|
||||
{
|
||||
QFile file( m_settingsFile );
|
||||
if ( !file.open (IO_WriteOnly) )
|
||||
{
|
||||
qWarning ("Could not write settings into file %s: %s", file.name().ascii(), file.errorString().ascii());
|
||||
return false;
|
||||
}
|
||||
|
||||
QDataStream stream (&file);
|
||||
|
||||
// Save header
|
||||
stream << SETTINGS_MAGIC;
|
||||
stream << SETTINGS_VERSION;
|
||||
|
||||
// Save size and last-modified
|
||||
stream << MARKER_FILESIZE;
|
||||
stream << m_currentfilesize;
|
||||
stream << MARKER_FILETIME;
|
||||
stream << m_currentfiledate;
|
||||
|
||||
// Save generic settings
|
||||
stream << MARKER_ACTIVETABSYSTEM;
|
||||
stream << m_activetabsystem;
|
||||
|
||||
// Save generic settings
|
||||
stream << MARKER_ACTIVETABWINDOW;
|
||||
stream << m_activetabwindow;
|
||||
|
||||
stream << MARKER_ACTIVEENCODING;
|
||||
stream << m_activeencodinglcid;
|
||||
|
||||
// Save search history vector
|
||||
stream << MARKER_SEARCHHISTORY;
|
||||
stream << m_searchhistory;
|
||||
|
||||
// Save window size and splitter position
|
||||
stream << MARKER_WINDOW_SIZE;
|
||||
stream << m_window_size_x;
|
||||
stream << m_window_size_y;
|
||||
stream << m_window_size_splitter;
|
||||
|
||||
stream << MARKER_BOOKMARKS;
|
||||
stream << m_bookmarks;
|
||||
|
||||
stream << MARKER_VIEWINDOWS;
|
||||
stream << m_viewwindows;
|
||||
|
||||
stream << MARKER_END;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void KCHMSettings::removeSettings( const QString & filename )
|
||||
{
|
||||
QString settingsfile, dictfile, doclistfile;
|
||||
|
||||
getFilenames( filename, &settingsfile, &dictfile, &doclistfile );
|
||||
|
||||
QFile::remove( settingsfile );
|
||||
QFile::remove( dictfile );
|
||||
QFile::remove( doclistfile );
|
||||
}
|
||||
|
||||
|
||||
void KCHMSettings::getFilenames(const QString & helpfilename, QString * settingsfile, QString * dictfile, QString * doclistfile )
|
||||
{
|
||||
QFileInfo finfo ( helpfilename );
|
||||
QString prefix = appConfig.m_datapath + "/" + finfo.baseName();
|
||||
|
||||
*settingsfile = prefix + ".kchmviewer";
|
||||
*dictfile = prefix + ".dict";
|
||||
*doclistfile = prefix + ".doclist";
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMSETTINGS_H
|
||||
#define KCHMSETTINGS_H
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qvaluelist.h>
|
||||
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class SavedBookmark;
|
||||
class QFileInfo;
|
||||
|
||||
|
||||
class KCHMSettings
|
||||
{
|
||||
public:
|
||||
KCHMSettings ();
|
||||
|
||||
bool loadSettings (const QString& filename);
|
||||
bool saveSettings ( );
|
||||
void removeSettings ( const QString& filename );
|
||||
|
||||
QString searchIndexDictFilename() const { return m_searchDictFile; }
|
||||
QString searchIndexDocFilename() const { return m_searchDocFile; }
|
||||
|
||||
class SavedBookmark
|
||||
{
|
||||
public:
|
||||
SavedBookmark() { scroll_y = 0; }
|
||||
SavedBookmark (QString n, QString u, int y) : name(n), url(u), scroll_y(y) {};
|
||||
|
||||
QString name;
|
||||
QString url;
|
||||
int scroll_y;
|
||||
};
|
||||
|
||||
class SavedViewWindow
|
||||
{
|
||||
public:
|
||||
SavedViewWindow() { scroll_y = 0; zoom = 0; }
|
||||
SavedViewWindow (QString u, int y, int z) : url(u), scroll_y(y), zoom(z) {};
|
||||
|
||||
QString url;
|
||||
int scroll_y;
|
||||
int zoom;
|
||||
};
|
||||
|
||||
typedef QValueList<QString> search_saved_settings_t;
|
||||
typedef QValueList<SavedBookmark> bookmark_saved_settings_t;
|
||||
typedef QValueList<SavedViewWindow> viewindow_saved_settings_t;
|
||||
|
||||
int m_window_size_x;
|
||||
int m_window_size_y;
|
||||
int m_window_size_splitter;
|
||||
int m_activetabsystem;
|
||||
int m_activetabwindow;
|
||||
int m_activeencodinglcid;
|
||||
search_saved_settings_t m_searchhistory;
|
||||
bookmark_saved_settings_t m_bookmarks;
|
||||
viewindow_saved_settings_t m_viewwindows;
|
||||
|
||||
private:
|
||||
void getFilenames(const QString & helpfilename, QString * settingsfile, QString * dictfile, QString * doclistfile );
|
||||
|
||||
unsigned int m_currentfilesize;
|
||||
unsigned int m_currentfiledate;
|
||||
QString m_settingsFile;
|
||||
QString m_searchDictFile;
|
||||
QString m_searchDocFile;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,395 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file './kchmsetupdialog.ui'
|
||||
**
|
||||
** Created: Sat Jun 16 22:08:58 2007
|
||||
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.8 edited Jan 11 14:47 $)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
|
||||
#include "kchmsetupdialog.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qwidget.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qlabel.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
/*
|
||||
* Constructs a KCHMSetupDialog as a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*
|
||||
* The dialog will by default be modeless, unless you set 'modal' to
|
||||
* TRUE to construct a modal dialog.
|
||||
*/
|
||||
KCHMSetupDialog::KCHMSetupDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
|
||||
: QDialog( parent, name, modal, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "MyDialog1" );
|
||||
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );
|
||||
setSizeGripEnabled( FALSE );
|
||||
setModal( TRUE );
|
||||
MyDialog1Layout = new QVBoxLayout( this, 11, 6, "MyDialog1Layout");
|
||||
MyDialog1Layout->setResizeMode( QLayout::Minimum );
|
||||
|
||||
tabWidget = new QTabWidget( this, "tabWidget" );
|
||||
|
||||
Widget8 = new QWidget( tabWidget, "Widget8" );
|
||||
Widget8Layout = new QVBoxLayout( Widget8, 11, 6, "Widget8Layout");
|
||||
|
||||
layout4 = new QHBoxLayout( 0, 0, 6, "layout4");
|
||||
|
||||
buttonGroup1 = new QButtonGroup( Widget8, "buttonGroup1" );
|
||||
buttonGroup1->setColumnLayout(0, Qt::Vertical );
|
||||
buttonGroup1->layout()->setSpacing( 6 );
|
||||
buttonGroup1->layout()->setMargin( 11 );
|
||||
buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() );
|
||||
buttonGroup1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_radioOnBeginOpenDialog = new QRadioButton( buttonGroup1, "m_radioOnBeginOpenDialog" );
|
||||
buttonGroup1Layout->addWidget( m_radioOnBeginOpenDialog );
|
||||
|
||||
m_radioOnBeginOpenLast = new QRadioButton( buttonGroup1, "m_radioOnBeginOpenLast" );
|
||||
buttonGroup1Layout->addWidget( m_radioOnBeginOpenLast );
|
||||
layout4->addWidget( buttonGroup1 );
|
||||
|
||||
buttonGroup2 = new QButtonGroup( Widget8, "buttonGroup2" );
|
||||
buttonGroup2->setColumnLayout(0, Qt::Vertical );
|
||||
buttonGroup2->layout()->setSpacing( 6 );
|
||||
buttonGroup2->layout()->setMargin( 11 );
|
||||
buttonGroup2Layout = new QVBoxLayout( buttonGroup2->layout() );
|
||||
buttonGroup2Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
layout3 = new QHBoxLayout( 0, 0, 6, "layout3");
|
||||
|
||||
textLabel1 = new QLabel( buttonGroup2, "textLabel1" );
|
||||
layout3->addWidget( textLabel1 );
|
||||
|
||||
m_historySize = new QSpinBox( buttonGroup2, "m_historySize" );
|
||||
m_historySize->setValue( 10 );
|
||||
layout3->addWidget( m_historySize );
|
||||
|
||||
textLabel2 = new QLabel( buttonGroup2, "textLabel2" );
|
||||
layout3->addWidget( textLabel2 );
|
||||
buttonGroup2Layout->addLayout( layout3 );
|
||||
|
||||
m_rememberHistoryInfo = new QCheckBox( buttonGroup2, "m_rememberHistoryInfo" );
|
||||
buttonGroup2Layout->addWidget( m_rememberHistoryInfo );
|
||||
layout4->addWidget( buttonGroup2 );
|
||||
Widget8Layout->addLayout( layout4 );
|
||||
|
||||
groupBox1 = new QGroupBox( Widget8, "groupBox1" );
|
||||
groupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
groupBox1->layout()->setSpacing( 6 );
|
||||
groupBox1->layout()->setMargin( 11 );
|
||||
groupBox1Layout = new QHBoxLayout( groupBox1->layout() );
|
||||
groupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
buttonGroup4 = new QButtonGroup( groupBox1, "buttonGroup4" );
|
||||
buttonGroup4->setColumnLayout(0, Qt::Vertical );
|
||||
buttonGroup4->layout()->setSpacing( 6 );
|
||||
buttonGroup4->layout()->setMargin( 11 );
|
||||
buttonGroup4Layout = new QVBoxLayout( buttonGroup4->layout() );
|
||||
buttonGroup4Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_radioExtLinkOpenAlways = new QRadioButton( buttonGroup4, "m_radioExtLinkOpenAlways" );
|
||||
buttonGroup4Layout->addWidget( m_radioExtLinkOpenAlways );
|
||||
|
||||
m_radioExtLinkAsk = new QRadioButton( buttonGroup4, "m_radioExtLinkAsk" );
|
||||
buttonGroup4Layout->addWidget( m_radioExtLinkAsk );
|
||||
|
||||
m_radioExtLinkOpenNever = new QRadioButton( buttonGroup4, "m_radioExtLinkOpenNever" );
|
||||
buttonGroup4Layout->addWidget( m_radioExtLinkOpenNever );
|
||||
groupBox1Layout->addWidget( buttonGroup4 );
|
||||
|
||||
buttonGroup5 = new QButtonGroup( groupBox1, "buttonGroup5" );
|
||||
buttonGroup5->setColumnLayout(0, Qt::Vertical );
|
||||
buttonGroup5->layout()->setSpacing( 6 );
|
||||
buttonGroup5->layout()->setMargin( 11 );
|
||||
buttonGroup5Layout = new QVBoxLayout( buttonGroup5->layout() );
|
||||
buttonGroup5Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_radioNewChmOpenAlways = new QRadioButton( buttonGroup5, "m_radioNewChmOpenAlways" );
|
||||
buttonGroup5Layout->addWidget( m_radioNewChmOpenAlways );
|
||||
|
||||
m_radioNewChmAsk = new QRadioButton( buttonGroup5, "m_radioNewChmAsk" );
|
||||
buttonGroup5Layout->addWidget( m_radioNewChmAsk );
|
||||
|
||||
m_radioNewChmOpenNever = new QRadioButton( buttonGroup5, "m_radioNewChmOpenNever" );
|
||||
buttonGroup5Layout->addWidget( m_radioNewChmOpenNever );
|
||||
groupBox1Layout->addWidget( buttonGroup5 );
|
||||
Widget8Layout->addWidget( groupBox1 );
|
||||
tabWidget->insertTab( Widget8, QString::fromLatin1("") );
|
||||
|
||||
Widget9 = new QWidget( tabWidget, "Widget9" );
|
||||
Widget9Layout = new QVBoxLayout( Widget9, 11, 6, "Widget9Layout");
|
||||
|
||||
m_groupQtsettings = new QGroupBox( Widget9, "m_groupQtsettings" );
|
||||
m_groupQtsettings->setColumnLayout(0, Qt::Vertical );
|
||||
m_groupQtsettings->layout()->setSpacing( 6 );
|
||||
m_groupQtsettings->layout()->setMargin( 11 );
|
||||
m_groupQtsettingsLayout = new QHBoxLayout( m_groupQtsettings->layout() );
|
||||
m_groupQtsettingsLayout->setAlignment( Qt::AlignTop );
|
||||
|
||||
textLabel1_2 = new QLabel( m_groupQtsettings, "textLabel1_2" );
|
||||
textLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );
|
||||
textLabel1_2->setLineWidth( 1 );
|
||||
textLabel1_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
|
||||
m_groupQtsettingsLayout->addWidget( textLabel1_2 );
|
||||
|
||||
m_qtBrowserPath = new QLineEdit( m_groupQtsettings, "m_qtBrowserPath" );
|
||||
m_qtBrowserPath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, m_qtBrowserPath->sizePolicy().hasHeightForWidth() ) );
|
||||
m_groupQtsettingsLayout->addWidget( m_qtBrowserPath );
|
||||
Widget9Layout->addWidget( m_groupQtsettings );
|
||||
|
||||
m_groupKDEsettings = new QGroupBox( Widget9, "m_groupKDEsettings" );
|
||||
m_groupKDEsettings->setColumnLayout(0, Qt::Vertical );
|
||||
m_groupKDEsettings->layout()->setSpacing( 6 );
|
||||
m_groupKDEsettings->layout()->setMargin( 11 );
|
||||
m_groupKDEsettingsLayout = new QHBoxLayout( m_groupKDEsettings->layout() );
|
||||
m_groupKDEsettingsLayout->setAlignment( Qt::AlignTop );
|
||||
|
||||
buttonGroup5_2 = new QButtonGroup( m_groupKDEsettings, "buttonGroup5_2" );
|
||||
buttonGroup5_2->setColumnLayout(0, Qt::Vertical );
|
||||
buttonGroup5_2->layout()->setSpacing( 6 );
|
||||
buttonGroup5_2->layout()->setMargin( 11 );
|
||||
buttonGroup5_2Layout = new QVBoxLayout( buttonGroup5_2->layout() );
|
||||
buttonGroup5_2Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_radioUseQtextBrowser = new QRadioButton( buttonGroup5_2, "m_radioUseQtextBrowser" );
|
||||
buttonGroup5_2Layout->addWidget( m_radioUseQtextBrowser );
|
||||
|
||||
m_radioUseKHTMLPart = new QRadioButton( buttonGroup5_2, "m_radioUseKHTMLPart" );
|
||||
buttonGroup5_2Layout->addWidget( m_radioUseKHTMLPart );
|
||||
m_groupKDEsettingsLayout->addWidget( buttonGroup5_2 );
|
||||
|
||||
groupKhtmlSecurity = new QGroupBox( m_groupKDEsettings, "groupKhtmlSecurity" );
|
||||
groupKhtmlSecurity->setColumnLayout(0, Qt::Vertical );
|
||||
groupKhtmlSecurity->layout()->setSpacing( 6 );
|
||||
groupKhtmlSecurity->layout()->setMargin( 11 );
|
||||
groupKhtmlSecurityLayout = new QGridLayout( groupKhtmlSecurity->layout() );
|
||||
groupKhtmlSecurityLayout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_enableJS = new QCheckBox( groupKhtmlSecurity, "m_enableJS" );
|
||||
|
||||
groupKhtmlSecurityLayout->addWidget( m_enableJS, 0, 0 );
|
||||
|
||||
m_enablePlugins = new QCheckBox( groupKhtmlSecurity, "m_enablePlugins" );
|
||||
|
||||
groupKhtmlSecurityLayout->addWidget( m_enablePlugins, 0, 1 );
|
||||
|
||||
m_enableJava = new QCheckBox( groupKhtmlSecurity, "m_enableJava" );
|
||||
|
||||
groupKhtmlSecurityLayout->addWidget( m_enableJava, 1, 0 );
|
||||
|
||||
m_enableRefresh = new QCheckBox( groupKhtmlSecurity, "m_enableRefresh" );
|
||||
|
||||
groupKhtmlSecurityLayout->addWidget( m_enableRefresh, 1, 1 );
|
||||
m_groupKDEsettingsLayout->addWidget( groupKhtmlSecurity );
|
||||
Widget9Layout->addWidget( m_groupKDEsettings );
|
||||
tabWidget->insertTab( Widget9, QString::fromLatin1("") );
|
||||
|
||||
TabPage = new QWidget( tabWidget, "TabPage" );
|
||||
TabPageLayout = new QVBoxLayout( TabPage, 11, 6, "TabPageLayout");
|
||||
|
||||
buttonGroup7 = new QButtonGroup( TabPage, "buttonGroup7" );
|
||||
buttonGroup7->setColumnLayout(0, Qt::Vertical );
|
||||
buttonGroup7->layout()->setSpacing( 6 );
|
||||
buttonGroup7->layout()->setMargin( 11 );
|
||||
buttonGroup7Layout = new QVBoxLayout( buttonGroup7->layout() );
|
||||
buttonGroup7Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_advViewSourceInternal = new QRadioButton( buttonGroup7, "m_advViewSourceInternal" );
|
||||
buttonGroup7Layout->addWidget( m_advViewSourceInternal );
|
||||
|
||||
m_advViewSourceExternal = new QRadioButton( buttonGroup7, "m_advViewSourceExternal" );
|
||||
buttonGroup7Layout->addWidget( m_advViewSourceExternal );
|
||||
|
||||
layout4_2 = new QHBoxLayout( 0, 0, 6, "layout4_2");
|
||||
|
||||
textLabel1_3 = new QLabel( buttonGroup7, "textLabel1_3" );
|
||||
layout4_2->addWidget( textLabel1_3 );
|
||||
|
||||
m_advExternalProgramName = new QLineEdit( buttonGroup7, "m_advExternalProgramName" );
|
||||
layout4_2->addWidget( m_advExternalProgramName );
|
||||
buttonGroup7Layout->addLayout( layout4_2 );
|
||||
TabPageLayout->addWidget( buttonGroup7 );
|
||||
|
||||
groupBox6 = new QButtonGroup( TabPage, "groupBox6" );
|
||||
groupBox6->setColumnLayout(0, Qt::Vertical );
|
||||
groupBox6->layout()->setSpacing( 6 );
|
||||
groupBox6->layout()->setMargin( 11 );
|
||||
groupBox6Layout = new QGridLayout( groupBox6->layout() );
|
||||
groupBox6Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
m_useSearchEngineInternal = new QRadioButton( groupBox6, "m_useSearchEngineInternal" );
|
||||
|
||||
groupBox6Layout->addWidget( m_useSearchEngineInternal, 1, 0 );
|
||||
|
||||
m_labelUseSearchEngineInternal = new QLabel( groupBox6, "m_labelUseSearchEngineInternal" );
|
||||
m_labelUseSearchEngineInternal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 10, 0, m_labelUseSearchEngineInternal->sizePolicy().hasHeightForWidth() ) );
|
||||
m_labelUseSearchEngineInternal->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
|
||||
|
||||
groupBox6Layout->addWidget( m_labelUseSearchEngineInternal, 1, 1 );
|
||||
|
||||
m_useSearchEngineNew = new QRadioButton( groupBox6, "m_useSearchEngineNew" );
|
||||
|
||||
groupBox6Layout->addWidget( m_useSearchEngineNew, 0, 0 );
|
||||
|
||||
m_labelUseSearchEngineNew = new QLabel( groupBox6, "m_labelUseSearchEngineNew" );
|
||||
m_labelUseSearchEngineNew->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 10, 0, m_labelUseSearchEngineNew->sizePolicy().hasHeightForWidth() ) );
|
||||
m_labelUseSearchEngineNew->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
|
||||
|
||||
groupBox6Layout->addWidget( m_labelUseSearchEngineNew, 0, 1 );
|
||||
TabPageLayout->addWidget( groupBox6 );
|
||||
tabWidget->insertTab( TabPage, QString::fromLatin1("") );
|
||||
MyDialog1Layout->addWidget( tabWidget );
|
||||
|
||||
Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
|
||||
|
||||
buttonHelp = new QPushButton( this, "buttonHelp" );
|
||||
buttonHelp->setAutoDefault( TRUE );
|
||||
Layout1->addWidget( buttonHelp );
|
||||
Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||
Layout1->addItem( Horizontal_Spacing2 );
|
||||
|
||||
buttonOk = new QPushButton( this, "buttonOk" );
|
||||
buttonOk->setAutoDefault( TRUE );
|
||||
buttonOk->setDefault( TRUE );
|
||||
Layout1->addWidget( buttonOk );
|
||||
|
||||
buttonCancel = new QPushButton( this, "buttonCancel" );
|
||||
buttonCancel->setAutoDefault( TRUE );
|
||||
Layout1->addWidget( buttonCancel );
|
||||
MyDialog1Layout->addLayout( Layout1 );
|
||||
languageChange();
|
||||
resize( QSize(654, 343).expandedTo(minimumSizeHint()) );
|
||||
clearWState( WState_Polished );
|
||||
|
||||
// signals and slots connections
|
||||
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
|
||||
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
||||
connect( m_radioUseKHTMLPart, SIGNAL( toggled(bool) ), groupKhtmlSecurity, SLOT( setEnabled(bool) ) );
|
||||
connect( m_advViewSourceExternal, SIGNAL( toggled(bool) ), m_advExternalProgramName, SLOT( setEnabled(bool) ) );
|
||||
connect( m_radioUseQtextBrowser, SIGNAL( toggled(bool) ), groupKhtmlSecurity, SLOT( setDisabled(bool) ) );
|
||||
|
||||
// tab order
|
||||
setTabOrder( m_advViewSourceInternal, m_advViewSourceExternal );
|
||||
setTabOrder( m_advViewSourceExternal, m_useSearchEngineNew );
|
||||
setTabOrder( m_useSearchEngineNew, m_useSearchEngineInternal );
|
||||
setTabOrder( m_useSearchEngineInternal, tabWidget );
|
||||
setTabOrder( tabWidget, m_radioOnBeginOpenDialog );
|
||||
setTabOrder( m_radioOnBeginOpenDialog, m_radioOnBeginOpenLast );
|
||||
setTabOrder( m_radioOnBeginOpenLast, m_historySize );
|
||||
setTabOrder( m_historySize, m_rememberHistoryInfo );
|
||||
setTabOrder( m_rememberHistoryInfo, m_radioExtLinkOpenAlways );
|
||||
setTabOrder( m_radioExtLinkOpenAlways, m_radioExtLinkAsk );
|
||||
setTabOrder( m_radioExtLinkAsk, m_radioExtLinkOpenNever );
|
||||
setTabOrder( m_radioExtLinkOpenNever, m_radioNewChmOpenAlways );
|
||||
setTabOrder( m_radioNewChmOpenAlways, m_radioNewChmAsk );
|
||||
setTabOrder( m_radioNewChmAsk, m_radioNewChmOpenNever );
|
||||
setTabOrder( m_radioNewChmOpenNever, m_qtBrowserPath );
|
||||
setTabOrder( m_qtBrowserPath, m_radioUseQtextBrowser );
|
||||
setTabOrder( m_radioUseQtextBrowser, m_radioUseKHTMLPart );
|
||||
setTabOrder( m_radioUseKHTMLPart, m_enableJS );
|
||||
setTabOrder( m_enableJS, m_enablePlugins );
|
||||
setTabOrder( m_enablePlugins, m_enableJava );
|
||||
setTabOrder( m_enableJava, m_enableRefresh );
|
||||
setTabOrder( m_enableRefresh, m_advExternalProgramName );
|
||||
setTabOrder( m_advExternalProgramName, buttonHelp );
|
||||
setTabOrder( buttonHelp, buttonOk );
|
||||
setTabOrder( buttonOk, buttonCancel );
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
KCHMSetupDialog::~KCHMSetupDialog()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the strings of the subwidgets using the current
|
||||
* language.
|
||||
*/
|
||||
void KCHMSetupDialog::languageChange()
|
||||
{
|
||||
setCaption( tr( "KchmViewer settings" ) );
|
||||
buttonGroup1->setTitle( tr( "If no arguments given on load" ) );
|
||||
m_radioOnBeginOpenDialog->setText( tr( "Open the 'open CHM file' dialog" ) );
|
||||
m_radioOnBeginOpenLast->setText( tr( "Open the &last used CHM file, if exist" ) );
|
||||
m_radioOnBeginOpenLast->setAccel( QKeySequence( tr( "Alt+L" ) ) );
|
||||
buttonGroup2->setTitle( tr( "History" ) );
|
||||
textLabel1->setText( tr( "Store history information for" ) );
|
||||
m_historySize->setPrefix( QString::null );
|
||||
textLabel2->setText( tr( "latest files" ) );
|
||||
m_rememberHistoryInfo->setText( tr( "R&emember extra information for history files" ) );
|
||||
m_rememberHistoryInfo->setAccel( QKeySequence( tr( "Alt+E" ) ) );
|
||||
QToolTip::add( m_rememberHistoryInfo, tr( "Remembers the information about the files, which were opened. Remembers last opened page, search history, font size, bookmarks and so on." ) );
|
||||
groupBox1->setTitle( tr( "CHM security settings" ) );
|
||||
buttonGroup4->setTitle( tr( "When external link clicked" ) );
|
||||
m_radioExtLinkOpenAlways->setText( tr( "Alwa&ys open it in external browser" ) );
|
||||
m_radioExtLinkOpenAlways->setAccel( QKeySequence( tr( "Alt+Y" ) ) );
|
||||
m_radioExtLinkAsk->setText( tr( "Ask for confirmation" ) );
|
||||
m_radioExtLinkOpenNever->setText( tr( "Do not open the link" ) );
|
||||
m_radioExtLinkOpenNever->setAccel( QKeySequence( QString::null ) );
|
||||
buttonGroup5->setTitle( tr( "When link pointed to a new CHM file clicked" ) );
|
||||
m_radioNewChmOpenAlways->setText( tr( "Always open a new CHM file" ) );
|
||||
m_radioNewChmAsk->setText( tr( "Ask for confirmation" ) );
|
||||
m_radioNewChmOpenNever->setText( tr( "Do not open a new CHM file" ) );
|
||||
tabWidget->changeTab( Widget8, tr( "General behavior" ) );
|
||||
m_groupQtsettings->setTitle( tr( "Qt version settings" ) );
|
||||
textLabel1_2->setText( tr( "Enter the path to the program, which will be used as a browser for external links. A <i>%s</i> symbol will be replaced by the URL clicked." ) );
|
||||
m_groupKDEsettings->setTitle( tr( "KDE version settings" ) );
|
||||
buttonGroup5_2->setTitle( tr( "To show HTML content, use" ) );
|
||||
m_radioUseQtextBrowser->setText( tr( "&QTextBrowser-based widget" ) );
|
||||
m_radioUseQtextBrowser->setAccel( QKeySequence( tr( "Alt+Q" ) ) );
|
||||
m_radioUseKHTMLPart->setText( tr( "&KHTMLPart-based widget" ) );
|
||||
m_radioUseKHTMLPart->setAccel( QKeySequence( tr( "Alt+K" ) ) );
|
||||
groupKhtmlSecurity->setTitle( tr( "KHTMLPart security" ) );
|
||||
m_enableJS->setText( tr( "Enable Java&Script" ) );
|
||||
m_enableJS->setAccel( QKeySequence( tr( "Alt+S" ) ) );
|
||||
m_enablePlugins->setText( tr( "Enable &plugins" ) );
|
||||
m_enablePlugins->setAccel( QKeySequence( tr( "Alt+P" ) ) );
|
||||
m_enableJava->setText( tr( "Enable &Java" ) );
|
||||
m_enableJava->setAccel( QKeySequence( tr( "Alt+J" ) ) );
|
||||
m_enableRefresh->setText( tr( "Enable &refresh" ) );
|
||||
m_enableRefresh->setAccel( QKeySequence( tr( "Alt+R" ) ) );
|
||||
tabWidget->changeTab( Widget9, tr( "Version-specific settings" ) );
|
||||
buttonGroup7->setTitle( tr( "View HTML source command uses" ) );
|
||||
m_advViewSourceInternal->setText( tr( "Built-in HTML source viewer" ) );
|
||||
m_advViewSourceInternal->setAccel( QKeySequence( QString::null ) );
|
||||
m_advViewSourceExternal->setText( tr( "E&xternal program, specified below" ) );
|
||||
m_advViewSourceExternal->setAccel( QKeySequence( tr( "Alt+X" ) ) );
|
||||
textLabel1_3->setText( tr( "External program:" ) );
|
||||
groupBox6->setTitle( tr( "Search engine to use" ) );
|
||||
m_useSearchEngineInternal->setText( QString::null );
|
||||
m_labelUseSearchEngineInternal->setText( tr( "Use the search based on internal CHM index. This engine cannot search for any symbols except underscode, does not support multibyte languages, and is not always available." ) );
|
||||
m_useSearchEngineNew->setText( QString::null );
|
||||
m_labelUseSearchEngineNew->setText( tr( "Use new kchmviewer internal search engine (recommended). This engine indexes symbols, so it is possible to search for special symbols (like \"C++\"). All languages are supported. The index will be generated before the first search." ) );
|
||||
tabWidget->changeTab( TabPage, tr( "Advanced" ) );
|
||||
buttonHelp->setText( tr( "&Help" ) );
|
||||
buttonHelp->setAccel( QKeySequence( tr( "F1" ) ) );
|
||||
buttonOk->setText( tr( "&OK" ) );
|
||||
buttonOk->setAccel( QKeySequence( QString::null ) );
|
||||
buttonCancel->setText( tr( "&Cancel" ) );
|
||||
buttonCancel->setAccel( QKeySequence( QString::null ) );
|
||||
}
|
||||
|
||||
void KCHMSetupDialog::m_radioUseKHTMLPart_toggled(bool)
|
||||
{
|
||||
qWarning( "KCHMSetupDialog::m_radioUseKHTMLPart_toggled(bool): Not implemented yet" );
|
||||
}
|
||||
|
||||
#include "kchmsetupdialog.moc"
|
@ -0,0 +1,710 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>KCHMSetupDialog</class>
|
||||
<widget class="QDialog">
|
||||
<property name="name">
|
||||
<cstring>MyDialog1</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>654</width>
|
||||
<height>343</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>KchmViewer settings</string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>Minimum</enum>
|
||||
</property>
|
||||
<widget class="QTabWidget">
|
||||
<property name="name">
|
||||
<cstring>tabWidget</cstring>
|
||||
</property>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>Widget8</cstring>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>General behavior</string>
|
||||
</attribute>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>buttonGroup1</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>If no arguments given on load</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioOnBeginOpenDialog</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open the 'open CHM file' dialog</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioOnBeginOpenLast</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open the &last used CHM file, if exist</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+L</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>buttonGroup2</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>History</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout3</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel1</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Store history information for</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox">
|
||||
<property name="name">
|
||||
<cstring>m_historySize</cstring>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel2</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>latest files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>m_rememberHistoryInfo</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R&emember extra information for history files</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+E</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Remembers the information about the files, which were opened. Remembers last opened page, search history, font size, bookmarks and so on.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>groupBox1</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>CHM security settings</string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>buttonGroup4</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>When external link clicked</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioExtLinkOpenAlways</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alwa&ys open it in external browser</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+Y</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioExtLinkAsk</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ask for confirmation</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioExtLinkOpenNever</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Do not open the link</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>buttonGroup5</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>When link pointed to a new CHM file clicked</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioNewChmOpenAlways</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Always open a new CHM file</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioNewChmAsk</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ask for confirmation</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioNewChmOpenNever</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Do not open a new CHM file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>Widget9</cstring>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Version-specific settings</string>
|
||||
</attribute>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>m_groupQtsettings</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Qt version settings</string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel1_2</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enter the path to the program, which will be used as a browser for external links. A <i>%s</i> symbol will be replaced by the URL clicked.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>WordBreak|AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>m_qtBrowserPath</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>m_groupKDEsettings</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>KDE version settings</string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>buttonGroup5_2</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>To show HTML content, use</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioUseQtextBrowser</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&QTextBrowser-based widget</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+Q</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_radioUseKHTMLPart</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&KHTMLPart-based widget</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+K</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>groupKhtmlSecurity</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>KHTMLPart security</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QCheckBox" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>m_enableJS</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable Java&Script</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+S</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" row="0" column="1">
|
||||
<property name="name">
|
||||
<cstring>m_enablePlugins</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable &plugins</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+P</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>m_enableJava</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable &Java</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+J</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>m_enableRefresh</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable &refresh</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+R</string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>TabPage</cstring>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Advanced</string>
|
||||
</attribute>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>buttonGroup7</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>View HTML source command uses</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_advViewSourceInternal</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Built-in HTML source viewer</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>m_advViewSourceExternal</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>E&xternal program, specified below</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>Alt+X</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel1_3</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>External program:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>m_advExternalProgramName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="QButtonGroup">
|
||||
<property name="name">
|
||||
<cstring>groupBox6</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Search engine to use</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QRadioButton" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>m_useSearchEngineInternal</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>m_labelUseSearchEngineInternal</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use the search based on internal CHM index. This engine cannot search for any symbols except underscode, does not support multibyte languages, and is not always available.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>WordBreak|AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>m_useSearchEngineNew</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="0" column="1">
|
||||
<property name="name">
|
||||
<cstring>m_labelUseSearchEngineNew</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use new kchmviewer internal search engine (recommended). This engine indexes symbols, so it is possible to search for special symbols (like "C++"). All languages are supported. The index will be generated before the first search.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>WordBreak|AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>Layout1</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonHelp</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>F1</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>Horizontal Spacing2</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonOk</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonCancel</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonOk</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>MyDialog1</receiver>
|
||||
<slot>accept()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonCancel</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>MyDialog1</receiver>
|
||||
<slot>reject()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_radioUseKHTMLPart</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>groupKhtmlSecurity</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_advViewSourceExternal</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>m_advExternalProgramName</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>m_radioUseQtextBrowser</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>groupKhtmlSecurity</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<tabstops>
|
||||
<tabstop>m_advViewSourceInternal</tabstop>
|
||||
<tabstop>m_advViewSourceExternal</tabstop>
|
||||
<tabstop>m_useSearchEngineNew</tabstop>
|
||||
<tabstop>m_useSearchEngineInternal</tabstop>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>m_radioOnBeginOpenDialog</tabstop>
|
||||
<tabstop>m_radioOnBeginOpenLast</tabstop>
|
||||
<tabstop>m_historySize</tabstop>
|
||||
<tabstop>m_rememberHistoryInfo</tabstop>
|
||||
<tabstop>m_radioExtLinkOpenAlways</tabstop>
|
||||
<tabstop>m_radioExtLinkAsk</tabstop>
|
||||
<tabstop>m_radioExtLinkOpenNever</tabstop>
|
||||
<tabstop>m_radioNewChmOpenAlways</tabstop>
|
||||
<tabstop>m_radioNewChmAsk</tabstop>
|
||||
<tabstop>m_radioNewChmOpenNever</tabstop>
|
||||
<tabstop>m_qtBrowserPath</tabstop>
|
||||
<tabstop>m_radioUseQtextBrowser</tabstop>
|
||||
<tabstop>m_radioUseKHTMLPart</tabstop>
|
||||
<tabstop>m_enableJS</tabstop>
|
||||
<tabstop>m_enablePlugins</tabstop>
|
||||
<tabstop>m_enableJava</tabstop>
|
||||
<tabstop>m_enableRefresh</tabstop>
|
||||
<tabstop>m_advExternalProgramName</tabstop>
|
||||
<tabstop>buttonHelp</tabstop>
|
||||
<tabstop>buttonOk</tabstop>
|
||||
<tabstop>buttonCancel</tabstop>
|
||||
</tabstops>
|
||||
<slots>
|
||||
<slot>m_radioUseKHTMLPart_toggled( bool )</slot>
|
||||
</slots>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
@ -0,0 +1,94 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qcstring.h>
|
||||
#include <qimage.h>
|
||||
#include <qdir.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
#include "libchmurlfactory.h"
|
||||
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmsourcefactory.h"
|
||||
#include "kchmviewwindow_qtextbrowser.h"
|
||||
|
||||
|
||||
KCHMSourceFactory::KCHMSourceFactory (KCHMViewWindow * viewwindow)
|
||||
: QMimeSourceFactory()
|
||||
{
|
||||
m_viewWindow = viewwindow;
|
||||
}
|
||||
|
||||
|
||||
const QMimeSource * KCHMSourceFactory::data( const QString & abs_name ) const
|
||||
{
|
||||
QString data, file, path = abs_name;
|
||||
|
||||
// Retreive the data from chm file
|
||||
LCHMFile * chm = ::mainWindow->chmFile();
|
||||
|
||||
if ( !chm )
|
||||
return 0;
|
||||
|
||||
int pos = path.find ('#');
|
||||
if ( pos != -1 )
|
||||
path = path.left (pos);
|
||||
|
||||
// To handle a single-image pages, we need to generate the HTML page to show
|
||||
// this image. We did it in KCHMViewWindow::handleStartPageAsImage; now we need
|
||||
// to generate the HTML page, and set it.
|
||||
if ( LCHMUrlFactory::handleFileType( path, data ) )
|
||||
{
|
||||
((QMimeSourceFactory*)this)->setText (path, data);
|
||||
}
|
||||
else if ( path.endsWith (".htm") || path.endsWith (".html") )
|
||||
{
|
||||
if ( chm->getFileContentAsString( &data, path ) )
|
||||
((QMimeSourceFactory*)this)->setText (path, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
// treat as image
|
||||
QImage img;
|
||||
QByteArray buf;
|
||||
|
||||
QString fpath = KCHMViewWindow_QTextBrowser::decodeUrl( path );
|
||||
|
||||
if ( chm->getFileContentAsBinary( &buf, fpath ) )
|
||||
{
|
||||
if ( img.loadFromData ( (const uchar *) buf.data(), buf.size() ) )
|
||||
((QMimeSourceFactory*)this)->setImage (path, img);
|
||||
}
|
||||
else
|
||||
{
|
||||
((QMimeSourceFactory*)this)->setImage( path, img );
|
||||
qWarning( "Could not resolve file %s\n", path.ascii() );
|
||||
}
|
||||
}
|
||||
|
||||
return QMimeSourceFactory::data (path);
|
||||
}
|
||||
|
||||
QString KCHMSourceFactory::makeAbsolute ( const QString & abs_or_rel_name, const QString & ) const
|
||||
{
|
||||
return m_viewWindow->makeURLabsolute ( abs_or_rel_name, false );
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMSOURCEFACTORY_H
|
||||
#define KCHMSOURCEFACTORY_H
|
||||
|
||||
#include <qmime.h>
|
||||
#include "forwarddeclarations.h"
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMSourceFactory : public QMimeSourceFactory
|
||||
{
|
||||
public:
|
||||
KCHMSourceFactory (KCHMViewWindow * viewwindow);
|
||||
|
||||
virtual const QMimeSource * data ( const QString & abs_name ) const;
|
||||
virtual QString makeAbsolute ( const QString & abs_or_rel_name, const QString & context ) const;
|
||||
|
||||
private:
|
||||
KCHMViewWindow * m_viewWindow;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,286 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qstringlist.h>
|
||||
#include <qstyle.h>
|
||||
|
||||
#include "kchmtreeviewitem.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmdialogchooseurlfromlist.h"
|
||||
#include "iconstorage.h"
|
||||
|
||||
|
||||
KCHMIndTocItem::KCHMIndTocItem( QListViewItem * parent, QListViewItem * after, QString name, QString aurl, int image) : QListViewItem(parent, after, name), url(aurl), image_number(image)
|
||||
{
|
||||
}
|
||||
|
||||
KCHMIndTocItem::KCHMIndTocItem( QListView * parent, QListViewItem * after, QString name, QString aurl, int image) : QListViewItem(parent, after, name), url(aurl), image_number(image)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const QPixmap * KCHMIndTocItem::pixmap( int i ) const
|
||||
{
|
||||
int imagenum;
|
||||
|
||||
if ( i || image_number == LCHMBookIcons::IMAGE_NONE || image_number == LCHMBookIcons::IMAGE_INDEX )
|
||||
return 0;
|
||||
|
||||
if ( firstChild () )
|
||||
{
|
||||
if ( isOpen() )
|
||||
imagenum = (image_number == LCHMBookIcons::IMAGE_AUTO) ? 1 : image_number;
|
||||
else
|
||||
imagenum = (image_number == LCHMBookIcons::IMAGE_AUTO) ? 0 : image_number + 1;
|
||||
}
|
||||
else
|
||||
imagenum = (image_number == LCHMBookIcons::IMAGE_AUTO) ? 10 : image_number;
|
||||
|
||||
return ::mainWindow->chmFile()->getBookIconPixmap( imagenum );
|
||||
}
|
||||
|
||||
|
||||
QString KCHMIndTocItem::getUrl( ) const
|
||||
{
|
||||
if ( url.find ('|') == -1 )
|
||||
return url;
|
||||
|
||||
// Create a dialog with URLs, and show it, so user can select an URL he/she wants.
|
||||
QStringList urls = QStringList::split ('|', url);
|
||||
QStringList titles;
|
||||
LCHMFile * xchm = ::mainWindow->chmFile();
|
||||
|
||||
for ( unsigned int i = 0; i < urls.size(); i++ )
|
||||
{
|
||||
QString title = xchm->getTopicByUrl (urls[i]);
|
||||
|
||||
if ( !title )
|
||||
{
|
||||
qWarning ("Could not get item name for url '%s'", urls[i].ascii());
|
||||
titles.push_back(QString::null);
|
||||
}
|
||||
else
|
||||
titles.push_back(title);
|
||||
}
|
||||
|
||||
KCHMDialogChooseUrlFromList dlg (urls, titles, ::mainWindow);
|
||||
|
||||
if ( dlg.exec() == QDialog::Accepted )
|
||||
return dlg.getSelectedItemUrl();
|
||||
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
|
||||
void KCHMIndTocItem::paintBranches( QPainter * p, const QColorGroup & cg, int w, int y, int h )
|
||||
{
|
||||
if ( image_number != LCHMBookIcons::IMAGE_INDEX )
|
||||
QListViewItem::paintBranches(p, cg, w, y, h);
|
||||
else
|
||||
{
|
||||
// Too bad that listView()->paintEmptyArea( p, QRect( 0, 0, w, h ) ) is protected.
|
||||
// Taken from qt-x11-free-3.0.4/src/widgets/qlistview.cpp
|
||||
QStyleOption opt( 0, 0 );
|
||||
QStyle::SFlags how = QStyle::Style_Default | QStyle::Style_Enabled;
|
||||
|
||||
listView()->style().drawComplexControl( QStyle::CC_ListView,
|
||||
p, listView(), QRect( 0, 0, w, h ), cg,
|
||||
how, QStyle::SC_ListView, QStyle::SC_None,
|
||||
opt );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMIndTocItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
|
||||
{
|
||||
QColorGroup newcg ( cg );
|
||||
QColor c = newcg.text();
|
||||
|
||||
if ( url.find ('|') != -1 )
|
||||
newcg.setColor( QColorGroup::Text, Qt::red );
|
||||
else if ( url[0] == ':' )
|
||||
newcg.setColor( QColorGroup::Text, Qt::lightGray );
|
||||
else
|
||||
{
|
||||
QListViewItem::paintCell( p, cg, column, width, align );
|
||||
return;
|
||||
}
|
||||
|
||||
QListViewItem::paintCell( p, newcg, column, width, align );
|
||||
newcg.setColor( QColorGroup::Text, c );
|
||||
}
|
||||
|
||||
|
||||
void KCHMIndTocItem::setOpen( bool open )
|
||||
{
|
||||
if ( image_number != LCHMBookIcons::IMAGE_INDEX || open )
|
||||
QListViewItem::setOpen (open);
|
||||
}
|
||||
|
||||
void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMParsedEntry >& data, QMap<QString, KCHMIndTocItem*> * map )
|
||||
{
|
||||
QValueVector< KCHMIndTocItem *> lastchild;
|
||||
QValueVector< KCHMIndTocItem *> rootentry;
|
||||
|
||||
if ( map )
|
||||
map->clear();
|
||||
|
||||
list->clear();
|
||||
|
||||
for ( unsigned int i = 0; i < data.size(); i++ )
|
||||
{
|
||||
unsigned int indent = data[i].indent;
|
||||
|
||||
// Do we need to add another indent?
|
||||
if ( indent >= lastchild.size() )
|
||||
{
|
||||
lastchild.resize( indent + 1 );
|
||||
lastchild[indent] = 0;
|
||||
|
||||
rootentry.resize( indent + 1 );
|
||||
rootentry[indent] = 0;
|
||||
}
|
||||
|
||||
// Create the node
|
||||
KCHMIndTocItem * item;
|
||||
QString url = data[i].urls.join ("|");
|
||||
|
||||
if ( indent == 0 )
|
||||
item = new KCHMIndTocItem( list, lastchild[indent], data[i].name, url, data[i].imageid );
|
||||
else
|
||||
{
|
||||
// New non-root entry. It is possible (for some buggy CHMs) that there is no previous entry: previoous entry had indent 1,
|
||||
// and next entry has indent 3. Backtracking it up, creating missing entries.
|
||||
if ( rootentry[indent-1] == 0 )
|
||||
qFatal("Child entry indented as %d with no root entry!", indent);
|
||||
|
||||
item = new KCHMIndTocItem( rootentry[indent-1], lastchild[indent], data[i].name, url, data[i].imageid );
|
||||
}
|
||||
|
||||
// Hack: if map is 0, we have index, so make it open
|
||||
if ( map )
|
||||
{
|
||||
for ( unsigned int li = 0; li < data[i].urls.size(); li++ )
|
||||
map->insert( data[i].urls[li], item );
|
||||
}
|
||||
else
|
||||
item->setOpen( true );
|
||||
|
||||
lastchild[indent] = item;
|
||||
rootentry[indent] = item;
|
||||
}
|
||||
|
||||
list->triggerUpdate();
|
||||
/*
|
||||
KCHMMainTreeViewItem * item;
|
||||
|
||||
if ( !root_indent_offset_set )
|
||||
{
|
||||
root_indent_offset_set = true;
|
||||
root_indent_offset = indent;
|
||||
|
||||
if ( root_indent_offset > 1 )
|
||||
qWarning("CHM has improper index; root indent offset is %d", root_indent_offset);
|
||||
}
|
||||
|
||||
int real_indent = indent - root_indent_offset;
|
||||
QString url = urls.join ("|");
|
||||
|
||||
if ( real_indent == 0 )
|
||||
{
|
||||
// New root entry
|
||||
item = new KCHMMainTreeViewItem (tree, lastchild[real_indent], name, url, imagenum);
|
||||
DEBUGPARSER(("<root object>: '%s', new rootentry %08X\n", name.ascii(), item));
|
||||
}
|
||||
else
|
||||
{
|
||||
// New non-root entry
|
||||
if ( !rootentry[real_indent-1] )
|
||||
qFatal("CHMFile::ParseAndFillTopicsTree: child entry \"%s\" indented as %d with no root entry!", name.ascii(), real_indent);
|
||||
|
||||
item = new KCHMMainTreeViewItem (rootentry[real_indent-1], lastchild[real_indent], name, url, imagenum);
|
||||
DEBUGPARSER(("<object>: '%s', indent %d, rootentry %08X, item %08X\n", name.ascii(), real_indent, rootentry[real_indent-1], item));
|
||||
}
|
||||
|
||||
lastchild[real_indent] = item;
|
||||
rootentry[real_indent] = item;
|
||||
|
||||
if ( asIndex )
|
||||
rootentry[real_indent]->setOpen(true);
|
||||
|
||||
// There are no 'titles' in index file
|
||||
if ( add2treemap )
|
||||
{
|
||||
for ( unsigned int li = 0; li < urls.size(); li++ )
|
||||
m_treeUrlMap[urls[li]] = item;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !urls.isEmpty() )
|
||||
qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag with url \"%s\" is parsed, but name is empty.", urls[0].ascii());
|
||||
else
|
||||
qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty.");
|
||||
}
|
||||
|
||||
name = QString::null;
|
||||
urls.clear();
|
||||
in_object = false;
|
||||
imagenum = defaultimagenum;
|
||||
}
|
||||
}
|
||||
else if ( tagword == "ul" ) // increase indent level
|
||||
{
|
||||
// Fix for buggy help files
|
||||
if ( ++indent >= MAX_NEST_DEPTH )
|
||||
qFatal("CHMFile::ParseAndFillTopicsTree: max nest depth (%d) is reached, error in help file", MAX_NEST_DEPTH);
|
||||
|
||||
lastchild[indent] = 0;
|
||||
rootentry[indent] = 0;
|
||||
|
||||
// This intended to fix <ul><ul>, which was seen in some buggy chm files,
|
||||
// and brokes rootentry[indent-1] check
|
||||
int real_indent = indent - root_indent_offset;
|
||||
if ( real_indent > 1
|
||||
&& rootentry[real_indent - 1] == 0
|
||||
&& rootentry[real_indent - 2] != 0 )
|
||||
{
|
||||
rootentry[real_indent - 1] = rootentry[real_indent - 2];
|
||||
qWarning("Broken CHM index/content: tree autocorrection enabled.");
|
||||
}
|
||||
|
||||
DEBUGPARSER(("<ul>: new indent is %d, last rootentry was %08X\n", indent - root_indent_offset, rootentry[indent-1]));
|
||||
}
|
||||
else if ( tagword == "/ul" ) // decrease indent level
|
||||
{
|
||||
if ( --indent < root_indent_offset )
|
||||
indent = root_indent_offset;
|
||||
|
||||
rootentry[indent] = 0;
|
||||
DEBUGPARSER(("</ul>: new intent is %d\n", indent - root_indent_offset));
|
||||
}
|
||||
|
||||
pos = i;
|
||||
}
|
||||
|
||||
return true;
|
||||
*/
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CTREEVIEWITEM_H
|
||||
#define CTREEVIEWITEM_H
|
||||
|
||||
#include <qlistview.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
//! This is a list item used both in Index and Table Of Content trees
|
||||
class KCHMIndTocItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
KCHMIndTocItem( QListViewItem* parent, QListViewItem* after, QString name, QString aurl, int image);
|
||||
KCHMIndTocItem( QListView* parent, QListViewItem* after, QString name, QString url, int image);
|
||||
|
||||
QString getUrl() const;
|
||||
virtual void setOpen ( bool open );
|
||||
|
||||
private:
|
||||
virtual void paintBranches ( QPainter * p, const QColorGroup & cg, int w, int y, int h );
|
||||
virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align );
|
||||
virtual const QPixmap * pixmap( int i ) const;
|
||||
|
||||
QString url;
|
||||
int image_number;
|
||||
};
|
||||
|
||||
|
||||
class KCMSearchTreeViewItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
KCMSearchTreeViewItem (QListView* parent, QString name, QString loc, QString url)
|
||||
: QListViewItem (parent, name, loc)
|
||||
{
|
||||
this->url = url;
|
||||
}
|
||||
|
||||
QString getUrl() const { return url; }
|
||||
|
||||
private:
|
||||
QString url;
|
||||
};
|
||||
|
||||
|
||||
class KCHMSingleTreeViewItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
KCHMSingleTreeViewItem (QListView* parent, QString name, QString url)
|
||||
: QListViewItem (parent, name)
|
||||
{
|
||||
this->url = url;
|
||||
}
|
||||
|
||||
QString getUrl() const { return url; }
|
||||
|
||||
private:
|
||||
QString url;
|
||||
};
|
||||
|
||||
|
||||
class KCHMBookmarkTreeViewItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
KCHMBookmarkTreeViewItem (QListView* parent, QString n, QString u, int s)
|
||||
: QListViewItem (parent, n), url(u), name(n), scroll_y(s) { menuid = 0; }
|
||||
|
||||
QString url;
|
||||
QString name;
|
||||
int scroll_y;
|
||||
int menuid;
|
||||
};
|
||||
|
||||
|
||||
void kchmFillListViewWithParsedData( QListView * list, const QValueVector< LCHMParsedEntry >& data, QMap<QString, KCHMIndTocItem*> * map );
|
||||
|
||||
#endif
|
@ -0,0 +1,314 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
// Do not use tr() or i18n() in this file - this class is not derived from QObject.
|
||||
|
||||
#include <qregexp.h>
|
||||
#include <qstring.h>
|
||||
#include <qdir.h>
|
||||
|
||||
#include "libchmfile.h"
|
||||
#include "libchmurlfactory.h"
|
||||
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindowmgr.h"
|
||||
#include "kchmnavtoolbar.h"
|
||||
|
||||
|
||||
KCHMViewWindow::KCHMViewWindow( QTabWidget * parent )
|
||||
{
|
||||
invalidate();
|
||||
m_contextMenu = 0;
|
||||
m_contextMenuLink = 0;
|
||||
m_historyMaxSize = 25;
|
||||
|
||||
m_parentTabWidget = parent;
|
||||
}
|
||||
|
||||
KCHMViewWindow::~KCHMViewWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void KCHMViewWindow::invalidate( )
|
||||
{
|
||||
m_base_url = "/";
|
||||
m_openedPage = QString::null;
|
||||
m_newTabLinkKeeper = QString::null;
|
||||
|
||||
m_historyCurrentPos = 0;
|
||||
m_history.clear();
|
||||
|
||||
updateNavigationToolbar();
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString KCHMViewWindow::makeURLabsolute ( const QString & url, bool set_as_base )
|
||||
{
|
||||
QString p1, p2, newurl = url;
|
||||
|
||||
if ( !LCHMUrlFactory::isRemoteURL (url, p1)
|
||||
&& !LCHMUrlFactory::isJavascriptURL (url)
|
||||
&& !LCHMUrlFactory::isNewChmURL (url, p1, p2) )
|
||||
{
|
||||
newurl = QDir::cleanDirPath (url);
|
||||
|
||||
// Normalize url, so it becomes absolute
|
||||
if ( newurl[0] != '/' )
|
||||
newurl = m_base_url + "/" + newurl;
|
||||
|
||||
newurl = QDir::cleanDirPath (newurl);
|
||||
|
||||
if ( set_as_base )
|
||||
{
|
||||
m_base_url = newurl;
|
||||
|
||||
// and set up new baseurl
|
||||
int i = newurl.findRev('/');
|
||||
if ( i != -1 )
|
||||
m_base_url = QDir::cleanDirPath (newurl.left (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
//qDebug ("KCHMViewWindow::makeURLabsolute (%s) -> (%s)", url.ascii(), newurl.ascii());
|
||||
return newurl;
|
||||
}
|
||||
|
||||
bool KCHMViewWindow::openUrl ( const QString& origurl )
|
||||
{
|
||||
QString chmfile, page, newurl = origurl;
|
||||
|
||||
if ( !origurl )
|
||||
return true;
|
||||
|
||||
// URL could be a complete ms-its link. The file should be already loaded (for QTextBrowser),
|
||||
// or will be loaded (for kio slave). We care only about the path component.
|
||||
if ( LCHMUrlFactory::isNewChmURL( newurl, chmfile, page ) )
|
||||
{
|
||||
// If a new chm file is opened here, and we do not use KCHMLPart, we better abort
|
||||
if ( chmfile != ::mainWindow->getOpenedFileName() && appConfig.m_kdeUseQTextBrowser )
|
||||
qFatal("KCHMViewWindow::openUrl(): opened new chm file %s while current is %s",
|
||||
chmfile.ascii(), ::mainWindow->getOpenedFileName().ascii() );
|
||||
|
||||
// It is OK to have a new file in chm for KHTMLPart
|
||||
newurl = page;
|
||||
}
|
||||
|
||||
makeURLabsolute (newurl);
|
||||
handleStartPageAsImage( newurl );
|
||||
|
||||
if ( openPage (newurl) )
|
||||
{
|
||||
m_newTabLinkKeeper = QString::null;
|
||||
m_openedPage = newurl;
|
||||
|
||||
mainWindow->viewWindowMgr()->setTabName( this );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void KCHMViewWindow::handleStartPageAsImage( QString & link )
|
||||
{
|
||||
// Handle pics
|
||||
if ( link.endsWith( ".jpg", false )
|
||||
|| link.endsWith( ".jpeg", false )
|
||||
|| link.endsWith( ".gif", false )
|
||||
|| link.endsWith( ".png", false )
|
||||
|| link.endsWith( ".bmp", false ) )
|
||||
link += LCHMUrlFactory::getInternalUriExtension();
|
||||
}
|
||||
|
||||
|
||||
KQPopupMenu * KCHMViewWindow::createStandardContextMenu( QWidget * parent )
|
||||
{
|
||||
KQPopupMenu * contextMenu = new KQPopupMenu( parent );
|
||||
|
||||
contextMenu->insertItem ( "&Copy", ::mainWindow, SLOT(slotBrowserCopy()) );
|
||||
contextMenu->insertItem ( "&Select all", ::mainWindow, SLOT(slotBrowserSelectAll()) );
|
||||
|
||||
return contextMenu;
|
||||
}
|
||||
|
||||
|
||||
KQPopupMenu * KCHMViewWindow::getContextMenu( const QString & link, QWidget * parent )
|
||||
{
|
||||
if ( link.isNull() )
|
||||
{
|
||||
// standard context menu
|
||||
if ( !m_contextMenu )
|
||||
m_contextMenu = createStandardContextMenu( parent );
|
||||
|
||||
return m_contextMenu;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Open in New Tab context menu
|
||||
// standard context menu
|
||||
if ( !m_contextMenuLink )
|
||||
{
|
||||
m_contextMenuLink = createStandardContextMenu( parent );
|
||||
m_contextMenuLink->insertSeparator();
|
||||
|
||||
m_contextMenuLink->insertItem ( "&Open this link in a new tab", ::mainWindow, SLOT(slotOpenPageInNewTab()), QKeySequence("Shift+Enter") );
|
||||
|
||||
m_contextMenuLink->insertItem ( "&Open this link in a new background tab", ::mainWindow, SLOT(slotOpenPageInNewBackgroundTab()), QKeySequence("Ctrl+Enter") );
|
||||
}
|
||||
|
||||
setTabKeeper( link );
|
||||
return m_contextMenuLink;
|
||||
}
|
||||
}
|
||||
|
||||
QString KCHMViewWindow::getTitle() const
|
||||
{
|
||||
QString title = ::mainWindow->chmFile()->getTopicByUrl( m_openedPage );
|
||||
|
||||
if ( title.isEmpty() )
|
||||
title = m_openedPage;
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindow::navigateForward()
|
||||
{
|
||||
if ( m_historyCurrentPos < m_history.size() )
|
||||
{
|
||||
m_historyCurrentPos++;
|
||||
::mainWindow->openPage( m_history[m_historyCurrentPos].getUrl() );
|
||||
setScrollbarPosition( m_history[m_historyCurrentPos].getScrollPosition() );
|
||||
|
||||
// By default navigation starts with empty array, and a new entry is added when
|
||||
// you change the current page (or it may not be added). So to have the whole system
|
||||
// worked, the m_historyCurrentPos should never be m_history.size() - 1, it should be
|
||||
// either greater or lesser.
|
||||
//
|
||||
// This is a dirty hack - but the whole navigation system now looks to me like
|
||||
// it was written by some drunk monkey - which is probably not far from The Real Truth.
|
||||
// Shame on me - Tim.
|
||||
if ( m_historyCurrentPos == (m_history.size() - 1) )
|
||||
m_historyCurrentPos++;
|
||||
}
|
||||
|
||||
updateNavigationToolbar();
|
||||
}
|
||||
|
||||
void KCHMViewWindow::navigateBack( )
|
||||
{
|
||||
if ( m_historyCurrentPos > 0 )
|
||||
{
|
||||
// If we're on top of list, and pressing Back, the last page is still
|
||||
// not in list - so add it, if it is not still here
|
||||
if ( m_historyCurrentPos == m_history.size() )
|
||||
{
|
||||
if ( m_history[m_historyCurrentPos-1].getUrl() != m_openedPage )
|
||||
m_history.push_back( KCHMUrlHistory( m_openedPage, getScrollbarPosition() ) );
|
||||
else
|
||||
{
|
||||
// part 2 of the navigation hack - see navigateForward() comment
|
||||
m_history[m_historyCurrentPos-1].setScrollPosition( getScrollbarPosition() );
|
||||
m_historyCurrentPos--;
|
||||
}
|
||||
}
|
||||
|
||||
m_historyCurrentPos--;
|
||||
|
||||
::mainWindow->openPage( m_history[m_historyCurrentPos].getUrl() );
|
||||
setScrollbarPosition( m_history[m_historyCurrentPos].getScrollPosition() );
|
||||
}
|
||||
|
||||
updateNavigationToolbar();
|
||||
}
|
||||
|
||||
void KCHMViewWindow::navigateHome( )
|
||||
{
|
||||
::mainWindow->openPage( ::mainWindow->chmFile()->homeUrl() );
|
||||
}
|
||||
|
||||
void KCHMViewWindow::addNavigationHistory( const QString & url, int scrollpos )
|
||||
{
|
||||
// shred the 'forward' history
|
||||
if ( m_historyCurrentPos < m_history.size() )
|
||||
m_history.erase( m_history.at( m_historyCurrentPos ), m_history.end());
|
||||
|
||||
// do not grow the history if already max size
|
||||
if ( m_history.size() >= m_historyMaxSize )
|
||||
m_history.pop_front();
|
||||
|
||||
m_history.push_back( KCHMUrlHistory( url, scrollpos ) );
|
||||
m_historyCurrentPos = m_history.size();
|
||||
|
||||
updateNavigationToolbar();
|
||||
}
|
||||
|
||||
void KCHMViewWindow::updateNavigationToolbar( )
|
||||
{
|
||||
// Dump navigation for debugging
|
||||
#if 0
|
||||
qDebug("\nNavigation dump (%d entries, current pos %d)", m_history.size(), m_historyCurrentPos );
|
||||
for ( unsigned int i = 0; i < m_history.size(); i++ )
|
||||
qDebug("[%02d]: %s [%d]", i, m_history[i].getUrl().ascii(), m_history[i].getScrollPosition());
|
||||
#endif
|
||||
|
||||
if ( mainWindow )
|
||||
{
|
||||
mainWindow->navigationToolbar()->updateIconStatus(
|
||||
m_historyCurrentPos > 0,
|
||||
m_historyCurrentPos < (m_history.size() - 1) );
|
||||
}
|
||||
}
|
||||
|
||||
KQPopupMenu * KCHMViewWindow::createListItemContextMenu( QWidget * w )
|
||||
{
|
||||
KQPopupMenu * contextMenu = new KQPopupMenu( w );
|
||||
|
||||
contextMenu->insertItem ( "&Open this link in a new tab",
|
||||
::mainWindow,
|
||||
SLOT( slotOpenPageInNewTab() ),
|
||||
QKeySequence( "Shift+Enter" ) );
|
||||
|
||||
contextMenu->insertItem ( "&Open this link in a new background tab",
|
||||
::mainWindow,
|
||||
SLOT( slotOpenPageInNewBackgroundTab() ),
|
||||
QKeySequence( "Ctrl+Enter" ) );
|
||||
|
||||
return contextMenu;
|
||||
}
|
||||
|
||||
void KCHMViewWindow::setTabKeeper( const QString & link )
|
||||
{
|
||||
// If we clicked on relative link, make sure we convert it to absolute right now,
|
||||
// because later we will not have access to this view window variables
|
||||
m_newTabLinkKeeper = link;
|
||||
if ( m_newTabLinkKeeper[0] == '#' && !m_openedPage.isEmpty() )
|
||||
{
|
||||
// Clean up opened page URL
|
||||
int pos = m_openedPage.find ('#');
|
||||
QString fixedpath = pos == -1 ? m_openedPage : m_openedPage.left (pos);
|
||||
m_newTabLinkKeeper = fixedpath + m_newTabLinkKeeper;
|
||||
}
|
||||
|
||||
m_newTabLinkKeeper = makeURLabsolute( m_newTabLinkKeeper, false );
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMVIEWWINDOW_H
|
||||
#define KCHMVIEWWINDOW_H
|
||||
|
||||
#include "forwarddeclarations.h"
|
||||
#include "kde-qt.h"
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMViewWindow
|
||||
{
|
||||
public:
|
||||
KCHMViewWindow ( QTabWidget * parent );
|
||||
virtual ~KCHMViewWindow();
|
||||
|
||||
//! Open a page from current chm archive
|
||||
bool openUrl (const QString& url );
|
||||
|
||||
QString getBaseUrl() const { return m_base_url; }
|
||||
QString getOpenedPage() const { return m_openedPage; }
|
||||
QString getNewTabLink() const { return m_newTabLinkKeeper; }
|
||||
QString makeURLabsolute ( const QString &url, bool set_as_base = true );
|
||||
|
||||
public:
|
||||
// virtual members, which should be implemented by viewers
|
||||
//! Invalidate current view, doing all the cleanups etc.
|
||||
virtual void invalidate();
|
||||
|
||||
//! Popups the print dialog, and prints the current page on the printer.
|
||||
virtual bool printCurrentPage() = 0;
|
||||
|
||||
//! Continues the find-in-page search forward or backward
|
||||
virtual void searchWord( const QString & word, bool forward = true, bool casesensitive = false ) = 0;
|
||||
|
||||
//! Return current ZoomFactor.
|
||||
virtual int getZoomFactor() const = 0;
|
||||
|
||||
//! Sets ZoomFactor. The value returned by getZoomFactor(), given to this function, should give the same result.
|
||||
virtual void setZoomFactor (int zoom) = 0;
|
||||
|
||||
//! Relatively changes ZoomFactor. Most common values are -1 and 1.
|
||||
virtual void addZoomFactor (int value) = 0;
|
||||
|
||||
virtual QObject * getQObject() = 0;
|
||||
virtual QWidget * getQWidget() = 0;
|
||||
|
||||
/*!
|
||||
* Return current scrollbar position in view window. Saved on program exit.
|
||||
* There is no restriction on returned value, except that giving this value to
|
||||
* setScrollbarPosition() should move the scrollbar in the same position.
|
||||
*/
|
||||
virtual int getScrollbarPosition() = 0;
|
||||
|
||||
//! Sets the scrollbar position.
|
||||
virtual void setScrollbarPosition(int pos) = 0;
|
||||
|
||||
//! Select the content of the whole page
|
||||
virtual void clipSelectAll() = 0;
|
||||
|
||||
//! Copies the selected content to the clipboard
|
||||
virtual void clipCopy() = 0;
|
||||
|
||||
//! Returns the window title
|
||||
virtual QString getTitle() const;
|
||||
|
||||
//! Navigation stuff
|
||||
virtual void navigateBack();
|
||||
virtual void navigateHome();
|
||||
virtual void navigateForward();
|
||||
|
||||
//! Navigation auxiliary stuff
|
||||
virtual void setHistoryMaxSize (unsigned int size) { m_historyMaxSize = size; }
|
||||
virtual void addNavigationHistory( const QString & url, int scrollpos );
|
||||
virtual void updateNavigationToolbar();
|
||||
|
||||
/*!
|
||||
* Used by contents window (and probably by other windows in future) to show
|
||||
* context menu in listviews. Put here to futher reuse code in index and search windows.
|
||||
*/
|
||||
KQPopupMenu * createListItemContextMenu ( QWidget * w );
|
||||
void setTabKeeper ( const QString& link );
|
||||
|
||||
|
||||
protected: /* signals */
|
||||
/*!
|
||||
* Emitted when the user clicked on the link, before the page changed.
|
||||
* If linkClicked() return false, the current page should NOT change.
|
||||
* Otherwise it should be changed to the new link value.
|
||||
*/
|
||||
virtual void signalLinkClicked ( const QString & newlink, bool& follow_link ) = 0;
|
||||
|
||||
protected:
|
||||
virtual bool openPage ( const QString& url ) = 0;
|
||||
virtual void handleStartPageAsImage( QString& link );
|
||||
|
||||
KQPopupMenu * getContextMenu( const QString& link, QWidget * parent );
|
||||
KQPopupMenu * createStandardContextMenu( QWidget * parent );
|
||||
|
||||
//! History
|
||||
class KCHMUrlHistory
|
||||
{
|
||||
public:
|
||||
KCHMUrlHistory() { scrollbarpos = 0; }
|
||||
KCHMUrlHistory( const QString& _url, int _scrollbarpos )
|
||||
: url(_url), scrollbarpos(_scrollbarpos) {};
|
||||
|
||||
const QString& getUrl() const { return url; }
|
||||
int getScrollPosition() const { return scrollbarpos; }
|
||||
void setScrollPosition( int pos ) { scrollbarpos = pos; }
|
||||
|
||||
private:
|
||||
QString url;
|
||||
int scrollbarpos;
|
||||
};
|
||||
|
||||
unsigned int m_historyMaxSize;
|
||||
unsigned int m_historyCurrentPos;
|
||||
|
||||
QValueList<KCHMUrlHistory> m_history;
|
||||
|
||||
KQPopupMenu * m_contextMenu;
|
||||
KQPopupMenu * m_contextMenuLink;
|
||||
|
||||
// This member keeps a "open new tab" link between getContextMenu() call and appropriate
|
||||
// slot call
|
||||
QString m_newTabLinkKeeper;
|
||||
|
||||
QString m_openedPage;
|
||||
QString m_lastOpenedPage;
|
||||
QString m_base_url;
|
||||
|
||||
QTabWidget * m_parentTabWidget;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,270 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qprinter.h>
|
||||
#include <qpainter.h>
|
||||
#include <qsimplerichtext.h>
|
||||
#include <qpaintdevicemetrics.h>
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindow_qtextbrowser.h"
|
||||
|
||||
/*
|
||||
* If defined, all the data viewed is kept in source factory. It increases the response time
|
||||
* when a user opens the page he has already seen, in cost of everything which has been opened
|
||||
* is stored in memory, increasing memory usage.
|
||||
*
|
||||
* If not defined, on any page change the source factory cleans up, saving the memory, but
|
||||
* increasing the page loading time in case the page has the same images, or the page is opened
|
||||
* second time.
|
||||
*/
|
||||
#define KEEP_ALL_OPENED_DATA_IN_SOURCE_FACTORY
|
||||
|
||||
KCHMViewWindow_QTextBrowser::KCHMViewWindow_QTextBrowser( QTabWidget * parent )
|
||||
: QTextBrowser ( parent ), KCHMViewWindow ( parent )
|
||||
{
|
||||
m_zoomfactor = 0;
|
||||
m_sourcefactory = 0;
|
||||
invalidate();
|
||||
|
||||
setTextFormat ( Qt::RichText );
|
||||
connect( this, SIGNAL( linkClicked (const QString &) ), this, SLOT( slotLinkClicked(const QString &) ) );
|
||||
}
|
||||
|
||||
|
||||
KCHMViewWindow_QTextBrowser::~KCHMViewWindow_QTextBrowser()
|
||||
{
|
||||
delete m_sourcefactory;
|
||||
}
|
||||
|
||||
bool KCHMViewWindow_QTextBrowser::openPage (const QString& url)
|
||||
{
|
||||
// If we're using a memory saving scheme, we destroy MimeSourceFactory (including all the stored data)
|
||||
// when opening a new page. It saves some memory, but spends more time while looking for already loaded
|
||||
// images and HTML pages
|
||||
#if !defined (KEEP_ALL_OPENED_DATA_IN_SOURCE_FACTORY)
|
||||
delete m_sourcefactory;
|
||||
m_sourcefactory = new KCHMSourceFactory;
|
||||
setMimeSourceFactory (m_sourcefactory);
|
||||
#endif
|
||||
|
||||
setSource (url);
|
||||
return true;
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::setSource ( const QString & name )
|
||||
{
|
||||
if ( m_allowSourceChange )
|
||||
{
|
||||
// Do URI decoding, qtextbrowser does stupid job.
|
||||
QString fixedname = decodeUrl( name );
|
||||
QTextBrowser::setSource (fixedname);
|
||||
}
|
||||
else
|
||||
m_allowSourceChange = true;
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::setZoomFactor( int zoom )
|
||||
{
|
||||
m_zoomfactor = zoom;
|
||||
|
||||
if ( zoom < 0 )
|
||||
QTextBrowser::zoomOut( -zoom );
|
||||
else if ( zoom > 0 )
|
||||
QTextBrowser::zoomIn( zoom);
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::invalidate( )
|
||||
{
|
||||
delete m_sourcefactory;
|
||||
m_sourcefactory = new KCHMSourceFactory (this);
|
||||
setMimeSourceFactory (m_sourcefactory);
|
||||
m_zoomfactor = 0;
|
||||
m_allowSourceChange = true;
|
||||
m_searchLastIndex = 0;
|
||||
m_searchLastParagraph = 0;
|
||||
m_searchText = QString::null;
|
||||
reload();
|
||||
|
||||
KCHMViewWindow::invalidate( );
|
||||
}
|
||||
|
||||
int KCHMViewWindow_QTextBrowser::getScrollbarPosition( )
|
||||
{
|
||||
return contentsY ();
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::setScrollbarPosition( int pos )
|
||||
{
|
||||
setContentsPos (0, pos);
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::addZoomFactor( int value )
|
||||
{
|
||||
setZoomFactor( value);
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::slotLinkClicked( const QString & newlink )
|
||||
{
|
||||
emit signalLinkClicked (newlink, m_allowSourceChange);
|
||||
}
|
||||
|
||||
|
||||
bool KCHMViewWindow_QTextBrowser::printCurrentPage( )
|
||||
{
|
||||
#if !defined (QT_NO_PRINTER)
|
||||
QPrinter printer( QPrinter::HighResolution );
|
||||
printer.setFullPage(TRUE);
|
||||
|
||||
if ( printer.setup( this ) )
|
||||
{
|
||||
QPainter p( &printer );
|
||||
|
||||
if( !p.isActive() ) // starting printing failed
|
||||
return false;
|
||||
|
||||
QPaintDeviceMetrics metrics(p.device());
|
||||
int dpiy = metrics.logicalDpiY();
|
||||
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
|
||||
QRect body( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
|
||||
QSimpleRichText richText( text(),
|
||||
QFont(),
|
||||
context(),
|
||||
styleSheet(),
|
||||
mimeSourceFactory(),
|
||||
body.height() );
|
||||
richText.setWidth( &p, body.width() );
|
||||
QRect view( body );
|
||||
|
||||
int page = 1;
|
||||
|
||||
do
|
||||
{
|
||||
richText.draw( &p, body.left(), body.top(), view, colorGroup() );
|
||||
view.moveBy( 0, body.height() );
|
||||
p.translate( 0 , -body.height() );
|
||||
p.drawText( view.right() - p.fontMetrics().width( QString::number(page) ),
|
||||
view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page) );
|
||||
|
||||
if ( view.top() >= richText.height() )
|
||||
break;
|
||||
|
||||
QString msg = i18n( "Printing (page %1)...") .arg(page);
|
||||
::mainWindow->showInStatusBar( msg );
|
||||
|
||||
printer.newPage();
|
||||
page++;
|
||||
}
|
||||
while (TRUE);
|
||||
|
||||
::mainWindow->showInStatusBar( i18n( "Printing completed") );
|
||||
return true;
|
||||
}
|
||||
|
||||
::mainWindow->showInStatusBar( i18n( "Printing aborted") );
|
||||
return false;
|
||||
|
||||
#else /* QT_NO_PRINTER */
|
||||
|
||||
QMessageBox::warning( this,
|
||||
i18n( "%1 - could not print") . arg(APP_NAME),
|
||||
i18n( "Could not print.\nYour Qt library has been compiled without printing support");
|
||||
return false;
|
||||
|
||||
#endif /* QT_NO_PRINTER */
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::searchWord( const QString & word, bool forward, bool )
|
||||
{
|
||||
if ( m_searchText == word )
|
||||
{
|
||||
if ( forward && (m_searchLastIndex || m_searchLastParagraph) )
|
||||
m_searchLastIndex += m_searchText.length();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_searchLastParagraph = m_searchLastIndex = 0;
|
||||
m_searchText = word;
|
||||
}
|
||||
|
||||
if ( find (m_searchText, false, false, forward, &m_searchLastParagraph, &m_searchLastIndex) )
|
||||
::mainWindow->showInStatusBar( i18n( "Search failed") );
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::clipSelectAll( )
|
||||
{
|
||||
selectAll (TRUE);
|
||||
}
|
||||
|
||||
void KCHMViewWindow_QTextBrowser::clipCopy( )
|
||||
{
|
||||
copy ();
|
||||
}
|
||||
|
||||
|
||||
// Shamelessly stolen from Qt
|
||||
QString KCHMViewWindow_QTextBrowser::decodeUrl( const QString &input )
|
||||
{
|
||||
QString temp;
|
||||
|
||||
int i = 0;
|
||||
int len = input.length();
|
||||
int a, b;
|
||||
QChar c;
|
||||
while (i < len)
|
||||
{
|
||||
c = input[i];
|
||||
if (c == '%' && i + 2 < len)
|
||||
{
|
||||
a = input[++i];
|
||||
b = input[++i];
|
||||
|
||||
if (a >= '0' && a <= '9') a -= '0';
|
||||
else if (a >= 'a' && a <= 'f') a = a - 'a' + 10;
|
||||
else if (a >= 'A' && a <= 'F') a = a - 'A' + 10;
|
||||
|
||||
if (b >= '0' && b <= '9') b -= '0';
|
||||
else if (b >= 'a' && b <= 'f') b = b - 'a' + 10;
|
||||
else if (b >= 'A' && b <= 'F') b = b - 'A' + 10;
|
||||
|
||||
temp.append( (QChar)((a << 4) | b ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
temp.append( c );
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
QPopupMenu * KCHMViewWindow_QTextBrowser::createPopupMenu( const QPoint & pos )
|
||||
{
|
||||
KQPopupMenu * menu = getContextMenu( anchorAt( pos ), this );
|
||||
menu->exec( mapToGlobal( contentsToViewport( pos ) ) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "kchmviewwindow_qtextbrowser.moc"
|
@ -0,0 +1,107 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMVIEWWINDOW_QTEXTBROWSER_H
|
||||
#define KCHMVIEWWINDOW_QTEXTBROWSER_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmsourcefactory.h"
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
class KCHMViewWindow_QTextBrowser : public QTextBrowser, public KCHMViewWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMViewWindow_QTextBrowser( QTabWidget * parent );
|
||||
~KCHMViewWindow_QTextBrowser();
|
||||
|
||||
//! Open a page from current chm archive
|
||||
virtual bool openPage (const QString& url);
|
||||
|
||||
//! Invalidate current view, doing all the cleanups etc.
|
||||
virtual void invalidate();
|
||||
|
||||
//! Return current ZoomFactor.
|
||||
virtual int getZoomFactor() const { return m_zoomfactor; }
|
||||
|
||||
//! Sets ZoomFactor. The value returned by getZoomFactor(), given to this function, should give the same result.
|
||||
virtual void setZoomFactor (int zoom);
|
||||
|
||||
//! Relatively changes ZoomFactor. Most common values are -1 and 1.
|
||||
virtual void addZoomFactor (int value);
|
||||
|
||||
//! Popups the print dialog, and prints the current page on the printer.
|
||||
virtual bool printCurrentPage();
|
||||
|
||||
//! Initiates the find-in-page search, if succeed, cursor moved to the first entry
|
||||
virtual void searchWord( const QString & word, bool forward = true, bool casesensitive = false );
|
||||
|
||||
//! Select the content of the whole page
|
||||
virtual void clipSelectAll();
|
||||
|
||||
//! Copies the selected content to the clipboard
|
||||
virtual void clipCopy();
|
||||
|
||||
/*!
|
||||
* Return current scrollbar position in view window. Saved on program exit.
|
||||
* There is no restriction on returned value, except that giving this value to
|
||||
* setScrollbarPosition() should move the scrollbar in the same position.
|
||||
*/
|
||||
virtual int getScrollbarPosition();
|
||||
|
||||
//! Sets the scrollbar position.
|
||||
virtual void setScrollbarPosition(int pos);
|
||||
|
||||
virtual QObject * getQObject() { return this; }
|
||||
virtual QWidget * getQWidget() { return this; }
|
||||
|
||||
static QString decodeUrl( const QString &url );
|
||||
|
||||
signals:
|
||||
/*!
|
||||
* Emitted when the user clicked on the link, before the page changed.
|
||||
* If signalLinkClicked() sets follow_link to false, the current page should NOT change.
|
||||
* Otherwise it should be changed to the new link value.
|
||||
*/
|
||||
void signalLinkClicked ( const QString & newlink, bool& follow_link );
|
||||
|
||||
private slots:
|
||||
virtual void slotLinkClicked (const QString & newlink);
|
||||
|
||||
private:
|
||||
QPopupMenu * createPopupMenu ( const QPoint & pos );
|
||||
void setSource ( const QString & name );
|
||||
|
||||
int m_zoomfactor;
|
||||
bool m_allowSourceChange;
|
||||
int m_searchLastIndex;
|
||||
int m_searchLastParagraph;
|
||||
QString m_searchText;
|
||||
|
||||
KCHMSourceFactory * m_sourcefactory;
|
||||
};
|
||||
|
||||
|
||||
#endif /* KCHMVIEWWINDOW_QTEXTBROWSER_H */
|
@ -0,0 +1,344 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qaccel.h>
|
||||
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmviewwindowmgr.h"
|
||||
#include "iconstorage.h"
|
||||
|
||||
#include "kchmviewwindow_qtextbrowser.h"
|
||||
|
||||
#if defined (USE_KDE)
|
||||
#include "kde/kchmviewwindow_khtmlpart.h"
|
||||
#endif
|
||||
|
||||
|
||||
KCHMViewWindowMgr::KCHMViewWindowMgr( QWidget *parent )
|
||||
: QTabWidget( parent ) //QTabWidget
|
||||
{
|
||||
m_MenuWindow = 0;
|
||||
|
||||
// on current tab changed
|
||||
connect( this, SIGNAL( currentChanged(QWidget *) ), this, SLOT( onTabChanged(QWidget *) ) );
|
||||
|
||||
// Create an iconset for the button
|
||||
QIconSet iset( *gIconStorage.getCloseWindowIcon() );
|
||||
|
||||
// Create a pushbutton
|
||||
m_closeButton = new QPushButton( iset, QString::null, this );
|
||||
m_closeButton->setFlat( true );
|
||||
m_closeButton->setEnabled( false );
|
||||
connect( m_closeButton, SIGNAL( clicked() ), this, SLOT( closeCurrentWindow() ) );
|
||||
|
||||
setCornerWidget( m_closeButton, TopRight);
|
||||
}
|
||||
|
||||
KCHMViewWindowMgr::~KCHMViewWindowMgr( )
|
||||
{
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::createMenu( KCHMMainWindow * parent )
|
||||
{
|
||||
// Create the approptiate menu entries in 'View' main menu
|
||||
m_MenuWindow = new KQPopupMenu( parent );
|
||||
parent->menuBar()->insertItem( i18n( "&Window"), m_MenuWindow );
|
||||
|
||||
m_menuIdClose = m_MenuWindow->insertItem( i18n( "&Close"), this, SLOT( closeCurrentWindow()), CTRL+Key_W );
|
||||
m_MenuWindow->insertSeparator();
|
||||
|
||||
//connect( m_MenuWindow, SIGNAL( activated(int) ), this, SLOT ( onCloseWindow(int) ));
|
||||
connect( m_MenuWindow, SIGNAL( activated(int) ), this, SLOT ( onActiveWindow(int) ));
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::invalidate()
|
||||
{
|
||||
deleteAllWindows();
|
||||
addNewTab( true );
|
||||
}
|
||||
|
||||
|
||||
KCHMViewWindow * KCHMViewWindowMgr::current()
|
||||
{
|
||||
QWidget * w = currentPage();
|
||||
WindowsIterator it;
|
||||
|
||||
if ( !w || (it = m_Windows.find( w )) == m_Windows.end() )
|
||||
qFatal( "KCHMViewWindowMgr::current called without any windows!" );
|
||||
|
||||
return it.data().window;
|
||||
}
|
||||
|
||||
KCHMViewWindow * KCHMViewWindowMgr::addNewTab( bool set_active )
|
||||
{
|
||||
KCHMViewWindow * viewvnd;
|
||||
|
||||
#if defined (USE_KDE)
|
||||
if ( !appConfig.m_kdeUseQTextBrowser )
|
||||
viewvnd = new KCHMViewWindow_KHTMLPart( this );
|
||||
else
|
||||
#endif
|
||||
viewvnd = new KCHMViewWindow_QTextBrowser( this );
|
||||
|
||||
QWidget * widget = viewvnd->getQWidget();
|
||||
m_Windows[widget].window = viewvnd;
|
||||
m_Windows[widget].menuitem = 0;
|
||||
m_Windows[widget].widget = widget;
|
||||
|
||||
addTab( widget, "" );
|
||||
|
||||
Q_ASSERT( m_Windows.size() == (unsigned int) count() );
|
||||
|
||||
// Set active if it is the first tab
|
||||
if ( set_active || m_Windows.size() == 1 )
|
||||
showPage( widget );
|
||||
|
||||
// Handle clicking on link in browser window
|
||||
connect( viewvnd->getQObject(), SIGNAL( signalLinkClicked (const QString &, bool &) ), ::mainWindow, SLOT( slotLinkClicked(const QString &, bool &) ) );
|
||||
|
||||
return viewvnd;
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::deleteAllWindows( )
|
||||
{
|
||||
// No it++ - we removing the window by every closeWindow call
|
||||
while ( m_Windows.begin() != m_Windows.end() )
|
||||
closeWindow( m_Windows.begin().data() );
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::setTabName( KCHMViewWindow * window )
|
||||
{
|
||||
WindowsIterator it = m_Windows.find( window->getQWidget() );
|
||||
|
||||
if ( it == m_Windows.end() )
|
||||
qFatal( "KCHMViewWindowMgr::setTabName called with unknown window!" );
|
||||
|
||||
QString title = window->getTitle();
|
||||
|
||||
// Trim too long string
|
||||
if ( title.length() > 25 )
|
||||
title = title.left( 22 ) + "...";
|
||||
|
||||
setTabLabel( window->getQWidget(), title );
|
||||
|
||||
if ( it.data().menuitem == 0 )
|
||||
{
|
||||
// find the empty menuid
|
||||
int menuid;
|
||||
|
||||
if ( !m_idSlot.empty() )
|
||||
{
|
||||
menuid = *m_idSlot.begin();
|
||||
m_idSlot.erase( m_idSlot.begin() );
|
||||
}
|
||||
else
|
||||
menuid = m_Windows.size();
|
||||
|
||||
QString menutitle = "&" + QString::number(menuid) + " " + title;
|
||||
it.data().menuitem = menuid;
|
||||
m_MenuWindow->insertItem(menutitle, menuid);
|
||||
updateTabAccel();
|
||||
}
|
||||
else
|
||||
{
|
||||
QString menutitle = "&" + QString::number(it.data().menuitem) + " " + title;
|
||||
m_MenuWindow->changeItem( it.data().menuitem, menutitle );
|
||||
}
|
||||
|
||||
updateCloseButtons();
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::closeCurrentWindow( )
|
||||
{
|
||||
// Do not allow to close the last window
|
||||
if ( m_Windows.size() == 1 )
|
||||
return;
|
||||
|
||||
QWidget * w = currentPage();
|
||||
WindowsIterator it;
|
||||
|
||||
if ( !w || (it = m_Windows.find( w )) == m_Windows.end() )
|
||||
qFatal( "KCHMViewWindowMgr::closeCurrentWindow called without any windows!" );
|
||||
|
||||
closeWindow( it.data() );
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::closeWindow( const tab_window_t & tab )
|
||||
{
|
||||
WindowsIterator it = m_Windows.find( tab.widget );
|
||||
|
||||
if ( it == m_Windows.end() )
|
||||
qFatal( "KCHMViewWindowMgr::closeWindow called with unknown widget!" );
|
||||
|
||||
if ( tab.menuitem != 0 )
|
||||
{
|
||||
m_MenuWindow->removeItem( tab.menuitem );
|
||||
m_idSlot.push_back( tab.menuitem );
|
||||
}
|
||||
|
||||
removePage( tab.widget );
|
||||
delete tab.window;
|
||||
|
||||
m_Windows.remove( it );
|
||||
updateCloseButtons();
|
||||
updateTabAccel();
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::onCloseWindow( int id )
|
||||
{
|
||||
for ( WindowsIterator it = m_Windows.begin(); it != m_Windows.end(); it++ )
|
||||
{
|
||||
if ( it.data().menuitem != id )
|
||||
continue;
|
||||
|
||||
closeWindow( it.data() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindowMgr::onActiveWindow(int id)
|
||||
{
|
||||
for (WindowsIterator it = m_Windows.begin(); it != m_Windows.end(); ++it)
|
||||
{
|
||||
if ( it.data().menuitem != id )
|
||||
continue;
|
||||
|
||||
QWidget *widget = it.data().widget;
|
||||
showPage(widget);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindowMgr::restoreSettings( const KCHMSettings::viewindow_saved_settings_t & settings )
|
||||
{
|
||||
// Destroy pre-created tab
|
||||
closeWindow( m_Windows.begin().data() );
|
||||
|
||||
for ( unsigned int i = 0; i < settings.size(); i++ )
|
||||
{
|
||||
KCHMViewWindow * window = addNewTab( false );
|
||||
window->openUrl( settings[i].url ); // will call setTabName()
|
||||
window->setScrollbarPosition( settings[i].scroll_y );
|
||||
window->setZoomFactor( settings[i].zoom );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindowMgr::saveSettings( KCHMSettings::viewindow_saved_settings_t & settings )
|
||||
{
|
||||
settings.clear();
|
||||
|
||||
for ( int i = 0; i < count(); i++ )
|
||||
{
|
||||
QWidget * p = page( i );
|
||||
WindowsIterator it = m_Windows.find( p );
|
||||
|
||||
if ( it == m_Windows.end() )
|
||||
qFatal( "KCHMViewWindowMgr::saveSettings: could not find widget!" );
|
||||
|
||||
settings.push_back(
|
||||
KCHMSettings::SavedViewWindow(
|
||||
it.data().window->getOpenedPage(),
|
||||
it.data().window->getScrollbarPosition(),
|
||||
it.data().window->getZoomFactor()) );
|
||||
}
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::updateCloseButtons( )
|
||||
{
|
||||
m_MenuWindow->setItemEnabled( m_menuIdClose, m_Windows.size() > 1 );
|
||||
m_closeButton->setEnabled( m_Windows.size() > 1 );
|
||||
}
|
||||
|
||||
void KCHMViewWindowMgr::onTabChanged( QWidget * newtab )
|
||||
{
|
||||
WindowsIterator it = m_Windows.find( newtab );
|
||||
|
||||
if ( it == m_Windows.end() )
|
||||
qFatal( "KCHMViewWindowMgr::onTabChanged called with unknown widget!" );
|
||||
|
||||
it.data().window->updateNavigationToolbar();
|
||||
mainWindow->slotBrowserChanged( it.data().window );
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindowMgr::updateTabAccel()
|
||||
{
|
||||
WindowsIterator it;
|
||||
for ( it = m_Windows.begin(); it != m_Windows.end(); ++it )
|
||||
{
|
||||
int menuid = it.data().menuitem;
|
||||
int index = indexOf(it.data().widget);
|
||||
|
||||
if ( index <= 9 )
|
||||
{
|
||||
if ( index < 9 )
|
||||
index++;
|
||||
else
|
||||
index = 0;
|
||||
|
||||
m_MenuWindow->setAccel(ALT + key(index), menuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QKeySequence KCHMViewWindowMgr::key(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
return Key_0;
|
||||
|
||||
case 1:
|
||||
return Key_1;
|
||||
|
||||
case 2:
|
||||
return Key_2;
|
||||
|
||||
case 3:
|
||||
return Key_3;
|
||||
|
||||
case 4:
|
||||
return Key_4;
|
||||
|
||||
case 5:
|
||||
return Key_5;
|
||||
|
||||
case 6:
|
||||
return Key_6;
|
||||
|
||||
case 7:
|
||||
return Key_7;
|
||||
|
||||
case 8:
|
||||
return Key_8;
|
||||
|
||||
default:
|
||||
return Key_9;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "kchmviewwindowmgr.moc"
|
@ -0,0 +1,90 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INCLUDE_KCHMVIEWWINDOWMGR_H
|
||||
#define INCLUDE_KCHMVIEWWINDOWMGR_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "forwarddeclarations.h"
|
||||
#include "kchmsettings.h"
|
||||
|
||||
#include <qvaluevector.h>
|
||||
|
||||
class KCHMViewWindowMgr : public QTabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMViewWindowMgr( QWidget *parent = 0 );
|
||||
~KCHMViewWindowMgr( );
|
||||
|
||||
// Returns a handle to a currently viewed window.
|
||||
// Guaranteeed to return a valid handle, or aborts.
|
||||
KCHMViewWindow * current();
|
||||
|
||||
// Adds a new tab, creating a new browser window
|
||||
KCHMViewWindow * addNewTab( bool set_active );
|
||||
|
||||
// Sets the tab name and updates Windows menu
|
||||
void setTabName( KCHMViewWindow* window );
|
||||
|
||||
void invalidate();
|
||||
|
||||
// Creates a Window menu
|
||||
void createMenu( KCHMMainWindow * parent );
|
||||
|
||||
// Saves and restores current settings between sessions
|
||||
void restoreSettings( const KCHMSettings::viewindow_saved_settings_t& settings );
|
||||
void saveSettings( KCHMSettings::viewindow_saved_settings_t& settings );
|
||||
|
||||
public slots:
|
||||
void closeCurrentWindow();
|
||||
|
||||
protected slots:
|
||||
void onTabChanged( QWidget * newtab );
|
||||
void onCloseWindow( int id );
|
||||
void onActiveWindow( int id );
|
||||
void updateCloseButtons();
|
||||
|
||||
private:
|
||||
typedef struct
|
||||
{
|
||||
QWidget * widget;
|
||||
KCHMViewWindow * window;
|
||||
int menuitem;
|
||||
} tab_window_t;
|
||||
|
||||
void closeWindow( const tab_window_t& tab );
|
||||
void deleteAllWindows();
|
||||
void updateTabAccel();
|
||||
QKeySequence key(int);
|
||||
|
||||
QMap<QWidget*,tab_window_t> m_Windows;
|
||||
typedef QMap<QWidget*,tab_window_t>::iterator WindowsIterator;
|
||||
|
||||
QValueList<int> m_idSlot;
|
||||
typedef QValueList<int>::iterator IdIterator;
|
||||
|
||||
QPushButton * m_closeButton;
|
||||
KQPopupMenu * m_MenuWindow;
|
||||
int m_menuIdClose;
|
||||
};
|
||||
|
||||
#endif /* INCLUDE_KCHMVIEWWINDOWMGR_H */
|
@ -0,0 +1,52 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#if defined (USE_KDE)
|
||||
KQListView::KQListView( QWidget * parent, const char * name, int )
|
||||
: KListView (parent, name)
|
||||
#else
|
||||
KQListView::KQListView( QWidget * parent, const char * name, int f )
|
||||
: QListView (parent, name, f)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
#if defined (USE_KDE)
|
||||
KQProgressModalDialog::KQProgressModalDialog ( const QString & captionText, const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator )
|
||||
: KProgressDialog( creator, 0, captionText, labelText, true )
|
||||
{
|
||||
setAllowCancel( true );
|
||||
showCancelButton( true );
|
||||
setAutoClose( true );
|
||||
setButtonText( cancelButtonText );
|
||||
setTotalSteps( totalSteps );
|
||||
setMinimumDuration( 1 );
|
||||
}
|
||||
#else
|
||||
KQProgressModalDialog::KQProgressModalDialog ( const QString & captionText, const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator )
|
||||
: QProgressDialog( labelText, cancelButtonText, totalSteps, creator, 0, false )
|
||||
{
|
||||
setCaption( captionText );
|
||||
setMinimumDuration( 1 );
|
||||
}
|
||||
#endif
|
@ -0,0 +1,148 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KDE_QT_H
|
||||
#define KDE_QT_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined (USE_KDE)
|
||||
|
||||
#define KQ_CLASSNAME(name) K##name
|
||||
#define KQ_DECLARECLASS(name) class KQ##name : public K##name
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kmainwindow.h>
|
||||
#include <kstatusbar.h>
|
||||
#include <kmenubar.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <klocale.h>
|
||||
#include <klistview.h>
|
||||
#include <kfiledialog.h>
|
||||
#include <khtml_part.h>
|
||||
#include <ktabwidget.h>
|
||||
#include <kpopupmenu.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kprogress.h>
|
||||
#include <krun.h>
|
||||
|
||||
#else /* !USE_KDE */
|
||||
|
||||
#define KQ_CLASSNAME(name) Q##name
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qstring.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qlistview.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qprogressdialog.h>
|
||||
|
||||
#define i18n(A) tr(A)
|
||||
|
||||
#endif /* USE_KDE */
|
||||
|
||||
/* common non-wrapped UI classes */
|
||||
#include <qsplitter.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qheader.h>
|
||||
#include <qtextbrowser.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlabel.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
/* common utility classes */
|
||||
#include <qwhatsthis.h>
|
||||
#include <qstring.h>
|
||||
#include <qtextedit.h>
|
||||
#include <qfile.h>
|
||||
#include <qdir.h>
|
||||
#include <qregexp.h>
|
||||
#include <qtimer.h>
|
||||
#include <qmap.h>
|
||||
#include <qeventloop.h>
|
||||
|
||||
class KQMainWindow : public KQ_CLASSNAME(MainWindow)
|
||||
{
|
||||
public:
|
||||
KQMainWindow ( QWidget * parent, const char * name, WFlags f )
|
||||
: KQ_CLASSNAME(MainWindow) (parent, name, f) {};
|
||||
};
|
||||
|
||||
|
||||
class KQListView : public KQ_CLASSNAME(ListView)
|
||||
{
|
||||
public:
|
||||
KQListView(QWidget *parent = 0, const char *name = 0, int f = 0);
|
||||
};
|
||||
|
||||
|
||||
class KQProgressModalDialog : public KQ_CLASSNAME(ProgressDialog)
|
||||
{
|
||||
public:
|
||||
KQProgressModalDialog ( const QString & captionText, const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator = 0 );
|
||||
|
||||
// Seems like people have fun making classes incompatible
|
||||
#if defined (USE_KDE)
|
||||
void setTotalSteps( int totalSteps ) { progressBar ()->setTotalSteps( totalSteps ); }
|
||||
void setProgress( int progress ) { progressBar ()->setProgress( progress ); }
|
||||
#else
|
||||
bool wasCancelled() { return wasCanceled(); }
|
||||
#endif
|
||||
};
|
||||
|
||||
class KQTabWidget : public KQ_CLASSNAME(TabWidget)
|
||||
{
|
||||
public:
|
||||
KQTabWidget (QWidget *parent = 0, const char *name = 0, int f = 0)
|
||||
: KQ_CLASSNAME(TabWidget) (parent, name, f) {};
|
||||
};
|
||||
|
||||
class KQPopupMenu : public KQ_CLASSNAME(PopupMenu)
|
||||
{
|
||||
public:
|
||||
KQPopupMenu (QWidget *parent = 0 )
|
||||
: KQ_CLASSNAME(PopupMenu) (parent) {};
|
||||
};
|
||||
|
||||
#include <qinputdialog.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qtextedit.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qtooltip.h>
|
||||
|
||||
|
||||
class KCHMShowWaitCursor
|
||||
{
|
||||
public:
|
||||
KCHMShowWaitCursor() { QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); }
|
||||
~KCHMShowWaitCursor() { QApplication::restoreOverrideCursor(); }
|
||||
};
|
||||
|
||||
|
||||
#endif /* KDE_QT_H */
|
@ -0,0 +1,8 @@
|
||||
lib_LIBRARIES=libkdeextra.a
|
||||
libkdeextra_a_SOURCES = kchmdcopiface.cpp kchmdcopiface.skel kchmviewwindow_khtmlpart.cpp
|
||||
noinst_HEADERS = kchmdcopiface.h kchmviewwindow_khtmlpart.h
|
||||
|
||||
INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES) $(LIBCHMFILE_INCLUDES)
|
||||
|
||||
METASOURCES = AUTO
|
||||
KDE_OPTIONS = qtonly
|
@ -0,0 +1,86 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2005 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kchmdcopiface.h"
|
||||
#include "kchmdcopiface.moc"
|
||||
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmsearchwindow.h"
|
||||
|
||||
|
||||
KCHMDCOPIface::KCHMDCOPIface(QObject *parent, const char *name)
|
||||
: QObject(parent, name), DCOPObject( "KCHMDCOPIface" )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
KCHMDCOPIface::~KCHMDCOPIface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void KCHMDCOPIface::loadHelpFile( const QString & filename, const QString & page2open )
|
||||
{
|
||||
QStringList args;
|
||||
|
||||
args.push_back( filename );
|
||||
args.push_back( page2open );
|
||||
|
||||
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "loadAndOpen", args ) );
|
||||
}
|
||||
|
||||
|
||||
void KCHMDCOPIface::openPage( const QString & page2open )
|
||||
{
|
||||
QStringList args;
|
||||
|
||||
args.push_back( page2open );
|
||||
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "openPage", args ) );
|
||||
}
|
||||
|
||||
|
||||
void KCHMDCOPIface::guiFindInIndex( const QString & word )
|
||||
{
|
||||
QStringList args;
|
||||
|
||||
args.push_back( word );
|
||||
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "findInIndex", args ) );
|
||||
}
|
||||
|
||||
|
||||
void KCHMDCOPIface::guiSearchQuery( const QString & query )
|
||||
{
|
||||
QStringList args;
|
||||
|
||||
args.push_back( query );
|
||||
qApp->postEvent( ::mainWindow, new KCHMUserEvent( "searchQuery", args ) );
|
||||
}
|
||||
|
||||
QStringList KCHMDCOPIface::searchQuery( const QString & query )
|
||||
{
|
||||
QStringList results;
|
||||
|
||||
if ( ::mainWindow->searchWindow()->searchQuery( query, &results ) )
|
||||
return results;
|
||||
else
|
||||
return QStringList();
|
||||
}
|
||||
|
@ -0,0 +1,58 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2005 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMDCOPIFACE_H
|
||||
#define KCHMDCOPIFACE_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include <dcopobject.h>
|
||||
#include <qstring.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
class KCHMDCOPIface : public QObject, public DCOPObject
|
||||
{
|
||||
Q_OBJECT
|
||||
K_DCOP
|
||||
|
||||
public:
|
||||
KCHMDCOPIface( QObject *parent = 0, const char *name = 0 );
|
||||
~KCHMDCOPIface();
|
||||
|
||||
k_dcop:
|
||||
//! Loads a CHM file \a filename , and opens the URL \a url. Use URL "/" to open default homepage
|
||||
void loadHelpFile( const QString& filename, const QString& url );
|
||||
|
||||
//! Opens a specific \a url inside the loaded CHM file
|
||||
void openPage( const QString& url );
|
||||
|
||||
//! Tries to find word in index, opening the index window and scrolling it there
|
||||
void guiFindInIndex( const QString& word );
|
||||
|
||||
//! Executes a search in GUI. \a query contains the complete search query.
|
||||
void guiSearchQuery( const QString& query );
|
||||
|
||||
//! Executes a search; GUI is not involved and user sees nothing.
|
||||
//! \a query contains the complete search query.
|
||||
//! Returns a list of URLs, or empty array if nothing os
|
||||
QStringList searchQuery( const QString& query );
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,98 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** DCOP Skeleton generated by dcopidl2cpp from kchmdcopiface.kidl
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#include "./kchmdcopiface.h"
|
||||
|
||||
#include <kdatastream.h>
|
||||
|
||||
|
||||
static const char* const KCHMDCOPIface_ftable[6][3] = {
|
||||
{ "void", "loadHelpFile(QString,QString)", "loadHelpFile(QString filename,QString url)" },
|
||||
{ "void", "openPage(QString)", "openPage(QString url)" },
|
||||
{ "void", "guiFindInIndex(QString)", "guiFindInIndex(QString word)" },
|
||||
{ "void", "guiSearchQuery(QString)", "guiSearchQuery(QString query)" },
|
||||
{ "QStringList", "searchQuery(QString)", "searchQuery(QString query)" },
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
static const int KCHMDCOPIface_ftable_hiddens[5] = {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
bool KCHMDCOPIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
|
||||
{
|
||||
if ( fun == KCHMDCOPIface_ftable[0][1] ) { // void loadHelpFile(QString,QString)
|
||||
QString arg0;
|
||||
QString arg1;
|
||||
QDataStream arg( data, IO_ReadOnly );
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg0;
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg1;
|
||||
replyType = KCHMDCOPIface_ftable[0][0];
|
||||
loadHelpFile(arg0, arg1 );
|
||||
} else if ( fun == KCHMDCOPIface_ftable[1][1] ) { // void openPage(QString)
|
||||
QString arg0;
|
||||
QDataStream arg( data, IO_ReadOnly );
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg0;
|
||||
replyType = KCHMDCOPIface_ftable[1][0];
|
||||
openPage(arg0 );
|
||||
} else if ( fun == KCHMDCOPIface_ftable[2][1] ) { // void guiFindInIndex(QString)
|
||||
QString arg0;
|
||||
QDataStream arg( data, IO_ReadOnly );
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg0;
|
||||
replyType = KCHMDCOPIface_ftable[2][0];
|
||||
guiFindInIndex(arg0 );
|
||||
} else if ( fun == KCHMDCOPIface_ftable[3][1] ) { // void guiSearchQuery(QString)
|
||||
QString arg0;
|
||||
QDataStream arg( data, IO_ReadOnly );
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg0;
|
||||
replyType = KCHMDCOPIface_ftable[3][0];
|
||||
guiSearchQuery(arg0 );
|
||||
} else if ( fun == KCHMDCOPIface_ftable[4][1] ) { // QStringList searchQuery(QString)
|
||||
QString arg0;
|
||||
QDataStream arg( data, IO_ReadOnly );
|
||||
if (arg.atEnd()) return false;
|
||||
arg >> arg0;
|
||||
replyType = KCHMDCOPIface_ftable[4][0];
|
||||
QDataStream _replyStream( replyData, IO_WriteOnly );
|
||||
_replyStream << searchQuery(arg0 );
|
||||
} else {
|
||||
return DCOPObject::process( fun, data, replyType, replyData );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QCStringList KCHMDCOPIface::interfaces()
|
||||
{
|
||||
QCStringList ifaces = DCOPObject::interfaces();
|
||||
ifaces += "KCHMDCOPIface";
|
||||
return ifaces;
|
||||
}
|
||||
|
||||
QCStringList KCHMDCOPIface::functions()
|
||||
{
|
||||
QCStringList funcs = DCOPObject::functions();
|
||||
for ( int i = 0; KCHMDCOPIface_ftable[i][2]; i++ ) {
|
||||
if (KCHMDCOPIface_ftable_hiddens[i])
|
||||
continue;
|
||||
QCString func = KCHMDCOPIface_ftable[i][0];
|
||||
func += ' ';
|
||||
func += KCHMDCOPIface_ftable[i][2];
|
||||
funcs << func;
|
||||
}
|
||||
return funcs;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,163 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qclipboard.h>
|
||||
|
||||
#include <khtmlview.h>
|
||||
#include <kfinddialog.h>
|
||||
|
||||
#include "kde-qt.h"
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmviewwindow_khtmlpart.h"
|
||||
|
||||
#include "kchmviewwindow_khtmlpart.moc"
|
||||
|
||||
|
||||
QWidget * KCHMViewWindow_KHTMLPart::getQWidget()
|
||||
{
|
||||
return view();
|
||||
}
|
||||
|
||||
KCHMViewWindow_KHTMLPart::KCHMViewWindow_KHTMLPart( QTabWidget * parent )
|
||||
: KHTMLPart ( parent ), KCHMViewWindow ( parent )
|
||||
{
|
||||
m_zoomfactor = 0;
|
||||
m_currentEncoding = 0;
|
||||
m_searchForward = true;
|
||||
|
||||
invalidate();
|
||||
|
||||
connect( browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
|
||||
this, SLOT ( onOpenURLRequest( const KURL &, const KParts::URLArgs & )) );
|
||||
|
||||
connect( this, SIGNAL ( popupMenu ( const QString &, const QPoint &) ),
|
||||
this, SLOT ( onPopupMenu ( const QString &, const QPoint &) ) );
|
||||
}
|
||||
|
||||
|
||||
KCHMViewWindow_KHTMLPart::~KCHMViewWindow_KHTMLPart()
|
||||
{
|
||||
}
|
||||
|
||||
bool KCHMViewWindow_KHTMLPart::openPage (const QString& url)
|
||||
{
|
||||
// Set or change the encoding
|
||||
if ( m_currentEncoding != ::mainWindow->chmFile()->currentEncoding() )
|
||||
{
|
||||
m_currentEncoding = ::mainWindow->chmFile()->currentEncoding();
|
||||
setEncoding ( m_currentEncoding->qtcodec, TRUE );
|
||||
}
|
||||
|
||||
QString fullurl = "ms-its:" + ::mainWindow->getOpenedFileName() + "::" + url;
|
||||
openURL ( KURL(fullurl) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::setZoomFactor( int zoom )
|
||||
{
|
||||
m_zoomfactor = zoom;
|
||||
|
||||
// Default ZoomFactor is 100, any increase or decrease should modify this value.
|
||||
KHTMLPart::setZoomFactor ( 100 + (m_zoomfactor * 10) );
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::invalidate( )
|
||||
{
|
||||
m_zoomfactor = 0;
|
||||
m_searchForward = true;
|
||||
m_searchText = QString::null;
|
||||
|
||||
setJScriptEnabled ( appConfig.m_kdeEnableJS );
|
||||
setJavaEnabled ( appConfig.m_kdeEnableJava );
|
||||
setMetaRefreshEnabled ( appConfig.m_kdeEnableRefresh );
|
||||
setPluginsEnabled ( appConfig.m_kdeEnablePlugins );
|
||||
|
||||
KCHMViewWindow::invalidate( );
|
||||
}
|
||||
|
||||
int KCHMViewWindow_KHTMLPart::getScrollbarPosition( )
|
||||
{
|
||||
return view()->contentsY ();
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::setScrollbarPosition( int pos )
|
||||
{
|
||||
view()->scrollBy (0, pos);
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::addZoomFactor( int value )
|
||||
{
|
||||
setZoomFactor( m_zoomfactor + value);
|
||||
}
|
||||
|
||||
bool KCHMViewWindow_KHTMLPart::printCurrentPage()
|
||||
{
|
||||
view()->print();
|
||||
return true;
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::searchWord( const QString & word, bool forward, bool )
|
||||
{
|
||||
if ( word != m_searchText || forward != m_searchForward )
|
||||
{
|
||||
m_searchText = word;
|
||||
m_searchForward = forward;
|
||||
|
||||
findText ( word, forward ? 0 : KFindDialog::FindBackwards, ::mainWindow, 0 );
|
||||
}
|
||||
|
||||
findTextNext ();
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::onOpenURLRequest( const KURL & url, const KParts::URLArgs & )
|
||||
{
|
||||
bool sourcechange = true;
|
||||
emit signalLinkClicked ( url.prettyURL(), sourcechange );
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::slotLinkClicked( const QString & newlink )
|
||||
{
|
||||
bool notused;
|
||||
emit signalLinkClicked (newlink, notused);
|
||||
}
|
||||
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::clipSelectAll()
|
||||
{
|
||||
selectAll ();
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::clipCopy()
|
||||
{
|
||||
QString text = selectedText();
|
||||
|
||||
if ( !text.isEmpty() )
|
||||
QApplication::clipboard()->setText( text );
|
||||
}
|
||||
|
||||
void KCHMViewWindow_KHTMLPart::onPopupMenu ( const QString &url, const QPoint & point )
|
||||
{
|
||||
KQPopupMenu * menu = getContextMenu( url, view() );
|
||||
menu->exec( point );
|
||||
}
|
||||
|
@ -0,0 +1,114 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KCHMVIEWWINDOW_KHTMLPART_H
|
||||
#define KCHMVIEWWINDOW_KHTMLPART_H
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "kchmviewwindow.h"
|
||||
#include "kchmsourcefactory.h"
|
||||
#include "libchmtextencoding.h"
|
||||
|
||||
|
||||
/**
|
||||
@author Georgy Yunaev
|
||||
*/
|
||||
/*
|
||||
* For Qt-only version, we cannot compile KCHMViewWindow_KHTMLPart. However,
|
||||
* we cannot just exclude it, because it would not generate a MOC file for a KDE
|
||||
* version. Therefore we declare it, and compile the .moc file, but do not provide
|
||||
* the class methods.
|
||||
*/
|
||||
#if defined (USE_KDE)
|
||||
class KCHMViewWindow_KHTMLPart : public KHTMLPart, public KCHMViewWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KCHMViewWindow_KHTMLPart( QTabWidget * parent );
|
||||
~KCHMViewWindow_KHTMLPart();
|
||||
|
||||
//! Open a page from current chm archive
|
||||
virtual bool openPage (const QString& url);
|
||||
|
||||
//! Invalidate current view, doing all the cleanups etc.
|
||||
virtual void invalidate();
|
||||
|
||||
//! Return current ZoomFactor.
|
||||
virtual int getZoomFactor() const { return m_zoomfactor; }
|
||||
|
||||
//! Sets ZoomFactor. The value returned by getZoomFactor(), given to this function, should give the same result.
|
||||
virtual void setZoomFactor (int zoom);
|
||||
|
||||
//! Relatively changes ZoomFactor. Most common values are -1 and 1.
|
||||
virtual void addZoomFactor (int value);
|
||||
|
||||
//! Popups the print dialog, and prints the current page on the printer.
|
||||
virtual bool printCurrentPage();
|
||||
|
||||
//! Initiates the find-in-page search, if succeed, cursor moved to the first entry
|
||||
virtual void searchWord( const QString & word, bool forward = true, bool casesensitive = false );
|
||||
|
||||
//! Select the content of the whole page
|
||||
virtual void clipSelectAll();
|
||||
|
||||
//! Copies the selected content to the clipboard
|
||||
virtual void clipCopy();
|
||||
|
||||
/*!
|
||||
* Return current scrollbar position in view window. Saved on program exit.
|
||||
* There is no restriction on returned value, except that giving this value to
|
||||
* setScrollbarPosition() should move the scrollbar in the same position.
|
||||
*/
|
||||
virtual int getScrollbarPosition();
|
||||
|
||||
//! Sets the scrollbar position.
|
||||
virtual void setScrollbarPosition(int pos);
|
||||
|
||||
virtual QObject * getQObject() { return this; }
|
||||
virtual QWidget * getQWidget();
|
||||
|
||||
signals:
|
||||
/*!
|
||||
* Emitted when the user clicked on the link, before the page changed.
|
||||
* If signalLinkClicked() sets follow_link to false, the current page should NOT change.
|
||||
* Otherwise it should be changed to the new link value.
|
||||
*/
|
||||
void signalLinkClicked ( const QString & newlink, bool& follow_link );
|
||||
|
||||
private slots:
|
||||
virtual void slotLinkClicked ( const QString & newlink);
|
||||
virtual void onOpenURLRequest( const KURL &, const KParts::URLArgs & );
|
||||
virtual void onPopupMenu ( const QString & url, const QPoint & point );
|
||||
|
||||
private:
|
||||
void setSource ( const QString & name );
|
||||
|
||||
int m_zoomfactor;
|
||||
bool m_searchForward;
|
||||
QString m_searchText;
|
||||
|
||||
const LCHMTextEncoding * m_currentEncoding;
|
||||
};
|
||||
|
||||
#endif /* USE_KDE */
|
||||
|
||||
#endif /* KCHMVIEWWINDOW_KHTMLPART_H */
|
@ -0,0 +1,52 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static bool run_process( const QString& command, const QString& filename )
|
||||
{
|
||||
QString safefilename = filename;
|
||||
QString preparedcommand = command;
|
||||
|
||||
// To be safe, URL should contain no quotes, apostrofes and \0 symbols
|
||||
safefilename.remove (QRegExp ("['\"\0]"));
|
||||
preparedcommand.replace( "%s", safefilename );
|
||||
|
||||
// And run an external command with fork()s
|
||||
switch ( fork() )
|
||||
{
|
||||
case -1:
|
||||
return false;
|
||||
|
||||
case 0: // child
|
||||
if ( fork() != 0 )
|
||||
exit(0); // exit immediately - our child is now has init as his parent
|
||||
|
||||
system( preparedcommand.ascii() );
|
||||
exit (0);
|
||||
|
||||
default: // parent
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "kqtempfile.h"
|
||||
|
||||
|
||||
KQTempFileKeeper::KQTempFileKeeper( )
|
||||
{
|
||||
#if defined(WIN32)
|
||||
m_tempDir = ::GetTempDirectory();
|
||||
#else
|
||||
if ( getenv("TEMP") )
|
||||
m_tempDir = getenv("TEMP");
|
||||
else if ( getenv("TMP") )
|
||||
m_tempDir = getenv("TMP");
|
||||
else
|
||||
m_tempDir = "/tmp";
|
||||
#endif
|
||||
|
||||
m_fileNumber = 1;
|
||||
}
|
||||
|
||||
KQTempFileKeeper::~ KQTempFileKeeper( )
|
||||
{
|
||||
destroyTempFiles();
|
||||
}
|
||||
|
||||
bool KQTempFileKeeper::generateTempFile( QFile & file, const QString & tempdir )
|
||||
{
|
||||
QString usetempdir = ((tempdir != QString::null) ? tempdir : m_tempDir) + "/";
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
char fnbuf[128];
|
||||
sprintf( fnbuf, "KQTEMPFILE%d-%d-%d.tmp", (int) getpid(), (int) time(0), m_fileNumber++ );
|
||||
|
||||
file.setName( usetempdir + fnbuf );
|
||||
if ( file.open( IO_WriteOnly ) )
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void KQTempFileKeeper::destroyTempFiles( )
|
||||
{
|
||||
for ( unsigned int i = 0; i < m_tempFiles.size(); i++ )
|
||||
QFile::remove( m_tempFiles[i] );
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef KQTEMPFILE_H
|
||||
#define KQTEMPFILE_H
|
||||
|
||||
#include <qvaluevector.h>
|
||||
#include <qfile.h>
|
||||
|
||||
/*
|
||||
* This class generates temp file names in race condition-safe way,
|
||||
* returns QFile and filename pairs, keeps the track of opened temp files,
|
||||
* and deletes them when program exist.
|
||||
*/
|
||||
|
||||
class KQTempFileKeeper
|
||||
{
|
||||
public:
|
||||
KQTempFileKeeper();
|
||||
~KQTempFileKeeper();
|
||||
|
||||
//! Generates a temporary file name, and creates it on disk at the same time.
|
||||
//! Returns the file. If tempdir is not empty, it is used as temp directory.
|
||||
bool generateTempFile( QFile& file, const QString& tempdir = QString::null );
|
||||
|
||||
//! Closes and removes all the files from disk
|
||||
void destroyTempFiles();
|
||||
|
||||
private:
|
||||
QValueVector<QString> m_tempFiles;
|
||||
QString m_tempDir;
|
||||
unsigned int m_fileNumber;
|
||||
};
|
||||
|
||||
#endif /* KQTEMPFILE_H */
|
@ -0,0 +1,96 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com *
|
||||
* Please do not use email address above for bug reports; see *
|
||||
* the README file *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "kde-qt.h"
|
||||
|
||||
#include "kchmmainwindow.h"
|
||||
#include "kchmconfig.h"
|
||||
#include "kchmkeyeventfilter.h"
|
||||
|
||||
#if defined (USE_KDE)
|
||||
#include <kaboutdata.h>
|
||||
#include <dcopclient.h>
|
||||
|
||||
#include "kde/kchmdcopiface.h"
|
||||
#endif
|
||||
|
||||
KCHMMainWindow * mainWindow;
|
||||
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
{
|
||||
#if defined (USE_KDE)
|
||||
static KCmdLineOptions options[] =
|
||||
{
|
||||
{ "autotestmode", "Perform auto testing", 0 },
|
||||
{ "shortautotestmode", "Perform short auto testing", 0 },
|
||||
{ "+[chmfile]", "A CHM file to show", 0 },
|
||||
{ "search <query>", I18N_NOOP("'--search <query>' specifies the search query to search, and activate the first entry if found"), 0 },
|
||||
{ "sindex <word>", I18N_NOOP("'--sindex <word>' specifies the word to find in index, and activate if found"), 0 },
|
||||
KCmdLineLastOption
|
||||
};
|
||||
|
||||
KAboutData aboutdata ( "kchmviewer",
|
||||
APP_NAME,
|
||||
APP_VERSION,
|
||||
I18N_NOOP("CHM file viewer"),
|
||||
KAboutData::License_GPL,
|
||||
"(c) 2004-2007 George Yunaev, gyunaev@ulduzsoft.com",
|
||||
0,
|
||||
"http://www.kchmviewer.net",
|
||||
"gyunaev@ulduzsoft.com");
|
||||
|
||||
KLocale::setMainCatalogue( "kchmviewer" );
|
||||
KCmdLineArgs::init (argc, argv, &aboutdata);
|
||||
KCmdLineArgs::addCmdLineOptions( options );
|
||||
|
||||
KApplication app;
|
||||
#else
|
||||
QApplication app( argc, argv );
|
||||
#endif
|
||||
|
||||
appConfig.load();
|
||||
app.installEventFilter( &gKeyEventFilter );
|
||||
|
||||
#if defined(USE_KDE)
|
||||
// DCOP stuff
|
||||
KCHMDCOPIface iface;
|
||||
|
||||
DCOPClient *client = kapp->dcopClient();
|
||||
|
||||
if ( !client->attach() )
|
||||
qWarning("DCOP attach failed");
|
||||
|
||||
//QCString realAppId = client->registerAs( kapp->name() );
|
||||
QCString realAppId = client->registerAs( "kchmviewer" );
|
||||
#endif
|
||||
|
||||
mainWindow = new KCHMMainWindow();
|
||||
mainWindow->show();
|
||||
|
||||
#if !defined(USE_KDE)
|
||||
app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );
|
||||
#else
|
||||
app.setMainWidget( mainWindow );
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
# Install the icons into the global KDE directories
|
||||
KDE_ICON = AUTO
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue