Skip to content

Commit

Permalink
Show the icon of running processing
Browse files Browse the repository at this point in the history
This helps the user to identify that download and uploading is running.

re #6894
  • Loading branch information
gesnerpassos committed Apr 26, 2013
1 parent b33b65f commit f4169a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Code/Mantid/MantidQt/API/src/RepoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ QVariant RepoModel::data(const QModelIndex &index, int role) const
break;
case 1: // ask for the status
if (isDownloading(index))
return "Downloading";
return downloadSt();
if (isUploading(index))
return "Uploading";
return uploadSt();
status = repo_ptr->fileStatus(path.toStdString());
return fromStatus(status);
break;
Expand Down Expand Up @@ -248,6 +248,10 @@ QVariant RepoModel::data(const QModelIndex &index, int role) const
// tool tip role
if (role == Qt::ToolTipRole){
if (index.column() == 1){
if (isDownloading(index))
return "Downloading... Be patient.";
if (isUploading(index))
return "Uploading... Be patient.";
status = repo_ptr->fileStatus(path.toStdString());
inf = repo_ptr->fileInfo(path.toStdString());
switch(status){
Expand Down
3 changes: 2 additions & 1 deletion Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ void ScriptRepositoryView::RepoDelegate::paint(
icon = QIcon::fromTheme("dialog-ok", QIcon(QPixmap(":/win/dialog-ok")));
else if (state == RepoModel::localOnlySt() || state == RepoModel::localChangedSt())
icon = QIcon::fromTheme("add-files-to-archive", QIcon(QPixmap(":win/upload")));

else if (state == RepoModel::downloadSt() || state == RepoModel::uploadSt())
icon = QIcon(QPixmap(":win/running_process"));
// define the region to draw the icon
QRect buttonRect( option.rect);
int min_val = buttonRect.width()<buttonRect.height() ? buttonRect.width() : buttonRect.height();
Expand Down

0 comments on commit f4169a4

Please sign in to comment.