summaryrefslogtreecommitdiff
path: root/noncore/applets/notesapplet/notes.cpp
Unidiff
Diffstat (limited to 'noncore/applets/notesapplet/notes.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 7b8bdd9..1142028 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -1,45 +1,46 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org> 2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3 3
4** All rights reserved. 4** All rights reserved.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "notes.h" 16#include "notes.h"
17 17
18#include <qapplication.h> 18#include <qapplication.h>
19#include <stdlib.h> 19#include <stdlib.h>
20#include <qstringlist.h> 20#include <qstringlist.h>
21 21
22#include <opie2/otaskbarapplet.h>
22#include <qpe/filemanager.h> 23#include <qpe/filemanager.h>
23#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
24#include <qpe/timestring.h> 25#include <qpe/timestring.h>
25#include <qpe/applnk.h> 26#include <qpe/applnk.h>
26#include <qpe/ir.h> 27#include <qpe/ir.h>
27#include <qpe/config.h> 28#include <qpe/config.h>
28 29
29// #include <qsocket.h> 30// #include <qsocket.h>
30// #include <qclipboard.h> 31// #include <qclipboard.h>
31#include <qmultilineedit.h> 32#include <qmultilineedit.h>
32#include <qlistbox.h> 33#include <qlistbox.h>
33#include <qpopupmenu.h> 34#include <qpopupmenu.h>
34#include <qmessagebox.h> 35#include <qmessagebox.h>
35 36
36#include <qdir.h> 37#include <qdir.h>
37#include <qfile.h> 38#include <qfile.h>
38#include <qpoint.h> 39#include <qpoint.h>
39#include <qpushbutton.h> 40#include <qpushbutton.h>
40#include <qpainter.h> 41#include <qpainter.h>
41#include <qlayout.h> 42#include <qlayout.h>
42#include <qframe.h> 43#include <qframe.h>
43#include <qpixmap.h> 44#include <qpixmap.h>
44#include <qstring.h> 45#include <qstring.h>
45#include <qtimer.h> 46#include <qtimer.h>
@@ -445,60 +446,69 @@ void NotesControl::slotSearch() {
445// if(e->key() == Key_V) { //paste 446// if(e->key() == Key_V) { //paste
446// QClipboard *cb = QApplication::clipboard(); 447// QClipboard *cb = QApplication::clipboard();
447// QString text; 448// QString text;
448// //view 449// //view
449// cb->setText(); 450// cb->setText();
450// } 451// }
451// break; 452// break;
452// }; 453// };
453// QWidget::keyReleaseEvent(e); 454// QWidget::keyReleaseEvent(e);
454// } 455// }
455 456
456//=========================================================================== 457//===========================================================================
457 458
458NotesApplet::NotesApplet( QWidget *parent, const char *name ) 459NotesApplet::NotesApplet( QWidget *parent, const char *name )
459 : QWidget( parent, name ) { 460 : QWidget( parent, name ) {
460 setFixedHeight( 18 ); 461 setFixedHeight( 18 );
461 setFixedWidth( 14 ); 462 setFixedWidth( 14 );
462 vc = new NotesControl; 463 vc = new NotesControl;
463} 464}
464 465
465NotesApplet::~NotesApplet() { 466NotesApplet::~NotesApplet() {
466 delete vc; 467 delete vc;
467} 468}
468 469
470int NotesApplet::position()
471{
472 return 6;
473}
474
469void NotesApplet::mousePressEvent( QMouseEvent *) { 475void NotesApplet::mousePressEvent( QMouseEvent *) {
470 if( !vc->isHidden()) { 476 if( !vc->isHidden()) {
471 vc->doPopulate=false; 477 vc->doPopulate=false;
472 vc->save(); 478 vc->save();
473 vc->close(); 479 vc->close();
474 } else { 480 } else {
475// vc = new NotesControl; 481// vc = new NotesControl;
476// QPoint curPos = mapToGlobal( rect().topLeft() ); 482// QPoint curPos = mapToGlobal( rect().topLeft() );
477 if(vc->showMax) { 483 if(vc->showMax) {
478 qDebug("show max"); 484 qDebug("show max");
479 vc->showMaximized(); 485 vc->showMaximized();
480 } else { 486 } else {
481 qDebug("no show max"); 487 qDebug("no show max");
482 QWidget *wid = QPEApplication::desktop(); 488 QWidget *wid = QPEApplication::desktop();
483 QRect rect = QApplication::desktop()->geometry(); 489 QRect rect = QApplication::desktop()->geometry();
484 vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180); 490 vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180);
485 vc->move ( (rect.center()/2) - (vc->rect().center()/2)); 491 vc->move ( (rect.center()/2) - (vc->rect().center()/2));
486// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28); 492// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28);
487 } 493 }
488 vc->show(); 494 vc->show();
489 vc->doPopulate=true; 495 vc->doPopulate=true;
490 vc->populateBox(); 496 vc->populateBox();
491 vc->doPopulate=false; 497 vc->doPopulate=false;
492 vc->loaded=false; 498 vc->loaded=false;
493 499
494 vc->load(); 500 vc->load();
495// this->setFocus(); 501// this->setFocus();
496 vc->view->setFocus(); 502 vc->view->setFocus();
497 } 503 }
498} 504}
499 505
500void NotesApplet::paintEvent( QPaintEvent* ) { 506void NotesApplet::paintEvent( QPaintEvent* ) {
501 QPainter p(this); 507 QPainter p(this);
502 p.drawPixmap( 0, 1, ( const char** ) notes_xpm ); 508 p.drawPixmap( 0, 1, ( const char** ) notes_xpm );
503} 509}
504 510
511Q_EXPORT_INTERFACE()
512{
513 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NotesApplet> );
514}