22#include <tqmultilineedit.h>
23#include "KoCommentDia.h"
25#include <tqpushbutton.h>
27#include <tqdatetime.h>
31KoCommentDia::KoCommentDia( TQWidget *parent, const TQString &_note, const TQString & _authorName, const TQString &_createNote, const char *name )
34 setCaption( i18n( "Edit Comment") );
35 authorName = _authorName;
36 TQVBox *page = makeVBoxMainWidget();
37 kdDebug()<< "_createNote :"<<_createNote<<endl;
38 if ( !_createNote.isEmpty() )
39 new TQLabel( _createNote, page );
41 m_multiLine = new TQMultiLineEdit( page );
42 m_multiLine->setText( _note );
43 m_multiLine->setFocus();
44 pbAddAuthorName = new TQPushButton(i18n( "Add Author Name"),page);
45 if ( authorName.isEmpty() )
46 pbAddAuthorName->setEnabled( false );
48 connect (pbAddAuthorName, TQ_SIGNAL(clicked ()), this , TQ_SLOT(slotAddAuthorName()));
49 connect ( m_multiLine , TQ_SIGNAL( textChanged()), this, TQ_SLOT( slotTextChanged( )));
55void KoCommentDia::slotTextChanged( )
60TQString KoCommentDia::commentText()
62 return m_multiLine->text();
65void KoCommentDia::slotAddAuthorName()
67 TQString date = TDEGlobal::locale()->formatDate( TQDate::currentDate() );
68 TQString time = TDEGlobal::locale()->formatTime( TQTime::currentTime() );
69 TQString result = TQString( "--------%1 ,%2, %3------\n").arg(authorName).arg(date).arg(time);
70 m_multiLine->insertLine( result, m_multiLine->numLines() );
73#include "KoCommentDia.moc"
void enableButtonOK(bool state)
const char * name(StdAction id)
|