mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 14:12:43 -04:00
- Added some performance optimizations in FriendSelectionWidget::peerStatusChanged
- Fixed some ui design git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6442 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
771ae5ba58
commit
cac96b8317
7 changed files with 55 additions and 19 deletions
|
@ -36,13 +36,12 @@ CreateMsgLinkDialog::CreateMsgLinkDialog()
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
|
|
||||||
layout()->addWidget( _gpg_selection = new FriendSelectionWidget(this) ) ;
|
|
||||||
QObject::connect(_create_link_PB,SIGNAL(clicked()),this,SLOT(createLink())) ;
|
QObject::connect(_create_link_PB,SIGNAL(clicked()),this,SLOT(createLink())) ;
|
||||||
|
|
||||||
_gpg_selection->setModus(FriendSelectionWidget::MODUS_SINGLE) ;
|
friendSelectionWidget->setModus(FriendSelectionWidget::MODUS_SINGLE) ;
|
||||||
_gpg_selection->setShowType(FriendSelectionWidget::SHOW_NON_FRIEND_GPG | FriendSelectionWidget::SHOW_GPG) ;
|
friendSelectionWidget->setShowType(FriendSelectionWidget::SHOW_NON_FRIEND_GPG | FriendSelectionWidget::SHOW_GPG) ;
|
||||||
_gpg_selection->setHeaderText(QObject::tr("Select who can contact you:")) ;
|
friendSelectionWidget->setHeaderText(QObject::tr("Select who can contact you:")) ;
|
||||||
_gpg_selection->start() ;
|
friendSelectionWidget->start() ;
|
||||||
|
|
||||||
layout()->update() ;
|
layout()->update() ;
|
||||||
update() ;
|
update() ;
|
||||||
|
@ -83,7 +82,7 @@ void CreateMsgLinkDialog::createLink()
|
||||||
|
|
||||||
time_t validity_duration = computeValidityDuration() ;
|
time_t validity_duration = computeValidityDuration() ;
|
||||||
FriendSelectionWidget::IdType type ;
|
FriendSelectionWidget::IdType type ;
|
||||||
std::string current_pgp_id = _gpg_selection->selectedId(type) ;
|
std::string current_pgp_id = friendSelectionWidget->selectedId(type) ;
|
||||||
|
|
||||||
std::string encrypted_string ;
|
std::string encrypted_string ;
|
||||||
|
|
||||||
|
@ -132,4 +131,3 @@ void CreateMsgLinkDialog::createLink()
|
||||||
QMessageBox::information(NULL,tr("Messenging invite created"),tr("Your new messenging chat invite has been copied to clipboard. You can now paste it as a Retroshare link.")) ;
|
QMessageBox::information(NULL,tr("Messenging invite created"),tr("Your new messenging chat invite has been copied to clipboard. You can now paste it as a Retroshare link.")) ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,4 @@ class CreateMsgLinkDialog : public QDialog, public Ui::CreateMsgLinkDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
time_t computeValidityDuration() const ;
|
time_t computeValidityDuration() const ;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
|
||||||
FriendSelectionWidget *_gpg_selection ;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>590</width>
|
<width>590</width>
|
||||||
<height>179</height>
|
<height>427</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -118,8 +118,26 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="FriendSelectionWidget" name="friendSelectionWidget" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>FriendSelectionWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/common/FriendSelectionWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -533,6 +533,9 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
||||||
while ((item = *itemIterator) != NULL) {
|
while ((item = *itemIterator) != NULL) {
|
||||||
itemIterator++;
|
itemIterator++;
|
||||||
|
|
||||||
|
bool bFoundGPG = false;
|
||||||
|
bool bFoundSSL = false;
|
||||||
|
|
||||||
switch (idTypeFromItem(item)) {
|
switch (idTypeFromItem(item)) {
|
||||||
case IDTYPE_NONE:
|
case IDTYPE_NONE:
|
||||||
case IDTYPE_GROUP:
|
case IDTYPE_GROUP:
|
||||||
|
@ -549,6 +552,8 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
||||||
|
|
||||||
item->setTextColor(COLUMN_NAME, color);
|
item->setTextColor(COLUMN_NAME, color);
|
||||||
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(gpgStatus)));
|
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(gpgStatus)));
|
||||||
|
|
||||||
|
bFoundGPG = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -564,11 +569,31 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
||||||
|
|
||||||
item->setTextColor(COLUMN_NAME, color);
|
item->setTextColor(COLUMN_NAME, color);
|
||||||
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(status)));
|
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(status)));
|
||||||
|
|
||||||
|
bFoundSSL = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// friend can assigned to groups more than one
|
|
||||||
|
if (bFoundGPG) {
|
||||||
|
if (mShowTypes & SHOW_GROUP) {
|
||||||
|
// a friend can be assigned to more than one group
|
||||||
|
} else {
|
||||||
|
if (mShowTypes & SHOW_SSL) {
|
||||||
|
// search for ssl id
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bFoundSSL) {
|
||||||
|
if (mShowTypes & SHOW_GROUP) {
|
||||||
|
// a friend can be assigned to more than one group
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,6 @@ signals:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void fillList();
|
void fillList();
|
||||||
void secured_fillList();
|
|
||||||
void peerStatusChanged(const QString& peerId, int status);
|
void peerStatusChanged(const QString& peerId, int status);
|
||||||
void filterItems(const QString &text);
|
void filterItems(const QString &text);
|
||||||
void contextMenuRequested(const QPoint &pos);
|
void contextMenuRequested(const QPoint &pos);
|
||||||
|
@ -116,6 +115,7 @@ private slots:
|
||||||
void deselectAll() ;
|
void deselectAll() ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void secured_fillList();
|
||||||
bool filterItem(QTreeWidgetItem *item, const QString &text);
|
bool filterItem(QTreeWidgetItem *item, const QString &text);
|
||||||
|
|
||||||
void selectedIds(IdType idType, std::list<std::string> &ids, bool onlyDirectSelected);
|
void selectedIds(IdType idType, std::list<std::string> &ids, bool onlyDirectSelected);
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeWidget" name="friendList">
|
<widget class="QTreeWidget" name="friendList">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="general">
|
<widget class="QWidget" name="general">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue