summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-02 12:16:34 (UTC)
committer zautrix <zautrix>2005-04-02 12:16:34 (UTC)
commit997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe (patch) (side-by-side diff)
treef788b37459574b5cea0d2ab874882c6a396c240d
parente0d51120d2f0c178115746e0c1357af40f95bc77 (diff)
downloadkdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.zip
kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.tar.gz
kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.tar.bz2
more fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp3
-rw-r--r--kaddressbook/viewmanager.cpp2
-rw-r--r--kaddressbook/views/colorlistbox.cpp7
-rw-r--r--kaddressbook/views/colorlistbox.h1
-rw-r--r--kaddressbook/views/configurecardviewdialog.cpp4
-rw-r--r--kaddressbook/views/configuretableviewdialog.cpp4
-rw-r--r--korganizer/koagenda.cpp51
-rw-r--r--korganizer/koagenda.h4
-rw-r--r--korganizer/koagendaview.cpp18
-rw-r--r--korganizer/koagendaview.h4
-rw-r--r--korganizer/kotodoview.cpp35
-rw-r--r--microkde/kcolordialog.cpp1
-rw-r--r--microkde/kdeui/ktoolbar.cpp2
13 files changed, 108 insertions, 28 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 5ef61b1..e34951a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -396,13 +396,13 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
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()
{
@@ -2170,12 +2170,13 @@ void KABCore::addActionsManually()
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
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 86f0f3d..0614d06 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -701,13 +701,13 @@ void ViewManager::initActions()
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" );
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
@@ -29,12 +29,13 @@
#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 )
{
@@ -71,13 +72,17 @@ QColor ColorListBox::color( uint index ) const
}
else
{
return( black );
}
}
-
+void ColorListBox::slotNewColor(QListBoxItem * i)
+{
+ if ( i )
+ newColor( index( i ) );
+}
void ColorListBox::newColor( int index )
{
if( isEnabled() == false )
{
return;
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
@@ -45,12 +45,13 @@ class ColorListBox : public KListBox
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;
};
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
@@ -212,17 +212,21 @@ void CardViewLookNFeelPage::setHeaderFont()
#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();
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
@@ -207,17 +207,21 @@ void LookAndFeelPage::setHeaderFont()
#endif //KAB_EMBEDDED
}
void LookAndFeelPage::enableFonts()
{
vbFonts->setEnabled( cbEnableCustomFonts->isChecked() );
+ if ( cbEnableCustomFonts->isChecked() )
+ vbFonts->setFocus();
}
void LookAndFeelPage::enableColors()
{
lbColors->setEnabled( cbEnableCustomColors->isChecked() );
+ if ( cbEnableCustomColors->isChecked() )
+ lbColors->setFocus();
}
void LookAndFeelPage::initGUI()
{
int spacing = KDialog::spacingHint();
int margin = KDialog::marginHint();
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index deadfc9..de964da 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -165,13 +165,13 @@ void MarcusBains::updateLocation(bool recalculate)
*/
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 );
@@ -184,12 +184,13 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
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;
@@ -384,49 +385,88 @@ void KOAgenda::popupMenu()
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)
{
+ 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();
+ mPopupPos = me->globalPos();
if (object != viewport()) {
mPopupItem = (KOAgendaItem *)object;
mPopupKind = 1;
if (me->button() == RightButton) {
popupMenu();
} else if (me->button() == LeftButton) {
@@ -452,13 +492,12 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
} 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;
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 35c08b6..4f1fdb9 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -28,12 +28,13 @@
#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;
@@ -120,13 +121,13 @@ class KOAgenda : public QScrollView
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();
@@ -165,12 +166,13 @@ class KOAgenda : public QScrollView
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 * );
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 8d32152..95388ef 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -502,15 +502,13 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
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
@@ -541,22 +539,26 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
// 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();
@@ -664,14 +666,14 @@ void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
}
}
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());
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 30c9b05..c6e6602 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -268,14 +268,14 @@ class KOAgendaView : public KOEventView {
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;
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index ccc4b01..0a315cb 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -204,31 +204,42 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e)
}
#endif
}
void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
{
-#ifndef KORG_NODND
+
QPoint p(contentsToViewport(e->pos()));
QListViewItem *i = itemAt(p);
- mMousePressed = false;
+ bool rootClicked = true;
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)) +
+ 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() ||
- p.x() < header()->sectionPos(header()->mapToIndex(0))) {
- if (e->button()==Qt::LeftButton) {
- mPressPos = e->pos();
- mMousePressed = true;
+ X < header()->sectionPos(0)) {
+ rootClicked = false;
}
}
+#ifndef KORG_NODND
+ mMousePressed = false;
+ if (! rootClicked ) {
+ mPressPos = e->pos();
+ mMousePressed = true;
}
#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);
}
@@ -1060,24 +1071,32 @@ void KOTodoView::changedCategories(int index)
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;
diff --git a/microkde/kcolordialog.cpp b/microkde/kcolordialog.cpp
index 9a76e5e..a3d8973 100644
--- a/microkde/kcolordialog.cpp
+++ b/microkde/kcolordialog.cpp
@@ -72,12 +72,13 @@ KColorDialog::KColorDialog( QWidget *p ):QDialog( p, "input-dialog", true )
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() ));
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
@@ -1158,12 +1158,13 @@ QString KToolBar::settingsGroup()
}
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;
@@ -1601,12 +1602,13 @@ KToolBar::IconText KToolBar::iconTextSetting()
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