mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 17:45:15 -04:00
improved display in share manager. Updated RemoteDirModel to show groups.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-FileSharingPermissions@5706 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
56e26ba00a
commit
03d4936b12
8 changed files with 95 additions and 33 deletions
|
@ -17,11 +17,28 @@
|
|||
#define INDEX_GROUP_UNCHECKED 4
|
||||
#define INDEX_OTHER_UNCHECKED 5
|
||||
|
||||
QString GroupFlagsWidget::_tooltips_on[4] = {
|
||||
QObject::tr("Directory is browsable for friends from parent groups"),
|
||||
QObject::tr("Directory is accessible by anonymous tunnels from friends from parent groups"),
|
||||
QObject::tr("Directory is browsable for any friend"),
|
||||
QObject::tr("Directory is accessible by anonymous tunnels from any friend")
|
||||
};
|
||||
QString GroupFlagsWidget::_tooltips_off[4] = {
|
||||
QObject::tr(""),
|
||||
QObject::tr(""),
|
||||
QObject::tr(""),
|
||||
QObject::tr("")
|
||||
};
|
||||
|
||||
GroupFlagsWidget::GroupFlagsWidget(QWidget *parent,uint32_t flags)
|
||||
: QWidget(parent)
|
||||
{
|
||||
_layout = new QHBoxLayout(this) ;
|
||||
|
||||
setMinimumSize(128,32) ;
|
||||
setMaximumSize(128,32) ;
|
||||
setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
|
||||
_icons[INDEX_GROUP_BROWSABLE] = new QIcon(FLAGS_GROUP_BROWSABLE_ICON) ;
|
||||
_icons[INDEX_GROUP_NETWORK_W] = new QIcon(FLAGS_GROUP_NETWORK_WIDE_ICON) ;
|
||||
_icons[INDEX_OTHER_BROWSABLE] = new QIcon(FLAGS_OTHER_BROWSABLE_ICON) ;
|
||||
|
@ -41,8 +58,7 @@ GroupFlagsWidget::GroupFlagsWidget(QWidget *parent,uint32_t flags)
|
|||
_buttons[i] = new QPushButton(this) ;
|
||||
_buttons[i]->setCheckable(true) ;
|
||||
_buttons[i]->setChecked(flags & _flags[i]) ;
|
||||
//_buttons[i]->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
//_buttons[i]->setMinimumSize(32,32);
|
||||
_buttons[i]->setIconSize(QSize(32,32));
|
||||
update_button_state(_buttons[i]->isChecked(),i) ;
|
||||
_layout->addWidget(_buttons[i]) ;
|
||||
}
|
||||
|
@ -76,11 +92,20 @@ uint32_t GroupFlagsWidget::flags() const
|
|||
void GroupFlagsWidget::update_button_state(bool b,int button_id)
|
||||
{
|
||||
if(b)
|
||||
{
|
||||
_buttons[button_id]->setIcon(*_icons[button_id]) ;
|
||||
_buttons[button_id]->setToolTip(_tooltips_on[button_id]) ;
|
||||
}
|
||||
else if(button_id == INDEX_GROUP_NETWORK_W || button_id == INDEX_GROUP_BROWSABLE)
|
||||
{
|
||||
_buttons[button_id]->setIcon(*_icons[INDEX_GROUP_UNCHECKED]) ;
|
||||
_buttons[button_id]->setToolTip(_tooltips_off[button_id]) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
_buttons[button_id]->setIcon(*_icons[INDEX_OTHER_UNCHECKED]) ;
|
||||
_buttons[button_id]->setToolTip(_tooltips_off[button_id]) ;
|
||||
}
|
||||
}
|
||||
|
||||
void GroupFlagsWidget::update_GN_button(bool b) { update_button_state(b,INDEX_GROUP_NETWORK_W) ; updated() ; }
|
||||
|
|
|
@ -34,4 +34,7 @@ class GroupFlagsWidget: public QWidget
|
|||
QLayout *_layout ;
|
||||
QIcon *_icons[6] ;
|
||||
uint32_t _flags[4] ;
|
||||
|
||||
static QString _tooltips_on[4] ;
|
||||
static QString _tooltips_off[4] ;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue