summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-29 07:48:23 (UTC)
committer zautrix <zautrix>2005-01-29 07:48:23 (UTC)
commitef1d97a243957180f5ffc3c3b055ffd8bf52e157 (patch) (unidiff)
tree57ebf97cfd0d324ffcecbfb0c9814745f73d54a5 /korganizer
parent0850ade22908615389800c6ee973f5906154d980 (diff)
downloadkdepimpi-ef1d97a243957180f5ffc3c3b055ffd8bf52e157.zip
kdepimpi-ef1d97a243957180f5ffc3c3b055ffd8bf52e157.tar.gz
kdepimpi-ef1d97a243957180f5ffc3c3b055ffd8bf52e157.tar.bz2
many stribg fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/filteredit_base.cpp13
-rw-r--r--korganizer/koeditordetails.cpp3
-rw-r--r--korganizer/koeditorgeneral.cpp8
-rw-r--r--korganizer/koprefsdialog.cpp6
4 files changed, 18 insertions, 12 deletions
diff --git a/korganizer/filteredit_base.cpp b/korganizer/filteredit_base.cpp
index 15a4aaa..505edf6 100644
--- a/korganizer/filteredit_base.cpp
+++ b/korganizer/filteredit_base.cpp
@@ -1,145 +1,152 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'filteredit_base.ui' 2** Form implementation generated from reading ui file 'filteredit_base.ui'
3** 3**
4** Created: Fr Jan 21 21:25:30 2005 4** Created: Fr Jan 21 21:25:30 2005
5** by: The User Interface Compiler ($Id$) 5** by: The User Interface Compiler ($Id$)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9 9
10#include "filteredit_base.h" 10#include "filteredit_base.h"
11 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qpushbutton.h> 13#include <qpushbutton.h>
14#include <qframe.h> 14#include <qframe.h>
15#include <qbuttongroup.h> 15#include <qbuttongroup.h>
16#include <qapplication.h>
16#include <qradiobutton.h> 17#include <qradiobutton.h>
17#include <qlistbox.h> 18#include <qlistbox.h>
18#include <qlabel.h> 19#include <qlabel.h>
19#include <qcheckbox.h> 20#include <qcheckbox.h>
20#include <qlayout.h> 21#include <qlayout.h>
21#include <qtooltip.h> 22#include <qtooltip.h>
22#include <qwhatsthis.h> 23#include <qwhatsthis.h>
23#include "tr.h" 24#include "tr.h"
24 25
25/* 26/*
26 * Constructs a FilterEdit_base as a child of 'parent', with the 27 * Constructs a FilterEdit_base as a child of 'parent', with the
27 * name 'name' and widget flags set to 'f'. 28 * name 'name' and widget flags set to 'f'.
28 */ 29 */
29FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) 30FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl )
30 : QWidget( parent, name, fl ) 31 : QWidget( parent, name, fl )
31{ 32{
32 if ( !name ) 33 if ( !name )
33 setName( "FilterEdit_base" ); 34 setName( "FilterEdit_base" );
34 FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); 35 FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout");
35 36
36 mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); 37 mCriteriaFrame = new QFrame( this, "mCriteriaFrame" );
37 mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); 38 mCriteriaFrame->setFrameShape( QFrame::StyledPanel );
38 mCriteriaFrame->setFrameShadow( QFrame::Raised ); 39 mCriteriaFrame->setFrameShadow( QFrame::Raised );
39 mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); 40 mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout");
40 41
41 ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); 42 ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" );
42 ButtonGroup1->setColumnLayout(0, Qt::Vertical ); 43 ButtonGroup1->setColumnLayout(0, Qt::Vertical );
43 ButtonGroup1->layout()->setSpacing( 6 ); 44 ButtonGroup1->layout()->setSpacing( 6 );
44 ButtonGroup1->layout()->setMargin( 6 ); 45 ButtonGroup1->layout()->setMargin( 6 );
45 ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); 46 ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
46 ButtonGroup1Layout->setAlignment( Qt::AlignTop ); 47 ButtonGroup1Layout->setAlignment( Qt::AlignTop );
47 48
48 layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); 49 layout4 = new QHBoxLayout( 0, 0, 6, "layout4");
49 50
50 mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); 51 mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" );
51 layout4->addWidget( mCatShowCheck ); 52 layout4->addWidget( mCatShowCheck );
52 53
53 mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" ); 54 mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" );
54 layout4->addWidget( mCatHideCheck ); 55 layout4->addWidget( mCatHideCheck );
55 56
56 mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" ); 57 mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" );
57 layout4->addWidget( mCatEditButton ); 58 layout4->addWidget( mCatEditButton );
58 59
59 ButtonGroup1Layout->addLayout( layout4, 0, 0 ); 60 ButtonGroup1Layout->addLayout( layout4, 0, 0 );
60 61
61 mCatList = new QListBox( ButtonGroup1, "mCatList" ); 62 mCatList = new QListBox( ButtonGroup1, "mCatList" );
62 63
63 ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); 64 ButtonGroup1Layout->addWidget( mCatList, 1, 0 );
64 mCriteriaFrameLayout->addWidget( ButtonGroup1 ); 65 mCriteriaFrameLayout->addWidget( ButtonGroup1 );
65 66
66 layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 67 layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
67 68
68 textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); 69 textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" );
69 layout7->addWidget( textLabel1 ); 70 layout7->addWidget( textLabel1 );
70 71
71 mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" ); 72 mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" );
72 layout7->addWidget( mRecurringCheck ); 73 layout7->addWidget( mRecurringCheck );
73 74
74 mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" ); 75 mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" );
75 layout7->addWidget( mCompletedCheck ); 76 layout7->addWidget( mCompletedCheck );
76 mCriteriaFrameLayout->addLayout( layout7 ); 77 mCriteriaFrameLayout->addLayout( layout7 );
77 78
78 layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 79 layout9 = new QHBoxLayout( 0, 0, 6, "layout9");
79 80
80 textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); 81 textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" );
81 layout9->addWidget( textLabel1_2 ); 82 layout9->addWidget( textLabel1_2 );
82 83
83 mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" ); 84 mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" );
84 layout9->addWidget( mEventCheck ); 85 layout9->addWidget( mEventCheck );
85 86
86 mTodoCheck = new QCheckBox( mCriteriaFrame, "mTodoCheck" ); 87 mTodoCheck = new QCheckBox( mCriteriaFrame, "mTodoCheck" );
87 layout9->addWidget( mTodoCheck ); 88 layout9->addWidget( mTodoCheck );
88 89
89 mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" ); 90 mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" );
90 layout9->addWidget( mJournalCheck ); 91 layout9->addWidget( mJournalCheck );
91 mCriteriaFrameLayout->addLayout( layout9 ); 92 mCriteriaFrameLayout->addLayout( layout9 );
92 93
93 layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); 94 layout2 = new QHBoxLayout( 0, 0, 0, "layout2");
94 95
95 textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); 96 textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" );
96 layout2->addWidget( textLabel2 ); 97 layout2->addWidget( textLabel2 );
97 98
98 mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" ); 99 mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" );
99 layout2->addWidget( mPublicCheck ); 100 layout2->addWidget( mPublicCheck );
100 101
101 mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" ); 102 mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" );
102 layout2->addWidget( mPrivateCheck ); 103 layout2->addWidget( mPrivateCheck );
103 104
104 mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" ); 105 mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" );
105 mConfidentialCheck->setChecked( FALSE ); 106 mConfidentialCheck->setChecked( FALSE );
106 layout2->addWidget( mConfidentialCheck ); 107 layout2->addWidget( mConfidentialCheck );
107 mCriteriaFrameLayout->addLayout( layout2 ); 108 mCriteriaFrameLayout->addLayout( layout2 );
108 FilterEdit_baseLayout->addWidget( mCriteriaFrame ); 109 FilterEdit_baseLayout->addWidget( mCriteriaFrame );
109 languageChange(); 110 languageChange();
110 resize( QSize(324, 281).expandedTo(minimumSizeHint()) ); 111 resize( QSize(300, 200).expandedTo(minimumSizeHint()) );
111 clearWState( WState_Polished ); 112 clearWState( WState_Polished );
112} 113}
113 114
114/* 115/*
115 * Destroys the object and frees any allocated resources 116 * Destroys the object and frees any allocated resources
116 */ 117 */
117FilterEdit_base::~FilterEdit_base() 118FilterEdit_base::~FilterEdit_base()
118{ 119{
119 // no need to delete child widgets, Qt does it all for us 120 // no need to delete child widgets, Qt does it all for us
120} 121}
121 122
122/* 123/*
123 * Sets the strings of the subwidgets using the current 124 * Sets the strings of the subwidgets using the current
124 * language. 125 * language.
125 */ 126 */
126void FilterEdit_base::languageChange() 127void FilterEdit_base::languageChange()
127{ 128{
128 setCaption( tr( "FilterEditor" ) ); 129 setCaption( tr( "FilterEditor" ) );
129 ButtonGroup1->setTitle( tr( "Categories" ) ); 130 ButtonGroup1->setTitle( tr( "Categories" ) );
130 mCatShowCheck->setText( tr( "Include" ) ); 131 mCatShowCheck->setText( tr( "Include" ) );
131 mCatHideCheck->setText( tr( "Exclude" ) ); 132 mCatHideCheck->setText( tr( "Exclude" ) );
132 mCatEditButton->setText( tr( "Edit Selection..." ) ); 133 mCatEditButton->setText( tr( "Edit Selection..." ) );
133 textLabel1->setText( tr( "Exclude" ) ); 134 textLabel1->setText( tr( "Exclude" ) );
134 mRecurringCheck->setText( tr( "recurring events" ) ); 135 if (QApplication::desktop()->width() > 480 ) {
135 mCompletedCheck->setText( tr( "completed to-dos" ) ); 136 mCompletedCheck->setText( tr( "completed to-dos" ) );
137 mRecurringCheck->setText( tr( "recurring events" ) );
138 }
139 else {
140 mCompletedCheck->setText( tr( "compl.todos" ) );
141 mRecurringCheck->setText( tr( "recurr. events" ) );
142 }
136 textLabel1_2->setText( tr( "Exclude" ) ); 143 textLabel1_2->setText( tr( "Exclude" ) );
137 mEventCheck->setText( tr( "events" ) ); 144 mEventCheck->setText( tr( "events" ) );
138 mTodoCheck->setText( tr( "todos" ) ); 145 mTodoCheck->setText( tr( "todos" ) );
139 mJournalCheck->setText( tr( "journals" ) ); 146 mJournalCheck->setText( tr( "journals" ) );
140 textLabel2->setText( tr( "Include" ) ); 147 textLabel2->setText( tr( "Include" ) );
141 mPublicCheck->setText( tr( "public" ) ); 148 mPublicCheck->setText( tr( "public" ) );
142 mPrivateCheck->setText( tr( "private" ) ); 149 mPrivateCheck->setText( tr( "private" ) );
143 mConfidentialCheck->setText( tr( "confidential" ) ); 150 mConfidentialCheck->setText( tr( "confidential" ) );
144} 151}
145 152
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index b73d22f..cf0a458 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -1,440 +1,441 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in thse hope that it will be useful, 10 This program is distributed in thse hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
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#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <qfiledialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapp.h> 32#include <qapp.h>
33 33
34#include <klocale.h> 34#include <klocale.h>
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kiconloader.h> 36#include <kiconloader.h>
37#include <kstandarddirs.h> 37#include <kstandarddirs.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#ifndef KORG_NOKABC 39#ifndef KORG_NOKABC
40 40
41#ifdef DESKTOP_VERSION 41#ifdef DESKTOP_VERSION
42#include <kabc/addresseedialog.h> 42#include <kabc/addresseedialog.h>
43#else //DESKTOP_VERSION 43#else //DESKTOP_VERSION
44#include <externalapphandler.h> 44#include <externalapphandler.h>
45#endif //DESKTOP_VERSION 45#endif //DESKTOP_VERSION
46 46
47#endif 47#endif
48 48
49#include <libkcal/incidence.h> 49#include <libkcal/incidence.h>
50 50
51#include "koprefs.h" 51#include "koprefs.h"
52 52
53#include "koeditordetails.h" 53#include "koeditordetails.h"
54 54
55template <> 55template <>
56CustomListViewItem<class Attendee *>::~CustomListViewItem() 56CustomListViewItem<class Attendee *>::~CustomListViewItem()
57{ 57{
58 delete mData; 58 delete mData;
59} 59}
60 60
61template <> 61template <>
62void CustomListViewItem<class Attendee *>::updateItem() 62void CustomListViewItem<class Attendee *>::updateItem()
63{ 63{
64 setText(0,mData->name()); 64 setText(0,mData->name());
65 setText(1,mData->email()); 65 setText(1,mData->email());
66 setText(2,mData->roleStr()); 66 setText(2,mData->roleStr());
67 setText(3,mData->statusStr()); 67 setText(3,mData->statusStr());
68 if (mData->RSVP() && !mData->email().isEmpty()) 68 if (mData->RSVP() && !mData->email().isEmpty())
69 setPixmap(4,SmallIcon("mailappt")); 69 setPixmap(4,SmallIcon("mailappt"));
70 else 70 else
71 setPixmap(4,SmallIcon("nomailappt")); 71 setPixmap(4,SmallIcon("nomailappt"));
72} 72}
73 73
74 74
75KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 75KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
76 : QWidget( parent, name), mDisableItemUpdate( false ) 76 : QWidget( parent, name), mDisableItemUpdate( false )
77{ 77{
78 QGridLayout *topLayout = new QGridLayout(this); 78 QGridLayout *topLayout = new QGridLayout(this);
79 topLayout->setSpacing(spacing); 79 topLayout->setSpacing(spacing);
80 80
81 QString organizer = KOPrefs::instance()->email(); 81 QString organizer = KOPrefs::instance()->email();
82 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); 82 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
83 83
84 mListView = new KListView(this,"mListView"); 84 mListView = new KListView(this,"mListView");
85 mListView->addColumn(i18n("Name"),180); 85 mListView->addColumn(i18n("Name"),180);
86 mListView->addColumn(i18n("Email"),180); 86 mListView->addColumn(i18n("Email"),180);
87 mListView->addColumn(i18n("Role"),60); 87 mListView->addColumn(i18n("Role"),60);
88 mListView->addColumn(i18n("Status"),100); 88 mListView->addColumn(i18n("Status"),100);
89 mListView->addColumn(i18n("RSVP"),35); 89 mListView->addColumn(i18n("RSVP"),35);
90 if ( KOPrefs::instance()->mCompactDialogs ) { 90 if ( KOPrefs::instance()->mCompactDialogs ) {
91 //mListView->setFixedHeight(78); 91 //mListView->setFixedHeight(78);
92 } 92 }
93 93
94 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 94 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
95 SLOT(updateAttendeeInput())); 95 SLOT(updateAttendeeInput()));
96 96
97 QLabel *attendeeLabel = new QLabel(this); 97 QLabel *attendeeLabel = new QLabel(this);
98 attendeeLabel->setText(i18n("Name:")); 98 attendeeLabel->setText(i18n("Name:"));
99 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 99 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
100 mNameEdit = new QLineEdit(this); 100 mNameEdit = new QLineEdit(this);
101 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 101 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
102 SLOT(updateAttendeeItem())); 102 SLOT(updateAttendeeItem()));
103 103
104 mUidEdit = new QLineEdit(0); 104 mUidEdit = new QLineEdit(0);
105 mUidEdit->setText(""); 105 mUidEdit->setText("");
106 106
107 QLabel *emailLabel = new QLabel(this); 107 QLabel *emailLabel = new QLabel(this);
108 emailLabel->setText(i18n("Email:")); 108 emailLabel->setText(i18n("Email:"));
109 mEmailEdit = new QLineEdit(this); 109 mEmailEdit = new QLineEdit(this);
110 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 110 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
111 SLOT(updateAttendeeItem())); 111 SLOT(updateAttendeeItem()));
112 112
113 QLabel *attendeeRoleLabel = new QLabel(this); 113 QLabel *attendeeRoleLabel = new QLabel(this);
114 attendeeRoleLabel->setText(i18n("Role:")); 114 attendeeRoleLabel->setText(i18n("Role:"));
115 mRoleCombo = new QComboBox(false,this); 115 mRoleCombo = new QComboBox(false,this);
116 mRoleCombo->insertStringList(Attendee::roleList()); 116 mRoleCombo->insertStringList(Attendee::roleList());
117 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 117 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
118 118
119 QLabel *statusLabel = new QLabel(this); 119 QLabel *statusLabel = new QLabel(this);
120 statusLabel->setText( i18n("Status:") ); 120 statusLabel->setText( i18n("Status:") );
121 121
122 mStatusCombo = new QComboBox(false,this); 122 mStatusCombo = new QComboBox(false,this);
123 mStatusCombo->insertStringList(Attendee::statusList()); 123 mStatusCombo->insertStringList(Attendee::statusList());
124 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 124 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
125 125
126 mRsvpButton = new QCheckBox(this); 126 mRsvpButton = new QCheckBox(this);
127 mRsvpButton->setText(i18n("Request response")); 127 mRsvpButton->setText(i18n("Request response"));
128 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 128 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
129 QWidget *buttonBox = new QWidget(this); 129 QWidget *buttonBox = new QWidget(this);
130 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 130 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
131 131
132 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 132 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
133 buttonLayout->addWidget(newButton); 133 buttonLayout->addWidget(newButton);
134 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 134 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
135 135
136 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 136 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
137 buttonLayout->addWidget(mRemoveButton); 137 buttonLayout->addWidget(mRemoveButton);
138 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 138 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
139 139
140 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 140 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
141 // buttonLayout->addWidget(mAddressBookButton); 141 // buttonLayout->addWidget(mAddressBookButton);
142 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 142 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
143 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 143 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
144 144
145 if (qApp->desktop()->width() < 640 ) { 145 if (qApp->desktop()->width() < 640 ) {
146 if ( qApp->desktop()->width() < 300 ) 146 if ( qApp->desktop()->width() < 300 )
147 mListView->setFixedHeight(80); 147 topLayout->setSpacing(1);
148 ;//mListView->setFixedHeight(80);
148 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); 149 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3);
149 topLayout->addMultiCellWidget(mListView,1,1,0,3); 150 topLayout->addMultiCellWidget(mListView,1,1,0,3);
150 topLayout->addWidget(attendeeLabel,3,0); 151 topLayout->addWidget(attendeeLabel,3,0);
151 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); 152 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2);
152 topLayout->addWidget(emailLabel,4,0); 153 topLayout->addWidget(emailLabel,4,0);
153 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); 154 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2);
154 topLayout->addWidget(attendeeRoleLabel,5,0); 155 topLayout->addWidget(attendeeRoleLabel,5,0);
155 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); 156 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3);
156 topLayout->addWidget(statusLabel,6,0); 157 topLayout->addWidget(statusLabel,6,0);
157 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); 158 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3);
158 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); 159 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3);
159 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 160 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
160 topLayout->addMultiCellWidget(buttonBox,3,4,3,3); 161 topLayout->addMultiCellWidget(buttonBox,3,4,3,3);
161 topLayout->setRowStretch(1,2); 162 topLayout->setRowStretch(1,2);
162 topLayout->setColStretch(0,0); 163 topLayout->setColStretch(0,0);
163 topLayout->setColStretch(1,2); 164 topLayout->setColStretch(1,2);
164 topLayout->setColStretch(2,1); 165 topLayout->setColStretch(2,1);
165 topLayout->setColStretch(3,1); 166 topLayout->setColStretch(3,1);
166 167
167 } else { 168 } else {
168 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 169 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
169 topLayout->addMultiCellWidget(mListView,1,1,0,5); 170 topLayout->addMultiCellWidget(mListView,1,1,0,5);
170 topLayout->addWidget(attendeeLabel,3,0); 171 topLayout->addWidget(attendeeLabel,3,0);
171 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); 172 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
172 topLayout->addWidget(emailLabel,4,0); 173 topLayout->addWidget(emailLabel,4,0);
173 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); 174 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
174 topLayout->addWidget(attendeeRoleLabel,5,0); 175 topLayout->addWidget(attendeeRoleLabel,5,0);
175 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); 176 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
176 topLayout->addWidget(statusLabel,5,3); 177 topLayout->addWidget(statusLabel,5,3);
177 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); 178 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
178 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); 179 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5);
179 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 180 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
180 topLayout->addMultiCellWidget(buttonBox,3,4,5,5); 181 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
181 topLayout->setRowStretch(1,5); 182 topLayout->setRowStretch(1,5);
182 topLayout->setColStretch(0,0); 183 topLayout->setColStretch(0,0);
183 } 184 }
184// #if 0 185// #if 0
185// topLayout->setColStretch(2,1); 186// topLayout->setColStretch(2,1);
186// topLayout->addWidget(statusLabel,3,3); 187// topLayout->addWidget(statusLabel,3,3);
187// topLayout->addWidget(mStatusCombo,3,4); 188// topLayout->addWidget(mStatusCombo,3,4);
188// #else 189// #else
189// topLayout->addWidget(statusLabel,4,3); 190// topLayout->addWidget(statusLabel,4,3);
190// // topLayout->addWidget(mStatusCombo,4,3); 191// // topLayout->addWidget(mStatusCombo,4,3);
191// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); 192// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5);
192 193
193// #endif 194// #endif
194// // topLayout->setRowStretch(5,1); 195// // topLayout->setRowStretch(5,1);
195// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); 196// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1);
196// topLayout->addMultiCellWidget(buttonBox,2,3,5,5); 197// topLayout->addMultiCellWidget(buttonBox,2,3,5,5);
197// topLayout->setRowStretch(1,5); 198// topLayout->setRowStretch(1,5);
198// topLayout->setColStretch(0,0); 199// topLayout->setColStretch(0,0);
199 200
200#ifdef KORG_NOKABC 201#ifdef KORG_NOKABC
201 mAddressBookButton->hide(); 202 mAddressBookButton->hide();
202#endif 203#endif
203 204
204 updateAttendeeInput(); 205 updateAttendeeInput();
205#ifndef DESKTOP_VERSION 206#ifndef DESKTOP_VERSION
206//US listen for arriving address resultsets 207//US listen for arriving address resultsets
207 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 208 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
208 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 209 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
209#endif 210#endif
210 211
211} 212}
212 213
213KOEditorDetails::~KOEditorDetails() 214KOEditorDetails::~KOEditorDetails()
214{ 215{
215} 216}
216 217
217void KOEditorDetails::removeAttendee() 218void KOEditorDetails::removeAttendee()
218{ 219{
219 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem(); 220 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem();
220 if (!aItem) return; 221 if (!aItem) return;
221 222
222 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(), 223 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(),
223 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(), 224 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(),
224 aItem->data()->uid()); 225 aItem->data()->uid());
225 mdelAttendees.append(delA); 226 mdelAttendees.append(delA);
226 227
227 delete aItem; 228 delete aItem;
228 229
229 updateAttendeeInput(); 230 updateAttendeeInput();
230} 231}
231 232
232 233
233void KOEditorDetails::openAddressBook() 234void KOEditorDetails::openAddressBook()
234{ 235{
235#ifndef KORG_NOKABC 236#ifndef KORG_NOKABC
236 237
237#ifdef DESKTOP_VERSION 238#ifdef DESKTOP_VERSION
238 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 239 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
239 uint i=0; 240 uint i=0;
240 for (i=0; i < list.count(); i++) { 241 for (i=0; i < list.count(); i++) {
241 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); 242 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) );
242 } 243 }
243#else 244#else
244 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 245 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
245 // the result should now arrive through method insertAttendees 246 // the result should now arrive through method insertAttendees
246#endif 247#endif
247 248
248 249
249#if 0 250#if 0
250 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); 251 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
251 if (!a.isEmpty()) { 252 if (!a.isEmpty()) {
252 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); 253 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) );
253 } 254 }
254#endif 255#endif
255#endif 256#endif
256} 257}
257 258
258 259
259void KOEditorDetails::addNewAttendee() 260void KOEditorDetails::addNewAttendee()
260{ 261{
261#if 0 262#if 0
262 // this is cool. If they didn't enter an email address, 263 // this is cool. If they didn't enter an email address,
263 // try to look it up in the address book and fill it in for them. 264 // try to look it up in the address book and fill it in for them.
264 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) { 265 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) {
265 KabAPI addrBook; 266 KabAPI addrBook;
266 QString name; 267 QString name;
267 std::list<AddressBook::Entry> entries; 268 std::list<AddressBook::Entry> entries;
268 name = mNameEdit->text(); 269 name = mNameEdit->text();
269 if (addrBook.init() == AddressBook::NoError) { 270 if (addrBook.init() == AddressBook::NoError) {
270 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) { 271 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) {
271 kdDebug() << "positive match" << endl; 272 kdDebug() << "positive match" << endl;
272 // take first email address 273 // take first email address
273 if (!entries.front().emails.isEmpty() && 274 if (!entries.front().emails.isEmpty() &&
274 entries.front().emails.first().length()>0) 275 entries.front().emails.first().length()>0)
275 mEmailEdit->setText(entries.front().emails.first()); 276 mEmailEdit->setText(entries.front().emails.first());
276 } 277 }
277 } 278 }
278 } 279 }
279#endif 280#endif
280 281
281 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); 282 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)"));
282 insertAttendee(a); 283 insertAttendee(a);
283} 284}
284 285
285//the map includes name/email pairs, that comes from Ka/Pi 286//the map includes name/email pairs, that comes from Ka/Pi
286void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) 287void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
287{ 288{
288 if (uid == this->name()) 289 if (uid == this->name())
289 { 290 {
290 for ( int i = 0; i < nameList.count(); i++) 291 for ( int i = 0; i < nameList.count(); i++)
291 { 292 {
292 QString _name = nameList[i]; 293 QString _name = nameList[i];
293 QString _email = emailList[i]; 294 QString _email = emailList[i];
294 QString _uid = uidList[i]; 295 QString _uid = uidList[i];
295 296
296 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); 297 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid);
297 insertAttendee(a); 298 insertAttendee(a);
298 } 299 }
299 } 300 }
300 301
301} 302}
302 303
303void KOEditorDetails::insertAttendee(Attendee *a) 304void KOEditorDetails::insertAttendee(Attendee *a)
304{ 305{
305 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild(); 306 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild();
306 while (first) { 307 while (first) {
307 if ( first->data()->name() == a->name() && first->data()->email() == a->email() ) 308 if ( first->data()->name() == a->name() && first->data()->email() == a->email() )
308 return; 309 return;
309 first = (AttendeeListItem*) first->nextSibling(); 310 first = (AttendeeListItem*) first->nextSibling();
310 } 311 }
311 312
312 AttendeeListItem *item = new AttendeeListItem(a,mListView); 313 AttendeeListItem *item = new AttendeeListItem(a,mListView);
313 mListView->setSelected( item, true ); 314 mListView->setSelected( item, true );
314} 315}
315 316
316void KOEditorDetails::setDefaults() 317void KOEditorDetails::setDefaults()
317{ 318{
318 mRsvpButton->setChecked(true); 319 mRsvpButton->setChecked(true);
319 mListView->clear(); 320 mListView->clear();
320 mdelAttendees.clear(); 321 mdelAttendees.clear();
321 clearAttendeeInput(); 322 clearAttendeeInput();
322 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); 323 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email()));
323 324
324 mNameEdit->setText(""); 325 mNameEdit->setText("");
325 mUidEdit->setText(""); 326 mUidEdit->setText("");
326 mEmailEdit->setText(""); 327 mEmailEdit->setText("");
327 mRoleCombo->setCurrentItem( 0 ); 328 mRoleCombo->setCurrentItem( 0 );
328 mStatusCombo->setCurrentItem( 0 ); 329 mStatusCombo->setCurrentItem( 0 );
329 330
330} 331}
331 332
332void KOEditorDetails::readEvent(Incidence *event) 333void KOEditorDetails::readEvent(Incidence *event)
333{ 334{
334 setDefaults(); 335 setDefaults();
335 //mListView->clear(); 336 //mListView->clear();
336 //mdelAttendees.clear(); 337 //mdelAttendees.clear();
337 QPtrList<Attendee> tmpAList = event->attendees(); 338 QPtrList<Attendee> tmpAList = event->attendees();
338 Attendee *a; 339 Attendee *a;
339 for (a = tmpAList.first(); a; a = tmpAList.next()) 340 for (a = tmpAList.first(); a; a = tmpAList.next())
340 insertAttendee(new Attendee(*a)); 341 insertAttendee(new Attendee(*a));
341 342
342 mListView->setSelected( mListView->firstChild(), true ); 343 mListView->setSelected( mListView->firstChild(), true );
343 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); 344 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer()));
344} 345}
345 346
346void KOEditorDetails::writeEvent(Incidence *event) 347void KOEditorDetails::writeEvent(Incidence *event)
347{ 348{
348 event->clearAttendees(); 349 event->clearAttendees();
349 QListViewItem *item; 350 QListViewItem *item;
350 AttendeeListItem *a; 351 AttendeeListItem *a;
351 for (item = mListView->firstChild(); item; 352 for (item = mListView->firstChild(); item;
352 item = item->nextSibling()) { 353 item = item->nextSibling()) {
353 a = (AttendeeListItem *)item; 354 a = (AttendeeListItem *)item;
354 event->addAttendee(new Attendee(*(a->data()))); 355 event->addAttendee(new Attendee(*(a->data())));
355 } 356 }
356 event->setOrganizer(KOPrefs::instance()->email()); 357 event->setOrganizer(KOPrefs::instance()->email());
357} 358}
358 359
359void KOEditorDetails::cancelAttendeeEvent(Incidence *event) 360void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
360{ 361{
361 event->clearAttendees(); 362 event->clearAttendees();
362 Attendee * att; 363 Attendee * att;
363 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { 364 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) {
364 event->addAttendee(new Attendee(*att)); 365 event->addAttendee(new Attendee(*att));
365 } 366 }
366 mdelAttendees.clear(); 367 mdelAttendees.clear();
367} 368}
368 369
369bool KOEditorDetails::validateInput() 370bool KOEditorDetails::validateInput()
370{ 371{
371 return true; 372 return true;
372} 373}
373 374
374void KOEditorDetails::updateAttendeeInput() 375void KOEditorDetails::updateAttendeeInput()
375{ 376{
376 QListViewItem *item = mListView->selectedItem(); 377 QListViewItem *item = mListView->selectedItem();
377 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 378 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
378 if (aItem) { 379 if (aItem) {
379 fillAttendeeInput( aItem ); 380 fillAttendeeInput( aItem );
380 } else { 381 } else {
381 clearAttendeeInput(); 382 clearAttendeeInput();
382 } 383 }
383} 384}
384 385
385void KOEditorDetails::clearAttendeeInput() 386void KOEditorDetails::clearAttendeeInput()
386{ 387{
387 mNameEdit->setText(""); 388 mNameEdit->setText("");
388 mUidEdit->setText(""); 389 mUidEdit->setText("");
389 mEmailEdit->setText(""); 390 mEmailEdit->setText("");
390 mRoleCombo->setCurrentItem(0); 391 mRoleCombo->setCurrentItem(0);
391 mStatusCombo->setCurrentItem(0); 392 mStatusCombo->setCurrentItem(0);
392 mRsvpButton->setChecked(true); 393 mRsvpButton->setChecked(true);
393 setEnabledAttendeeInput( false ); 394 setEnabledAttendeeInput( false );
394} 395}
395 396
396void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) 397void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
397{ 398{
398 Attendee *a = aItem->data(); 399 Attendee *a = aItem->data();
399 mDisableItemUpdate = true; 400 mDisableItemUpdate = true;
400 mNameEdit->setText(a->name()); 401 mNameEdit->setText(a->name());
401 mUidEdit->setText(a->uid()); 402 mUidEdit->setText(a->uid());
402 mEmailEdit->setText(a->email()); 403 mEmailEdit->setText(a->email());
403 mRoleCombo->setCurrentItem(a->role()); 404 mRoleCombo->setCurrentItem(a->role());
404 mStatusCombo->setCurrentItem(a->status()); 405 mStatusCombo->setCurrentItem(a->status());
405 mRsvpButton->setChecked(a->RSVP()); 406 mRsvpButton->setChecked(a->RSVP());
406 407
407 mDisableItemUpdate = false; 408 mDisableItemUpdate = false;
408 409
409 setEnabledAttendeeInput( true ); 410 setEnabledAttendeeInput( true );
410} 411}
411 412
412void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) 413void KOEditorDetails::setEnabledAttendeeInput( bool enabled )
413{ 414{
414 mNameEdit->setEnabled( enabled ); 415 mNameEdit->setEnabled( enabled );
415 mEmailEdit->setEnabled( enabled ); 416 mEmailEdit->setEnabled( enabled );
416 mRoleCombo->setEnabled( enabled ); 417 mRoleCombo->setEnabled( enabled );
417 mStatusCombo->setEnabled( enabled ); 418 mStatusCombo->setEnabled( enabled );
418 mRsvpButton->setEnabled( enabled ); 419 mRsvpButton->setEnabled( enabled );
419 420
420 mRemoveButton->setEnabled( enabled ); 421 mRemoveButton->setEnabled( enabled );
421} 422}
422 423
423void KOEditorDetails::updateAttendeeItem() 424void KOEditorDetails::updateAttendeeItem()
424{ 425{
425 if (mDisableItemUpdate) return; 426 if (mDisableItemUpdate) return;
426 427
427 QListViewItem *item = mListView->selectedItem(); 428 QListViewItem *item = mListView->selectedItem();
428 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 429 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
429 if ( !aItem ) return; 430 if ( !aItem ) return;
430 431
431 Attendee *a = aItem->data(); 432 Attendee *a = aItem->data();
432 433
433 a->setName( mNameEdit->text() ); 434 a->setName( mNameEdit->text() );
434 a->setUid( mUidEdit->text() ); 435 a->setUid( mUidEdit->text() );
435 a->setEmail( mEmailEdit->text() ); 436 a->setEmail( mEmailEdit->text() );
436 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); 437 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
437 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) ); 438 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) );
438 a->setRSVP( mRsvpButton->isChecked() ); 439 a->setRSVP( mRsvpButton->isChecked() );
439 aItem->updateItem(); 440 aItem->updateItem();
440} 441}
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index b4fe965..f5eb52e 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -1,518 +1,518 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
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#include <qwidget.h> 24#include <qwidget.h>
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qfile.h> 32#include <qfile.h>
33 33
34 34
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kdebug.h> 36#include <kdebug.h>
37#include <klocale.h> 37#include <klocale.h>
38#include <kiconloader.h> 38#include <kiconloader.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40#include <kfiledialog.h> 40#include <kfiledialog.h>
41#include <kstandarddirs.h> 41#include <kstandarddirs.h>
42 42
43#include <libkcal/todo.h> 43#include <libkcal/todo.h>
44#include <libkcal/event.h> 44#include <libkcal/event.h>
45#include <libkdepim/categoryselectdialog.h> 45#include <libkdepim/categoryselectdialog.h>
46#include <libkdepim/kdateedit.h> 46#include <libkdepim/kdateedit.h>
47 47
48#include "koprefs.h" 48#include "koprefs.h"
49#include "koglobals.h" 49#include "koglobals.h"
50 50
51#include "koeditorgeneral.h" 51#include "koeditorgeneral.h"
52#include "kolocationbox.h" 52#include "kolocationbox.h"
53#ifndef DESKTOP_VERSION 53#ifndef DESKTOP_VERSION
54#include <qpe/qpeapplication.h> 54#include <qpe/qpeapplication.h>
55#else 55#else
56#include <qapplication.h> 56#include <qapplication.h>
57#endif 57#endif
58 58
59KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : 59KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
60 QObject( parent, name) 60 QObject( parent, name)
61{ 61{
62} 62}
63 63
64KOEditorGeneral::~KOEditorGeneral() 64KOEditorGeneral::~KOEditorGeneral()
65{ 65{
66} 66}
67 67
68void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) 68void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
69{ 69{
70 QGridLayout *headerLayout = new QGridLayout(topLayout); 70 QGridLayout *headerLayout = new QGridLayout(topLayout);
71 71
72#if 0 72#if 0
73 mOwnerLabel = new QLabel(i18n("Owner:"),parent); 73 mOwnerLabel = new QLabel(i18n("Owner:"),parent);
74 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); 74 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
75#endif 75#endif
76 76
77 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 77 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
78 headerLayout->addWidget(summaryLabel,1,0); 78 headerLayout->addWidget(summaryLabel,1,0);
79 79
80 mSummaryEdit = new KOLocationBox(TRUE,parent, 10); 80 mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
81 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 81 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
82 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); 82 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
83 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); 83 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
84 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; 84 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
85 if ( QApplication::desktop()->width() > 320 ) 85 if ( QApplication::desktop()->width() > 320 )
86 mSummaryEdit->setMaximumHeight( hei +6 ); 86 mSummaryEdit->setMaximumHeight( hei +6 );
87 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); 87 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
88 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } 88 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
89 // mSummaryEdit = new QLineEdit(parent); 89 // mSummaryEdit = new QLineEdit(parent);
90 headerLayout->addWidget(mSummaryEdit,1,1); 90 headerLayout->addWidget(mSummaryEdit,1,1);
91 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 91 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
92 92
93 QLabel *locationLabel = new QLabel(i18n("Location:"),parent); 93 QLabel *locationLabel = new QLabel(i18n("Location:"),parent);
94 headerLayout->addWidget(locationLabel,2,0); 94 headerLayout->addWidget(locationLabel,2,0);
95 95
96 mLocationEdit = new KOLocationBox(TRUE,parent,10); 96 mLocationEdit = new KOLocationBox(TRUE,parent,10);
97 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 97 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
98 if ( QApplication::desktop()->width() > 320 ) 98 if ( QApplication::desktop()->width() > 320 )
99 mLocationEdit->setMaximumHeight( hei + 6); 99 mLocationEdit->setMaximumHeight( hei + 6);
100 100
101 // mLocationEdit = new QLineEdit(parent); 101 // mLocationEdit = new QLineEdit(parent);
102 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 102 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
103 headerLayout->addWidget(mLocationEdit,2,1); 103 headerLayout->addWidget(mLocationEdit,2,1);
104 headerLayout->setColStretch( 1, 10); 104 headerLayout->setColStretch( 1, 10);
105} 105}
106void KOEditorGeneral::setFocusOn( int i ) 106void KOEditorGeneral::setFocusOn( int i )
107{ 107{
108 qApp->processEvents(); 108 qApp->processEvents();
109 if ( i == 1 ) { 109 if ( i == 1 ) {
110 mDescriptionEdit->setFocus(); 110 mDescriptionEdit->setFocus();
111 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); 111 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
112 } 112 }
113 if ( i == 2 ) { 113 if ( i == 2 ) {
114 mSummaryEdit->setFocus(); 114 mSummaryEdit->setFocus();
115 } 115 }
116 116
117} 117}
118void KOEditorGeneral::editCategories() 118void KOEditorGeneral::editCategories()
119{ 119{
120 // qDebug("KOEditorGeneral::editCategories() "); 120 // qDebug("KOEditorGeneral::editCategories() ");
121 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 121 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
122 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); 122 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));
123 //KOGlobals::fitDialogToScreen( csd ); 123 //KOGlobals::fitDialogToScreen( csd );
124 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); 124 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
125 csd->exec(); 125 csd->exec();
126 delete csd; 126 delete csd;
127} 127}
128void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 128void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
129{ 129{
130 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 130 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
131 131
132 mCategoriesButton = new QPushButton(parent); 132 mCategoriesButton = new QPushButton(parent);
133 mCategoriesButton->setText(i18n("Categories...")); 133 mCategoriesButton->setText(i18n("Categories..."));
134 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 134 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
135 categoriesLayout->addWidget(mCategoriesButton); 135 categoriesLayout->addWidget(mCategoriesButton);
136 136
137 mCategoriesLabel = new QLabel(parent); 137 mCategoriesLabel = new QLabel(parent);
138 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 138 mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
139 categoriesLayout->addWidget(mCategoriesLabel,1); 139 categoriesLayout->addWidget(mCategoriesLabel,1);
140} 140}
141 141
142void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 142void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
143{ 143{
144 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 144 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
145 145
146 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 146 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
147 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 147 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
148 secrecyLayout->addWidget(mCancelBox); 148 secrecyLayout->addWidget(mCancelBox);
149 secrecyLayout->addWidget(secrecyLabel); 149 secrecyLayout->addWidget(secrecyLabel);
150 150
151 mSecrecyCombo = new QComboBox(parent); 151 mSecrecyCombo = new QComboBox(parent);
152 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 152 mSecrecyCombo->insertStringList(Incidence::secrecyList());
153 secrecyLayout->addWidget(mSecrecyCombo); 153 secrecyLayout->addWidget(mSecrecyCombo);
154} 154}
155 155
156void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 156void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
157{ 157{
158 mDescriptionEdit = new KTextEdit(parent); 158 mDescriptionEdit = new KTextEdit(parent);
159 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 159 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
160 mDescriptionEdit->append(""); 160 mDescriptionEdit->append("");
161 mDescriptionEdit->setReadOnly(false); 161 mDescriptionEdit->setReadOnly(false);
162 mDescriptionEdit->setOverwriteMode(false); 162 mDescriptionEdit->setOverwriteMode(false);
163 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 163 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
164 topLayout->addWidget(mDescriptionEdit); 164 topLayout->addWidget(mDescriptionEdit);
165#ifndef DESKTOP_VERSION 165#ifndef DESKTOP_VERSION
166 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); 166 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
167#endif 167#endif
168 168
169} 169}
170 170
171void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) 171void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
172{ 172{
173 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); 173 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
174 174
175 //mAlarmBell = new QLabel(parent); 175 //mAlarmBell = new QLabel(parent);
176 //mAlarmBell->setPixmap(SmallIcon("bell")); 176 //mAlarmBell->setPixmap(SmallIcon("bell"));
177 //alarmLayout->addWidget(mAlarmBell); 177 //alarmLayout->addWidget(mAlarmBell);
178 if ( QApplication::desktop()->width() < 320 ) 178 if ( QApplication::desktop()->width() < 320 )
179 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 179 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
180 else 180 else
181 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 181 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
182 182
183 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 183 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
184 alarmLayout->addWidget(mAlarmButton); 184 alarmLayout->addWidget(mAlarmButton);
185 185
186 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; 186 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
187 alarmLayout->addWidget(mAlarmTimeEdit); 187 alarmLayout->addWidget(mAlarmTimeEdit);
188 mAlarmIncrCombo = new QComboBox(false, parent); 188 mAlarmIncrCombo = new QComboBox(false, parent);
189 if ( QApplication::desktop()->width() < 320 ) { 189 if ( QApplication::desktop()->width() < 320 ) {
190 mAlarmIncrCombo->insertItem(i18n("min")); 190 mAlarmIncrCombo->insertItem(i18n("min"));
191 mAlarmIncrCombo->insertItem(i18n("hou")); 191 mAlarmIncrCombo->insertItem(i18n("hou"));
192 mAlarmIncrCombo->insertItem(i18n("day")); 192 mAlarmIncrCombo->insertItem(i18n("day"));
193 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); 193 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() );
194 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); 194 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() );
195 } else { 195 } else {
196 mAlarmIncrCombo->insertItem(i18n("minute(s)")); 196 mAlarmIncrCombo->insertItem(i18n("minute(s)"));
197 mAlarmIncrCombo->insertItem(i18n("hour(s)")); 197 mAlarmIncrCombo->insertItem(i18n("hour(s)"));
198 mAlarmIncrCombo->insertItem(i18n("day(s)")); 198 mAlarmIncrCombo->insertItem(i18n("day(s)"));
199 } 199 }
200 200
201 // mAlarmIncrCombo->setMinimumHeight(20); 201 // mAlarmIncrCombo->setMinimumHeight(20);
202 alarmLayout->addWidget(mAlarmIncrCombo); 202 alarmLayout->addWidget(mAlarmIncrCombo);
203 mAlarmSoundButton = new QPushButton(parent); 203 mAlarmSoundButton = new QPushButton(parent);
204 mAlarmSoundButton->setPixmap(SmallIcon("playsound")); 204 mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
205 mAlarmSoundButton->setToggleButton(true); 205 mAlarmSoundButton->setToggleButton(true);
206 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 206 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
207 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); 207 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
208 alarmLayout->addWidget(mAlarmSoundButton); 208 alarmLayout->addWidget(mAlarmSoundButton);
209 209
210 mAlarmProgramButton = new QPushButton(parent); 210 mAlarmProgramButton = new QPushButton(parent);
211 mAlarmProgramButton->setPixmap(SmallIcon("run")); 211 mAlarmProgramButton->setPixmap(SmallIcon("run"));
212 mAlarmProgramButton->setToggleButton(true); 212 mAlarmProgramButton->setToggleButton(true);
213 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 213 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
214 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); 214 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
215 alarmLayout->addWidget(mAlarmProgramButton); 215 alarmLayout->addWidget(mAlarmProgramButton);
216 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); 216 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
217 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); 217 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
218 // if ( KOPrefs::instance()->mCompactDialogs ) { 218 // if ( KOPrefs::instance()->mCompactDialogs ) {
219 // mAlarmSoundButton->hide(); 219 // mAlarmSoundButton->hide();
220 // mAlarmProgramButton->hide(); 220 // mAlarmProgramButton->hide();
221 // } 221 // }
222} 222}
223 223
224void KOEditorGeneral::pickAlarmSound() 224void KOEditorGeneral::pickAlarmSound()
225{ 225{
226 226
227 //QString prefix = mAlarmSound; 227 //QString prefix = mAlarmSound;
228 if (!mAlarmSoundButton->isOn()) { 228 if (!mAlarmSoundButton->isOn()) {
229 //mAlarmSound = ""; 229 //mAlarmSound = "";
230 QToolTip::remove(mAlarmSoundButton); 230 QToolTip::remove(mAlarmSoundButton);
231 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 231 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
232 mAlarmProgramButton->setOn(true); 232 mAlarmProgramButton->setOn(true);
233 mAlarmSoundButton->setOn(false); 233 mAlarmSoundButton->setOn(false);
234 } else { 234 } else {
235 QString fileName(KFileDialog::getOpenFileName(mAlarmSound, 235 QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
236 i18n("*.wav|Wav Files"), 0)); 236 i18n("*.wav|Wav Files"), 0));
237 if (!fileName.isEmpty()) { 237 if (!fileName.isEmpty()) {
238 mAlarmSound = fileName; 238 mAlarmSound = fileName;
239 QToolTip::remove(mAlarmSoundButton); 239 QToolTip::remove(mAlarmSoundButton);
240 QString dispStr = i18n("Playing '%1'").arg(fileName); 240 QString dispStr = i18n("Playing '%1'").arg(fileName);
241 QToolTip::add(mAlarmSoundButton, dispStr); 241 QToolTip::add(mAlarmSoundButton, dispStr);
242 mAlarmProgramButton->setOn(false); 242 mAlarmProgramButton->setOn(false);
243 mAlarmSoundButton->setOn(true); 243 mAlarmSoundButton->setOn(true);
244 } else { 244 } else {
245 mAlarmProgramButton->setOn(true); 245 mAlarmProgramButton->setOn(true);
246 mAlarmSoundButton->setOn(false); 246 mAlarmSoundButton->setOn(false);
247 247
248 } 248 }
249 } 249 }
250 250
251 if (mAlarmProgramButton->isOn()) 251 if (mAlarmProgramButton->isOn())
252 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); 252 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
253 if ( mAlarmSoundButton->isOn()) 253 if ( mAlarmSoundButton->isOn())
254 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + mAlarmSound ); 254 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) );
255} 255}
256 256
257void KOEditorGeneral::pickAlarmProgram() 257void KOEditorGeneral::pickAlarmProgram()
258{ 258{
259 if (!mAlarmProgramButton->isOn()) { 259 if (!mAlarmProgramButton->isOn()) {
260 //mAlarmProgram = ""; 260 //mAlarmProgram = "";
261 QToolTip::remove(mAlarmProgramButton); 261 QToolTip::remove(mAlarmProgramButton);
262 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 262 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
263 mAlarmProgramButton->setOn(false); 263 mAlarmProgramButton->setOn(false);
264 mAlarmSoundButton->setOn(true); 264 mAlarmSoundButton->setOn(true);
265 } else { 265 } else {
266 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0)); 266 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0));
267 if (!fileName.isEmpty()) { 267 if (!fileName.isEmpty()) {
268 mAlarmProgram = fileName; 268 mAlarmProgram = fileName;
269 QToolTip::remove(mAlarmProgramButton); 269 QToolTip::remove(mAlarmProgramButton);
270 QString dispStr = i18n("Running '%1'").arg(fileName); 270 QString dispStr = i18n("Running '%1'").arg(fileName);
271 QToolTip::add(mAlarmProgramButton, dispStr); 271 QToolTip::add(mAlarmProgramButton, dispStr);
272 mAlarmSoundButton->setOn(false); 272 mAlarmSoundButton->setOn(false);
273 mAlarmProgramButton->setOn(true); 273 mAlarmProgramButton->setOn(true);
274 } else { 274 } else {
275 mAlarmProgramButton->setOn(false); 275 mAlarmProgramButton->setOn(false);
276 mAlarmSoundButton->setOn(true); 276 mAlarmSoundButton->setOn(true);
277 } 277 }
278 } 278 }
279 if (mAlarmProgramButton->isOn()) 279 if (mAlarmProgramButton->isOn())
280 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); 280 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
281 if ( mAlarmSoundButton->isOn()) 281 if ( mAlarmSoundButton->isOn())
282 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); 282 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) );
283} 283}
284 284
285 285
286QString KOEditorGeneral::getFittingPath( const QString s ) 286QString KOEditorGeneral::getFittingPath( const QString s )
287{ 287{
288 int maxlen = 50; 288 int maxlen = 50;
289 if ( QApplication::desktop()->width() < 640 ) { 289 if ( QApplication::desktop()->width() < 640 ) {
290 if ( QApplication::desktop()->width() < 320 ) 290 if ( QApplication::desktop()->width() < 320 )
291 maxlen = 22; 291 maxlen = 22;
292 else 292 else
293 maxlen = 35; 293 maxlen = 35;
294 } 294 }
295 if ( s.length() > maxlen ) { 295 if ( s.length() > maxlen ) {
296 return "..."+s.right(maxlen -3); 296 return "..."+s.right(maxlen -3);
297 } 297 }
298 return s; 298 return s;
299} 299}
300 300
301void KOEditorGeneral::enableAlarmEdit(bool enable) 301void KOEditorGeneral::enableAlarmEdit(bool enable)
302{ 302{
303 if ( enable ) { 303 if ( enable ) {
304 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { 304 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
305 mAlarmSoundButton->setOn( true ); 305 mAlarmSoundButton->setOn( true );
306 if ( mAlarmSound.isEmpty() ) 306 if ( mAlarmSound.isEmpty() )
307 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 307 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
308 else { 308 else {
309 if ( ! QFile::exists( mAlarmSound ) ) 309 if ( ! QFile::exists( mAlarmSound ) )
310 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 310 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
311 } 311 }
312 } 312 }
313 if (mAlarmProgramButton->isOn()) 313 if (mAlarmProgramButton->isOn())
314 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 314 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
315 if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) 315 if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
316 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 316 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
317 } 317 }
318 else { 318 else {
319 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); 319 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item"));
320 320
321 } 321 }
322 mAlarmTimeEdit->setEnabled(enable); 322 mAlarmTimeEdit->setEnabled(enable);
323 mAlarmSoundButton->setEnabled(enable); 323 mAlarmSoundButton->setEnabled(enable);
324 mAlarmProgramButton->setEnabled(enable); 324 mAlarmProgramButton->setEnabled(enable);
325 mAlarmIncrCombo->setEnabled(enable); 325 mAlarmIncrCombo->setEnabled(enable);
326} 326}
327 327
328void KOEditorGeneral::disableAlarmEdit(bool disable) 328void KOEditorGeneral::disableAlarmEdit(bool disable)
329{ 329{
330 enableAlarmEdit( !disable ); 330 enableAlarmEdit( !disable );
331} 331}
332 332
333void KOEditorGeneral::enableAlarm( bool enable ) 333void KOEditorGeneral::enableAlarm( bool enable )
334{ 334{
335 enableAlarmEdit( enable ); 335 enableAlarmEdit( enable );
336} 336}
337 337
338void KOEditorGeneral::alarmDisable(bool disable) 338void KOEditorGeneral::alarmDisable(bool disable)
339{ 339{
340 if (!disable) { 340 if (!disable) {
341 //mAlarmBell->setEnabled(true); 341 //mAlarmBell->setEnabled(true);
342 mAlarmButton->setEnabled(true); 342 mAlarmButton->setEnabled(true);
343 } else { 343 } else {
344 //mAlarmBell->setEnabled(false); 344 //mAlarmBell->setEnabled(false);
345 mAlarmButton->setEnabled(false); 345 mAlarmButton->setEnabled(false);
346 mAlarmButton->setChecked(false); 346 mAlarmButton->setChecked(false);
347 mAlarmTimeEdit->setEnabled(false); 347 mAlarmTimeEdit->setEnabled(false);
348 mAlarmSoundButton->setEnabled(false); 348 mAlarmSoundButton->setEnabled(false);
349 mAlarmProgramButton->setEnabled(false); 349 mAlarmProgramButton->setEnabled(false);
350 mAlarmIncrCombo->setEnabled(false); 350 mAlarmIncrCombo->setEnabled(false);
351 } 351 }
352} 352}
353 353
354void KOEditorGeneral::setCategories(const QString &str) 354void KOEditorGeneral::setCategories(const QString &str)
355{ 355{
356 mCategoriesLabel->setText(str); 356 mCategoriesLabel->setText(str);
357} 357}
358 358
359void KOEditorGeneral::setDefaults(bool allDay) 359void KOEditorGeneral::setDefaults(bool allDay)
360{ 360{
361#if 0 361#if 0
362 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); 362 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
363#endif 363#endif
364 364
365 enableAlarmEdit( !allDay ); 365 enableAlarmEdit( !allDay );
366 366
367 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 367 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
368 int alarmTime; 368 int alarmTime;
369 int a[] = { 1,5,10,15,30,60,180, 1440 }; 369 int a[] = { 1,5,10,15,30,60,180, 1440 };
370 int index = KOPrefs::instance()->mAlarmTime; 370 int index = KOPrefs::instance()->mAlarmTime;
371 if (index < 0 || index > 7) { 371 if (index < 0 || index > 7) {
372 alarmTime = 15; 372 alarmTime = 15;
373 } else { 373 } else {
374 alarmTime = a[index]; 374 alarmTime = a[index];
375 } 375 }
376 mAlarmButton ->setChecked( false ); 376 mAlarmButton ->setChecked( false );
377 mAlarmTimeEdit->setValue(alarmTime); 377 mAlarmTimeEdit->setValue(alarmTime);
378 mAlarmIncrCombo->setCurrentItem(0); 378 mAlarmIncrCombo->setCurrentItem(0);
379 enableAlarmEdit( false ); 379 enableAlarmEdit( false );
380 //alarmDisable (false); 380 //alarmDisable (false);
381 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); 381 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic);
382 mCancelBox->setChecked( false ); 382 mCancelBox->setChecked( false );
383 mSummaryEdit->setEditText(""); 383 mSummaryEdit->setEditText("");
384 mLocationEdit->setEditText(""); 384 mLocationEdit->setEditText("");
385 mDescriptionEdit->setText(""); 385 mDescriptionEdit->setText("");
386 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 386 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
387 setCategories(""); 387 setCategories("");
388} 388}
389void KOEditorGeneral::setSecrecy( int num ) 389void KOEditorGeneral::setSecrecy( int num )
390{ 390{
391 mSecrecyCombo->setCurrentItem(num); 391 mSecrecyCombo->setCurrentItem(num);
392} 392}
393void KOEditorGeneral::readIncidence(Incidence *event) 393void KOEditorGeneral::readIncidence(Incidence *event)
394{ 394{
395 395
396 mAlarmIncrCombo->setCurrentItem(0); 396 mAlarmIncrCombo->setCurrentItem(0);
397 mSummaryEdit->setEditText(event->summary()); 397 mSummaryEdit->setEditText(event->summary());
398 mLocationEdit->setEditText(event->location()); 398 mLocationEdit->setEditText(event->location());
399 mDescriptionEdit->setText(event->description()); 399 mDescriptionEdit->setText(event->description());
400 400
401#if 0 401#if 0
402 // organizer information 402 // organizer information
403 mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); 403 mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
404#endif 404#endif
405 405
406 enableAlarmEdit( event->isAlarmEnabled() ); 406 enableAlarmEdit( event->isAlarmEnabled() );
407 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); 407 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
408 if(!event->isAlarmEnabled()) { 408 if(!event->isAlarmEnabled()) {
409 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 409 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
410 int alarmTime; 410 int alarmTime;
411 int a[] = { 1,5,10,15,30,60,180, 1440 }; 411 int a[] = { 1,5,10,15,30,60,180, 1440 };
412 int index = KOPrefs::instance()->mAlarmTime; 412 int index = KOPrefs::instance()->mAlarmTime;
413 if (index < 0 || index > 7) { 413 if (index < 0 || index > 7) {
414 alarmTime = 15; 414 alarmTime = 15;
415 } else { 415 } else {
416 alarmTime = a[index]; 416 alarmTime = a[index];
417 } 417 }
418 mAlarmTimeEdit->setValue(alarmTime); 418 mAlarmTimeEdit->setValue(alarmTime);
419 } 419 }
420 mAlarmButton->setChecked( event->isAlarmEnabled() ); 420 mAlarmButton->setChecked( event->isAlarmEnabled() );
421 mSecrecyCombo->setCurrentItem(event->secrecy()); 421 mSecrecyCombo->setCurrentItem(event->secrecy());
422 mCancelBox->setChecked( event->cancelled() ); 422 mCancelBox->setChecked( event->cancelled() );
423 mAlarmProgramButton->setOn(false); 423 mAlarmProgramButton->setOn(false);
424 mAlarmSoundButton->setOn(false); 424 mAlarmSoundButton->setOn(false);
425 425
426 // set up alarm stuff 426 // set up alarm stuff
427 QPtrList<Alarm> alarms = event->alarms(); 427 QPtrList<Alarm> alarms = event->alarms();
428 Alarm* alarm; 428 Alarm* alarm;
429 mAlarmIncrCombo->setCurrentItem(0); 429 mAlarmIncrCombo->setCurrentItem(0);
430 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { 430 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
431 int offset; 431 int offset;
432 if ( alarm->hasTime() ) { 432 if ( alarm->hasTime() ) {
433 QDateTime t = alarm->time(); 433 QDateTime t = alarm->time();
434 offset = event->dtStart().secsTo( t ); 434 offset = event->dtStart().secsTo( t );
435 } else { 435 } else {
436 offset = alarm->startOffset().asSeconds(); 436 offset = alarm->startOffset().asSeconds();
437 } 437 }
438 if ( offset != 0 ) { 438 if ( offset != 0 ) {
439 offset = offset / -60; // make minutes 439 offset = offset / -60; // make minutes
440 if (offset % 60 == 0) { // divides evenly into hours? 440 if (offset % 60 == 0) { // divides evenly into hours?
441 offset = offset / 60; 441 offset = offset / 60;
442 mAlarmIncrCombo->setCurrentItem(1); 442 mAlarmIncrCombo->setCurrentItem(1);
443 if (offset % 24 == 0) { // divides evenly into days? 443 if (offset % 24 == 0) { // divides evenly into days?
444 offset = offset / 24; 444 offset = offset / 24;
445 mAlarmIncrCombo->setCurrentItem(2); 445 mAlarmIncrCombo->setCurrentItem(2);
446 } 446 }
447 } 447 }
448 } 448 }
449 mAlarmTimeEdit->setValue( offset ); 449 mAlarmTimeEdit->setValue( offset );
450 if (alarm->type() == Alarm::Procedure) { 450 if (alarm->type() == Alarm::Procedure) {
451 451
452 mAlarmProgram = alarm->programFile(); 452 mAlarmProgram = alarm->programFile();
453 mAlarmProgramButton->setOn(true); 453 mAlarmProgramButton->setOn(true);
454 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); 454 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram);
455 QToolTip::add(mAlarmProgramButton, dispStr); 455 QToolTip::add(mAlarmProgramButton, dispStr);
456 } 456 }
457 else if (alarm->type() == Alarm::Audio) { 457 else if (alarm->type() == Alarm::Audio) {
458 mAlarmSound = alarm->audioFile(); 458 mAlarmSound = alarm->audioFile();
459 if ( ! QFile::exists( mAlarmSound ) ) 459 if ( ! QFile::exists( mAlarmSound ) )
460 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 460 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
461 mAlarmSoundButton->setOn(true); 461 mAlarmSoundButton->setOn(true);
462 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); 462 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound);
463 QToolTip::add(mAlarmSoundButton, dispStr); 463 QToolTip::add(mAlarmSoundButton, dispStr);
464 } 464 }
465 mAlarmButton->setChecked(alarm->enabled()); 465 mAlarmButton->setChecked(alarm->enabled());
466 enableAlarmEdit( alarm->enabled() ); 466 enableAlarmEdit( alarm->enabled() );
467 //qDebug("nableAlarmEdit( alarm->enabled() )********* "); 467 //qDebug("nableAlarmEdit( alarm->enabled() )********* ");
468 // TODO: Deal with multiple alarms 468 // TODO: Deal with multiple alarms
469 break; // For now, stop after the first alarm 469 break; // For now, stop after the first alarm
470 } 470 }
471 471
472 setCategories(event->categoriesStr()); 472 setCategories(event->categoriesStr());
473} 473}
474 474
475void KOEditorGeneral::writeIncidence(Incidence *event) 475void KOEditorGeneral::writeIncidence(Incidence *event)
476{ 476{
477 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; 477 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl;
478 mLocationEdit->save(KOLocationBox::LOCATION); 478 mLocationEdit->save(KOLocationBox::LOCATION);
479 event->setSummary(mSummaryEdit->currentText()); 479 event->setSummary(mSummaryEdit->currentText());
480 event->setLocation(mLocationEdit->currentText()); 480 event->setLocation(mLocationEdit->currentText());
481 event->setDescription(mDescriptionEdit->text()); 481 event->setDescription(mDescriptionEdit->text());
482 event->setCategories(mCategoriesLabel->text()); 482 event->setCategories(mCategoriesLabel->text());
483 event->setSecrecy(mSecrecyCombo->currentItem()); 483 event->setSecrecy(mSecrecyCombo->currentItem());
484 event->setCancelled(mCancelBox->isChecked() );; 484 event->setCancelled(mCancelBox->isChecked() );;
485 // alarm stuff 485 // alarm stuff
486 if (mAlarmButton->isChecked()) { 486 if (mAlarmButton->isChecked()) {
487 if (event->alarms().count() == 0) 487 if (event->alarms().count() == 0)
488 event->newAlarm(); 488 event->newAlarm();
489 QPtrList<Alarm> alarms = event->alarms(); 489 QPtrList<Alarm> alarms = event->alarms();
490 Alarm *alarm; 490 Alarm *alarm;
491 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 491 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
492 alarm->setEnabled(true); 492 alarm->setEnabled(true);
493 int j = mAlarmTimeEdit->value()* -60; 493 int j = mAlarmTimeEdit->value()* -60;
494 if (mAlarmIncrCombo->currentItem() == 1) 494 if (mAlarmIncrCombo->currentItem() == 1)
495 j = j * 60; 495 j = j * 60;
496 else if (mAlarmIncrCombo->currentItem() == 2) 496 else if (mAlarmIncrCombo->currentItem() == 2)
497 j = j * (60 * 24); 497 j = j * (60 * 24);
498 alarm->setStartOffset( j ); 498 alarm->setStartOffset( j );
499 499
500 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) { 500 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) {
501 alarm->setProcedureAlarm(mAlarmProgram); 501 alarm->setProcedureAlarm(mAlarmProgram);
502 } 502 }
503 else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) 503 else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
504 alarm->setAudioAlarm(mAlarmSound); 504 alarm->setAudioAlarm(mAlarmSound);
505 else 505 else
506 alarm->setType(Alarm::Invalid); 506 alarm->setType(Alarm::Invalid);
507 //alarm->setAudioAlarm("default"); 507 //alarm->setAudioAlarm("default");
508 // TODO: Deal with multiple alarms 508 // TODO: Deal with multiple alarms
509 break; // For now, stop after the first alarm 509 break; // For now, stop after the first alarm
510 } 510 }
511 } else { 511 } else {
512 Alarm* alarm = event->alarms().first(); 512 Alarm* alarm = event->alarms().first();
513 if ( alarm ) { 513 if ( alarm ) {
514 alarm->setEnabled(false); 514 alarm->setEnabled(false);
515 alarm->setType(Alarm::Invalid); 515 alarm->setType(Alarm::Invalid);
516 } 516 }
517 } 517 }
518} 518}
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index ea73fd0..1b24f56 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,1661 +1,1659 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
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#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56 56
57#include <kurlrequester.h> 57#include <kurlrequester.h>
58#include <klineedit.h> 58#include <klineedit.h>
59 59
60#if defined(USE_SOLARIS) 60#if defined(USE_SOLARIS)
61#include <sys/param.h> 61#include <sys/param.h>
62 62
63#define ZONEINFODIR "/usr/share/lib/zoneinfo" 63#define ZONEINFODIR "/usr/share/lib/zoneinfo"
64#define INITFILE "/etc/default/init" 64#define INITFILE "/etc/default/init"
65#endif 65#endif
66 66
67#include "koprefs.h" 67#include "koprefs.h"
68 68
69#include "koprefsdialog.h" 69#include "koprefsdialog.h"
70#include "kpimglobalprefs.h" 70#include "kpimglobalprefs.h"
71 71
72 72
73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
74 KPrefsDialog(KOPrefs::instance(),parent,name,true) 74 KPrefsDialog(KOPrefs::instance(),parent,name,true)
75{ 75{
76 76
77 setCaption( i18n("Preferences - some settings need a restart (nr)")); 77 setCaption( i18n("Preferences - some settings need a restart (nr)"));
78 mCategoryDict.setAutoDelete(true); 78 mCategoryDict.setAutoDelete(true);
79 79
80 KGlobal::locale()->insertCatalogue("timezones"); 80 KGlobal::locale()->insertCatalogue("timezones");
81 81
82 setupGlobalTab(); 82 setupGlobalTab();
83 setupMainTab(); 83 setupMainTab();
84 // setupLocaleTab(); 84 // setupLocaleTab();
85 //setupTimeZoneTab(); 85 //setupTimeZoneTab();
86 setupTimeTab(); 86 setupTimeTab();
87 //setupLocaleDateTab(); 87 //setupLocaleDateTab();
88 setupFontsTab(); 88 setupFontsTab();
89 setupColorsTab(); 89 setupColorsTab();
90 setupViewsTab(); 90 setupViewsTab();
91 //setupSyncTab(); 91 //setupSyncTab();
92 //setupSyncAlgTab(); 92 //setupSyncAlgTab();
93 //setupPrinterTab(); 93 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 94 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 95 //setupGroupAutomationTab();
96 96
97#ifndef DESKTOP_VERSION 97#ifndef DESKTOP_VERSION
98 if ( QApplication::desktop()->height() == 480 ) 98 if ( QApplication::desktop()->height() == 480 )
99 hideButtons(); 99 hideButtons();
100#endif 100#endif
101} 101}
102 102
103 103
104KOPrefsDialog::~KOPrefsDialog() 104KOPrefsDialog::~KOPrefsDialog()
105{ 105{
106} 106}
107void KOPrefsDialog::setupGlobalTab() 107void KOPrefsDialog::setupGlobalTab()
108{ 108{
109 QFrame *topFrame = addPage(i18n("Global"),0,0); 109 QFrame *topFrame = addPage(i18n("Global"),0,0);
110 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 110 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
111 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 111 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
112 topLayout->addWidget( kdelibcfg ); 112 topLayout->addWidget( kdelibcfg );
113 113
114 114
115} 115}
116void KOPrefsDialog::setupLocaleDateTab() 116void KOPrefsDialog::setupLocaleDateTab()
117{ 117{
118#if 0 118#if 0
119QFrame *topFrame = addPage(i18n("Date Format"),0,0); 119QFrame *topFrame = addPage(i18n("Date Format"),0,0);
120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
121 topLayout->setSpacing(spacingHint()); 121 topLayout->setSpacing(spacingHint());
122 topLayout->setMargin(marginHint()); 122 topLayout->setMargin(marginHint());
123 int iii = 0; 123 int iii = 0;
124 124
125 125
126 KPrefsDialogWidRadios *syncPrefsGroup = 126 KPrefsDialogWidRadios *syncPrefsGroup =
127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
128 QString format; 128 QString format;
129 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
130 format = "(%d.%m.%Y)"; 130 format = "(%d.%m.%Y)";
131 else 131 else
132 format = "(%d.%m.%Y|%A %d %B %Y)"; 132 format = "(%d.%m.%Y|%A %d %B %Y)";
133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
134 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
135 format = "(%m.%d.%Y)"; 135 format = "(%m.%d.%Y)";
136 else 136 else
137 format = "(%m.%d.%Y|%A %B %d %Y)"; 137 format = "(%m.%d.%Y|%A %B %d %Y)";
138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
139 if ( QApplication::desktop()->width() < 480 ) 139 if ( QApplication::desktop()->width() < 480 )
140 format = "(%Y-%m-%d)"; 140 format = "(%Y-%m-%d)";
141 else 141 else
142 format = "(%Y-%m-%d|%A %Y %B %d)"; 142 format = "(%Y-%m-%d|%A %Y %B %d)";
143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
144 syncPrefsGroup->addRadio(i18n("User defined")); 144 syncPrefsGroup->addRadio(i18n("User defined"));
145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
146 ++iii; 146 ++iii;
147 ++iii; 147 ++iii;
148 QLabel * lab; 148 QLabel * lab;
149 mUserDateFormatLong = new QLineEdit(topFrame); 149 mUserDateFormatLong = new QLineEdit(topFrame);
150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
151 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
152 topLayout->addWidget(mUserDateFormatLong,iii,1); 152 topLayout->addWidget(mUserDateFormatLong,iii,1);
153 ++iii; 153 ++iii;
154 mUserDateFormatShort = new QLineEdit(topFrame); 154 mUserDateFormatShort = new QLineEdit(topFrame);
155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
156 topLayout->addWidget(lab ,iii,0); 156 topLayout->addWidget(lab ,iii,0);
157 topLayout->addWidget(mUserDateFormatShort,iii,1); 157 topLayout->addWidget(mUserDateFormatShort,iii,1);
158 ++iii; 158 ++iii;
159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
161 ++iii; 161 ++iii;
162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
164 ++iii; 164 ++iii;
165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
167 ++iii; 167 ++iii;
168#endif 168#endif
169 169
170} 170}
171 171
172void KOPrefsDialog::setupLocaleTab() 172void KOPrefsDialog::setupLocaleTab()
173{ 173{
174#if 0 174#if 0
175 QFrame *topFrame = addPage(i18n("Locale"),0,0); 175 QFrame *topFrame = addPage(i18n("Locale"),0,0);
176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
177 topLayout->setSpacing(spacingHint()); 177 topLayout->setSpacing(spacingHint());
178 topLayout->setMargin(marginHint()); 178 topLayout->setMargin(marginHint());
179 int iii = 0; 179 int iii = 0;
180 KPrefsDialogWidRadios *syncPrefsGroup = 180 KPrefsDialogWidRadios *syncPrefsGroup =
181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
182 syncPrefsGroup->addRadio(i18n("English")); 182 syncPrefsGroup->addRadio(i18n("English"));
183 syncPrefsGroup->addRadio(i18n("German")); 183 syncPrefsGroup->addRadio(i18n("German"));
184 syncPrefsGroup->addRadio(i18n("French")); 184 syncPrefsGroup->addRadio(i18n("French"));
185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
186 if ( QApplication::desktop()->width() < 300 ) 186 if ( QApplication::desktop()->width() < 300 )
187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
189 ++iii; 189 ++iii;
190 190
191 syncPrefsGroup = 191 syncPrefsGroup =
192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
193 if ( QApplication::desktop()->width() > 300 ) 193 if ( QApplication::desktop()->width() > 300 )
194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
195 syncPrefsGroup->addRadio(i18n("24:00")); 195 syncPrefsGroup->addRadio(i18n("24:00"));
196 syncPrefsGroup->addRadio(i18n("12:00am")); 196 syncPrefsGroup->addRadio(i18n("12:00am"));
197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
199 ++iii; 199 ++iii;
200 KPrefsDialogWidBool *sb; 200 KPrefsDialogWidBool *sb;
201 if ( QApplication::desktop()->width() < 300 ) { 201 if ( QApplication::desktop()->width() < 300 ) {
202 sb = 202 sb =
203 addWidBool(i18n("Week starts on Sunday"), 203 addWidBool(i18n("Week starts on Sunday"),
204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
206 ++iii; 206 ++iii;
207 sb = 207 sb =
208 addWidBool(i18n("Use short date in (WN/E) view"), 208 addWidBool(i18n("Use short date in (WN/E) view"),
209 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 209 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
211 } 211 }
212 else { 212 else {
213 QWidget * hb = new QWidget( topFrame ); 213 QWidget * hb = new QWidget( topFrame );
214 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 214 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
215 sb = 215 sb =
216 addWidBool(i18n("Week starts on Sunday"), 216 addWidBool(i18n("Week starts on Sunday"),
217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
218 hbLayout->addWidget(sb->checkBox() ); 218 hbLayout->addWidget(sb->checkBox() );
219 sb = 219 sb =
220 addWidBool(i18n("Use short date in (WN/E) view"), 220 addWidBool(i18n("Use short date in (WN/E) view"),
221 &(KOPrefs::instance()->mShortDateInViewer),hb); 221 &(KOPrefs::instance()->mShortDateInViewer),hb);
222 hbLayout->addWidget(sb->checkBox() ); 222 hbLayout->addWidget(sb->checkBox() );
223 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 223 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
224 224
225 } 225 }
226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
227#if 0 227#if 0
228 ++iii; 228 ++iii;
229 sb = 229 sb =
230 addWidBool(i18n("Quick load/save (w/o Unicode)"), 230 addWidBool(i18n("Quick load/save (w/o Unicode)"),
231 &(KOPrefs::instance()->mUseQuicksave),topFrame); 231 &(KOPrefs::instance()->mUseQuicksave),topFrame);
232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
233#endif 233#endif
234#endif 234#endif
235} 235}
236void KOPrefsDialog::showSyncPage() 236void KOPrefsDialog::showSyncPage()
237{ 237{
238 showPage ( 0 ) ; 238 showPage ( 0 ) ;
239 kdelibcfg->showTimeZoneTab() ; 239 kdelibcfg->showTimeZoneTab() ;
240 240
241} 241}
242void KOPrefsDialog::setupSyncAlgTab() 242void KOPrefsDialog::setupSyncAlgTab()
243{ 243{
244#if 0 244#if 0
245 QLabel * lab; 245 QLabel * lab;
246 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 246 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
247 mSetupSyncAlgTab = topFrame; 247 mSetupSyncAlgTab = topFrame;
248 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 248 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
249 topLayout->setSpacing(spacingHint()); 249 topLayout->setSpacing(spacingHint());
250 topLayout->setMargin(marginHint()); 250 topLayout->setMargin(marginHint());
251 int iii = 0; 251 int iii = 0;
252 252
253 KPrefsDialogWidBool *sb = 253 KPrefsDialogWidBool *sb =
254 addWidBool(i18n("Ask for preferences before syncing"), 254 addWidBool(i18n("Ask for preferences before syncing"),
255 &(KOPrefs::instance()->mAskForPreferences),topFrame); 255 &(KOPrefs::instance()->mAskForPreferences),topFrame);
256 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 256 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
257 257
258 ++iii; 258 ++iii;
259 259
260 KPrefsDialogWidRadios *syncPrefsGroup = 260 KPrefsDialogWidRadios *syncPrefsGroup =
261 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), 261 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
262 topFrame); 262 topFrame);
263 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 263 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
264 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 264 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
265 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 265 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
266 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 266 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
267 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 267 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
268 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 268 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
269 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 269 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
270 ++iii; 270 ++iii;
271 sb = 271 sb =
272 addWidBool(i18n("Show summary after syncing"), 272 addWidBool(i18n("Show summary after syncing"),
273 &(KOPrefs::instance()->mShowSyncSummary),topFrame); 273 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
274 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 274 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
275 275
276 ++iii; 276 ++iii;
277#endif 277#endif
278 278
279 279
280 280
281} 281}
282 282
283 283
284void KOPrefsDialog::setupSyncTab() 284void KOPrefsDialog::setupSyncTab()
285{ 285{
286#if 0 286#if 0
287 QLabel * lab; 287 QLabel * lab;
288 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 288 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
289 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 289 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
290 topLayout->setSpacing(spacingHint()); 290 topLayout->setSpacing(spacingHint());
291 topLayout->setMargin(marginHint()); 291 topLayout->setMargin(marginHint());
292 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 292 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
293 int iii = 0; 293 int iii = 0;
294 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 294 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
295 ++iii; 295 ++iii;
296 296
297 mRemoteIPEdit = new QLineEdit(topFrame); 297 mRemoteIPEdit = new QLineEdit(topFrame);
298 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 298 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
299 topLayout->addWidget(lab ,iii,0); 299 topLayout->addWidget(lab ,iii,0);
300 topLayout->addWidget(mRemoteIPEdit,iii,1); 300 topLayout->addWidget(mRemoteIPEdit,iii,1);
301 ++iii; 301 ++iii;
302 mRemoteUser = new QLineEdit(topFrame); 302 mRemoteUser = new QLineEdit(topFrame);
303 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); 303 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
304 topLayout->addWidget(lab ,iii,0); 304 topLayout->addWidget(lab ,iii,0);
305 topLayout->addWidget(mRemoteUser, iii,1); 305 topLayout->addWidget(mRemoteUser, iii,1);
306 ++iii; 306 ++iii;
307 307
308 mRemoteFile = new QLineEdit(topFrame); 308 mRemoteFile = new QLineEdit(topFrame);
309 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); 309 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
310 topLayout->addWidget(lab ,iii,0); 310 topLayout->addWidget(lab ,iii,0);
311 topLayout->addWidget(mRemoteFile,iii,1); 311 topLayout->addWidget(mRemoteFile,iii,1);
312 ++iii; 312 ++iii;
313 313
314 mLocalTempFile = new QLineEdit(topFrame); 314 mLocalTempFile = new QLineEdit(topFrame);
315 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); 315 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
316 topLayout->addWidget(lab ,iii,0); 316 topLayout->addWidget(lab ,iii,0);
317 topLayout->addWidget(mLocalTempFile,iii,1); 317 topLayout->addWidget(mLocalTempFile,iii,1);
318 ++iii; 318 ++iii;
319 319
320 KPrefsDialogWidBool *wb = 320 KPrefsDialogWidBool *wb =
321 addWidBool(i18n("Write back synced file"), 321 addWidBool(i18n("Write back synced file"),
322 &(KOPrefs::instance()->mWriteBackFile),topFrame); 322 &(KOPrefs::instance()->mWriteBackFile),topFrame);
323 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 323 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
324 ++iii; 324 ++iii;
325 wb = 325 wb =
326 addWidBool(i18n("Write back existing entries only"), 326 addWidBool(i18n("Write back existing entries only"),
327 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 327 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
328 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 328 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
329 ++iii; 329 ++iii;
330 330
331#endif 331#endif
332} 332}
333 333
334void KOPrefsDialog::setupMainTab() 334void KOPrefsDialog::setupMainTab()
335{ 335{
336 QFrame *topFrame = addPage(i18n("General"),0,0); 336 QFrame *topFrame = addPage(i18n("General"),0,0);
337 // DesktopIcon("identity",KIcon::SizeMedium)); 337 // DesktopIcon("identity",KIcon::SizeMedium));
338 338
339 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 339 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
340 topLayout->setSpacing(spacingHint()); 340 topLayout->setSpacing(spacingHint());
341 topLayout->setMargin(marginHint()); 341 topLayout->setMargin(marginHint());
342 342
343 // KPrefsDialogWidBool *emailControlCenter = 343 // KPrefsDialogWidBool *emailControlCenter =
344// addWidBool(i18n("&Use email settings from Control Center"), 344// addWidBool(i18n("&Use email settings from Control Center"),
345// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 345// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
346// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 346// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
347 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 347 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
348 // SLOT(toggleEmailSettings(bool))); 348 // SLOT(toggleEmailSettings(bool)));
349 349
350 mNameEdit = new QLineEdit(topFrame); 350 mNameEdit = new QLineEdit(topFrame);
351 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 351 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
352 topLayout->addWidget(mNameLabel,0,0); 352 topLayout->addWidget(mNameLabel,0,0);
353 topLayout->addWidget(mNameEdit,0,1); 353 topLayout->addWidget(mNameEdit,0,1);
354 354
355 mEmailEdit = new QLineEdit(topFrame); 355 mEmailEdit = new QLineEdit(topFrame);
356 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 356 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
357 topLayout->addWidget(mEmailLabel,1,0); 357 topLayout->addWidget(mEmailLabel,1,0);
358 topLayout->addWidget(mEmailEdit,1,1); 358 topLayout->addWidget(mEmailEdit,1,1);
359 KPrefsDialogWidBool *wb; 359 KPrefsDialogWidBool *wb;
360 QHBox *dummy; 360 QHBox *dummy;
361 if ( QApplication::desktop()->width() > 480 ) { 361 if ( QApplication::desktop()->width() > 480 ) {
362 dummy = new QHBox(topFrame); 362 dummy = new QHBox(topFrame);
363 } else { 363 } else {
364 dummy = new QVBox(topFrame); 364 dummy = new QVBox(topFrame);
365 } 365 }
366 366
367 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 367 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
368 addWidBool(i18n("Full menu bar(nr)"), 368 addWidBool(i18n("Full menu bar(nr)"),
369 &(KOPrefs::instance()->mShowFullMenu),dummy); 369 &(KOPrefs::instance()->mShowFullMenu),dummy);
370 370
371 371
372 addWidBool(i18n("Mini icons in toolbar(nr)"), 372 addWidBool(i18n("Mini icons in toolbar(nr)"),
373 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 373 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
374 374
375 375
376 dummy = new QHBox(topFrame); 376 dummy = new QHBox(topFrame);
377 new QLabel(i18n("Days in What's Next:"),dummy); 377 new QLabel(i18n("Days in What's Next:"),dummy);
378 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 378 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
379 379
380 topLayout->addMultiCellWidget(dummy,3,3,0,1); 380 topLayout->addMultiCellWidget(dummy,3,3,0,1);
381 381
382 382
383 383
384 dummy = new QHBox(topFrame); 384 dummy = new QHBox(topFrame);
385 new QLabel(i18n("Days in Next-X-Days:"),dummy); 385 new QLabel(i18n("Days in Next-X-Days:"),dummy);
386 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 386 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
387 387
388 topLayout->addMultiCellWidget(dummy,4,4,0,1); 388 topLayout->addMultiCellWidget(dummy,4,4,0,1);
389 389
390 QHBox *prioBox = new QHBox(topFrame); 390 QHBox *prioBox = new QHBox(topFrame);
391 // intervalBox->setSpacing(spacingHint()); 391 // intervalBox->setSpacing(spacingHint());
392 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 392 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
393 QString messa = i18n("Show topmost todo prios in What's Next:"); 393 QString messa = i18n("Show topmost todo prios in What's Next:");
394 394
395 if ( QApplication::desktop()->width() < 300 ) 395 if ( QApplication::desktop()->width() < 300 )
396 messa = i18n("Show topmost todo prios in What's N.:"); 396 messa = i18n("Show topmost todo prios in What's N.:");
397 QLabel *prioLabel = new QLabel(messa, prioBox); 397 QLabel *prioLabel = new QLabel(messa, prioBox);
398 mPrioSpin = new QSpinBox(0,5,1,prioBox); 398 mPrioSpin = new QSpinBox(0,5,1,prioBox);
399 if ( QApplication::desktop()->width() < 300 ) 399 if ( QApplication::desktop()->width() < 300 )
400 mPrioSpin->setFixedWidth( 40 ); 400 mPrioSpin->setFixedWidth( 40 );
401 401
402 // KPrefsDialogWidBool *bcc = 402 // KPrefsDialogWidBool *bcc =
403// addWidBool(i18n("Send copy to owner when mailing events"), 403// addWidBool(i18n("Send copy to owner when mailing events"),
404// &(KOPrefs::instance()->mBcc),topFrame); 404// &(KOPrefs::instance()->mBcc),topFrame);
405// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 405// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
406 406
407 407
408 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 408 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
409 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 409 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
410 410
411 // addWidBool(i18n("Enable automatic saving of calendar"), 411 // addWidBool(i18n("Enable automatic saving of calendar"),
412 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 412 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
413 413
414 QHBox *intervalBox = new QHBox(topFrame); 414 QHBox *intervalBox = new QHBox(topFrame);
415 // intervalBox->setSpacing(spacingHint()); 415 // intervalBox->setSpacing(spacingHint());
416 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 416 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
417 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 417 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
418 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 418 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
419 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 419 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
420 /* 420 /*
421 QHBox * agendasize = new QHBox ( topFrame ); 421 QHBox * agendasize = new QHBox ( topFrame );
422 422
423 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 423 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
424 424
425 425
426 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 426 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
427 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 427 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
428 */ 428 */
429 KPrefsDialogWidBool *verticalScreen = 429 KPrefsDialogWidBool *verticalScreen =
430 addWidBool(i18n("Show vertical screen (Needs restart)"), 430 addWidBool(i18n("Show vertical screen (Needs restart)"),
431 &(KOPrefs::instance()->mVerticalScreen),topFrame); 431 &(KOPrefs::instance()->mVerticalScreen),topFrame);
432 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 432 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
433 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); 433 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1);
434 434
435 KPrefsDialogWidBool *ask = 435 KPrefsDialogWidBool *ask =
436 addWidBool(i18n("Ask for quit when closing KO/Pi"), 436 addWidBool(i18n("Ask for quit when closing KO/Pi"),
437 &(KOPrefs::instance()->mAskForQuit),topFrame); 437 &(KOPrefs::instance()->mAskForQuit),topFrame);
438 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); 438 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1);
439 439
440 440
441 /* 441 /*
442 KPrefsDialogWidBool *confirmCheck = 442 KPrefsDialogWidBool *confirmCheck =
443 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 443 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
444 topFrame); 444 topFrame);
445 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 445 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
446 446
447 447
448 mEnableGroupScheduling = 448 mEnableGroupScheduling =
449 addWidBool(i18n("Enable group scheduling"), 449 addWidBool(i18n("Enable group scheduling"),
450 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 450 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
451 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 451 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
452 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 452 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
453 SLOT(warningGroupScheduling())); 453 SLOT(warningGroupScheduling()));
454 454
455 mEnableProjectView = 455 mEnableProjectView =
456 addWidBool(i18n("Enable project view"), 456 addWidBool(i18n("Enable project view"),
457 &(KOPrefs::instance()->mEnableProjectView),topFrame); 457 &(KOPrefs::instance()->mEnableProjectView),topFrame);
458 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 458 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
459 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 459 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
460 SLOT(warningProjectView())); 460 SLOT(warningProjectView()));
461 461
462 // Can't be disabled anymore 462 // Can't be disabled anymore
463 mEnableGroupScheduling->checkBox()->hide(); 463 mEnableGroupScheduling->checkBox()->hide();
464 464
465 // Disable setting, because this feature now becomes stable 465 // Disable setting, because this feature now becomes stable
466 mEnableProjectView->checkBox()->hide(); 466 mEnableProjectView->checkBox()->hide();
467 467
468 KPrefsDialogWidRadios *defaultFormatGroup = 468 KPrefsDialogWidRadios *defaultFormatGroup =
469 addWidRadios(i18n("Default Calendar Format"), 469 addWidRadios(i18n("Default Calendar Format"),
470 &(KOPrefs::instance()->mDefaultFormat),topFrame); 470 &(KOPrefs::instance()->mDefaultFormat),topFrame);
471 defaultFormatGroup->addRadio(i18n("vCalendar")); 471 defaultFormatGroup->addRadio(i18n("vCalendar"));
472 defaultFormatGroup->addRadio(i18n("iCalendar")); 472 defaultFormatGroup->addRadio(i18n("iCalendar"));
473 473
474 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 474 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
475 475
476 // Default format unconditionally is iCalendar 476 // Default format unconditionally is iCalendar
477 defaultFormatGroup->groupBox()->hide(); 477 defaultFormatGroup->groupBox()->hide();
478 478
479 KPrefsDialogWidRadios *mailClientGroup = 479 KPrefsDialogWidRadios *mailClientGroup =
480 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 480 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
481 topFrame); 481 topFrame);
482 mailClientGroup->addRadio(i18n("KMail")); 482 mailClientGroup->addRadio(i18n("KMail"));
483 mailClientGroup->addRadio(i18n("Sendmail")); 483 mailClientGroup->addRadio(i18n("Sendmail"));
484 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 484 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
485 485
486 KPrefsDialogWidBool *htmlsave = 486 KPrefsDialogWidBool *htmlsave =
487 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 487 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
488 topFrame); 488 topFrame);
489 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 489 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
490 490
491 KPrefsDialogWidRadios *destinationGroup = 491 KPrefsDialogWidRadios *destinationGroup =
492 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 492 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
493 topFrame); 493 topFrame);
494 destinationGroup->addRadio(i18n("be added to the standard resource")); 494 destinationGroup->addRadio(i18n("be added to the standard resource"));
495 destinationGroup->addRadio(i18n("be asked which resource to use")); 495 destinationGroup->addRadio(i18n("be asked which resource to use"));
496 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 496 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
497 497
498 topLayout->setRowStretch(14,1); 498 topLayout->setRowStretch(14,1);
499 */ 499 */
500} 500}
501 501
502 502
503void KOPrefsDialog::setupTimeTab() 503void KOPrefsDialog::setupTimeTab()
504{ 504{
505 QFrame *topFrame = addPage(i18n("Time"),0,0); 505 QFrame *topFrame = addPage(i18n("Time"),0,0);
506 // DesktopIcon("clock",KIcon::SizeMedium)); 506 // DesktopIcon("clock",KIcon::SizeMedium));
507 507
508 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 508 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
509 topLayout->setSpacing(spacingHint()); 509 topLayout->setSpacing(spacingHint());
510 topLayout->setMargin(marginHint()); 510 topLayout->setMargin(marginHint());
511 511
512 QHBox *dummy = new QHBox(topFrame); 512 QHBox *dummy = new QHBox(topFrame);
513 KPrefsDialogWidTime *dayBegins = 513 KPrefsDialogWidTime *dayBegins =
514 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 514 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
515 dummy); 515 dummy);
516 //topLayout->addWidget(dayBegins->label(),2,0); 516 //topLayout->addWidget(dayBegins->label(),2,0);
517 517
518 //topLayout->addWidget(dayBegins->spinBox(),2,1); 518 //topLayout->addWidget(dayBegins->spinBox(),2,1);
519 topLayout->addMultiCellWidget(dummy,0,0,0,1); 519 topLayout->addMultiCellWidget(dummy,0,0,0,1);
520 520
521 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 521 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
522 topFrame),1,0); 522 topFrame),1,0);
523 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 523 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
524 mStartTimeSpin->setSuffix(":00"); 524 mStartTimeSpin->setSuffix(":00");
525 topLayout->addWidget(mStartTimeSpin,1,1); 525 topLayout->addWidget(mStartTimeSpin,1,1);
526 526
527 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 527 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
528 topFrame),2,0); 528 topFrame),2,0);
529 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 529 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
530 mDefaultDurationSpin->setSuffix(":00"); 530 mDefaultDurationSpin->setSuffix(":00");
531 topLayout->addWidget(mDefaultDurationSpin,2,1); 531 topLayout->addWidget(mDefaultDurationSpin,2,1);
532 532
533 QStringList alarmList; 533 QStringList alarmList;
534 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 534 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
535 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 535 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
536 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 536 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
537 3,0); 537 3,0);
538 mAlarmTimeCombo = new QComboBox(topFrame); 538 mAlarmTimeCombo = new QComboBox(topFrame);
539 mAlarmTimeCombo->insertStringList(alarmList); 539 mAlarmTimeCombo->insertStringList(alarmList);
540 topLayout->addWidget(mAlarmTimeCombo,3,1); 540 topLayout->addWidget(mAlarmTimeCombo,3,1);
541 541
542 542
543 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 543 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
544 i18n("Working Hours"), 544 i18n("Working Hours"),
545 topFrame); 545 topFrame);
546 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 546 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
547 workingHoursGroup->layout()->setSpacing( 0 ); 547 workingHoursGroup->layout()->setSpacing( 0 );
548 workingHoursGroup->layout()->setMargin( 4 ); 548 workingHoursGroup->layout()->setMargin( 4 );
549 QHBox *workStartBox = new QHBox(workingHoursGroup); 549 QHBox *workStartBox = new QHBox(workingHoursGroup);
550 // workStartBox->setMargin( 0 ); 550 // workStartBox->setMargin( 0 );
551 addWidTime(i18n("Daily starting hour:"), 551 addWidTime(i18n("Daily starting hour:"),
552 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 552 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
553 553
554 QHBox *workEndBox = new QHBox(workingHoursGroup); 554 QHBox *workEndBox = new QHBox(workingHoursGroup);
555 //workEndBox->setMargin( 0 ); 555 //workEndBox->setMargin( 0 );
556 addWidTime(i18n("Daily ending hour:"), 556 addWidTime(i18n("Daily ending hour:"),
557 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 557 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
558 QVBox *excludeBox = new QVBox(workingHoursGroup); 558 QVBox *excludeBox = new QVBox(workingHoursGroup);
559 //excludeBox->setMargin( 0 ); 559 //excludeBox->setMargin( 0 );
560 addWidBool(i18n("Exclude holidays"), 560 addWidBool(i18n("Exclude holidays"),
561 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 561 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
562 562
563 addWidBool(i18n("Exclude Saturdays"), 563 addWidBool(i18n("Exclude Saturdays"),
564 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 564 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
565 565
566// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 566// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
567 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 567 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
568 // topFrame); 568 // topFrame);
569// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 569// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
570 570
571 // topLayout->setRowStretch(6,1); 571 // topLayout->setRowStretch(6,1);
572} 572}
573 573
574 574
575void KOPrefsDialog::setupViewsTab() 575void KOPrefsDialog::setupViewsTab()
576{ 576{
577 577
578 QFrame *topFrame = addPage(i18n("Views"),0,0); 578 QFrame *topFrame = addPage(i18n("Views"),0,0);
579 // DesktopIcon("viewmag",KIcon::SizeMedium)); 579 // DesktopIcon("viewmag",KIcon::SizeMedium));
580 580
581 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 581 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
582 topLayout->setSpacing(spacingHint()); 582 topLayout->setSpacing(spacingHint());
583 topLayout->setMargin(marginHint()); 583 topLayout->setMargin(marginHint());
584 584
585// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 585// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
586// topLayout->addLayout(dayBeginsLayout,0,0); 586// topLayout->addLayout(dayBeginsLayout,0,0);
587 587
588// KPrefsDialogWidTime *dayBegins = 588// KPrefsDialogWidTime *dayBegins =
589// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 589// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
590// topFrame); 590// topFrame);
591// dayBeginsLayout->addWidget(dayBegins->label()); 591// dayBeginsLayout->addWidget(dayBegins->label());
592// dayBeginsLayout->addStretch(1); 592// dayBeginsLayout->addStretch(1);
593// dayBeginsLayout->addWidget(dayBegins->spinBox()); 593// dayBeginsLayout->addWidget(dayBegins->spinBox());
594 594
595// QBoxLayout *nextDaysLayout = new QHBoxLayout; 595// QBoxLayout *nextDaysLayout = new QHBoxLayout;
596// topLayout->addLayout(nextDaysLayout,1,0); 596// topLayout->addLayout(nextDaysLayout,1,0);
597// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 597// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
598// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 598// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
599// nextDaysLayout->addStretch(1); 599// nextDaysLayout->addStretch(1);
600// nextDaysLayout->addWidget(mNextXDaysSpin); 600// nextDaysLayout->addWidget(mNextXDaysSpin);
601 601
602 602
603 int ii = 0; 603 int ii = 0;
604 KPrefsDialogWidBool *dummy = 604 KPrefsDialogWidBool *dummy =
605 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 605 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
606 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 606 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
607 topLayout->addWidget(dummy->checkBox(),ii++,0); 607 topLayout->addWidget(dummy->checkBox(),ii++,0);
608 608
609 dummy = 609 dummy =
610 addWidBool(i18n("Show time in agenda items"), 610 addWidBool(i18n("Show time in agenda items"),
611 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 611 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
612 topLayout->addWidget(dummy->checkBox(),ii++,0); 612 topLayout->addWidget(dummy->checkBox(),ii++,0);
613 613
614 dummy = 614 dummy =
615 addWidBool(i18n("Highlight current day in agenda"), 615 addWidBool(i18n("Highlight current day in agenda"),
616 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 616 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
617 topLayout->addWidget(dummy->checkBox(),ii++,0); 617 topLayout->addWidget(dummy->checkBox(),ii++,0);
618 618
619 dummy = 619 dummy =
620 addWidBool(i18n("Use light color for highlight current day"), 620 addWidBool(i18n("Use light color for highlight current day"),
621 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 621 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
622 topLayout->addWidget(dummy->checkBox(),ii++,0); 622 topLayout->addWidget(dummy->checkBox(),ii++,0);
623 623
624 KPrefsDialogWidBool *dailyRecur = 624 KPrefsDialogWidBool *dailyRecur =
625 addWidBool(i18n("Show events that recur daily in date nav."), 625 addWidBool(i18n("Show events that recur daily in date nav."),
626 &(KOPrefs::instance()->mDailyRecur),topFrame); 626 &(KOPrefs::instance()->mDailyRecur),topFrame);
627 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 627 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
628 628
629 KPrefsDialogWidBool *weeklyRecur = 629 KPrefsDialogWidBool *weeklyRecur =
630 addWidBool(i18n("Show ev. that recur weekly in date nav."), 630 addWidBool(i18n("Show ev. that recur weekly in date nav."),
631 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 631 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
632 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 632 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
633 if ( QApplication::desktop()->width() > 640 ) { 633 if ( QApplication::desktop()->width() > 640 ) {
634 634
635 KPrefsDialogWidBool *enableToolTips = 635 KPrefsDialogWidBool *enableToolTips =
636 addWidBool(i18n("Enable tooltips displaying summary of ev."), 636 addWidBool(i18n("Enable tooltips displaying summary of ev."),
637 &(KOPrefs::instance()->mEnableToolTips),topFrame); 637 &(KOPrefs::instance()->mEnableToolTips),topFrame);
638 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 638 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
639 639
640 } 640 }
641 641
642 KPrefsDialogWidBool *marcusBainsEnabled = 642 KPrefsDialogWidBool *marcusBainsEnabled =
643 addWidBool(i18n("Show Marcus Bains line"), 643 addWidBool(i18n("Show Marcus Bains line"),
644 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 644 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
645 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 645 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
646 646
647 647
648 // topLayout->addWidget(hourSizeGroup,ii++,0); 648 // topLayout->addWidget(hourSizeGroup,ii++,0);
649 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 649 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
650 //topLayout->setRowStretch(11,1); 650 //topLayout->setRowStretch(11,1);
651 651
652 652
653 653
654 654
655 655
656 656
657 topFrame = addPage(i18n("ViewChange"),0,0); 657 topFrame = addPage(i18n("ViewChange"),0,0);
658 // DesktopIcon("viewmag",KIcon::SizeMedium)); 658 // DesktopIcon("viewmag",KIcon::SizeMedium));
659 659
660 topLayout = new QGridLayout(topFrame,6,1); 660 topLayout = new QGridLayout(topFrame,6,1);
661 topLayout->setSpacing(spacingHint()); 661 topLayout->setSpacing(spacingHint());
662 topLayout->setMargin(marginHint()); 662 topLayout->setMargin(marginHint());
663 ii = 0; 663 ii = 0;
664 664
665 665
666 dummy = 666 dummy =
667 addWidBool(i18n("Hold fullscreen on view change"), 667 addWidBool(i18n("Hold fullscreen on view change"),
668 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 668 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
669 topLayout->addWidget(dummy->checkBox(),ii++,0); 669 topLayout->addWidget(dummy->checkBox(),ii++,0);
670 670
671 dummy = 671 dummy =
672 addWidBool(i18n("Hold non-fullscreen on view change"), 672 addWidBool(i18n("Hold non-fullscreen on view change"),
673 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 673 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
674 topLayout->addWidget(dummy->checkBox(),ii++,0); 674 topLayout->addWidget(dummy->checkBox(),ii++,0);
675 675
676 676
677 KPrefsDialogWidBool *fullViewTodo = 677 KPrefsDialogWidBool *fullViewTodo =
678 addWidBool(i18n("Event list view uses full window"), 678 addWidBool(i18n("Event list view uses full window"),
679 &(KOPrefs::instance()->mFullViewTodo),topFrame); 679 &(KOPrefs::instance()->mFullViewTodo),topFrame);
680 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 680 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
681 681
682 KPrefsDialogWidBool *fullViewMonth = 682 KPrefsDialogWidBool *fullViewMonth =
683 addWidBool(i18n("Next days view uses full window"), 683 addWidBool(i18n("Next days view uses full window"),
684 &(KOPrefs::instance()->mFullViewMonth),topFrame); 684 &(KOPrefs::instance()->mFullViewMonth),topFrame);
685 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 685 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
686 686
687 dummy = 687 dummy =
688 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 688 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
689 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 689 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
690 topLayout->addWidget(dummy->checkBox(),ii++,0); 690 topLayout->addWidget(dummy->checkBox(),ii++,0);
691 691
692 dummy = 692 dummy =
693 addWidBool(i18n("Set agenda to current time on change"), 693 addWidBool(i18n("Set agenda to current time on change"),
694 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 694 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
695 topLayout->addWidget(dummy->checkBox(),ii++,0); 695 topLayout->addWidget(dummy->checkBox(),ii++,0);
696 696
697 dummy = 697 dummy =
698 addWidBool(i18n("Listview uses monthly timespan"), 698 addWidBool(i18n("Listview uses monthly timespan"),
699 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 699 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
700 topLayout->addWidget(dummy->checkBox(),ii++,0); 700 topLayout->addWidget(dummy->checkBox(),ii++,0);
701 dummy = 701 dummy =
702 addWidBool(i18n("Highlight selection in Time Edit"), 702 addWidBool(i18n("Highlight selection in Time Edit"),
703 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 703 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
704 topLayout->addWidget( dummy->checkBox(), ii++,0); 704 topLayout->addWidget( dummy->checkBox(), ii++,0);
705 705
706 706
707 707
708 708
709 709
710 topFrame = addPage(i18n("Month View"),0,0); 710 topFrame = addPage(i18n("Month View"),0,0);
711 // DesktopIcon("viewmag",KIcon::SizeMedium)); 711 // DesktopIcon("viewmag",KIcon::SizeMedium));
712 712
713 topLayout = new QGridLayout(topFrame,5,1); 713 topLayout = new QGridLayout(topFrame,5,1);
714 topLayout->setSpacing(spacingHint()); 714 topLayout->setSpacing(spacingHint());
715 topLayout->setMargin(marginHint()); 715 topLayout->setMargin(marginHint());
716 ii = 0; 716 ii = 0;
717 QLabel *lab; 717 QLabel *lab;
718 QHBox *habo = new QHBox( topFrame ); 718 QHBox *habo = new QHBox( topFrame );
719 if ( QApplication::desktop()->width() < 320 ) { 719 if ( QApplication::desktop()->width() <= 480 ) {
720 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 720 lab = new QLabel ( i18n("Show events that recur "), topFrame );
721 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 721 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
722 ii++; 722 ii++;
723
724 } else { 723 } else {
725 new QLabel ( i18n("Show events that recur "), habo ); 724 new QLabel ( i18n("Show events that recur "), habo );
726
727 } 725 }
728 dailyRecur = 726 dailyRecur =
729 addWidBool(i18n("daily"), 727 addWidBool(i18n("daily"),
730 &(KOPrefs::instance()->mMonthDailyRecur),habo); 728 &(KOPrefs::instance()->mMonthDailyRecur),habo);
731 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 729 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
732 730
733 weeklyRecur = 731 weeklyRecur =
734 addWidBool(i18n("weekly"), 732 addWidBool(i18n("weekly"),
735 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 733 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
736 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 734 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
737 ii++; 735 ii++;
738 736
739 737
740 habo = new QHBox( topFrame ); 738 habo = new QHBox( topFrame );
741 if ( QApplication::desktop()->width() < 320 ) { 739 if ( QApplication::desktop()->width() <= 480 ) {
742 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 740 lab = new QLabel (i18n("Show in every cell ") , topFrame );
743 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 741 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
744 ii++; 742 ii++;
745 743
746 } else { 744 } else {
747 new QLabel ( i18n("Show in every cell "), habo ); 745 new QLabel ( i18n("Show in every cell "), habo );
748 } 746 }
749 weeklyRecur = 747 weeklyRecur =
750 addWidBool(i18n("short month"), 748 addWidBool(i18n("short month"),
751 &(KOPrefs::instance()->mMonthShowShort),habo); 749 &(KOPrefs::instance()->mMonthShowShort),habo);
752 weeklyRecur = 750 weeklyRecur =
753 addWidBool(i18n("icons"), 751 addWidBool(i18n("icons"),
754 &(KOPrefs::instance()->mMonthShowIcons),habo); 752 &(KOPrefs::instance()->mMonthShowIcons),habo);
755 753
756 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 754 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
757 ii++; 755 ii++;
758#ifdef DESKTOP_VERSION 756#ifdef DESKTOP_VERSION
759 KPrefsDialogWidBool *enableMonthScroll = 757 KPrefsDialogWidBool *enableMonthScroll =
760 addWidBool(i18n("Enable scrollbars in month view cells"), 758 addWidBool(i18n("Enable scrollbars in month view cells"),
761 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 759 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
762 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 760 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
763#endif 761#endif
764 762
765 dummy = 763 dummy =
766 addWidBool(i18n("Show Sat/Sun together"), 764 addWidBool(i18n("Show Sat/Sun together"),
767 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 765 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
768 topLayout->addWidget(dummy->checkBox(),ii++,0); 766 topLayout->addWidget(dummy->checkBox(),ii++,0);
769 767
770 KPrefsDialogWidBool *coloredCategoriesInMonthView = 768 KPrefsDialogWidBool *coloredCategoriesInMonthView =
771 addWidBool(i18n("Month view uses category colors"), 769 addWidBool(i18n("Month view uses category colors"),
772 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 770 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
773 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 771 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
774 772
775 dummy = 773 dummy =
776 addWidBool(i18n("Categorie colors are applied to text"), 774 addWidBool(i18n("Categorie colors are applied to text"),
777 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 775 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
778 topLayout->addWidget(dummy->checkBox(),ii++,0); 776 topLayout->addWidget(dummy->checkBox(),ii++,0);
779 coloredCategoriesInMonthView = 777 coloredCategoriesInMonthView =
780 addWidBool(i18n("Month view uses day colors"), 778 addWidBool(i18n("Month view uses day colors"),
781 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 779 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
782 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 780 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
783 781
784 KPrefsDialogWidColor *holidayColor = 782 KPrefsDialogWidColor *holidayColor =
785 addWidColor(i18n("Day color odd months"), 783 addWidColor(i18n("Day color odd months"),
786 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 784 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
787 topLayout->addWidget(holidayColor->label(),ii,0); 785 topLayout->addWidget(holidayColor->label(),ii,0);
788 topLayout->addWidget(holidayColor->button(),ii++,1); 786 topLayout->addWidget(holidayColor->button(),ii++,1);
789 787
790 holidayColor = 788 holidayColor =
791 addWidColor(i18n("Day color even months"), 789 addWidColor(i18n("Day color even months"),
792 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 790 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
793 topLayout->addWidget(holidayColor->label(),ii,0); 791 topLayout->addWidget(holidayColor->label(),ii,0);
794 topLayout->addWidget(holidayColor->button(),ii++,1); 792 topLayout->addWidget(holidayColor->button(),ii++,1);
795 793
796 794
797 holidayColor = 795 holidayColor =
798 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 796 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
799 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 797 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
800 topLayout->addWidget(holidayColor->label(),ii,0); 798 topLayout->addWidget(holidayColor->label(),ii,0);
801 topLayout->addWidget(holidayColor->button(),ii++,1); 799 topLayout->addWidget(holidayColor->button(),ii++,1);
802 // *********************** What'sNext View 800 // *********************** What'sNext View
803 topFrame = addPage(i18n("What's Next View"),0,0); 801 topFrame = addPage(i18n("What's Next View"),0,0);
804 // DesktopIcon("viewmag",KIcon::SizeMedium)); 802 // DesktopIcon("viewmag",KIcon::SizeMedium));
805 803
806 topLayout = new QGridLayout(topFrame,4,1); 804 topLayout = new QGridLayout(topFrame,4,1);
807 topLayout->setSpacing(spacingHint()); 805 topLayout->setSpacing(spacingHint());
808 topLayout->setMargin(marginHint()); 806 topLayout->setMargin(marginHint());
809 ii = 0; 807 ii = 0;
810 KPrefsDialogWidBool *passwdk = 808 KPrefsDialogWidBool *passwdk =
811 809
812 addWidBool(i18n("Show events, that are done in \nWhat's Next view"), 810 addWidBool(i18n("Show events, that are done in \nWhat's Next view"),
813 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 811 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
814 topLayout->addWidget(passwdk->checkBox(), ii++,0); 812 topLayout->addWidget(passwdk->checkBox(), ii++,0);
815 passwdk = 813 passwdk =
816 addWidBool(i18n("Show parent To-Do's in What's Next view"), 814 addWidBool(i18n("Show parent To-Do's in What's Next view"),
817 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 815 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
818 topLayout->addWidget(passwdk->checkBox(), ii++,0); 816 topLayout->addWidget(passwdk->checkBox(), ii++,0);
819 817
820 passwdk = 818 passwdk =
821 addWidBool(i18n("Show location in What's Next view"), 819 addWidBool(i18n("Show location in What's Next view"),
822 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 820 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
823 topLayout->addWidget(passwdk->checkBox(), ii++,0); 821 topLayout->addWidget(passwdk->checkBox(), ii++,0);
824 822
825 passwdk = 823 passwdk =
826 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), 824 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
827 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 825 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
828 topLayout->addWidget(passwdk->checkBox(), ii++,0); 826 topLayout->addWidget(passwdk->checkBox(), ii++,0);
829 passwdk = 827 passwdk =
830 addWidBool(i18n("Use short date in \nWhat's Next/Event view"), 828 addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
831 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 829 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
832 topLayout->addWidget(passwdk->checkBox(), ii++,0); 830 topLayout->addWidget(passwdk->checkBox(), ii++,0);
833 831
834 832
835 833
836 834
837 // *********************** Todo View 835 // *********************** Todo View
838 836
839 topFrame = addPage(i18n("Todo View"),0,0); 837 topFrame = addPage(i18n("Todo View"),0,0);
840 // DesktopIcon("viewmag",KIcon::SizeMedium)); 838 // DesktopIcon("viewmag",KIcon::SizeMedium));
841 839
842 topLayout = new QGridLayout(topFrame,4,1); 840 topLayout = new QGridLayout(topFrame,4,1);
843 topLayout->setSpacing(spacingHint()); 841 topLayout->setSpacing(spacingHint());
844 topLayout->setMargin(marginHint()); 842 topLayout->setMargin(marginHint());
845 ii = 0; 843 ii = 0;
846dummy = 844dummy =
847 addWidBool(i18n("Hide not running Todos in To-do view"), 845 addWidBool(i18n("Hide not running Todos in To-do view"),
848 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 846 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
849 topLayout->addWidget(dummy->checkBox(),ii++,0); 847 topLayout->addWidget(dummy->checkBox(),ii++,0);
850 848
851 849
852 KPrefsDialogWidBool *showCompletedTodo = 850 KPrefsDialogWidBool *showCompletedTodo =
853 addWidBool(i18n("To-do view shows completed Todos"), 851 addWidBool(i18n("To-do view shows completed Todos"),
854 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 852 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
855 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 853 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
856 dummy = 854 dummy =
857 addWidBool(i18n("To-do view shows complete as 'xx %'"), 855 addWidBool(i18n("To-do view shows complete as 'xx %'"),
858 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 856 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
859 topLayout->addWidget(dummy->checkBox(),ii++,0); 857 topLayout->addWidget(dummy->checkBox(),ii++,0);
860 858
861 dummy = 859 dummy =
862 addWidBool(i18n("Small To-do view uses smaller font"), 860 addWidBool(i18n("Small To-do view uses smaller font"),
863 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 861 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
864 topLayout->addWidget(dummy->checkBox(),ii++,0); 862 topLayout->addWidget(dummy->checkBox(),ii++,0);
865 863
866 864
867 865
868 dummy = 866 dummy =
869 addWidBool(i18n("Todo view uses category colors"), 867 addWidBool(i18n("Todo view uses category colors"),
870 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 868 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
871 topLayout->addWidget(dummy->checkBox(),ii++,0); 869 topLayout->addWidget(dummy->checkBox(),ii++,0);
872 870
873 871
874 QWidget* wid = new QWidget( topFrame ); 872 QWidget* wid = new QWidget( topFrame );
875 // Todo due today color 873 // Todo due today color
876 KPrefsDialogWidColor *todoDueTodayColor = 874 KPrefsDialogWidColor *todoDueTodayColor =
877 addWidColor(i18n("Todo due today color:"), 875 addWidColor(i18n("Todo due today color:"),
878 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 876 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
879 QHBoxLayout *widLayout = new QHBoxLayout(wid); 877 QHBoxLayout *widLayout = new QHBoxLayout(wid);
880 widLayout->addWidget( todoDueTodayColor->label() ); 878 widLayout->addWidget( todoDueTodayColor->label() );
881 widLayout->addWidget( todoDueTodayColor->button() ); 879 widLayout->addWidget( todoDueTodayColor->button() );
882 topLayout->addWidget(wid,ii++,0); 880 topLayout->addWidget(wid,ii++,0);
883 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 881 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
884 882
885 // Todo overdue color 883 // Todo overdue color
886 wid = new QWidget( topFrame ); 884 wid = new QWidget( topFrame );
887 widLayout = new QHBoxLayout(wid); 885 widLayout = new QHBoxLayout(wid);
888 KPrefsDialogWidColor *todoOverdueColor = 886 KPrefsDialogWidColor *todoOverdueColor =
889 addWidColor(i18n("Todo overdue color:"), 887 addWidColor(i18n("Todo overdue color:"),
890 &(KOPrefs::instance()->mTodoOverdueColor),wid); 888 &(KOPrefs::instance()->mTodoOverdueColor),wid);
891 widLayout->addWidget(todoOverdueColor->label()); 889 widLayout->addWidget(todoOverdueColor->label());
892 widLayout->addWidget(todoOverdueColor->button()); 890 widLayout->addWidget(todoOverdueColor->button());
893 topLayout->addWidget(wid,ii++,0); 891 topLayout->addWidget(wid,ii++,0);
894 892
895 dummy = 893 dummy =
896 addWidBool(i18n("Colors are applied to text"), 894 addWidBool(i18n("Colors are applied to text"),
897 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 895 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
898 topLayout->addWidget(dummy->checkBox(),ii++,0); 896 topLayout->addWidget(dummy->checkBox(),ii++,0);
899 897
900 dummy = 898 dummy =
901 addWidBool(i18n("Allday Agenda view shows todos"), 899 addWidBool(i18n("Allday Agenda view shows todos"),
902 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 900 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
903 topLayout->addWidget(dummy->checkBox(),ii++,0); 901 topLayout->addWidget(dummy->checkBox(),ii++,0);
904 902
905 903
906 904
907 905
908 topFrame = addPage(i18n("Alarm"),0,0); 906 topFrame = addPage(i18n("Alarm"),0,0);
909 // DesktopIcon("viewmag",KIcon::SizeMedium)); 907 // DesktopIcon("viewmag",KIcon::SizeMedium));
910 908
911 topLayout = new QGridLayout(topFrame,2,1); 909 topLayout = new QGridLayout(topFrame,2,1);
912 topLayout->setSpacing(spacingHint()); 910 topLayout->setSpacing(spacingHint());
913 topLayout->setMargin(marginHint()); 911 topLayout->setMargin(marginHint());
914 int iii = 0; 912 int iii = 0;
915 913
916 dummy = 914 dummy =
917 addWidBool(i18n("Use internal alarm notification"), 915 addWidBool(i18n("Use internal alarm notification"),
918 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 916 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
919 topLayout->addWidget(dummy->checkBox(),iii++,0); 917 topLayout->addWidget(dummy->checkBox(),iii++,0);
920 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 918 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
921 919
922 topLayout->addWidget(lab ,iii++,0); 920 topLayout->addWidget(lab ,iii++,0);
923#ifndef DESKTOP_VERSION 921#ifndef DESKTOP_VERSION
924 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 922 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
925#else 923#else
926 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 924 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
927 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 925 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
928#endif 926#endif
929 927
930 QHBox* dummyBox = new QHBox(topFrame); 928 QHBox* dummyBox = new QHBox(topFrame);
931 new QLabel(i18n("Play beeps count:"),dummyBox); 929 new QLabel(i18n("Play beeps count:"),dummyBox);
932 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 930 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
933 topLayout->addWidget(dummyBox,iii++,0); 931 topLayout->addWidget(dummyBox,iii++,0);
934 932
935 dummyBox = new QHBox(topFrame); 933 dummyBox = new QHBox(topFrame);
936 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 934 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
937 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 935 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
938 topLayout->addWidget(dummyBox,iii++,0); 936 topLayout->addWidget(dummyBox,iii++,0);
939 937
940 dummyBox = new QHBox(topFrame); 938 dummyBox = new QHBox(topFrame);
941 new QLabel(i18n("Default suspend time in min:"),dummyBox); 939 new QLabel(i18n("Default suspend time in min:"),dummyBox);
942 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 940 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
943 topLayout->addWidget(dummyBox,iii++,0); 941 topLayout->addWidget(dummyBox,iii++,0);
944 942
945 dummyBox = new QHBox(topFrame); 943 dummyBox = new QHBox(topFrame);
946 new QLabel(i18n("Auto suspend count:"),dummyBox); 944 new QLabel(i18n("Auto suspend count:"),dummyBox);
947 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 945 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
948 topLayout->addWidget(dummyBox,iii++,0); 946 topLayout->addWidget(dummyBox,iii++,0);
949 947
950 948
951 949
952 950
953 951
954 952
955 953
956 QHBox* hbo = new QHBox ( topFrame ); 954 QHBox* hbo = new QHBox ( topFrame );
957 mDefaultAlarmFile = new QLineEdit(hbo); 955 mDefaultAlarmFile = new QLineEdit(hbo);
958 QPushButton * loadTemplate = new QPushButton(hbo); 956 QPushButton * loadTemplate = new QPushButton(hbo);
959 QPixmap icon; 957 QPixmap icon;
960 if ( QApplication::desktop()->width() < 321 ) 958 if ( QApplication::desktop()->width() < 321 )
961 icon = SmallIcon("fileimport16"); 959 icon = SmallIcon("fileimport16");
962 else 960 else
963 icon = SmallIcon("fileimport"); 961 icon = SmallIcon("fileimport");
964 loadTemplate->setIconSet (icon ) ; 962 loadTemplate->setIconSet (icon ) ;
965 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 963 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
966 int size = loadTemplate->sizeHint().height(); 964 int size = loadTemplate->sizeHint().height();
967 loadTemplate->setFixedSize( size, size ); 965 loadTemplate->setFixedSize( size, size );
968 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 966 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
969 // topLayout->addWidget(lab ,iii++,0); 967 // topLayout->addWidget(lab ,iii++,0);
970 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 968 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
971 topLayout->addWidget(lab ,iii++,0); 969 topLayout->addWidget(lab ,iii++,0);
972 topLayout->addWidget(hbo,iii++,0); 970 topLayout->addWidget(hbo,iii++,0);
973 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 971 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
974 972
975// topLayout->addWidget(lab ,iii++,0); 973// topLayout->addWidget(lab ,iii++,0);
976// #ifndef DESKTOP_VERSION 974// #ifndef DESKTOP_VERSION
977// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 975// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
978// #else 976// #else
979// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 977// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
980// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 978// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
981// #endif 979// #endif
982 980
983 981
984} 982}
985 983
986void KOPrefsDialog::selectSoundFile() 984void KOPrefsDialog::selectSoundFile()
987{ 985{
988 QString fileName = mDefaultAlarmFile->text(); 986 QString fileName = mDefaultAlarmFile->text();
989 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 987 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
990 if ( fileName.length() > 0 ) 988 if ( fileName.length() > 0 )
991 mDefaultAlarmFile->setText( fileName ); 989 mDefaultAlarmFile->setText( fileName );
992} 990}
993void KOPrefsDialog::setupFontsTab() 991void KOPrefsDialog::setupFontsTab()
994{ 992{
995 993
996 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 994 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
997 // DesktopIcon("fonts",KIcon::SizeMedium)); 995 // DesktopIcon("fonts",KIcon::SizeMedium));
998 996
999 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 997 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1000 topLayout->setSpacing(1); 998 topLayout->setSpacing(1);
1001 topLayout->setMargin(3); 999 topLayout->setMargin(3);
1002 KPrefsDialogWidFont * tVFont; 1000 KPrefsDialogWidFont * tVFont;
1003 int i = 0; 1001 int i = 0;
1004 KPrefsDialogWidFont *timeLabelsFont = 1002 KPrefsDialogWidFont *timeLabelsFont =
1005 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1003 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1006 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1004 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1007 topLayout->addWidget(timeLabelsFont->label(),i,0); 1005 topLayout->addWidget(timeLabelsFont->label(),i,0);
1008 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1006 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1009 topLayout->addWidget(timeLabelsFont->button(),i,2); 1007 topLayout->addWidget(timeLabelsFont->button(),i,2);
1010 ++i; 1008 ++i;
1011 1009
1012 1010
1013 timeLabelsFont = 1011 timeLabelsFont =
1014 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1012 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1015 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1013 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1016 topLayout->addWidget(timeLabelsFont->label(),i,0); 1014 topLayout->addWidget(timeLabelsFont->label(),i,0);
1017 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1015 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1018 topLayout->addWidget(timeLabelsFont->button(),i,2); 1016 topLayout->addWidget(timeLabelsFont->button(),i,2);
1019 ++i; 1017 ++i;
1020 1018
1021 KPrefsDialogWidFont *timeBarFont = 1019 KPrefsDialogWidFont *timeBarFont =
1022 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1020 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1023 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1021 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1024 topLayout->addWidget(timeBarFont->label(),i,0); 1022 topLayout->addWidget(timeBarFont->label(),i,0);
1025 topLayout->addWidget(timeBarFont->preview(),i,1); 1023 topLayout->addWidget(timeBarFont->preview(),i,1);
1026 topLayout->addWidget(timeBarFont->button(),i,2); 1024 topLayout->addWidget(timeBarFont->button(),i,2);
1027 ++i; 1025 ++i;
1028 1026
1029 1027
1030 KPrefsDialogWidFont *marcusBainsFont = 1028 KPrefsDialogWidFont *marcusBainsFont =
1031 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1029 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1032 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1030 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1033 topLayout->addWidget(marcusBainsFont->label(),i,0); 1031 topLayout->addWidget(marcusBainsFont->label(),i,0);
1034 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1032 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1035 topLayout->addWidget(marcusBainsFont->button(),i,2); 1033 topLayout->addWidget(marcusBainsFont->button(),i,2);
1036 ++i; 1034 ++i;
1037 1035
1038 tVFont = 1036 tVFont =
1039 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1037 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1040 &(KOPrefs::instance()->mEventViewFont),topFrame); 1038 &(KOPrefs::instance()->mEventViewFont),topFrame);
1041 topLayout->addWidget(tVFont->label(),i,0); 1039 topLayout->addWidget(tVFont->label(),i,0);
1042 topLayout->addWidget(tVFont->preview(),i,1); 1040 topLayout->addWidget(tVFont->preview(),i,1);
1043 topLayout->addWidget(tVFont->button(),i,2); 1041 topLayout->addWidget(tVFont->button(),i,2);
1044 ++i; 1042 ++i;
1045 1043
1046 1044
1047 1045
1048 tVFont = 1046 tVFont =
1049 addWidFont(i18n("Details"),i18n("EditorBox:"), 1047 addWidFont(i18n("Details"),i18n("EditorBox:"),
1050 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1048 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1051 topLayout->addWidget(tVFont->label(),i,0); 1049 topLayout->addWidget(tVFont->label(),i,0);
1052 topLayout->addWidget(tVFont->preview(),i,1); 1050 topLayout->addWidget(tVFont->preview(),i,1);
1053 topLayout->addWidget(tVFont->button(),i,2); 1051 topLayout->addWidget(tVFont->button(),i,2);
1054 ++i; 1052 ++i;
1055 1053
1056 1054
1057 1055
1058 topLayout->setColStretch(1,1); 1056 topLayout->setColStretch(1,1);
1059 topLayout->setRowStretch(4,1); 1057 topLayout->setRowStretch(4,1);
1060 1058
1061 1059
1062 i = 0; 1060 i = 0;
1063 topFrame = addPage(i18n("View Fonts"),0, 1061 topFrame = addPage(i18n("View Fonts"),0,
1064 DesktopIcon("fonts",KIcon::SizeMedium)); 1062 DesktopIcon("fonts",KIcon::SizeMedium));
1065 1063
1066 topLayout = new QGridLayout(topFrame,7,3); 1064 topLayout = new QGridLayout(topFrame,7,3);
1067 topLayout->setSpacing(1); 1065 topLayout->setSpacing(1);
1068 topLayout->setMargin(3); 1066 topLayout->setMargin(3);
1069 1067
1070 tVFont = 1068 tVFont =
1071 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1069 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1072 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1070 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1073 topLayout->addWidget(tVFont->label(),i,0); 1071 topLayout->addWidget(tVFont->label(),i,0);
1074 topLayout->addWidget(tVFont->preview(),i,1); 1072 topLayout->addWidget(tVFont->preview(),i,1);
1075 topLayout->addWidget(tVFont->button(),i,2); 1073 topLayout->addWidget(tVFont->button(),i,2);
1076 ++i; 1074 ++i;
1077 KPrefsDialogWidFont *agendaViewFont = 1075 KPrefsDialogWidFont *agendaViewFont =
1078 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1076 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1079 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1077 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1080 topLayout->addWidget(agendaViewFont->label(),i,0); 1078 topLayout->addWidget(agendaViewFont->label(),i,0);
1081 topLayout->addWidget(agendaViewFont->preview(),i,1); 1079 topLayout->addWidget(agendaViewFont->preview(),i,1);
1082 topLayout->addWidget(agendaViewFont->button(),i,2); 1080 topLayout->addWidget(agendaViewFont->button(),i,2);
1083 ++i; 1081 ++i;
1084 1082
1085 1083
1086 KPrefsDialogWidFont *monthViewFont = 1084 KPrefsDialogWidFont *monthViewFont =
1087 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1085 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1088 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1086 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1089 topLayout->addWidget(monthViewFont->label(),i,0); 1087 topLayout->addWidget(monthViewFont->label(),i,0);
1090 topLayout->addWidget(monthViewFont->preview(),i,1); 1088 topLayout->addWidget(monthViewFont->preview(),i,1);
1091 topLayout->addWidget(monthViewFont->button(),i,2); 1089 topLayout->addWidget(monthViewFont->button(),i,2);
1092 ++i; 1090 ++i;
1093 1091
1094 1092
1095 KPrefsDialogWidFont *lVFont = 1093 KPrefsDialogWidFont *lVFont =
1096 addWidFont(i18n("Event"),i18n("List View:"), 1094 addWidFont(i18n("Event"),i18n("List View:"),
1097 &(KOPrefs::instance()->mListViewFont),topFrame); 1095 &(KOPrefs::instance()->mListViewFont),topFrame);
1098 topLayout->addWidget(lVFont->label(),i,0); 1096 topLayout->addWidget(lVFont->label(),i,0);
1099 topLayout->addWidget(lVFont->preview(),i,1); 1097 topLayout->addWidget(lVFont->preview(),i,1);
1100 topLayout->addWidget(lVFont->button(),i,2); 1098 topLayout->addWidget(lVFont->button(),i,2);
1101 ++i; 1099 ++i;
1102 1100
1103 1101
1104 tVFont = 1102 tVFont =
1105 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1103 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1106 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1104 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1107 topLayout->addWidget(tVFont->label(),i,0); 1105 topLayout->addWidget(tVFont->label(),i,0);
1108 topLayout->addWidget(tVFont->preview(),i,1); 1106 topLayout->addWidget(tVFont->preview(),i,1);
1109 topLayout->addWidget(tVFont->button(),i,2); 1107 topLayout->addWidget(tVFont->button(),i,2);
1110 ++i; 1108 ++i;
1111 1109
1112 1110
1113 tVFont = 1111 tVFont =
1114 addWidFont(i18n("Today"),i18n("JournalView:"), 1112 addWidFont(i18n("Today"),i18n("JournalView:"),
1115 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1113 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1116 topLayout->addWidget(tVFont->label(),i,0); 1114 topLayout->addWidget(tVFont->label(),i,0);
1117 topLayout->addWidget(tVFont->preview(),i,1); 1115 topLayout->addWidget(tVFont->preview(),i,1);
1118 topLayout->addWidget(tVFont->button(),i,2); 1116 topLayout->addWidget(tVFont->button(),i,2);
1119 ++i; 1117 ++i;
1120 1118
1121 1119
1122 1120
1123 1121
1124 topLayout->setColStretch(1,1); 1122 topLayout->setColStretch(1,1);
1125 topLayout->setRowStretch(4,1); 1123 topLayout->setRowStretch(4,1);
1126 1124
1127 1125
1128 1126
1129 1127
1130} 1128}
1131 1129
1132void KOPrefsDialog::setupColorsTab() 1130void KOPrefsDialog::setupColorsTab()
1133{ 1131{
1134 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1132 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1135 // DesktopIcon("colorize",KIcon::SizeMedium)); 1133 // DesktopIcon("colorize",KIcon::SizeMedium));
1136 1134
1137 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1135 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1138 // topLayout->setSpacing(spacingHint()); 1136 // topLayout->setSpacing(spacingHint());
1139 // topLayout->setMargin(marginHint()); 1137 // topLayout->setMargin(marginHint());
1140 1138
1141 topLayout->setSpacing(2); 1139 topLayout->setSpacing(2);
1142 topLayout->setMargin(3); 1140 topLayout->setMargin(3);
1143 1141
1144 int ii = 1; 1142 int ii = 1;
1145 QGroupBox *categoryGroup ; 1143 QGroupBox *categoryGroup ;
1146 1144
1147 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1145 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1148 topFrame); 1146 topFrame);
1149 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1147 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1150 1148
1151 mCategoryCombo = new QComboBox(categoryGroup); 1149 mCategoryCombo = new QComboBox(categoryGroup);
1152 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1150 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1153 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1151 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1154 1152
1155 mCategoryButton = new KColorButton(categoryGroup); 1153 mCategoryButton = new KColorButton(categoryGroup);
1156 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1154 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1157 updateCategoryColor(); 1155 updateCategoryColor();
1158 1156
1159 1157
1160 // Holiday Color 1158 // Holiday Color
1161 1159
1162 KPrefsDialogWidColor *holidayColor = 1160 KPrefsDialogWidColor *holidayColor =
1163 addWidColor(i18n("Holiday color:"), 1161 addWidColor(i18n("Holiday color:"),
1164 &(KOPrefs::instance()->mHolidayColor),topFrame); 1162 &(KOPrefs::instance()->mHolidayColor),topFrame);
1165 topLayout->addWidget(holidayColor->label(),ii,0); 1163 topLayout->addWidget(holidayColor->label(),ii,0);
1166 topLayout->addWidget(holidayColor->button(),ii++,1); 1164 topLayout->addWidget(holidayColor->button(),ii++,1);
1167 1165
1168 // Highlight Color 1166 // Highlight Color
1169 KPrefsDialogWidColor *highlightColor = 1167 KPrefsDialogWidColor *highlightColor =
1170 addWidColor(i18n("Highlight color:"), 1168 addWidColor(i18n("Highlight color:"),
1171 &(KOPrefs::instance()->mHighlightColor),topFrame); 1169 &(KOPrefs::instance()->mHighlightColor),topFrame);
1172 topLayout->addWidget(highlightColor->label(),ii,0); 1170 topLayout->addWidget(highlightColor->label(),ii,0);
1173 topLayout->addWidget(highlightColor->button(),ii++,1); 1171 topLayout->addWidget(highlightColor->button(),ii++,1);
1174 1172
1175 // Event color 1173 // Event color
1176 KPrefsDialogWidColor *eventColor = 1174 KPrefsDialogWidColor *eventColor =
1177 addWidColor(i18n("Default event color:"), 1175 addWidColor(i18n("Default event color:"),
1178 &(KOPrefs::instance()->mEventColor),topFrame); 1176 &(KOPrefs::instance()->mEventColor),topFrame);
1179 topLayout->addWidget(eventColor->label(),ii,0); 1177 topLayout->addWidget(eventColor->label(),ii,0);
1180 topLayout->addWidget(eventColor->button(),ii++,1); 1178 topLayout->addWidget(eventColor->button(),ii++,1);
1181 1179
1182 // agenda view background color 1180 // agenda view background color
1183 KPrefsDialogWidColor *agendaBgColor = 1181 KPrefsDialogWidColor *agendaBgColor =
1184 addWidColor(i18n("Agenda view background color:"), 1182 addWidColor(i18n("Agenda view background color:"),
1185 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1183 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1186 topLayout->addWidget(agendaBgColor->label(),ii,0); 1184 topLayout->addWidget(agendaBgColor->label(),ii,0);
1187 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1185 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1188 1186
1189 // working hours color 1187 // working hours color
1190 KPrefsDialogWidColor *workingHoursColor = 1188 KPrefsDialogWidColor *workingHoursColor =
1191 addWidColor(i18n("Working hours color:"), 1189 addWidColor(i18n("Working hours color:"),
1192 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1190 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1193 topLayout->addWidget(workingHoursColor->label(),ii,0); 1191 topLayout->addWidget(workingHoursColor->label(),ii,0);
1194 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1192 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1195 1193
1196 KPrefsDialogWidBool *sb = 1194 KPrefsDialogWidBool *sb =
1197 addWidBool(i18n("Use colors for application:"), 1195 addWidBool(i18n("Use colors for application:"),
1198 &(KOPrefs::instance()->mUseAppColors),topFrame); 1196 &(KOPrefs::instance()->mUseAppColors),topFrame);
1199 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1197 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1200 1198
1201 ii++; 1199 ii++;
1202 KPrefsDialogWidColor * workingHoursColor1 = 1200 KPrefsDialogWidColor * workingHoursColor1 =
1203 addWidColor(i18n("Buttons, menus, etc.:"), 1201 addWidColor(i18n("Buttons, menus, etc.:"),
1204 &(KOPrefs::instance()->mAppColor1),topFrame); 1202 &(KOPrefs::instance()->mAppColor1),topFrame);
1205 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1203 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1206 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1204 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1207 1205
1208 KPrefsDialogWidColor * workingHoursColor2 = 1206 KPrefsDialogWidColor * workingHoursColor2 =
1209 addWidColor(i18n("Frames, labels, etc.:"), 1207 addWidColor(i18n("Frames, labels, etc.:"),
1210 &(KOPrefs::instance()->mAppColor2),topFrame); 1208 &(KOPrefs::instance()->mAppColor2),topFrame);
1211 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1209 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1212 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1210 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1213 1211
1214 1212
1215 1213
1216} 1214}
1217 1215
1218void KOPrefsDialog::setCategoryColor() 1216void KOPrefsDialog::setCategoryColor()
1219{ 1217{
1220 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1218 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1221} 1219}
1222 1220
1223void KOPrefsDialog::updateCategoryColor() 1221void KOPrefsDialog::updateCategoryColor()
1224{ 1222{
1225 QString cat = mCategoryCombo->currentText(); 1223 QString cat = mCategoryCombo->currentText();
1226 QColor *color = mCategoryDict.find(cat); 1224 QColor *color = mCategoryDict.find(cat);
1227 if (!color) { 1225 if (!color) {
1228 color = KOPrefs::instance()->categoryColor(cat); 1226 color = KOPrefs::instance()->categoryColor(cat);
1229 } 1227 }
1230 if (color) { 1228 if (color) {
1231 mCategoryButton->setColor(*color); 1229 mCategoryButton->setColor(*color);
1232 } 1230 }
1233} 1231}
1234 1232
1235void KOPrefsDialog::setupPrinterTab() 1233void KOPrefsDialog::setupPrinterTab()
1236{ 1234{
1237 mPrinterTab = addPage(i18n("Printing"),0, 1235 mPrinterTab = addPage(i18n("Printing"),0,
1238 DesktopIcon("fileprint",KIcon::SizeMedium)); 1236 DesktopIcon("fileprint",KIcon::SizeMedium));
1239 1237
1240 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1238 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1241 topLayout->setSpacing(spacingHint()); 1239 topLayout->setSpacing(spacingHint());
1242 topLayout->setMargin(marginHint()); 1240 topLayout->setMargin(marginHint());
1243 1241
1244 topLayout->setRowStretch(4,1); 1242 topLayout->setRowStretch(4,1);
1245} 1243}
1246 1244
1247void KOPrefsDialog::setupGroupSchedulingTab() 1245void KOPrefsDialog::setupGroupSchedulingTab()
1248{ 1246{
1249#if 0 1247#if 0
1250 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1248 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1251 DesktopIcon("personal",KIcon::SizeMedium)); 1249 DesktopIcon("personal",KIcon::SizeMedium));
1252 1250
1253 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1251 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1254 topLayout->setSpacing(spacingHint()); 1252 topLayout->setSpacing(spacingHint());
1255 topLayout->setMargin(marginHint()); 1253 topLayout->setMargin(marginHint());
1256 1254
1257#if 0 1255#if 0
1258 KPrefsDialogWidRadios *schedulerGroup = 1256 KPrefsDialogWidRadios *schedulerGroup =
1259 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1257 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1260 topFrame); 1258 topFrame);
1261 schedulerGroup->addRadio("Dummy"); // Only for debugging 1259 schedulerGroup->addRadio("Dummy"); // Only for debugging
1262 schedulerGroup->addRadio(i18n("Mail client")); 1260 schedulerGroup->addRadio(i18n("Mail client"));
1263 1261
1264 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1262 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1265#endif 1263#endif
1266 1264
1267 KPrefsDialogWidRadios *sendGroup = 1265 KPrefsDialogWidRadios *sendGroup =
1268 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1266 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1269 topFrame); 1267 topFrame);
1270 sendGroup->addRadio(i18n("Send to outbox")); 1268 sendGroup->addRadio(i18n("Send to outbox"));
1271 sendGroup->addRadio(i18n("Send directly")); 1269 sendGroup->addRadio(i18n("Send directly"));
1272 1270
1273 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1271 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1274 1272
1275 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1273 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1276 mAMails = new QListView(topFrame); 1274 mAMails = new QListView(topFrame);
1277 mAMails->addColumn(i18n("Email"),300); 1275 mAMails->addColumn(i18n("Email"),300);
1278 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1276 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1279 1277
1280 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1278 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1281 aEmailsEdit = new QLineEdit(topFrame); 1279 aEmailsEdit = new QLineEdit(topFrame);
1282 aEmailsEdit->setEnabled(false); 1280 aEmailsEdit->setEnabled(false);
1283 topLayout->addWidget(aEmailsEdit,4,1); 1281 topLayout->addWidget(aEmailsEdit,4,1);
1284 1282
1285 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1283 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1286 topLayout->addWidget(add,5,0); 1284 topLayout->addWidget(add,5,0);
1287 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1285 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1288 topLayout->addWidget(del,5,1); 1286 topLayout->addWidget(del,5,1);
1289 1287
1290 //topLayout->setRowStretch(2,1); 1288 //topLayout->setRowStretch(2,1);
1291 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1289 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1292 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1290 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1293 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1291 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1294 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1292 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1295#endif 1293#endif
1296} 1294}
1297 1295
1298void KOPrefsDialog::setupGroupAutomationTab() 1296void KOPrefsDialog::setupGroupAutomationTab()
1299{ 1297{
1300 return; 1298 return;
1301 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1299 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1302 DesktopIcon("personal",KIcon::SizeMedium)); 1300 DesktopIcon("personal",KIcon::SizeMedium));
1303 1301
1304 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1302 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1305 topLayout->setSpacing(spacingHint()); 1303 topLayout->setSpacing(spacingHint());
1306 topLayout->setMargin(marginHint()); 1304 topLayout->setMargin(marginHint());
1307 1305
1308 KPrefsDialogWidRadios *autoRefreshGroup = 1306 KPrefsDialogWidRadios *autoRefreshGroup =
1309 addWidRadios(i18n("Auto Send Refresh"), 1307 addWidRadios(i18n("Auto Send Refresh"),
1310 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1308 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1311 autoRefreshGroup->addRadio(i18n("Never")); 1309 autoRefreshGroup->addRadio(i18n("Never"));
1312 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1310 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1313 //autoRefreshGroup->addRadio(i18n("selected emails")); 1311 //autoRefreshGroup->addRadio(i18n("selected emails"));
1314 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1312 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1315 1313
1316 KPrefsDialogWidRadios *autoInsertGroup = 1314 KPrefsDialogWidRadios *autoInsertGroup =
1317 addWidRadios(i18n("Auto Insert IMIP Replies"), 1315 addWidRadios(i18n("Auto Insert IMIP Replies"),
1318 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1316 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1319 autoInsertGroup->addRadio(i18n("Never")); 1317 autoInsertGroup->addRadio(i18n("Never"));
1320 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1318 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1321 //autoInsertGroup->addRadio(i18n("selected emails")); 1319 //autoInsertGroup->addRadio(i18n("selected emails"));
1322 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1320 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1323 1321
1324 KPrefsDialogWidRadios *autoRequestGroup = 1322 KPrefsDialogWidRadios *autoRequestGroup =
1325 addWidRadios(i18n("Auto Insert IMIP Requests"), 1323 addWidRadios(i18n("Auto Insert IMIP Requests"),
1326 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1324 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1327 autoRequestGroup->addRadio(i18n("Never")); 1325 autoRequestGroup->addRadio(i18n("Never"));
1328 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1326 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1329 //autoInsertGroup->addRadio(i18n("selected emails")); 1327 //autoInsertGroup->addRadio(i18n("selected emails"));
1330 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1328 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1331 1329
1332 KPrefsDialogWidRadios *autoFreeBusyGroup = 1330 KPrefsDialogWidRadios *autoFreeBusyGroup =
1333 addWidRadios(i18n("Auto Send FreeBusy Information"), 1331 addWidRadios(i18n("Auto Send FreeBusy Information"),
1334 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1332 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1335 autoFreeBusyGroup->addRadio(i18n("Never")); 1333 autoFreeBusyGroup->addRadio(i18n("Never"));
1336 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1334 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1337 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1335 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1338 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1336 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1339 1337
1340 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1338 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1341 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1339 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1342 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1340 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1343 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1341 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1344 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1342 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1345 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1343 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1346 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1344 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1347} 1345}
1348 1346
1349void KOPrefsDialog::showPrinterTab() 1347void KOPrefsDialog::showPrinterTab()
1350{ 1348{
1351 showPage(pageIndex(mPrinterTab)); 1349 showPage(pageIndex(mPrinterTab));
1352} 1350}
1353 1351
1354 1352
1355void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1353void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1356 const QStringList *tags) 1354 const QStringList *tags)
1357{ 1355{
1358 if (tags) { 1356 if (tags) {
1359 int i = tags->findIndex(text); 1357 int i = tags->findIndex(text);
1360 if (i > 0) combo->setCurrentItem(i); 1358 if (i > 0) combo->setCurrentItem(i);
1361 } else { 1359 } else {
1362 for(int i=0;i<combo->count();++i) { 1360 for(int i=0;i<combo->count();++i) {
1363 if (combo->text(i) == text) { 1361 if (combo->text(i) == text) {
1364 combo->setCurrentItem(i); 1362 combo->setCurrentItem(i);
1365 break; 1363 break;
1366 } 1364 }
1367 } 1365 }
1368 } 1366 }
1369} 1367}
1370 1368
1371void KOPrefsDialog::usrReadConfig() 1369void KOPrefsDialog::usrReadConfig()
1372{ 1370{
1373 kdelibcfg->readConfig(); 1371 kdelibcfg->readConfig();
1374 mNameEdit->setText(KOPrefs::instance()->fullName()); 1372 mNameEdit->setText(KOPrefs::instance()->fullName());
1375 mEmailEdit->setText(KOPrefs::instance()->email()); 1373 mEmailEdit->setText(KOPrefs::instance()->email());
1376 1374
1377 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1375 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1378 // QDate current ( 2001, 1,1); 1376 // QDate current ( 2001, 1,1);
1379 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1377 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1380 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1378 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1381 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); 1379 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1382 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1380 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1383 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1381 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1384 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1382 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1385 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1383 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1386 // if (KOPrefs::instance()->mAllDaySize > 47 ) 1384 // if (KOPrefs::instance()->mAllDaySize > 47 )
1387 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; 1385 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1388 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); 1386 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1389 1387
1390 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1388 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1391 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1389 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1392 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1390 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1393 // mAMails->clear(); 1391 // mAMails->clear();
1394 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1392 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1395// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1393// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1396// QListViewItem *item = new QListViewItem(mAMails); 1394// QListViewItem *item = new QListViewItem(mAMails);
1397// item->setText(0,*it); 1395// item->setText(0,*it);
1398// mAMails->insertItem(item); 1396// mAMails->insertItem(item);
1399// } 1397// }
1400 1398
1401 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); 1399 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1402 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); 1400 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1403 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); 1401 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1404 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); 1402 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1405 1403
1406 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1404 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1407 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1405 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1408 //QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1406 //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1409 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 1407 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1410 //dummy = KOPrefs::instance()->mUserDateFormatShort; 1408 //dummy = KOPrefs::instance()->mUserDateFormatShort;
1411 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 1409 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1412 updateCategories(); 1410 updateCategories();
1413 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1411 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1414 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1412 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1415 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1413 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1416 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1414 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1417} 1415}
1418 1416
1419 1417
1420void KOPrefsDialog::usrWriteConfig() 1418void KOPrefsDialog::usrWriteConfig()
1421{ 1419{
1422 1420
1423 kdelibcfg->writeConfig(); 1421 kdelibcfg->writeConfig();
1424 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); 1422 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1425 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); 1423 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1426 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); 1424 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1427 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); 1425 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1428 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); 1426 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1429 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1427 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1430 1428
1431 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 1429 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1432 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 1430 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1433 KOPrefs::instance()->setFullName(mNameEdit->text()); 1431 KOPrefs::instance()->setFullName(mNameEdit->text());
1434 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1432 KOPrefs::instance()->setEmail(mEmailEdit->text());
1435 1433
1436 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1434 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1437 1435
1438 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); 1436 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1439 //QDate date; 1437 //QDate date;
1440 //date = mStartDateSavingEdit->date(); 1438 //date = mStartDateSavingEdit->date();
1441 //int sub = 0; 1439 //int sub = 0;
1442 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1440 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1443 // sub = 1; 1441 // sub = 1;
1444// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; 1442// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1445// date = mEndDateSavingEdit->date(); 1443// date = mEndDateSavingEdit->date();
1446// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1444// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1447// sub = 1; 1445// sub = 1;
1448// else 1446// else
1449// sub = 0; 1447// sub = 0;
1450// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1448// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1451// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1449// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1452 1450
1453 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1451 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1454 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1452 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1455 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1453 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1456 1454
1457 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1455 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1458 1456
1459 QDictIterator<QColor> it(mCategoryDict); 1457 QDictIterator<QColor> it(mCategoryDict);
1460 while (it.current()) { 1458 while (it.current()) {
1461 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1459 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1462 ++it; 1460 ++it;
1463 } 1461 }
1464 1462
1465 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1463 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1466 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1464 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1467 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1465 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1468 1466
1469 KOPrefs::instance()->mAdditionalMails.clear(); 1467 KOPrefs::instance()->mAdditionalMails.clear();
1470 // QListViewItem *item; 1468 // QListViewItem *item;
1471 // item = mAMails->firstChild(); 1469 // item = mAMails->firstChild();
1472 // while (item) 1470 // while (item)
1473 // { 1471 // {
1474 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1472 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1475 // item = item->nextSibling(); 1473 // item = item->nextSibling();
1476 // } 1474 // }
1477 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1475 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1478 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1476 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1479 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1477 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1480 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1478 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1481 1479
1482} 1480}
1483 1481
1484void KOPrefsDialog::updateCategories() 1482void KOPrefsDialog::updateCategories()
1485{ 1483{
1486 mCategoryCombo->clear(); 1484 mCategoryCombo->clear();
1487 mCategoryDict.clear(); 1485 mCategoryDict.clear();
1488 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1486 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1489 updateCategoryColor(); 1487 updateCategoryColor();
1490} 1488}
1491 1489
1492void KOPrefsDialog::warningGroupScheduling() 1490void KOPrefsDialog::warningGroupScheduling()
1493{ 1491{
1494 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); 1492 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1495} 1493}
1496 1494
1497void KOPrefsDialog::warningProjectView() 1495void KOPrefsDialog::warningProjectView()
1498{ 1496{
1499 warningExperimental(mEnableProjectView->checkBox()->isChecked()); 1497 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1500} 1498}
1501 1499
1502void KOPrefsDialog::warningExperimental(bool on) 1500void KOPrefsDialog::warningExperimental(bool on)
1503{ 1501{
1504 if (on) { 1502 if (on) {
1505 KMessageBox::information(this,i18n("This is an experimental feature. " 1503 KMessageBox::information(this,i18n("This is an experimental feature. "
1506 "It may not work, it may do nothing useful and it may cause data loss. " 1504 "It may not work, it may do nothing useful and it may cause data loss. "
1507 "Use with care.\n" 1505 "Use with care.\n"
1508 "You have to restart KOrganizer for this setting to take effect.")); 1506 "You have to restart KOrganizer for this setting to take effect."));
1509 } else { 1507 } else {
1510 KMessageBox::information(this, 1508 KMessageBox::information(this,
1511 i18n("You have to restart KOrganizer for this setting to take effect.")); 1509 i18n("You have to restart KOrganizer for this setting to take effect."));
1512 } 1510 }
1513} 1511}
1514 1512
1515void KOPrefsDialog::toggleEmailSettings(bool on) 1513void KOPrefsDialog::toggleEmailSettings(bool on)
1516{ 1514{
1517 if (on) { 1515 if (on) {
1518 mEmailEdit->setEnabled(false); 1516 mEmailEdit->setEnabled(false);
1519 mNameEdit->setEnabled(false); 1517 mNameEdit->setEnabled(false);
1520 mEmailLabel->setEnabled(false); 1518 mEmailLabel->setEnabled(false);
1521 mNameLabel->setEnabled(false); 1519 mNameLabel->setEnabled(false);
1522 1520
1523 KEMailSettings settings; 1521 KEMailSettings settings;
1524 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1522 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1525 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1523 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1526 } else { 1524 } else {
1527 mEmailEdit->setEnabled(true); 1525 mEmailEdit->setEnabled(true);
1528 mNameEdit->setEnabled(true); 1526 mNameEdit->setEnabled(true);
1529 mEmailLabel->setEnabled(true); 1527 mEmailLabel->setEnabled(true);
1530 mNameLabel->setEnabled(true); 1528 mNameLabel->setEnabled(true);
1531 } 1529 }
1532} 1530}
1533 1531
1534void KOPrefsDialog::addItem() 1532void KOPrefsDialog::addItem()
1535{ 1533{
1536 // aEmailsEdit->setEnabled(true); 1534 // aEmailsEdit->setEnabled(true);
1537// QListViewItem *item = new QListViewItem(mAMails); 1535// QListViewItem *item = new QListViewItem(mAMails);
1538// mAMails->insertItem(item); 1536// mAMails->insertItem(item);
1539// mAMails->setSelected(item,true); 1537// mAMails->setSelected(item,true);
1540// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1538// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1541} 1539}
1542 1540
1543void KOPrefsDialog::removeItem() 1541void KOPrefsDialog::removeItem()
1544{ 1542{
1545// QListViewItem *item; 1543// QListViewItem *item;
1546// item = mAMails->selectedItem(); 1544// item = mAMails->selectedItem();
1547// if (!item) return; 1545// if (!item) return;
1548// mAMails->takeItem(item); 1546// mAMails->takeItem(item);
1549// item = mAMails->selectedItem(); 1547// item = mAMails->selectedItem();
1550// if (!item) { 1548// if (!item) {
1551// aEmailsEdit->setText(""); 1549// aEmailsEdit->setText("");
1552// aEmailsEdit->setEnabled(false); 1550// aEmailsEdit->setEnabled(false);
1553// } 1551// }
1554// if (mAMails->childCount() == 0) { 1552// if (mAMails->childCount() == 0) {
1555// aEmailsEdit->setEnabled(false); 1553// aEmailsEdit->setEnabled(false);
1556// } 1554// }
1557} 1555}
1558 1556
1559void KOPrefsDialog::updateItem() 1557void KOPrefsDialog::updateItem()
1560{ 1558{
1561 // QListViewItem *item; 1559 // QListViewItem *item;
1562// item = mAMails->selectedItem(); 1560// item = mAMails->selectedItem();
1563// if (!item) return; 1561// if (!item) return;
1564// item->setText(0,aEmailsEdit->text()); 1562// item->setText(0,aEmailsEdit->text());
1565} 1563}
1566 1564
1567void KOPrefsDialog::updateInput() 1565void KOPrefsDialog::updateInput()
1568{ 1566{
1569// QListViewItem *item; 1567// QListViewItem *item;
1570// item = mAMails->selectedItem(); 1568// item = mAMails->selectedItem();
1571// if (!item) return; 1569// if (!item) return;
1572// aEmailsEdit->setEnabled(true); 1570// aEmailsEdit->setEnabled(true);
1573// aEmailsEdit->setText(item->text(0)); 1571// aEmailsEdit->setText(item->text(0));
1574} 1572}
1575void KOPrefsDialog::updateTimezoneOffset( int index ) 1573void KOPrefsDialog::updateTimezoneOffset( int index )
1576{ 1574{
1577 /* 1575 /*
1578 qDebug("updateTimezoneOffset %d ", index); 1576 qDebug("updateTimezoneOffset %d ", index);
1579 if ( index < 24 ) { 1577 if ( index < 24 ) {
1580 mTimezoneOffsetSpin->setEnabled ( false ); 1578 mTimezoneOffsetSpin->setEnabled ( false );
1581 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); 1579 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1582 1580
1583 1581
1584 } else { 1582 } else {
1585 if ( index == 24 ) { 1583 if ( index == 24 ) {
1586 mTimezoneOffsetSpin->setEnabled ( true ); 1584 mTimezoneOffsetSpin->setEnabled ( true );
1587 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1585 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1588 1586
1589 } else { 1587 } else {
1590 mTimezoneOffsetSpin->setEnabled ( false ); 1588 mTimezoneOffsetSpin->setEnabled ( false );
1591 mTimezoneOffsetSpin->setValue( 0 ); 1589 mTimezoneOffsetSpin->setValue( 0 );
1592 } 1590 }
1593 } 1591 }
1594 */ 1592 */
1595} 1593}
1596 1594
1597void KOPrefsDialog::setupTimeZoneTab() 1595void KOPrefsDialog::setupTimeZoneTab()
1598{ 1596{
1599#if 0 1597#if 0
1600 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); 1598 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1601 // DesktopIcon("clock",KIcon::SizeMedium)); 1599 // DesktopIcon("clock",KIcon::SizeMedium));
1602 1600
1603 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1601 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1604 topLayout->setSpacing(spacingHint()); 1602 topLayout->setSpacing(spacingHint());
1605 topLayout->setMargin(marginHint()); 1603 topLayout->setMargin(marginHint());
1606 1604
1607 QHBox *timeZoneBox = new QHBox( topFrame ); 1605 QHBox *timeZoneBox = new QHBox( topFrame );
1608 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 1606 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1609 1607
1610 new QLabel( i18n("Timezone:"), timeZoneBox ); 1608 new QLabel( i18n("Timezone:"), timeZoneBox );
1611 mTimeZoneCombo = new QComboBox( timeZoneBox ); 1609 mTimeZoneCombo = new QComboBox( timeZoneBox );
1612 if ( QApplication::desktop()->width() < 300 ) { 1610 if ( QApplication::desktop()->width() < 300 ) {
1613 mTimeZoneCombo->setMaximumWidth(150); 1611 mTimeZoneCombo->setMaximumWidth(150);
1614 } 1612 }
1615 1613
1616 QStringList list; 1614 QStringList list;
1617 list = KGlobal::locale()->timeZoneList(); 1615 list = KGlobal::locale()->timeZoneList();
1618 mTimeZoneCombo->insertStringList(list); 1616 mTimeZoneCombo->insertStringList(list);
1619 1617
1620 // find the currently set time zone and select it 1618 // find the currently set time zone and select it
1621 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; 1619 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1622 int nCurrentlySet = 11; 1620 int nCurrentlySet = 11;
1623 for (int i = 0; i < mTimeZoneCombo->count(); i++) 1621 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1624 { 1622 {
1625 if (mTimeZoneCombo->text(i) == sCurrentlySet) 1623 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1626 { 1624 {
1627 nCurrentlySet = i; 1625 nCurrentlySet = i;
1628 break; 1626 break;
1629 } 1627 }
1630 } 1628 }
1631 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 1629 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1632 int iii = 1; 1630 int iii = 1;
1633 KPrefsDialogWidBool *sb = 1631 KPrefsDialogWidBool *sb =
1634 addWidBool(i18n("Timezone has daylight saving"), 1632 addWidBool(i18n("Timezone has daylight saving"),
1635 &(KOPrefs::instance()->mUseDaylightsaving),topFrame); 1633 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1636 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 1634 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1637 ++iii; 1635 ++iii;
1638 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 1636 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1639 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1637 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1640 ++iii; 1638 ++iii;
1641 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 1639 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1642 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1640 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1643 ++iii; 1641 ++iii;
1644 lab = new QLabel( i18n("Daylight start:"), topFrame ); 1642 lab = new QLabel( i18n("Daylight start:"), topFrame );
1645 topLayout->addWidget(lab, iii,0); 1643 topLayout->addWidget(lab, iii,0);
1646 mStartDateSavingEdit = new KDateEdit(topFrame); 1644 mStartDateSavingEdit = new KDateEdit(topFrame);
1647 topLayout->addWidget(mStartDateSavingEdit, iii,1); 1645 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1648 ++iii; 1646 ++iii;
1649 1647
1650 lab = new QLabel( i18n("Daylight end:"), topFrame ); 1648 lab = new QLabel( i18n("Daylight end:"), topFrame );
1651 topLayout->addWidget(lab, iii,0); 1649 topLayout->addWidget(lab, iii,0);
1652 mEndDateSavingEdit = new KDateEdit(topFrame); 1650 mEndDateSavingEdit = new KDateEdit(topFrame);
1653 topLayout->addWidget(mEndDateSavingEdit, iii,1); 1651 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1654 ++iii; 1652 ++iii;
1655 QDate current ( 2001, 1,1); 1653 QDate current ( 2001, 1,1);
1656 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1654 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1657 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1655 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1658#endif 1656#endif
1659 1657
1660} 1658}
1661 1659