finished Drag'n'Drop handling (dragging a mail from it's folder's mail list onto another folder): now we show the '+' sign (added to the mouse cursor) only when the user pressed the key (s)he has specified for COPY operations. Also we now show the correct sign at _beginning_ of the drag operation. So the user can see whether this will make a copy of the mail when _starting_ the drag operation.

svn path=/trunk/kdenetwork/kmail/; revision=153814
wilder-work
Karl-Heinz Zimmer 24 years ago
parent c284624513
commit 0b962d72fe
  1. 3
      kmfoldertree.cpp
  2. 34
      kmheaders.cpp
  3. 5
      kmheaders.h

@ -1277,8 +1277,7 @@ void KMFolderTree::contentsDropEvent( QDropEvent *e )
{
int root_x, root_y, win_x, win_y;
uint keybstate;
Window rootw;
Window childw;
Window rootw, childw;
XQueryPointer( qt_xdisplay(), qt_xrootwin(), &rootw, &childw,
&root_x, &root_y, &win_x, &win_y, &keybstate );

@ -702,6 +702,16 @@ void KMHeaders::readConfig (void)
{
KConfigGroupSaver saver(config, "Behaviour");
mLoopOnGotoUnread = config->readBoolEntry( "LoopOnGotoUnread", true );
// read D'n'D behavior settings
mActionWhenDnD = config->readNumEntry("DnD_action_normal", KMMsgDnDActionASK );
if ( mActionWhenDnD < 0 || mActionWhenDnD > 2 )
mActionWhenDnD = KMMsgDnDActionASK;
mActionWhenShiftDnD = config->readNumEntry("DnD_action_SHIFT", KMMsgDnDActionMOVE );
if ( mActionWhenShiftDnD < 0 || mActionWhenShiftDnD > 2 )
mActionWhenShiftDnD = KMMsgDnDActionMOVE;
mActionWhenCtrlDnD = config->readNumEntry("DnD_action_CTRL", KMMsgDnDActionCOPY );
if ( mActionWhenCtrlDnD < 0 || mActionWhenCtrlDnD > 2 )
mActionWhenCtrlDnD = KMMsgDnDActionCOPY;
}
}
@ -2554,7 +2564,29 @@ void KMHeaders::contentsMouseMoveEvent( QMouseEvent* e )
QListViewItem *item = itemAt( contentsToViewport(presspos) );
if ( item ) {
KMHeaderToFolderDrag* d = new KMHeaderToFolderDrag(viewport());
d->drag();
const ButtonState keybstate = e->state();
int actionSettings;
if ( keybstate & Qt::ControlButton )
actionSettings = mActionWhenCtrlDnD;
else if ( keybstate & Qt::ShiftButton )
actionSettings = mActionWhenShiftDnD;
else
actionSettings = mActionWhenDnD;
switch ( actionSettings ) {
case KMMsgDnDActionMOVE:
d->dragMove();
break;
case KMMsgDnDActionCOPY:
d->dragCopy();
break;
default:
// We will ASK the user via PopUp menu.
// But we _must_ call dragMove() since otherwise Qt will
// show the '+' indicator if CTRL key is hold down even if
// our KMail user has specified /not/ to copy via CRTL+D'n'D.
d->dragMove();
}
}
}
}

@ -390,6 +390,11 @@ private:
KMime::DateFormatter mDate;
/** value of config key Behaviour/LoopOnGotoUnread */
bool mLoopOnGotoUnread;
// actions for D'n'D from Headers to Folder
int mActionWhenDnD;
int mActionWhenShiftDnD;
int mActionWhenCtrlDnD;
};
#endif

Loading…
Cancel
Save