Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-studio / trunk / src / synfigapp / uimanager.cpp
index 7ec30f6..4259e70 100644 (file)
@@ -33,6 +33,8 @@
 #include <iostream>
 #include <string>
 
+#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<<title<<": "<<message<<' ';
@@ -74,7 +103,7 @@ ConsoleUIInterface::yes_no(const std::string &title, const std::string &message,
 }
 
 UIInterface::Response
-ConsoleUIInterface::yes_no_cancel(const string &title, const string &message,Response dflt)
+ConsoleUIInterface::yes_no_cancel(const std::string &title, const std::string &message, Response dflt)
 {
        cout<<title<<": "<<message<<' ';
        if(dflt==RESPONSE_NO)
@@ -149,7 +178,7 @@ ConsoleUIInterface::warning(const std::string &task)
 }
 
 bool
-ConsoleUIInterface::amount_complete(int current, int total)
+ConsoleUIInterface::amount_complete(int /*current*/, int /*total*/)
 {
        return true;
 }