]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
KfW GUI -- clean up 'About' dialog
authorKevin Wasserman <kevin.wasserman@painless-security.com>
Thu, 28 Jun 2012 22:16:21 +0000 (18:16 -0400)
committerBen Kaduk <kaduk@mit.edu>
Mon, 27 Aug 2012 15:48:13 +0000 (11:48 -0400)
By default, hide the debug list of loaded modules; change LeashView.cpp
and recompile to get the list.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7291 (new)
queue: kfw
target_version: 1.10.4
tags: pullup

src/windows/leash/LeashAboutBox.cpp
src/windows/leash/LeashAboutBox.h
src/windows/leash/LeashView.cpp

index 8c6f7f425b5e9646f8cf9ea112be4b39a320f9d4..d8e3fde09cea0b7dc329c9ed817acb6b1b726733 100644 (file)
@@ -33,6 +33,7 @@ static char THIS_FILE[] = __FILE__;
 
 CLeashAboutBox::CLeashAboutBox(CWnd* pParent /*=NULL*/)
        : CDialog(CLeashAboutBox::IDD, pParent)
+        , m_bListModules(FALSE)
 {
     m_missingFileError = FALSE;
 
@@ -244,20 +245,44 @@ BOOL CLeashAboutBox::OnInitDialog()
     CDialog::OnInitDialog();
 
     // XXX - we need to add some sensible behavior on error.
+    // We need to get the version info and display it...
     SetVersionInfo(IDC_ABOUT_VERSION, IDC_ABOUT_COPYRIGHT);
 
     if (!CLeashApp::m_hToolHelp32 && !CLeashApp::m_hPsapi)
         m_missingFileError = TRUE;
 
-    m_radio_LeashDLLs.SetCheck(TRUE);
-    OnLeashModules();
-
-    // We need to get the version info and display it...
-    HighlightFirstItem();
-
-    if (!CLeashApp::m_hPsapi)
-        GetDlgItem(IDC_PROPERTIES)->EnableWindow(FALSE);
-
+    if (m_bListModules) {
+        m_radio_LeashDLLs.SetCheck(TRUE);
+        OnLeashModules();
+
+        HighlightFirstItem();
+
+        if (!CLeashApp::m_hPsapi)
+            GetDlgItem(IDC_PROPERTIES)->EnableWindow(FALSE);
+    } else {
+        m_radio_LeashDLLs.ShowWindow(SW_HIDE);
+        GetDlgItem(IDC_NOT_LOADED_MODULES)->ShowWindow(SW_HIDE);
+        GetDlgItem(IDC_ALL_MODULES)->ShowWindow(SW_HIDE);
+        GetDlgItem(IDC_PROPERTIES)->ShowWindow(SW_HIDE);
+        GetDlgItem(IDC_STATIC_MODULES_LOADED)->ShowWindow(SW_HIDE);
+        GetDlgItem(IDC_STATIC_NO_OF_MODULES)->ShowWindow(SW_HIDE);
+        m_LB_DLLsLoaded.ShowWindow(SW_HIDE);
+        // shrink window, move 'OK' button
+        const int hideDiff = 175;
+        RECT okRect;
+        CWnd* pOK = GetDlgItem(IDOK);
+        pOK->GetWindowRect(&okRect);
+        ScreenToClient(&okRect);
+        pOK->SetWindowPos(0, okRect.left, okRect.top - hideDiff,
+                          0, 0, SWP_NOZORDER | SWP_NOSIZE);
+        RECT dlgRect;
+        GetWindowRect( &dlgRect );
+
+        SetWindowPos(0,0,0,
+                     dlgRect.right-dlgRect.left,
+                     dlgRect.bottom-dlgRect.top - hideDiff,
+                     SWP_NOZORDER|SWP_NOMOVE);
+    }
     return TRUE;  // return TRUE unless you set the focus to a control
     // EXCEPTION: OCX Property Pages should return FALSE
 }
index 34e1dac3131986a48f872d77b5538050a878f3fd..c6dbfc177286b377fe357d3e72e0dea409a7d152 100644 (file)
@@ -45,6 +45,7 @@ public:
     CButton    m_radio_LeashDLLs;
     CListBox   m_LB_DLLsLoaded;
     CString    m_fileItem;
+    BOOL        m_bListModules;
     //}}AFX_DATA
 
 
index cfa985c6d6864742570c8ca2ad5f196fb0c978eb..34b6b7d8e743b4bcefe8206bbc1aa759fd0a9d1d 100644 (file)
@@ -2110,6 +2110,8 @@ LRESULT CLeashView::OnTrayIcon(WPARAM wParam, LPARAM lParam)
 VOID CLeashView::OnAppAbout()
 {
     CLeashAboutBox leashAboutBox;
+    // To debug loaded dlls:
+    // leashAboutBox.m_bListModules = TRUE;
     leashAboutBox.DoModal();
 }