summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-11 09:22:29 (UTC)
committer zautrix <zautrix>2005-06-11 09:22:29 (UTC)
commitd4501288ba7414ba89a791dd2c306e9f74eeb3fa (patch) (unidiff)
treea99b30c87947a22f9c2da3ab5426f4e5ed8de9ab /korganizer
parentb214921b2072079ec59a87ac84231f83532009d5 (diff)
downloadkdepimpi-d4501288ba7414ba89a791dd2c306e9f74eeb3fa.zip
kdepimpi-d4501288ba7414ba89a791dd2c306e9f74eeb3fa.tar.gz
kdepimpi-d4501288ba7414ba89a791dd2c306e9f74eeb3fa.tar.bz2
fixx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/kofilterview.cpp2
-rw-r--r--korganizer/kofilterview.h50
3 files changed, 54 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index ea100d1..8d992b9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -450,48 +450,49 @@ void CalendarView::init()
450 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 450 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
451 "CalendarView::DateNavigator" ); 451 "CalendarView::DateNavigator" );
452#if 0 452#if 0
453 // FIXME 453 // FIXME
454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
455 "CalendarView::DateNavigator", QDate::currentDate()); 455 "CalendarView::DateNavigator", QDate::currentDate());
456#endif 456#endif
457 // mDateNavigator->blockSignals( true ); 457 // mDateNavigator->blockSignals( true );
458 //leftFrameLayout->addWidget( mDateNavigator ); 458 //leftFrameLayout->addWidget( mDateNavigator );
459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
462 mTodoList->setNavigator( mNavigator ); 462 mTodoList->setNavigator( mNavigator );
463#if 0 463#if 0
464 if ( QApplication::desktop()->width() < 480 ) { 464 if ( QApplication::desktop()->width() < 480 ) {
465 leftFrameLayout->addWidget(mFilterView); 465 leftFrameLayout->addWidget(mFilterView);
466 leftFrameLayout->addWidget(mTodoList, 2 ); 466 leftFrameLayout->addWidget(mTodoList, 2 );
467 467
468 } else { 468 } else {
469 leftFrameLayout->addWidget(mTodoList,2 ); 469 leftFrameLayout->addWidget(mTodoList,2 );
470 leftFrameLayout->addWidget(mFilterView ); 470 leftFrameLayout->addWidget(mFilterView );
471 } 471 }
472#endif 472#endif
473 mFilterView->hide(); 473 mFilterView->hide();
474 mCalEditView->hide();
474 QWidget *rightBox = new QWidget( mMainFrame ); 475 QWidget *rightBox = new QWidget( mMainFrame );
475 //mainBoxLayout->addWidget ( rightBox, 10 ); 476 //mainBoxLayout->addWidget ( rightBox, 10 );
476 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 477 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
477 mRightFrame = new QWidgetStack( rightBox ); 478 mRightFrame = new QWidgetStack( rightBox );
478 rightLayout->addWidget( mRightFrame, 10 ); 479 rightLayout->addWidget( mRightFrame, 10 );
479 480
480 //mLeftFrame = (QWidget *)leftFrame; 481 //mLeftFrame = (QWidget *)leftFrame;
481 if ( KOPrefs::instance()->mVerticalScreen ) { 482 if ( KOPrefs::instance()->mVerticalScreen ) {
482 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 483 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
483 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 484 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
484 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 485 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
485 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 486 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
486 } else { 487 } else {
487 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 488 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
488 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 489 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
489 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 490 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
490 } 491 }
491 if ( !KOPrefs::instance()->mShowDateNavigator) 492 if ( !KOPrefs::instance()->mShowDateNavigator)
492 mDateNavigator->hide(); 493 mDateNavigator->hide();
493 //qDebug("Calendarview Size %d %d ", width(), height()); 494 //qDebug("Calendarview Size %d %d ", width(), height());
494#endif 495#endif
495 496
496 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 497 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
497 SLOT( showDates( const KCal::DateList & ) ) ); 498 SLOT( showDates( const KCal::DateList & ) ) );
@@ -3888,51 +3889,52 @@ void CalendarView::editFilters()
3888 3889
3889 CalFilter *filter = mFilters.first(); 3890 CalFilter *filter = mFilters.first();
3890 while(filter) { 3891 while(filter) {
3891 kdDebug() << " Filter: " << filter->name() << endl; 3892 kdDebug() << " Filter: " << filter->name() << endl;
3892 filter = mFilters.next(); 3893 filter = mFilters.next();
3893 } 3894 }
3894 3895
3895 mDialogManager->showFilterEditDialog(&mFilters); 3896 mDialogManager->showFilterEditDialog(&mFilters);
3896} 3897}
3897void CalendarView::toggleFilter() 3898void CalendarView::toggleFilter()
3898{ 3899{
3899 showFilter(! mFilterView->isVisible()); 3900 showFilter(! mFilterView->isVisible());
3900} 3901}
3901 3902
3902KOFilterView *CalendarView::filterView() 3903KOFilterView *CalendarView::filterView()
3903{ 3904{
3904 return mFilterView; 3905 return mFilterView;
3905} 3906}
3906void CalendarView::selectFilter( int fil ) 3907void CalendarView::selectFilter( int fil )
3907{ 3908{
3908 mFilterView->setSelectedFilter( fil ); 3909 mFilterView->setSelectedFilter( fil );
3909} 3910}
3910void CalendarView::showFilter(bool visible) 3911void CalendarView::showFilter(bool visible)
3911{ 3912{
3913#if 0
3912 if (visible) mCalEditView->show(); 3914 if (visible) mCalEditView->show();
3913 else mCalEditView->hide(); 3915 else mCalEditView->hide();
3914#if 0 3916#else
3915 if (visible) mFilterView->show(); 3917 if (visible) mFilterView->show();
3916 else mFilterView->hide(); 3918 else mFilterView->hide();
3917#endif 3919#endif
3918} 3920}
3919void CalendarView::toggleFilerEnabled( ) 3921void CalendarView::toggleFilerEnabled( )
3920{ 3922{
3921 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 3923 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
3922 if ( !mFilterView->filtersEnabled() ) 3924 if ( !mFilterView->filtersEnabled() )
3923 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 3925 topLevelWidget()->setCaption( i18n("Filter disabled ") );
3924 3926
3925} 3927}
3926void CalendarView::updateFilter() 3928void CalendarView::updateFilter()
3927{ 3929{
3928 CalFilter *filter = mFilterView->selectedFilter(); 3930 CalFilter *filter = mFilterView->selectedFilter();
3929 if (filter) { 3931 if (filter) {
3930 QString mess; 3932 QString mess;
3931 if (mFilterView->filtersEnabled()) { 3933 if (mFilterView->filtersEnabled()) {
3932 mess = i18n("Filter selected: ")+filter->name(); 3934 mess = i18n("Filter selected: ")+filter->name();
3933 filter->setEnabled(true); 3935 filter->setEnabled(true);
3934 } 3936 }
3935 else filter->setEnabled(false); 3937 else filter->setEnabled(false);
3936 mCalendar->setFilter(filter); 3938 mCalendar->setFilter(filter);
3937 updateView(); 3939 updateView();
3938 if ( !mess.isEmpty() ) 3940 if ( !mess.isEmpty() )
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 1bfe4dd..dc6237b 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -117,49 +117,49 @@ KOCalEditView::KOCalEditView(QWidget* parent,
117 117
118 addBut = new QPushButton ( this ); 118 addBut = new QPushButton ( this );
119 mainLayout->addWidget( addBut,0,1 ); 119 mainLayout->addWidget( addBut,0,1 );
120 addBut->setPixmap ( SmallIcon("eye")); 120 addBut->setPixmap ( SmallIcon("eye"));
121 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 121 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
122 addBut->setMaximumWidth( addBut->sizeHint().height() ); 122 addBut->setMaximumWidth( addBut->sizeHint().height() );
123 123
124 QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", this ); 124 QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", this );
125 mainLayout->addWidget( lab,0,2 ); 125 mainLayout->addWidget( lab,0,2 );
126 126
127 addBut = new QPushButton ( this ); 127 addBut = new QPushButton ( this );
128 mainLayout->addWidget( addBut,0,3 ); 128 mainLayout->addWidget( addBut,0,3 );
129 addBut->setPixmap ( SmallIcon("bell")); 129 addBut->setPixmap ( SmallIcon("bell"));
130 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 130 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
131 addBut->setMaximumWidth( addBut->sizeHint().height() ); 131 addBut->setMaximumWidth( addBut->sizeHint().height() );
132 132
133 addBut = new QPushButton ( this ); 133 addBut = new QPushButton ( this );
134 mainLayout->addWidget( addBut,0,4 ); 134 mainLayout->addWidget( addBut,0,4 );
135 addBut->setPixmap ( SmallIcon("pencil")); 135 addBut->setPixmap ( SmallIcon("pencil"));
136 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 136 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
137 addBut->setMaximumWidth( addBut->sizeHint().height() ); 137 addBut->setMaximumWidth( addBut->sizeHint().height() );
138 138
139 addBut = new QPushButton ( this ); 139 addBut = new QPushButton ( this );
140 mainLayout->addWidget( addBut,0,5 ); 140 mainLayout->addWidget( addBut,0,5 );
141 addBut->setPixmap ( SmallIcon("trash")); 141 addBut->setPixmap ( SmallIcon("minus"));
142 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); 142 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll()));
143 addBut->setMaximumWidth( addBut->sizeHint().height() ); 143 addBut->setMaximumWidth( addBut->sizeHint().height() );
144 144
145 145
146 146
147} 147}
148 148
149KOCalEditView::~KOCalEditView() 149KOCalEditView::~KOCalEditView()
150{ 150{
151 // no need to delete child widgets, Qt does it all for us 151 // no need to delete child widgets, Qt does it all for us
152} 152}
153void KOCalEditView::readConfig( KConfig *) 153void KOCalEditView::readConfig( KConfig *)
154{ 154{
155 155
156} 156}
157void KOCalEditView::addCal() 157void KOCalEditView::addCal()
158{ 158{
159 qDebug("addcal "); 159 qDebug("addcal ");
160} 160}
161void KOCalEditView::enableAll() 161void KOCalEditView::enableAll()
162{ 162{
163 qDebug("enableAll"); 163 qDebug("enableAll");
164} 164}
165void KOCalEditView::enableAlarm() 165void KOCalEditView::enableAlarm()
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index d434c52..060108f 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -3,48 +3,50 @@
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#ifndef KOFILTERVIEW_H 23#ifndef KOFILTERVIEW_H
24#define KOFILTERVIEW_H 24#define KOFILTERVIEW_H
25 25
26#include <qstring.h> 26#include <qstring.h>
27#include <qcheckbox.h>
28#include <qpushbutton.h>
27#include <kconfig.h> 29#include <kconfig.h>
28#include "kofilterview_base.h" 30#include "kofilterview_base.h"
29 31
30#include <libkcal/calfilter.h> 32#include <libkcal/calfilter.h>
31 33
32using namespace KCal; 34using namespace KCal;
33 35
34class KOFilterView : public KOFilterView_base 36class KOFilterView : public KOFilterView_base
35{ 37{
36 Q_OBJECT 38 Q_OBJECT
37 public: 39 public:
38 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); 40 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
39 ~KOFilterView(); 41 ~KOFilterView();
40 42
41 void updateFilters(); 43 void updateFilters();
42 44
43 bool filtersEnabled(); 45 bool filtersEnabled();
44 void setFiltersEnabled(bool); 46 void setFiltersEnabled(bool);
45 CalFilter *selectedFilter(); 47 CalFilter *selectedFilter();
46 void setSelectedFilter(QString); 48 void setSelectedFilter(QString);
47 void setSelectedFilter( int ); 49 void setSelectedFilter( int );
48 50
49 signals: 51 signals:
50 void filterChanged(); 52 void filterChanged();
@@ -57,27 +59,75 @@ class KOFilterView : public KOFilterView_base
57class KOCalEditView : public QWidget 59class KOCalEditView : public QWidget
58{ 60{
59 Q_OBJECT 61 Q_OBJECT
60 public: 62 public:
61 KOCalEditView( QWidget* parent=0,const char* name=0); 63 KOCalEditView( QWidget* parent=0,const char* name=0);
62 ~KOCalEditView(); 64 ~KOCalEditView();
63 65
64 void readConfig( KConfig *); 66 void readConfig( KConfig *);
65 public slots: 67 public slots:
66 void addCal(); 68 void addCal();
67 void enableAll(); 69 void enableAll();
68 void enableAlarm(); 70 void enableAlarm();
69 void disableRO(); 71 void disableRO();
70 void deleteAll(); 72 void deleteAll();
71 signals: 73 signals:
72 void alarmEnabled ( int cal, bool enable ); 74 void alarmEnabled ( int cal, bool enable );
73 void calendarEnabled ( int cal, bool enable ); 75 void calendarEnabled ( int cal, bool enable );
74 void calendarReadonly ( int cal, bool readonly ); 76 void calendarReadonly ( int cal, bool readonly );
75 void setCalendarDefault ( int cal ); 77 void setCalendarDefault ( int cal );
76 void removeCalendar ( int cal ); 78 void removeCalendar ( int cal );
77 79
78 private: 80 private:
79}; 81};
80 82
83class KOCalButton : public QPushButton
84{
85 Q_OBJECT
86 public:
87 KOCalButton( QWidget *parent=0, const char *name=0 ) :
88 QPushButton( parent, name)
89 {
90 connect( this, SIGNAL( clicked() ),
91 SLOT( bottonClicked() ));
92 mNumber = -1;
93 }
94 void setNum ( int num ) {mNumber = num; }
95 signals:
96 void selectNum ( int );
97private:
98 int mNumber;
99 void keyPressEvent ( QKeyEvent * e )
100 {
101 e->ignore();
102 }
103
104private slots :
105 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
106};
107class KOCalCheckButton : public QCheckBox
108{
109 Q_OBJECT
110 public:
111 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
112 QCheckBox( parent, name)
113 {
114 connect( this, SIGNAL( toggled ( bool ) ),
115 SLOT( bottonClicked( bool ) ));
116 mNumber = -1;
117 }
118 void setNum ( int num ) {mNumber = num; }
119 signals:
120 void selectNum ( int, bool );
121private:
122 int mNumber;
123 void keyPressEvent ( QKeyEvent * e )
124 {
125 e->ignore();
126 }
127
128private slots :
129 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
130};
81 131
82 132
83#endif // KOFILTERVIEW_H 133#endif // KOFILTERVIEW_H