summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp45
-rw-r--r--noncore/applets/notesapplet/notes.h10
-rw-r--r--noncore/applets/notesapplet/notesappletimpl.cpp1
3 files changed, 28 insertions, 28 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
@@ -78,10 +78,10 @@ static char * notes_xpm[] = {
" ..=.. ",
" . "};
-NotesControl::NotesControl( QWidget *parent, const char *name )
- : QFrame( parent, name,/* WDestructiveClose | */WStyle_StaysOnTop )
+NotesControl::NotesControl( QWidget *, const char * )
+ : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop )
// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
{
QDir d( QDir::homeDirPath()+"/notes");
if( !d.exists()) {
@@ -90,47 +90,45 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed");
}
Config cfg("Notes");
cfg.setGroup("Options");
- showMax = cfg.readBoolEntry("ShowMax", false);
+ showMax = cfg.readBoolEntry("ShowMax", false);
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
loaded=false;
edited=false;
doPopulate=true;
isNew=false;
- QVBoxLayout *vbox = new QVBoxLayout( this,0, -1, "Vlayout" );
- QHBoxLayout *hbox = new QHBoxLayout( this, 0, -1, "HLayout" );
+ QVBox *vbox = new QVBox( this, "Vlayout" );
+ QHBox *hbox = new QHBox( this, "HLayout" );
- view = new QMultiLineEdit(this, "OpieNotesView");
+ view = new QMultiLineEdit(vbox, "OpieNotesView");
- box = new QListBox(this, "OpieNotesBox");
+ box = new QListBox(vbox, "OpieNotesBox");
QPEApplication::setStylusOperation( box->viewport(),QPEApplication::RightOnHold);
box->setFixedHeight(50);
vbox->setMargin( 6 );
vbox->setSpacing( 3 );
- vbox->addWidget( view);
- vbox->addWidget( box);
+
setFocusPolicy(QWidget::StrongFocus);
- newButton= new QPushButton( this, "newButton" );
+ newButton= new QPushButton( hbox, "newButton" );
newButton->setText(tr("New"));
- hbox->addWidget( newButton);
- saveButton= new QPushButton( this, "saveButton" );
+
+ saveButton= new QPushButton( hbox, "saveButton" );
saveButton->setText(tr("Save"));
- hbox->addWidget( saveButton);
- deleteButton= new QPushButton( this, "deleteButton" );
+
+ deleteButton= new QPushButton( hbox, "deleteButton" );
deleteButton->setText(tr("Delete"));
- hbox->addWidget( deleteButton);
-
- vbox->addItem(hbox);
+
+
connect( box, SIGNAL( mouseButtonPressed( int, QListBoxItem *, const QPoint&)),
this,SLOT( boxPressed(int, QListBoxItem *, const QPoint&)) );
@@ -146,9 +144,9 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
populateBox();
load();
setCaption("Notes");
- // parent->setFocus();
+ // parent->setFocus();
}
void NotesControl::slotSaveButton() {
slotNewButton();
@@ -158,9 +156,9 @@ void NotesControl::slotSaveButton() {
void NotesControl::slotDeleteButtonClicked() {
switch ( QMessageBox::warning(this,tr("Delete?")
,tr("Do you really want to<BR><B> delete</B> this note ?")
,tr("Yes"),tr("No"),0,1,1) ) {
- case 0:
+ case 0:
slotDeleteButton();
break;
};
}
@@ -198,13 +196,13 @@ void NotesControl::slotDeleteButton() {
qDebug(fi);
QFile f( fi);
if( !f.remove()) qDebug(".desktop file not removed");
-
+
}
}
view->clear();
-
+
populateBox();
}
}
@@ -334,10 +332,10 @@ void NotesControl::save() {
if (doPopulate)
populateBox();
}
cfg.writeEntry( "LastDoc",oldDocName );
- cfg.write();
-
+ cfg.write();
+
}
}
void NotesControl::populateBox() {
@@ -467,8 +465,9 @@ NotesApplet::NotesApplet( QWidget *parent, const char *name )
vc = new NotesControl;
}
NotesApplet::~NotesApplet() {
+ delete vc;
}
void NotesApplet::mousePressEvent( QMouseEvent *) {
if( !vc->isHidden()) {
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
@@ -15,9 +15,9 @@
#ifndef __NOTES_APPLET_H__
#define __NOTES_APPLET_H__
#include <qwidget.h>
-#include <qframe.h>
+#include <qvbox.h>
#include <qpixmap.h>
#include <qguardedptr.h>
#include <qtimer.h>
#include <qpe/filemanager.h>
@@ -30,9 +30,9 @@ class QSpinBox;
class QPushButton;
class QMultiLineEdit;
class QListBox;
class QListBoxItem;
-class NotesControl : public QFrame {
+class NotesControl : public QVBox {
Q_OBJECT
public:
NotesControl( QWidget *parent=0, const char *name=0 );
@@ -45,9 +45,9 @@ public:
bool showMax;
void save();
void populateBox();
void load();
-
+
private:
QTimer menuTimer;
DocLnk *doc;
QString oldDocName;
@@ -75,9 +75,9 @@ class NotesApplet : public QWidget {
Q_OBJECT
public:
NotesApplet( QWidget *parent = 0, const char *name=0 );
~NotesApplet();
- NotesControl *vc;
+ NotesControl *vc;
public slots:
private:
void mousePressEvent( QMouseEvent * );
void paintEvent( QPaintEvent* );
@@ -85,9 +85,9 @@ private:
private:
QPixmap notesPixmap;
private slots:
-
+
};
#endif // __NOTES_APPLET_H__
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
@@ -17,8 +17,9 @@ NotesAppletImpl::NotesAppletImpl()
: notes(0), ref(0) {
}
NotesAppletImpl::~NotesAppletImpl() {
+ // not needed though cause we should have a valid parent
delete notes;
}
QWidget *NotesAppletImpl::applet( QWidget *parent ) {