Changeset 213

Show
Ignore:
Timestamp:
06/10/06 14:14:55 (2 years ago)
Author:
jordi
Message:

configure script now sets a Makefile condition about printing support. A new empty print dialog has been added.

Location:
trunk
Files:
5 added
11 modified

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r211 r213  
    4747 
    4848EPDFVIEW_PATH_CUPS([CUPS], [have_cups=yes]) 
     49AM_CONDITIONAL(cups_printing, test "x$have_cups" = "xyes") 
    4950if test "x$have_cups" = "xyes"; then 
    5051    AC_SUBST([CUPS_CFLAGS]) 
  • trunk/src/IMainView.h

    r212 r213  
    511511            virtual IPreferencesView *getPreferencesView (void) = 0; 
    512512 
     513#if defined (HAVE_CUPS) 
     514            /// 
     515            /// @brief Gets the print's view. 
     516            /// 
     517            /// The print view is created each time the presenter 
     518            /// class this function, with the main view as its parent window. 
     519            /// 
     520            /// @return The new print view. The returned pointer must be 
     521            ///         freed by the caller. 
     522            /// 
     523            virtual IPrintView *getPrintView (void) = 0; 
     524#endif // HAVE_CUPS 
     525 
    513526            /// 
    514527            /// @brief Gets the text from the zoom entry. 
  • trunk/src/MainPter.cxx

    r212 r213  
    446446} 
    447447 
     448#if defined (HAVE_CUPS) 
     449/// 
     450/// @brief The "print" action was activated. 
     451/// 
     452void 
     453MainPter::printActivated () 
     454{ 
     455    PrintPter *print = new PrintPter (); 
     456    IPrintView *view = getView ().getPrintView (); 
     457    if ( NULL != view ) 
     458    { 
     459        print->setView (view); 
     460    } 
     461    else 
     462    { 
     463        delete print; 
     464    } 
     465    // There's no need to keep a pointer to the presenter because 
     466    // it will destroy itself when the dialog is closed. 
     467} 
     468#endif // HAVE_CUPS 
     469 
    448470/// 
    449471/// @brief The "Preferences" was activated. 
     
    458480        preferences->setView (view); 
    459481    } 
     482    else 
     483    { 
     484        delete preferences; 
     485    } 
    460486    // There's no need to keep a pointer of the preferences presenter because 
    461     // when the dialog is closed of the application is finished it will 
     487    // when the dialog is closed or the application is finished it will 
    462488    // destroy itself. 
    463489} 
  • trunk/src/MainPter.h

    r209 r213  
    5757            void outlineActivated (DocumentOutline *outline); 
    5858            void preferencesActivated (void); 
     59#if defined (HAVE_CUPS) 
     60            void printActivated (void); 
     61#endif // HAVE_CUPS 
    5962            void reloadActivated (void); 
    6063            void rotateLeftActivated (void); 
  • trunk/src/Makefile.am

    r200 r213  
    7272    $(libshell_ldadd)   \ 
    7373    $(POPPLER_LIBS) 
     74 
     75if cups_printing 
     76libepdfview_a_SOURCES +=    \ 
     77    IPrintView.h    \ 
     78    PrintPter.cxx   \ 
     79    PrintPter.h 
     80 
     81libepdfview_a_CXXFLAGS +=   \ 
     82    $(CUPS_CFLAGS) 
     83 
     84epdfview_LDADD +=   \ 
     85    $(CUPS_LIBS) 
     86endif 
     87 
  • trunk/src/epdfview.h

    r200 r213  
    4040#include <JobRender.h> 
    4141#include <JobSave.h> 
     42#if defined (HAVE_CUPS) 
     43#endif // HAVE_CUPS 
    4244 
    4345#include <IFindView.h> 
    4446#include <IPageView.h> 
    4547#include <IPreferencesView.h> 
     48#if defined (HAVE_CUPS) 
     49#include <IPrintView.h> 
     50#endif // HAVE_CUPS 
    4651#include <IMainView.h> 
    4752#include <FindPter.h> 
    4853#include <PagePter.h> 
    4954#include <PreferencesPter.h> 
     55#if defined (HAVE_CUPS) 
     56#include <PrintPter.h> 
     57#endif // HAVE_CUPS 
    5058#include <MainPter.h> 
    5159 
  • trunk/src/gtk/MainView.cxx

    r212 r213  
    2626#include "PageView.h" 
    2727#include "PreferencesView.h" 
     28#if defined (HAVE_CUPS) 
     29#include "PrintView.h" 
     30#endif // HAVE_CUPS 
    2831#include "MainView.h" 
    2932 
     
    543546} 
    544547 
    545 void  
     548void 
    546549MainView::sensitiveZoomWidth (gboolean sensitive) 
    547550{ 
    548     GtkAction *zoomWidth =  
     551    GtkAction *zoomWidth = 
    549552        gtk_ui_manager_get_action (m_UIManager, "/MenuBar/ViewMenu/ZoomWidth"); 
    550553    gtk_action_set_sensitive (zoomWidth, sensitive); 
    551554} 
    552555 
    553 void  
     556void 
    554557MainView::show (void) 
    555 {     
     558{ 
    556559    Config &config = Config::getConfig (); 
    557560    gtk_window_set_default_size (GTK_WINDOW (m_MainWindow), 
     
    563566} 
    564567 
    565 void  
     568void 
    566569MainView::showErrorMessage (const gchar *title, const gchar *body) 
    567570{ 
     
    681684    return new PreferencesView (GTK_WINDOW (m_MainWindow)); 
    682685} 
     686 
     687#if defined (HAVE_CUPS) 
     688IPrintView * 
     689MainView::getPrintView () 
     690{ 
     691    return new PrintView (GTK_WINDOW (m_MainWindow)); 
     692} 
     693#endif // HAVE_CUPS 
    683694 
    684695void 
     
    11971208 
    11981209    MainPter *pter = (MainPter *)data; 
     1210    pter->printActivated (); 
    11991211} 
    12001212#endif // HAVE_CUPS 
  • trunk/src/gtk/MainView.h

    r212 r213  
    7070            IPageView *getPageView (void); 
    7171            IPreferencesView *getPreferencesView (void); 
     72#if defined (HAVE_CUPS) 
     73            IPrintView *getPrintView (void); 
     74#endif // HAVE_CUPS 
    7275            const gchar *getZoomText (void); 
    7376            void setTitle (const gchar *title); 
  • trunk/src/gtk/Makefile.am

    r199 r213  
    1717    -I$(top_srcdir)/src \ 
    1818    $(GTK2_CFLAGS) 
     19 
     20if cups_printing 
     21libshell_gtk_a_SOURCES +=   \ 
     22    PrintView.cxx   \ 
     23    PrintView.h 
     24endif 
  • trunk/src/gtk/PreferencesView.cxx

    r199 r213  
    2727static void preferences_view_browser_command_changed (GtkEntry *, gpointer); 
    2828 
    29 PreferencesView::PreferencesView (GtkWindow *parent) 
     29PreferencesView::PreferencesView (GtkWindow *parent): 
     30    IPreferencesView () 
    3031{ 
    3132    m_PreferencesDialog = gtk_dialog_new_with_buttons (_("Preferences"), 
     
    3334            GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, 
    3435            NULL); 
    35     // Utility dialog should now show itself in the window list. 
     36    // Utility dialog should not show itself in the window list. 
    3637    gtk_window_set_skip_taskbar_hint (GTK_WINDOW (m_PreferencesDialog), TRUE); 
    3738 
  • trunk/src/gtk/PreferencesView.h

    r199 r213  
    3030            virtual const gchar *getBrowserCommandLine (void); 
    3131 
    32             GtkWidget *createExternalCommandsTab (void); 
    33  
    3432        protected: 
    3533            GtkWidget *m_PreferencesDialog; 
    3634            GtkWidget *m_BrowserCommandLine; 
     35 
     36            GtkWidget *createExternalCommandsTab (void); 
    3737    }; 
    3838}