-rw-r--r-- | korganizer/navigatorbar.cpp | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 24de01f..657f98d 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp @@ -69,14 +69,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam bool isRTL = KOGlobals::self()->reverseLayout(); #ifndef DESKTOP_VERSION bool isDesktop = false; #else bool isDesktop = true; #endif - bool insertWeek = (QString ( name ) == QString("useBigPixmaps")) ; - if ( insertWeek && QApplication::desktop()->width() > 320 ) + if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 ) isDesktop = true; // Create backward navigation buttons mPrevYear = new QPushButton( mCtrlFrame ); mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); QToolTip::add( mPrevYear, i18n("Previous Year") ); @@ -86,19 +85,12 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam // Create forward navigation buttons mNextMonth = new QPushButton( mCtrlFrame ); mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); QToolTip::add( mNextMonth, i18n("Next Month") ); - QPushButton * selWeek = 0; - if ( insertWeek ) { - selWeek = new QPushButton( mCtrlFrame ); - QToolTip::add( selWeek, i18n("Select Week") ); - selWeek->setFocusPolicy(NoFocus); - } - mNextYear = new QPushButton( mCtrlFrame ); mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); QToolTip::add( mNextYear, i18n("Next Year") ); mSelectMonth = new QPushButton( mCtrlFrame ); // Create month name label //selectMonth->setFont( tfont ); @@ -108,15 +100,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam //mDateLabel->setAlignment( AlignCenter ); if ( QString ( name ) == QString("useBigPixmaps") ) { mNextMonth->setFlat( true); mNextYear->setFlat( true); mSelectMonth->setFlat( true); mPrevYear->setFlat( true); - mPrevMonth->setFlat( true); - if ( insertWeek ) - selWeek->setFlat( true); + mPrevMonth->setFlat( true); } mSelectMonth->setFont( tfont ); // Set minimum width to width of widest month name label int i; int maxwidth = 0; QFontMetrics fm ( mSelectMonth->font() ); @@ -132,35 +122,12 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam int size = fm.height()+2; if ( QApplication::desktop()->width() >= 480 ) { size += 6; maxwidth+= 6; } - if ( insertWeek ) { - QPopupMenu * wpo = new QPopupMenu (this); - QPopupMenu * all = new QPopupMenu (this); - //wpo->insertItem( i18n("W#"), 0 ); - int first = 1; - for ( i = 1; i < 50; ++i ) { - if ( !(i%10) ) { - all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); - connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); - first = i; - wpo = new QPopupMenu (this); - } - wpo->insertItem( QString::number(i), i ); - } - for ( i = 50; i < 53; ++i ) { - wpo->insertItem( QString::number(i), i); - } - all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); - selWeek->setPopup( all ); - selWeek->setFixedWidth( (size/5)*4 ); - selWeek->setFixedHeight( size ); - connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); - } mSelectMonth->setFixedWidth( maxwidth ); mSelectMonth->setFixedHeight( size ); mPrevYear->setFixedHeight( size ); mPrevMonth->setFixedHeight( size ); mNextMonth->setFixedHeight( size ); mNextYear->setFixedHeight ( size ); @@ -173,14 +140,12 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam // ctrlLayout->addWidget( mDateLabel ); ctrlLayout->addWidget( mSelectMonth ); // ctrlLayout->addSpacing( 1 ); // ctrlLayout->addStretch( 1 ); ctrlLayout->addWidget( mNextMonth, 3 ); ctrlLayout->addWidget( mNextYear, 3 ); - if ( insertWeek ) - ctrlLayout->addWidget( selWeek ); connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |