summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (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()
mDateNavigator = new DateNavigatorContainer( mLeftFrame,
"CalendarView::DateNavigator" );
#if 0
// FIXME
mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
"CalendarView::DateNavigator", QDate::currentDate());
#endif
// mDateNavigator->blockSignals( true );
//leftFrameLayout->addWidget( mDateNavigator );
mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
mTodoList->setNavigator( mNavigator );
#if 0
if ( QApplication::desktop()->width() < 480 ) {
leftFrameLayout->addWidget(mFilterView);
leftFrameLayout->addWidget(mTodoList, 2 );
} else {
leftFrameLayout->addWidget(mTodoList,2 );
leftFrameLayout->addWidget(mFilterView );
}
#endif
mFilterView->hide();
+ mCalEditView->hide();
QWidget *rightBox = new QWidget( mMainFrame );
//mainBoxLayout->addWidget ( rightBox, 10 );
QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
mRightFrame = new QWidgetStack( rightBox );
rightLayout->addWidget( mRightFrame, 10 );
//mLeftFrame = (QWidget *)leftFrame;
if ( KOPrefs::instance()->mVerticalScreen ) {
//mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
//mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
//mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
//leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
} else {
//mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
//mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
//leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
}
if ( !KOPrefs::instance()->mShowDateNavigator)
mDateNavigator->hide();
//qDebug("Calendarview Size %d %d ", width(), height());
#endif
connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
SLOT( showDates( const KCal::DateList & ) ) );
@@ -3888,51 +3889,52 @@ void CalendarView::editFilters()
CalFilter *filter = mFilters.first();
while(filter) {
kdDebug() << " Filter: " << filter->name() << endl;
filter = mFilters.next();
}
mDialogManager->showFilterEditDialog(&mFilters);
}
void CalendarView::toggleFilter()
{
showFilter(! mFilterView->isVisible());
}
KOFilterView *CalendarView::filterView()
{
return mFilterView;
}
void CalendarView::selectFilter( int fil )
{
mFilterView->setSelectedFilter( fil );
}
void CalendarView::showFilter(bool visible)
{
+#if 0
if (visible) mCalEditView->show();
else mCalEditView->hide();
-#if 0
+#else
if (visible) mFilterView->show();
else mFilterView->hide();
#endif
}
void CalendarView::toggleFilerEnabled( )
{
mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
if ( !mFilterView->filtersEnabled() )
topLevelWidget()->setCaption( i18n("Filter disabled ") );
}
void CalendarView::updateFilter()
{
CalFilter *filter = mFilterView->selectedFilter();
if (filter) {
QString mess;
if (mFilterView->filtersEnabled()) {
mess = i18n("Filter selected: ")+filter->name();
filter->setEnabled(true);
}
else filter->setEnabled(false);
mCalendar->setFilter(filter);
updateView();
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,
addBut = new QPushButton ( this );
mainLayout->addWidget( addBut,0,1 );
addBut->setPixmap ( SmallIcon("eye"));
connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
addBut->setMaximumWidth( addBut->sizeHint().height() );
QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", this );
mainLayout->addWidget( lab,0,2 );
addBut = new QPushButton ( this );
mainLayout->addWidget( addBut,0,3 );
addBut->setPixmap ( SmallIcon("bell"));
connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
addBut->setMaximumWidth( addBut->sizeHint().height() );
addBut = new QPushButton ( this );
mainLayout->addWidget( addBut,0,4 );
addBut->setPixmap ( SmallIcon("pencil"));
connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
addBut->setMaximumWidth( addBut->sizeHint().height() );
addBut = new QPushButton ( this );
mainLayout->addWidget( addBut,0,5 );
- addBut->setPixmap ( SmallIcon("trash"));
+ addBut->setPixmap ( SmallIcon("minus"));
connect(addBut,SIGNAL(clicked()),SLOT(deleteAll()));
addBut->setMaximumWidth( addBut->sizeHint().height() );
}
KOCalEditView::~KOCalEditView()
{
// no need to delete child widgets, Qt does it all for us
}
void KOCalEditView::readConfig( KConfig *)
{
}
void KOCalEditView::addCal()
{
qDebug("addcal ");
}
void KOCalEditView::enableAll()
{
qDebug("enableAll");
}
void 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 @@
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOFILTERVIEW_H
#define KOFILTERVIEW_H
#include <qstring.h>
+#include <qcheckbox.h>
+#include <qpushbutton.h>
#include <kconfig.h>
#include "kofilterview_base.h"
#include <libkcal/calfilter.h>
using namespace KCal;
class KOFilterView : public KOFilterView_base
{
Q_OBJECT
public:
KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
~KOFilterView();
void updateFilters();
bool filtersEnabled();
void setFiltersEnabled(bool);
CalFilter *selectedFilter();
void setSelectedFilter(QString);
void setSelectedFilter( int );
signals:
void filterChanged();
@@ -57,27 +59,75 @@ class KOFilterView : public KOFilterView_base
class KOCalEditView : public QWidget
{
Q_OBJECT
public:
KOCalEditView( QWidget* parent=0,const char* name=0);
~KOCalEditView();
void readConfig( KConfig *);
public slots:
void addCal();
void enableAll();
void enableAlarm();
void disableRO();
void deleteAll();
signals:
void alarmEnabled ( int cal, bool enable );
void calendarEnabled ( int cal, bool enable );
void calendarReadonly ( int cal, bool readonly );
void setCalendarDefault ( int cal );
void removeCalendar ( int cal );
private:
};
+class KOCalButton : public QPushButton
+{
+ Q_OBJECT
+ public:
+ KOCalButton( QWidget *parent=0, const char *name=0 ) :
+ QPushButton( parent, name)
+ {
+ connect( this, SIGNAL( clicked() ),
+ SLOT( bottonClicked() ));
+ mNumber = -1;
+ }
+ void setNum ( int num ) {mNumber = num; }
+ signals:
+ void selectNum ( int );
+private:
+ int mNumber;
+ void keyPressEvent ( QKeyEvent * e )
+ {
+ e->ignore();
+ }
+
+private slots :
+ void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
+};
+class KOCalCheckButton : public QCheckBox
+{
+ Q_OBJECT
+ public:
+ KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
+ QCheckBox( parent, name)
+ {
+ connect( this, SIGNAL( toggled ( bool ) ),
+ SLOT( bottonClicked( bool ) ));
+ mNumber = -1;
+ }
+ void setNum ( int num ) {mNumber = num; }
+ signals:
+ void selectNum ( int, bool );
+private:
+ int mNumber;
+ void keyPressEvent ( QKeyEvent * e )
+ {
+ e->ignore();
+ }
+
+private slots :
+ void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
+};
#endif // KOFILTERVIEW_H