COPKGManager: use parameters for errror message and additional text as option

This commit is contained in:
2015-05-25 15:25:32 +02:00
parent cc49d5a714
commit 9a6aae8f49
2 changed files with 6 additions and 5 deletions

View File

@@ -797,12 +797,13 @@ void COPKGManager::showErr(int* res)
DisplayErrorMessage(errtest.c_str()); DisplayErrorMessage(errtest.c_str());
} }
void COPKGManager::showError(const char* local_msg, char* err_message, const string& command) void COPKGManager::showError(const char* local_msg, char* err_message, const string& additional_text)
{ {
string msg = local_msg ? string(local_msg) + "\n" : ""; string msg = local_msg ? string(local_msg) + "\n" : "";
msg += err_msg + "\n"; if (err_message)
msg += string(err_message) + ":\n"; msg += string(err_message) + ":\n";
msg += command; if (!additional_text.empty())
msg += additional_text;
DisplayErrorMessage(msg.c_str()); DisplayErrorMessage(msg.c_str());
} }

View File

@@ -126,7 +126,7 @@ class COPKGManager : public CMenuTarget
void updateMenu(); void updateMenu();
void refreshMenu(); void refreshMenu();
bool badpackage(std::string &s); bool badpackage(std::string &s);
void showError(const char* local_msg, char* err_msg, const std::string& command); void showError(const char* local_msg, char* err_msg = NULL, const std::string& additional_text = std::string());
int doUpdate(); int doUpdate();
void handleShellOutput(std::string* cur_line, int* res, bool* ok); void handleShellOutput(std::string* cur_line, int* res, bool* ok);