widgets/colorval_ui.ui
widgets/positionval_ui.ui
widgets/titlewidget_ui.ui
+ widgets/unicodedialog_ui.ui
widgets/timelinebuttons_ui.ui
widgets/renderwidget_ui.ui
widgets/saveprofile_ui.ui
kdenlivesettingsdialog.cpp
complexparameter.cpp
titlewidget.cpp
+ unicodedialog.cpp
graphicsscenerectmove.cpp
effectslistwidget.cpp
titledocument.cpp
/***************************************************************************
- titlewidget.h - description
+ titlewidget.cpp - description
-------------------
begin : Feb 28 2008
copyright : (C) 2008 by Marco Gittler
m_endViewport(NULL),
m_render(render),
m_count(0),
+ m_unicodeDialog(new UnicodeDialog(UnicodeDialog::InputHex)),
m_projectPath(projectPath)
{
setupUi(this);
text_properties->setFixedHeight(frame_properties->height() + 4);
m_frameWidth = render->renderWidth();
m_frameHeight = render->renderHeight();
- //connect(newTextButton, SIGNAL(clicked()), this, SLOT(slotNewText()));
- //connect(newRectButton, SIGNAL(clicked()), this, SLOT(slotNewRect()));
- // kcolorbutton == The color of the background
connect(kcolorbutton, SIGNAL(clicked()), this, SLOT(slotChangeBackground())) ;
- // horizontalslider == The alpha of the background
connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(slotChangeBackground())) ;
connect(buttonAlignRight, SIGNAL(clicked()), this, SLOT(slotUpdateText()));
connect(buttonAlignCenter, SIGNAL(clicked()), this, SLOT(slotUpdateText()));
connect(buttonAlignNone, SIGNAL(clicked()), this, SLOT(slotUpdateText()));
+ connect(buttonInsertUnicode, SIGNAL(clicked()), this, SLOT(slotInsertUnicode()));
+ connect(m_unicodeDialog, SIGNAL(charSelected(QString)), this, SLOT(slotInsertUnicodeString(QString)));
connect(displayBg, SIGNAL(stateChanged(int)), this, SLOT(displayBackgroundFrame()));
// mbd
buttonAlignRight->setToolTip(i18n("Align right"));
buttonAlignLeft->setToolTip(i18n("Align left"));
buttonAlignCenter->setToolTip(i18n("Align center"));
+ buttonInsertUnicode->setToolTip(i18n("Insert Unicode character (Shift+Ctrl+U)"));
+ buttonInsertUnicode->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_U);
origin_x_left->setToolTip(i18n("Invert x axis and change 0 point"));
origin_y_top->setToolTip(i18n("Invert y axis and change 0 point"));
rectBColor->setToolTip(i18n("Select fill color"));
delete m_buttonSave;
delete m_buttonLoad;
+ delete m_unicodeDialog;
delete m_frameBorder;
delete m_frameImage;
delete m_startViewport;
updateTextOriginX();
updateTextOriginY();
frame_properties->setEnabled(false);
+ text_properties->setEnabled(false);
+ rect_properties->setEnabled(false);
if (blockX) origin_x_left->blockSignals(false);
if (blockY) origin_y_top->blockSignals(false);
} else if (l.size() == 1) {
//value_w->setValue((int) i->boundingRect().width());
//value_h->setValue((int) i->boundingRect().height());
frame_properties->setEnabled(true);
+ text_properties->setEnabled(true);
+ rect_properties->setEnabled(false);
value_w->setEnabled(false);
value_h->setEnabled(false);
//value_w->setValue((int) rec->rect().width());
//value_h->setValue((int) rec->rect().height());
frame_properties->setEnabled(true);
+ text_properties->setEnabled(false);
+ rect_properties->setEnabled(true);
value_w->setEnabled(true);
value_h->setEnabled(true);
- } else if (l.at(0)->type() == IMAGEITEM) {
- // TODO
+ } else if (l.at(0)->type() == IMAGEITEM) {
updateCoordinates(l.at(0));
updateDimension(l.at(0));
frame_properties->setEnabled(true);
+ text_properties->setEnabled(false);
+ rect_properties->setEnabled(false);
value_x->setEnabled(true);
value_w->setEnabled(false);
value_h->setEnabled(false);
+
} else {
//toolBox->setCurrentIndex(0);
frame_properties->setEnabled(false);
+ text_properties->setEnabled(false);
+ rect_properties->setEnabled(false);
}
zValue->setValue((int)l.at(0)->zValue());
itemzoom->setValue((int)(m_transformations.value(l.at(0)).scalex * 100.0 + 0.5));
}
}
+void TitleWidget::slotInsertUnicode()
+{
+ m_unicodeDialog->exec();
+}
+
+void TitleWidget::slotInsertUnicodeString(QString text)
+{
+ QList<QGraphicsItem *> l = graphicsView->scene()->selectedItems();
+ if (l.size() > 0) {
+ if (l.at(0)->type() == TEXTITEM) {
+ QGraphicsTextItem *t = static_cast <QGraphicsTextItem *> (l.at(0));
+ t->textCursor().insertText(text);
+ }
+ }
+}
+
void TitleWidget::slotUpdateText()
{
QFont font = font_family->currentFont();
#include "titledocument.h"
#include "renderer.h"
#include "graphicsscenerectmove.h"
+#include "unicodedialog.h"
#include <QMap>
QAction *m_buttonCursor;
QAction *m_buttonSave;
QAction *m_buttonLoad;
+ /** \brief Dialog for entering unicode in text fields */
+ UnicodeDialog *m_unicodeDialog;
/** project path for storing title clips */
QString m_projectPath;
/** \brief Store the current choices of font, background and rect values */
void slotZoomOneToOne();
void slotUpdateText();
+ void slotInsertUnicode();
+ void slotInsertUnicodeString(QString);
void displayBackgroundFrame();
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2008 by Simon Andreas Eugster (simon.eu@gmail.com) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+
+#include "unicodedialog.h"
+
+/// CONSTANTS
+
+const int MAX_LENGTH_HEX = 4;
+
+
+/// CONSTRUCTORS/DECONSTRUCTORS
+
+UnicodeDialog::UnicodeDialog(InputMethod inputMeth) : inputMethod(inputMeth), lastCursorPos(0), lastUnicodeNumber("")
+{
+ setupUi(this);
+ connect(unicodeNumber, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
+ connect(unicodeNumber, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
+
+ switch (inputMethod) {
+ case InputHex:
+ unicodeNumber->setMaxLength(MAX_LENGTH_HEX);
+ break;
+
+ case InputDec:
+ break;
+ }
+}
+
+UnicodeDialog::~UnicodeDialog()
+{
+}
+
+
+/// METHODS
+
+QString UnicodeDialog::unicodeInfo(QString unicode_number)
+{
+ QString infoText("");
+ QString u = unicode_number;
+
+ while (unicode_number.at(0) == QChar('0')) {
+ unicode_number = unicode_number.remove(0, 1);
+ }
+
+ if (false) {
+ // Just a placeholder for reason of ease (shifting around lines)
+ } else if (u == "2009") {
+ infoText = i18n("A thin space, in HTML also &thinsp;. See <a href=\"http://en.wikipedia.org/wiki/Space_(punctuation)\">Wikipedia:Space_(punctuation)</a>");
+ } else if (u == "2019") {
+ infoText = i18n("Punctuation Apostrophe. Should be used instead of U+0027. See <a href=\"http://en.wikipedia.org/wiki/Apostrophe\">Wikipedia:Apostrophe</a>");
+ } else if (u == "2013") {
+ infoText = i18n("An en Dash (dash of the width of an n). See <a href=\"http://en.wikipedia.org/wiki/Dash\">Wikipedia:Dash</a>");
+ } else if (u == "2014") {
+ infoText = i18n("An em Dash (dash of the widht of an m). See <a href=\"http://en.wikipedia.org/wiki/Dash\">Wikipedia:Dash</a>");
+ } else if (u == "2026") {
+ infoText = i18n("Ellipsis: If text has been left out. See <a href=\"http://en.wikipedia.org/wiki/Ellipsis\">Wikipedia:Ellipsis</a>");
+ }
+
+ return infoText;
+}
+
+/**
+ * Validates an Unicode number.
+ */
+QString UnicodeDialog::validateText(QString text)
+{
+ QRegExp regex("([0-9]|[a-f])", Qt::CaseInsensitive, QRegExp::RegExp2);
+ QString newText = "";
+ int pos = 0;
+
+ switch (inputMethod) {
+ case InputHex:
+ while ((pos = regex.indexIn(text, pos)) != -1) {
+ newText += regex.cap(1);
+ pos++;
+ }
+ break;
+
+ case InputDec:
+ // TODO
+ break;
+ }
+
+ return newText;
+}
+
+
+/// SLOTS
+
+/**
+ * \brief Validates the entered Unicode number and displays its Unicode character.
+ */
+void UnicodeDialog::slotTextChanged(QString text)
+{
+ unicodeNumber->blockSignals(true);
+
+ bool ok;
+ int cursorPos = unicodeNumber->cursorPosition();
+ QString newText = validateText(text);
+
+ unicodeNumber->setText(newText);
+ unicodeNumber->setCursorPosition(cursorPos);
+
+ uint value;
+ switch (inputMethod) {
+ case InputHex:
+ value = newText.toUInt(&ok, 16);
+ break;
+ case InputDec:
+ value = newText.toUInt(&ok, 10);
+ break;
+ }
+
+ if (!ok) {
+ //TODO!
+ }
+
+ // If an invalid character has been entered:
+ // Reset the cursor position because the entered char has been deleted.
+ if (text != newText && newText == lastUnicodeNumber) {
+ unicodeNumber->setCursorPosition(lastCursorPos);
+ }
+
+ lastCursorPos = unicodeNumber->cursorPosition();
+ lastUnicodeNumber = newText;
+
+ labelInfoText->setText(unicodeInfo(newText));
+ unicodeChar->setText(QChar(value));
+ unicodeNumber->blockSignals(false);
+}
+
+void UnicodeDialog::slotReturnPressed()
+{
+ emit charSelected(unicodeChar->text());
+ emit accept();
+}
+
+#include "unicodedialog.moc"
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2008 by Simon Andreas Eugster (simon.eu@gmail.com) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+
+#ifndef UNICODEDIALOG_H
+#define UNICODEDIALOG_H
+
+#include "ui_unicodedialog_ui.h"
+
+class UnicodeDialog : public QDialog, public Ui::UnicodeDialog_UI
+{
+ Q_OBJECT
+
+public:
+ /** \brief The input method for the dialog. Atm only InputHex supported. */
+ enum InputMethod { InputHex, InputDec };
+
+ UnicodeDialog(InputMethod inputMeth);
+ ~UnicodeDialog();
+
+ /** \brief Returns infos about an unicode number. Extendable/improvable ;) */
+ QString unicodeInfo(QString unicode_number);
+
+private:
+ Ui::UnicodeDialog_UI m_view;
+
+ /** Selected input method */
+ InputMethod inputMethod;
+ /** \brief Validates text and removes all invalid characters (non-hex e.g.) */
+ QString validateText(QString text);
+
+ int lastCursorPos;
+ QString lastUnicodeNumber;
+
+signals:
+ /** \brief Contains the selected unicode character; emitted when Enter is pressed. */
+ void charSelected(const QString&);
+
+private slots:
+ void slotTextChanged(QString text);
+ void slotReturnPressed();
+
+};
+
+#endif
<rect>
<x>0</x>
<y>0</y>
- <width>757</width>
+ <width>902</width>
<height>442</height>
</rect>
</property>
</property>
</widget>
</item>
+ <item>
+ <widget class="QToolButton" name="buttonInsertUnicode">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<rect>
<x>0</x>
<y>0</y>
- <width>358</width>
- <height>178</height>
+ <width>441</width>
+ <height>143</height>
</rect>
</property>
<attribute name="label">
<rect>
<x>0</x>
<y>0</y>
- <width>94</width>
- <height>65</height>
+ <width>441</width>
+ <height>143</height>
</rect>
</property>
<attribute name="label">
<rect>
<x>0</x>
<y>0</y>
- <width>232</width>
- <height>198</height>
+ <width>425</width>
+ <height>224</height>
</rect>
</property>
<attribute name="label">
<property name="text">
<string>+X</string>
</property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
</widget>
</item>
<item>
<property name="text">
<string>+Y</string>
</property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
</widget>
</item>
<item>
</layout>
</widget>
<customwidgets>
- <customwidget>
- <class>KIntSpinBox</class>
- <extends>QSpinBox</extends>
- <header>knuminput.h</header>
- </customwidget>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UnicodeDialog_UI</class>
+ <widget class="QDialog" name="UnicodeDialog_UI">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>614</width>
+ <height>315</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Enter Unicode value</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QFrame" name="frame">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>15</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string notr="true">U+</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="4">
+ <widget class="QLabel" name="unicodeChar">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>15</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="6">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="7">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="unicodeNumber">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>12</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>15</pointsize>
+ </font>
+ </property>
+ <property name="inputMask">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5">
+ <widget class="Line" name="line_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QFrame" name="frame_2">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <property name="text">
+ <string>Information about unicode characters: <a href="http://decodeunicode.org">http://decodeunicode.org</a> (Unicode database)</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="labelInfoText">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="font">
+ <font>
+ <italic>true</italic>
+ </font>
+ </property>
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <property name="text">
+ <string>Additional Information:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>