From 8bd62a3b0d3b362b783a273e2460811392485bbd Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 14 Feb 2013 17:17:18 -0600 Subject: Rename common header files for consistency with class renaming --- tdeui/CMakeLists.txt | 10 +- tdeui/MAINTAINERS | 6 +- tdeui/Makefile.am | 10 +- tdeui/kaboutapplication.cpp | 188 --- tdeui/kaboutapplication.h | 94 -- tdeui/kaboutdialog.cpp | 1797 ----------------------- tdeui/kaboutdialog.h | 633 -------- tdeui/kaboutkde.cpp | 87 -- tdeui/kaboutkde.h | 62 - tdeui/kactivelabel.cpp | 2 +- tdeui/kbugreport.cpp | 4 +- tdeui/kcharselect.cpp | 2 +- tdeui/kcolorcombo.cpp | 2 +- tdeui/kcolordialog.cpp | 2 +- tdeui/kdatepicker.cpp | 2 +- tdeui/kdatetbl.cpp | 2 +- tdeui/kdcopactionproxy.cpp | 2 +- tdeui/kdetrayproxy/kdetrayproxy.cpp | 4 +- tdeui/kdialog.cpp | 2 +- tdeui/kdialogbase.cpp | 2 +- tdeui/keditcl1.cpp | 2 +- tdeui/keditcl2.cpp | 2 +- tdeui/keditlistbox.cpp | 2 +- tdeui/khelpmenu.cpp | 8 +- tdeui/kiconview.cpp | 2 +- tdeui/kjanuswidget.cpp | 2 +- tdeui/kkeybutton.cpp | 2 +- tdeui/kkeydialog.cpp | 4 +- tdeui/kled.cpp | 2 +- tdeui/klineedit.cpp | 2 +- tdeui/klineeditdlg.cpp | 2 +- tdeui/kmenubar.cpp | 2 +- tdeui/kmessagebox.cpp | 2 +- tdeui/kpanelapplet.cpp | 2 +- tdeui/kpanelappmenu.cpp | 2 +- tdeui/kpassdlg.cpp | 4 +- tdeui/kprogress.cpp | 2 +- tdeui/kprogressbox.cpp | 2 +- tdeui/kpushbutton.cpp | 2 +- tdeui/krootpixmap.cpp | 2 +- tdeui/ksconfig.cpp | 2 +- tdeui/kseparator.cpp | 2 +- tdeui/ksharedpixmap.cpp | 2 +- tdeui/kstdaction.cpp | 4 +- tdeui/kstdguiitem.cpp | 2 +- tdeui/ksyntaxhighlighter.cpp | 2 +- tdeui/ksystemtray.cpp | 4 +- tdeui/ktextbrowser.cpp | 2 +- tdeui/ktip.cpp | 4 +- tdeui/kwhatsthismanager.cpp | 2 +- tdeui/kxmlguibuilder.cpp | 2 +- tdeui/kxmlguiclient.cpp | 2 +- tdeui/tdeaboutapplication.cpp | 188 +++ tdeui/tdeaboutapplication.h | 94 ++ tdeui/tdeaboutdialog.cpp | 1797 +++++++++++++++++++++++ tdeui/tdeaboutdialog.h | 633 ++++++++ tdeui/tdeabouttde.cpp | 87 ++ tdeui/tdeabouttde.h | 62 + tdeui/tdeaction.cpp | 2 +- tdeui/tdeactionclasses.cpp | 2 +- tdeui/tdeactioncollection.cpp | 2 +- tdeui/tdecmodule.cpp | 2 +- tdeui/tdefontdialog.cpp | 2 +- tdeui/tdelistbox.cpp | 2 +- tdeui/tdelistview.cpp | 2 +- tdeui/tdemainwindow.cpp | 2 +- tdeui/tdemainwindowiface.cpp | 2 +- tdeui/tdepopupmenu.cpp | 2 +- tdeui/tdeshortcutdialog.cpp | 2 +- tdeui/tdespell.cpp | 2 +- tdeui/tdespelldlg.cpp | 2 +- tdeui/tdetoolbar.cpp | 2 +- tdeui/tdetoolbarbutton.cpp | 2 +- tdeui/tdetoolbarhandler.cpp | 2 +- tdeui/tests/itemcontainertest.cpp | 2 +- tdeui/tests/kaboutdialogtest.cpp | 4 +- tdeui/tests/kblendtest.cpp | 2 +- tdeui/tests/kbuttonboxtest.cpp | 2 +- tdeui/tests/kcharselecttest.cpp | 2 +- tdeui/tests/kcolordlgtest.cpp | 2 +- tdeui/tests/kcolortest.cpp | 2 +- tdeui/tests/kcomboboxtest.cpp | 2 +- tdeui/tests/kcompletiontest.cpp | 2 +- tdeui/tests/kdatepicktest.cpp | 2 +- tdeui/tests/kdatetimewidgettest.cpp | 2 +- tdeui/tests/kdatewidgettest.cpp | 2 +- tdeui/tests/kdesattest.cpp | 2 +- tdeui/tests/kdialogbasetest.cpp | 2 +- tdeui/tests/kdocktest.cpp | 2 +- tdeui/tests/kdockwidgetdemo.cpp | 2 +- tdeui/tests/kdockwidgettest.cpp | 2 +- tdeui/tests/kdualcolortest.cpp | 2 +- tdeui/tests/keditlistboxtest.cpp | 2 +- tdeui/tests/kedittest.cpp | 2 +- tdeui/tests/kgradienttest.cpp | 2 +- tdeui/tests/khashtest.cpp | 2 +- tdeui/tests/kinputdialogtest.cpp | 2 +- tdeui/tests/kjanuswidgettest.cpp | 2 +- tdeui/tests/kledtest.cpp | 2 +- tdeui/tests/klineeditdlgtest.cpp | 2 +- tdeui/tests/klineedittest.cpp | 6 +- tdeui/tests/kmessageboxtest.cpp | 2 +- tdeui/tests/knuminputtest.cpp | 2 +- tdeui/tests/kpalettetest.cpp | 2 +- tdeui/tests/kpanelmenutest.cpp | 2 +- tdeui/tests/kpixmapregionselectordialogtest.cpp | 4 +- tdeui/tests/kprogresstest.cpp | 2 +- tdeui/tests/krulertest.h | 2 +- tdeui/tests/kseparatortest.cpp | 2 +- tdeui/tests/ksqueezedtextlabeltest.cpp | 2 +- tdeui/tests/kstatusbartest.cpp | 2 +- tdeui/tests/ksystemtraytest.cpp | 2 +- tdeui/tests/ktabctltest.cpp | 2 +- tdeui/tests/ktabwidgettest.cpp | 4 +- tdeui/tests/ktextedittest.cpp | 2 +- tdeui/tests/ktimewidgettest.cpp | 2 +- tdeui/tests/kunbalancedgrdtest.cpp | 2 +- tdeui/tests/kwizardtest.cpp | 2 +- tdeui/tests/kwordwraptest.cpp | 2 +- tdeui/tests/kxmlguitest.cpp | 2 +- tdeui/tests/tdeactiontest.cpp | 2 +- tdeui/tests/tdefontdialogtest.cpp | 2 +- tdeui/tests/tdelistviewtest.cpp | 2 +- tdeui/tests/tdemainwindowrestoretest.cpp | 2 +- tdeui/tests/tdemainwindowtest.cpp | 2 +- tdeui/tests/tdepopuptest.cpp | 2 +- tdeui/tests/tdespelltest.cpp | 2 +- tdeui/tests/tdetoolbarlabelactiontest.cpp | 2 +- tdeui/tests/twindowtest.cpp | 4 +- tdeui/twindowlistmenu.cpp | 4 +- 130 files changed, 3006 insertions(+), 3006 deletions(-) delete mode 100644 tdeui/kaboutapplication.cpp delete mode 100644 tdeui/kaboutapplication.h delete mode 100644 tdeui/kaboutdialog.cpp delete mode 100644 tdeui/kaboutdialog.h delete mode 100644 tdeui/kaboutkde.cpp delete mode 100644 tdeui/kaboutkde.h create mode 100644 tdeui/tdeaboutapplication.cpp create mode 100644 tdeui/tdeaboutapplication.h create mode 100644 tdeui/tdeaboutdialog.cpp create mode 100644 tdeui/tdeaboutdialog.h create mode 100644 tdeui/tdeabouttde.cpp create mode 100644 tdeui/tdeabouttde.h (limited to 'tdeui') diff --git a/tdeui/CMakeLists.txt b/tdeui/CMakeLists.txt index b8e11ed32..85d2fc9b4 100644 --- a/tdeui/CMakeLists.txt +++ b/tdeui/CMakeLists.txt @@ -53,7 +53,7 @@ install( FILES klineeditdlg.h kinputdialog.h kactivelabel.h kcharselect.h kcolordrag.h qxembed.h knumvalidator.h kdialog.h kdialogbase.h - kjanuswidget.h kaboutdialog.h + kjanuswidget.h tdeaboutdialog.h kauthicon.h kmessagebox.h ksharedpixmap.h kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h tdetoolbarradiogroup.h ktextbrowser.h @@ -64,7 +64,7 @@ install( FILES kxmlguiclient.h kxmlgui.h kxmlguibuilder.h kxmlguifactory.h kpixmapio.h kwordwrap.h kedittoolbar.h kdockwidget.h kanimwidget.h - krootpixmap.h kaboutkde.h kaboutapplication.h + krootpixmap.h tdeabouttde.h tdeaboutapplication.h kpanelapplet.h kpushbutton.h kdcopactionproxy.h kcolorcombo.h kpanelextension.h tdecompletionbox.h ksqueezedtextlabel.h kcommand.h twindowlistmenu.h tdefontcombo.h tdeaccelgen.h ktip.h @@ -117,7 +117,7 @@ set( ${target}_SRCS kruler.cpp kcursor.cpp klineeditdlg.cpp kcharselect.cpp kcolordrag.cpp knumvalidator.cpp kdialog.cpp kdialogbase.cpp - kjanuswidget.cpp kaboutdialog.cpp + kjanuswidget.cpp tdeaboutdialog.cpp kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp @@ -126,8 +126,8 @@ set( ${target}_SRCS kcombobox.cpp kpassdlg.cpp kxmlguiclient.cpp kxmlguifactory.cpp kxmlguifactory_p.cpp kxmlguibuilder.cpp kedittoolbar.cpp kpanelappmenu.cpp kdockwidget.cpp kdockwidget_private.cpp - kanimwidget.cpp krootpixmap.cpp kaboutkde.cpp - kaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp + kanimwidget.cpp krootpixmap.cpp tdeabouttde.cpp + tdeaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp kcolorcombo.cpp kpushbutton.cpp kpanelextension.cpp tdecompletionbox.cpp ksqueezedtextlabel.cpp tdecmodule.cpp kcommand.cpp twindowlistmenu.cpp tdefontcombo.cpp ktip.cpp diff --git a/tdeui/MAINTAINERS b/tdeui/MAINTAINERS index 4e22d00a0..f4e2165fb 100644 --- a/tdeui/MAINTAINERS +++ b/tdeui/MAINTAINERS @@ -5,9 +5,9 @@ that class. When adding yourself as a maintainer, don't be afraid to reorder the files to a more logical grouping. -kaboutapplication.cpp -kaboutdialog.cpp -kaboutkde.cpp +tdeaboutapplication.cpp +tdeaboutdialog.cpp +tdeabouttde.cpp tdeaction.cpp Holger Freyther , Martijn Klingens kanimwidget.cpp Waldo Bastian karrowbutton.cpp Frerich Raabe diff --git a/tdeui/Makefile.am b/tdeui/Makefile.am index 4a1b472ff..26a9423cd 100644 --- a/tdeui/Makefile.am +++ b/tdeui/Makefile.am @@ -50,7 +50,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ klineeditdlg.h kinputdialog.h kactivelabel.h \ kcharselect.h kcolordrag.h qxembed.h \ knumvalidator.h kdialog.h kdialogbase.h \ - kjanuswidget.h kaboutdialog.h \ + kjanuswidget.h tdeaboutdialog.h \ kauthicon.h kmessagebox.h ksharedpixmap.h \ kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h \ tdetoolbarradiogroup.h ktextbrowser.h \ @@ -61,7 +61,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ kxmlguiclient.h kxmlgui.h kxmlguibuilder.h kxmlguifactory.h \ kpixmapio.h kwordwrap.h \ kedittoolbar.h kdockwidget.h kanimwidget.h \ - krootpixmap.h kaboutkde.h kaboutapplication.h \ + krootpixmap.h tdeabouttde.h tdeaboutapplication.h \ kpanelapplet.h kpushbutton.h kdcopactionproxy.h kcolorcombo.h \ kpanelextension.h tdecompletionbox.h ksqueezedtextlabel.h \ kcommand.h twindowlistmenu.h tdefontcombo.h tdeaccelgen.h ktip.h \ @@ -98,7 +98,7 @@ libtdeui_la_SOURCES = \ kruler.cpp kcursor.cpp klineeditdlg.cpp \ kcharselect.cpp kcolordrag.cpp \ knumvalidator.cpp kdialog.cpp kdialogbase.cpp \ - kjanuswidget.cpp kaboutdialog.cpp \ + kjanuswidget.cpp tdeaboutdialog.cpp \ kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp \ tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp \ ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp \ @@ -107,8 +107,8 @@ libtdeui_la_SOURCES = \ kcombobox.cpp kpassdlg.cpp kxmlguiclient.cpp kxmlguifactory.cpp \ kxmlguifactory_p.cpp kxmlguibuilder.cpp kedittoolbar.cpp \ kpanelappmenu.cpp kdockwidget.cpp kdockwidget_private.cpp \ - kanimwidget.cpp krootpixmap.cpp kaboutkde.cpp \ - kaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp \ + kanimwidget.cpp krootpixmap.cpp tdeabouttde.cpp \ + tdeaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp \ kcolorcombo.cpp kpushbutton.cpp kpanelextension.cpp \ tdecompletionbox.cpp ksqueezedtextlabel.cpp tdecmodule.cpp \ kcommand.cpp twindowlistmenu.cpp tdefontcombo.cpp ktip.cpp \ diff --git a/tdeui/kaboutapplication.cpp b/tdeui/kaboutapplication.cpp deleted file mode 100644 index 681b22642..000000000 --- a/tdeui/kaboutapplication.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and - * Espen Sand (espen@kde.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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. - * - */ - -// I (espen) prefer that header files are included alphabetically - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ktextedit.h" - -TDEAboutApplication::TDEAboutApplication( TQWidget *parent, const char *name, - bool modal ) - :TDEAboutDialog( AbtTabbed|AbtProduct, - kapp ? kapp->caption() : TQString::null, - Close, Close, - parent, name, modal ) -{ - buildDialog(TDEGlobal::instance()->aboutData()); -} - -TDEAboutApplication::TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent, - const char *name, bool modal ) - :TDEAboutDialog( AbtTabbed|AbtProduct, aboutData->programName(), Close, Close, - parent, name, modal ) -{ - buildDialog(aboutData); -} - -void TDEAboutApplication::buildDialog( const TDEAboutData *aboutData ) -{ - if( !aboutData ) - { - // - // Recovery - // - - //i18n "??" is displayed as (pseudo-)version when no data is known about the application - setProduct( kapp ? kapp->caption() : TQString::null, i18n("??"), TQString::null, TQString::null ); - TDEAboutContainer *appPage = addContainerPage( i18n("&About")); - - TQString appPageText = - i18n("No information available.\n" - "The supplied TDEAboutData object does not exist."); - TQLabel *appPageLabel = new TQLabel( "\n\n\n\n"+appPageText+"\n\n\n\n", 0 ); - appPage->addWidget( appPageLabel ); - return; - } - - setProduct( aboutData->programName(), aboutData->version(), - TQString::null, TQString::null ); - - if (!aboutData->programLogo().isNull()) - setProgramLogo( aboutData->programLogo() ); - - TQString appPageText = aboutData->shortDescription() + "\n"; - - if (!aboutData->otherText().isEmpty()) - appPageText += "\n" + aboutData->otherText()+"\n"; - - if (!aboutData->copyrightStatement().isEmpty()) - appPageText += "\n" + aboutData->copyrightStatement()+"\n"; - - TDEAboutContainer *appPage = addContainerPage( i18n("&About")); - - TQLabel *appPageLabel = new TQLabel( appPageText, 0 ); - appPage->addWidget( appPageLabel ); - - if (!aboutData->homepage().isEmpty()) - { - KURLLabel *url = new KURLLabel(); - url->setText(aboutData->homepage()); - url->setURL(aboutData->homepage()); - appPage->addWidget( url ); - connect( url, TQT_SIGNAL(leftClickedURL(const TQString &)), - this, TQT_SLOT(openURLSlot(const TQString &))); - } - - int authorCount = aboutData->authors().count(); - if (authorCount) - { - TQString authorPageTitle = authorCount == 1 ? - i18n("A&uthor") : i18n("A&uthors"); - TDEAboutContainer *authorPage = addScrolledContainerPage( authorPageTitle ); - - if (!aboutData->customAuthorTextEnabled() || !aboutData->customAuthorRichText().isEmpty ()) - { - TQString text; - KActiveLabel* activeLabel = new KActiveLabel( authorPage ); - if (!aboutData->customAuthorTextEnabled()) - { - if ( aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "submit@bugs.pearsoncomputing.net") - text = i18n( "Please use http://bugs.pearsoncomputing.net to report bugs.\n" ); - else { - if( aboutData->authors().count() == 1 && ( aboutData->authors().first().emailAddress() == aboutData->bugAddress() ) ) - { - text = i18n( "Please report bugs to %2.\n" ).arg( aboutData->authors().first().emailAddress() ).arg( aboutData->authors().first().emailAddress() ); - } - else { - text = i18n( "Please report bugs to %2.\n" ).arg(aboutData->bugAddress()).arg(aboutData->bugAddress() ); - } - } - } - else - { - text = aboutData->customAuthorRichText(); - } - activeLabel->setText( text ); - authorPage->addWidget( activeLabel ); - } - - TQValueList::ConstIterator it; - for (it = aboutData->authors().begin(); - it != aboutData->authors().end(); ++it) - { - authorPage->addPerson( (*it).name(), (*it).emailAddress(), - (*it).webAddress(), (*it).task() ); - } - } - - int creditsCount = aboutData->credits().count(); - if (creditsCount) - { - TDEAboutContainer *creditsPage = - addScrolledContainerPage( i18n("&Thanks To") ); - TQValueList::ConstIterator it; - for (it = aboutData->credits().begin(); - it != aboutData->credits().end(); ++it) - { - creditsPage->addPerson( (*it).name(), (*it).emailAddress(), - (*it).webAddress(), (*it).task() ); - } - } - - const TQValueList translatorList = aboutData->translators(); - - if(translatorList.count() > 0) - { - TQString text = ""; - - TQValueList::ConstIterator it; - for(it = translatorList.begin(); it != translatorList.end(); ++it) - { - text += TQString("

%1
   " - "%2

") - .arg((*it).name()) - .arg((*it).emailAddress()) - .arg((*it).emailAddress()); - } - - text += TDEAboutData::aboutTranslationTeam() + "
"; - addTextPage( i18n("T&ranslation"), text, true); - } - - if (!aboutData->license().isEmpty() ) - { - addLicensePage( i18n("&License Agreement"), aboutData->license() ); - } - - // - // Make sure the dialog has a reasonable width - // - setInitialSize( TQSize(400,1) ); -} diff --git a/tdeui/kaboutapplication.h b/tdeui/kaboutapplication.h deleted file mode 100644 index c313460ff..000000000 --- a/tdeui/kaboutapplication.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and - * Espen Sand (espen@kde.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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. - * - */ - -#ifndef _KABOUT_APPLICATION_H_ -#define _KABOUT_APPLICATION_H_ - -#include -#include - -/** - * @short Standard "About Application" dialog box. - * - * This class provides the standard "About Application" dialog box - * that is used by KHelpMenu. It uses the information of the global - * TDEAboutData that is specified at the start of your program in - * main(). Normally you should not use this class directly but rather - * the KHelpMenu class or even better just subclass your toplevel - * window from TDEMainWindow. If you do the latter, the help menu and - * thereby this dialog box is available through the - * TDEMainWindow::helpMenu() function. - * - * @author Waldo Bastian (bastian@kde.org) and Espen Sand (espen@kde.org) - */ - -class TDEUI_EXPORT TDEAboutApplication : public TDEAboutDialog -{ - public: - /** - * Constructor. Creates a fully featured "About Application" dialog box. - * Note that this dialog is made modeless in the KHelpMenu class so - * the users may expect a modeless dialog. - * - * @param parent The parent of the dialog box. You should use the - * toplevel window so that the dialog becomes centered. - * @param name Internal name of the widget. This name is not used in the - * caption. - * @param modal If false, this widget will be modeless and must be - * made visible using TQWidget::show(). Otherwise it will be - * modal and must be made visible using TQWidget::exec(). - */ - TDEAboutApplication( TQWidget *parent=0, const char *name=0, bool modal=true ); - - /** - * Constructor. Mostly does the same stuff as the previous constructor, except - * that it can take a custom TDEAboutData object instead of the one specified - * in your main() function. This is especially useful for applications - * which are implemented as (dynamically loaded) libraries, e.g. panel - * applets. - * - * @param aboutData A pointer to a TDEAboutData object which data - * will be used for filling the dialog. - * @param parent The parent of the dialog box. You should use the - * toplevel window so that the dialog becomes centered. - * @param name Internal name of the widget. This name is not used in the - * caption. - * @param modal If false, this widget will be modeless and must be - * made visible using TQWidget::show(). Otherwise it will be - * modal and must be made visible using TQWidget::exec(). - */ - TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent=0, const char *name=0, bool modal=true ); - -/* - FIXME: The two constructors should be replaced with the following after the lib freeze: - - TDEAboutApplication( const TDEAboutData *aboutData=0, TQWidget *parent=0, const char *name=0, bool modal=true ); - - This will make buildDialog() obsolete as well (Frerich). -*/ - protected: - void buildDialog( const TDEAboutData *aboutData ); -}; - - -#endif - diff --git a/tdeui/kaboutdialog.cpp b/tdeui/kaboutdialog.cpp deleted file mode 100644 index 7cc1c6327..000000000 --- a/tdeui/kaboutdialog.cpp +++ /dev/null @@ -1,1797 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 1999-2001 Mirko Boehm and - * Espen Sand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//MOC_SKIP_BEGIN -template class TQPtrList; -//MOC_SKIP_END - -#define WORKTEXT_IDENTATION 16 -#define Grid 3 - -// ############################################################## -// MOC OUTPUT FILES: -#include "kaboutdialog.moc" -#include "kaboutdialog_private.moc" -// ############################################################## - -class TDEAboutTabWidget : public TQTabWidget -{ -public: - TDEAboutTabWidget( TQWidget* parent ) : TQTabWidget( parent ) {} - TQSize sizeHint() const { - return TQTabWidget::sizeHint().expandedTo( tabBar()->sizeHint() + TQSize(4,4) ); - } -}; - - - - -TDEAboutContributor::TDEAboutContributor( TQWidget *_parent, const char *wname, - const TQString &_name,const TQString &_email, - const TQString &_url, const TQString &_work, - bool showHeader, bool showFrame, - bool showBold ) - : TQFrame( _parent, wname ), mShowHeader(showHeader), mShowBold(showBold), d(0) -{ - if( showFrame ) - { - setFrameStyle(TQFrame::Panel | TQFrame::Raised); - } - - mLabel[0] = new TQLabel( this ); - mLabel[1] = new TQLabel( this ); - mLabel[2] = new TQLabel( this ); - mLabel[3] = new TQLabel( this ); - mText[0] = new TQLabel( this ); - mText[1] = new KURLLabel( this ); - mText[2] = new KURLLabel( this ); - mText[3] = new TQLabel( this ); - - setName( _name, i18n("Author"), false ); - setEmail( _email, i18n("Email"), false ); - setURL( _url, i18n("Homepage"), false ); - setWork( _work, i18n("Task"), false ); - - KURLLabel *kurl = static_cast(mText[1]); - kurl->setFloat(true); - kurl->setUnderline(true); - kurl->setMargin(0); - connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), - TQT_SLOT(emailClickedSlot(const TQString &))); - - kurl = static_cast(mText[2]); - kurl->setFloat(true); - kurl->setUnderline(true); - kurl->setMargin(0); - connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), - TQT_SLOT(urlClickedSlot(const TQString &))); - - mLabel[3]->setAlignment( AlignTop ); - - fontChange( font() ); - updateLayout(); -} - - -void TDEAboutContributor::setName( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[0]->setText(_header); - mText[0]->setText(_text); - if( _update ) { updateLayout(); } -} - - -void TDEAboutContributor::setEmail( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[1]->setText(_header); - KURLLabel* const kurl = static_cast(mText[1]); - kurl->setText(_text); - kurl->setURL(_text); - if( _update ) { updateLayout(); } -} - - -void TDEAboutContributor::setURL( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[2]->setText(_header); - KURLLabel* const kurl = static_cast(mText[2]); - kurl->setText(_text); - kurl->setURL(_text); - if( _update ) { updateLayout(); } -} - - -void TDEAboutContributor::setWork( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[3]->setText(_header); - mText[3]->setText(_text); - if( _update ) { updateLayout(); } -} - - -TQString TDEAboutContributor::getName( void ) const -{ - return mText[0]->text(); -} - - -TQString TDEAboutContributor::getEmail( void ) const -{ - return mText[1]->text(); -} - - -TQString TDEAboutContributor::getURL( void ) const -{ - return mText[2]->text(); -} - - -TQString TDEAboutContributor::getWork( void ) const -{ - return mText[3]->text(); -} - - - -void TDEAboutContributor::updateLayout( void ) -{ - delete layout(); - - int row = 0; - if( !mText[0]->text().isEmpty() ) { ++row; } - if( !mText[1]->text().isEmpty() ) { ++row; } - if( !mText[2]->text().isEmpty() ) { ++row; } - if( !mText[3]->text().isEmpty() ) { ++row; } - - - TQGridLayout *gbox; - if( row == 0 ) - { - gbox = new TQGridLayout( this, 1, 1, 0 ); - for( int i=0; i<4; ++i ) - { - mLabel[i]->hide(); - mText[i]->hide(); - } - } - else - { - if( mText[0]->text().isEmpty() && !mShowHeader ) - { - gbox = new TQGridLayout( this, row, 1, frameWidth()+1, 2 ); - } - else - { - gbox = new TQGridLayout( this, row, 2, frameWidth()+1, 2 ); - if( !mShowHeader ) - { - gbox->addColSpacing( 0, KDialog::spacingHint()*2 ); - } - gbox->setColStretch( 1, 10 ); - } - - for( int i=0, r=0; i<4; ++i ) - { - mLabel[i]->setFixedHeight( fontMetrics().lineSpacing() ); - if( i != 3 ) - { - mText[i]->setFixedHeight( fontMetrics().lineSpacing() ); - } - - if( !mText[i]->text().isEmpty() ) - { - if( mShowHeader ) - { - gbox->addWidget( TQT_TQWIDGET(mLabel[i]), r, 0, (TQ_Alignment)AlignLeft ); - gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); - mLabel[i]->show(); - mText[i]->show(); - } - else - { - mLabel[i]->hide(); - if( !i ) - { - gbox->addMultiCellWidget( TQT_TQWIDGET(mText[i]), r, r, 0, 1, (TQ_Alignment)AlignLeft ); - } - else - { - gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); - } - mText[i]->show(); - } - ++r; - } - else - { - mLabel[i]->hide(); - mText[i]->hide(); - } - } - } - - gbox->activate(); - setMinimumSize( sizeHint() ); -} - - -void TDEAboutContributor::fontChange( const TQFont &/*oldFont*/ ) -{ - if( mShowBold ) - { - TQFont f( font() ); - f.setBold( true ); - mText[0]->setFont( f ); - } - update(); -} - - -TQSize TDEAboutContributor::sizeHint( void ) const -{ - return minimumSizeHint(); -} - - -void TDEAboutContributor::urlClickedSlot( const TQString &u ) -{ - emit openURL(u); -} - - -void TDEAboutContributor::emailClickedSlot( const TQString &e ) -{ - emit sendEmail( mText[0]->text(), e ) ; -} - - -// -// Internal widget for the TDEAboutDialog class. -// -TDEAboutContainerBase::TDEAboutContainerBase( int layoutType, TQWidget *_parent, - char *_name ) - : TQWidget( _parent, _name ), - mImageLabel(0), mTitleLabel(0), mIconLabel(0),mVersionLabel(0), - mAuthorLabel(0), mImageFrame(0),mPageTab(0),mPlainSpace(0),d(0) -{ - mTopLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - if( !mTopLayout ) { return; } - - if( layoutType & AbtImageOnly ) - { - layoutType &= ~(AbtImageLeft|AbtImageRight|AbtTabbed|AbtPlain); - } - if( layoutType & AbtImageLeft ) - { - layoutType &= ~AbtImageRight; - } - - if( layoutType & AbtTitle ) - { - mTitleLabel = new TQLabel( this, "title" ); - mTitleLabel->setAlignment(AlignCenter); - mTopLayout->addWidget( mTitleLabel ); - mTopLayout->addSpacing( KDialog::spacingHint() ); - } - - if( layoutType & AbtProduct ) - { - TQWidget* const productArea = new TQWidget( this, "area" ); - mTopLayout->addWidget( productArea, 0, TQApplication::reverseLayout() ? AlignRight : AlignLeft ); - - TQHBoxLayout* const hbox = new TQHBoxLayout(productArea,0,KDialog::spacingHint()); - if( !hbox ) { return; } - - mIconLabel = new TQLabel( productArea ); - hbox->addWidget( mIconLabel, 0, AlignLeft|AlignHCenter ); - - TQVBoxLayout* const vbox = new TQVBoxLayout(); - if( !vbox ) { return; } - hbox->addLayout( vbox ); - - mVersionLabel = new TQLabel( productArea, "version" ); - mAuthorLabel = new TQLabel( productArea, "author" ); - vbox->addWidget( mVersionLabel ); - vbox->addWidget( mAuthorLabel ); - hbox->activate(); - - mTopLayout->addSpacing( KDialog::spacingHint() ); - } - - TQHBoxLayout* const hbox = new TQHBoxLayout(); - if( !hbox ) { return; } - mTopLayout->addLayout( hbox, 10 ); - - if( layoutType & AbtImageLeft ) - { - TQVBoxLayout* vbox = new TQVBoxLayout(); - hbox->addLayout(vbox); - vbox->addSpacing(1); - mImageFrame = new TQFrame( this ); - setImageFrame( true ); - vbox->addWidget( mImageFrame ); - vbox->addSpacing(1); - - vbox = new TQVBoxLayout( mImageFrame, 1 ); - mImageLabel = new KImageTrackLabel( mImageFrame ); - connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), - TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); - vbox->addStretch(10); - vbox->addWidget( mImageLabel ); - vbox->addStretch(10); - vbox->activate(); - } - - if( layoutType & AbtTabbed ) - { - mPageTab = new TDEAboutTabWidget( this ); - if( !mPageTab ) { return; } - hbox->addWidget( mPageTab, 10 ); - } - else if( layoutType & AbtImageOnly ) - { - mImageFrame = new TQFrame( this ); - setImageFrame( true ); - hbox->addWidget( mImageFrame, 10 ); - - TQGridLayout* const gbox = new TQGridLayout(mImageFrame, 3, 3, 1, 0 ); - gbox->setRowStretch( 0, 10 ); - gbox->setRowStretch( 2, 10 ); - gbox->setColStretch( 0, 10 ); - gbox->setColStretch( 2, 10 ); - - mImageLabel = new KImageTrackLabel( mImageFrame ); - connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), - TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); - gbox->addWidget( mImageLabel, 1, 1 ); - gbox->activate(); - } - else - { - mPlainSpace = new TQFrame( this ); - if( !mPlainSpace ) { return; } - hbox->addWidget( mPlainSpace, 10 ); - } - - if( layoutType & AbtImageRight ) - { - TQVBoxLayout *vbox = new TQVBoxLayout(); - hbox->addLayout(vbox); - vbox->addSpacing(1); - mImageFrame = new TQFrame( this ); - setImageFrame( true ); - vbox->addWidget( mImageFrame ); - vbox->addSpacing(1); - - vbox = new TQVBoxLayout( mImageFrame, 1 ); - mImageLabel = new KImageTrackLabel( mImageFrame ); - connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), - TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); - vbox->addStretch(10); - vbox->addWidget( mImageLabel ); - vbox->addStretch(10); - vbox->activate(); - } - - fontChange( font() ); -} - - -void TDEAboutContainerBase::show( void ) -{ - TQWidget::show(); -} - -TQSize TDEAboutContainerBase::sizeHint( void ) const -{ - return minimumSize().expandedTo( TQSize( TQWidget::sizeHint().width(), 0 ) ); -} - -void TDEAboutContainerBase::fontChange( const TQFont &/*oldFont*/ ) -{ - if( mTitleLabel ) - { - TQFont f( TDEGlobalSettings::generalFont() ); - f.setBold( true ); - int fs = f.pointSize(); - if (fs == -1) - fs = TQFontInfo(f).pointSize(); - f.setPointSize( fs+2 ); // Lets not make it too big - mTitleLabel->setFont(f); - } - - if( mVersionLabel ) - { - TQFont f( TDEGlobalSettings::generalFont() ); - f.setBold( true ); - mVersionLabel->setFont(f); - mAuthorLabel->setFont(f); - mVersionLabel->parentWidget()->layout()->activate(); - } - - update(); -} - -TQFrame *TDEAboutContainerBase::addTextPage( const TQString &title, - const TQString &text, - bool richText, int numLines ) -{ - TQFrame* const page = addEmptyPage( title ); - if( !page ) { return 0; } - if( numLines <= 0 ) { numLines = 10; } - - TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); - - if( richText ) - { - KTextBrowser* const browser = new KTextBrowser( page, "browser" ); - browser->setHScrollBarMode( TQScrollView::AlwaysOff ); - browser->setText( text ); - browser->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); - - vbox->addWidget(browser); - connect(browser, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(browser, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - } - else - { - KTextEdit* const textEdit = new KTextEdit( page, "text" ); - textEdit->setReadOnly( true ); - textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); - textEdit->setWordWrap( TQTextEdit::NoWrap ); - vbox->addWidget( textEdit ); - } - - return page; -} - -TQFrame *TDEAboutContainerBase::addLicensePage( const TQString &title, - const TQString &text, int numLines) -{ - TQFrame* const page = addEmptyPage( title ); - if( !page ) { return 0; } - if( numLines <= 0 ) { numLines = 10; } - - TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); - - KTextEdit* const textEdit = new KTextEdit( page, "license" ); - textEdit->setFont( TDEGlobalSettings::fixedFont() ); - textEdit->setReadOnly( true ); - textEdit->setWordWrap( TQTextEdit::NoWrap ); - textEdit->setText( text ); - textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); - vbox->addWidget( textEdit ); - return page; -} - - -TDEAboutContainer *TDEAboutContainerBase::addContainerPage( const TQString &title, - int childAlignment, - int innerAlignment ) -{ - if( !mPageTab ) - { - kdDebug(291) << "addPage: " << "Invalid layout" << endl; - return 0; - } - - TDEAboutContainer* const container = new TDEAboutContainer( mPageTab, "container", - KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, - innerAlignment ); - mPageTab->addTab( container, title ); - - connect(container, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - - return container; -} - - -TDEAboutContainer *TDEAboutContainerBase::addScrolledContainerPage( - const TQString &title, - int childAlignment, - int innerAlignment ) -{ - if( !mPageTab ) - { - kdDebug(291) << "addPage: " << "Invalid layout" << endl; - return 0; - } - - TQFrame* const page = addEmptyPage( title ); - TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); - TQScrollView* const scrollView = new TQScrollView( page ); - scrollView->viewport()->setBackgroundMode( PaletteBackground ); - vbox->addWidget( scrollView ); - - TDEAboutContainer* const container = new TDEAboutContainer( scrollView, "container", - KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, - innerAlignment ); - scrollView->addChild( container ); - - - connect(container, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - - return container; -} - - -TQFrame *TDEAboutContainerBase::addEmptyPage( const TQString &title ) -{ - if( !mPageTab ) - { - kdDebug(291) << "addPage: " << "Invalid layout" << endl; - return 0; - } - - TQFrame* const page = new TQFrame( mPageTab, title.latin1() ); - page->setFrameStyle( TQFrame::NoFrame ); - - mPageTab->addTab( page, title ); - return page; -} - - -TDEAboutContainer *TDEAboutContainerBase::addContainer( int childAlignment, - int innerAlignment ) -{ - TDEAboutContainer* const container = new TDEAboutContainer( this, "container", - 0, KDialog::spacingHint(), childAlignment, innerAlignment ); - mTopLayout->addWidget( container, 0, childAlignment ); - - connect(container, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - - return container; -} - - - -void TDEAboutContainerBase::setTitle( const TQString &title ) -{ - if( !mTitleLabel ) - { - kdDebug(291) << "setTitle: " << "Invalid layout" << endl; - return; - } - mTitleLabel->setText(title); -} - - -void TDEAboutContainerBase::setImage( const TQString &fileName ) -{ - if( !mImageLabel ) - { - kdDebug(291) << "setImage: " << "Invalid layout" << endl; - return; - } - if( fileName.isNull() ) - { - return; - } - - const TQPixmap logo( fileName ); - if( !logo.isNull() ) - mImageLabel->setPixmap( logo ); - - mImageFrame->layout()->activate(); -} - -void TDEAboutContainerBase::setProgramLogo( const TQString &fileName ) -{ - if( fileName.isNull() ) - { - return; - } - - const TQPixmap logo( fileName ); - setProgramLogo( logo ); -} - -void TDEAboutContainerBase::setProgramLogo( const TQPixmap &pixmap ) -{ - if( !mIconLabel ) - { - kdDebug(291) << "setProgramLogo: " << "Invalid layout" << endl; - return; - } - if( !pixmap.isNull() ) - { - mIconLabel->setPixmap( pixmap ); - } -} - -void TDEAboutContainerBase::setImageBackgroundColor( const TQColor &color ) -{ - if( mImageFrame ) - { - mImageFrame->setBackgroundColor( color ); - } -} - - -void TDEAboutContainerBase::setImageFrame( bool state ) -{ - if( mImageFrame ) - { - if( state ) - { - mImageFrame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - mImageFrame->setLineWidth(1); - } - else - { - mImageFrame->setFrameStyle( TQFrame::NoFrame ); - mImageFrame->setLineWidth(0); - } - } -} - - -void TDEAboutContainerBase::setProduct( const TQString &appName, - const TQString &version, - const TQString &author, - const TQString &year ) -{ - if( !mIconLabel ) - { - kdDebug(291) << "setProduct: " << "Invalid layout" << endl; - return; - } - - if ( kapp ) - { - mIconLabel->setPixmap( kapp->icon() ); - kdDebug(291) << "setPixmap (iconName): " << kapp->iconName() << endl; - } - else - kdDebug(291) << "no kapp" << endl; - - const TQString msg1 = i18n("%1 %2 (Using Trinity %3)").arg(appName).arg(version). - arg(TQString::fromLatin1(TDE_VERSION_STRING)); - const TQString msg2 = !year.isEmpty() ? i18n("%1 %2, %3").arg('©').arg(year). - arg(author) : TQString::fromLatin1(""); - - //if (!year.isEmpty()) - // msg2 = i18n("%1 %2, %3").arg('©').arg(year).arg(author); - - mVersionLabel->setText( msg1 ); - mAuthorLabel->setText( msg2 ); - if( msg2.isEmpty() ) - { - mAuthorLabel->hide(); - } - - mIconLabel->parentWidget()->layout()->activate(); -} - - -void TDEAboutContainerBase::slotMouseTrack( int mode, const TQMouseEvent *e ) -{ - emit mouseTrack( mode, e ); -} - - -void TDEAboutContainerBase::slotUrlClick( const TQString &url ) -{ - emit urlClick( url ); -} - -void TDEAboutContainerBase::slotMailClick( const TQString &_name, - const TQString &_address ) -{ - emit mailClick( _name, _address ); -} - - - -TDEAboutContainer::TDEAboutContainer( TQWidget *_parent, const char *_name, - int _margin, int _spacing, - int childAlignment, int innerAlignment ) - : TQFrame( _parent, _name ), d(0) -{ - mAlignment = innerAlignment; - - TQGridLayout* const gbox = new TQGridLayout( this, 3, 3, _margin, _spacing ); - if( childAlignment & AlignHCenter ) - { - gbox->setColStretch( 0, 10 ); - gbox->setColStretch( 2, 10 ); - } - else if( childAlignment & AlignRight ) - { - gbox->setColStretch( 0, 10 ); - } - else - { - gbox->setColStretch( 2, 10 ); - } - - if( childAlignment & AlignVCenter ) - { - gbox->setRowStretch( 0, 10 ); - gbox->setRowStretch( 2, 10 ); - } - else if( childAlignment & AlignRight ) - { - gbox->setRowStretch( 0, 10 ); - } - else - { - gbox->setRowStretch( 2, 10 ); - } - - mVbox = new TQVBoxLayout( _spacing ); - gbox->addLayout( mVbox, 1, 1 ); - gbox->activate(); -} - - -void TDEAboutContainer::childEvent( TQChildEvent *e ) -{ - if( !e->inserted() || !e->child()->isWidgetType() ) - { - return; - } - - TQWidget* const w = static_cast(e->child()); - mVbox->addWidget( w, 0, mAlignment ); - const TQSize s( sizeHint() ); - setMinimumSize( s ); - - TQObjectList const l = childrenListObject(); // silence please - TQObjectListIterator itr( l ); - TQObject * o; - while ( (o = itr.current()) ) { - ++itr; - if( o->isWidgetType() ) - { - TQT_TQWIDGET(o)->setMinimumWidth( s.width() ); - } - } -} - - -TQSize TDEAboutContainer::sizeHint( void ) const -{ - // - // The size is computed by adding the sizeHint().height() of all - // widget children and taking the width of the widest child and adding - // layout()->margin() and layout()->spacing() - // - - TQSize total_size; - - int numChild = 0; - TQObjectList const l = childrenListObject(); // silence please - - TQObjectListIterator itr( l ); - TQObject * o; - while ( (o = itr.current()) ) { - ++itr; - if( o->isWidgetType() ) - { - ++numChild; - TQWidget* const w= TQT_TQWIDGET(o); - - TQSize s = w->minimumSize(); - if( s.isEmpty() ) - { - s = w->minimumSizeHint(); - if( s.isEmpty() ) - { - s = w->sizeHint(); - if( s.isEmpty() ) - { - s = TQSize( 100, 100 ); // Default size - } - } - } - total_size.setHeight( total_size.height() + s.height() ); - if( s.width() > total_size.width() ) { total_size.setWidth( s.width() ); } - } - } - - if( numChild > 0 ) - { - // - // Seems I have to add 1 to the height to properly show the border - // of the last entry if layout()->margin() is 0 - // - - total_size.setHeight( total_size.height() + layout()->spacing()*(numChild-1) ); - total_size += TQSize( layout()->margin()*2, layout()->margin()*2 + 1 ); - } - else - { - total_size = TQSize( 1, 1 ); - } - return total_size; -} - - -TQSize TDEAboutContainer::minimumSizeHint( void ) const -{ - return sizeHint(); -} - - -void TDEAboutContainer::addWidget( TQWidget *widget ) -{ - widget->reparent( this, 0, TQPoint(0,0) ); -} - - -void TDEAboutContainer::addPerson( const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_task, - bool showHeader, bool showFrame,bool showBold) -{ - - TDEAboutContributor* const cont = new TDEAboutContributor( this, "pers", - _name, _email, _url, _task, showHeader, showFrame, showBold ); - connect( cont, TQT_SIGNAL( openURL(const TQString&)), - this, TQT_SIGNAL( urlClick(const TQString &))); - connect( cont, TQT_SIGNAL( sendEmail(const TQString &, const TQString &)), - this, TQT_SIGNAL( mailClick(const TQString &, const TQString &))); -} - - -void TDEAboutContainer::addTitle( const TQString &title, int alignment, - bool showFrame, bool showBold ) -{ - - TQLabel* const label = new TQLabel( title, this, "title" ); - if( showBold ) - { - TQFont labelFont( font() ); - labelFont.setBold( true ); - label->setFont( labelFont ); - } - if( showFrame ) - { - label->setFrameStyle(TQFrame::Panel | TQFrame::Raised); - } - label->setAlignment( alignment ); -} - - -void TDEAboutContainer::addImage( const TQString &fileName, int alignment ) -{ - if( fileName.isNull() ) - { - return; - } - - KImageTrackLabel* const label = new KImageTrackLabel( this, "image" ); - const TQImage logo( fileName ); - if( !logo.isNull() ) - { - TQPixmap pix; - pix = logo; - label->setPixmap( pix ); - } - label->setAlignment( alignment ); -} - -#if 0 -//MOC_SKIP_BEGIN - -/** Every person displayed is stored in a TDEAboutContributor object. - * Every contributor, the author and/or the maintainer of the application are - * stored in objects of this local class. Every single field may be empty. - * To add a contributor, create a TDEAboutContributor object as a child of your - * @ref TDEAboutDialog, set its contents and add it using add addContributor. */ -class TDEAboutContributor : public QFrame -{ - // ############################################################################ - Q_OBJECT - // ---------------------------------------------------------------------------- -public: - /** The Qt constructor. */ - TDEAboutContributor(TQWidget* parent=0, const char* name=0); - /** Set the name (a literal string). */ - void setName(const TQString&); - /** Get the name. */ - TQString getName(); - /** The email address (dito). */ - void setEmail(const TQString&); - /** Get the email address. */ - TQString getEmail(); - /** The URL (dito). */ - void setURL(const TQString&); - /** Get the URL. */ - TQString getURL(); - /** The tasks the person worked on (a literal string). More than one line is - * possible, but very long texts might look ugly. */ - void setWork(const TQString&); - /** The size hint. Very important here, since TDEAboutWidget relies on it for - * geometry management. */ - TQSize sizeHint(); - TQSize minimumSizeHint(void); - virtual void show( void ); - - // ---------------------------------------------------------------------------- -protected: - // events: - /** The resize event. */ - void resizeEvent(TQResizeEvent*); - /** The paint event. */ - void paintEvent(TQPaintEvent*); - /** The label showing the program version. */ - TQLabel *name; - /** The clickable URL label showing the email address. It is only visible if - * its text is not empty. */ - KURLLabel *email; - /** Another interactive part that displays the homepage URL. */ - KURLLabel *url; - /** The description of the contributions of the person. */ - TQString work; - // ---------------------------------------------------------------------------- -protected slots: - /** The homepage URL has been clicked. */ - void urlClickedSlot(const TQString&); - /** The email address has been clicked. */ - void emailClickedSlot(const TQString& emailaddress); - // ---------------------------------------------------------------------------- -signals: - /** The email address has been clicked. */ - void sendEmail(const TQString& name, const TQString& email); - /** The URL has been clicked. */ - void openURL(const TQString& url); - // ############################################################################ -}; - - - -TDEAboutContributor::TDEAboutContributor(TQWidget* parent, const char* n) - : TQFrame(parent, n), - name(new TQLabel(this)), - email(new KURLLabel(this)), - url(new KURLLabel(this)) -{ - // ############################################################ - if(name==0 || email==0) - { // this will nearly never happen (out of memory in about box?) - kdDebug() << "TDEAboutContributor::TDEAboutContributor: Out of memory." << endl; - tqApp->quit(); - } - setFrameStyle(TQFrame::Panel | TQFrame::Raised); - // ----- - connect(email, TQT_SIGNAL(leftClickedURL(const TQString&)), - TQT_SLOT(emailClickedSlot(const TQString&))); - connect(url, TQT_SIGNAL(leftClickedURL(const TQString&)), - TQT_SLOT(urlClickedSlot(const TQString&))); - // ############################################################ -} - -void -TDEAboutContributor::setName(const TQString& n) -{ - // ############################################################ - name->setText(n); - // ############################################################ -} - -QString -TDEAboutContributor::getName() -{ - // ########################################################### - return name->text(); - // ########################################################### -} -void -TDEAboutContributor::setURL(const TQString& u) -{ - // ########################################################### - url->setText(u); - // ########################################################### -} - -QString -TDEAboutContributor::getURL() -{ - // ########################################################### - return url->text(); - // ########################################################### -} - -void -TDEAboutContributor::setEmail(const TQString& e) -{ - // ########################################################### - email->setText(e); - // ########################################################### -} - -QString -TDEAboutContributor::getEmail() -{ - // ########################################################### - return email->text(); - // ########################################################### -} - -void -TDEAboutContributor::emailClickedSlot(const TQString& e) -{ - // ########################################################### - kdDebug() << "TDEAboutContributor::emailClickedSlot: called." << endl; - emit(sendEmail(name->text(), e)); - // ########################################################### -} - -void -TDEAboutContributor::urlClickedSlot(const TQString& u) -{ - // ########################################################### - kdDebug() << "TDEAboutContributor::urlClickedSlot: called." << endl; - emit(openURL(u)); - // ########################################################### -} - -void -TDEAboutContributor::setWork(const TQString& w) -{ - // ########################################################### - work=w; - // ########################################################### -} - -#endif - - -#if 0 -QSize -TDEAboutContributor::sizeHint() -{ - // ############################################################################ - const int FrameWidth=frameWidth(); - const int WorkTextWidth=200; - int maxx, maxy; - TQRect rect; - // ----- first calculate name and email width: - maxx=name->sizeHint().width(); - maxx=QMAX(maxx, email->sizeHint().width()+WORKTEXT_IDENTATION); - // ----- now determine "work" text rectangle: - if(!work.isEmpty()) // save time - { - rect=fontMetrics().boundingRect - (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); - } - if(maxxsizeHint().width()+WORKTEXT_IDENTATION); - // ----- - maxy=2*(name->sizeHint().height()+Grid); // need a space above the KURLLabels - maxy+=/* email */ name->sizeHint().height(); - maxy+=rect.height(); - // ----- - maxx+=2*FrameWidth; - maxy+=2*FrameWidth; - return TQSize(maxx, maxy); - // ############################################################################ -} - -TQSize TDEAboutContributor::minimumSizeHint(void) -{ - return( sizeHint() ); -} - - -void TDEAboutContributor::show( void ) -{ - TQFrame::show(); - setMinimumSize( sizeHint() ); -} - - - -void -TDEAboutContributor::resizeEvent(TQResizeEvent*) -{ // the widgets are simply aligned from top to bottom, since the parent is - // expected to respect the size hint - // ############################################################################ - int framewidth=frameWidth(), childwidth=width()-2*framewidth; - int cy=framewidth; - // ----- - name->setGeometry - (framewidth, framewidth, childwidth, name->sizeHint().height()); - cy=name->height()+Grid; - email->setGeometry - (framewidth+WORKTEXT_IDENTATION, cy, - childwidth-WORKTEXT_IDENTATION, /* email */ name->sizeHint().height()); - cy+=name->height()+Grid; - url->setGeometry - (framewidth+WORKTEXT_IDENTATION, cy, - childwidth-WORKTEXT_IDENTATION, /* url */ name->sizeHint().height()); - // the work text is drawn in the paint event - // ############################################################################ -} - - -void -TDEAboutContributor::paintEvent(TQPaintEvent* e) -{ // the widgets are simply aligned from top to bottom, since the parent is - // expected to respect the size hint (the widget is only used locally by now) - // ############################################################################ - int cy=frameWidth()+name->height()+email->height()+Grid+url->height()+Grid; - int h=height()-cy-frameWidth(); - int w=width()-WORKTEXT_IDENTATION-2*frameWidth(); - // ----- - TQFrame::paintEvent(e); - if(work.isEmpty()) return; - TQPainter paint(this); // construct painter only if there is something to draw - // ----- - paint.drawText(WORKTEXT_IDENTATION, cy, w, h, AlignLeft | WordBreak, work); - // ############################################################################ -} -// MOC_SKIP_END -#endif - - -#if 0 -TQSize TDEAboutContributor::sizeHint( void ) -{ - int s = KDialog::spacingHint(); - int h = fontMetrics().lineSpacing()*3 + 2*s; - int m = frameWidth(); - - int w = name->sizeHint().width(); - w = QMAX( w, email->sizeHint().width()+s); - w = QMAX( w, url->sizeHint().width()+s); - - if( work.isEmpty() == false ) - { - const int WorkTextWidth=200; - TQRect r = fontMetrics().boundingRect - (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); - if( w < r.width() ) - { - w = QMAX( w, WorkTextWidth+s ); - } - h += QMAX( fontMetrics().lineSpacing(), r.height() ) + s; - } - return( TQSize( w + 2*m, h + 2*m ) ); - - - /* - int s = 3; - int m = frameWidth() + KDialog::spacingHint(); - int h = ls * 3 + s * 2; - int w = name->sizeHint().width(); - - w = QMAX( w, email->sizeHint().width()+WORKTEXT_IDENTATION); - w = QMAX( w, url->sizeHint().width()+WORKTEXT_IDENTATION); - if( work.isEmpty() == false ) - { - const int WorkTextWidth=200; - - TQRect r = fontMetrics().boundingRect - (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); - if( w < r.width() ) - { - w = QMAX( w, WorkTextWidth + WORKTEXT_IDENTATION ); - } - h += r.height() + s; - } - return( TQSize( w + 2*m, h + 2*m ) ); - */ -} - - -// -// The widgets are simply aligned from top to bottom, since the parent is -// expected to respect the size hint -// -void TDEAboutContributor::resizeEvent(TQResizeEvent*) -{ - int x = frameWidth(); - int s = KDialog::spacingHint(); - int h = fontMetrics().lineSpacing(); - int w = width() - 2*x; - int y = x; - - name->setGeometry( x, y, w, h ); - y += h + s; - email->setGeometry( x+s, y, w-s, h ); - y += h + s; - url->setGeometry( x+s, y, w-s, h ); - - /* - int x = frameWidth() + KDialog::spacingHint(); - int y = x; - int w = width() - 2*x; - int h = name->sizeHint().height(); - int s = 3; - - name->setGeometry( x, y, w, h ); - y += h + s; - email->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); - y += h + s; - url->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); - // - // the work text is drawn in the paint event - // - */ -} - - - -void TDEAboutContributor::paintEvent( TQPaintEvent *e ) -{ - TQFrame::paintEvent(e); - if(work.isEmpty()) return; - - int x = frameWidth() + KDialog::spacingHint(); - int h = fontMetrics().lineSpacing(); - int y = height() - frameWidth() - fontMetrics().lineSpacing(); - int w = width() - frameWidth()*2 - KDialog::spacingHint(); - - TQPainter paint( this ); - paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); - - /* - - int s = 3; - int x = frameWidth() + KDialog::spacingHint() + WORKTEXT_IDENTATION; - int w = width()-WORKTEXT_IDENTATION-2*(frameWidth()+KDialog::spacingHint()); - int y = frameWidth()+KDialog::spacingHint()+(name->sizeHint().height()+s)*3; - int h = height()-y-frameWidth(); - - TQPainter paint( this ); - paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); - */ -} -#endif - - - - - - -TDEAboutWidget::TDEAboutWidget(TQWidget *_parent, const char *_name) - : TQWidget(_parent, _name), - version(new TQLabel(this)), - cont(new TQLabel(this)), - logo(new TQLabel(this)), - author(new TDEAboutContributor(this)), - maintainer(new TDEAboutContributor(this)), - showMaintainer(false), - d(0) -{ - // ################################################################# - if( !version || !cont || !logo || !author || !maintainer ) - { - // this will nearly never happen (out of memory in about box?) - kdDebug() << "TDEAboutWidget::TDEAboutWidget: Out of memory." << endl; - tqApp->quit(); - } - // ----- - cont->setText(i18n("Other Contributors:")); - logo->setText(i18n("(No logo available)")); - logo->setFrameStyle(TQFrame::Panel | TQFrame::Raised); - version->setAlignment(AlignCenter); - // ----- - connect(author, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(author, TQT_SIGNAL(openURL(const TQString&)), - TQT_SLOT(openURLSlot(const TQString&))); - connect(maintainer, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(maintainer, TQT_SIGNAL(openURL(const TQString&)), - TQT_SLOT(openURLSlot(const TQString&))); - // ################################################################# -} - - -void -TDEAboutWidget::adjust() -{ - // ################################################################# - int cx, cy, tempx; - int maintWidth, maintHeight; - TQSize total_size; - // ----- - if(showMaintainer) - { - total_size=maintainer->sizeHint(); - maintWidth=total_size.width(); - maintHeight=total_size.height(); - } else { - maintWidth=0; - maintHeight=0; - } - total_size=author->sizeHint(); - logo->adjustSize(); - cy=version->sizeHint().height()+Grid; - cx=logo->width(); - tempx=QMAX(total_size.width(), maintWidth); - cx+=Grid+tempx; - cx=QMAX(cx, version->sizeHint().width()); - cy+=QMAX(logo->height(), - total_size.height()+(showMaintainer ? Grid+maintHeight : 0)); - // ----- - if(!contributors.isEmpty()) - { - cx=QMAX(cx, cont->sizeHint().width()); - cy+=cont->sizeHint().height()+Grid; - TQPtrListIterator _pos(contributors); - TDEAboutContributor* currEntry; - while ( (currEntry = _pos.current()) ) - { - ++_pos; - cy+=currEntry->sizeHint().height(); - } - } - // ----- - setMinimumSize(cx, cy); - // ################################################################# -} - -void -TDEAboutWidget::setLogo(const TQPixmap& i) -{ - // ############################################################################ - logo->setPixmap(i); - // ############################################################################ -} - -void TDEAboutWidget::sendEmailSlot(const TQString &_name, const TQString &_email) -{ - emit(sendEmail(_name, _email)); -} - -void TDEAboutWidget::openURLSlot(const TQString& _url) -{ - emit(openURL(_url)); -} - -void -TDEAboutWidget::setAuthor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ############################################################################ - author->setName(_name); - author->setEmail(_email); - author->setURL(_url); - author->setWork(_w); - // ############################################################################ -} - -void -TDEAboutWidget::setMaintainer(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ############################################################################ - maintainer->setName(_name); - maintainer->setEmail(_email); - maintainer->setWork(_w); - maintainer->setURL(_url); - showMaintainer=true; - // ############################################################################ -} - -void -TDEAboutWidget::addContributor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ############################################################################ - TDEAboutContributor* const c=new TDEAboutContributor(this); - // ----- - c->setName(_name); - c->setEmail(_email); - c->setURL(_url); - c->setWork(_w); - contributors.append(c); - connect(c, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(c, TQT_SIGNAL(openURL(const TQString&)), TQT_SLOT(openURLSlot(const TQString&))); - // ############################################################################ -} - -void -TDEAboutWidget::setVersion(const TQString &_name) -{ - // ############################################################################ - version->setText(_name); - // ############################################################################ -} - -void -TDEAboutWidget::resizeEvent(TQResizeEvent*) -{ - // ############################################################################ - int _x=0, _y, cx, tempx, tempy; - // ----- set version label geometry: - version->setGeometry(0, 0, width(), version->sizeHint().height()); - _y=version->height()+Grid; - // ----- move logo to correct position: - logo->adjustSize(); - logo->move(0, _y); - // ----- move author and maintainer right to it: - tempx=logo->width()+Grid; - cx=width()-tempx; - author->setGeometry - (tempx, _y, cx, author->sizeHint().height()); - maintainer->setGeometry - (tempx, _y+author->height()+Grid, cx, maintainer->sizeHint().height()); - - _y+=QMAX(logo->height(), - author->height()+(showMaintainer ? Grid+maintainer->height() : 0)); - // ----- - if(!contributors.isEmpty()) - { - tempy=cont->sizeHint().height(); - cont->setGeometry(0, _y, width(), tempy); - cont->show(); - _y+=tempy+Grid; - } else { - cont->hide(); - } - TQPtrListIterator _pos(contributors); - TDEAboutContributor* currEntry; - while( (currEntry = _pos.current()) ) - { - ++_pos; - tempy=currEntry->sizeHint().height(); - // y+=Grid; - currEntry->setGeometry(_x, _y, width(), tempy); - _y+=tempy; - } - if(showMaintainer) - { - maintainer->show(); - } else { - maintainer->hide(); - } - // ############################################################################ -} - -TDEAboutDialog::TDEAboutDialog(TQWidget *_parent, const char *_name, bool modal) - : KDialogBase(_parent, _name, modal, TQString::null, Ok, Ok ), - about(new TDEAboutWidget(this)), mContainerBase(0), d(0) -{ - // ################################################################# - if(!about) - { - // this will nearly never happen (out of memory in about box?) - kdDebug() << "TDEAboutDialog::TDEAboutDialog: Out of memory." << endl; - tqApp->quit(); - } - setMainWidget(about); - connect(about, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(about, TQT_SIGNAL(openURL(const TQString&)), - TQT_SLOT(openURLSlot(const TQString&))); - // ################################################################# -} - - -TDEAboutDialog::TDEAboutDialog( int layoutType, const TQString &_caption, - int buttonMask, ButtonCode defaultButton, - TQWidget *_parent, const char *_name, bool modal, - bool separator, const TQString &user1, - const TQString &user2, const TQString &user3 ) - :KDialogBase( _parent, _name, modal, TQString::null, buttonMask, defaultButton, - separator, user1, user2, user3 ), - about(0), d(0) -{ - setPlainCaption( i18n("About %1").arg(_caption) ); - - mContainerBase = new TDEAboutContainerBase( layoutType, this ); - setMainWidget(mContainerBase); - - connect( mContainerBase, TQT_SIGNAL(urlClick(const TQString &)), - this, TQT_SLOT(openURLSlot(const TQString &))); - connect( mContainerBase, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - this, TQT_SLOT(sendEmailSlot(const TQString &,const TQString &))); - connect( mContainerBase, TQT_SIGNAL(mouseTrack(int, const TQMouseEvent *)), - this, TQT_SLOT(mouseTrackSlot(int, const TQMouseEvent *))); -} - - -void TDEAboutDialog::show( void ) -{ - adjust(); - if( mContainerBase ) { mContainerBase->show(); } - TQDialog::show(); -} - - -void TDEAboutDialog::show( TQWidget * /*centerParent*/ ) -{ - adjust(); - if( mContainerBase ) { mContainerBase->show(); } - TQDialog::show(); -} - - -void TDEAboutDialog::adjust() -{ - if( !about ) { return; } - about->adjust(); - //initializeGeometry(); - resize( sizeHint() ); -} - - -void TDEAboutDialog::setLogo(const TQPixmap& i) -{ - if( !about ) { return; } - about->setLogo(i); -} - - -void TDEAboutDialog::setMaintainer(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ################################################################# - if( !about ) { return; } - about->setMaintainer(_name, _email, _url, _w); - // ################################################################# -} - -void TDEAboutDialog::setAuthor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_work) -{ - // ################################################################# - if( !about ) { return; } - about->setAuthor(_name, _email, _url, _work); - // ################################################################# -} - -void TDEAboutDialog::addContributor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ################################################################# - if( !about ) { return; } - about->addContributor(_name, _email, _url, _w); - // ################################################################# -} - -void TDEAboutDialog::setVersion(const TQString &_name) -{ - // ################################################################# - if( !about ) { return; } - about->setVersion(_name); - // ################################################################# -} - -void TDEAboutDialog::sendEmailSlot(const TQString& /*name*/, const TQString& email) -{ - if ( kapp ) - kapp->invokeMailer( email, TQString::null ); - /* - kdDebug() << "TDEAboutDialog::sendEmailSlot: request to send an email to " - << name << ", " << email << endl; - emit(sendEmail(name, email)); - */ -} - -void TDEAboutDialog::openURLSlot(const TQString& url) -{ - if ( kapp ) - kapp->invokeBrowser( url ); - //kdDebug() << "TDEAboutDialog::openURLSlot: request to open URL " << url << endl; - //emit(openURL(url)); -} - - -void TDEAboutDialog::mouseTrackSlot( int /*mode*/, const TQMouseEvent * /*e*/ ) -{ - // By default we do nothing. This method must be reimplemented. -} - - -TQFrame *TDEAboutDialog::addTextPage( const TQString &title, const TQString &text, - bool richText, int numLines ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addTextPage( title, text, richText, numLines ); -} - -TQFrame *TDEAboutDialog::addLicensePage( const TQString &title, const TQString &text, - int numLines ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addLicensePage( title, text, numLines ); -} - - -TDEAboutContainer *TDEAboutDialog::addContainerPage( const TQString &title, - int childAlignment, int innerAlignment ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addContainerPage( title, childAlignment, - innerAlignment); -} - - -TDEAboutContainer *TDEAboutDialog::addScrolledContainerPage( const TQString &title, - int childAlignment, int innerAlignment ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addScrolledContainerPage( title, childAlignment, - innerAlignment); -} - - - -TQFrame *TDEAboutDialog::addPage( const TQString &title ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addEmptyPage( title ); -} - - -TDEAboutContainer *TDEAboutDialog::addContainer( int childAlignment, - int innerAlignment ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addContainer( childAlignment, innerAlignment ); -} - - -void TDEAboutDialog::setTitle( const TQString &title ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setTitle( title ); -} - - -void TDEAboutDialog::setImage( const TQString &fileName ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setImage( fileName ); -} - -// KDE4: remove -void TDEAboutDialog::setIcon( const TQString &fileName ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProgramLogo( fileName ); -} - -void TDEAboutDialog::setProgramLogo( const TQString &fileName ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProgramLogo( fileName ); -} - -void TDEAboutDialog::setProgramLogo( const TQPixmap &pixmap ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProgramLogo( pixmap ); -} - -void TDEAboutDialog::setImageBackgroundColor( const TQColor &color ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setImageBackgroundColor( color ); -} - - -void TDEAboutDialog::setImageFrame( bool state ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setImageFrame( state ); -} - - -void TDEAboutDialog::setProduct( const TQString &appName, const TQString &version, - const TQString &author, const TQString &year ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProduct( appName, version, author, year ); -} - - - -void TDEAboutDialog::imageURL( TQWidget *_parent, const TQString &_caption, - const TQString &_path, const TQColor &_imageColor, - const TQString &_url ) -{ - TDEAboutDialog a( AbtImageOnly, TQString::null, Close, Close, _parent, "image", true ); - a.setPlainCaption( _caption ); - a.setImage( _path ); - a.setImageBackgroundColor( _imageColor ); - - TDEAboutContainer* const c = a.addContainer( AlignCenter, AlignCenter ); - if( c ) - { - c->addPerson( TQString::null, TQString::null, _url, TQString::null ); - } - a.exec(); -} - - - - -// -// A class that can can monitor mouse movements on the image -// -KImageTrackLabel::KImageTrackLabel( TQWidget *_parent, const char *_name, WFlags f ) - : TQLabel( _parent, _name, f ) -{ - setText( i18n("Image missing")); -} - -void KImageTrackLabel::mousePressEvent( TQMouseEvent *e ) -{ - emit mouseTrack( MousePress, e ); -} - -void KImageTrackLabel::mouseReleaseEvent( TQMouseEvent *e ) -{ - emit mouseTrack( MouseRelease, e ); -} - -void KImageTrackLabel::mouseDoubleClickEvent( TQMouseEvent *e ) -{ - emit mouseTrack( MouseDoubleClick, e ); -} - -void KImageTrackLabel::mouseMoveEvent ( TQMouseEvent *e ) -{ - emit mouseTrack( MouseDoubleClick, e ); -} - -void TDEAboutDialog::virtual_hook( int id, void* data ) -{ KDialogBase::virtual_hook( id, data ); } - diff --git a/tdeui/kaboutdialog.h b/tdeui/kaboutdialog.h deleted file mode 100644 index fbb19b98e..000000000 --- a/tdeui/kaboutdialog.h +++ /dev/null @@ -1,633 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and - * Espen Sand (espen@kde.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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. - * - */ - -/* - * This file declares a class for creating "About ..." dialogs - * in a general way. It provides geometry management and some - * options to connect for, like emailing the author or maintainer. - */ - - -#ifndef _KABOUTDIALOG_H_ -#define _KABOUTDIALOG_H_ - -#include -#include - -class TQFrame; -class TQLabel; -class TQVBoxLayout; -class TQTabWidget; -class KURLLabel; -class TDEAboutContainer; -class TDEAboutContainerBase; - -class TDEAboutWidgetPrivate; - -class TDEAboutContainerPrivate; -/** - * TDEAboutContainer can be used to make a application specific AboutDialog. - */ -class TDEUI_EXPORT TDEAboutContainer : public TQFrame -{ - Q_OBJECT - - public: - TDEAboutContainer( TQWidget *parent=0, const char *name=0, - int margin=0, int spacing=0, - int childAlignment = AlignCenter, - int innerAlignment = AlignCenter ); - - void addWidget( TQWidget *widget ); - void addPerson( const TQString &name, const TQString &email, - const TQString &url, const TQString &task, - bool showHeader = false, bool showframe = false, - bool showBold = false ); - void addTitle( const TQString &title, int alignment=AlignLeft, - bool showframe = false, bool showBold = false ); - void addImage( const TQString &fileName, int alignment=AlignLeft ); - - virtual TQSize sizeHint( void ) const; - virtual TQSize minimumSizeHint( void ) const; - - protected: - virtual void childEvent( TQChildEvent *e ); - - signals: - void urlClick( const TQString &url ); - void mailClick( const TQString &name, const TQString &address ); - - - private: - TQVBoxLayout *mVbox; - int mAlignment; - TDEAboutContainerPrivate* const d; -}; - -class TDEAboutContributorPrivate; - -/** - * Used internally by TDEAboutWidget - * @internal - */ -class TDEUI_EXPORT TDEAboutContributor : public TQFrame -{ - Q_OBJECT - - public: - TDEAboutContributor( TQWidget *parent=0, const char *name=0, - const TQString &username=TQString::null, - const TQString &email=TQString::null, - const TQString &url=TQString::null, - const TQString &work=TQString::null, - bool showHeader=false, bool showFrame=true, - bool showBold=false ); - - void setName( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - void setEmail( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - void setURL( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - void setWork( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - TQString getName( void ) const; - TQString getEmail( void ) const; - TQString getURL( void ) const; - TQString getWork( void ) const; - - virtual TQSize sizeHint( void ) const; - - protected: - virtual void fontChange( const TQFont &oldFont ); - - protected slots: - void urlClickedSlot( const TQString& ); - void emailClickedSlot( const TQString& emailaddress ); - - private: - void updateLayout( void ); - - signals: - void sendEmail(const TQString& name, const TQString& email); - void openURL(const TQString& url); - - private: - TQLabel *mLabel[4]; - TQLabel *mText[4]; - bool mShowHeader; - bool mShowBold; - - TDEAboutContributorPrivate* const d; - - virtual void setName(const char *_name) { TQFrame::setName(_name); } -}; - -/** - * TDEAboutWidget is the main widget for TDEAboutDialog. - * - * It has a minimum size set. - */ -class TDEUI_EXPORT TDEAboutWidget : public TQWidget -{ - Q_OBJECT - -public: - - /** - * The Qt constructor. - */ - TDEAboutWidget(TQWidget* parent=0, const char* name=0 ); - - /** - * Adjust the minimum size (after setting the properties of the image and - * the labels. - */ - void adjust(); - - /** - * Sets the image as the application logo. - */ - void setLogo(const TQPixmap&); - /** - * Sets the author's name and email address. - */ - void setAuthor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - /** - * Sets the maintainers name and email address. - */ - void setMaintainer(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - /** - * Shows this person as one of the major contributors. - */ - void addContributor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - /** - * Sets the text describing the version. - */ - void setVersion(const TQString& name); - // ------------------------------------------------------------------------- -protected slots: - /** - * Catches the signals from the contributors elements. - */ - void sendEmailSlot(const TQString& name, const TQString& email); - /** - * Catches the clicked URLs. - */ - void openURLSlot(const TQString& url); - // ------------------------------------------------------------------------- -signals: - /** - * An email address has been selected by the user. - */ - void sendEmail(const TQString& name, const TQString& email); - /** - * An URL has been clicked. - */ - void openURL(const TQString& url); - // ------------------------------------------------------------------------- -protected: - // events: - /** - * The resize event. - */ - void resizeEvent(TQResizeEvent*); - /** - * The label showing the program version. - */ - TQLabel *version; - /** - * The label showing the text "Other contributors:". - */ - TQLabel *cont; - /** - * The frame showing the logo. - */ - TQLabel *logo; - /** - * The application developer. - */ - TDEAboutContributor *author; - /** - * The application maintainer. - */ - TDEAboutContributor *maintainer; - /** - * Show the maintainer? - */ - bool showMaintainer; - /** - * A set of people who contributed to the application. - */ - TQPtrList contributors; - // ######################################################################### - // -private: - TDEAboutWidgetPrivate* const d; -}; - -class TDEAboutDialogPrivate; -/** - * A KDialogBase with predefined main widget. - * - * As a KDialogBase it uses your application wide settings - * for KDialogBase - * objects (base frame tiles, main frame tiles etc). - * To use it, simply create a TDEAboutDialog object, set all (or some) of its - * properties and show it. Do not derive it to create your own about dialog - * until you need some cool features that are unsupported and you have - * contacted me to add them. - * - * The dialog can be created using two different constructors. The - * difference between these constructors is the available components that - * can be used to build the contents of the dialog. The first (Constructor I) - * provides a number of easy to use methods. Basically it allows you - * to add the components of choice, and the components are placed in a - * predefined layout. You do not have to plan the layout. Everything is - * taken care of. - * - * The second constructor (Constructor II) works in quite the same manner - * as the first, but you have better control on where the components - * are postioned in the layout and you have access to an extended number - * of components you can install such as titles, product information, - * a tabbed pages (where you can display rich text with url links) and - * a person (developer) information field. The "About KDE" dialog box is - * created with Constructor II. - * - * For the derived features, see the basic class KDialogBase. - * @author Mirko Boehm (mirko@kde.org) and Espen Sand (espensa@online.no) - * @see KDialogBase - */ -class TDEUI_EXPORT TDEAboutDialog : public KDialogBase -{ - Q_OBJECT - - public: - /** - * Layout formats. - **/ - enum LayoutType - { - AbtPlain = 0x0001, - AbtTabbed = 0x0002, - AbtTitle = 0x0004, - AbtImageLeft = 0x0008, - AbtImageRight = 0x0010, - AbtImageOnly = 0x0020, - AbtProduct = 0x0040, - AbtKDEStandard = AbtTabbed|AbtTitle|AbtImageLeft, - AbtAppStandard = AbtTabbed|AbtTitle|AbtProduct, - AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly - }; - - public: - /** - * The standard Qt constructor (Constructor I). - * - * Add components with the following methods: - * setLogo(), setAuthor(), setMaintainer(), - * addContributor(), or setVersion(). - * The dialog will be laid out automatically. - */ - TDEAboutDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); - - /** - * The extended constructor. (Constructor II). - * - * Add components with the methods: - * setTitle(), setImage(), setImageBackgroundColor(), - * setImageFrame(), setProduct(), addTextPage(), - * addContainerPage(), addContainer(), or addPage(). - * - * @param dialogLayout Use a mask of LayoutType flags. - * @param caption The dialog caption. The text you specify is prepended - * by i18n("About"). - * @param buttonMask Specifies what buttons will be visible. - * @param defaultButton Specifies what button will be marked as the default. - * @param parent Parent of the dialog. - * @param name Dialog name (for internal use only) - * @param modal Sets dialog modality. If false, the rest of the - * program interface (other dialogs, for example) is accessible while - * the dialog is open. - * @param separator If true, a separator line is drawn between the action - * buttons an the main widget. - * @param user1 User button1 text. - * @param user2 User button2 text. - * @param user3 User button3 text. - * - */ - TDEAboutDialog( int dialogLayout, const TQString &caption, int buttonMask, - ButtonCode defaultButton, TQWidget *parent=0, - const char *name=0, bool modal=false, bool separator = false, - const TQString &user1 = TQString::null, - const TQString &user2 = TQString::null, - const TQString &user3 = TQString::null ); - - /** - * Adjusts the dialog. - * - * You can call this method after you have set up all - * the contents but it is not required. It is done automatically when - * show() is executed. - */ - void adjust(); - - /** - * Makes a modeless (modal = false in constructor) dialog visible. - * - * If you reimplement this method make sure you run it - * in the new method (e.g., show()). Reimplemented - * from KDialogBase. - */ - virtual void show( void ); - - /** - * Makes a modeless (modal = false in constructor) dialog visible. - * - * If you reimplmement this method make sure you run it - * in the new method (i.e., show( parent )). - * - * @param centerParent Center the dialog with respect to this widget. - */ - virtual void show( TQWidget *centerParent ); - - /** - * (Constructor II only) - * Sets a title (not caption) in the uppermost area of the dialog. - * - * @param title Title string. - */ - void setTitle( const TQString &title ); - - /** - * (Constructor II only) - * Define an image to be shown in the dialog. The position is dependent - * on the @p dialogLayout in the constructor - * - * @param fileName Path to image file. - */ - void setImage( const TQString &fileName ); - - /** - * (Constructor II only) - * Define the program logo to be shown in the dialog. Use this to override the - * default program logo. For example, use this function if the - * TDEAboutDialog is for a panel applet and you want to override the - * appletproxy logo with your own pixmap. - * - * @param fileName Path to file containing logo data in a format that - * can be loaded by TQPixmap. - * - * @since 3.3 - */ - void setIcon( const TQString &fileName ) KDE_DEPRECATED; // KDE4: remove - - /** - * Overloaded version of setProgramLogo(const TQPixmap& pixmap). - * - * @since 3.4 - */ - void setProgramLogo( const TQString &fileName ); - - /** - * (Constructor II only) - * Define the program logo to be shown in the dialog. Use this to override the - * default program logo. For example, use this function if the - * TDEAboutDialog is for a panel applet and you want to override the - * appletproxy logo with your own pixmap. - * - * @param pixmap The logo pixmap. - * - * @since 3.4 - */ - void setProgramLogo( const TQPixmap &pixmap ); - - /** - * (Constructor II only) - * The image has a minimum size, but is centered within an area if the - * dialog box is enlarged by the user. You set the background color - * of the area with this method. - * - * @param color Background color. - */ - void setImageBackgroundColor( const TQColor &color ); - - /** - * (Constructor II only) - * Enables or disables a frame around the image. The frame is, by default, - * enabled in the constructor - * - * @param state A value of @p true enables the frame - */ - void setImageFrame( bool state ); - - /** - * (Constructor II only) - * Prints the application name, KDE version, author, a copyright sign - * and a year string. To the left of the text the standard application - * icon is displayed. - * - * @param appName The application name. - * @param version Application version. - * @param author One or more authors. - * @param year A string telling when the application was made. - */ - void setProduct( const TQString &appName, const TQString &version, - const TQString &author, const TQString &year ); - - /** - * (Constructor II only) - * Adds a text page to a tab box. The text can be regular text or - * rich text. The rich text can contain URLs and mail links. - * - * @param title Tab name. - * @param text The text to display. - * @param richText Set this to @p true if 'text' is rich text. - * @param numLines The text area height will be adjusted so that this - * is the minimum number of lines of text that are visible. - * @return The frame that contains the page. - */ - TQFrame *addTextPage( const TQString &title, const TQString &text, - bool richText=false, int numLines=10 ); - - /** - * (Constructor II only) - * Adds a license page to a tab box. - * - * @param title Tab name. - * @param text The text to display. - * @param numLines The text area height will be adjusted so that this - * is the minimum number of lines of text that are visible. - * @return The frame that contains the page. - */ - TQFrame *addLicensePage( const TQString &title, const TQString &text, - int numLines=10 ); - - /** - * (Constructor II only) - * Adds a container to a tab box. You can add text and images to a - * container. - * - * @param title Tab name. - * @param childAlignment Specifies how the children of the container are - * aligned with respect to the container. - * @param innerAlignment Specifies how the children are aligned with - * respect to each other. - * @return The new container. - */ - TDEAboutContainer *addContainerPage( const TQString &title, - int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); - - /** - * (Constructor II only) - * Adds a container inside a TQScrollView to a tab box. You can add text - * and images to a container. - * - * @param title Tab name. - * @param childAlignment Specifies how the children of the container are - * aligned with respect to the container. - * @param innerAlignment Specifies how the children are aligned with - * respect to each other. - * @return The new container. - */ - TDEAboutContainer *addScrolledContainerPage( const TQString &title, - int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); - - /** - * (Constructor II only) - * Adds a container. You can add text and images to a container. - * - * @param childAlignment Specifies how the children of the container are - * aligned with respect to the container. - * @param innerAlignment Specifies how the children are aligned with - * respect to each other. - * @return The new container. - */ - TDEAboutContainer *addContainer( int childAlignment, int innerAlignment ); - - /** - * (Constructor II only) - * Adds an empty page to a tab box. - * - * @param title Tab name - * @return The new page. - */ - TQFrame *addPage( const TQString &title ); - - - /** - * (Constructor I only) - * Sets the image as the application logo. - */ - void setLogo(const TQPixmap&); - - /** - * (Constructor I only) - * Sets the author's name and email address. - */ - void setAuthor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - - /** - * (Constructor I only) - * Sets the maintainer's name and email address. - */ - void setMaintainer(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - - /** - * (Constructor I only) - * Show this person as one of the major contributors. - */ - void addContributor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - - /** - * (Constructor I only) - * Sets the text describing the version. - */ - void setVersion(const TQString& name); - - /** - * Create a modal dialog with an image in the upper area with a - * URL link below. - */ - static void imageURL( TQWidget *parent, const TQString &caption, - const TQString &path, const TQColor &imageColor, - const TQString &url ); - -signals: - /** - * Send an email to this person. - * - * The application must provide the - * functionality. - */ - void sendEmail(const TQString& name, const TQString& email); - - /** - * Open the selected URL. - */ - void openURL(const TQString& url); - // ---------------------------------------------------------------------------- -protected: - /** - * The main widget (Constructor I) - */ - TDEAboutWidget * about; - - /** - * The main widget (Constructor II) - */ - TDEAboutContainerBase *mContainerBase; - - // ------------------------------------------------------------------------- -protected slots: - - /** - * Connected to widget->sendEmail. - */ - void sendEmailSlot(const TQString& name, const TQString& email); - - /** - * Open this URL. - */ - void openURLSlot(const TQString& url); - - /** - * (Constructor II only) - * Tells the position of the mouse cursor when the left mouse button - * is pressed above an image - */ - virtual void mouseTrackSlot( int mode, const TQMouseEvent *e ); - - // ######################################################################### -protected: - virtual void virtual_hook( int id, void* data ); -private: - TDEAboutDialogPrivate* const d; -}; - -#endif // defined KABOUTDIALOG_H diff --git a/tdeui/kaboutkde.cpp b/tdeui/kaboutkde.cpp deleted file mode 100644 index 5ccd8822a..000000000 --- a/tdeui/kaboutkde.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Espen Sand (espen@kde.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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. - * - */ - -// I (espen) prefer that header files are included alphabetically -#include -#include -#include -#include - - -TDEAboutKDE::TDEAboutKDE( TQWidget *parent, const char *name, bool modal ) - :TDEAboutDialog( TDEAboutDialog::AbtKDEStandard, TQString::fromLatin1("TDE"), - KDialogBase::Help|KDialogBase::Close, KDialogBase::Close, - parent, name, modal ) -{ - const TQString text1 = i18n("" - "The Trinity Desktop Environment is a fork of the " - "K Desktop Environment version 3.5, which was originally written by the KDE Team, " - "a world-wide network of software engineers committed to Free Software " - "development.

No single group, company or organization controls the " - "Trinity source code. Everyone is welcome to contribute to Trinity.

Visit http://www.trinitydesktop.org for more information " - "about Trinity, and http://www.kde.org " - "for more information on the KDE project. "); - - const TQString text2 = i18n("" - "Software can always be improved, and the Trinity Team is ready to " - "do so. However, you - the user - must tell us when " - "something does not work as expected or could be done better.

" - "The Trinity Desktop Environment has a bug tracking system. Visit " - "http://bugs.pearsoncomputing.net or " - "use the \"Report Bug...\" dialog from the \"Help\" menu to report bugs.

" - "If you have a suggestion for improvement then you are welcome to use " - "the bug tracking system to register your wish. Make sure you use the " - "severity called \"Wishlist\"." ); - - const TQString text3 = i18n("" - "You do not have to be a software developer to be a member of the " - "Trinity team. You can join the national teams that translate " - "program interfaces. You can provide graphics, themes, sounds, and " - "improved documentation. You decide!" - "

" - "Visit " - "http://www.trinitydesktop.org/jobs/ " - "for information on some projects in which you can participate." - "

" - "If you need more information or documentation, then a visit to " - "http://www.trinitydesktop.org/docs/ " - "will provide you with what you need."); - const TQString text4 = i18n("" - "Trinity is available free of charge, but making it is not free.

" - "

" - "The Trinity team does need financial support. Most of the money is used to " - "reimburse members and others on expenses they experienced when " - "contributing to Trinity. You are encouraged to support Trinity through a financial " - "donation, using one of the ways described at " - "http://www.trinitydesktop.org/donate.php." - "

Thank you very much in advance for your support!"); - setHelp( TQString::fromLatin1("khelpcenter/main.html"), TQString::null ); - setTitle(i18n("Trinity Desktop Environment. Release %1"). - arg(TQString::fromLatin1(TDE_VERSION_STRING)) ); - addTextPage( i18n("About Trinity","&About"), text1, true ); - addTextPage( i18n("&Report Bugs/Request Enhancements"), text2, true ); - addTextPage( i18n("&Join the Trinity Team"), text3, true ); - addTextPage( i18n("&Support Trinity"), text4, true ); - setImage( locate( "data", TQString::fromLatin1("tdeui/pics/aboutkde.png")) ); - setImageBackgroundColor( white ); -} diff --git a/tdeui/kaboutkde.h b/tdeui/kaboutkde.h deleted file mode 100644 index 8013d093d..000000000 --- a/tdeui/kaboutkde.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Espen Sand (espen@kde.org) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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. - * - */ - -#ifndef _KABOUT_KDE_H_ -#define _KABOUT_KDE_H_ - -#include - -/** - * @short Standard "About KDE" dialog box, - * - * This class provides the standard "About KDE" dialog box that is used - * KHelpMenu Normally you should not use this class directly but - * rather the KHelpMenu class or even better just subclass your - * toplevel window from TDEMainWindow. If you do the latter, the help - * menu and thereby this dialog box is available through the - * TDEMainWindow::helpMenu() function. - * - * @author Espen Sand (espen@kde.org) - */ - -class TDEUI_EXPORT TDEAboutKDE : public TDEAboutDialog -{ - public: - /** - * Constructor. Creates a fully featured "About KDE" dialog box. - * Note that this dialog is made modeless in the KHelpMenu class so - * the users may expect a modeless dialog. - * - * @param parent The parent of the dialog box. You should use the - * toplevel window so that the dialog becomes centered. - * @param name Internal name of the widget. This name in not used in the - * caption. - * @param modal If false, this widget will be modeless and must be - * made visible using TQWidget::show(). Otherwise it will be - * modal and must be made visible using TQWidget::exec() - */ - TDEAboutKDE( TQWidget *parent=0, const char *name=0, bool modal=true ); -}; - - -#endif - - diff --git a/tdeui/kactivelabel.cpp b/tdeui/kactivelabel.cpp index a30fac7f4..0e5abc5ad 100644 --- a/tdeui/kactivelabel.cpp +++ b/tdeui/kactivelabel.cpp @@ -19,7 +19,7 @@ #include "kactivelabel.h" -#include +#include #include #include #include diff --git a/tdeui/kbugreport.cpp b/tdeui/kbugreport.cpp index efee22366..91c6aa66c 100644 --- a/tdeui/kbugreport.cpp +++ b/tdeui/kbugreport.cpp @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/kcharselect.cpp b/tdeui/kcharselect.cpp index ace147496..a623b3efa 100644 --- a/tdeui/kcharselect.cpp +++ b/tdeui/kcharselect.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/kcolorcombo.cpp b/tdeui/kcolorcombo.cpp index 0449550fd..7e9353cf4 100644 --- a/tdeui/kcolorcombo.cpp +++ b/tdeui/kcolorcombo.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/kcolordialog.cpp b/tdeui/kcolordialog.cpp index 16f16d07e..29292f960 100644 --- a/tdeui/kcolordialog.cpp +++ b/tdeui/kcolordialog.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/kdatepicker.cpp b/tdeui/kdatepicker.cpp index 91cafddbd..98d72030d 100644 --- a/tdeui/kdatepicker.cpp +++ b/tdeui/kdatepicker.cpp @@ -33,7 +33,7 @@ #include "kdatepicker.h" #include -#include +#include #include #include #include diff --git a/tdeui/kdatetbl.cpp b/tdeui/kdatetbl.cpp index 2fd593493..542f89f08 100644 --- a/tdeui/kdatetbl.cpp +++ b/tdeui/kdatetbl.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kdcopactionproxy.cpp b/tdeui/kdcopactionproxy.cpp index c8444cfdf..028c90883 100644 --- a/tdeui/kdcopactionproxy.cpp +++ b/tdeui/kdcopactionproxy.cpp @@ -20,7 +20,7 @@ #include "kdcopactionproxy.h" #include -#include +#include #include #include #include diff --git a/tdeui/kdetrayproxy/kdetrayproxy.cpp b/tdeui/kdetrayproxy/kdetrayproxy.cpp index f1e6995ee..d0e7a84cf 100644 --- a/tdeui/kdetrayproxy/kdetrayproxy.cpp +++ b/tdeui/kdetrayproxy/kdetrayproxy.cpp @@ -19,7 +19,7 @@ #include "kdetrayproxy.h" -#include +#include #include #include #include @@ -182,7 +182,7 @@ void KDETrayProxy::withdrawWindow( Window w ) #include "kdetrayproxy.moc" #if 0 -#include +#include int main( int argc, char* argv[] ) { TDECmdLineArgs::init( argc, argv, "a", "b", "c", "d" ); diff --git a/tdeui/kdialog.cpp b/tdeui/kdialog.cpp index ddac1ddd8..f6b2b8b56 100644 --- a/tdeui/kdialog.cpp +++ b/tdeui/kdialog.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include #include diff --git a/tdeui/kdialogbase.cpp b/tdeui/kdialogbase.cpp index 46d0697d5..6656d6803 100644 --- a/tdeui/kdialogbase.cpp +++ b/tdeui/kdialogbase.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/keditcl1.cpp b/tdeui/keditcl1.cpp index baff8db25..37cee99fb 100644 --- a/tdeui/keditcl1.cpp +++ b/tdeui/keditcl1.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/keditcl2.cpp b/tdeui/keditcl2.cpp index 92ca542d4..a7db92555 100644 --- a/tdeui/keditcl2.cpp +++ b/tdeui/keditcl2.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/keditlistbox.cpp b/tdeui/keditlistbox.cpp index 040e77c70..1a31bbaa4 100644 --- a/tdeui/keditlistbox.cpp +++ b/tdeui/keditlistbox.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include "keditlistbox.h" diff --git a/tdeui/khelpmenu.cpp b/tdeui/khelpmenu.cpp index dd6b7d174..41fa063c2 100644 --- a/tdeui/khelpmenu.cpp +++ b/tdeui/khelpmenu.cpp @@ -27,11 +27,11 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include #include diff --git a/tdeui/kiconview.cpp b/tdeui/kiconview.cpp index 3a139985a..bcf9550b4 100644 --- a/tdeui/kiconview.cpp +++ b/tdeui/kiconview.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/kjanuswidget.cpp b/tdeui/kjanuswidget.cpp index fc1a04e7e..e9dd9df85 100644 --- a/tdeui/kjanuswidget.cpp +++ b/tdeui/kjanuswidget.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include // Access to some static members #include #include diff --git a/tdeui/kkeybutton.cpp b/tdeui/kkeybutton.cpp index e0a41ce5d..24191aa45 100644 --- a/tdeui/kkeybutton.cpp +++ b/tdeui/kkeybutton.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kkeydialog.cpp b/tdeui/kkeydialog.cpp index b6db9bb71..7faad35c4 100644 --- a/tdeui/kkeydialog.cpp +++ b/tdeui/kkeydialog.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #ifdef Q_WS_X11 diff --git a/tdeui/kled.cpp b/tdeui/kled.cpp index dc245cd6f..6b29ac0ca 100644 --- a/tdeui/kled.cpp +++ b/tdeui/kled.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include "kled.h" diff --git a/tdeui/klineedit.cpp b/tdeui/klineedit.cpp index 4e11f5fa3..a1c05aaab 100644 --- a/tdeui/klineedit.cpp +++ b/tdeui/klineedit.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "klineedit.h" #include "klineedit.moc" diff --git a/tdeui/klineeditdlg.cpp b/tdeui/klineeditdlg.cpp index 9551fc1f6..ca4fd8266 100644 --- a/tdeui/klineeditdlg.cpp +++ b/tdeui/klineeditdlg.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/kmenubar.cpp b/tdeui/kmenubar.cpp index 9f21ce300..71158370b 100644 --- a/tdeui/kmenubar.cpp +++ b/tdeui/kmenubar.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kmessagebox.cpp b/tdeui/kmessagebox.cpp index 1e3c0bfda..5684c6484 100644 --- a/tdeui/kmessagebox.cpp +++ b/tdeui/kmessagebox.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/kpanelapplet.cpp b/tdeui/kpanelapplet.cpp index 02a098283..f88cb5a8a 100644 --- a/tdeui/kpanelapplet.cpp +++ b/tdeui/kpanelapplet.cpp @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kpanelapplet.h" #include "kpanelapplet.moc" -#include +#include #include class KPanelApplet::KPanelAppletPrivate diff --git a/tdeui/kpanelappmenu.cpp b/tdeui/kpanelappmenu.cpp index 4cc77b5fe..247d844de 100644 --- a/tdeui/kpanelappmenu.cpp +++ b/tdeui/kpanelappmenu.cpp @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kpanelappmenu.h" #include #include -#include +#include #include static int panelmenu_get_seq_id() diff --git a/tdeui/kpassdlg.cpp b/tdeui/kpassdlg.cpp index e2ca0bb80..302b4e679 100644 --- a/tdeui/kpassdlg.cpp +++ b/tdeui/kpassdlg.cpp @@ -36,11 +36,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kprogress.cpp b/tdeui/kprogress.cpp index 9b72dcf2c..3f0186e3d 100644 --- a/tdeui/kprogress.cpp +++ b/tdeui/kprogress.cpp @@ -34,7 +34,7 @@ #include "kprogress.h" -#include +#include #include #include diff --git a/tdeui/kprogressbox.cpp b/tdeui/kprogressbox.cpp index 4638f78fb..6dda25a33 100644 --- a/tdeui/kprogressbox.cpp +++ b/tdeui/kprogressbox.cpp @@ -37,7 +37,7 @@ #include "ktextedit.h" #include "kprogressbox.h" -#include +#include #include #include diff --git a/tdeui/kpushbutton.cpp b/tdeui/kpushbutton.cpp index 35bf0928f..e92fe8583 100644 --- a/tdeui/kpushbutton.cpp +++ b/tdeui/kpushbutton.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include class KPushButton::KPushButtonPrivate { diff --git a/tdeui/krootpixmap.cpp b/tdeui/krootpixmap.cpp index 71b1d86ca..6be62d157 100644 --- a/tdeui/krootpixmap.cpp +++ b/tdeui/krootpixmap.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp index 363a9b8b4..d27ae07ca 100644 --- a/tdeui/ksconfig.cpp +++ b/tdeui/ksconfig.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/kseparator.cpp b/tdeui/kseparator.cpp index 9e860f3cf..c5a4879d8 100644 --- a/tdeui/kseparator.cpp +++ b/tdeui/kseparator.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "kseparator.moc" diff --git a/tdeui/ksharedpixmap.cpp b/tdeui/ksharedpixmap.cpp index b9e0e69c4..33eca17e4 100644 --- a/tdeui/ksharedpixmap.cpp +++ b/tdeui/ksharedpixmap.cpp @@ -22,7 +22,7 @@ #ifdef Q_WS_X11 -#include +#include #include #include #include diff --git a/tdeui/kstdaction.cpp b/tdeui/kstdaction.cpp index a0e840e5a..8dd874a9d 100644 --- a/tdeui/kstdaction.cpp +++ b/tdeui/kstdaction.cpp @@ -21,9 +21,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeui/kstdguiitem.cpp b/tdeui/kstdguiitem.cpp index 2367804a8..78f3fd6f6 100644 --- a/tdeui/kstdguiitem.cpp +++ b/tdeui/kstdguiitem.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include KGuiItem KStdGuiItem::guiItem ( StdItem ui_enum ) { diff --git a/tdeui/ksyntaxhighlighter.cpp b/tdeui/ksyntaxhighlighter.cpp index 1d0ce4159..ba938382b 100644 --- a/tdeui/ksyntaxhighlighter.cpp +++ b/tdeui/ksyntaxhighlighter.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "ksyntaxhighlighter.h" diff --git a/tdeui/ksystemtray.cpp b/tdeui/ksystemtray.cpp index 572616833..fcd0389da 100644 --- a/tdeui/ksystemtray.cpp +++ b/tdeui/ksystemtray.cpp @@ -24,9 +24,9 @@ #include "tdeshortcut.h" #include "ksystemtray.h" #include "tdepopupmenu.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "klocale.h" -#include "kaboutdata.h" +#include "tdeaboutdata.h" #ifdef Q_WS_X11 #include diff --git a/tdeui/ktextbrowser.cpp b/tdeui/ktextbrowser.cpp index 15f14d711..b17e38067 100644 --- a/tdeui/ktextbrowser.cpp +++ b/tdeui/ktextbrowser.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include #include diff --git a/tdeui/ktip.cpp b/tdeui/ktip.cpp index d52e134b6..44f710fb9 100644 --- a/tdeui/ktip.cpp +++ b/tdeui/ktip.cpp @@ -33,8 +33,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/kwhatsthismanager.cpp b/tdeui/kwhatsthismanager.cpp index 2f4d1750f..bcf48438c 100644 --- a/tdeui/kwhatsthismanager.cpp +++ b/tdeui/kwhatsthismanager.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include KWhatsThisManager *KWhatsThisManager::s_instance = 0; diff --git a/tdeui/kxmlguibuilder.cpp b/tdeui/kxmlguibuilder.cpp index 3eb756678..6fd472ad5 100644 --- a/tdeui/kxmlguibuilder.cpp +++ b/tdeui/kxmlguibuilder.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include "kapplication.h" +#include "tdeapplication.h" #include "kxmlguibuilder.h" #include "kmenubar.h" #include "tdepopupmenu.h" diff --git a/tdeui/kxmlguiclient.cpp b/tdeui/kxmlguiclient.cpp index a02718f0a..de015b5a4 100644 --- a/tdeui/kxmlguiclient.cpp +++ b/tdeui/kxmlguiclient.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include diff --git a/tdeui/tdeaboutapplication.cpp b/tdeui/tdeaboutapplication.cpp new file mode 100644 index 000000000..08ee46450 --- /dev/null +++ b/tdeui/tdeaboutapplication.cpp @@ -0,0 +1,188 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and + * Espen Sand (espen@kde.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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. + * + */ + +// I (espen) prefer that header files are included alphabetically + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ktextedit.h" + +TDEAboutApplication::TDEAboutApplication( TQWidget *parent, const char *name, + bool modal ) + :TDEAboutDialog( AbtTabbed|AbtProduct, + kapp ? kapp->caption() : TQString::null, + Close, Close, + parent, name, modal ) +{ + buildDialog(TDEGlobal::instance()->aboutData()); +} + +TDEAboutApplication::TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent, + const char *name, bool modal ) + :TDEAboutDialog( AbtTabbed|AbtProduct, aboutData->programName(), Close, Close, + parent, name, modal ) +{ + buildDialog(aboutData); +} + +void TDEAboutApplication::buildDialog( const TDEAboutData *aboutData ) +{ + if( !aboutData ) + { + // + // Recovery + // + + //i18n "??" is displayed as (pseudo-)version when no data is known about the application + setProduct( kapp ? kapp->caption() : TQString::null, i18n("??"), TQString::null, TQString::null ); + TDEAboutContainer *appPage = addContainerPage( i18n("&About")); + + TQString appPageText = + i18n("No information available.\n" + "The supplied TDEAboutData object does not exist."); + TQLabel *appPageLabel = new TQLabel( "\n\n\n\n"+appPageText+"\n\n\n\n", 0 ); + appPage->addWidget( appPageLabel ); + return; + } + + setProduct( aboutData->programName(), aboutData->version(), + TQString::null, TQString::null ); + + if (!aboutData->programLogo().isNull()) + setProgramLogo( aboutData->programLogo() ); + + TQString appPageText = aboutData->shortDescription() + "\n"; + + if (!aboutData->otherText().isEmpty()) + appPageText += "\n" + aboutData->otherText()+"\n"; + + if (!aboutData->copyrightStatement().isEmpty()) + appPageText += "\n" + aboutData->copyrightStatement()+"\n"; + + TDEAboutContainer *appPage = addContainerPage( i18n("&About")); + + TQLabel *appPageLabel = new TQLabel( appPageText, 0 ); + appPage->addWidget( appPageLabel ); + + if (!aboutData->homepage().isEmpty()) + { + KURLLabel *url = new KURLLabel(); + url->setText(aboutData->homepage()); + url->setURL(aboutData->homepage()); + appPage->addWidget( url ); + connect( url, TQT_SIGNAL(leftClickedURL(const TQString &)), + this, TQT_SLOT(openURLSlot(const TQString &))); + } + + int authorCount = aboutData->authors().count(); + if (authorCount) + { + TQString authorPageTitle = authorCount == 1 ? + i18n("A&uthor") : i18n("A&uthors"); + TDEAboutContainer *authorPage = addScrolledContainerPage( authorPageTitle ); + + if (!aboutData->customAuthorTextEnabled() || !aboutData->customAuthorRichText().isEmpty ()) + { + TQString text; + KActiveLabel* activeLabel = new KActiveLabel( authorPage ); + if (!aboutData->customAuthorTextEnabled()) + { + if ( aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "submit@bugs.pearsoncomputing.net") + text = i18n( "Please use http://bugs.pearsoncomputing.net to report bugs.\n" ); + else { + if( aboutData->authors().count() == 1 && ( aboutData->authors().first().emailAddress() == aboutData->bugAddress() ) ) + { + text = i18n( "Please report bugs to %2.\n" ).arg( aboutData->authors().first().emailAddress() ).arg( aboutData->authors().first().emailAddress() ); + } + else { + text = i18n( "Please report bugs to %2.\n" ).arg(aboutData->bugAddress()).arg(aboutData->bugAddress() ); + } + } + } + else + { + text = aboutData->customAuthorRichText(); + } + activeLabel->setText( text ); + authorPage->addWidget( activeLabel ); + } + + TQValueList::ConstIterator it; + for (it = aboutData->authors().begin(); + it != aboutData->authors().end(); ++it) + { + authorPage->addPerson( (*it).name(), (*it).emailAddress(), + (*it).webAddress(), (*it).task() ); + } + } + + int creditsCount = aboutData->credits().count(); + if (creditsCount) + { + TDEAboutContainer *creditsPage = + addScrolledContainerPage( i18n("&Thanks To") ); + TQValueList::ConstIterator it; + for (it = aboutData->credits().begin(); + it != aboutData->credits().end(); ++it) + { + creditsPage->addPerson( (*it).name(), (*it).emailAddress(), + (*it).webAddress(), (*it).task() ); + } + } + + const TQValueList translatorList = aboutData->translators(); + + if(translatorList.count() > 0) + { + TQString text = ""; + + TQValueList::ConstIterator it; + for(it = translatorList.begin(); it != translatorList.end(); ++it) + { + text += TQString("

%1
   " + "%2

") + .arg((*it).name()) + .arg((*it).emailAddress()) + .arg((*it).emailAddress()); + } + + text += TDEAboutData::aboutTranslationTeam() + "
"; + addTextPage( i18n("T&ranslation"), text, true); + } + + if (!aboutData->license().isEmpty() ) + { + addLicensePage( i18n("&License Agreement"), aboutData->license() ); + } + + // + // Make sure the dialog has a reasonable width + // + setInitialSize( TQSize(400,1) ); +} diff --git a/tdeui/tdeaboutapplication.h b/tdeui/tdeaboutapplication.h new file mode 100644 index 000000000..19fa0fe61 --- /dev/null +++ b/tdeui/tdeaboutapplication.h @@ -0,0 +1,94 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and + * Espen Sand (espen@kde.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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. + * + */ + +#ifndef _KABOUT_APPLICATION_H_ +#define _KABOUT_APPLICATION_H_ + +#include +#include + +/** + * @short Standard "About Application" dialog box. + * + * This class provides the standard "About Application" dialog box + * that is used by KHelpMenu. It uses the information of the global + * TDEAboutData that is specified at the start of your program in + * main(). Normally you should not use this class directly but rather + * the KHelpMenu class or even better just subclass your toplevel + * window from TDEMainWindow. If you do the latter, the help menu and + * thereby this dialog box is available through the + * TDEMainWindow::helpMenu() function. + * + * @author Waldo Bastian (bastian@kde.org) and Espen Sand (espen@kde.org) + */ + +class TDEUI_EXPORT TDEAboutApplication : public TDEAboutDialog +{ + public: + /** + * Constructor. Creates a fully featured "About Application" dialog box. + * Note that this dialog is made modeless in the KHelpMenu class so + * the users may expect a modeless dialog. + * + * @param parent The parent of the dialog box. You should use the + * toplevel window so that the dialog becomes centered. + * @param name Internal name of the widget. This name is not used in the + * caption. + * @param modal If false, this widget will be modeless and must be + * made visible using TQWidget::show(). Otherwise it will be + * modal and must be made visible using TQWidget::exec(). + */ + TDEAboutApplication( TQWidget *parent=0, const char *name=0, bool modal=true ); + + /** + * Constructor. Mostly does the same stuff as the previous constructor, except + * that it can take a custom TDEAboutData object instead of the one specified + * in your main() function. This is especially useful for applications + * which are implemented as (dynamically loaded) libraries, e.g. panel + * applets. + * + * @param aboutData A pointer to a TDEAboutData object which data + * will be used for filling the dialog. + * @param parent The parent of the dialog box. You should use the + * toplevel window so that the dialog becomes centered. + * @param name Internal name of the widget. This name is not used in the + * caption. + * @param modal If false, this widget will be modeless and must be + * made visible using TQWidget::show(). Otherwise it will be + * modal and must be made visible using TQWidget::exec(). + */ + TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent=0, const char *name=0, bool modal=true ); + +/* + FIXME: The two constructors should be replaced with the following after the lib freeze: + + TDEAboutApplication( const TDEAboutData *aboutData=0, TQWidget *parent=0, const char *name=0, bool modal=true ); + + This will make buildDialog() obsolete as well (Frerich). +*/ + protected: + void buildDialog( const TDEAboutData *aboutData ); +}; + + +#endif + diff --git a/tdeui/tdeaboutdialog.cpp b/tdeui/tdeaboutdialog.cpp new file mode 100644 index 000000000..b46c0b959 --- /dev/null +++ b/tdeui/tdeaboutdialog.cpp @@ -0,0 +1,1797 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 1999-2001 Mirko Boehm and + * Espen Sand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//MOC_SKIP_BEGIN +template class TQPtrList; +//MOC_SKIP_END + +#define WORKTEXT_IDENTATION 16 +#define Grid 3 + +// ############################################################## +// MOC OUTPUT FILES: +#include "tdeaboutdialog.moc" +#include "kaboutdialog_private.moc" +// ############################################################## + +class TDEAboutTabWidget : public TQTabWidget +{ +public: + TDEAboutTabWidget( TQWidget* parent ) : TQTabWidget( parent ) {} + TQSize sizeHint() const { + return TQTabWidget::sizeHint().expandedTo( tabBar()->sizeHint() + TQSize(4,4) ); + } +}; + + + + +TDEAboutContributor::TDEAboutContributor( TQWidget *_parent, const char *wname, + const TQString &_name,const TQString &_email, + const TQString &_url, const TQString &_work, + bool showHeader, bool showFrame, + bool showBold ) + : TQFrame( _parent, wname ), mShowHeader(showHeader), mShowBold(showBold), d(0) +{ + if( showFrame ) + { + setFrameStyle(TQFrame::Panel | TQFrame::Raised); + } + + mLabel[0] = new TQLabel( this ); + mLabel[1] = new TQLabel( this ); + mLabel[2] = new TQLabel( this ); + mLabel[3] = new TQLabel( this ); + mText[0] = new TQLabel( this ); + mText[1] = new KURLLabel( this ); + mText[2] = new KURLLabel( this ); + mText[3] = new TQLabel( this ); + + setName( _name, i18n("Author"), false ); + setEmail( _email, i18n("Email"), false ); + setURL( _url, i18n("Homepage"), false ); + setWork( _work, i18n("Task"), false ); + + KURLLabel *kurl = static_cast(mText[1]); + kurl->setFloat(true); + kurl->setUnderline(true); + kurl->setMargin(0); + connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), + TQT_SLOT(emailClickedSlot(const TQString &))); + + kurl = static_cast(mText[2]); + kurl->setFloat(true); + kurl->setUnderline(true); + kurl->setMargin(0); + connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), + TQT_SLOT(urlClickedSlot(const TQString &))); + + mLabel[3]->setAlignment( AlignTop ); + + fontChange( font() ); + updateLayout(); +} + + +void TDEAboutContributor::setName( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[0]->setText(_header); + mText[0]->setText(_text); + if( _update ) { updateLayout(); } +} + + +void TDEAboutContributor::setEmail( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[1]->setText(_header); + KURLLabel* const kurl = static_cast(mText[1]); + kurl->setText(_text); + kurl->setURL(_text); + if( _update ) { updateLayout(); } +} + + +void TDEAboutContributor::setURL( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[2]->setText(_header); + KURLLabel* const kurl = static_cast(mText[2]); + kurl->setText(_text); + kurl->setURL(_text); + if( _update ) { updateLayout(); } +} + + +void TDEAboutContributor::setWork( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[3]->setText(_header); + mText[3]->setText(_text); + if( _update ) { updateLayout(); } +} + + +TQString TDEAboutContributor::getName( void ) const +{ + return mText[0]->text(); +} + + +TQString TDEAboutContributor::getEmail( void ) const +{ + return mText[1]->text(); +} + + +TQString TDEAboutContributor::getURL( void ) const +{ + return mText[2]->text(); +} + + +TQString TDEAboutContributor::getWork( void ) const +{ + return mText[3]->text(); +} + + + +void TDEAboutContributor::updateLayout( void ) +{ + delete layout(); + + int row = 0; + if( !mText[0]->text().isEmpty() ) { ++row; } + if( !mText[1]->text().isEmpty() ) { ++row; } + if( !mText[2]->text().isEmpty() ) { ++row; } + if( !mText[3]->text().isEmpty() ) { ++row; } + + + TQGridLayout *gbox; + if( row == 0 ) + { + gbox = new TQGridLayout( this, 1, 1, 0 ); + for( int i=0; i<4; ++i ) + { + mLabel[i]->hide(); + mText[i]->hide(); + } + } + else + { + if( mText[0]->text().isEmpty() && !mShowHeader ) + { + gbox = new TQGridLayout( this, row, 1, frameWidth()+1, 2 ); + } + else + { + gbox = new TQGridLayout( this, row, 2, frameWidth()+1, 2 ); + if( !mShowHeader ) + { + gbox->addColSpacing( 0, KDialog::spacingHint()*2 ); + } + gbox->setColStretch( 1, 10 ); + } + + for( int i=0, r=0; i<4; ++i ) + { + mLabel[i]->setFixedHeight( fontMetrics().lineSpacing() ); + if( i != 3 ) + { + mText[i]->setFixedHeight( fontMetrics().lineSpacing() ); + } + + if( !mText[i]->text().isEmpty() ) + { + if( mShowHeader ) + { + gbox->addWidget( TQT_TQWIDGET(mLabel[i]), r, 0, (TQ_Alignment)AlignLeft ); + gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); + mLabel[i]->show(); + mText[i]->show(); + } + else + { + mLabel[i]->hide(); + if( !i ) + { + gbox->addMultiCellWidget( TQT_TQWIDGET(mText[i]), r, r, 0, 1, (TQ_Alignment)AlignLeft ); + } + else + { + gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); + } + mText[i]->show(); + } + ++r; + } + else + { + mLabel[i]->hide(); + mText[i]->hide(); + } + } + } + + gbox->activate(); + setMinimumSize( sizeHint() ); +} + + +void TDEAboutContributor::fontChange( const TQFont &/*oldFont*/ ) +{ + if( mShowBold ) + { + TQFont f( font() ); + f.setBold( true ); + mText[0]->setFont( f ); + } + update(); +} + + +TQSize TDEAboutContributor::sizeHint( void ) const +{ + return minimumSizeHint(); +} + + +void TDEAboutContributor::urlClickedSlot( const TQString &u ) +{ + emit openURL(u); +} + + +void TDEAboutContributor::emailClickedSlot( const TQString &e ) +{ + emit sendEmail( mText[0]->text(), e ) ; +} + + +// +// Internal widget for the TDEAboutDialog class. +// +TDEAboutContainerBase::TDEAboutContainerBase( int layoutType, TQWidget *_parent, + char *_name ) + : TQWidget( _parent, _name ), + mImageLabel(0), mTitleLabel(0), mIconLabel(0),mVersionLabel(0), + mAuthorLabel(0), mImageFrame(0),mPageTab(0),mPlainSpace(0),d(0) +{ + mTopLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); + if( !mTopLayout ) { return; } + + if( layoutType & AbtImageOnly ) + { + layoutType &= ~(AbtImageLeft|AbtImageRight|AbtTabbed|AbtPlain); + } + if( layoutType & AbtImageLeft ) + { + layoutType &= ~AbtImageRight; + } + + if( layoutType & AbtTitle ) + { + mTitleLabel = new TQLabel( this, "title" ); + mTitleLabel->setAlignment(AlignCenter); + mTopLayout->addWidget( mTitleLabel ); + mTopLayout->addSpacing( KDialog::spacingHint() ); + } + + if( layoutType & AbtProduct ) + { + TQWidget* const productArea = new TQWidget( this, "area" ); + mTopLayout->addWidget( productArea, 0, TQApplication::reverseLayout() ? AlignRight : AlignLeft ); + + TQHBoxLayout* const hbox = new TQHBoxLayout(productArea,0,KDialog::spacingHint()); + if( !hbox ) { return; } + + mIconLabel = new TQLabel( productArea ); + hbox->addWidget( mIconLabel, 0, AlignLeft|AlignHCenter ); + + TQVBoxLayout* const vbox = new TQVBoxLayout(); + if( !vbox ) { return; } + hbox->addLayout( vbox ); + + mVersionLabel = new TQLabel( productArea, "version" ); + mAuthorLabel = new TQLabel( productArea, "author" ); + vbox->addWidget( mVersionLabel ); + vbox->addWidget( mAuthorLabel ); + hbox->activate(); + + mTopLayout->addSpacing( KDialog::spacingHint() ); + } + + TQHBoxLayout* const hbox = new TQHBoxLayout(); + if( !hbox ) { return; } + mTopLayout->addLayout( hbox, 10 ); + + if( layoutType & AbtImageLeft ) + { + TQVBoxLayout* vbox = new TQVBoxLayout(); + hbox->addLayout(vbox); + vbox->addSpacing(1); + mImageFrame = new TQFrame( this ); + setImageFrame( true ); + vbox->addWidget( mImageFrame ); + vbox->addSpacing(1); + + vbox = new TQVBoxLayout( mImageFrame, 1 ); + mImageLabel = new KImageTrackLabel( mImageFrame ); + connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), + TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); + vbox->addStretch(10); + vbox->addWidget( mImageLabel ); + vbox->addStretch(10); + vbox->activate(); + } + + if( layoutType & AbtTabbed ) + { + mPageTab = new TDEAboutTabWidget( this ); + if( !mPageTab ) { return; } + hbox->addWidget( mPageTab, 10 ); + } + else if( layoutType & AbtImageOnly ) + { + mImageFrame = new TQFrame( this ); + setImageFrame( true ); + hbox->addWidget( mImageFrame, 10 ); + + TQGridLayout* const gbox = new TQGridLayout(mImageFrame, 3, 3, 1, 0 ); + gbox->setRowStretch( 0, 10 ); + gbox->setRowStretch( 2, 10 ); + gbox->setColStretch( 0, 10 ); + gbox->setColStretch( 2, 10 ); + + mImageLabel = new KImageTrackLabel( mImageFrame ); + connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), + TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); + gbox->addWidget( mImageLabel, 1, 1 ); + gbox->activate(); + } + else + { + mPlainSpace = new TQFrame( this ); + if( !mPlainSpace ) { return; } + hbox->addWidget( mPlainSpace, 10 ); + } + + if( layoutType & AbtImageRight ) + { + TQVBoxLayout *vbox = new TQVBoxLayout(); + hbox->addLayout(vbox); + vbox->addSpacing(1); + mImageFrame = new TQFrame( this ); + setImageFrame( true ); + vbox->addWidget( mImageFrame ); + vbox->addSpacing(1); + + vbox = new TQVBoxLayout( mImageFrame, 1 ); + mImageLabel = new KImageTrackLabel( mImageFrame ); + connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), + TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); + vbox->addStretch(10); + vbox->addWidget( mImageLabel ); + vbox->addStretch(10); + vbox->activate(); + } + + fontChange( font() ); +} + + +void TDEAboutContainerBase::show( void ) +{ + TQWidget::show(); +} + +TQSize TDEAboutContainerBase::sizeHint( void ) const +{ + return minimumSize().expandedTo( TQSize( TQWidget::sizeHint().width(), 0 ) ); +} + +void TDEAboutContainerBase::fontChange( const TQFont &/*oldFont*/ ) +{ + if( mTitleLabel ) + { + TQFont f( TDEGlobalSettings::generalFont() ); + f.setBold( true ); + int fs = f.pointSize(); + if (fs == -1) + fs = TQFontInfo(f).pointSize(); + f.setPointSize( fs+2 ); // Lets not make it too big + mTitleLabel->setFont(f); + } + + if( mVersionLabel ) + { + TQFont f( TDEGlobalSettings::generalFont() ); + f.setBold( true ); + mVersionLabel->setFont(f); + mAuthorLabel->setFont(f); + mVersionLabel->parentWidget()->layout()->activate(); + } + + update(); +} + +TQFrame *TDEAboutContainerBase::addTextPage( const TQString &title, + const TQString &text, + bool richText, int numLines ) +{ + TQFrame* const page = addEmptyPage( title ); + if( !page ) { return 0; } + if( numLines <= 0 ) { numLines = 10; } + + TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); + + if( richText ) + { + KTextBrowser* const browser = new KTextBrowser( page, "browser" ); + browser->setHScrollBarMode( TQScrollView::AlwaysOff ); + browser->setText( text ); + browser->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); + + vbox->addWidget(browser); + connect(browser, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(browser, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + } + else + { + KTextEdit* const textEdit = new KTextEdit( page, "text" ); + textEdit->setReadOnly( true ); + textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); + textEdit->setWordWrap( TQTextEdit::NoWrap ); + vbox->addWidget( textEdit ); + } + + return page; +} + +TQFrame *TDEAboutContainerBase::addLicensePage( const TQString &title, + const TQString &text, int numLines) +{ + TQFrame* const page = addEmptyPage( title ); + if( !page ) { return 0; } + if( numLines <= 0 ) { numLines = 10; } + + TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); + + KTextEdit* const textEdit = new KTextEdit( page, "license" ); + textEdit->setFont( TDEGlobalSettings::fixedFont() ); + textEdit->setReadOnly( true ); + textEdit->setWordWrap( TQTextEdit::NoWrap ); + textEdit->setText( text ); + textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); + vbox->addWidget( textEdit ); + return page; +} + + +TDEAboutContainer *TDEAboutContainerBase::addContainerPage( const TQString &title, + int childAlignment, + int innerAlignment ) +{ + if( !mPageTab ) + { + kdDebug(291) << "addPage: " << "Invalid layout" << endl; + return 0; + } + + TDEAboutContainer* const container = new TDEAboutContainer( mPageTab, "container", + KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, + innerAlignment ); + mPageTab->addTab( container, title ); + + connect(container, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + + return container; +} + + +TDEAboutContainer *TDEAboutContainerBase::addScrolledContainerPage( + const TQString &title, + int childAlignment, + int innerAlignment ) +{ + if( !mPageTab ) + { + kdDebug(291) << "addPage: " << "Invalid layout" << endl; + return 0; + } + + TQFrame* const page = addEmptyPage( title ); + TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); + TQScrollView* const scrollView = new TQScrollView( page ); + scrollView->viewport()->setBackgroundMode( PaletteBackground ); + vbox->addWidget( scrollView ); + + TDEAboutContainer* const container = new TDEAboutContainer( scrollView, "container", + KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, + innerAlignment ); + scrollView->addChild( container ); + + + connect(container, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + + return container; +} + + +TQFrame *TDEAboutContainerBase::addEmptyPage( const TQString &title ) +{ + if( !mPageTab ) + { + kdDebug(291) << "addPage: " << "Invalid layout" << endl; + return 0; + } + + TQFrame* const page = new TQFrame( mPageTab, title.latin1() ); + page->setFrameStyle( TQFrame::NoFrame ); + + mPageTab->addTab( page, title ); + return page; +} + + +TDEAboutContainer *TDEAboutContainerBase::addContainer( int childAlignment, + int innerAlignment ) +{ + TDEAboutContainer* const container = new TDEAboutContainer( this, "container", + 0, KDialog::spacingHint(), childAlignment, innerAlignment ); + mTopLayout->addWidget( container, 0, childAlignment ); + + connect(container, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + + return container; +} + + + +void TDEAboutContainerBase::setTitle( const TQString &title ) +{ + if( !mTitleLabel ) + { + kdDebug(291) << "setTitle: " << "Invalid layout" << endl; + return; + } + mTitleLabel->setText(title); +} + + +void TDEAboutContainerBase::setImage( const TQString &fileName ) +{ + if( !mImageLabel ) + { + kdDebug(291) << "setImage: " << "Invalid layout" << endl; + return; + } + if( fileName.isNull() ) + { + return; + } + + const TQPixmap logo( fileName ); + if( !logo.isNull() ) + mImageLabel->setPixmap( logo ); + + mImageFrame->layout()->activate(); +} + +void TDEAboutContainerBase::setProgramLogo( const TQString &fileName ) +{ + if( fileName.isNull() ) + { + return; + } + + const TQPixmap logo( fileName ); + setProgramLogo( logo ); +} + +void TDEAboutContainerBase::setProgramLogo( const TQPixmap &pixmap ) +{ + if( !mIconLabel ) + { + kdDebug(291) << "setProgramLogo: " << "Invalid layout" << endl; + return; + } + if( !pixmap.isNull() ) + { + mIconLabel->setPixmap( pixmap ); + } +} + +void TDEAboutContainerBase::setImageBackgroundColor( const TQColor &color ) +{ + if( mImageFrame ) + { + mImageFrame->setBackgroundColor( color ); + } +} + + +void TDEAboutContainerBase::setImageFrame( bool state ) +{ + if( mImageFrame ) + { + if( state ) + { + mImageFrame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + mImageFrame->setLineWidth(1); + } + else + { + mImageFrame->setFrameStyle( TQFrame::NoFrame ); + mImageFrame->setLineWidth(0); + } + } +} + + +void TDEAboutContainerBase::setProduct( const TQString &appName, + const TQString &version, + const TQString &author, + const TQString &year ) +{ + if( !mIconLabel ) + { + kdDebug(291) << "setProduct: " << "Invalid layout" << endl; + return; + } + + if ( kapp ) + { + mIconLabel->setPixmap( kapp->icon() ); + kdDebug(291) << "setPixmap (iconName): " << kapp->iconName() << endl; + } + else + kdDebug(291) << "no kapp" << endl; + + const TQString msg1 = i18n("%1 %2 (Using Trinity %3)").arg(appName).arg(version). + arg(TQString::fromLatin1(TDE_VERSION_STRING)); + const TQString msg2 = !year.isEmpty() ? i18n("%1 %2, %3").arg('©').arg(year). + arg(author) : TQString::fromLatin1(""); + + //if (!year.isEmpty()) + // msg2 = i18n("%1 %2, %3").arg('©').arg(year).arg(author); + + mVersionLabel->setText( msg1 ); + mAuthorLabel->setText( msg2 ); + if( msg2.isEmpty() ) + { + mAuthorLabel->hide(); + } + + mIconLabel->parentWidget()->layout()->activate(); +} + + +void TDEAboutContainerBase::slotMouseTrack( int mode, const TQMouseEvent *e ) +{ + emit mouseTrack( mode, e ); +} + + +void TDEAboutContainerBase::slotUrlClick( const TQString &url ) +{ + emit urlClick( url ); +} + +void TDEAboutContainerBase::slotMailClick( const TQString &_name, + const TQString &_address ) +{ + emit mailClick( _name, _address ); +} + + + +TDEAboutContainer::TDEAboutContainer( TQWidget *_parent, const char *_name, + int _margin, int _spacing, + int childAlignment, int innerAlignment ) + : TQFrame( _parent, _name ), d(0) +{ + mAlignment = innerAlignment; + + TQGridLayout* const gbox = new TQGridLayout( this, 3, 3, _margin, _spacing ); + if( childAlignment & AlignHCenter ) + { + gbox->setColStretch( 0, 10 ); + gbox->setColStretch( 2, 10 ); + } + else if( childAlignment & AlignRight ) + { + gbox->setColStretch( 0, 10 ); + } + else + { + gbox->setColStretch( 2, 10 ); + } + + if( childAlignment & AlignVCenter ) + { + gbox->setRowStretch( 0, 10 ); + gbox->setRowStretch( 2, 10 ); + } + else if( childAlignment & AlignRight ) + { + gbox->setRowStretch( 0, 10 ); + } + else + { + gbox->setRowStretch( 2, 10 ); + } + + mVbox = new TQVBoxLayout( _spacing ); + gbox->addLayout( mVbox, 1, 1 ); + gbox->activate(); +} + + +void TDEAboutContainer::childEvent( TQChildEvent *e ) +{ + if( !e->inserted() || !e->child()->isWidgetType() ) + { + return; + } + + TQWidget* const w = static_cast(e->child()); + mVbox->addWidget( w, 0, mAlignment ); + const TQSize s( sizeHint() ); + setMinimumSize( s ); + + TQObjectList const l = childrenListObject(); // silence please + TQObjectListIterator itr( l ); + TQObject * o; + while ( (o = itr.current()) ) { + ++itr; + if( o->isWidgetType() ) + { + TQT_TQWIDGET(o)->setMinimumWidth( s.width() ); + } + } +} + + +TQSize TDEAboutContainer::sizeHint( void ) const +{ + // + // The size is computed by adding the sizeHint().height() of all + // widget children and taking the width of the widest child and adding + // layout()->margin() and layout()->spacing() + // + + TQSize total_size; + + int numChild = 0; + TQObjectList const l = childrenListObject(); // silence please + + TQObjectListIterator itr( l ); + TQObject * o; + while ( (o = itr.current()) ) { + ++itr; + if( o->isWidgetType() ) + { + ++numChild; + TQWidget* const w= TQT_TQWIDGET(o); + + TQSize s = w->minimumSize(); + if( s.isEmpty() ) + { + s = w->minimumSizeHint(); + if( s.isEmpty() ) + { + s = w->sizeHint(); + if( s.isEmpty() ) + { + s = TQSize( 100, 100 ); // Default size + } + } + } + total_size.setHeight( total_size.height() + s.height() ); + if( s.width() > total_size.width() ) { total_size.setWidth( s.width() ); } + } + } + + if( numChild > 0 ) + { + // + // Seems I have to add 1 to the height to properly show the border + // of the last entry if layout()->margin() is 0 + // + + total_size.setHeight( total_size.height() + layout()->spacing()*(numChild-1) ); + total_size += TQSize( layout()->margin()*2, layout()->margin()*2 + 1 ); + } + else + { + total_size = TQSize( 1, 1 ); + } + return total_size; +} + + +TQSize TDEAboutContainer::minimumSizeHint( void ) const +{ + return sizeHint(); +} + + +void TDEAboutContainer::addWidget( TQWidget *widget ) +{ + widget->reparent( this, 0, TQPoint(0,0) ); +} + + +void TDEAboutContainer::addPerson( const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_task, + bool showHeader, bool showFrame,bool showBold) +{ + + TDEAboutContributor* const cont = new TDEAboutContributor( this, "pers", + _name, _email, _url, _task, showHeader, showFrame, showBold ); + connect( cont, TQT_SIGNAL( openURL(const TQString&)), + this, TQT_SIGNAL( urlClick(const TQString &))); + connect( cont, TQT_SIGNAL( sendEmail(const TQString &, const TQString &)), + this, TQT_SIGNAL( mailClick(const TQString &, const TQString &))); +} + + +void TDEAboutContainer::addTitle( const TQString &title, int alignment, + bool showFrame, bool showBold ) +{ + + TQLabel* const label = new TQLabel( title, this, "title" ); + if( showBold ) + { + TQFont labelFont( font() ); + labelFont.setBold( true ); + label->setFont( labelFont ); + } + if( showFrame ) + { + label->setFrameStyle(TQFrame::Panel | TQFrame::Raised); + } + label->setAlignment( alignment ); +} + + +void TDEAboutContainer::addImage( const TQString &fileName, int alignment ) +{ + if( fileName.isNull() ) + { + return; + } + + KImageTrackLabel* const label = new KImageTrackLabel( this, "image" ); + const TQImage logo( fileName ); + if( !logo.isNull() ) + { + TQPixmap pix; + pix = logo; + label->setPixmap( pix ); + } + label->setAlignment( alignment ); +} + +#if 0 +//MOC_SKIP_BEGIN + +/** Every person displayed is stored in a TDEAboutContributor object. + * Every contributor, the author and/or the maintainer of the application are + * stored in objects of this local class. Every single field may be empty. + * To add a contributor, create a TDEAboutContributor object as a child of your + * @ref TDEAboutDialog, set its contents and add it using add addContributor. */ +class TDEAboutContributor : public QFrame +{ + // ############################################################################ + Q_OBJECT + // ---------------------------------------------------------------------------- +public: + /** The Qt constructor. */ + TDEAboutContributor(TQWidget* parent=0, const char* name=0); + /** Set the name (a literal string). */ + void setName(const TQString&); + /** Get the name. */ + TQString getName(); + /** The email address (dito). */ + void setEmail(const TQString&); + /** Get the email address. */ + TQString getEmail(); + /** The URL (dito). */ + void setURL(const TQString&); + /** Get the URL. */ + TQString getURL(); + /** The tasks the person worked on (a literal string). More than one line is + * possible, but very long texts might look ugly. */ + void setWork(const TQString&); + /** The size hint. Very important here, since TDEAboutWidget relies on it for + * geometry management. */ + TQSize sizeHint(); + TQSize minimumSizeHint(void); + virtual void show( void ); + + // ---------------------------------------------------------------------------- +protected: + // events: + /** The resize event. */ + void resizeEvent(TQResizeEvent*); + /** The paint event. */ + void paintEvent(TQPaintEvent*); + /** The label showing the program version. */ + TQLabel *name; + /** The clickable URL label showing the email address. It is only visible if + * its text is not empty. */ + KURLLabel *email; + /** Another interactive part that displays the homepage URL. */ + KURLLabel *url; + /** The description of the contributions of the person. */ + TQString work; + // ---------------------------------------------------------------------------- +protected slots: + /** The homepage URL has been clicked. */ + void urlClickedSlot(const TQString&); + /** The email address has been clicked. */ + void emailClickedSlot(const TQString& emailaddress); + // ---------------------------------------------------------------------------- +signals: + /** The email address has been clicked. */ + void sendEmail(const TQString& name, const TQString& email); + /** The URL has been clicked. */ + void openURL(const TQString& url); + // ############################################################################ +}; + + + +TDEAboutContributor::TDEAboutContributor(TQWidget* parent, const char* n) + : TQFrame(parent, n), + name(new TQLabel(this)), + email(new KURLLabel(this)), + url(new KURLLabel(this)) +{ + // ############################################################ + if(name==0 || email==0) + { // this will nearly never happen (out of memory in about box?) + kdDebug() << "TDEAboutContributor::TDEAboutContributor: Out of memory." << endl; + tqApp->quit(); + } + setFrameStyle(TQFrame::Panel | TQFrame::Raised); + // ----- + connect(email, TQT_SIGNAL(leftClickedURL(const TQString&)), + TQT_SLOT(emailClickedSlot(const TQString&))); + connect(url, TQT_SIGNAL(leftClickedURL(const TQString&)), + TQT_SLOT(urlClickedSlot(const TQString&))); + // ############################################################ +} + +void +TDEAboutContributor::setName(const TQString& n) +{ + // ############################################################ + name->setText(n); + // ############################################################ +} + +QString +TDEAboutContributor::getName() +{ + // ########################################################### + return name->text(); + // ########################################################### +} +void +TDEAboutContributor::setURL(const TQString& u) +{ + // ########################################################### + url->setText(u); + // ########################################################### +} + +QString +TDEAboutContributor::getURL() +{ + // ########################################################### + return url->text(); + // ########################################################### +} + +void +TDEAboutContributor::setEmail(const TQString& e) +{ + // ########################################################### + email->setText(e); + // ########################################################### +} + +QString +TDEAboutContributor::getEmail() +{ + // ########################################################### + return email->text(); + // ########################################################### +} + +void +TDEAboutContributor::emailClickedSlot(const TQString& e) +{ + // ########################################################### + kdDebug() << "TDEAboutContributor::emailClickedSlot: called." << endl; + emit(sendEmail(name->text(), e)); + // ########################################################### +} + +void +TDEAboutContributor::urlClickedSlot(const TQString& u) +{ + // ########################################################### + kdDebug() << "TDEAboutContributor::urlClickedSlot: called." << endl; + emit(openURL(u)); + // ########################################################### +} + +void +TDEAboutContributor::setWork(const TQString& w) +{ + // ########################################################### + work=w; + // ########################################################### +} + +#endif + + +#if 0 +QSize +TDEAboutContributor::sizeHint() +{ + // ############################################################################ + const int FrameWidth=frameWidth(); + const int WorkTextWidth=200; + int maxx, maxy; + TQRect rect; + // ----- first calculate name and email width: + maxx=name->sizeHint().width(); + maxx=QMAX(maxx, email->sizeHint().width()+WORKTEXT_IDENTATION); + // ----- now determine "work" text rectangle: + if(!work.isEmpty()) // save time + { + rect=fontMetrics().boundingRect + (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); + } + if(maxxsizeHint().width()+WORKTEXT_IDENTATION); + // ----- + maxy=2*(name->sizeHint().height()+Grid); // need a space above the KURLLabels + maxy+=/* email */ name->sizeHint().height(); + maxy+=rect.height(); + // ----- + maxx+=2*FrameWidth; + maxy+=2*FrameWidth; + return TQSize(maxx, maxy); + // ############################################################################ +} + +TQSize TDEAboutContributor::minimumSizeHint(void) +{ + return( sizeHint() ); +} + + +void TDEAboutContributor::show( void ) +{ + TQFrame::show(); + setMinimumSize( sizeHint() ); +} + + + +void +TDEAboutContributor::resizeEvent(TQResizeEvent*) +{ // the widgets are simply aligned from top to bottom, since the parent is + // expected to respect the size hint + // ############################################################################ + int framewidth=frameWidth(), childwidth=width()-2*framewidth; + int cy=framewidth; + // ----- + name->setGeometry + (framewidth, framewidth, childwidth, name->sizeHint().height()); + cy=name->height()+Grid; + email->setGeometry + (framewidth+WORKTEXT_IDENTATION, cy, + childwidth-WORKTEXT_IDENTATION, /* email */ name->sizeHint().height()); + cy+=name->height()+Grid; + url->setGeometry + (framewidth+WORKTEXT_IDENTATION, cy, + childwidth-WORKTEXT_IDENTATION, /* url */ name->sizeHint().height()); + // the work text is drawn in the paint event + // ############################################################################ +} + + +void +TDEAboutContributor::paintEvent(TQPaintEvent* e) +{ // the widgets are simply aligned from top to bottom, since the parent is + // expected to respect the size hint (the widget is only used locally by now) + // ############################################################################ + int cy=frameWidth()+name->height()+email->height()+Grid+url->height()+Grid; + int h=height()-cy-frameWidth(); + int w=width()-WORKTEXT_IDENTATION-2*frameWidth(); + // ----- + TQFrame::paintEvent(e); + if(work.isEmpty()) return; + TQPainter paint(this); // construct painter only if there is something to draw + // ----- + paint.drawText(WORKTEXT_IDENTATION, cy, w, h, AlignLeft | WordBreak, work); + // ############################################################################ +} +// MOC_SKIP_END +#endif + + +#if 0 +TQSize TDEAboutContributor::sizeHint( void ) +{ + int s = KDialog::spacingHint(); + int h = fontMetrics().lineSpacing()*3 + 2*s; + int m = frameWidth(); + + int w = name->sizeHint().width(); + w = QMAX( w, email->sizeHint().width()+s); + w = QMAX( w, url->sizeHint().width()+s); + + if( work.isEmpty() == false ) + { + const int WorkTextWidth=200; + TQRect r = fontMetrics().boundingRect + (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); + if( w < r.width() ) + { + w = QMAX( w, WorkTextWidth+s ); + } + h += QMAX( fontMetrics().lineSpacing(), r.height() ) + s; + } + return( TQSize( w + 2*m, h + 2*m ) ); + + + /* + int s = 3; + int m = frameWidth() + KDialog::spacingHint(); + int h = ls * 3 + s * 2; + int w = name->sizeHint().width(); + + w = QMAX( w, email->sizeHint().width()+WORKTEXT_IDENTATION); + w = QMAX( w, url->sizeHint().width()+WORKTEXT_IDENTATION); + if( work.isEmpty() == false ) + { + const int WorkTextWidth=200; + + TQRect r = fontMetrics().boundingRect + (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); + if( w < r.width() ) + { + w = QMAX( w, WorkTextWidth + WORKTEXT_IDENTATION ); + } + h += r.height() + s; + } + return( TQSize( w + 2*m, h + 2*m ) ); + */ +} + + +// +// The widgets are simply aligned from top to bottom, since the parent is +// expected to respect the size hint +// +void TDEAboutContributor::resizeEvent(TQResizeEvent*) +{ + int x = frameWidth(); + int s = KDialog::spacingHint(); + int h = fontMetrics().lineSpacing(); + int w = width() - 2*x; + int y = x; + + name->setGeometry( x, y, w, h ); + y += h + s; + email->setGeometry( x+s, y, w-s, h ); + y += h + s; + url->setGeometry( x+s, y, w-s, h ); + + /* + int x = frameWidth() + KDialog::spacingHint(); + int y = x; + int w = width() - 2*x; + int h = name->sizeHint().height(); + int s = 3; + + name->setGeometry( x, y, w, h ); + y += h + s; + email->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); + y += h + s; + url->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); + // + // the work text is drawn in the paint event + // + */ +} + + + +void TDEAboutContributor::paintEvent( TQPaintEvent *e ) +{ + TQFrame::paintEvent(e); + if(work.isEmpty()) return; + + int x = frameWidth() + KDialog::spacingHint(); + int h = fontMetrics().lineSpacing(); + int y = height() - frameWidth() - fontMetrics().lineSpacing(); + int w = width() - frameWidth()*2 - KDialog::spacingHint(); + + TQPainter paint( this ); + paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); + + /* + + int s = 3; + int x = frameWidth() + KDialog::spacingHint() + WORKTEXT_IDENTATION; + int w = width()-WORKTEXT_IDENTATION-2*(frameWidth()+KDialog::spacingHint()); + int y = frameWidth()+KDialog::spacingHint()+(name->sizeHint().height()+s)*3; + int h = height()-y-frameWidth(); + + TQPainter paint( this ); + paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); + */ +} +#endif + + + + + + +TDEAboutWidget::TDEAboutWidget(TQWidget *_parent, const char *_name) + : TQWidget(_parent, _name), + version(new TQLabel(this)), + cont(new TQLabel(this)), + logo(new TQLabel(this)), + author(new TDEAboutContributor(this)), + maintainer(new TDEAboutContributor(this)), + showMaintainer(false), + d(0) +{ + // ################################################################# + if( !version || !cont || !logo || !author || !maintainer ) + { + // this will nearly never happen (out of memory in about box?) + kdDebug() << "TDEAboutWidget::TDEAboutWidget: Out of memory." << endl; + tqApp->quit(); + } + // ----- + cont->setText(i18n("Other Contributors:")); + logo->setText(i18n("(No logo available)")); + logo->setFrameStyle(TQFrame::Panel | TQFrame::Raised); + version->setAlignment(AlignCenter); + // ----- + connect(author, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(author, TQT_SIGNAL(openURL(const TQString&)), + TQT_SLOT(openURLSlot(const TQString&))); + connect(maintainer, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(maintainer, TQT_SIGNAL(openURL(const TQString&)), + TQT_SLOT(openURLSlot(const TQString&))); + // ################################################################# +} + + +void +TDEAboutWidget::adjust() +{ + // ################################################################# + int cx, cy, tempx; + int maintWidth, maintHeight; + TQSize total_size; + // ----- + if(showMaintainer) + { + total_size=maintainer->sizeHint(); + maintWidth=total_size.width(); + maintHeight=total_size.height(); + } else { + maintWidth=0; + maintHeight=0; + } + total_size=author->sizeHint(); + logo->adjustSize(); + cy=version->sizeHint().height()+Grid; + cx=logo->width(); + tempx=QMAX(total_size.width(), maintWidth); + cx+=Grid+tempx; + cx=QMAX(cx, version->sizeHint().width()); + cy+=QMAX(logo->height(), + total_size.height()+(showMaintainer ? Grid+maintHeight : 0)); + // ----- + if(!contributors.isEmpty()) + { + cx=QMAX(cx, cont->sizeHint().width()); + cy+=cont->sizeHint().height()+Grid; + TQPtrListIterator _pos(contributors); + TDEAboutContributor* currEntry; + while ( (currEntry = _pos.current()) ) + { + ++_pos; + cy+=currEntry->sizeHint().height(); + } + } + // ----- + setMinimumSize(cx, cy); + // ################################################################# +} + +void +TDEAboutWidget::setLogo(const TQPixmap& i) +{ + // ############################################################################ + logo->setPixmap(i); + // ############################################################################ +} + +void TDEAboutWidget::sendEmailSlot(const TQString &_name, const TQString &_email) +{ + emit(sendEmail(_name, _email)); +} + +void TDEAboutWidget::openURLSlot(const TQString& _url) +{ + emit(openURL(_url)); +} + +void +TDEAboutWidget::setAuthor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ############################################################################ + author->setName(_name); + author->setEmail(_email); + author->setURL(_url); + author->setWork(_w); + // ############################################################################ +} + +void +TDEAboutWidget::setMaintainer(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ############################################################################ + maintainer->setName(_name); + maintainer->setEmail(_email); + maintainer->setWork(_w); + maintainer->setURL(_url); + showMaintainer=true; + // ############################################################################ +} + +void +TDEAboutWidget::addContributor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ############################################################################ + TDEAboutContributor* const c=new TDEAboutContributor(this); + // ----- + c->setName(_name); + c->setEmail(_email); + c->setURL(_url); + c->setWork(_w); + contributors.append(c); + connect(c, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(c, TQT_SIGNAL(openURL(const TQString&)), TQT_SLOT(openURLSlot(const TQString&))); + // ############################################################################ +} + +void +TDEAboutWidget::setVersion(const TQString &_name) +{ + // ############################################################################ + version->setText(_name); + // ############################################################################ +} + +void +TDEAboutWidget::resizeEvent(TQResizeEvent*) +{ + // ############################################################################ + int _x=0, _y, cx, tempx, tempy; + // ----- set version label geometry: + version->setGeometry(0, 0, width(), version->sizeHint().height()); + _y=version->height()+Grid; + // ----- move logo to correct position: + logo->adjustSize(); + logo->move(0, _y); + // ----- move author and maintainer right to it: + tempx=logo->width()+Grid; + cx=width()-tempx; + author->setGeometry + (tempx, _y, cx, author->sizeHint().height()); + maintainer->setGeometry + (tempx, _y+author->height()+Grid, cx, maintainer->sizeHint().height()); + + _y+=QMAX(logo->height(), + author->height()+(showMaintainer ? Grid+maintainer->height() : 0)); + // ----- + if(!contributors.isEmpty()) + { + tempy=cont->sizeHint().height(); + cont->setGeometry(0, _y, width(), tempy); + cont->show(); + _y+=tempy+Grid; + } else { + cont->hide(); + } + TQPtrListIterator _pos(contributors); + TDEAboutContributor* currEntry; + while( (currEntry = _pos.current()) ) + { + ++_pos; + tempy=currEntry->sizeHint().height(); + // y+=Grid; + currEntry->setGeometry(_x, _y, width(), tempy); + _y+=tempy; + } + if(showMaintainer) + { + maintainer->show(); + } else { + maintainer->hide(); + } + // ############################################################################ +} + +TDEAboutDialog::TDEAboutDialog(TQWidget *_parent, const char *_name, bool modal) + : KDialogBase(_parent, _name, modal, TQString::null, Ok, Ok ), + about(new TDEAboutWidget(this)), mContainerBase(0), d(0) +{ + // ################################################################# + if(!about) + { + // this will nearly never happen (out of memory in about box?) + kdDebug() << "TDEAboutDialog::TDEAboutDialog: Out of memory." << endl; + tqApp->quit(); + } + setMainWidget(about); + connect(about, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(about, TQT_SIGNAL(openURL(const TQString&)), + TQT_SLOT(openURLSlot(const TQString&))); + // ################################################################# +} + + +TDEAboutDialog::TDEAboutDialog( int layoutType, const TQString &_caption, + int buttonMask, ButtonCode defaultButton, + TQWidget *_parent, const char *_name, bool modal, + bool separator, const TQString &user1, + const TQString &user2, const TQString &user3 ) + :KDialogBase( _parent, _name, modal, TQString::null, buttonMask, defaultButton, + separator, user1, user2, user3 ), + about(0), d(0) +{ + setPlainCaption( i18n("About %1").arg(_caption) ); + + mContainerBase = new TDEAboutContainerBase( layoutType, this ); + setMainWidget(mContainerBase); + + connect( mContainerBase, TQT_SIGNAL(urlClick(const TQString &)), + this, TQT_SLOT(openURLSlot(const TQString &))); + connect( mContainerBase, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + this, TQT_SLOT(sendEmailSlot(const TQString &,const TQString &))); + connect( mContainerBase, TQT_SIGNAL(mouseTrack(int, const TQMouseEvent *)), + this, TQT_SLOT(mouseTrackSlot(int, const TQMouseEvent *))); +} + + +void TDEAboutDialog::show( void ) +{ + adjust(); + if( mContainerBase ) { mContainerBase->show(); } + TQDialog::show(); +} + + +void TDEAboutDialog::show( TQWidget * /*centerParent*/ ) +{ + adjust(); + if( mContainerBase ) { mContainerBase->show(); } + TQDialog::show(); +} + + +void TDEAboutDialog::adjust() +{ + if( !about ) { return; } + about->adjust(); + //initializeGeometry(); + resize( sizeHint() ); +} + + +void TDEAboutDialog::setLogo(const TQPixmap& i) +{ + if( !about ) { return; } + about->setLogo(i); +} + + +void TDEAboutDialog::setMaintainer(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ################################################################# + if( !about ) { return; } + about->setMaintainer(_name, _email, _url, _w); + // ################################################################# +} + +void TDEAboutDialog::setAuthor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_work) +{ + // ################################################################# + if( !about ) { return; } + about->setAuthor(_name, _email, _url, _work); + // ################################################################# +} + +void TDEAboutDialog::addContributor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ################################################################# + if( !about ) { return; } + about->addContributor(_name, _email, _url, _w); + // ################################################################# +} + +void TDEAboutDialog::setVersion(const TQString &_name) +{ + // ################################################################# + if( !about ) { return; } + about->setVersion(_name); + // ################################################################# +} + +void TDEAboutDialog::sendEmailSlot(const TQString& /*name*/, const TQString& email) +{ + if ( kapp ) + kapp->invokeMailer( email, TQString::null ); + /* + kdDebug() << "TDEAboutDialog::sendEmailSlot: request to send an email to " + << name << ", " << email << endl; + emit(sendEmail(name, email)); + */ +} + +void TDEAboutDialog::openURLSlot(const TQString& url) +{ + if ( kapp ) + kapp->invokeBrowser( url ); + //kdDebug() << "TDEAboutDialog::openURLSlot: request to open URL " << url << endl; + //emit(openURL(url)); +} + + +void TDEAboutDialog::mouseTrackSlot( int /*mode*/, const TQMouseEvent * /*e*/ ) +{ + // By default we do nothing. This method must be reimplemented. +} + + +TQFrame *TDEAboutDialog::addTextPage( const TQString &title, const TQString &text, + bool richText, int numLines ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addTextPage( title, text, richText, numLines ); +} + +TQFrame *TDEAboutDialog::addLicensePage( const TQString &title, const TQString &text, + int numLines ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addLicensePage( title, text, numLines ); +} + + +TDEAboutContainer *TDEAboutDialog::addContainerPage( const TQString &title, + int childAlignment, int innerAlignment ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addContainerPage( title, childAlignment, + innerAlignment); +} + + +TDEAboutContainer *TDEAboutDialog::addScrolledContainerPage( const TQString &title, + int childAlignment, int innerAlignment ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addScrolledContainerPage( title, childAlignment, + innerAlignment); +} + + + +TQFrame *TDEAboutDialog::addPage( const TQString &title ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addEmptyPage( title ); +} + + +TDEAboutContainer *TDEAboutDialog::addContainer( int childAlignment, + int innerAlignment ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addContainer( childAlignment, innerAlignment ); +} + + +void TDEAboutDialog::setTitle( const TQString &title ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setTitle( title ); +} + + +void TDEAboutDialog::setImage( const TQString &fileName ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setImage( fileName ); +} + +// KDE4: remove +void TDEAboutDialog::setIcon( const TQString &fileName ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProgramLogo( fileName ); +} + +void TDEAboutDialog::setProgramLogo( const TQString &fileName ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProgramLogo( fileName ); +} + +void TDEAboutDialog::setProgramLogo( const TQPixmap &pixmap ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProgramLogo( pixmap ); +} + +void TDEAboutDialog::setImageBackgroundColor( const TQColor &color ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setImageBackgroundColor( color ); +} + + +void TDEAboutDialog::setImageFrame( bool state ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setImageFrame( state ); +} + + +void TDEAboutDialog::setProduct( const TQString &appName, const TQString &version, + const TQString &author, const TQString &year ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProduct( appName, version, author, year ); +} + + + +void TDEAboutDialog::imageURL( TQWidget *_parent, const TQString &_caption, + const TQString &_path, const TQColor &_imageColor, + const TQString &_url ) +{ + TDEAboutDialog a( AbtImageOnly, TQString::null, Close, Close, _parent, "image", true ); + a.setPlainCaption( _caption ); + a.setImage( _path ); + a.setImageBackgroundColor( _imageColor ); + + TDEAboutContainer* const c = a.addContainer( AlignCenter, AlignCenter ); + if( c ) + { + c->addPerson( TQString::null, TQString::null, _url, TQString::null ); + } + a.exec(); +} + + + + +// +// A class that can can monitor mouse movements on the image +// +KImageTrackLabel::KImageTrackLabel( TQWidget *_parent, const char *_name, WFlags f ) + : TQLabel( _parent, _name, f ) +{ + setText( i18n("Image missing")); +} + +void KImageTrackLabel::mousePressEvent( TQMouseEvent *e ) +{ + emit mouseTrack( MousePress, e ); +} + +void KImageTrackLabel::mouseReleaseEvent( TQMouseEvent *e ) +{ + emit mouseTrack( MouseRelease, e ); +} + +void KImageTrackLabel::mouseDoubleClickEvent( TQMouseEvent *e ) +{ + emit mouseTrack( MouseDoubleClick, e ); +} + +void KImageTrackLabel::mouseMoveEvent ( TQMouseEvent *e ) +{ + emit mouseTrack( MouseDoubleClick, e ); +} + +void TDEAboutDialog::virtual_hook( int id, void* data ) +{ KDialogBase::virtual_hook( id, data ); } + diff --git a/tdeui/tdeaboutdialog.h b/tdeui/tdeaboutdialog.h new file mode 100644 index 000000000..fbb19b98e --- /dev/null +++ b/tdeui/tdeaboutdialog.h @@ -0,0 +1,633 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and + * Espen Sand (espen@kde.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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. + * + */ + +/* + * This file declares a class for creating "About ..." dialogs + * in a general way. It provides geometry management and some + * options to connect for, like emailing the author or maintainer. + */ + + +#ifndef _KABOUTDIALOG_H_ +#define _KABOUTDIALOG_H_ + +#include +#include + +class TQFrame; +class TQLabel; +class TQVBoxLayout; +class TQTabWidget; +class KURLLabel; +class TDEAboutContainer; +class TDEAboutContainerBase; + +class TDEAboutWidgetPrivate; + +class TDEAboutContainerPrivate; +/** + * TDEAboutContainer can be used to make a application specific AboutDialog. + */ +class TDEUI_EXPORT TDEAboutContainer : public TQFrame +{ + Q_OBJECT + + public: + TDEAboutContainer( TQWidget *parent=0, const char *name=0, + int margin=0, int spacing=0, + int childAlignment = AlignCenter, + int innerAlignment = AlignCenter ); + + void addWidget( TQWidget *widget ); + void addPerson( const TQString &name, const TQString &email, + const TQString &url, const TQString &task, + bool showHeader = false, bool showframe = false, + bool showBold = false ); + void addTitle( const TQString &title, int alignment=AlignLeft, + bool showframe = false, bool showBold = false ); + void addImage( const TQString &fileName, int alignment=AlignLeft ); + + virtual TQSize sizeHint( void ) const; + virtual TQSize minimumSizeHint( void ) const; + + protected: + virtual void childEvent( TQChildEvent *e ); + + signals: + void urlClick( const TQString &url ); + void mailClick( const TQString &name, const TQString &address ); + + + private: + TQVBoxLayout *mVbox; + int mAlignment; + TDEAboutContainerPrivate* const d; +}; + +class TDEAboutContributorPrivate; + +/** + * Used internally by TDEAboutWidget + * @internal + */ +class TDEUI_EXPORT TDEAboutContributor : public TQFrame +{ + Q_OBJECT + + public: + TDEAboutContributor( TQWidget *parent=0, const char *name=0, + const TQString &username=TQString::null, + const TQString &email=TQString::null, + const TQString &url=TQString::null, + const TQString &work=TQString::null, + bool showHeader=false, bool showFrame=true, + bool showBold=false ); + + void setName( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + void setEmail( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + void setURL( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + void setWork( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + TQString getName( void ) const; + TQString getEmail( void ) const; + TQString getURL( void ) const; + TQString getWork( void ) const; + + virtual TQSize sizeHint( void ) const; + + protected: + virtual void fontChange( const TQFont &oldFont ); + + protected slots: + void urlClickedSlot( const TQString& ); + void emailClickedSlot( const TQString& emailaddress ); + + private: + void updateLayout( void ); + + signals: + void sendEmail(const TQString& name, const TQString& email); + void openURL(const TQString& url); + + private: + TQLabel *mLabel[4]; + TQLabel *mText[4]; + bool mShowHeader; + bool mShowBold; + + TDEAboutContributorPrivate* const d; + + virtual void setName(const char *_name) { TQFrame::setName(_name); } +}; + +/** + * TDEAboutWidget is the main widget for TDEAboutDialog. + * + * It has a minimum size set. + */ +class TDEUI_EXPORT TDEAboutWidget : public TQWidget +{ + Q_OBJECT + +public: + + /** + * The Qt constructor. + */ + TDEAboutWidget(TQWidget* parent=0, const char* name=0 ); + + /** + * Adjust the minimum size (after setting the properties of the image and + * the labels. + */ + void adjust(); + + /** + * Sets the image as the application logo. + */ + void setLogo(const TQPixmap&); + /** + * Sets the author's name and email address. + */ + void setAuthor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + /** + * Sets the maintainers name and email address. + */ + void setMaintainer(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + /** + * Shows this person as one of the major contributors. + */ + void addContributor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + /** + * Sets the text describing the version. + */ + void setVersion(const TQString& name); + // ------------------------------------------------------------------------- +protected slots: + /** + * Catches the signals from the contributors elements. + */ + void sendEmailSlot(const TQString& name, const TQString& email); + /** + * Catches the clicked URLs. + */ + void openURLSlot(const TQString& url); + // ------------------------------------------------------------------------- +signals: + /** + * An email address has been selected by the user. + */ + void sendEmail(const TQString& name, const TQString& email); + /** + * An URL has been clicked. + */ + void openURL(const TQString& url); + // ------------------------------------------------------------------------- +protected: + // events: + /** + * The resize event. + */ + void resizeEvent(TQResizeEvent*); + /** + * The label showing the program version. + */ + TQLabel *version; + /** + * The label showing the text "Other contributors:". + */ + TQLabel *cont; + /** + * The frame showing the logo. + */ + TQLabel *logo; + /** + * The application developer. + */ + TDEAboutContributor *author; + /** + * The application maintainer. + */ + TDEAboutContributor *maintainer; + /** + * Show the maintainer? + */ + bool showMaintainer; + /** + * A set of people who contributed to the application. + */ + TQPtrList contributors; + // ######################################################################### + // +private: + TDEAboutWidgetPrivate* const d; +}; + +class TDEAboutDialogPrivate; +/** + * A KDialogBase with predefined main widget. + * + * As a KDialogBase it uses your application wide settings + * for KDialogBase + * objects (base frame tiles, main frame tiles etc). + * To use it, simply create a TDEAboutDialog object, set all (or some) of its + * properties and show it. Do not derive it to create your own about dialog + * until you need some cool features that are unsupported and you have + * contacted me to add them. + * + * The dialog can be created using two different constructors. The + * difference between these constructors is the available components that + * can be used to build the contents of the dialog. The first (Constructor I) + * provides a number of easy to use methods. Basically it allows you + * to add the components of choice, and the components are placed in a + * predefined layout. You do not have to plan the layout. Everything is + * taken care of. + * + * The second constructor (Constructor II) works in quite the same manner + * as the first, but you have better control on where the components + * are postioned in the layout and you have access to an extended number + * of components you can install such as titles, product information, + * a tabbed pages (where you can display rich text with url links) and + * a person (developer) information field. The "About KDE" dialog box is + * created with Constructor II. + * + * For the derived features, see the basic class KDialogBase. + * @author Mirko Boehm (mirko@kde.org) and Espen Sand (espensa@online.no) + * @see KDialogBase + */ +class TDEUI_EXPORT TDEAboutDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * Layout formats. + **/ + enum LayoutType + { + AbtPlain = 0x0001, + AbtTabbed = 0x0002, + AbtTitle = 0x0004, + AbtImageLeft = 0x0008, + AbtImageRight = 0x0010, + AbtImageOnly = 0x0020, + AbtProduct = 0x0040, + AbtKDEStandard = AbtTabbed|AbtTitle|AbtImageLeft, + AbtAppStandard = AbtTabbed|AbtTitle|AbtProduct, + AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly + }; + + public: + /** + * The standard Qt constructor (Constructor I). + * + * Add components with the following methods: + * setLogo(), setAuthor(), setMaintainer(), + * addContributor(), or setVersion(). + * The dialog will be laid out automatically. + */ + TDEAboutDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); + + /** + * The extended constructor. (Constructor II). + * + * Add components with the methods: + * setTitle(), setImage(), setImageBackgroundColor(), + * setImageFrame(), setProduct(), addTextPage(), + * addContainerPage(), addContainer(), or addPage(). + * + * @param dialogLayout Use a mask of LayoutType flags. + * @param caption The dialog caption. The text you specify is prepended + * by i18n("About"). + * @param buttonMask Specifies what buttons will be visible. + * @param defaultButton Specifies what button will be marked as the default. + * @param parent Parent of the dialog. + * @param name Dialog name (for internal use only) + * @param modal Sets dialog modality. If false, the rest of the + * program interface (other dialogs, for example) is accessible while + * the dialog is open. + * @param separator If true, a separator line is drawn between the action + * buttons an the main widget. + * @param user1 User button1 text. + * @param user2 User button2 text. + * @param user3 User button3 text. + * + */ + TDEAboutDialog( int dialogLayout, const TQString &caption, int buttonMask, + ButtonCode defaultButton, TQWidget *parent=0, + const char *name=0, bool modal=false, bool separator = false, + const TQString &user1 = TQString::null, + const TQString &user2 = TQString::null, + const TQString &user3 = TQString::null ); + + /** + * Adjusts the dialog. + * + * You can call this method after you have set up all + * the contents but it is not required. It is done automatically when + * show() is executed. + */ + void adjust(); + + /** + * Makes a modeless (modal = false in constructor) dialog visible. + * + * If you reimplement this method make sure you run it + * in the new method (e.g., show()). Reimplemented + * from KDialogBase. + */ + virtual void show( void ); + + /** + * Makes a modeless (modal = false in constructor) dialog visible. + * + * If you reimplmement this method make sure you run it + * in the new method (i.e., show( parent )). + * + * @param centerParent Center the dialog with respect to this widget. + */ + virtual void show( TQWidget *centerParent ); + + /** + * (Constructor II only) + * Sets a title (not caption) in the uppermost area of the dialog. + * + * @param title Title string. + */ + void setTitle( const TQString &title ); + + /** + * (Constructor II only) + * Define an image to be shown in the dialog. The position is dependent + * on the @p dialogLayout in the constructor + * + * @param fileName Path to image file. + */ + void setImage( const TQString &fileName ); + + /** + * (Constructor II only) + * Define the program logo to be shown in the dialog. Use this to override the + * default program logo. For example, use this function if the + * TDEAboutDialog is for a panel applet and you want to override the + * appletproxy logo with your own pixmap. + * + * @param fileName Path to file containing logo data in a format that + * can be loaded by TQPixmap. + * + * @since 3.3 + */ + void setIcon( const TQString &fileName ) KDE_DEPRECATED; // KDE4: remove + + /** + * Overloaded version of setProgramLogo(const TQPixmap& pixmap). + * + * @since 3.4 + */ + void setProgramLogo( const TQString &fileName ); + + /** + * (Constructor II only) + * Define the program logo to be shown in the dialog. Use this to override the + * default program logo. For example, use this function if the + * TDEAboutDialog is for a panel applet and you want to override the + * appletproxy logo with your own pixmap. + * + * @param pixmap The logo pixmap. + * + * @since 3.4 + */ + void setProgramLogo( const TQPixmap &pixmap ); + + /** + * (Constructor II only) + * The image has a minimum size, but is centered within an area if the + * dialog box is enlarged by the user. You set the background color + * of the area with this method. + * + * @param color Background color. + */ + void setImageBackgroundColor( const TQColor &color ); + + /** + * (Constructor II only) + * Enables or disables a frame around the image. The frame is, by default, + * enabled in the constructor + * + * @param state A value of @p true enables the frame + */ + void setImageFrame( bool state ); + + /** + * (Constructor II only) + * Prints the application name, KDE version, author, a copyright sign + * and a year string. To the left of the text the standard application + * icon is displayed. + * + * @param appName The application name. + * @param version Application version. + * @param author One or more authors. + * @param year A string telling when the application was made. + */ + void setProduct( const TQString &appName, const TQString &version, + const TQString &author, const TQString &year ); + + /** + * (Constructor II only) + * Adds a text page to a tab box. The text can be regular text or + * rich text. The rich text can contain URLs and mail links. + * + * @param title Tab name. + * @param text The text to display. + * @param richText Set this to @p true if 'text' is rich text. + * @param numLines The text area height will be adjusted so that this + * is the minimum number of lines of text that are visible. + * @return The frame that contains the page. + */ + TQFrame *addTextPage( const TQString &title, const TQString &text, + bool richText=false, int numLines=10 ); + + /** + * (Constructor II only) + * Adds a license page to a tab box. + * + * @param title Tab name. + * @param text The text to display. + * @param numLines The text area height will be adjusted so that this + * is the minimum number of lines of text that are visible. + * @return The frame that contains the page. + */ + TQFrame *addLicensePage( const TQString &title, const TQString &text, + int numLines=10 ); + + /** + * (Constructor II only) + * Adds a container to a tab box. You can add text and images to a + * container. + * + * @param title Tab name. + * @param childAlignment Specifies how the children of the container are + * aligned with respect to the container. + * @param innerAlignment Specifies how the children are aligned with + * respect to each other. + * @return The new container. + */ + TDEAboutContainer *addContainerPage( const TQString &title, + int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); + + /** + * (Constructor II only) + * Adds a container inside a TQScrollView to a tab box. You can add text + * and images to a container. + * + * @param title Tab name. + * @param childAlignment Specifies how the children of the container are + * aligned with respect to the container. + * @param innerAlignment Specifies how the children are aligned with + * respect to each other. + * @return The new container. + */ + TDEAboutContainer *addScrolledContainerPage( const TQString &title, + int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); + + /** + * (Constructor II only) + * Adds a container. You can add text and images to a container. + * + * @param childAlignment Specifies how the children of the container are + * aligned with respect to the container. + * @param innerAlignment Specifies how the children are aligned with + * respect to each other. + * @return The new container. + */ + TDEAboutContainer *addContainer( int childAlignment, int innerAlignment ); + + /** + * (Constructor II only) + * Adds an empty page to a tab box. + * + * @param title Tab name + * @return The new page. + */ + TQFrame *addPage( const TQString &title ); + + + /** + * (Constructor I only) + * Sets the image as the application logo. + */ + void setLogo(const TQPixmap&); + + /** + * (Constructor I only) + * Sets the author's name and email address. + */ + void setAuthor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + + /** + * (Constructor I only) + * Sets the maintainer's name and email address. + */ + void setMaintainer(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + + /** + * (Constructor I only) + * Show this person as one of the major contributors. + */ + void addContributor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + + /** + * (Constructor I only) + * Sets the text describing the version. + */ + void setVersion(const TQString& name); + + /** + * Create a modal dialog with an image in the upper area with a + * URL link below. + */ + static void imageURL( TQWidget *parent, const TQString &caption, + const TQString &path, const TQColor &imageColor, + const TQString &url ); + +signals: + /** + * Send an email to this person. + * + * The application must provide the + * functionality. + */ + void sendEmail(const TQString& name, const TQString& email); + + /** + * Open the selected URL. + */ + void openURL(const TQString& url); + // ---------------------------------------------------------------------------- +protected: + /** + * The main widget (Constructor I) + */ + TDEAboutWidget * about; + + /** + * The main widget (Constructor II) + */ + TDEAboutContainerBase *mContainerBase; + + // ------------------------------------------------------------------------- +protected slots: + + /** + * Connected to widget->sendEmail. + */ + void sendEmailSlot(const TQString& name, const TQString& email); + + /** + * Open this URL. + */ + void openURLSlot(const TQString& url); + + /** + * (Constructor II only) + * Tells the position of the mouse cursor when the left mouse button + * is pressed above an image + */ + virtual void mouseTrackSlot( int mode, const TQMouseEvent *e ); + + // ######################################################################### +protected: + virtual void virtual_hook( int id, void* data ); +private: + TDEAboutDialogPrivate* const d; +}; + +#endif // defined KABOUTDIALOG_H diff --git a/tdeui/tdeabouttde.cpp b/tdeui/tdeabouttde.cpp new file mode 100644 index 000000000..0e7078af4 --- /dev/null +++ b/tdeui/tdeabouttde.cpp @@ -0,0 +1,87 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Espen Sand (espen@kde.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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. + * + */ + +// I (espen) prefer that header files are included alphabetically +#include +#include +#include +#include + + +TDEAboutKDE::TDEAboutKDE( TQWidget *parent, const char *name, bool modal ) + :TDEAboutDialog( TDEAboutDialog::AbtKDEStandard, TQString::fromLatin1("TDE"), + KDialogBase::Help|KDialogBase::Close, KDialogBase::Close, + parent, name, modal ) +{ + const TQString text1 = i18n("" + "The Trinity Desktop Environment is a fork of the " + "K Desktop Environment version 3.5, which was originally written by the KDE Team, " + "a world-wide network of software engineers committed to Free Software " + "development.

No single group, company or organization controls the " + "Trinity source code. Everyone is welcome to contribute to Trinity.

Visit http://www.trinitydesktop.org for more information " + "about Trinity, and http://www.kde.org " + "for more information on the KDE project. "); + + const TQString text2 = i18n("" + "Software can always be improved, and the Trinity Team is ready to " + "do so. However, you - the user - must tell us when " + "something does not work as expected or could be done better.

" + "The Trinity Desktop Environment has a bug tracking system. Visit " + "http://bugs.pearsoncomputing.net or " + "use the \"Report Bug...\" dialog from the \"Help\" menu to report bugs.

" + "If you have a suggestion for improvement then you are welcome to use " + "the bug tracking system to register your wish. Make sure you use the " + "severity called \"Wishlist\"." ); + + const TQString text3 = i18n("" + "You do not have to be a software developer to be a member of the " + "Trinity team. You can join the national teams that translate " + "program interfaces. You can provide graphics, themes, sounds, and " + "improved documentation. You decide!" + "

" + "Visit " + "http://www.trinitydesktop.org/jobs/ " + "for information on some projects in which you can participate." + "

" + "If you need more information or documentation, then a visit to " + "http://www.trinitydesktop.org/docs/ " + "will provide you with what you need."); + const TQString text4 = i18n("" + "Trinity is available free of charge, but making it is not free.

" + "

" + "The Trinity team does need financial support. Most of the money is used to " + "reimburse members and others on expenses they experienced when " + "contributing to Trinity. You are encouraged to support Trinity through a financial " + "donation, using one of the ways described at " + "http://www.trinitydesktop.org/donate.php." + "

Thank you very much in advance for your support!"); + setHelp( TQString::fromLatin1("khelpcenter/main.html"), TQString::null ); + setTitle(i18n("Trinity Desktop Environment. Release %1"). + arg(TQString::fromLatin1(TDE_VERSION_STRING)) ); + addTextPage( i18n("About Trinity","&About"), text1, true ); + addTextPage( i18n("&Report Bugs/Request Enhancements"), text2, true ); + addTextPage( i18n("&Join the Trinity Team"), text3, true ); + addTextPage( i18n("&Support Trinity"), text4, true ); + setImage( locate( "data", TQString::fromLatin1("tdeui/pics/aboutkde.png")) ); + setImageBackgroundColor( white ); +} diff --git a/tdeui/tdeabouttde.h b/tdeui/tdeabouttde.h new file mode 100644 index 000000000..a75b92904 --- /dev/null +++ b/tdeui/tdeabouttde.h @@ -0,0 +1,62 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Espen Sand (espen@kde.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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. + * + */ + +#ifndef _KABOUT_KDE_H_ +#define _KABOUT_KDE_H_ + +#include + +/** + * @short Standard "About KDE" dialog box, + * + * This class provides the standard "About KDE" dialog box that is used + * KHelpMenu Normally you should not use this class directly but + * rather the KHelpMenu class or even better just subclass your + * toplevel window from TDEMainWindow. If you do the latter, the help + * menu and thereby this dialog box is available through the + * TDEMainWindow::helpMenu() function. + * + * @author Espen Sand (espen@kde.org) + */ + +class TDEUI_EXPORT TDEAboutKDE : public TDEAboutDialog +{ + public: + /** + * Constructor. Creates a fully featured "About KDE" dialog box. + * Note that this dialog is made modeless in the KHelpMenu class so + * the users may expect a modeless dialog. + * + * @param parent The parent of the dialog box. You should use the + * toplevel window so that the dialog becomes centered. + * @param name Internal name of the widget. This name in not used in the + * caption. + * @param modal If false, this widget will be modeless and must be + * made visible using TQWidget::show(). Otherwise it will be + * modal and must be made visible using TQWidget::exec() + */ + TDEAboutKDE( TQWidget *parent=0, const char *name=0, bool modal=true ); +}; + + +#endif + + diff --git a/tdeui/tdeaction.cpp b/tdeui/tdeaction.cpp index 1cae013a2..d817a5ba4 100644 --- a/tdeui/tdeaction.cpp +++ b/tdeui/tdeaction.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/tdeactionclasses.cpp b/tdeui/tdeactionclasses.cpp index 3b07f56ca..1fc963887 100644 --- a/tdeui/tdeactionclasses.cpp +++ b/tdeui/tdeactionclasses.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/tdeactioncollection.cpp b/tdeui/tdeactioncollection.cpp index 9181fca89..16104e242 100644 --- a/tdeui/tdeactioncollection.cpp +++ b/tdeui/tdeactioncollection.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/tdecmodule.cpp b/tdeui/tdecmodule.cpp index 85a23341e..4e6ce943f 100644 --- a/tdeui/tdecmodule.cpp +++ b/tdeui/tdecmodule.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include #include #include diff --git a/tdeui/tdefontdialog.cpp b/tdeui/tdefontdialog.cpp index 2a8398419..15c687e13 100644 --- a/tdeui/tdefontdialog.cpp +++ b/tdeui/tdefontdialog.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdelistbox.cpp b/tdeui/tdelistbox.cpp index 02ecf2fd1..9f7c23688 100644 --- a/tdeui/tdelistbox.cpp +++ b/tdeui/tdelistbox.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/tdelistview.cpp b/tdeui/tdelistview.cpp index 158eac5ab..020f18679 100644 --- a/tdeui/tdelistview.cpp +++ b/tdeui/tdelistview.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/tdemainwindow.cpp b/tdeui/tdemainwindow.cpp index b7596c262..01b6a09e0 100644 --- a/tdeui/tdemainwindow.cpp +++ b/tdeui/tdemainwindow.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdemainwindowiface.cpp b/tdeui/tdemainwindowiface.cpp index fc864d9fa..8f8a9d40c 100644 --- a/tdeui/tdemainwindowiface.cpp +++ b/tdeui/tdemainwindowiface.cpp @@ -20,7 +20,7 @@ #include "tdemainwindowiface.h" #include -#include +#include #include #include #include diff --git a/tdeui/tdepopupmenu.cpp b/tdeui/tdepopupmenu.cpp index 62ac6f4ad..46d5c758f 100644 --- a/tdeui/tdepopupmenu.cpp +++ b/tdeui/tdepopupmenu.cpp @@ -30,7 +30,7 @@ #include "tdepopupmenu.h" #include -#include +#include TDEPopupTitle::TDEPopupTitle(TQWidget *parent, const char *name) : TQWidget(parent, name) diff --git a/tdeui/tdeshortcutdialog.cpp b/tdeui/tdeshortcutdialog.cpp index 73f06581f..fe3593b7e 100644 --- a/tdeui/tdeshortcutdialog.cpp +++ b/tdeui/tdeshortcutdialog.cpp @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdespell.cpp b/tdeui/tdespell.cpp index 8eac3bde2..629013121 100644 --- a/tdeui/tdespell.cpp +++ b/tdeui/tdespell.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdespelldlg.cpp b/tdeui/tdespelldlg.cpp index ac0ccb984..280ddf861 100644 --- a/tdeui/tdespelldlg.cpp +++ b/tdeui/tdespelldlg.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdetoolbar.cpp b/tdeui/tdetoolbar.cpp index 02173e41b..a095f1493 100644 --- a/tdeui/tdetoolbar.cpp +++ b/tdeui/tdetoolbar.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/tdetoolbarbutton.cpp b/tdeui/tdetoolbarbutton.cpp index da5fc7b9b..608c31a32 100644 --- a/tdeui/tdetoolbarbutton.cpp +++ b/tdeui/tdetoolbarbutton.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdetoolbarhandler.cpp b/tdeui/tdetoolbarhandler.cpp index e03880bad..4242a119e 100644 --- a/tdeui/tdetoolbarhandler.cpp +++ b/tdeui/tdetoolbarhandler.cpp @@ -19,7 +19,7 @@ #include "tdetoolbarhandler.h" #include -#include +#include #include #include #include diff --git a/tdeui/tests/itemcontainertest.cpp b/tdeui/tests/itemcontainertest.cpp index af7fb41e2..c96d6a4eb 100644 --- a/tdeui/tests/itemcontainertest.cpp +++ b/tdeui/tests/itemcontainertest.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tests/kaboutdialogtest.cpp b/tdeui/tests/kaboutdialogtest.cpp index 0555070a6..c3be2de25 100644 --- a/tdeui/tests/kaboutdialogtest.cpp +++ b/tdeui/tests/kaboutdialogtest.cpp @@ -8,10 +8,10 @@ * $Revision$ */ -#include "kaboutdialog.h" +#include "tdeaboutdialog.h" // #include #include -#include +#include #include int main(int argc, char** argv) diff --git a/tdeui/tests/kblendtest.cpp b/tdeui/tests/kblendtest.cpp index dc708f2b5..4672b76ee 100644 --- a/tdeui/tests/kblendtest.cpp +++ b/tdeui/tests/kblendtest.cpp @@ -1,5 +1,5 @@ #include "kblendtest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/kbuttonboxtest.cpp b/tdeui/tests/kbuttonboxtest.cpp index 8f2052b28..c9eb1134b 100644 --- a/tdeui/tests/kbuttonboxtest.cpp +++ b/tdeui/tests/kbuttonboxtest.cpp @@ -16,7 +16,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include #include "kbuttonbox.h" #include #include diff --git a/tdeui/tests/kcharselecttest.cpp b/tdeui/tests/kcharselecttest.cpp index 019f6bd43..ccd6cd10a 100644 --- a/tdeui/tests/kcharselecttest.cpp +++ b/tdeui/tests/kcharselecttest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "kcharselect.h" diff --git a/tdeui/tests/kcolordlgtest.cpp b/tdeui/tests/kcolordlgtest.cpp index 23c0b89ea..f45df0de7 100644 --- a/tdeui/tests/kcolordlgtest.cpp +++ b/tdeui/tests/kcolordlgtest.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include "kcolordialog.h" #include #include diff --git a/tdeui/tests/kcolortest.cpp b/tdeui/tests/kcolortest.cpp index 3f61da00f..243de265b 100644 --- a/tdeui/tests/kcolortest.cpp +++ b/tdeui/tests/kcolortest.cpp @@ -1,6 +1,6 @@ #include "kcolortest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/kcomboboxtest.cpp b/tdeui/tests/kcomboboxtest.cpp index 701710891..225c80c0f 100644 --- a/tdeui/tests/kcomboboxtest.cpp +++ b/tdeui/tests/kcomboboxtest.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include #include diff --git a/tdeui/tests/kcompletiontest.cpp b/tdeui/tests/kcompletiontest.cpp index 617957b4c..12e3835dc 100644 --- a/tdeui/tests/kcompletiontest.cpp +++ b/tdeui/tests/kcompletiontest.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include /* diff --git a/tdeui/tests/kdatepicktest.cpp b/tdeui/tests/kdatepicktest.cpp index df8bc7013..abcfeb24a 100644 --- a/tdeui/tests/kdatepicktest.cpp +++ b/tdeui/tests/kdatepicktest.cpp @@ -1,6 +1,6 @@ #include "kdatepicker.h" #include -#include +#include #include int main(int argc, char** argv) diff --git a/tdeui/tests/kdatetimewidgettest.cpp b/tdeui/tests/kdatetimewidgettest.cpp index 9b158faf8..721f86492 100644 --- a/tdeui/tests/kdatetimewidgettest.cpp +++ b/tdeui/tests/kdatetimewidgettest.cpp @@ -1,5 +1,5 @@ #include "kdatetimewidget.h" -#include +#include #include int main(int argc, char** argv) diff --git a/tdeui/tests/kdatewidgettest.cpp b/tdeui/tests/kdatewidgettest.cpp index 16521da20..11fb243f3 100644 --- a/tdeui/tests/kdatewidgettest.cpp +++ b/tdeui/tests/kdatewidgettest.cpp @@ -1,6 +1,6 @@ #include "kdatewidget.h" #include -#include +#include #include int main(int argc, char** argv) diff --git a/tdeui/tests/kdesattest.cpp b/tdeui/tests/kdesattest.cpp index fbf93bfe8..8eab0b125 100644 --- a/tdeui/tests/kdesattest.cpp +++ b/tdeui/tests/kdesattest.cpp @@ -1,5 +1,5 @@ #include "kdesattest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/kdialogbasetest.cpp b/tdeui/tests/kdialogbasetest.cpp index b1c7d422c..7f8023bd2 100644 --- a/tdeui/tests/kdialogbasetest.cpp +++ b/tdeui/tests/kdialogbasetest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tdeui/tests/kdocktest.cpp b/tdeui/tests/kdocktest.cpp index fbbb799fc..538e2b888 100644 --- a/tdeui/tests/kdocktest.cpp +++ b/tdeui/tests/kdocktest.cpp @@ -1,6 +1,6 @@ #include "kdocktest.h" -#include +#include #include #include diff --git a/tdeui/tests/kdockwidgetdemo.cpp b/tdeui/tests/kdockwidgetdemo.cpp index c252c7cf8..a922acf2d 100644 --- a/tdeui/tests/kdockwidgetdemo.cpp +++ b/tdeui/tests/kdockwidgetdemo.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include //#include #include diff --git a/tdeui/tests/kdockwidgettest.cpp b/tdeui/tests/kdockwidgettest.cpp index 144391f50..683d42acd 100644 --- a/tdeui/tests/kdockwidgettest.cpp +++ b/tdeui/tests/kdockwidgettest.cpp @@ -15,7 +15,7 @@ #include "kdockwidgettest.h" #include -#include +#include #include #include #include diff --git a/tdeui/tests/kdualcolortest.cpp b/tdeui/tests/kdualcolortest.cpp index ea749cd6e..e52d6e671 100644 --- a/tdeui/tests/kdualcolortest.cpp +++ b/tdeui/tests/kdualcolortest.cpp @@ -1,6 +1,6 @@ #include "kdualcolortest.h" #include -#include +#include #include #include #include diff --git a/tdeui/tests/keditlistboxtest.cpp b/tdeui/tests/keditlistboxtest.cpp index 177a8b6ec..5b4e45ddb 100644 --- a/tdeui/tests/keditlistboxtest.cpp +++ b/tdeui/tests/keditlistboxtest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tdeui/tests/kedittest.cpp b/tdeui/tests/kedittest.cpp index 42d6f659f..f806c3bdf 100644 --- a/tdeui/tests/kedittest.cpp +++ b/tdeui/tests/kedittest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tdeui/tests/kgradienttest.cpp b/tdeui/tests/kgradienttest.cpp index dcd45673c..4ee8c0f93 100644 --- a/tdeui/tests/kgradienttest.cpp +++ b/tdeui/tests/kgradienttest.cpp @@ -1,5 +1,5 @@ #include "kgradienttest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/khashtest.cpp b/tdeui/tests/khashtest.cpp index af7cc60cd..d392fcbc5 100644 --- a/tdeui/tests/khashtest.cpp +++ b/tdeui/tests/khashtest.cpp @@ -1,5 +1,5 @@ #include "khashtest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/kinputdialogtest.cpp b/tdeui/tests/kinputdialogtest.cpp index 5db3babff..b40b5c562 100644 --- a/tdeui/tests/kinputdialogtest.cpp +++ b/tdeui/tests/kinputdialogtest.cpp @@ -3,7 +3,7 @@ * License: GPL V2 */ -#include +#include #include #include diff --git a/tdeui/tests/kjanuswidgettest.cpp b/tdeui/tests/kjanuswidgettest.cpp index 12a267a02..71e72fb13 100644 --- a/tdeui/tests/kjanuswidgettest.cpp +++ b/tdeui/tests/kjanuswidgettest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tdeui/tests/kledtest.cpp b/tdeui/tests/kledtest.cpp index 48f2f1430..4ba158776 100644 --- a/tdeui/tests/kledtest.cpp +++ b/tdeui/tests/kledtest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/tdeui/tests/klineeditdlgtest.cpp b/tdeui/tests/klineeditdlgtest.cpp index 012a22b7f..ecc6ac984 100644 --- a/tdeui/tests/klineeditdlgtest.cpp +++ b/tdeui/tests/klineeditdlgtest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tdeui/tests/klineedittest.cpp b/tdeui/tests/klineedittest.cpp index 5146b7d15..793988968 100644 --- a/tdeui/tests/klineedittest.cpp +++ b/tdeui/tests/klineedittest.cpp @@ -4,9 +4,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdeui/tests/kmessageboxtest.cpp b/tdeui/tests/kmessageboxtest.cpp index 69f28e8c6..ce333edee 100644 --- a/tdeui/tests/kmessageboxtest.cpp +++ b/tdeui/tests/kmessageboxtest.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include diff --git a/tdeui/tests/knuminputtest.cpp b/tdeui/tests/knuminputtest.cpp index fad4cd50a..9a333dfda 100644 --- a/tdeui/tests/knuminputtest.cpp +++ b/tdeui/tests/knuminputtest.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include "knuminputtest.h" diff --git a/tdeui/tests/kpalettetest.cpp b/tdeui/tests/kpalettetest.cpp index 8edb97a57..94036244e 100644 --- a/tdeui/tests/kpalettetest.cpp +++ b/tdeui/tests/kpalettetest.cpp @@ -1,5 +1,5 @@ -#include +#include #include #include #include diff --git a/tdeui/tests/kpanelmenutest.cpp b/tdeui/tests/kpanelmenutest.cpp index 1890ff13e..a14cb3366 100644 --- a/tdeui/tests/kpanelmenutest.cpp +++ b/tdeui/tests/kpanelmenutest.cpp @@ -1,5 +1,5 @@ #include "kpanelmenutest.h" -#include +#include #include #include diff --git a/tdeui/tests/kpixmapregionselectordialogtest.cpp b/tdeui/tests/kpixmapregionselectordialogtest.cpp index 8c5cb545e..28a51a3f7 100644 --- a/tdeui/tests/kpixmapregionselectordialogtest.cpp +++ b/tdeui/tests/kpixmapregionselectordialogtest.cpp @@ -1,8 +1,8 @@ #include "kpixmapregionselectordialog.h" #include #include -#include -#include +#include +#include #include static const TDECmdLineOptions options[] = diff --git a/tdeui/tests/kprogresstest.cpp b/tdeui/tests/kprogresstest.cpp index c3665865d..6106a236b 100644 --- a/tdeui/tests/kprogresstest.cpp +++ b/tdeui/tests/kprogresstest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "kprogress.h" diff --git a/tdeui/tests/krulertest.h b/tdeui/tests/krulertest.h index cf1abc155..0242fb5d7 100644 --- a/tdeui/tests/krulertest.h +++ b/tdeui/tests/krulertest.h @@ -3,7 +3,7 @@ #ifndef krulertest_h #define krulertest_h -#include +#include #include #include #include diff --git a/tdeui/tests/kseparatortest.cpp b/tdeui/tests/kseparatortest.cpp index 17e965ca8..a791fa930 100644 --- a/tdeui/tests/kseparatortest.cpp +++ b/tdeui/tests/kseparatortest.cpp @@ -18,7 +18,7 @@ */ -#include +#include #include #include diff --git a/tdeui/tests/ksqueezedtextlabeltest.cpp b/tdeui/tests/ksqueezedtextlabeltest.cpp index a0a0e400f..7c3fd413c 100644 --- a/tdeui/tests/ksqueezedtextlabeltest.cpp +++ b/tdeui/tests/ksqueezedtextlabeltest.cpp @@ -1,5 +1,5 @@ #include "ksqueezedtextlabel.h" -#include +#include int main( int argc, char **argv ) { diff --git a/tdeui/tests/kstatusbartest.cpp b/tdeui/tests/kstatusbartest.cpp index c06f18b51..82c03e271 100644 --- a/tdeui/tests/kstatusbartest.cpp +++ b/tdeui/tests/kstatusbartest.cpp @@ -10,7 +10,7 @@ #include #include "kstatusbar.h" -#include +#include #include #include #include "kstatusbartest.h" diff --git a/tdeui/tests/ksystemtraytest.cpp b/tdeui/tests/ksystemtraytest.cpp index 07572f8d3..27a6629d9 100644 --- a/tdeui/tests/ksystemtraytest.cpp +++ b/tdeui/tests/ksystemtraytest.cpp @@ -1,5 +1,5 @@ #include -#include +#include int main(int argc, char **argv) { diff --git a/tdeui/tests/ktabctltest.cpp b/tdeui/tests/ktabctltest.cpp index b864017b0..05fe2aeb3 100644 --- a/tdeui/tests/ktabctltest.cpp +++ b/tdeui/tests/ktabctltest.cpp @@ -2,7 +2,7 @@ * */ -#include +#include #include #include #include diff --git a/tdeui/tests/ktabwidgettest.cpp b/tdeui/tests/ktabwidgettest.cpp index 84a35952f..64d2795fc 100644 --- a/tdeui/tests/ktabwidgettest.cpp +++ b/tdeui/tests/ktabwidgettest.cpp @@ -2,8 +2,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdeui/tests/ktextedittest.cpp b/tdeui/tests/ktextedittest.cpp index 6af109d5a..6570bf26d 100644 --- a/tdeui/tests/ktextedittest.cpp +++ b/tdeui/tests/ktextedittest.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include diff --git a/tdeui/tests/ktimewidgettest.cpp b/tdeui/tests/ktimewidgettest.cpp index f4465fbf7..bbff45648 100644 --- a/tdeui/tests/ktimewidgettest.cpp +++ b/tdeui/tests/ktimewidgettest.cpp @@ -1,5 +1,5 @@ #include "ktimewidget.h" -#include +#include #include int main(int argc, char** argv) diff --git a/tdeui/tests/kunbalancedgrdtest.cpp b/tdeui/tests/kunbalancedgrdtest.cpp index d9e7448d8..40904000b 100644 --- a/tdeui/tests/kunbalancedgrdtest.cpp +++ b/tdeui/tests/kunbalancedgrdtest.cpp @@ -1,5 +1,5 @@ #include "kunbalancedgrdtest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/kwizardtest.cpp b/tdeui/tests/kwizardtest.cpp index f103a114f..0635188d0 100644 --- a/tdeui/tests/kwizardtest.cpp +++ b/tdeui/tests/kwizardtest.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include int main(int argc, char **argv) diff --git a/tdeui/tests/kwordwraptest.cpp b/tdeui/tests/kwordwraptest.cpp index bd51800e8..690fbf157 100644 --- a/tdeui/tests/kwordwraptest.cpp +++ b/tdeui/tests/kwordwraptest.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include "kwordwrap.h" diff --git a/tdeui/tests/kxmlguitest.cpp b/tdeui/tests/kxmlguitest.cpp index 89c5caf30..1a79526aa 100644 --- a/tdeui/tests/kxmlguitest.cpp +++ b/tdeui/tests/kxmlguitest.cpp @@ -1,5 +1,5 @@ #include "kxmlguitest.h" -#include +#include #include #include #include diff --git a/tdeui/tests/tdeactiontest.cpp b/tdeui/tests/tdeactiontest.cpp index d62d9c3fc..dcec16189 100644 --- a/tdeui/tests/tdeactiontest.cpp +++ b/tdeui/tests/tdeactiontest.cpp @@ -1,7 +1,7 @@ #include -#include +#include #include #include diff --git a/tdeui/tests/tdefontdialogtest.cpp b/tdeui/tests/tdefontdialogtest.cpp index 2d4e187b2..ff7ac2840 100644 --- a/tdeui/tests/tdefontdialogtest.cpp +++ b/tdeui/tests/tdefontdialogtest.cpp @@ -24,7 +24,7 @@ */ -#include +#include #include "tdefontdialog.h" #include diff --git a/tdeui/tests/tdelistviewtest.cpp b/tdeui/tests/tdelistviewtest.cpp index d73baf087..c2a0e78cf 100644 --- a/tdeui/tests/tdelistviewtest.cpp +++ b/tdeui/tests/tdelistviewtest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/tdeui/tests/tdemainwindowrestoretest.cpp b/tdeui/tests/tdemainwindowrestoretest.cpp index 7b477f8f7..559348ec0 100644 --- a/tdeui/tests/tdemainwindowrestoretest.cpp +++ b/tdeui/tests/tdemainwindowrestoretest.cpp @@ -1,7 +1,7 @@ #include "tdemainwindowrestoretest.h" -#include +#include #include diff --git a/tdeui/tests/tdemainwindowtest.cpp b/tdeui/tests/tdemainwindowtest.cpp index b83123dde..c8ace159e 100644 --- a/tdeui/tests/tdemainwindowtest.cpp +++ b/tdeui/tests/tdemainwindowtest.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/tests/tdepopuptest.cpp b/tdeui/tests/tdepopuptest.cpp index c830525f1..f9a97bad4 100644 --- a/tdeui/tests/tdepopuptest.cpp +++ b/tdeui/tests/tdepopuptest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include "tdepopupmenu.h" diff --git a/tdeui/tests/tdespelltest.cpp b/tdeui/tests/tdespelltest.cpp index b4b5e571e..5ec103b99 100644 --- a/tdeui/tests/tdespelltest.cpp +++ b/tdeui/tests/tdespelltest.cpp @@ -17,7 +17,7 @@ */ #include "tdespell.h" -#include +#include #include #include diff --git a/tdeui/tests/tdetoolbarlabelactiontest.cpp b/tdeui/tests/tdetoolbarlabelactiontest.cpp index ae12e56d8..b919c2725 100644 --- a/tdeui/tests/tdetoolbarlabelactiontest.cpp +++ b/tdeui/tests/tdetoolbarlabelactiontest.cpp @@ -18,7 +18,7 @@ #include -#include +#include #include #include #include diff --git a/tdeui/tests/twindowtest.cpp b/tdeui/tests/twindowtest.cpp index d45bc2554..3823ab46f 100644 --- a/tdeui/tests/twindowtest.cpp +++ b/tdeui/tests/twindowtest.cpp @@ -9,10 +9,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeui/twindowlistmenu.cpp b/tdeui/twindowlistmenu.cpp index e23cf18da..7ca8fda3f 100644 --- a/tdeui/twindowlistmenu.cpp +++ b/tdeui/twindowlistmenu.cpp @@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include -#include +#include +#include #include #undef Bool -- cgit v1.2.1