|
|
@ -41,7 +41,12 @@ InsertionMarker=QLine(); |
|
|
|
db=NULL; |
|
|
|
db=NULL; |
|
|
|
LastHoverItem=NULL; |
|
|
|
LastHoverItem=NULL; |
|
|
|
setHeaderLabels(QStringList()<<tr("Gruppen")); |
|
|
|
setHeaderLabels(QStringList()<<tr("Gruppen")); |
|
|
|
ShowSearchGroup=true; |
|
|
|
ShowSearchGroup=false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KeepassGroupView::selectSearchGroup(){ |
|
|
|
|
|
|
|
Q_ASSERT(ShowSearchGroup); |
|
|
|
|
|
|
|
setItemSelected(Items.back(),true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void KeepassGroupView:: dragEnterEvent ( QDragEnterEvent * event ){ |
|
|
|
void KeepassGroupView:: dragEnterEvent ( QDragEnterEvent * event ){ |
|
|
@ -61,8 +66,9 @@ if(LastHoverItem){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
InsertionMarker=QLine(); |
|
|
|
InsertionMarker=QLine(); |
|
|
|
|
|
|
|
if(isSearchResultGroup(item)) |
|
|
|
if(item){ |
|
|
|
event->setAccepted(false); |
|
|
|
|
|
|
|
else if(item){ |
|
|
|
QRect ItemRect=visualItemRect(item); |
|
|
|
QRect ItemRect=visualItemRect(item); |
|
|
|
if(!db->isParentGroup(item->pGroup,DragItem->pGroup) && DragItem!=item){ |
|
|
|
if(!db->isParentGroup(item->pGroup,DragItem->pGroup) && DragItem!=item){ |
|
|
|
if((ItemRect.height()+ItemRect.y())-event->pos().y() > INSERT_AREA_WIDTH && event->pos().y() > INSERT_AREA_WIDTH){ |
|
|
|
if((ItemRect.height()+ItemRect.y())-event->pos().y() > INSERT_AREA_WIDTH && event->pos().y() > INSERT_AREA_WIDTH){ |
|
|
@ -148,6 +154,8 @@ void KeepassGroupView::mouseMoveEvent(QMouseEvent *event){ |
|
|
|
if ((event->pos() - DragStartPos).manhattanLength() < QApplication::startDragDistance()) |
|
|
|
if ((event->pos() - DragStartPos).manhattanLength() < QApplication::startDragDistance()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
DragItem=(GroupViewItem*)itemAt(DragStartPos); |
|
|
|
DragItem=(GroupViewItem*)itemAt(DragStartPos); |
|
|
|
|
|
|
|
if (isSearchResultGroup(DragItem)) |
|
|
|
|
|
|
|
return; |
|
|
|
if(!DragItem)return; |
|
|
|
if(!DragItem)return; |
|
|
|
QDrag *drag = new QDrag(this); |
|
|
|
QDrag *drag = new QDrag(this); |
|
|
|
QFontMetrics fontmet(DragItem->font(0)); |
|
|
|
QFontMetrics fontmet(DragItem->font(0)); |
|
|
@ -203,6 +211,9 @@ if(ShowSearchGroup){ |
|
|
|
Items.push_back(new GroupViewItem(this)); |
|
|
|
Items.push_back(new GroupViewItem(this)); |
|
|
|
Items.back()->setText(0,trUtf8("Suchergebnisse")); |
|
|
|
Items.back()->setText(0,trUtf8("Suchergebnisse")); |
|
|
|
Items.back()->pGroup=NULL; |
|
|
|
Items.back()->pGroup=NULL; |
|
|
|
|
|
|
|
QFont f=Items.back()->font(0); |
|
|
|
|
|
|
|
f.setItalic(true); |
|
|
|
|
|
|
|
Items.back()->setFont(0,f); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|