author | zautrix <zautrix> | 2005-06-30 05:32:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-30 05:32:10 (UTC) |
commit | da264cf19c0183d6ea4e8dab6eabd40994e351c8 (patch) (side-by-side diff) | |
tree | 061026fe6869c365641853b1ebba542b852046bc | |
parent | 4e850fa7aa99f92676e49466cfccaa5d5e0ec24c (diff) | |
download | kdepimpi-da264cf19c0183d6ea4e8dab6eabd40994e351c8.zip kdepimpi-da264cf19c0183d6ea4e8dab6eabd40994e351c8.tar.gz kdepimpi-da264cf19c0183d6ea4e8dab6eabd40994e351c8.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/journalentry.cpp | 37 | ||||
-rw-r--r-- | korganizer/journalentry.h | 3 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 6 |
3 files changed, 14 insertions, 32 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 58863fe..add874f 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -62,12 +62,11 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mCalendar = calendar; mJournal = 0; - mDirty = false; QHBox * vb = new QHBox ( this ); - QIconSet icon; + QPixmap iconp; QPushButton * toggleJournal = new QPushButton( vb ); - icon = SmallIcon("1updownarrow"); - toggleJournal->setIconSet (icon ) ; + iconp = SmallIcon("1updownarrow"); + toggleJournal->setPixmap (iconp ) ; new QLabel(i18n(" Title: "),vb); mTitle = new KLineEdit ( vb ); @@ -78,19 +77,18 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : QPushButton * saveTemplate = new QPushButton( vb ); if ( QApplication::desktop()->width() < 321 ) - icon = SmallIcon("fileexport16"); + iconp = SmallIcon("fileexport16"); else - icon = SmallIcon("fileexport"); - saveTemplate->setIconSet (icon ) ; + iconp = SmallIcon("fileexport"); + saveTemplate->setPixmap (iconp ) ; int size = saveTemplate->sizeHint().height(); if ( QApplication::desktop()->width() < 321 ) - icon = SmallIcon("fileimport16"); + iconp = SmallIcon("fileimport16"); else - icon = SmallIcon("fileimport"); - loadTemplate->setIconSet (icon ) ; + iconp = SmallIcon("fileimport"); + loadTemplate->setPixmap (iconp ) ; loadTemplate->setFixedSize( size, size ); saveTemplate->setFixedSize( size, size ); toggleJournal->setFixedSize( size , size ); mEditor = new KTextEdit(this); - connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); @@ -102,5 +100,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mEditor->installEventFilter(this); connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); - connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) ); connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); @@ -162,5 +159,4 @@ void JournalEntry::slotLoadTemplate() mEditor-> insertAt ( text, line, col, true ); //mEditor->setIgnoreMark( true ); - setDirty(); } void JournalEntry::setDate(const QDate &date) @@ -204,5 +200,4 @@ void JournalEntry::setJournal(Journal *journal) mTitleLabel->setText( " (" + calname +")"); - mDirty = false; } @@ -212,10 +207,4 @@ Journal *JournalEntry::journal() const } -void JournalEntry::setDirty() -{ - mDirty = true; - -// kdDebug() << "JournalEntry::setDirty()" << endl; -} void JournalEntry::clear() @@ -245,10 +234,7 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) void JournalEntry::writeJournal() { -// kdDebug() << "JournalEntry::writeJournal()" << endl; - if (!mDirty) return; - if (mEditor->text().isEmpty()) { + if (mEditor->text().isEmpty() && mTitle->text().isEmpty()) { if ( mJournal ) { - mDirty = false; bool conf = KOPrefs::instance()->mConfirm; KOPrefs::instance()->mConfirm = false; @@ -270,11 +256,8 @@ void JournalEntry::writeJournal() mJournal->setDescription(mEditor->text()); mJournal->setSummary(mTitle->text()); - mDirty = false; } void JournalEntry::flushEntry() { - if (!mDirty) return; - writeJournal(); } diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index b37cabd..f2db785 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -56,5 +56,4 @@ class JournalEntry : public QFrame { void slotSaveTemplate(); void slotLoadTemplate(); - void setDirty(); void toggleShowJournal(); signals: @@ -78,6 +77,4 @@ class JournalEntry : public QFrame { KTextEdit *mEditor; int heiHint; - - bool mDirty; }; diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index ff87ef4..cb9a2c0 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -60,10 +60,10 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, QHBox * vb = new QHBox ( parWid ); QPushButton * newJournal = new QPushButton( vb ); - QIconSet icon; + QPixmap icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("ko16old"); else icon = SmallIcon("ko24old"); - newJournal->setIconSet (icon ) ; + newJournal->setPixmap (icon ) ; int size = newJournal->sizeHint().height(); newJournal->setFixedSize( size, size ); @@ -139,4 +139,5 @@ void KOJournalView::clearList() void KOJournalView::newJournal() { + flushView(); Journal* mJournal = new Journal; mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); @@ -147,4 +148,5 @@ void KOJournalView::newJournal() void KOJournalView::showOnly ( Journal* j ) { + flushView(); if ( j == 0 ) { showDates( mDate, QDate() ); |