mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 11:24:00 +02:00
- fixed bug in mod menu where no messages were shown since tit's console class change.
- added new ftp status info and display output from 7z extraction as it happens in game so that the user knows something is happening (and to show errors)
This commit is contained in:
@@ -82,6 +82,14 @@ const char vkDelete = -26;
|
||||
const char vkPrint = -27;
|
||||
const char vkPause = -29;
|
||||
|
||||
class ShellCommandOutputCallbackInterface {
|
||||
public:
|
||||
virtual ~ShellCommandOutputCallbackInterface() {}
|
||||
|
||||
virtual void * getShellCommandOutput_UserData(string cmd) = 0;
|
||||
virtual void ShellCommandOutput_CallbackEvent(string cmd,char *output,void *userdata) = 0;
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class PerformanceTimer
|
||||
// =====================================================
|
||||
@@ -260,7 +268,7 @@ inline string trim (const string & s, const string & t = SPACES) {
|
||||
|
||||
string getFullFileArchiveExtractCommand(string fileArchiveExtractCommand,
|
||||
string fileArchiveExtractCommandParameters, string outputpath, string archivename);
|
||||
bool executeShellCommand(string cmd,int expectedResult=IGNORE_CMD_RESULT_VALUE);
|
||||
bool executeShellCommand(string cmd,int expectedResult=IGNORE_CMD_RESULT_VALUE,ShellCommandOutputCallbackInterface *cb=NULL);
|
||||
string executable_path(string exeName,bool includeExeNameInPath=false);
|
||||
|
||||
bool valid_utf8_file(const char* file_name);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#include "base_thread.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "platform_common.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -39,7 +39,8 @@ enum FTP_Client_CallbackType {
|
||||
ftp_cct_Techtree = 2,
|
||||
ftp_cct_Scenario = 3,
|
||||
ftp_cct_File = 4,
|
||||
ftp_cct_DownloadProgress = 5
|
||||
ftp_cct_DownloadProgress = 5,
|
||||
ftp_cct_ExtractProgress = 6
|
||||
};
|
||||
|
||||
class FTPClientCallbackInterface {
|
||||
@@ -55,10 +56,12 @@ public:
|
||||
};
|
||||
|
||||
virtual void FTPClient_CallbackEvent(string itemName,
|
||||
FTP_Client_CallbackType type, pair<FTP_Client_ResultType,string> result, void *userdata) = 0;
|
||||
FTP_Client_CallbackType type,
|
||||
pair<FTP_Client_ResultType,string> result,
|
||||
void *userdata) = 0;
|
||||
};
|
||||
|
||||
class FTPClientThread : public BaseThread
|
||||
class FTPClientThread : public BaseThread, public ShellCommandOutputCallbackInterface
|
||||
{
|
||||
protected:
|
||||
int portNumber;
|
||||
@@ -111,6 +114,10 @@ protected:
|
||||
string remotePath, string destFileSaveAs, string ftpUser,
|
||||
string ftpUserPassword, vector <string> *wantDirListOnly=NULL);
|
||||
|
||||
string shellCommandCallbackUserData;
|
||||
virtual void * getShellCommandOutput_UserData(string cmd);
|
||||
virtual void ShellCommandOutput_CallbackEvent(string cmd,char *output,void *userdata);
|
||||
|
||||
public:
|
||||
|
||||
FTPClientThread(int portNumber,string serverUrl,
|
||||
|
Reference in New Issue
Block a user