Commit 31dfa184 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

finish porting group editing

svn path=/branches/work/kgpg2/; revision=753093
parent f7d3da31
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "kgpgitemmodel.h" #include "kgpgitemmodel.h"
#include <QHeaderView> #include <QHeaderView>
#include <KDebug>
groupEdit::groupEdit(QWidget *parent, QList<KGpgNode *> *ids) groupEdit::groupEdit(QWidget *parent, QList<KGpgNode *> *ids)
: QWidget( parent ), members(ids) : QWidget( parent ), members(ids)
...@@ -51,22 +50,34 @@ groupEdit::setModel(KGpgItemModel *md) ...@@ -51,22 +50,34 @@ groupEdit::setModel(KGpgItemModel *md)
void void
groupEdit::groupAdd() groupEdit::groupAdd()
{ {
#warning FIXME QModelIndexList sel = availableKeys->selectionModel()->selectedIndexes();
/* QList<Q3ListViewItem*> addList = gEdit->availableKeys->selectedItems(); for (int i = 0; i < sel.count(); i++) {
for (int i = 0; i < addList.count(); ++i) if (sel.at(i).column() != 0)
if (addList.at(i)) continue;
gEdit->groupKeys->insertItem(addList.at(i));*/ KGpgNode *nd = m_out->nodeForIndex(sel.at(i));
members->append(nd);
}
m_in->invalidate();
m_out->invalidate();
} }
void void
groupEdit::groupRemove() groupEdit::groupRemove()
{ {
Q_ASSERT(!members->isEmpty()); Q_ASSERT(!members->isEmpty());
#warning FIXME QModelIndexList sel = groupKeys->selectionModel()->selectedIndexes();
/* QList<Q3ListViewItem*> remList = gEdit->groupKeys->selectedItems(); for (int i = 0; i < sel.count(); i++) {
for (int i = 0; i < remList.count(); ++i) if (sel.at(i).column() != 0)
if (remList.at(i)) continue;
gEdit->availableKeys->insertItem(remList.at(i));*/ KGpgNode *nd = m_in->nodeForIndex(sel.at(i));
for (int j = 0; j < members->count(); j++)
if (members->at(j)->getId() == nd->getId()) {
members->removeAt(j);
break;
}
}
m_in->invalidate();
m_out->invalidate();
} }
void void
......
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<column> <column>
<property name="text" > <property name="text" >
<string>Name</string> <string>Name</string>
...@@ -124,6 +130,12 @@ ...@@ -124,6 +130,12 @@
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<column> <column>
<property name="text" > <property name="text" >
<string>Name</string> <string>Name</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment