[gnome-color-manager] Rework the preferences UI to be in three distinct sections rather than a random group



commit 774a10bd63fc0fa66e5848efefcb87b12a3a6bdd
Author: Richard Hughes <richard hughsie com>
Date:   Sat Nov 28 22:48:44 2009 +0000

    Rework the preferences UI to be in three distinct sections rather than a random group

 data/gcm-prefs.ui |  760 ++++++++++++++++++++++++++++++++++++-----------------
 src/gcm-device.c  |   20 ++
 src/gcm-prefs.c   |   96 ++++++--
 3 files changed, 610 insertions(+), 266 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index 84275b1..d75db27 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -53,183 +53,460 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkVBox" id="vbox1">
+                  <object class="GtkVBox" id="vbox_sections">
                     <property name="visible">True</property>
                     <property name="orientation">vertical</property>
-                    <property name="spacing">9</property>
+                    <property name="spacing">15</property>
                     <child>
-                      <object class="GtkHBox" id="hbox2">
+                      <object class="GtkVBox" id="vbox7">
                         <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
                         <child>
-                          <object class="GtkLabel" id="label_profile">
+                          <object class="GtkHBox" id="hbox19">
                             <property name="visible">True</property>
-                            <property name="label" translatable="yes" comments="Section heading for device profile settings">Color Profile:</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
+                            <child>
+                              <object class="GtkLabel" id="label_device">
+                                <property name="visible">True</property>
+                                <property name="label" translatable="yes" comments="Section heading for device settings">Device:</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="combobox_profile">
-                        <property name="visible">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="hbox3">
-                        <property name="visible">True</property>
                         <child>
-                          <object class="GtkTable" id="table_details">
+                          <object class="GtkAlignment" id="alignment1">
                             <property name="visible">True</property>
-                            <property name="n_rows">3</property>
-                            <property name="n_columns">2</property>
-                            <property name="column_spacing">9</property>
-                            <property name="row_spacing">3</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkHBox" id="hbox5">
+                              <object class="GtkVBox" id="vbox6">
                                 <property name="visible">True</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">9</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_title_vendor">
+                                  <object class="GtkVBox" id="vbox2">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes" comments="The manufacturer of the profile">Vendor:</property>
+                                    <property name="orientation">vertical</property>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox_manufacturer">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox21">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_title_manufacturer">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes" comments="The manufacturer of the device">Manufacturer:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox25">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_manufacturer">
+                                                <property name="visible">True</property>
+                                                <property name="label">manufacturer</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="padding">3</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox_model">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox22">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_title_model">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes" comments="The model of the device">Model:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox24">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_model">
+                                                <property name="visible">True</property>
+                                                <property name="label">model</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="padding">3</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox_serial">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox23">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_title_serial">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes" comments="The serial number of the device">Serial:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox26">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_serial">
+                                                <property name="visible">True</property>
+                                                <property name="label">serial:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="padding">3</property>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="hbox10">
-                                <property name="visible">True</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_title_copyright">
+                                  <object class="GtkHBox" id="hbox3">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes" comments="The licence of the profile, normally non-free">License:</property>
+                                    <child>
+                                      <object class="GtkButton" id="button_delete">
+                                        <property name="label" translatable="yes" comments="This is a button to delete the saved device">_Delete device</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="use_underline">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
+                                    <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
                             </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkVBox" id="vbox8">
+                        <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkHBox" id="hbox2">
+                            <property name="visible">True</property>
                             <child>
-                              <object class="GtkHBox" id="hbox11">
+                              <object class="GtkLabel" id="label_profile">
                                 <property name="visible">True</property>
-                                <child>
-                                  <object class="GtkLabel" id="label_vendor">
-                                    <property name="visible">True</property>
-                                    <property name="label">The hardware vendor</property>
-                                    <property name="use_markup">True</property>
-                                    <property name="wrap">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
+                                <property name="label" translatable="yes" comments="Section heading for device profile settings">Color Profile:</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
                               </object>
                               <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
+                                <property name="expand">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkAlignment" id="alignment2">
+                            <property name="visible">True</property>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkHBox" id="hbox12">
+                              <object class="GtkVBox" id="vbox1">
                                 <property name="visible">True</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">9</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_copyright">
+                                  <object class="GtkComboBox" id="combobox_profile">
                                     <property name="visible">True</property>
-                                    <property name="label">Usually non-free</property>
-                                    <property name="use_markup">True</property>
-                                    <property name="wrap">True</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="hbox6">
-                                <property name="visible">True</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_title_type">
+                                  <object class="GtkVBox" id="vbox_details">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes" comments="The type of profile, e.g. display, scanner, etc.">Profile type:</property>
+                                    <property name="orientation">vertical</property>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox_vendor">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">3</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox5">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_title_vendor">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes" comments="The manufacturer of the profile">Vendor:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox11">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_vendor">
+                                                <property name="visible">True</property>
+                                                <property name="label">vendor</property>
+                                                <property name="use_markup">True</property>
+                                                <property name="wrap">True</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="padding">3</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox_copyright">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">3</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox10">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_title_copyright">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes" comments="The licence of the profile, normally non-free">License:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox12">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_copyright">
+                                                <property name="visible">True</property>
+                                                <property name="label">non-free</property>
+                                                <property name="use_markup">True</property>
+                                                <property name="wrap">True</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="padding">3</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox_type">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">3</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox6">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_title_type">
+                                                <property name="visible">True</property>
+                                                <property name="label" translatable="yes" comments="The type of profile, e.g. display, scanner, etc.">Profile type:</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox18">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkLabel" id="label_type">
+                                                <property name="visible">True</property>
+                                                <property name="label">input</property>
+                                                <property name="use_markup">True</property>
+                                                <property name="wrap">True</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="padding">3</property>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
+                                    <property name="position">1</property>
                                   </packing>
                                 </child>
-                              </object>
-                              <packing>
-                                <property name="top_attach">2</property>
-                                <property name="bottom_attach">3</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="hbox18">
-                                <property name="visible">True</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_type">
+                                  <object class="GtkHBox" id="hbox4">
                                     <property name="visible">True</property>
-                                    <property name="label">Output or input</property>
-                                    <property name="use_markup">True</property>
-                                    <property name="wrap">True</property>
+                                    <child>
+                                      <object class="GtkButton" id="button_calibrate">
+                                        <property name="label" translatable="yes" comments="This is a button to calibrate the device by creating an ICC profile file using a hardware device or a reference image">_Calibrate device</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="use_underline">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
                               </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">2</property>
-                                <property name="bottom_attach">3</property>
-                              </packing>
                             </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
@@ -237,109 +514,148 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <child>
-                          <object class="GtkTable" id="table1">
+                          <object class="GtkAlignment" id="alignment3">
                             <property name="visible">True</property>
-                            <property name="n_rows">3</property>
-                            <property name="n_columns">2</property>
-                            <property name="column_spacing">3</property>
-                            <property name="row_spacing">6</property>
-                            <child>
-                              <object class="GtkHScale" id="hscale_gamma">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="restrict_to_fill_level">False</property>
-                                <property name="fill_level">1</property>
-                                <property name="value_pos">right</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                              </packing>
-                            </child>
+                            <property name="left_padding">12</property>
                             <child>
-                              <object class="GtkHBox" id="hbox7">
+                              <object class="GtkVBox" id="vbox5">
                                 <property name="visible">True</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">3</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_gamma">
+                                  <object class="GtkTable" id="table1">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Gamma:</property>
+                                    <property name="n_rows">3</property>
+                                    <property name="n_columns">2</property>
+                                    <property name="column_spacing">3</property>
+                                    <property name="row_spacing">6</property>
+                                    <child>
+                                      <object class="GtkHScale" id="hscale_gamma">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="restrict_to_fill_level">False</property>
+                                        <property name="fill_level">1</property>
+                                        <property name="value_pos">right</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox8">
+                                        <property name="visible">True</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label_gamma">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Gamma:</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHScale" id="hscale_brightness">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="restrict_to_fill_level">False</property>
+                                        <property name="fill_level">1</property>
+                                        <property name="digits">0</property>
+                                        <property name="value_pos">right</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHScale" id="hscale_contrast">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="restrict_to_fill_level">False</property>
+                                        <property name="fill_level">1</property>
+                                        <property name="digits">0</property>
+                                        <property name="value_pos">right</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox9">
+                                        <property name="visible">True</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label_brightness">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Brightness:</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox28">
+                                        <property name="visible">True</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label_contrast">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Contrast:</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
+                                    <property name="padding">6</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkHScale" id="hscale_brightness">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="restrict_to_fill_level">False</property>
-                                <property name="fill_level">1</property>
-                                <property name="digits">0</property>
-                                <property name="value_pos">right</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHScale" id="hscale_contrast">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="restrict_to_fill_level">False</property>
-                                <property name="fill_level">1</property>
-                                <property name="digits">0</property>
-                                <property name="value_pos">right</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">2</property>
-                                <property name="bottom_attach">3</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="hbox8">
-                                <property name="visible">True</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_brightness">
+                                  <object class="GtkHBox" id="hbox7">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Brightness:</property>
+                                    <child>
+                                      <object class="GtkButton" id="button_reset">
+                                        <property name="label" translatable="yes" comments="This resets the device to it's defaults, and removes any user tweaked settings.">_Reset to defaults</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="use_underline">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
+                                    <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHBox" id="hbox9">
-                                <property name="visible">True</property>
-                                <child>
-                                  <object class="GtkLabel" id="label_contrast">
-                                    <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Contrast:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="top_attach">2</property>
-                                <property name="bottom_attach">3</property>
-                              </packing>
                             </child>
                           </object>
                         </child>
@@ -355,63 +671,13 @@
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="position">3</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="hbox4">
-                        <property name="visible">True</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkButton" id="button_delete">
-                            <property name="label" translatable="yes" comments="This is a button to delete the saved device">_Delete</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_underline">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="button_calibrate">
-                            <property name="label" translatable="yes" comments="This is a button to calibrate the device by creating an ICC profile file using a hardware device or a reference image">_Calibrate</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_underline">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="button_reset">
-                            <property name="label" translatable="yes" comments="This resets the device to it's defaults, and removes any user tweaked settings.">_Reset to defaults</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_underline">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">4</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
-                    <property name="position">3</property>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </object>
diff --git a/src/gcm-device.c b/src/gcm-device.c
index 2cb49ef..cf7a9bc 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -237,6 +237,12 @@ gcm_device_load (GcmDevice *device, GError **error)
 	/* load data */
 	g_free (device->priv->profile_filename);
 	device->priv->profile_filename = g_key_file_get_string (file, device->priv->id, "profile", NULL);
+	if (device->priv->serial == NULL)
+		device->priv->serial = g_key_file_get_string (file, device->priv->id, "serial", NULL);
+	if (device->priv->model == NULL)
+		device->priv->model = g_key_file_get_string (file, device->priv->id, "model", NULL);
+	if (device->priv->manufacturer == NULL)
+		device->priv->manufacturer = g_key_file_get_string (file, device->priv->id, "manufacturer", NULL);
 	device->priv->gamma = g_key_file_get_double (file, device->priv->id, "gamma", &error_local);
 	if (error_local != NULL) {
 		device->priv->gamma = gconf_client_get_float (device->priv->gconf_client, "/apps/gnome-color-manager/default_gamma", NULL);
@@ -343,6 +349,20 @@ gcm_device_save (GcmDevice *device, GError **error)
 	else
 		g_key_file_set_string (keyfile, device->priv->id, "profile", device->priv->profile_filename);
 
+	/* save device specific data */
+	if (device->priv->serial == NULL)
+		g_key_file_remove_key (keyfile, device->priv->id, "serial", NULL);
+	else
+		g_key_file_set_string (keyfile, device->priv->id, "serial", device->priv->serial);
+	if (device->priv->model == NULL)
+		g_key_file_remove_key (keyfile, device->priv->id, "model", NULL);
+	else
+		g_key_file_set_string (keyfile, device->priv->id, "model", device->priv->model);
+	if (device->priv->manufacturer == NULL)
+		g_key_file_remove_key (keyfile, device->priv->id, "manufacturer", NULL);
+	else
+		g_key_file_set_string (keyfile, device->priv->id, "manufacturer", device->priv->manufacturer);
+
 	/* only save gamma if not the default */
 	if (device->priv->gamma > 0.99 && device->priv->gamma < 1.01)
 		g_key_file_remove_key (keyfile, device->priv->id, "gamma", NULL);
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 907fb9c..af352e8 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -876,6 +876,9 @@ gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection, gpointer use
 	gchar *id;
 	GcmDeviceType type;
 	gboolean ret = FALSE;
+	gchar *device_serial = NULL;
+	gchar *device_model = NULL;
+	gchar *device_manufacturer = NULL;
 
 	/* This will only work in single or browse selection mode! */
 	if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
@@ -921,8 +924,37 @@ gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection, gpointer use
 		      "brightness", &brightness,
 		      "contrast", &contrast,
 		      "connected", &connected,
+		      "serial", &device_serial,
+		      "model", &device_model,
+		      "manufacturer", &device_manufacturer,
 		      NULL);
 
+	/* set device labels */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_serial"));
+	if (device_serial != NULL) {
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_serial"));
+		gtk_label_set_label (GTK_LABEL (widget), device_serial);
+	} else {
+		gtk_widget_hide (widget);
+	}
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_model"));
+	if (device_model != NULL) {
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_model"));
+		gtk_label_set_label (GTK_LABEL (widget), device_model);
+	} else {
+		gtk_widget_hide (widget);
+	}
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_manufacturer"));
+	if (device_manufacturer != NULL) {
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_manufacturer"));
+		gtk_label_set_label (GTK_LABEL (widget), device_manufacturer);
+	} else {
+		gtk_widget_hide (widget);
+	}
+
 	/* set adjustments */
 	setting_up_device = TRUE;
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hscale_gamma"));
@@ -977,6 +1009,9 @@ gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection, gpointer use
 	/* can this device calibrate */
 	gcm_prefs_set_calibrate_button_sensitivity ();
 
+	g_free (device_serial);
+	g_free (device_model);
+	g_free (device_manufacturer);
 	g_free (id);
 	g_free (profile_filename);
 }
@@ -1199,54 +1234,41 @@ gcm_prefs_profile_combo_changed_cb (GtkWidget *widget, gpointer data)
 	}
 
 	/* set type */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_type"));
 	if (profile_type == GCM_PROFILE_TYPE_UNKNOWN) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_title_type"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_type"));
 		gtk_widget_hide (widget);
 	} else {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_title_type"));
 		gtk_widget_show (widget);
-		profile_type_text = gcm_prefs_profile_type_to_text (profile_type);
 		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_type"));
+		profile_type_text = gcm_prefs_profile_type_to_text (profile_type);
 		gtk_label_set_label (GTK_LABEL (widget), profile_type_text);
-		gtk_widget_show (widget);
 	}
 
 	/* set new descriptions */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_copyright"));
 	if (copyright == NULL) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_title_copyright"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_copyright"));
 		gtk_widget_hide (widget);
 	} else {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_title_copyright"));
 		gtk_widget_show (widget);
 		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_copyright"));
 		gtk_label_set_label (GTK_LABEL(widget), copyright);
-		gtk_widget_show (widget);
 	}
 
 	/* set new descriptions */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_vendor"));
 	if (vendor == NULL) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_title_vendor"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_vendor"));
 		gtk_widget_hide (widget);
 	} else {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_title_vendor"));
 		gtk_widget_show (widget);
 		widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_vendor"));
 		gtk_label_set_label (GTK_LABEL(widget), vendor);
-		gtk_widget_show (widget);
 	}
 
 	/* set new descriptions */
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "vbox_details"));
 	if (copyright == NULL && vendor == NULL && profile_type == GCM_PROFILE_TYPE_UNKNOWN) {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "table_details"));
 		gtk_widget_hide (widget);
 	} else {
-		widget = GTK_WIDGET (gtk_builder_get_object (builder, "table_details"));
 		gtk_widget_show (widget);
 	}
 
@@ -1691,6 +1713,8 @@ main (int argc, char **argv)
 	GtkTreeSelection *selection;
 	const gchar *subsystems[] = {"usb", NULL};
 	GtkWidget *info_bar_label;
+	GtkSizeGroup *size_group = NULL;
+	GtkSizeGroup *size_group2 = NULL;
 
 	const GOptionEntry options[] = {
 		{ "parent-window", 'p', 0, G_OPTION_ARG_INT, &xid,
@@ -1787,7 +1811,7 @@ main (int argc, char **argv)
 	gtk_widget_set_sensitive (widget, FALSE);
 
 	/* hide widgets by default */
-	widget = GTK_WIDGET (gtk_builder_get_object (builder, "table_details"));
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "vbox_details"));
 	gtk_widget_hide (widget);
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_profile"));
 	gtk_widget_set_sensitive (widget, FALSE);
@@ -1833,6 +1857,36 @@ main (int argc, char **argv)
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hscale_contrast"));
 	gtk_range_set_range (GTK_RANGE (widget), 1.0f, 100.0f);
 
+	/* set alignment */
+	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox5"));
+	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox10"));
+	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox6"));
+	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox21"));
+	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox22"));
+	gtk_size_group_add_widget (size_group, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox23"));
+	gtk_size_group_add_widget (size_group, widget);
+
+	/* set alignment */
+	size_group2 = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox24"));
+	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox25"));
+	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox26"));
+	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox11"));
+	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox12"));
+	gtk_size_group_add_widget (size_group2, widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hbox18"));
+	gtk_size_group_add_widget (size_group2, widget);
+
 	/* get screen */
 	rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), NULL, NULL, &error);
 	if (rr_screen == NULL) {
@@ -1921,6 +1975,10 @@ main (int argc, char **argv)
 out:
 	g_object_unref (unique_app);
 	g_main_loop_unref (loop);
+	if (size_group != NULL)
+		g_object_unref (size_group);
+	if (size_group2 != NULL)
+		g_object_unref (size_group2);
 	if (current_device != NULL)
 		g_object_unref (current_device);
 	if (rr_screen != NULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]