author | llornkcor <llornkcor> | 2002-07-28 15:05:31 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-28 15:05:31 (UTC) |
commit | 1619cf87bd1db9e991dd22f528798e1463344d4c (patch) (side-by-side diff) | |
tree | 0a8a4edc1967cf194a3ed0e974ad8ee17fcd9a86 | |
parent | a0e8d4d1d1e442b7d11723d055e49f46167d24c1 (diff) | |
download | opie-1619cf87bd1db9e991dd22f528798e1463344d4c.zip opie-1619cf87bd1db9e991dd22f528798e1463344d4c.tar.gz opie-1619cf87bd1db9e991dd22f528798e1463344d4c.tar.bz2 |
added Insert Time adn Date to edit menu
-rw-r--r-- | core/apps/textedit/textedit.cpp | 24 | ||||
-rw-r--r-- | core/apps/textedit/textedit.h | 1 |
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 @@ -38,4 +38,6 @@ #include <qpe/qcopenvelope_qws.h> +#include <qdatetime.h> +#include <qclipboard.h> #include <qstringlist.h> #include <qaction.h> @@ -51,8 +53,10 @@ #include <qcheckbox.h> #include <qcombo.h> + #include <unistd.h> #include <sys/stat.h> - #include <stdlib.h> //getenv + + /* XPM */ static char * filesave_xpm[] = { @@ -291,4 +295,11 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) a->addTo( edit ); + +#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 ); connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) ); @@ -512,5 +523,5 @@ void TextEdit::fileOpen() Config cfg("TextEdit"); cfg.setGroup("View"); - bool b=FALSE; + // bool b=FALSE; QMap<QString, QStringList> map; @@ -983,2 +994,11 @@ void TextEdit::doAdvanced(bool b) { cfg.writeEntry("AdvancedFeatures",b); } + +void TextEdit::editPasteTimeDate() { +#ifndef QT_NO_CLIPBOARD + QClipboard *cb = QApplication::clipboard(); + QDateTime dt = QDateTime::currentDateTime(); + cb->setText( dt.toString()); + editor->paste(); +#endif +} 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 @@ -70,4 +70,5 @@ protected: void doSearchBar(); private slots: + void editPasteTimeDate(); void doAdvanced(bool); void doAbout(); |