-rw-r--r-- | kaddressbook/kabcore.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/views/colorlistbox.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/views/colorlistbox.h | 1 | ||||
-rw-r--r-- | kaddressbook/views/configurecardviewdialog.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/views/configuretableviewdialog.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 57 | ||||
-rw-r--r-- | korganizer/koagenda.h | 4 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 18 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 4 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 49 | ||||
-rw-r--r-- | microkde/kcolordialog.cpp | 1 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 2 |
13 files changed, 120 insertions, 40 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 5ef61b1..e34951a 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -386,33 +386,33 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mAddressBookService = new KAddressBookService( this ); #endif //KAB_EMBEDDED mMessageTimer = new QTimer( this ); connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); mEditorDialog = 0; createAddresseeEditorDialog( this ); setModified( false ); mBRdisabled = false; #ifndef DESKTOP_VERSION infrared = 0; #endif //toggleBeamReceive( ); - //mMainWindow->toolBar()->show(); + mMainWindow->toolBar()->show(); // we have a toolbar repainting error on the Zaurus when starting KA/Pi QTimer::singleShot( 10, this , SLOT ( updateToolBar())); } void KABCore::updateToolBar() { static int iii = 0; ++iii; mMainWindow->toolBar()->repaintMe(); if ( iii < 4 ) QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); } KABCore::~KABCore() { // save(); //saveSettings(); @@ -2160,32 +2160,33 @@ void KABCore::addActionsManually() tb->insertWidget(-1, 0, menuBarTB); mIncSearchWidget = new IncSearchWidget( tb ); tb->enableMoving(false); popupBarTB->insertItem( i18n("&File"), fileMenu ); popupBarTB->insertItem( i18n("&Edit"), editMenu ); popupBarTB->insertItem( i18n("&View"), viewMenu ); popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); mViewManager->getFilterAction()->plug ( popupBarTB); //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); popupBarTB->insertItem( i18n("&Help"), helpMenu ); if (QApplication::desktop()->width() > 320 ) { // mViewManager->getFilterAction()->plug ( tb); } } #endif + mIncSearchWidget->setSize(); // mActionQuit->plug ( mMainWindow->toolBar()); //US Now connect the actions with the menue entries. #ifdef DESKTOP_VERSION mActionPrint->plug( fileMenu ); mActionPrintDetails->plug( fileMenu ); fileMenu->insertSeparator(); #endif mActionMail->plug( fileMenu ); fileMenu->insertSeparator(); mActionNewContact->plug( editMenu ); mActionNewContact->plug( tb ); @@ -2282,33 +2283,33 @@ void KABCore::addActionsManually() if (KGlobal::getDesktopSize() > KGlobal::Small ) { mActionSave->plug( tb ); mViewManager->getFilterAction()->plug ( tb); //LR hide filteraction on started in 480x640 if (QApplication::desktop()->width() == 480 ) { mViewManager->getFilterAction()->setComboWidth( 0 ); } mActionUndo->plug( tb ); mActionDelete->plug( tb ); mActionRedo->plug( tb ); } else { mActionSave->plug( tb ); tb->enableMoving(false); } //mActionQuit->plug ( tb ); - // tb->insertWidget(-1, 0, mIncSearchWidget, 6); + //tb->insertWidget(-1, 0, mIncSearchWidget, 6); //US link the searchwidget first to this. // The real linkage to the toolbar happens later. //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); //US tb->insertItem( mIncSearchWidget ); /*US mIncSearchWidget = new IncSearchWidget( tb ); connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), SLOT( incrementalSearch( const QString& ) ) ); mJumpButtonBar = new JumpButtonBar( this, this ); //US topLayout->addWidget( mJumpButtonBar ); this->layout()->add( mJumpButtonBar ); */ diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 86f0f3d..0614d06 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -691,33 +691,33 @@ void ViewManager::initActions() mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) ); #else //KAB_EMBEDDED mActionDeleteView->plug(viewmenu); viewmenu->insertSeparator(); #endif //KAB_EMBEDDED #ifndef KAB_EMBEDDED action = new KAction( i18n( "Refresh View" ), "reload", 0, this, SLOT( refreshView(const QString &) ), mCore->actionCollection(), "view_refresh" ); action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) ); #else //KAB_EMBEDDED action = new KAction( i18n( "Refresh View" ), "reload", 0, this, SLOT( refreshView()), mCore->actionCollection(), "view_refresh" ); action->plug(viewmenu); - viewmenu->insertSeparator(); + //viewmenu->insertSeparator(); #endif //KAB_EMBEDDED action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this, SLOT( configureFilters() ), mCore->actionCollection(), "options_edit_filters" ); mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); #if KDE_VERSION >= 309 mActionSelectFilter->setMenuAccelsEnabled( false ); #endif connect( mActionSelectFilter, SIGNAL( activated( int ) ), SLOT( setActiveFilter( int ) ) ); #ifdef KAB_EMBEDDED action->plug(settingsmenu); mActionSelectFilter->plug(viewmenu,0); diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp index c243fa0..7386207 100644 --- a/kaddressbook/views/colorlistbox.cpp +++ b/kaddressbook/views/colorlistbox.cpp @@ -19,32 +19,33 @@ */ #include <qpainter.h> #include <kcolordialog.h> #ifndef KAB_EMBEDDED #include <kcolordrag.h> #endif //KAB_EMBEDDED #include "colorlistbox.h" ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) { connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); + connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); setAcceptDrops( true); } void ColorListBox::setEnabled( bool state ) { if( state == isEnabled() ) { return; } QListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); } @@ -61,33 +62,37 @@ void ColorListBox::setColor( uint index, const QColor &color ) } } QColor ColorListBox::color( uint index ) const { if( index < count() ) { ColorListItem *colorItem = (ColorListItem*)item(index); return( colorItem->color() ); } else { return( black ); } } - +void ColorListBox::slotNewColor(QListBoxItem * i) +{ + if ( i ) + newColor( index( i ) ); +} void ColorListBox::newColor( int index ) { if( isEnabled() == false ) { return; } if( (uint)index < count() ) { QColor c = color( index ); #ifndef KAB_EMBEDDED if( KColorDialog::getColor( c, this ) != QDialog::Rejected ) { setColor( index, c ); } diff --git a/kaddressbook/views/colorlistbox.h b/kaddressbook/views/colorlistbox.h index 4a0e705..bb91484 100644 --- a/kaddressbook/views/colorlistbox.h +++ b/kaddressbook/views/colorlistbox.h @@ -35,32 +35,33 @@ class ColorListBox : public KListBox public: ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); void setColor( uint index, const QColor &color ); QColor color( uint index ) const; public slots: virtual void setEnabled( bool state ); protected: void dragEnterEvent( QDragEnterEvent *e ); void dragLeaveEvent( QDragLeaveEvent *e ); void dragMoveEvent( QDragMoveEvent *e ); void dropEvent( QDropEvent *e ); private slots: void newColor( int index ); + void slotNewColor(QListBoxItem * i); private: int mCurrentOnDragEnter; }; class ColorListItem : public QListBoxItem { public: ColorListItem( const QString &text, const QColor &color=Qt::black ); const QColor &color( void ); void setColor( const QColor &color ); protected: virtual void paint( QPainter * ); diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp index 366e54c..e0fbd21 100644 --- a/kaddressbook/views/configurecardviewdialog.cpp +++ b/kaddressbook/views/configurecardviewdialog.cpp @@ -202,37 +202,41 @@ void CardViewLookNFeelPage::setHeaderFont() { QFont f( lHeaderFont->font() ); #ifndef KAB_EMBEDDED if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) updateFontLabel( f, lHeaderFont ); #else //KAB_EMBEDDED bool ok; QFont fout = KFontDialog::getFont( f, ok); if ( ok ) updateFontLabel( fout, lHeaderFont ); #endif //KAB_EMBEDDED } void CardViewLookNFeelPage::enableFonts() { vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); + if ( cbEnableCustomFonts->isChecked() ) + vbFonts->setFocus(); } void CardViewLookNFeelPage::enableColors() { lbColors->setEnabled( cbEnableCustomColors->isChecked() ); + if ( cbEnableCustomColors->isChecked() ) + lbColors->setFocus(); } void CardViewLookNFeelPage::initGUI() { int spacing = KDialog::spacingHint(); int margin = KDialog::marginHint(); QTabWidget *tabs = new QTabWidget( this ); // Layout QVBox *loTab = new QVBox( this, "layouttab" ); loTab->setSpacing( spacing ); loTab->setMargin( margin ); QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp index 8bcceb2..0e36abd 100644 --- a/kaddressbook/views/configuretableviewdialog.cpp +++ b/kaddressbook/views/configuretableviewdialog.cpp @@ -197,37 +197,41 @@ void LookAndFeelPage::setHeaderFont() { QFont f( lHeaderFont->font() ); #ifndef KAB_EMBEDDED if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted ) updateFontLabel( f, lHeaderFont ); #else //KAB_EMBEDDED bool ok; QFont fout = KFontDialog::getFont( f, ok); if ( ok ) updateFontLabel( fout, lHeaderFont ); #endif //KAB_EMBEDDED } void LookAndFeelPage::enableFonts() { vbFonts->setEnabled( cbEnableCustomFonts->isChecked() ); + if ( cbEnableCustomFonts->isChecked() ) + vbFonts->setFocus(); } void LookAndFeelPage::enableColors() { - lbColors->setEnabled( cbEnableCustomColors->isChecked() ); + lbColors->setEnabled( cbEnableCustomColors->isChecked() ); + if ( cbEnableCustomColors->isChecked() ) + lbColors->setFocus(); } void LookAndFeelPage::initGUI() { int spacing = KDialog::spacingHint(); int margin = KDialog::marginHint(); QTabWidget *tabs = new QTabWidget( this ); // General QVBox *generalTab = new QVBox( this, "generaltab" ); generalTab->setSpacing( spacing ); generalTab->setMargin( margin ); QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index deadfc9..de964da 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -155,51 +155,52 @@ void MarcusBains::updateLocation(bool recalculate) //mTimeBox->setAutoMask(true); minutes->start(5000,true); } //////////////////////////////////////////////////////////////////////////// /* Create an agenda widget with rows rows and columns columns. */ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, const char *name,WFlags f) : QScrollView(parent,name,f) { - + mAllAgendaPopup = 0; mColumns = columns; mRows = rows; mGridSpacingY = rowSize; mAllDayMode = false; #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif mHolidayMask = 0; init(); } /* Create an agenda widget with columns columns and one row. This is used for all-day events. */ KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : QScrollView(parent,name,f) { + mAllAgendaPopup = 0; blockResize = false; mColumns = columns; mRows = 1; //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); mGridSpacingY = KOPrefs::instance()->mAllDaySize; mAllDayMode = true; #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif mHolidayMask = 0; init(); } KOAgenda::~KOAgenda() { @@ -219,33 +220,33 @@ QDate KOAgenda::selectedIncidenceDate() const } void KOAgenda::init() { mPopupTimer = new QTimer(this); connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); mNewItemPopup = new QPopupMenu( this ); connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); QString pathString = ""; if ( !KOPrefs::instance()->mToolBarMiniIcons ) { if ( QApplication::desktop()->width() < 480 ) pathString += "icons16/"; } else pathString += "iconsmini/"; - + mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); mNewItemPopup->insertSeparator ( ); mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); #ifndef _WIN32_ int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase viewport()->setWFlags ( wflags); #endif mGridSpacingX = 80; mResizeBorderWidth = 8; mScrollBorderWidth = 8; @@ -374,101 +375,139 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) return true; default: return QScrollView::eventFilter(object,event); } } void KOAgenda::popupMenu() { mPopupTimer->stop(); if ( mPopupKind == 1 ) { if (mActionItem ) { endItemAction(); } mLeftMouseDown = false; // no more leftMouse computation if (mPopupItem) { selectItem(mPopupItem); + if ( mAllAgendaPopup ) + mAllAgendaPopup->installEventFilter( this ); emit showIncidencePopupSignal(mPopupItem->incidence()); } } else if ( mPopupKind == 2 ) { if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action endSelectAction( false ); // do not emit new event signal mLeftMouseDown = false; // no more leftMouse computation } + mNewItemPopup->installEventFilter( this ); mNewItemPopup->popup( mPopupPos); + } mLeftMouseDown = false; mPopupItem = 0; mPopupKind = 0; } bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) { - //qDebug("KOAgenda::eventFilter_mous "); + static int startX = 0; + static int startY = 0; + static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); + static bool blockMoving = true; + + //qDebug("KOAgenda::eventFilter_mous "); + if ( object == mNewItemPopup ) { + //qDebug("mNewItemPopup "); + if ( me->type() == QEvent::MouseButtonRelease ) { + mNewItemPopup->removeEventFilter( this ); + int dX = me->globalPos().x() - mPopupPos.x();; + if ( dX < 0 ) + dX = -dX; + int dY = me->globalPos().y() - mPopupPos.y(); + if ( dY < 0 ) + dY = -dY; + if ( dX > blockmoveDist || dY > blockmoveDist ) { + mNewItemPopup->hide(); + } + } + return true; + } + if ( object == mAllAgendaPopup ) { + //qDebug(" mAllAgendaPopup "); + if ( me->type() == QEvent::MouseButtonRelease ) { + mAllAgendaPopup->removeEventFilter( this ); + int dX = me->globalPos().x() - mPopupPos.x();; + if ( dX < 0 ) + dX = -dX; + int dY = me->globalPos().y() - mPopupPos.y(); + if ( dY < 0 ) + dY = -dY; + if ( dX > blockmoveDist || dY > blockmoveDist ) { + mAllAgendaPopup->hide(); + } + } + return true; + } QPoint viewportPos; if (object != viewport()) { viewportPos = ((QWidget *)object)->mapToParent(me->pos()); } else { viewportPos = me->pos(); } - static int startX = 0; - static int startY = 0; - static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); - static bool blockMoving = true; + switch (me->type()) { case QEvent::MouseButtonPress: if (me->button() == LeftButton) { mPopupTimer->start( 600 ); mLeftMouseDown = true; } blockMoving = true; startX = viewportPos.x(); - startY = viewportPos.y(); + startY = viewportPos.y(); + mPopupPos = me->globalPos(); if (object != viewport()) { mPopupItem = (KOAgendaItem *)object; mPopupKind = 1; if (me->button() == RightButton) { popupMenu(); } else if (me->button() == LeftButton) { mActionItem = (KOAgendaItem *)object; if (mActionItem) { if ( mSelectionHeight > 0 ) { int selectionCellX = mSelectionCellX * mGridSpacingX; int selectionYTop = mSelectionYTop; int gridSpacingX = mGridSpacingX; int selectionHeight = mSelectionHeight; clearSelection(); repaintContents( selectionCellX, selectionYTop, gridSpacingX, selectionHeight,false ); } selectItem(mActionItem); Incidence *incidence = mActionItem->incidence(); if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { mActionItem = 0; } else { startItemAction(viewportPos); } } } } else { // ---------- viewport() mPopupItem = 0; mPopupKind = 2; selectItem(0); mActionItem = 0; - mPopupPos = viewport()->mapToGlobal( me->pos() ); if (me->button() == RightButton) { int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); mCurrentCellX = gx; mCurrentCellY = gy; mStartCellX = gx; mStartCellY = gy; popupMenu(); } else if (me->button() == LeftButton) { setCursor(arrowCursor); startSelectAction(viewportPos); } } break; diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 35c08b6..4f1fdb9 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h @@ -18,32 +18,33 @@ 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. */ #ifndef KOAGENDA_H #define KOAGENDA_H #include <qscrollview.h> #include <qtimer.h> #include <qmemarray.h> #include <qpainter.h> #include <qpixmap.h> #include <qguardedptr.h> #include "koagendaitem.h" +#include "koeventview.h" class QPopupMenu; class QTime; class KConfig; class QFrame; class KOAgenda; class KCal::Event; class KCal::Todo; using namespace KCal; class MarcusBains : public QFrame { Q_OBJECT public: MarcusBains(KOAgenda *agenda=0,const char *name=0); virtual ~MarcusBains(); @@ -110,33 +111,33 @@ class KOAgenda : public QScrollView /** Calculates the minimum width */ virtual int minimumWidth() const; /** Update configuration from preference settings */ void updateConfig(); void checkScrollBoundaries(); void setHolidayMask(QMemArray<bool> *); void setDateList(const DateList &selectedDates); DateList dateList() const; void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); void finishUpdate(); void printSelection(); void storePosition(); void restorePosition(); - + void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; } public slots: void popupMenu(); void newItem( int ); void moveChild( QWidget *, int, int ); void scrollUp(); void scrollDown(); void updateTodo( Todo * t, int , bool ); void popupAlarm(); void checkScrollBoundaries(int); /** Deselect selected items. This function does not emit any signals. */ void deselectItem(); /** Select item. If the argument is 0, the currently selected item gets deselected. This function emits the itemSelected(bool) signal to inform @@ -155,32 +156,33 @@ class KOAgenda : public QScrollView void showIncidenceSignal(Incidence *); void editIncidenceSignal(Incidence *); void deleteIncidenceSignal(Incidence *); void showIncidencePopupSignal(Incidence *); void itemModified(KOAgendaItem *item, int ); void incidenceSelected(Incidence *); void lowerYChanged(int); void upperYChanged(int); void startDragSignal(Incidence *); void addToCalSignal(Incidence *, Incidence *); void resizedSignal(); protected: + KOEventPopupMenu * mAllAgendaPopup; QPainter mPixPainter; QPixmap mPaintPixmap; QPixmap mHighlightPixmap; void drawContents(QPainter *p,int cx, int cy, int cw, int ch); virtual void resizeEvent ( QResizeEvent * ); /** Handles mouse events. Called from eventFilter */ virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); /** Start selecting time span. */ void startSelectAction(QPoint viewportPos); /** Select time span. */ void performSelectAction(QPoint viewportPos); /** Emd selecting time span. */ diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 8d32152..95388ef 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -492,35 +492,33 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mExpandButton->setPixmap( expandPix ); int widebut = mExpandButton->sizeHint().width()+4; int heibut = mExpandButton->sizeHint().height()+4; if ( heibut > widebut ) widebut = heibut ; //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); QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); // Create event context menu for all day agenda - mAllDayAgendaPopup = eventPopup(); - connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), - mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); + //mAllDayAgendaPopup = eventPopup(); // Create agenda frame QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); // QHBox *agendaFrame = new QHBox(splitterAgenda); // create event indicator bars mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); #ifndef DESKTOP_VERSION // FIX mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); #endif mDayLabelsFrame = new QHBox(agendaFrame); //topLayout->addWidget(mDayLabelsFrame); mDayLabels = new QFrame (mDayLabelsFrame); mLayoutDayLabels = new QHBoxLayout(mDayLabels); agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); @@ -531,42 +529,46 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : agendaLayout->addWidget(mEventIndicatorBottom,3,1); QWidget *dummyAgendaRight = new QWidget(agendaFrame); agendaLayout->addWidget(dummyAgendaRight,1,2); // Create time labels mTimeLabels = new TimeLabels(24,agendaFrame); agendaLayout->addWidget(mTimeLabels,2,0); connect(mTimeLabels,SIGNAL( scaleChanged()), this,SLOT(updateConfig())); // Create agenda mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); agendaLayout->setColStretch(1,1); mAgenda->setFocusPolicy(NoFocus); // Create event context menu for agenda - mAgendaPopup = eventPopup(); + mAllAgendaPopup = eventPopup(); - mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), + mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), i18n("Toggle Alarm"),mAgenda, SLOT(popupAlarm()),true); connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), - mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); + mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); + connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), + mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); + mAgenda->setPopup( mAllAgendaPopup ); + mAllDayAgenda->setPopup( mAllAgendaPopup ); // make connections between dependent widgets mTimeLabels->setAgenda(mAgenda); // Update widgets to reflect user preferences // updateConfig(); // createDayLabels(); // these blank widgets make the All Day Event box line up with the agenda dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); // Scrolling connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), mTimeLabels, SLOT(positionChanged())); @@ -654,34 +656,34 @@ void KOAgendaView::toggleAllDay() } void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) { calendar()->addIncidence( inc ); if ( incOld ) { if ( incOld->type() == "Todo" ) emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); else emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); } } KOAgendaView::~KOAgendaView() { - delete mAgendaPopup; - delete mAllDayAgendaPopup; + delete mAllAgendaPopup; + //delete mAllDayAgendaPopup; delete KOAgendaItem::paintPix(); delete KOAgendaItem::paintPixSel(); } void KOAgendaView::resizeEvent( QResizeEvent* e ) { //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); bool uc = false; int ow = e->oldSize().width(); int oh = e->oldSize().height(); int w = e->size().width(); int h = e->size().height(); if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) uc = true; //qDebug("view changed %d %d %d %d ", ow, oh , w , h); } diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 30c9b05..c6e6602 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -258,34 +258,34 @@ class KOAgendaView : public KOEventView { QBoxLayout *mLayoutDayLabels; QFrame *mAllDayFrame; KOAgenda *mAllDayAgenda; KOAgenda *mAgenda; TimeLabels *mTimeLabels; QWidget *mDummyAllDayLeft; KDGanttMinimizeSplitter* mSplitterAgenda; QPushButton *mExpandButton; DateList mSelectedDates; // List of dates to be displayed int mViewType; bool mWeekStartsMonday; int mStartHour; - KOEventPopupMenu *mAgendaPopup; - KOEventPopupMenu *mAllDayAgendaPopup; + KOEventPopupMenu *mAllAgendaPopup; + //KOEventPopupMenu *mAllDayAgendaPopup; EventIndicator *mEventIndicatorTop; EventIndicator *mEventIndicatorBottom; QMemArray<int> mMinY; QMemArray<int> mMaxY; QMemArray<bool> mHolidayMask; QPtrList<KOAgendaButton> mDayLabelsList; QDateTime mTimeSpanBegin; QDateTime mTimeSpanEnd; bool mTimeSpanInAllDay; void keyPressEvent ( QKeyEvent * e ); }; diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index ccc4b01..0a315cb 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -194,51 +194,62 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) 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::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() || + X < header()->sectionPos(0)) { + rootClicked = false; + } + } #ifndef KORG_NODND - QPoint p(contentsToViewport(e->pos())); - QListViewItem *i = itemAt(p); - mMousePressed = false; - if (i) { - // if the user clicked into the root decoration of the item, don't - // try to start a drag! - if (p.x() > header()->sectionPos(header()->mapToIndex(0)) + - treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + - itemMargin() || - p.x() < header()->sectionPos(header()->mapToIndex(0))) { - if (e->button()==Qt::LeftButton) { + mMousePressed = false; + if (! rootClicked ) { mPressPos = e->pos(); mMousePressed = true; - } } - } #endif - QListView::contentsMousePressEvent(e); + //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) { #ifndef KORG_NODND //QListView::contentsMouseMoveEvent(e); if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()*3) { mMousePressed = false; QListViewItem *item = itemAt(contentsToViewport(mPressPos)); if (item) { @@ -1050,44 +1061,52 @@ void KOTodoView::changedCategories(int index) categories.remove( colcat ); categories.prepend( colcat ); } } mActiveItem->todo()->setCategories (categories); mActiveItem->construct(); 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 ) { + 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!")); } pendingSubtodo = 0; return; } KOTodoViewItem *todoItem = (KOTodoViewItem *)item; if ( pendingSubtodo != 0 ) { bool allowReparent = true; QListViewItem *par = item; while ( par ) { if ( par == pendingSubtodo ) { allowReparent = false; break; } diff --git a/microkde/kcolordialog.cpp b/microkde/kcolordialog.cpp index 9a76e5e..a3d8973 100644 --- a/microkde/kcolordialog.cpp +++ b/microkde/kcolordialog.cpp @@ -62,31 +62,32 @@ KColorDialog::KColorDialog( QWidget *p ):QDialog( p, "input-dialog", true ) lay->addWidget(lg ,3,0 ); g = new QSlider ( 0, 255, 1, 1, Horizontal, this ); lay->addWidget( g ,3,1 ); QLabel* lb = new QLabel ( "Blue:",this ); lay->addWidget( lb,4,0 ); b = new QSlider ( 0, 255, 1, 1, Horizontal, this ); lay->addWidget(b ,4,1 ); QColor d = backgroundColor(); r->setValue(d.red() ); g->setValue(d.green() ); b->setValue(d.blue() ); old_color->setPalette( QPalette( d.dark() , d ) ); // kannst du wieder reinnehmen, aber es geht auch so. QPushButton * ok = new QPushButton (i18n(" OK "), this ); + ok->setDefault( true ); QPushButton * cancel = new QPushButton (i18n(" Cancel "), this ); lay->addWidget(ok ,5,0 ); lay->addWidget(cancel ,5,1 ); connect (ok, SIGNAL( clicked() ), this ,SLOT (accept() )); connect (cancel, SIGNAL( clicked() ), this ,SLOT (reject() )); connect (r, SIGNAL( valueChanged ( int ) ), this ,SLOT (updateColor( int ) )); connect (g, SIGNAL( valueChanged ( int ) ), this ,SLOT (updateColor( int ) )); connect (b, SIGNAL( valueChanged ( int ) ), this ,SLOT (updateColor( int ) )); } void KColorDialog::updateColor( int ) { QColor c = getColor( ) ; new_color->setPalette( QPalette( c.dark(), c ) ); } diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 35d4916..36ede81 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp @@ -1148,32 +1148,33 @@ QString KToolBar::settingsGroup() { QString configGroup; if (!::qstrcmp(name(), "unnamed") || !::qstrcmp(name(), "mainToolBar")) configGroup = "Toolbar style"; else configGroup = QString(name()) + " Toolbar style"; if ( this->mainWindow() ) { configGroup.prepend(" "); configGroup.prepend( this->mainWindow()->name() ); } return configGroup; } void KToolBar::saveSettings(KConfig *config, const QString &_configGroup) { + return; QString configGroup = _configGroup; if (configGroup.isEmpty()) configGroup = settingsGroup(); //kdDebug(220) << "KToolBar::saveSettings group=" << _configGroup << " -> " << configGroup << endl; QString position, icontext; int index; getAttributes( position, icontext, index ); //kdDebug(220) << "KToolBar::saveSettings " << name() << " newLine=" << newLine << endl; KConfigGroupSaver saver(config, configGroup); if ( position != d->PositionDefault ) config->writeEntry("Position", position); else @@ -1591,32 +1592,33 @@ KToolBar::IconText KToolBar::iconTextSetting() { QString grpToolbar(QString::fromLatin1("Toolbar style")); KConfigGroupSaver saver(KGlobal::config(), grpToolbar); QString icontext = KGlobal::config()->readEntry(QString::fromLatin1("IconText"),QString::fromLatin1("IconOnly")); if ( icontext == "IconTextRight" ) return IconTextRight; else if ( icontext == "IconTextBottom" ) return IconTextBottom; else if ( icontext == "TextOnly" ) return TextOnly; else return IconOnly; } void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal) { + return; QString configGroup = _configGroup.isEmpty() ? settingsGroup() : _configGroup; //kdDebug(220) << "KToolBar::applyAppearanceSettings: configGroup=" << configGroup << endl; // We have application-specific settings in the XML file, // and nothing in the application's config file // -> don't apply the global defaults, the XML ones are preferred // See applySettings for a full explanation /*US :we do not support xml files if ( d->m_xmlguiClient && !d->m_xmlguiClient->xmlFile().isEmpty() && !config->hasGroup(configGroup) ) { //kdDebug(220) << "skipping global defaults, using XML ones instead" << endl; return; } */ if ( !config->hasGroup(configGroup) ) { |