summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/koeventpopupmenu.cpp12
-rw-r--r--korganizer/kolistview.cpp7
-rw-r--r--korganizer/koviewmanager.cpp3
-rw-r--r--korganizer/mainwindow.cpp4
5 files changed, 23 insertions, 19 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a10e93c..72221fd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -665,35 +665,41 @@ void CalendarView::setScrollBarStep(int val )
{
#ifdef DESKTOP_VERSION
mDateScrollBar->setLineStep ( val );
#endif
}
void CalendarView::scrollBarValue(int val )
{
#ifdef DESKTOP_VERSION
if ( QApplication::desktop()->width() < 800 ) return;
static bool block = false;
if ( block ) return;
block = true;
- val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
- //qDebug("VAL %d ",val );
int count = mNavigator->selectedDates().count();
- int year = mNavigator->selectedDates().first().year();
int day = mNavigator->selectedDates().first().dayOfYear();
- if ( val == day -1 ) {
+ int stepdays = val;
+ if ( mDateScrollBar->lineStep () <= count ) {
+ val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
+ //qDebug("VAL %d ",val );
+ stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
+ stepdays = day-1+stepdays;
+ if ( stepdays < 0 ) stepdays = 0;
+ }
+ if ( stepdays == day -1 ) {
block = false;
return;
}
+ int year = mNavigator->selectedDates().first().year();
QDate d ( year,1,1 );
- mNavigator->selectDates( d.addDays( val ), count );
+ mNavigator->selectDates( d.addDays( stepdays) , count );
block = false;
#endif
}
void CalendarView::checkFiles()
{
QString message;
QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
while ( cal ) {
if ( cal->mErrorOnLoad ) {
message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index 0b0fe8e..77322e7 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -52,74 +52,80 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu()
#endif
mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"),
this,SLOT(popupCancel())));
isDisabled = false;
mCatPopup = new QPopupMenu ( this );
mCatPopup->setCheckable (true);
connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup()));
connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int )));
mCalPopup = new QPopupMenu ( this );
mCalPopup->setCheckable (true);
connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
- mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
- mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
+ //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
+ //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
+ insertItem (i18n("Categories"),mCatPopup );
+ insertItem (i18n("Calendar"),mCalPopup );
QValueList<int>::Iterator it;
for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
mSingleOnlyItems.append(*it);
}
}
void KOEventPopupMenu::enableDefault( bool enable )
{
isDisabled = !enable;
QValueList<int>::Iterator it;
for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) {
setItemEnabled(*it,enable);
}
}
void KOEventPopupMenu::fillCalPopup() // CAL
{
mCalPopup->clear();
if (!mCurrentIncidence) return;
+ bool readO = mCurrentIncidence->isReadOnly()|| isDisabled;
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
- if ( kkf->mErrorOnLoad || kkf->isReadOnly )
+ if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
mCalPopup->setItemEnabled( index, false );
mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID());
kkf = KOPrefs::instance()->mCalendars.next();
}
}
void KOEventPopupMenu::computeCalPopup( int index ) // CAL
{
if (!mCurrentIncidence) return;
mCurrentIncidence->setCalID( index );
emit categoryChanged( mCurrentIncidence );
}
void KOEventPopupMenu::fillCatPopup()
{
mCatPopup->clear();
if (!mCurrentIncidence) return;
+ bool readO = mCurrentIncidence->isReadOnly() || isDisabled;
QStringList checkedCategories = mCurrentIncidence->categories();
int index = 0;
for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
it != KOPrefs::instance()->mCustomCategories.end ();
++it) {
mCatPopup->insertItem (*it, index );
if (checkedCategories.find (*it) != checkedCategories.end ()) {
mCatPopup->setItemChecked (index, true);
}
+ if ( readO )
+ mCatPopup->setItemEnabled( index, false );
++index;
}
}
void KOEventPopupMenu::computeCatPopup( int index )
{
if (!mCurrentIncidence) return;
QStringList categories = mCurrentIncidence->categories();
QString colcat = categories.first();
if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
categories.remove (KOPrefs::instance()->mCustomCategories[index]);
else
categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index cec0476..25e599d 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -311,53 +311,53 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
selPopup->insertItem(i18n("All"),this,
SLOT(allSelection()));
selPopup->insertItem(i18n("None"),this,
SLOT(clearSelection()));
selPopup->insertItem(i18n("Delete selected..."),this,
SLOT(deleteAll()));
mPopupMenu->insertItem(i18n("Selection"), selPopup );
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Hide all selected"),this,
SLOT(hideAll()),true);
selPopup->insertSeparator();
+ QPopupMenu * exportPO = new QPopupMenu ( this );
+ selPopup->insertItem( i18n("Export"), exportPO );
#ifdef DESKTOP_VERSION
mPopupMenu->insertSeparator();
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
- i18n("Print complete list"),this,
+ i18n("Print complete list..."),this,
SLOT(printList()),true);
#endif
mCalPopup = new QPopupMenu ( this );
selPopup->insertItem( i18n("Set Calendar"), mCalPopup );
selPopup->insertItem(i18n("Set categories")+"...",this,
SLOT(setCat()) );
selPopup->insertItem( i18n("Set alarm..."),this,
SLOT(setAlarm()));
#if 0
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Set categories")+"...",this,
SLOT(setCat()),true);
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Set alarm..."),this,
SLOT(setAlarm()),true);
#endif
QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this,
SLOT( populateCalPopup() ));
QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
SLOT( setCalendar( int ) ));
QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this,
SLOT( catChanged( Incidence * ) ));
- QPopupMenu * exportPO = new QPopupMenu ( this );
- selPopup->insertItem( i18n("Export"), exportPO );
exportPO->insertItem( i18n("As iCal (ics) file..."),this,
SLOT(saveToFile()));
exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
SLOT(saveToFileVCS()));
exportPO->insertItem( i18n("Journal/Details..."),this,
SLOT(saveDescriptionToFile()));
// mPopupMenu->insertSeparator();
// mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
// i18n("Add Categ. to selected..."),this,
// SLOT(addCat()),true);
//mPopupMenu->insertSeparator();
#ifndef DESKTOP_VERSION
@@ -1303,25 +1303,24 @@ KOListViewListView::KOListViewListView(KOListView * lv )
{
mYMousePos = 0;
mPopupTimer = new QTimer(this);
connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
#ifndef DESKTOP_VERSION
//QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
#endif
setSelectionMode( QListView::Multi );
setMultiSelection( true);
}
bool KOListViewListView::hasMultiSelection(QListViewItem* item)
{
- int selCount = 0;
QListViewItem *qitem = firstChild ();
while ( qitem ) {
if ( qitem->isSelected() && item != qitem )
return true;
qitem = qitem->nextSibling();
}
return false;
}
void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 792a7b8..ba3bc05 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -546,62 +546,59 @@ void KOViewManager::showDayView()
mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockLabel = 1;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 1 )
mCurrentAgendaView = -1;
showAgendaView();
qApp->processEvents();
globalFlagBlockAgenda = 2;
globalFlagBlockLabel = 0;
mMainView->dateNavigator()->selectDates( 1 );
mCurrentAgendaView = 1 ;
- mMainView->setScrollBarStep( 1 );
}
void KOViewManager::showWorkWeekView()
{
mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockAgenda = 1;
globalFlagBlockLabel = 1;
if ( mCurrentAgendaView != 5 )
mCurrentAgendaView = -1;
showAgendaView();
qApp->processEvents();
globalFlagBlockAgenda = 2;
globalFlagBlockLabel = 0;
mMainView->dateNavigator()->selectWorkWeek();
mCurrentAgendaView = 5 ;
- mMainView->setScrollBarStep( 1 );
}
void KOViewManager::showWeekView()
{
mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockAgenda = 1;
globalFlagBlockLabel = 1;
if ( mCurrentAgendaView != 7 )
mCurrentAgendaView = -1;
showAgendaView();
qApp->processEvents();
globalFlagBlockAgenda = 2;
globalFlagBlockLabel = 0;
mMainView->dateNavigator()->selectWeek();
mCurrentAgendaView = 7 ;
- mMainView->setScrollBarStep( 1 );
}
void KOViewManager::showNextXView()
{
KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 3 )
mCurrentAgendaView = -1;
showAgendaView(KOPrefs::instance()->mFullViewMonth);
globalFlagBlockAgenda = 2;
mMainView->dateNavigator()->selectDates( QDate::currentDate(),
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7a5f3e5..5d26d35 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -821,28 +821,24 @@ void MainWindow::initActions()
mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
mMoveAction->addTo( mCurrentItemMenu );
connect( mMoveAction, SIGNAL( activated() ),
mView, SLOT( moveIncidence() ) );
mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
mBeamAction->addTo(mCurrentItemMenu );
connect( mBeamAction, SIGNAL( activated() ),
mView, SLOT( beamIncidence() ) );
mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
mCancelAction->addTo( mCurrentItemMenu );
connect( mCancelAction, SIGNAL( activated() ),
mView, SLOT( toggleCancelIncidence() ) );
-#ifdef DESKTOP_VERSION
- actionMenu->insertSeparator();
-#endif
-
QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
ne_action->addTo( actionMenu );
connect( ne_action, SIGNAL( activated() ),
mView, SLOT( newEvent() ) );
icon = loadPixmap( pathString + "newtodo" );
configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
nt_action->addTo( actionMenu );
connect( nt_action, SIGNAL( activated() ),
mView, SLOT( newTodo() ) );