summaryrefslogtreecommitdiff
path: root/core/apps/textedit/textedit.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp24
1 files changed, 22 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 @@
+#include <qdatetime.h>
+#include <qclipboard.h>
#include <qstringlist.h>
@@ -52,6 +54,8 @@
#include <qcombo.h>
+
#include <unistd.h>
#include <sys/stat.h>
-
#include <stdlib.h> //getenv
+
+
/* XPM */
@@ -292,2 +296,9 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
+
+#ifndef QT_NO_CLIPBOARD
+ a = new QAction( tr( "Insert Time and Date" ), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
+ connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) );
+ a->addTo( edit );
+#endif
+
a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
@@ -513,3 +524,3 @@ void TextEdit::fileOpen()
cfg.setGroup("View");
- bool b=FALSE;
+ // bool b=FALSE;
@@ -984 +995,10 @@ void TextEdit::doAdvanced(bool b) {
}
+
+void TextEdit::editPasteTimeDate() {
+#ifndef QT_NO_CLIPBOARD
+ QClipboard *cb = QApplication::clipboard();
+ QDateTime dt = QDateTime::currentDateTime();
+ cb->setText( dt.toString());
+ editor->paste();
+#endif
+}