From 8362bf63dea22bbf6736609b0f49c152f975eb63 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 20 Jan 2010 01:29:50 +0000 Subject: Added old abandoned KDE3 version of koffice git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kexi/tests/gui/finddialog/finddialog.pro | 18 ++ kexi/tests/gui/finddialog/kexifinddialog.cpp | 67 +++++ kexi/tests/gui/finddialog/kexifinddialog.h | 66 +++++ kexi/tests/gui/finddialog/kexifinddialogbase.ui | 326 ++++++++++++++++++++++++ kexi/tests/gui/finddialog/main.cpp | 36 +++ 5 files changed, 513 insertions(+) create mode 100644 kexi/tests/gui/finddialog/finddialog.pro create mode 100644 kexi/tests/gui/finddialog/kexifinddialog.cpp create mode 100644 kexi/tests/gui/finddialog/kexifinddialog.h create mode 100644 kexi/tests/gui/finddialog/kexifinddialogbase.ui create mode 100644 kexi/tests/gui/finddialog/main.cpp (limited to 'kexi/tests/gui') diff --git a/kexi/tests/gui/finddialog/finddialog.pro b/kexi/tests/gui/finddialog/finddialog.pro new file mode 100644 index 00000000..f76b5372 --- /dev/null +++ b/kexi/tests/gui/finddialog/finddialog.pro @@ -0,0 +1,18 @@ +TEMPLATE = app + +include( $(KEXI)/common.pro ) + +CONFIG += qt warn_on release +DEPENDPATH = ../../include + +system( bash kmoc ) + +TARGET = finddialogtest +DESTDIR=. + +system( bash kmoc ) +system( bash kdcopidl ) + +SOURCES = kexifinddialog.cpp main.cpp + +FORMS = kexifinddialogbase.ui diff --git a/kexi/tests/gui/finddialog/kexifinddialog.cpp b/kexi/tests/gui/finddialog/kexifinddialog.cpp new file mode 100644 index 00000000..64f54d51 --- /dev/null +++ b/kexi/tests/gui/finddialog/kexifinddialog.cpp @@ -0,0 +1,67 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Jaroslaw Staniek + + 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 "kexifinddialog.h" + +#include +#include +#include +#include + +#include +#include + +KexiFindDialog::KexiFindDialog( bool replaceMode, QWidget* parent, const char* name, bool modal ) + : KexiFindDialogBase(parent, name, modal) + , m_replaceMode(true) +{ + m_btnFind->setIconSet(KStdGuiItem::find().iconSet()); + m_btnClose->setIconSet(KStdGuiItem::close().iconSet()); + setReplaceMode(replaceMode); + m_lookIn->insertItem(i18n("(All columns)")); +} + +void KexiFindDialog::setReplaceMode(bool set) +{ + if (m_replaceMode == set) + return; + m_replaceMode = set; + if (m_replaceMode) { + m_promptOnReplace->show(); + m_replaceLbl->show(); + m_textToReplace->show(); + m_btnReplace->show(); + m_btnReplaceAll->show(); + } + else { + m_promptOnReplace->hide(); + m_replaceLbl->hide(); + m_textToReplace->hide(); + m_btnReplace->hide(); + m_btnReplaceAll->hide(); + resize(width(),height()-30); + } + updateGeometry(); +} + +KexiFindDialog::~KexiFindDialog() +{ +} + +#include "kexifinddialog.moc" diff --git a/kexi/tests/gui/finddialog/kexifinddialog.h b/kexi/tests/gui/finddialog/kexifinddialog.h new file mode 100644 index 00000000..9025d152 --- /dev/null +++ b/kexi/tests/gui/finddialog/kexifinddialog.h @@ -0,0 +1,66 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Jaroslaw Staniek + + 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 KEXIFINDDIALOG_H +#define KEXIFINDDIALOG_H + +#include "kexifinddialogbase.h" + +/*! @brief A Kexi-specific "Find text" dialog. + + Also used for replace. +*/ +class KexiFindDialog : public KexiFindDialogBase +{ + Q_OBJECT + public: + KexiFindDialog( bool replaceMode, QWidget* parent = 0, const char* name = 0, bool modal = FALSE ); + virtual ~KexiFindDialog(); + +#if 0 +TODO TODO TODO TODO TODO TODO + /*! Sets \a columnNames list for 'look in column' combo box. + "(All columns)" item is also prepended. */ + void setLookInColumnList(const QStringList& columnNames); + + /*! \return a list for 'look in column' combo box. + "(All columns)" item is also prepended. */ + QStringList* lookInColumnList() const; + + /*! \return column name selected in 'look in column' combo box. + If "(All columns)" item is selected, "*" is returned. */ + QString lookInColumn() const; + + /*! Selects \a columnName to be selected 'look in column'. + By default "(All columns)" item is selected. To select this item, pass "*". */ + void setLookInColumn(const QString& columnName); + +#endif + + public slots: + /*! Sets or clears replace mode. + For replace mode 'prompt or replace' option is visible. + */ + void setReplaceMode(bool set); + + protected: + bool m_replaceMode : 1; +}; + +#endif diff --git a/kexi/tests/gui/finddialog/kexifinddialogbase.ui b/kexi/tests/gui/finddialog/kexifinddialogbase.ui new file mode 100644 index 00000000..f4684bff --- /dev/null +++ b/kexi/tests/gui/finddialog/kexifinddialogbase.ui @@ -0,0 +1,326 @@ + +KexiFindDialogBase + + + KexiFindDialogBase + + + + 0 + 0 + 476 + 224 + + + + Find Text + + + + unnamed + + + + m_textToReplace + + + AtTop + + + true + + + false + + + + + m_caseSensitive + + + WheelFocus + + + C&ase sensitive + + + + + m_textToFind + + + AtTop + + + true + + + false + + + + + + Any Part of Field + + + + + Whole Field + + + + + Start of Field + + + + m_match + + + NoInsertion + + + + + textLabel1 + + + Fi&nd: + + + m_textToFind + + + + + m_replaceLbl + + + Re&place with: + + + m_textToReplace + + + + + textLabel2_2_2 + + + &Search: + + + m_search + + + + + textLabel2_2_3 + + + &Match: + + + m_match + + + + + + Up + + + + + Down + + + + + All Rows + + + + m_search + + + WheelFocus + + + NoInsertion + + + + + m_lookIn + + + NoInsertion + + + + + textLabel2_2 + + + &Look in column: + + + m_lookIn + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 16 + 20 + + + + + + m_wholeWords + + + WheelFocus + + + &Whole words only + + + + + m_promptOnReplace + + + WheelFocus + + + Prompt on replace + + + true + + + + + spacer3 + + + Vertical + + + Expanding + + + + 20 + 16 + + + + + + layout2 + + + + unnamed + + + + m_btnFind + + + &Find Next + + + + + m_btnClose + + + Close + + + + + m_btnReplace + + + &Replace + + + + + m_btnReplaceAll + + + &Replace All + + + + + spacer8 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + + + + + + + m_btnClose + clicked() + KexiFindDialogBase + reject() + + + + m_textToFind + m_textToReplace + m_lookIn + m_search + m_match + m_caseSensitive + m_wholeWords + + + + kcombobox.h + klineedit.h + kcombobox.h + klineedit.h + kcombobox.h + kcombobox.h + kcombobox.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + + diff --git a/kexi/tests/gui/finddialog/main.cpp b/kexi/tests/gui/finddialog/main.cpp new file mode 100644 index 00000000..7da98bf4 --- /dev/null +++ b/kexi/tests/gui/finddialog/main.cpp @@ -0,0 +1,36 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Jaroslaw Staniek + + 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 "kexifinddialog.h" + +int main( int argc, char ** argv ) +{ + KAboutData aboutData( "test", I18N_NOOP("KFind"), "0", "", KAboutData::License_LGPL ); + KCmdLineArgs::init( argc, argv, &aboutData ); + KApplication app; + + KexiFindDialog dlg(true, 0, "dialog"); + + return dlg.exec(); +} -- cgit v1.2.1