if(KHM_FAILED(khc_read_string(hc_cw, viewval, buf, &cbsize)))\r
goto _exit;\r
view = buf;\r
+ } else {\r
+ khc_write_string(hc_cw, viewval, view);\r
+ }\r
\r
/* in addition, if we are loading the default view, we should\r
also check the appropriate menu item */\r
\r
- if (!wcscmp(view, L"ByIdentity"))\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
- KHUI_ACTION_LAYOUT_ID);\r
- else if (!wcscmp(view, L"ByLocation"))\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
- KHUI_ACTION_LAYOUT_LOC);\r
- else if (!wcscmp(view, L"ByType"))\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
- KHUI_ACTION_LAYOUT_TYPE);\r
- else if (!wcscmp(view, L"Custom_0"))\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
- KHUI_ACTION_LAYOUT_CUST);\r
- else if (!wcscmp(view, L"CompactIdentity"))\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
- KHUI_ACTION_LAYOUT_MINI);\r
-\r
- kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
- } else {\r
- khc_write_string(hc_cw, viewval, view);\r
+ if (!wcscmp(view, L"ByIdentity"))\r
+ khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
+ KHUI_ACTION_LAYOUT_ID);\r
+ else if (!wcscmp(view, L"ByLocation"))\r
+ khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
+ KHUI_ACTION_LAYOUT_LOC);\r
+ else if (!wcscmp(view, L"ByType"))\r
+ khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
+ KHUI_ACTION_LAYOUT_TYPE);\r
+ else if (!wcscmp(view, L"Custom_0"))\r
+ khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
+ KHUI_ACTION_LAYOUT_CUST);\r
+ else {\r
+ /* do nothing */\r
}\r
\r
+ kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
+\r
if(KHM_FAILED(khc_open_space(hc_vs, view, 0, &hc_v)))\r
goto _exit;\r
\r
o->header = PMALLOC(cblen);\r
StringCbCopy(o->header, cblen, heading);\r
}\r
+ o->start = -1;\r
\r
return o;\r
}\r
o->col = grouping[0];\r
o->data = id_def;\r
o->attr_id = KCDB_ATTR_ID;\r
+ o->start = -1;\r
+ } else {\r
+ kcdb_identity_release(id_def);\r
+ }\r
\r
- if (flags & KCDB_IDENT_FLAG_STICKY)\r
- o->flags |= KHUI_CW_O_STICKY;\r
+ if (o->start != -1)\r
+ goto done_with_defident;\r
+\r
+ if (flags & KCDB_IDENT_FLAG_STICKY)\r
+ o->flags |= KHUI_CW_O_STICKY;\r
+ else\r
+ o->flags &= ~KHUI_CW_O_STICKY;\r
\r
- o->start = n_rows;\r
- o->length = 1;\r
- o->idx_start = -1;\r
+ o->start = n_rows;\r
+ o->length = 1;\r
+ o->idx_start = -1;\r
\r
- if (grouping[0] == tbl->n_cols - 1)\r
- o->flags |= KHUI_CW_O_NOOUTLINE;\r
+ if (grouping[0] == tbl->n_cols - 1)\r
+ o->flags |= KHUI_CW_O_NOOUTLINE;\r
\r
- cw_set_tbl_row_header(tbl, n_rows, grouping[0], o);\r
+ cw_set_tbl_row_header(tbl, n_rows, grouping[0], o);\r
\r
- n_rows ++;\r
- } else {\r
- kcdb_identity_release(id_def);\r
- }\r
+ n_rows ++;\r
\r
done_with_defident:\r
;\r
/* found it */\r
if (o->start != -1) /* already visible? */\r
continue;\r
- o->flags &= KHUI_CW_O_STICKY;\r
+ o->flags &= KHUI_CW_O_STICKY | KHUI_CW_O_RELIDENT;\r
o->flags |= KHUI_CW_O_VISIBLE;\r
} else {\r
/* not found. create */\r
o->col = grouping[0];\r
o->data = (void *) h;\r
o->attr_id = KCDB_ATTR_ID;\r
-\r
- if (grouping[0] == tbl->n_cols - 1)\r
- o->flags |= KHUI_CW_O_NOOUTLINE;\r
}\r
\r
+ if (grouping[0] == tbl->n_cols - 1)\r
+ o->flags |= KHUI_CW_O_NOOUTLINE;\r
+\r
if (o->flags & KHUI_CW_O_STICKY)\r
kcdb_identity_release(h);\r
else\r
/* leave identity held in this case */\r
- o->flags |= KHUI_CW_O_STICKY;\r
+ o->flags |= KHUI_CW_O_STICKY | KHUI_CW_O_RELIDENT;\r
\r
o->flags &= ~KHUI_CW_O_EXPAND;\r
o->start = n_rows;\r
o->length = 1;\r
o->idx_start = -1;\r
+ o->idx_end = -1;\r
\r
cw_set_tbl_row_header(tbl, n_rows, grouping[0], o);\r
\r
if (o->flags & KHUI_CW_O_STICKY) {\r
/* khui_ilist_draw_id(tbl->ilist, IDB_TK_NEW_SM, hdc, \r
r->left, r->bottom - KHUI_SMICON_CY, 0); */\r
+ if (!(o->flags & KHUI_CW_O_NOOUTLINE)) {\r
+ r->left += KHUI_SMICON_CX * 3 / 2;\r
+ }\r
} else if (!(o->flags & KHUI_CW_O_NOOUTLINE)) {\r
if((tbl->mouse_state & CW_MOUSE_WOUTLINE) && \r
tbl->mouse_row == row) {\r
}\r
\r
static void\r
-cw_select_cred_row(khui_credwnd_tbl * tbl, int row, int selected) {\r
+cw_select_row_creds(khui_credwnd_tbl * tbl, int row, int selected) {\r
\r
khm_size j;\r
khm_size idx_start, idx_end;\r
idx_end = tbl->rows[row].idx_end;\r
}\r
\r
+ if (idx_start == -1 || idx_end == -1)\r
+ return;\r
+\r
for (j = idx_start; j <= idx_end; j++) {\r
khm_handle cred = NULL;\r
\r
for(i=0; i<tbl->n_rows; i++) {\r
tbl->rows[i].flags &= ~KHUI_CW_ROW_SELECTED;\r
\r
- if (!(tbl->rows[i].flags & KHUI_CW_ROW_HEADER)) {\r
- cw_select_cred_row(tbl, i, FALSE);\r
- }\r
+ cw_select_row_creds(tbl, i, FALSE);\r
}\r
\r
cw_select_outline_level(tbl->outline, FALSE);\r
\r
for(i=0; i<tbl->n_rows; i++) {\r
tbl->rows[i].flags |= KHUI_CW_ROW_SELECTED;\r
- if (!(tbl->rows[i].flags & KHUI_CW_ROW_HEADER))\r
- cw_select_cred_row(tbl, i, TRUE);\r
+ cw_select_row_creds(tbl, i, TRUE);\r
}\r
\r
cw_select_outline_level(tbl->outline, TRUE);\r
\r
for (i = group_begin; i <= group_end; i++) {\r
tbl->rows[i].flags |= KHUI_CW_ROW_SELECTED;\r
- cw_select_cred_row(tbl, i, TRUE);\r
+ cw_select_row_creds(tbl, i, TRUE);\r
}\r
} else if (toggle) {\r
BOOL select;\r
else\r
tbl->rows[i].flags &= ~KHUI_CW_ROW_SELECTED;\r
\r
- cw_select_cred_row(tbl, i, select);\r
+ cw_select_row_creds(tbl, i, select);\r
}\r
} else if (extend) {\r
int range_begin;\r
for (i = range_begin; i <= range_end; i++) {\r
tbl->rows[i].flags |= KHUI_CW_ROW_SELECTED;\r
\r
- cw_select_cred_row(tbl, i, TRUE);\r
+ cw_select_row_creds(tbl, i, TRUE);\r
}\r
\r
tbl->cursor_row = row;\r
x < KHUI_SMICON_CX * 4) {\r
nm_state |= CW_MOUSE_WICON | CW_MOUSE_WIDGET;\r
}\r
- } else if (tbl->cols[tbl->rows[row].col].attr_id == KCDB_ATTR_ID_NAME) {\r
+ } else if (tbl->cols[o->col].attr_id == KCDB_ATTR_ID_NAME) {\r
if (col == tbl->rows[row].col &&\r
x >= 0 &&\r
x < KHUI_SMICON_CX){\r
\r
InvalidateRect(tbl->hwnd, NULL, TRUE);\r
\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT), KHUI_ACTION_LAYOUT_ID);\r
- kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
}\r
break;\r
\r
\r
InvalidateRect(tbl->hwnd, NULL, TRUE);\r
\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT), \r
- KHUI_ACTION_LAYOUT_LOC);\r
- kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
}\r
break;\r
\r
\r
InvalidateRect(tbl->hwnd, NULL, TRUE);\r
\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT), \r
- KHUI_ACTION_LAYOUT_TYPE);\r
- kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
}\r
break;\r
\r
\r
InvalidateRect(tbl->hwnd, NULL, TRUE);\r
\r
- khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT),\r
- KHUI_ACTION_LAYOUT_CUST);\r
- kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
}\r
break;\r
\r
CONTROL "&Destroy all credentials on exit",IDC_CFG_DESTROYALL,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,36,111,10\r
GROUPBOX "Other",IDC_CFG_OTHER,7,55,241,120\r
- CONTROL "&Run Network Identity Manager in system tray after window close",IDC_CFG_KEEPRUNNING,\r
+ CONTROL "&Run from taskbar notification area after window close",IDC_CFG_KEEPRUNNING,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,68,230,10\r
LTEXT "Clicking on the ¬ification icon",IDC_CFG_NOTACT_STATIC,26,87,99,8\r
COMBOBOX IDC_CFG_NOTACTION,133,85,110,48,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
IDS_ACTION_SET_SRCH_ID "Allow applications to &search"\r
IDS_CFG_ROOT_TITLE "Network Identity Manager Configuration"\r
IDS_CFG_GENERAL_SHORT "General"\r
- IDS_ACTION_NEW_CRED "&New credentials ..."\r
+ IDS_ACTION_NEW_CRED "Obtain &new credentials ..."\r
IDS_ACTION_PASSWD_ID "Change &password"\r
IDS_ACTION_CHOOSE_COLS "View columns"\r
IDS_ACTION_DEBUG_WINDOW "Debug window"\r
IDS_ACTION_OPT_KHIM "General"\r
IDS_ACTION_OPT_IDENTS "Identities"\r
IDS_ACTION_OPT_NOTIF "Notifications"\r
- IDS_ACTION_HELP_CTX "Help Index"\r
+ IDS_ACTION_HELP_CTX "Help Contents"\r
IDS_ACTION_HELP_CONTENTS "Contents"\r
IDS_ACTION_HELP_INDEX "Index"\r
IDS_ACTION_HELP_ABOUT "About Network Identity Manager"\r
MAX_ILIST, 5, 0);\r
for(i=0;i<MAX_ILIST;i++)\r
il_icon_id[i] = -1;\r
+\r
+ khm_refresh_identity_menus();\r
}\r
\r
void khui_exit_menu(void) {\r
if(act->type & KHUI_ACTIONTYPE_TOGGLE) {\r
mii.fMask |= MIIM_STATE;\r
if (act->state & KHUI_ACTIONSTATE_CHECKED) {\r
+ mii.fState &= ~MFS_UNCHECKED;\r
mii.fState |= MFS_CHECKED;\r
} else {\r
+ mii.fState &= ~MFS_CHECKED;\r
mii.fState |= MFS_UNCHECKED;\r
}\r
}\r
khm_size t;\r
khm_int32 rv = KHM_ERROR_SUCCESS;\r
\r
+ kcdb_identity_refresh_all();\r
+\r
khui_action_lock();\r
\r
idcmd_refreshcycle++;\r
\r
} while(TRUE);\r
\r
+ if (idlist != NULL && n_idents > 0) {\r
+ khui_enable_action(KHUI_MENU_RENEW_CRED, TRUE);\r
+ khui_enable_action(KHUI_MENU_DESTROY_CRED, TRUE);\r
+ khui_enable_action(KHUI_ACTION_RENEW_CRED, TRUE);\r
+ khui_enable_action(KHUI_ACTION_DESTROY_CRED, TRUE);\r
+ } else {\r
+ khui_enable_action(KHUI_MENU_RENEW_CRED, FALSE);\r
+ khui_enable_action(KHUI_MENU_DESTROY_CRED, FALSE);\r
+ khui_enable_action(KHUI_ACTION_RENEW_CRED, FALSE);\r
+ khui_enable_action(KHUI_ACTION_DESTROY_CRED, FALSE);\r
+ }\r
+\r
renew_def = khui_find_menu(KHUI_MENU_RENEW_CRED);\r
dest_def = khui_find_menu(KHUI_MENU_DESTROY_CRED);\r
#ifdef DEBUG\r
khui_menu_remove_action(renew_def, 0);\r
t--;\r
}\r
- khui_menu_insert_action(renew_def, 0, KHUI_ACTION_RENEW_ALL, 0);\r
\r
t = khui_menu_get_size(dest_def);\r
while(t) {\r
khui_menu_remove_action(dest_def, 0);\r
t--;\r
}\r
- khui_menu_insert_action(dest_def, 0, KHUI_ACTION_DESTROY_ALL, 0);\r
\r
- if (idlist != NULL && n_idents > 0) {\r
+ if (idlist != NULL && n_idents > 1) {\r
+ khui_menu_insert_action(renew_def, 0, KHUI_ACTION_RENEW_ALL, 0);\r
khui_menu_insert_action(renew_def, 1, KHUI_MENU_SEP, 0);\r
+\r
+ khui_menu_insert_action(dest_def, 0, KHUI_ACTION_DESTROY_ALL, 0);\r
khui_menu_insert_action(dest_def, 1, KHUI_MENU_SEP, 0);\r
}\r
\r
MENU_ACTION(KHUI_ACTION_NEW_CRED),\r
MENU_SEP(),\r
MENU_SUBMENU(KHUI_MENU_RENEW_CRED),\r
- MENU_SUBMENU(KHUI_MENU_DESTROY_CRED),\r
MENU_ACTION(KHUI_ACTION_IMPORT),\r
+ MENU_SUBMENU(KHUI_MENU_DESTROY_CRED),\r
MENU_SEP(),\r
MENU_ACTION(KHUI_ACTION_SET_DEF_ID),\r
#if 0\r
khui_action_ref khui_menu_help[] = {\r
MENU_ACTION(KHUI_ACTION_HELP_CTX),\r
MENU_SEP(),\r
- MENU_ACTION(KHUI_ACTION_HELP_CONTENTS),\r
MENU_ACTION(KHUI_ACTION_HELP_INDEX),\r
MENU_SEP(),\r
MENU_ACTION(KHUI_ACTION_HELP_ABOUT),\r
MENU_SEP(),\r
MENU_ACTION(KHUI_ACTION_NEW_CRED),\r
MENU_SUBMENU(KHUI_MENU_RENEW_CRED),\r
+ MENU_ACTION(KHUI_ACTION_IMPORT),\r
MENU_SUBMENU(KHUI_MENU_DESTROY_CRED),\r
MENU_SEP(),\r
+ MENU_ACTION(KHUI_ACTION_PASSWD_ID),\r
+ MENU_SEP(),\r
+ MENU_ACTION(KHUI_ACTION_HELP_CTX),\r
+ MENU_ACTION(KHUI_ACTION_HELP_ABOUT),\r
+ MENU_SEP(),\r
MENU_ACTION(KHUI_ACTION_EXIT),\r
MENU_END()\r
};\r
MENU_SEP(),\r
MENU_ACTION(KHUI_ACTION_NEW_CRED),\r
MENU_SUBMENU(KHUI_MENU_RENEW_CRED),\r
+ MENU_ACTION(KHUI_ACTION_IMPORT),\r
MENU_SUBMENU(KHUI_MENU_DESTROY_CRED),\r
MENU_SEP(),\r
+ MENU_ACTION(KHUI_ACTION_PASSWD_ID),\r
+ MENU_SEP(),\r
+ MENU_ACTION(KHUI_ACTION_HELP_CTX),\r
+ MENU_ACTION(KHUI_ACTION_HELP_ABOUT),\r
+ MENU_SEP(),\r
MENU_ACTION(KHUI_ACTION_EXIT),\r
MENU_END()\r
};\r