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
10 // -------------------
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
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;
31 + case SAL_PRINTER_ERROR_NO_PRINTER:
32 + nVCLError = ERRCODE_IO_NOTEXISTS;
35 nVCLError = PRINTER_GENERALERROR;
37 @@ -1867,6 +1870,8 @@ BOOL Printer::EndJob()
41 + BOOL success = TRUE;
46 @@ -1874,7 +1879,13 @@ BOOL Printer::EndJob()
50 - mpPrinter->EndJob();
51 + if (! mpPrinter->EndJob() )
53 + mnError = ImplSalPrinterErrorCodeToVCL( mpPrinter->GetErrorCode() );
55 + mnError = PRINTER_GENERALERROR;
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()
63 mpQPrinter->EndQueuePrint();
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 = \
79 $(SLO)$/sfxbasecontroller.obj
81 +CFLAGS+=`pkg-config --cflags glib-2.0`
83 # --- Targets -------------------------------------------------------
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
94 #include <svtools/printwarningoptions.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 );
106 - if ( nError != PRINTER_ABORT )
108 - // "real" problem (not simply printing cancelled by user)
109 - String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
111 - ErrorBox( NULL, WB_OK | WB_DEF_OK, aMsg ).Execute();
112 - rReq.SetReturnValue(SfxBoolItem(0,FALSE));
114 + String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
116 + if ( nError == ERRCODE_IO_NOTEXISTS )
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)
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);
132 + if ( nError != PRINTER_ABORT )
134 + // "real" problem (not simply printing cancelled by user)
136 + ErrorBox( NULL, WB_OK | WB_DEF_OK, aMsg ).Execute();
137 + rReq.SetReturnValue(SfxBoolItem(0,FALSE));
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
150 #define MSG_CANT_CLOSE (RID_SFX_VIEW_START+42)
152 #define TP_FRAMEPROPERTIES (RID_SFX_VIEW_START+44)
153 +#define STR_ADDPRINTER (RID_SFX_VIEW_START+45)
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
165 #include "sfxlocal.hrc"
167 // Strings ---------------------------------------------------------------
168 +String STR_ADDPRINTER
170 + TEXT = "Drucker hinzufügen";
171 + TEXT [ English ] = "Add Printer";
172 + TEXT [ english_us ] = "Add Printer";
174 String STR_NODEFPRINTER
176 TEXT = "Kein Standarddrucker gefunden.\nBitte wählen Sie einen Drucker aus und versuchen Sie es noch einmal." ;