programoptions.ui.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /****************************************************************************
  2. ** ui.h extension file, included from the uic-generated form implementation.
  3. **
  4. ** If you want to add, delete, or rename functions or slots, use
  5. ** Qt Designer to update this file, preserving your code.
  6. **
  7. ** You should not define a constructor or destructor in this file.
  8. ** Instead, write your code in functions called init() and destroy().
  9. ** These will automatically be called by the form's constructor and
  10. ** destructor.
  11. *****************************************************************************/
  12. /*
  13. ktigcc - TIGCC IDE for KDE
  14. Copyright (C) 2004-2006 Kevin Kofler
  15. Copyright (C) 2006 Joey Adams
  16. This program is free software; you can redistribute it and/or modify
  17. it under the terms of the GNU General Public License as published by
  18. the Free Software Foundation; either version 2, or (at your option)
  19. any later version.
  20. This program is distributed in the hope that it will be useful,
  21. but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. GNU General Public License for more details.
  24. You should have received a copy of the GNU General Public License
  25. along with this program; if not, write to the Free Software Foundation,
  26. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  27. */
  28. #include <kurl.h>
  29. #include "tpr.h" //tpr.h relies on kurl.h
  30. extern tprLibOpts libopts;
  31. void ProgramOptions::ImportSettings()
  32. {
  33. //Tab: Calculator
  34. TI89->setChecked(libopts.use_ti89);
  35. TI92Plus->setChecked(libopts.use_ti92p);
  36. V200->setChecked(libopts.use_v200);
  37. OptimizeCalcConsts->setChecked(libopts.opt_calc_consts);
  38. //Tab: Operating System
  39. if (libopts.use_preos)
  40. PreOS->setChecked(TRUE);
  41. else if (libopts.use_kernel)
  42. RecentDoorsCompatibleKernels->setChecked(TRUE);
  43. else
  44. AnyNoKernel->setChecked(TRUE);
  45. CMinimumAMSVersion->setChecked(libopts.use_minams);
  46. MinimumAMSVersion->setText(QString("%1.%2%3").arg(libopts.minams/100).arg((libopts.minams/10)%10).arg(libopts.minams%10));
  47. MinimumAMSVersion->setEnabled(libopts.use_minams);
  48. UnofficialOSSupport->setChecked(libopts.unofficial_os);
  49. //Tab: Reloc Format
  50. if (libopts.reloc_format==RT_KERNEL)
  51. RelocKernel->setChecked(TRUE);
  52. else if (libopts.reloc_format==RT_COMPRESSED)
  53. RelocCompressed->setChecked(TRUE);
  54. else if (libopts.reloc_format==RT_MLINK)
  55. RelocMlink->setChecked(TRUE);
  56. else
  57. RelocAMS->setChecked(TRUE);
  58. UseFLineJumps->setChecked(libopts.use_fline_jumps);
  59. Use4ByteFLineJumps->setChecked(libopts.use_4b_fline_jumps);
  60. if (libopts.rom_call_format==RT_KERNEL)
  61. ROMCallKernel->setChecked(TRUE);
  62. else if (libopts.rom_call_format==RT_COMPRESSED)
  63. ROMCallCompressed->setChecked(TRUE);
  64. else if (libopts.rom_call_format==RT_MLINK)
  65. ROMCallMlink->setChecked(TRUE);
  66. else if (libopts.rom_call_format==RT_FLINE)
  67. ROMCallFLine->setChecked(TRUE);
  68. else
  69. ROMCallDirect->setChecked(TRUE);
  70. OptimizeROMCalls->setChecked(libopts.opt_rom_calls);
  71. UseInternalFLineEmulator->setChecked(libopts.use_internal_fline_emu);
  72. //Tab: BSS/Data Format
  73. if (libopts.bss_ref_format==RT_KERNEL)
  74. BSSKernel->setChecked(TRUE);
  75. else if (libopts.bss_ref_format==RT_COMPRESSED)
  76. BSSCompressed->setChecked(TRUE);
  77. else if (libopts.bss_ref_format==RT_MLINK)
  78. BSSMlink->setChecked(TRUE);
  79. else
  80. BSSMerge->setChecked(TRUE);
  81. if (libopts.data_ref_format==RT_COMPRESSED)
  82. BSSDataCompressed->setChecked(TRUE);
  83. else if (libopts.data_ref_format==RT_MLINK)
  84. BSSDataMlink->setChecked(TRUE);
  85. else
  86. BSSDataKernel->setChecked(TRUE);
  87. //Tab: Home Screen
  88. if (libopts.use_return_value)
  89. HomeCustomValue->setChecked(TRUE);
  90. else
  91. HomeDone->setChecked(TRUE);
  92. EnableReturningErrors->setChecked(libopts.enable_error_return);
  93. SaveScreen->setChecked(libopts.save_screen);
  94. }
  95. void ProgramOptions::ExportSettings()
  96. {
  97. //Tab: Calculator
  98. libopts.use_ti89=TI89->isChecked();
  99. libopts.use_ti92p=TI92Plus->isChecked();
  100. libopts.use_v200=V200->isChecked();
  101. libopts.opt_calc_consts=OptimizeCalcConsts->isChecked();
  102. //Tab: Operating System
  103. libopts.use_preos=PreOS->isChecked();
  104. libopts.use_kernel=RecentDoorsCompatibleKernels->isChecked();
  105. libopts.use_minams=CMinimumAMSVersion->isChecked();
  106. QString minams=MinimumAMSVersion->text();
  107. libopts.minams=minams.section('.',1,1).toUInt()*100+minams.section('.',2,2).toUInt();
  108. libopts.unofficial_os=UnofficialOSSupport->isChecked();
  109. //Tab: Reloc Format
  110. if (RelocKernel->isChecked())
  111. libopts.reloc_format=RT_KERNEL;
  112. else if (RelocCompressed->isChecked())
  113. libopts.reloc_format=RT_COMPRESSED;
  114. else if (RelocMlink->isChecked())
  115. libopts.reloc_format=RT_MLINK;
  116. else
  117. libopts.reloc_format=RT_AMS;
  118. libopts.use_fline_jumps=UseFLineJumps->isChecked();
  119. libopts.use_4b_fline_jumps=Use4ByteFLineJumps->isChecked();
  120. if (ROMCallKernel->isChecked())
  121. libopts.rom_call_format=RT_KERNEL;
  122. else if (ROMCallCompressed->isChecked())
  123. libopts.rom_call_format=RT_COMPRESSED;
  124. else if (ROMCallMlink->isChecked())
  125. libopts.rom_call_format=RT_MLINK;
  126. else if (ROMCallFLine->isChecked())
  127. libopts.rom_call_format=RT_FLINE;
  128. else
  129. libopts.rom_call_format=RT_DIRECT;
  130. libopts.opt_rom_calls=OptimizeROMCalls->isChecked();
  131. libopts.use_internal_fline_emu=UseInternalFLineEmulator->isChecked();
  132. //Tab: BSS/Data Format
  133. if (BSSKernel->isChecked())
  134. libopts.bss_ref_format=RT_KERNEL;
  135. else if (BSSCompressed->isChecked())
  136. libopts.bss_ref_format=RT_COMPRESSED;
  137. else if (BSSMlink->isChecked())
  138. libopts.bss_ref_format=RT_MLINK;
  139. else
  140. libopts.bss_ref_format=RT_NONE;
  141. if (BSSDataCompressed->isChecked())
  142. libopts.data_ref_format=RT_COMPRESSED;
  143. else if (BSSDataMlink->isChecked())
  144. libopts.data_ref_format=RT_MLINK;
  145. else
  146. libopts.data_ref_format=RT_KERNEL;
  147. //Tab: Home Screen
  148. libopts.use_return_value=HomeCustomValue->isChecked();
  149. libopts.enable_error_return=EnableReturningErrors->isChecked();
  150. libopts.save_screen=SaveScreen->isChecked();
  151. }
  152. void ProgramOptions::CMinimumAMSVersion_toggled(bool on)
  153. {
  154. MinimumAMSVersion->setEnabled(on);
  155. }