logic: Show unknown progress dialog when refreshing (issue 341)

* refactored dialog handling
* Application always provides a DialogView instance

bug id = 341
This commit is contained in:
Eberhard Graether
2017-04-19 13:04:46 +02:00
parent c4deca4662
commit 9d718d6a87
13 changed files with 81 additions and 114 deletions
+2 -2
View File
@@ -194,9 +194,9 @@ void QtIndexingDialog::setupReport(
finishSetup();
}
void QtIndexingDialog::setupStatus()
void QtIndexingDialog::setupUnknownProgress()
{
setType(DIALOG_STATUS);
setType(DIALOG_UNKNOWN_PROGRESS);
QBoxLayout* layout = createLayout();
+2 -2
View File
@@ -19,7 +19,7 @@ public:
enum DialogType
{
DIALOG_MESSAGE,
DIALOG_STATUS,
DIALOG_UNKNOWN_PROGRESS,
DIALOG_PROGRESS,
DIALOG_INDEXING
};
@@ -35,7 +35,7 @@ public:
void setupReport(
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount, float time);
void setupStatus();
void setupUnknownProgress();
void setupProgress();
void updateMessage(QString message);
@@ -128,8 +128,9 @@ std::vector<std::string> QtProjectWizzardContentPathSourceMaven::getFileNames()
const FilePath mavenProjectRoot = javaSettings->getAbsoluteMavenProjectFilePath().parentDirectory();
std::vector<std::string> list;
std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView();
Application::getInstance()->getDialogView()->showStatusDialog("Preparing Project", "Maven\nGenerating Source Files");
dialogView->showUnknownProgressDialog("Preparing Project", "Maven\nGenerating Source Files");
const bool success = utility::mavenGenerateSources(mavenPath, mavenProjectRoot);
if (!success)
{
@@ -143,7 +144,7 @@ std::vector<std::string> QtProjectWizzardContentPathSourceMaven::getFileNames()
}
else
{
Application::getInstance()->getDialogView()->showStatusDialog("Preparing Project", "Maven\nFetching Source Directories");
dialogView->showUnknownProgressDialog("Preparing Project", "Maven\nFetching Source Directories");
const std::vector<FilePath> sourceDirectories = utility::mavenGetAllDirectoriesFromEffectivePom(
mavenPath,
mavenProjectRoot,
@@ -169,7 +170,7 @@ std::vector<std::string> QtProjectWizzardContentPathSourceMaven::getFileNames()
list.push_back(path.str());
}
}
Application::getInstance()->getDialogView()->hideStatusDialog();
dialogView->hideUnknownProgressDialog();
return list;
}