Goodbye Stash View
Working stash management in Workspace view FossilOrigin-Name: 1b0d47442df7a239ed11a048bde0073603b514f1
This commit is contained in:
		
							
								
								
									
										18
									
								
								manifest
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								manifest
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | ||||
| C Fixed\sgetSelectionPaths\n | ||||
| D 2015-05-01T19:13:19.529 | ||||
| C Goodbye\sStash\sView\nWorking\sstash\smanagement\sin\sWorkspace\sview | ||||
| D 2015-05-01T19:29:12.162 | ||||
| F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 | ||||
| F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b | ||||
| F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b | ||||
| @@ -200,14 +200,14 @@ F src/Fossil.cpp b54d136f05764535636da04bcc5f60b2eb97e5b6 | ||||
| F src/Fossil.h e46ec6cdb5c23a34176050fbd90e561ac87c07f9 | ||||
| F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c | ||||
| F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 | ||||
| F src/MainWindow.cpp bdaa3a5c8dc96bc480bd8ee979abec791be403b2 | ||||
| F src/MainWindow.h 5e0b71e6b795c32ae4207ffb44aa056b52674a10 | ||||
| F src/MainWindow.cpp 50bcfea121159016f6658abcece3208b6cbc6419 | ||||
| F src/MainWindow.h d21a0e993f44dfa6c751613fc07325ec287a58cf | ||||
| F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4 | ||||
| F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43 | ||||
| F src/Utils.cpp f78728e0817b1db23007ba0d2c5c26980ee7ebca | ||||
| F src/Utils.h 8ad68bd227bd999eb6ea92a70bb4be2d6788d912 | ||||
| F src/Workspace.cpp 114daa2d44228ac253056fdf74a45e977d181475 | ||||
| F src/Workspace.h 9f1d34320abb378ae5a6e3360f8c8a5949029b88 | ||||
| F src/Workspace.h 28e8e466df6ddce0bb80e8c9dbec7355d53f2c78 | ||||
| F src/main.cpp 2ac8badc2a63fa123ceae53382ce24cfe1b5a54b | ||||
| F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x | ||||
| F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x | ||||
| @@ -215,9 +215,9 @@ F ui/BrowserWidget.ui 5ad98b13773afadb20a1a2c22148aaebe5dbd95d | ||||
| F ui/CloneDialog.ui 4886e7d4f258ea8b852b5eefc860396e35145712 | ||||
| F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f | ||||
| F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d | ||||
| F ui/MainWindow.ui ef46a06e46eb465703a8b7353b079c2e538104d7 | ||||
| F ui/MainWindow.ui b735238428bad38bbb5c03e09975e5bb0fa156ab | ||||
| F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b | ||||
| P 63b2c047630f4f14ee0c1bd398d5df61433827dc | ||||
| R e18f69554275572e3401b0b43d69aa3d | ||||
| P 268641002b332e82e893dacce6698a2c298c4f98 | ||||
| R 88c5523fcc03ef8f78e0d4bd0720be73 | ||||
| U kostas | ||||
| Z c73159632c41ad626bc86208beab1c49 | ||||
| Z ce07e9006ea4abb3d7459eb4c758192a | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| 268641002b332e82e893dacce6698a2c298c4f98 | ||||
| 1b0d47442df7a239ed11a048bde0073603b514f1 | ||||
| @@ -169,13 +169,6 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP | ||||
| 	menuWorkspace->addAction(ui->actionRenameFolder); | ||||
| 	menuWorkspace->addAction(ui->actionOpenFolder); | ||||
|  | ||||
| 	// StashView | ||||
| 	ui->stashTableView->setModel(&getWorkspace().getStashModel()); | ||||
| 	ui->stashTableView->addAction(ui->actionApplyStash); | ||||
| 	ui->stashTableView->addAction(ui->actionDiffStash); | ||||
| 	ui->stashTableView->addAction(ui->actionDeleteStash); | ||||
| 	ui->stashTableView->horizontalHeader()->setSortIndicatorShown(false); | ||||
|  | ||||
| 	// StashMenu | ||||
| 	menuStashes = new QMenu(this); | ||||
| 	menuStashes->addAction(ui->actionApplyStash); | ||||
| @@ -608,7 +601,6 @@ void MainWindow::scanWorkspace() | ||||
| 							); | ||||
| 	updateDirView(); | ||||
| 	updateFileView(); | ||||
| 	updateStashView(); | ||||
|  | ||||
| 	setBusy(false); | ||||
| 	setStatus(""); | ||||
| @@ -790,25 +782,6 @@ void MainWindow::updateFileView() | ||||
| 	ui->fileTableView->resizeRowsToContents(); | ||||
| } | ||||
|  | ||||
| //------------------------------------------------------------------------------ | ||||
| void MainWindow::updateStashView() | ||||
| { | ||||
| 	getWorkspace().getStashModel().clear(); | ||||
|  | ||||
| 	QStringList header; | ||||
| 	header << tr("Stashes"); | ||||
| 	getWorkspace().getStashModel().setHorizontalHeaderLabels(header); | ||||
|  | ||||
| 	for(stashmap_t::iterator it=getWorkspace().getStashes().begin(); it!=getWorkspace().getStashes().end(); ++it) | ||||
| 	{ | ||||
| 		QStandardItem *item = new QStandardItem(it.key()); | ||||
| 		item->setToolTip(it.key()); | ||||
| 		getWorkspace().getStashModel().appendRow(item); | ||||
| 	} | ||||
| 	ui->stashTableView->resizeColumnsToContents(); | ||||
| 	ui->stashTableView->resizeRowsToContents(); | ||||
| } | ||||
|  | ||||
| //------------------------------------------------------------------------------ | ||||
| void MainWindow::log(const QString &text, bool isHTML) | ||||
| { | ||||
| @@ -907,11 +880,6 @@ void MainWindow::applySettings() | ||||
| 		viewMode = store->value("ViewAsList").toBool()? VIEWMODE_LIST : VIEWMODE_TREE; | ||||
| 	} | ||||
| 	//ui->workspaceTreeView->setVisible(viewMode == VIEWMODE_TREE); | ||||
|  | ||||
| 	if(store->contains("ViewStash")) | ||||
| 		ui->actionViewStash->setChecked(store->value("ViewStash").toBool()); | ||||
| 	ui->stashTableView->setVisible(ui->actionViewStash->isChecked()); | ||||
|  | ||||
| } | ||||
|  | ||||
| //------------------------------------------------------------------------------ | ||||
| @@ -1104,25 +1072,23 @@ void MainWindow::getFileViewSelection(QStringList &filenames, int includeMask, b | ||||
| 	} | ||||
| } | ||||
| //------------------------------------------------------------------------------ | ||||
| void MainWindow::getStashViewSelection(QStringList &stashNames, bool allIfEmpty) | ||||
| void MainWindow::getStashViewSelection(QStringList &stashNames) | ||||
| { | ||||
| 	QModelIndexList selection = ui->stashTableView->selectionModel()->selectedIndexes(); | ||||
| 	if(selection.empty() && allIfEmpty) | ||||
| 	{ | ||||
| 		ui->stashTableView->selectAll(); | ||||
| 		selection = ui->stashTableView->selectionModel()->selectedIndexes(); | ||||
| 		ui->stashTableView->clearSelection(); | ||||
| 	} | ||||
| 	QModelIndexList selection = ui->workspaceTreeView->selectionModel()->selectedIndexes(); | ||||
|  | ||||
| 	for(QModelIndexList::iterator mi_it = selection.begin(); mi_it!=selection.end(); ++mi_it) | ||||
| 	foreach(const QModelIndex &mi, selection) | ||||
| 	{ | ||||
| 		const QModelIndex &mi = *mi_it; | ||||
| 		QVariant data = mi.model()->data(mi, REPODIRMODEL_ROLE_PATH); | ||||
| 		Q_ASSERT(data.isValid()); | ||||
| 		TreeViewItem tv = data.value<TreeViewItem>(); | ||||
|  | ||||
| 		if(mi.column()!=0) | ||||
| 		if(tv.Type != TreeViewItem::TYPE_STASH) | ||||
| 			continue; | ||||
| 		QString name = getWorkspace().getStashModel().data(mi).toString(); | ||||
|  | ||||
| 		QString name = mi.model()->data(mi, Qt::DisplayRole).toString(); | ||||
| 		stashNames.append(name); | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
| //------------------------------------------------------------------------------ | ||||
| @@ -1625,8 +1591,6 @@ void MainWindow::onWorkspaceTreeViewSelectionChanged(const QItemSelection &/*sel | ||||
|  | ||||
| 	foreach(const QModelIndex &id, indices) | ||||
| 	{ | ||||
| 		Q_ASSERT(ui->workspaceTreeView->model()==&getWorkspace().getDirModel()); | ||||
| 		//QVariant data = getWorkspace().getDirModel().data(id, REPODIRMODEL_ROLE_PATH); | ||||
| 		QVariant data = id.model()->data(id, REPODIRMODEL_ROLE_PATH); | ||||
| 		Q_ASSERT(data.isValid()); | ||||
| 		TreeViewItem tv = data.value<TreeViewItem>(); | ||||
| @@ -1843,12 +1807,6 @@ QMenu * MainWindow::createPopupMenu() | ||||
| 	return NULL; | ||||
| } | ||||
|  | ||||
| //------------------------------------------------------------------------------ | ||||
| void MainWindow::on_actionViewStash_triggered() | ||||
| { | ||||
| 	ui->stashTableView->setVisible(ui->actionViewStash->isChecked()); | ||||
| } | ||||
|  | ||||
| //------------------------------------------------------------------------------ | ||||
| void MainWindow::on_actionNewStash_triggered() | ||||
| { | ||||
|   | ||||
| @@ -36,7 +36,7 @@ private: | ||||
| 	void getSelectionFilenames(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL, bool allIfEmpty=false); | ||||
| 	void getFileViewSelection(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL, bool allIfEmpty=false); | ||||
| 	void getDirViewSelection(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL, bool allIfEmpty=false); | ||||
| 	void getStashViewSelection(QStringList &stashNames, bool allIfEmpty=false); | ||||
| 	void getStashViewSelection(QStringList &stashNames); | ||||
| 	void getSelectionPaths(stringset_t &paths); | ||||
| 	void getAllFilenames(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL); | ||||
| 	bool startUI(); | ||||
| @@ -49,7 +49,6 @@ private: | ||||
| 	QString getFossilHttpAddress(); | ||||
| 	void updateDirView(); | ||||
| 	void updateFileView(); | ||||
| 	void updateStashView(); | ||||
| 	void selectRootDir(); | ||||
| 	void fossilBrowse(const QString &fossilUrl); | ||||
| 	void dragEnterEvent(class QDragEnterEvent *event); | ||||
| @@ -105,7 +104,6 @@ private slots: | ||||
| 	void on_actionOpenRepository_triggered(); | ||||
| 	void on_actionCloseRepository_triggered(); | ||||
| 	void on_actionCloneRepository_triggered(); | ||||
| 	void on_actionViewStash_triggered(); | ||||
| 	void on_actionNewStash_triggered(); | ||||
| 	void on_actionApplyStash_triggered(); | ||||
| 	void on_actionDeleteStash_triggered(); | ||||
|   | ||||
| @@ -116,7 +116,7 @@ public: | ||||
|  | ||||
| 	QStandardItemModel	&getFileModel() { return repoFileModel; } | ||||
| 	QStandardItemModel	&getDirModel() { return repoDirModel; } | ||||
| 	QStandardItemModel	&getStashModel() { return repoStashModel; } | ||||
|  | ||||
| 	filemap_t			&getFiles() { return workspaceFiles; } | ||||
| 	stringset_t			&getPaths() { return pathSet; } | ||||
| 	stashmap_t			&getStashes() { return stashMap; } | ||||
| @@ -129,7 +129,6 @@ private: | ||||
|  | ||||
| 	QStandardItemModel	repoFileModel; | ||||
| 	QStandardItemModel	repoDirModel; | ||||
| 	QStandardItemModel	repoStashModel; | ||||
| }; | ||||
|  | ||||
| #endif // WORKSPACE_H | ||||
|   | ||||
| @@ -140,44 +140,6 @@ | ||||
|          <number>30</number> | ||||
|         </attribute> | ||||
|        </widget> | ||||
|        <widget class="QTableView" name="stashTableView"> | ||||
|         <property name="sizePolicy"> | ||||
|          <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> | ||||
|           <horstretch>20</horstretch> | ||||
|           <verstretch>0</verstretch> | ||||
|          </sizepolicy> | ||||
|         </property> | ||||
|         <property name="contextMenuPolicy"> | ||||
|          <enum>Qt::ActionsContextMenu</enum> | ||||
|         </property> | ||||
|         <property name="editTriggers"> | ||||
|          <set>QAbstractItemView::NoEditTriggers</set> | ||||
|         </property> | ||||
|         <property name="alternatingRowColors"> | ||||
|          <bool>true</bool> | ||||
|         </property> | ||||
|         <property name="selectionBehavior"> | ||||
|          <enum>QAbstractItemView::SelectRows</enum> | ||||
|         </property> | ||||
|         <property name="showGrid"> | ||||
|          <bool>false</bool> | ||||
|         </property> | ||||
|         <property name="sortingEnabled"> | ||||
|          <bool>true</bool> | ||||
|         </property> | ||||
|         <property name="wordWrap"> | ||||
|          <bool>false</bool> | ||||
|         </property> | ||||
|         <attribute name="horizontalHeaderHighlightSections"> | ||||
|          <bool>false</bool> | ||||
|         </attribute> | ||||
|         <attribute name="horizontalHeaderStretchLastSection"> | ||||
|          <bool>true</bool> | ||||
|         </attribute> | ||||
|         <attribute name="verticalHeaderVisible"> | ||||
|          <bool>false</bool> | ||||
|         </attribute> | ||||
|        </widget> | ||||
|       </widget> | ||||
|       <widget class="QTabWidget" name="tabWidget"> | ||||
|        <property name="sizePolicy"> | ||||
| @@ -190,7 +152,7 @@ | ||||
|         <enum>QTabWidget::South</enum> | ||||
|        </property> | ||||
|        <property name="currentIndex"> | ||||
|         <number>1</number> | ||||
|         <number>0</number> | ||||
|        </property> | ||||
|        <widget class="QWidget" name="tabLog"> | ||||
|         <attribute name="title"> | ||||
| @@ -296,8 +258,6 @@ | ||||
|     <addaction name="actionViewUnknown"/> | ||||
|     <addaction name="actionViewIgnored"/> | ||||
|     <addaction name="separator"/> | ||||
|     <addaction name="actionViewStash"/> | ||||
|     <addaction name="separator"/> | ||||
|     <addaction name="actionViewAsList"/> | ||||
|    </widget> | ||||
|    <addaction name="menuFile"/> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user