author | zautrix <zautrix> | 2005-06-15 19:45:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-15 19:45:57 (UTC) |
commit | e17a686fcfab42a71f25e9f0a4c3a395ec41a7b1 (patch) (unidiff) | |
tree | 3974dde9d4f9a5c8d3f6af724cafb3206d08f3cc | |
parent | ccfe3f97afd65c75ee6c7c931cb3694919a4e29b (diff) | |
download | kdepimpi-e17a686fcfab42a71f25e9f0a4c3a395ec41a7b1.zip kdepimpi-e17a686fcfab42a71f25e9f0a4c3a395ec41a7b1.tar.gz kdepimpi-e17a686fcfab42a71f25e9f0a4c3a395ec41a7b1.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/kofilterview.cpp | 11 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index a653c18..105028a 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -142,24 +142,25 @@ void KOFilterView::setSelectedFilter( int fil ) | |||
142 | 142 | ||
143 | 143 | ||
144 | 144 | ||
145 | KOCalEditView::KOCalEditView(QWidget* parent, | 145 | KOCalEditView::KOCalEditView(QWidget* parent, |
146 | const char* name ) | 146 | const char* name ) |
147 | : QScrollView(parent,name) | 147 | : QScrollView(parent,name) |
148 | { | 148 | { |
149 | mw = 0; | 149 | mw = 0; |
150 | setResizePolicy( AutoOneFit ); | 150 | setResizePolicy( AutoOneFit ); |
151 | setFrameStyle ( QFrame::Panel | QFrame::Plain ); | 151 | setFrameStyle ( QFrame::Panel | QFrame::Plain ); |
152 | setLineWidth ( 1 ); | 152 | setLineWidth ( 1 ); |
153 | setMidLineWidth ( 1 ); | 153 | setMidLineWidth ( 1 ); |
154 | setFocusPolicy(NoFocus); | ||
154 | } | 155 | } |
155 | 156 | ||
156 | KOCalEditView::~KOCalEditView() | 157 | KOCalEditView::~KOCalEditView() |
157 | { | 158 | { |
158 | // no need to delete child widgets, Qt does it all for us | 159 | // no need to delete child widgets, Qt does it all for us |
159 | } | 160 | } |
160 | void KOCalEditView::selectCal(int id ,bool b) | 161 | void KOCalEditView::selectCal(int id ,bool b) |
161 | { | 162 | { |
162 | KOPrefs::instance()->getCalendar( id )->isEnabled = b; | 163 | KOPrefs::instance()->getCalendar( id )->isEnabled = b; |
163 | emit calendarEnabled ( id, b ); | 164 | emit calendarEnabled ( id, b ); |
164 | emit needsUpdate(); | 165 | emit needsUpdate(); |
165 | 166 | ||
@@ -219,85 +220,89 @@ void KOCalEditView::selectReadOnly(int id ,bool b ) | |||
219 | 220 | ||
220 | } | 221 | } |
221 | void KOCalEditView::setColor( const QColor& c, int id ) | 222 | void KOCalEditView::setColor( const QColor& c, int id ) |
222 | { | 223 | { |
223 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; | 224 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; |
224 | emit needsUpdate(); | 225 | emit needsUpdate(); |
225 | } | 226 | } |
226 | void KOCalEditView::deleteCal( int id ) | 227 | void KOCalEditView::deleteCal( int id ) |
227 | { | 228 | { |
228 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); | 229 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); |
229 | QString name = kkf->mName; | 230 | QString name = kkf->mName; |
230 | QString file = kkf->mFileName; | 231 | QString file = kkf->mFileName; |
231 | if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b><tr> Do you want to remove this calendar from KO/Pi? (The file is not removed, of course!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; | 232 | if ( KMessageBox::warningContinueCancel( this, i18n("The calendar<tr><b>%1</b><tr>is displaying file<tr><b>%2</b><tr>Do you want to remove<tr>this calendar from KO/Pi?<tr>(The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; |
232 | if ( kkf->isStandard ) | 233 | if ( kkf->isStandard ) |
233 | selectStdCal( 1, true ); | 234 | selectStdCal( 1, true ); |
234 | emit removeCalendar ( id ); | 235 | emit removeCalendar ( id ); |
235 | KOPrefs::instance()->mCalendars.remove ( kkf ); | 236 | KOPrefs::instance()->mCalendars.remove ( kkf ); |
236 | emit needsUpdate(); | 237 | emit needsUpdate(); |
237 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 238 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
238 | } | 239 | } |
239 | void KOCalEditView::infoCal( int id ) | 240 | void KOCalEditView::infoCal( int id ) |
240 | { | 241 | { |
241 | QString name = KOPrefs::instance()->getCalendar( id )->mName; | 242 | QString name = KOPrefs::instance()->getCalendar( id )->mName; |
242 | QString file = KOPrefs::instance()->getCalendar( id )->mFileName; | 243 | QString file = KOPrefs::instance()->getCalendar( id )->mFileName; |
243 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { | 244 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { |
244 | 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) ) ) { | 245 | if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <tr><b>%1</b><tr> is not loaded! Loading of file <tr><b>%2</b><tr> failed! <tr><b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { |
245 | emit calendarAdded( id ); | 246 | emit calendarAdded( id ); |
246 | emit needsUpdate(); | 247 | emit needsUpdate(); |
247 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 248 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
248 | } | 249 | } |
249 | } | 250 | } |
250 | else | 251 | else |
251 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); | 252 | KMessageBox::information( this, i18n("The calendar <tr><b>%1</b><tr>is displaying file<tr><b>%2</b>").arg(name).arg(file) ); |
252 | } | 253 | } |
253 | void KOCalEditView::readConfig() | 254 | void KOCalEditView::readConfig() |
254 | { | 255 | { |
255 | 256 | ||
256 | mStdandardB.clear(); | 257 | mStdandardB.clear(); |
257 | mEnabledB.clear(); | 258 | mEnabledB.clear(); |
258 | mAlarmB.clear(); | 259 | mAlarmB.clear(); |
259 | mROB.clear(); | 260 | mROB.clear(); |
260 | 261 | ||
261 | if ( mw ) delete mw; | 262 | if ( mw ) delete mw; |
262 | mw = new QWidget ( viewport() ); | 263 | mw = new QWidget ( viewport() ); |
263 | addChild(mw); | 264 | addChild(mw); |
264 | 265 | ||
265 | mainLayout = new QGridLayout ( mw , 2, 8 ); | 266 | mainLayout = new QGridLayout ( mw , 2, 8 ); |
266 | mainLayout->setMargin( 3); | 267 | mainLayout->setMargin( 3); |
267 | mainLayout->setSpacing( 2); | 268 | mainLayout->setSpacing( 2); |
268 | QPushButton * addBut = new QPushButton ( mw ); | 269 | QPushButton * addBut = new QPushButton ( mw ); |
270 | addBut->setFocusPolicy(NoFocus); | ||
269 | mainLayout->addWidget( addBut,0,0 ); | 271 | mainLayout->addWidget( addBut,0,0 ); |
270 | addBut->setPixmap ( SmallIcon("plus")); | 272 | addBut->setPixmap ( SmallIcon("plus")); |
271 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); | 273 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); |
272 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 274 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
273 | 275 | ||
274 | addBut = new QPushButton ( mw ); | 276 | addBut = new QPushButton ( mw ); |
277 | addBut->setFocusPolicy(NoFocus); | ||
275 | mainLayout->addWidget( addBut,0,1 ); | 278 | mainLayout->addWidget( addBut,0,1 ); |
276 | addBut->setPixmap ( SmallIcon("eye")); | 279 | addBut->setPixmap ( SmallIcon("eye")); |
277 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); | 280 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); |
278 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 281 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
279 | 282 | ||
280 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); | 283 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); |
281 | mainLayout->addWidget( lab,0,2 ); | 284 | mainLayout->addWidget( lab,0,2 ); |
282 | lab = new QLabel ( i18n(" "), mw ); | 285 | lab = new QLabel ( i18n(" "), mw ); |
283 | mainLayout->addWidget( lab,0,3 ); | 286 | mainLayout->addWidget( lab,0,3 ); |
284 | lab->setFixedWidth( 6 ); | 287 | lab->setFixedWidth( 6 ); |
285 | addBut = new QPushButton ( mw ); | 288 | addBut = new QPushButton ( mw ); |
289 | addBut->setFocusPolicy(NoFocus); | ||
286 | mainLayout->addWidget( addBut,0,4 ); | 290 | mainLayout->addWidget( addBut,0,4 ); |
287 | addBut->setPixmap ( SmallIcon("bell")); | 291 | addBut->setPixmap ( SmallIcon("bell")); |
288 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); | 292 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); |
289 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 293 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
290 | 294 | ||
291 | addBut = new QPushButton ( mw ); | 295 | addBut = new QPushButton ( mw ); |
296 | addBut->setFocusPolicy(NoFocus); | ||
292 | mainLayout->addWidget( addBut,0,5 ); | 297 | mainLayout->addWidget( addBut,0,5 ); |
293 | addBut->setPixmap ( SmallIcon("pencil")); | 298 | addBut->setPixmap ( SmallIcon("pencil")); |
294 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); | 299 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); |
295 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 300 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
296 | 301 | ||
297 | lab = new QLabel ( i18n(" Color "), mw ); | 302 | lab = new QLabel ( i18n(" Color "), mw ); |
298 | mainLayout->addWidget( lab,0,6 ); | 303 | mainLayout->addWidget( lab,0,6 ); |
299 | #if 0 | 304 | #if 0 |
300 | addBut = new QPushButton ( mw ); | 305 | addBut = new QPushButton ( mw ); |
301 | mainLayout->addWidget( addBut,0,6 ); | 306 | mainLayout->addWidget( addBut,0,6 ); |
302 | addBut->setPixmap ( SmallIcon("minus")); | 307 | addBut->setPixmap ( SmallIcon("minus")); |
303 | connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); | 308 | connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index e2ebdd4..3ab316f 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -36,48 +36,50 @@ class QGridLayout; | |||
36 | 36 | ||
37 | using namespace KCal; | 37 | using namespace KCal; |
38 | class KOCalButton : public QPushButton | 38 | class KOCalButton : public QPushButton |
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | public: | 41 | public: |
42 | KOCalButton( QWidget *parent=0, const char *name=0 ) : | 42 | KOCalButton( QWidget *parent=0, const char *name=0 ) : |
43 | QPushButton( parent, name) | 43 | QPushButton( parent, name) |
44 | { | 44 | { |
45 | connect( this, SIGNAL( clicked() ), | 45 | connect( this, SIGNAL( clicked() ), |
46 | SLOT( bottonClicked() )); | 46 | SLOT( bottonClicked() )); |
47 | mNumber = -1; | 47 | mNumber = -1; |
48 | setFocusPolicy(NoFocus); | ||
48 | } | 49 | } |
49 | void setNum ( int num ) {mNumber = num; } | 50 | void setNum ( int num ) {mNumber = num; } |
50 | signals: | 51 | signals: |
51 | void selectNum ( int ); | 52 | void selectNum ( int ); |
52 | private: | 53 | private: |
53 | int mNumber; | 54 | int mNumber; |
54 | void keyPressEvent ( QKeyEvent * e ) | 55 | void keyPressEvent ( QKeyEvent * e ) |
55 | { | 56 | { |
56 | e->ignore(); | 57 | e->ignore(); |
57 | } | 58 | } |
58 | 59 | ||
59 | private slots : | 60 | private slots : |
60 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } | 61 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } |
61 | }; | 62 | }; |
62 | class KOCalCheckButton : public QCheckBox | 63 | class KOCalCheckButton : public QCheckBox |
63 | { | 64 | { |
64 | Q_OBJECT | 65 | Q_OBJECT |
65 | public: | 66 | public: |
66 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : | 67 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : |
67 | QCheckBox( parent, name) | 68 | QCheckBox( parent, name) |
68 | { | 69 | { |
69 | connect( this, SIGNAL( toggled ( bool ) ), | 70 | connect( this, SIGNAL( toggled ( bool ) ), |
70 | SLOT( bottonClicked( bool ) )); | 71 | SLOT( bottonClicked( bool ) )); |
71 | mNumber = -1; | 72 | mNumber = -1; |
73 | setFocusPolicy(NoFocus); | ||
72 | //setMaximumWidth( 10 ); | 74 | //setMaximumWidth( 10 ); |
73 | 75 | ||
74 | } | 76 | } |
75 | void setNum ( int num ) {mNumber = num; } | 77 | void setNum ( int num ) {mNumber = num; } |
76 | signals: | 78 | signals: |
77 | void selectNum ( int, bool ); | 79 | void selectNum ( int, bool ); |
78 | private: | 80 | private: |
79 | int mNumber; | 81 | int mNumber; |
80 | void keyPressEvent ( QKeyEvent * e ) | 82 | void keyPressEvent ( QKeyEvent * e ) |
81 | { | 83 | { |
82 | e->ignore(); | 84 | e->ignore(); |
83 | } | 85 | } |