mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
little bit worked on rsStatus, and added a tooltip for status message lineedit
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2412 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e4a508ab5b
commit
e7a78af546
3 changed files with 58 additions and 7 deletions
|
@ -112,6 +112,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
|
|||
connect( ui.actionHide_Offline_Friends, SIGNAL(triggered()), this, SLOT(insertPeers()));
|
||||
|
||||
connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage()));
|
||||
connect(ui.statuscomboBox, SIGNAL(clicked()), this, SLOT(savestatus()));
|
||||
|
||||
/* to hide the header */
|
||||
ui.messengertreeWidget->header()->hide();
|
||||
|
@ -146,6 +147,8 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
|
|||
updateAvatar();
|
||||
loadmystatusmessage();
|
||||
|
||||
loadstatus();
|
||||
|
||||
displayMenu();
|
||||
updateMessengerDisplay();
|
||||
|
||||
|
@ -928,20 +931,22 @@ void MessengerWindow::displayMenu()
|
|||
void MessengerWindow::loadstatus()
|
||||
{
|
||||
/* load up configuration from rsPeers */
|
||||
/*RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(rsPeers->getOwnId(), detail))
|
||||
RsPeerDetails detail;
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
|
||||
if (!rsPeers->getPeerDetails(ownId, detail))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
StatusInfo si;
|
||||
if (!rsStatus->getStatus(detail.id, si))
|
||||
if (!rsStatus->getStatus(ownId, si))
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* set status mode */
|
||||
/*int statusIndex = 0;
|
||||
int statusIndex = 0;
|
||||
switch(si.status)
|
||||
{
|
||||
case RS_STATUS_OFFLINE:
|
||||
|
@ -958,5 +963,47 @@ void MessengerWindow::loadstatus()
|
|||
statusIndex = 0;
|
||||
break;
|
||||
}
|
||||
ui.statuscomboBox->setCurrentIndex(statusIndex);*/
|
||||
|
||||
ui.statuscomboBox->setCurrentIndex(statusIndex);
|
||||
}
|
||||
|
||||
/** Save own status Online,Away,Busy **/
|
||||
void MessengerWindow::savestatus()
|
||||
{
|
||||
RsPeerDetails detail;
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
|
||||
if (!rsPeers->getPeerDetails(ownId, detail))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
StatusInfo si;
|
||||
|
||||
int statusIndex = ui.statuscomboBox->currentIndex();
|
||||
|
||||
/* Check if status has changed */
|
||||
int status = 0;
|
||||
switch(statusIndex)
|
||||
{
|
||||
case 3:
|
||||
status = RS_STATUS_OFFLINE;
|
||||
break;
|
||||
case 2:
|
||||
status = RS_STATUS_AWAY;
|
||||
break;
|
||||
case 1:
|
||||
status = RS_STATUS_BUSY;
|
||||
break;
|
||||
default:
|
||||
case 0:
|
||||
status = RS_STATUS_ONLINE;
|
||||
break;
|
||||
}
|
||||
|
||||
si.id = ownId;
|
||||
si.status = status;
|
||||
|
||||
rsStatus->setStatus(si);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue