-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 2 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 65 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
5 files changed, 74 insertions, 1 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index ec7f730..e8ec033 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -614,68 +614,70 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) mTimerTime = 1; } void SimpleAlarmDaemonImpl::writeFile() { QCopEnvelope e("QPE/Application/kopi", "-writeFile"); } void SimpleAlarmDaemonImpl::showWN() { QCopEnvelope e("QPE/Application/kopi", "-showWN"); } void SimpleAlarmDaemonImpl::newTodo() { QCopEnvelope e("QPE/Application/kopi", "-newTodo"); } void SimpleAlarmDaemonImpl::newEvent() { QCopEnvelope e("QPE/Application/kopi", "-newEvent"); } void SimpleAlarmDaemonImpl::newMail() { QCopEnvelope e("QPE/Application/ompi", "newMail()"); } void SimpleAlarmDaemonImpl::showAdd() { QCopEnvelope e("QPE/Application/kapi", "raise()"); } void SimpleAlarmDaemonImpl::ringSync() { QCopEnvelope e("QPE/Application/kopi", "-ringSync"); } void SimpleAlarmDaemonImpl::newCountdown() { //recieve("cal_alarm", 10 ); } void SimpleAlarmDaemonImpl::simulate() { writeFile(); QString filename = getenv("QPEDIR") ; filename += "/pics/kdepim/korganizer/koalarm.wav"; startAlarm("Alarm simulation", filename ); } void SimpleAlarmDaemonImpl::showKO() { QCopEnvelope e("QPE/Application/kopi", "-showKO"); + // testing only + //QCopEnvelope e("QPE/Application/kopi", "nextView()"); } void SimpleAlarmDaemonImpl::showTodo() { QCopEnvelope e("QPE/Application/kopi", "-showTodo"); } void SimpleAlarmDaemonImpl::writeJournal() { QCopEnvelope e("QPE/Application/kopi", "-showJournal"); } void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) { mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() ))); } diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index a32333c..fa6b951 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -717,96 +717,98 @@ void KOAgendaView::createDayLabels() dayLabel = getNewDaylabel(); } dayLabel->setMinimumWidth( 1 ); dayLabel->setMaximumWidth( 10240 ); dayLabel->setFont( dlf ); dayLabel->show(); dayLabel->setNum( counter ); QString str; int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); switch ( maxLen ) { case 2: str = QString::number( date.day() ); break; case 3: str = dayName.left( 1 ) +QString::number( date.day()); break; case 4: str = dayName.left( 1 ) + " " +QString::number( date.day()); break; case 5: str = dayName.left( 2 ) + " " +QString::number( date.day()); break; case 6: str = dayName.left( 3 ) + " " +QString::number( date.day()); break; default: break; } if ( oneday ) { QString addString; if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) addString = i18n("Today"); else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) addString = i18n("Tomorrow"); else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) addString = i18n("Yesterday"); else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) addString = i18n("Day before yesterday"); else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) addString = i18n("Day after tomorrow"); if ( !addString.isEmpty() ) { str = addString+", " + str; + } else { + str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); } } dayLabel->setText(str); //dayLabel->setAlignment(QLabel::AlignHCenter); if (date == QDate::currentDate()) { QFont bFont = dlf; bFont.setBold( true ); dayLabel->setFont(bFont); } //dayLayout->addWidget(dayLabel); #ifndef KORG_NOPLUGINS CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); CalendarDecoration *it; for(it = cds.first(); it; it = cds.next()) { QString text = it->shortText( date ); if ( !text.isEmpty() ) { QLabel *label = new QLabel(text,mDayLabels); label->setAlignment(AlignCenter); dayLayout->addWidget(label); } } for(it = cds.first(); it; it = cds.next()) { QWidget *wid = it->smallWidget(mDayLabels,date); if ( wid ) { // wid->setHeight(20); dayLayout->addWidget(wid); } } #endif } if ( ! appendLabels ) { dayLabel = mDayLabelsList.next(); if ( !dayLabel ) appendLabels = true; } if ( appendLabels ) { dayLabel = getNewDaylabel(); } //dayLabel->hide();//test only int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; if ( offset < 0 ) offset = 0; //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); dayLabel->setFont( dlf ); dayLabel->show(); diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 31ee5e2..b5de4a1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -153,97 +153,162 @@ void KOViewManager::showDateView( int view, QDate date) KOPrefs::instance()->mNextXDays ); mFlagShowNextxDays = true; mCurrentAgendaView = 3 ; } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) if ( lastMode ) { mCurrentAgendaView = lastCount ; mMainView->dateNavigator()->selectDates( lastDate, lastCount); mFlagShowNextxDays = lastNDMode; if ( mFlagShowNextxDays ) { mCurrentAgendaView = 3 ; } } else showWeekView(); } else if (view == 10) { mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); } } void KOViewManager::writeSettings(KConfig *config) { config->setGroup("General"); QString view; if (mCurrentView == mWhatsNextView) view = "WhatsNext"; else if (mCurrentView == mMonthView) view = "Month"; else if (mCurrentView == mListView) view = "List"; else if (mCurrentView == mJournalView) view = "Journal"; else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; else if (mCurrentView == mTodoView) view = "Todo"; else view = "Agenda"; config->writeEntry("Current View",view); if (mAgendaView) { mAgendaView->writeSettings(config); } if (mTimeSpanView) { mTimeSpanView->writeSettings(config); } if (mListView) { mListView->writeSettings(config); } if (mTodoView) { mTodoView->saveLayout(config,"Todo View"); } } +void KOViewManager::showNextView() +{ + if (mCurrentView == mWhatsNextView) goto NEXT_X; + + if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto LIST; + + if (mCurrentView == mListView ) goto DAY_1; + + if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; + + if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; + + if (mCurrentView == mAgendaView ) goto DAY_6; + + if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; + + if (mCurrentView == mMonthView ) goto TODO; + + if (mCurrentView == mTodoView ) goto JOURNAL; + + NEXT: + if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} + NEXT_X: + if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} + LIST: + if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} + DAY_1: + if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} + DAY_5: + if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} + DAY_7: + if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} + DAY_6: + if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} + MONTH: + if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} + TODO: + if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} + JOURNAL: + if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} + + + + if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} + if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} + + if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} + + if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} + + if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} + + if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} + + if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} + + if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} + + if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} + + if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} + + + +} void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) { //mFlagShowNextxDays = false; //if(view == mCurrentView) return; if ( view == 0 ) { view = mCurrentView; if ( view == 0 ) return; } bool callupdate = !(view == mCurrentView); bool full = fullScreen; if(view == mCurrentView && view != mWhatsNextView ) { if ( mCurrentAgendaView < 0 ) return; if ( view != mMonthView ) full = mMainView->leftFrame()->isVisible(); } else { if ( view == mMonthView && mMonthView) ;//mMonthView->skipResize = true ; mCurrentView = view; // bool full = fullScreen; bool isFull = !mMainView->leftFrame()->isVisible(); if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) full = true; if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) full = false; } if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); //raiseCurrentView( full ); mMainView->processIncidenceSelection( 0 ); //mMainView->updateView(); raiseCurrentView( full, callupdate ); mMainView->adaptNavigationUnits(); } void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) { mCurrentAgendaView = 0; if ( fullScreen ) { mMainView->leftFrame()->hide(); } else { mMainView->leftFrame()->show(); } //if ( mCurrentView == mMonthView ) qApp->processEvents(); emit signalFullScreen( !fullScreen ); if ( callUpdateView ) mMainView->updateView(); diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 6290227..d829f14 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h @@ -37,85 +37,86 @@ class KOTimeSpanView; class KOTodoView; class KOWhatsNextView; class KOJournalView; using namespace KCal; /** This class manages the views of the calendar. It owns the objects and handles creation and selection. */ class KOViewManager : public QObject { Q_OBJECT public: KOViewManager( CalendarView * ); virtual ~KOViewManager(); /** changes the view to be the currently selected view */ void showView(KOrg::BaseView *, bool fullScreen = false ); void updateWNview(); void readSettings(KConfig *config); void writeSettings(KConfig *config); bool showsNextDays(); /** Read which view was shown last from config file */ void readCurrentView(KConfig *); /** Write which view is currently shown to config file */ void writeCurrentView(KConfig *); KOrg::BaseView *currentView(); void setDocumentId( const QString & ); void updateView( const QDate &start, const QDate &end ); void raiseCurrentView( bool fullScreen = false , bool updateView = false); void addView(KOrg::BaseView *); Incidence *currentSelection(); QDate currentSelectionDate(); KOAgendaView *agendaView() const { return mAgendaView; } signals: void printWNV(); void signalFullScreen( bool ); void signalAgendaView( bool ); public slots: + void showNextView(); void showMonth( const QDate & ); void showDateView( int, QDate ); void updateView(); void showWhatsNextView(); void showListView(); void showAgendaView( bool fullScreen = false ); void showDayView(); void showWorkWeekView(); void showWeekView(); void showNextXView(); void showMonthView(); void showMonthViewWeek(); void showTodoView(); void showJournalView(); void showTimeSpanView(); private: void createMonthView(); CalendarView *mMainView; int mCurrentAgendaView; KOAgendaView *mAgendaView; KOListView *mListView; KOMonthView *mMonthView; KOTodoView *mTodoView; KOWhatsNextView *mWhatsNextView; KOJournalView *mJournalView; KOTimeSpanView *mTimeSpanView; KOrg::BaseView *mCurrentView; // currently active event view int mAgendaViewMode; bool mFlagShowNextxDays; }; #endif diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7d5cf72..b947cac 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -439,99 +439,102 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) int nextC = allmsg.find( "-", 1 ); if ( nextC == -1 ) { msg = allmsg; allmsg = ""; } else{ msg = allmsg.left( nextC ); allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); } //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); if ( msg == "-newEvent" ) { mView->newEvent(); } if ( msg == "-newTodo" ) { mView->newTodo(); } if ( msg == "-showWN" ) { mView->viewManager()->showWhatsNextView(); } if ( msg == "-showTodo" ) { mView->viewManager()->showTodoView(); } if ( msg == "-showList" ) { mView->viewManager()->showListView(); } else if ( msg == "-showDay" ) { mView->viewManager()->showDayView(); } else if ( msg == "-showWWeek" ) { mView->viewManager()->showWorkWeekView(); } else if ( msg == "-ringSync" ) { mSyncManager->multiSync( false ); } else if ( msg == "-showWeek" ) { mView->viewManager()->showWeekView(); } else if ( msg == "-showTodo" ) { mView->viewManager()->showTodoView(); } else if ( msg == "-showJournal" ) { mView->dateNavigator()->selectDates( 1 ); mView->dateNavigator()->selectToday(); mView->viewManager()->showJournalView(); } else if ( msg == "-showKO" ) { mView->viewManager()->showNextXView(); } - else if ( msg == "-showWNext" || msg == "nextView()" ) { + else if ( msg == "-showWNext" ) { mView->viewManager()->showWhatsNextView(); } + else if ( msg == "nextView()" ) { + mView->viewManager()->showNextView(); + } else if ( msg == "-showNextXView" ) { mView->viewManager()->showNextXView(); } } showMaximized(); raise(); } QPixmap MainWindow::loadPixmap( QString name ) { return SmallIcon( name ); } void MainWindow::initActions() { //KOPrefs::instance()->mShowFullMenu iconToolBar->clear(); KOPrefs *p = KOPrefs::instance(); //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); QPopupMenu *viewMenu = new QPopupMenu( this ); QPopupMenu *actionMenu = new QPopupMenu( this ); QPopupMenu *importMenu = new QPopupMenu( this ); QPopupMenu *importMenu_X = new QPopupMenu( this ); QPopupMenu *exportMenu_X = new QPopupMenu( this ); QPopupMenu *beamMenu_X = new QPopupMenu( this ); selectFilterMenu = new QPopupMenu( this ); selectFilterMenu->setCheckable( true ); syncMenu = new QPopupMenu( this ); configureAgendaMenu = new QPopupMenu( this ); configureToolBarMenu = new QPopupMenu( this ); QPopupMenu *helpMenu = new QPopupMenu( this ); QIconSet icon; int pixWid = 22, pixHei = 22; QString pathString = ""; if ( !p->mToolBarMiniIcons ) { if ( QApplication::desktop()->width() < 480 ) { pathString += "icons16/"; pixWid = 18; pixHei = 16; } } else { pathString += "iconsmini/"; pixWid = 18; pixHei = 16; } if ( KOPrefs::instance()->mShowFullMenu ) { |