summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-10-27 18:45:36 (UTC)
committer mickeyl <mickeyl>2003-10-27 18:45:36 (UTC)
commitdf9d9d818c9667ba8e614e5c09f0e121e9225dfd (patch) (side-by-side diff)
treefff36af7df853c64c68c839f5fdd9d065ff14e86
parent96a577bb03db6ccbf1a10b03116d3b868233df0e (diff)
downloadopie-df9d9d818c9667ba8e614e5c09f0e121e9225dfd.zip
opie-df9d9d818c9667ba8e614e5c09f0e121e9225dfd.tar.gz
opie-df9d9d818c9667ba8e614e5c09f0e121e9225dfd.tar.bz2
merge noncore/applets/*
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
@@ -79,8 +79,8 @@ 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");
@@ -91,19 +91,19 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
}
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);
@@ -112,24 +112,22 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
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&)) );
@@ -147,7 +145,7 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
populateBox();
load();
setCaption("Notes");
- // parent->setFocus();
+ // parent->setFocus();
}
void NotesControl::slotSaveButton() {
@@ -159,7 +157,7 @@ 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;
};
@@ -199,11 +197,11 @@ void NotesControl::slotDeleteButton() {
QFile f( fi);
if( !f.remove()) qDebug(".desktop file not removed");
-
+
}
}
view->clear();
-
+
populateBox();
}
}
@@ -335,8 +333,8 @@ void NotesControl::save() {
populateBox();
}
cfg.writeEntry( "LastDoc",oldDocName );
- cfg.write();
-
+ cfg.write();
+
}
}
@@ -468,6 +466,7 @@ NotesApplet::NotesApplet( QWidget *parent, const char *name )
}
NotesApplet::~NotesApplet() {
+ delete vc;
}
void NotesApplet::mousePressEvent( QMouseEvent *) {
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
@@ -16,7 +16,7 @@
#define __NOTES_APPLET_H__
#include <qwidget.h>
-#include <qframe.h>
+#include <qvbox.h>
#include <qpixmap.h>
#include <qguardedptr.h>
#include <qtimer.h>
@@ -31,7 +31,7 @@ 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 );
@@ -46,7 +46,7 @@ public:
void save();
void populateBox();
void load();
-
+
private:
QTimer menuTimer;
DocLnk *doc;
@@ -76,7 +76,7 @@ class NotesApplet : public QWidget {
public:
NotesApplet( QWidget *parent = 0, const char *name=0 );
~NotesApplet();
- NotesControl *vc;
+ NotesControl *vc;
public slots:
private:
void mousePressEvent( QMouseEvent * );
@@ -86,7 +86,7 @@ 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
@@ -18,6 +18,7 @@ NotesAppletImpl::NotesAppletImpl()
}
NotesAppletImpl::~NotesAppletImpl() {
+ // not needed though cause we should have a valid parent
delete notes;
}