@@ -469,6 +469,21 @@ void ItemManagerWidget::setCompletion()
469469 }
470470}
471471
472+ void ItemManagerWidget::setPriority ()
473+ {
474+ QAction* action = qobject_cast<QAction*>( sender () );
475+ auto priority = static_cast <RamStatus::Priority>( action->data ().toInt () );
476+ QVector<RamStatus*> status = beginEditSelectedStatus ();
477+
478+ RamUser *currentUser = Ramses::instance ()->currentUser ();
479+
480+ for (int i = 0 ; i < status.count (); i++)
481+ {
482+ status.at (i)->setPriority ( priority );
483+ status.at (i)->setModifiedBy (currentUser);
484+ }
485+ }
486+
472487void ItemManagerWidget::copyComment ()
473488{
474489 QModelIndex currentIndex = ui_table->selectionModel ()->currentIndex ();
@@ -844,6 +859,21 @@ void ItemManagerWidget::setupUi()
844859 completionMenu->addAction (ui_completion100);
845860 statusMenu->addMenu (completionMenu);
846861
862+ DuMenu *priorityMenu = new DuMenu (" Set priority" , this );
863+ ui_priorityNone = new QAction (" None" ,this );
864+ ui_priorityLow = new QAction (" Low" ,this );
865+ ui_priorityMedium = new QAction (" Medium" ,this );
866+ ui_priorityHigh = new QAction (" High" ,this );
867+ ui_priorityNone->setData (RamStatus::NoPriority);
868+ ui_priorityLow->setData (RamStatus::LowPriority);
869+ ui_priorityMedium->setData (RamStatus::MediumPriority);
870+ ui_priorityHigh->setData (RamStatus::HighPriority);
871+ priorityMenu->addAction (ui_priorityNone );
872+ priorityMenu->addAction (ui_priorityLow );
873+ priorityMenu->addAction (ui_priorityMedium );
874+ priorityMenu->addAction (ui_priorityHigh );
875+ statusMenu->addMenu (priorityMenu);
876+
847877
848878 QToolButton *statusButton = new QToolButton (this );
849879 statusButton->setText (" Status" );
@@ -911,6 +941,13 @@ void ItemManagerWidget::setupUi()
911941 completionContextMenu->addAction (ui_completion100);
912942 ui_contextMenu->addMenu (completionContextMenu);
913943
944+ DuMenu *priorityContextMenu = new DuMenu (" Set priority" , this );
945+ priorityContextMenu->addAction (ui_priorityNone );
946+ priorityContextMenu->addAction (ui_priorityLow );
947+ priorityContextMenu->addAction (ui_priorityMedium );
948+ priorityContextMenu->addAction (ui_priorityHigh );
949+ ui_contextMenu->addMenu (priorityContextMenu);
950+
914951 ui_contextMenu->addSeparator ();
915952
916953 ui_actionCopyFileName = new QAction (tr (" Copy file name" ));
@@ -952,6 +989,10 @@ void ItemManagerWidget::connectEvents()
952989 connect (ui_completion75 , SIGNAL (triggered ()), this , SLOT ( setCompletion () ) );
953990 connect (ui_completion90 , SIGNAL (triggered ()), this , SLOT ( setCompletion () ) );
954991 connect (ui_completion100, SIGNAL (triggered ()), this , SLOT ( setCompletion () ) );
992+ connect (ui_priorityNone, SIGNAL (triggered ()), this , SLOT ( setPriority () ) );
993+ connect (ui_priorityLow, SIGNAL (triggered ()), this , SLOT ( setPriority () ) );
994+ connect (ui_priorityMedium, SIGNAL (triggered ()), this , SLOT ( setPriority () ) );
995+ connect (ui_priorityHigh, SIGNAL (triggered ()), this , SLOT ( setPriority () ) );
955996 connect (ui_table, SIGNAL (customContextMenuRequested (QPoint)), this , SLOT (contextMenuRequested (QPoint)));
956997 // view actions
957998 // connect(ui_actionTimeTracking, SIGNAL(toggled(bool)), ui_table, SLOT(setTimeTracking(bool)));
0 commit comments