X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Funicodedialog.h;h=1c7a83a0464d32f5dcd03ea300cfae2fed6c6621;hb=4f9bd66f4c236423b440b10ae1e543d162cec0ed;hp=b34f3c01a9240c5656df70e58ee66763809345a5;hpb=7ac877ea57663a02e9042939aa51eb700fbe4301;p=kdenlive diff --git a/src/unicodedialog.h b/src/unicodedialog.h index b34f3c01..1c7a83a0 100644 --- a/src/unicodedialog.h +++ b/src/unicodedialog.h @@ -10,38 +10,52 @@ #ifndef UNICODEDIALOG_H #define UNICODEDIALOG_H -#include "ui_unicodedialog_ui.h" - -class UnicodeDialog : public QDialog, public Ui::UnicodeDialog_UI +#include "ui_unicodewidget_ui.h" +#include +class UnicodeWidget; +class UnicodeDialog : public KDialog { Q_OBJECT - public: /** \brief The input method for the dialog. Atm only InputHex supported. */ enum InputMethod { InputHex, InputDec }; - - UnicodeDialog(InputMethod inputMeth); + explicit UnicodeDialog(InputMethod inputMeth, QWidget *parent = 0); ~UnicodeDialog(); +private Q_SLOTS: + void slotAccept(); + +Q_SIGNALS: + /** \brief Contains the selected unicode character; emitted when Enter is pressed. */ + void charSelected(const QString&); + +private: + UnicodeWidget *mUnicodeWidget; +}; + +class UnicodeWidget : public QWidget, public Ui::UnicodeWidget_UI +{ + Q_OBJECT +public: + + explicit UnicodeWidget(UnicodeDialog::InputMethod inputMeth, QWidget *parent = 0); + ~UnicodeWidget(); + /** \brief Returns infos about a unicode number. Extendable/improvable ;) */ QString unicodeInfo(const QString &unicode); void showLastUnicode(); protected: - virtual void wheelEvent(QWheelEvent * event); - -public slots: - /** \brief Override QDialog::exec() to assure the focus being on the unicode input field */ - int exec(); + void wheelEvent(QWheelEvent * event); private: - Ui::UnicodeDialog_UI m_view; + Ui::UnicodeWidget_UI m_view; enum Direction { Forward, Backward }; /** Selected input method */ - InputMethod inputMethod; + UnicodeDialog::InputMethod inputMethod; /** \brief Validates text and removes all invalid characters (non-hex e.g.) */ QString validateText(const QString &text); @@ -71,12 +85,15 @@ signals: /** \brief Contains the selected unicode character; emitted when Enter is pressed. */ void charSelected(const QString&); +public slots: + void slotReturnPressed(); + private slots: void slotTextChanged(const QString &text); - void slotReturnPressed(); void slotNextUnicode(); void slotPrevUnicode(); - }; + + #endif