summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/journalentry.cpp49
-rw-r--r--korganizer/journalentry.h4
-rw-r--r--korganizer/kodaymatrix.cpp21
-rw-r--r--korganizer/koeventviewer.cpp3
-rw-r--r--korganizer/kojournalview.cpp22
-rw-r--r--korganizer/kojournalview.h2
-rw-r--r--korganizer/kolistview.cpp8
-rw-r--r--korganizer/searchdialog.cpp19
8 files changed, 91 insertions, 37 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 0b923ad..05bfd31 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -43,4 +43,5 @@
#include <kmessagebox.h>
#include "koprefs.h"
+#include <klineedit.h>
#include <libkcal/journal.h>
@@ -64,25 +65,15 @@ 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 );
-
QPushButton * toggleJournal = new QPushButton( vb );
icon = SmallIcon("1updownarrow");
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);
QPushButton * loadTemplate = new QPushButton( vb );
@@ -112,6 +103,6 @@ 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( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) );
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
}
@@ -119,5 +110,5 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
JournalEntry::~JournalEntry()
{
- qDebug("JournalEntry::~JournalEntry() ");
+ //qDebug("JournalEntry::~JournalEntry() ");
}
QSize JournalEntry::sizeHint() const
@@ -180,14 +171,11 @@ void JournalEntry::setDate(const QDate &date)
writeJournal();
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 +")");
- }
+ mTitleLabel->setText( " (" + calname +")");
}
void JournalEntry::toggleShowJournal()
{
+ flushEntry();
if ( showOnlyMode )
emit showJournalOnly( 0 );
@@ -195,5 +183,9 @@ void JournalEntry::toggleShowJournal()
emit showJournalOnly( mJournal );
}
-
+void JournalEntry::setShowOnly()
+{
+ showOnlyMode = true;
+ mEditor->setFocus();
+}
void JournalEntry::setJournal(Journal *journal)
{
@@ -201,13 +193,11 @@ 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));
- }
+ mTitleLabel->setText( " (" + calname +")");
+
mDirty = false;
}
@@ -275,6 +265,5 @@ 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
@@ -32,4 +32,5 @@
class QLabel;
class KTextEdit;
+class KLineEdit;
using namespace KCal;
@@ -49,5 +50,5 @@ class JournalEntry : public QFrame {
void flushEntry();
- void setShowOnly() {showOnlyMode = true;}
+ void setShowOnly();
QSize sizeHint() const;
@@ -74,4 +75,5 @@ class JournalEntry : public QFrame {
void keyPressEvent ( QKeyEvent * ) ;
QLabel *mTitleLabel;
+ KLineEdit * mTitle;
KTextEdit *mEditor;
int heiHint;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 3468657..067c34c 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -221,12 +221,21 @@ 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 )
+ 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 );
+ j = j_list.next();
}
}
@@ -550,5 +559,7 @@ void KODayMatrix::updateViewTimed()
if ( !holiStr.isEmpty() )
holiStr += "\n";
- holiStr += i18n("Journal");
+ holiStr += i18n("Journal: ")+todo->summary().left(25);
+ if ( todo->summary().length() > 25 )
+ holiStr +="...";
bDays.setBit(i);
mHolidays[i] =holiStr ;
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 6315827..dcbb99f 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -702,4 +702,7 @@ void KOEventViewer::appendJournal(Journal *jour, int mode )
mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer)));
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()) {
addTag("p",deTag(jour->description()));
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 9e354d3..4fc9013 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -28,8 +28,14 @@
#include <qscrollview.h>
#include <qpopupmenu.h>
+#include <qhbox.h>
+#include <qpushbutton.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qapplication.h>
#include <klocale.h>
#include <kdebug.h>
#include "koprefs.h"
+#include <kglobal.h>
#include <libkcal/calendar.h>
@@ -52,4 +58,19 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
sv->setResizePolicy( QScrollView:: AutoOneFit );
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();
}
@@ -171,4 +192,5 @@ void KOJournalView::showDates(const QDate &start, const QDate &)
{
mDate = start;
+ mDateLabel-> setText(KGlobal::locale()->formatDate(mDate));
QPtrList<Journal> jl = calendar()->journals4Date( start );
showList( jl );
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index 0437d95..331bdfa 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -28,4 +28,5 @@
class JournalEntry;
+class QLabel;
/**
@@ -71,4 +72,5 @@ class KOJournalView : public KOrg::BaseView
QBoxLayout *mTopLayout;
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
@@ -216,8 +216,14 @@ bool ListItemVisitor::visit(Todo *t)
bool ListItemVisitor::visit(Journal * j)
{
- QString des = j->description().left(30);
+
+ 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));
mItem->setText(1,j->dtStartDateStr());
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 0e9f64c..72359df 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -219,4 +219,7 @@ void SearchDialog::raiseAndSelect()
mSearchTodo->setChecked( false );
mSearchEvent->setChecked( false );
+ mSummaryCheck->setChecked( true );
+ mDescriptionCheck->setChecked( true );
+
}
}
@@ -551,4 +554,5 @@ void SearchDialog::search(const QRegExp &re)
if ( journ->dtStart().date() <= mEndDate->date()
&&journ->dtStart().date() >= mStartDate->date()) {
+ if (mDescriptionCheck->isChecked()) {
#if QT_VERSION >= 0x030000
if (re.search(journ->description()) != -1)
@@ -564,4 +568,19 @@ void SearchDialog::search(const QRegExp &re)
}
}
+ 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;
+ }
+ }
+ }
}
}