mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Merged branch for GUI improvements into trunk. The improvement phase is not finsihed yet. The work on GUI will continue into trunk
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6138 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c23cfd4a0f
commit
50db473329
46 changed files with 2536 additions and 2984 deletions
48
retroshare-gui/src/gui/common/FriendSelectionDialog.cpp
Normal file
48
retroshare-gui/src/gui/common/FriendSelectionDialog.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include <list>
|
||||
|
||||
#include <QLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include "FriendSelectionDialog.h"
|
||||
|
||||
std::list<std::string> FriendSelectionDialog::selectFriends()
|
||||
{
|
||||
FriendSelectionDialog dialog ;
|
||||
dialog.friends_widget->start() ;
|
||||
dialog.setWindowTitle(tr("Choose some friends")) ;
|
||||
|
||||
if(QDialog::Rejected == dialog.exec())
|
||||
return std::list<std::string>() ;
|
||||
|
||||
std::list<std::string> ids ;
|
||||
dialog.friends_widget->selectedSslIds(ids,false) ;
|
||||
|
||||
return ids ;
|
||||
}
|
||||
|
||||
FriendSelectionDialog::FriendSelectionDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
friends_widget = new FriendSelectionWidget(this) ;
|
||||
|
||||
friends_widget->setHeaderText(tr("Contacts:"));
|
||||
friends_widget->setModus(FriendSelectionWidget::MODUS_CHECK);
|
||||
friends_widget->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_SSL);
|
||||
|
||||
QLayout *l = new QVBoxLayout ;
|
||||
setLayout(l) ;
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
l->addWidget(friends_widget) ;
|
||||
l->addWidget(buttonBox) ;
|
||||
l->update() ;
|
||||
}
|
||||
|
||||
FriendSelectionDialog::~FriendSelectionDialog()
|
||||
{
|
||||
delete friends_widget ;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue