summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-30 12:37:10 (UTC)
committer zautrix <zautrix>2005-06-30 12:37:10 (UTC)
commit4c19ba3345d1af263c02ebe564e56d9dec679347 (patch) (side-by-side diff)
tree1ac48610c5545998670fa1c14592ef4e1981ce94 /korganizer
parent13eb32c82e736b033435e596111b7b0f3fe75608 (diff)
downloadkdepimpi-4c19ba3345d1af263c02ebe564e56d9dec679347.zip
kdepimpi-4c19ba3345d1af263c02ebe564e56d9dec679347.tar.gz
kdepimpi-4c19ba3345d1af263c02ebe564e56d9dec679347.tar.bz2
fixx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp13
-rw-r--r--korganizer/journalentry.h1
-rw-r--r--korganizer/kojournalview.cpp12
3 files changed, 17 insertions, 9 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 9e2c902..ca8d5f7 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -162,8 +162,8 @@ void JournalEntry::slotLoadTemplate()
void JournalEntry::setDate(const QDate &date)
{
showOnlyMode = false;
- mDate = date;
writeJournal();
+ mDate = date;
int id = mCalendar->defaultCalendar();
QString calname = KOPrefs::instance()->getCalendar( id )->mName;
mTitleLabel->setText( " (" + calname +")");
@@ -179,13 +179,20 @@ void JournalEntry::toggleShowJournal()
// we have to protect mJournal from deleting if mJournal has empty text
visibleMode = false; // set to true via :setShowOnly()
emit showJournalOnly( mJournal );
+ //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) );
}
}
+void JournalEntry::setVisibleOn()
+{
+ visibleMode = true;
+}
void JournalEntry::setShowOnly()
{
showOnlyMode = true;
- mEditor->setFocus();
- visibleMode = true;
+ if ( mTitle->text().isEmpty() )
+ mTitle->setFocus();
+ else
+ mEditor->setFocus();
}
void JournalEntry::setJournal(Journal *journal)
{
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index e98d018..cc9b5ef 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -57,6 +57,7 @@ class JournalEntry : public QFrame {
void slotSaveTemplate();
void slotLoadTemplate();
void toggleShowJournal();
+ void setVisibleOn();
signals:
void deleteJournal(Journal *);
void newJournal();
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 7a96aa5..6fa9b23 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -155,7 +155,7 @@ void KOJournalView::newJournal()
void KOJournalView::showOnly ( Journal* j )
{
- //qDebug("showOnly %x ", j);
+ qDebug("showOnly %x ", j);
flushView();
if ( j == 0 ) {
showDates( mDate, QDate() );
@@ -169,7 +169,7 @@ void KOJournalView::showOnly ( Journal* j )
}
void KOJournalView::showList(QPtrList<Journal> jl)
{
- //qDebug("KOJournalView::showList %d",jl.count() );
+ qDebug("KOJournalView::showList %d",jl.count() );
JournalEntry* mEntry = jEntries.first();
JournalEntry* firstEntry = mEntry;
int count = jl.count();
@@ -177,16 +177,16 @@ void KOJournalView::showList(QPtrList<Journal> jl)
while ( iii < count ) {
if ( !mEntry ) {
mEntry = getNewEntry();
- mEntry->show();
- mEntry->setVisibleMode( true );
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii));
+ mEntry->setVisibleMode( true );
+ mEntry->show();
mEntry = 0;
} else {
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii));
- mEntry->show();
mEntry->setVisibleMode( true );
+ mEntry->show();
mEntry = jEntries.next();
}
++iii;
@@ -209,7 +209,7 @@ void KOJournalView::showList(QPtrList<Journal> jl)
void KOJournalView::showDates(const QDate &start, const QDate &)
{
mDate = start;
- mDateLabel-> setText(KGlobal::locale()->formatDate(mDate));
+ mDateLabel->setText(KGlobal::locale()->formatDate(mDate));
QPtrList<Journal> jl = calendar()->journals4Date( start );
showList( jl );
}