mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added a menu for the Hide Unconnected Button and renamed it
Added new action for Hide Status Column to the Display Menu Moved Hide Offline Friends action to the Display Menu git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3159 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ec6c252d62
commit
09ac44316a
@ -141,7 +141,8 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
||||||
connect( ui.msgText, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
connect( ui.msgText, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
|
||||||
|
|
||||||
connect(ui.hide_unconnected, SIGNAL(clicked()), this, SLOT(insertPeers()));
|
connect(ui.action_Hide_Offline_Friends, SIGNAL(triggered()), this, SLOT(insertPeers()));
|
||||||
|
connect(ui.action_Hide_Status_Column, SIGNAL(triggered()), this, SLOT(statusColumn()));
|
||||||
|
|
||||||
ui.peertabWidget->setTabPosition(QTabWidget::North);
|
ui.peertabWidget->setTabPosition(QTabWidget::North);
|
||||||
ui.peertabWidget->addTab(new ProfileWidget(),QString(tr("Profile")));
|
ui.peertabWidget->addTab(new ProfileWidget(),QString(tr("Profile")));
|
||||||
@ -233,6 +234,7 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
updateAvatar();
|
updateAvatar();
|
||||||
loadmypersonalstatus();
|
loadmypersonalstatus();
|
||||||
loadEmoticonsgroupchat();
|
loadEmoticonsgroupchat();
|
||||||
|
displayMenu();
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
@ -269,7 +271,10 @@ void PeersDialog::processSettings(bool bLoad)
|
|||||||
header->restoreState(Settings->value("PeerTree").toByteArray());
|
header->restoreState(Settings->value("PeerTree").toByteArray());
|
||||||
|
|
||||||
// state of hideUnconnected
|
// state of hideUnconnected
|
||||||
ui.hide_unconnected->setChecked(Settings->value("hideUnconnected", false).toBool());
|
ui.action_Hide_Offline_Friends->setChecked(Settings->value("hideUnconnected", false).toBool());
|
||||||
|
|
||||||
|
// state of hideStatusColumn
|
||||||
|
ui.action_Hide_Status_Column->setChecked(Settings->value("hideStatusColumn", false).toBool());
|
||||||
|
|
||||||
// state of splitter
|
// state of splitter
|
||||||
ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
|
ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
|
||||||
@ -280,7 +285,10 @@ void PeersDialog::processSettings(bool bLoad)
|
|||||||
Settings->setValue("PeerTree", header->saveState());
|
Settings->setValue("PeerTree", header->saveState());
|
||||||
|
|
||||||
// state of hideUnconnected
|
// state of hideUnconnected
|
||||||
Settings->setValue("hideUnconnected", ui.hide_unconnected->isChecked());
|
Settings->setValue("hideUnconnected", ui.action_Hide_Offline_Friends->isChecked());
|
||||||
|
|
||||||
|
// state of hideStatusColumn
|
||||||
|
Settings->setValue("hideStatusColumn", ui.action_Hide_Status_Column->isChecked());
|
||||||
|
|
||||||
// state of splitter
|
// state of splitter
|
||||||
Settings->setValue("Splitter", ui.splitter->saveState());
|
Settings->setValue("Splitter", ui.splitter->saveState());
|
||||||
@ -439,7 +447,7 @@ void PeersDialog::insertPeers()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bHideUnconnected = ui.hide_unconnected->isChecked();
|
bool bHideUnconnected = ui.action_Hide_Offline_Friends->isChecked();
|
||||||
|
|
||||||
rsPeers->getGPGAcceptedList(gpgFriends);
|
rsPeers->getGPGAcceptedList(gpgFriends);
|
||||||
|
|
||||||
@ -1803,3 +1811,31 @@ void PeersDialog::playsound(){
|
|||||||
if(QSound::isAvailable())
|
if(QSound::isAvailable())
|
||||||
QSound::play(OnlineSound);
|
QSound::play(OnlineSound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PeersDialog::displayMenu()
|
||||||
|
{
|
||||||
|
QMenu *displaymenu = new QMenu();
|
||||||
|
|
||||||
|
displaymenu->addAction(ui.action_Hide_Offline_Friends);
|
||||||
|
displaymenu->addAction(ui.action_Hide_Status_Column);
|
||||||
|
|
||||||
|
ui.displayButton->setMenu(displaymenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PeersDialog::statusColumn()
|
||||||
|
{
|
||||||
|
/* Set header resize modes and initial section sizes */
|
||||||
|
QHeaderView * peerheader = ui.peertreeWidget->header();
|
||||||
|
|
||||||
|
if(ui.action_Hide_Status_Column->isChecked())
|
||||||
|
{
|
||||||
|
ui.peertreeWidget->setColumnHidden ( 1, true);
|
||||||
|
peerheader->resizeSection ( 0, 200 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.peertreeWidget->setColumnHidden ( 1, false);
|
||||||
|
peerheader->resizeSection ( 0, 200 );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -151,6 +151,10 @@ private slots:
|
|||||||
|
|
||||||
void setCurrentFileName(const QString &fileName);
|
void setCurrentFileName(const QString &fileName);
|
||||||
|
|
||||||
|
void displayMenu();
|
||||||
|
void statusColumn();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void friendsUpdated() ;
|
void friendsUpdated() ;
|
||||||
void notifyGroupChat(const QString&,const QString&) ;
|
void notifyGroupChat(const QString&,const QString&) ;
|
||||||
|
@ -606,12 +606,26 @@ p, li { white-space: pre-wrap; }
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<widget class="QPushButton" name="hide_unconnected">
|
<widget class="QPushButton" name="displayButton">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>hide unconnected</string>
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Display</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"> QPushButton:hover {
|
<string notr="true">QPushButton::menu-indicator {
|
||||||
|
subcontrol-origin: padding;
|
||||||
|
subcontrol-position: bottom right;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
|
||||||
|
position: relative;
|
||||||
|
top: 2px; left: 2px; /* shift the arrow by 2 px */
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover {
|
||||||
border: 1px solid #CCCCCC;
|
border: 1px solid #CCCCCC;
|
||||||
}</string>
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
@ -620,7 +634,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="images.qrc">
|
<iconset resource="images.qrc">
|
||||||
<normaloff>:/images/user/identityoffline24.png</normaloff>:/images/user/identityoffline24.png</iconset>
|
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
@ -649,7 +663,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>250</width>
|
<width>150</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -1426,6 +1440,22 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>Save Chat History</string>
|
<string>Save Chat History</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="action_Hide_Offline_Friends">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide Offline Friends</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_Hide_Status_Column">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide Status Column</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="images.qrc"/>
|
<include location="images.qrc"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user