Changeset 233
- Timestamp:
- 06/13/06 16:11:47 (2 years ago)
- Location:
- trunk/src
- Files:
-
- 6 modified
-
IPrintView.h (modified) (2 diffs)
-
JobPrint.cxx (modified) (8 diffs)
-
JobPrint.h (modified) (4 diffs)
-
PrintPter.cxx (modified) (2 diffs)
-
gtk/PrintView.cxx (modified) (2 diffs)
-
gtk/PrintView.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IPrintView.h
r232 r233 123 123 124 124 /// 125 /// @brief Gets the currently selected color model. 126 /// 127 /// @return The value of the color model that is selected. 128 /// 129 virtual gchar *getColorModel (void) = 0; 130 131 /// 125 132 /// @brief Gets the number of copies to do. 126 133 /// … … 161 168 162 169 /// 170 /// @brief Gets the currently selected resolution. 171 /// 172 /// @return The value of the resolution that is selected. 173 /// This value is the @a value parameter of the 174 /// addResolution() function. 175 /// 176 virtual gchar *getResolution (void) = 0; 177 178 /// 163 179 /// @brief Gets the name of the currently selected printer. 164 180 /// -
trunk/src/JobPrint.cxx
r223 r233 33 33 { 34 34 m_Collate = FALSE; 35 m_ColorModel = NULL; 35 36 m_CurrentPage = 1; 36 37 m_Document = NULL; … … 45 46 m_PageWidth = 0.1147f; 46 47 m_PrinterName = NULL; 48 m_Resolution = NULL; 47 49 m_TempFileName = NULL; 48 50 } … … 55 57 delete m_DocumentCopy; 56 58 delete[] m_PageRange; 59 g_free (m_ColorModel); 57 60 g_free (m_PageRangeString); 58 61 g_free (m_PrinterName); 62 g_free (m_Resolution); 59 63 g_free (m_TempFileName); 60 64 } … … 66 70 } 67 71 72 const gchar * 73 JobPrint::getColorModel () 74 { 75 return m_ColorModel; 76 } 77 68 78 guint 69 79 JobPrint::getCurrentPage () … … 126 136 { 127 137 return m_PrinterName; 138 } 139 140 const gchar * 141 JobPrint::getResolution () 142 { 143 return m_Resolution; 128 144 } 129 145 … … 175 191 176 192 void 193 JobPrint::setColorModel (const gchar *colorModel) 194 { 195 g_free (m_ColorModel); 196 m_ColorModel = g_strdup (colorModel); 197 } 198 199 void 177 200 JobPrint::setCurrentPage (guint pageNumber) 178 201 { … … 229 252 m_PageWidth = pageWidth; 230 253 m_PageHeight = pageHeight; 254 } 255 256 void 257 JobPrint::setResolution (const gchar *resolution) 258 { 259 g_free (m_Resolution); 260 m_Resolution = g_strdup (resolution); 231 261 } 232 262 … … 467 497 } 468 498 numOptions = cupsAddOption ("number-up", layout, numOptions, &options); 499 numOptions = cupsAddOption ("ColorModel", job->getColorModel (), 500 numOptions, &options); 501 numOptions = cupsAddOption ("Resolution", job->getResolution (), 502 numOptions, &options); 469 503 470 504 cupsPrintFile (job->getPrinterName (), job->getTempFileName (), -
trunk/src/JobPrint.h
r223 r233 64 64 65 65 gboolean getCollate (void); 66 const gchar *getColorModel (void); 66 67 IDocument &getDocument (void); 67 68 guint getNumberOfCopies (void); … … 69 70 PrintPageOrientation getPageOrientation (void); 70 71 const gchar *getPrinterName (void); 72 const gchar *getResolution (void); 71 73 const gchar *getTempFileName (void); 72 74 virtual gboolean run (void); 73 75 void setCollate (gboolean collate); 76 void setColorModel (const gchar *colorModel); 74 77 void setDocument (IDocument *document); 75 78 void setNumberOfCopies (guint copies); … … 80 83 void setPageSize (gfloat pageWidth, gfloat pageHeight); 81 84 void setPrinterName (const gchar *name); 85 void setResolution (const gchar *resolution); 82 86 void setUpPrint (void); 83 87 84 88 protected: 85 89 gboolean m_Collate; 90 gchar *m_ColorModel; 86 91 guint m_CurrentPage; 87 92 IDocument *m_Document; … … 94 99 gchar *m_PageRangeString; 95 100 PrintPageSet m_PageSet; 101 gchar *m_Resolution; 96 102 gfloat m_PageWidth; 97 103 gchar *m_PrinterName; -
trunk/src/PrintPter.cxx
r232 r233 113 113 getPageSizeForPrinter (printerName, pageSizeName, 114 114 &pageWidth, &pageHeight); 115 g_free (pageSizeName);116 115 // Create the new print job. 117 116 JobPrint *job = new JobPrint (); … … 148 147 job->setPageOrientation (view.getPageOrientation ()); 149 148 job->setPageLayout (view.getPageLayout ()); 149 150 gchar *colorModel = view.getColorModel (); 151 job->setColorModel (colorModel); 152 gchar *resolution = view.getResolution (); 153 job->setResolution (resolution); 150 154 151 155 IJob::enqueue (job); -
trunk/src/gtk/PrintView.cxx
r232 r233 177 177 } 178 178 179 gchar * 180 PrintView::getColorModel () 181 { 182 gchar *colorModel = NULL; 183 getOptionFromComboBox (m_ColorModelView, &colorModel); 184 return colorModel; 185 } 186 179 187 PrintPageLayout 180 188 PrintView::getPageLayout () … … 205 213 getOptionFromComboBox (m_PageSizeView, &pageSize); 206 214 return pageSize; 215 } 216 217 gchar * 218 PrintView::getResolution () 219 { 220 gchar *resolution = NULL; 221 getOptionFromComboBox (m_ResolutionView, &resolution); 222 return resolution; 207 223 } 208 224 -
trunk/src/gtk/PrintView.h
r232 r233 42 42 virtual void clearResolutionList (void); 43 43 virtual guint getNumberOfCopies (void); 44 virtual gchar *getColorModel (void); 44 45 virtual PrintPageLayout getPageLayout (void); 45 46 virtual PrintPageOrientation getPageOrientation (void); 46 47 virtual const gchar *getPageRange (void); 47 48 virtual gchar *getPageSize (void); 49 virtual gchar *getResolution (void); 48 50 virtual gchar *getSelectedPrinterName (void); 49 51 virtual gboolean isCheckedCollate (void);
