[qet] [2081] Add the HTML Editor ! |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2081
Author: cfdev
Date: 2013-04-01 15:49:34 +0200 (Mon, 01 Apr 2013)
Log Message:
-----------
Add the HTML Editor !
Modified Paths:
--------------
trunk/qelectrotech.pro
trunk/sources/diagramtextitem.cpp
trunk/sources/diagramtextitem.h
trunk/sources/diagramview.cpp
trunk/sources/diagramview.h
trunk/sources/qetdiagrameditor.cpp
trunk/sources/qetdiagrameditor.h
Added Paths:
-----------
trunk/sources/htmleditor/
trunk/sources/htmleditor/highlighter.cpp
trunk/sources/htmleditor/highlighter.h
trunk/sources/htmleditor/htmleditor.cpp
trunk/sources/htmleditor/htmleditor.h
trunk/sources/htmleditor/htmleditor.qrc
trunk/sources/htmleditor/htmleditor.ui
trunk/sources/htmleditor/images/
trunk/sources/htmleditor/images/bulleted-list.png
trunk/sources/htmleditor/images/document-new.png
trunk/sources/htmleditor/images/document-open.png
trunk/sources/htmleditor/images/document-save-as.png
trunk/sources/htmleditor/images/document-save.png
trunk/sources/htmleditor/images/edit-copy.png
trunk/sources/htmleditor/images/edit-cut.png
trunk/sources/htmleditor/images/edit-paste.png
trunk/sources/htmleditor/images/edit-redo.png
trunk/sources/htmleditor/images/edit-select-all.png
trunk/sources/htmleditor/images/edit-undo.png
trunk/sources/htmleditor/images/format-indent-less.png
trunk/sources/htmleditor/images/format-indent-more.png
trunk/sources/htmleditor/images/format-justify-center.png
trunk/sources/htmleditor/images/format-justify-fill.png
trunk/sources/htmleditor/images/format-justify-left.png
trunk/sources/htmleditor/images/format-justify-right.png
trunk/sources/htmleditor/images/format-text-bold.png
trunk/sources/htmleditor/images/format-text-italic.png
trunk/sources/htmleditor/images/format-text-strikethrough.png
trunk/sources/htmleditor/images/format-text-underline.png
trunk/sources/htmleditor/images/image-x-generic.png
trunk/sources/htmleditor/images/insert-html.png
trunk/sources/htmleditor/images/list-add.png
trunk/sources/htmleditor/images/list-remove.png
trunk/sources/htmleditor/images/numbered-list.png
trunk/sources/htmleditor/images/text-html.png
trunk/sources/htmleditor/images/text.png
trunk/sources/htmleditor/images/text_color.png
trunk/sources/htmleditor/inserthtmldialog.ui
trunk/sources/htmleditor/qtlogo.png
trunk/sources/ui/
trunk/sources/ui/ui_htmleditor.h
trunk/sources/ui/ui_inserthtmldialog.h
Modified: trunk/qelectrotech.pro
===================================================================
--- trunk/qelectrotech.pro 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/qelectrotech.pro 2013-04-01 13:49:34 UTC (rev 2081)
@@ -63,11 +63,11 @@
INCLUDEPATH += sources sources/editor sources/titleblock
# Fichiers sources
-HEADERS += sources/*.h sources/editor/*.h sources/titleblock/*.h
-SOURCES += sources/*.cpp sources/editor/*.cpp sources/titleblock/*.cpp
+HEADERS += sources/*.h sources/ui/*.h sources/editor/*.h sources/titleblock/*.h sources/htmleditor/*.h
+SOURCES += sources/*.cpp sources/editor/*.cpp sources/titleblock/*.cpp sources/htmleditor/*.cpp
# Liste des fichiers qui seront incorpores au binaire en tant que ressources Qt
-RESOURCES += qelectrotech.qrc
+RESOURCES += qelectrotech.qrc sources/htmleditor/htmleditor.qrc
# Liste des ressources Windows
RC_FILE = ico/windows_icon/qelectrotech.rc
@@ -76,8 +76,13 @@
TRANSLATIONS += lang/qet_en.ts lang/qet_es.ts lang/qet_fr.ts lang/qet_ru.ts lang/qet_pt.ts lang/qet_cs.ts lang/qet_pl.ts lang/qet_de.ts lang/qet_ro.ts lang/qet_it.ts
# Modules Qt utilises par l'application
-QT += xml svg network sql
+QT += xml svg network sql webkit
+# UI DESIGNER FILES AND GENERATION SOURCES FILES
+FORMS = sources/htmleditor/htmleditor.ui sources/htmleditor/inserthtmldialog.ui
+UI_SOURCES_DIR = sources/ui/
+UI_HEADERS_DIR = sources/ui/
+
# Configuration de la compilation
CONFIG += debug_and_release warn_on
Modified: trunk/sources/diagramtextitem.cpp
===================================================================
--- trunk/sources/diagramtextitem.cpp 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/sources/diagramtextitem.cpp 2013-04-01 13:49:34 UTC (rev 2081)
@@ -1,5 +1,5 @@
/*
- Copyright 2006-2012 Xavier Guerrin
+ Copyright 2006-2013 QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
@@ -20,6 +20,7 @@
#include "qet.h"
#include "qetapp.h"
+#include "htmleditor/htmleditor.h"
/**
Constructeur
@param parent Le QGraphicsItem parent du champ de texte
@@ -297,3 +298,29 @@
void DiagramTextItem::setNonFocusable() {
setFlag(QGraphicsTextItem::ItemIsFocusable, false);
}
+
+
+/**
+ * @brief DiagramTextItem::setHtmlText
+ * @param txt
+ */
+void DiagramTextItem::setHtmlText(const QString &txt) {
+ setHtml( txt );
+}
+
+/**
+ * @brief Edit the text with HtmlEditor
+ */
+void DiagramTextItem::edit() {
+ //Open the HtmlEditor
+ HtmlEditor *editor = new HtmlEditor();
+ // connect the in/out
+ connect(editor, SIGNAL(applyEditText(const QString &)), this, SLOT(setHtmlText(const QString &)));
+ // load the Html txt
+ editor->loadHtml( toHtml() );
+ // set the minimum controls
+ editor->setSimpleDisplay(true);
+ // show
+ editor->show();
+}
+
Modified: trunk/sources/diagramtextitem.h
===================================================================
--- trunk/sources/diagramtextitem.h 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/sources/diagramtextitem.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -53,6 +53,7 @@
qreal rotationAngle() const;
void setRotationAngle(const qreal &);
void rotateBy(const qreal &);
+ void edit();
QPointF mapMovementToScene(const QPointF &) const;
QPointF mapMovementFromScene(const QPointF &) const;
QPointF mapMovementToParent(const QPointF &) const;
@@ -73,6 +74,7 @@
public slots:
void setNonFocusable();
+ void setHtmlText(const QString &);
private:
/// Previous text value
Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/sources/diagramview.cpp 2013-04-01 13:49:34 UTC (rev 2081)
@@ -38,6 +38,8 @@
#include "qetmessagebox.h"
#include "qtextorientationspinboxwidget.h"
+#include "htmleditor/htmleditor.h"
+
/**
Constructeur
@param diagram Schema a afficher ; si diagram vaut 0, un nouveau Diagram est utilise
@@ -1133,7 +1135,30 @@
is_adding_text = true;
}
+
/**
+ To edit the text through the htmlEditor
+*/
+void DiagramView::editText() {
+ if (scene -> isReadOnly()) return;
+ // Get text to edit
+ QList<DiagramTextItem *> texts_to_edit;
+ foreach (QGraphicsItem *item, scene -> selectedItems()) {
+ if (ConductorTextItem *cti = qgraphicsitem_cast<ConductorTextItem *>(item)) {
+ texts_to_edit << cti;
+ } else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item)) {
+ texts_to_edit << iti;
+ } else if (ElementTextItem *eti = qgraphicsitem_cast<ElementTextItem *>(item)) {
+ // here...
+ texts_to_edit << eti;
+ }
+ }
+ // Test if any text existe..
+ if (texts_to_edit.isEmpty()) return;
+ else texts_to_edit.at(0)->edit();
+}
+
+/**
Cree un nouveau champ de texte et le place a la position pos
en gerant l'annulation ; enfin, le signal textAdded est emis.
@param pos Position du champ de texte ajoute
Modified: trunk/sources/diagramview.h
===================================================================
--- trunk/sources/diagramview.h 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/sources/diagramview.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -68,6 +68,7 @@
bool hasCopiableItems();
bool hasDeletableItems();
void addText();
+ void editText();
IndependentTextItem *addDiagramTextAtPos(const QPointF &);
protected:
Added: trunk/sources/htmleditor/highlighter.cpp
===================================================================
--- trunk/sources/htmleditor/highlighter.cpp (rev 0)
+++ trunk/sources/htmleditor/highlighter.cpp 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,269 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@xxxxxxxxx)
+**
+** This file is part of the Graphics Dojo project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@xxxxxxxxx.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#include "highlighter.h"
+
+#include <QtGui>
+
+Highlighter::Highlighter(QTextDocument *document)
+ : QSyntaxHighlighter(document)
+{
+ m_colors[DocType] = QColor(192, 192, 192);
+ m_colors[Entity] = QColor(128, 128, 128);
+ m_colors[Tag] = QColor(136, 18, 128);
+ m_colors[Comment] = QColor( 35, 110, 37);
+ m_colors[AttributeName] = QColor(153, 69, 0);
+ m_colors[AttributeValue] = QColor( 36, 36, 170);
+}
+
+void Highlighter::highlightBlock(const QString &text)
+{
+ int state = previousBlockState();
+ int len = text.length();
+ int start = 0;
+ int pos = 0;
+
+ while (pos < len) {
+
+ switch (state) {
+
+ case State_Text:
+ default:
+
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ if (ch == '<') {
+ if (text.mid(pos, 4) == "<!--") {
+ state = State_Comment;
+ } else {
+ if (text.mid(pos, 9).toUpper() == "<!DOCTYPE")
+ state = State_DocType;
+ else
+ state = State_TagStart;
+ }
+ break;
+ } else if (ch == '&') {
+ start = pos;
+ while (pos < len
+ && text.at(pos++) != ';')
+ ;
+ setFormat(start, pos - start, m_colors[Entity]);
+ } else {
+ ++pos;
+ }
+ }
+ break;
+
+
+ case State_Comment:
+ start = pos;
+ while (pos < len) {
+ if (text.mid(pos, 3) == "-->") {
+ pos += 3;
+ state = State_Text;
+ break;
+ } else {
+ ++pos;
+ }
+ }
+ setFormat(start, pos - start, m_colors[Comment]);
+ break;
+
+ case State_DocType:
+ start = pos;
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+ if (ch == '>') {
+ state = State_Text;
+ break;
+ }
+ }
+ setFormat(start, pos - start, m_colors[DocType]);
+ break;
+
+ // at '<' in e.g. "<span>foo</span>"
+ case State_TagStart:
+ start = pos + 1;
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+ if (ch == '>') {
+ state = State_Text;
+ break;
+ }
+ if (!ch.isSpace()) {
+ --pos;
+ state = State_TagName;
+ break;
+ }
+ }
+ break;
+
+ // at 'b' in e.g "<blockquote>foo</blockquote>"
+ case State_TagName:
+ start = pos;
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+ if (ch.isSpace()) {
+ --pos;
+ state = State_InsideTag;
+ break;
+ }
+ if (ch == '>') {
+ state = State_Text;
+ break;
+ }
+ }
+ setFormat(start, pos - start, m_colors[Tag]);
+ break;
+
+ // anywhere after tag name and before tag closing ('>')
+ case State_InsideTag:
+ start = pos;
+
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+
+ if (ch == '/')
+ continue;
+
+ if (ch == '>') {
+ state = State_Text;
+ break;
+ }
+
+ if (!ch.isSpace()) {
+ --pos;
+ state = State_AttributeName;
+ break;
+ }
+
+ }
+
+ break;
+
+ // at 's' in e.g. <img src=bla.png/>
+ case State_AttributeName:
+ start = pos;
+
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+
+ if (ch == '=') {
+ state = State_AttributeValue;
+ break;
+ }
+
+ if (ch == '>' || ch == '/') {
+ state = State_InsideTag;
+ break;
+ }
+ }
+
+ setFormat(start, pos - start, m_colors[AttributeName]);
+ break;
+
+ // after '=' in e.g. <img src=bla.png/>
+ case State_AttributeValue:
+ start = pos;
+
+ // find first non-space character
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+
+ // handle opening single quote
+ if (ch == '\'') {
+ state = State_SingleQuote;
+ break;
+ }
+
+ // handle opening double quote
+ if (ch == '"') {
+ state = State_DoubleQuote;
+ break;
+ }
+
+ if (!ch.isSpace())
+ break;
+ }
+
+ if (state == State_AttributeValue) {
+ // attribute value without quote
+ // just stop at non-space or tag delimiter
+ start = pos;
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ if (ch.isSpace())
+ break;
+ if (ch == '>' || ch == '/')
+ break;
+ ++pos;
+ }
+ state = State_InsideTag;
+ setFormat(start, pos - start, m_colors[AttributeValue]);
+ }
+
+ break;
+
+ // after the opening single quote in an attribute value
+ case State_SingleQuote:
+ start = pos;
+
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+ if (ch == '\'')
+ break;
+ }
+
+ state = State_InsideTag;
+
+ setFormat(start, pos - start, m_colors[AttributeValue]);
+ break;
+
+ // after the opening double quote in an attribute value
+ case State_DoubleQuote:
+ start = pos;
+
+ while (pos < len) {
+ QChar ch = text.at(pos);
+ ++pos;
+ if (ch == '"')
+ break;
+ }
+
+ state = State_InsideTag;
+
+ setFormat(start, pos - start, m_colors[AttributeValue]);
+ break;
+
+ }
+ }
+
+ setCurrentBlockState(state);
+}
Added: trunk/sources/htmleditor/highlighter.h
===================================================================
--- trunk/sources/htmleditor/highlighter.h (rev 0)
+++ trunk/sources/htmleditor/highlighter.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@xxxxxxxxx)
+**
+** This file is part of the Graphics Dojo project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@xxxxxxxxx.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+#ifndef HIGHLIGHTER_H
+#define HIGHLIGHTER_H
+
+#include <QHash>
+#include <QSyntaxHighlighter>
+
+// based on http://doc.trolltech.com/qq/qq21-syntaxhighlighter.html
+
+class Highlighter : public QSyntaxHighlighter
+{
+ Q_OBJECT
+
+public:
+
+ Highlighter(QTextDocument *document);
+
+ enum Construct {
+ DocType,
+ Entity,
+ Tag,
+ Comment,
+ AttributeName,
+ AttributeValue
+ };
+
+protected:
+ enum State {
+ State_Text = -1,
+ State_DocType,
+ State_Comment,
+ State_TagStart,
+ State_TagName,
+ State_InsideTag,
+ State_AttributeName,
+ State_SingleQuote,
+ State_DoubleQuote,
+ State_AttributeValue,
+ };
+
+ void highlightBlock(const QString &text);
+
+private:
+ QHash<int, QColor> m_colors;
+};
+
+
+#endif // HIGHLIGHTER_H
Added: trunk/sources/htmleditor/htmleditor.cpp
===================================================================
--- trunk/sources/htmleditor/htmleditor.cpp (rev 0)
+++ trunk/sources/htmleditor/htmleditor.cpp 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,645 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@xxxxxxxxx)
+**
+** This file is part of the Graphics Dojo project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@xxxxxxxxx.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+/**
+ Integration : QElectroTech Team
+ Changelog:
+ - 26/03/2013 : Start integration...Compilation and object creation are successful
+*/
+
+#include "htmleditor.h"
+#include "highlighter.h"
+
+#include "../ui/ui_htmleditor.h"
+#include "../ui/ui_inserthtmldialog.h"
+
+#include <QtGui>
+#include <QtWebKit>
+
+#define FORWARD_ACTION(action1, action2) \
+ connect(action1, SIGNAL(triggered()), \
+ ui->webView->pageAction(action2), SLOT(trigger())); \
+ connect(ui->webView->pageAction(action2), \
+ SIGNAL(changed()), SLOT(adjustActions()));
+
+
+HtmlEditor::HtmlEditor(QWidget *parent)
+ : QMainWindow(parent)
+ , ui(new Ui_MainWindow)
+ , sourceDirty(true)
+ , highlighter(0)
+ , ui_dialog(0)
+ , insertHtmlDialog(0)
+{
+ ui->setupUi(this);
+ ui->tabWidget->setTabText(0, "Normal View");
+ ui->tabWidget->setTabText(1, "HTML Source");
+ connect(ui->tabWidget, SIGNAL(currentChanged(int)), SLOT(changeTab(int)));
+ resize(600, 600);
+
+ highlighter = new Highlighter(ui->plainTextEdit->document());
+
+ QWidget *spacer = new QWidget(this);
+ spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
+ ui->standardToolBar->insertWidget(ui->actionZoomOut, spacer);
+
+ zoomLabel = new QLabel;
+ ui->standardToolBar->insertWidget(ui->actionZoomOut, zoomLabel);
+
+ zoomSlider = new QSlider(this);
+ zoomSlider->setOrientation(Qt::Horizontal);
+ zoomSlider->setMaximumWidth(150);
+ zoomSlider->setRange(25, 400);
+ zoomSlider->setSingleStep(25);
+ zoomSlider->setPageStep(100);
+ connect(zoomSlider, SIGNAL(valueChanged(int)), SLOT(changeZoom(int)));
+ ui->standardToolBar->insertWidget(ui->actionZoomIn, zoomSlider);
+
+ connect(ui->actionFileNew, SIGNAL(triggered()), SLOT(fileNew()));
+ connect(ui->actionFileOpen, SIGNAL(triggered()), SLOT(fileOpen()));
+ connect(ui->actionFileSave, SIGNAL(triggered()), SLOT(fileSave()));
+ connect(ui->actionFileSaveAs, SIGNAL(triggered()), SLOT(fileSaveAs()));
+ connect(ui->actionExit, SIGNAL(triggered()), SLOT(close()));
+ connect(ui->actionInsertImage, SIGNAL(triggered()), SLOT(insertImage()));
+ connect(ui->actionCreateLink, SIGNAL(triggered()), SLOT(createLink()));
+ connect(ui->actionInsertHtml, SIGNAL(triggered()), SLOT(insertHtml()));
+ connect(ui->actionZoomOut, SIGNAL(triggered()), SLOT(zoomOut()));
+ connect(ui->actionZoomIn, SIGNAL(triggered()), SLOT(zoomIn()));
+
+ // these are forward to internal QWebView
+ FORWARD_ACTION(ui->actionEditUndo, QWebPage::Undo);
+ FORWARD_ACTION(ui->actionEditRedo, QWebPage::Redo);
+ FORWARD_ACTION(ui->actionEditCut, QWebPage::Cut);
+ FORWARD_ACTION(ui->actionEditCopy, QWebPage::Copy);
+ FORWARD_ACTION(ui->actionEditPaste, QWebPage::Paste);
+ FORWARD_ACTION(ui->actionFormatBold, QWebPage::ToggleBold);
+ FORWARD_ACTION(ui->actionFormatItalic, QWebPage::ToggleItalic);
+ FORWARD_ACTION(ui->actionFormatUnderline, QWebPage::ToggleUnderline);
+
+ // Qt 4.5.0 has a bug: always returns 0 for QWebPage::SelectAll
+ connect(ui->actionEditSelectAll, SIGNAL(triggered()), SLOT(editSelectAll()));
+
+ connect(ui->actionStyleParagraph, SIGNAL(triggered()), SLOT(styleParagraph()));
+ connect(ui->actionStyleHeading1, SIGNAL(triggered()), SLOT(styleHeading1()));
+ connect(ui->actionStyleHeading2, SIGNAL(triggered()), SLOT(styleHeading2()));
+ connect(ui->actionStyleHeading3, SIGNAL(triggered()), SLOT(styleHeading3()));
+ connect(ui->actionStyleHeading4, SIGNAL(triggered()), SLOT(styleHeading4()));
+ connect(ui->actionStyleHeading5, SIGNAL(triggered()), SLOT(styleHeading5()));
+ connect(ui->actionStyleHeading6, SIGNAL(triggered()), SLOT(styleHeading6()));
+ connect(ui->actionStylePreformatted, SIGNAL(triggered()), SLOT(stylePreformatted()));
+ connect(ui->actionStyleAddress, SIGNAL(triggered()), SLOT(styleAddress()));
+ connect(ui->actionFormatFontName, SIGNAL(triggered()), SLOT(formatFontName()));
+ connect(ui->actionFormatFontSize, SIGNAL(triggered()), SLOT(formatFontSize()));
+ connect(ui->actionFormatTextColor, SIGNAL(triggered()), SLOT(formatTextColor()));
+ connect(ui->actionFormatBackgroundColor, SIGNAL(triggered()), SLOT(formatBackgroundColor()));
+
+ // no page action exists yet for these, so use execCommand trick
+ connect(ui->actionFormatStrikethrough, SIGNAL(triggered()), SLOT(formatStrikeThrough()));
+ connect(ui->actionFormatAlignLeft, SIGNAL(triggered()), SLOT(formatAlignLeft()));
+ connect(ui->actionFormatAlignCenter, SIGNAL(triggered()), SLOT(formatAlignCenter()));
+ connect(ui->actionFormatAlignRight, SIGNAL(triggered()), SLOT(formatAlignRight()));
+ connect(ui->actionFormatAlignJustify, SIGNAL(triggered()), SLOT(formatAlignJustify()));
+ connect(ui->actionFormatDecreaseIndent, SIGNAL(triggered()), SLOT(formatDecreaseIndent()));
+ connect(ui->actionFormatIncreaseIndent, SIGNAL(triggered()), SLOT(formatIncreaseIndent()));
+ connect(ui->actionFormatNumberedList, SIGNAL(triggered()), SLOT(formatNumberedList()));
+ connect(ui->actionFormatBulletedList, SIGNAL(triggered()), SLOT(formatBulletedList()));
+
+
+ // necessary to sync our actions
+ connect(ui->webView->page(), SIGNAL(selectionChanged()), SLOT(adjustActions()));
+
+ connect(ui->webView->page(), SIGNAL(contentsChanged()), SLOT(adjustSource()));
+ ui->webView->setFocus();
+
+ setCurrentFileName(QString());
+
+ QString initialFile = ":/example.html";
+ const QStringList args = QCoreApplication::arguments();
+ if (args.count() == 2)
+ initialFile = args.at(1);
+
+ if (!load(initialFile))
+ fileNew();
+
+ adjustActions();
+ adjustSource();
+ setWindowModified(false);
+ changeZoom(100);
+}
+
+HtmlEditor::~HtmlEditor()
+{
+ delete ui;
+ delete ui_dialog;
+}
+
+bool HtmlEditor::maybeSave()
+{
+ if (!isWindowModified())
+ return true;
+
+ QMessageBox::StandardButton ret;
+ ret = QMessageBox::warning(this, tr("HTML Editor"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Save | QMessageBox::Discard
+ | QMessageBox::Cancel);
+ if (ret == QMessageBox::Save)
+ return fileSave();
+ else if (ret == QMessageBox::Cancel)
+ return false;
+ return true;
+}
+
+void HtmlEditor::fileNew()
+{
+ if (maybeSave()) {
+ ui->webView->setHtml("<p></p>");
+ ui->webView->setFocus();
+ ui->webView->page()->setContentEditable(true);
+ setCurrentFileName(QString());
+ setWindowModified(false);
+
+ // quirk in QWebView: need an initial mouse click to show the cursor
+ int mx = ui->webView->width() / 2;
+ int my = ui->webView->height() / 2;
+ QPoint center = QPoint(mx, my);
+ QMouseEvent *e1 = new QMouseEvent(QEvent::MouseButtonPress, center,
+ Qt::LeftButton, Qt::LeftButton,
+ Qt::NoModifier);
+ QMouseEvent *e2 = new QMouseEvent(QEvent::MouseButtonRelease, center,
+ Qt::LeftButton, Qt::LeftButton,
+ Qt::NoModifier);
+ QApplication::postEvent(ui->webView, e1);
+ QApplication::postEvent(ui->webView, e2);
+ }
+}
+
+void HtmlEditor::fileOpen()
+{
+ QString fn = QFileDialog::getOpenFileName(this, tr("Open File..."),
+ QString(), tr("HTML-Files (*.htm *.html);;All Files (*)"));
+ if (!fn.isEmpty())
+ load(fn);
+}
+
+bool HtmlEditor::fileSave()
+{
+ if (fileName.isEmpty() || fileName.startsWith(QLatin1String(":/")))
+ return fileSaveAs();
+
+ QFile file(fileName);
+ bool success = file.open(QIODevice::WriteOnly);
+ if (success) {
+ // FIXME: here we always use UTF-8 encoding
+ QString content = ui->webView->page()->mainFrame()->toHtml();
+ QByteArray data = content.toUtf8();
+ qint64 c = file.write(data);
+ success = (c >= data.length());
+ }
+
+ setWindowModified(false);
+ return success;
+}
+
+bool HtmlEditor::fileSaveAs()
+{
+ QString fn = QFileDialog::getSaveFileName(this, tr("Save as..."),
+ QString(), tr("HTML-Files (*.htm *.html);;All Files (*)"));
+ if (fn.isEmpty())
+ return false;
+ if (!(fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)))
+ fn += ".htm"; // default
+ setCurrentFileName(fn);
+ return fileSave();
+}
+
+void HtmlEditor::insertImage()
+{
+ QString filters;
+ filters += tr("Common Graphics (*.png *.jpg *.jpeg *.gif);;");
+ filters += tr("Portable Network Graphics (PNG) (*.png);;");
+ filters += tr("JPEG (*.jpg *.jpeg);;");
+ filters += tr("Graphics Interchange Format (*.gif);;");
+ filters += tr("All Files (*)");
+
+ QString fn = QFileDialog::getOpenFileName(this, tr("Open image..."),
+ QString(), filters);
+ if (fn.isEmpty())
+ return;
+ if (!QFile::exists(fn))
+ return;
+
+ QUrl url = QUrl::fromLocalFile(fn);
+ execCommand("insertImage", url.toString());
+}
+
+// shamelessly copied from Qt Demo Browser
+static QUrl guessUrlFromString(const QString &string)
+{
+ QString urlStr = string.trimmed();
+ QRegExp test(QLatin1String("^[a-zA-Z]+\\:.*"));
+
+ // Check if it looks like a qualified URL. Try parsing it and see.
+ bool hasSchema = test.exactMatch(urlStr);
+ if (hasSchema) {
+ QUrl url(urlStr, QUrl::TolerantMode);
+ if (url.isValid())
+ return url;
+ }
+
+ // Might be a file.
+ if (QFile::exists(urlStr))
+ return QUrl::fromLocalFile(urlStr);
+
+ // Might be a shorturl - try to detect the schema.
+ if (!hasSchema) {
+ int dotIndex = urlStr.indexOf(QLatin1Char('.'));
+ if (dotIndex != -1) {
+ QString prefix = urlStr.left(dotIndex).toLower();
+ QString schema = (prefix == QLatin1String("ftp")) ? prefix : QLatin1String("http");
+ QUrl url(schema + QLatin1String("://") + urlStr, QUrl::TolerantMode);
+ if (url.isValid())
+ return url;
+ }
+ }
+
+ // Fall back to QUrl's own tolerant parser.
+ return QUrl(string, QUrl::TolerantMode);
+}
+
+void HtmlEditor::createLink()
+{
+ QString link = QInputDialog::getText(this, tr("Create link"),
+ "Enter URL");
+ if (!link.isEmpty()) {
+ QUrl url = guessUrlFromString(link);
+ if (url.isValid())
+ execCommand("createLink", url.toString());
+ }
+}
+
+void HtmlEditor::insertHtml()
+{
+ if (!insertHtmlDialog) {
+ insertHtmlDialog = new QDialog(this);
+ if (!ui_dialog)
+ ui_dialog = new Ui_Dialog;
+ ui_dialog->setupUi(insertHtmlDialog);
+ connect(ui_dialog->buttonBox, SIGNAL(accepted()),
+ insertHtmlDialog, SLOT(accept()));
+ connect(ui_dialog->buttonBox, SIGNAL(rejected()),
+ insertHtmlDialog, SLOT(reject()));
+ }
+
+ ui_dialog->plainTextEdit->clear();
+ ui_dialog->plainTextEdit->setFocus();
+ Highlighter *hilite = new Highlighter(ui_dialog->plainTextEdit->document());
+
+ if (insertHtmlDialog->exec() == QDialog::Accepted)
+ execCommand("insertHTML", ui_dialog->plainTextEdit->toPlainText());
+
+ delete hilite;
+}
+
+void HtmlEditor::zoomOut()
+{
+ int percent = static_cast<int>(ui->webView->zoomFactor() * 100);
+ if (percent > 25) {
+ percent -= 25;
+ percent = 25 * (int((percent + 25 - 1) / 25));
+ qreal factor = static_cast<qreal>(percent) / 100;
+ ui->webView->setZoomFactor(factor);
+ ui->actionZoomOut->setEnabled(percent > 25);
+ ui->actionZoomIn->setEnabled(true);
+ zoomSlider->setValue(percent);
+ }
+}
+
+void HtmlEditor::zoomIn()
+{
+ int percent = static_cast<int>(ui->webView->zoomFactor() * 100);
+ if (percent < 400) {
+ percent += 25;
+ percent = 25 * (int(percent / 25));
+ qreal factor = static_cast<qreal>(percent) / 100;
+ ui->webView->setZoomFactor(factor);
+ ui->actionZoomIn->setEnabled(percent < 400);
+ ui->actionZoomOut->setEnabled(true);
+ zoomSlider->setValue(percent);
+ }
+}
+
+void HtmlEditor::editSelectAll()
+{
+ ui->webView->triggerPageAction(QWebPage::SelectAll);
+}
+
+void HtmlEditor::execCommand(const QString &cmd)
+{
+ QWebFrame *frame = ui->webView->page()->mainFrame();
+ QString js = QString("document.execCommand(\"%1\", false, null)").arg(cmd);
+ frame->evaluateJavaScript(js);
+}
+
+void HtmlEditor::execCommand(const QString &cmd, const QString &arg)
+{
+ QWebFrame *frame = ui->webView->page()->mainFrame();
+ QString js = QString("document.execCommand(\"%1\", false, \"%2\")").arg(cmd).arg(arg);
+ frame->evaluateJavaScript(js);
+}
+
+bool HtmlEditor::queryCommandState(const QString &cmd)
+{
+ QWebFrame *frame = ui->webView->page()->mainFrame();
+ QString js = QString("document.queryCommandState(\"%1\", false, null)").arg(cmd);
+ QVariant result = frame->evaluateJavaScript(js);
+ return result.toString().simplified().toLower() == "true";
+}
+
+void HtmlEditor::styleParagraph()
+{
+ execCommand("formatBlock", "p");
+}
+
+void HtmlEditor::styleHeading1()
+{
+ execCommand("formatBlock", "h1");
+}
+
+void HtmlEditor::styleHeading2()
+{
+ execCommand("formatBlock", "h2");
+}
+
+void HtmlEditor::styleHeading3()
+{
+ execCommand("formatBlock", "h3");
+}
+
+void HtmlEditor::styleHeading4()
+{
+ execCommand("formatBlock", "h4");
+}
+
+void HtmlEditor::styleHeading5()
+{
+ execCommand("formatBlock", "h5");
+}
+
+void HtmlEditor::styleHeading6()
+{
+ execCommand("formatBlock", "h6");
+}
+
+void HtmlEditor::stylePreformatted()
+{
+ execCommand("formatBlock", "pre");
+}
+
+void HtmlEditor::styleAddress()
+{
+ execCommand("formatBlock", "address");
+}
+
+void HtmlEditor::formatStrikeThrough()
+{
+ execCommand("strikeThrough");
+}
+
+void HtmlEditor::formatAlignLeft()
+{
+ execCommand("justifyLeft");
+}
+
+void HtmlEditor::formatAlignCenter()
+{
+ execCommand("justifyCenter");
+}
+
+void HtmlEditor::formatAlignRight()
+{
+ execCommand("justifyRight");
+}
+
+void HtmlEditor::formatAlignJustify()
+{
+ execCommand("justifyFull");
+}
+
+void HtmlEditor::formatIncreaseIndent()
+{
+ execCommand("indent");
+}
+
+void HtmlEditor::formatDecreaseIndent()
+{
+ execCommand("outdent");
+}
+
+void HtmlEditor::formatNumberedList()
+{
+ execCommand("insertOrderedList");
+}
+
+void HtmlEditor::formatBulletedList()
+{
+ execCommand("insertUnorderedList");
+}
+
+void HtmlEditor::formatFontName()
+{
+ QStringList families = QFontDatabase().families();
+ bool ok = false;
+ QString family = QInputDialog::getItem(this, tr("Font"), tr("Select font:"),
+ families, 0, false, &ok);
+
+ if (ok)
+ execCommand("fontName", family);
+}
+
+void HtmlEditor::formatFontSize()
+{
+ QStringList sizes;
+ sizes << "xx-small";
+ sizes << "x-small";
+ sizes << "small";
+ sizes << "medium";
+ sizes << "large";
+ sizes << "x-large";
+ sizes << "xx-large";
+
+ bool ok = false;
+ QString size = QInputDialog::getItem(this, tr("Font Size"), tr("Select font size:"),
+ sizes, sizes.indexOf("medium"), false, &ok);
+
+ if (ok)
+ execCommand("fontSize", QString::number(sizes.indexOf(size)));
+}
+
+void HtmlEditor::formatTextColor()
+{
+ QColor color = QColorDialog::getColor(Qt::black, this);
+ if (color.isValid())
+ execCommand("foreColor", color.name());
+}
+
+void HtmlEditor::formatBackgroundColor()
+{
+ QColor color = QColorDialog::getColor(Qt::white, this);
+ if (color.isValid())
+ execCommand("hiliteColor", color.name());
+}
+
+#define FOLLOW_ENABLE(a1, a2) a1->setEnabled(ui->webView->pageAction(a2)->isEnabled())
+#define FOLLOW_CHECK(a1, a2) a1->setChecked(ui->webView->pageAction(a2)->isChecked())
+
+void HtmlEditor::adjustActions()
+{
+ FOLLOW_ENABLE(ui->actionEditUndo, QWebPage::Undo);
+ FOLLOW_ENABLE(ui->actionEditRedo, QWebPage::Redo);
+ FOLLOW_ENABLE(ui->actionEditCut, QWebPage::Cut);
+ FOLLOW_ENABLE(ui->actionEditCopy, QWebPage::Copy);
+ FOLLOW_ENABLE(ui->actionEditPaste, QWebPage::Paste);
+ FOLLOW_CHECK(ui->actionFormatBold, QWebPage::ToggleBold);
+ FOLLOW_CHECK(ui->actionFormatItalic, QWebPage::ToggleItalic);
+ FOLLOW_CHECK(ui->actionFormatUnderline, QWebPage::ToggleUnderline);
+
+ ui->actionFormatStrikethrough->setChecked(queryCommandState("strikeThrough"));
+ ui->actionFormatNumberedList->setChecked(queryCommandState("insertOrderedList"));
+ ui->actionFormatBulletedList->setChecked(queryCommandState("insertUnorderedList"));
+}
+
+void HtmlEditor::adjustSource()
+{
+ setWindowModified(true);
+ sourceDirty = true;
+
+ if (ui->tabWidget->currentIndex() == 1)
+ changeTab(1);
+}
+
+void HtmlEditor::changeTab(int index)
+{
+ if (sourceDirty && (index == 1)) {
+ QString content = ui->webView->page()->mainFrame()->toHtml();
+ ui->plainTextEdit->setPlainText(content);
+ sourceDirty = false;
+ }
+}
+
+void HtmlEditor::openLink(const QUrl &url)
+{
+ QString msg = QString(tr("Open %1 ?")).arg(url.toString());
+ if (QMessageBox::question(this, tr("Open link"), msg,
+ QMessageBox::Open | QMessageBox::Cancel) ==
+ QMessageBox::Open)
+ QDesktopServices::openUrl(url);
+}
+
+void HtmlEditor::changeZoom(int percent)
+{
+ ui->actionZoomOut->setEnabled(percent > 25);
+ ui->actionZoomIn->setEnabled(percent < 400);
+ qreal factor = static_cast<qreal>(percent) / 100;
+ ui->webView->setZoomFactor(factor);
+
+ zoomLabel->setText(tr(" Zoom: %1% ").arg(percent));
+ zoomSlider->setValue(percent);
+}
+
+/**
+ * @brief HtmlEditor::closeEvent and send a applyEditText signal!
+ * @param e
+ */
+void HtmlEditor::closeEvent(QCloseEvent *e)
+{
+ /*if (maybeSave())
+ e->accept();
+ else
+ e->ignore();*/
+
+ //start applyEdit
+ emit applyEditText( ui->webView->page()->mainFrame()->toHtml() );
+}
+
+/**
+ * @brief HtmlEditor::loadHtml to the editor
+ * @param f
+ */
+void HtmlEditor::loadHtml(const QString &f) {
+ ui->webView->setContent(f.toAscii(), "text/html");
+ ui->webView->page()->setContentEditable(true);
+ ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
+ connect(ui->webView, SIGNAL(linkClicked(QUrl)), SLOT(openLink(QUrl)));
+
+}
+
+/**
+ * @brief HtmlEditor::setSimpleDisplay
+ * @param state
+ */
+void HtmlEditor::setSimpleDisplay(bool state) {
+ ui->standardToolBar->setVisible(!state);
+ ui->menubar->setVisible(!state);
+}
+
+bool HtmlEditor::load(const QString &f)
+{
+ if (!QFile::exists(f))
+ return false;
+ QFile file(f);
+ if (!file.open(QFile::ReadOnly))
+ return false;
+
+ QByteArray data = file.readAll();
+ ui->webView->setContent(data, "text/html");
+ ui->webView->page()->setContentEditable(true);
+ ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
+ connect(ui->webView, SIGNAL(linkClicked(QUrl)), SLOT(openLink(QUrl)));
+
+ setCurrentFileName(f);
+ return true;
+}
+
+void HtmlEditor::setCurrentFileName(const QString &fileName)
+{
+ this->fileName = fileName;
+ // setWindowModified(false);
+
+ QString shownName;
+ if (fileName.isEmpty())
+ shownName = "untitled";
+ else
+ shownName = QFileInfo(fileName).fileName();
+
+ setWindowTitle(tr("%1[*] - %2").arg("QET").arg(tr("HTML Editor")));
+ setWindowModified(false);
+
+ bool allowSave = true;
+ if (fileName.isEmpty() || fileName.startsWith(QLatin1String(":/")))
+ allowSave = false;
+ ui->actionFileSave->setEnabled(allowSave);
+}
+
+
Added: trunk/sources/htmleditor/htmleditor.h
===================================================================
--- trunk/sources/htmleditor/htmleditor.h (rev 0)
+++ trunk/sources/htmleditor/htmleditor.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@xxxxxxxxx)
+**
+** This file is part of the Graphics Dojo project on Qt Labs.
+**
+** This file may be used under the terms of the GNU General Public
+** License version 2.0 or 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of
+** this file. Please review the following information to ensure GNU
+** General Public Licensing requirements will be met:
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@xxxxxxxxx.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+****************************************************************************/
+
+
+#ifndef HTML_EDITOR_H
+#define HTML_EDITOR_H
+
+#include <QMainWindow>
+#include "highlighter.h"
+
+#if QT_VERSION < 0x040500
+#error You must use Qt >= 4.5.0!
+#endif
+
+class Ui_MainWindow;
+class Ui_Dialog;
+
+class QLabel;
+class QSlider;
+class QUrl;
+
+class HtmlEditor : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ HtmlEditor(QWidget *parent = 0);
+ ~HtmlEditor();
+
+ void loadHtml(const QString &f);
+ void setSimpleDisplay(bool state);
+
+protected:
+ virtual void closeEvent(QCloseEvent *e);
+
+private:
+ void setupActions();
+ void setupToolBar();
+ void setupMenu();
+ bool load(const QString &f);
+ bool maybeSave();
+ void setCurrentFileName(const QString &fileName);
+ void execCommand(const QString&);
+ void execCommand(const QString &cmd, const QString &arg);
+ bool queryCommandState(const QString&);
+
+private slots:
+ void fileNew();
+ void fileOpen();
+ bool fileSave();
+ bool fileSaveAs();
+ void editSelectAll();
+ void styleParagraph();
+ void styleHeading1();
+ void styleHeading2();
+ void styleHeading3();
+ void styleHeading4();
+ void styleHeading5();
+ void styleHeading6();
+ void stylePreformatted();
+ void styleAddress();
+ void formatStrikeThrough();
+ void formatAlignLeft();
+ void formatAlignCenter();
+ void formatAlignRight();
+ void formatAlignJustify();
+ void formatIncreaseIndent();
+ void formatDecreaseIndent();
+ void formatNumberedList();
+ void formatBulletedList();
+ void formatFontName();
+ void formatFontSize();
+ void formatTextColor();
+ void formatBackgroundColor();
+ void insertImage();
+ void createLink();
+ void insertHtml();
+ void zoomOut();
+ void zoomIn();
+ void adjustActions();
+ void adjustSource();
+ void changeTab(int);
+ void openLink(const QUrl&);
+ void changeZoom(int);
+
+signals:
+ void applyEditText(const QString &);
+
+private:
+ Ui_MainWindow *ui;
+ QString fileName;
+ bool sourceDirty;
+ QLabel *zoomLabel;
+ QSlider *zoomSlider;
+ Highlighter *highlighter;
+ Ui_Dialog *ui_dialog;
+ QDialog *insertHtmlDialog;
+
+
+};
+
+#endif // HTML_EDITOR_H
Added: trunk/sources/htmleditor/htmleditor.qrc
===================================================================
--- trunk/sources/htmleditor/htmleditor.qrc (rev 0)
+++ trunk/sources/htmleditor/htmleditor.qrc 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,33 @@
+<RCC>
+ <qresource prefix="/">
+ <file>images/document-new.png</file>
+ <file>images/document-open.png</file>
+ <file>images/document-save.png</file>
+ <file>images/edit-copy.png</file>
+ <file>images/edit-cut.png</file>
+ <file>images/edit-paste.png</file>
+ <file>images/edit-redo.png</file>
+ <file>images/edit-select-all.png</file>
+ <file>images/edit-undo.png</file>
+ <file>images/format-indent-less.png</file>
+ <file>images/format-indent-more.png</file>
+ <file>images/format-justify-center.png</file>
+ <file>images/format-justify-fill.png</file>
+ <file>images/format-justify-left.png</file>
+ <file>images/format-justify-right.png</file>
+ <file>images/format-text-bold.png</file>
+ <file>images/format-text-italic.png</file>
+ <file>images/format-text-underline.png</file>
+ <file>images/format-text-strikethrough.png</file>
+ <file>images/bulleted-list.png</file>
+ <file>images/numbered-list.png</file>
+ <file>images/image-x-generic.png</file>
+ <file>qtlogo.png</file>
+ <file>images/text-html.png</file>
+ <file>images/list-remove.png</file>
+ <file>images/list-add.png</file>
+ <file>images/insert-html.png</file>
+ <file>images/text.png</file>
+ <file>images/text_color.png</file>
+ </qresource>
+</RCC>
Added: trunk/sources/htmleditor/htmleditor.ui
===================================================================
--- trunk/sources/htmleditor/htmleditor.ui (rev 0)
+++ trunk/sources/htmleditor/htmleditor.ui 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,629 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>659</width>
+ <height>398</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>HTML Editor</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="tabPosition">
+ <enum>QTabWidget::South</enum>
+ </property>
+ <property name="tabShape">
+ <enum>QTabWidget::Rounded</enum>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <property name="documentMode">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QWebView" name="webView">
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Tab 2</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QPlainTextEdit" name="plainTextEdit">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>659</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
+ <string>&File</string>
+ </property>
+ <addaction name="actionFileNew"/>
+ <addaction name="actionFileOpen"/>
+ <addaction name="actionFileSave"/>
+ <addaction name="actionFileSaveAs"/>
+ <addaction name="separator"/>
+ <addaction name="actionExit"/>
+ </widget>
+ <widget class="QMenu" name="menu_Edit">
+ <property name="title">
+ <string>&Edit</string>
+ </property>
+ <addaction name="actionEditUndo"/>
+ <addaction name="actionEditRedo"/>
+ <addaction name="separator"/>
+ <addaction name="actionEditCut"/>
+ <addaction name="actionEditCopy"/>
+ <addaction name="actionEditPaste"/>
+ <addaction name="separator"/>
+ <addaction name="actionEditSelectAll"/>
+ <addaction name="separator"/>
+ <addaction name="actionInsertImage"/>
+ <addaction name="actionCreateLink"/>
+ <addaction name="actionInsertHtml"/>
+ </widget>
+ <widget class="QMenu" name="menuF_ormat">
+ <property name="title">
+ <string>F&ormat</string>
+ </property>
+ <widget class="QMenu" name="menuSt_yle">
+ <property name="title">
+ <string>St&yle</string>
+ </property>
+ <addaction name="actionStyleParagraph"/>
+ <addaction name="actionStyleHeading1"/>
+ <addaction name="actionStyleHeading2"/>
+ <addaction name="actionStyleHeading3"/>
+ <addaction name="actionStyleHeading4"/>
+ <addaction name="actionStyleHeading5"/>
+ <addaction name="actionStyleHeading6"/>
+ <addaction name="actionStylePreformatted"/>
+ <addaction name="actionStyleAddress"/>
+ </widget>
+ <widget class="QMenu" name="menu_Align">
+ <property name="title">
+ <string>&Align</string>
+ </property>
+ <addaction name="actionFormatAlignLeft"/>
+ <addaction name="actionFormatAlignCenter"/>
+ <addaction name="actionFormatAlignRight"/>
+ <addaction name="actionFormatAlignJustify"/>
+ </widget>
+ <addaction name="menuSt_yle"/>
+ <addaction name="menu_Align"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatBold"/>
+ <addaction name="actionFormatItalic"/>
+ <addaction name="actionFormatUnderline"/>
+ <addaction name="actionFormatStrikethrough"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatIncreaseIndent"/>
+ <addaction name="actionFormatDecreaseIndent"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatNumberedList"/>
+ <addaction name="actionFormatBulletedList"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatFontName"/>
+ <addaction name="actionFormatFontSize"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatTextColor"/>
+ <addaction name="actionFormatBackgroundColor"/>
+ </widget>
+ <addaction name="menu_File"/>
+ <addaction name="menu_Edit"/>
+ <addaction name="menuF_ormat"/>
+ </widget>
+ <widget class="QToolBar" name="standardToolBar">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="windowTitle">
+ <string>Standard</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionFileNew"/>
+ <addaction name="actionFileOpen"/>
+ <addaction name="actionFileSave"/>
+ <addaction name="separator"/>
+ <addaction name="actionEditUndo"/>
+ <addaction name="actionEditRedo"/>
+ <addaction name="separator"/>
+ <addaction name="actionEditCut"/>
+ <addaction name="actionEditCopy"/>
+ <addaction name="actionEditPaste"/>
+ <addaction name="separator"/>
+ <addaction name="actionZoomOut"/>
+ <addaction name="actionZoomIn"/>
+ </widget>
+ <widget class="QToolBar" name="formatToolBar">
+ <property name="windowTitle">
+ <string>Formatting</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>true</bool>
+ </attribute>
+ <addaction name="actionFormatBold"/>
+ <addaction name="actionFormatItalic"/>
+ <addaction name="actionFormatUnderline"/>
+ <addaction name="actionFormatStrikethrough"/>
+ <addaction name="actionFormatFontSize"/>
+ <addaction name="actionFormatTextColor"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatAlignLeft"/>
+ <addaction name="actionFormatAlignCenter"/>
+ <addaction name="actionFormatAlignRight"/>
+ <addaction name="actionFormatAlignJustify"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatDecreaseIndent"/>
+ <addaction name="actionFormatIncreaseIndent"/>
+ <addaction name="separator"/>
+ <addaction name="actionFormatNumberedList"/>
+ <addaction name="actionFormatBulletedList"/>
+ <addaction name="separator"/>
+ <addaction name="actionInsertImage"/>
+ <addaction name="actionCreateLink"/>
+ <addaction name="actionInsertHtml"/>
+ </widget>
+ <action name="actionFileNew">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/document-new.png</normaloff>:/images/document-new.png</iconset>
+ </property>
+ <property name="text">
+ <string>&New</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action name="actionFileOpen">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/document-open.png</normaloff>:/images/document-open.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Open...</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+O</string>
+ </property>
+ </action>
+ <action name="actionFileSave">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/document-save.png</normaloff>:/images/document-save.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Save</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action name="actionFileSaveAs">
+ <property name="text">
+ <string>Save &As...</string>
+ </property>
+ </action>
+ <action name="actionEditUndo">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/edit-undo.png</normaloff>:/images/edit-undo.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Undo</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Z</string>
+ </property>
+ </action>
+ <action name="actionEditRedo">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/edit-redo.png</normaloff>:/images/edit-redo.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Redo</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Y</string>
+ </property>
+ </action>
+ <action name="actionEditCut">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/edit-cut.png</normaloff>:/images/edit-cut.png</iconset>
+ </property>
+ <property name="text">
+ <string>Cu&t</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+X</string>
+ </property>
+ </action>
+ <action name="actionEditCopy">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/edit-copy.png</normaloff>:/images/edit-copy.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Copy</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action name="actionEditPaste">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/edit-paste.png</normaloff>:/images/edit-paste.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Paste</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+V</string>
+ </property>
+ </action>
+ <action name="actionEditSelectAll">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/edit-select-all.png</normaloff>:/images/edit-select-all.png</iconset>
+ </property>
+ <property name="text">
+ <string>Select A&ll</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+A</string>
+ </property>
+ </action>
+ <action name="actionFormatBold">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-text-bold.png</normaloff>:/images/format-text-bold.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Bold</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+B</string>
+ </property>
+ </action>
+ <action name="actionFormatItalic">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-text-italic.png</normaloff>:/images/format-text-italic.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Italic</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+I</string>
+ </property>
+ </action>
+ <action name="actionFormatUnderline">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-text-underline.png</normaloff>:/images/format-text-underline.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Underline</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+U</string>
+ </property>
+ </action>
+ <action name="actionFormatStrikethrough">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-text-strikethrough.png</normaloff>:/images/format-text-strikethrough.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Strikethrough</string>
+ </property>
+ </action>
+ <action name="actionFormatAlignLeft">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-justify-left.png</normaloff>:/images/format-justify-left.png</iconset>
+ </property>
+ <property name="text">
+ <string>Align &Left</string>
+ </property>
+ </action>
+ <action name="actionFormatAlignCenter">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-justify-center.png</normaloff>:/images/format-justify-center.png</iconset>
+ </property>
+ <property name="text">
+ <string>Align &Center</string>
+ </property>
+ </action>
+ <action name="actionFormatAlignRight">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-justify-right.png</normaloff>:/images/format-justify-right.png</iconset>
+ </property>
+ <property name="text">
+ <string>Align &Right</string>
+ </property>
+ </action>
+ <action name="actionFormatAlignJustify">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-justify-fill.png</normaloff>:/images/format-justify-fill.png</iconset>
+ </property>
+ <property name="text">
+ <string>Align &Justify</string>
+ </property>
+ </action>
+ <action name="actionFormatIncreaseIndent">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-indent-more.png</normaloff>:/images/format-indent-more.png</iconset>
+ </property>
+ <property name="text">
+ <string>I&ncrease Indent</string>
+ </property>
+ </action>
+ <action name="actionFormatDecreaseIndent">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/format-indent-less.png</normaloff>:/images/format-indent-less.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Decrease Indent</string>
+ </property>
+ </action>
+ <action name="actionFormatBulletedList">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/bulleted-list.png</normaloff>:/images/bulleted-list.png</iconset>
+ </property>
+ <property name="text">
+ <string>Bulle&ted List</string>
+ </property>
+ </action>
+ <action name="actionFormatNumberedList">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/numbered-list.png</normaloff>:/images/numbered-list.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Numbered List</string>
+ </property>
+ </action>
+ <action name="actionInsertImage">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/image-x-generic.png</normaloff>:/images/image-x-generic.png</iconset>
+ </property>
+ <property name="text">
+ <string>Insert &Image...</string>
+ </property>
+ <property name="visible">
+ <bool>false</bool>
+ </property>
+ </action>
+ <action name="actionCreateLink">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/text-html.png</normaloff>:/images/text-html.png</iconset>
+ </property>
+ <property name="text">
+ <string>Create Link...</string>
+ </property>
+ </action>
+ <action name="actionZoomOut">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/list-remove.png</normaloff>:/images/list-remove.png</iconset>
+ </property>
+ <property name="text">
+ <string>Zoom Out</string>
+ </property>
+ </action>
+ <action name="actionZoomIn">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/list-add.png</normaloff>:/images/list-add.png</iconset>
+ </property>
+ <property name="text">
+ <string>Zoom In</string>
+ </property>
+ </action>
+ <action name="actionExit">
+ <property name="text">
+ <string>E&xit</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+Q</string>
+ </property>
+ </action>
+ <action name="actionStyleParagraph">
+ <property name="text">
+ <string>&Paragraph</string>
+ </property>
+ </action>
+ <action name="actionStyleHeading1">
+ <property name="text">
+ <string>Heading &1</string>
+ </property>
+ </action>
+ <action name="actionStyleHeading2">
+ <property name="text">
+ <string>Heading &2</string>
+ </property>
+ </action>
+ <action name="actionStyleHeading3">
+ <property name="text">
+ <string>Heading &3</string>
+ </property>
+ </action>
+ <action name="actionStyleHeading4">
+ <property name="text">
+ <string>Heading &4</string>
+ </property>
+ </action>
+ <action name="actionStyleHeading5">
+ <property name="text">
+ <string>Heading &5</string>
+ </property>
+ </action>
+ <action name="actionStyleHeading6">
+ <property name="text">
+ <string>Heading &6</string>
+ </property>
+ </action>
+ <action name="actionStylePreformatted">
+ <property name="text">
+ <string>Pre&formatted</string>
+ </property>
+ </action>
+ <action name="actionStyleAddress">
+ <property name="text">
+ <string>&Address</string>
+ </property>
+ </action>
+ <action name="actionFormatFontName">
+ <property name="text">
+ <string>&Font Name...</string>
+ </property>
+ </action>
+ <action name="actionFormatTextColor">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/text_color.png</normaloff>:/images/text_color.png</iconset>
+ </property>
+ <property name="text">
+ <string>Text &Color...</string>
+ </property>
+ </action>
+ <action name="actionFormatBackgroundColor">
+ <property name="text">
+ <string>Bac&kground Color...</string>
+ </property>
+ </action>
+ <action name="actionFormatFontSize">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/text.png</normaloff>:/images/text.png</iconset>
+ </property>
+ <property name="text">
+ <string>Font Si&ze...</string>
+ </property>
+ </action>
+ <action name="actionInsertHtml">
+ <property name="icon">
+ <iconset resource="htmleditor.qrc">
+ <normaloff>:/images/insert-html.png</normaloff>:/images/insert-html.png</iconset>
+ </property>
+ <property name="text">
+ <string>Insert HTML...</string>
+ </property>
+ <property name="toolTip">
+ <string>Insert HTML</string>
+ </property>
+ </action>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKit/QWebView</header>
+ </customwidget>
+ </customwidgets>
+ <resources>
+ <include location="htmleditor.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Added: trunk/sources/htmleditor/images/bulleted-list.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/bulleted-list.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/document-new.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/document-new.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/document-open.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/document-open.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/document-save-as.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/document-save-as.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/document-save.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/document-save.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/edit-copy.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/edit-copy.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/edit-cut.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/edit-cut.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/edit-paste.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/edit-paste.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/edit-redo.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/edit-redo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/edit-select-all.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/edit-select-all.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/edit-undo.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/edit-undo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-indent-less.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-indent-less.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-indent-more.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-indent-more.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-justify-center.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-justify-center.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-justify-fill.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-justify-fill.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-justify-left.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-justify-left.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-justify-right.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-justify-right.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-text-bold.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-text-bold.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-text-italic.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-text-italic.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-text-strikethrough.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-text-strikethrough.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/format-text-underline.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/format-text-underline.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/image-x-generic.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/image-x-generic.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/insert-html.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/insert-html.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/list-add.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/list-add.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/list-remove.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/list-remove.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/numbered-list.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/numbered-list.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/text-html.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/text-html.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/text.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/text.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/images/text_color.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/images/text_color.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/sources/htmleditor/inserthtmldialog.ui
===================================================================
--- trunk/sources/htmleditor/inserthtmldialog.ui (rev 0)
+++ trunk/sources/htmleditor/inserthtmldialog.ui 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>426</width>
+ <height>288</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Insert HTML</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>HTML Code:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="plainTextEdit"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Added: trunk/sources/htmleditor/qtlogo.png
===================================================================
(Binary files differ)
Property changes on: trunk/sources/htmleditor/qtlogo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/sources/qetdiagrameditor.cpp 2013-04-01 13:49:34 UTC (rev 2081)
@@ -211,7 +211,7 @@
conductor_reset = new QAction(QET::Icons::ConductorSettings, tr("R\351initialiser les conducteurs"), this);
infos_diagram = new QAction(QET::Icons::DialogInformation, tr("Propri\351t\351s du sch\351ma"), this);
add_text = new QAction(QET::Icons::PartTextField, tr("Ajouter un champ de texte"), this);
- add_edittext = new QAction(QET::Icons::EditText, tr("\311diter un champ de texte"), this);
+ add_edittext = new QAction(QET::Icons::EditText, tr("\311diter le champ de texte"), this);
add_column = new QAction(QET::Icons::EditTableInsertColumnRight, tr("Ajouter une colonne"), this);
remove_column = new QAction(QET::Icons::EditTableDeleteColumn, tr("Enlever une colonne"), this);
add_row = new QAction(QET::Icons::EditTableInsertRowUnder, tr("Ajouter une ligne"), this);
@@ -1472,6 +1472,15 @@
}
/**
+ to Edit en text through the html editor
+*/
+void QETDiagramEditor::slot_editText() {
+ if (DiagramView *dv = currentDiagram()) {
+ dv -> editText();
+ }
+}
+
+/**
Affiche les projets dans des fenetres.
*/
void QETDiagramEditor::setWindowedMode() {
Modified: trunk/sources/qetdiagrameditor.h
===================================================================
--- trunk/sources/qetdiagrameditor.h 2013-03-31 18:13:30 UTC (rev 2080)
+++ trunk/sources/qetdiagrameditor.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -123,6 +123,7 @@
void slot_editConductor();
void slot_resetConductors();
void slot_addText();
+ void slot_editText();
void setWindowedMode();
void setTabbedMode();
void readSettings();
Added: trunk/sources/ui/ui_htmleditor.h
===================================================================
--- trunk/sources/ui/ui_htmleditor.h (rev 0)
+++ trunk/sources/ui/ui_htmleditor.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,509 @@
+/********************************************************************************
+** Form generated from reading UI file 'htmleditor.ui'
+**
+** Created: Mon 1. Apr 15:44:25 2013
+** by: Qt User Interface Compiler version 4.8.4
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_HTMLEDITOR_H
+#define UI_HTMLEDITOR_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QHeaderView>
+#include <QtGui/QMainWindow>
+#include <QtGui/QMenu>
+#include <QtGui/QMenuBar>
+#include <QtGui/QPlainTextEdit>
+#include <QtGui/QTabWidget>
+#include <QtGui/QToolBar>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QWidget>
+#include <QtWebKit/QWebView>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_MainWindow
+{
+public:
+ QAction *actionFileNew;
+ QAction *actionFileOpen;
+ QAction *actionFileSave;
+ QAction *actionFileSaveAs;
+ QAction *actionEditUndo;
+ QAction *actionEditRedo;
+ QAction *actionEditCut;
+ QAction *actionEditCopy;
+ QAction *actionEditPaste;
+ QAction *actionEditSelectAll;
+ QAction *actionFormatBold;
+ QAction *actionFormatItalic;
+ QAction *actionFormatUnderline;
+ QAction *actionFormatStrikethrough;
+ QAction *actionFormatAlignLeft;
+ QAction *actionFormatAlignCenter;
+ QAction *actionFormatAlignRight;
+ QAction *actionFormatAlignJustify;
+ QAction *actionFormatIncreaseIndent;
+ QAction *actionFormatDecreaseIndent;
+ QAction *actionFormatBulletedList;
+ QAction *actionFormatNumberedList;
+ QAction *actionInsertImage;
+ QAction *actionCreateLink;
+ QAction *actionZoomOut;
+ QAction *actionZoomIn;
+ QAction *actionExit;
+ QAction *actionStyleParagraph;
+ QAction *actionStyleHeading1;
+ QAction *actionStyleHeading2;
+ QAction *actionStyleHeading3;
+ QAction *actionStyleHeading4;
+ QAction *actionStyleHeading5;
+ QAction *actionStyleHeading6;
+ QAction *actionStylePreformatted;
+ QAction *actionStyleAddress;
+ QAction *actionFormatFontName;
+ QAction *actionFormatTextColor;
+ QAction *actionFormatBackgroundColor;
+ QAction *actionFormatFontSize;
+ QAction *actionInsertHtml;
+ QWidget *centralwidget;
+ QVBoxLayout *verticalLayout;
+ QTabWidget *tabWidget;
+ QWidget *tab;
+ QVBoxLayout *verticalLayout_2;
+ QWebView *webView;
+ QWidget *tab_2;
+ QVBoxLayout *verticalLayout_3;
+ QPlainTextEdit *plainTextEdit;
+ QMenuBar *menubar;
+ QMenu *menu_File;
+ QMenu *menu_Edit;
+ QMenu *menuF_ormat;
+ QMenu *menuSt_yle;
+ QMenu *menu_Align;
+ QToolBar *standardToolBar;
+ QToolBar *formatToolBar;
+
+ void setupUi(QMainWindow *MainWindow)
+ {
+ if (MainWindow->objectName().isEmpty())
+ MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
+ MainWindow->resize(659, 398);
+ actionFileNew = new QAction(MainWindow);
+ actionFileNew->setObjectName(QString::fromUtf8("actionFileNew"));
+ QIcon icon;
+ icon.addFile(QString::fromUtf8(":/images/document-new.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFileNew->setIcon(icon);
+ actionFileOpen = new QAction(MainWindow);
+ actionFileOpen->setObjectName(QString::fromUtf8("actionFileOpen"));
+ QIcon icon1;
+ icon1.addFile(QString::fromUtf8(":/images/document-open.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFileOpen->setIcon(icon1);
+ actionFileSave = new QAction(MainWindow);
+ actionFileSave->setObjectName(QString::fromUtf8("actionFileSave"));
+ QIcon icon2;
+ icon2.addFile(QString::fromUtf8(":/images/document-save.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFileSave->setIcon(icon2);
+ actionFileSaveAs = new QAction(MainWindow);
+ actionFileSaveAs->setObjectName(QString::fromUtf8("actionFileSaveAs"));
+ actionEditUndo = new QAction(MainWindow);
+ actionEditUndo->setObjectName(QString::fromUtf8("actionEditUndo"));
+ QIcon icon3;
+ icon3.addFile(QString::fromUtf8(":/images/edit-undo.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionEditUndo->setIcon(icon3);
+ actionEditRedo = new QAction(MainWindow);
+ actionEditRedo->setObjectName(QString::fromUtf8("actionEditRedo"));
+ QIcon icon4;
+ icon4.addFile(QString::fromUtf8(":/images/edit-redo.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionEditRedo->setIcon(icon4);
+ actionEditCut = new QAction(MainWindow);
+ actionEditCut->setObjectName(QString::fromUtf8("actionEditCut"));
+ QIcon icon5;
+ icon5.addFile(QString::fromUtf8(":/images/edit-cut.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionEditCut->setIcon(icon5);
+ actionEditCopy = new QAction(MainWindow);
+ actionEditCopy->setObjectName(QString::fromUtf8("actionEditCopy"));
+ QIcon icon6;
+ icon6.addFile(QString::fromUtf8(":/images/edit-copy.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionEditCopy->setIcon(icon6);
+ actionEditPaste = new QAction(MainWindow);
+ actionEditPaste->setObjectName(QString::fromUtf8("actionEditPaste"));
+ QIcon icon7;
+ icon7.addFile(QString::fromUtf8(":/images/edit-paste.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionEditPaste->setIcon(icon7);
+ actionEditSelectAll = new QAction(MainWindow);
+ actionEditSelectAll->setObjectName(QString::fromUtf8("actionEditSelectAll"));
+ QIcon icon8;
+ icon8.addFile(QString::fromUtf8(":/images/edit-select-all.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionEditSelectAll->setIcon(icon8);
+ actionFormatBold = new QAction(MainWindow);
+ actionFormatBold->setObjectName(QString::fromUtf8("actionFormatBold"));
+ actionFormatBold->setCheckable(true);
+ QIcon icon9;
+ icon9.addFile(QString::fromUtf8(":/images/format-text-bold.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatBold->setIcon(icon9);
+ actionFormatItalic = new QAction(MainWindow);
+ actionFormatItalic->setObjectName(QString::fromUtf8("actionFormatItalic"));
+ actionFormatItalic->setCheckable(true);
+ QIcon icon10;
+ icon10.addFile(QString::fromUtf8(":/images/format-text-italic.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatItalic->setIcon(icon10);
+ actionFormatUnderline = new QAction(MainWindow);
+ actionFormatUnderline->setObjectName(QString::fromUtf8("actionFormatUnderline"));
+ actionFormatUnderline->setCheckable(true);
+ QIcon icon11;
+ icon11.addFile(QString::fromUtf8(":/images/format-text-underline.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatUnderline->setIcon(icon11);
+ actionFormatStrikethrough = new QAction(MainWindow);
+ actionFormatStrikethrough->setObjectName(QString::fromUtf8("actionFormatStrikethrough"));
+ actionFormatStrikethrough->setCheckable(true);
+ QIcon icon12;
+ icon12.addFile(QString::fromUtf8(":/images/format-text-strikethrough.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatStrikethrough->setIcon(icon12);
+ actionFormatAlignLeft = new QAction(MainWindow);
+ actionFormatAlignLeft->setObjectName(QString::fromUtf8("actionFormatAlignLeft"));
+ QIcon icon13;
+ icon13.addFile(QString::fromUtf8(":/images/format-justify-left.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatAlignLeft->setIcon(icon13);
+ actionFormatAlignCenter = new QAction(MainWindow);
+ actionFormatAlignCenter->setObjectName(QString::fromUtf8("actionFormatAlignCenter"));
+ QIcon icon14;
+ icon14.addFile(QString::fromUtf8(":/images/format-justify-center.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatAlignCenter->setIcon(icon14);
+ actionFormatAlignRight = new QAction(MainWindow);
+ actionFormatAlignRight->setObjectName(QString::fromUtf8("actionFormatAlignRight"));
+ QIcon icon15;
+ icon15.addFile(QString::fromUtf8(":/images/format-justify-right.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatAlignRight->setIcon(icon15);
+ actionFormatAlignJustify = new QAction(MainWindow);
+ actionFormatAlignJustify->setObjectName(QString::fromUtf8("actionFormatAlignJustify"));
+ QIcon icon16;
+ icon16.addFile(QString::fromUtf8(":/images/format-justify-fill.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatAlignJustify->setIcon(icon16);
+ actionFormatIncreaseIndent = new QAction(MainWindow);
+ actionFormatIncreaseIndent->setObjectName(QString::fromUtf8("actionFormatIncreaseIndent"));
+ QIcon icon17;
+ icon17.addFile(QString::fromUtf8(":/images/format-indent-more.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatIncreaseIndent->setIcon(icon17);
+ actionFormatDecreaseIndent = new QAction(MainWindow);
+ actionFormatDecreaseIndent->setObjectName(QString::fromUtf8("actionFormatDecreaseIndent"));
+ QIcon icon18;
+ icon18.addFile(QString::fromUtf8(":/images/format-indent-less.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatDecreaseIndent->setIcon(icon18);
+ actionFormatBulletedList = new QAction(MainWindow);
+ actionFormatBulletedList->setObjectName(QString::fromUtf8("actionFormatBulletedList"));
+ actionFormatBulletedList->setCheckable(true);
+ QIcon icon19;
+ icon19.addFile(QString::fromUtf8(":/images/bulleted-list.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatBulletedList->setIcon(icon19);
+ actionFormatNumberedList = new QAction(MainWindow);
+ actionFormatNumberedList->setObjectName(QString::fromUtf8("actionFormatNumberedList"));
+ actionFormatNumberedList->setCheckable(true);
+ QIcon icon20;
+ icon20.addFile(QString::fromUtf8(":/images/numbered-list.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatNumberedList->setIcon(icon20);
+ actionInsertImage = new QAction(MainWindow);
+ actionInsertImage->setObjectName(QString::fromUtf8("actionInsertImage"));
+ QIcon icon21;
+ icon21.addFile(QString::fromUtf8(":/images/image-x-generic.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionInsertImage->setIcon(icon21);
+ actionInsertImage->setVisible(false);
+ actionCreateLink = new QAction(MainWindow);
+ actionCreateLink->setObjectName(QString::fromUtf8("actionCreateLink"));
+ QIcon icon22;
+ icon22.addFile(QString::fromUtf8(":/images/text-html.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionCreateLink->setIcon(icon22);
+ actionZoomOut = new QAction(MainWindow);
+ actionZoomOut->setObjectName(QString::fromUtf8("actionZoomOut"));
+ QIcon icon23;
+ icon23.addFile(QString::fromUtf8(":/images/list-remove.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionZoomOut->setIcon(icon23);
+ actionZoomIn = new QAction(MainWindow);
+ actionZoomIn->setObjectName(QString::fromUtf8("actionZoomIn"));
+ QIcon icon24;
+ icon24.addFile(QString::fromUtf8(":/images/list-add.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionZoomIn->setIcon(icon24);
+ actionExit = new QAction(MainWindow);
+ actionExit->setObjectName(QString::fromUtf8("actionExit"));
+ actionStyleParagraph = new QAction(MainWindow);
+ actionStyleParagraph->setObjectName(QString::fromUtf8("actionStyleParagraph"));
+ actionStyleHeading1 = new QAction(MainWindow);
+ actionStyleHeading1->setObjectName(QString::fromUtf8("actionStyleHeading1"));
+ actionStyleHeading2 = new QAction(MainWindow);
+ actionStyleHeading2->setObjectName(QString::fromUtf8("actionStyleHeading2"));
+ actionStyleHeading3 = new QAction(MainWindow);
+ actionStyleHeading3->setObjectName(QString::fromUtf8("actionStyleHeading3"));
+ actionStyleHeading4 = new QAction(MainWindow);
+ actionStyleHeading4->setObjectName(QString::fromUtf8("actionStyleHeading4"));
+ actionStyleHeading5 = new QAction(MainWindow);
+ actionStyleHeading5->setObjectName(QString::fromUtf8("actionStyleHeading5"));
+ actionStyleHeading6 = new QAction(MainWindow);
+ actionStyleHeading6->setObjectName(QString::fromUtf8("actionStyleHeading6"));
+ actionStylePreformatted = new QAction(MainWindow);
+ actionStylePreformatted->setObjectName(QString::fromUtf8("actionStylePreformatted"));
+ actionStyleAddress = new QAction(MainWindow);
+ actionStyleAddress->setObjectName(QString::fromUtf8("actionStyleAddress"));
+ actionFormatFontName = new QAction(MainWindow);
+ actionFormatFontName->setObjectName(QString::fromUtf8("actionFormatFontName"));
+ actionFormatTextColor = new QAction(MainWindow);
+ actionFormatTextColor->setObjectName(QString::fromUtf8("actionFormatTextColor"));
+ QIcon icon25;
+ icon25.addFile(QString::fromUtf8(":/images/text_color.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatTextColor->setIcon(icon25);
+ actionFormatBackgroundColor = new QAction(MainWindow);
+ actionFormatBackgroundColor->setObjectName(QString::fromUtf8("actionFormatBackgroundColor"));
+ actionFormatFontSize = new QAction(MainWindow);
+ actionFormatFontSize->setObjectName(QString::fromUtf8("actionFormatFontSize"));
+ QIcon icon26;
+ icon26.addFile(QString::fromUtf8(":/images/text.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionFormatFontSize->setIcon(icon26);
+ actionInsertHtml = new QAction(MainWindow);
+ actionInsertHtml->setObjectName(QString::fromUtf8("actionInsertHtml"));
+ QIcon icon27;
+ icon27.addFile(QString::fromUtf8(":/images/insert-html.png"), QSize(), QIcon::Normal, QIcon::Off);
+ actionInsertHtml->setIcon(icon27);
+ centralwidget = new QWidget(MainWindow);
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
+ verticalLayout = new QVBoxLayout(centralwidget);
+ verticalLayout->setContentsMargins(0, 0, 0, 0);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ tabWidget = new QTabWidget(centralwidget);
+ tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
+ tabWidget->setTabPosition(QTabWidget::South);
+ tabWidget->setTabShape(QTabWidget::Rounded);
+ tabWidget->setDocumentMode(true);
+ tab = new QWidget();
+ tab->setObjectName(QString::fromUtf8("tab"));
+ verticalLayout_2 = new QVBoxLayout(tab);
+ verticalLayout_2->setContentsMargins(0, 0, 0, 0);
+ verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
+ webView = new QWebView(tab);
+ webView->setObjectName(QString::fromUtf8("webView"));
+ webView->setUrl(QUrl(QString::fromUtf8("about:blank")));
+
+ verticalLayout_2->addWidget(webView);
+
+ tabWidget->addTab(tab, QString());
+ tab_2 = new QWidget();
+ tab_2->setObjectName(QString::fromUtf8("tab_2"));
+ verticalLayout_3 = new QVBoxLayout(tab_2);
+ verticalLayout_3->setContentsMargins(0, 0, 0, 0);
+ verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
+ plainTextEdit = new QPlainTextEdit(tab_2);
+ plainTextEdit->setObjectName(QString::fromUtf8("plainTextEdit"));
+ plainTextEdit->setFrameShape(QFrame::NoFrame);
+ plainTextEdit->setReadOnly(true);
+
+ verticalLayout_3->addWidget(plainTextEdit);
+
+ tabWidget->addTab(tab_2, QString());
+
+ verticalLayout->addWidget(tabWidget);
+
+ MainWindow->setCentralWidget(centralwidget);
+ menubar = new QMenuBar(MainWindow);
+ menubar->setObjectName(QString::fromUtf8("menubar"));
+ menubar->setGeometry(QRect(0, 0, 659, 31));
+ menu_File = new QMenu(menubar);
+ menu_File->setObjectName(QString::fromUtf8("menu_File"));
+ menu_Edit = new QMenu(menubar);
+ menu_Edit->setObjectName(QString::fromUtf8("menu_Edit"));
+ menuF_ormat = new QMenu(menubar);
+ menuF_ormat->setObjectName(QString::fromUtf8("menuF_ormat"));
+ menuSt_yle = new QMenu(menuF_ormat);
+ menuSt_yle->setObjectName(QString::fromUtf8("menuSt_yle"));
+ menu_Align = new QMenu(menuF_ormat);
+ menu_Align->setObjectName(QString::fromUtf8("menu_Align"));
+ MainWindow->setMenuBar(menubar);
+ standardToolBar = new QToolBar(MainWindow);
+ standardToolBar->setObjectName(QString::fromUtf8("standardToolBar"));
+ standardToolBar->setEnabled(false);
+ standardToolBar->setIconSize(QSize(24, 24));
+ MainWindow->addToolBar(Qt::TopToolBarArea, standardToolBar);
+ formatToolBar = new QToolBar(MainWindow);
+ formatToolBar->setObjectName(QString::fromUtf8("formatToolBar"));
+ formatToolBar->setIconSize(QSize(24, 24));
+ MainWindow->addToolBar(Qt::TopToolBarArea, formatToolBar);
+ MainWindow->insertToolBarBreak(formatToolBar);
+
+ menubar->addAction(menu_File->menuAction());
+ menubar->addAction(menu_Edit->menuAction());
+ menubar->addAction(menuF_ormat->menuAction());
+ menu_File->addAction(actionFileNew);
+ menu_File->addAction(actionFileOpen);
+ menu_File->addAction(actionFileSave);
+ menu_File->addAction(actionFileSaveAs);
+ menu_File->addSeparator();
+ menu_File->addAction(actionExit);
+ menu_Edit->addAction(actionEditUndo);
+ menu_Edit->addAction(actionEditRedo);
+ menu_Edit->addSeparator();
+ menu_Edit->addAction(actionEditCut);
+ menu_Edit->addAction(actionEditCopy);
+ menu_Edit->addAction(actionEditPaste);
+ menu_Edit->addSeparator();
+ menu_Edit->addAction(actionEditSelectAll);
+ menu_Edit->addSeparator();
+ menu_Edit->addAction(actionInsertImage);
+ menu_Edit->addAction(actionCreateLink);
+ menu_Edit->addAction(actionInsertHtml);
+ menuF_ormat->addAction(menuSt_yle->menuAction());
+ menuF_ormat->addAction(menu_Align->menuAction());
+ menuF_ormat->addSeparator();
+ menuF_ormat->addAction(actionFormatBold);
+ menuF_ormat->addAction(actionFormatItalic);
+ menuF_ormat->addAction(actionFormatUnderline);
+ menuF_ormat->addAction(actionFormatStrikethrough);
+ menuF_ormat->addSeparator();
+ menuF_ormat->addAction(actionFormatIncreaseIndent);
+ menuF_ormat->addAction(actionFormatDecreaseIndent);
+ menuF_ormat->addSeparator();
+ menuF_ormat->addAction(actionFormatNumberedList);
+ menuF_ormat->addAction(actionFormatBulletedList);
+ menuF_ormat->addSeparator();
+ menuF_ormat->addAction(actionFormatFontName);
+ menuF_ormat->addAction(actionFormatFontSize);
+ menuF_ormat->addSeparator();
+ menuF_ormat->addAction(actionFormatTextColor);
+ menuF_ormat->addAction(actionFormatBackgroundColor);
+ menuSt_yle->addAction(actionStyleParagraph);
+ menuSt_yle->addAction(actionStyleHeading1);
+ menuSt_yle->addAction(actionStyleHeading2);
+ menuSt_yle->addAction(actionStyleHeading3);
+ menuSt_yle->addAction(actionStyleHeading4);
+ menuSt_yle->addAction(actionStyleHeading5);
+ menuSt_yle->addAction(actionStyleHeading6);
+ menuSt_yle->addAction(actionStylePreformatted);
+ menuSt_yle->addAction(actionStyleAddress);
+ menu_Align->addAction(actionFormatAlignLeft);
+ menu_Align->addAction(actionFormatAlignCenter);
+ menu_Align->addAction(actionFormatAlignRight);
+ menu_Align->addAction(actionFormatAlignJustify);
+ standardToolBar->addAction(actionFileNew);
+ standardToolBar->addAction(actionFileOpen);
+ standardToolBar->addAction(actionFileSave);
+ standardToolBar->addSeparator();
+ standardToolBar->addAction(actionEditUndo);
+ standardToolBar->addAction(actionEditRedo);
+ standardToolBar->addSeparator();
+ standardToolBar->addAction(actionEditCut);
+ standardToolBar->addAction(actionEditCopy);
+ standardToolBar->addAction(actionEditPaste);
+ standardToolBar->addSeparator();
+ standardToolBar->addAction(actionZoomOut);
+ standardToolBar->addAction(actionZoomIn);
+ formatToolBar->addAction(actionFormatBold);
+ formatToolBar->addAction(actionFormatItalic);
+ formatToolBar->addAction(actionFormatUnderline);
+ formatToolBar->addAction(actionFormatStrikethrough);
+ formatToolBar->addAction(actionFormatFontSize);
+ formatToolBar->addAction(actionFormatTextColor);
+ formatToolBar->addSeparator();
+ formatToolBar->addAction(actionFormatAlignLeft);
+ formatToolBar->addAction(actionFormatAlignCenter);
+ formatToolBar->addAction(actionFormatAlignRight);
+ formatToolBar->addAction(actionFormatAlignJustify);
+ formatToolBar->addSeparator();
+ formatToolBar->addAction(actionFormatDecreaseIndent);
+ formatToolBar->addAction(actionFormatIncreaseIndent);
+ formatToolBar->addSeparator();
+ formatToolBar->addAction(actionFormatNumberedList);
+ formatToolBar->addAction(actionFormatBulletedList);
+ formatToolBar->addSeparator();
+ formatToolBar->addAction(actionInsertImage);
+ formatToolBar->addAction(actionCreateLink);
+ formatToolBar->addAction(actionInsertHtml);
+
+ retranslateUi(MainWindow);
+
+ tabWidget->setCurrentIndex(0);
+
+
+ QMetaObject::connectSlotsByName(MainWindow);
+ } // setupUi
+
+ void retranslateUi(QMainWindow *MainWindow)
+ {
+ MainWindow->setWindowTitle(QApplication::translate("MainWindow", "HTML Editor", 0, QApplication::UnicodeUTF8));
+ actionFileNew->setText(QApplication::translate("MainWindow", "&New", 0, QApplication::UnicodeUTF8));
+ actionFileNew->setShortcut(QApplication::translate("MainWindow", "Ctrl+N", 0, QApplication::UnicodeUTF8));
+ actionFileOpen->setText(QApplication::translate("MainWindow", "&Open...", 0, QApplication::UnicodeUTF8));
+ actionFileOpen->setShortcut(QApplication::translate("MainWindow", "Ctrl+O", 0, QApplication::UnicodeUTF8));
+ actionFileSave->setText(QApplication::translate("MainWindow", "&Save", 0, QApplication::UnicodeUTF8));
+ actionFileSave->setShortcut(QApplication::translate("MainWindow", "Ctrl+S", 0, QApplication::UnicodeUTF8));
+ actionFileSaveAs->setText(QApplication::translate("MainWindow", "Save &As...", 0, QApplication::UnicodeUTF8));
+ actionEditUndo->setText(QApplication::translate("MainWindow", "&Undo", 0, QApplication::UnicodeUTF8));
+ actionEditUndo->setShortcut(QApplication::translate("MainWindow", "Ctrl+Z", 0, QApplication::UnicodeUTF8));
+ actionEditRedo->setText(QApplication::translate("MainWindow", "&Redo", 0, QApplication::UnicodeUTF8));
+ actionEditRedo->setShortcut(QApplication::translate("MainWindow", "Ctrl+Y", 0, QApplication::UnicodeUTF8));
+ actionEditCut->setText(QApplication::translate("MainWindow", "Cu&t", 0, QApplication::UnicodeUTF8));
+ actionEditCut->setShortcut(QApplication::translate("MainWindow", "Ctrl+X", 0, QApplication::UnicodeUTF8));
+ actionEditCopy->setText(QApplication::translate("MainWindow", "&Copy", 0, QApplication::UnicodeUTF8));
+ actionEditCopy->setShortcut(QApplication::translate("MainWindow", "Ctrl+C", 0, QApplication::UnicodeUTF8));
+ actionEditPaste->setText(QApplication::translate("MainWindow", "&Paste", 0, QApplication::UnicodeUTF8));
+ actionEditPaste->setShortcut(QApplication::translate("MainWindow", "Ctrl+V", 0, QApplication::UnicodeUTF8));
+ actionEditSelectAll->setText(QApplication::translate("MainWindow", "Select A&ll", 0, QApplication::UnicodeUTF8));
+ actionEditSelectAll->setShortcut(QApplication::translate("MainWindow", "Ctrl+A", 0, QApplication::UnicodeUTF8));
+ actionFormatBold->setText(QApplication::translate("MainWindow", "&Bold", 0, QApplication::UnicodeUTF8));
+ actionFormatBold->setShortcut(QApplication::translate("MainWindow", "Ctrl+B", 0, QApplication::UnicodeUTF8));
+ actionFormatItalic->setText(QApplication::translate("MainWindow", "&Italic", 0, QApplication::UnicodeUTF8));
+ actionFormatItalic->setShortcut(QApplication::translate("MainWindow", "Ctrl+I", 0, QApplication::UnicodeUTF8));
+ actionFormatUnderline->setText(QApplication::translate("MainWindow", "&Underline", 0, QApplication::UnicodeUTF8));
+ actionFormatUnderline->setShortcut(QApplication::translate("MainWindow", "Ctrl+U", 0, QApplication::UnicodeUTF8));
+ actionFormatStrikethrough->setText(QApplication::translate("MainWindow", "&Strikethrough", 0, QApplication::UnicodeUTF8));
+ actionFormatAlignLeft->setText(QApplication::translate("MainWindow", "Align &Left", 0, QApplication::UnicodeUTF8));
+ actionFormatAlignCenter->setText(QApplication::translate("MainWindow", "Align &Center", 0, QApplication::UnicodeUTF8));
+ actionFormatAlignRight->setText(QApplication::translate("MainWindow", "Align &Right", 0, QApplication::UnicodeUTF8));
+ actionFormatAlignJustify->setText(QApplication::translate("MainWindow", "Align &Justify", 0, QApplication::UnicodeUTF8));
+ actionFormatIncreaseIndent->setText(QApplication::translate("MainWindow", "I&ncrease Indent", 0, QApplication::UnicodeUTF8));
+ actionFormatDecreaseIndent->setText(QApplication::translate("MainWindow", "&Decrease Indent", 0, QApplication::UnicodeUTF8));
+ actionFormatBulletedList->setText(QApplication::translate("MainWindow", "Bulle&ted List", 0, QApplication::UnicodeUTF8));
+ actionFormatNumberedList->setText(QApplication::translate("MainWindow", "&Numbered List", 0, QApplication::UnicodeUTF8));
+ actionInsertImage->setText(QApplication::translate("MainWindow", "Insert &Image...", 0, QApplication::UnicodeUTF8));
+ actionCreateLink->setText(QApplication::translate("MainWindow", "Create Link...", 0, QApplication::UnicodeUTF8));
+ actionZoomOut->setText(QApplication::translate("MainWindow", "Zoom Out", 0, QApplication::UnicodeUTF8));
+ actionZoomIn->setText(QApplication::translate("MainWindow", "Zoom In", 0, QApplication::UnicodeUTF8));
+ actionExit->setText(QApplication::translate("MainWindow", "E&xit", 0, QApplication::UnicodeUTF8));
+ actionExit->setShortcut(QApplication::translate("MainWindow", "Ctrl+Q", 0, QApplication::UnicodeUTF8));
+ actionStyleParagraph->setText(QApplication::translate("MainWindow", "&Paragraph", 0, QApplication::UnicodeUTF8));
+ actionStyleHeading1->setText(QApplication::translate("MainWindow", "Heading &1", 0, QApplication::UnicodeUTF8));
+ actionStyleHeading2->setText(QApplication::translate("MainWindow", "Heading &2", 0, QApplication::UnicodeUTF8));
+ actionStyleHeading3->setText(QApplication::translate("MainWindow", "Heading &3", 0, QApplication::UnicodeUTF8));
+ actionStyleHeading4->setText(QApplication::translate("MainWindow", "Heading &4", 0, QApplication::UnicodeUTF8));
+ actionStyleHeading5->setText(QApplication::translate("MainWindow", "Heading &5", 0, QApplication::UnicodeUTF8));
+ actionStyleHeading6->setText(QApplication::translate("MainWindow", "Heading &6", 0, QApplication::UnicodeUTF8));
+ actionStylePreformatted->setText(QApplication::translate("MainWindow", "Pre&formatted", 0, QApplication::UnicodeUTF8));
+ actionStyleAddress->setText(QApplication::translate("MainWindow", "&Address", 0, QApplication::UnicodeUTF8));
+ actionFormatFontName->setText(QApplication::translate("MainWindow", "&Font Name...", 0, QApplication::UnicodeUTF8));
+ actionFormatTextColor->setText(QApplication::translate("MainWindow", "Text &Color...", 0, QApplication::UnicodeUTF8));
+ actionFormatBackgroundColor->setText(QApplication::translate("MainWindow", "Bac&kground Color...", 0, QApplication::UnicodeUTF8));
+ actionFormatFontSize->setText(QApplication::translate("MainWindow", "Font Si&ze...", 0, QApplication::UnicodeUTF8));
+ actionInsertHtml->setText(QApplication::translate("MainWindow", "Insert HTML...", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ actionInsertHtml->setToolTip(QApplication::translate("MainWindow", "Insert HTML", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
+ tabWidget->setTabText(tabWidget->indexOf(tab), QApplication::translate("MainWindow", "Tab 1", 0, QApplication::UnicodeUTF8));
+ tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("MainWindow", "Tab 2", 0, QApplication::UnicodeUTF8));
+ menu_File->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8));
+ menu_Edit->setTitle(QApplication::translate("MainWindow", "&Edit", 0, QApplication::UnicodeUTF8));
+ menuF_ormat->setTitle(QApplication::translate("MainWindow", "F&ormat", 0, QApplication::UnicodeUTF8));
+ menuSt_yle->setTitle(QApplication::translate("MainWindow", "St&yle", 0, QApplication::UnicodeUTF8));
+ menu_Align->setTitle(QApplication::translate("MainWindow", "&Align", 0, QApplication::UnicodeUTF8));
+ standardToolBar->setWindowTitle(QApplication::translate("MainWindow", "Standard", 0, QApplication::UnicodeUTF8));
+ formatToolBar->setWindowTitle(QApplication::translate("MainWindow", "Formatting", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class MainWindow: public Ui_MainWindow {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_HTMLEDITOR_H
Added: trunk/sources/ui/ui_inserthtmldialog.h
===================================================================
--- trunk/sources/ui/ui_inserthtmldialog.h (rev 0)
+++ trunk/sources/ui/ui_inserthtmldialog.h 2013-04-01 13:49:34 UTC (rev 2081)
@@ -0,0 +1,78 @@
+/********************************************************************************
+** Form generated from reading UI file 'inserthtmldialog.ui'
+**
+** Created: Sun 31. Mar 20:12:38 2013
+** by: Qt User Interface Compiler version 4.8.4
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_INSERTHTMLDIALOG_H
+#define UI_INSERTHTMLDIALOG_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QDialog>
+#include <QtGui/QDialogButtonBox>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QPlainTextEdit>
+#include <QtGui/QVBoxLayout>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Dialog
+{
+public:
+ QVBoxLayout *verticalLayout;
+ QLabel *label;
+ QPlainTextEdit *plainTextEdit;
+ QDialogButtonBox *buttonBox;
+
+ void setupUi(QDialog *Dialog)
+ {
+ if (Dialog->objectName().isEmpty())
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
+ Dialog->resize(426, 288);
+ verticalLayout = new QVBoxLayout(Dialog);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ label = new QLabel(Dialog);
+ label->setObjectName(QString::fromUtf8("label"));
+
+ verticalLayout->addWidget(label);
+
+ plainTextEdit = new QPlainTextEdit(Dialog);
+ plainTextEdit->setObjectName(QString::fromUtf8("plainTextEdit"));
+
+ verticalLayout->addWidget(plainTextEdit);
+
+ buttonBox = new QDialogButtonBox(Dialog);
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
+ buttonBox->setOrientation(Qt::Horizontal);
+ buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
+
+ verticalLayout->addWidget(buttonBox);
+
+
+ retranslateUi(Dialog);
+
+ QMetaObject::connectSlotsByName(Dialog);
+ } // setupUi
+
+ void retranslateUi(QDialog *Dialog)
+ {
+ Dialog->setWindowTitle(QApplication::translate("Dialog", "Insert HTML", 0, QApplication::UnicodeUTF8));
+ label->setText(QApplication::translate("Dialog", "HTML Code:", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Dialog: public Ui_Dialog {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_INSERTHTMLDIALOG_H