From 6490d67e8411000763af85e5a5dc662485c5b9b1 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 18 Nov 2007 23:35:53 +0000 Subject: [PATCH] -added systray menu function for can start SMPlayer . -added for MessagesDialog/ New Message Dialog needed items for File Name,Size, Sources if correct?, Hash -added resizesection/resizemode to see the complete Message Timestamp/Date item for MessagesDialog. -added WidgetInformation function for MessengerWindow/New Message Dialog to save the Widget Position and Size. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@258 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 6 +++++ retroshare-gui/src/gui/MainWindow.h | 1 + retroshare-gui/src/gui/MessagesDialog.cpp | 25 ++++++++++++++++++- retroshare-gui/src/gui/MessagesDialog.ui | 23 +++++++++++++++++ retroshare-gui/src/gui/MessengerWindow.cpp | 7 +++++- retroshare-gui/src/gui/MessengerWindow.h | 4 +-- retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp | 14 ++++++++++- retroshare-gui/src/gui/msgs/ChanMsgDialog.h | 7 +++++- retroshare-gui/src/gui/msgs/ChanMsgDialog.ui | 17 ++++++++++++- 9 files changed, 97 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index a47bc566e..97347596d 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -237,12 +237,14 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) menu->addAction(QIcon(IMAGE_RETROSHARE), tr("Show/Hide"), this, SLOT(toggleVisibilitycontextmenu())); menu->addSeparator(); menu->addAction(_messengerwindowAct); + /* bandwidth only in development version */ #ifdef RS_RELEASE_VERSION #else menu->addAction(_bandwidthAct); #endif menu->addAction(_prefsAct); + menu->addAction(_smplayerAct); menu->addSeparator(); menu->addAction(tr("Minimize"), this, SLOT(showMinimized())); menu->addAction(tr("Maximize"), this, SLOT(showMaximized())); @@ -404,6 +406,7 @@ MainWindow::~MainWindow() delete _prefsAct; delete _bandwidthGraph; delete _messengerwindowAct; + delete _smplayerAct; } /** Create and bind actions to events. Setup for initial @@ -420,6 +423,9 @@ void MainWindow::createActions() _messengerwindowAct = new QAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this); connect(_messengerwindowAct, SIGNAL(triggered()),this, SLOT(showMessengerWindow())); + + _smplayerAct = new QAction(QIcon(IMAGE_SMPLAYER), tr("SMPlayer"), this); + connect(_smplayerAct, SIGNAL(triggered()),this, SLOT(showsmplayer())); connect(ui.btntoggletoolbox, SIGNAL(toggled(bool)), this, SLOT(showToolboxFrame(bool))); diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index de09e1961..fdc98dbc8 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -154,6 +154,7 @@ private: QAction* _prefsAct; QAction* _bandwidthAct; QAction* _messengerwindowAct; + QAction* _smplayerAct; /** A BandwidthGraph object which handles monitoring RetroShare bandwidth usage */ BandwidthGraph* _bandwidthGraph; diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 3d2558236..f5e472e16 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -36,6 +36,8 @@ #include #include #include +#include + /* Images for context menu icons */ #define IMAGE_MESSAGE ":/images/folder-draft.png" @@ -66,7 +68,26 @@ MessagesDialog::MessagesDialog(QWidget *parent) mCurrMsgId = ""; /* hide the Tree +/- */ - ui.msgList -> setRootIsDecorated( false ); + ui.msgList->setRootIsDecorated( false ); + + + /* Set header resize modes and initial section sizes */ + QHeaderView * msgwheader = ui.msgWidget->header () ; + msgwheader->setResizeMode (0, QHeaderView::Interactive); + + msgwheader->resizeSection ( 0, 125 ); + + /* Set header resize modes and initial section sizes */ + QHeaderView * msglheader = ui.msgList->header () ; + msglheader->setResizeMode (0, QHeaderView::Interactive); + msglheader->setResizeMode (1, QHeaderView::Interactive); + msglheader->setResizeMode (2, QHeaderView::Interactive); + msglheader->setResizeMode (3, QHeaderView::Interactive); + + msglheader->resizeSection ( 0, 125 ); + msglheader->resizeSection ( 1, 100 ); + msglheader->resizeSection ( 2, 100 ); + msglheader->resizeSection ( 3, 200 ); /* Hide platform specific features */ @@ -127,6 +148,8 @@ void MessagesDialog::newmessage() //std::cerr << "MessagesDialog::newmessage()" << std::endl; nMsgDialog->newMsg(); nMsgDialog->show(); + nMsgDialog->activateWindow(); + /* window will destroy itself! */ } diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/MessagesDialog.ui index b97ab41fd..a61f84c70 100644 --- a/retroshare-gui/src/gui/MessagesDialog.ui +++ b/retroshare-gui/src/gui/MessagesDialog.ui @@ -693,6 +693,29 @@ border-image: url(:/images/deletemail-pressed.png); Qt::CustomContextMenu + + true + + + + File Name + + + + + Size + + + + + Sources + + + + + Hash + + diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index 187c8be62..0660546e3 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -68,7 +68,9 @@ MessengerWindow::MessengerWindow(QWidget * parent) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); - + + RshareSettings config; + config.loadWidgetInformation(this); connect( ui.messengertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messengertreeWidgetCostumPopupMenu( QPoint ) ) ); @@ -327,6 +329,9 @@ void MessengerWindow::show() void MessengerWindow::closeEvent (QCloseEvent * event) { + RshareSettings config; + config.saveWidgetInformation(this); + hide(); event->ignore(); } diff --git a/retroshare-gui/src/gui/MessengerWindow.h b/retroshare-gui/src/gui/MessengerWindow.h index 3420a237b..f44cb32e6 100644 --- a/retroshare-gui/src/gui/MessengerWindow.h +++ b/retroshare-gui/src/gui/MessengerWindow.h @@ -1,7 +1,7 @@ /**************************************************************** * RetroShare is distributed under the following license: * - * Copyright (C) 2006, crypton + * Copyright (C) 2007, RetroShare Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,7 +26,7 @@ #include "mainpage.h" #include "ui_MessengerWindow.h" #include "NetworkDialog.h" - +#include class LogoBar; class ChatDialog; diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp b/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp index 4749e50a7..bbfc20f8f 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp @@ -1,7 +1,7 @@ /**************************************************************** * RetroShare is distributed under the following license: * - * Copyright (C) 2006, crypton + * Copyright (C) 2006,2007 RetroShare Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -40,6 +40,9 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); + + RshareSettings config; + config.loadWidgetInformation(this); setAttribute ( Qt::WA_DeleteOnClose, true ); @@ -98,6 +101,15 @@ void ChanMsgDialog::channelstreeViewCostumPopupMenu( QPoint point ) contextMnu.exec( mevent->globalPos() ); } +void ChanMsgDialog::closeEvent (QCloseEvent * event) +{ + RshareSettings config; + config.saveWidgetInformation(this); + + hide(); + event->ignore(); +} + void ChanMsgDialog::deletechannel() { diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.h b/retroshare-gui/src/gui/msgs/ChanMsgDialog.h index 13bceda45..cbb56c3c5 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.h +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.h @@ -1,7 +1,7 @@ /**************************************************************** * RetroShare is distributed under the following license: * - * Copyright (C) 2006, crypton + * Copyright (C) 2007, RetroShare Team * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -24,6 +24,8 @@ #define _CHAN_MSG_DIALOG_H #include +#include + #include "ui_ChanMsgDialog.h" @@ -52,6 +54,9 @@ public slots: void sendMessage(); void cancelMessage(); +protected: + void closeEvent (QCloseEvent * event); + private slots: /** Create the context popup menu and it's submenus */ diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui b/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui index 385293e50..a563d14bd 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui @@ -165,7 +165,22 @@ p, li { white-space: pre-wrap; } - 1 + File Name + + + + + Size + + + + + Sources + + + + + Hash