mirror of
https://github.com/henrypp/simplewall.git
synced 2026-10-21 18:43:09 -05:00
use _app_message_displayinfo and cleanup
This commit is contained in:
2 files changed
+8
-28
No files matched your search
+3
-10
@@ -446,7 +446,7 @@ INT_PTR CALLBACK PropertiesPagesProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM
|
||||
|
||||
_app_setcheckboxlock (hwnd, IDC_RULE_APPS_ID, TRUE);
|
||||
|
||||
_r_listview_additemex (hwnd, IDC_RULE_APPS_ID, 0, _app_getappdisplayname (ptr_app, TRUE), I_IMAGECALLBACK, I_GROUPIDCALLBACK, ptr_app->app_hash);
|
||||
_r_listview_additemex (hwnd, IDC_RULE_APPS_ID, 0, LPSTR_TEXTCALLBACK, I_IMAGECALLBACK, I_GROUPIDCALLBACK, ptr_app->app_hash);
|
||||
_r_listview_setitemcheck (hwnd, IDC_RULE_APPS_ID, 0, is_enabled);
|
||||
|
||||
_app_setcheckboxlock (hwnd, IDC_RULE_APPS_ID, FALSE);
|
||||
@@ -529,7 +529,6 @@ INT_PTR CALLBACK PropertiesPagesProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM
|
||||
_r_listview_addgroup (hwnd, IDC_APP_RULES_ID, 1, _r_locale_getstring (IDS_TRAY_USER_RULES), 0, LVGS_COLLAPSIBLE, LVGS_COLLAPSIBLE);
|
||||
|
||||
// initialize
|
||||
WCHAR buffer[128] = {0};
|
||||
PITEM_RULE ptr_rule;
|
||||
BOOLEAN is_enabled;
|
||||
|
||||
@@ -545,15 +544,9 @@ INT_PTR CALLBACK PropertiesPagesProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM
|
||||
// check for services
|
||||
is_enabled = ((ptr_rule->is_forservices && (context->ptr_app->app_hash == config.ntoskrnl_hash || context->ptr_app->app_hash == config.svchost_hash)) || _r_obj_findhashtable (ptr_rule->apps, context->ptr_app->app_hash));
|
||||
|
||||
if (ptr_rule->name)
|
||||
_r_str_copy (buffer, RTL_NUMBER_OF (buffer), ptr_rule->name->buffer);
|
||||
|
||||
if (ptr_rule->is_readonly)
|
||||
_r_str_append (buffer, RTL_NUMBER_OF (buffer), SZ_RULE_INTERNAL_MENU);
|
||||
|
||||
_app_setcheckboxlock (hwnd, IDC_APP_RULES_ID, TRUE);
|
||||
|
||||
_r_listview_additemex (hwnd, IDC_APP_RULES_ID, 0, buffer, I_IMAGECALLBACK, I_GROUPIDCALLBACK, i);
|
||||
_r_listview_additemex (hwnd, IDC_APP_RULES_ID, 0, LPSTR_TEXTCALLBACK, I_IMAGECALLBACK, I_GROUPIDCALLBACK, i);
|
||||
_r_listview_setitemcheck (hwnd, IDC_APP_RULES_ID, 0, is_enabled);
|
||||
|
||||
_app_setcheckboxlock (hwnd, IDC_APP_RULES_ID, FALSE);
|
||||
@@ -762,7 +755,7 @@ INT_PTR CALLBACK PropertiesPagesProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM
|
||||
lpnmlv = (LPNMLVDISPINFOW)lparam;
|
||||
listview_id = (INT)(INT_PTR)lpnmlv->hdr.idFrom;
|
||||
|
||||
_app_getdisplayinfo (hwnd, listview_id, lpnmlv);
|
||||
_app_message_displayinfo (hwnd, listview_id, lpnmlv);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-18
@@ -2201,7 +2201,7 @@ INT_PTR CALLBACK DlgProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In
|
||||
lpnmlv = (LPNMLVDISPINFOW)lparam;
|
||||
listview_id = (INT)(INT_PTR)lpnmlv->hdr.idFrom;
|
||||
|
||||
_app_getdisplayinfo (hwnd, listview_id, lpnmlv);
|
||||
_app_message_displayinfo (hwnd, listview_id, lpnmlv);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2625,8 +2625,7 @@ INT_PTR CALLBACK DlgProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In
|
||||
|
||||
case IDM_SHOWFILENAMESONLY_CHK:
|
||||
{
|
||||
PITEM_APP ptr_app;
|
||||
SIZE_T enum_key;
|
||||
INT listview_id;
|
||||
BOOLEAN new_val;
|
||||
|
||||
new_val = !_r_config_getboolean (L"ShowFilenames", TRUE);
|
||||
@@ -2634,22 +2633,10 @@ INT_PTR CALLBACK DlgProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In
|
||||
_r_menu_checkitem (GetMenu (hwnd), ctrl_id, 0, MF_BYCOMMAND, new_val);
|
||||
_r_config_setboolean (L"ShowFilenames", new_val);
|
||||
|
||||
// regroup apps
|
||||
_r_queuedlock_acquireshared (&lock_apps);
|
||||
listview_id = _app_getcurrentlistview_id (hwnd);
|
||||
|
||||
enum_key = 0;
|
||||
|
||||
while (_r_obj_enumhashtablepointer (apps_table, &ptr_app, NULL, &enum_key))
|
||||
{
|
||||
if (_r_obj_isstringempty (ptr_app->short_name))
|
||||
continue;
|
||||
|
||||
_app_updateitembylparam (hwnd, ptr_app->app_hash, TRUE);
|
||||
}
|
||||
|
||||
_r_queuedlock_releaseshared (&lock_apps);
|
||||
|
||||
_app_listviewsort (hwnd, _app_getcurrentlistview_id (hwnd), -1, FALSE);
|
||||
_r_listview_redraw (hwnd, listview_id, -1);
|
||||
_app_listviewsort (hwnd, listview_id, -1, FALSE);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user