~cjcurran/+junk/soundnua-gtk-warnings

« back to all changes in this revision

Viewing changes to soundnua/gvc-mixer-dialog.c

  • Committer: Conor Curran
  • Date: 2012-03-16 16:49:19 UTC
  • Revision ID: conor.curran@canonical.com-20120316164919-xqojkceick5div60
remove redundant code around profile combo hiding

Show diffs side-by-side

added added

removed removed

Lines of Context:
783
783
                gvc_combo_box_set_profiles (GVC_COMBO_BOX (dialog->priv->input_profile_combo),
784
784
                                            profs_entries);
785
785
                                
786
 
                gboolean disabled;
787
 
                disabled = gvc_mixer_ui_device_determine_profile_sensitivity (active_input);
788
786
 
789
 
                if (disabled){
790
 
                        GvcMixerCardProfile *p;
791
 
                        // We can be sure that its just one profile in the list when it's disabled
792
 
                        p = g_list_last (profiles)->data;
793
 
                        gvc_combo_box_set_active (GVC_COMBO_BOX (dialog->priv->input_profile_combo), 
794
 
                                                                 p->profile);                        
795
 
                }
796
 
                else{
797
 
                        gvc_combo_box_set_active (GVC_COMBO_BOX (dialog->priv->input_profile_combo), 
798
 
                                                  gvc_mixer_control_get_active_profile_from_ui_device (dialog->priv->mixer_control,
799
 
                                                                                               active_input));
800
 
                }
 
787
                gvc_combo_box_set_active (GVC_COMBO_BOX (dialog->priv->input_profile_combo), 
 
788
                                          gvc_mixer_control_get_active_profile_from_ui_device (dialog->priv->mixer_control,
 
789
                                                                                       active_input));
801
790
                g_object_set_data (G_OBJECT (dialog->priv->input_profile_combo),
802
791
                                   "uidevice",
803
792
                                   active_input);
814
803
                                                      dialog->priv->size_group, FALSE);
815
804
                }
816
805
                gtk_widget_show (dialog->priv->input_profile_combo);                
817
 
                gtk_widget_set_sensitive (dialog->priv->input_profile_combo, 
818
 
                                           !disabled);
819
806
        }
820
807
}
821
808
 
952
939
                gvc_combo_box_set_profiles (GVC_COMBO_BOX (dialog->priv->output_profile_combo),
953
940
                                            profs_entries);
954
941
                                
955
 
                gboolean disabled;
956
 
                disabled = gvc_mixer_ui_device_determine_profile_sensitivity (active_output);
957
 
 
958
942
                gtk_box_pack_start (GTK_BOX (dialog->priv->output_settings_box),
959
943
                                    dialog->priv->output_profile_combo,
960
944
                                    FALSE, FALSE, 3);
964
948
                                                      dialog->priv->size_group, FALSE);
965
949
                }
966
950
 
967
 
                if (disabled){
968
 
                        GvcMixerCardProfile *p;
969
 
                        // We can be sure that its just one profile in the list when it's disabled
970
 
                        p = g_list_last (profiles)->data;
971
 
                        gvc_combo_box_set_active (GVC_COMBO_BOX (dialog->priv->output_profile_combo), 
972
 
                                                                 p->profile);                        
973
 
                }
974
 
                else{
975
 
                        gvc_combo_box_set_active (GVC_COMBO_BOX (dialog->priv->output_profile_combo), 
976
 
                                                  gvc_mixer_control_get_active_profile_from_ui_device (dialog->priv->mixer_control,
977
 
                                                                                               active_output));
978
 
                }
 
951
                gvc_combo_box_set_active (GVC_COMBO_BOX (dialog->priv->output_profile_combo), 
 
952
                                          gvc_mixer_control_get_active_profile_from_ui_device (dialog->priv->mixer_control,
 
953
                                                                                       active_output));
 
954
                
979
955
                g_object_set_data (G_OBJECT (dialog->priv->output_profile_combo),
980
956
                                   "uidevice",
981
957
                                   active_output);
983
959
                                  G_CALLBACK (profile_selection_changed), dialog);
984
960
 
985
961
                gtk_widget_show (dialog->priv->output_profile_combo);                
986
 
                gtk_widget_set_sensitive (dialog->priv->output_profile_combo, 
987
 
                                           !disabled);
988
962
        }
989
963
 
990
964
}