-rw-r--r-- | korganizer/journalentry.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 7274849..0b923ad 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -47,24 +47,25 @@ | |||
47 | #include <libkcal/calendarresources.h> | 47 | #include <libkcal/calendarresources.h> |
48 | #include <libkcal/resourcecalendar.h> | 48 | #include <libkcal/resourcecalendar.h> |
49 | #include <kresources/resourceselectdialog.h> | 49 | #include <kresources/resourceselectdialog.h> |
50 | 50 | ||
51 | #include "journalentry.h" | 51 | #include "journalentry.h" |
52 | //#include "journalentry.moc" | 52 | //#include "journalentry.moc" |
53 | #ifndef DESKTOP_VERSION | 53 | #ifndef DESKTOP_VERSION |
54 | #include <qpe/qpeapplication.h> | 54 | #include <qpe/qpeapplication.h> |
55 | #endif | 55 | #endif |
56 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | 56 | JournalEntry::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 ); |
65 | QPushButton * newJournal = new QPushButton( vb ); | 66 | QPushButton * newJournal = new QPushButton( vb ); |
66 | QIconSet icon; | 67 | QIconSet icon; |
67 | if ( QApplication::desktop()->width() < 321 ) | 68 | if ( QApplication::desktop()->width() < 321 ) |
68 | icon = SmallIcon("ko16old"); | 69 | icon = SmallIcon("ko16old"); |
69 | else | 70 | else |
70 | icon = SmallIcon("ko24old"); | 71 | icon = SmallIcon("ko24old"); |
@@ -108,26 +109,30 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
108 | QBoxLayout *topLayout = new QVBoxLayout(this); | 109 | QBoxLayout *topLayout = new QVBoxLayout(this); |
109 | topLayout->addWidget(vb); | 110 | topLayout->addWidget(vb); |
110 | topLayout->addWidget(mEditor); | 111 | topLayout->addWidget(mEditor); |
111 | mEditor->installEventFilter(this); | 112 | mEditor->installEventFilter(this); |
112 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 113 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
113 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 114 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
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 | ||
118 | JournalEntry::~JournalEntry() | 119 | JournalEntry::~JournalEntry() |
119 | { | 120 | { |
121 | qDebug("JournalEntry::~JournalEntry() "); | ||
122 | } | ||
123 | QSize JournalEntry::sizeHint() const | ||
124 | { | ||
125 | return QSize ( 240, heiHint ); | ||
120 | } | 126 | } |
121 | |||
122 | void JournalEntry::slotSaveTemplate() | 127 | void 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 ); |
128 | fileName += "/journal"; | 133 | fileName += "/journal"; |
129 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); | 134 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); |
130 | if ( fileName.length() == 0 ) | 135 | if ( fileName.length() == 0 ) |
131 | return; | 136 | return; |
132 | 137 | ||
133 | QFile fileIn( fileName ); | 138 | QFile fileIn( fileName ); |