summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index a4aa093..cc5245c 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -87,3 +87,3 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
QVBoxLayout *vbox = new QVBoxLayout( this,0, -1, "Vlayout" );
- QHBoxLayout *hbox = new QHBoxLayout( this );
+ QHBoxLayout *hbox = new QHBoxLayout( this, 0, -1, "HLayout" );
@@ -110,2 +110,7 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
hbox->addWidget( newButton);
+
+ deleteButton= new QPushButton( this, "deleteButton" );
+ deleteButton->setText(tr("Delete"));
+ hbox->addWidget( deleteButton);
+
vbox->addItem(hbox);
@@ -119,2 +124,3 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton()));
+ connect(deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButton()));
populateBox();
@@ -126,4 +132,7 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
void NotesControl::slotDeleteButton() {
+
QString selectedText = box->currentText();
qDebug("deleting "+selectedText);
+
+ if( !selectedText.isEmpty()) {
Config cfg("Notes");
@@ -154,2 +163,3 @@ void NotesControl::slotDeleteButton() {
}
+}
@@ -249,3 +259,2 @@ void NotesControl::save() {
edited=false;
- }
qDebug("save");
@@ -256,2 +265,4 @@ void NotesControl::save() {
cfg.write();
+
+ }
}
@@ -277,5 +288,5 @@ void NotesControl::load() {
+ if(!loaded) {
Config cfg("Notes");
cfg.setGroup("Docs");
- if(!loaded) {
QString lastDoc=cfg.readEntry( "LastDoc","");
@@ -288,3 +299,2 @@ void NotesControl::load() {
oldDocName=lastDoc;
- }
cfg.writeEntry( "LastDoc",oldDocName );
@@ -292,2 +302,3 @@ void NotesControl::load() {
}
+}
@@ -351,2 +362,3 @@ void NotesApplet::mousePressEvent( QMouseEvent *) {
vc->doPopulate=false;
+ vc->loaded=false;