Remember the last source location path chosen by the user.

- When the user chooses the location of a source file via the file panel,
  we now preserve the file panel so it can remember its previous location
  when invoked again.

Resolves the other part of #8095.
This commit is contained in:
Rene Gollent
2011-11-13 20:19:10 -05:00
parent f7337f78ee
commit 72d140460d
2 changed files with 15 additions and 8 deletions
@@ -1,6 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, [email protected]. * Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2010, Rene Gollent, [email protected]. * Copyright 2010-2011, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -107,7 +107,8 @@ TeamWindow::TeamWindow(::Team* team, UserInterfaceListener* listener)
fRunButton(NULL), fRunButton(NULL),
fStepOverButton(NULL), fStepOverButton(NULL),
fStepIntoButton(NULL), fStepIntoButton(NULL),
fStepOutButton(NULL) fStepOutButton(NULL),
fSourceLocatePanel(NULL)
{ {
fTeam->Lock(); fTeam->Lock();
BString name = fTeam->Name(); BString name = fTeam->Name();
@@ -138,6 +139,8 @@ TeamWindow::~TeamWindow()
_SetActiveStackTrace(NULL); _SetActiveStackTrace(NULL);
_SetActiveImage(NULL); _SetActiveImage(NULL);
_SetActiveThread(NULL); _SetActiveThread(NULL);
delete fSourceLocatePanel;
} }
@@ -247,13 +250,15 @@ TeamWindow::MessageReceived(BMessage* message)
&& fActiveFunction->GetFunctionDebugInfo() && fActiveFunction->GetFunctionDebugInfo()
->SourceFile() != NULL && fActiveSourceCode != NULL ->SourceFile() != NULL && fActiveSourceCode != NULL
&& fActiveSourceCode->GetSourceFile() == NULL) { && fActiveSourceCode->GetSourceFile() == NULL) {
BFilePanel* panel = NULL;
try { try {
panel = new BFilePanel(B_OPEN_PANEL, if (fSourceLocatePanel == NULL) {
new BMessenger(this)); fSourceLocatePanel = new BFilePanel(B_OPEN_PANEL,
panel->Show(); new BMessenger(this));
}
fSourceLocatePanel->Show();
} catch (...) { } catch (...) {
delete panel; delete fSourceLocatePanel;
fSourceLocatePanel = NULL;
} }
} }
break; break;
@@ -1,6 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, [email protected]. * Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2010, Rene Gollent, [email protected]. * Copyright 2010-2011, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef TEAM_WINDOW_H #ifndef TEAM_WINDOW_H
@@ -24,6 +24,7 @@
class BButton; class BButton;
class BFilePanel;
class BMenuBar; class BMenuBar;
class BSplitView; class BSplitView;
class BStringView; class BStringView;
@@ -185,6 +186,7 @@ private:
BSplitView* fThreadSplitView; BSplitView* fThreadSplitView;
InspectorWindow* fInspectorWindow; InspectorWindow* fInspectorWindow;
GUITeamUISettings fUISettings; GUITeamUISettings fUISettings;
BFilePanel* fSourceLocatePanel;
}; };