summaryrefslogtreecommitdiffabout
path: root/korganizer/kojournalview.cpp
authorzautrix <zautrix>2005-06-30 05:32:10 (UTC)
committer zautrix <zautrix>2005-06-30 05:32:10 (UTC)
commitda264cf19c0183d6ea4e8dab6eabd40994e351c8 (patch) (side-by-side diff)
tree061026fe6869c365641853b1ebba542b852046bc /korganizer/kojournalview.cpp
parent4e850fa7aa99f92676e49466cfccaa5d5e0ec24c (diff)
downloadkdepimpi-da264cf19c0183d6ea4e8dab6eabd40994e351c8.zip
kdepimpi-da264cf19c0183d6ea4e8dab6eabd40994e351c8.tar.gz
kdepimpi-da264cf19c0183d6ea4e8dab6eabd40994e351c8.tar.bz2
fixxx
Diffstat (limited to 'korganizer/kojournalview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kojournalview.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index ff87ef4..cb9a2c0 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -38,54 +38,54 @@
#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;
+ 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 );
mDateLabel = new QLabel ( vb );
mTopLayout->addWidget( vb );
mDateLabel->setMargin(1);
mDateLabel->setAlignment(AlignCenter);
connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
getNewEntry();
}
KOJournalView::~KOJournalView()
{
}
int KOJournalView::currentDateCount()
{
return 0;
}
JournalEntry* KOJournalView::getNewEntry()
{
JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
jEntries.append( Entry );
mTopLayout->addWidget(Entry);
Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
@@ -117,56 +117,58 @@ void KOJournalView::updateView()
mEntry = jEntries.next();
}
showDates( mDate, QDate() );
}
void KOJournalView::flushView()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->flushEntry();
mEntry = jEntries.next();
}
}
void KOJournalView::clearList()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->clear();
mEntry = jEntries.next();
}
}
void KOJournalView::newJournal()
{
+ flushView();
Journal* mJournal = new Journal;
mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
mCalendar->addJournal(mJournal);
showDates( mDate, QDate() );
}
void KOJournalView::showOnly ( Journal* j )
{
+ flushView();
if ( j == 0 ) {
showDates( mDate, QDate() );
return;
}
QPtrList<Journal> jl;
jl.append ( j );
showList( jl );
JournalEntry* mEntry = jEntries.first();
mEntry->setShowOnly();
}
void KOJournalView::showList(QPtrList<Journal> jl)
{
JournalEntry* mEntry = jEntries.first();
JournalEntry* firstEntry = mEntry;
int count = jl.count();
int iii = 0;
while ( iii < count ) {
if ( !mEntry ) {
mEntry = getNewEntry();
mEntry->show();
mEntry->setDate(mDate);
mEntry->setJournal(jl.at(iii));
mEntry = 0;
} else {