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:
@@ -25,7 +25,7 @@ QtDialogView::~QtDialogView()
|
||||
m_resultReady = true;
|
||||
}
|
||||
|
||||
void QtDialogView::showStatusDialog(const std::string& title, const std::string& message)
|
||||
void QtDialogView::showUnknownProgressDialog(const std::string& title, const std::string& message)
|
||||
{
|
||||
MessageStatus(title + ": " + message, false, true).dispatch();
|
||||
|
||||
@@ -33,12 +33,12 @@ void QtDialogView::showStatusDialog(const std::string& title, const std::string&
|
||||
[=]()
|
||||
{
|
||||
QtIndexingDialog* window = dynamic_cast<QtIndexingDialog*>(m_windowStack.getTopWindow());
|
||||
if (!window || window->getType() != QtIndexingDialog::DIALOG_STATUS)
|
||||
if (!window || window->getType() != QtIndexingDialog::DIALOG_UNKNOWN_PROGRESS)
|
||||
{
|
||||
m_windowStack.clearWindows();
|
||||
|
||||
window = createWindow<QtIndexingDialog>();
|
||||
window->setupStatus();
|
||||
window->setupUnknownProgress();
|
||||
}
|
||||
|
||||
window->updateTitle(title.c_str());
|
||||
@@ -49,7 +49,7 @@ void QtDialogView::showStatusDialog(const std::string& title, const std::string&
|
||||
);
|
||||
}
|
||||
|
||||
void QtDialogView::hideStatusDialog()
|
||||
void QtDialogView::hideUnknownProgressDialog()
|
||||
{
|
||||
MessageStatus("", false, false).dispatch();
|
||||
|
||||
@@ -57,7 +57,7 @@ void QtDialogView::hideStatusDialog()
|
||||
[=]()
|
||||
{
|
||||
QtIndexingDialog* window = dynamic_cast<QtIndexingDialog*>(m_windowStack.getTopWindow());
|
||||
if (window && window->getType() == QtIndexingDialog::DIALOG_STATUS)
|
||||
if (window && window->getType() == QtIndexingDialog::DIALOG_UNKNOWN_PROGRESS)
|
||||
{
|
||||
m_windowStack.popWindow();
|
||||
}
|
||||
@@ -127,7 +127,7 @@ DialogView::IndexingOptions QtDialogView::startIndexingDialog(
|
||||
result = o;
|
||||
m_resultReady = true;
|
||||
|
||||
setUIBlocked(false);
|
||||
setUIBlocked(o.startIndexing);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -254,7 +254,7 @@ void QtDialogView::handleMessage(MessageInterruptTasks* message)
|
||||
QtIndexingDialog* window = dynamic_cast<QtIndexingDialog*>(m_windowStack.getTopWindow());
|
||||
if (window && window->getType() == QtIndexingDialog::DIALOG_INDEXING)
|
||||
{
|
||||
showStatusDialog("Interrupting Indexing", "Waiting for indexer\nthreads to finish");
|
||||
showUnknownProgressDialog("Interrupting Indexing", "Waiting for indexer\nthreads to finish");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -28,8 +28,8 @@ public:
|
||||
QtDialogView(QtMainWindow* mainWindow, StorageAccess* storageAccess);
|
||||
virtual ~QtDialogView();
|
||||
|
||||
virtual void showStatusDialog(const std::string& title, const std::string& message) override;
|
||||
virtual void hideStatusDialog() override;
|
||||
virtual void showUnknownProgressDialog(const std::string& title, const std::string& message) override;
|
||||
virtual void hideUnknownProgressDialog() override;
|
||||
|
||||
virtual void showProgressDialog(const std::string& title, const std::string& message, int progress) override;
|
||||
virtual void hideProgressDialog() override;
|
||||
|
||||
@@ -194,9 +194,9 @@ void QtIndexingDialog::setupReport(
|
||||
finishSetup();
|
||||
}
|
||||
|
||||
void QtIndexingDialog::setupStatus()
|
||||
void QtIndexingDialog::setupUnknownProgress()
|
||||
{
|
||||
setType(DIALOG_STATUS);
|
||||
setType(DIALOG_UNKNOWN_PROGRESS);
|
||||
|
||||
QBoxLayout* layout = createLayout();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user