krb5 commit: Leash UI menu updates

Benjamin Kaduk kaduk at MIT.EDU
Thu Aug 23 15:32:47 EDT 2012


https://github.com/krb5/krb5/commit/3152a4c79e34b1954616a39e24c7d179cd08e0bb
commit 3152a4c79e34b1954616a39e24c7d179cd08e0bb
Author: Kevin Wasserman <kevin.wasserman at painless-security.com>
Date:   Tue Apr 3 12:36:44 2012 -0400

    Leash UI menu updates
    
    Eliminate Action menu:
     -move Ticket manipulation to File menu
     -eliminate "Reset Window Size/Pos", "Synchronize Time", and "Update Display"
    
    Update Options menu:
     -eliminate all the "Properties" items:
    	"Leash ", "Kerberos ", "Kerberos v4 ", "Kerberos v5 ", and "AFS"
    	TODO: move functionality to advanced install/registry keys.
    
    Update View menu:
     -add "Time Issued", "Renewable Until", "Flags", "Encryption Type",
       and "Valid Until"
     -remove "Large Icons", "Toolbar", "Status Bar", and "Debug Window"
    
    Signed-off-by: Kevin Wasserman <kevin.wasserman at painless-security.com>
    
    ticket: 7243 (new)
    queue: kfw
    target_version: 1.10.4
    tags: pullup

 src/windows/leash/Leash.rc      |   52 +++----
 src/windows/leash/LeashView.cpp |  302 ++++++++++++++++++++------------------
 src/windows/leash/LeashView.h   |   19 +++
 src/windows/leash/MainFrm.cpp   |    1 -
 src/windows/leash/resource.h    |   13 ++-
 5 files changed, 210 insertions(+), 177 deletions(-)

diff --git a/src/windows/leash/Leash.rc b/src/windows/leash/Leash.rc
index 9594446..f682f25 100644
--- a/src/windows/leash/Leash.rc
+++ b/src/windows/leash/Leash.rc
@@ -110,40 +110,29 @@ IDR_MAINFRAME MENU
 BEGIN
     POPUP "&File"
     BEGIN
-        MENUITEM "E&xit",                       ID_APP_EXIT
-    END
-    POPUP "&Action"
-    BEGIN
-        MENUITEM "&Gew Ticket(s)/Token(s)\tCtrl+T", ID_INIT_TICKET
-        MENUITEM "&Renew Ticket(s)/Token(s)\tCtrl+R", ID_RENEW_TICKET
-        MENUITEM "&Import Ticket(s)/Token(s)\tCtrl+I", ID_IMPORT_TICKET
-        MENUITEM "&Destroy Ticket(s)/Token(s)\tCtrl+D", ID_DESTROY_TICKET
+        MENUITEM "&Initialize Ticket(s)\tCtrl+T", ID_INIT_TICKET
+        MENUITEM "&Renew Ticket(s)\tCtrl+R",    ID_RENEW_TICKET
+        MENUITEM "&Import Ticket(s)\tCtrl+I",   ID_IMPORT_TICKET
+        MENUITEM "&Destroy Ticket(s)\tCtrl+D",  ID_DESTROY_TICKET
         MENUITEM SEPARATOR
         MENUITEM "&Change Password...",         ID_CHANGE_PASSWORD
         MENUITEM SEPARATOR
-        MENUITEM "&Reset Window Size/Pos",      ID_RESET_WINDOW_SIZE
-        MENUITEM "&Synchronize Time",           ID_SYN_TIME
-        MENUITEM "&Update Display\tF5",         ID_UPDATE_DISPLAY
+        MENUITEM "E&xit",                       ID_APP_EXIT
     END
     POPUP "&View"
     BEGIN
-        MENUITEM "&Large Icons",                ID_LARGE_ICONS
-        MENUITEM "&Toolbar",                    ID_VIEW_TOOLBAR
-        MENUITEM "&Status Bar",                 ID_VIEW_STATUS_BAR
-        MENUITEM "&Debug Window",               ID_DEBUG_MODE
+        MENUITEM "&Time Issued",                ID_TIME_ISSUED
+        MENUITEM "&Renewable Until",            ID_RENEWABLE_UNTIL
+        MENUITEM "&Valid Until",                ID_VALID_UNTIL
+        MENUITEM "&Encryption Type",            ID_ENCRYPTION_TYPE
+        MENUITEM "&Flags",                      ID_SHOW_TICKET_FLAGS
     END
     POPUP "&Options"
     BEGIN
         MENUITEM "Upper &Case Realm Name",      ID_UPPERCASE_REALM
         MENUITEM "&Automatic Ticket Renewal",   ID_AUTO_RENEW
         MENUITEM "&Expiration Alarm",           ID_LOW_TICKET_ALARM
-        MENUITEM "&Destroy Tickets/Tokens on Exit", ID_KILL_TIX_ONEXIT
-        MENUITEM SEPARATOR
-        MENUITEM "&Leash Properties...\tCtrl+L", ID_LEASH_PROPERTIES
-        MENUITEM "&Kerberos Properties...\tCtrl+K", ID_PROPERTIES
-        MENUITEM "Kerberos v&4 Properties...\tCtrl+4", ID_KRB4_PROPERTIES
-        MENUITEM "Kerberos v&5 Properties...\tCtrl+5", ID_KRB5_PROPERTIES
-        MENUITEM "&AFS Properties\tCtrl+A",     ID_AFS_CONTROL_PANEL
+        MENUITEM "&Destroy Tickets on Exit",    ID_KILL_TIX_ONEXIT
     END
     POPUP "&Help"
     BEGIN
@@ -165,14 +154,9 @@ END
 
 IDR_MAINFRAME ACCELERATORS
 BEGIN
-    "4",            ID_KRB4_PROPERTIES,     VIRTKEY, CONTROL, NOINVERT
-    "5",            ID_KRB5_PROPERTIES,     VIRTKEY, CONTROL, NOINVERT
-    "A",            ID_AFS_CONTROL_PANEL,   VIRTKEY, CONTROL, NOINVERT
     "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL, NOINVERT
     "D",            ID_DESTROY_TICKET,      VIRTKEY, CONTROL, NOINVERT
     "I",            ID_IMPORT_TICKET,       VIRTKEY, CONTROL, NOINVERT
-    "K",            ID_PROPERTIES,          VIRTKEY, CONTROL, NOINVERT
-    "L",            ID_LEASH_PROPERTIES,    VIRTKEY, CONTROL, NOINVERT
     "N",            ID_FILE_NEW,            VIRTKEY, CONTROL, NOINVERT
     "O",            ID_FILE_OPEN,           VIRTKEY, CONTROL, NOINVERT
     "R",            ID_RENEW_TICKET,        VIRTKEY, CONTROL, NOINVERT
@@ -958,18 +942,24 @@ STRINGTABLE
 BEGIN
     ID_KILL_TIX_ONEXIT      "Dispose of or keep tickets/tokens upon exiting Leash"
     ID_LARGE_ICONS          "Show large or small tree icons"
-    ID_UPPERCASE_REALM      "Force upper or lower case realm name"
+    ID_UPPERCASE_REALM      "Allow mixed case or force upper case realm name"
     ID_OPTIONS_RESETWINDOWSIZE
                             "Puts Leash's main window back to it's default size "
     ID_RESET_WINDOW_SIZE    "Refresh Leash window to it's default size/position"
     ID_AFS_CONTROL_PANEL    "Enables you to change settings"
     ID_SYSTEM_CONTROL_PANEL "Open your System Properties window"
-    ID_KRB4_PROPERTIES      "Enables you to change settings"
-    ID_KRB5_PROPERTIES      "Enables you to change settings"
-    ID_LEASH_PROPERTIES     "Enables you to change settings"
     ID_OPTIONS_LOWTICKETALARMSOUND
                             "Turn alarm off or on,  when ticket time is low"
     ID_LOW_TICKET_ALARM     "Turn alarm on or off, on low ticket(s)/token(s) times"
+    ID_TIME_ISSUED          "Display ticket time issued column"
+    ID_RENEWABLE_UNTIL      "Display ticket renewable until time column"
+    ID_SHOW_TICKET_FLAGS    "Display ticket flags column"
+END
+
+STRINGTABLE
+BEGIN
+    ID_ENCRYPTION_TYPE      "Display ticket encryption type column"
+    ID_VALID_UNTIL          "Display ticket valid until time column"
 END
 
 #endif    // English (U.S.) resources
diff --git a/src/windows/leash/LeashView.cpp b/src/windows/leash/LeashView.cpp
index 3c91e32..163f463 100644
--- a/src/windows/leash/LeashView.cpp
+++ b/src/windows/leash/LeashView.cpp
@@ -59,8 +59,20 @@ BEGIN_MESSAGE_MAP(CLeashView, CFormView)
 	ON_COMMAND(ID_SYN_TIME, OnSynTime)
 	ON_COMMAND(ID_DEBUG_MODE, OnDebugMode)
 	ON_COMMAND(ID_LARGE_ICONS, OnLargeIcons)
+	ON_COMMAND(ID_TIME_ISSUED, OnTimeIssued)
+	ON_COMMAND(ID_VALID_UNTIL, OnValidUntil)
+	ON_COMMAND(ID_RENEWABLE_UNTIL, OnRenewableUntil)
+	ON_COMMAND(ID_SHOW_TICKET_FLAGS, OnShowTicketFlags)
+	ON_COMMAND(ID_ENCRYPTION_TYPE, OnEncryptionType)
+	ON_UPDATE_COMMAND_UI(ID_TIME_ISSUED, OnUpdateTimeIssued)
+	ON_UPDATE_COMMAND_UI(ID_VALID_UNTIL, OnUpdateValidUntil)
+	ON_UPDATE_COMMAND_UI(ID_RENEWABLE_UNTIL, OnUpdateRenewableUntil)
+	ON_UPDATE_COMMAND_UI(ID_SHOW_TICKET_FLAGS, OnUpdateShowTicketFlags)
+	ON_UPDATE_COMMAND_UI(ID_ENCRYPTION_TYPE, OnUpdateEncryptionType)
 	ON_COMMAND(ID_UPPERCASE_REALM, OnUppercaseRealm)
 	ON_COMMAND(ID_KILL_TIX_ONEXIT, OnKillTixOnExit)
+	ON_UPDATE_COMMAND_UI(ID_UPPERCASE_REALM, OnUpdateUppercaseRealm)
+	ON_UPDATE_COMMAND_UI(ID_KILL_TIX_ONEXIT, OnUpdateKillTixOnExit)
 	ON_WM_DESTROY()
 	ON_UPDATE_COMMAND_UI(ID_DESTROY_TICKET, OnUpdateDestroyTicket)
     ON_UPDATE_COMMAND_UI(ID_IMPORT_TICKET, OnUpdateImportTicket)
@@ -77,6 +89,8 @@ BEGIN_MESSAGE_MAP(CLeashView, CFormView)
     ON_COMMAND(ID_LEASH_MINIMIZE, OnLeashMinimize)
 	ON_COMMAND(ID_LOW_TICKET_ALARM, OnLowTicketAlarm)
 	ON_COMMAND(ID_AUTO_RENEW, OnAutoRenew)
+	ON_UPDATE_COMMAND_UI(ID_LOW_TICKET_ALARM, OnUpdateLowTicketAlarm)
+	ON_UPDATE_COMMAND_UI(ID_AUTO_RENEW, OnUpdateAutoRenew)
 	ON_UPDATE_COMMAND_UI(ID_KRB4_PROPERTIES, OnUpdateKrb4Properties)
 	ON_UPDATE_COMMAND_UI(ID_KRB5_PROPERTIES, OnUpdateKrb5Properties)
 	ON_UPDATE_COMMAND_UI(ID_AFS_CONTROL_PANEL, OnUpdateAfsControlPanel)
@@ -342,6 +356,13 @@ VOID CLeashView::OnShowWindow(BOOL bShow, UINT nStatus)
         // Public IP Address
         m_publicIPAddress = pLeash_get_default_publicip();
 
+        // @TODO: get/set defaults for these
+        m_showRenewableUntil = m_pApp->GetProfileInt("Settings", "ShowRenewableUntil", OFF);
+        m_showTicketFlags = m_pApp->GetProfileInt("Settings", "ShowTicketFlags", OFF);
+        m_showTimeIssued = m_pApp->GetProfileInt("Settings", "ShowTimeIssued", OFF);
+        m_showValidUntil = m_pApp->GetProfileInt("Settings", "ShowValidUntil", ON);
+        m_showEncryptionType = m_pApp->GetProfileInt("Settings", "ShowEncryptionType", OFF);
+
         OnLargeIcons();
     }
 
@@ -756,9 +777,9 @@ VOID CLeashView::OnDestroyTicket()
                                      MB_ICONEXCLAMATION|MB_YESNO, 0);
         else
             whatToDo = AfxMessageBox("You are about to destroy your ticket(s)/token(s)!",
-                                     MB_OKCANCEL, 0);
+                                     MB_ICONEXCLAMATION|MB_YESNO, 0);
 
-        if (whatToDo == IDOK)
+        if (whatToDo == IDYES)
         {
             pLeash_kdestroy();
             ResetTreeNodes();
@@ -1314,63 +1335,55 @@ VOID CLeashView::OnActivateView(BOOL bActivate, CView* pActivateView,
     } else {
         return;
     }
-    if( m_hMenu == NULL )
-    {
-        AfxMessageBox("There is a problem finding the Leash main menu!",
-                   MB_OK|MB_ICONSTOP);
-        return;
-    }
-    if (!m_largeIcons)
-        check = CheckMenuItem(m_hMenu, ID_LARGE_ICONS, MF_CHECKED);
-    else
-        check = CheckMenuItem(m_hMenu, ID_LARGE_ICONS, MF_UNCHECKED);
 
-    if( check != MF_CHECKED || check != MF_UNCHECKED )
-    {
-        m_debugStartUp = 1;
-    }
+    if (m_hMenu) {
+        if (!m_largeIcons)
+            check = CheckMenuItem(m_hMenu, ID_LARGE_ICONS, MF_CHECKED);
+        else
+            check = CheckMenuItem(m_hMenu, ID_LARGE_ICONS, MF_UNCHECKED);
 
-    if (!m_destroyTicketsOnExit)
-        check = CheckMenuItem(m_hMenu, ID_KILL_TIX_ONEXIT, MF_UNCHECKED);
-    else
-        check = CheckMenuItem(m_hMenu, ID_KILL_TIX_ONEXIT, MF_CHECKED);
+        if( check != MF_CHECKED || check != MF_UNCHECKED )
+        {
+            m_debugStartUp = 1;
+        }
 
-    if (!m_upperCaseRealm)
-        check = CheckMenuItem(m_hMenu, ID_UPPERCASE_REALM, MF_UNCHECKED);
-    else
-        check = CheckMenuItem(m_hMenu, ID_UPPERCASE_REALM, MF_CHECKED);
+        if (!m_destroyTicketsOnExit)
+            check = CheckMenuItem(m_hMenu, ID_KILL_TIX_ONEXIT, MF_UNCHECKED);
+        else
+            check = CheckMenuItem(m_hMenu, ID_KILL_TIX_ONEXIT, MF_CHECKED);
 
-    if (!m_lowTicketAlarm)
-    {
-        m_lowTicketAlarmSound = FALSE;
+        if (!m_upperCaseRealm)
+            check = CheckMenuItem(m_hMenu, ID_UPPERCASE_REALM, MF_UNCHECKED);
+        else
+            check = CheckMenuItem(m_hMenu, ID_UPPERCASE_REALM, MF_CHECKED);
 
-        if (m_hMenu)
+        CheckMenuItem(m_hMenu, ID_SHOW_TICKET_FLAGS,
+                      m_showTicketFlags ? MF_CHECKED : MF_UNCHECKED);
+
+        CheckMenuItem(m_hMenu, ID_RENEWABLE_UNTIL,
+                      m_showRenewableUntil ? MF_CHECKED : MF_UNCHECKED);
+
+        CheckMenuItem(m_hMenu, ID_TIME_ISSUED,
+                      m_showTimeIssued ? MF_CHECKED : MF_UNCHECKED);
+
+
+        if (!m_lowTicketAlarm)
             CheckMenuItem(m_hMenu, ID_LOW_TICKET_ALARM, MF_UNCHECKED);
-    }
-    else
-    {
-        m_lowTicketAlarmSound = TRUE;
-        if (m_hMenu)
+        else
             CheckMenuItem(m_hMenu, ID_LOW_TICKET_ALARM, MF_CHECKED);
-    }
 
-    if (!m_autoRenewTickets)
-    {
-        if (m_hMenu)
+        if (!m_autoRenewTickets)
             CheckMenuItem(m_hMenu, ID_AUTO_RENEW, MF_UNCHECKED);
-    }
-    else
-    {
-        if (m_hMenu)
+        else
             CheckMenuItem(m_hMenu, ID_AUTO_RENEW, MF_CHECKED);
-    }
-
-    m_debugWindow = m_pApp->GetProfileInt("Settings", "DebugWindow", 0);
-    if (!m_debugWindow)
-        check = CheckMenuItem(m_hMenu, ID_DEBUG_MODE, MF_UNCHECKED);
-    else
-        check = CheckMenuItem(m_hMenu, ID_DEBUG_MODE, MF_CHECKED);
 
+        m_debugWindow = m_pApp->GetProfileInt("Settings", "DebugWindow", 0);
+        if (!m_debugWindow)
+            check = CheckMenuItem(m_hMenu, ID_DEBUG_MODE, MF_UNCHECKED);
+        else
+            check = CheckMenuItem(m_hMenu, ID_DEBUG_MODE, MF_CHECKED);
+    }
+    m_lowTicketAlarmSound = !!m_lowTicketAlarm;
     m_alreadyPlayed = TRUE;
     if (m_pApp)
     {
@@ -1486,6 +1499,75 @@ VOID CLeashView::OnDebugMode()
     }
 }
 
+VOID CLeashView::OnRenewableUntil()
+{
+    m_showRenewableUntil = !m_showRenewableUntil;
+    if (m_hMenu)
+        CheckMenuItem(m_hMenu, ID_RENEWABLE_UNTIL,
+                      m_showRenewableUntil ? MF_CHECKED : MF_UNCHECKED);
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "ShowRenewableUntil", m_showRenewableUntil);
+}
+
+VOID CLeashView::OnUpdateRenewableUntil(CCmdUI *pCmdUI)
+{
+    pCmdUI->SetCheck(m_showRenewableUntil);
+}
+
+VOID CLeashView::OnShowTicketFlags()
+{
+    m_showTicketFlags = !m_showTicketFlags;
+    if (m_hMenu)
+        CheckMenuItem(m_hMenu, ID_SHOW_TICKET_FLAGS,
+                      m_showTicketFlags ? MF_CHECKED : MF_UNCHECKED);
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "ShowTicketFlags", m_showTicketFlags);
+}
+
+VOID CLeashView::OnUpdateShowTicketFlags(CCmdUI *pCmdUI)
+{
+    pCmdUI->SetCheck(m_showTicketFlags);
+}
+
+VOID CLeashView::OnTimeIssued()
+{
+    m_showTimeIssued = !m_showTimeIssued;
+    if (m_hMenu)
+        CheckMenuItem(m_hMenu, ID_TIME_ISSUED,
+                      m_showTimeIssued ? MF_CHECKED : MF_UNCHECKED);
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "ShowTimeIssued", m_showTimeIssued);
+}
+
+VOID CLeashView::OnUpdateTimeIssued(CCmdUI *pCmdUI)
+{
+    pCmdUI->SetCheck(m_showTimeIssued);
+}
+
+VOID CLeashView::OnValidUntil()
+{
+    m_showValidUntil = !m_showValidUntil;
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "ShowValidUntil", m_showValidUntil);
+}
+
+VOID CLeashView::OnUpdateValidUntil(CCmdUI *pCmdUI)
+{
+    pCmdUI->SetCheck(m_showValidUntil);
+}
+
+VOID CLeashView::OnEncryptionType()
+{
+    m_showEncryptionType = !m_showEncryptionType;
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "ShowEncryptionType", m_showEncryptionType);
+}
+
+VOID CLeashView::OnUpdateEncryptionType(CCmdUI *pCmdUI)
+{
+    pCmdUI->SetCheck(m_showEncryptionType);
+}
+
 VOID CLeashView::OnLargeIcons()
 {
     INT x, y, n;
@@ -1598,64 +1680,29 @@ VOID CLeashView::OnLargeIcons()
 
 VOID CLeashView::OnKillTixOnExit()
 {
-    if (m_destroyTicketsOnExit%2 == 0)
-        m_destroyTicketsOnExit = ON;
-    else
-        m_destroyTicketsOnExit = OFF;
+    m_destroyTicketsOnExit = !m_destroyTicketsOnExit;
 
     if (m_pApp)
-    {
-        if (!m_destroyTicketsOnExit)
-        {
-            if (m_hMenu)
-                CheckMenuItem(m_hMenu, ID_KILL_TIX_ONEXIT, MF_UNCHECKED);
-
-            AfxMessageBox("Tickets will be not be destroyed upon exiting Leash!!!",
-                       MB_OK|MB_ICONWARNING);
-            m_pApp->WriteProfileInt("Settings", "DestroyTicketsOnExit",
-                                    FALSE_FLAG);
-        }
-        else
-        {
-            if (m_hMenu)
-                CheckMenuItem(m_hMenu, ID_KILL_TIX_ONEXIT, MF_CHECKED);
+        m_pApp->WriteProfileInt("Settings", "DestroyTicketsOnExit",
+                                m_destroyTicketsOnExit);
+}
 
-            AfxMessageBox("All tickets/tokens will be destroyed upon exiting Leash!!!",
-                       MB_OK|MB_ICONWARNING);
-            m_pApp->WriteProfileInt("Settings", "DestroyTicketsOnExit", TRUE_FLAG);
-        }
-    }
-    else
-    {
-        ApplicationInfoMissingMsg();
-    }
+VOID CLeashView::OnUpdateKillTixOnExit(CCmdUI *pCmdUI)
+{
+    pCmdUI->SetCheck(m_destroyTicketsOnExit);
 }
 
 VOID CLeashView::OnUppercaseRealm()
 {
-    if (m_upperCaseRealm%2 == 0)
-        m_upperCaseRealm = ON;
-    else
-        m_upperCaseRealm = OFF;
-
-    if (!m_pApp)
-    {
-        ApplicationInfoMissingMsg();
-    }
-    else if (!m_upperCaseRealm)
-    {
-        pLeash_set_default_uppercaserealm(FALSE_FLAG);
+    m_upperCaseRealm = !m_upperCaseRealm;
 
-        if (m_hMenu)
-            CheckMenuItem(m_hMenu, ID_UPPERCASE_REALM, MF_UNCHECKED);
-    }
-    else
-    {
-        pLeash_set_default_uppercaserealm(TRUE_FLAG);
+    pLeash_set_default_uppercaserealm(m_upperCaseRealm);
+}
 
-        if (m_hMenu)
-            CheckMenuItem(m_hMenu, ID_UPPERCASE_REALM, MF_CHECKED);
-    }
+VOID CLeashView::OnUpdateUppercaseRealm(CCmdUI *pCmdUI)
+{
+    // description is now 'allow mixed case', so reverse logic
+    pCmdUI->SetCheck(!m_upperCaseRealm);
 }
 
 VOID CLeashView::ResetTreeNodes()
@@ -2746,63 +2793,32 @@ BOOL CLeashView::PreTranslateMessage(MSG* pMsg)
 
 VOID CLeashView::OnLowTicketAlarm()
 {
-    if (m_lowTicketAlarm%2 == 0)
-        m_lowTicketAlarm = ON;
-    else
-        m_lowTicketAlarm = OFF;
-
+    m_lowTicketAlarm = !m_lowTicketAlarm;
 
-    if (!m_pApp)
-    {
-        ApplicationInfoMissingMsg();
-    }
-    else if (!m_lowTicketAlarm)
-    {
-        if (m_hMenu)
-            CheckMenuItem(m_hMenu, ID_LOW_TICKET_ALARM, MF_UNCHECKED);
-
-        m_pApp->WriteProfileInt("Settings", "LowTicketAlarm", FALSE_FLAG);
-    }
-    else
-    {
-        if (m_hMenu)
-            CheckMenuItem(m_hMenu, ID_LOW_TICKET_ALARM, MF_CHECKED);
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "LowTicketAlarm", m_lowTicketAlarm);
+}
 
-        m_pApp->WriteProfileInt("Settings", "LowTicketAlarm", TRUE_FLAG);
-    }
+VOID CLeashView::OnUpdateLowTicketAlarm(CCmdUI* pCmdUI)
+{
+    pCmdUI->SetCheck(m_lowTicketAlarm);
 }
 
 VOID CLeashView::OnAutoRenew()
 {
-    if (m_autoRenewTickets%2 == 0)
-        m_autoRenewTickets = ON;
-    else
-        m_autoRenewTickets = OFF;
-
+    m_autoRenewTickets = !m_autoRenewTickets;
 
-    if (!m_pApp)
-    {
-        ApplicationInfoMissingMsg();
-    }
-    else if (!m_autoRenewTickets)
-    {
-        if (m_hMenu)
-            CheckMenuItem(m_hMenu, ID_AUTO_RENEW, MF_UNCHECKED);
-
-        m_pApp->WriteProfileInt("Settings", "AutoRenewTickets", FALSE_FLAG);
-        m_autoRenewTickets = FALSE;
-    }
-    else
-    {
-        if (m_hMenu)
-            CheckMenuItem(m_hMenu, ID_AUTO_RENEW, MF_CHECKED);
+    if (m_pApp)
+        m_pApp->WriteProfileInt("Settings", "AutoRenewTickets", m_autoRenewTickets);
 
-        m_pApp->WriteProfileInt("Settings", "AutoRenewTickets", TRUE_FLAG);
-        m_autoRenewTickets = TRUE;
-    }
     m_autoRenewalAttempted = 0;
 }
 
+VOID CLeashView::OnUpdateAutoRenew(CCmdUI* pCmdUI)
+{
+    pCmdUI->SetCheck(m_autoRenewTickets);
+}
+
 VOID CLeashView::AlarmBeep()
 {
 	if (m_lowTicketAlarmSound)
diff --git a/src/windows/leash/LeashView.h b/src/windows/leash/LeashView.h
index 0d9009a..99ec204 100644
--- a/src/windows/leash/LeashView.h
+++ b/src/windows/leash/LeashView.h
@@ -97,6 +97,11 @@ private:
 	BOOL				m_debugStartUp;
 	BOOL				m_alreadyPlayed;
     INT					m_upperCaseRealm;
+	INT					m_showTicketFlags;
+	INT					m_showTimeIssued;
+	INT					m_showValidUntil;
+	INT					m_showRenewableUntil;
+	INT					m_showEncryptionType;
 	INT					m_destroyTicketsOnExit;
 	INT					m_debugWindow;
 	INT					m_largeIcons;
@@ -223,6 +228,11 @@ protected:
 	afx_msg VOID OnSynTime();
 	afx_msg VOID OnDebugMode();
 	afx_msg VOID OnLargeIcons();
+	afx_msg VOID OnTimeIssued();
+	afx_msg VOID OnValidUntil();
+	afx_msg VOID OnRenewableUntil();
+	afx_msg VOID OnShowTicketFlags();
+	afx_msg VOID OnEncryptionType();
 	afx_msg VOID OnUppercaseRealm();
 	afx_msg VOID OnKillTixOnExit();
 	afx_msg VOID OnDestroy();
@@ -230,6 +240,15 @@ protected:
 	afx_msg VOID OnUpdateImportTicket(CCmdUI* pCmdUI);
 	afx_msg VOID OnUpdateInitTicket(CCmdUI* pCmdUI);
 	afx_msg VOID OnUpdateRenewTicket(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateTimeIssued(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateValidUntil(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateRenewableUntil(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateShowTicketFlags(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateEncryptionType(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateUppercaseRealm(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateKillTixOnExit(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateLowTicketAlarm(CCmdUI* pCmdUI);
+	afx_msg VOID OnUpdateAutoRenew(CCmdUI* pCmdUI);
 	afx_msg VOID OnAppAbout();
 	afx_msg VOID OnAfsControlPanel();
 	afx_msg VOID OnUpdateDebugMode(CCmdUI* pCmdUI);
diff --git a/src/windows/leash/MainFrm.cpp b/src/windows/leash/MainFrm.cpp
index b2d20cc..fe1472c 100644
--- a/src/windows/leash/MainFrm.cpp
+++ b/src/windows/leash/MainFrm.cpp
@@ -46,7 +46,6 @@ IMPLEMENT_DYNCREATE(CMainFrame, CLeashFrame)
 BEGIN_MESSAGE_MAP(CMainFrame, CLeashFrame)
 	//{{AFX_MSG_MAP(CMainFrame)
 	ON_WM_CREATE()
-	ON_COMMAND(ID_RESET_WINDOW_SIZE, OnResetWindowSize)
 	ON_WM_SIZING()
     ON_WM_CLOSE()
 	ON_WM_GETMINMAXINFO()
diff --git a/src/windows/leash/resource.h b/src/windows/leash/resource.h
index 629a75c..24249c9 100644
--- a/src/windows/leash/resource.h
+++ b/src/windows/leash/resource.h
@@ -322,14 +322,23 @@
 #define ID_INIT_TICKET                  32807
 #define ID_AUTO_RENEW                   32808
 #define ID_OBTAIN_TGT_WITH_LPARAM       32809
+#define ID_TIME_ISSUED                  32810
+#define ID_RENEWABLE_UNTIL              32811
+#define ID_SHOW_TICKET_FLAGS            32812
+#define ID_BUTTON2                      32813
+#define ID_BUTTON5                      32816
+#define ID_BUTTON4                      32818
+#define ID_ENCRYPTION_TYPE              32826
+#define ID_VALID_UNTIL                  32828
+#define ID_BUTTON9                      32834
 
 // Next default values for new objects
 //
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        241
-#define _APS_NEXT_COMMAND_VALUE         32810
+#define _APS_NEXT_RESOURCE_VALUE        269
+#define _APS_NEXT_COMMAND_VALUE         32835
 #define _APS_NEXT_CONTROL_VALUE         1207
 #define _APS_NEXT_SYMED_VALUE           101
 #endif


More information about the cvs-krb5 mailing list