* added for systray contextmenu Open Messages (working)

* set for MessengerWindow to use RWindow now
* added Messages button for MessengerWindow not working at the moment


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@919 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-01-07 21:12:31 +00:00
parent 935a52dee3
commit 5dc3e39337
8 changed files with 174 additions and 104 deletions

View File

@ -174,6 +174,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
connect(ui.actionSMPlayer, SIGNAL(triggered()), this, SLOT( showsmplayer()) );
connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT( showabout()) );
connect(ui.actionColor, SIGNAL(triggered()), this, SLOT( setStyle()) );
connect(ui.actionSettings, SIGNAL(triggered()), this, SLOT( showSettings()) );
/** adjusted quit behaviour: trigger a warning that can be switched off in the saved
@ -359,6 +361,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
menu->addAction(QIcon(IMAGE_RETROSHARE), tr("Show/Hide"), this, SLOT(toggleVisibilitycontextmenu()));
menu->addSeparator();
menu->addAction(_messengerwindowAct);
menu->addAction(_messagesAct);
/* bandwidth only in development version */
#ifdef RS_RELEASE_VERSION
@ -453,7 +457,7 @@ void MainWindow::addActionservice(QAction *actionservice, const char *slot)
}
/** Overloads the default show so we can load settings */
void MainWindow::show()
/*void MainWindow::show()
{
if (!this->isVisible()) {
@ -463,15 +467,17 @@ void MainWindow::show()
setWindowState(windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
QMainWindow::raise();
}
}
}*/
/** Shows the config dialog with focus set to the given page. */
void MainWindow::show(Page page)
/** Shows the MainWindow with focus set to the given page. */
void MainWindow::showWindow(Page page)
{
/* Show the dialog. */
show();
//show();
/* Show the dialog. */
RWindow::showWindow();
/* Set the focus to the specified page. */
ui.stackPages->setCurrentIndex((int)page);
}
@ -521,7 +527,7 @@ void MainWindow::inviteFriend()
}
/** Shows Preferences */
/** Add a Share */
void MainWindow::addSharedDirectory()
{
/* Same Code as in Preferences Window (add Share) */
@ -538,7 +544,7 @@ void MainWindow::addSharedDirectory()
}
/** Shows Preferences */
/** Shows Share Manager */
void MainWindow::openShareManager()
{
static ShareManager* sharemanager = new ShareManager(this);
@ -546,12 +552,21 @@ void MainWindow::openShareManager()
}
/** Shows Preferences */
/*void MainWindow::showPreferencesWindow()
/** Creates and displays the Configuration dialog with the current page set to
* <b>page</b>. */
void
MainWindow::showPreferencesWindow(PreferencesWindow::Page page)
{
static PreferencesWindow* preferencesWindow = new PreferencesWindow(this);
preferencesWindow->show();
}*/
_preferencesWindow->showWindow(page);
}
/** Shows Messages Dialog */
void
MainWindow::showMess(MainWindow::Page page)
{
showWindow(page);
}
/** Shows Options */
void MainWindow::showSettings()
@ -599,6 +614,9 @@ void MainWindow::createActions()
_messengerwindowAct = new QAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this);
connect(_messengerwindowAct, SIGNAL(triggered()),this, SLOT(showMessengerWindow()));
_messagesAct = new QAction(QIcon(IMAGE_MESSAGES), tr("Open Messages"), this);
connect(_messagesAct, SIGNAL(triggered()),this, SLOT(showMess()));
_appAct = new QAction(QIcon(IMAGE_UNFINISHED), tr("Applications"), this);
connect(_appAct, SIGNAL(triggered()),this, SLOT(showApplWindow()));
@ -809,15 +827,6 @@ void MainWindow::setStyle()
}
/** Creates and displays the Configuration dialog with the current page set to
* <b>page</b>. */
void
MainWindow::showPreferencesWindow(PreferencesWindow::Page page)
{
_preferencesWindow->showWindow(page);
}
void openFile(std::string path)
{

View File

@ -69,14 +69,14 @@ public:
/** Main dialog pages. */
enum Page {
Network = 0, /** Network page. */
Friends = 1, /** Peers page. */
SharedDirectories = 2, /** Shared Directories page. */
Search = 3, /** Search page. */
Transfers = 4, /** Transfers page. */
Chat = 5, /** Chat page. */
Messages = 6, /** Messages page. */
Channels = 7, /** Channels page. */
Statistics = 8 /** Statistic page. */
Friends, /** Peers page. */
Search, /** Search page. */
Transfers, /** Transfers page. */
SharedDirectories, /** Shared Directories page. */
Messages, /** Messages page. */
Links, /** Links page. */
Channels, /** Channels page. */
Forums /** Forums page. */
};
@ -108,9 +108,9 @@ public:
public slots:
/** Called when this dialog is to be displayed */
void show();
//void show();
/** Shows the config dialog with focus set to the given page. */
void show(Page page);
void showWindow(Page page);
void startgammon();
void startqcheckers();
@ -146,6 +146,8 @@ private slots:
/** Creates and displays the Configuration dialog with the current page set
* to <b>page</b>. */
void showPreferencesWindow(PreferencesWindow::Page page = PreferencesWindow::General);
void showMess(MainWindow::Page page = MainWindow::Messages);
void showSettings();
void setStyle();
@ -175,6 +177,7 @@ private:
QAction* _prefsAct;
QAction* _bandwidthAct;
QAction* _messengerwindowAct;
QAction* _messagesAct;
QAction* _smplayerAct;
QAction* _helpAct;
QAction* _appAct;

View File

@ -494,16 +494,17 @@
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<widget class="QWidget" name="centralwidget" >
<property name="geometry" >
<rect>
<x>35</x>
<y>12</y>
<width>753</width>
<height>567</height>
</rect>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item row="0" column="0" >
@ -1002,25 +1003,8 @@
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>579</y>
<width>800</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>12</height>
</rect>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
@ -1050,19 +1034,11 @@
</attribute>
</widget>
<widget class="QToolBar" name="toolBarservice" >
<property name="geometry" >
<rect>
<x>788</x>
<y>12</y>
<width>12</width>
<height>567</height>
</rect>
</property>
<property name="windowTitle" >
<string/>
</property>
<property name="allowedAreas" >
<set>Qt::BottomToolBarArea|Qt::LeftToolBarArea|Qt::RightToolBarArea</set>
<set>Qt::BottomToolBarArea|Qt::LeftToolBarArea|Qt::NoToolBarArea|Qt::RightToolBarArea</set>
</property>
<property name="iconSize" >
<size>
@ -1081,14 +1057,6 @@
<property name="enabled" >
<bool>true</bool>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>12</y>
<width>35</width>
<height>567</height>
</rect>
</property>
<property name="windowTitle" >
<string>toolBar_2</string>
</property>
@ -1119,8 +1087,7 @@
</widget>
<action name="actionAdd_Friend" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/add-friend24.png</normaloff>:/images/add-friend24.png</iconset>
<iconset resource="images.qrc" >:/images/add-friend24.png</iconset>
</property>
<property name="text" >
<string>Add Friend</string>
@ -1128,8 +1095,7 @@
</action>
<action name="actionInvite_Friend" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/invite-friend24.png</normaloff>:/images/invite-friend24.png</iconset>
<iconset resource="images.qrc" >:/images/invite-friend24.png</iconset>
</property>
<property name="text" >
<string>Invite Friend</string>
@ -1137,8 +1103,7 @@
</action>
<action name="actionAdd_Share" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
<iconset resource="images.qrc" >:/images/add-share24.png</iconset>
</property>
<property name="text" >
<string>Add Share</string>
@ -1146,8 +1111,7 @@
</action>
<action name="actionOptions" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/kcmsystem24.png</normaloff>:/images/kcmsystem24.png</iconset>
<iconset resource="images.qrc" >:/images/kcmsystem24.png</iconset>
</property>
<property name="text" >
<string>Options</string>
@ -1155,8 +1119,7 @@
</action>
<action name="actionQuit" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/exit_24x24.png</normaloff>:/images/exit_24x24.png</iconset>
<iconset resource="images.qrc" >:/images/exit_24x24.png</iconset>
</property>
<property name="text" >
<string>Quit</string>
@ -1167,8 +1130,7 @@
<bool>false</bool>
</property>
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/highlight.png</normaloff>:/images/highlight.png</iconset>
<iconset resource="images.qrc" >:/images/highlight.png</iconset>
</property>
<property name="text" >
<string>Color</string>
@ -1179,8 +1141,7 @@
</action>
<action name="actionSMPlayer" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/smplayer_icon32.png</normaloff>:/images/smplayer_icon32.png</iconset>
<iconset resource="images.qrc" >:/images/smplayer_icon32.png</iconset>
</property>
<property name="text" >
<string>SMPlayer</string>
@ -1188,8 +1149,7 @@
</action>
<action name="actionMessenger" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/kdmconfig.png</normaloff>:/images/kdmconfig.png</iconset>
<iconset resource="images.qrc" >:/images/kdmconfig.png</iconset>
</property>
<property name="text" >
<string>Messenger</string>
@ -1197,13 +1157,20 @@
</action>
<action name="actionAbout" >
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/informations_24x24.png</normaloff>:/images/informations_24x24.png</iconset>
<iconset resource="images.qrc" >:/images/informations_24x24.png</iconset>
</property>
<property name="text" >
<string>About</string>
</property>
</action>
<action name="actionSettings" >
<property name="icon" >
<iconset resource="images.qrc" >:/images/settings.png</iconset>
</property>
<property name="text" >
<string>Settings</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -28,6 +28,7 @@
#include "rshare.h"
#include "MessengerWindow.h"
//#include "MainWindow.h"
#include "chat/PopupChatDialog.h"
#include "msgs/ChanMsgDialog.h"
@ -70,18 +71,20 @@
/** Constructor */
MessengerWindow::MessengerWindow(QWidget * parent)
: QMainWindow(parent)
MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
: RWindow("MessengerWindow", parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
RshareSettings config;
config.loadWidgetInformation(this);
//RshareSettings config;
//config.loadWidgetInformation(this);
connect( ui.messengertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messengertreeWidgetCostumPopupMenu( QPoint ) ) );
connect( ui.avatarButton, SIGNAL(clicked()), SLOT(getPicture()));
connect( ui.mailButton, SIGNAL(clicked()), SLOT(showMessages()));
connect( ui.addIMAccountButton, SIGNAL(clicked( bool ) ), this , SLOT( addFriend2() ) );
connect( ui.messengertreeWidget, SIGNAL(itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(chatfriend2()));
@ -91,7 +94,7 @@ MessengerWindow::MessengerWindow(QWidget * parent)
/* to hide the header */
ui.messengertreeWidget->header()->hide();
/* Set header resize modes and initial section sizes */
/* Set header resize modes and initial section sizes */
ui.messengertreeWidget->setColumnCount(1);
QHeaderView * _header = ui.messengertreeWidget->header () ;
@ -101,6 +104,9 @@ MessengerWindow::MessengerWindow(QWidget * parent)
//_header->setResizeMode (3, QHeaderView::Interactive);
_header->resizeSection ( 0, 200 );
/* Create all the dialogs of which we only want one instance */
//_mainWindow = new MainWindow();
//LogoBar
_rsLogoBarmessenger = NULL;
@ -353,13 +359,18 @@ void MessengerWindow::show()
void MessengerWindow::closeEvent (QCloseEvent * event)
{
RshareSettings config;
config.saveWidgetInformation(this);
//RshareSettings config;
//config.saveWidgetInformation(this);
hide();
event->ignore();
}
/** Shows Messages */
/*void MessengerWindow::showMessages(MainWindow::Page page)
{
mainWindow->showWindow(page);
}*/
void MessengerWindow::setChatDialog(PeersDialog *cd)

View File

@ -27,17 +27,19 @@
#include "ui_MessengerWindow.h"
#include "NetworkDialog.h"
#include <gui/Preferences/rsharesettings.h>
#include <gui/common/rwindow.h>
class LogoBar;
class PeersDialog;
//class MainWindow;
class MessengerWindow : public QMainWindow
class MessengerWindow : public RWindow
{
Q_OBJECT
public:
/** Default Constructor */
MessengerWindow(QWidget *parent = 0);
MessengerWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default Destructor */
void insertPeers();
@ -76,7 +78,10 @@ private slots:
void addFriend2();
void getPicture();
void getPicture();
//void showMessages(MainWindow::Page page = MainWindow::Messages);
/** RsServer Friend Calls */
@ -99,6 +104,9 @@ private:
PeersDialog *chatDialog;
//MainWindow* mainWindow;
/** Define the popup menus for the Context menu */
QMenu* contextMnu;
/** Defines the actions for the context menu */

View File

@ -56,6 +56,12 @@
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<layout class="QGridLayout" >
<property name="leftMargin" >
@ -217,6 +223,68 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QFrame" name="frame" >
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>2</number>
</property>
<property name="topMargin" >
<number>2</number>
</property>
<property name="rightMargin" >
<number>2</number>
</property>
<property name="bottomMargin" >
<number>2</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QPushButton" name="mailButton" >
<property name="toolTip" >
<string>Open your Messages Inbox</string>
</property>
<property name="text" >
<string/>
</property>
<property name="icon" >
<iconset resource="images.qrc" >:/images/evolution.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>161</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -34,6 +34,9 @@
#include "rsiface/rstypes.h"
#include "rsiface/rsdistrib.h" /* For FLAGS */
#define RS_FORUMMSG_NEW 0x0010
class ForumInfo
{
public:

View File

@ -3,6 +3,7 @@
}
.time {
}
.incomingHeader {
@ -20,5 +21,5 @@
}
.outgoingTime {
color: #244578;
color: #707070;
}