]> git.pld-linux.org Git - packages/libreoffice.git/blob - openoffice-print-generic-gui.patch
- DON'T hardcode java paths!
[packages/libreoffice.git] / openoffice-print-generic-gui.patch
1 Index: vcl/inc/salptype.hxx
2 ===================================================================
3 RCS file: /cvs/gsl/vcl/inc/salptype.hxx,v
4 retrieving revision 1.1.1.1
5 diff -u -p -u -r1.1.1.1 salptype.hxx
6 --- vcl/inc/salptype.hxx        19 Sep 2000 10:23:06 -0000      1.1.1.1
7 +++ vcl/inc/salptype.hxx        29 May 2003 14:09:26 -0000
8 @@ -80,8 +80,9 @@
9  // - SalPrinterError -
10  // -------------------
11  
12 -#define SAL_PRINTER_ERROR_GENERALERROR                 1
13 -#define SAL_PRINTER_ERROR_ABORT                                2
14 +#define SAL_PRINTER_ERROR_GENERALERROR  1
15 +#define SAL_PRINTER_ERROR_ABORT         2
16 +#define SAL_PRINTER_ERROR_NO_PRINTER    3
17  
18  
19  // -------------------
20 Index: vcl/source/gdi/print.cxx
21 ===================================================================
22 RCS file: /cvs/gsl/vcl/source/gdi/print.cxx,v
23 retrieving revision 1.41
24 diff -u -p -u -r1.41 print.cxx
25 --- vcl/source/gdi/print.cxx    15 Apr 2003 16:05:54 -0000      1.41
26 +++ vcl/source/gdi/print.cxx    29 May 2003 14:11:18 -0000
27 @@ -1694,6 +1694,9 @@ ULONG ImplSalPrinterErrorCodeToVCL( ULON
28                 case SAL_PRINTER_ERROR_ABORT:
29                         nVCLError = PRINTER_ABORT;
30                         break;
31 +               case SAL_PRINTER_ERROR_NO_PRINTER:
32 +                       nVCLError = ERRCODE_IO_NOTEXISTS;
33 +                       break;
34                 default:
35                         nVCLError = PRINTER_GENERALERROR;
36                         break;
37 @@ -1867,6 +1870,8 @@ BOOL Printer::EndJob()
38  
39                 mnCurPage = 0;
40  
41 +               BOOL success = TRUE;
42 +
43                 if ( mpPrinter )
44                 {
45                         mbPrinting              = FALSE;
46 @@ -1874,7 +1879,13 @@ BOOL Printer::EndJob()
47                         maJobName.Erase();
48  
49                         mbDevOutput = FALSE;
50 -                       mpPrinter->EndJob();
51 +                       if (! mpPrinter->EndJob() )
52 +                       {
53 +                               mnError = ImplSalPrinterErrorCodeToVCL( mpPrinter->GetErrorCode() );
54 +                               if ( !mnError )
55 +                                       mnError = PRINTER_GENERALERROR;
56 +                               success = FALSE;
57 +                       }
58                         // Hier den Drucker nicht asyncron zerstoeren, da es
59                         // W95 nicht verkraftet, wenn gleichzeitig gedruckt wird
60                         // und ein Druckerobjekt zerstoert wird
61 @@ -1885,7 +1896,7 @@ BOOL Printer::EndJob()
62                 else
63                         mpQPrinter->EndQueuePrint();
64  
65 -               return TRUE;
66 +               return success;
67         }
68  #else
69         ImplSVData* pSVData = ImplGetSVData();
70 Index: sfx2/source/view/makefile.mk
71 ===================================================================
72 RCS file: /cvs/framework/sfx2/source/view/makefile.mk,v
73 retrieving revision 1.4
74 diff -u -p -u -r1.4 makefile.mk
75 --- sfx2/source/view/makefile.mk        18 Jun 2001 10:52:07 -0000      1.4
76 +++ sfx2/source/view/makefile.mk        29 May 2003 14:15:19 -0000
77 @@ -109,6 +109,8 @@ SLOFILES =  \
78                 $(SLO)$/topfrm.obj \
79                 $(SLO)$/sfxbasecontroller.obj
80  
81 +CFLAGS+=`pkg-config --cflags glib-2.0`
82 +
83  # --- Targets -------------------------------------------------------
84  
85  .INCLUDE :  target.mk
86 Index: sfx2/source/view/viewprn.cxx
87 ===================================================================
88 RCS file: /cvs/framework/sfx2/source/view/viewprn.cxx,v
89 retrieving revision 1.15
90 diff -u -p -u -r1.15 viewprn.cxx
91 --- sfx2/source/view/viewprn.cxx        17 Apr 2003 16:10:43 -0000      1.15
92 +++ sfx2/source/view/viewprn.cxx        29 May 2003 14:17:39 -0000
93 @@ -98,6 +98,8 @@
94  #include <svtools/printwarningoptions.hxx>
95  #pragma hdrstop
96  
97 +#include <glib.h>
98 +
99  #include "viewsh.hxx"
100  #include "viewimp.hxx"
101  #include "viewfrm.hxx"
102 @@ -745,14 +747,31 @@ void SfxViewShell::ExecPrint_Impl( SfxRe
103              if ( bDontModifyDoc && bOldFlag != pObjSh->IsEnableSetModified() )
104                  pObjSh->EnableSetModified( bOldFlag );
105  
106 -                       if ( nError != PRINTER_ABORT )
107 -                       {
108 -                // "real" problem (not simply printing cancelled by user)
109 -                               String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
110 -                if ( !bIsAPI )
111 -                    ErrorBox( NULL, WB_OK | WB_DEF_OK,  aMsg ).Execute();
112 -                               rReq.SetReturnValue(SfxBoolItem(0,FALSE));
113 -                       }
114 +           String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
115 +#ifdef UNX
116 +           if ( nError == ERRCODE_IO_NOTEXISTS ) 
117 +           {
118 +                   ErrorBox box ( NULL, WB_OK | WB_DEF_OK,  aMsg );
119 +#define BUTTONID_ADD_PRN 77                                    
120 +                   box.AddButton( ::rtl::OUString( SfxResId( STR_ADDPRINTER ) ),
121 +                                  BUTTONID_ADD_PRN, 0, 0 );
122 +                   if (box.Execute () == BUTTONID_ADD_PRN)
123 +                   {
124 +                           const char *argv[] = { "gnome-cups-add", NULL };
125 +                           g_spawn_async (NULL, (gchar **)argv,
126 +                                          NULL, G_SPAWN_SEARCH_PATH,
127 +                                          NULL, NULL, NULL, NULL);
128 +                   }
129 +           }
130 +           else
131 +#endif     
132 +           if ( nError != PRINTER_ABORT )
133 +           {
134 +                   // "real" problem (not simply printing cancelled by user)
135 +                   if ( !bIsAPI )
136 +                           ErrorBox( NULL, WB_OK | WB_DEF_OK,  aMsg ).Execute();
137 +                   rReq.SetReturnValue(SfxBoolItem(0,FALSE));
138 +           }
139  
140              rReq.Ignore();
141                 }
142 Index: sfx2/source/view/view.hrc
143 ===================================================================
144 RCS file: /cvs/framework/sfx2/source/view/view.hrc,v
145 retrieving revision 1.5
146 diff -u -p -u -r1.5 view.hrc
147 --- sfx2/source/view/view.hrc   30 Jul 2001 11:15:41 -0000      1.5
148 +++ sfx2/source/view/view.hrc   15 Jul 2003 11:58:12 -0000
149 @@ -112,6 +112,7 @@
150  #define MSG_CANT_CLOSE                                         (RID_SFX_VIEW_START+42)
151  
152  #define TP_FRAMEPROPERTIES                  (RID_SFX_VIEW_START+44)
153 +#define STR_ADDPRINTER                      (RID_SFX_VIEW_START+45)
154  
155  #define FT_FRAMENAME                                   3
156  #define ED_FRAMENAME                                   4
157 Index: sfx2/source/view/view.src
158 ===================================================================
159 RCS file: /cvs/framework/sfx2/source/view/view.src,v
160 retrieving revision 1.41
161 diff -u -p -u -r1.41 view.src
162 --- sfx2/source/view/view.src   22 Jul 2003 16:18:03 -0000      1.41
163 +++ sfx2/source/view/view.src   29 Aug 2003 14:31:34 -0000
164 @@ -65,6 +65,12 @@
165  #include "sfxlocal.hrc"
166  
167   // Strings ---------------------------------------------------------------
168 +String STR_ADDPRINTER
169 +{
170 +       TEXT = "Drucker hinzufügen";
171 +       TEXT [ English ] = "Add Printer";
172 +       TEXT [ english_us ] = "Add Printer";
173 +};
174  String STR_NODEFPRINTER
175  {
176         TEXT = "Kein Standarddrucker gefunden.\nBitte wählen Sie einen Drucker aus und versuchen Sie es noch einmal." ;
This page took 0.0424 seconds and 3 git commands to generate.