mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
* Enabled the Filter Line edit for filtering friends, by nick/ID for Create Circles Dialog's Known Identities Widget.
* Set some minimum header sizes for some items * Enabled sorting for the QTreeWidget's git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6991 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3e13311be0
commit
b7bb1c25cb
@ -79,6 +79,14 @@ CirclesDialog::CirclesDialog(QWidget *parent)
|
||||
|
||||
/* Setup TokenQueue */
|
||||
mCircleQueue = new TokenQueue(rsGxsCircles->getTokenService(), this);
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * membership_header = ui.treeWidget_membership->header () ;
|
||||
membership_header->resizeSection ( CIRCLEGROUP_CIRCLE_COL_GROUPNAME, 200 );
|
||||
|
||||
QHeaderView * friends_header = ui.treeWidget_friends->header () ;
|
||||
friends_header->resizeSection ( CIRCLEGROUP_FRIEND_COL_NAME, 200 );
|
||||
|
||||
}
|
||||
|
||||
void CirclesDialog::todo()
|
||||
|
@ -117,6 +117,9 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget_membership">
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
@ -129,12 +132,12 @@
|
||||
</column>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Personal Circles</string>
|
||||
<string>Public Circles</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Public Circles</string>
|
||||
<string>Personal Circles</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
@ -153,6 +156,9 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget_friends">
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
@ -170,7 +176,7 @@
|
||||
</column>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Friends</string>
|
||||
<string>Others</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -186,7 +192,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Others</string>
|
||||
<string>Friends</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -238,6 +244,7 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -62,6 +62,15 @@ CreateCircleDialog::CreateCircleDialog()
|
||||
connect(ui.treeWidget_membership, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedMember(QTreeWidgetItem*, QTreeWidgetItem*)));
|
||||
connect(ui.treeWidget_IdList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedId(QTreeWidgetItem*, QTreeWidgetItem*)));
|
||||
|
||||
connect(ui.IdFilter, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
||||
|
||||
/* Add filter actions */
|
||||
QTreeWidgetItem *headerItem = ui.treeWidget_IdList->headerItem();
|
||||
QString headerText = headerItem->text(RSCIRCLEID_COL_NICKNAME);
|
||||
ui.IdFilter->addFilter(QIcon(), headerText, RSCIRCLEID_COL_NICKNAME, QString("%1 %2").arg(tr("Search"), headerText));
|
||||
headerText = headerItem->text(RSCIRCLEID_COL_KEYID);
|
||||
ui.IdFilter->addFilter(QIcon(), headerItem->text(RSCIRCLEID_COL_KEYID), RSCIRCLEID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText));
|
||||
|
||||
ui.removeButton->setEnabled(false);
|
||||
ui.addButton->setEnabled(false);
|
||||
ui.radioButton_ListKnownPGP->setChecked(true);
|
||||
@ -418,6 +427,8 @@ void CreateCircleDialog::getPgpIdentities()
|
||||
|
||||
tree->addTopLevelItem(item);
|
||||
}
|
||||
|
||||
filterIds();
|
||||
}
|
||||
|
||||
|
||||
@ -540,3 +551,16 @@ void CreateCircleDialog::loadRequest(const TokenQueue *queue, const TokenRequest
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CreateCircleDialog::filterChanged(const QString& /*text*/)
|
||||
{
|
||||
filterIds();
|
||||
}
|
||||
|
||||
void CreateCircleDialog::filterIds()
|
||||
{
|
||||
int filterColumn = ui.IdFilter->currentFilter();
|
||||
QString text = ui.IdFilter->text();
|
||||
|
||||
ui.treeWidget_IdList->filterItems(filterColumn, text);
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ private slots:
|
||||
void selectedMember(QTreeWidgetItem*, QTreeWidgetItem*);
|
||||
|
||||
void createCircle();
|
||||
void filterChanged(const QString &text);
|
||||
|
||||
private:
|
||||
void setupForPersonalCircle();
|
||||
@ -67,6 +68,8 @@ private:
|
||||
void requestGxsIdentities();
|
||||
void getPgpIdentities();
|
||||
|
||||
void filterIds();
|
||||
|
||||
TokenQueue *mCircleQueue;
|
||||
TokenQueue *mIdQueue;
|
||||
|
||||
|
@ -49,6 +49,9 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget_membership">
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
@ -81,15 +84,29 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="toolTip">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><< Add</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/back.png</normaloff>:/images/back.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="toolTip">
|
||||
<string>Remove </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>>> Remove </string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/forward.png</normaloff>:/images/forward.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -156,12 +173,15 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="IdFilter"/>
|
||||
<widget class="LineEditClear" name="IdFilter"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget_IdList">
|
||||
<widget class="RSTreeWidget" name="treeWidget_IdList">
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Nickname</string>
|
||||
@ -305,8 +325,6 @@
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>buttonBox</zorder>
|
||||
<zorder>groupBox_title</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -328,7 +346,19 @@
|
||||
<header>gui/common/HeaderFrame.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>LineEditClear</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>gui/common/LineEditClear.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RSTreeWidget</class>
|
||||
<extends>QTreeWidget</extends>
|
||||
<header>gui/common/RSTreeWidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
Reference in New Issue
Block a user