little improvements for Compose Messsage,

added Blockquote,Increase font size,Decrease font size,text font to code style Buttons
added when reply to a message set TextCursor to End.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2123 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-25 14:03:38 +00:00
parent c86196e8fa
commit 6cb925016a
15 changed files with 634 additions and 1092 deletions

View File

@ -193,7 +193,7 @@ HEADERS += rshare.h \
gui/connect/ConnectDialog.h \
gui/connect/ConfCertDialog.h \
gui/msgs/ChanMsgDialog.h \
gui/msgs/ChanCreateDialog.h \
gui/msgs/textformat.h \
gui/images/retroshare_win.rc.h \
gui/settings/rsharesettings.h \
gui/settings/rsettings.h \
@ -279,7 +279,6 @@ FORMS += gui/StartDialog.ui \
gui/connect/ConnectDialog.ui \
gui/connect/ConfCertDialog.ui \
gui/msgs/ChanMsgDialog.ui \
gui/msgs/ChanCreateDialog.ui \
gui/toaster/CallToaster.ui \
gui/toaster/ChatToaster.ui \
gui/toaster/MessageToaster.ui \
@ -375,7 +374,6 @@ SOURCES += main.cpp \
gui/connect/ConnectDialog.cpp \
gui/connect/ConfCertDialog.cpp \
gui/msgs/ChanMsgDialog.cpp \
gui/msgs/ChanCreateDialog.cpp \
gui/common/vmessagebox.cpp \
gui/common/rwindow.cpp \
gui/common/html.cpp \

View File

@ -223,6 +223,8 @@
<file>images/kalarm.png</file>
<file>images/kbackgammon.png</file>
<file>images/kblogger.png</file>
<file>images/hi48-app-kblogger.png</file>
<file>images/hi64-app-kblogger.png</file>
<file>images/kcmsystem24.png</file>
<file>images/kdmconfig.png</file>
<file>images/konsole.png</file>
@ -360,6 +362,10 @@
<file>images/textedit/filesave.png</file>
<file>images/textedit/zoomin.png</file>
<file>images/textedit/zoomout.png</file>
<file>images/textedit/format_font_size_more.png</file>
<file>images/textedit/format_font_size_less.png</file>
<file>images/textedit/hi22-action-format-text-blockquote.png</file>
<file>images/textedit/hi22-action-format-text-code.png</file>
<file>images/toaster/chat.png</file>
<file>images/toaster/hangup.png</file>
<file>images/toaster/pickup.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,73 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006, crypton
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "rshare.h"
#include "ChanCreateDialog.h"
#include "rsiface/rsiface.h"
#include <sstream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
/** Constructor */
ChanCreateDialog::ChanCreateDialog(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
// connect up the buttons.
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelChan( ) ) );
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createChan( ) ) );
setFixedSize(QSize(392, 167));
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
void ChanCreateDialog::newChan()
{
/* clear all */
}
void ChanCreateDialog::createChan()
{
hide();
return;
}
void ChanCreateDialog::cancelChan()
{
hide();
return;
}

View File

@ -1,57 +0,0 @@
/****************************************************************
* RShare is distributed under the following license:
*
* Copyright (C) 2006, crypton
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _CHAN_CREATE_DIALOG_H
#define _CHAN_CREATE_DIALOG_H
#include <QMainWindow>
//#include <config/rsharesettings.h>
#include "ui_ChanCreateDialog.h"
class ChanCreateDialog : public QMainWindow
{
Q_OBJECT
public:
/** Default Constructor */
ChanCreateDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default Destructor */
void newChan(); /* cleanup */
private slots:
/* actions to take.... */
void createChan();
void cancelChan();
private:
/** Qt Designer generated object */
Ui::ChanCreateDialog ui;
};
#endif

View File

@ -1,662 +0,0 @@
<ui version="4.0" >
<class>ChanCreateDialog</class>
<widget class="QWidget" name="ChanCreateDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>167</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette" >
<palette>
<active>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>192</red>
<green>192</green>
<blue>192</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font" >
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
<property name="windowTitle" >
<string>Create a new Broadcast Channel</string>
</property>
<property name="windowIcon" >
<iconset/>
</property>
<widget class="QLabel" name="label_2" >
<property name="geometry" >
<rect>
<x>10</x>
<y>0</y>
<width>391</width>
<height>31</height>
</rect>
</property>
<property name="font" >
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Create A New Broadcast Channel</string>
</property>
</widget>
<widget class="QFrame" name="frame" >
<property name="geometry" >
<rect>
<x>0</x>
<y>20</y>
<width>401</width>
<height>151</height>
</rect>
</property>
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<widget class="QLabel" name="label_3" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>101</width>
<height>23</height>
</rect>
</property>
<property name="font" >
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Channel Name:</string>
</property>
</widget>
<widget class="QLabel" name="label_4" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>41</width>
<height>23</height>
</rect>
</property>
<property name="font" >
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Type:</string>
</property>
</widget>
<widget class="QLineEdit" name="channelName" >
<property name="geometry" >
<rect>
<x>120</x>
<y>20</y>
<width>261</width>
<height>23</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="cancelButton" >
<property name="geometry" >
<rect>
<x>150</x>
<y>110</y>
<width>111</width>
<height>26</height>
</rect>
</property>
<property name="text" >
<string>Cancel Channel</string>
</property>
</widget>
<widget class="QPushButton" name="createButton" >
<property name="geometry" >
<rect>
<x>270</x>
<y>110</y>
<width>111</width>
<height>26</height>
</rect>
</property>
<property name="text" >
<string>Create Channel</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
<widget class="QRadioButton" name="publicButton" >
<property name="geometry" >
<rect>
<x>120</x>
<y>50</y>
<width>271</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>Public Channel (Signed)</string>
</property>
</widget>
<widget class="QRadioButton" name="privateButton" >
<property name="geometry" >
<rect>
<x>120</x>
<y>70</y>
<width>271</width>
<height>23</height>
</rect>
</property>
<property name="text" >
<string>Private Channel (Encrypted)</string>
</property>
</widget>
</widget>
</widget>
<tabstops>
<tabstop>channelName</tabstop>
<tabstop>publicButton</tabstop>
<tabstop>privateButton</tabstop>
<tabstop>cancelButton</tabstop>
<tabstop>createButton</tabstop>
</tabstops>
<resources>
<include location="../images.qrc" />
</resources>
<connections/>
</ui>

View File

@ -28,7 +28,7 @@
#include <gui/settings/rsharesettings.h>
#include "gui/feeds/AttachFileItem.h"
#include "textformat.h"
#include "util/misc.h"
#include <sstream>
@ -49,6 +49,7 @@
#include <QPrintDialog>
#include <QPrinter>
#include <QHeaderView>
#include <QTextCharFormat>
#include <QTextCodec>
#include <QTextEdit>
#include <QTextCursor>
@ -61,38 +62,40 @@
ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
: mIsMsg(msg), QMainWindow(parent, flags), mCheckAttachment(true)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
setupFileActions();
setupEditActions();
setupViewActions();
setupInsertActions();
setupFileActions();
setupEditActions();
setupViewActions();
setupInsertActions();
RshareSettings config;
config.loadWidgetInformation(this);
RshareSettings config;
config.loadWidgetInformation(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setAttribute ( Qt::WA_DeleteOnClose, true );
// connect up the buttons.
connect( ui.actionSend, SIGNAL( triggered (bool)), this, SLOT( sendMessage( ) ) );
//connect( ui.actionReply, SIGNAL( triggered (bool)), this, SLOT( replyMessage( ) ) );
connect(ui.boldbtn, SIGNAL(clicked()), this, SLOT(textBold()));
connect(ui.underlinebtn, SIGNAL(clicked()), this, SLOT(textUnderline()));
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()));
connect(ui.actionAttach, SIGNAL(triggered()), this, SLOT(attachFile()));
//connect( ui.channelstreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( channelstreeViewCostumPopupMenu( QPoint ) ) );
//
// connect up the buttons.
connect( ui.actionSend, SIGNAL( triggered (bool)), this, SLOT( sendMessage( ) ) );
//connect( ui.actionReply, SIGNAL( triggered (bool)), this, SLOT( replyMessage( ) ) );
connect(ui.boldbtn, SIGNAL(clicked()), this, SLOT(textBold()));
connect(ui.underlinebtn, SIGNAL(clicked()), this, SLOT(textUnderline()));
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()));
connect(ui.actionAttach, SIGNAL(triggered()), this, SLOT(attachFile()));
connect(ui.sizeincreaseButton, SIGNAL (clicked()), this, SLOT (fontSizeIncrease()));
connect(ui.sizedecreaseButton, SIGNAL (clicked()), this, SLOT (fontSizeDecrease()));
connect(ui.blockquoteButton, SIGNAL (clicked()), this, SLOT (blockQuote()));
connect(ui.codeButton, SIGNAL (clicked()), this, SLOT (toggleCode()));
connect(ui.msgText, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
connect(ui.msgText, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
this, SLOT(currentCharFormatChanged(const QTextCharFormat &)));
connect(ui.msgText, SIGNAL(cursorPositionChanged()),
connect(ui.msgText, SIGNAL(cursorPositionChanged()),
this, SLOT(cursorPositionChanged()));
connect(ui.msgText->document(), SIGNAL(modificationChanged(bool)),
@ -124,27 +127,27 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
/* if Msg */
if (mIsMsg)
{
connect(ui.msgSendList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) ));
}
else
{
connect(ui.msgSendList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(toggleChannelItem( QTreeWidgetItem *, int ) ));
}
/* if Msg */
if (mIsMsg)
{
connect(ui.msgSendList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) ));
}
else
{
connect(ui.msgSendList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(toggleChannelItem( QTreeWidgetItem *, int ) ));
}
connect(ui.msgFileList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(toggleRecommendItem( QTreeWidgetItem *, int ) ));
connect(ui.msgFileList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(toggleRecommendItem( QTreeWidgetItem *, int ) ));
/* hide the Tree +/- */
ui.msgSendList -> setRootIsDecorated( false );
ui.msgFileList -> setRootIsDecorated( false );
/* hide the Tree +/- */
ui.msgSendList -> setRootIsDecorated( false );
ui.msgFileList -> setRootIsDecorated( false );
/* to hide the header */
//ui.msgSendList->header()->hide();
/* to hide the header */
//ui.msgSendList->header()->hide();
QActionGroup *grp = new QActionGroup(this);
connect(grp, SIGNAL(triggered(QAction *)), this, SLOT(textAlign(QAction *)));
@ -182,19 +185,7 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
connect(ui.comboSize, SIGNAL(activated(const QString &)),this, SLOT(textSize(const QString &)));
ui.comboSize->setCurrentIndex(ui.comboSize->findText(QString::number(QApplication::font().pointSize())));
ui.boldbtn->setIcon(QIcon(QString(":/images/textedit/textbold.png")));
ui.underlinebtn->setIcon(QIcon(QString(":/images/textedit/textunder.png")));
ui.italicbtn->setIcon(QIcon(QString(":/images/textedit/textitalic.png")));
ui.textalignmentbtn->setIcon(QIcon(QString(":/images/textedit/textcenter.png")));
ui.imagebtn->setIcon(QIcon(QString(":/images/lphoto24.png")));
ui.actionContactsView->setIcon(QIcon(":/images/contacts24.png"));
ui.actionSaveas->setIcon(QIcon(":/images/save24.png"));
/* ToolTips */
ui.actionSend->setStatusTip(tr("Send this message now"));
ui.actionContactsView->setStatusTip(tr("Toggle Contacts View"));
ui.actionSaveas->setStatusTip(tr("Save this message"));
ui.textalignmentbtn->setIcon(QIcon(QString(":/images/textedit/textcenter.png")));
QMenu * alignmentmenu = new QMenu();
alignmentmenu->addAction(actionAlignLeft);
@ -217,6 +208,9 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
_smheader->resizeSection ( 2, 60 );
_smheader->resizeSection ( 3, 220 );
_smheader->resizeSection ( 4, 10 );
QPalette palette = QApplication::palette();
codeBackground = palette.color( QPalette::Active, QPalette::Midlight );
/* Hide platform specific features */
@ -225,26 +219,6 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags)
#endif
}
void ChanMsgDialog::channelstreeViewCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
deletechannelAct = new QAction( tr( "Delete Channel" ), this );
connect( deletechannelAct , SIGNAL( triggered() ), this, SLOT( deletechannel() ) );
createchannelmsgAct = new QAction( tr( "Create Channel MSG" ), this );
connect( createchannelmsgAct , SIGNAL( triggered() ), this, SLOT( createchannelmsg() ) );
contextMnu.clear();
contextMnu.addAction( deletechannelAct);
contextMnu.addAction( createchannelmsgAct);
contextMnu.exec( mevent->globalPos() );
}
void ChanMsgDialog::closeEvent (QCloseEvent * event)
{
//=== uncheck all repecient's boxes =======
@ -278,21 +252,6 @@ void ChanMsgDialog::closeEvent (QCloseEvent * event)
}
void ChanMsgDialog::deletechannel()
{
}
void ChanMsgDialog::createchannelmsg()
{
}
void ChanMsgDialog::insertSendList()
{
if (!rsPeers)
@ -525,6 +484,12 @@ void ChanMsgDialog::insertPastedText(std::string msg)
msg.replace(i,1,std::string("\n<BR/>> ")) ;
ui.msgText->setHtml(QString("<HTML><font color=\"blue\">")+QString::fromStdString(std::string("> ") + msg)+"</font><br/><br/></HTML>") ;
ui.msgText->setFocus( Qt::OtherFocusReason );
QTextCursor c = ui.msgText->textCursor();
c.movePosition(QTextCursor::End);
ui.msgText->setTextCursor(c);
}
void ChanMsgDialog::insertForwardPastedText(std::string msg)
@ -534,16 +499,29 @@ void ChanMsgDialog::insertForwardPastedText(std::string msg)
msg.replace(i,1,std::string("\n<BR/>> ")) ;
ui.msgText->setHtml(QString("<HTML><blockquote ><font color=\"blue\">")+QString::fromStdString(std::string("") + msg)+"</font><br/><br/></blockquote></HTML>") ;
ui.msgText->setFocus( Qt::OtherFocusReason );
QTextCursor c = ui.msgText->textCursor();
c.movePosition(QTextCursor::End);
ui.msgText->setTextCursor(c);
}
void ChanMsgDialog::insertMsgText(std::string msg)
{
ui.msgText->setText(QString::fromStdString(msg));
ui.msgText->setFocus( Qt::OtherFocusReason );
QTextCursor c = ui.msgText->textCursor();
c.movePosition(QTextCursor::End);
ui.msgText->setTextCursor(c);
}
void ChanMsgDialog::insertHtmlText(std::string msg)
{
ui.msgText->setHtml(QString("<a href='") + QString::fromStdString(std::string(msg + "'> ") ) + QString::fromStdString(std::string(msg)) + "</a>") ;
}
@ -992,14 +970,6 @@ void ChanMsgDialog::filePrint()
#endif
}
/*void TextEdit::filePrintPreview()
{
PrintPreview *preview = new PrintPreview(textEdit->document(), this);
preview->setWindowModality(Qt::WindowModal);
preview->setAttribute(Qt::WA_DeleteOnClose);
preview->show();
}*/
void ChanMsgDialog::filePrintPdf()
{
#ifndef QT_NO_PRINTER
@ -1101,6 +1071,76 @@ void ChanMsgDialog::Create_New_Image_Tag( const QString urlremoteorlocal )
//}
}
void ChanMsgDialog::fontSizeIncrease()
{
if ( !( ui.msgText->textCursor().blockFormat().hasProperty( TextFormat::HtmlHeading ) &&
ui.msgText->textCursor().blockFormat().intProperty( TextFormat::HtmlHeading ) ) ) {
QTextCharFormat format;
int idx = ui.msgText->currentCharFormat().intProperty( QTextFormat::FontSizeAdjustment );
if ( idx < 3 ) {
format.setProperty( QTextFormat::FontSizeAdjustment, QVariant( ++idx ) );
ui.msgText->textCursor().mergeCharFormat( format );
}
}
ui.msgText->setFocus( Qt::OtherFocusReason );
}
void ChanMsgDialog::fontSizeDecrease()
{
if ( !( ui.msgText->textCursor().blockFormat().hasProperty( TextFormat::HtmlHeading ) &&
ui.msgText->textCursor().blockFormat().intProperty( TextFormat::HtmlHeading ) ) ) {
QTextCharFormat format;
int idx = ui.msgText->currentCharFormat().intProperty( QTextFormat::FontSizeAdjustment );
if ( idx > -1 ) {
format.setProperty( QTextFormat::FontSizeAdjustment, QVariant( --idx ) );
ui.msgText->textCursor().mergeCharFormat( format );
}
}
ui.msgText->setFocus( Qt::OtherFocusReason );
}
void ChanMsgDialog::blockQuote()
{
QTextBlockFormat blockFormat = ui.msgText->textCursor().blockFormat();
QTextBlockFormat f;
if ( blockFormat.hasProperty( TextFormat::IsBlockQuote ) &&
blockFormat.boolProperty( TextFormat::IsBlockQuote ) ) {
f.setProperty( TextFormat::IsBlockQuote, QVariant( false ) );
f.setLeftMargin( 0 );
f.setRightMargin( 0 );
} else {
f.setProperty( TextFormat::IsBlockQuote, QVariant( true ) );
f.setLeftMargin( 40 );
f.setRightMargin( 40 );
}
ui.msgText->textCursor().mergeBlockFormat( f );
}
void ChanMsgDialog::toggleCode()
{
static QString preFontFamily;
QTextCharFormat charFormat = ui.msgText->currentCharFormat();
QTextCharFormat f;
if ( charFormat.hasProperty( TextFormat::HasCodeStyle ) &&
charFormat.boolProperty( TextFormat::HasCodeStyle ) ) {
f.setProperty( TextFormat::HasCodeStyle, QVariant( false ) );
f.setBackground( defaultCharFormat.background() );
f.setFontFamily( preFontFamily );
ui.msgText->textCursor().mergeCharFormat( f );
} else {
preFontFamily = ui.msgText->fontFamily();
f.setProperty( TextFormat::HasCodeStyle, QVariant( true ) );
f.setBackground( codeBackground );
f.setFontFamily( "Dejavu Sans Mono" );
ui.msgText->textCursor().mergeCharFormat( f );
}
ui.msgText->setFocus( Qt::OtherFocusReason );
}
void ChanMsgDialog::attachFile()
{
// select a file
@ -1178,6 +1218,8 @@ void ChanMsgDialog::fileHashingFinished(AttachFileItem* file) {
}
ui.msgText->setHtml(QString::fromStdWString(message));
ui.msgText->setFocus( Qt::OtherFocusReason );
}

View File

@ -48,39 +48,32 @@ public:
ChanMsgDialog(bool isMsg, QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default Destructor */
void newMsg();
void newMsg();
/* worker fns */
void insertSendList(); /* for Msgs */
void insertChannelSendList(); /* for Channels */
void insertFileList(const std::list<DirDetails>&); /* for Both */
void insertTitleText(std::string title);
void insertPastedText(std::string msg) ;
void insertForwardPastedText(std::string msg);
void insertHtmlText(std::string msg);
void insertMsgText(std::string msg);
void addRecipient(std::string id) ;
void Create_New_Image_Tag( const QString urlremoteorlocal );
void insertSendList(); /* for Msgs */
void insertChannelSendList(); /* for Channels */
void insertFileList(const std::list<DirDetails>&); /* for Both */
void insertTitleText(std::string title);
void insertPastedText(std::string msg) ;
void insertForwardPastedText(std::string msg);
void insertHtmlText(std::string msg);
void insertMsgText(std::string msg);
void addRecipient(std::string id) ;
void Create_New_Image_Tag( const QString urlremoteorlocal );
QSettings setter;
public slots:
/* actions to take.... */
void sendMessage();
void cancelMessage();
void addImage();
void sendMessage();
void cancelMessage();
void addImage();
protected:
void closeEvent (QCloseEvent * event);
private slots:
/** Create the context popup menu and it's submenus */
void channelstreeViewCostumPopupMenu( QPoint point );
/** Defines the context menu functions*/
void deletechannel();
void createchannelmsg();
/* toggle Contacts DockWidget */
void toggleContacts();
@ -119,7 +112,12 @@ private slots:
void addAttachment(std::string);
void checkAttachmentReady();
void fontSizeIncrease();
void fontSizeDecrease();
void blockQuote();
void toggleCode();
private:
void setTextColor(const QColor& col) ;
void setupFileActions();
@ -160,6 +158,9 @@ private:
QString fileName;
QString nametomake;
QColor codeBackground;
QTextCharFormat defaultCharFormat;
QHash<QString, QString> autoLinkDictionary;
QHash<QString, QString> autoLinkTitleDictionary;
QHash<QString, int> autoLinkTargetDictionary;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>770</width>
<width>874</width>
<height>528</height>
</rect>
</property>
@ -20,9 +20,13 @@
<iconset resource="../images.qrc">
<normaloff>:/images/folder-draft.png</normaloff>:/images/folder-draft.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">QToolBar#toolBar{background-image: url(:/images/connect/connectFriendBanner.png)}
</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QSplitter" name="splitter_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -101,7 +105,10 @@
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="messagelayout">
<layout class="QGridLayout" name="gridLayout_2">
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout">
<property name="spacing">
@ -130,175 +137,374 @@
</layout>
</item>
<item row="1" column="0">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="comboStyle"/>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="comboFont"/>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboSize">
<property name="toolTip">
<string>Font size</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="boldbtn">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Bold</string>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="underlinebtn">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Underline</string>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="italicbtn">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Italic</string>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QPushButton" name="colorbtn">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Color</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QPushButton" name="textalignmentbtn">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Alignment</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="11">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="8">
<widget class="QPushButton" name="imagebtn">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Add a Image</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
<widget class="QFrame" name="frame">
<property name="styleSheet">
<string notr="true">QFrame#frame{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="comboStyle"/>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="comboFont"/>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboSize">
<property name="maximumSize">
<size>
<width>45</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Font size</string>
</property>
</widget>
</item>
<item row="0" column="15">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="blockquoteButton">
<property name="toolTip">
<string>Blockquote</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/hi22-action-format-text-blockquote.png</normaloff>:/images/textedit/hi22-action-format-text-blockquote.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="sizeincreaseButton">
<property name="maximumSize">
<size>
<width>1677</width>
<height>1677</height>
</size>
</property>
<property name="toolTip">
<string>Increase font size</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/format_font_size_less.png</normaloff>:/images/textedit/format_font_size_less.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QToolButton" name="sizedecreaseButton">
<property name="maximumSize">
<size>
<width>167</width>
<height>167</height>
</size>
</property>
<property name="toolTip">
<string>Decrease font size</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/format_font_size_more.png</normaloff>:/images/textedit/format_font_size_more.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QToolButton" name="boldbtn">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1677</width>
<height>1677</height>
</size>
</property>
<property name="toolTip">
<string>Bold</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/textbold.png</normaloff>:/images/textedit/textbold.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QToolButton" name="underlinebtn">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>167</height>
</size>
</property>
<property name="toolTip">
<string>Underline</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/textunder.png</normaloff>:/images/textedit/textunder.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QToolButton" name="italicbtn">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>167</height>
</size>
</property>
<property name="toolTip">
<string>Italic</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/textitalic.png</normaloff>:/images/textedit/textitalic.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="QToolButton" name="colorbtn">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>167</height>
</size>
</property>
<property name="toolTip">
<string>Select Color</string>
</property>
<property name="text">
<string/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="11">
<widget class="QToolButton" name="textalignmentbtn">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>167</height>
</size>
</property>
<property name="toolTip">
<string>Alignment</string>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="12">
<widget class="QToolButton" name="imagebtn">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>167</height>
</size>
</property>
<property name="toolTip">
<string>Add a Image</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QToolButton" name="codeButton">
<property name="toolTip">
<string>Sets text font to code style</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/textedit/hi22-action-format-text-code.png</normaloff>:/images/textedit/hi22-action-format-text-code.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QTextEdit" name="msgText">
@ -391,7 +597,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>770</width>
<width>874</width>
<height>21</height>
</rect>
</property>
@ -430,6 +636,9 @@
<property name="text">
<string>Send</string>
</property>
<property name="toolTip">
<string>Send this message now</string>
</property>
</action>
<action name="actionReply">
<property name="icon">
@ -441,14 +650,28 @@
</property>
</action>
<action name="actionContactsView">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/contacts24.png</normaloff>:/images/contacts24.png</iconset>
</property>
<property name="text">
<string>Contacts</string>
</property>
<property name="toolTip">
<string>Toggle Contacts View</string>
</property>
</action>
<action name="actionSaveas">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/save24.png</normaloff>:/images/save24.png</iconset>
</property>
<property name="text">
<string>Save</string>
</property>
<property name="toolTip">
<string>Save this message</string>
</property>
</action>
<action name="actionAttach">
<property name="icon">

View File

@ -0,0 +1,64 @@
/***************************************************************************
* This file is distributed under the following license: *
* Copyright (c) 2006-2010 RetroShare Team *
* Copyright (C) 2008-2009 Mehrdad Momeny <mehrdad.momeny@gmail.com> *
* Copyright (C) 2008-2009 Golnaz Nilieh <g382nilieh@gmail.com> *
* *
* It is a modified version of "bilbotextformat.h", which was part *
* of the Bilbo Blogger. It has been customized for *
* use in RetroShare, at January 2010. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef TEXTFORMAT_H
#define TEXTFORMAT_H
#include <QTextFormat>
/**
* Adds some textformat attributes which don't exist in QTextFormat class.
* this class may be removed in future, if all editor related staff be ordered as a lib.
*
@author Mehrdad Momeny <mehrdad.momeny@gmail.com>
@author Golnaz Nilieh <g382nilieh@gmail.com>
*/
// class TextCharFormat : public QTextCharFormat
class TextFormat
{
public:
enum Property {
/// Anchor properties
AnchorTitle = 0x100010,
AnchorTarget = 0x100011,
/// Image properties
ImageTitle = 0x100020,
ImageAlternateText = 0x100021,
HasCodeStyle = 0x100030,
/// Block Properties
HtmlHeading = 0x100040, //zero if block is not in heading format, 1 for Heading 1, and so on.
IsBlockQuote = 0x100041,
IsHtmlTagSign = 0x100042,
};
};
#endif