uppsrc2.diff

The diff file to apply for uppsrc directory (second version) - Sender Ghost, 11/05/2011 08:38 AM

Download (4.68 KB)

View differences:

uppsrc/ide/ide.h 2011-11-05 12:50:38 +0600
461 461
	virtual   void   FileSelected();
462 462
	virtual   void   Serialize(Stream& s);
463 463
	virtual   void   FileRename(const String& nm);
464
	virtual   bool   FileRemove();
464 465
	virtual   void   DragAndDrop(Point p, PasteClip& d);
465 466

  
466 467
	virtual   void      PutConsole(const char *s);
uppsrc/ide/idefile.cpp 2011-11-05 13:00:55 +0600
396 396
	tabs.RenameFile(editfile, nm);
397 397
}
398 398

  
399
bool Ide::FileRemove()
400
{
401
	int q = tabs.GetCursor();
402
	if(q >= 0) {
403
		tabs.CloseForce(q, false);
404
		if(filelist.GetCount())
405
			return true;
406
		if(tabs.GetCount())
407
			TabFile();
408
		else {
409
			tabs.Refresh();
410
			FlushFile();
411
		}
412
		return false;
413
	}
414
	return true;
415
}
416

  
399 417
void Ide::EditFile0(const String& path, byte charset, bool astext, const String& headername) {
400 418
	editor.CheckEdited(false);
401 419
	editor.CloseAssist();
uppsrc/ide/UppDlg.h 2011-11-05 13:19:58 +0600
173 173
	virtual void   SyncWorkspace()                    {}
174 174
	virtual void   FileSelected()                     {}
175 175
	virtual void   FileRename(const String& nm)       {}
176
	virtual bool   FileRemove()                       { return true; }
176 177
	virtual void   SyncSvnDir(const String& working)  {}
177 178

  
178 179
	void   ScanWorkspace();
......
205 206
	bool           IsSeparator(int i) const;
206 207

  
207 208
	void LoadActualPackage();
208
	void SaveLoadPackage();
209
	void SaveLoadPackageNS();
209
	void SaveLoadPackage(bool sel = true);
210
	void SaveLoadPackageNS(bool sel = true);
210 211
	void TouchFile(const String& path);
211 212

  
212 213
	void MoveFile(int d);
uppsrc/ide/UppWspc.cpp 2011-11-05 13:19:50 +0600
197 197
	}
198 198
}
199 199

  
200
void WorkspaceWork::SaveLoadPackageNS()
200
void WorkspaceWork::SaveLoadPackageNS(bool sel)
201 201
{
202 202
	SavePackage();
203 203
	String p = actualpackage;
......
209 209
	ScanWorkspace();
210 210
	package.SetSbPos(psc);
211 211
	package.FindSetCursor(p);
212
	filelist.SetSbPos(fsc);
213
	filelist.FindSetCursor(f);
212
	if (sel) {
213
		filelist.SetSbPos(fsc);
214
		filelist.FindSetCursor(f);
215
	}
214 216
}
215 217

  
216
void WorkspaceWork::SaveLoadPackage()
218
void WorkspaceWork::SaveLoadPackage(bool sel)
217 219
{
218
	SaveLoadPackageNS();
220
	SaveLoadPackageNS(sel);
219 221
	SyncWorkspace();
220 222
}
221 223

  
......
589 591
		actual.file.Remove(fx);
590 592
	}
591 593
	if(separator || IsAux())
592
		SaveLoadPackageNS();
594
		SaveLoadPackageNS(false);
593 595
	else
594
		SaveLoadPackage();
595
	filelist.SetSbPos(s);
596
	filelist.SetCursor(i);
596
		SaveLoadPackage(false);
597

  
598
	if (separator || FileRemove()) {
599
		filelist.SetSbPos(s);
600
		filelist.SetCursor(i);
601
	}
597 602
}
598 603

  
599 604
void WorkspaceWork::DelFile()
uppsrc/TabBar/TabBar.cpp 2011-11-05 11:55:43 +0600
393 393
void TabBar::ContextMenu(Bar& bar)
394 394
{
395 395
	if (highlight >= 0 && crosses) {
396
		bar.Add(tabs.GetCount() > mintabcount, t_("Close"), THISBACK1(Close, highlight));
396
		bar.Add(tabs.GetCount() > mintabcount, t_("Close"), THISBACK2(Close, highlight, true));
397 397
		bar.Separator();
398 398
	}
399 399
	int cnt = groups.GetCount();
......
2298 2298
	Repos();
2299 2299
}
2300 2300

  
2301
void TabBar::Close(int n)
2301
void TabBar::CloseForce(int n, bool action)
2302 2302
{
2303
	if(tabs.GetCount() <= mintabcount)
2304
		return;
2305

  
2306 2303
	if(n == active)
2307 2304
	{
2308 2305
		int c = FindId(tabs[n].id);
......
2317 2314
	Repos();
2318 2315
	
2319 2316
	if(n == active)
2320
		SetCursor(-1);
2317
		SetCursor0(-1, action);
2321 2318
	else {
2322 2319
		if (n < active)
2323 2320
			active--;
......
2332 2329
	}
2333 2330
}
2334 2331

  
2332
void TabBar::Close(int n, bool action)
2333
{
2334
	if(tabs.GetCount() <= mintabcount)
2335
		return;
2336

  
2337
	CloseForce(n, action);
2338
}
2339

  
2335 2340
void TabBar::CloseKey(const Value &key)
2336 2341
{
2337 2342
	int tabix = FindKey(key);
uppsrc/TabBar/TabBar.h 2011-11-05 11:53:42 +0600
394 394
	TabBar& AddKey(const Value& key, const Value& value, Image icon = Null, String group = Null, bool make_active = false);
395 395
	TabBar& InsertKey(int ix, const Value& key, const Value& value, Image icon = Null, String group = Null, bool make_active = false);
396 396
	
397
	void 	Close(int n);
397
	void 	CloseForce(int n, bool action = true);
398
	void 	Close(int n, bool action = true);
398 399
	void 	CloseKey(const Value& key);
399 400
	void 	Clear();
400 401