Add Analyze buttons for last and current log

master
palana 2014-02-12 03:05:35 +01:00
parent a6cf3dde90
commit 959efa1e68
5 changed files with 16 additions and 5 deletions

1
OBS.rc
View File

@ -949,6 +949,7 @@ BEGIN
MENUITEM SEPARATOR
POPUP "MainMenu.Help.UploadLog"
BEGIN
MENUITEM "MainMenu.Help.AnalyzeCurrentLog", ID_HELP_ANALYZE_CURRENT_LOG
MENUITEM "MainMenu.Help.UploadCurrentLog", ID_HELP_UPLOAD_CURRENT_LOG
END
MENUITEM "MainMenu.Settings.OpenLogFolder", ID_SETTINGS_OPENLOGFOLDER

View File

@ -23,6 +23,7 @@ struct LogUploadResult
String url, analyzerURL;
String errors;
bool openAnalyzerOnSuccess;
LogUploadResult() : openAnalyzerOnSuccess(false) {}
};
bool UploadCurrentLog(LogUploadResult &result);

View File

@ -2353,11 +2353,14 @@ void OBS::ResetLogUploadMenu()
HMENU hmenuHelp = GetSubMenu(hmenuMain, 3);
HMENU hmenuUpload = GetSubMenu(hmenuHelp, 3);
while (DeleteMenu(hmenuUpload, 1, MF_BYPOSITION));
while (DeleteMenu(hmenuUpload, 2, MF_BYPOSITION));
if (!App->logFiles.Num())
return;
AppendMenu(hmenuUpload, MF_SEPARATOR, 0, nullptr);
AppendMenu(hmenuUpload, MF_STRING, ID_UPLOAD_ANALYZE_LOG, Str("MainMenu.Help.AnalyzeLastLog"));
AppendMenu(hmenuUpload, MF_STRING, ID_UPLOAD_LOG, Str("MainMenu.Help.UploadLastLog"));
AppendMenu(hmenuUpload, MF_SEPARATOR, 0, nullptr);
@ -2386,13 +2389,13 @@ String GetLogUploadMenuItem(UINT item)
mii.cbSize = sizeof mii;
mii.fMask = MIIM_STRING;
GetMenuItemInfo(hmenuLog, 3 + item, true, &mii);
GetMenuItemInfo(hmenuLog, 6 + item, true, &mii);
String log;
log.SetLength(mii.cch++);
mii.dwTypeData = log.Array();
GetMenuItemInfo(hmenuLog, 3 + item, true, &mii);
GetMenuItemInfo(hmenuLog, 6 + item, true, &mii);
return log;
}
@ -2672,12 +2675,14 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
OSCloseThread(OSCreateThread((XTHREAD)CheckUpdateThread, (LPVOID)1));
break;
case ID_HELP_ANALYZE_CURRENT_LOG:
case ID_HELP_UPLOAD_CURRENT_LOG:
if (App->bRunning)
break;
{
LogUploadResult result;
result.openAnalyzerOnSuccess = LOWORD(wParam) == ID_HELP_ANALYZE_CURRENT_LOG;
ShowLogUploadResult(result, UploadCurrentLog(result));
break;
}

View File

@ -290,7 +290,7 @@
#define IDC_COPY 1169
#define IDC_STARTRECORDINGHOTKEY_STATIC 1170
#define IDC_COPIED 1170
#define IDC_ANALYZE 1171
#define IDC_ANALYZE 1171
#define IDC_STOPRECORDINGHOTKEY_STATIC 1171
#define IDC_STARTRECORDINGHOTKEY 1172
#define IDC_STOPRECORDINGHOTKEY 1173
@ -340,13 +340,15 @@
#define ID_HELP_CHECK_FOR_UPDATES 40058
#define ID_HELP_UPLOAD_CURRENT_LOG 40060
#define ID_HELP_UPLOAD_LAST_LOG 40061
#define ID_MAINMENU_MAINMENU40062 40062
#define ID_HELP_ANALYZE_CURRENT_LOG 40063
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 148
#define _APS_NEXT_COMMAND_VALUE 40062
#define _APS_NEXT_COMMAND_VALUE 40064
#define _APS_NEXT_CONTROL_VALUE 1171
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@ -370,7 +370,9 @@ Updater.UpdatesAvailable="Updates are available"
Updater.NoUpdatesAvailable="No updates are available"
MainMenu.Help.UploadLog="Upload a Log File"
MainMenu.Help.AnalyzeCurrentLog="Analyze current Log File"
MainMenu.Help.UploadCurrentLog="Upload current Log File"
MainMenu.Help.AnalyzeLastLog="Analyze last Log File"
MainMenu.Help.UploadLastLog="Upload last Log File"
LogUpload.SuccessDialog.Caption="Log uploaded"