Show
Ignore:
Timestamp:
04/11/06 13:58:09 (3 years ago)
Author:
jordi
Message:

The page navigation toolbar works as expected, setting the sensitiveness of its controls correctly.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DumbMainView.cxx

    r27 r29  
    2727    IMainView (pter) 
    2828{ 
     29    m_CurrentPage = 0; 
    2930    // This won't be deleted because it's presenter responsability. 
    3031    m_DocumentPage = NULL; 
     32    m_GoToPageText = g_strdup (""); 
    3133    m_OpenFileName = g_strdup (""); 
    3234    m_Password = NULL; 
     
    4446    m_Title = g_strdup (""); 
    4547    m_TimesShownPassword = 0; 
     48    m_TotalPages = 0; 
    4649} 
    4750 
    4851DumbMainView::~DumbMainView () 
    4952{ 
     53    g_free (m_GoToPageText); 
    5054    g_free (m_OpenFileName); 
    5155    g_free (m_Password); 
     
    120124} 
    121125 
    122 void 
    123 DumbMainView::show (void) 
    124 { 
    125     m_Shown = TRUE; 
    126 } 
    127  
    128 void 
    129 DumbMainView::showErrorMessage (const gchar *title, const gchar *body) 
    130 { 
    131     m_ShownError = TRUE; 
    132 } 
    133  
    134 void 
    135 DumbMainView::showPage (DocumentPage *page) 
    136 { 
    137     m_DocumentPage = page; 
     126const gchar * 
     127DumbMainView::getGoToPageText () 
     128{ 
     129    return (const gchar *)m_GoToPageText; 
     130} 
     131 
     132void 
     133DumbMainView::setTotalPages (gint pages) 
     134{ 
     135    m_TotalPages = pages; 
     136} 
     137 
     138void 
     139DumbMainView::setGoToPageText (const char *text) 
     140{ 
     141    g_free (m_GoToPageText); 
     142    m_GoToPageText = g_strdup (text); 
     143    m_CurrentPage = atoi(text); 
    138144} 
    139145 
     
    145151} 
    146152 
     153void 
     154DumbMainView::show (void) 
     155{ 
     156    m_Shown = TRUE; 
     157} 
     158 
     159void 
     160DumbMainView::showErrorMessage (const gchar *title, const gchar *body) 
     161{ 
     162    m_ShownError = TRUE; 
     163} 
     164 
     165void 
     166DumbMainView::showPage (DocumentPage *page) 
     167{ 
     168    m_DocumentPage = page; 
     169} 
    147170 
    148171//////////////////////////////////////////////////////////////// 
     
    154177{ 
    155178    return m_TimesShownPassword; 
     179} 
     180 
     181gint 
     182DumbMainView::getCurrentPage () 
     183{ 
     184    return m_CurrentPage; 
     185} 
     186 
     187gint 
     188DumbMainView::getTotalPages () 
     189{ 
     190    return m_TotalPages; 
    156191} 
    157192