summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-09-24 01:53:27 (UTC)
committer llornkcor <llornkcor>2002-09-24 01:53:27 (UTC)
commitef40f0d781c904723d7842fc8be8f7dbad0614da (patch) (unidiff)
tree3c90068d73e19cf1fea43de570d7cd08c7ef6c33
parenta2c7b045c9a3ff9e275858b66e7fe29bdf4d8e31 (diff)
downloadopie-ef40f0d781c904723d7842fc8be8f7dbad0614da.zip
opie-ef40f0d781c904723d7842fc8be8f7dbad0614da.tar.gz
opie-ef40f0d781c904723d7842fc8be8f7dbad0614da.tar.bz2
added delete confirm to button
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp13
-rw-r--r--noncore/applets/notesapplet/notes.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index cc5245c..81864c6 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -122,19 +122,30 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
122 122
123 connect(view,SIGNAL( textChanged() ), this, SLOT(slotViewEdited() ) ); 123 connect(view,SIGNAL( textChanged() ), this, SLOT(slotViewEdited() ) );
124 connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton())); 124 connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton()));
125 connect(deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButton())); 125 connect(deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButtonClicked()));
126
126 populateBox(); 127 populateBox();
127 load(); 128 load();
128 setCaption("Notes"); 129 setCaption("Notes");
129 // parent->setFocus(); 130 // parent->setFocus();
130} 131}
131 132
133void NotesControl::slotDeleteButtonClicked() {
134 switch ( QMessageBox::warning(this,tr("Delete?"),tr("Do you really want to<BR><B> delete</B> this note ?")
135 ,tr("Yes"),tr("No"),0,1,1) ) {
136 case 0:
137 slotDeleteButton();
138 break;
139 };
140}
141
132void NotesControl::slotDeleteButton() { 142void NotesControl::slotDeleteButton() {
133 143
134 QString selectedText = box->currentText(); 144 QString selectedText = box->currentText();
135 qDebug("deleting "+selectedText); 145 qDebug("deleting "+selectedText);
136 146
137 if( !selectedText.isEmpty()) { 147 if( !selectedText.isEmpty()) {
148
138 Config cfg("Notes"); 149 Config cfg("Notes");
139 cfg.setGroup("Docs"); 150 cfg.setGroup("Docs");
140 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 151 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
diff --git a/noncore/applets/notesapplet/notes.h b/noncore/applets/notesapplet/notes.h
index c589f81..473a89a 100644
--- a/noncore/applets/notesapplet/notes.h
+++ b/noncore/applets/notesapplet/notes.h
@@ -54,6 +54,7 @@ private:
54 void load(const QString&); 54 void load(const QString&);
55private slots: 55private slots:
56 void slotDeleteButton(); 56 void slotDeleteButton();
57 void slotDeleteButtonClicked();
57 void slotNewButton(); 58 void slotNewButton();
58 void boxPressed(int, QListBoxItem *, const QPoint&); 59 void boxPressed(int, QListBoxItem *, const QPoint&);
59 void showMenu(); 60 void showMenu();