summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-06 01:23:43 (UTC)
committer zautrix <zautrix>2005-02-06 01:23:43 (UTC)
commit118f5aab05c9ace5612d5c4fd69e7c5a59bed67b (patch) (side-by-side diff)
treee097f3fecb6e2ae692b91ac29e58e6d5a51154c8
parent659f07aa44f44aebb74c83e7319021cfeb87f275 (diff)
downloadkdepimpi-118f5aab05c9ace5612d5c4fd69e7c5a59bed67b.zip
kdepimpi-118f5aab05c9ace5612d5c4fd69e7c5a59bed67b.tar.gz
kdepimpi-118f5aab05c9ace5612d5c4fd69e7c5a59bed67b.tar.bz2
better week choose
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt5
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/koagendaview.cpp72
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/mainwindow.cpp62
-rw-r--r--korganizer/mainwindow.h7
-rw-r--r--korganizer/navigatorbar.cpp37
7 files changed, 77 insertions, 111 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 41c60ea..4251283 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,14 +1,19 @@
Info about the changes in new versions of KDE-Pim/Pi
+********** VERSION 2.0.4 ************
+
+KO/Pi:
+Fixed problem loading translations for summary/location edit boxes in event/todo editor.
+
********** VERSION 2.0.3 ************
KO/Pi:
Added feature for changing alarm settings for many items at once:
Open list view (or search dialog), select the desired items and choose in
the popup menu: Set alarm for selected...
Added to the event/todo viewer the option to send an email to
all attendees or all selected (with RSVP) attendees.
Made the week-month mode changing in month view faster.
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 5c18aaa..e9ba8db 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1196,26 +1196,26 @@
{ "compl.todos","erled.Todos" },
{ "Day view","Tagesansicht" },
{ "Next days","Nächste Tage" },
{ "Next week","Nächste Woche" },
{ "Next two weeks","Nächste zwei Wochen" },
{ "Next month","Nächster Monat" },
{ "Journal view","Journal" },
{ "Display all opened","Zeige alle geöffnet" },
{ "Display all closed","Zeige alle geschlossen" },
{ "Display all flat","Zeige alle flach" },
{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
{ "Default todo done color:","Standard Todo erledigt Farbe" },
-{ "Select week %1-%2","Selektiere Woche %1-%2" },
-{ "Select Week","Selektiere Woche" },
+{ "Select week %1-%2","Wähle Woche %1-%2" },
+{ "Select Week","Wähle Woche" },
{ "Set alarm for selected...","Setze Alarm für Selekt..." },
{ "Set Alarm!","Setze Alarm!" },
{ "Canged alarm for %1 items","Alarm für %1 Items geändert" },
{ " and "," und " },
{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
{ "Mail to selected","Mail an Ausgewählte" },
{ "Mail to all","Mail an Alle" },
{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
{ " on"," am" },
{ " completed on "," erledigt am " },
{ "Save as Event template","Speichere als Vorlage" },
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 36c66ea..0d36946 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -416,54 +416,25 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
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);
- QVBox *dummyAllDayRight = new QVBox(mAllDayFrame);
-
- mDummyAllDayRightL = new QLabel ( dummyAllDayRight );
- QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight);
- new QLabel ( dummyAllDayRight );
- mDummyAllDayRightL->setSizePolicy( QSizePolicy( QSizePolicy::Minimum,QSizePolicy::Fixed ) );
- dummyAllDayRightB->setFlat( true );
- dummyAllDayRightB->setFocusPolicy(NoFocus);
- dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 );
-
- QPopupMenu * wpo = new QPopupMenu (this);
- QPopupMenu * all = new QPopupMenu (this);
- //wpo->insertItem( i18n("W#"), 0 );
- int first = 1;
- int i;
- 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( selectWeekNum ( 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 );
- dummyAllDayRightB->setPopup( all );
- connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
+ QLabel *dummyAllDayRight = new QLabel (mAllDayFrame);
// 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);
@@ -578,38 +549,25 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
SIGNAL( incidenceSelected( Incidence * ) ) );
connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
SIGNAL( incidenceSelected( Incidence * ) ) );
connect( mAgenda, SIGNAL( resizedSignal() ),
SLOT( updateConfig( ) ) );
connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ),
SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
SLOT( addToCalSlot(Incidence * , Incidence *) ) );
// connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
//connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
- QFont dlf = KOPrefs::instance()->mTimeLabelsFont;
- QFontMetrics fm ( dlf );
- QString dayTest = "30";
- int wid = fm.width( dayTest );
- int maxWid = dummyAllDayRight->width()-2;
- int fontPoint = dlf.pointSize();
- while ( wid > maxWid ) {
- --fontPoint;
- dlf.setPointSize( fontPoint );
- QFontMetrics f( dlf );
- wid = f.width( dayTest );
- }
- mDummyAllDayRightL->setFont( dlf );
- mDummyAllDayRightL->setAlignment( AlignHCenter );
+
}
void KOAgendaView::toggleAllDay()
{
if ( mSplitterAgenda->firstHandle() )
mSplitterAgenda->firstHandle()->toggle();
}
void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
{
calendar()->addIncidence( inc );
if ( incOld ) {
@@ -1099,50 +1057,24 @@ void KOAgendaView::fillAgenda()
return;
if ( globalFlagBlockAgenda == 1 )
return;
//if ( globalFlagBlockAgenda == 2 )
//globalFlagBlockAgenda = 0;
// globalFlagBlockPainting = false;
if ( globalFlagBlockAgenda == 0 )
globalFlagBlockAgenda = 1;
// clearView();
//qDebug("fillAgenda()++++ ");
globalFlagBlockAgendaItemPaint = 1;
- int weekNum = 0;
- QDate seda = mSelectedDates.first();
- QDate d = QDate ( seda.year(), 1,1);
- seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday
- if ( seda.addDays(6).year() != seda.year() ) {
- if ( seda.year() != d.year() ) {
- if ( d.dayOfWeek() > 4 )
- d = QDate ( seda.year(), 1,1);
- else
- weekNum = 1;
- } else {
- QDate dd( seda.year()+1, 1,1);
- if ( dd.dayOfWeek() <= 4 )
- weekNum = 1;
- }
- }
- if ( weekNum == 0 ){
- int dow = d.dayOfWeek();
- if ( dow <= 4 )
- d = d.addDays( 1-dow );
- else // 5,6,7
- d = d.addDays( 8-dow );
- // we have the first week of the year.we are on monday
- weekNum = d.daysTo( seda ) / 7 +1;
- }
- mDummyAllDayRightL->setText( QString::number( weekNum) );
mAllDayAgenda->changeColumns(mSelectedDates.count());
mAgenda->changeColumns(mSelectedDates.count());
qApp->processEvents();
mEventIndicatorTop->changeColumns(mSelectedDates.count());
mEventIndicatorBottom->changeColumns(mSelectedDates.count());
setHolidayMasks();
//mAgenda->hideUnused();
//mAllDayAgenda->hideUnused();
// mAgenda->blockNextRepaint( false );
// mAgenda->viewport()->repaint();
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index ba9bc93..4a058ce 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -207,25 +207,24 @@ class KOAgendaView : public KOEventView {
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:
- QLabel * mDummyAllDayRightL;
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();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9e32c18..1c74307 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -275,25 +275,27 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
"You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
qApp->processEvents();
mView->dialogManager()->showSyncOptions();
}
//US listen for result adressed from Ka/Pi
#ifndef DESKTOP_VERSION
connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
#endif
#ifndef DESKTOP_VERSION
infrared = 0;
#endif
-
+ updateWeek( mView->startDate() );
+ connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
+ SLOT( updateWeekNum( const KCal::DateList & ) ) );
mBRdisabled = false;
//toggleBeamReceive();
}
MainWindow::~MainWindow()
{
//qDebug("MainWindow::~MainWindow() ");
//save toolbar location
delete mCalendar;
delete mSyncManager;
#ifndef DESKTOP_VERSION
if ( infrared )
delete infrared;
@@ -545,24 +547,48 @@ void MainWindow::initActions()
menuBar->insertItem( i18n("Actions"), actionMenu );
menuBar->insertItem( i18n("Synchronize"), syncMenu );
menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
menuBar->insertItem( i18n("Filter"),selectFilterMenu );
menuBar->insertItem( i18n("Help"), helpMenu );
//menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
menuBar1->setMaximumSize( menuBar1->sizeHint( ));
}
connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
+ menuBarWeek = new QPEMenuBar( iconToolBar );
+ QPopupMenu * wpo = new QPopupMenu (this);
+ QPopupMenu * all = new QPopupMenu (this);
+ //wpo->insertItem( i18n("W#"), 0 );
+ int first = 1;
+ int i;
+ 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 );
+ connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) );
+ menuBarWeek->insertItem( "00",all,1);
+ menuBarWeek->setMaximumSize( menuBarWeek->sizeHint( ));
+
+ connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
// ******************
QAction *action;
QIconSet icon;
// QPopupMenu *configureMenu= new QPopupMenu( menuBar );
configureToolBarMenu->setCheckable( true );
QString pathString = "";
if ( !p->mToolBarMiniIcons ) {
if ( QApplication::desktop()->width() < 480 )
pathString += "icons16/";
} else
pathString += "iconsmini/";
@@ -1307,27 +1333,61 @@ void MainWindow::aboutKnownBugs()
QString MainWindow::defaultFileName()
{
return locateLocal( "data", "korganizer/mycalendar.ics" );
}
QString MainWindow::syncFileName()
{
#ifdef DESKTOP_VERSION
return locateLocal( "tmp", "synccalendar.ics" );
#else
return QString( "/tmp/synccalendar.ics" );
#endif
}
+void MainWindow::updateWeek(QDate seda)
+{
+ int weekNum = 0;
+ QDate d = QDate ( seda.year(), 1,1);
+ seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday
+ if ( seda.addDays(6).year() != seda.year() ) {
+ if ( seda.year() != d.year() ) {
+ if ( d.dayOfWeek() > 4 )
+ d = QDate ( seda.year(), 1,1);
+ else
+ weekNum = 1;
+ } else {
+ QDate dd( seda.year()+1, 1,1);
+ if ( dd.dayOfWeek() <= 4 )
+ weekNum = 1;
+ }
+ }
+ if ( weekNum == 0 ){
+ int dow = d.dayOfWeek();
+ if ( dow <= 4 )
+ d = d.addDays( 1-dow );
+ else // 5,6,7
+ d = d.addDays( 8-dow );
+ // we have the first week of the year.we are on monday
+ weekNum = d.daysTo( seda ) / 7 +1;
+ }
+ //qDebug("weeknum %s ", QString::number( weekNum).latin1());
+ menuBarWeek-> changeItem(1, QString::number( weekNum) );
+}
+void MainWindow::updateWeekNum(const DateList &selectedDates)
+{
+ updateWeek( selectedDates.first() );
+}
void MainWindow::processIncidenceSelection( Incidence *incidence )
{
+
if ( !incidence ) {
enableIncidenceActions( false );
mNewSubTodoAction->setEnabled( false );
setCaptionToDates();
return;
}
//KGlobal::locale()->formatDateTime(nextA, true);
QString startString = "";
if ( incidence->type() != "Todo" ) {
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 8dd55ac..076ab94 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -14,43 +14,46 @@
#ifndef DESKTOP_VERSION
#include <qcopchannel_qws.h>
#endif
class QAction;
class CalendarView;
class KSyncProfile;
#ifdef DESKTOP_VERSION
#define QPEToolBar QToolBar
#define QPEMenuBar QMenuBar
#endif
class QPEToolBar;
+class QPEMenuBar;
namespace KCal {
class CalendarLocal;
}
using namespace KCal;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
~MainWindow();
bool beamReceiveEnabled();
static QString defaultFileName();
static QString syncFileName();
static QString resourcePath();
public slots:
+ void updateWeekNum(const KCal::DateList &);
+ void updateWeek(QDate);
virtual void showMaximized ();
void configureAgenda( int );
void recieve( const QCString& msg, const QByteArray& data );
protected slots:
void setCaptionToDates();
void about();
void licence();
void faq();
void usertrans();
void features();
void synchowto();
void kdesynchowto();
@@ -75,25 +78,26 @@ class MainWindow : public QMainWindow
void saveStopTimer();
void configureToolBar( int );
void printSel();
void printCal();
void saveCalendar();
void loadCalendar();
void exportVCalendar();
void fillFilterMenu();
void selectFilter( int );
void exportToPhone( int );
void toggleBeamReceive();
void disableBR(bool);
-
+ signals:
+ void selectWeek ( int );
private slots:
void showConfigureAgenda();
void getFile( bool );
void syncFileRequest();
protected:
void displayText( QString, QString);
void enableIncidenceActions( bool );
private:
bool mBRdisabled;
#ifndef DESKTOP_VERSION
@@ -107,24 +111,25 @@ class MainWindow : public QMainWindow
bool mBlockAtStartup;
QPEToolBar *iconToolBar;
void initActions();
void setDefaultPreferences();
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
QPopupMenu *configureToolBarMenu;
QPopupMenu *selectFilterMenu;
QPopupMenu *configureAgendaMenu, *syncMenu;
CalendarLocal *mCalendar;
CalendarView *mView;
QAction *mNewSubTodoAction;
+ QPEMenuBar *menuBarWeek;
QAction *mShowAction;
QAction *mEditAction;
QAction *mDeleteAction;
QAction *mCloneAction;
QAction *mMoveAction;
QAction *mBeamAction;
QAction *mCancelAction;
QAction *mToggleNav;
QAction *mToggleFilter;
QAction *mToggleAllday;
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 24de01f..657f98d 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -63,130 +63,95 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
QFont tfont = font();
if ( QApplication::desktop()->width() >= 480 )
tfont.setPointSize(tfont.pointSize()+2);
tfont.setBold(true);
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") );
mPrevMonth = new QPushButton( mCtrlFrame );
mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
QToolTip::add( mPrevMonth, i18n("Previous Month") );
// 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 );
// selectMonth->setAlignment( AlignCenter );
//mDateLabel = new QLabel( selectMonth );
//mDateLabel->setFont( tfont );
//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);
}
mSelectMonth->setFont( tfont );
// Set minimum width to width of widest month name label
int i;
int maxwidth = 0;
QFontMetrics fm ( mSelectMonth->font() );
int width = fm.width("September '00" );
// for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date);
// ++i ) {
// //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i,
// // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" );
// int width = fm.width("September 2000" );
// if ( width > maxwidth ) maxwidth = width;
// }
maxwidth = width+2;
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 );
// set up control frame layout
QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 );
ctrlLayout->addWidget( mPrevYear, 3 );
ctrlLayout->addWidget( mPrevMonth, 3 );
//ctrlLayout->addStretch( 1 );
// ctrlLayout->addSpacing( 1 );
// 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() ) );
mPrevYear->setFocusPolicy(NoFocus);
mPrevMonth->setFocusPolicy(NoFocus);
mNextMonth->setFocusPolicy(NoFocus);
mNextYear->setFocusPolicy(NoFocus);
mSelectMonth->setFocusPolicy(NoFocus);