summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kojournalview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 9e354d3..4fc9013 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -18,48 +18,69 @@
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
//
// View of Journal entries
#include <qlayout.h>
#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>
#include "journalentry.h"
#include "kojournalview.h"
using namespace KOrg;
KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
const char *name)
: KOrg::BaseView(calendar, parent, name)
{
mCalendar = calendar;
QScrollView * sv = new QScrollView( this );
QHBoxLayout * hbl = new QHBoxLayout( this );
hbl->addWidget( sv );
parWid = new QWidget( sv->viewport() );
sv->addChild(parWid);
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();
}
KOJournalView::~KOJournalView()
{
}
int KOJournalView::currentDateCount()
{
return 0;
}
JournalEntry* KOJournalView::getNewEntry()
@@ -161,24 +182,25 @@ void KOJournalView::showList(QPtrList<Journal> jl)
mEntry->clear();
if ( mEntry != firstEntry )
mEntry->hide();
else
mEntry->show();
mEntry = jEntries.next();
}
}
void KOJournalView::showDates(const QDate &start, const QDate &)
{
mDate = start;
+ mDateLabel-> setText(KGlobal::locale()->formatDate(mDate));
QPtrList<Journal> jl = calendar()->journals4Date( start );
showList( jl );
}
void KOJournalView::showEvents(QPtrList<Event>)
{
// After new creation of list view no events are selected.
// emit incidenceSelected( 0 );
}
void KOJournalView::changeEventDisplay(Event *, int /*action*/)
{