summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-29 11:08:57 (UTC)
committer zautrix <zautrix>2005-06-29 11:08:57 (UTC)
commit435e68d6ace30fb2121b718226e00be44971c617 (patch) (unidiff)
tree2b7d2793f0244db82a9cddbfab8957d13989ed20
parentb7044dfc9516d546683973985555c481d59fc677 (diff)
downloadkdepimpi-435e68d6ace30fb2121b718226e00be44971c617.zip
kdepimpi-435e68d6ace30fb2121b718226e00be44971c617.tar.gz
kdepimpi-435e68d6ace30fb2121b718226e00be44971c617.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp7
-rw-r--r--korganizer/journalentry.h2
-rw-r--r--korganizer/kojournalview.cpp11
-rw-r--r--korganizer/kojournalview.h1
4 files changed, 18 insertions, 3 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 7274849..0b923ad 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -53,12 +53,13 @@
53#ifndef DESKTOP_VERSION 53#ifndef DESKTOP_VERSION
54#include <qpe/qpeapplication.h> 54#include <qpe/qpeapplication.h>
55#endif 55#endif
56JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : 56JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
57 QFrame(parent) 57 QFrame(parent)
58{ 58{
59 heiHint = QApplication::desktop()->height() / 5 ;
59 showOnlyMode = false; 60 showOnlyMode = false;
60 mCalendar = calendar; 61 mCalendar = calendar;
61 mJournal = 0; 62 mJournal = 0;
62 mDirty = false; 63 mDirty = false;
63 64
64 QHBox * vb = new QHBox ( this ); 65 QHBox * vb = new QHBox ( this );
@@ -114,14 +115,18 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
114 connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) ); 115 connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) );
115 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); 116 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
116} 117}
117 118
118JournalEntry::~JournalEntry() 119JournalEntry::~JournalEntry()
119{ 120{
121 qDebug("JournalEntry::~JournalEntry() ");
122}
123QSize JournalEntry::sizeHint() const
124{
125 return QSize ( 240, heiHint );
120} 126}
121
122void JournalEntry::slotSaveTemplate() 127void JournalEntry::slotSaveTemplate()
123{ 128{
124 QString fileName =locateLocal( "templates", "journals" ); 129 QString fileName =locateLocal( "templates", "journals" );
125 QDir t_dir; 130 QDir t_dir;
126 if ( !t_dir.exists(fileName) ) 131 if ( !t_dir.exists(fileName) )
127 t_dir.mkdir ( fileName ); 132 t_dir.mkdir ( fileName );
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index 85ad5df..b0e9cc7 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -46,12 +46,13 @@ class JournalEntry : public QFrame {
46 void setDate(const QDate &); 46 void setDate(const QDate &);
47 47
48 void clear(); 48 void clear();
49 49
50 void flushEntry(); 50 void flushEntry();
51 void setShowOnly() {showOnlyMode = true;} 51 void setShowOnly() {showOnlyMode = true;}
52 QSize sizeHint() const;
52 53
53 protected slots: 54 protected slots:
54 void slotSaveTemplate(); 55 void slotSaveTemplate();
55 void slotLoadTemplate(); 56 void slotLoadTemplate();
56 void setDirty(); 57 void setDirty();
57 void toggleShowJournal(); 58 void toggleShowJournal();
@@ -70,11 +71,12 @@ class JournalEntry : public QFrame {
70 Calendar *mCalendar; 71 Calendar *mCalendar;
71 Journal *mJournal; 72 Journal *mJournal;
72 QDate mDate; 73 QDate mDate;
73 void keyPressEvent ( QKeyEvent * ) ; 74 void keyPressEvent ( QKeyEvent * ) ;
74 QLabel *mTitleLabel; 75 QLabel *mTitleLabel;
75 KTextEdit *mEditor; 76 KTextEdit *mEditor;
77 int heiHint;
76 78
77 bool mDirty; 79 bool mDirty;
78}; 80};
79 81
80#endif 82#endif
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index fae59d6..9e354d3 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -22,12 +22,13 @@
22*/ 22*/
23 23
24// 24//
25// View of Journal entries 25// View of Journal entries
26 26
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qscrollview.h>
28#include <qpopupmenu.h> 29#include <qpopupmenu.h>
29 30
30#include <klocale.h> 31#include <klocale.h>
31#include <kdebug.h> 32#include <kdebug.h>
32#include "koprefs.h" 33#include "koprefs.h"
33 34
@@ -40,13 +41,19 @@ using namespace KOrg;
40 41
41KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, 42KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
42 const char *name) 43 const char *name)
43 : KOrg::BaseView(calendar, parent, name) 44 : KOrg::BaseView(calendar, parent, name)
44{ 45{
45 mCalendar = calendar; 46 mCalendar = calendar;
46 mTopLayout = new QVBoxLayout(this); 47 QScrollView * sv = new QScrollView( this );
48 QHBoxLayout * hbl = new QHBoxLayout( this );
49 hbl->addWidget( sv );
50 parWid = new QWidget( sv->viewport() );
51 sv->addChild(parWid);
52 sv->setResizePolicy( QScrollView:: AutoOneFit );
53 mTopLayout = new QVBoxLayout(parWid);
47 getNewEntry(); 54 getNewEntry();
48} 55}
49 56
50KOJournalView::~KOJournalView() 57KOJournalView::~KOJournalView()
51{ 58{
52} 59}
@@ -54,13 +61,13 @@ KOJournalView::~KOJournalView()
54int KOJournalView::currentDateCount() 61int KOJournalView::currentDateCount()
55{ 62{
56 return 0; 63 return 0;
57} 64}
58JournalEntry* KOJournalView::getNewEntry() 65JournalEntry* KOJournalView::getNewEntry()
59{ 66{
60 JournalEntry* Entry = new JournalEntry(mCalendar,this); 67 JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
61 jEntries.append( Entry ); 68 jEntries.append( Entry );
62 mTopLayout->addWidget(Entry); 69 mTopLayout->addWidget(Entry);
63 Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); 70 Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
64 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; 71 connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
65 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; 72 connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ;
66 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; 73 connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ;
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index aabf11c..0437d95 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -66,11 +66,12 @@ class KOJournalView : public KOrg::BaseView
66 void showList(QPtrList<Journal> jl); 66 void showList(QPtrList<Journal> jl);
67 Calendar *mCalendar; 67 Calendar *mCalendar;
68 JournalEntry* getNewEntry(); 68 JournalEntry* getNewEntry();
69 QPtrList<JournalEntry> jEntries; 69 QPtrList<JournalEntry> jEntries;
70 void keyPressEvent ( QKeyEvent * ) ; 70 void keyPressEvent ( QKeyEvent * ) ;
71 QBoxLayout *mTopLayout; 71 QBoxLayout *mTopLayout;
72 QWidget *parWid;
72 QDate mDate; 73 QDate mDate;
73 74
74}; 75};
75 76
76#endif 77#endif