summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2002-09-22 13:22:51 (UTC)
committer llornkcor <llornkcor>2002-09-22 13:22:51 (UTC)
commit0816ba0c42df8074d698b60041993dbda5591e27 (patch) (unidiff)
treec8688bedc4bf5a87e967b0ede8218997dbdd4071 /noncore
parent2778d4b110b6b9106da568eb10568af18e482900 (diff)
downloadopie-0816ba0c42df8074d698b60041993dbda5591e27.zip
opie-0816ba0c42df8074d698b60041993dbda5591e27.tar.gz
opie-0816ba0c42df8074d698b60041993dbda5591e27.tar.bz2
delete button so I dont have to explain so much about the hold-menu delete
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp32
1 files changed, 22 insertions, 10 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 )
87 QVBoxLayout *vbox = new QVBoxLayout( this,0, -1, "Vlayout" ); 87 QVBoxLayout *vbox = new QVBoxLayout( this,0, -1, "Vlayout" );
88 QHBoxLayout *hbox = new QHBoxLayout( this ); 88 QHBoxLayout *hbox = new QHBoxLayout( this, 0, -1, "HLayout" );
89 89
@@ -110,2 +110,7 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
110 hbox->addWidget( newButton); 110 hbox->addWidget( newButton);
111
112 deleteButton= new QPushButton( this, "deleteButton" );
113 deleteButton->setText(tr("Delete"));
114 hbox->addWidget( deleteButton);
115
111 vbox->addItem(hbox); 116 vbox->addItem(hbox);
@@ -119,2 +124,3 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
119 connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton())); 124 connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton()));
125 connect(deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButton()));
120 populateBox(); 126 populateBox();
@@ -126,4 +132,7 @@ NotesControl::NotesControl( QWidget *parent, const char *name )
126void NotesControl::slotDeleteButton() { 132void NotesControl::slotDeleteButton() {
133
127 QString selectedText = box->currentText(); 134 QString selectedText = box->currentText();
128 qDebug("deleting "+selectedText); 135 qDebug("deleting "+selectedText);
136
137 if( !selectedText.isEmpty()) {
129 Config cfg("Notes"); 138 Config cfg("Notes");
@@ -153,2 +162,3 @@ void NotesControl::slotDeleteButton() {
153 populateBox(); 162 populateBox();
163 }
154} 164}
@@ -249,9 +259,10 @@ void NotesControl::save() {
249 edited=false; 259 edited=false;
260 qDebug("save");
261 if (doPopulate)
262 populateBox();
250 } 263 }
251 qDebug("save");
252 if (doPopulate)
253 populateBox();
254 }
255 cfg.writeEntry( "LastDoc",oldDocName ); 264 cfg.writeEntry( "LastDoc",oldDocName );
256 cfg.write(); 265 cfg.write();
266
267 }
257} 268}
@@ -277,5 +288,5 @@ void NotesControl::load() {
277 288
278 Config cfg("Notes");
279 cfg.setGroup("Docs");
280 if(!loaded) { 289 if(!loaded) {
290 Config cfg("Notes");
291 cfg.setGroup("Docs");
281 QString lastDoc=cfg.readEntry( "LastDoc",""); 292 QString lastDoc=cfg.readEntry( "LastDoc","");
@@ -288,5 +299,5 @@ void NotesControl::load() {
288 oldDocName=lastDoc; 299 oldDocName=lastDoc;
289 } 300 cfg.writeEntry( "LastDoc",oldDocName );
290 cfg.writeEntry( "LastDoc",oldDocName ); 301 cfg.write();
291 cfg.write(); 302 }
292} 303}
@@ -351,2 +362,3 @@ void NotesApplet::mousePressEvent( QMouseEvent *) {
351 vc->doPopulate=false; 362 vc->doPopulate=false;
363 vc->loaded=false;
352 364