MCPcopy Create free account
hub / github.com/SpartanJ/eepp / resolveInputsBeforeRun

Method resolveInputsBeforeRun

src/tools/ecode/plugins/debugger/debuggerplugin.cpp:1872–1952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1870}
1871
1872void DebuggerPlugin::resolveInputsBeforeRun(
1873 std::unordered_map<std::string, DapConfigurationInput> inputs, DapTool debugger,
1874 DapConfig config, std::unordered_map<std::string, std::string> solvedInputs ) {
1875 if ( inputs.empty() ) {
1876 prepareAndRun( debugger, config, solvedInputs );
1877 return;
1878 }
1879
1880 auto input = inputs.begin()->second;
1881 if ( input.type == "pickprocess"sv ) {
1882 UIWindow* win = processPicker();
1883 win->setTitle( i18n( "pick_process", "Pick Process" ) );
1884 win->center();
1885 win->showWhenReady();
1886 win->on( Event::OnConfirm, [inputs, win, debugger, config, solvedInputs,
1887 this]( const Event* ) mutable {
1888 UITableView* uiTableView = win->find( "processes_list" )->asType<UITableView>();
1889 auto model = static_cast<ProcessesModel*>( uiTableView->getModel() );
1890 std::string inputData(
1891 model->data( uiTableView->getSelection().first(), ModelRole::Display ).toString() );
1892 std::string id( inputs.begin()->second.id );
1893 solvedInputs[id] = inputData;
1894 inputs.erase( inputs.begin() );
1895 resolveInputsBeforeRun( inputs, debugger, config, solvedInputs );
1896 win->closeWindow();
1897 } );
1898 } else if ( input.type == "pickfile" ) {
1899 UIFileDialog* dialog = UIFileDialog::New(
1900 UIFileDialog::DefaultFlags | ( getPluginContext()->getConfig().ui.nativeFileDialogs
1901 ? UIFileDialog::UseNativeFileDialog
1902 : 0 ),
1903 "*", getPluginContext()->getDefaultFileDialogFolder() );
1904 dialog->setWindowFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
1905 dialog->setTitle( i18n( "open_file", "Open File" ) );
1906 dialog->setCloseShortcut( KEY_ESCAPE );
1907 dialog->setSingleClickNavigation(
1908 getPluginContext()->getConfig().editor.singleClickNavigation );
1909 dialog->setAllowsMultiFileSelect( false );
1910 dialog->on( Event::OpenFile, [this, dialog, inputs, solvedInputs, debugger,
1911 config]( const Event* event ) mutable {
1912 auto file = event->getNode()->asType<UIFileDialog>()->getFullPath();
1913 solvedInputs[inputs.begin()->second.id] = file;
1914 inputs.erase( inputs.begin() );
1915 resolveInputsBeforeRun( inputs, debugger, config, solvedInputs );
1916 dialog->closeWindow();
1917 } );
1918 dialog->on( Event::OnWindowClose, [this]( const Event* ) {
1919 if ( getPluginContext()->getSplitter() &&
1920 getPluginContext()->getSplitter()->getCurWidget() &&
1921 !SceneManager::instance()->isShuttingDown() )
1922 getPluginContext()->getSplitter()->getCurWidget()->setFocus();
1923 } );
1924 dialog->center();
1925 dialog->show();
1926 } else {
1927 bool isPick = input.type == "pickstring";
1928 UIMessageBox* msgBox = UIMessageBox::New(
1929 isPick ? UIMessageBox::DROPDOWNLIST : UIMessageBox::INPUT, input.description );

Callers

nothing calls this directly

Calls 15

centerMethod · 0.80
showWhenReadyMethod · 0.80
closeWindowMethod · 0.80
getConfigMethod · 0.80
setWindowFlagsMethod · 0.80
getFullPathMethod · 0.80
getNodeMethod · 0.80
getCurWidgetMethod · 0.80
getDropDownListMethod · 0.80
reserveMethod · 0.80

Tested by

no test coverage detected