-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 6 | ||||
-rw-r--r-- | korganizer/journalentry.cpp | 83 | ||||
-rw-r--r-- | korganizer/journalentry.h | 2 | ||||
-rw-r--r-- | korganizer/koeventeditor.cpp | 4 | ||||
-rw-r--r-- | microkde/kfiledialog.cpp | 4 | ||||
-rw-r--r-- | microkde/ktextedit.h | 1 |
7 files changed, 99 insertions, 6 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 4421e61..41c60ea 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -3,48 +3,53 @@ Info about the changes in new versions of KDE-Pim/Pi | |||
3 | ********** VERSION 2.0.3 ************ | 3 | ********** VERSION 2.0.3 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Added feature for changing alarm settings for many items at once: | 6 | Added feature for changing alarm settings for many items at once: |
7 | Open list view (or search dialog), select the desired items and choose in | 7 | Open list view (or search dialog), select the desired items and choose in |
8 | the popup menu: Set alarm for selected... | 8 | the popup menu: Set alarm for selected... |
9 | 9 | ||
10 | Added to the event/todo viewer the option to send an email to | 10 | Added to the event/todo viewer the option to send an email to |
11 | all attendees or all selected (with RSVP) attendees. | 11 | all attendees or all selected (with RSVP) attendees. |
12 | 12 | ||
13 | Made the week-month mode changing in month view faster. | 13 | Made the week-month mode changing in month view faster. |
14 | 14 | ||
15 | Made month view better useable with keyboard. | 15 | Made month view better useable with keyboard. |
16 | Now TAB key jumps to next cell with an event/todo. | 16 | Now TAB key jumps to next cell with an event/todo. |
17 | Scroll in cell with coursor keys, scroll in time (next week) with | 17 | Scroll in cell with coursor keys, scroll in time (next week) with |
18 | Shift/Control + coursorkeys. | 18 | Shift/Control + coursorkeys. |
19 | 19 | ||
20 | Fixed bug that the todo view flat mode was reset after first view update. | 20 | Fixed bug that the todo view flat mode was reset after first view update. |
21 | 21 | ||
22 | If a todo is displayed closed in the todo view, | 22 | If a todo is displayed closed in the todo view, |
23 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. | 23 | it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. |
24 | 24 | ||
25 | Added info about the numbers of years to the caption (title) information about a birthday event. | 25 | Added info about the numbers of years to the caption (title) information about a birthday event. |
26 | 26 | ||
27 | Made completion date in todo editor editable. | ||
28 | |||
29 | Added possibility to save/load templates for journals. | ||
30 | (Which is just a simple "save text to file" or "insert text from file". | ||
31 | |||
27 | ********** VERSION 2.0.2 ************ | 32 | ********** VERSION 2.0.2 ************ |
28 | 33 | ||
29 | KO/Pi: | 34 | KO/Pi: |
30 | Fixed the layout problem of the day label buttons | 35 | Fixed the layout problem of the day label buttons |
31 | of the agenda view introduced in version 2.0.1. | 36 | of the agenda view introduced in version 2.0.1. |
32 | 37 | ||
33 | Added WhatsThis support for the todo view and the list view. | 38 | Added WhatsThis support for the todo view and the list view. |
34 | 39 | ||
35 | Added a quite useful feature to the montview. | 40 | Added a quite useful feature to the montview. |
36 | Just click on the week numbers on the left. | 41 | Just click on the week numbers on the left. |
37 | And in the top right corner of month view/agenda view | 42 | And in the top right corner of month view/agenda view |
38 | there is now a "week number quick selector". | 43 | there is now a "week number quick selector". |
39 | (Click on the black triangle). | 44 | (Click on the black triangle). |
40 | 45 | ||
41 | Made the quite difficult timezone change in KO/Pi easy. | 46 | Made the quite difficult timezone change in KO/Pi easy. |
42 | 47 | ||
43 | OM/Pi: | 48 | OM/Pi: |
44 | Fixed too small icons on desktop. | 49 | Fixed too small icons on desktop. |
45 | Fixed non visible icons in mainwindow on Z with fastload enabled. | 50 | Fixed non visible icons in mainwindow on Z with fastload enabled. |
46 | Added signature file setting to smtp account config. | 51 | Added signature file setting to smtp account config. |
47 | And the signature can be edited and saved in the edit mail dialog. | 52 | And the signature can be edited and saved in the edit mail dialog. |
48 | That does mean: | 53 | That does mean: |
49 | Simply edit the signature for the selected smtp account in the | 54 | Simply edit the signature for the selected smtp account in the |
50 | edit new mail dialog and press the "save signature" button there. | 55 | edit new mail dialog and press the "save signature" button there. |
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index b8080b5..5c18aaa 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1197,28 +1197,34 @@ | |||
1197 | { "Day view","Tagesansicht" }, | 1197 | { "Day view","Tagesansicht" }, |
1198 | { "Next days","Nächste Tage" }, | 1198 | { "Next days","Nächste Tage" }, |
1199 | { "Next week","Nächste Woche" }, | 1199 | { "Next week","Nächste Woche" }, |
1200 | { "Next two weeks","Nächste zwei Wochen" }, | 1200 | { "Next two weeks","Nächste zwei Wochen" }, |
1201 | { "Next month","Nächster Monat" }, | 1201 | { "Next month","Nächster Monat" }, |
1202 | { "Journal view","Journal" }, | 1202 | { "Journal view","Journal" }, |
1203 | { "Display all opened","Zeige alle geöffnet" }, | 1203 | { "Display all opened","Zeige alle geöffnet" }, |
1204 | { "Display all closed","Zeige alle geschlossen" }, | 1204 | { "Display all closed","Zeige alle geschlossen" }, |
1205 | { "Display all flat","Zeige alle flach" }, | 1205 | { "Display all flat","Zeige alle flach" }, |
1206 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1206 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1207 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1207 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1208 | { "Select week %1-%2","Selektiere Woche %1-%2" }, | 1208 | { "Select week %1-%2","Selektiere Woche %1-%2" }, |
1209 | { "Select Week","Selektiere Woche" }, | 1209 | { "Select Week","Selektiere Woche" }, |
1210 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1210 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1211 | { "Set Alarm!","Setze Alarm!" }, | 1211 | { "Set Alarm!","Setze Alarm!" }, |
1212 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1212 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1213 | { " and "," und " }, | 1213 | { " and "," und " }, |
1214 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1214 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1215 | { "Mail to selected","Mail an Ausgewählte" }, | 1215 | { "Mail to selected","Mail an Ausgewählte" }, |
1216 | { "Mail to all","Mail an Alle" }, | 1216 | { "Mail to all","Mail an Alle" }, |
1217 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1217 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1218 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1218 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1219 | { " on"," am" }, | 1219 | { " on"," am" }, |
1220 | { " completed on "," erledigt am " }, | 1220 | { " completed on "," erledigt am " }, |
1221 | { "Save as Event template","Speichere als Vorlage" }, | ||
1222 | { "Load Event template","Lade Termin Vorlage" }, | ||
1223 | { "Save as Journal template","Speichere als Journal Vorlage" }, | ||
1224 | { "Insert Journal template","Füge Journal Vorlage ein" }, | ||
1225 | { "","" }, | ||
1226 | { "","" }, | ||
1221 | { "","" }, | 1227 | { "","" }, |
1222 | { "","" }, | 1228 | { "","" }, |
1223 | { "","" }, | 1229 | { "","" }, |
1224 | { "","" }, | 1230 | { "","" }, |
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 7af5cf4..dca42e0 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -5,92 +5,170 @@ | |||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | // | 24 | // |
25 | // Journal Entry | 25 | // Journal Entry |
26 | 26 | ||
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qvbox.h> | ||
30 | #include <qfile.h> | ||
31 | #include <qdir.h> | ||
32 | #include <qtextstream.h> | ||
33 | #include <qtextcodec.h> | ||
34 | #include <qpixmap.h> | ||
35 | #include <qpushbutton.h> | ||
29 | 36 | ||
30 | #include <kdebug.h> | 37 | #include <kdebug.h> |
31 | #include <kglobal.h> | 38 | #include <kglobal.h> |
32 | #include <klocale.h> | 39 | #include <klocale.h> |
33 | #include <ktextedit.h> | 40 | #include <ktextedit.h> |
41 | #include <kfiledialog.h> | ||
42 | #include <kmessagebox.h> | ||
34 | #include "koprefs.h" | 43 | #include "koprefs.h" |
35 | 44 | ||
36 | #include <libkcal/journal.h> | 45 | #include <libkcal/journal.h> |
37 | #include <libkcal/calendarresources.h> | 46 | #include <libkcal/calendarresources.h> |
38 | #include <libkcal/resourcecalendar.h> | 47 | #include <libkcal/resourcecalendar.h> |
39 | #include <kresources/resourceselectdialog.h> | 48 | #include <kresources/resourceselectdialog.h> |
40 | 49 | ||
41 | #include "journalentry.h" | 50 | #include "journalentry.h" |
42 | //#include "journalentry.moc" | 51 | //#include "journalentry.moc" |
43 | #ifndef DESKTOP_VERSION | 52 | #ifndef DESKTOP_VERSION |
44 | #include <qpe/qpeapplication.h> | 53 | #include <qpe/qpeapplication.h> |
45 | #endif | 54 | #endif |
46 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | 55 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : |
47 | QFrame(parent) | 56 | QFrame(parent) |
48 | { | 57 | { |
49 | mCalendar = calendar; | 58 | mCalendar = calendar; |
50 | mJournal = 0; | 59 | mJournal = 0; |
51 | mDirty = false; | 60 | mDirty = false; |
52 | 61 | ||
53 | mTitleLabel = new QLabel(i18n("Title"),this); | 62 | QHBox * vb = new QHBox ( this ); |
63 | QPushButton * loadTemplate = new QPushButton( vb ); | ||
64 | QPushButton * saveTemplate = new QPushButton( vb ); | ||
65 | QIconSet icon; | ||
66 | if ( QApplication::desktop()->width() < 321 ) | ||
67 | icon = SmallIcon("fileexport16"); | ||
68 | else | ||
69 | icon = SmallIcon("fileexport"); | ||
70 | saveTemplate->setIconSet (icon ) ; | ||
71 | int size = saveTemplate->sizeHint().height(); | ||
72 | saveTemplate->setFixedSize( size, size ); | ||
73 | if ( QApplication::desktop()->width() < 321 ) | ||
74 | icon = SmallIcon("fileimport16"); | ||
75 | else | ||
76 | icon = SmallIcon("fileimport"); | ||
77 | loadTemplate->setIconSet (icon ) ; | ||
78 | loadTemplate->setFixedSize( size, size ); | ||
79 | |||
80 | mTitleLabel = new QLabel(i18n("Title"),vb); | ||
54 | mTitleLabel->setMargin(2); | 81 | mTitleLabel->setMargin(2); |
55 | mTitleLabel->setAlignment(AlignCenter); | 82 | mTitleLabel->setAlignment(AlignCenter); |
56 | 83 | ||
57 | mEditor = new KTextEdit(this); | 84 | mEditor = new KTextEdit(this); |
58 | connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); | 85 | connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); |
59 | #ifndef DESKTOP_VERSION | 86 | #ifndef DESKTOP_VERSION |
60 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); | 87 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); |
61 | #endif | 88 | #endif |
62 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 89 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
63 | QBoxLayout *topLayout = new QVBoxLayout(this); | 90 | QBoxLayout *topLayout = new QVBoxLayout(this); |
64 | topLayout->addWidget(mTitleLabel); | 91 | topLayout->addWidget(vb); |
65 | topLayout->addWidget(mEditor); | 92 | topLayout->addWidget(mEditor); |
66 | mEditor->installEventFilter(this); | 93 | mEditor->installEventFilter(this); |
94 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | ||
95 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | ||
67 | } | 96 | } |
68 | 97 | ||
69 | JournalEntry::~JournalEntry() | 98 | JournalEntry::~JournalEntry() |
70 | { | 99 | { |
71 | } | 100 | } |
72 | 101 | ||
102 | void JournalEntry::slotSaveTemplate() | ||
103 | { | ||
104 | QString fileName =locateLocal( "templates", "journals" ); | ||
105 | QDir t_dir; | ||
106 | if ( !t_dir.exists(fileName) ) | ||
107 | t_dir.mkdir ( fileName ); | ||
108 | fileName += "/journal"; | ||
109 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); | ||
110 | if ( fileName.length() == 0 ) | ||
111 | return; | ||
112 | |||
113 | QFile fileIn( fileName ); | ||
114 | if (!fileIn.open( IO_WriteOnly ) ) { | ||
115 | KMessageBox::error( this, i18n("Error saving template file\n '%1'.") | ||
116 | .arg( fileName ) ); | ||
117 | return; | ||
118 | } | ||
119 | // QString text; | ||
120 | QTextStream tsIn( &fileIn ); | ||
121 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | ||
122 | tsIn << mEditor->text(); | ||
123 | fileIn.close(); | ||
124 | } | ||
125 | void JournalEntry::slotLoadTemplate() | ||
126 | { | ||
127 | QString fileName =locateLocal( "templates", "journals" ); | ||
128 | QDir t_dir; | ||
129 | if ( !t_dir.exists(fileName) ) | ||
130 | t_dir.mkdir ( fileName ); | ||
131 | fileName += "/journal"; | ||
132 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this ); | ||
133 | if ( fileName.length() == 0 ) | ||
134 | return; | ||
135 | QFile fileIn( fileName ); | ||
136 | if (!fileIn.open( IO_ReadOnly ) ) { | ||
137 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | ||
138 | .arg( fileName ) ); | ||
139 | return; | ||
140 | } | ||
141 | QTextStream tsIn( &fileIn ); | ||
142 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | ||
143 | QString text = tsIn.read(); | ||
144 | fileIn.close(); | ||
145 | int line, col; | ||
146 | mEditor->getCursorPosition (& line, & col ); | ||
147 | mEditor-> insertAt ( text, line, col, true ); | ||
148 | //mEditor->setIgnoreMark( true ); | ||
149 | setDirty(); | ||
150 | } | ||
73 | void JournalEntry::setDate(const QDate &date) | 151 | void JournalEntry::setDate(const QDate &date) |
74 | { | 152 | { |
75 | writeJournal(); | 153 | writeJournal(); |
76 | 154 | ||
77 | mTitleLabel->setText(KGlobal::locale()->formatDate(date)); | 155 | mTitleLabel->setText(KGlobal::locale()->formatDate(date)); |
78 | 156 | ||
79 | 157 | ||
80 | mDate = date; | 158 | mDate = date; |
81 | } | 159 | } |
82 | 160 | ||
83 | void JournalEntry::setJournal(Journal *journal) | 161 | void JournalEntry::setJournal(Journal *journal) |
84 | { | 162 | { |
85 | writeJournal(); | 163 | writeJournal(); |
86 | 164 | ||
87 | mJournal = journal; | 165 | mJournal = journal; |
88 | 166 | ||
89 | mEditor->setText(mJournal->description()); | 167 | mEditor->setText(mJournal->description()); |
90 | 168 | ||
91 | mDirty = false; | 169 | mDirty = false; |
92 | } | 170 | } |
93 | 171 | ||
94 | Journal *JournalEntry::journal() const | 172 | Journal *JournalEntry::journal() const |
95 | { | 173 | { |
96 | return mJournal; | 174 | return mJournal; |
@@ -132,39 +210,40 @@ void JournalEntry::writeJournal() | |||
132 | // kdDebug() << "JournalEntry::writeJournal()" << endl; | 210 | // kdDebug() << "JournalEntry::writeJournal()" << endl; |
133 | if (!mDirty) return; | 211 | if (!mDirty) return; |
134 | 212 | ||
135 | if (mEditor->text().isEmpty()) { | 213 | if (mEditor->text().isEmpty()) { |
136 | if ( mJournal ) { | 214 | if ( mJournal ) { |
137 | mDirty = false; | 215 | mDirty = false; |
138 | bool conf = KOPrefs::instance()->mConfirm; | 216 | bool conf = KOPrefs::instance()->mConfirm; |
139 | KOPrefs::instance()->mConfirm = false; | 217 | KOPrefs::instance()->mConfirm = false; |
140 | emit deleteJournal(mJournal); | 218 | emit deleteJournal(mJournal); |
141 | KOPrefs::instance()->mConfirm = conf; | 219 | KOPrefs::instance()->mConfirm = conf; |
142 | mJournal = 0; | 220 | mJournal = 0; |
143 | } | 221 | } |
144 | return; | 222 | return; |
145 | } | 223 | } |
146 | 224 | ||
147 | // kdDebug() << "JournalEntry::writeJournal()..." << endl; | 225 | // kdDebug() << "JournalEntry::writeJournal()..." << endl; |
148 | 226 | ||
149 | if (!mJournal) { | 227 | if (!mJournal) { |
150 | mJournal = new Journal; | 228 | mJournal = new Journal; |
151 | mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); | 229 | mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); |
152 | mCalendar->addJournal(mJournal); | 230 | mCalendar->addJournal(mJournal); |
153 | } | 231 | } |
154 | 232 | ||
155 | mJournal->setDescription(mEditor->text()); | 233 | mJournal->setDescription(mEditor->text()); |
234 | //qDebug("tttt%s ", mEditor->text().latin1()); | ||
156 | 235 | ||
157 | mDirty = false; | 236 | mDirty = false; |
158 | } | 237 | } |
159 | 238 | ||
160 | void JournalEntry::flushEntry() | 239 | void JournalEntry::flushEntry() |
161 | { | 240 | { |
162 | if (!mDirty) return; | 241 | if (!mDirty) return; |
163 | 242 | ||
164 | writeJournal(); | 243 | writeJournal(); |
165 | } | 244 | } |
166 | void JournalEntry::keyPressEvent ( QKeyEvent * e ) | 245 | void JournalEntry::keyPressEvent ( QKeyEvent * e ) |
167 | { | 246 | { |
168 | e->ignore(); | 247 | e->ignore(); |
169 | 248 | ||
170 | } | 249 | } |
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index 1f784f4..f1a1fef 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h | |||
@@ -29,45 +29,47 @@ | |||
29 | 29 | ||
30 | #include <libkcal/calendar.h> | 30 | #include <libkcal/calendar.h> |
31 | 31 | ||
32 | class QLabel; | 32 | class QLabel; |
33 | class KTextEdit; | 33 | class KTextEdit; |
34 | 34 | ||
35 | using namespace KCal; | 35 | using namespace KCal; |
36 | 36 | ||
37 | class JournalEntry : public QFrame { | 37 | class JournalEntry : public QFrame { |
38 | Q_OBJECT | 38 | Q_OBJECT |
39 | public: | 39 | public: |
40 | JournalEntry(Calendar *,QWidget *parent); | 40 | JournalEntry(Calendar *,QWidget *parent); |
41 | virtual ~JournalEntry(); | 41 | virtual ~JournalEntry(); |
42 | 42 | ||
43 | void setJournal(Journal *); | 43 | void setJournal(Journal *); |
44 | Journal *journal() const; | 44 | Journal *journal() const; |
45 | 45 | ||
46 | void setDate(const QDate &); | 46 | void setDate(const QDate &); |
47 | 47 | ||
48 | void clear(); | 48 | void clear(); |
49 | 49 | ||
50 | void flushEntry(); | 50 | void flushEntry(); |
51 | 51 | ||
52 | protected slots: | 52 | protected slots: |
53 | void slotSaveTemplate(); | ||
54 | void slotLoadTemplate(); | ||
53 | void setDirty(); | 55 | void setDirty(); |
54 | signals: | 56 | signals: |
55 | void deleteJournal(Journal *); | 57 | void deleteJournal(Journal *); |
56 | 58 | ||
57 | protected: | 59 | protected: |
58 | bool eventFilter( QObject *o, QEvent *e ); | 60 | bool eventFilter( QObject *o, QEvent *e ); |
59 | 61 | ||
60 | void writeJournal(); | 62 | void writeJournal(); |
61 | 63 | ||
62 | private: | 64 | private: |
63 | Calendar *mCalendar; | 65 | Calendar *mCalendar; |
64 | Journal *mJournal; | 66 | Journal *mJournal; |
65 | QDate mDate; | 67 | QDate mDate; |
66 | void keyPressEvent ( QKeyEvent * ) ; | 68 | void keyPressEvent ( QKeyEvent * ) ; |
67 | QLabel *mTitleLabel; | 69 | QLabel *mTitleLabel; |
68 | KTextEdit *mEditor; | 70 | KTextEdit *mEditor; |
69 | 71 | ||
70 | bool mDirty; | 72 | bool mDirty; |
71 | }; | 73 | }; |
72 | 74 | ||
73 | #endif | 75 | #endif |
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 0ff99a4..337db9b 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp | |||
@@ -314,64 +314,64 @@ void KOEventEditor::writeEvent(Event *event) | |||
314 | 314 | ||
315 | bool KOEventEditor::validateInput() | 315 | bool KOEventEditor::validateInput() |
316 | { | 316 | { |
317 | if (!mGeneral->validateInput()) return false; | 317 | if (!mGeneral->validateInput()) return false; |
318 | if (!mDetails->validateInput()) return false; | 318 | if (!mDetails->validateInput()) return false; |
319 | if (!mRecurrence->validateInput()) return false; | 319 | if (!mRecurrence->validateInput()) return false; |
320 | return true; | 320 | return true; |
321 | } | 321 | } |
322 | 322 | ||
323 | int KOEventEditor::msgItemDelete() | 323 | int KOEventEditor::msgItemDelete() |
324 | { | 324 | { |
325 | return KMessageBox::warningContinueCancel(this, | 325 | return KMessageBox::warningContinueCancel(this, |
326 | i18n("This item will be permanently deleted."), | 326 | i18n("This item will be permanently deleted."), |
327 | i18n("KOrganizer Confirmation"),i18n("Delete")); | 327 | i18n("KOrganizer Confirmation"),i18n("Delete")); |
328 | } | 328 | } |
329 | 329 | ||
330 | void KOEventEditor::slotLoadTemplate() | 330 | void KOEventEditor::slotLoadTemplate() |
331 | { | 331 | { |
332 | 332 | ||
333 | QString fileName =locateLocal( "templates", "events" ); | 333 | QString fileName =locateLocal( "templates", "events" ); |
334 | QDir t_dir; | 334 | QDir t_dir; |
335 | if ( !t_dir.exists(fileName) ) | 335 | if ( !t_dir.exists(fileName) ) |
336 | t_dir.mkdir ( fileName ); | 336 | t_dir.mkdir ( fileName ); |
337 | fileName += "/event"; | 337 | fileName += "/event"; |
338 | fileName = KFileDialog::getSaveFileName( fileName , "Load Event template", this ); | 338 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this ); |
339 | if ( fileName.length() == 0 ) | 339 | if ( fileName.length() == 0 ) |
340 | return; | 340 | return; |
341 | CalendarLocal cal; | 341 | CalendarLocal cal; |
342 | ICalFormat format; | 342 | ICalFormat format; |
343 | if ( !format.load( &cal, fileName ) ) { | 343 | if ( !format.load( &cal, fileName ) ) { |
344 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 344 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
345 | .arg( fileName ) ); | 345 | .arg( fileName ) ); |
346 | return ; | 346 | return ; |
347 | } | 347 | } |
348 | QPtrList<Event> events = cal.events(); | 348 | QPtrList<Event> events = cal.events(); |
349 | Event* event = events.first(); | 349 | Event* event = events.first(); |
350 | if ( !event ) { | 350 | if ( !event ) { |
351 | KMessageBox::error( this, | 351 | KMessageBox::error( this, |
352 | i18n("Template does not contain\na valid Event.")); | 352 | i18n("Template does not contain\na valid Event.")); |
353 | } else { | 353 | } else { |
354 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; | 354 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; |
355 | readEvent( event, true ); | 355 | readEvent( event, true ); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | 359 | ||
360 | void KOEventEditor::slotSaveTemplate() | 360 | void KOEventEditor::slotSaveTemplate() |
361 | { | 361 | { |
362 | QString fileName =locateLocal( "templates", "events" ); | 362 | QString fileName =locateLocal( "templates", "events" ); |
363 | QDir t_dir; | 363 | QDir t_dir; |
364 | if ( !t_dir.exists(fileName) ) | 364 | if ( !t_dir.exists(fileName) ) |
365 | t_dir.mkdir ( fileName ); | 365 | t_dir.mkdir ( fileName ); |
366 | fileName += "/event"; | 366 | fileName += "/event"; |
367 | fileName = KFileDialog::getSaveFileName( fileName , "Save as Event template", this ); | 367 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Event template"), this ); |
368 | if ( fileName.length() > 0 ) | 368 | if ( fileName.length() > 0 ) |
369 | saveTemplate( fileName ); | 369 | saveTemplate( fileName ); |
370 | } | 370 | } |
371 | 371 | ||
372 | void KOEventEditor::saveTemplate( const QString &templateName ) | 372 | void KOEventEditor::saveTemplate( const QString &templateName ) |
373 | { | 373 | { |
374 | Event *event = new Event; | 374 | Event *event = new Event; |
375 | writeEvent( event ); | 375 | writeEvent( event ); |
376 | saveAsTemplate( event, templateName ); | 376 | saveAsTemplate( event, templateName ); |
377 | } | 377 | } |
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 309f8dc..3f47425 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp | |||
@@ -1,76 +1,76 @@ | |||
1 | #include <kfiledialog.h> | 1 | #include <kfiledialog.h> |
2 | #include <qdialog.h> | 2 | #include <qdialog.h> |
3 | #include <qlayout.h> | 3 | #include <qlayout.h> |
4 | #include <qdir.h> | 4 | #include <qdir.h> |
5 | #include <qfileinfo.h> | 5 | #include <qfileinfo.h> |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | #ifndef DESKTOP_VERSION | 8 | #ifndef DESKTOP_VERSION |
9 | //US orig#include <ofileselector.h> | 9 | //US orig#include <ofileselector.h> |
10 | #include <ofileselector_p.h> | 10 | #include <ofileselector_p.h> |
11 | QString KFileDialog::getSaveFileName( const QString & fn, | 11 | QString KFileDialog::getSaveFileName( const QString & fn, |
12 | const QString & cap , QWidget * par ) | 12 | const QString & cap , QWidget * par ) |
13 | { | 13 | { |
14 | QString retfile = ""; | 14 | QString retfile = ""; |
15 | QDialog dia ( par, "input-dialog", true ); | 15 | QDialog dia ( par, "input-dialog", true ); |
16 | QVBoxLayout lay( &dia ); | 16 | QVBoxLayout lay( &dia ); |
17 | lay.setMargin(7); | 17 | lay.setMargin(7); |
18 | lay.setSpacing(7); | 18 | lay.setSpacing(7); |
19 | dia.setCaption( cap ); | ||
20 | QString file = fn; | 19 | QString file = fn; |
21 | if ( file.isEmpty() ) | 20 | if ( file.isEmpty() ) |
22 | file = QDir::homeDirPath()+"/*"; | 21 | file = QDir::homeDirPath()+"/*"; |
23 | QFileInfo fi ( file ); | 22 | QFileInfo fi ( file ); |
24 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); | 23 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); |
25 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 24 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
26 | lay.addWidget( &o); | 25 | lay.addWidget( &o); |
27 | // o.setNewVisible( true ); | 26 | // o.setNewVisible( true ); |
28 | // o.setNameVisible( true ); | 27 | // o.setNameVisible( true ); |
29 | dia.showMaximized(); | 28 | dia.showMaximized(); |
29 | dia.setCaption( cap ); | ||
30 | int res = dia.exec(); | 30 | int res = dia.exec(); |
31 | if ( res ) | 31 | if ( res ) |
32 | retfile = o.selectedName(); | 32 | retfile = o.selectedName(); |
33 | return retfile; | 33 | return retfile; |
34 | } | 34 | } |
35 | 35 | ||
36 | QString KFileDialog::getOpenFileName( const QString & fn, | 36 | QString KFileDialog::getOpenFileName( const QString & fn, |
37 | const QString & cap, QWidget * par ) | 37 | const QString & cap, QWidget * par ) |
38 | { | 38 | { |
39 | QString retfile = ""; | 39 | QString retfile = ""; |
40 | QDialog dia ( par, "input-dialog", true ); | 40 | QDialog dia ( par, "input-dialog", true ); |
41 | // QLineEdit lab ( &dia ); | 41 | // QLineEdit lab ( &dia ); |
42 | QVBoxLayout lay( &dia ); | 42 | QVBoxLayout lay( &dia ); |
43 | lay.setMargin(7); | 43 | lay.setMargin(7); |
44 | lay.setSpacing(7); | 44 | lay.setSpacing(7); |
45 | dia.setCaption( cap ); | ||
46 | QString file = fn; | 45 | QString file = fn; |
47 | if ( file.isEmpty() ) | 46 | if ( file.isEmpty() ) |
48 | file = QDir::homeDirPath()+"/*";; | 47 | file = QDir::homeDirPath()+"/*";; |
49 | QFileInfo fi ( file ); | 48 | QFileInfo fi ( file ); |
50 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); | 49 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); |
51 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 50 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
52 | lay.addWidget( &o); | 51 | lay.addWidget( &o); |
53 | dia.showMaximized(); | 52 | dia.showMaximized(); |
53 | dia.setCaption( cap ); | ||
54 | int res = dia.exec(); | 54 | int res = dia.exec(); |
55 | if ( res ) | 55 | if ( res ) |
56 | retfile = o.selectedName(); | 56 | retfile = o.selectedName(); |
57 | return retfile; | 57 | return retfile; |
58 | } | 58 | } |
59 | 59 | ||
60 | #else | 60 | #else |
61 | 61 | ||
62 | #include <qfiledialog.h> | 62 | #include <qfiledialog.h> |
63 | 63 | ||
64 | QString KFileDialog::getSaveFileName( const QString & fn, | 64 | QString KFileDialog::getSaveFileName( const QString & fn, |
65 | const QString & cap , QWidget * par ) | 65 | const QString & cap , QWidget * par ) |
66 | { | 66 | { |
67 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); | 67 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); |
68 | } | 68 | } |
69 | QString KFileDialog::getOpenFileName( const QString & fn, | 69 | QString KFileDialog::getOpenFileName( const QString & fn, |
70 | const QString & cap, QWidget * par ) | 70 | const QString & cap, QWidget * par ) |
71 | { | 71 | { |
72 | 72 | ||
73 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); | 73 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); |
74 | } | 74 | } |
75 | #endif | 75 | #endif |
76 | 76 | ||
diff --git a/microkde/ktextedit.h b/microkde/ktextedit.h index c912f3b..87c0602 100644 --- a/microkde/ktextedit.h +++ b/microkde/ktextedit.h | |||
@@ -1,22 +1,23 @@ | |||
1 | #ifndef MICROKDE_KTEXTEDIT_H | 1 | #ifndef MICROKDE_KTEXTEDIT_H |
2 | #define MICROKDE_KTEXTEDIT_H | 2 | #define MICROKDE_KTEXTEDIT_H |
3 | 3 | ||
4 | #include <qmultilineedit.h> | 4 | #include <qmultilineedit.h> |
5 | 5 | ||
6 | class KTextEdit : public QMultiLineEdit | 6 | class KTextEdit : public QMultiLineEdit |
7 | { | 7 | { |
8 | public: | 8 | public: |
9 | KTextEdit( QWidget *parent ) ; | 9 | KTextEdit( QWidget *parent ) ; |
10 | void setIgnoreMark( bool b ) { mIgnoreMark = b; } | ||
10 | 11 | ||
11 | private: | 12 | private: |
12 | bool mAllowPopupMenu; | 13 | bool mAllowPopupMenu; |
13 | bool mMouseDown; | 14 | bool mMouseDown; |
14 | bool mIgnoreMark; | 15 | bool mIgnoreMark; |
15 | int mYMousePos; | 16 | int mYMousePos; |
16 | int mXMousePos; | 17 | int mXMousePos; |
17 | void mousePressEvent(QMouseEvent *e); | 18 | void mousePressEvent(QMouseEvent *e); |
18 | void mouseReleaseEvent(QMouseEvent *e); | 19 | void mouseReleaseEvent(QMouseEvent *e); |
19 | void mouseMoveEvent(QMouseEvent *e); | 20 | void mouseMoveEvent(QMouseEvent *e); |
20 | }; | 21 | }; |
21 | 22 | ||
22 | #endif | 23 | #endif |