shows the game variant page of the create instance dialog so the user can pick which game variant is installed this is used below in setupInstance() when there is no variant in the ini but the game plugin requires one; this can happen when the ini is broken or when a new variant has become supported by the plugin for a game the user already has an instance for
| 775 | // user already has an instance for |
| 776 | // |
| 777 | SetupInstanceResults selectVariant(Instance& instance, PluginContainer& pc) |
| 778 | { |
| 779 | CreateInstanceDialog dlg(pc, nullptr); |
| 780 | |
| 781 | // the variant page uses the game page to know which game was selected, so |
| 782 | // set it manually |
| 783 | dlg.getPage<cid::GamePage>()->select(instance.gamePlugin(), instance.gameDirectory()); |
| 784 | |
| 785 | // only show the variant page |
| 786 | dlg.setSinglePage<cid::VariantsPage>(instance.displayName()); |
| 787 | |
| 788 | dlg.show(); |
| 789 | dlg.activateWindow(); |
| 790 | dlg.raise(); |
| 791 | |
| 792 | if (dlg.exec() != QDialog::Accepted) { |
| 793 | return SetupInstanceResults::SelectAnother; |
| 794 | } |
| 795 | |
| 796 | // this info will be used instead of the ini, which should fix this |
| 797 | // particular problem |
| 798 | instance.setVariant(dlg.creationInfo().gameVariant); |
| 799 | |
| 800 | return SetupInstanceResults::TryAgain; |
| 801 | } |
| 802 | |
| 803 | SetupInstanceResults setupInstance(Instance& instance, PluginContainer& pc) |
| 804 | { |
no test coverage detected