Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 106 |
1 files changed, 41 insertions, 65 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index cf1eeca..b7e89b0 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp @@ -102,15 +102,13 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) - QPEToolBar *bar = new QPEToolBar( this ); - bar->setHorizontalStretchable( TRUE ); +// QPEToolBar *bar = new QPEToolBar( this ); +// bar->setHorizontalStretchable( TRUE ); - QPEMenuBar *mb = new QPEMenuBar( bar ); - mb->setMargin( 0 ); +// QPEMenuBar *mb = new QPEMenuBar( bar ); +// mb->setMargin( 0 ); - QPEToolBar *sub_bar = new QPEToolBar(this); - - QPopupMenu *view = new QPopupMenu( this ); - QPopupMenu *settings = new QPopupMenu( this ); +// QPopupMenu *view = new QPopupMenu( this ); +// mb->insertItem( tr( "View" ), view ); - mb->insertItem( tr( "View" ), view ); - mb->insertItem( tr( "Settings" ), settings ); + QPEToolBar *sub_bar = new QPEToolBar(this); + sub_bar->setHorizontalStretchable(TRUE); @@ -119,4 +117,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) - QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), - QString::null, 0, this, 0 ); + QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); @@ -124,2 +121,4 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) + sub_bar->addSeparator(); + a = new QAction( tr( "Today" ), Resource::loadPixmap( "datebook/to_day" ), QString::null, 0, g, 0 ); @@ -127,3 +126,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) a->addTo( sub_bar ); - a->addTo( view ); +// a->addTo( view ); + + sub_bar->addSeparator(); @@ -132,3 +133,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) a->addTo( sub_bar ); - a->addTo( view ); +// a->addTo( view ); a->setToggleAction( TRUE ); @@ -140,3 +141,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) a->addTo( sub_bar ); - a->addTo( view ); +// a->addTo( view ); a->setToggleAction( TRUE ); @@ -147,3 +148,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) a->addTo( sub_bar ); - a->addTo( view ); +// a->addTo( view ); a->setToggleAction( TRUE ); @@ -154,3 +155,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) a->addTo( sub_bar ); - a->addTo( view ); +// a->addTo( view ); a->setToggleAction( TRUE ); @@ -158,3 +159,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) - a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, g, 0 ); + sub_bar->addSeparator(); + + a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 ); connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); @@ -162,5 +165,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) - a = new QAction( tr( "Edit..." ), QString::null, 0, 0 ); + a = new QAction( tr( "Edit..." ), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); - a->addTo( settings ); + a->addTo( sub_bar ); @@ -375,9 +378,2 @@ void DateBook::view(int v, const QDate &d) { void DateBook::viewDefault(const QDate &d) { -/* - Config config("DateBook"); - config.setGroup("Main"); - int current=config.readNumEntry("defaultview", DAY); - - view(current,d); -*/ view(defaultView,d); @@ -528,16 +524,9 @@ void DateBook::initDay() dayView->setRowStyle( rowStyle ); - connect( this, SIGNAL( newEvent() ), - dayView, SLOT( redraw() ) ); - connect( dayView, SIGNAL( newEvent() ), - this, SLOT( fileNew() ) ); - connect( dayView, SIGNAL( removeEvent( const Event & ) ), - this, SLOT( removeEvent( const Event & ) ) ); - connect( dayView, SIGNAL( editEvent( const Event & ) ), - this, SLOT( editEvent( const Event & ) ) ); - connect( dayView, SIGNAL( duplicateEvent( const Event & ) ), - this, SLOT( duplicateEvent( const Event & ) ) ); - connect( dayView, SIGNAL( beamEvent( const Event & ) ), - this, SLOT( beamEvent( const Event & ) ) ); - connect( dayView, SIGNAL(sigNewEvent(const QString &)), - this, SLOT(slotNewEventFromKey(const QString &)) ); + connect( this, SIGNAL( newEvent() ), dayView, SLOT( redraw() ) ); + connect( dayView, SIGNAL( newEvent() ), this, SLOT( fileNew() ) ); + connect( dayView, SIGNAL( removeEvent( const Event & ) ), this, SLOT( removeEvent( const Event & ) ) ); + connect( dayView, SIGNAL( editEvent( const Event & ) ), this, SLOT( editEvent( const Event & ) ) ); + connect( dayView, SIGNAL( duplicateEvent( const Event & ) ), this, SLOT( duplicateEvent( const Event & ) ) ); + connect( dayView, SIGNAL( beamEvent( const Event & ) ), this, SLOT( beamEvent( const Event & ) ) ); + connect( dayView, SIGNAL(sigNewEvent(const QString &)), this, SLOT(slotNewEventFromKey(const QString &)) ); } @@ -551,6 +540,4 @@ void DateBook::initWeek() views->addWidget( weekView, WEEK ); - connect( weekView, SIGNAL( showDate( int, int, int ) ), - this, SLOT( showDay( int, int, int ) ) ); - connect( this, SIGNAL( newEvent() ), - weekView, SLOT( redraw() ) ); + connect( weekView, SIGNAL( showDate( int, int, int ) ), this, SLOT( showDay( int, int, int ) ) ); + connect( this, SIGNAL( newEvent() ), weekView, SLOT( redraw() ) ); } @@ -570,4 +557,2 @@ void DateBook::initWeek() } - if ( totWeeks != weekView->totalWeeks() ) - weekView->setTotalWeeks( totWeeks ); } @@ -576,4 +561,3 @@ void DateBook::initWeekLst() { if ( !weekLstView ) { - weekLstView = new DateBookWeekLst( ampm, onMonday, db, - views, "weeklst view" ); + weekLstView = new DateBookWeekLst( ampm, onMonday, db, views, "weeklst view" ); views->addWidget( weekLstView, WEEKLST ); @@ -581,14 +565,7 @@ void DateBook::initWeekLst() { //weekLstView->setStartViewTime( startTime ); - connect( weekLstView, SIGNAL( showDate( int, int, int ) ), - this, SLOT( showDay( int, int, int ) ) ); - connect( weekLstView, SIGNAL( addEvent( const QDateTime &, - const QDateTime &, - const QString & , const QString &) ), - this, SLOT( slotNewEntry( const QDateTime &, - const QDateTime &, - const QString & , const QString &) ) ); - connect( this, SIGNAL( newEvent() ), - weekLstView, SLOT( redraw() ) ); - connect( weekLstView, SIGNAL( editEvent( const Event & ) ), - this, SLOT( editEvent( const Event & ) ) ); + connect( weekLstView, SIGNAL( showDate( int, int, int ) ), this, SLOT( showDay( int, int, int ) ) ); + connect( weekLstView, SIGNAL( addEvent( const QDateTime &, const QDateTime &, const QString & , const QString &) ), + this, SLOT( slotNewEntry( const QDateTime &, const QDateTime &, const QString & , const QString &) ) ); + connect( this, SIGNAL( newEvent() ), weekLstView, SLOT( redraw() ) ); + connect( weekLstView, SIGNAL( editEvent( const Event & ) ), this, SLOT( editEvent( const Event & ) ) ); } @@ -602,6 +579,4 @@ void DateBook::initMonth() views->addWidget( monthView, MONTH ); - connect( monthView, SIGNAL( dateClicked( int, int, int ) ), - this, SLOT( showDay( int, int, int ) ) ); - connect( this, SIGNAL( newEvent() ), - monthView, SLOT( redraw() ) ); + connect( monthView, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( showDay( int, int, int ) ) ); + connect( this, SIGNAL( newEvent() ), monthView, SLOT( redraw() ) ); qApp->processEvents(); @@ -631,2 +606,3 @@ void DateBook::loadSettings() defaultCategories.truncate(0); + for( QStringList::Iterator i=tmpStringList.begin(); i!=tmpStringList.end(); i++) { |