mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
* Fixed Create Forum Message Dialog
* Fixed some Displaying isues for statusbar git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@846 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
99c038a4db
commit
74104d71e7
4 changed files with 181 additions and 60 deletions
|
@ -282,7 +282,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||||
#endif
|
#endif
|
||||||
peerstatus = new PeerStatus();
|
peerstatus = new PeerStatus();
|
||||||
statusBar()->addWidget(peerstatus);
|
statusBar()->addWidget(peerstatus);
|
||||||
statusBar()->addPermanentWidget(statusRates = new QLabel(tr("<strong>Down:</strong> 0.00 | <strong>Up:</strong> 0.00 ")));
|
statusBar()->addPermanentWidget(statusRates = new QLabel(tr("<strong>Down:</strong> 0.00 (kB/s) | <strong>Up:</strong> 0.00 (kB/s) ")));
|
||||||
|
|
||||||
|
|
||||||
//servicegrp->actions()[0]->setChecked(true);
|
//servicegrp->actions()[0]->setChecked(true);
|
||||||
|
|
|
@ -50,15 +50,23 @@
|
||||||
#include <QTextDocumentFragment>
|
#include <QTextDocumentFragment>
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
CreateForumMsg::CreateForumMsg(std::string fId, std::string pId)
|
CreateForumMsg::CreateForumMsg(std::string fId, std::string pId, QWidget *parent, Qt::WFlags flags)
|
||||||
: QMainWindow(NULL), mForumId(fId), mParentId(pId)
|
: QMainWindow(parent, flags), mForumId(fId), mParentId(pId)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
setupFileActions();
|
||||||
|
setupEditActions();
|
||||||
|
setupViewActions();
|
||||||
|
setupInsertActions();
|
||||||
|
|
||||||
RshareSettings config;
|
RshareSettings config;
|
||||||
config.loadWidgetInformation(this);
|
config.loadWidgetInformation(this);
|
||||||
|
|
||||||
|
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||||
|
|
||||||
|
|
||||||
// connect up the buttons.
|
// connect up the buttons.
|
||||||
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
|
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
|
||||||
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
||||||
|
@ -520,3 +528,105 @@ bool CreateForumMsg::maybeSave()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateForumMsg::setupFileActions()
|
||||||
|
{
|
||||||
|
QMenu *menu = new QMenu(tr("&File"), this);
|
||||||
|
menuBar()->addMenu(menu);
|
||||||
|
|
||||||
|
QAction *a;
|
||||||
|
|
||||||
|
a = new QAction(QIcon(":/images/textedit/filenew.png"), tr("&New"), this);
|
||||||
|
a->setShortcut(QKeySequence::New);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(fileNew()));
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
a = new QAction(QIcon(":/images/textedit/fileopen.png"), tr("&Open..."), this);
|
||||||
|
a->setShortcut(QKeySequence::Open);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(fileOpen()));
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
actionSave = a = new QAction(QIcon(":/images/textedit/filesave.png"), tr("&Save"), this);
|
||||||
|
a->setShortcut(QKeySequence::Save);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(fileSave()));
|
||||||
|
a->setEnabled(false);
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
a = new QAction(tr("Save &As..."), this);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||||
|
menu->addAction(a);
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
a = new QAction(QIcon(":/images/textedit/fileprint.png"), tr("&Print..."), this);
|
||||||
|
a->setShortcut(QKeySequence::Print);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(filePrint()));
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
/*a = new QAction(QIcon(":/images/textedit/fileprint.png"), tr("Print Preview..."), this);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview()));
|
||||||
|
menu->addAction(a);*/
|
||||||
|
|
||||||
|
a = new QAction(QIcon(":/images/textedit/exportpdf.png"), tr("&Export PDF..."), this);
|
||||||
|
a->setShortcut(Qt::CTRL + Qt::Key_D);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf()));
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
a = new QAction(tr("&Quit"), this);
|
||||||
|
a->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(close()));
|
||||||
|
menu->addAction(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateForumMsg::setupEditActions()
|
||||||
|
{
|
||||||
|
QMenu *menu = new QMenu(tr("&Edit"), this);
|
||||||
|
menuBar()->addMenu(menu);
|
||||||
|
|
||||||
|
QAction *a;
|
||||||
|
a = actionUndo = new QAction(QIcon(":/images/textedit/editundo.png"), tr("&Undo"), this);
|
||||||
|
a->setShortcut(QKeySequence::Undo);
|
||||||
|
menu->addAction(a);
|
||||||
|
a = actionRedo = new QAction(QIcon(":/images/textedit/editredo.png"), tr("&Redo"), this);
|
||||||
|
a->setShortcut(QKeySequence::Redo);
|
||||||
|
menu->addAction(a);
|
||||||
|
menu->addSeparator();
|
||||||
|
a = actionCut = new QAction(QIcon(":/images/textedit/editcut.png"), tr("Cu&t"), this);
|
||||||
|
a->setShortcut(QKeySequence::Cut);
|
||||||
|
menu->addAction(a);
|
||||||
|
a = actionCopy = new QAction(QIcon(":/images/textedit/editcopy.png"), tr("&Copy"), this);
|
||||||
|
a->setShortcut(QKeySequence::Copy);
|
||||||
|
menu->addAction(a);
|
||||||
|
a = actionPaste = new QAction(QIcon(":/images/textedit/editpaste.png"), tr("&Paste"), this);
|
||||||
|
a->setShortcut(QKeySequence::Paste);
|
||||||
|
menu->addAction(a);
|
||||||
|
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateForumMsg::setupViewActions()
|
||||||
|
{
|
||||||
|
QMenu *menu = new QMenu(tr("&View"), this);
|
||||||
|
menuBar()->addMenu(menu);
|
||||||
|
|
||||||
|
QAction *a;
|
||||||
|
|
||||||
|
a = new QAction(QIcon(""), tr("&Contacts Sidebar"), this);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(toggleContacts()));
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateForumMsg::setupInsertActions()
|
||||||
|
{
|
||||||
|
QMenu *menu = new QMenu(tr("&Insert"), this);
|
||||||
|
menuBar()->addMenu(menu);
|
||||||
|
|
||||||
|
QAction *a;
|
||||||
|
|
||||||
|
a = new QAction(QIcon(""), tr("&Image"), this);
|
||||||
|
connect(a, SIGNAL(triggered()), this, SLOT(addImage()));
|
||||||
|
menu->addAction(a);
|
||||||
|
|
||||||
|
}
|
|
@ -24,6 +24,7 @@
|
||||||
#define _CREATE_FORUM_MSG_DIALOG_H
|
#define _CREATE_FORUM_MSG_DIALOG_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QMainWindow>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "ui_CreateForumMsg.h"
|
#include "ui_CreateForumMsg.h"
|
||||||
|
@ -39,15 +40,19 @@ class CreateForumMsg : public QMainWindow
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CreateForumMsg(std::string fId, std::string pId);
|
CreateForumMsg(std::string fId, std::string pId, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||||
|
|
||||||
void newMsg(); /* cleanup */
|
void newMsg(); /* cleanup */
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
void createMsg();
|
||||||
|
void cancelMsg();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
/* actions to take.... */
|
/* actions to take.... */
|
||||||
void createMsg();
|
|
||||||
void cancelMsg();
|
|
||||||
|
|
||||||
void fileNew();
|
void fileNew();
|
||||||
void fileOpen();
|
void fileOpen();
|
||||||
|
@ -77,6 +82,12 @@ private:
|
||||||
std::string mForumId;
|
std::string mForumId;
|
||||||
std::string mParentId;
|
std::string mParentId;
|
||||||
|
|
||||||
|
void setTextColor(const QColor& col) ;
|
||||||
|
void setupFileActions();
|
||||||
|
void setupEditActions();
|
||||||
|
void setupViewActions();
|
||||||
|
void setupInsertActions();
|
||||||
|
|
||||||
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
||||||
void fontChanged(const QFont &f);
|
void fontChanged(const QFont &f);
|
||||||
void colorChanged(const QColor &c);
|
void colorChanged(const QColor &c);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue