X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fuimanager.cpp;h=4259e7058b642924e5896fe34bb81c2a67a75890;hb=70eafd12bd61c47015b2ee21d87e93e5a38eb61e;hp=9ee6af2de46066f6745eca9ea6b192c2598351fe;hpb=8ef042c40521681cea99944097c4f90a5ac6cf74;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/uimanager.cpp b/synfig-studio/trunk/src/synfigapp/uimanager.cpp index 9ee6af2..4259e70 100644 --- a/synfig-studio/trunk/src/synfigapp/uimanager.cpp +++ b/synfig-studio/trunk/src/synfigapp/uimanager.cpp @@ -49,6 +49,33 @@ using namespace synfigapp; /* === M E T H O D S ======================================================= */ UIInterface::Response +ConsoleUIInterface::confirmation(const std::string &title, const std::string &primaryText, + const std::string &secondaryText, const std::string &confirmPhrase, + const std::string &cancelPhrase, Response dflt) +{ + cout << title << ": " << primaryText << endl; + cout << secondaryText; + + if (dflt == RESPONSE_OK) + cout << "(" << confirmPhrase << "/" << cancelPhrase << ")" << endl; + else + cout << "(" << cancelPhrase << "/" << confirmPhrase << ")" << endl; + + string resp; + cin >> resp; + + if (dflt == RESPONSE_OK) + { + if (resp == cancelPhrase) + return RESPONSE_CANCEL; + return RESPONSE_OK; + } + if (resp == confirmPhrase) + return RESPONSE_OK; + return RESPONSE_CANCEL; +} + +UIInterface::Response ConsoleUIInterface::yes_no(const std::string &title, const std::string &message,Response dflt) { cout<