summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-02-02 12:48:28 (UTC)
committer zautrix <zautrix>2005-02-02 12:48:28 (UTC)
commit66c1429e6d29331dac4182d2c42aaf1630916c7d (patch) (side-by-side diff)
tree27280cf745c2828cfa22ec52049cfd8e96d28f4f /korganizer
parente770226d68f5fdb8484003bbb9898848cec901a8 (diff)
downloadkdepimpi-66c1429e6d29331dac4182d2c42aaf1630916c7d.zip
kdepimpi-66c1429e6d29331dac4182d2c42aaf1630916c7d.tar.gz
kdepimpi-66c1429e6d29331dac4182d2c42aaf1630916c7d.tar.bz2
fifi
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp18
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/komonthview.cpp7
-rw-r--r--korganizer/koviewmanager.cpp2
4 files changed, 25 insertions, 3 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index d4ff77a..aed9bae 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -404,49 +404,65 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
mAllDayFrame = new QHBox(mSplitterAgenda);
mAllDayFrame->setFocusPolicy(NoFocus);
QWidget *agendaFrame = new QWidget(mSplitterAgenda);
agendaFrame->setFocusPolicy(NoFocus);
#endif
// Create all-day agenda widget
mDummyAllDayLeft = new QVBox( mAllDayFrame );
mExpandButton = new QPushButton(mDummyAllDayLeft);
mExpandButton->setPixmap( mNotExpandedPixmap );
int widebut = mExpandButton->sizeHint().width();
if ( QApplication::desktop()->width() < 480 )
widebut = widebut*2;
else
widebut = (widebut*3) / 2;
//mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
// QSizePolicy::Fixed ) );
mExpandButton->setFixedSize( widebut, widebut);
connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
mExpandButton->setFocusPolicy(NoFocus);
mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
mAllDayAgenda->setFocusPolicy(NoFocus);
- QWidget *dummyAllDayRight = new QWidget(mAllDayFrame);
+ QVBox *dummyAllDayRight = new QVBox(mAllDayFrame);
+
+ QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight);
+ QLabel * dummyAllDayRightL = new QLabel ( dummyAllDayRight );
+
+ dummyAllDayRightB->setFlat( true );
+ dummyAllDayRightB->setFocusPolicy(NoFocus);
+ // dummyAllDayRightB->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding ));
+ //dummyAllDayRightB->setFixedHeight( dummyAllDayRightB->sizeHint().height()/2 );
+ QPopupMenu * wpo = new QPopupMenu (this);
+ wpo->insertItem( i18n("W#"), 0 );
+ int i;
+ for ( i = 1; i < 54; i++ )
+ wpo->insertItem( QString::number( i ),i );
+ dummyAllDayRightB->setPopup( wpo );
+
+ connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
// Create event context menu for all day agenda
mAllDayAgendaPopup = eventPopup();
connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
// Create agenda frame
QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3);
// QHBox *agendaFrame = new QHBox(splitterAgenda);
// create event indicator bars
mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
agendaLayout->addWidget(mEventIndicatorTop,0,1);
mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
agendaFrame);
agendaLayout->addWidget(mEventIndicatorBottom,2,1);
QWidget *dummyAgendaRight = new QWidget(agendaFrame);
agendaLayout->addWidget(dummyAgendaRight,0,2);
// Create time labels
mTimeLabels = new TimeLabels(24,agendaFrame);
agendaLayout->addWidget(mTimeLabels,1,0);
connect(mTimeLabels,SIGNAL( scaleChanged()),
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index e9e85cc..4a058ce 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -189,48 +189,49 @@ class KOAgendaView : public KOEventView {
void newTodo(int gx,int gy);
void newEvent(int gx,int gy);
void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newEventAllDay(int gx, int gy);
void newTodoAllDay(int gx, int gy);
void startDrag(Event *);
void readSettings();
void readSettings(KConfig *);
void writeSettings(KConfig *);
void setContentsPos(int y);
void setExpandedButton( bool expanded );
void scrollOneHourUp();
void scrollOneHourDown();
void addToCalSlot(Incidence *, Incidence *);
signals:
void showDateView( int, QDate );
void newTodoSignal( QDateTime ,bool );
void toggleExpand();
+ void selectWeekNum( int );
void todoMoved( Todo *, int );
void incidenceChanged(Incidence * , int );
// void cloneIncidenceSignal(Incidence *);
protected:
KOAgendaButton* getNewDaylabel();
bool mBlockUpdating;
int mUpcomingWidth;
/** Fill agenda beginning with date startDate */
void fillAgenda(const QDate &startDate);
void resizeEvent( QResizeEvent* e );
/** Fill agenda using the current set value for the start date */
void fillAgenda();
/** Create labels for the selected dates. */
void createDayLabels();
/**
Set the masks on the agenda widgets indicating, which days are holidays.
*/
void setHolidayMasks();
protected slots:
void slotDaylabelClicked( int );
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f2cfb75..ab96786 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -888,64 +888,67 @@ DateList KOMonthView::selectedDates()
{
DateList selected;
if ( mSelectedCell ) {
QDate qd = mSelectedCell->selectedIncidenceDate();
if ( qd.isValid() ) selected.append( qd );
}
return selected;
}
void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Month, fd, td);
#endif
}
void KOMonthView::updateConfig()
{
mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
- if ( mShowWeekView )
+ if ( mShowWeekView ) {
mWeekStartsMonday = true;
+ }
QFontMetrics fontmetric(mDayLabels[0]->font());
mWidthLongDayLabel = 0;
for (int i = 0; i < 7; i++) {
int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
}
bool temp = mShowSatSunComp ;
mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
+ if ( ! mShowWeekView ) {
if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
computeLayout();
+ }
updateDayLabels();
//qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
- int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
+ //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
//resizeEvent( 0 );
for (uint i = 0; i < mCells.count(); ++i) {
mCells[i]->updateConfig();
}
#ifdef DESKTOP_VERSION
MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
#endif
updateView();
}
void KOMonthView::updateDayLabels()
{
for (int i = 0; i < 7; i++) {
if (mWeekStartsMonday) {
bool show = mShortDayLabels;
if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() )
show = true;
mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
} else {
if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
}
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index ca3de59..a74c5fe 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -386,48 +386,50 @@ void KOViewManager::showAgendaView( bool fullScreen )
connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
mMainView, SLOT(deleteIncidence(Incidence *)));
connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
connect(mAgendaView, SIGNAL( toggleExpand() ),
mMainView, SLOT( toggleExpand() ) );
connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ),
mAgendaView, SLOT( setExpandedButton( bool ) ) );
connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
SLOT( updateTodo( Todo *, int ) ) );
connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
mMainView, SIGNAL( todoModified( Todo *, int )));
connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( moveIncidence( Incidence * ) ) );
connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
+ connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
+ mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
mAgendaView->readSettings();
mAgendaView->updateConfig();
}
showView( mAgendaView, full);
}
void KOViewManager::showDayView()
{
mFlagShowNextxDays = false;
globalFlagBlockLabel = 1;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 1 )
mCurrentAgendaView = -1;
showAgendaView();
qApp->processEvents();
globalFlagBlockAgenda = 2;
globalFlagBlockLabel = 0;
mMainView->dateNavigator()->selectDates( 1 );
mCurrentAgendaView = 1 ;
}