author | zautrix <zautrix> | 2005-04-03 04:33:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-03 04:33:19 (UTC) |
commit | f6c8249db564c1276d4c7ed5ad88c6fbac361b8d (patch) (side-by-side diff) | |
tree | 8e5b6e2d6f9a7bc00326f7c0115bf2af53ae9ce8 | |
parent | 40e5edc1ab153144f0e824ad2d3a0ab37357e408 (diff) | |
download | kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.zip kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.tar.gz kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | kabc/addresseedialog.cpp | 80 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 13 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 19 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 69 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 11 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
8 files changed, 135 insertions, 70 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 6b739ba..711509d 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1319,25 +1319,25 @@ { "There is nothing selected!","Es ist nichts ausgewählt!" }, { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, { "KO/Pi Printout","KO/Pi Ausdruck" }, { "Print unscaled","Drucke unskaliert" }, { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, { "Printout Mode","Druck Modus" }, { "Filter menu icon","Filtermenu Icon" }, { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, { "%1d","%1t" }, { "%1h","%1std" }, { "%1min","%1min" }, { "( %1 before )","( %1 vorher )" }, +{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, +{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, +{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, -{ "","" }, -{ "","" }, -{ "","" }, -{ "","" }
\ No newline at end of file +{ "","" },
\ No newline at end of file diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 648e780..19b52bb 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp @@ -113,35 +113,36 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), SLOT( removeSelected() ) ); QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), SLOT( addSelected( QListViewItem * ) ) ); connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), SLOT( selectNextItem( QListViewItem * ) ) ); } mAddressBook = StdAddressBook::self( true ); connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), SLOT( addressBookChanged() ) ); +#if 0 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), SLOT( addressBookChanged() ) ); - +#endif loadAddressBook(); QValueList<int> splitterSize; splitterSize.append( ( width() / 5 ) * 3 ); splitterSize.append( ( width() / 5 ) *2 ); mMiniSplitter->setSizes( splitterSize ); } AddresseeDialog::~AddresseeDialog() { qDebug("DELETE AddresseeDialog "); } void AddresseeDialog::loadAddressBook() { mAddresseeList->clear(); mItemDict.clear(); @@ -265,47 +266,88 @@ Addressee::List AddresseeDialog::addressees() aItem = (AddresseeItem *)( item ); if ( aItem ) al.append( aItem->addressee() ); item = item->nextSibling(); } } else { aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); if (aItem) al.append( aItem->addressee() ); } return al; } Addressee AddresseeDialog::getAddressee( QWidget *parent ) { - AddresseeDialog *dlg = new AddresseeDialog( parent ); - Addressee addressee; - int result = dlg->exec(); + AddresseeDialog *dlg = new AddresseeDialog( parent ); + Addressee addressee; +#ifdef DESKTOP_VERSION + static int geoX = 0; + static int geoY = 0; + static int geoW = 0; + static int geoH = 0; + if ( !geoX && ! geoY && !geoW &&!geoH ) { + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); + } else { + dlg->show(); + dlg->setGeometry(geoX , geoY,geoW , geoH ); - if ( result == QDialog::Accepted ) { - addressee = dlg->addressee(); - } + } +#endif + int result = dlg->exec(); +#ifdef DESKTOP_VERSION + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); +#endif + if ( result == QDialog::Accepted ) { + addressee = dlg->addressee(); + } - delete dlg; - return addressee; + delete dlg; + return addressee; } Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) { - AddresseeDialog *dlg = new AddresseeDialog( parent, true ); - Addressee::List addressees; - if ( QApplication::desktop()->width() <= 640 ) - dlg->showMaximized(); - int result = dlg->exec(); - if ( result == QDialog::Accepted ) { - addressees = dlg->addressees(); - } + AddresseeDialog *dlg = new AddresseeDialog( parent, true ); + Addressee::List addressees; + static int geoX = 0; + static int geoY = 0; + static int geoW = 0; + static int geoH = 0; + if ( QApplication::desktop()->width() <= 640 ) + dlg->showMaximized(); + else { + if ( !geoX && ! geoY && !geoW &&!geoH ) { + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); + } else { + dlg->show(); + dlg->setGeometry(geoX , geoY,geoW , geoH ); + + } + } + int result = dlg->exec(); + geoX = dlg->geometry().x(); + geoY = dlg->geometry().y(); + geoW = dlg->width(); + geoH = dlg->height(); + if ( result == QDialog::Accepted ) { + addressees = dlg->addressees(); + } - delete dlg; - return addressees; + delete dlg; + return addressees; } void AddresseeDialog::addressBookChanged() { loadAddressBook(); } diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index bdeee4a..53ff488 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp @@ -19,59 +19,60 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ // $Id$ #include <qhbox.h> #include <qvbox.h> #include <qapp.h> #include <qlabel.h> #include <qlayout.h> #include <qfile.h> #include <qtimer.h> #include <qsound.h> #include <qpushbutton.h> +#include <qregexp.h> #ifndef DESKTOP_VERSION #define protected public #include <qspinbox.h> #undef protected #else #include <qspinbox.h> #endif #include <stdlib.h> #ifndef _WIN32_ #include <unistd.h> #include <sys/ioctl.h> #endif #include <stdio.h> #include <fcntl.h> #ifndef DESKTOP_VERSION #include <qtopia/alarmserver.h> #include <qpe/resource.h> #include <qtopia/sound.h> #endif #include "alarmdialog.h" AlarmDialog::AlarmDialog(QWidget *parent,const char *name) - : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) + : QDialog (parent, name, true, Qt::WStyle_Customize |Qt::WStyle_StaysOnTop | Qt::WStyle_DialogBorder) { setCaption( "KO/Pi Alarm!" ); QVBoxLayout* layout = new QVBoxLayout( this); QLabel* l = new QLabel("The following event triggered alarm:",this); layout->addWidget ( l ); l->setAlignment( AlignCenter); mMessage = new QLabel ( " ", this ); int fs = 18; int fs2 = 12; int baseSize = 6; if ( QApplication::desktop()->width() < 480 ) { fs2 = 10; fs = 12; baseSize = 4; } layout->setSpacing( 3 ); @@ -219,72 +220,74 @@ void AlarmDialog::setSuspendTime( int val ) } bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) { if ( mess.left( 9) != "Suspended" ) mSuspendCounter = suspendtimes; mPauseCount = pause; mFileName = fn; mPlayWav = playwav; if ( !QFile::exists( fn ) ) mFileName = ""; alarmCounter = 0 ; maxAlarmReplay = replay ; mStopAlarm = false; mSilent = false; if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { mMissedAlarmsCombo->show(); - mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); + QString newItem = mMessage->text().stripWhiteSpace(); + newItem.replace( QRegExp("\n"), QString(" ") ); + mMissedAlarmsCombo->insertItem( newItem ); mMissedAlarms->setText( "Missed alarms:"); } else mMissedAlarmsCombo->hide(); mMessage->setText(mess); int w =sizeHint().width() ; int h = sizeHint().height() ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); show(); raise(); //qApp->processEvents(); //repaint(); qApp->processEvents(); #ifndef _WIN32_ if ( fd_led > 0 ) { statusLED.status = LED_SALARM_ON ; ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); } #endif playSoundTimer->start( 1000, true ); return true; } void AlarmDialog::playSound () { if (mStopAlarm ) return; - if (mSilent ) + if ( mSilent ) return; showNormal(); setActiveWindow(); + raise(); mSuspendSpin->setFocus(); - raise(); - repaint(); + qApp->processEvents(); if ( alarmCounter < maxAlarmReplay && ! mSilent) { ++alarmCounter; #ifdef DESKTOP_VERSION mPlayWav = true; #endif if ( !mPlayWav || mFileName.length() < 2 ) { #ifdef DESKTOP_VERSION qDebug("Sound play not possible - file not found"); #else Sound::soundAlarm (); #endif } else diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index beb19d9..76cce26 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -517,32 +517,37 @@ void CalendarView::showDay( QDate d ) } void CalendarView::timerAlarm() { //qDebug("CalendarView::timerAlarm() "); computeAlarm(mAlarmNotification ); } void CalendarView::suspendAlarm() { //qDebug(" CalendarView::suspendAlarm() "); computeAlarm(mSuspendAlarmNotification ); } void CalendarView::startAlarm( QString mess , QString filename) { + + topLevelWidget()->showNormal(); + topLevelWidget()->setActiveWindow(); + topLevelWidget()->raise(); + mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); } void CalendarView::checkNextTimerAlarm() { mCalendar->checkAlarmForIncidence( 0, true ); } void CalendarView::computeAlarm( QString msg ) { QString mess = msg; QString mAlarmMessage = mess.mid( 9 ); QString filename = MainWindow::resourcePath(); @@ -4081,37 +4086,47 @@ void CalendarView::resetFocus() void CalendarView::showNextAlarms() { QString message; QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { QString sum = mCalendar->nextSummary(); QDateTime nextA = mNextAlarmDateTime; QDateTime cur = QDateTime::currentDateTime(); int secs = cur.secsTo( nextA ); int min = secs /60; int hours = min /60; min = min % 60; int days = hours /24; hours = hours % 24; - message = i18n("The next alarm is in:\n"); + //message = i18n("The next alarm is in:\n"); if ( days > 1 ) message += i18n("%1 days\n").arg( days ); else if ( days == 1 ) message += i18n("1 day\n"); if ( hours > 1 ) message += i18n("%1 hours\n").arg( hours ); else if ( hours == 1 ) message += i18n("1 hour\n"); if ( min > 1 ) message += i18n("%1 minutes\n").arg( min ); else if ( min == 1 ) message += i18n("1 minute\n"); - + if ( message.isEmpty() ) + message = i18n("The next alarm is in\nless than one minute!"); + else + message = i18n("The next alarm is in:\n") + message; message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; } else { message = i18n("There is no next alarm."); } +#ifdef DESKTOP_VERSION + if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { + message += i18n("\nThe internal alarm notification is disabled!\n"); + message += i18n("Enable it in the settings menu, TAB alarm."); + } + +#endif KMessageBox::information( this, message); } diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index d450a97..6d1e6d5 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -140,33 +140,33 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) } fm = QFontMetrics( nFont ); timeHeight = fm.ascent(); } //timeHeight -= (timeHeight/4-2); QFont sFont = nFont; sFont.setPointSize( sFont.pointSize()/2 ); QFontMetrics fmS( sFont ); int sHei = fmS.ascent() ; //sHei -= (sHei/4-2); int startW = mMiniWidth - frameWidth()-2 ; int tw2 = fmS.width(suffix); timeHeight = (timeHeight-1) /2 -1; //testline //p->drawLine(0,0,0,contentsHeight()); while (y < cy + ch+mCellHeight) { - p->drawLine(startW-tw2 ,y,cw+2,y); + p->drawLine(startW-tw2+1 ,y,cw+2,y); hour.setNum(cell); // handle 24h and am/pm time formats if (KGlobal::locale()->use12Clock()) { if (cell == 12) suffix = "pm"; if (cell == 0) hour.setNum(12); if (cell > 12) hour.setNum(cell - 12); } // center and draw the time label int timeWidth = fm.width(hour); int offset = startW - timeWidth - tw2 -1 ; p->setFont( nFont ); p->drawText( offset, y+ timeHeight, hour); p->setFont( sFont ); offset = startW - tw2; p->drawText( offset, y -1, suffix); @@ -202,33 +202,33 @@ void TimeLabels::updateConfig() test = "12"; mMiniWidth = fontMetrics().width(test); if (KGlobal::locale()->use12Clock()) test = "pm"; else { test = "00"; } QFont sFont = font(); sFont.setPointSize( sFont.pointSize()/2 ); QFontMetrics fmS( sFont ); mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; // update geometry restrictions based on new settings setFixedWidth( mMiniWidth ); // update HourSize mCellHeight = KOPrefs::instance()->mHourSize*4; - resizeContents(50,mRows * mCellHeight); + resizeContents(mMiniWidth,mRows * mCellHeight+1); } /** update time label positions */ void TimeLabels::positionChanged() { int adjustment = mAgenda->contentsY(); setContentsPos(0, adjustment); } /** */ void TimeLabels::setAgenda(KOAgenda* agenda) { mAgenda = agenda; } void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index b14ca43..abc80d4 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -214,85 +214,82 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) mAlarmProgramButton->setToggleButton(true); QToolTip::add(mAlarmProgramButton, i18n("No program set")); connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); alarmLayout->addWidget(mAlarmProgramButton); mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); // if ( KOPrefs::instance()->mCompactDialogs ) { // mAlarmSoundButton->hide(); // mAlarmProgramButton->hide(); // } } void KOEditorGeneral::pickAlarmSound() { qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); - //QString prefix = mAlarmSound; - if (!mAlarmSoundButton->isOn()) { + + bool oldState = mAlarmSoundButton->isOn(); + + QString fileName(KFileDialog::getOpenFileName(mAlarmSound, + i18n("*.wav|Wav Files"), 0)); + if (!fileName.isEmpty()) { + mAlarmSound = fileName; + QToolTip::remove(mAlarmSoundButton); + QString dispStr = i18n("Playing '%1'").arg(fileName); + QToolTip::add(mAlarmSoundButton, dispStr); + mAlarmProgramButton->setOn(false); mAlarmSoundButton->setOn(true); - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); + QToolTip::add(mAlarmProgramButton, i18n("No program set")); } else { - QString fileName(KFileDialog::getOpenFileName(mAlarmSound, - i18n("*.wav|Wav Files"), 0)); - if (!fileName.isEmpty()) { - mAlarmSound = fileName; - QToolTip::remove(mAlarmSoundButton); - QString dispStr = i18n("Playing '%1'").arg(fileName); - QToolTip::add(mAlarmSoundButton, dispStr); - mAlarmProgramButton->setOn(false); - mAlarmSoundButton->setOn(true); - } else { - mAlarmProgramButton->setOn(true); - mAlarmSoundButton->setOn(false); - - } + mAlarmProgramButton->setOn(oldState); + mAlarmSoundButton->setOn(!oldState); + + } -#if 0 + if (mAlarmProgramButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); if ( mAlarmSoundButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); -#endif + } void KOEditorGeneral::pickAlarmProgram() { - if (!mAlarmProgramButton->isOn()) { + bool oldState = mAlarmProgramButton->isOn(); + + QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); + if (!fileName.isEmpty()) { + mAlarmProgram = fileName; + QToolTip::remove(mAlarmProgramButton); + QString dispStr = i18n("Running '%1'").arg(fileName); + QToolTip::add(mAlarmProgramButton, dispStr); + mAlarmSoundButton->setOn(false); mAlarmProgramButton->setOn(true); - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); - } else { - QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); - if (!fileName.isEmpty()) { - mAlarmProgram = fileName; - QToolTip::remove(mAlarmProgramButton); - QString dispStr = i18n("Running '%1'").arg(fileName); - QToolTip::add(mAlarmProgramButton, dispStr); - mAlarmSoundButton->setOn(false); - mAlarmProgramButton->setOn(true); - } else { - mAlarmProgramButton->setOn(false); - mAlarmSoundButton->setOn(true); - } + QToolTip::add(mAlarmSoundButton, i18n("No sound set")); + } else { + mAlarmProgramButton->setOn(!oldState); + mAlarmSoundButton->setOn(oldState); } -#if 0 + if (mAlarmProgramButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); if ( mAlarmSoundButton->isOn()) ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); -#endif + } QString KOEditorGeneral::getFittingPath( const QString s ) { int maxlen = 50; if ( QApplication::desktop()->width() < 640 ) { if ( QApplication::desktop()->width() < 320 ) maxlen = 22; else maxlen = 35; } if ( s.length() > maxlen ) { return "..."+s.right(maxlen -3); } return s; diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 01cf0ff..395325c 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -191,58 +191,64 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { int pos = (*it).find("<"); QString name = (*it).left(pos); QString email = (*it).mid(pos); if (!email.isEmpty() && todoi) { todoi->todo()->addAttendee(new Attendee(name,email)); } } } else { qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); e->ignore(); } } #endif } +void KOTodoListView::wheelEvent (QWheelEvent *e) +{ + QListView::wheelEvent (e); +} void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) { QPoint p(contentsToViewport(e->pos())); QListViewItem *i = itemAt(p); bool rootClicked = true; if (i) { // if the user clicked into the root decoration of the item, don't // try to start a drag! int X = p.x(); //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); if (X > header()->sectionPos(0) + treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin() +i->height()|| X < header()->sectionPos(0)) { rootClicked = false; } } else { rootClicked = false; } #ifndef KORG_NODND mMousePressed = false; - if (! rootClicked ) { + if (! rootClicked && !( e->button() == RightButton) ) { mPressPos = e->pos(); mMousePressed = true; + } else { + mMousePressed = false; } #endif //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); #ifndef DESKTOP_VERSION if (!( e->button() == RightButton && rootClicked) ) QListView::contentsMousePressEvent(e); #else QListView::contentsMousePressEvent(e); #endif } void KOTodoListView::paintEvent(QPaintEvent* e) { emit paintNeeded(); QListView::paintEvent( e); } void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) @@ -1069,33 +1075,33 @@ void KOTodoView::changedCategories(int index) mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); } } void KOTodoView::itemDoubleClicked(QListViewItem *item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); } pendingSubtodo = 0; int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); //qDebug("ROW %d ", row); if (!item) { newTodo(); return; } else { - if ( row == 1 ) { + if ( row == 1 || row == 2 ) { mActiveItem = (KOTodoViewItem *) item; newSubTodo(); return; } } if ( KOPrefs::instance()->mEditOnDoubleClick ) editItem( item ); else showItem( item , QPoint(), 0 ); } void KOTodoView::itemClicked(QListViewItem *item) { //qDebug("KOTodoView::itemClicked %d", item); if (!item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); @@ -1258,32 +1264,33 @@ void KOTodoView::displayAllFlat() void KOTodoView::setAllFlat() { if ( isFlatDisplay ) { isFlatDisplay = false; mPopupMenu->setItemChecked( 8,false ); updateView(); return; } storeCurrentItem(); displayAllFlat(); resetCurrentItem(); } void KOTodoView::purgeCompleted() { emit purgeCompletedSignal(); + } void KOTodoView::toggleQuickTodo() { if ( mQuickAdd->isVisible() ) { mQuickAdd->hide(); KOPrefs::instance()->mEnableQuickTodo = false; } else { mQuickAdd->show(); KOPrefs::instance()->mEnableQuickTodo = true; } mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); } void KOTodoView::toggleRunning() diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index e553d0e..39976cf 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -55,32 +55,33 @@ class DocPrefs; class KOTodoListView : public KListView { Q_OBJECT public: KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); virtual ~KOTodoListView() {} signals: void paintNeeded(); void todoDropped(Todo *, int); void double_Clicked(QListViewItem *item); void reparentTodoSignal( Todo *,Todo * ); void unparentTodoSignal(Todo *); void deleteTodo( Todo * ); protected: + void wheelEvent (QWheelEvent *e); void contentsDragEnterEvent(QDragEnterEvent *); void contentsDragMoveEvent(QDragMoveEvent *); void contentsDragLeaveEvent(QDragLeaveEvent *); void contentsDropEvent(QDropEvent *); void contentsMousePressEvent(QMouseEvent *); void contentsMouseMoveEvent(QMouseEvent *); void contentsMouseReleaseEvent(QMouseEvent *); void contentsMouseDoubleClickEvent(QMouseEvent *); private: void paintEvent(QPaintEvent * pevent); bool internalDrop; QString mName; Calendar *mCalendar; QPoint mPressPos; |