From 2bda8f7717adf28da4af0d34fb82f63d2868c31d Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kregexpeditor/infopage.cpp | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 kregexpeditor/infopage.cpp (limited to 'kregexpeditor/infopage.cpp') diff --git a/kregexpeditor/infopage.cpp b/kregexpeditor/infopage.cpp new file mode 100644 index 0000000..8f373c5 --- /dev/null +++ b/kregexpeditor/infopage.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2002-2003 Jesper K. Pedersen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + **/ +#ifdef QT_ONLY + #include "compat.h" +#else + #include + #include +#endif + +#include "infopage.h" + +InfoPage::InfoPage( QWidget* parent, const char* name ) + :KTextBrowser( parent, name ) +{ + QString txt = + QString::fromLatin1( "" ) + + i18n( "Translators, feel free to add yourself in the text below, asking for a postcard ;-), " + "also feel free to add a section saying

Translators

. " + "Kind regards, and thanks for your work - Jesper.", + "

Regular Expression Editor

" + "

What you are currently looking at is an editor for Regular Expressions.

" + "

The upper part in the middle is the editing area, the lower part is a verification window where you can " + "try your regular expressions right away. The row of buttons is the editing actions. " + "This is actually very similar to common drawing programs. Select an editing tool to start " + "editing your regular expression, and press the mouse button in the editing area where you want " + "this item inserted.

" + "

For a more detailed description of this editor see the info pages

" + + "

What is a regular expression?

" + "If you do not know what a regular expression is, then it might be a good idea " + "to read the introduction to regular expressions.

"); + +#ifdef HOUSEOFFUSION + txt += tr("

House Of Fusion note

" + "If you want to donate money to continue development on the KRegExpEditor port for " + "house of fusion then please contact Michael Dinowitz (mdinowit@houseoffusion.com)."); +#endif + txt += i18n( "

Send the author an electronic postcard

" + "I don't get any money for working on KRegExpEditor, " + "I therefore appreciate it very much when users tell me what they think about my work. " + "I would therefore be very happy if you " + "sent me a short mail, telling me that you use my regular expression editor." + + "

Author

" + "Jesper K. Pedersen <blackie@kde.org>") + + QString::fromLatin1( "
" ); + setText( txt ); +} + +void InfoPage::setSource ( const QString& name ) +{ +#ifdef QT_ONLY + mimeSourceFactory()->setFilePath( QStringList() << QString::fromLatin1("manual/")); + QString nm = name; + if ( nm.endsWith("/") ) + nm = nm.left( nm.length()-1); + + if ( nm.startsWith("mailto:") ) { + QMessageBox::information( this, tr("Support mail"), tr("Please send the mail to blackie@kde.org") ); + return; + } + if ( nm.startsWith( "http:" ) ) + return; + + + if ( nm == "doc://" ) + nm = "doc://index"; + + if ( nm.startsWith( QString::fromLocal8Bit("doc://") ) ) { + nm = nm.mid(6) + ".html"; + } + + QTextBrowser::setSource( nm ); +#else + if ( name.startsWith( QString::fromLocal8Bit("doc://") ) ) { + kapp->invokeHelp( name.mid(6, name.length()-7), QString::fromLocal8Bit("KRegExpEditor") ); + } + else { + KTextBrowser::setSource( name ); // handle mailto and other links + } +#endif +} -- cgit v1.2.3