mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 08:10:46 -04:00
moved chat lobbies into a separate tab
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ImprovedGUI@6124 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c7aa08f03f
commit
205828bc7d
10 changed files with 78 additions and 99 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <QMessageBox>
|
||||
#include "ChatLobbyWidget.h"
|
||||
#include "chat/CreateLobbyDialog.h"
|
||||
#include "chat/ChatTabWidget.h"
|
||||
#include "common/RSTreeWidgetItem.h"
|
||||
#include "notifyqt.h"
|
||||
#include "chat/ChatLobbyDialog.h"
|
||||
|
@ -40,6 +41,12 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WFlags flags)
|
|||
QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,const QString&,const QString&)), this, SLOT(displayChatLobbyEvent(qulonglong,int,const QString&,const QString&)));
|
||||
QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyInviteReceived()), this, SLOT(readChatLobbyInvites()));
|
||||
|
||||
lobbyTreeWidget = new QTreeWidget ;
|
||||
getTabWidget()->addTab(lobbyTreeWidget,tr("Lobby list")) ;
|
||||
|
||||
layout()->addWidget( getTabWidget() ) ;
|
||||
layout()->update() ;
|
||||
|
||||
QObject::connect(lobbyTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(lobbyTreeWidgetCostumPopupMenu()));
|
||||
QObject::connect(lobbyTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
|
||||
|
||||
|
@ -349,6 +356,13 @@ void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
|
|||
subscribeLobby(item);
|
||||
}
|
||||
|
||||
ChatTabWidget *ChatLobbyWidget::getTabWidget()
|
||||
{
|
||||
static ChatTabWidget *instance = new ChatTabWidget() ;
|
||||
|
||||
return instance ;
|
||||
}
|
||||
|
||||
void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str)
|
||||
{
|
||||
std::cerr << "Received displayChatLobbyEvent()!" << std::endl;
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include "ui_ChatLobbyWidget.h"
|
||||
#include "RsAutoUpdatePage.h"
|
||||
|
||||
class RSTreeWidgetItemCompareRole;
|
||||
class ChatTabWidget ;
|
||||
|
||||
class ChatLobbyWidget : public RsAutoUpdatePage, Ui::ChatLobbyWidget
|
||||
{
|
||||
|
@ -18,6 +20,7 @@ public:
|
|||
|
||||
virtual void updateDisplay();
|
||||
|
||||
static ChatTabWidget *getTabWidget() ;
|
||||
protected slots:
|
||||
void lobbyChanged();
|
||||
void lobbyTreeWidgetCostumPopupMenu();
|
||||
|
@ -32,4 +35,7 @@ private:
|
|||
RSTreeWidgetItemCompareRole *compareRole;
|
||||
QTreeWidgetItem *privateLobbyItem;
|
||||
QTreeWidgetItem *publicLobbyItem;
|
||||
|
||||
ChatTabWidget *tabWidget ;
|
||||
QTreeWidget *lobbyTreeWidget ;
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>608</width>
|
||||
<height>397</height>
|
||||
<height>188</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
|
@ -89,40 +89,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTreeWidget" name="lobbyTreeWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="expandsOnDoubleClick">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "im_history/ImHistoryBrowser.h"
|
||||
#include "MainWindow.h"
|
||||
#include "NewsFeed.h"
|
||||
#include "ChatLobbyWidget.h"
|
||||
#include "notifyqt.h"
|
||||
#include "profile/ProfileWidget.h"
|
||||
#include "profile/StatusMessage.h"
|
||||
|
@ -51,7 +50,6 @@
|
|||
#include "util/misc.h"
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/DateTime.h"
|
||||
#include "chat/CreateLobbyDialog.h"
|
||||
#include "FriendRecommendDialog.h"
|
||||
#include "FriendsDialog.h"
|
||||
#include "ServicePermissionDialog.h"
|
||||
|
@ -89,8 +87,7 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
|
||||
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
|
||||
connect( ui.actionAdd_Friend, SIGNAL(triggered()), this, SLOT(addFriend()));
|
||||
connect( ui.actionCreate_new_Chat_lobby, SIGNAL(triggered()), this, SLOT(createChatLobby()));
|
||||
connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends()));
|
||||
connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends()));
|
||||
connect( ui.actionServicePermission, SIGNAL(triggered()), this, SLOT(servicePermission()));
|
||||
connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString)));
|
||||
|
||||
|
@ -103,7 +100,7 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
ui.tabWidget->setTabPosition(QTabWidget::North);
|
||||
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"));
|
||||
|
@ -873,12 +870,6 @@ void FriendsDialog::on_actionAdd_Group_activated()
|
|||
// }
|
||||
// }
|
||||
|
||||
void FriendsDialog::createChatLobby()
|
||||
{
|
||||
std::list<std::string> friends;
|
||||
CreateLobbyDialog(friends).exec();
|
||||
}
|
||||
|
||||
void FriendsDialog::recommendFriends()
|
||||
{
|
||||
FriendRecommendDialog::showYourself();
|
||||
|
@ -890,11 +881,6 @@ void FriendsDialog::servicePermission()
|
|||
dlg.exec();
|
||||
}
|
||||
|
||||
/*static*/ ChatTabWidget *FriendsDialog::getTabWidget()
|
||||
{
|
||||
return instance ? instance->ui.tabWidget : NULL;
|
||||
}
|
||||
|
||||
/*static*/ bool FriendsDialog::isGroupChatActive()
|
||||
{
|
||||
FriendsDialog *friendsDialog = dynamic_cast<FriendsDialog*>(MainWindow::getPage(MainWindow::Friends));
|
||||
|
|
|
@ -49,7 +49,6 @@ public:
|
|||
|
||||
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
|
||||
|
||||
static ChatTabWidget *getTabWidget();
|
||||
static bool isGroupChatActive();
|
||||
static void groupChatActivate();
|
||||
|
||||
|
@ -117,7 +116,6 @@ private slots:
|
|||
|
||||
//void newsFeedChanged(int count);
|
||||
|
||||
void createChatLobby();
|
||||
void recommendFriends();
|
||||
void servicePermission();
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "NetworkView.h"
|
||||
#include "ForumsDialog.h"
|
||||
#include "FriendsDialog.h"
|
||||
#include "ChatLobbyWidget.h"
|
||||
#include "HelpDialog.h"
|
||||
#include "AboutDialog.h"
|
||||
#include "QuickStartWizard.h"
|
||||
|
@ -255,8 +256,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp));
|
||||
notify.push_back(QPair<MainPage*, QAction*>(transfersDialog, action));
|
||||
|
||||
// ui->stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui->stackPages),
|
||||
// createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp));
|
||||
ui->stackPages->add(chatLobbyDialog = new ChatLobbyWidget(ui->stackPages),
|
||||
action = createPageAction(QIcon(IMAGE_CHAT), tr("Chat Lobbies"), grp));
|
||||
notify.push_back(QPair<MainPage*, QAction*>(chatLobbyDialog, action));
|
||||
|
||||
ui->stackPages->add(messagesDialog = new MessagesDialog(ui->stackPages),
|
||||
action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
|
||||
|
@ -787,37 +789,39 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||
|
||||
MainPage *Page = NULL;
|
||||
|
||||
switch (page) {
|
||||
// case Network:
|
||||
// Page = _instance->networkDialog;
|
||||
// break;
|
||||
case Friends:
|
||||
Page = _instance->friendsDialog;
|
||||
break;
|
||||
// case Search:
|
||||
// Page = _instance->searchDialog;
|
||||
// break;
|
||||
case Transfers:
|
||||
Page = _instance->transfersDialog;
|
||||
break;
|
||||
// case SharedDirectories:
|
||||
// Page = _instance->sharedfilesDialog;
|
||||
break;
|
||||
case Messages:
|
||||
Page = _instance->messagesDialog;
|
||||
break;
|
||||
case Channels:
|
||||
Page = _instance->channelFeed;
|
||||
break;
|
||||
case Forums:
|
||||
Page = _instance->forumsDialog;
|
||||
break;
|
||||
switch (page) {
|
||||
// case Network:
|
||||
// Page = _instance->networkDialog;
|
||||
// break;
|
||||
case Friends:
|
||||
Page = _instance->friendsDialog;
|
||||
break;
|
||||
case ChatLobby:
|
||||
Page = _instance->chatLobbyDialog;
|
||||
break;
|
||||
case Transfers:
|
||||
Page = _instance->transfersDialog;
|
||||
break;
|
||||
// case SharedDirectories:
|
||||
// Page = _instance->sharedfilesDialog;
|
||||
break;
|
||||
case Messages:
|
||||
Page = _instance->messagesDialog;
|
||||
break;
|
||||
case Channels:
|
||||
Page = _instance->channelFeed;
|
||||
break;
|
||||
case Forums:
|
||||
Page = _instance->forumsDialog;
|
||||
break;
|
||||
#ifdef BLOGS
|
||||
case Blogs:
|
||||
Page = _instance->blogsFeed;
|
||||
break;
|
||||
case Blogs:
|
||||
Page = _instance->blogsFeed;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
default:
|
||||
std::cerr << "Show page called on value that is not handled yet. Please code it! (value = " << Page << ")" << std::endl;
|
||||
}
|
||||
|
||||
if (Page) {
|
||||
/* Set the focus to the specified page. */
|
||||
|
@ -843,9 +847,9 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||
if (page == _instance->friendsDialog) {
|
||||
return Friends;
|
||||
}
|
||||
// if (page == _instance->searchDialog) {
|
||||
// return Search;
|
||||
// }
|
||||
if (page == _instance->chatLobbyDialog) {
|
||||
return ChatLobby;
|
||||
}
|
||||
if (page == _instance->transfersDialog) {
|
||||
return Transfers;
|
||||
}
|
||||
|
@ -887,8 +891,8 @@ void SetForegroundWindowInternal(HWND hWnd)
|
|||
// return _instance->networkDialog;
|
||||
case Friends:
|
||||
return _instance->friendsDialog;
|
||||
// case Search:
|
||||
// return _instance->searchDialog;
|
||||
case ChatLobby:
|
||||
return _instance->chatLobbyDialog;
|
||||
case Transfers:
|
||||
return _instance->transfersDialog;
|
||||
// case SharedDirectories:
|
||||
|
|
|
@ -43,6 +43,7 @@ class DHTStatus;
|
|||
class HashingStatus;
|
||||
class ForumsDialog;
|
||||
class FriendsDialog;
|
||||
class ChatLobbyWidget;
|
||||
class ChatDialog;
|
||||
class NetworkDialog;
|
||||
class SearchDialog;
|
||||
|
@ -79,17 +80,18 @@ public:
|
|||
/* Fixed numbers for load and save the last page */
|
||||
Network = 0, /** Network page. */
|
||||
Friends = 1, /** Friends page. */
|
||||
Search = 2, /** Search page. */
|
||||
ChatLobby = 2, /** Chat Lobby page. */
|
||||
Transfers = 3, /** Transfers page. */
|
||||
SharedDirectories = 4, /** Shared Directories page. */
|
||||
Messages = 5, /** Messages page. */
|
||||
Channels = 6, /** Channels page. */
|
||||
Forums = 7, /** Forums page. */
|
||||
Search = 8, /** Search page. */
|
||||
#ifdef BLOGS
|
||||
Blogs = 8, /** Blogs page. */
|
||||
Blogs = 9, /** Blogs page. */
|
||||
#endif
|
||||
#ifdef RS_USE_LINKS
|
||||
Links = 9, /** Links page. */
|
||||
Links = 10, /** Links page. */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -124,6 +126,7 @@ public:
|
|||
NewsFeed *newsFeed;
|
||||
FriendsDialog *friendsDialog;
|
||||
TransfersDialog *transfersDialog;
|
||||
ChatLobbyWidget *chatLobbyDialog;
|
||||
MessagesDialog *messagesDialog;
|
||||
SharedFilesDialog *sharedfilesDialog;
|
||||
ForumsDialog *forumsDialog;
|
||||
|
|
|
@ -118,9 +118,9 @@ void NetworkView::updateDisplay()
|
|||
|
||||
/* add all friends */
|
||||
std::string ownGPGId = rsPeers->getGPGOwnId();
|
||||
#ifdef DEBUG_NETWORKVIEW
|
||||
//#ifdef DEBUG_NETWORKVIEW
|
||||
std::cerr << "NetworkView::updateDisplay()" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
std::deque<NodeInfo> nodes_to_treat ; // list of nodes to be treated. Used as a queue. The int is the level of friendness
|
||||
std::set<std::string> nodes_considered ; // list of nodes already considered. Eases lookup.
|
||||
|
|
|
@ -619,7 +619,7 @@ QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int
|
|||
if (RemoteMode)
|
||||
return tr("Friend");
|
||||
else
|
||||
return tr("Share Type");
|
||||
return tr("Share Flags");
|
||||
case 4:
|
||||
if (RemoteMode)
|
||||
return tr("What's new");
|
||||
|
@ -665,7 +665,7 @@ QVariant FlatStyle_RDM::headerData(int section, Qt::Orientation orientation, int
|
|||
if(RemoteMode)
|
||||
return tr("Friend");
|
||||
else
|
||||
return tr("Share Type");
|
||||
return tr("Share Flags");
|
||||
case 4:
|
||||
return tr("Directory");
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <QMenu>
|
||||
|
||||
#include "ChatLobbyDialog.h"
|
||||
#include "gui/ChatLobbyWidget.h"
|
||||
#include "ChatTabWidget.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/settings/RsharePeerSettings.h"
|
||||
|
@ -123,7 +124,8 @@ void ChatLobbyDialog::init(const std::string &peerId, const QString &title)
|
|||
showParticipantsFrame(PeerSettings->getShowParticipantsFrame(peerId));
|
||||
|
||||
// add to window
|
||||
ChatTabWidget *tabWidget = FriendsDialog::getTabWidget();
|
||||
ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
|
||||
|
||||
if (tabWidget) {
|
||||
tabWidget->addDialog(this);
|
||||
}
|
||||
|
@ -455,8 +457,8 @@ bool ChatLobbyDialog::canClose()
|
|||
void ChatLobbyDialog::showDialog(uint chatflags)
|
||||
{
|
||||
if (chatflags & RS_CHAT_FOCUS) {
|
||||
MainWindow::showWindow(MainWindow::Friends);
|
||||
ChatTabWidget *tabWidget = FriendsDialog::getTabWidget();
|
||||
MainWindow::showWindow(MainWindow::ChatLobby);
|
||||
ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
|
||||
if (tabWidget) {
|
||||
tabWidget->setCurrentWidget(this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue