diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 0c432d8e1..279f158c7 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -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() { diff --git a/retroshare-gui/src/gui/FriendsDialog.h b/retroshare-gui/src/gui/FriendsDialog.h index 198240f38..593fad6a9 100644 --- a/retroshare-gui/src/gui/FriendsDialog.h +++ b/retroshare-gui/src/gui/FriendsDialog.h @@ -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 */ diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 9ca5d2ba9..02cb459f6 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -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)); diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index f429ba080..9176dfbcd 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -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;