diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /lib/kofficecore/Koversiondialog.cpp | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
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
Diffstat (limited to 'lib/kofficecore/Koversiondialog.cpp')
-rw-r--r-- | lib/kofficecore/Koversiondialog.cpp | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/lib/kofficecore/Koversiondialog.cpp b/lib/kofficecore/Koversiondialog.cpp new file mode 100644 index 00000000..b21ae52f --- /dev/null +++ b/lib/kofficecore/Koversiondialog.cpp @@ -0,0 +1,143 @@ +/* This file is part of the KDE project + Copyright (C) 2005 Laurent Montel <[email protected]> + + 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 <qlabel.h> +#include <qlayout.h> +#include <qmultilineedit.h> +#include <qpushbutton.h> +#include <qtoolbutton.h> +#include <qapplication.h> +#include <qlayout.h> +#include <kiconloader.h> +#include <kbuttonbox.h> +#include <kdebug.h> +#include <kmessagebox.h> +#include <klocale.h> +#include <klistview.h> +#include <kdebug.h> + +#include <qmultilineedit.h> + +#include "Koversiondialog.h" + + +KoVersionDialog::KoVersionDialog( QWidget* parent, const char* name ) + : KDialogBase( parent, name, true, i18n("Version"), Ok|Cancel ) +{ + QWidget* page = new QWidget( this ); + setMainWidget( page ); + + QGridLayout *grid1 = new QGridLayout( page,10,3,KDialog::marginHint(), KDialog::spacingHint()); + + list=new KListView(page, "versionlist"); + list->addColumn(i18n("Date & Time")); + list->addColumn(i18n("Saved By")); + list->addColumn(i18n("Comment")); + + grid1->addMultiCellWidget(list,0,8,0,0); + + m_pAdd=new QPushButton(i18n("&Add"),page); + grid1->addWidget(m_pAdd,1,2); + + m_pRemove=new QPushButton(i18n("&Remove"),page); + grid1->addWidget(m_pRemove,2,2); + + m_pModify=new QPushButton(i18n("&Modify"),page); + grid1->addWidget(m_pModify,3,2); + + m_pOpen=new QPushButton(i18n("&Open"),page); + grid1->addWidget(m_pOpen,4,2); + + + connect( m_pRemove, SIGNAL( clicked() ), this, SLOT( slotRemove() ) ); + connect( m_pAdd, SIGNAL( clicked() ), this, SLOT( slotAdd() ) ); + connect( m_pOpen, SIGNAL( clicked() ), this, SLOT( slotOpen() ) ); + connect( m_pModify, SIGNAL( clicked() ), this, SLOT( slotModify() ) ); + + updateButton(); + + resize( 600, 250 ); + +} + +KoVersionDialog::~KoVersionDialog() +{ +} + +void KoVersionDialog::updateButton() +{ +#if 0 + bool state = ( list->currentItem() >= 0 ); + m_pRemove->setEnabled( state ); +#endif +} + +void KoVersionDialog::slotAdd() +{ + //TODO create entry +} + +void KoVersionDialog::slotRemove() +{ + //TODO remove entry +} + +void KoVersionDialog::slotModify() +{ + KoVersionModifyDialog * dlg = new KoVersionModifyDialog( this /*, const QString &_comment*/ /*TODO add*/ ); + if ( dlg->exec() ) + { + //TODO + kdDebug()<<" comment :"<<dlg->comment()<<endl; + } + delete dlg; + +} + +void KoVersionDialog::slotOpen() +{ + //TODO open file +} + +void KoVersionDialog::slotOk() +{ + accept(); +} + +KoVersionModifyDialog::KoVersionModifyDialog( QWidget* parent, const QString &/*comment*/, const char* name ) + : KDialogBase( parent, name, true, i18n("Comment"), Ok|Cancel ) +{ + QWidget* page = new QWidget( this ); + setMainWidget( page ); + + QHBoxLayout *grid1 = new QHBoxLayout( page,KDialog::marginHint(), KDialog::spacingHint()); + + m_multiline=new QMultiLineEdit(page, "multiline"); + grid1->addWidget( m_multiline ); + +} + +QString KoVersionModifyDialog::comment() const +{ + return m_multiline->text(); +} + + +#include "Koversiondialog.moc" |