summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--korganizer/journalentry.cpp53
-rw-r--r--korganizer/journalentry.h4
-rw-r--r--korganizer/kodaymatrix.cpp27
-rw-r--r--korganizer/koeventviewer.cpp3
-rw-r--r--korganizer/kojournalview.cpp22
-rw-r--r--korganizer/kojournalview.h2
-rw-r--r--korganizer/kolistview.cpp14
-rw-r--r--korganizer/searchdialog.cpp37
9 files changed, 113 insertions, 54 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 4df2005..510f4bf 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1464,2 +1464,7 @@
{ "Timezone settings","Zeitzoneneinstellung" },
+{ " Title: "," Titel: " },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 0b923ad..05bfd31 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -44,2 +44,3 @@
#include "koprefs.h"
+#include <klineedit.h>
@@ -65,12 +66,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
QHBox * vb = new QHBox ( this );
- QPushButton * newJournal = new QPushButton( vb );
QIconSet icon;
- if ( QApplication::desktop()->width() < 321 )
- icon = SmallIcon("ko16old");
- else
- icon = SmallIcon("ko24old");
- newJournal->setIconSet (icon ) ;
- int size = newJournal->sizeHint().height();
- newJournal->setFixedSize( size, size );
-
@@ -79,9 +71,8 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
toggleJournal->setIconSet (icon ) ;
- //int size = toggleJournal->sizeHint().height();
+ int size = toggleJournal->sizeHint().height();
toggleJournal->setFixedSize( size * 2 /3 , size );
-
-
-
+ new QLabel(i18n(" Title: "),vb);
+ mTitle = new KLineEdit ( vb );
mTitleLabel = new QLabel(i18n("Title"),vb);
- mTitleLabel->setMargin(2);
+ mTitleLabel->setMargin(0);
mTitleLabel->setAlignment(AlignCenter);
@@ -113,4 +104,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
+ connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
- connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) );
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
@@ -120,3 +111,3 @@ JournalEntry::~JournalEntry()
{
- qDebug("JournalEntry::~JournalEntry() ");
+ //qDebug("JournalEntry::~JournalEntry() ");
}
@@ -181,8 +172,4 @@ void JournalEntry::setDate(const QDate &date)
int id = mCalendar->defaultCalendar();
- if ( id == 1 ) {
- mTitleLabel->setText(KGlobal::locale()->formatDate(date));
- } else {
- QString calname = KOPrefs::instance()->getCalendar( id )->mName;
- mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")");
- }
+ QString calname = KOPrefs::instance()->getCalendar( id )->mName;
+ mTitleLabel->setText( " (" + calname +")");
}
@@ -191,2 +178,3 @@ void JournalEntry::toggleShowJournal()
{
+ flushEntry();
if ( showOnlyMode )
@@ -196,3 +184,7 @@ void JournalEntry::toggleShowJournal()
}
-
+void JournalEntry::setShowOnly()
+{
+ showOnlyMode = true;
+ mEditor->setFocus();
+}
void JournalEntry::setJournal(Journal *journal)
@@ -202,11 +194,9 @@ void JournalEntry::setJournal(Journal *journal)
mJournal = journal;
-
+ mTitle->setText(mJournal->summary());
mEditor->setText(mJournal->description());
int id = mJournal->calID();
- if ( id > 1 ) {
- QString calname = KOPrefs::instance()->getCalendar( id )->mName;
- mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")");
- } else {
- mTitleLabel->setText(KGlobal::locale()->formatDate(mDate));
- }
+
+ QString calname = KOPrefs::instance()->getCalendar( id )->mName;
+ mTitleLabel->setText( " (" + calname +")");
+
mDirty = false;
@@ -276,4 +266,3 @@ void JournalEntry::writeJournal()
mJournal->setDescription(mEditor->text());
- //qDebug("tttt%s ", mEditor->text().latin1());
-
+ mJournal->setSummary(mTitle->text());
mDirty = false;
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index b0e9cc7..b37cabd 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -33,2 +33,3 @@ class QLabel;
class KTextEdit;
+class KLineEdit;
@@ -50,3 +51,3 @@ class JournalEntry : public QFrame {
void flushEntry();
- void setShowOnly() {showOnlyMode = true;}
+ void setShowOnly();
QSize sizeHint() const;
@@ -75,2 +76,3 @@ class JournalEntry : public QFrame {
QLabel *mTitleLabel;
+ KLineEdit * mTitle;
KTextEdit *mEditor;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 3468657..067c34c 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -222,10 +222,19 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
- Journal *j = mCalendar->journal( mDate );
- if ( j ) {
- QString mToolTipText = j->description().left(100);
- if ( j->description().length() > 100 )
- mToolTipText += " ...";
- mToolTipText = deTag( mToolTipText);
+ QPtrList<Journal> j_list = mCalendar->journals4Date( mDate );
+ Journal *j = j_list.first();
+ while ( j ) {
+ QString mToolTipText;
+ if ( !j->summary().isEmpty() ) {
+ mToolTipText = j->summary().left(30);
+ if ( j->summary().length() > 30 )
+ mToolTipText += " ...";
+ } else {
+ mToolTipText = j->description().left(25);
+ if ( j->description().length() > 25 )
+ mToolTipText += " ...";
+ mToolTipText = deTag( mToolTipText);
+ }
mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText;
- mToolTip.append( mToolTipText );
+ mToolTip.append( mToolTipText );
+ j = j_list.next();
}
@@ -551,3 +560,5 @@ void KODayMatrix::updateViewTimed()
holiStr += "\n";
- holiStr += i18n("Journal");
+ holiStr += i18n("Journal: ")+todo->summary().left(25);
+ if ( todo->summary().length() > 25 )
+ holiStr +="...";
bDays.setBit(i);
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 6315827..dcbb99f 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -703,2 +703,5 @@ void KOEventViewer::appendJournal(Journal *jour, int mode )
addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) );
+ if (!jour->summary().isEmpty()) {
+ addTag("p",i18n(" Title: ") + deTag(jour->summary()));
+ }
if (!jour->description().isEmpty()) {
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 9e354d3..4fc9013 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -29,2 +29,7 @@
#include <qpopupmenu.h>
+#include <qhbox.h>
+#include <qpushbutton.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qapplication.h>
@@ -33,2 +38,3 @@
#include "koprefs.h"
+#include <kglobal.h>
@@ -53,2 +59,17 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
mTopLayout = new QVBoxLayout(parWid);
+ QHBox * vb = new QHBox ( parWid );
+ QPushButton * newJournal = new QPushButton( vb );
+ QIconSet icon;
+ if ( QApplication::desktop()->width() < 321 )
+ icon = SmallIcon("ko16old");
+ else
+ icon = SmallIcon("ko24old");
+ newJournal->setIconSet (icon ) ;
+ int size = newJournal->sizeHint().height();
+ newJournal->setFixedSize( size, size );
+ mDateLabel = new QLabel ( vb );
+ mTopLayout->addWidget( vb );
+ mDateLabel->setMargin(2);
+ mDateLabel->setAlignment(AlignCenter);
+ connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
getNewEntry();
@@ -172,2 +193,3 @@ void KOJournalView::showDates(const QDate &start, const QDate &)
mDate = start;
+ mDateLabel-> setText(KGlobal::locale()->formatDate(mDate));
QPtrList<Journal> jl = calendar()->journals4Date( start );
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index 0437d95..331bdfa 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -29,2 +29,3 @@
class JournalEntry;
+class QLabel;
@@ -72,2 +73,3 @@ class KOJournalView : public KOrg::BaseView
QWidget *parWid;
+ QLabel * mDateLabel;
QDate mDate;
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 22d9ac0..0c1ac7a 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -217,6 +217,12 @@ bool ListItemVisitor::visit(Journal * j)
{
- QString des = j->description().left(30);
- des = des.simplifyWhiteSpace ();
- des.replace (QRegExp ("\\n"),"" );
- des.replace (QRegExp ("\\r"),"" );
+
+ QString des;
+ if ( !j->summary().isEmpty() ) {
+ des = j->summary();
+ } else {
+ des = j->description().left(30);
+ des = des.simplifyWhiteSpace ();
+ des.replace (QRegExp ("\\n"),"" );
+ des.replace (QRegExp ("\\r"),"" );
+ }
mItem->setText(0,i18n("Journal: ")+des.left(25));
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 0e9f64c..72359df 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -220,2 +220,5 @@ void SearchDialog::raiseAndSelect()
mSearchEvent->setChecked( false );
+ mSummaryCheck->setChecked( true );
+ mDescriptionCheck->setChecked( true );
+
}
@@ -552,14 +555,30 @@ void SearchDialog::search(const QRegExp &re)
&&journ->dtStart().date() >= mStartDate->date()) {
+ if (mDescriptionCheck->isChecked()) {
#if QT_VERSION >= 0x030000
- if (re.search(journ->description()) != -1)
+ if (re.search(journ->description()) != -1)
#else
- if (re.match(journ->description()) != -1)
+ if (re.match(journ->description()) != -1)
#endif
- {
- if ( mSubItems->isChecked() )
- mMatchedJournals.remove(journ);
- else if (!mMatchedJournals.contains( journ ))
- mMatchedJournals.append(journ);
- continue;
- }
+ {
+ if ( mSubItems->isChecked() )
+ mMatchedJournals.remove(journ);
+ else if (!mMatchedJournals.contains( journ ))
+ mMatchedJournals.append(journ);
+ continue;
+ }
+ }
+ if (mSummaryCheck->isChecked()) {
+#if QT_VERSION >= 0x030000
+ if (re.search(journ->summary()) != -1)
+#else
+ if (re.match(journ->summary()) != -1)
+#endif
+ {
+ if ( mSubItems->isChecked() )
+ mMatchedJournals.remove(journ);
+ else if (!mMatchedJournals.contains( journ ))
+ mMatchedJournals.append(journ);
+ continue;
+ }
+ }
}