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

View File

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

View File

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

View File

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

View File

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

View File

@ -56,6 +56,12 @@
<property name="bottomMargin" > <property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" > <item row="0" column="0" >
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="leftMargin" > <property name="leftMargin" >
@ -217,6 +223,68 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
</item> </item>

View File

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

View File

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