Skip to content

Commit

Permalink
Merge pull request #445 from lithorus/master
Browse files Browse the repository at this point in the history
Added ability to change branch in afwatch
  • Loading branch information
timurhai authored Mar 11, 2019
2 parents abe2ab2 + 81b5f5b commit e8c09b9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions afanasy/src/watch/itemjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void ItemJob::updateValues( af::Node * i_node, int i_type)
project = afqt::stoq( job->getProject());
department = afqt::stoq( job->getDepartment());
folders = afqt::stoq( job->getFolders());
branch = afqt::stoq( job->getBranch());
num_runningtasks = job->getRunningTasksNum();
lifetime = job->getTimeLife();
ppapproval = job->isPPAFlag();
Expand Down
1 change: 1 addition & 0 deletions afanasy/src/watch/itemjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ItemJob : public ItemNode
QString service;
QString hostname;
QString username;
QString branch;
QString hostsmask;
QString hostsmask_exclude;
QString dependmask;
Expand Down
14 changes: 14 additions & 0 deletions afanasy/src/watch/listjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ void ListJobs::contextMenuEvent( QContextMenuEvent *event)

submenu = new QMenu( "Set Parameter", this);

action = new QAction( "Change Branch", this);
connect( action, SIGNAL( triggered() ), this, SLOT( actChangeBranch() ));
submenu->addAction( action);
action = new QAction( "Max Running Tasks", this);
connect( action, SIGNAL( triggered() ), this, SLOT( actMaxRunningTasks() ));
submenu->addAction( action);
Expand Down Expand Up @@ -684,6 +687,17 @@ void ListJobs::actWaitTime()
setParameter("time_wait", waittime);
}

void ListJobs::actChangeBranch()
{
ItemJob* jobitem = (ItemJob*)getCurrentItem();
if( jobitem == NULL ) return;
QString current = jobitem->branch;
bool ok;
QString branch = QInputDialog::getText(this, "Change Branch", "Branch", QLineEdit::Normal, current, &ok);
if( !ok) return;
setParameter("branch", afqt::qtos( branch));
}

void ListJobs::actMaxRunningTasks()
{
ItemJob* jobitem = (ItemJob*)getCurrentItem();
Expand Down
1 change: 1 addition & 0 deletions afanasy/src/watch/listjobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private slots:
void actSetUser();
void actHostsMask();
void actHostsMaskExclude();
void actChangeBranch();
void actMaxRunningTasks();
void actMaxRunTasksPerHost();
void actDependMask();
Expand Down

0 comments on commit e8c09b9

Please sign in to comment.