Added long operation termination button on status bar
More robust process termination Folded the Abort shortcut into a QAction FossilOrigin-Name: ea4b656b8237af73b81e6b22fd4c451a51450d2d
This commit is contained in:
		| @@ -24,6 +24,7 @@ Fuel V2.0.0 (2015-XX-XX) | |||||||
| - Feature: Support for the versionable .fossil-settings/ignore-glob | - Feature: Support for the versionable .fossil-settings/ignore-glob | ||||||
| - Feature: OSX: UI improvements | - Feature: OSX: UI improvements | ||||||
| - Feature: OSX: Improved external application selection for application bundles | - Feature: OSX: Improved external application selection for application bundles | ||||||
|  | - Feature: Long operations can now be aborted via a button on the status bar | ||||||
| - Misc: Reorganised menu structure. | - Misc: Reorganised menu structure. | ||||||
| - Misc: Separated Fuel and Fossil settings | - Misc: Separated Fuel and Fossil settings | ||||||
| - Bug Fix: Retain the folder tree state when refreshing the workspace | - Bug Fix: Retain the folder tree state when refreshing the workspace | ||||||
|   | |||||||
							
								
								
									
										26
									
								
								manifest
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								manifest
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | |||||||
| C Fossil::Init\snow\srequires\sa\spath\sto\sthe\sfossil\sexecutable | C Added\slong\soperation\stermination\sbutton\son\sstatus\sbar\nMore\srobust\sprocess\stermination\nFolded\sthe\sAbort\sshortcut\sinto\sa\sQAction\n | ||||||
| D 2015-08-27T12:00:28.915 | D 2015-08-27T14:30:44.033 | ||||||
| F .fossil-settings/manifest a09a968bf05a50058f3ad50132730b719bc39e76 | F .fossil-settings/manifest a09a968bf05a50058f3ad50132730b719bc39e76 | ||||||
| F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 | F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 | ||||||
| F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b | F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b | ||||||
| @@ -14,7 +14,7 @@ F debian/watch 34f0921ff100a3e16a7ad84dcc303731de830a60 | |||||||
| F dist/arch/PKGBUILD 26623327e467028a883cd13963daa36baf10dfa3 | F dist/arch/PKGBUILD 26623327e467028a883cd13963daa36baf10dfa3 | ||||||
| F dist/win/fuel.iss ef3558dbba409eb194938b930377fc9ee27d319e | F dist/win/fuel.iss ef3558dbba409eb194938b930377fc9ee27d319e | ||||||
| F doc/Building.md 149d959751ae488829e084a9f88449a08220c1d1 | F doc/Building.md 149d959751ae488829e084a9f88449a08220c1d1 | ||||||
| F doc/Changes.md 47e0d70b5b4ce6e11688a807952d72134d4ff643 | F doc/Changes.md d45c0401b93dbeeb2dad9c5f9ef36c27d15a10c5 | ||||||
| F doc/License.txt 4cc77b90af91e615a64ae04893fdffa7939db84c | F doc/License.txt 4cc77b90af91e615a64ae04893fdffa7939db84c | ||||||
| F ext/qtkeychain/CMakeLists.txt fc1afa05034f2765ba243ce758a7e9d6b6efe2d6 | F ext/qtkeychain/CMakeLists.txt fc1afa05034f2765ba243ce758a7e9d6b6efe2d6 | ||||||
| F ext/qtkeychain/COPYING d0f83c8198fdd5464d2373015b7b64ce7cae607e | F ext/qtkeychain/COPYING d0f83c8198fdd5464d2373015b7b64ce7cae607e | ||||||
| @@ -226,14 +226,14 @@ F src/FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8 | |||||||
| F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce | F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce | ||||||
| F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2 | F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2 | ||||||
| F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df | F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df | ||||||
| F src/Fossil.cpp 98a9f7032ef53eafb71fef41159ec97ca7d1008a | F src/Fossil.cpp a33ea0f0c6ac9af9a50bbb8eb0f00d014d742ae7 | ||||||
| F src/Fossil.h 0601beebc3c8cb11abb679691b94207a9a5c2f84 | F src/Fossil.h 7695ace9412a26c5498a4ebe69ab261f6d598d81 | ||||||
| F src/FslSettingsDialog.cpp e00907d493fba469e48a008aecda88426350b5ac | F src/FslSettingsDialog.cpp e00907d493fba469e48a008aecda88426350b5ac | ||||||
| F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7 | F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7 | ||||||
| F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c | F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c | ||||||
| F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 | F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 | ||||||
| F src/MainWindow.cpp 37bda20f00b73a2e2f7a170e5eb29749a06c7041 | F src/MainWindow.cpp 751deebc3a887701fb1712dfb10563537d7de14e | ||||||
| F src/MainWindow.h b358227a96adb3afdf10566367478d76283acc91 | F src/MainWindow.h fd8bb12f0bf49a6cb5ce9b875ad5277426380e3f | ||||||
| F src/RemoteDialog.cpp d5d39871f319bb760405736ba0caa9e83ec51ea3 | F src/RemoteDialog.cpp d5d39871f319bb760405736ba0caa9e83ec51ea3 | ||||||
| F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d | F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d | ||||||
| F src/RevisionDialog.cpp e58c4f8a704f00addebb15d521b76620fdafda79 | F src/RevisionDialog.cpp e58c4f8a704f00addebb15d521b76620fdafda79 | ||||||
| @@ -246,8 +246,8 @@ F src/SettingsDialog.cpp fa0c70eaf0fa7edb15de302d041cdb552fe523d5 | |||||||
| F src/SettingsDialog.h 5eb3ae2cbb00ab5544e1889860f5376f69fe47cd | F src/SettingsDialog.h 5eb3ae2cbb00ab5544e1889860f5376f69fe47cd | ||||||
| F src/Utils.cpp fb9fe1caeef47dca310079f8f10b41c838defaa5 | F src/Utils.cpp fb9fe1caeef47dca310079f8f10b41c838defaa5 | ||||||
| F src/Utils.h c52be757cd0045e34ab14c51f35a61af8f8870a4 | F src/Utils.h c52be757cd0045e34ab14c51f35a61af8f8870a4 | ||||||
| F src/Workspace.cpp 0548001c0975f84151dc93989cc03e4adaab48f5 | F src/Workspace.cpp aff5e81b1cf355b81a17a5e97a4b32a0f0bf9439 | ||||||
| F src/Workspace.h 50970993b6f49c0f4dc55ba5954e7e4c2a723539 | F src/Workspace.h 408ae0d52d5c17420a0add9b6fd5e0a7db3dc948 | ||||||
| F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0 | F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0 | ||||||
| F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x | F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x | ||||||
| F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x | F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x | ||||||
| @@ -257,11 +257,11 @@ F ui/CloneDialog.ui d02d2fc6356cb7ff88860c1a6963d882c444b030 | |||||||
| F ui/CommitDialog.ui 1e5dafa742e9ae07ec937bcda8cda3297ddc6199 | F ui/CommitDialog.ui 1e5dafa742e9ae07ec937bcda8cda3297ddc6199 | ||||||
| F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d | F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d | ||||||
| F ui/FslSettingsDialog.ui eb3d4cb764cab90b01e82922237d8c42d6ce1749 | F ui/FslSettingsDialog.ui eb3d4cb764cab90b01e82922237d8c42d6ce1749 | ||||||
| F ui/MainWindow.ui e2a18caa7482b3ee0dff477592cdc9574b35fe4f | F ui/MainWindow.ui ad04643d071fe513b46ef413749a493909a90ad1 | ||||||
| F ui/RemoteDialog.ui 424b2d4a3d0162f84fdccf6af02c1cfce07a06f5 | F ui/RemoteDialog.ui 424b2d4a3d0162f84fdccf6af02c1cfce07a06f5 | ||||||
| F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd | F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd | ||||||
| F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1 | F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1 | ||||||
| P eaec54a0320c199d5e1133b38acfafa3da82228e | P ee09b7f597c4ab4b81a24c281ab33893f3c20ed6 | ||||||
| R 8c5cc7026dce6c43c834603f6ffe3238 | R 045e3d666e9e7764e0e5696cec816ce6 | ||||||
| U Kostas | U Kostas | ||||||
| Z 456afb0a08b1115c953be0a118b74952 | Z 446f655f3a22f719427b796cf499616e | ||||||
|   | |||||||
| @@ -1 +1 @@ | |||||||
| ee09b7f597c4ab4b81a24c281ab33893f3c20ed6 | ea4b656b8237af73b81e6b22fd4c451a51450d2d | ||||||
| @@ -846,7 +846,6 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi | |||||||
|  |  | ||||||
| 		if(uiCallback->processAborted()) | 		if(uiCallback->processAborted()) | ||||||
| 		{ | 		{ | ||||||
| 			log("\n* "+QObject::tr("Terminated")+" *\n"); |  | ||||||
| 			#ifdef Q_OS_WIN		// Verify this is still true on Qt5 | 			#ifdef Q_OS_WIN		// Verify this is still true on Qt5 | ||||||
| 				process.kill(); // QT on windows cannot terminate console processes with QProcess::terminate | 				process.kill(); // QT on windows cannot terminate console processes with QProcess::terminate | ||||||
| 			#else | 			#else | ||||||
| @@ -891,7 +890,7 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi | |||||||
| 		//	qDebug() << "Breakpoint\n"; | 		//	qDebug() << "Breakpoint\n"; | ||||||
| 		#endif | 		#endif | ||||||
|  |  | ||||||
| 		QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); | 		QCoreApplication::processEvents(QEventLoop::AllEvents, 500); // 500 ms | ||||||
|  |  | ||||||
| 		if(buffer.isEmpty()) | 		if(buffer.isEmpty()) | ||||||
| 			continue; | 			continue; | ||||||
| @@ -1048,11 +1047,12 @@ bool Fossil::runFossilRaw(const QStringList &args, QStringList *output, int *exi | |||||||
| 	delete decoder; | 	delete decoder; | ||||||
|  |  | ||||||
| 	// Must be finished by now | 	// Must be finished by now | ||||||
|  | 	process.waitForFinished(5000); // Wait for termination 5 secs maximum | ||||||
| 	Q_ASSERT(process.state()==QProcess::NotRunning); | 	Q_ASSERT(process.state()==QProcess::NotRunning); | ||||||
|  |  | ||||||
| 	QProcess::ExitStatus es = process.exitStatus(); | 	QProcess::ExitStatus es = process.exitStatus(); | ||||||
|  |  | ||||||
| 	if(es!=QProcess::NormalExit) | 	if(es!=QProcess::NormalExit || uiCallback->processAborted()) | ||||||
| 		return false; | 		return false; | ||||||
|  |  | ||||||
| 	if(exitCode) | 	if(exitCode) | ||||||
|   | |||||||
| @@ -106,6 +106,7 @@ private: | |||||||
| 	void setRepositoryFile(const QString &filename) { repositoryFile = filename; } | 	void setRepositoryFile(const QString &filename) { repositoryFile = filename; } | ||||||
| 	bool runFossil(const QStringList &args, QStringList *output=0, int runFlags=RUNFLAGS_NONE); | 	bool runFossil(const QStringList &args, QStringList *output=0, int runFlags=RUNFLAGS_NONE); | ||||||
| 	bool runFossilRaw(const QStringList &args, QStringList *output, int *exitCode, int runFlags); | 	bool runFossilRaw(const QStringList &args, QStringList *output, int *exitCode, int runFlags); | ||||||
|  | 	QString	getFossilPath(); | ||||||
|  |  | ||||||
| 	void log(const QString &text, bool isHTML=false) | 	void log(const QString &text, bool isHTML=false) | ||||||
| 	{ | 	{ | ||||||
| @@ -113,8 +114,6 @@ private: | |||||||
| 			uiCallback->logText(text, isHTML); | 			uiCallback->logText(text, isHTML); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	QString	getFossilPath(); |  | ||||||
|  |  | ||||||
| 	UICallback			*uiCallback; | 	UICallback			*uiCallback; | ||||||
| 	QString				workspacePath; | 	QString				workspacePath; | ||||||
| 	QString				fossilPath;		// The value from the settings | 	QString				fossilPath;		// The value from the settings | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ | |||||||
| #include <QInputDialog> | #include <QInputDialog> | ||||||
| #include <QMimeData> | #include <QMimeData> | ||||||
| #include <QProgressBar> | #include <QProgressBar> | ||||||
|  | #include <QToolButton> | ||||||
| #include <QLabel> | #include <QLabel> | ||||||
| #include <QSettings> | #include <QSettings> | ||||||
| #include <QShortcut> | #include <QShortcut> | ||||||
| @@ -246,7 +247,7 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP | |||||||
| 	ui->statusBar->insertPermanentWidget(0, lblTags); | 	ui->statusBar->insertPermanentWidget(0, lblTags); | ||||||
| 	lblTags->setVisible(true); | 	lblTags->setVisible(true); | ||||||
|  |  | ||||||
| 	// Construct ProgressBar | 	// Create Progress Bar | ||||||
| 	progressBar = new QProgressBar(); | 	progressBar = new QProgressBar(); | ||||||
| 	progressBar->setMinimum(0); | 	progressBar->setMinimum(0); | ||||||
| 	progressBar->setMaximum(0); | 	progressBar->setMaximum(0); | ||||||
| @@ -256,6 +257,16 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP | |||||||
| 	ui->statusBar->insertPermanentWidget(1, progressBar); | 	ui->statusBar->insertPermanentWidget(1, progressBar); | ||||||
| 	progressBar->setVisible(false); | 	progressBar->setVisible(false); | ||||||
|  |  | ||||||
|  | 	// Create Abort Button | ||||||
|  | 	abortButton = new QToolButton(ui->statusBar); | ||||||
|  | 	abortButton->setAutoRaise(true); | ||||||
|  | 	abortButton->setIcon(getCachedIcon(":/icons/icon-action-stop")); | ||||||
|  | 	abortButton->setVisible(false); | ||||||
|  | 	abortButton->setArrowType(Qt::NoArrow); | ||||||
|  | 	abortButton->setToolButtonStyle(Qt::ToolButtonIconOnly); | ||||||
|  | 	abortButton->setDefaultAction(ui->actionAbortOperation); | ||||||
|  | 	ui->statusBar->insertPermanentWidget(2, abortButton); | ||||||
|  | 	ui->actionAbortOperation->setEnabled(false); | ||||||
|  |  | ||||||
| #ifdef Q_OS_MACX | #ifdef Q_OS_MACX | ||||||
| 	// Native applications on OSX don't have menu icons | 	// Native applications on OSX don't have menu icons | ||||||
| @@ -278,11 +289,6 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP | |||||||
| 	ui->tabWidget->setDocumentMode(true); | 	ui->tabWidget->setDocumentMode(true); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| 	abortShortcut = new QShortcut(QKeySequence("Escape"), this); |  | ||||||
| 	abortShortcut->setContext(Qt::ApplicationShortcut); |  | ||||||
| 	abortShortcut->setEnabled(false); |  | ||||||
| 	connect(abortShortcut, SIGNAL(activated()), this, SLOT(onAbort())); |  | ||||||
|  |  | ||||||
| 	// Searchbox | 	// Searchbox | ||||||
| 	// Add spacer to pad to right | 	// Add spacer to pad to right | ||||||
| 	QWidget* spacer = new QWidget(); | 	QWidget* spacer = new QWidget(); | ||||||
| @@ -736,8 +742,7 @@ bool MainWindow::scanWorkspace() | |||||||
| 								ui->actionViewModified->isChecked(), | 								ui->actionViewModified->isChecked(), | ||||||
| 								ui->actionViewUnchanged->isChecked(), | 								ui->actionViewUnchanged->isChecked(), | ||||||
| 								ignore_patterns, | 								ignore_patterns, | ||||||
| 								uiCallback, | 								uiCallback | ||||||
| 								operationAborted |  | ||||||
| 								); | 								); | ||||||
|  |  | ||||||
| 		// Build default versions list | 		// Build default versions list | ||||||
| @@ -2460,7 +2465,7 @@ void MainWindow::setBusy(bool busy) | |||||||
| 	else | 	else | ||||||
| 		QApplication::restoreOverrideCursor(); | 		QApplication::restoreOverrideCursor(); | ||||||
|  |  | ||||||
| 	abortShortcut->setEnabled(busy); | 	ui->actionAbortOperation->setEnabled(busy); | ||||||
| 	bool enabled = !busy; | 	bool enabled = !busy; | ||||||
| 	ui->menuBar->setEnabled(enabled); | 	ui->menuBar->setEnabled(enabled); | ||||||
| 	ui->mainToolBar->setEnabled(enabled); | 	ui->mainToolBar->setEnabled(enabled); | ||||||
| @@ -2468,7 +2473,7 @@ void MainWindow::setBusy(bool busy) | |||||||
| } | } | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| void MainWindow::onAbort() | void MainWindow::on_actionAbortOperation_triggered() | ||||||
| { | { | ||||||
| 	operationAborted = true; | 	operationAborted = true; | ||||||
| 	uiCallback.abortProcess(); | 	uiCallback.abortProcess(); | ||||||
| @@ -2498,6 +2503,8 @@ void MainWindow::MainWinUICallback::beginProcess(const QString& text) | |||||||
| 	mainWindow->ui->statusBar->showMessage(text); | 	mainWindow->ui->statusBar->showMessage(text); | ||||||
| 	mainWindow->lblTags->setHidden(true); | 	mainWindow->lblTags->setHidden(true); | ||||||
| 	mainWindow->progressBar->setHidden(false); | 	mainWindow->progressBar->setHidden(false); | ||||||
|  | 	mainWindow->abortButton->setHidden(false); | ||||||
|  | 	mainWindow->ui->actionAbortOperation->setEnabled(true); | ||||||
| 	QCoreApplication::processEvents(); | 	QCoreApplication::processEvents(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2516,6 +2523,8 @@ void MainWindow::MainWinUICallback::endProcess() | |||||||
| 	mainWindow->ui->statusBar->clearMessage(); | 	mainWindow->ui->statusBar->clearMessage(); | ||||||
| 	mainWindow->lblTags->setHidden(false); | 	mainWindow->lblTags->setHidden(false); | ||||||
| 	mainWindow->progressBar->setHidden(true); | 	mainWindow->progressBar->setHidden(true); | ||||||
|  | 	mainWindow->abortButton->setHidden(true); | ||||||
|  | 	mainWindow->ui->actionAbortOperation->setEnabled(false); | ||||||
| 	QCoreApplication::processEvents(); | 	QCoreApplication::processEvents(); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -75,7 +75,6 @@ private slots: | |||||||
| 	void onOpenRecent(); | 	void onOpenRecent(); | ||||||
| 	void onWorkspaceTreeViewSelectionChanged(const class QItemSelection &selected, const class QItemSelection &deselected); | 	void onWorkspaceTreeViewSelectionChanged(const class QItemSelection &selected, const class QItemSelection &deselected); | ||||||
| 	void onFileViewDragOut(); | 	void onFileViewDragOut(); | ||||||
| 	void onAbort(); |  | ||||||
| 	void onSearchBoxTextChanged(const QString &text); | 	void onSearchBoxTextChanged(const QString &text); | ||||||
| 	void onSearch(); | 	void onSearch(); | ||||||
| 	void onCustomActionTriggered(); | 	void onCustomActionTriggered(); | ||||||
| @@ -135,6 +134,7 @@ private slots: | |||||||
| 	void on_actionSetDefaultRemote_triggered(); | 	void on_actionSetDefaultRemote_triggered(); | ||||||
| 	void on_actionAddRemote_triggered(); | 	void on_actionAddRemote_triggered(); | ||||||
| 	void on_actionDeleteRemote_triggered(); | 	void on_actionDeleteRemote_triggered(); | ||||||
|  | 	void on_actionAbortOperation_triggered(); | ||||||
|  |  | ||||||
| private: | private: | ||||||
| 	class MainWinUICallback : public UICallback | 	class MainWinUICallback : public UICallback | ||||||
| @@ -178,8 +178,8 @@ private: | |||||||
| 	class QAction		*fileActionSeparator; | 	class QAction		*fileActionSeparator; | ||||||
| 	class QAction		*workspaceActionSeparator; | 	class QAction		*workspaceActionSeparator; | ||||||
| 	class QProgressBar	*progressBar; | 	class QProgressBar	*progressBar; | ||||||
|  | 	class QToolButton	*abortButton; | ||||||
| 	class QLabel		*lblTags; | 	class QLabel		*lblTags; | ||||||
| 	class QShortcut		*abortShortcut; |  | ||||||
| 	class SearchBox		*searchBox; | 	class SearchBox		*searchBox; | ||||||
| 	class QShortcut		*searchShortcut; | 	class QShortcut		*searchShortcut; | ||||||
| 	QMenu				*menuWorkspace; | 	QMenu				*menuWorkspace; | ||||||
|   | |||||||
| @@ -120,7 +120,7 @@ bool Workspace::switchWorkspace(const QString& workspace, QSettings &store) | |||||||
| } | } | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| bool Workspace::scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QStringList &ignorePatterns, const bool &abort, UICallback &uiCallback) | bool Workspace::scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QStringList &ignorePatterns, UICallback &uiCallback) | ||||||
| { | { | ||||||
| 	QDir dir(dirPath); | 	QDir dir(dirPath); | ||||||
|  |  | ||||||
| @@ -129,7 +129,7 @@ bool Workspace::scanDirectory(QFileInfoList &entries, const QString& dirPath, co | |||||||
| 	QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot); | 	QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot); | ||||||
| 	for (int i=0; i<list.count(); ++i) | 	for (int i=0; i<list.count(); ++i) | ||||||
| 	{ | 	{ | ||||||
| 		if(abort) | 		if(uiCallback.processAborted()) | ||||||
| 			return false; | 			return false; | ||||||
|  |  | ||||||
| 		QFileInfo info = list[i]; | 		QFileInfo info = list[i]; | ||||||
| @@ -143,7 +143,7 @@ bool Workspace::scanDirectory(QFileInfoList &entries, const QString& dirPath, co | |||||||
|  |  | ||||||
| 		if (info.isDir()) | 		if (info.isDir()) | ||||||
| 		{ | 		{ | ||||||
| 			if(!scanDirectory(entries, filepath, baseDir, ignorePatterns, abort, uiCallback)) | 			if(!scanDirectory(entries, filepath, baseDir, ignorePatterns, uiCallback)) | ||||||
| 				return false; | 				return false; | ||||||
| 		} | 		} | ||||||
| 		else | 		else | ||||||
| @@ -159,7 +159,7 @@ static bool StringLengthDescending(const QString &l, const QString &r) | |||||||
| } | } | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QStringList &ignorePatterns, UICallback &uiCallback, bool &operationAborted) | void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QStringList &ignorePatterns, UICallback &uiCallback) | ||||||
| { | { | ||||||
| 	// Scan all workspace files | 	// Scan all workspace files | ||||||
| 	QFileInfoList all_files; | 	QFileInfoList all_files; | ||||||
| @@ -179,8 +179,6 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie | |||||||
|  |  | ||||||
| 	QStringList paths; | 	QStringList paths; | ||||||
|  |  | ||||||
| 	operationAborted = false; |  | ||||||
|  |  | ||||||
| 	uiCallback.beginProcess(""); | 	uiCallback.beginProcess(""); | ||||||
| 	if(scan_files) | 	if(scan_files) | ||||||
| 	{ | 	{ | ||||||
| @@ -190,7 +188,7 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie | |||||||
| 		if(!scanIgnored) | 		if(!scanIgnored) | ||||||
| 			ignore = ignorePatterns; | 			ignore = ignorePatterns; | ||||||
|  |  | ||||||
| 		if(!scanDirectory(all_files, wkdir, wkdir, ignore, operationAborted, uiCallback)) | 		if(!scanDirectory(all_files, wkdir, wkdir, ignore, uiCallback)) | ||||||
| 			goto _done; | 			goto _done; | ||||||
|  |  | ||||||
| 		for(QFileInfoList::iterator it=all_files.begin(); it!=all_files.end(); ++it) | 		for(QFileInfoList::iterator it=all_files.begin(); it!=all_files.end(); ++it) | ||||||
|   | |||||||
| @@ -134,7 +134,7 @@ public: | |||||||
|  |  | ||||||
| 	const QString &		getPath() const { return fossil().getWorkspacePath(); } | 	const QString &		getPath() const { return fossil().getWorkspacePath(); } | ||||||
| 	bool				switchWorkspace(const QString &workspace, QSettings &store); | 	bool				switchWorkspace(const QString &workspace, QSettings &store); | ||||||
| 	void				scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QStringList& ignorePatterns, UICallback &uiCallback, bool &operationAborted); | 	void				scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QStringList& ignorePatterns, UICallback &uiCallback); | ||||||
|  |  | ||||||
| 	QStandardItemModel	&getFileModel() { return repoFileModel; } | 	QStandardItemModel	&getFileModel() { return repoFileModel; } | ||||||
| 	QStandardItemModel	&getTreeModel() { return repoTreeModel; } | 	QStandardItemModel	&getTreeModel() { return repoTreeModel; } | ||||||
| @@ -160,7 +160,7 @@ public: | |||||||
|  |  | ||||||
| 	void				storeWorkspace(QSettings &store); | 	void				storeWorkspace(QSettings &store); | ||||||
| private: | private: | ||||||
| 	static bool			scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QStringList& ignorePatterns, const bool& abort, UICallback &uiCallback); | 	static bool			scanDirectory(QFileInfoList &entries, const QString& dirPath, const QString &baseDir, const QStringList& ignorePatterns, UICallback &uiCallback); | ||||||
|  |  | ||||||
| private: | private: | ||||||
| 	Fossil				bridge; | 	Fossil				bridge; | ||||||
|   | |||||||
| @@ -222,7 +222,7 @@ | |||||||
|      <x>0</x> |      <x>0</x> | ||||||
|      <y>0</y> |      <y>0</y> | ||||||
|      <width>865</width> |      <width>865</width> | ||||||
|      <height>23</height> |      <height>21</height> | ||||||
|     </rect> |     </rect> | ||||||
|    </property> |    </property> | ||||||
|    <widget class="QMenu" name="menuFile"> |    <widget class="QMenu" name="menuFile"> | ||||||
| @@ -1047,6 +1047,21 @@ | |||||||
|     <string>Delete Remote</string> |     <string>Delete Remote</string> | ||||||
|    </property> |    </property> | ||||||
|   </action> |   </action> | ||||||
|  |   <action name="actionAbortOperation"> | ||||||
|  |    <property name="icon"> | ||||||
|  |     <iconset resource="../rsrc/resources.qrc"> | ||||||
|  |      <normaloff>:/icons/icon-action-stop</normaloff>:/icons/icon-action-stop</iconset> | ||||||
|  |    </property> | ||||||
|  |    <property name="text"> | ||||||
|  |     <string>abortOperation</string> | ||||||
|  |    </property> | ||||||
|  |    <property name="toolTip"> | ||||||
|  |     <string>Abort the current operation</string> | ||||||
|  |    </property> | ||||||
|  |    <property name="shortcut"> | ||||||
|  |     <string notr="true">Esc</string> | ||||||
|  |    </property> | ||||||
|  |   </action> | ||||||
|  </widget> |  </widget> | ||||||
|  <layoutdefault spacing="6" margin="11"/> |  <layoutdefault spacing="6" margin="11"/> | ||||||
|  <customwidgets> |  <customwidgets> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user