moved feed as a tab in main window

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ImprovedGUI@6103 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-01-30 22:21:00 +00:00
parent e6e7a1b52f
commit 8fe75acfaf
4 changed files with 37 additions and 30 deletions

View file

@ -101,13 +101,13 @@ FriendsDialog::FriendsDialog(QWidget *parent)
ui.avatar->setOwnId();
ui.tabWidget->setTabPosition(QTabWidget::North);
ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_PEERS), tr("Local network"));
ui.tabWidget->addTab(networkDialog = new NetworkDialog(),QIcon(IMAGE_NETWORK2), tr("Known people"));
ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_NETWORK2), tr("Local network"));
ui.tabWidget->addTab(networkDialog = new NetworkDialog(),QIcon(IMAGE_PEERS), tr("Known people"));
//ui.tabWidget->addTab(new ChatLobbyWidget(), tr("Chat lobbies"));
//ui.tabWidget->addTab(new ProfileWidget(), tr("Profile"));
newsFeed = new NewsFeed();
int newsFeedTabIndex = ui.tabWidget->insertTab(0, newsFeed, tr("News Feed"));
ui.tabWidget->setCurrentIndex(newsFeedTabIndex);
//newsFeed = new NewsFeed();
//int newsFeedTabIndex = ui.tabWidget->insertTab(0, newsFeed, tr("News Feed"));
//ui.tabWidget->setCurrentIndex(newsFeedTabIndex);
ui.tabWidget->hideCloseButton(0);
ui.tabWidget->hideCloseButton(1);
@ -115,10 +115,10 @@ FriendsDialog::FriendsDialog(QWidget *parent)
ui.tabWidget->hideCloseButton(3);
/* get the current text and text color of the tab bar */
newsFeedTabColor = ui.tabWidget->tabBar()->tabTextColor(newsFeedTabIndex);
newsFeedText = ui.tabWidget->tabBar()->tabText(newsFeedTabIndex);
//newsFeedTabColor = ui.tabWidget->tabBar()->tabTextColor(newsFeedTabIndex);
//newsFeedText = ui.tabWidget->tabBar()->tabText(newsFeedTabIndex);
connect(newsFeed, SIGNAL(newsFeedChanged(int)), this, SLOT(newsFeedChanged(int)));
//connect(newsFeed, SIGNAL(newsFeedChanged(int)), this, SLOT(newsFeedChanged(int)));
connect(ui.Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg()));
connect(ui.emoticonBtn, SIGNAL(clicked()), this, SLOT(smileyWidgetgroupchat()));
@ -855,23 +855,23 @@ void FriendsDialog::on_actionAdd_Group_activated()
createGrpDialog.exec();
}
void FriendsDialog::newsFeedChanged(int count)
{
int newsFeedTabIndex = ui.tabWidget->indexOf(newsFeed);
if (newsFeedTabIndex < 0) {
return;
}
if (count) {
ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, QString("%1 (%2)").arg(newsFeedText).arg(count));
ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, Qt::blue);
ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED_NEW));
} else {
ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, newsFeedText);
ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, newsFeedTabColor);
ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED));
}
}
// void FriendsDialog::newsFeedChanged(int count)
// {
// int newsFeedTabIndex = ui.tabWidget->indexOf(newsFeed);
// if (newsFeedTabIndex < 0) {
// return;
// }
//
// if (count) {
// ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, QString("%1 (%2)").arg(newsFeedText).arg(count));
// ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, Qt::blue);
// ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED_NEW));
// } else {
// ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, newsFeedText);
// ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, newsFeedTabColor);
// ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED));
// }
// }
void FriendsDialog::createChatLobby()
{

View file

@ -115,7 +115,7 @@ private slots:
void setCurrentFileName(const QString &fileName);
void newsFeedChanged(int count);
//void newsFeedChanged(int count);
void createChatLobby();
void recommendFriends();
@ -141,9 +141,9 @@ private:
QFont mCurrentFont; /* how the text will come out */
QWidget *newsFeed;
QColor newsFeedTabColor;
QString newsFeedText;
//QWidget *newsFeed;
//QColor newsFeedTabColor;
//QString newsFeedText;
bool inChatCharFormatChanged;
/** Qt Designer generated object */

View file

@ -45,6 +45,7 @@
#include "MessagesDialog.h"
#include "SharedFilesDialog.h"
#include "PluginsPage.h"
#include "NewsFeed.h"
#include "ShareManager.h"
#include "NetworkView.h"
#include "ForumsDialog.h"
@ -237,6 +238,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
QActionGroup *grp = new QActionGroup(this);
QAction *action;
ui->stackPages->add(newsFeed = new NewsFeed(ui->stackPages),
createPageAction(QIcon(IMAGE_NEWSFEED), tr("News feed"), grp));
// ui->stackPages->add(networkDialog = new NetworkDialog(ui->stackPages),
// createPageAction(QIcon(IMAGE_NETWORK2), tr("Network"), grp));

View file

@ -54,6 +54,7 @@ class PluginsPage;
class ChannelFeed;
class BandwidthGraph;
class MainPage;
class NewsFeed;
class UserNotify;
#ifdef RS_USE_LINKS
@ -118,8 +119,10 @@ public:
*/
// NetworkDialog *networkDialog;
FriendsDialog *friendsDialog;
// SearchDialog *searchDialog;
NewsFeed *newsFeed;
FriendsDialog *friendsDialog;
TransfersDialog *transfersDialog;
MessagesDialog *messagesDialog;
SharedFilesDialog *sharedfilesDialog;