author | zautrix <zautrix> | 2005-06-30 04:35:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-30 04:35:32 (UTC) |
commit | 63147898391dbeabca2dc8f48730b324c15a7498 (patch) (unidiff) | |
tree | 6f42b6fc1d95ee584d44deb50726e94c02f986e5 | |
parent | 54dd512d3980381c2b02263462db03ae7c5a0264 (diff) | |
download | kdepimpi-63147898391dbeabca2dc8f48730b324c15a7498.zip kdepimpi-63147898391dbeabca2dc8f48730b324c15a7498.tar.gz kdepimpi-63147898391dbeabca2dc8f48730b324c15a7498.tar.bz2 |
fixxi
-rw-r--r-- | korganizer/journalentry.cpp | 7 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 232ea58..58863fe 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -40,86 +40,85 @@ | |||
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <ktextedit.h> | 41 | #include <ktextedit.h> |
42 | #include <kfiledialog.h> | 42 | #include <kfiledialog.h> |
43 | #include <kmessagebox.h> | 43 | #include <kmessagebox.h> |
44 | #include "koprefs.h" | 44 | #include "koprefs.h" |
45 | #include <klineedit.h> | 45 | #include <klineedit.h> |
46 | 46 | ||
47 | #include <libkcal/journal.h> | 47 | #include <libkcal/journal.h> |
48 | #include <libkcal/calendarresources.h> | 48 | #include <libkcal/calendarresources.h> |
49 | #include <libkcal/resourcecalendar.h> | 49 | #include <libkcal/resourcecalendar.h> |
50 | #include <kresources/resourceselectdialog.h> | 50 | #include <kresources/resourceselectdialog.h> |
51 | 51 | ||
52 | #include "journalentry.h" | 52 | #include "journalentry.h" |
53 | //#include "journalentry.moc" | 53 | //#include "journalentry.moc" |
54 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
55 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
56 | #endif | 56 | #endif |
57 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | 57 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : |
58 | QFrame(parent) | 58 | QFrame(parent) |
59 | { | 59 | { |
60 | heiHint = QApplication::desktop()->height() / 5 ; | 60 | heiHint = QApplication::desktop()->height() / 5 ; |
61 | showOnlyMode = false; | 61 | showOnlyMode = false; |
62 | mCalendar = calendar; | 62 | mCalendar = calendar; |
63 | mJournal = 0; | 63 | mJournal = 0; |
64 | mDirty = false; | 64 | mDirty = false; |
65 | 65 | ||
66 | QHBox * vb = new QHBox ( this ); | 66 | QHBox * vb = new QHBox ( this ); |
67 | QIconSet icon; | 67 | QIconSet icon; |
68 | 68 | ||
69 | QPushButton * toggleJournal = new QPushButton( vb ); | 69 | QPushButton * toggleJournal = new QPushButton( vb ); |
70 | icon = SmallIcon("1updownarrow"); | 70 | icon = SmallIcon("1updownarrow"); |
71 | toggleJournal->setIconSet (icon ) ; | 71 | toggleJournal->setIconSet (icon ) ; |
72 | int size = toggleJournal->sizeHint().height(); | ||
73 | toggleJournal->setFixedSize( size * 2 /3 , size ); | ||
74 | new QLabel(i18n(" Title: "),vb); | 72 | new QLabel(i18n(" Title: "),vb); |
75 | mTitle = new KLineEdit ( vb ); | 73 | mTitle = new KLineEdit ( vb ); |
76 | mTitleLabel = new QLabel(i18n("Title"),vb); | 74 | mTitleLabel = new QLabel(i18n("Title"),vb); |
77 | mTitleLabel->setMargin(0); | 75 | mTitleLabel->setMargin(0); |
78 | mTitleLabel->setAlignment(AlignCenter); | 76 | mTitleLabel->setAlignment(AlignCenter); |
79 | QPushButton * loadTemplate = new QPushButton( vb ); | 77 | QPushButton * loadTemplate = new QPushButton( vb ); |
80 | QPushButton * saveTemplate = new QPushButton( vb ); | 78 | QPushButton * saveTemplate = new QPushButton( vb ); |
81 | if ( QApplication::desktop()->width() < 321 ) | 79 | if ( QApplication::desktop()->width() < 321 ) |
82 | icon = SmallIcon("fileexport16"); | 80 | icon = SmallIcon("fileexport16"); |
83 | else | 81 | else |
84 | icon = SmallIcon("fileexport"); | 82 | icon = SmallIcon("fileexport"); |
85 | saveTemplate->setIconSet (icon ) ; | 83 | saveTemplate->setIconSet (icon ) ; |
86 | //size = saveTemplate->sizeHint().height(); | 84 | int size = saveTemplate->sizeHint().height(); |
87 | saveTemplate->setFixedSize( size, size ); | ||
88 | if ( QApplication::desktop()->width() < 321 ) | 85 | if ( QApplication::desktop()->width() < 321 ) |
89 | icon = SmallIcon("fileimport16"); | 86 | icon = SmallIcon("fileimport16"); |
90 | else | 87 | else |
91 | icon = SmallIcon("fileimport"); | 88 | icon = SmallIcon("fileimport"); |
92 | loadTemplate->setIconSet (icon ) ; | 89 | loadTemplate->setIconSet (icon ) ; |
93 | loadTemplate->setFixedSize( size, size ); | 90 | loadTemplate->setFixedSize( size, size ); |
91 | saveTemplate->setFixedSize( size, size ); | ||
92 | toggleJournal->setFixedSize( size , size ); | ||
94 | mEditor = new KTextEdit(this); | 93 | mEditor = new KTextEdit(this); |
95 | connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); | 94 | connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); |
96 | #ifndef DESKTOP_VERSION | 95 | #ifndef DESKTOP_VERSION |
97 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); | 96 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); |
98 | #endif | 97 | #endif |
99 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 98 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
100 | QBoxLayout *topLayout = new QVBoxLayout(this); | 99 | QBoxLayout *topLayout = new QVBoxLayout(this); |
101 | topLayout->addWidget(vb); | 100 | topLayout->addWidget(vb); |
102 | topLayout->addWidget(mEditor); | 101 | topLayout->addWidget(mEditor); |
103 | mEditor->installEventFilter(this); | 102 | mEditor->installEventFilter(this); |
104 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 103 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
105 | connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) ); | 104 | connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) ); |
106 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 105 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
107 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); | 106 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); |
108 | } | 107 | } |
109 | 108 | ||
110 | JournalEntry::~JournalEntry() | 109 | JournalEntry::~JournalEntry() |
111 | { | 110 | { |
112 | //qDebug("JournalEntry::~JournalEntry() "); | 111 | //qDebug("JournalEntry::~JournalEntry() "); |
113 | } | 112 | } |
114 | QSize JournalEntry::sizeHint() const | 113 | QSize JournalEntry::sizeHint() const |
115 | { | 114 | { |
116 | return QSize ( 240, heiHint ); | 115 | return QSize ( 240, heiHint ); |
117 | } | 116 | } |
118 | void JournalEntry::slotSaveTemplate() | 117 | void JournalEntry::slotSaveTemplate() |
119 | { | 118 | { |
120 | QString fileName =locateLocal( "templates", "journals" ); | 119 | QString fileName =locateLocal( "templates", "journals" ); |
121 | QDir t_dir; | 120 | QDir t_dir; |
122 | if ( !t_dir.exists(fileName) ) | 121 | if ( !t_dir.exists(fileName) ) |
123 | t_dir.mkdir ( fileName ); | 122 | t_dir.mkdir ( fileName ); |
124 | fileName += "/journal"; | 123 | fileName += "/journal"; |
125 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); | 124 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); |
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 4fc9013..ff87ef4 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -40,65 +40,65 @@ | |||
40 | 40 | ||
41 | #include <libkcal/calendar.h> | 41 | #include <libkcal/calendar.h> |
42 | 42 | ||
43 | #include "journalentry.h" | 43 | #include "journalentry.h" |
44 | 44 | ||
45 | #include "kojournalview.h" | 45 | #include "kojournalview.h" |
46 | using namespace KOrg; | 46 | using namespace KOrg; |
47 | 47 | ||
48 | KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, | 48 | KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, |
49 | const char *name) | 49 | const char *name) |
50 | : KOrg::BaseView(calendar, parent, name) | 50 | : KOrg::BaseView(calendar, parent, name) |
51 | { | 51 | { |
52 | mCalendar = calendar; | 52 | mCalendar = calendar; |
53 | QScrollView * sv = new QScrollView( this ); | 53 | QScrollView * sv = new QScrollView( this ); |
54 | QHBoxLayout * hbl = new QHBoxLayout( this ); | 54 | QHBoxLayout * hbl = new QHBoxLayout( this ); |
55 | hbl->addWidget( sv ); | 55 | hbl->addWidget( sv ); |
56 | parWid = new QWidget( sv->viewport() ); | 56 | parWid = new QWidget( sv->viewport() ); |
57 | sv->addChild(parWid); | 57 | sv->addChild(parWid); |
58 | sv->setResizePolicy( QScrollView:: AutoOneFit ); | 58 | sv->setResizePolicy( QScrollView:: AutoOneFit ); |
59 | mTopLayout = new QVBoxLayout(parWid); | 59 | mTopLayout = new QVBoxLayout(parWid); |
60 | QHBox * vb = new QHBox ( parWid ); | 60 | QHBox * vb = new QHBox ( parWid ); |
61 | QPushButton * newJournal = new QPushButton( vb ); | 61 | QPushButton * newJournal = new QPushButton( vb ); |
62 | QIconSet icon; | 62 | QIconSet icon; |
63 | if ( QApplication::desktop()->width() < 321 ) | 63 | if ( QApplication::desktop()->width() < 321 ) |
64 | icon = SmallIcon("ko16old"); | 64 | icon = SmallIcon("ko16old"); |
65 | else | 65 | else |
66 | icon = SmallIcon("ko24old"); | 66 | icon = SmallIcon("ko24old"); |
67 | newJournal->setIconSet (icon ) ; | 67 | newJournal->setIconSet (icon ) ; |
68 | int size = newJournal->sizeHint().height(); | 68 | int size = newJournal->sizeHint().height(); |
69 | newJournal->setFixedSize( size, size ); | 69 | newJournal->setFixedSize( size, size ); |
70 | mDateLabel = new QLabel ( vb ); | 70 | mDateLabel = new QLabel ( vb ); |
71 | mTopLayout->addWidget( vb ); | 71 | mTopLayout->addWidget( vb ); |
72 | mDateLabel->setMargin(2); | 72 | mDateLabel->setMargin(1); |
73 | mDateLabel->setAlignment(AlignCenter); | 73 | mDateLabel->setAlignment(AlignCenter); |
74 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); | 74 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); |
75 | getNewEntry(); | 75 | getNewEntry(); |
76 | } | 76 | } |
77 | 77 | ||
78 | KOJournalView::~KOJournalView() | 78 | KOJournalView::~KOJournalView() |
79 | { | 79 | { |
80 | } | 80 | } |
81 | 81 | ||
82 | int KOJournalView::currentDateCount() | 82 | int KOJournalView::currentDateCount() |
83 | { | 83 | { |
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
86 | JournalEntry* KOJournalView::getNewEntry() | 86 | JournalEntry* KOJournalView::getNewEntry() |
87 | { | 87 | { |
88 | JournalEntry* Entry = new JournalEntry(mCalendar,parWid); | 88 | JournalEntry* Entry = new JournalEntry(mCalendar,parWid); |
89 | jEntries.append( Entry ); | 89 | jEntries.append( Entry ); |
90 | mTopLayout->addWidget(Entry); | 90 | mTopLayout->addWidget(Entry); |
91 | Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); | 91 | Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); |
92 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; | 92 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; |
93 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; | 93 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; |
94 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; | 94 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; |
95 | return Entry; | 95 | return Entry; |
96 | } | 96 | } |
97 | 97 | ||
98 | QPtrList<Incidence> KOJournalView::selectedIncidences() | 98 | QPtrList<Incidence> KOJournalView::selectedIncidences() |
99 | { | 99 | { |
100 | QPtrList<Incidence> eventList; | 100 | QPtrList<Incidence> eventList; |
101 | 101 | ||
102 | return eventList; | 102 | return eventList; |
103 | } | 103 | } |
104 | void KOJournalView::updateConfig() | 104 | void KOJournalView::updateConfig() |