Added a View and Insert File Menu

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@424 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-03-26 19:30:34 +00:00
parent 8d3f9a3ec6
commit 8133109c30
2 changed files with 39 additions and 3 deletions

View File

@ -63,6 +63,8 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
setupFileActions();
setupEditActions();
setupViewActions();
setupInsertActions();
RshareSettings config;
config.loadWidgetInformation(this);
@ -80,6 +82,7 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
connect(ui.italicbtn, SIGNAL(clicked()), this, SLOT(textItalic()));
connect(ui.colorbtn, SIGNAL(clicked()), this, SLOT(textColor()));
connect(ui.imagebtn, SIGNAL(clicked()), this, SLOT(addImage()));
//connect(ui.linkbtn, SIGNAL(clicked()), this, SLOT(insertLink()));
connect(ui.actionContactsView, SIGNAL(triggered()), this, SLOT(toggleContacts()));
connect(ui.actionSaveas, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
@ -686,6 +689,32 @@ void ChanMsgDialog::setupEditActions()
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
}
void ChanMsgDialog::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 ChanMsgDialog::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);
}
void ChanMsgDialog::textBold()
{
QTextCharFormat fmt;
@ -1020,3 +1049,5 @@ void ChanMsgDialog::Create_New_Image_Tag( const QString urlremoteorlocal )
//}
}

View File

@ -28,7 +28,6 @@
#include <QPointer>
#include <config/rsharesettings.h>
#include "ui_ChanMsgDialog.h"
class QAction;
@ -89,8 +88,7 @@ private slots:
void fileOpen();
bool fileSave();
bool fileSaveAs();
void filePrint();
void filePrint();
//void filePrintPreview();
void filePrintPdf();
@ -113,6 +111,9 @@ private slots:
private:
void setupFileActions();
void setupEditActions();
void setupViewActions();
void setupInsertActions();
bool load(const QString &f);
bool maybeSave();
//bool image_extension( QString nametomake );
@ -145,6 +146,10 @@ private:
QString fileName;
QString nametomake;
QHash<QString, QString> autoLinkDictionary;
QHash<QString, QString> autoLinkTitleDictionary;
QHash<QString, int> autoLinkTargetDictionary;
bool mIsMsg; /* different behaviour for Msg or ChanMsg */