1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-25 05:29:31 +00:00

Implement the "configure" button in the asm/gen dialog

This commit is contained in:
Andy McFadden 2019-07-16 17:16:47 -07:00
parent 310ed7649b
commit 0ff2ebefdf
3 changed files with 23 additions and 10 deletions

View File

@ -52,6 +52,11 @@ namespace SourceGenWPF.AsmGen.WpfGui {
}
}
/// <summary>
/// Main controller object, used to open app settings dialog.
/// </summary>
private MainController mMainCtrl;
/// <summary>
/// Project with data.
/// </summary>
@ -107,10 +112,12 @@ namespace SourceGenWPF.AsmGen.WpfGui {
/// </summary>
/// <param name="project">Project reference.</param>
/// <param name="projectPathName">Full path to the project file.</param>
public GenAndAsm(Window owner, DisasmProject project, string projectPathName) {
public GenAndAsm(Window owner, MainController mainCtrl, DisasmProject project,
string projectPathName) {
InitializeComponent();
Owner = owner;
mMainCtrl = mainCtrl;
mProject = project;
mWorkDirectory = Path.GetDirectoryName(projectPathName);
mBaseFileName = Path.GetFileNameWithoutExtension(projectPathName);
@ -230,10 +237,8 @@ namespace SourceGenWPF.AsmGen.WpfGui {
private void AssemblerSettingsButton_Click(object sender, RoutedEventArgs e) {
// Pop open the app settings dialog, with the appropriate tab selected.
#if false
mMainCtrl.ShowAppSettings(AppForms.EditAppSettings.Tab.AsmConfig,
mMainCtrl.ShowAppSettings(this, EditAppSettings.Tab.AsmConfig,
mSelectedAssemblerId);
#endif
// Update the controls based on whether or not the assembler is now available.
UpdateAssemblerControls();

View File

@ -732,8 +732,8 @@ namespace SourceGenWPF {
mMainWin.CodeListView_SetTopIndex(topItemIndex);
mReanalysisTimer.EndTask("Restore selection and top position");
// Update the Notes and Symbols windows.
// TODO: references?
// Update the Notes and Symbols windows. References should refresh automatically
// when the selection is restored.
PopulateNotesList();
PopulateSymbolsList();
@ -1235,7 +1235,7 @@ namespace SourceGenWPF {
}
AsmGen.WpfGui.GenAndAsm dlg =
new AsmGen.WpfGui.GenAndAsm(mMainWin, mProject, mProjectPathName);
new AsmGen.WpfGui.GenAndAsm(mMainWin, this, mProject, mProjectPathName);
dlg.ShowDialog();
}
@ -1360,8 +1360,14 @@ namespace SourceGenWPF {
/// to the AppSettings.Global object.
/// </summary>
public void EditAppSettings() {
EditAppSettings dlg = new EditAppSettings(mMainWin, mMainWin, this,
WpfGui.EditAppSettings.Tab.Unknown, AsmGen.AssemblerInfo.Id.Unknown);
ShowAppSettings(mMainWin, WpfGui.EditAppSettings.Tab.Unknown,
AsmGen.AssemblerInfo.Id.Unknown);
}
public void ShowAppSettings(Window owner, EditAppSettings.Tab initialTab,
AsmGen.AssemblerInfo.Id initialAsmId) {
EditAppSettings dlg = new EditAppSettings(owner, mMainWin, this,
initialTab, initialAsmId);
dlg.ShowDialog();
}

View File

@ -171,7 +171,9 @@ namespace SourceGenWPF.Sandbox {
try {
lease.Unregister(this);
} catch (InvalidOperationException ex) {
// TODO: not expected -- why did this start happening?
// TODO(someday): not expected -- why did this start happening? (Might
// be related to the timer hack not being enabled during early stages of
// WPF port? Seems to have stopped.)
Debug.WriteLine("WARNING: lease.Unregister threw " + ex);
}
}