-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 29 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notes.h | 4 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notesappletimpl.cpp | 1 |
3 files changed, 17 insertions, 17 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 4e98b31..e2b0c2a 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp | |||
@@ -76,14 +76,14 @@ static char * notes_xpm[] = { | |||
76 | " ..=**=#&=&=.. ", | 76 | " ..=**=#&=&=.. ", |
77 | " ..=*=&=.. ", | 77 | " ..=*=&=.. ", |
78 | " ..=.. ", | 78 | " ..=.. ", |
79 | " . "}; | 79 | " . "}; |
80 | 80 | ||
81 | 81 | ||
82 | NotesControl::NotesControl( QWidget *parent, const char *name ) | 82 | NotesControl::NotesControl( QWidget *, const char * ) |
83 | : QFrame( parent, name,/* WDestructiveClose | */WStyle_StaysOnTop ) | 83 | : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) |
84 | // : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) | 84 | // : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) |
85 | { | 85 | { |
86 | QDir d( QDir::homeDirPath()+"/notes"); | 86 | QDir d( QDir::homeDirPath()+"/notes"); |
87 | if( !d.exists()) { | 87 | if( !d.exists()) { |
88 | qDebug("make dir"); | 88 | qDebug("make dir"); |
89 | if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) | 89 | if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) |
@@ -95,44 +95,42 @@ NotesControl::NotesControl( QWidget *parent, const char *name ) | |||
95 | 95 | ||
96 | setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); | 96 | setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); |
97 | loaded=false; | 97 | loaded=false; |
98 | edited=false; | 98 | edited=false; |
99 | doPopulate=true; | 99 | doPopulate=true; |
100 | isNew=false; | 100 | isNew=false; |
101 | QVBoxLayout *vbox = new QVBoxLayout( this,0, -1, "Vlayout" ); | 101 | QVBox *vbox = new QVBox( this, "Vlayout" ); |
102 | QHBoxLayout *hbox = new QHBoxLayout( this, 0, -1, "HLayout" ); | 102 | QHBox *hbox = new QHBox( this, "HLayout" ); |
103 | 103 | ||
104 | view = new QMultiLineEdit(this, "OpieNotesView"); | 104 | view = new QMultiLineEdit(vbox, "OpieNotesView"); |
105 | 105 | ||
106 | box = new QListBox(this, "OpieNotesBox"); | 106 | box = new QListBox(vbox, "OpieNotesBox"); |
107 | 107 | ||
108 | QPEApplication::setStylusOperation( box->viewport(),QPEApplication::RightOnHold); | 108 | QPEApplication::setStylusOperation( box->viewport(),QPEApplication::RightOnHold); |
109 | 109 | ||
110 | box->setFixedHeight(50); | 110 | box->setFixedHeight(50); |
111 | 111 | ||
112 | vbox->setMargin( 6 ); | 112 | vbox->setMargin( 6 ); |
113 | vbox->setSpacing( 3 ); | 113 | vbox->setSpacing( 3 ); |
114 | 114 | ||
115 | vbox->addWidget( view); | 115 | |
116 | vbox->addWidget( box); | ||
117 | 116 | ||
118 | setFocusPolicy(QWidget::StrongFocus); | 117 | setFocusPolicy(QWidget::StrongFocus); |
119 | 118 | ||
120 | newButton= new QPushButton( this, "newButton" ); | 119 | newButton= new QPushButton( hbox, "newButton" ); |
121 | newButton->setText(tr("New")); | 120 | newButton->setText(tr("New")); |
122 | hbox->addWidget( newButton); | ||
123 | 121 | ||
124 | saveButton= new QPushButton( this, "saveButton" ); | 122 | |
123 | saveButton= new QPushButton( hbox, "saveButton" ); | ||
125 | saveButton->setText(tr("Save")); | 124 | saveButton->setText(tr("Save")); |
126 | hbox->addWidget( saveButton); | ||
127 | 125 | ||
128 | deleteButton= new QPushButton( this, "deleteButton" ); | 126 | |
127 | deleteButton= new QPushButton( hbox, "deleteButton" ); | ||
129 | deleteButton->setText(tr("Delete")); | 128 | deleteButton->setText(tr("Delete")); |
130 | hbox->addWidget( deleteButton); | ||
131 | 129 | ||
132 | vbox->addItem(hbox); | 130 | |
133 | 131 | ||
134 | connect( box, SIGNAL( mouseButtonPressed( int, QListBoxItem *, const QPoint&)), | 132 | connect( box, SIGNAL( mouseButtonPressed( int, QListBoxItem *, const QPoint&)), |
135 | this,SLOT( boxPressed(int, QListBoxItem *, const QPoint&)) ); | 133 | this,SLOT( boxPressed(int, QListBoxItem *, const QPoint&)) ); |
136 | 134 | ||
137 | connect(box, SIGNAL(highlighted(const QString&)), this, SLOT(slotBoxSelected(const QString &))); | 135 | connect(box, SIGNAL(highlighted(const QString&)), this, SLOT(slotBoxSelected(const QString &))); |
138 | 136 | ||
@@ -465,12 +463,13 @@ NotesApplet::NotesApplet( QWidget *parent, const char *name ) | |||
465 | setFixedHeight( 18 ); | 463 | setFixedHeight( 18 ); |
466 | setFixedWidth( 14 ); | 464 | setFixedWidth( 14 ); |
467 | vc = new NotesControl; | 465 | vc = new NotesControl; |
468 | } | 466 | } |
469 | 467 | ||
470 | NotesApplet::~NotesApplet() { | 468 | NotesApplet::~NotesApplet() { |
469 | delete vc; | ||
471 | } | 470 | } |
472 | 471 | ||
473 | void NotesApplet::mousePressEvent( QMouseEvent *) { | 472 | void NotesApplet::mousePressEvent( QMouseEvent *) { |
474 | if( !vc->isHidden()) { | 473 | if( !vc->isHidden()) { |
475 | vc->doPopulate=false; | 474 | vc->doPopulate=false; |
476 | vc->save(); | 475 | vc->save(); |
diff --git a/noncore/applets/notesapplet/notes.h b/noncore/applets/notesapplet/notes.h index c428efe..08253cb 100644 --- a/noncore/applets/notesapplet/notes.h +++ b/noncore/applets/notesapplet/notes.h | |||
@@ -13,13 +13,13 @@ | |||
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 <qvbox.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> |
@@ -28,13 +28,13 @@ class QComboBox; | |||
28 | class QCheckBox; | 28 | class QCheckBox; |
29 | class QSpinBox; | 29 | class QSpinBox; |
30 | class QPushButton; | 30 | class QPushButton; |
31 | class QMultiLineEdit; | 31 | class QMultiLineEdit; |
32 | class QListBox; | 32 | class QListBox; |
33 | class QListBoxItem; | 33 | class QListBoxItem; |
34 | class NotesControl : public QFrame { | 34 | class NotesControl : public QVBox { |
35 | Q_OBJECT | 35 | Q_OBJECT |
36 | public: | 36 | public: |
37 | NotesControl( QWidget *parent=0, const char *name=0 ); | 37 | NotesControl( QWidget *parent=0, const char *name=0 ); |
38 | 38 | ||
39 | QPixmap notes; | 39 | QPixmap notes; |
40 | QMultiLineEdit *view; | 40 | QMultiLineEdit *view; |
diff --git a/noncore/applets/notesapplet/notesappletimpl.cpp b/noncore/applets/notesapplet/notesappletimpl.cpp index 93e1e97..0526bad 100644 --- a/noncore/applets/notesapplet/notesappletimpl.cpp +++ b/noncore/applets/notesapplet/notesappletimpl.cpp | |||
@@ -15,12 +15,13 @@ | |||
15 | 15 | ||
16 | NotesAppletImpl::NotesAppletImpl() | 16 | NotesAppletImpl::NotesAppletImpl() |
17 | : notes(0), ref(0) { | 17 | : notes(0), ref(0) { |
18 | } | 18 | } |
19 | 19 | ||
20 | NotesAppletImpl::~NotesAppletImpl() { | 20 | NotesAppletImpl::~NotesAppletImpl() { |
21 | // not needed though cause we should have a valid parent | ||
21 | delete notes; | 22 | delete notes; |
22 | } | 23 | } |
23 | 24 | ||
24 | QWidget *NotesAppletImpl::applet( QWidget *parent ) { | 25 | QWidget *NotesAppletImpl::applet( QWidget *parent ) { |
25 | if ( !notes ) | 26 | if ( !notes ) |
26 | notes = new NotesApplet( parent ); | 27 | notes = new NotesApplet( parent ); |