Changeset 216

Show
Ignore:
Timestamp:
06/10/06 18:42:54 (2 years ago)
Author:
jordi
Message:

Added a test suite for the PrintPter? and a Dumb view for testing purposes. I've created the first test that checks the initial control's sensitivity.

Location:
trunk
Files:
4 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/IPrintView.h

    r213 r216  
    6161            } 
    6262 
     63            /// 
     64            /// @brief Changes the sensitivity of the "Collate" option. 
     65            /// 
     66            /// The view must change the sensitivity (it's called enabled or 
     67            /// disabled on some toolkits) of the "Collate" option. 
     68            /// 
     69            /// @param sensitive Set to TRUE to make sensitive (enable) the 
     70            ///                  option or FALSE to insensitive (disable) it. 
     71            /// 
     72            virtual void sensitiveCollate (gboolean sensitive) = 0; 
     73 
     74            /// 
     75            /// @brief Changes the sensitivity of the "Page Range" entry. 
     76            /// 
     77            /// The view must change the sensitivity (it's called enabled or 
     78            /// disabled on some toolkits) of the "Page Range" entry. 
     79            /// 
     80            /// @param sensitive Set to TRUE if need to make sensitive (enable) 
     81            ///                  the entry or FALSE to insensitive (disable) it. 
     82            /// 
     83            virtual void sensitivePageRange (gboolean sensitive) = 0; 
     84 
    6385        protected: 
    6486            /// The presenter that controls the view. 
  • trunk/src/PrintPter.cxx

    r213 r216  
    4343{ 
    4444    m_View = view; 
     45 
     46    // Set the page range and collate options insensitive. 
     47    view->sensitiveCollate (FALSE); 
     48    view->sensitivePageRange (FALSE); 
     49 
    4550    getView ().setPresenter (this); 
    4651} 
  • trunk/tests/DumbMainView.cxx

    r212 r216  
    2020#include "DumbFindView.h" 
    2121#include "DumbPageView.h" 
     22#include "DumbPreferencesView.h" 
     23#include "DumbPrintView.h" 
    2224#include "DumbMainView.h" 
    2325 
     
    110112DumbMainView::getPreferencesView () 
    111113{ 
    112     return (IPreferencesView *)0; 
    113 } 
     114    return new DumbPreferencesView (); 
     115} 
     116 
     117#if defined (HAVE_CUPS) 
     118IPrintView * 
     119DumbMainView::getPrintView () 
     120{ 
     121    return new DumbPrintView (); 
     122} 
     123#endif // HAVE_CUPS 
     124 
    114125 
    115126gchar * 
  • trunk/tests/DumbMainView.h

    r212 r216  
    3636            IFindView *getFindView (void); 
    3737            IPageView *getPageView (void); 
     38#if defined (HAVE_CUPS) 
     39            IPrintView *getPrintView (void); 
     40#endif // HAVE_CUPS 
    3841            IPreferencesView *getPreferencesView (void); 
    3942            const gchar *getZoomText (void); 
  • trunk/tests/Makefile.am

    r198 r216  
    5050    $(CPPUNIT_LIBS) \ 
    5151    $(top_builddir)/src/libepdfview.a 
     52 
     53if cups_printing 
     54test_epdfview_SOURCES +=    \ 
     55    DumbPrintView.cxx   \ 
     56    DumbPrintView.h \ 
     57    PrintPterTest.cxx   \ 
     58    PrintPterText.h 
     59 
     60test_epdfview_CXXFLAGS +=   \ 
     61    $(CUPS_CFLAGS) 
     62 
     63test_epdfview_LDADD +=  \ 
     64    $(CUPS_LIBS) 
     65endif