summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/Koversiondialog.cpp
blob: 8759ef664543d14e1df0ee698259dfbe620ead3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* This file is part of the KDE project
   Copyright (C) 2005 Laurent Montel <montel@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.
*/


#include <tqlabel.h>
#include <tqlayout.h>
#include <tqmultilineedit.h>
#include <tqpushbutton.h>
#include <tqtoolbutton.h>
#include <tqapplication.h>
#include <tqlayout.h>
#include <kiconloader.h>
#include <kbuttonbox.h>
#include <kdebug.h>
#include <tdemessagebox.h>
#include <tdelocale.h>
#include <tdelistview.h>
#include <kdebug.h>

#include <tqmultilineedit.h>

#include "Koversiondialog.h"


KoVersionDialog::KoVersionDialog( TQWidget* parent,  const char* name )
    : KDialogBase( parent, name, true, i18n("Version"), Ok|Cancel )
{
  TQWidget* page = new TQWidget( this );
  setMainWidget( page );

  TQGridLayout *grid1 = new TQGridLayout( page,10,3,KDialog::marginHint(), KDialog::spacingHint());

  list=new TDEListView(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 TQPushButton(i18n("&Add"),page);
  grid1->addWidget(m_pAdd,1,2);

  m_pRemove=new TQPushButton(i18n("&Remove"),page);
  grid1->addWidget(m_pRemove,2,2);

  m_pModify=new TQPushButton(i18n("&Modify"),page);
  grid1->addWidget(m_pModify,3,2);

  m_pOpen=new TQPushButton(i18n("&Open"),page);
  grid1->addWidget(m_pOpen,4,2);


  connect( m_pRemove, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemove() ) );
  connect( m_pAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAdd() ) );
  connect( m_pOpen, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotOpen() ) );
  connect( m_pModify, TQT_SIGNAL( clicked() ), this, TQT_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 TQString &_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(  TQWidget* parent, const TQString &/*comment*/, const char* name )
    : KDialogBase( parent, name, true, i18n("Comment"), Ok|Cancel )
{
    TQWidget* page = new TQWidget( this );
    setMainWidget( page );

    TQHBoxLayout *grid1 = new TQHBoxLayout( page,KDialog::marginHint(), KDialog::spacingHint());

    m_multiline=new TQMultiLineEdit(page, "multiline");
    grid1->addWidget( m_multiline );

}

TQString KoVersionModifyDialog::comment() const
{
    return m_multiline->text();
}


#include "Koversiondialog.moc"