mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 17:28:41 -04:00
add location to account detail at startup, and improve the peersdialog
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2075 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5f27d75dc4
commit
ac580a6c07
10 changed files with 548 additions and 808 deletions
|
@ -181,22 +181,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
|
||||
LinksDialog *linksDialog = NULL;
|
||||
|
||||
|
||||
#ifdef RS_RELEASE_VERSION
|
||||
|
||||
ChannelFeed *channelFeed = NULL;
|
||||
ui.stackPages->add(channelFeed = new ChannelFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_CHANNELS), tr("Channels"), grp));
|
||||
|
||||
ForumsDialog *forumsDialog = NULL;
|
||||
ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
||||
|
||||
ui.stackPages->add(linksDialog = new LinksDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_LINKS), tr("Links Cloud"), grp));
|
||||
|
||||
#else
|
||||
|
||||
ChannelFeed *channelFeed = NULL;
|
||||
ui.stackPages->add(channelFeed = new ChannelFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_CHANNELS), tr("Channels"), grp));
|
||||
|
@ -208,7 +192,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
ui.stackPages->add(forumsDialog = new ForumsDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
||||
|
||||
#endif
|
||||
NewsFeed *newsFeed = NULL;
|
||||
ui.stackPages->add(newsFeed = new NewsFeed(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_NEWSFEED), tr("News Feed"), grp));
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include "common/vmessagebox.h"
|
||||
#include <gui/mainpagestack.h>
|
||||
|
||||
#include "rshare.h"
|
||||
#include "PeersDialog.h"
|
||||
|
@ -96,6 +97,7 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||
|
||||
last_status_send_time = 0 ;
|
||||
|
||||
|
||||
connect( ui.peertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( peertreeWidgetCostumPopupMenu( QPoint ) ) );
|
||||
connect( ui.peertreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(chatfriend()));
|
||||
|
||||
|
@ -104,6 +106,7 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||
connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar()));
|
||||
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
|
||||
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::West);
|
||||
ui.peertabWidget->addTab(new ProfileWidget(),QString(tr("Profile")));
|
||||
|
||||
ui.peertreeWidget->setColumnCount(4);
|
||||
|
@ -127,7 +130,6 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||
headerItem->setTextAlignment(1, Qt::AlignLeft | Qt::AlignVCenter);
|
||||
headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
|
||||
loadtabsettings();
|
||||
loadEmoticonsgroupchat();
|
||||
|
||||
connect(ui.lineEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) ));
|
||||
|
@ -175,9 +177,7 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||
timer->start(500); /* half a second */
|
||||
|
||||
QMenu *menu = new QMenu();
|
||||
menu->addAction(ui.actionAdd_Friend);
|
||||
menu->addSeparator();
|
||||
menu->addAction(ui.actionCreate_new_Profile);
|
||||
menu->addAction(ui.actionAdd_Friend);
|
||||
menu->addSeparator();
|
||||
menu->addAction(ui.actionCreate_New_Forum);
|
||||
menu->addAction(ui.actionCreate_New_Channel);
|
||||
|
@ -186,21 +186,6 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||
|
||||
ui.menupushButton->setMenu(menu);
|
||||
|
||||
QMenu *lookmenu = new QMenu();
|
||||
lookmenu->addAction(ui.actionSort_Status_Descending_Order);
|
||||
lookmenu->addAction(ui.actionSort_Status_Ascending_Order);
|
||||
lookmenu->addSeparator();
|
||||
lookmenu->addAction(ui.actionSet_Tabs_Right);
|
||||
lookmenu->addAction(ui.actionSet_Tabs_Left);
|
||||
lookmenu->addAction(ui.actionSet_Tabs_North);
|
||||
lookmenu->addAction(ui.actionSet_Tabs_South);
|
||||
lookmenu->addSeparator();
|
||||
lookmenu->addAction(ui.actionSet_Tabs_Triangular);
|
||||
lookmenu->addAction(ui.actionSet_Tabs_Rounded);
|
||||
|
||||
ui.lookpushButton->setMenu(lookmenu);
|
||||
|
||||
|
||||
updateAvatar();
|
||||
loadmypersonalstatus();
|
||||
|
||||
|
@ -1417,15 +1402,9 @@ void PeersDialog::on_actionAdd_Friend_activated()
|
|||
connectwiz->show();
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionCreate_new_Profile_activated()
|
||||
{
|
||||
static GenCertDialog *gencertdialog = new GenCertDialog();
|
||||
gencertdialog->show();
|
||||
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionCreate_New_Forum_activated()
|
||||
{
|
||||
((MainPageStack*)this->parent())->setCurrentIndex(8); // swtich to forum view
|
||||
static CreateForum *cf = new CreateForum(this);
|
||||
cf->show();
|
||||
|
||||
|
@ -1434,6 +1413,7 @@ void PeersDialog::on_actionCreate_New_Forum_activated()
|
|||
void PeersDialog::on_actionCreate_New_Channel_activated()
|
||||
{
|
||||
CreateForum *cf = new CreateForum(NULL, false);
|
||||
((MainPageStack*)this->parent())->setCurrentIndex(6); // swtich to forum view
|
||||
|
||||
cf->setWindowTitle(tr("Create a new Channel"));
|
||||
cf->ui.labelicon->setPixmap(QPixmap(":/images/add_channel64.png"));
|
||||
|
@ -1456,84 +1436,3 @@ void PeersDialog::statusmessage()
|
|||
static StatusMessage *statusmsgdialog = new StatusMessage();
|
||||
statusmsgdialog->show();
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionSet_Tabs_North_activated()
|
||||
{
|
||||
_settings->beginGroup("PeersDialog");
|
||||
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::North);
|
||||
|
||||
_settings->setValue("TabWidget_Position",ui.peertabWidget->tabPosition());
|
||||
_settings->endGroup();
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionSet_Tabs_South_activated()
|
||||
{
|
||||
_settings->beginGroup("PeersDialog");
|
||||
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::South);
|
||||
|
||||
_settings->setValue("TabWidget_Position",ui.peertabWidget->tabPosition());
|
||||
_settings->endGroup();
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionSet_Tabs_Left_activated()
|
||||
{
|
||||
_settings->beginGroup("PeersDialog");
|
||||
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::West);
|
||||
|
||||
_settings->setValue("TabWidget_Position",ui.peertabWidget->tabPosition());
|
||||
_settings->endGroup();
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionSet_Tabs_Right_activated()
|
||||
{
|
||||
_settings->beginGroup("PeersDialog");
|
||||
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::East);
|
||||
|
||||
_settings->setValue("TabWidget_Position",ui.peertabWidget->tabPosition());
|
||||
_settings->endGroup();
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionSet_Tabs_Triangular_activated()
|
||||
{
|
||||
ui.peertabWidget->setTabShape(QTabWidget::Triangular);
|
||||
}
|
||||
|
||||
void PeersDialog::on_actionSet_Tabs_Rounded_activated()
|
||||
{
|
||||
ui.peertabWidget->setTabShape(QTabWidget::Rounded);
|
||||
}
|
||||
|
||||
void PeersDialog::loadtabsettings()
|
||||
{
|
||||
_settings->beginGroup("PeersDialog");
|
||||
|
||||
if(_settings->value("TabWidget_Position","0").toInt() == 0)
|
||||
{
|
||||
qDebug() << "Tab North";
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::North);
|
||||
}
|
||||
|
||||
else if (_settings->value("TabWidget_Position","1").toInt() == 1)
|
||||
{
|
||||
qDebug() << "Tab South";
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::South);
|
||||
}
|
||||
|
||||
else if (_settings->value("TabWidget_Position","2").toInt() ==2)
|
||||
{
|
||||
qDebug() << "Tab West";
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::West);
|
||||
}
|
||||
|
||||
else if(_settings->value("TabWidget_Position","3").toInt() ==3)
|
||||
{
|
||||
qDebug() << "Tab East";
|
||||
ui.peertabWidget->setTabPosition(QTabWidget::East);
|
||||
}
|
||||
|
||||
_settings->endGroup();
|
||||
}
|
||||
|
|
|
@ -124,20 +124,10 @@ class PeersDialog : public RsAutoUpdatePage
|
|||
void getAvatar();
|
||||
|
||||
void on_actionAdd_Friend_activated();
|
||||
void on_actionCreate_new_Profile_activated();
|
||||
void on_actionCreate_New_Forum_activated();
|
||||
void on_actionCreate_New_Channel_activated();
|
||||
|
||||
void loadmypersonalstatus();
|
||||
void loadtabsettings();
|
||||
|
||||
void on_actionSet_Tabs_Right_activated();
|
||||
void on_actionSet_Tabs_North_activated();
|
||||
void on_actionSet_Tabs_South_activated();
|
||||
void on_actionSet_Tabs_Left_activated();
|
||||
|
||||
void on_actionSet_Tabs_Triangular_activated();
|
||||
void on_actionSet_Tabs_Rounded_activated();
|
||||
|
||||
signals:
|
||||
void friendsUpdated() ;
|
||||
|
|
|
@ -557,7 +557,7 @@ p, li { white-space: pre-wrap; }
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="menupushButton">
|
||||
<property name="toolTip">
|
||||
<string>Add</string>
|
||||
|
@ -598,33 +598,6 @@ p, li { white-space: pre-wrap; }
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="lookpushButton">
|
||||
<property name="toolTip">
|
||||
<string>Display</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: bottom right;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
border: 1px solid #CCCCCC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -1225,47 +1198,7 @@ background: white;}</string>
|
|||
<string>Set your Personal Message</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set your Personal Message</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_Tabs_Right">
|
||||
<property name="text">
|
||||
<string>Set Tabs Right</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_Tabs_Left">
|
||||
<property name="text">
|
||||
<string>Set Tabs Left</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_Tabs_North">
|
||||
<property name="text">
|
||||
<string>Set Tabs North</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_Tabs_South">
|
||||
<property name="text">
|
||||
<string>Set Tabs South</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_Tabs_Triangular">
|
||||
<property name="text">
|
||||
<string>Set Tabs Triangular</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSet_Tabs_Rounded">
|
||||
<property name="text">
|
||||
<string>Set Tabs Rounded</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSort_Status_Descending_Order">
|
||||
<property name="text">
|
||||
<string>Sort Status Descending Order</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSort_Status_Ascending_Order">
|
||||
<property name="text">
|
||||
<string>Sort Status Ascending Order</string>
|
||||
<string>Edit your status Message</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
|
|
@ -75,9 +75,9 @@ StartDialog::StartDialog(QWidget *parent, Qt::WFlags flags)
|
|||
for(it = accountIds.begin(), i = 0; it != accountIds.end(); it++, i++)
|
||||
{
|
||||
const QVariant & userData = QVariant(QString::fromStdString(*it));
|
||||
std::string gpgid, name, email, sslname;
|
||||
RsInit::getAccountDetails(*it, gpgid, name, email, sslname);
|
||||
QString accountName = QString::fromStdString(name);
|
||||
std::string gpgid, name, email, location;
|
||||
RsInit::getAccountDetails(*it, gpgid, name, email, location);
|
||||
QString accountName = QString::fromStdString(name) + " - " + QString::fromStdString(location);
|
||||
ui.loadName->addItem(accountName, userData);
|
||||
|
||||
if (preferedId == *it)
|
||||
|
|
|
@ -65,8 +65,7 @@ void ProfileWidget::loadDialog()
|
|||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
|
||||
{
|
||||
|
||||
ui.name->setText(QString::fromStdString(detail.name));
|
||||
ui.orgloc->setText(QString::fromStdString(detail.org));
|
||||
ui.name->setText(QString::fromStdString(detail.name));
|
||||
ui.country->setText(QString::fromStdString(detail.location));
|
||||
|
||||
ui.peerid->setText(QString::fromStdString(detail.id));
|
||||
|
@ -74,7 +73,6 @@ void ProfileWidget::loadDialog()
|
|||
// Dont Show a timestamp in RS calculate the day
|
||||
QDateTime date = QDateTime::fromTime_t(detail.lastConnect);
|
||||
QString stime = date.toString(Qt::LocalDate);
|
||||
ui.lastcontact-> setText(stime);
|
||||
|
||||
/* set retroshare version */
|
||||
std::map<std::string, std::string>::iterator vit;
|
||||
|
@ -94,7 +92,7 @@ void ProfileWidget::loadDialog()
|
|||
|
||||
std::list<std::string> ids;
|
||||
ids.clear();
|
||||
rsPeers->getFriendList(ids);
|
||||
rsPeers->getGPGAcceptedList(ids);
|
||||
int friends = ids.size();
|
||||
|
||||
std::ostringstream out;
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue