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

Refactorized a little the printer options, so only one function adds data and one retrieved data.

Added the resolution list and also the setter function in the view.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/PrintPter.cxx

    r229 r231  
    212212                } 
    213213                view.selectPageSize (pageSizeToSelect); 
     214 
     215                // Get the resolutions. 
     216                ppd_option_t *resolutionOption = 
     217                    ppdFindOption (printerPPD, "Resolution"); 
     218                view.clearResolutionList (); 
     219                int resolutionToSelect = 0; 
     220                ppd_choice_t *resolutionChoice = resolutionOption->choices; 
     221                for ( int currentRes = 0 ; 
     222                      currentRes < resolutionOption->num_choices ; 
     223                      ++currentRes, ++resolutionChoice ) 
     224                { 
     225                    const gchar *resName = resolutionChoice->text; 
     226                    const gchar *resValue = resolutionChoice->choice; 
     227 
     228                    view.addResolution (_(resName), resValue); 
     229                    if ( resolutionChoice->marked ) 
     230                    { 
     231                        resolutionToSelect = currentRes; 
     232                    } 
     233                } 
     234                view.selectResolution (resolutionToSelect); 
    214235                ppdClose (printerPPD); 
    215236            }