File korganizer-journal-sending.diff of Package kdepim3
diff -u korganizer.old/actionmanager.cpp korganizer/actionmanager.cpp
--- korganizer.old/actionmanager.cpp 2005-07-20 12:02:57.000000000 +0200
+++ korganizer/actionmanager.cpp 2005-08-01 17:57:06.000000000 +0200
@@ -414,6 +414,9 @@
mCalendarView,SLOT( newSubTodo() ),
mACollection, "new_subtodo" );
action->setEnabled( false );
+ new KAction( i18n("New &Journal..."), 0,
+ mCalendarView,SLOT( newJournal() ),
+ mACollection, "new_journal" );
connect( mCalendarView,SIGNAL( todoSelected( bool ) ),
action,SLOT( setEnabled( bool ) ) );
diff -u korganizer.old/calendarview.cpp korganizer/calendarview.cpp
--- korganizer.old/calendarview.cpp 2005-07-20 12:02:57.000000000 +0200
+++ korganizer/calendarview.cpp 2005-08-02 18:57:46.797272766 +0200
@@ -965,6 +965,13 @@
todoEditor->show();
}
+void CalendarView::newJournal()
+{
+ kdDebug(5850) << "CalendarView::newJournal()" << endl;
+ QDate date = mNavigator->selectedDates().first();
+ newJournal( date );
+}
+
void CalendarView::newJournal( const QDate &date )
{
KOJournalEditor *journalEditor = mDialogManager->getJournalEditor();
diff -u korganizer.old/calendarview.h korganizer/calendarview.h
--- korganizer.old/calendarview.h 2005-05-23 14:12:59.000000000 +0200
+++ korganizer/calendarview.h 2005-08-01 17:57:06.000000000 +0200
@@ -312,6 +312,7 @@
void newTodo( const QString &summary, const QString &description,
const QString &attachment, const QStringList &attendees );
+ void newJournal();
void newJournal( const QDate &date );
void newJournal( const QString &text, const QDate &date );
void newJournal( const QString &text );
Common subdirectories: korganizer.old/interfaces and korganizer/interfaces
diff -u korganizer.old/journalentry.cpp korganizer/journalentry.cpp
--- korganizer.old/journalentry.cpp 2005-05-23 14:12:59.000000000 +0200
+++ korganizer/journalentry.cpp 2005-08-01 17:57:06.000000000 +0200
@@ -72,7 +72,7 @@
mTitle->setMargin(2);
mTitle->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
connect( mTitle, SIGNAL( linkClicked( const QString & ) ),
- this, SLOT( newJournal() ) );
+ this, SLOT( emitNewJournal() ) );
}
JournalDateEntry::~JournalDateEntry()
@@ -104,6 +104,7 @@
mEntries.clear();
}
+// should only be called by the KOJournalView now.
void JournalDateEntry::addJournal( Journal *j )
{
QMap<Journal*,JournalEntry*>::Iterator pos = mEntries.find( j );
@@ -123,6 +124,8 @@
entry, SLOT( flushEntry() ) );
connect( entry, SIGNAL( deleteIncidence( Incidence* ) ),
this, SIGNAL( deleteIncidence( Incidence* ) ) );
+ connect( entry, SIGNAL( editIncidence( Incidence* ) ),
+ this, SIGNAL( editIncidence( Incidence* ) ) );
}
Journal::List JournalDateEntry::journals() const
@@ -142,15 +145,9 @@
emit setIncidenceChangerSignal( changer );
}
-void JournalDateEntry::newJournal()
+void JournalDateEntry::emitNewJournal()
{
- Journal *j = new Journal();
- j->setDtStart( QDateTime( mDate, QTime(0,0,0) ) );
- if ( mCalendar->addIncidence( j ) ) {
- addJournal( j );
- } else {
- delete j;
- }
+ emit newJournal( mDate );
}
void JournalDateEntry::journalEdited( Journal *journal )
@@ -161,6 +158,7 @@
pos.data()->setJournal( journal );
}
+
void JournalDateEntry::journalDeleted( Journal *journal )
{
QMap<Journal*,JournalEntry*>::Iterator pos = mEntries.find( journal );
@@ -178,6 +176,7 @@
{
//kdDebug(5850)<<"JournalEntry::JournalEntry, parent="<<parent<<endl;
mDirty = false;
+ mWriteInProgress = false;
mChanger = 0;
mReadOnly = false;
@@ -214,10 +213,17 @@
connect( mDeleteButton, SIGNAL(pressed()), this, SLOT(deleteItem()) );
+ mEditButton = new KPushButton( this, "editButton" );
+ mEditButton->setPixmap( KOGlobals::self()->smallIcon( "edit" ) );
+ mEditButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ QToolTip::add( mEditButton, i18n("Edit this journal entry") );
+ QWhatsThis::add( mEditButton, i18n("Opens an editor dialog for this journal entry") );
+ mLayout->addWidget( mEditButton, 0, 5 );
+ connect( mEditButton, SIGNAL(clicked()), this, SLOT( editItem() ) );
mEditor = new KTextEdit(this);
- mLayout->addMultiCellWidget( mEditor, 1, 2, 0, 4 );
+ mLayout->addMultiCellWidget( mEditor, 1, 2, 0, 5 );
connect( mTitleEdit, SIGNAL(textChanged( const QString& )), SLOT(setDirty()) );
connect( mTimeCheck, SIGNAL(toggled(bool)), SLOT(setDirty()) );
@@ -248,6 +254,12 @@
// }
}
+void JournalEntry::editItem()
+{
+ if ( mJournal )
+ emit editIncidence( mJournal );
+}
+
void JournalEntry::setReadOnly( bool readonly )
{
mReadOnly = readonly;
@@ -267,7 +279,8 @@
void JournalEntry::setJournal(Journal *journal)
{
- writeJournal();
+ if ( !mWriteInProgress )
+ writeJournal();
if ( !journal ) return;
mJournal = journal;
@@ -327,6 +340,7 @@
return;
}
bool newJournal = false;
+ mWriteInProgress = true;
Journal *oldJournal = 0;
@@ -349,6 +363,7 @@
delete oldJournal;
}
mDirty = false;
+ mWriteInProgress = false;
}
void JournalEntry::flushEntry()
diff -u korganizer.old/journalentry.h korganizer/journalentry.h
--- korganizer.old/journalentry.h 2005-05-23 14:12:59.000000000 +0200
+++ korganizer/journalentry.h 2005-08-01 17:57:06.000000000 +0200
@@ -67,6 +67,7 @@
protected slots:
void setDirty();
+ void editItem();
void deleteItem();
public slots:
void setIncidenceChanger( IncidenceChangerBase *changer ) { mChanger = changer; }
@@ -75,6 +76,7 @@
signals:
void deleteIncidence( Incidence * );
+ void editIncidence( Incidence * );
protected:
void clearFields();
@@ -95,10 +97,12 @@
QCheckBox *mTimeCheck;
KTimeEdit *mTimeEdit;
KPushButton *mDeleteButton;
+ QButton *mEditButton;
QGridLayout *mLayout;
bool mDirty;
+ bool mWriteInProgress;
IncidenceChangerBase *mChanger;
};
@@ -124,10 +128,12 @@
void setIncidenceChangerSignal( IncidenceChangerBase *changer );
void setDateSignal( const QDate & );
void flushEntries();
+ void editIncidence( Incidence * );
void deleteIncidence( Incidence * );
+ void newJournal( const QDate & );
public slots:
- void newJournal();
+ void emitNewJournal();
void setIncidenceChanger( IncidenceChangerBase *changer );
void journalEdited( Journal* );
void journalDeleted( Journal* );
diff -u korganizer.old/kojournaleditor.cpp korganizer/kojournaleditor.cpp
--- korganizer.old/kojournaleditor.cpp 2005-05-23 14:12:59.000000000 +0200
+++ korganizer/kojournaleditor.cpp 2005-08-01 17:57:06.000000000 +0200
@@ -27,6 +27,7 @@
#include "kojournaleditor.h"
#include "koeditorgeneraljournal.h"
+#include "koeditordetails.h"
#include "kodialogmanager.h"
#include "koprefs.h"
@@ -56,6 +57,7 @@
void KOJournalEditor::init()
{
setupGeneral();
+ setupAttendeesTab();
}
void KOJournalEditor::reload()
@@ -188,22 +190,25 @@
void KOJournalEditor::setDefaults( const QDate &date )
{
mGeneral->setDefaults( date );
+ mDetails->setDefaults();
}
void KOJournalEditor::readJournal( Journal *journal )
{
kdDebug(5851)<<"read Journal"<<endl;
mGeneral->readJournal( journal );
+ mDetails->readEvent( journal );
}
void KOJournalEditor::writeJournal( Journal *journal )
{
mGeneral->writeJournal( journal );
+ mDetails->writeEvent( journal );
}
bool KOJournalEditor::validateInput()
{
- return mGeneral->validateInput();
+ return mGeneral->validateInput() && mDetails->validateInput();
}
int KOJournalEditor::msgItemDelete()
diff -u korganizer.old/kojournalview.cpp korganizer/kojournalview.cpp
--- korganizer.old/kojournalview.cpp 2005-05-23 14:12:59.000000000 +0200
+++ korganizer/kojournalview.cpp 2005-08-01 17:57:06.000000000 +0200
@@ -79,9 +79,13 @@
connect( this, SIGNAL( journalDeleted( Journal* ) ),
entry, SLOT( journalDeleted( Journal* ) ) );
+ connect( entry, SIGNAL( editIncidence( Incidence* ) ),
+ this, SIGNAL( editIncidenceSignal( Incidence* ) ) );
connect( entry, SIGNAL( deleteIncidence( Incidence* ) ),
this, SIGNAL( deleteIncidenceSignal( Incidence* ) ) );
+ connect( entry, SIGNAL( newJournal( const QDate & ) ),
+ this, SIGNAL( newJournalSignal( const QDate & ) ) );
mEntries.insert( dt, entry );
}
Common subdirectories: korganizer.old/korgac and korganizer/korgac
diff -u korganizer.old/korganizerui.rc korganizer/korganizerui.rc
--- korganizer.old/korganizerui.rc 2005-05-23 14:12:59.000000000 +0200
+++ korganizer/korganizerui.rc 2005-08-01 17:57:06.000000000 +0200
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui>
-<kpartgui name="korganizer" version="34">
+<kpartgui name="korganizer" version="35">
<MenuBar>
<Menu name="file"><text>&File</text>
@@ -60,6 +60,7 @@
<Action name="new_event"/>
<Action name="new_todo"/>
<Action name="new_subtodo"/>
+ <Action name="new_journal"/>
<Separator/>
<Action name="show_incidence"/>
<Action name="edit_incidence"/>
Common subdirectories: korganizer.old/pixmaps and korganizer/pixmaps
Common subdirectories: korganizer.old/plugins and korganizer/plugins
Common subdirectories: korganizer.old/printing and korganizer/printing
Common subdirectories: korganizer.old/sounds and korganizer/sounds