summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp24
-rw-r--r--core/apps/textedit/textedit.h1
2 files changed, 23 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 9e6ba8d..107695a 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -39,2 +39,4 @@
39 39
40#include <qdatetime.h>
41#include <qclipboard.h>
40#include <qstringlist.h> 42#include <qstringlist.h>
@@ -52,6 +54,8 @@
52#include <qcombo.h> 54#include <qcombo.h>
55
53#include <unistd.h> 56#include <unistd.h>
54#include <sys/stat.h> 57#include <sys/stat.h>
55
56#include <stdlib.h> //getenv 58#include <stdlib.h> //getenv
59
60
57/* XPM */ 61/* XPM */
@@ -292,2 +296,9 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
292 296
297
298#ifndef QT_NO_CLIPBOARD
299 a = new QAction( tr( "Insert Time and Date" ), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
300 connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) );
301 a->addTo( edit );
302#endif
303
293 a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 304 a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
@@ -513,3 +524,3 @@ void TextEdit::fileOpen()
513 cfg.setGroup("View"); 524 cfg.setGroup("View");
514 bool b=FALSE; 525 // bool b=FALSE;
515 526
@@ -984 +995,10 @@ void TextEdit::doAdvanced(bool b) {
984} 995}
996
997void TextEdit::editPasteTimeDate() {
998#ifndef QT_NO_CLIPBOARD
999 QClipboard *cb = QApplication::clipboard();
1000 QDateTime dt = QDateTime::currentDateTime();
1001 cb->setText( dt.toString());
1002 editor->paste();
1003#endif
1004}
diff --git a/core/apps/textedit/textedit.h b/core/apps/textedit/textedit.h
index aec6427..a2badaa 100644
--- a/core/apps/textedit/textedit.h
+++ b/core/apps/textedit/textedit.h
@@ -71,2 +71,3 @@ protected:
71private slots: 71private slots:
72 void editPasteTimeDate();
72 void doAdvanced(bool); 73 void doAdvanced(bool);