Module: wine Branch: master Commit: 6fae8e1df1bc604b491c75c4d227b66fc33b5f1d URL: http://source.winehq.org/git/wine.git/?a=commit;h=6fae8e1df1bc604b491c75c4d2...
Author: Alexandre Julliard julliard@winehq.org Date: Sat Feb 6 10:21:22 2010 +0100
winetest: Require an email address to submit a report.
---
programs/winetest/gui.c | 33 +++++++++++++++++++++++++++++++++ programs/winetest/main.c | 17 +++++++++++++++++ programs/winetest/resource.h | 2 ++ programs/winetest/winetest.h | 2 ++ programs/winetest/winetest.rc | 11 +++++++++++ 5 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/programs/winetest/gui.c b/programs/winetest/gui.c index cb59ac2..7a7b1e0 100644 --- a/programs/winetest/gui.c +++ b/programs/winetest/gui.c @@ -361,6 +361,39 @@ guiAskTag (void) dialog, AskTagProc); }
+static INT_PTR CALLBACK +AskEmailProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + int len; + + switch (msg) + { + case WM_COMMAND: + switch (LOWORD (wParam)) { + case IDOK: + len = GetWindowTextLengthA (GetDlgItem (hwnd, IDC_EMAIL)); + if(!len) { + report (R_WARNING, "You must enter an email address to continue"); + return FALSE; + } + email = heap_alloc (len+1); + GetDlgItemTextA (hwnd, IDC_EMAIL, email, len+1); + EndDialog (hwnd, IDOK); + return TRUE; + case IDABORT: + EndDialog (hwnd, IDABORT); + return TRUE; + } + } + return FALSE; +} + +int +guiAskEmail (void) +{ + return DialogBox (GetModuleHandle (NULL), MAKEINTRESOURCE (IDD_EMAIL), dialog, AskEmailProc); +} + /* Quiet functions */ static int qNoOp (va_list ap) diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 69b7da6..a20fa06 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -48,6 +48,7 @@ struct wine_test };
char *tag = NULL; +char *email = NULL; static struct wine_test *wine_tests; static int nr_of_files, nr_of_tests; static int nr_native_dlls; @@ -221,6 +222,7 @@ static void print_version (void) xprintf (" Platform=%s%s\n", platform, wow64 ? " (WOW64)" : ""); xprintf (" bRunningUnderWine=%d\n", running_under_wine ()); xprintf (" bRunningOnVisibleDesktop=%d\n", running_on_visible_desktop ()); + xprintf (" Submitter=%s\n", email ); xprintf (" dwMajorVersion=%u\n dwMinorVersion=%u\n" " dwBuildNumber=%u\n PlatformId=%u\n szCSDVersion=%s\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber, @@ -921,6 +923,7 @@ usage (void) " -d DIR Use DIR as temp directory (default: %%TEMP%%\wct)\n" " -e preserve the environment\n" " -h print this message and exit\n" +" -m MAIL an email address to enable developers to contact you\n" " -p shutdown when the tests are done\n" " -q quiet mode, no output at all\n" " -o FILE put report into FILE, do not submit\n" @@ -971,6 +974,13 @@ int main( int argc, char *argv[] ) case '?': usage (); exit (0); + case 'm': + if (!(email = argv[++i])) + { + usage(); + exit( 2 ); + } + break; case 'p': poweroff = 1; break; @@ -1056,6 +1066,13 @@ int main( int argc, char *argv[] ) } report (R_TAG);
+ while (!email) { + if (!interactive) + report (R_FATAL, "Please specify an email address (-m option) to enable developers\n" + " to contact you about your report if necessary."); + if (guiAskEmail () == IDABORT) exit (1); + } + if (!build_id[0]) report( R_WARNING, "You won't be able to submit results without a valid build id.\n" "To submit results, winetest needs to be built from a git checkout." ); diff --git a/programs/winetest/resource.h b/programs/winetest/resource.h index b0f1646..be71274 100644 --- a/programs/winetest/resource.h +++ b/programs/winetest/resource.h @@ -23,6 +23,7 @@ #define IDD_STATUS 100 #define IDD_ABOUT 101 #define IDD_TAG 102 +#define IDD_EMAIL 103
#define IDC_STATIC -1
@@ -36,6 +37,7 @@ #define IDC_DIR 2000 #define IDC_OUT 2001 #define IDC_TAG 2002 +#define IDC_EMAIL 2002
#define IDC_SB 3000
diff --git a/programs/winetest/winetest.h b/programs/winetest/winetest.h index 945586c..a0d2fbd 100644 --- a/programs/winetest/winetest.h +++ b/programs/winetest/winetest.h @@ -68,7 +68,9 @@ enum report_type {
#define MAXTAGLEN 20 extern char *tag; +extern char *email; int guiAskTag (void); +int guiAskEmail (void); int report (enum report_type t, ...);
#endif /* __WINETESTS_H */ diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc index 52c3430..5b5d6e0 100644 --- a/programs/winetest/winetest.rc +++ b/programs/winetest/winetest.rc @@ -35,6 +35,17 @@ BEGIN PUSHBUTTON "Abort", IDABORT, 85, 45, 40, 14 END
+IDD_EMAIL DIALOG 0, 0, 150, 65 +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "No email supplied" +BEGIN + CTEXT "Please supply an email address to enable developers to contact you about your report." + IDC_STATIC, 10, 5, 130, 30 + EDITTEXT IDC_EMAIL, 10, 30, 130, 10, ES_AUTOHSCROLL + DEFPUSHBUTTON "Start", IDOK, 25, 45, 40, 14 + PUSHBUTTON "Abort", IDABORT, 85, 45, 40, 14 +END + IDD_STATUS DIALOG 0, 0, 160, 150 STYLE WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX CAPTION "Wine Test Shell"