summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-09-27 18:09:40 (UTC)
committer llornkcor <llornkcor>2002-09-27 18:09:40 (UTC)
commit4c1c6d7e8f8b9c207e88767808631b1780d099bf (patch) (unidiff)
treeb7616c5293ad422294ea106dc058bf91bfc36ea8
parent44c98b497ff1cb8cddba10b56435f136a583cce2 (diff)
downloadopie-4c1c6d7e8f8b9c207e88767808631b1780d099bf.zip
opie-4c1c6d7e8f8b9c207e88767808631b1780d099bf.tar.gz
opie-4c1c6d7e8f8b9c207e88767808631b1780d099bf.tar.bz2
remove old function
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp4
-rw-r--r--noncore/applets/notesapplet/notes.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 2d38e97..76cb6c1 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -347,110 +347,110 @@ void NotesControl::load() {
347 cfg.setGroup("Docs"); 347 cfg.setGroup("Docs");
348 QString lastDoc=cfg.readEntry( "LastDoc",""); 348 QString lastDoc=cfg.readEntry( "LastDoc","");
349 DocLnk nf; 349 DocLnk nf;
350 nf.setType("text/plain"); 350 nf.setType("text/plain");
351 nf.setFile(lastDoc); 351 nf.setFile(lastDoc);
352 352
353 loadDoc(nf); 353 loadDoc(nf);
354 loaded=true; 354 loaded=true;
355 oldDocName=lastDoc; 355 oldDocName=lastDoc;
356 cfg.writeEntry( "LastDoc",oldDocName ); 356 cfg.writeEntry( "LastDoc",oldDocName );
357 cfg.write(); 357 cfg.write();
358 } 358 }
359} 359}
360 360
361void NotesControl::load(const QString & file) { 361void NotesControl::load(const QString & file) {
362 qDebug("loading "+file); 362 qDebug("loading "+file);
363 if(!loaded) { 363 if(!loaded) {
364 DocLnk nf; 364 DocLnk nf;
365 nf.setType("text/plain"); 365 nf.setType("text/plain");
366 nf.setFile( file); 366 nf.setFile( file);
367 367
368 loadDoc(nf); 368 loadDoc(nf);
369 loaded=true; 369 loaded=true;
370 } 370 }
371// view->setFocus(); 371// view->setFocus();
372 oldDocName=file; 372 oldDocName=file;
373 Config cfg("Notes"); 373 Config cfg("Notes");
374 cfg.setGroup("Docs"); 374 cfg.setGroup("Docs");
375 cfg.writeEntry( "LastDoc",oldDocName ); 375 cfg.writeEntry( "LastDoc",oldDocName );
376 cfg.write(); 376 cfg.write();
377} 377}
378 378
379void NotesControl::loadDoc( const DocLnk &f) { 379void NotesControl::loadDoc( const DocLnk &f) {
380 FileManager fm; 380 FileManager fm;
381 QString txt; 381 QString txt;
382 if ( !fm.loadFile( f, txt ) ) { 382 if ( !fm.loadFile( f, txt ) ) {
383 return; 383 return;
384 } 384 }
385 view->setText(txt); 385 view->setText(txt);
386} 386}
387 387
388void NotesControl::slotViewEdited() { 388void NotesControl::slotViewEdited() {
389 if(loaded) { 389 if(loaded) {
390 edited=true; 390 edited=true;
391 } 391 }
392} 392}
393 393
394// void NotesControl::keyReleaseEvent( QKeyEvent *e) { 394// void NotesControl::keyReleaseEvent( QKeyEvent *e) {
395 395
396// switch ( e->state() ) { 396// switch ( e->state() ) {
397// case ControlButton: 397// case ControlButton:
398// if(e->key() == Key_C) { //copy 398// if(e->key() == Key_C) { //copy
399// qDebug("copy"); 399// qDebug("copy");
400// QClipboard *cb = QApplication::clipboard(); 400// QClipboard *cb = QApplication::clipboard();
401// QString text; 401// QString text;
402 402
403// // Copy text from the clipboard (paste) 403// // Copy text from the clipboard (paste)
404// text = cb->text(); 404// text = cb->text();
405// } 405// }
406// if(e->key() == Key_X) { //cut 406// if(e->key() == Key_X) { //cut
407// } 407// }
408// if(e->key() == Key_V) { //paste 408// if(e->key() == Key_V) { //paste
409// QClipboard *cb = QApplication::clipboard(); 409// QClipboard *cb = QApplication::clipboard();
410// QString text; 410// QString text;
411// view 411// //view
412// cb->setText(); 412// cb->setText();
413// } 413// }
414// break; 414// break;
415// }; 415// };
416// QWidget::keyReleaseEvent(e); 416// QWidget::keyReleaseEvent(e);
417// } 417// }
418 418
419//=========================================================================== 419//===========================================================================
420 420
421NotesApplet::NotesApplet( QWidget *parent, const char *name ) 421NotesApplet::NotesApplet( QWidget *parent, const char *name )
422 : QWidget( parent, name ) { 422 : QWidget( parent, name ) {
423 setFixedHeight( 18 ); 423 setFixedHeight( 18 );
424 setFixedWidth( 14 ); 424 setFixedWidth( 14 );
425 vc = new NotesControl; 425 vc = new NotesControl;
426} 426}
427 427
428NotesApplet::~NotesApplet() { 428NotesApplet::~NotesApplet() {
429} 429}
430 430
431void NotesApplet::mousePressEvent( QMouseEvent *) { 431void NotesApplet::mousePressEvent( QMouseEvent *) {
432 if( !vc->isHidden()) { 432 if( !vc->isHidden()) {
433 vc->doPopulate=false; 433 vc->doPopulate=false;
434 vc->save(); 434 vc->save();
435 vc->close(); 435 vc->close();
436 } else { 436 } else {
437// vc = new NotesControl; 437// vc = new NotesControl;
438// QPoint curPos = mapToGlobal( rect().topLeft() ); 438// QPoint curPos = mapToGlobal( rect().topLeft() );
439 vc->show(); 439 vc->show();
440 vc->move( 5, 18); 440 vc->move( 2, 28);
441 vc->doPopulate=true; 441 vc->doPopulate=true;
442 vc->populateBox(); 442 vc->populateBox();
443 vc->doPopulate=false; 443 vc->doPopulate=false;
444 vc->loaded=false; 444 vc->loaded=false;
445 445
446 vc->load(); 446 vc->load();
447// this->setFocus(); 447// this->setFocus();
448 vc->view->setFocus(); 448 vc->view->setFocus();
449 } 449 }
450} 450}
451 451
452void NotesApplet::paintEvent( QPaintEvent* ) { 452void NotesApplet::paintEvent( QPaintEvent* ) {
453 QPainter p(this); 453 QPainter p(this);
454 p.drawPixmap( 0, 1, ( const char** ) notes_xpm ); 454 p.drawPixmap( 0, 1, ( const char** ) notes_xpm );
455} 455}
456 456
diff --git a/noncore/applets/notesapplet/notes.h b/noncore/applets/notesapplet/notes.h
index a593881..28877ce 100644
--- a/noncore/applets/notesapplet/notes.h
+++ b/noncore/applets/notesapplet/notes.h
@@ -1,91 +1,90 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com 2** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com
3** All rights reserved. 3** All rights reserved.
4** 4**
5** This file may be distributed and/or modified under the terms of the 5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software 6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the 7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file. 8** packaging of this file.
9** 9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12** 12**
13**********************************************************************/ 13**********************************************************************/
14 14
15#ifndef __NOTES_APPLET_H__ 15#ifndef __NOTES_APPLET_H__
16#define __NOTES_APPLET_H__ 16#define __NOTES_APPLET_H__
17 17
18#include <qwidget.h> 18#include <qwidget.h>
19#include <qframe.h> 19#include <qframe.h>
20#include <qpixmap.h> 20#include <qpixmap.h>
21#include <qguardedptr.h> 21#include <qguardedptr.h>
22#include <qtimer.h> 22#include <qtimer.h>
23#include <qpe/filemanager.h> 23#include <qpe/filemanager.h>
24#include <qpe/ir.h> 24#include <qpe/ir.h>
25#include <qstring.h> 25#include <qstring.h>
26 26
27class QComboBox; 27class QComboBox;
28class QCheckBox; 28class QCheckBox;
29class QSpinBox; 29class QSpinBox;
30class QPushButton; 30class QPushButton;
31class QMultiLineEdit; 31class QMultiLineEdit;
32class QListBox; 32class QListBox;
33class QListBoxItem; 33class QListBoxItem;
34class NotesControl : public QFrame { 34class NotesControl : public QFrame {
35 Q_OBJECT 35 Q_OBJECT
36public: 36public:
37 NotesControl( QWidget *parent=0, const char *name=0 ); 37 NotesControl( QWidget *parent=0, const char *name=0 );
38 void performGrab();
39 38
40 QPixmap notes; 39 QPixmap notes;
41 QMultiLineEdit *view; 40 QMultiLineEdit *view;
42 QListBox *box; 41 QListBox *box;
43 QPushButton *saveButton, *deleteButton, *newButton; 42 QPushButton *saveButton, *deleteButton, *newButton;
44 QString FileNamePath; 43 QString FileNamePath;
45 bool loaded, edited, doPopulate; 44 bool loaded, edited, doPopulate;
46 void save(); 45 void save();
47 void populateBox(); 46 void populateBox();
48 void load(); 47 void load();
49 48
50private: 49private:
51 QTimer menuTimer; 50 QTimer menuTimer;
52 DocLnk *doc; 51 DocLnk *doc;
53 QString oldDocName; 52 QString oldDocName;
54 void focusOutEvent( QFocusEvent * ); 53 void focusOutEvent( QFocusEvent * );
55 void load(const QString&); 54 void load(const QString&);
56private slots: 55private slots:
57 void slotBeamButton(); 56 void slotBeamButton();
58 void slotBeamFinished( Ir*); 57 void slotBeamFinished( Ir*);
59 void slotDeleteButton(); 58 void slotDeleteButton();
60 void slotSaveButton(); 59 void slotSaveButton();
61 void slotDeleteButtonClicked(); 60 void slotDeleteButtonClicked();
62 void slotNewButton(); 61 void slotNewButton();
63 void boxPressed(int, QListBoxItem *, const QPoint&); 62 void boxPressed(int, QListBoxItem *, const QPoint&);
64 void showMenu(); 63 void showMenu();
65 void loadDoc( const DocLnk &); 64 void loadDoc( const DocLnk &);
66 void slotViewEdited(); 65 void slotViewEdited();
67 void slotBoxSelected(const QString &); 66 void slotBoxSelected(const QString &);
68// void keyReleaseEvent( QKeyEvent *); 67// void keyReleaseEvent( QKeyEvent *);
69 68
70}; 69};
71 70
72class NotesApplet : public QWidget { 71class NotesApplet : public QWidget {
73 Q_OBJECT 72 Q_OBJECT
74public: 73public:
75 NotesApplet( QWidget *parent = 0, const char *name=0 ); 74 NotesApplet( QWidget *parent = 0, const char *name=0 );
76 ~NotesApplet(); 75 ~NotesApplet();
77 NotesControl *vc; 76 NotesControl *vc;
78public slots: 77public slots:
79private: 78private:
80 void mousePressEvent( QMouseEvent * ); 79 void mousePressEvent( QMouseEvent * );
81 void paintEvent( QPaintEvent* ); 80 void paintEvent( QPaintEvent* );
82 81
83private: 82private:
84 QPixmap notesPixmap; 83 QPixmap notesPixmap;
85private slots: 84private slots:
86 85
87 86
88}; 87};
89 88
90#endif // __NOTES_APPLET_H__ 89#endif // __NOTES_APPLET_H__
91 90