summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-24 12:34:27 (UTC)
committer zautrix <zautrix>2005-03-24 12:34:27 (UTC)
commit685d04bc8f696697202f2fc0de18e61905cbb2fa (patch) (side-by-side diff)
tree927d070c135d0025b236f6bd76143e0341ef2566
parenta9e8535fd6960f454ab7009cfa996973291502a2 (diff)
downloadkdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.zip
kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.tar.gz
kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.tar.bz2
layout fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp74
-rw-r--r--korganizer/datenavigatorcontainer.h8
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/koagendaitem.cpp4
-rw-r--r--korganizer/koprefsdialog.cpp18
-rw-r--r--korganizer/mainwindow.cpp4
6 files changed, 65 insertions, 45 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index d1caff3..2290c53 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -65,79 +65,93 @@ void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
#if 0
connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) );
connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ),
SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) );
#endif
connect( v, SIGNAL( weekClicked( const QDate & ) ),
SIGNAL( weekClicked( const QDate & ) ) );
connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) );
connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) );
- connect( v, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
- connect( v, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
- connect( v, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
- connect( v, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) );
+ connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) );
+ connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) );
+ connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) );
+ connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) );
connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
}
+void DateNavigatorContainer::slotgoNextYear()
+{
+ jumpMonth( 12 );
+ emit goNextYear();
+
+}
+void DateNavigatorContainer::slotgoPrevYear()
+{
+ jumpMonth( -12 );
+ emit goPrevYear();
+
+}
+void DateNavigatorContainer::slotgoPrevMonth()
+{
+ jumpMonth( -1 );
+ emit goPrevMonth();
+
+}
+void DateNavigatorContainer::slotgoNextMonth()
+{
+ jumpMonth( 1 );
+ emit goNextMonth();
+}
+void DateNavigatorContainer::jumpMonth( int month )
+{
+ QDate baseDate = mNavigatorView->baseDate();
+ computeMonthSelected( baseDate.month() + month, false );
+}
void DateNavigatorContainer::slotMonthSelected( int month )
{
- //qDebug("slotMonthSelected %d ", month);
+ computeMonthSelected( month, true );
+}
+void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit )
+{
+ //qDebug("slotMonthSelected %d ", month);
QDate baseDate = mNavigatorView->baseDate();
if ( baseDate.month() == month )
return;
//qDebug("month %d %d ",baseDate.month(),month);
QDate date = QDate ( baseDate.year(), baseDate.month() , 15 );
date = date.addDays( -(baseDate.month()-month ) *30 );
QDate newBase = QDate ( date.year(), date.month() , baseDate.day() );
-#if 0
- mFirstSelectedDate = dateList.first() ;
- mSelectedDateCount = dateList.count() ;
-
- KDateNavigator *view = mExtraViews.at( 0 );
- QDate date = view->baseDate();
-
- QDate curEnd = date.addDays( (mLastDisplayedDN)*30 +7);
- //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() );
- if ( lDate < curEnd && date.addDays( -30 ) < fDate) {
- mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate );
- mNavigatorView->dayMatrix()->repaint( false );
- for( uint i = 0; i < mLastDisplayedDN; ++i ) {
- KDateNavigator *n = mExtraViews.at( i );
- if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) {
- n->dayMatrix()->repaint( false );
- }
- }
- return;
- }
-#endif
//qDebug("NEW BASE %s", newBase.toString().latin1());
mNavigatorView->setBaseDate( newBase );
QDate last = lastAvailableDate();
QDate first = firstAvailableDate();
QDate selFirst = mFirstSelectedDate;
QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
- if ( selFirst >= first && selLast <= last ) {
+ if ( selFirst >= first && selLast <= last ) {
setBaseDates();
- updateDayMatrixDates();
+ if ( forceEmit )
+ updateDayMatrixDates();
}
else {
setBaseDates();
- updateDayMatrixDates();
- emit monthSelected( month );
+ if ( forceEmit )
+ updateDayMatrixDates();
+ if ( forceEmit )
+ emit monthSelected( month );
}
}
void DateNavigatorContainer::setCalendar( Calendar *cal )
{
mCalendar = cal;
mNavigatorView->setCalendar( cal );
for( uint i = 0; i < mLastDisplayedDN; ++i ) {
KDateNavigator *n = mExtraViews.at( i );
n->setCalendar( cal );
}
}
void DateNavigatorContainer::checkUpdateDayMatrixDates()
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index 9a64720..d2f397d 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -49,43 +49,49 @@ class DateNavigatorContainer: public QWidget
KDateNavigator * navigatorView() { return mNavigatorView;}
QDate lastAvailableDate() const ;
QDate firstAvailableDate() const ;
public slots:
void selectDates( const KCal::DateList & );
void updateView();
void updateConfig();
void updateDayMatrix();
void updateDayMatrixDates();
void checkUpdateDayMatrixDates();
void updateToday();
- void slotMonthSelected( int month );
+ void slotMonthSelected( int month );
+ void slotgoNextMonth();
+ void slotgoPrevMonth();
+ void slotgoNextYear();
+ void slotgoPrevYear();
signals:
void datesSelected( const KCal::DateList & );
void incidenceDropped( Incidence *, const QDate & );
void incidenceDroppedMove( Incidence *, const QDate & );
void weekClicked( const QDate &);
void goPrevious();
void goNext();
void goNextMonth();
void goPrevMonth();
void goNextYear();
void goPrevYear();
void monthSelected( int month );
protected:
+ void computeMonthSelected( int month , bool forceEmit );
+ void jumpMonth( int month );
void resizeEvent( QResizeEvent * );
void setBaseDates();
void connectNavigatorView( KDateNavigator *v );
private:
QTimer* mUpdateTimer;
int mLastDisplayedDN;
QDate mFirstSelectedDate;
int mSelectedDateCount;
KDateNavigator *mNavigatorView;
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index d62402f..6438c9a 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -110,25 +110,25 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
SIGNAL( eventDropped( Event * ) ) );
topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
// read settings from configuration file.
updateConfig();
enableRollover(FollowMonth);
mySizeHint = sizeHintTwoButtons();
myFullSizeHint = sizeHintTwoButtons( 4 );
mFontChanged = false;
- resize ( mySizeHint );
+ resize ( 0,0 );
}
void KDateNavigator::changeFont ( QFont fo )
{
setFont( fo );
mNavigatorBar->resetFont( fo );
}
QFont KDateNavigator::yourFontHint( QSize si , bool *b)
{
QFont fo = KOPrefs::instance()->mDateNavigatorFont;
*b = false;
int fontPoint = fo.pointSize();
while ( fontPoint > 5 ) {
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 82d1eab..b30ad75 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -496,32 +496,32 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
if ( mAllDay )
paintFrom = paintPixAllday();
else
paintFrom = paintPix();
}
xx += rx;
if ( xx < 0 ) {
rw = rw + xx;
rx -= xx;
xx = 0;
if ( rw <= 1 ) {
- qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
+ //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
return;
}
}
if ( paintFrom->width() < xx+rw ) {
rw = paintFrom->width() - xx;
if ( rw <= 1 ) {
- qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
+ //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
return;
}
}
//qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
}
void KOAgendaItem::computeText()
{
mDisplayedText = mIncidence->summary();
if ( (mIncidence->type() == "Todo") ) {
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 40e8a99..74037e6 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -581,33 +581,25 @@ void KOPrefsDialog::setupViewsTab()
// nextDaysLayout->addStretch(1);
// nextDaysLayout->addWidget(mNextXDaysSpin);
int ii = 0;
KPrefsDialogWidBool *dummy =
addWidBool(i18n("Edit item on doubleclick (if not, show)"),
&(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
- if ( QApplication::desktop()->width() > 640 ) {
-
- KPrefsDialogWidBool *enableToolTips =
- addWidBool(i18n("Enable tooltips displaying summary of ev."),
- &(KOPrefs::instance()->mEnableToolTips),topFrame);
- topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
-
- }
-
+
// topLayout->addWidget(hourSizeGroup,ii++,0);
// topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
//topLayout->setRowStretch(11,1);
#if 0
topFrame = addPage(i18n("ViewChange"),0,0);
@@ -652,24 +644,32 @@ void KOPrefsDialog::setupViewsTab()
topLayout->addWidget( dummy->checkBox(), ii++,0);
KPrefsDialogWidBool *dailyRecur =
addWidBool(i18n("Show events that recur daily in date nav."),
&(KOPrefs::instance()->mDailyRecur),topFrame);
topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
KPrefsDialogWidBool *weeklyRecur =
addWidBool(i18n("Show ev. that recur weekly in date nav."),
&(KOPrefs::instance()->mWeeklyRecur),topFrame);
topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
+
+ KPrefsDialogWidBool *enableToolTips =
+ addWidBool(i18n("Enable tooltips displaying summary of ev."),
+ &(KOPrefs::instance()->mEnableToolTips),topFrame);
+ topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
+
+ // *********************************************************
+
topFrame = addPage(i18n("Agenda View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,5,1);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
ii = 0;
dummy =
addWidBool(i18n("Show time in agenda items"),
&(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index bd9efc8..7faf675 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -991,24 +991,26 @@ void MainWindow::initActions()
// menubar icons
iconToolBar->setHorizontalStretchable (true );
//menuBar->insertItem( iconToolBar );
//xdays_action
if (p-> mShowIconNewEvent)
ne_action->addTo( iconToolBar );
if (p->mShowIconNewTodo )
nt_action->addTo( iconToolBar );
if (p-> mShowIconSearch)
search_action->addTo( iconToolBar );
+ if (p-> mShowIconWhatsThis)
+ QWhatsThis::whatsThisButton ( iconToolBar );
if (p-> mShowIconNext)
whatsnext_action->addTo( iconToolBar );
if (p-> mShowIconNextDays)
xdays_action->addTo( iconToolBar );
if (p-> mShowIconList)
showlist_action->addTo( iconToolBar );
if (p-> mShowIconDay1)
day1_action->addTo( iconToolBar );
if (p-> mShowIconDay5)
day5_action->addTo( iconToolBar );
if (p-> mShowIconDay7)
day7_action->addTo( iconToolBar );
@@ -1097,26 +1099,24 @@ void MainWindow::initActions()
if (p-> mShowIconJournal)
configureToolBarMenu->setItemChecked( 90, true );
if (p-> mShowIconWhatsThis)
configureToolBarMenu->setItemChecked( 300, true );
if (p-> mShowIconWeekNum)
configureToolBarMenu->setItemChecked( 400, true );
QLabel* dummy = new QLabel( iconToolBar );
dummy->setBackgroundColor( iconToolBar->backgroundColor() );
if (!p-> mShowIconStretch)
iconToolBar->setStretchableWidget ( dummy ) ;
else
configureToolBarMenu->setItemChecked( 5, true );
- if (p-> mShowIconWhatsThis)
- QWhatsThis::whatsThisButton ( iconToolBar );
connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
configureAgenda( p->mHourSize );
connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
}
void MainWindow::exportToPhone( int mode )
{
//ex2phone->insertItem(i18n("Complete calendar..."), 1 );
//ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
KOex2phonePrefs ex2phone;