summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.pro6
-rw-r--r--core/pim/datebook/dateentryimpl.cpp1
-rw-r--r--core/pim/datebook/noteentry.ui28
-rw-r--r--core/pim/datebook/noteentryimpl.cpp1
-rw-r--r--core/pim/datebook/onoteedit.cpp19
-rw-r--r--core/pim/datebook/onoteedit.h19
6 files changed, 67 insertions, 7 deletions
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro
index 60c2b08..cf3ed30 100644
--- a/core/pim/datebook/datebook.pro
+++ b/core/pim/datebook/datebook.pro
@@ -11,9 +11,10 @@ HEADERS = datebookday.h \
datebookweeklst.h \
datebookweekheaderimpl.h \
repeatentry.h \
timepicker.h \
- noteentryimpl.h
+ noteentryimpl.h \
+ onoteedit.h
SOURCES = main.cpp \
datebookday.cpp \
datebook.cpp \
@@ -24,9 +25,10 @@ SOURCES = main.cpp \
datebookweeklst.cpp \
datebookweekheaderimpl.cpp \
repeatentry.cpp \
timepicker.cpp \
- noteentryimpl.cpp
+ noteentryimpl.cpp \
+ onoteedit.cpp
INTERFACES = dateentry.ui \
datebookdayheader.ui \
datebooksettingsbase.ui \
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index 9cc5073..dab3375 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -40,8 +40,9 @@
#include <qspinbox.h>
#include <qtoolbutton.h>
#include "timepicker.h"
+#include "onoteedit.h"
#include <stdlib.h>
#include <stdio.h>
diff --git a/core/pim/datebook/noteentry.ui b/core/pim/datebook/noteentry.ui
index ce3c4ad..0bea06e 100644
--- a/core/pim/datebook/noteentry.ui
+++ b/core/pim/datebook/noteentry.ui
@@ -52,17 +52,35 @@
<name>hAlign</name>
</property>
</widget>
<widget>
- <class>QMultiLineEdit</class>
+ <class>ONoteEdit</class>
<property stdset="1">
<name>name</name>
<cstring>note</cstring>
</property>
- <property stdset="1">
- <name>wordWrap</name>
- <enum>WidgetWidth</enum>
- </property>
</widget>
</vbox>
</widget>
+<customwidgets>
+ <customwidget>
+ <class>ONoteEdit</class>
+ <header location="local">onoteedit.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image>
+ <name>image0</name>
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
+ </image>
+</images>
</UI>
diff --git a/core/pim/datebook/noteentryimpl.cpp b/core/pim/datebook/noteentryimpl.cpp
index 9e1abb9..0e45985 100644
--- a/core/pim/datebook/noteentryimpl.cpp
+++ b/core/pim/datebook/noteentryimpl.cpp
@@ -1,8 +1,9 @@
#include "noteentryimpl.h"
#include "qstring.h"
#include "qmultilinedit.h"
#include "qlabel.h"
+#include "onoteedit.h"
NoteEntry::NoteEntry(const QString &title, const QString &noteStr,
QWidget* parent, const char* name, bool modal,
WFlags fl) :
diff --git a/core/pim/datebook/onoteedit.cpp b/core/pim/datebook/onoteedit.cpp
new file mode 100644
index 0000000..d66ad86
--- a/dev/null
+++ b/core/pim/datebook/onoteedit.cpp
@@ -0,0 +1,19 @@
+#include "onoteedit.h"
+
+ONoteEdit::ONoteEdit (QWidget * parent, const char * name) :
+ QMultiLineEdit(parent,name) {
+ setDefaultTabStop(2);
+ setWordWrap(WidgetWidth);
+}
+
+// Copy indentation from previous line
+void ONoteEdit::newLine() {
+ int l,c;
+ getCursorPosition(&l,&c);
+ QString s=textLine(l);
+
+ insert("\n");
+
+ int i=0;
+ while (s[i]==' ' || s[i]=='\t') insert(QString(s[i])), i++;
+}
diff --git a/core/pim/datebook/onoteedit.h b/core/pim/datebook/onoteedit.h
new file mode 100644
index 0000000..2f71d0d
--- a/dev/null
+++ b/core/pim/datebook/onoteedit.h
@@ -0,0 +1,19 @@
+#ifndef ONOTEEDIT_H
+#define ONOTEEDIT_H
+
+#include <qmultilineedit.h>
+
+class ONoteEdit: public QMultiLineEdit {
+
+ Q_OBJECT
+
+ public:
+
+ ONoteEdit (QWidget * parent=0, const char * name=0);
+
+ protected:
+
+ virtual void newLine ();
+};
+
+#endif