Just added a modify button and a slot (slotModify) that it is connected to.
authorMichael Andreen <harv@ruin.nu>
Sat, 2 Dec 2000 16:13:18 +0000 (16:13 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 2 Dec 2000 16:13:18 +0000 (16:13 +0000)
mainwindow.cpp
mainwindow.h

index 094e54f..f072838 100644 (file)
@@ -156,6 +156,34 @@ void MainWindow::slotModify(QListViewItem* lvi)
        if(modify.exec() == QDialog::Accepted)
                updateView();
 }
+
+void MainWindow::slotModify()
+{
+       QListViewItem* lvi = ContactView->selectedItem();
+
+       if (lvi == '\0')
+       {
+               return;
+       }
+       
+       int num = lvi->text(0).toInt();
+
+       if (num < 1 || num > CContact::getNum())
+               return;
+
+       CContact* contact = CContact::getFirst();
+       
+       for (int i = 1; i < num; i++, contact = contact->getNext())
+       {
+               if (contact->getNext() == '\0')
+               {
+                       return;
+               }
+       }
+       ContactModifier modify(contact);
+       if(modify.exec() == QDialog::Accepted)
+               updateView();
+}
 /*
  * This funtion puts all contacts in the listview
  */
index 2a65fe3..ad0638d 100644 (file)
@@ -23,6 +23,7 @@ public slots:
     void slotLoad();
     void slotSearch();
                void slotModify(QListViewItem* lvi);
+               void slotModify();
 protected:
                void updateView();