summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/journalentry.cpp8
-rw-r--r--korganizer/kodaymatrix.cpp3
-rw-r--r--korganizer/koeditorgeneral.cpp6
-rw-r--r--korganizer/koprefs.cpp14
5 files changed, 21 insertions, 12 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 214b829..d0de233 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2550,97 +2550,99 @@ void CalendarView::changeTodoDisplay(Todo *which, int action)
2550} 2550}
2551 2551
2552void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2552void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2553{ 2553{
2554 updateUnmanagedViews(); 2554 updateUnmanagedViews();
2555 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2555 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2556 if ( action == KOGlobals::EVENTDELETED ) { //delete 2556 if ( action == KOGlobals::EVENTDELETED ) { //delete
2557 mCalendar->checkAlarmForIncidence( 0, true ); 2557 mCalendar->checkAlarmForIncidence( 0, true );
2558 if ( mEventViewerDialog ) 2558 if ( mEventViewerDialog )
2559 mEventViewerDialog->hide(); 2559 mEventViewerDialog->hide();
2560 } 2560 }
2561 else 2561 else
2562 mCalendar->checkAlarmForIncidence( which , false ); 2562 mCalendar->checkAlarmForIncidence( which , false );
2563} 2563}
2564 2564
2565// most of the changeEventDisplays() right now just call the view's 2565// most of the changeEventDisplays() right now just call the view's
2566// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2566// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2567void CalendarView::changeEventDisplay(Event *which, int action) 2567void CalendarView::changeEventDisplay(Event *which, int action)
2568{ 2568{
2569 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2569 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2570 changeIncidenceDisplay((Incidence *)which, action); 2570 changeIncidenceDisplay((Incidence *)which, action);
2571 mDateNavigator->updateView(); 2571 mDateNavigator->updateView();
2572 //mDialogManager->updateSearchDialog(); 2572 //mDialogManager->updateSearchDialog();
2573 2573
2574 if (which) { 2574 if (which) {
2575 // If there is an event view visible update the display 2575 // If there is an event view visible update the display
2576 mViewManager->currentView()->changeEventDisplay(which,action); 2576 mViewManager->currentView()->changeEventDisplay(which,action);
2577 // TODO: check, if update needed 2577 // TODO: check, if update needed
2578 // if (which->getTodoStatus()) { 2578 // if (which->getTodoStatus()) {
2579 mTodoList->updateView(); 2579 mTodoList->updateView();
2580 // } 2580 // }
2581 } else { 2581 } else {
2582 mViewManager->currentView()->updateView(); 2582 mViewManager->currentView()->updateView();
2583 } 2583 }
2584} 2584}
2585 2585
2586 2586
2587void CalendarView::updateTodoViews() 2587void CalendarView::updateTodoViews()
2588{ 2588{
2589 mTodoList->updateView(); 2589 mTodoList->updateView();
2590 mViewManager->currentView()->updateView(); 2590 mViewManager->currentView()->updateView();
2591 2591
2592} 2592}
2593 2593
2594 2594
2595void CalendarView::updateView(const QDate &start, const QDate &end) 2595void CalendarView::updateView(const QDate &start, const QDate &end)
2596{ 2596{
2597#ifdef DESKTOP_VERSION 2597#ifdef DESKTOP_VERSION
2598 mDateScrollBar->blockSignals( true );
2598 mDateScrollBar->setValue( start.dayOfYear()-1); 2599 mDateScrollBar->setValue( start.dayOfYear()-1);
2600 mDateScrollBar->blockSignals( false );
2599#endif 2601#endif
2600 mTodoList->updateView(); 2602 mTodoList->updateView();
2601 mViewManager->updateView(start, end); 2603 mViewManager->updateView(start, end);
2602 //mDateNavigator->updateView(); 2604 //mDateNavigator->updateView();
2603} 2605}
2604 2606
2605void CalendarView::clearAllViews() 2607void CalendarView::clearAllViews()
2606{ 2608{
2607 mTodoList->clearList(); 2609 mTodoList->clearList();
2608 mViewManager->clearAllViews(); 2610 mViewManager->clearAllViews();
2609 SearchDialog * sd = mDialogManager->getSearchDialog(); 2611 SearchDialog * sd = mDialogManager->getSearchDialog();
2610 if ( sd ) { 2612 if ( sd ) {
2611 KOListView* kol = sd->listview(); 2613 KOListView* kol = sd->listview();
2612 if ( kol ) 2614 if ( kol )
2613 kol->clearList(); 2615 kol->clearList();
2614 } 2616 }
2615} 2617}
2616void CalendarView::updateView() 2618void CalendarView::updateView()
2617{ 2619{
2618 DateList tmpList = mNavigator->selectedDates(); 2620 DateList tmpList = mNavigator->selectedDates();
2619 2621
2620 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2622 if ( KOPrefs::instance()->mHideNonStartedTodos )
2621 mTodoList->updateView(); 2623 mTodoList->updateView();
2622 // We assume that the navigator only selects consecutive days. 2624 // We assume that the navigator only selects consecutive days.
2623 updateView( tmpList.first(), tmpList.last() ); 2625 updateView( tmpList.first(), tmpList.last() );
2624} 2626}
2625 2627
2626void CalendarView::updateUnmanagedViews() 2628void CalendarView::updateUnmanagedViews()
2627{ 2629{
2628 mDateNavigator->updateDayMatrix(); 2630 mDateNavigator->updateDayMatrix();
2629} 2631}
2630 2632
2631int CalendarView::msgItemDelete(const QString name) 2633int CalendarView::msgItemDelete(const QString name)
2632{ 2634{
2633 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2635 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2634 i18n("This item will be\npermanently deleted."), 2636 i18n("This item will be\npermanently deleted."),
2635 i18n("KO/Pi Confirmation"),i18n("Delete")); 2637 i18n("KO/Pi Confirmation"),i18n("Delete"));
2636} 2638}
2637 2639
2638 2640
2639void CalendarView::edit_cut() 2641void CalendarView::edit_cut()
2640{ 2642{
2641 Event *anEvent=0; 2643 Event *anEvent=0;
2642 2644
2643 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2645 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2644 2646
2645 if (mViewManager->currentView()->isEventView()) { 2647 if (mViewManager->currentView()->isEventView()) {
2646 if ( incidence && incidence->typeID() == eventID ) { 2648 if ( incidence && incidence->typeID() == eventID ) {
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index ca8d5f7..3c38f34 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -12,97 +12,103 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// 24//
25// Journal Entry 25// Journal Entry
26 26
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qvbox.h> 29#include <qvbox.h>
30#include <qfile.h> 30#include <qfile.h>
31#include <qdir.h> 31#include <qdir.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qtextcodec.h> 33#include <qtextcodec.h>
34#include <qpixmap.h> 34#include <qpixmap.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qapplication.h> 36#include <qapplication.h>
37 37
38#include <kdebug.h> 38#include <kdebug.h>
39#include <kglobal.h> 39#include <kglobal.h>
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
57JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : 57JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
58 QFrame(parent) 58 QFrame(parent)
59{ 59{
60 heiHint = QApplication::desktop()->height() / 5 ; 60
61 int fac = 5;
62 heiHint = QApplication::desktop()->height();
63 if ( heiHint > 800 )
64 fac += 2;
65 heiHint = heiHint / fac;
66
61 showOnlyMode = false; 67 showOnlyMode = false;
62 mCalendar = calendar; 68 mCalendar = calendar;
63 mJournal = 0; 69 mJournal = 0;
64 visibleMode = true; 70 visibleMode = true;
65 QHBox * vb = new QHBox ( this ); 71 QHBox * vb = new QHBox ( this );
66 QPixmap iconp; 72 QPixmap iconp;
67 73
68 QPushButton * toggleJournal = new QPushButton( vb ); 74 QPushButton * toggleJournal = new QPushButton( vb );
69 iconp = SmallIcon("1updownarrow"); 75 iconp = SmallIcon("1updownarrow");
70 toggleJournal->setPixmap (iconp ) ; 76 toggleJournal->setPixmap (iconp ) ;
71 new QLabel(" "+i18n("Title: "),vb); 77 new QLabel(" "+i18n("Title: "),vb);
72 mTitle = new KLineEdit ( vb ); 78 mTitle = new KLineEdit ( vb );
73 mTitleLabel = new QLabel(i18n("Title"),vb); 79 mTitleLabel = new QLabel(i18n("Title"),vb);
74 mTitleLabel->setMargin(0); 80 mTitleLabel->setMargin(0);
75 mTitleLabel->setAlignment(AlignCenter); 81 mTitleLabel->setAlignment(AlignCenter);
76 QPushButton * loadTemplate = new QPushButton( vb ); 82 QPushButton * loadTemplate = new QPushButton( vb );
77 QPushButton * saveTemplate = new QPushButton( vb ); 83 QPushButton * saveTemplate = new QPushButton( vb );
78 if ( QApplication::desktop()->width() < 321 ) 84 if ( QApplication::desktop()->width() < 321 )
79 iconp = SmallIcon("fileexport16"); 85 iconp = SmallIcon("fileexport16");
80 else 86 else
81 iconp = SmallIcon("fileexport"); 87 iconp = SmallIcon("fileexport");
82 saveTemplate->setPixmap (iconp ) ; 88 saveTemplate->setPixmap (iconp ) ;
83 int size = saveTemplate->sizeHint().height(); 89 int size = saveTemplate->sizeHint().height();
84 if ( QApplication::desktop()->width() < 321 ) 90 if ( QApplication::desktop()->width() < 321 )
85 iconp = SmallIcon("fileimport16"); 91 iconp = SmallIcon("fileimport16");
86 else 92 else
87 iconp = SmallIcon("fileimport"); 93 iconp = SmallIcon("fileimport");
88 loadTemplate->setPixmap (iconp ) ; 94 loadTemplate->setPixmap (iconp ) ;
89 loadTemplate->setFixedSize( size, size ); 95 loadTemplate->setFixedSize( size, size );
90 saveTemplate->setFixedSize( size, size ); 96 saveTemplate->setFixedSize( size, size );
91 toggleJournal->setFixedSize( size , size ); 97 toggleJournal->setFixedSize( size , size );
92 mEditor = new KTextEdit(this); 98 mEditor = new KTextEdit(this);
93#ifndef DESKTOP_VERSION 99#ifndef DESKTOP_VERSION
94 QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); 100 QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold );
95#endif 101#endif
96 mEditor->setWordWrap( KTextEdit::WidgetWidth ); 102 mEditor->setWordWrap( KTextEdit::WidgetWidth );
97 QBoxLayout *topLayout = new QVBoxLayout(this); 103 QBoxLayout *topLayout = new QVBoxLayout(this);
98 topLayout->addWidget(vb); 104 topLayout->addWidget(vb);
99 topLayout->addWidget(mEditor); 105 topLayout->addWidget(mEditor);
100 mEditor->installEventFilter(this); 106 mEditor->installEventFilter(this);
101 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 107 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
102 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 108 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
103 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); 109 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
104} 110}
105 111
106JournalEntry::~JournalEntry() 112JournalEntry::~JournalEntry()
107{ 113{
108 //qDebug("JournalEntry::~JournalEntry() "); 114 //qDebug("JournalEntry::~JournalEntry() ");
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 067c34c..ec1154a 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -1152,65 +1152,66 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
1152 // draw selected days with special color 1152 // draw selected days with special color
1153 // DO NOT specially highlight holidays in selection ! 1153 // DO NOT specially highlight holidays in selection !
1154 if (i >= mSelStartT && i <= mSelEndT) { 1154 if (i >= mSelStartT && i <= mSelEndT) {
1155 ;//p.setPen(mSelectedDaysColor); 1155 ;//p.setPen(mSelectedDaysColor);
1156 } 1156 }
1157 1157
1158 int addCol = 0; 1158 int addCol = 0;
1159 int addRow = 0; 1159 int addRow = 0;
1160 if ( colModulo ) { 1160 if ( colModulo ) {
1161 if ( col >= 7 - colModulo ) 1161 if ( col >= 7 - colModulo )
1162 addCol = col - 7 + colModulo; 1162 addCol = col - 7 + colModulo;
1163 } 1163 }
1164 if ( rowModulo ) { 1164 if ( rowModulo ) {
1165 if ( row >= 6 - rowModulo ) 1165 if ( row >= 6 - rowModulo )
1166 addRow = row - 5 + rowModulo; 1166 addRow = row - 5 + rowModulo;
1167 } 1167 }
1168 //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow); 1168 //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow);
1169 ++addCol;//++addCol; 1169 ++addCol;//++addCol;
1170 if ( row == 0) 1170 if ( row == 0)
1171 addRow = 1; 1171 addRow = 1;
1172 p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight, 1172 p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight,
1173 Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); 1173 Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]);
1174 1174
1175 // reset color to actual color 1175 // reset color to actual color
1176 if (pDays.testBit(i)) { 1176 if (pDays.testBit(i)) {
1177 p.setPen(actcol); 1177 p.setPen(actcol);
1178 } 1178 }
1179 // reset bold font to plain font 1179 // reset bold font to plain font
1180 if ( eDays.testBit(i)) { 1180 if ( eDays.testBit(i)) {
1181 QFont myFont = font(); 1181 QFont myFont = font();
1182 myFont.setBold(false); 1182 myFont.setBold(false);
1183 p.setFont(myFont); 1183 p.setFont(myFont);
1184 } 1184 }
1185 } 1185 }
1186 p.setPen(mDefaultTextColor); 1186 p.setPen(mDefaultTextColor);
1187 p.drawRect(0, 0, width(), height()); 1187 p.drawRect(0, 0, width(), height());
1188 } else { 1188 } else {
1189 //qDebug("NO redraw "); 1189 //qDebug("NO redraw ");
1190 } 1190 }
1191 1191
1192 bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); 1192 bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP);
1193 mRedrawNeeded = false; 1193 mRedrawNeeded = false;
1194} 1194}
1195 1195
1196// ---------------------------------------------------------------------------- 1196// ----------------------------------------------------------------------------
1197// R E SI Z E E V E N T H A N D L I N G 1197// R E SI Z E E V E N T H A N D L I N G
1198// ---------------------------------------------------------------------------- 1198// ----------------------------------------------------------------------------
1199 1199
1200void KODayMatrix::resizeEvent(QResizeEvent *) 1200void KODayMatrix::resizeEvent(QResizeEvent * e)
1201{ 1201{
1202 QRect sz = frameRect(); 1202 QRect sz = frameRect();
1203 daysize.setHeight(sz.height()*7 / NUMDAYS); 1203 daysize.setHeight(sz.height()*7 / NUMDAYS);
1204 daysize.setWidth(sz.width() / 7); 1204 daysize.setWidth(sz.width() / 7);
1205 QFrame::resizeEvent( e );
1205} 1206}
1206 1207
1207QSize KODayMatrix::sizeHint() const 1208QSize KODayMatrix::sizeHint() const
1208{ 1209{
1209 1210
1210 QFontMetrics fm ( font() ); 1211 QFontMetrics fm ( font() );
1211 int wid = fm.width( "30") *7+3; 1212 int wid = fm.width( "30") *7+3;
1212 int hei = fm.height() * 6+3; 1213 int hei = fm.height() * 6+3;
1213 //qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei); 1214 //qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei);
1214 return QSize ( wid, hei ); 1215 return QSize ( wid, hei );
1215 1216
1216} 1217}
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 2fbcd42..e07bc53 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -139,103 +139,103 @@ void KOEditorGeneral::editCategories()
139 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); 139 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));
140 //KOGlobals::fitDialogToScreen( csd ); 140 //KOGlobals::fitDialogToScreen( csd );
141 csd->setColorEnabled(); 141 csd->setColorEnabled();
142 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); 142 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
143 csd->exec(); 143 csd->exec();
144 delete csd; 144 delete csd;
145} 145}
146 146
147void KOEditorGeneral::showCatPopup() 147void KOEditorGeneral::showCatPopup()
148{ 148{
149 mCatPopup->clear(); 149 mCatPopup->clear();
150 QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text()); 150 QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text());
151 int index = 0; 151 int index = 0;
152 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 152 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
153 it != KOPrefs::instance()->mCustomCategories.end (); 153 it != KOPrefs::instance()->mCustomCategories.end ();
154 ++it) { 154 ++it) {
155 mCatPopup->insertItem (*it, index ); 155 mCatPopup->insertItem (*it, index );
156 //mCategory[index] = *it; 156 //mCategory[index] = *it;
157 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); 157 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true);
158 ++index; 158 ++index;
159 } 159 }
160} 160}
161void KOEditorGeneral::selectedCatPopup( int index ) 161void KOEditorGeneral::selectedCatPopup( int index )
162{ 162{
163 QStringList categories = QStringList::split (",", mCategoriesLabel->text()); 163 QStringList categories = QStringList::split (",", mCategoriesLabel->text());
164 QString colcat = categories.first(); 164 QString colcat = categories.first();
165 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ()) 165 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
166 categories.remove (KOPrefs::instance()->mCustomCategories[index]); 166 categories.remove (KOPrefs::instance()->mCustomCategories[index]);
167 else 167 else
168 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]); 168 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
169 categories.sort (); 169 categories.sort ();
170 if ( !colcat.isEmpty() ) { 170 if ( !colcat.isEmpty() ) {
171 if ( categories.find ( colcat ) != categories.end () ) { 171 if ( categories.find ( colcat ) != categories.end () ) {
172 categories.remove( colcat ); 172 categories.remove( colcat );
173 categories.prepend( colcat ); 173 categories.prepend( colcat );
174 } 174 }
175 } 175 }
176 setCategories( categories.join(",") ); 176 setCategories( categories.join(",") );
177} 177}
178 178
179void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 179void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
180{ 180{
181 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 181 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
182 mCatPopup = new QPopupMenu ( parent ); 182 mCatPopup = new QPopupMenu ( parent );
183 mCatPopup->setCheckable (true); 183 mCatPopup->setCheckable (true);
184 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 184 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
185 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 185 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
186 mCategoriesButton = new QPushButton(parent); 186 mCategoriesButton = new QPushButton(parent);
187 mCategoriesButton->setText(i18n("Categories")); 187 mCategoriesButton->setText(i18n("Categories..."));
188 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
188 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 189 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
189 categoriesLayout->addWidget(mCategoriesButton); 190 categoriesLayout->addWidget(mCategoriesButton);
190 mCategoriesButton->setPopup( mCatPopup );
191 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent); 191 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent);
192 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 192 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
193 connect(mCategoriesLabel,SIGNAL(clicked()),this, SLOT(editCategories() )); 193 mCategoriesLabel->setPopup( mCatPopup );
194 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 194 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
195 categoriesLayout->addWidget(mCategoriesLabel,1); 195 categoriesLayout->addWidget(mCategoriesLabel,1);
196} 196}
197 197
198void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 198void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
199{ 199{
200 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 200 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
201 201
202 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 202 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
203 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 203 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
204 secrecyLayout->addWidget(mCancelBox); 204 secrecyLayout->addWidget(mCancelBox);
205 secrecyLayout->addWidget(secrecyLabel); 205 secrecyLayout->addWidget(secrecyLabel);
206 206
207 mSecrecyCombo = new QComboBox(parent); 207 mSecrecyCombo = new QComboBox(parent);
208 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 208 mSecrecyCombo->insertStringList(Incidence::secrecyList());
209 secrecyLayout->addWidget(mSecrecyCombo); 209 secrecyLayout->addWidget(mSecrecyCombo);
210} 210}
211 211
212void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 212void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
213{ 213{
214 mDescriptionEdit = new KTextEdit(parent); 214 mDescriptionEdit = new KTextEdit(parent);
215 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 215 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
216 mDescriptionEdit->append(""); 216 mDescriptionEdit->append("");
217 mDescriptionEdit->setReadOnly(false); 217 mDescriptionEdit->setReadOnly(false);
218 mDescriptionEdit->setOverwriteMode(false); 218 mDescriptionEdit->setOverwriteMode(false);
219 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 219 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
220 topLayout->addWidget(mDescriptionEdit); 220 topLayout->addWidget(mDescriptionEdit);
221#ifndef DESKTOP_VERSION 221#ifndef DESKTOP_VERSION
222 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); 222 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
223#endif 223#endif
224 224
225} 225}
226 226
227void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) 227void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
228{ 228{
229 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); 229 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
230 230
231 //mAlarmBell = new QLabel(parent); 231 //mAlarmBell = new QLabel(parent);
232 //mAlarmBell->setPixmap(SmallIcon("bell")); 232 //mAlarmBell->setPixmap(SmallIcon("bell"));
233 //alarmLayout->addWidget(mAlarmBell); 233 //alarmLayout->addWidget(mAlarmBell);
234 if ( QApplication::desktop()->width() < 320 ) 234 if ( QApplication::desktop()->width() < 320 )
235 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 235 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
236 else 236 else
237 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 237 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
238 238
239 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 239 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
240 alarmLayout->addWidget(mAlarmButton); 240 alarmLayout->addWidget(mAlarmButton);
241 241
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 9db2040..02d7aae 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -346,109 +346,109 @@ void KOPrefs::usrSetDefaults()
346{ 346{
347 347
348} 348}
349 349
350void KOPrefs::fillMailDefaults() 350void KOPrefs::fillMailDefaults()
351{ 351{
352 if (mName.isEmpty()) mName = i18n("Anonymous"); 352 if (mName.isEmpty()) mName = i18n("Anonymous");
353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
354} 354}
355 355
356void KOPrefs::setTimeZoneIdDefault() 356void KOPrefs::setTimeZoneIdDefault()
357{ 357{
358 ; 358 ;
359} 359}
360 360
361void KOPrefs::setAllDefaults() 361void KOPrefs::setAllDefaults()
362{ 362{
363 setCategoryDefaults(); 363 setCategoryDefaults();
364 mEventSummaryUser = getDefaultList() ; 364 mEventSummaryUser = getDefaultList() ;
365 mTodoSummaryUser = getDefaultList() ; 365 mTodoSummaryUser = getDefaultList() ;
366 mLocationDefaults = getLocationDefaultList(); 366 mLocationDefaults = getLocationDefaultList();
367} 367}
368 368
369void KOPrefs::setCategoryDefaults() 369void KOPrefs::setCategoryDefaults()
370{ 370{
371 mCustomCategories.clear(); 371 mCustomCategories.clear();
372 mCustomCategories = getDefaultList(); 372 mCustomCategories = getDefaultList();
373 373
374 QStringList::Iterator it; 374 QStringList::Iterator it;
375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
376 setCategoryColor(*it,mDefaultCategoryColor); 376 setCategoryColor(*it,mDefaultCategoryColor);
377 } 377 }
378} 378}
379QStringList KOPrefs::getLocationDefaultList() 379QStringList KOPrefs::getLocationDefaultList()
380{ 380{
381 QStringList retval ; 381 QStringList retval ;
382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
387 387
388 retval.sort(); 388 retval.sort();
389 return retval; 389 return retval;
390} 390}
391QStringList KOPrefs::getDefaultList() 391QStringList KOPrefs::getDefaultList()
392{ 392{
393 QStringList retval ; 393 QStringList retval ;
394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Cinema") << i18n("Customer") 394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer")
395 << i18n("Break") 395 << i18n("Break")
396 << i18n("Family") << i18n("Favorites") << i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 396 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts")
397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Key Customer") 397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts")
398 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") 398 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal")
399 << i18n("PHB") << i18n("Phone Calls") << i18n("School") << i18n("Shopping") 399 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping")
400 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 400 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
401 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 401 << i18n("Vacation") ;
402 retval.sort(); 402 retval.sort();
403 //qDebug("cat %s ", retval.join("-").latin1()); 403 //qDebug("cat %s ", retval.join("-").latin1());
404 return retval; 404 return retval;
405} 405}
406// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch") 406// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema")
407void KOPrefs::usrReadConfig() 407void KOPrefs::usrReadConfig()
408{ 408{
409 config()->setGroup("General"); 409 config()->setGroup("General");
410 410
411 //qDebug("KOPrefs::usrReadConfig() "); 411 //qDebug("KOPrefs::usrReadConfig() ");
412 mCustomCategories = config()->readListEntry("Custom Categories"); 412 mCustomCategories = config()->readListEntry("Custom Categories");
413 mOldLoadedLanguage = mOldLanguage ; 413 mOldLoadedLanguage = mOldLanguage ;
414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
415 if (mLocationDefaults.isEmpty()) { 415 if (mLocationDefaults.isEmpty()) {
416 mLocationDefaults = getLocationDefaultList(); 416 mLocationDefaults = getLocationDefaultList();
417 } 417 }
418 418
419 if (mEventSummaryUser.isEmpty()) { 419 if (mEventSummaryUser.isEmpty()) {
420 mEventSummaryUser = getDefaultList() ; 420 mEventSummaryUser = getDefaultList() ;
421 } 421 }
422 if (mTodoSummaryUser.isEmpty()) { 422 if (mTodoSummaryUser.isEmpty()) {
423 mTodoSummaryUser = getDefaultList() ; 423 mTodoSummaryUser = getDefaultList() ;
424 } 424 }
425 425
426 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 426 if (mCustomCategories.isEmpty()) setCategoryDefaults();
427 427
428 config()->setGroup("Personal Settings"); 428 config()->setGroup("Personal Settings");
429 mName = config()->readEntry("user_name",""); 429 mName = config()->readEntry("user_name","");
430 mEmail = config()->readEntry("user_email",""); 430 mEmail = config()->readEntry("user_email","");
431 fillMailDefaults(); 431 fillMailDefaults();
432 432
433 config()->setGroup("Category Colors"); 433 config()->setGroup("Category Colors");
434 QStringList::Iterator it; 434 QStringList::Iterator it;
435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
437 437
438 } 438 }
439 KConfig fc (locateLocal("config","kopicalendarrc")); 439 KConfig fc (locateLocal("config","kopicalendarrc"));
440 fc.setGroup("CC"); 440 fc.setGroup("CC");
441 int numCals = fc.readNumEntry("NumberCalendars",0 ); 441 int numCals = fc.readNumEntry("NumberCalendars",0 );
442 mNextAvailableCalendar = 1; 442 mNextAvailableCalendar = 1;
443 if ( numCals == 0 ) { 443 if ( numCals == 0 ) {
444 KopiCalendarFile *kkf = getNewCalendar(); 444 KopiCalendarFile *kkf = getNewCalendar();
445 kkf->isStandard = true; 445 kkf->isStandard = true;
446 kkf->mName = i18n("Standard"); 446 kkf->mName = i18n("Standard");
447 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 447 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
448 } 448 }
449 while ( mNextAvailableCalendar <= numCals ) { 449 while ( mNextAvailableCalendar <= numCals ) {
450 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 450 //qDebug("Read cal #%d ", mNextAvailableCalendar );
451 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 451 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
452 KopiCalendarFile *kkf = getNewCalendar(); 452 KopiCalendarFile *kkf = getNewCalendar();
453 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 453 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
454 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 454 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);