Show
Ignore:
Timestamp:
06/13/06 15:50:59 (2 years ago)
Author:
jordi
Message:

Added the Color Model options to the print view.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/PrintPter.cxx

    r231 r232  
    233233                } 
    234234                view.selectResolution (resolutionToSelect); 
     235 
     236                // Get the color models. 
     237                ppd_option_t *colorModelOption = 
     238                    ppdFindOption (printerPPD, "ColorModel"); 
     239                view.clearColorModelList (); 
     240                if ( NULL != colorModelOption ) 
     241                { 
     242                    int colorModelToSelect = 0; 
     243                    ppd_choice_t *colorModelChoice = colorModelOption->choices; 
     244                    for ( int currentColor = 0 ; 
     245                          currentColor < colorModelOption->num_choices ; 
     246                          ++currentColor, ++colorModelChoice ) 
     247                    { 
     248                        const gchar *colorName = colorModelChoice->text; 
     249                        const gchar *colorValue = colorModelChoice->choice; 
     250 
     251                        view.addColorModel (_(colorName), colorValue); 
     252                        if ( colorModelChoice->marked ) 
     253                        { 
     254                            colorModelToSelect = currentColor; 
     255                        } 
     256                    } 
     257                    view.selectColorModel (colorModelToSelect); 
     258                } 
     259                else 
     260                { 
     261                    view.addColorModel (_("Grayscale"), "Gray"); 
     262                } 
    235263                ppdClose (printerPPD); 
    236264            }