X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fuimanager.cpp;h=4259e7058b642924e5896fe34bb81c2a67a75890;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=7ec30f6a232f4c79d27c4a6639b8ce991c86ef0d;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/uimanager.cpp b/synfig-studio/trunk/src/synfigapp/uimanager.cpp index 7ec30f6..4259e70 100644 --- a/synfig-studio/trunk/src/synfigapp/uimanager.cpp +++ b/synfig-studio/trunk/src/synfigapp/uimanager.cpp @@ -33,6 +33,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -47,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<