From 0a25723025051224bb843b61280789324c22a7a1 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 22 Aug 2006 22:12:15 +0000 Subject: improvements to netidmgr dialogs * ensure that buttons are disabled while actions are in process * allow plug-ins to specify italic text * fix some documentation * reformat langres.rc ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18494 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/doc/ui_main.h | 1 + src/windows/identity/include/khmsgtypes.h | 16 ++- src/windows/identity/kcreddb/kcreddb.h | 12 +-- src/windows/identity/plugins/krb5/krb5configdlg.c | 15 ++- .../identity/plugins/krb5/lang/en_us/langres.rc | 119 +++++++-------------- src/windows/identity/ui/htwnd.c | 16 ++- src/windows/identity/ui/main.c | 96 ++++++++++++++--- src/windows/identity/ui/newcredwnd.c | 29 +++-- src/windows/identity/uilib/khnewcred.h | 12 ++- 9 files changed, 197 insertions(+), 119 deletions(-) (limited to 'src/windows') diff --git a/src/windows/identity/doc/ui_main.h b/src/windows/identity/doc/ui_main.h index 8cf735c044..6e17980a9c 100644 --- a/src/windows/identity/doc/ui_main.h +++ b/src/windows/identity/doc/ui_main.h @@ -31,4 +31,5 @@ - \subpage khui_actions - \subpage khui_menus - \subpage khui_context + - \subpage khui_htwnd */ diff --git a/src/windows/identity/include/khmsgtypes.h b/src/windows/identity/include/khmsgtypes.h index 686a9717f6..f1d42c2172 100644 --- a/src/windows/identity/include/khmsgtypes.h +++ b/src/windows/identity/include/khmsgtypes.h @@ -331,7 +331,7 @@ finalizing dialog creation operations. Message parameters: - - \b vparam : poitner to a ::khui_new_creds structure + - \b vparam : pointer to a ::khui_new_creds structure \note May be sent to individual credential subscriptions. */ @@ -472,6 +472,10 @@ /*! \brief A property page is being launced + Handlers of this message should determine whether or not they + should participate in the property sheet and if so, add a + ::khui_property_page structure to the property sheet. + Message parameters: - \b vparam : pointer to a ::khui_property_sheet structure */ @@ -490,6 +494,9 @@ /*! \brief A property page has finished processing + Handlers of this message should remove any ::khui_property_page + structures they added when processing ::KMSG_CRED_PP_BEGIN. + Message parameters: - \b vparam : pointer to a ::khui_property_sheet structure */ @@ -499,6 +506,13 @@ Message parameters: - \b vparam : pointer to a ::khui_property_sheet structure + + \note This is a notification that the property sheet processing + has been completed and that the property sheet data structures + should be freed. Any property page data structures should + have already been freed while processing KMSG_CRED_PP_END. + The validity of the ::khui_property_sheet structure should not + be relied upon while processing this message. */ #define KMSG_CRED_PP_DESTROY 131 diff --git a/src/windows/identity/kcreddb/kcreddb.h b/src/windows/identity/kcreddb/kcreddb.h index 63d16252dd..33c5d168d5 100644 --- a/src/windows/identity/kcreddb/kcreddb.h +++ b/src/windows/identity/kcreddb/kcreddb.h @@ -236,7 +236,7 @@ Functions, macros etc. for manipulating identities. A bitmask that correspond to all the read/write flags in the mask. */ -#define KCDB_IDENT_FLAGMASK_RDWR 0x00000fffL +#define KCDB_IDENT_FLAGMASK_RDWR 0x00000fffL /*@}*/ @@ -2876,7 +2876,7 @@ typedef struct tag_kcdb_credtype { kmq_delete_subscription() when the credentials type is unregistered.*/ - kcdb_cred_comp_func is_equal; /*!< Used to as an additional clause + kcdb_cred_comp_func is_equal; /*!< Used as an additional clause when comparing two credentials for equality. The function this is actually a comparison function, it @@ -2886,10 +2886,10 @@ typedef struct tag_kcdb_credtype { rock parameter is always zero. It can be assumed that the identity, - name and credentials have already - been found to be equal among the - credentials and the credential type - is the type that is being + name and credentials type have + already been found to be equal among + the credentials and the credential + type is the type that is being registered.*/ #ifdef _WIN32 diff --git a/src/windows/identity/plugins/krb5/krb5configdlg.c b/src/windows/identity/plugins/krb5/krb5configdlg.c index b8bdc55f99..8caafe9043 100644 --- a/src/windows/identity/plugins/krb5/krb5configdlg.c +++ b/src/windows/identity/plugins/krb5/krb5configdlg.c @@ -30,6 +30,7 @@ #include #include #include + #include typedef struct tag_k5_realm_kdc { @@ -1005,8 +1006,18 @@ k5_config_dlgproc(HWND hwnd, } /* and the import ticket options */ - LoadString(hResModule, IDS_K5CFG_IMPORT_OPTIONS, - importopts, ARRAYLENGTH(importopts)); + { + wchar_t csvstring[256]; + khm_size cb; + + csvstring[0] = L'\0'; + + LoadString(hResModule, IDS_K5CFG_IMPORT_OPTIONS, + csvstring, ARRAYLENGTH(csvstring)); + + cb = sizeof(importopts); + csv_to_multi_string(importopts, &cb, csvstring); + } hw = GetDlgItem(hwnd, IDC_CFG_IMPORT); #ifdef DEBUG diff --git a/src/windows/identity/plugins/krb5/lang/en_us/langres.rc b/src/windows/identity/plugins/krb5/lang/en_us/langres.rc index 49673c3781..aab9090503 100644 --- a/src/windows/identity/plugins/krb5/lang/en_us/langres.rc +++ b/src/windows/identity/plugins/krb5/lang/en_us/langres.rc @@ -53,32 +53,23 @@ END // IDD_NC_KRB5 DIALOGEX 0, 0, 300, 166 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | - WS_CLIPCHILDREN +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "Kerberos 5 Ticket Options",IDC_STATIC,"Static", - SS_LEFTNOWORDWRAP | SS_SUNKEN | WS_GROUP,7,7,286,11 + CONTROL "Kerberos 5 Ticket Options",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | SS_SUNKEN | WS_GROUP,7,7,286,11 LTEXT "Realm",IDC_STATIC,7,25,52,13 - COMBOBOX IDC_NCK5_REALM,60,25,233,17,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Specify &additional realms ...",IDC_NCK5_ADD_REALMS,181, - 43,112,16,BS_NOTIFY | NOT WS_VISIBLE | WS_DISABLED + COMBOBOX IDC_NCK5_REALM,60,25,233,17,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Specify &additional realms ...",IDC_NCK5_ADD_REALMS,181,43,112,16,BS_NOTIFY | NOT WS_VISIBLE | WS_DISABLED LTEXT "&Lifetime",IDC_STATIC,7,67,61,12 EDITTEXT IDC_NCK5_LIFETIME_EDIT,85,67,107,12,ES_AUTOHSCROLL - CONTROL "&Renewable for",IDC_NCK5_RENEWABLE,"Button", - BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,7,87,64,12 + CONTROL "&Renewable for",IDC_NCK5_RENEWABLE,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,7,87,64,12 EDITTEXT IDC_NCK5_RENEW_EDIT,85,87,108,12,ES_AUTOHSCROLL - CONTROL "Can be &forwarded to other machines", - IDC_NCK5_FORWARDABLE,"Button",BS_AUTOCHECKBOX | - BS_NOTIFY | WS_TABSTOP,7,107,132,12 - CONTROL "Addressless",IDC_NCK5_ADDRESS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,128,54,10 - LTEXT "Additional IP address",IDC_STATIC,118,129,68,8,NOT - WS_VISIBLE - CONTROL "",IDC_NCK5_PUBLICIP,"SysIPAddress32",NOT WS_VISIBLE | - WS_TABSTOP,193,125,100,15 + CONTROL "Can be &forwarded to other machines",IDC_NCK5_FORWARDABLE, + "Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,7,107,132,12 + CONTROL "Addressless",IDC_NCK5_ADDRESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,128,54,10 + LTEXT "Additional IP address",IDC_STATIC,118,129,68,8,NOT WS_VISIBLE + CONTROL "",IDC_NCK5_PUBLICIP,"SysIPAddress32",NOT WS_VISIBLE | WS_TABSTOP,193,125,100,15 END IDD_PP_KRB5C DIALOGEX 0, 0, 235, 156 @@ -95,8 +86,7 @@ BEGIN EDITTEXT IDC_PPK5_ISSUE,72,23,156,12,ES_AUTOHSCROLL | ES_READONLY EDITTEXT IDC_PPK5_VALID,72,39,156,12,ES_AUTOHSCROLL | ES_READONLY EDITTEXT IDC_PPK5_RENEW,72,55,156,12,ES_AUTOHSCROLL | ES_READONLY - LISTBOX IDC_PPK5_FLAGS,72,74,156,75,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_PPK5_FLAGS,72,74,156,75,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END IDD_PP_KRB5 DIALOGEX 0, 0, 235, 156 @@ -112,14 +102,10 @@ BEGIN LTEXT "Min. Renewable lifetime",IDC_STATIC,7,82,76,8 LTEXT "Max. Renewable lifetime",IDC_STATIC,7,97,79,8 GROUPBOX "Default ticket flags",IDC_STATIC,7,113,221,36 - CONTROL "Proxiable",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,160,129,45,10 - CONTROL "Renewable",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,23,129,51,10 - CONTROL "Forwardable",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,89,129,56,10 - LTEXT "ATHENA.MIT.EDU",IDC_STATIC,95,7,133,11,0, - WS_EX_CLIENTEDGE + CONTROL "Proxiable",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,160,129,45,10 + CONTROL "Renewable",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,129,51,10 + CONTROL "Forwardable",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,129,56,10 + LTEXT "ATHENA.MIT.EDU",IDC_STATIC,95,7,133,11,0,WS_EX_CLIENTEDGE LTEXT "10 hours",IDC_STATIC,95,22,133,11,0,WS_EX_CLIENTEDGE LTEXT "1 minute",IDC_STATIC,95,37,133,11,0,WS_EX_CLIENTEDGE LTEXT "7 days",IDC_STATIC,95,52,133,11,0,WS_EX_CLIENTEDGE @@ -133,31 +119,22 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "Default Realm",IDC_CFG_LBL_REALM,13,9,46,8 - COMBOBOX IDC_CFG_DEFREALM,76,7,166,30,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Configure Realms ...",IDC_CFG_CFGREALMS,76,25,84,14,NOT - WS_VISIBLE | WS_DISABLED - GROUPBOX "Keberos Configuration File",IDC_CFG_CFGFILEGRP,7,45,241, - 61 + COMBOBOX IDC_CFG_DEFREALM,76,7,166,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Configure Realms ...",IDC_CFG_CFGREALMS,76,25,84,14,NOT WS_VISIBLE | WS_DISABLED + GROUPBOX "Keberos Configuration File",IDC_CFG_CFGFILEGRP,7,45,241,61 LTEXT "Location",IDC_CFG_LBL_CFGFILE,13,61,28,8 EDITTEXT IDC_CFG_CFGFILE,76,58,119,14,ES_AUTOHSCROLL PUSHBUTTON "Browse...",IDC_CFG_BROWSE,198,58,44,14 - CONTROL "Create file if missing",IDC_CFG_CREATECONFIG,"Button", - BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | - WS_TABSTOP,76,90,80,10 - CONTROL "Include realms in New Credentials realm list", - IDC_CFG_INCREALMS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 76,78,153,10 + CONTROL "Create file if missing",IDC_CFG_CREATECONFIG,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,76,90,80,10 + CONTROL "Include realms in New Credentials realm list",IDC_CFG_INCREALMS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,76,78,153,10 GROUPBOX "Windows® Options",IDC_CFG_WINGRP,7,110,241,65 LTEXT "Hostname",IDC_CFG_LBL_HOSTNAME,13,123,33,8 - EDITTEXT IDC_CFG_HOSTNAME,76,120,166,14,ES_AUTOHSCROLL | - ES_READONLY + EDITTEXT IDC_CFG_HOSTNAME,76,120,166,14,ES_AUTOHSCROLL | ES_READONLY LTEXT "Domain",IDC_CFG_LBL_DOMAIN,13,141,24,8 - EDITTEXT IDC_CFG_DOMAIN,76,138,166,14,ES_AUTOHSCROLL | - ES_READONLY + EDITTEXT IDC_CFG_DOMAIN,76,138,166,14,ES_AUTOHSCROLL | ES_READONLY LTEXT "Import tickets",IDC_LBL_IMPORT,13,158,45,8 - COMBOBOX IDC_CFG_IMPORT,76,156,166,30,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CFG_IMPORT,76,156,166,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END IDD_CFG_REALMS DIALOGEX 0, 0, 255, 182 @@ -165,17 +142,11 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "",IDC_CFG_REALMS,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_TABSTOP,7,19,81, - 148 + CONTROL "",IDC_CFG_REALMS,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_EDITLABELS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_TABSTOP,7,19,81,148 GROUPBOX "Kerberos Servers",IDC_CFG_SERVERSGRP,93,7,155,91 GROUPBOX "Domain mappings",IDC_CFG_DOMAINGRP,93,101,155,74 - CONTROL "",IDC_CFG_KDC,"SysListView32",LVS_REPORT | - LVS_EDITLABELS | LVS_ALIGNLEFT | WS_TABSTOP,99,19,143,72 - CONTROL "",IDC_CFG_DMAP,"SysListView32",LVS_REPORT | - LVS_EDITLABELS | LVS_ALIGNLEFT | WS_TABSTOP,99,111,143, - 56 + CONTROL "",IDC_CFG_KDC,"SysListView32",LVS_REPORT | LVS_EDITLABELS | LVS_ALIGNLEFT | WS_TABSTOP,99,19,143,72 + CONTROL "",IDC_CFG_DMAP,"SysListView32",LVS_REPORT | LVS_EDITLABELS | LVS_ALIGNLEFT | WS_TABSTOP,99,111,143,56 END IDD_CFG_IDS_TAB DIALOGEX 0, 0, 235, 151 @@ -185,8 +156,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "Ticket lifetime",IDC_CFG_LBL_DEFLIFE,7,10,44,8 EDITTEXT IDC_CFG_DEFLIFE,91,7,137,14,ES_AUTOHSCROLL - LTEXT "Ticket renewable lifetime",IDC_CFG_LBL_DEFRLIFE,7,29,80, - 8 + LTEXT "Ticket renewable lifetime",IDC_CFG_LBL_DEFRLIFE,7,29,80,8 EDITTEXT IDC_CFG_DEFRLIFE,91,26,137,14,ES_AUTOHSCROLL GROUPBOX "Ticket lifetime range",IDC_CFG_LIFEGRP,7,43,221,49 LTEXT "Minimum",IDC_STATIC,13,56,28,8 @@ -207,17 +177,13 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "Ticket lifetime",IDC_CFG_LBL_DEFLIFE,7,10,44,8 EDITTEXT IDC_CFG_DEFLIFE,91,7,137,14,ES_AUTOHSCROLL - CONTROL "Renewable for",IDC_CFG_RENEW,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,41,63,10 + CONTROL "Renewable for",IDC_CFG_RENEW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,41,63,10 EDITTEXT IDC_CFG_DEFRLIFE,91,39,137,14,ES_AUTOHSCROLL CONTROL "Can be forwarded to other machines",IDC_CFG_FORWARD, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,133,10 - CONTROL "Addressless",IDC_CFG_ADDRESSLESS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,77,54,10 - LTEXT "Additional IP address",IDC_STATIC,91,78,68,8,NOT - WS_VISIBLE - CONTROL "",IDC_CFG_PUBLICIP,"SysIPAddress32",NOT WS_VISIBLE | - WS_TABSTOP,128,89,100,15 + CONTROL "Addressless",IDC_CFG_ADDRESSLESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,77,54,10 + LTEXT "Additional IP address",IDC_STATIC,91,78,68,8,NOT WS_VISIBLE + CONTROL "",IDC_CFG_PUBLICIP,"SysIPAddress32",NOT WS_VISIBLE | WS_TABSTOP,128,89,100,15 LTEXT "Credentials cache",IDC_STATIC,7,132,58,8 EDITTEXT IDC_CFG_CCACHE,91,130,137,14,ES_AUTOHSCROLL END @@ -227,13 +193,10 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "Kerberos 5 Change Password Options",IDC_STATIC,"Static", - SS_LEFTNOWORDWRAP | SS_SUNKEN | WS_GROUP,7,7,286,11 + CONTROL "Kerberos 5 Change Password Options",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | SS_SUNKEN | WS_GROUP,7,7,286,11 LTEXT "Realm",IDC_STATIC,7,25,52,13 - COMBOBOX IDC_NCK5_REALM,60,25,233,17,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Specify &additional realms ...",IDC_NCK5_ADD_REALMS,181, - 43,112,16,BS_NOTIFY | WS_DISABLED + COMBOBOX IDC_NCK5_REALM,60,25,233,17,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Specify &additional realms ...",IDC_NCK5_ADD_REALMS,181,43,112,16,BS_NOTIFY | WS_DISABLED END IDD_CFG_CACHES DIALOGEX 0, 0, 255, 182 @@ -242,16 +205,13 @@ EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN GROUPBOX "File Caches",IDC_CFG_FCGRP,7,26,241,149 - CONTROL "",IDC_CFG_FCLIST,"SysListView32",LVS_REPORT | - LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_BORDER | - WS_TABSTOP,13,37,229,97 + CONTROL "",IDC_CFG_FCLIST,"SysListView32",LVS_REPORT | LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,13,37,229,97 EDITTEXT IDC_CFG_FCNAME,13,139,173,14,ES_AUTOHSCROLL PUSHBUTTON "&Browse ...",IDC_CFG_BROWSE,192,139,50,14 PUSHBUTTON "Add",IDC_CFG_ADD,13,156,50,14 PUSHBUTTON "Remove Selected",IDC_CFG_REMOVE,88,156,80,14 CONTROL "Include all API: credentials caches",IDC_CFG_INCAPI, - "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP, - 123,7,125,10 + "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,123,7,125,10 CONTROL "Include Windows LSA cache (MSLSA:)",IDC_CFG_INCMSLSA, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,7,136,10 END @@ -443,8 +403,7 @@ BEGIN IDS_NC_PWD_NPWD "New Password" IDS_NC_PWD_NPWD_AGAIN "New Password again" IDS_KRB5_CREDTEXT_P0 "

Krb5: Changing password for %s

" - IDS_K5CFG_IMPORT_OPTIONS - "Never\000Always\000Only when the principal name matches\000 " + IDS_K5CFG_IMPORT_OPTIONS "Never,Always,Only when the principal matches" IDS_IDENTPRO_DESC "Kerberos 5 Identity Provider" IDS_K5CCC_SHORT_DESC "Credentials Caches" END @@ -521,8 +480,8 @@ BEGIN IDS_CFG_RE_MMK "Toggle &master KDC" IDS_CFG_RE_MND "&Add new domain mapping" IDS_CFG_RE_MDD "&Remove domain mapping" - IDS_KVNO_LONG_DESC "Key version number" IDS_KVNO_SHORT_DESC "Kvno" + IDS_KVNO_LONG_DESC "Key version number" END #endif // English (U.S.) resources diff --git a/src/windows/identity/ui/htwnd.c b/src/windows/identity/ui/htwnd.c index 9507fbdd0c..f655256909 100644 --- a/src/windows/identity/ui/htwnd.c +++ b/src/windows/identity/ui/htwnd.c @@ -315,17 +315,19 @@ We currently support the following tags: link text foo foo +foo + +foo + (color)=black|white|red|green|blue|grey +foo +foo
foo
foo foo -foo -foo -foo -

foo

- + */ @@ -468,6 +470,10 @@ static int htw_parse_tag( format_push(s,d, HTW_DEFAULT, FV_UNDERLINE, HTW_DEFAULT); } else if(!_wcsnicmp(start, L"/u", c - start)) { format_pop(s); + } else if(!_wcsnicmp(start, L"i", c - start)) { + format_push(s,d, HTW_DEFAULT, FV_ITALIC, HTW_DEFAULT); + } else if(!_wcsnicmp(start, L"/i", c - start)) { + format_pop(s); } else if(!_wcsnicmp(start, L"large", c - start)) { format_push(s,d,-MulDiv(HTW_LARGE_SIZE, d->l_pixel_y, 72), HTW_DEFAULT, HTW_DEFAULT); } else if(!_wcsnicmp(start, L"/large", c - start)) { diff --git a/src/windows/identity/ui/main.c b/src/windows/identity/ui/main.c index ad39de7eeb..80b7be3e52 100644 --- a/src/windows/identity/ui/main.c +++ b/src/windows/identity/ui/main.c @@ -174,6 +174,7 @@ void khm_unregister_window_classes(void) { typedef struct tag_khui_dialog { HWND hwnd; + HWND hwnd_next; BOOL active; } khui_dialog; @@ -186,6 +187,7 @@ static BOOL khui_main_window_active; void khm_add_dialog(HWND dlg) { if(n_khui_dialogs < MAX_UI_DIALOGS - 1) { khui_dialogs[n_khui_dialogs].hwnd = dlg; + khui_dialogs[n_khui_dialogs].hwnd_next = NULL; /* we set .active=FALSE for now. We don't need this to have a meaningful value until we enter a modal loop */ khui_dialogs[n_khui_dialogs].active = FALSE; @@ -202,36 +204,96 @@ void khm_add_dialog(HWND dlg) { void khm_enter_modal(HWND hwnd) { int i; - for(i=0; i < n_khui_dialogs; i++) { - if(khui_dialogs[i].hwnd != hwnd) { - khui_dialogs[i].active = IsWindowEnabled(khui_dialogs[i].hwnd); - EnableWindow(khui_dialogs[i].hwnd, FALSE); + if (khui_modal_dialog) { + + /* we are already in a modal loop. */ + +#ifdef DEBUG + assert(hwnd != khui_modal_dialog); +#endif + + for (i=0; i < n_khui_dialogs; i++) { + if (khui_dialogs[i].hwnd == khui_modal_dialog) { + khui_dialogs[i].active = TRUE; + EnableWindow(khui_modal_dialog, FALSE); + break; + } } - } - khui_main_window_active = khm_is_main_window_active(); - EnableWindow(khm_hwnd_main, FALSE); +#ifdef DEBUG + assert(i < n_khui_dialogs); +#endif + + for (i=0; i < n_khui_dialogs; i++) { + if (khui_dialogs[i].hwnd == hwnd) { + khui_dialogs[i].hwnd_next = khui_modal_dialog; + break; + } + } + +#ifdef DEBUG + assert(i < n_khui_dialogs); +#endif + + khui_modal_dialog = hwnd; + + } else { + + /* we are entering a modal loop. preserve the active state of + the overlapped dialogs and proceed with the modal + dialog. */ - khui_modal_dialog = hwnd; + for (i=0; i < n_khui_dialogs; i++) { + if(khui_dialogs[i].hwnd != hwnd) { + khui_dialogs[i].active = IsWindowEnabled(khui_dialogs[i].hwnd); + EnableWindow(khui_dialogs[i].hwnd, FALSE); + } + } + + khui_main_window_active = khm_is_main_window_active(); + EnableWindow(khm_hwnd_main, FALSE); + + khui_modal_dialog = hwnd; + } } /* should only be called from the UI thread */ void khm_leave_modal(void) { int i; - for(i=0; i < n_khui_dialogs; i++) { - if(khui_dialogs[i].hwnd != khui_modal_dialog) { - EnableWindow(khui_dialogs[i].hwnd, khui_dialogs[i].active); - } + for (i=0; i < n_khui_dialogs; i++) { + if (khui_dialogs[i].hwnd == khui_modal_dialog) + break; } - EnableWindow(khm_hwnd_main, TRUE); -#if 0 - if (khui_main_window_active) - SetForegroundWindow(khm_hwnd_main); +#ifdef DEBUG + assert(i < n_khui_dialogs); #endif - khui_modal_dialog = NULL; + if (i < n_khui_dialogs && khui_dialogs[i].hwnd_next) { + + /* we need to proceed to the next one down the modal dialog + chain. We are not exiting a modal loop. */ + + khui_modal_dialog = khui_dialogs[i].hwnd_next; + khui_dialogs[i].hwnd_next = FALSE; + + EnableWindow(khui_modal_dialog, TRUE); + + } else { + + /* we are exiting a modal loop. */ + + for (i=0; i < n_khui_dialogs; i++) { + if(khui_dialogs[i].hwnd != khui_modal_dialog) { + EnableWindow(khui_dialogs[i].hwnd, khui_dialogs[i].active); + } + } + + EnableWindow(khm_hwnd_main, TRUE); + + khui_modal_dialog = NULL; + } } /* should only be called from the UI thread */ diff --git a/src/windows/identity/ui/newcredwnd.c b/src/windows/identity/ui/newcredwnd.c index 39e670179c..a12942a150 100644 --- a/src/windows/identity/ui/newcredwnd.c +++ b/src/windows/identity/ui/newcredwnd.c @@ -198,8 +198,8 @@ nc_tab_sort_func(const void * v1, const void * v2) t1 = *((khui_new_creds_by_type **) v1); t2 = *((khui_new_creds_by_type **) v2); - if(t1->ordinal > 0) { - if(t2->ordinal > 0) { + if(t1->ordinal != -1) { + if(t2->ordinal != -1) { if(t1->ordinal == t2->ordinal) return wcscmp(t1->name, t2->name); else @@ -208,7 +208,7 @@ nc_tab_sort_func(const void * v1, const void * v2) } else return -1; } else { - if(t2->ordinal > 0) + if(t2->ordinal != -1) return 1; else if (t1->name && t2->name) return wcscmp(t1->name, t2->name); @@ -260,7 +260,7 @@ nc_update_credtext(khui_nc_wnd_data * d) StringCchLength(ctbuf, NC_MAXCCH_CREDTEXT, &cch); buf = ctbuf + cch; nc_notify_types(d->nc, KHUI_WM_NC_NOTIFY, - MAKEWPARAM(0, WMNC_UPDATE_CREDTEXT), 0); + MAKEWPARAM(0, WMNC_UPDATE_CREDTEXT), (LPARAM) d->nc); /* hopefully all the types have updated their credential texts */ if(d->nc->n_identities == 1) { @@ -915,7 +915,7 @@ nc_handle_wm_command(HWND hwnd, nc_notify_types(d->nc, KHUI_WM_NC_NOTIFY, MAKEWPARAM(0,WMNC_DIALOG_PREPROCESS), - 0); + (LPARAM) d->nc); khui_cw_sync_prompt_values(d->nc); @@ -931,6 +931,8 @@ nc_handle_wm_command(HWND hwnd, EnableWindow(hw, FALSE); hw = GetDlgItem(d->dlg_main, IDCANCEL); EnableWindow(hw, FALSE); + hw = GetDlgItem(d->dlg_main, IDC_NC_OPTIONS); + EnableWindow(hw, FALSE); hw = GetDlgItem(d->dlg_bb, IDOK); EnableWindow(hw, FALSE); hw = GetDlgItem(d->dlg_bb, IDCANCEL); @@ -1071,7 +1073,7 @@ static LRESULT nc_handle_wm_moving(HWND hwnd, d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM); nc_notify_types(d->nc, KHUI_WM_NC_NOTIFY, - MAKEWPARAM(0, WMNC_DIALOG_MOVE), 0); + MAKEWPARAM(0, WMNC_DIALOG_MOVE), (LPARAM) d->nc); return FALSE; } @@ -1222,8 +1224,19 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd, id = NC_TS_CTRL_ID_MIN; + /* if we have too many buttons than would fit on the + button bar, we have to adjust the width of the buttons. + Of course, having too many of them would be bad and + make the buttons fairly useless. This is just an + interim measure. */ + khui_cw_lock_nc(d->nc); + GetWindowRect(d->dlg_ts, &r); + if (x + width * d->nc->n_types > (khm_size) (r.right - r.left)) { + width = (int)(((r.right - r.left) - x) / d->nc->n_types); + } + /* first, the control for the main panel */ LoadString(khm_hInstance, IDS_NC_IDENTITY, wbuf, ARRAYLENGTH(wbuf)); @@ -1352,7 +1365,7 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd, BOOL okEnable = FALSE; nc_notify_types(d->nc, KHUI_WM_NC_NOTIFY, - MAKEWPARAM(0, WMNC_IDENTITY_CHANGE), 0); + MAKEWPARAM(0, WMNC_IDENTITY_CHANGE), (LPARAM) d->nc); if (d->nc->subtype == KMSG_CRED_NEW_CREDS && d->nc->n_identities > 0 && @@ -1654,6 +1667,8 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd, EnableWindow(hw, TRUE); hw = GetDlgItem(d->dlg_main, IDCANCEL); EnableWindow(hw, TRUE); + hw = GetDlgItem(d->dlg_main, IDC_NC_OPTIONS); + EnableWindow(hw, TRUE); hw = GetDlgItem(d->dlg_bb, IDOK); EnableWindow(hw, TRUE); hw = GetDlgItem(d->dlg_bb, IDCANCEL); diff --git a/src/windows/identity/uilib/khnewcred.h b/src/windows/identity/uilib/khnewcred.h index dc553f7408..4535757138 100644 --- a/src/windows/identity/uilib/khnewcred.h +++ b/src/windows/identity/uilib/khnewcred.h @@ -518,7 +518,17 @@ typedef struct tag_khui_new_creds_by_type { current state of this cred type. (localized, optional). Only used if providing a - user-interface. */ + user-interface. If this field is + non-NULL, then it should point to a + NULL terminated string that does not + exceed ::KHUI_MAXCCH_LONG_DESC + characters in length including the + terminating NULL. + + \see \ref khui_htwnd for information + on how to format the string for this + field. + */ LPARAM aux; /*!< auxilliary field. For use by the plug-in. */ -- cgit