|
@@ -44,11 +44,10 @@ ProgramOptions *programoptions;
|
|
|
|
|
|
void ProjectOptions::init()
|
|
|
{
|
|
|
+ //Create the Program Options dialog
|
|
|
+ programoptions=new ProgramOptions(this);
|
|
|
//Toggle controls to match settings.
|
|
|
ImportSettings();
|
|
|
- //Create the Program Options dialog and toggle its controls
|
|
|
- programoptions=new ProgramOptions(this);
|
|
|
- programoptions->ImportSettings();
|
|
|
//Update stuff
|
|
|
CheckOncalcNames();
|
|
|
UpdateVisibilities();
|
|
@@ -56,11 +55,10 @@ void ProjectOptions::init()
|
|
|
|
|
|
void ProjectOptions::destroy()
|
|
|
{
|
|
|
- delete(programoptions);
|
|
|
- if (result()!=QDialog::Accepted)
|
|
|
- return;
|
|
|
//Save settings
|
|
|
- ExportSettings();
|
|
|
+ if (result()==QDialog::Accepted)
|
|
|
+ ExportSettings();
|
|
|
+ delete(programoptions);
|
|
|
}
|
|
|
|
|
|
void ProjectOptions::ImportSettings(void)
|
|
@@ -111,45 +109,27 @@ void ProjectOptions::ImportSettings(void)
|
|
|
GCCSwitches->setText(settings.cc_switches);
|
|
|
AsSwitches->setText(settings.as_switches);
|
|
|
A68kSwitches->setText(settings.a68k_switches);
|
|
|
- if (settings.debug_info)
|
|
|
- GenerateDebugInformation->setChecked(TRUE);
|
|
|
+ GenerateDebugInformation->setChecked(settings.debug_info);
|
|
|
//Tab: Linking
|
|
|
- if (settings.optimize_nops)
|
|
|
- NOPs->setChecked(TRUE);
|
|
|
- if (settings.optimize_returns)
|
|
|
- ReturnSequences->setChecked(TRUE);
|
|
|
- if (settings.optimize_branches)
|
|
|
- Branches->setChecked(TRUE);
|
|
|
- if (settings.optimize_moves)
|
|
|
- MoveLoadPushInstructions->setChecked(TRUE);
|
|
|
- if (settings.optimize_tests)
|
|
|
- TestCompareInstructions->setChecked(TRUE);
|
|
|
- if (settings.optimize_calcs)
|
|
|
- CalculationInstructions->setChecked(TRUE);
|
|
|
- if (settings.remove_unused)
|
|
|
- RemoveUnusedSections->setChecked(TRUE);
|
|
|
- if (settings.reorder_sections)
|
|
|
- ReorderSections->setChecked(TRUE);
|
|
|
- if (settings.cut_ranges)
|
|
|
- CutUnusedRanges->setChecked(TRUE);
|
|
|
- if (settings.merge_constants)
|
|
|
- MergeConstants->setChecked(TRUE);
|
|
|
- if (settings.std_lib)
|
|
|
- LinkAgainstStandardLibrary->setChecked(TRUE);
|
|
|
- if (settings.initialize_bss)
|
|
|
- InitializeBSSSection->setChecked(TRUE);
|
|
|
- if (settings.outputbin)
|
|
|
- OutputVariableImageWithoutWrapper->setChecked(TRUE);
|
|
|
+ NOPs->setChecked(settings.optimize_nops);
|
|
|
+ ReturnSequences->setChecked(settings.optimize_returns);
|
|
|
+ Branches->setChecked(settings.optimize_branches);
|
|
|
+ MoveLoadPushInstructions->setChecked(settings.optimize_moves);
|
|
|
+ TestCompareInstructions->setChecked(settings.optimize_tests);
|
|
|
+ CalculationInstructions->setChecked(settings.optimize_calcs);
|
|
|
+ RemoveUnusedSections->setChecked(settings.remove_unused);
|
|
|
+ ReorderSections->setChecked(settings.reorder_sections);
|
|
|
+ CutUnusedRanges->setChecked(settings.cut_ranges);
|
|
|
+ MergeConstants->setChecked(settings.merge_constants);
|
|
|
+ LinkAgainstStandardLibrary->setChecked(settings.std_lib);
|
|
|
+ InitializeBSSSection->setChecked(settings.initialize_bss);
|
|
|
+ OutputVariableImageWithoutWrapper->setChecked(settings.outputbin);
|
|
|
//Tab: Post-Build
|
|
|
CallAfterBuilding->setText(settings.post_build);
|
|
|
Parameters->setText(settings.cmd_line);
|
|
|
+ programoptions->ImportSettings();
|
|
|
}
|
|
|
|
|
|
-#define ExportCheckbox(checkwidget,settingvariable) if (checkwidget->isOn()) \
|
|
|
-settings.settingvariable=TRUE; \
|
|
|
-else \
|
|
|
-settings.settingvariable=FALSE;
|
|
|
-
|
|
|
void ProjectOptions::ExportSettings(void)
|
|
|
{
|
|
|
//Tab: General
|
|
@@ -158,28 +138,28 @@ void ProjectOptions::ExportSettings(void)
|
|
|
settings.archive=FALSE;
|
|
|
settings.use_data_var=FALSE;
|
|
|
settings.pack=FALSE;
|
|
|
- if (FargoProgram->isOn())
|
|
|
+ if (FargoProgram->isChecked())
|
|
|
settings.fargo=TRUE;
|
|
|
- else if (FlashOperatingSystem->isOn())
|
|
|
+ else if (FlashOperatingSystem->isChecked())
|
|
|
settings.flash_os=TRUE;
|
|
|
- else if (FunctionArchive->isOn())
|
|
|
+ else if (FunctionArchive->isChecked())
|
|
|
settings.archive=TRUE;
|
|
|
- else if (RegularProgram->isOn()) //the original TIGCC IDE automatically unchecked External data variable and Compress program when you toggled away from Regular Program, so we will only consider these two if Regular Program is toggled
|
|
|
+ else if (RegularProgram->isChecked()) //the original TIGCC IDE automatically unchecked External data variable and Compress program when you toggled away from Regular Program, so we will only consider these two if Regular Program is toggled
|
|
|
{
|
|
|
- if (ExternalDataVariable->isOn())
|
|
|
+ if (ExternalDataVariable->isChecked())
|
|
|
settings.use_data_var=TRUE;
|
|
|
- if (CompressProgram->isOn())
|
|
|
+ if (CompressProgram->isChecked())
|
|
|
settings.pack=TRUE;
|
|
|
}
|
|
|
//Subselections for External data variable and Compress program are always preserved.
|
|
|
settings.data_var=OncalcVariableName_1->text();
|
|
|
settings.copy_data_var_arc=FALSE;
|
|
|
- if (CreateCopyNever->isOn())
|
|
|
+ if (CreateCopyNever->isChecked())
|
|
|
settings.copy_data_var=FALSE;
|
|
|
else
|
|
|
{
|
|
|
settings.copy_data_var=TRUE;
|
|
|
- if (CreateCopyIfArchived->isOn())
|
|
|
+ if (CreateCopyIfArchived->isChecked())
|
|
|
settings.copy_data_var_arc=TRUE;
|
|
|
}
|
|
|
settings.pack_name=OncalcVariableName_2->text();
|
|
@@ -187,51 +167,43 @@ void ProjectOptions::ExportSettings(void)
|
|
|
settings.cc_switches=GCCSwitches->text();
|
|
|
settings.as_switches=AsSwitches->text();
|
|
|
settings.a68k_switches=A68kSwitches->text();
|
|
|
- ExportCheckbox(GenerateDebugInformation,debug_info);
|
|
|
+ settings.debug_info=GenerateDebugInformation->isChecked();
|
|
|
//Tab: Linking
|
|
|
- ExportCheckbox(NOPs,optimize_nops);
|
|
|
- ExportCheckbox(ReturnSequences,optimize_returns);
|
|
|
- ExportCheckbox(Branches,optimize_branches);
|
|
|
- ExportCheckbox(MoveLoadPushInstructions,optimize_moves);
|
|
|
- ExportCheckbox(TestCompareInstructions,optimize_tests);
|
|
|
- ExportCheckbox(CalculationInstructions,optimize_calcs);
|
|
|
- ExportCheckbox(RemoveUnusedSections,remove_unused);
|
|
|
- ExportCheckbox(ReorderSections,reorder_sections);
|
|
|
- ExportCheckbox(CutUnusedRanges,cut_ranges);
|
|
|
- ExportCheckbox(MergeConstants,merge_constants);
|
|
|
- ExportCheckbox(LinkAgainstStandardLibrary,std_lib);
|
|
|
- ExportCheckbox(InitializeBSSSection,initialize_bss);
|
|
|
- ExportCheckbox(OutputVariableImageWithoutWrapper,outputbin);
|
|
|
+ settings.optimize_nops=NOPs->isChecked();
|
|
|
+ settings.optimize_returns=ReturnSequences->isChecked();
|
|
|
+ settings.optimize_branches=Branches->isChecked();
|
|
|
+ settings.optimize_moves=MoveLoadPushInstructions->isChecked();
|
|
|
+ settings.optimize_tests=TestCompareInstructions->isChecked();
|
|
|
+ settings.optimize_calcs=CalculationInstructions->isChecked();
|
|
|
+ settings.remove_unused=RemoveUnusedSections->isChecked();
|
|
|
+ settings.reorder_sections=ReorderSections->isChecked();
|
|
|
+ settings.cut_ranges=CutUnusedRanges->isChecked();
|
|
|
+ settings.merge_constants=MergeConstants->isChecked();
|
|
|
+ settings.std_lib=LinkAgainstStandardLibrary->isChecked();
|
|
|
+ settings.initialize_bss=InitializeBSSSection->isChecked();
|
|
|
+ settings.outputbin=OutputVariableImageWithoutWrapper->isChecked();
|
|
|
//Tab: Post-Build
|
|
|
settings.post_build=CallAfterBuilding->text();
|
|
|
settings.cmd_line=Parameters->text();
|
|
|
+ programoptions->ExportSettings();
|
|
|
}
|
|
|
-#undef ExportCheckbox
|
|
|
|
|
|
-void ProjectOptions::RegularProgramToggle()
|
|
|
+void ProjectOptions::RegularProgram_toggled(bool state)
|
|
|
{
|
|
|
- int state;
|
|
|
- buttonOk->setAccel(0);
|
|
|
- buttonOk->setText("OK");
|
|
|
- state=RegularProgram->isOn()?TRUE:FALSE;
|
|
|
if (!state)
|
|
|
{
|
|
|
- if (ExternalDataVariable->isOn())
|
|
|
- ExternalDataVariable->setChecked(TRUE);
|
|
|
- if (CompressProgram->isOn())
|
|
|
- CompressProgram->setChecked(TRUE);
|
|
|
+ ExternalDataVariable->setChecked(FALSE);
|
|
|
+ CompressProgram->setChecked(FALSE);
|
|
|
+ ExternalDataVariable_toggled(FALSE);
|
|
|
+ CompressProgram_toggled(FALSE);
|
|
|
}
|
|
|
ExternalDataVariable->setEnabled(state);
|
|
|
CompressProgram->setEnabled(state);
|
|
|
- ExternalDataVariableToggle();
|
|
|
- CompressProgramToggle();
|
|
|
}
|
|
|
|
|
|
|
|
|
-void ProjectOptions::ExternalDataVariableToggle()
|
|
|
+void ProjectOptions::ExternalDataVariable_toggled(bool state)
|
|
|
{
|
|
|
- int state;
|
|
|
- state=ExternalDataVariable->isOn()?TRUE:FALSE;
|
|
|
LOncalcVariableName_1->setEnabled(state);
|
|
|
OncalcVariableName_1->setEnabled(state);
|
|
|
LCreateCopyNever->setEnabled(state);
|
|
@@ -242,10 +214,8 @@ void ProjectOptions::ExternalDataVariableToggle()
|
|
|
}
|
|
|
|
|
|
|
|
|
-void ProjectOptions::CompressProgramToggle()
|
|
|
+void ProjectOptions::CompressProgram_toggled(bool state)
|
|
|
{
|
|
|
- int state;
|
|
|
- state=CompressProgram->isOn()?TRUE:FALSE;
|
|
|
LOncalcVariableName_2->setEnabled(state);
|
|
|
OncalcVariableName_2->setEnabled(state);
|
|
|
CheckOncalcNames();
|
|
@@ -267,8 +237,8 @@ void ProjectOptions::CheckOncalcNames()
|
|
|
|
|
|
void ProjectOptions::UpdateVisibilities()
|
|
|
{
|
|
|
- Boolean regularprogram=RegularProgram->isOn();
|
|
|
- Boolean functionarchive=FunctionArchive->isOn();
|
|
|
+ Boolean regularprogram=RegularProgram->isChecked();
|
|
|
+ Boolean functionarchive=FunctionArchive->isChecked();
|
|
|
if (regularprogram)
|
|
|
ProgramOptionsButton->show();
|
|
|
else
|