Changeset 232
- Timestamp:
- 06/13/06 15:50:59 (2 years ago)
- Location:
- trunk/src
- Files:
-
- 4 modified
-
IPrintView.h (modified) (3 diffs)
-
PrintPter.cxx (modified) (1 diff)
-
gtk/PrintView.cxx (modified) (6 diffs)
-
gtk/PrintView.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IPrintView.h
r231 r232 62 62 63 63 /// 64 /// @brief Adds a new color model to the list. 65 /// 66 /// @param name The possibly translated name of the color model. 67 /// @param value The value the ePDFView internally uses to know 68 /// which colorModel is. 69 /// 70 virtual void addColorModel (const gchar *name, 71 const gchar *value) = 0; 72 73 74 /// 64 75 /// @brief Adds a new page size to the list. 65 76 /// … … 97 108 98 109 /// 110 /// @brief Deletes all color models from the list of color modes. 111 /// 112 virtual void clearColorModelList (void) = 0; 113 114 /// 99 115 /// @brief Deletes all sizes from the list of page sizes. 100 116 /// … … 186 202 187 203 /// 204 /// @brief Select a color model. 205 /// 206 /// @param colorModelIndex The index of the color model to select. 207 /// 208 virtual void selectColorModel (guint colorModelIndex) = 0; 209 210 /// 188 211 /// @brief Selects a page size. 189 212 /// -
trunk/src/PrintPter.cxx
r231 r232 233 233 } 234 234 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 } 235 263 ppdClose (printerPPD); 236 264 } -
trunk/src/gtk/PrintView.cxx
r231 r232 122 122 123 123 void 124 PrintView::addColorModel (const gchar *name, const gchar *value) 125 { 126 addOptionToList (m_ColorModel, name, value); 127 } 128 129 void 124 130 PrintView::addPageSize (const gchar *name, const gchar *value) 125 131 { … … 148 154 149 155 void 156 PrintView::clearColorModelList () 157 { 158 gtk_list_store_clear (m_ColorModel); 159 } 160 161 void 150 162 PrintView::clearPageSizeList () 151 163 { … … 236 248 { 237 249 return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m_OddPageSet)); 250 } 251 252 void 253 PrintView::selectColorModel (guint colorModelIndex) 254 { 255 gtk_combo_box_set_active (GTK_COMBO_BOX (m_ColorModelView), 256 colorModelIndex); 238 257 } 239 258 … … 551 570 gtk_misc_set_alignment (GTK_MISC (colorModeLabel), 1.0, 0.5); 552 571 gtk_label_set_use_underline (GTK_LABEL (colorModeLabel), TRUE); 553 // createColorModeListModel (); 554 GtkWidget *colorModeView = gtk_combo_box_new (); //_with_model (GTK_TREE_MODEL (m_ColorMode)); 555 gtk_label_set_mnemonic_widget (GTK_LABEL (colorModeLabel), colorModeView); 556 { 557 GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); 558 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (colorModeView), 572 createColorModelListModel (); 573 m_ColorModelView = 574 gtk_combo_box_new_with_model (GTK_TREE_MODEL (m_ColorModel)); 575 gtk_label_set_mnemonic_widget (GTK_LABEL (colorModeLabel), 576 m_ColorModelView); 577 { 578 GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); 579 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (m_ColorModelView), 559 580 renderer, TRUE); 560 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT ( colorModeView),581 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (m_ColorModelView), 561 582 renderer, 562 583 "text", … … 568 589 (GtkAttachOptions)(GTK_SHRINK), 569 590 0, 0); 570 gtk_table_attach (GTK_TABLE (outputTable), colorModeView,591 gtk_table_attach (GTK_TABLE (outputTable), m_ColorModelView, 571 592 1, 2, 0, 1, 572 593 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), … … 661 682 662 683 void 684 PrintView::createColorModelListModel () 685 { 686 m_ColorModel = gtk_list_store_new (printOptionNumColumn, 687 G_TYPE_STRING, // Label 688 G_TYPE_INT); // Value 689 } 690 691 void 663 692 PrintView::createLayoutListModel () 664 693 { -
trunk/src/gtk/PrintView.h
r231 r232 29 29 virtual void setPresenter (PrintPter *pter); 30 30 31 virtual void addColorModel (const gchar *name, 32 const gchar *value); 31 33 virtual void addPageSize (const gchar *name, 32 34 const gchar *value); … … 36 38 virtual void addResolution (const gchar *name, 37 39 const gchar *value); 40 virtual void clearColorModelList (void); 38 41 virtual void clearPageSizeList (void); 39 42 virtual void clearResolutionList (void); … … 48 51 virtual gboolean isSelectedEvenPageSet (void); 49 52 virtual gboolean isSelectedOddPageSet (void); 53 virtual void selectColorModel (guint colorModeIndex); 50 54 virtual void selectPageSize (guint pageSizeIndex); 51 55 virtual void selectPrinter (guint printerIndex); … … 58 62 GtkWidget *m_AllPagesRangeOption; 59 63 GtkWidget *m_Collate; 64 GtkListStore *m_ColorModel; 65 GtkWidget *m_ColorModelView; 60 66 GtkWidget *m_CustomPagesRangeOption; 61 67 GtkWidget *m_EvenPageSet; … … 83 89 GtkWidget *createPrinterTab (void); 84 90 91 void createColorModelListModel (void); 85 92 void createLayoutListModel (void); 86 93 void createOrientationListModel (void);
