summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-02 19:17:50 (UTC)
committer zautrix <zautrix>2005-07-02 19:17:50 (UTC)
commit8cde05e63c63af0f3ad8048d7160798439125d43 (patch) (unidiff)
tree4f1cca2213626931c0cf63eaa99bda0e31e4d330
parent27c100807f471a63d91ee08bdba3549d3a0cff8c (diff)
downloadkdepimpi-8cde05e63c63af0f3ad8048d7160798439125d43.zip
kdepimpi-8cde05e63c63af0f3ad8048d7160798439125d43.tar.gz
kdepimpi-8cde05e63c63af0f3ad8048d7160798439125d43.tar.bz2
nochn fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kofilterview.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 3f08ef8..ff80afc 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -32,358 +32,358 @@
32 32
33 33
34#include <libkcal/calfilter.h> 34#include <libkcal/calfilter.h>
35 35
36#include "kofilterview.h" 36#include "kofilterview.h"
37#include "koprefs.h" 37#include "koprefs.h"
38#include <kiconloader.h> 38#include <kiconloader.h>
39#include <kglobal.h> 39#include <kglobal.h>
40#include <kcolorbutton.h> 40#include <kcolorbutton.h>
41#include <kmessagebox.h> 41#include <kmessagebox.h>
42 42
43 43
44 44
45 45
46 46
47KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, 47KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent,
48 const char* name,WFlags fl ) 48 const char* name,WFlags fl )
49 : KOFilterView_base(parent,name,fl) 49 : KOFilterView_base(parent,name,fl)
50{ 50{
51 mFilters = filterList; 51 mFilters = filterList;
52 52
53 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 53 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
54 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 54 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
55 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); 55 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters()));
56} 56}
57 57
58KOFilterView::~KOFilterView() 58KOFilterView::~KOFilterView()
59{ 59{
60 // no need to delete child widgets, Qt does it all for us 60 // no need to delete child widgets, Qt does it all for us
61} 61}
62 62
63bool KOFilterView::filtersEnabled() 63bool KOFilterView::filtersEnabled()
64{ 64{
65 return mEnabledCheck->isChecked(); 65 return mEnabledCheck->isChecked();
66} 66}
67 67
68void KOFilterView::setFiltersEnabled(bool set) 68void KOFilterView::setFiltersEnabled(bool set)
69{ 69{
70 mEnabledCheck->setChecked(set); 70 mEnabledCheck->setChecked(set);
71 emit filterChanged(); 71 emit filterChanged();
72} 72}
73 73
74 74
75void KOFilterView::updateFilters() 75void KOFilterView::updateFilters()
76{ 76{
77 mSelectionCombo->clear(); 77 mSelectionCombo->clear();
78 78
79 CalFilter *filter = mFilters->first(); 79 CalFilter *filter = mFilters->first();
80 while(filter) { 80 while(filter) {
81 mSelectionCombo->insertItem(filter->name()); 81 mSelectionCombo->insertItem(filter->name());
82 filter = mFilters->next(); 82 filter = mFilters->next();
83 } 83 }
84} 84}
85 85
86CalFilter *KOFilterView::selectedFilter() 86CalFilter *KOFilterView::selectedFilter()
87{ 87{
88 CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); 88 CalFilter *f = mFilters->at(mSelectionCombo->currentItem());
89 return f; 89 return f;
90} 90}
91 91
92void KOFilterView::setSelectedFilter(QString filterName) 92void KOFilterView::setSelectedFilter(QString filterName)
93{ 93{
94 int filter_num = mSelectionCombo->count(); 94 int filter_num = mSelectionCombo->count();
95 int i; 95 int i;
96 for (i=0;i<filter_num;i++) { 96 for (i=0;i<filter_num;i++) {
97 if (mSelectionCombo->text(i)==filterName) 97 if (mSelectionCombo->text(i)==filterName)
98 mSelectionCombo->setCurrentItem(i); 98 mSelectionCombo->setCurrentItem(i);
99 } 99 }
100 emit filterChanged(); 100 emit filterChanged();
101} 101}
102void KOFilterView::setSelectedFilter( int fil ) 102void KOFilterView::setSelectedFilter( int fil )
103{ 103{
104 if ( fil >= mSelectionCombo->count() ) 104 if ( fil >= mSelectionCombo->count() )
105 return; 105 return;
106 mSelectionCombo->setCurrentItem( fil ); 106 mSelectionCombo->setCurrentItem( fil );
107 emit filterChanged(); 107 emit filterChanged();
108} 108}
109 109
110 110
111 111
112KOCalEditView::KOCalEditView(QWidget* parent, 112KOCalEditView::KOCalEditView(QWidget* parent,
113 const char* name ) 113 const char* name )
114 : QScrollView(parent,name) 114 : QScrollView(parent,name)
115{ 115{
116 mw = 0; 116 mw = 0;
117 setResizePolicy( AutoOneFit ); 117 setResizePolicy( AutoOneFit );
118 setFrameStyle ( QFrame::Panel | QFrame::Plain ); 118 setFrameStyle ( QFrame::Panel | QFrame::Plain );
119 setLineWidth ( 1 ); 119 setLineWidth ( 1 );
120 setMidLineWidth ( 1 ); 120 setMidLineWidth ( 1 );
121 setFocusPolicy(NoFocus); 121 setFocusPolicy(NoFocus);
122} 122}
123 123
124KOCalEditView::~KOCalEditView() 124KOCalEditView::~KOCalEditView()
125{ 125{
126 // no need to delete child widgets, Qt does it all for us 126 // no need to delete child widgets, Qt does it all for us
127} 127}
128void KOCalEditView::selectCal(int id ,bool b) 128void KOCalEditView::selectCal(int id ,bool b)
129{ 129{
130 KOPrefs::instance()->getCalendar( id )->isEnabled = b; 130 KOPrefs::instance()->getCalendar( id )->isEnabled = b;
131 emit calendarEnabled ( id, b ); 131 emit calendarEnabled ( id, b );
132 emit needsUpdate(); 132 emit needsUpdate();
133 133
134} 134}
135void KOCalEditView::selectStdCal( int id ) 135void KOCalEditView::selectStdCal( int id )
136{ 136{
137 KOCalRadioButton* it = mStdandardB.first(); 137 KOCalRadioButton* it = mStdandardB.first();
138 while ( it ) { 138 while ( it ) {
139 it->blockSignals( true ); 139 it->blockSignals( true );
140 it->setChecked( it->num() == id ); 140 it->setChecked( it->num() == id );
141 it->blockSignals( false ); 141 it->blockSignals( false );
142 it = mStdandardB.next(); 142 it = mStdandardB.next();
143 } 143 }
144 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 144 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
145 while ( kkf ) { 145 while ( kkf ) {
146 kkf->isStandard = (kkf->mCalNumber == id ); 146 kkf->isStandard = (kkf->mCalNumber == id );
147 kkf = KOPrefs::instance()->mCalendars.next(); 147 kkf = KOPrefs::instance()->mCalendars.next();
148 } 148 }
149 emit setCalendarDefault ( id ); 149 emit setCalendarDefault ( id );
150} 150}
151 151
152void KOCalEditView::selectCalAlarm(int id ,bool b ) 152void KOCalEditView::selectCalAlarm(int id ,bool b )
153{ 153{
154 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; 154 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b;
155 emit alarmEnabled ( id , b ); 155 emit alarmEnabled ( id , b );
156 emit needsUpdate(); 156 emit needsUpdate();
157} 157}
158void KOCalEditView::selectReadOnly(int id ,bool b ) 158void KOCalEditView::selectReadOnly(int id ,bool b )
159{ 159{
160
161 emit calendarReadonly ( id , b );
162 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
160 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { 163 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) {
161 findNewStandard(); 164 findNewStandard();
162 } else { 165 }
163 if ( !b ){ 166 if ( !b ){
164 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 167 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
165 while ( kkf ) { 168 while ( kkf ) {
166 if (kkf->isReadOnly && kkf->isStandard ) { 169 if (kkf->isReadOnly && kkf->isStandard ) {
167 selectStdCal( id ); 170 selectStdCal( id );
168 break; 171 break;
169 }
170 kkf = KOPrefs::instance()->mCalendars.next();
171 } 172 }
173 kkf = KOPrefs::instance()->mCalendars.next();
172 } 174 }
173 } 175 }
176
174 mStdandardB.at(id-1)->setEnabled( !b ); 177 mStdandardB.at(id-1)->setEnabled( !b );
175 emit calendarReadonly ( id , b );
176 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
177 emit needsUpdate(); 178 emit needsUpdate();
178 179
179} 180}
180void KOCalEditView::findNewStandard() 181void KOCalEditView::findNewStandard()
181{ 182{
182 bool found = false; 183 bool found = false;
183 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 184 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
184 while ( kkf ) { 185 while ( kkf ) {
185 if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { 186 if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) {
186 found = true; 187 found = true;
187 selectStdCal( kkf->mCalNumber ); 188 selectStdCal( kkf->mCalNumber );
188 break; 189 break;
189 } 190 }
190 kkf = KOPrefs::instance()->mCalendars.next(); 191 kkf = KOPrefs::instance()->mCalendars.next();
191 } 192 }
192 if ( !found ) { 193 if ( !found ) {
193 KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), 194 KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"),
194 i18n("Houston, we have a problem!") ); 195 i18n("Houston, we have a problem!") );
195 196
196 } 197 }
197} 198}
198 199
199void KOCalEditView::setColor( const QColor& c, int id ) 200void KOCalEditView::setColor( const QColor& c, int id )
200{ 201{
201 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 202 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
202 emit needsUpdate(); 203 emit needsUpdate();
203} 204}
204void KOCalEditView::deleteCal( int id ) 205void KOCalEditView::deleteCal( int id )
205{ 206{
206 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 207 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
207 QString name = kkf->mName; 208 QString name = kkf->mName;
208 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); 209 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
209 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 210 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
210 bool findnewstd = kkf->isStandard; 211 bool findnewstd = kkf->isStandard;
211 emit removeCalendar ( id ); 212 emit removeCalendar ( id );
212 KOPrefs::instance()->mCalendars.remove ( kkf ); 213 KOPrefs::instance()->mCalendars.remove ( kkf );
213 if ( findnewstd ) findNewStandard(); 214 if ( findnewstd ) findNewStandard();
214 emit needsUpdate(); 215 emit needsUpdate();
215 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 216 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
216} 217}
217void KOCalEditView::infoCal( int id ) 218void KOCalEditView::infoCal( int id )
218{ 219{
219 QString name = KOPrefs::instance()->getCalendar( id )->mName; 220 QString name = KOPrefs::instance()->getCalendar( id )->mName;
220 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); 221 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 );
221 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { 222 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) {
222 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { 223 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) {
223 emit calendarAdded( id ); 224 emit calendarAdded( id );
224 emit needsUpdate(); 225 emit needsUpdate();
225 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 226 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
226 QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); 227 QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) );
227 } 228 }
228 } 229 }
229 else 230 else
230 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); 231 KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) );
231} 232}
232void KOCalEditView::readConfig() 233void KOCalEditView::readConfig()
233{ 234{
234 235
235 mStdandardB.clear(); 236 mStdandardB.clear();
236 mEnabledB.clear(); 237 mEnabledB.clear();
237 mAlarmB.clear(); 238 mAlarmB.clear();
238 mROB.clear(); 239 mROB.clear();
239 240
240 if ( mw ) delete mw; 241 if ( mw ) delete mw;
241 mw = new QWidget ( viewport() ); 242 mw = new QWidget ( viewport() );
242 addChild(mw); 243 addChild(mw);
243 int ii = 0; 244 int ii = 0;
244 mainLayout = new QGridLayout ( mw , 2, 8 ); 245 mainLayout = new QGridLayout ( mw , 2, 8 );
245 mainLayout->setMargin( 2 ); 246 mainLayout->setMargin( 2 );
246 mainLayout->setSpacing( 2 ); 247 mainLayout->setSpacing( 2 );
247 QPushButton * addBut = new QPushButton ( mw ); 248 QPushButton * addButT = new QPushButton ( mw );
248 addBut->setFocusPolicy(NoFocus); 249 addButT->setFocusPolicy(NoFocus);
249 mainLayout->addWidget( addBut,0,0 ); 250 mainLayout->addWidget( addButT,0,0 );
250 addBut->setText( "D"); 251 addButT->setText( "D");
251 connect(addBut,SIGNAL(clicked()),SLOT(defaultInfo())); 252 connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo()));
252 //addBut->setPixmap ( SmallIcon("greenhook16")); 253 //addBut->setPixmap ( SmallIcon("greenhook16"));
253 addBut->setMaximumWidth( addBut->sizeHint().height() ); 254 QPushButton *addBut = new QPushButton ( mw );
254 int max = addBut->sizeHint().height();
255 addBut = new QPushButton ( mw );
256 addBut->setFocusPolicy(NoFocus); 255 addBut->setFocusPolicy(NoFocus);
257 mainLayout->addWidget( addBut,0,++ii ); 256 mainLayout->addWidget( addBut,0,++ii );
258 addBut->setPixmap ( SmallIcon("eye")); 257 addBut->setPixmap ( SmallIcon("eye"));
259 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 258 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
260 addBut->setMaximumWidth( addBut->sizeHint().height() ); 259 int max = addBut->sizeHint().height();
261 260 addBut->setMaximumWidth( max );
261 addButT->setFixedSize( QSize( max, max ) );
262 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); 262 QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw );
263 mainLayout->addWidget( lab,0,++ii ); 263 mainLayout->addWidget( lab,0,++ii );
264 //lab = new QLabel ( i18n(" "), mw ); 264 //lab = new QLabel ( i18n(" "), mw );
265 //mainLayout->addWidget( lab,0,++ii ); 265 //mainLayout->addWidget( lab,0,++ii );
266 //lab->setFixedWidth( 1 ); 266 //lab->setFixedWidth( 1 );
267 addBut = new QPushButton ( mw ); 267 addBut = new QPushButton ( mw );
268 addBut->setFocusPolicy(NoFocus); 268 addBut->setFocusPolicy(NoFocus);
269 mainLayout->addWidget( addBut,0,++ii ); 269 mainLayout->addWidget( addBut,0,++ii );
270 addBut->setPixmap ( SmallIcon("bell")); 270 addBut->setPixmap ( SmallIcon("bell"));
271 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 271 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
272 addBut->setMaximumWidth( addBut->sizeHint().height() ); 272 addBut->setMaximumWidth( addBut->sizeHint().height() );
273 273
274 addBut = new QPushButton ( mw ); 274 addBut = new QPushButton ( mw );
275 addBut->setFocusPolicy(NoFocus); 275 addBut->setFocusPolicy(NoFocus);
276 mainLayout->addWidget( addBut,0,++ii ); 276 mainLayout->addWidget( addBut,0,++ii );
277 addBut->setPixmap ( SmallIcon("pencil")); 277 addBut->setPixmap ( SmallIcon("pencil"));
278 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 278 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
279 addBut->setMaximumWidth( addBut->sizeHint().height() ); 279 addBut->setMaximumWidth( addBut->sizeHint().height() );
280 lab = new QLabel ( "", mw ); 280 lab = new QLabel ( "", mw );
281 mainLayout->addWidget( lab,0,++ii ); 281 mainLayout->addWidget( lab,0,++ii );
282 282
283 addBut = new QPushButton ( mw ); 283 addBut = new QPushButton ( mw );
284 addBut->setFocusPolicy(NoFocus); 284 addBut->setFocusPolicy(NoFocus);
285 mainLayout->addWidget( addBut,0,++ii ); 285 mainLayout->addWidget( addBut,0,++ii );
286 addBut->setPixmap ( SmallIcon("plus")); 286 addBut->setPixmap ( SmallIcon("plus"));
287 connect(addBut,SIGNAL(clicked()),SLOT(addCal())); 287 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
288 288
289 lab = new QLabel ( " ", mw ); 289 lab = new QLabel ( " ", mw );
290 mainLayout->addWidget( lab,0,++ii ); 290 mainLayout->addWidget( lab,0,++ii );
291 291
292 292
293 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 293 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
294 int row = 1; 294 int row = 1;
295 bool errorLoadStandard = false; 295 bool errorLoadStandard = false;
296 while ( kkf ) { 296 while ( kkf ) {
297 int iii = 0; 297 int iii = 0;
298 KOCalRadioButton* rb = new KOCalRadioButton( mw ); 298 KOCalRadioButton* rb = new KOCalRadioButton( mw );
299 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); 299 mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb );
300 rb->setChecked( kkf->isStandard ); 300 rb->setChecked( kkf->isStandard );
301 if ( kkf->isStandard && ( kkf->mErrorOnLoad || kkf->isReadOnly ) ) 301 if ( kkf->isStandard && ( kkf->mErrorOnLoad || kkf->isReadOnly ) )
302 errorLoadStandard = true; 302 errorLoadStandard = true;
303 rb->setNum( kkf->mCalNumber ); 303 rb->setNum( kkf->mCalNumber );
304 connect (rb, SIGNAL (selectNum(int)), SLOT ( selectStdCal(int) ) ); 304 connect (rb, SIGNAL (selectNum(int)), SLOT ( selectStdCal(int) ) );
305 if ( kkf->mErrorOnLoad || kkf->isReadOnly ) 305 if ( kkf->mErrorOnLoad || kkf->isReadOnly )
306 rb->setEnabled( false ); 306 rb->setEnabled( false );
307 KOCalCheckButton* cb = new KOCalCheckButton( mw ); 307 KOCalCheckButton* cb = new KOCalCheckButton( mw );
308 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); 308 mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb );
309 cb->setChecked( kkf->isEnabled && !kkf->mErrorOnLoad ); 309 cb->setChecked( kkf->isEnabled && !kkf->mErrorOnLoad );
310 cb->setNum( kkf->mCalNumber ); 310 cb->setNum( kkf->mCalNumber );
311 if ( kkf->mErrorOnLoad ) 311 if ( kkf->mErrorOnLoad )
312 cb->setEnabled( false ); 312 cb->setEnabled( false );
313 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); 313 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) );
314 KOCalButton* name = new KOCalButton( mw ); 314 KOCalButton* name = new KOCalButton( mw );
315 name->setNum( kkf->mCalNumber ); 315 name->setNum( kkf->mCalNumber );
316 name->setText( kkf->mName ); 316 name->setText( kkf->mName );
317 mainLayout->addWidget( name,row,++iii ); 317 mainLayout->addWidget( name,row,++iii );
318 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); 318 connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) );
319 //lab = new QLabel (" ", mw ); 319 //lab = new QLabel (" ", mw );
320 //mainLayout->addWidget( lab,row,++iii ); 320 //mainLayout->addWidget( lab,row,++iii );
321 cb = new KOCalCheckButton( mw ); 321 cb = new KOCalCheckButton( mw );
322 mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); 322 mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb );
323 cb->setChecked( kkf->isAlarmEnabled && !kkf->mErrorOnLoad); 323 cb->setChecked( kkf->isAlarmEnabled && !kkf->mErrorOnLoad);
324 cb->setNum( kkf->mCalNumber ); 324 cb->setNum( kkf->mCalNumber );
325 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); 325 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) );
326 if ( kkf->mErrorOnLoad ) 326 if ( kkf->mErrorOnLoad )
327 cb->setEnabled( false ); 327 cb->setEnabled( false );
328 cb = new KOCalCheckButton( mw ); 328 cb = new KOCalCheckButton( mw );
329 mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); 329 mainLayout->addWidget( cb,row,++iii );mROB.append( cb );
330 cb->setChecked( kkf->isReadOnly ); 330 cb->setChecked( kkf->isReadOnly );
331 cb->setNum( kkf->mCalNumber ); 331 cb->setNum( kkf->mCalNumber );
332 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); 332 connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) );
333 if ( kkf->mErrorOnLoad ) 333 if ( kkf->mErrorOnLoad )
334 cb->setEnabled( false ); 334 cb->setEnabled( false );
335 if ( row > 1) { 335 if ( row > 1) {
336 KColorButton *colb = new KColorButton( mw ); 336 KColorButton *colb = new KColorButton( mw );
337 mainLayout->addWidget( colb,row,++iii ); 337 mainLayout->addWidget( colb,row,++iii );
338 colb->setID( kkf->mCalNumber ); 338 colb->setID( kkf->mCalNumber );
339 colb->setColor( kkf->mDefaultColor ); 339 colb->setColor( kkf->mDefaultColor );
340 connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); 340 connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) );
341 KOCalButton* calb = new KOCalButton( mw ); 341 KOCalButton* calb = new KOCalButton( mw );
342 mainLayout->addWidget( calb,row,++iii ); 342 mainLayout->addWidget( calb,row,++iii );
343 calb->setNum( kkf->mCalNumber ); 343 calb->setNum( kkf->mCalNumber );
344 calb->setPixmap ( SmallIcon("minus")); 344 calb->setPixmap ( SmallIcon("minus"));
345 connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); 345 connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) );
346 int hei = calb->sizeHint().height(); 346 int hei = calb->sizeHint().height();
347 //calb->setMaximumSize( hei*9/10, hei*9/10 ); 347 //calb->setMaximumSize( hei*9/10, hei*9/10 );
348 } 348 }
349 ++row; 349 ++row;
350 kkf = KOPrefs::instance()->mCalendars.next(); 350 kkf = KOPrefs::instance()->mCalendars.next();
351 } 351 }
352 if ( errorLoadStandard ) 352 if ( errorLoadStandard )
353 findNewStandard(); 353 findNewStandard();
354 lab = new QLabel ( "", mw ); 354 lab = new QLabel ( "", mw );
355 mainLayout->addWidget( lab,row,0 ); 355 mainLayout->addWidget( lab,row,0 );
356 mw->show(); 356 mw->show();
357 357
358} 358}
359 359
360void KOCalEditView::defaultInfo() 360void KOCalEditView::defaultInfo()
361{ 361{
362 KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); 362 KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") );
363} 363}
364void KOCalEditView::addCal() 364void KOCalEditView::addCal()
365{ 365{
366 bool tryagain = true; 366 bool tryagain = true;
367 QString name, file; 367 QString name, file;
368 while ( tryagain ) { 368 while ( tryagain ) {
369 KONewCalPrefs prefs ( this ); 369 KONewCalPrefs prefs ( this );
370 prefs.nameE->setText( name ); 370 prefs.nameE->setText( name );
371 prefs.url->setURL( file ); 371 prefs.url->setURL( file );
372 if ( ! prefs.exec() ) 372 if ( ! prefs.exec() )
373 return; 373 return;
374 name = prefs.calName(); 374 name = prefs.calName();
375 file = prefs.calFileName(); 375 file = prefs.calFileName();
376 tryagain = false; 376 tryagain = false;
377 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 377 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
378 while ( kkf ) { 378 while ( kkf ) {
379 if ( kkf->mName == name ) { 379 if ( kkf->mName == name ) {
380 KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); 380 KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) );
381 name = ""; 381 name = "";
382 tryagain = true; 382 tryagain = true;
383 break; 383 break;
384 } 384 }
385 if ( kkf->mFileName == file ) { 385 if ( kkf->mFileName == file ) {
386 KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); 386 KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) );
387 tryagain = true; 387 tryagain = true;
388 file = ""; 388 file = "";
389 break; 389 break;