]> ruin.nu Git - adress.git/commitdiff
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 094e54f9156730600c168633283073fa350c3d55..f07283884ccbb285d906bbc5b305dd0c7a7f8fcc 100644 (file)
@@ -156,6 +156,34 @@ void MainWindow::slotModify(QListViewItem* lvi)
        if(modify.exec() == QDialog::Accepted)
                updateView();
 }
        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
  */
 /*
  * This funtion puts all contacts in the listview
  */
index 2a65fe34c3de56b89ecd49f7bedd48665ee136e4..ad0638d11d1d78f05fd33a6bb4a5043849b11aeb 100644 (file)
@@ -23,6 +23,7 @@ public slots:
     void slotLoad();
     void slotSearch();
                void slotModify(QListViewItem* lvi);
     void slotLoad();
     void slotSearch();
                void slotModify(QListViewItem* lvi);
+               void slotModify();
 protected:
                void updateView();
 
 protected:
                void updateView();