Show
Ignore:
Timestamp:
04/11/06 12:15:53 (3 years ago)
Author:
jordi
Message:

The user can now open an encrypted pdf file, as the presenter will ask for the password three time before to show an error, or until the user gives the cancels out.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DumbMainView.cxx

    r26 r27  
    3030    m_DocumentPage = NULL; 
    3131    m_OpenFileName = g_strdup (""); 
     32    m_Password = NULL; 
    3233    m_SensitiveGoToFirstPage = TRUE; 
    3334    m_SensitiveGoToLastPage = TRUE; 
     
    4243    m_ShownError = FALSE; 
    4344    m_Title = g_strdup (""); 
     45    m_TimesShownPassword = 0; 
    4446} 
    4547 
     
    4749{ 
    4850    g_free (m_OpenFileName); 
     51    g_free (m_Password); 
    4952    g_free (m_Title); 
    5053} 
     
    5659} 
    5760 
     61gchar * 
     62DumbMainView::promptPasswordDialog (void) 
     63{ 
     64    m_TimesShownPassword++; 
     65    return g_strdup (m_Password); 
     66} 
     67 
    5868void 
    5969DumbMainView::sensitiveGoToFirstPage (gboolean sensitive) 
     
    139149// Test Methods 
    140150//////////////////////////////////////////////////////////////// 
     151 
     152gint 
     153DumbMainView::countTimesShownPasswordPrompt () 
     154{ 
     155    return m_TimesShownPassword; 
     156} 
    141157 
    142158gboolean 
     
    220236{ 
    221237    g_free (m_OpenFileName); 
    222     m_OpenFileName = NULL; 
    223     if ( NULL != fileName ) 
    224     { 
    225         m_OpenFileName = g_strdup (fileName); 
    226     } 
     238    m_OpenFileName = g_strdup (fileName); 
     239} 
     240 
     241void 
     242DumbMainView::setPassword (const gchar *password) 
     243{ 
     244    g_free (m_Password); 
     245    m_Password = g_strdup (password); 
     246    m_TimesShownPassword = 0; 
    227247} 
    228248