[network-manager-applet/lr/jtojnar-happy: 33/35] mobile-wizard: use more specific types when possible
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/lr/jtojnar-happy: 33/35] mobile-wizard: use more specific types when possible
- Date: Fri, 26 Oct 2018 09:49:50 +0000 (UTC)
commit 9edc08c8077048d46a3a19fc2ab602d814215814
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Mon Aug 27 19:37:52 2018 +0200
mobile-wizard: use more specific types when possible
This avoids some useless casting while keeping the type information more
accurate.
src/libnma/nma-mobile-wizard.c | 190 ++++++++++++++++++++---------------------
1 file changed, 95 insertions(+), 95 deletions(-)
---
diff --git a/src/libnma/nma-mobile-wizard.c b/src/libnma/nma-mobile-wizard.c
index cea92651..2131030d 100644
--- a/src/libnma/nma-mobile-wizard.c
+++ b/src/libnma/nma-mobile-wizard.c
@@ -67,7 +67,7 @@ typedef struct {
gboolean will_connect_after;
/* Intro page */
- GtkWidget *dev_combo;
+ GtkComboBox *dev_combo;
GtkLabel *provider_name_label;
GtkLabel *plan_name_label;
GtkLabel *apn_label;
@@ -78,40 +78,40 @@ typedef struct {
/* Country page */
NMACountryInfo *country;
GtkWidget *country_page;
- GtkWidget *country_view;
+ GtkTreeView *country_view;
GtkTreeStore *country_store;
GtkTreeModelSort *country_sort;
guint32 country_focus_id;
/* Providers page */
GtkWidget *providers_page;
- GtkWidget *providers_view;
+ GtkTreeView *providers_view;
GtkTreeStore *providers_store;
- GtkTreeModelSort *providers_sort;
+ GtkTreeModel *providers_sort;
guint32 providers_focus_id;
- GtkWidget *providers_view_radio;
+ GtkToggleButton *providers_view_radio;
- GtkWidget *provider_unlisted_radio;
- GtkWidget *provider_unlisted_type_combo;
+ GtkToggleButton *provider_unlisted_radio;
+ GtkComboBox *provider_unlisted_type_combo;
gboolean provider_only_cdma;
/* Plan page */
GtkWidget *plan_page;
- GtkWidget *plan_combo;
+ GtkComboBox *plan_combo;
GtkTreeStore *plan_store;
guint32 plan_focus_id;
- GtkWidget *plan_apn_entry;
+ GtkEntry *plan_apn_entry;
/* Confirm page */
GtkWidget *confirm_page;
- GtkWidget *confirm_provider;
- GtkWidget *confirm_plan;
- GtkWidget *confirm_apn;
- GtkWidget *confirm_plan_label;
- GtkWidget *confirm_device;
- GtkWidget *confirm_device_label;
+ GtkLabel *confirm_provider;
+ GtkLabel *confirm_plan;
+ GtkLabel *confirm_apn;
+ GtkLabel *confirm_plan_label;
+ GtkLabel *confirm_device;
+ GtkLabel *confirm_device_label;
GtkWidget *confirm_connect_after_label;
} NMAMobileWizardPrivate;
@@ -140,7 +140,7 @@ assistant_closed (GtkButton *button, gpointer user_data)
family = get_provider_unlisted_type (self);
if (family == NMA_MOBILE_FAMILY_3GPP)
- wiz_method->gsm_apn = g_strdup (gtk_entry_get_text (GTK_ENTRY
(priv->plan_apn_entry)));
+ wiz_method->gsm_apn = g_strdup (gtk_entry_get_text (priv->plan_apn_entry));
} else {
gboolean manual = FALSE;
@@ -168,7 +168,7 @@ assistant_closed (GtkButton *button, gpointer user_data)
}
} else {
family = NMA_MOBILE_FAMILY_3GPP;
- wiz_method->gsm_apn = g_strdup (gtk_entry_get_text (GTK_ENTRY
(priv->plan_apn_entry)));
+ wiz_method->gsm_apn = g_strdup (gtk_entry_get_text (priv->plan_apn_entry));
}
}
}
@@ -248,43 +248,43 @@ confirm_prepare (NMAMobileWizard *self)
g_string_append_printf (str, ", %s", nma_country_info_get_country_name (country_info));
nma_country_info_unref (country_info);
- gtk_label_set_text (GTK_LABEL (priv->confirm_provider), str->str);
- gtk_widget_show (priv->confirm_provider);
+ gtk_label_set_text (priv->confirm_provider, str->str);
+ gtk_widget_show (GTK_WIDGET (priv->confirm_provider));
g_string_free (str, TRUE);
if (priv->dev_desc) {
- gtk_label_set_text (GTK_LABEL (priv->confirm_device), priv->dev_desc);
- gtk_widget_show (priv->confirm_device_label);
- gtk_widget_show (priv->confirm_device);
+ gtk_label_set_text (priv->confirm_device, priv->dev_desc);
+ gtk_widget_show (GTK_WIDGET (priv->confirm_device_label));
+ gtk_widget_show (GTK_WIDGET (priv->confirm_device));
} else {
- gtk_widget_hide (priv->confirm_device_label);
- gtk_widget_hide (priv->confirm_device);
+ gtk_widget_hide (GTK_WIDGET (priv->confirm_device_label));
+ gtk_widget_hide (GTK_WIDGET (priv->confirm_device));
}
if (priv->provider_only_cdma) {
- gtk_widget_hide (priv->confirm_plan_label);
- gtk_widget_hide (priv->confirm_plan);
+ gtk_widget_hide (GTK_WIDGET (priv->confirm_plan_label));
+ gtk_widget_hide (GTK_WIDGET (priv->confirm_plan));
} else {
/* Plan */
- gtk_widget_show (priv->confirm_plan_label);
- gtk_widget_show (priv->confirm_plan);
+ gtk_widget_show (GTK_WIDGET (priv->confirm_plan_label));
+ gtk_widget_show (GTK_WIDGET (priv->confirm_plan));
if (method)
- gtk_label_set_text (GTK_LABEL (priv->confirm_plan), nma_mobile_access_method_get_name
(method));
+ gtk_label_set_text (priv->confirm_plan, nma_mobile_access_method_get_name (method));
else
- gtk_label_set_text (GTK_LABEL (priv->confirm_plan), _("Unlisted"));
+ gtk_label_set_text (priv->confirm_plan, _("Unlisted"));
- apn = gtk_entry_get_text (GTK_ENTRY (priv->plan_apn_entry));
+ apn = gtk_entry_get_text (priv->plan_apn_entry);
}
if (apn) {
str = g_string_new (NULL);
g_string_append_printf (str, "<span color=\"#999999\">APN: %s</span>", apn);
- gtk_label_set_markup (GTK_LABEL (priv->confirm_apn), str->str);
+ gtk_label_set_markup (priv->confirm_apn, str->str);
g_string_free (str, TRUE);
- gtk_widget_show (priv->confirm_apn);
+ gtk_widget_show (GTK_WIDGET (priv->confirm_apn));
} else {
- gtk_widget_hide (priv->confirm_apn);
+ gtk_widget_hide (GTK_WIDGET (priv->confirm_apn));
}
}
@@ -305,10 +305,10 @@ get_selected_method (NMAMobileWizard *self, gboolean *manual)
GtkTreeIter iter;
gboolean is_manual = FALSE;
- if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->plan_combo), &iter))
+ if (!gtk_combo_box_get_active_iter (priv->plan_combo, &iter))
return NULL;
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->plan_combo));
+ model = gtk_combo_box_get_model (priv->plan_combo);
if (!model)
return NULL;
@@ -342,7 +342,7 @@ plan_update_complete (NMAMobileWizard *self)
} else {
const char *manual_apn;
- manual_apn = gtk_entry_get_text (GTK_ENTRY (priv->plan_apn_entry));
+ manual_apn = gtk_entry_get_text (priv->plan_apn_entry);
gtk_assistant_set_page_complete (assistant, priv->plan_page,
(manual_apn && strlen (manual_apn)));
}
@@ -357,12 +357,12 @@ plan_combo_changed (NMAMobileWizard *self)
method = get_selected_method (self, &is_manual);
if (method) {
- gtk_entry_set_text (GTK_ENTRY (priv->plan_apn_entry), nma_mobile_access_method_get_3gpp_apn
(method));
- gtk_widget_set_sensitive (priv->plan_apn_entry, FALSE);
+ gtk_entry_set_text (priv->plan_apn_entry, nma_mobile_access_method_get_3gpp_apn (method));
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->plan_apn_entry), FALSE);
} else {
- gtk_entry_set_text (GTK_ENTRY (priv->plan_apn_entry), "");
- gtk_widget_set_sensitive (priv->plan_apn_entry, TRUE);
- gtk_widget_grab_focus (priv->plan_apn_entry);
+ gtk_entry_set_text (priv->plan_apn_entry, "");
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->plan_apn_entry), TRUE);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->plan_apn_entry));
}
if (method)
@@ -408,7 +408,7 @@ plan_setup (NMAMobileWizard *self)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
GtkCellRenderer *renderer;
- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (priv->plan_combo),
+ gtk_combo_box_set_row_separator_func (priv->plan_combo,
plan_row_separator_func,
NULL,
NULL);
@@ -425,7 +425,7 @@ focus_plan_apn_entry (gpointer user_data)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
priv->plan_focus_id = 0;
- gtk_widget_grab_focus (priv->plan_apn_entry);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->plan_apn_entry));
return FALSE;
}
@@ -477,10 +477,10 @@ plan_prepare (NMAMobileWizard *self)
TRUE,
-1);
/* Select the first item by default if nothing is yet selected */
- if (gtk_combo_box_get_active (GTK_COMBO_BOX (priv->plan_combo)) < 0)
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->plan_combo), 0);
+ if (gtk_combo_box_get_active (priv->plan_combo) < 0)
+ gtk_combo_box_set_active (priv->plan_combo, 0);
- gtk_widget_set_sensitive (priv->plan_combo, count > 0);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->plan_combo), count > 0);
if (count == 0) {
if (!priv->plan_focus_id)
priv->plan_focus_id = g_idle_add (focus_plan_apn_entry, self);
@@ -527,10 +527,10 @@ get_selected_provider (NMAMobileWizard *self)
GtkTreeIter iter;
NMAMobileProvider *provider = NULL;
- if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->providers_view_radio)))
+ if (!gtk_toggle_button_get_active (priv->providers_view_radio))
return NULL;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->providers_view));
+ selection = gtk_tree_view_get_selection (priv->providers_view);
g_assert (selection);
if (!gtk_tree_selection_get_selected (GTK_TREE_SELECTION (selection), &model, &iter))
@@ -547,7 +547,7 @@ providers_update_complete (NMAMobileWizard *self)
GtkAssistant *assistant = GTK_ASSISTANT (self);
gboolean use_view;
- use_view = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->providers_view_radio));
+ use_view = gtk_toggle_button_get_active (priv->providers_view_radio);
if (use_view) {
NMAMobileProvider *provider;
@@ -567,7 +567,7 @@ focus_providers_view (gpointer user_data)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
priv->providers_focus_id = 0;
- gtk_widget_grab_focus (priv->providers_view);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->providers_view));
return FALSE;
}
@@ -578,7 +578,7 @@ focus_provider_unlisted_type_combo (gpointer user_data)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
priv->providers_focus_id = 0;
- gtk_widget_grab_focus (priv->provider_unlisted_type_combo);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->provider_unlisted_type_combo));
return FALSE;
}
@@ -589,17 +589,17 @@ providers_radio_toggled (GtkToggleButton *button, gpointer user_data)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
gboolean use_view;
- use_view = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->providers_view_radio));
+ use_view = gtk_toggle_button_get_active (priv->providers_view_radio);
if (use_view) {
if (!priv->providers_focus_id)
priv->providers_focus_id = g_idle_add (focus_providers_view, self);
- gtk_widget_set_sensitive (priv->providers_view, TRUE);
- gtk_widget_set_sensitive (priv->provider_unlisted_type_combo, FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->providers_view), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->provider_unlisted_type_combo), FALSE);
} else if (priv->family == NMA_MOBILE_FAMILY_UNKNOWN) {
if (!priv->providers_focus_id)
priv->providers_focus_id = g_idle_add (focus_provider_unlisted_type_combo, self);
- gtk_widget_set_sensitive (priv->providers_view, FALSE);
- gtk_widget_set_sensitive (priv->provider_unlisted_type_combo, TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->providers_view), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->provider_unlisted_type_combo), TRUE);
}
providers_update_complete (self);
@@ -610,7 +610,7 @@ get_provider_unlisted_type (NMAMobileWizard *self)
{
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
- switch (gtk_combo_box_get_active (GTK_COMBO_BOX (priv->provider_unlisted_type_combo))) {
+ switch (gtk_combo_box_get_active (priv->provider_unlisted_type_combo)) {
case 0:
return NMA_MOBILE_FAMILY_3GPP;
case 1:
@@ -636,23 +636,23 @@ providers_setup (NMAMobileWizard *self)
renderer,
"text", PROVIDER_COL_NAME,
NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->providers_view), column);
+ gtk_tree_view_append_column (priv->providers_view, column);
gtk_tree_view_column_set_clickable (column, TRUE);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->providers_view));
+ selection = gtk_tree_view_get_selection (priv->providers_view);
g_assert (selection);
switch (priv->family) {
case NMA_MOBILE_FAMILY_3GPP:
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->provider_unlisted_type_combo), 0);
- gtk_widget_set_sensitive (priv->provider_unlisted_type_combo, FALSE);
+ gtk_combo_box_set_active (priv->provider_unlisted_type_combo, 0);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->provider_unlisted_type_combo), FALSE);
break;
case NMA_MOBILE_FAMILY_CDMA:
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->provider_unlisted_type_combo), 1);
- gtk_widget_set_sensitive (priv->provider_unlisted_type_combo, FALSE);
+ gtk_combo_box_set_active (priv->provider_unlisted_type_combo, 1);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->provider_unlisted_type_combo), FALSE);
break;
case NMA_MOBILE_FAMILY_UNKNOWN:
- gtk_widget_set_sensitive (priv->provider_unlisted_type_combo, TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->provider_unlisted_type_combo), TRUE);
break;
}
}
@@ -701,21 +701,21 @@ providers_prepare (NMAMobileWizard *self)
}
nma_country_info_unref (country_info);
- gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->providers_view), PROVIDER_COL_NAME);
- gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (priv->providers_view),
+ gtk_tree_view_set_search_column (priv->providers_view, PROVIDER_COL_NAME);
+ gtk_tree_view_set_search_equal_func (priv->providers_view,
providers_search_func, self, NULL);
/* If no row has focus yet, focus the first row so that the user can start
* incremental search without clicking.
*/
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->providers_view));
+ selection = gtk_tree_view_get_selection (priv->providers_view);
g_assert (selection);
if (!gtk_tree_selection_count_selected_rows (selection)) {
GtkTreeIter first_iter;
GtkTreePath *first_path;
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->providers_sort), &first_iter)) {
- first_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->providers_sort),
&first_iter);
+ if (gtk_tree_model_get_iter_first (priv->providers_sort, &first_iter)) {
+ first_path = gtk_tree_model_get_path (priv->providers_sort, &first_iter);
if (first_path) {
gtk_tree_selection_select_path (selection, first_path);
gtk_tree_path_free (first_path);
@@ -725,10 +725,10 @@ providers_prepare (NMAMobileWizard *self)
if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->providers_store), NULL) == 0) {
/* No providers to choose from. */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->provider_unlisted_radio), TRUE);
+ gtk_toggle_button_set_active (priv->provider_unlisted_radio, TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (priv->providers_view_radio), FALSE);
} else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->providers_view_radio), TRUE);
+ gtk_toggle_button_set_active (priv->providers_view_radio, TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (priv->providers_view_radio), TRUE);
}
@@ -805,12 +805,12 @@ add_one_country (gpointer key, gpointer value, gpointer user_data)
if (country_view_path) {
GtkTreeSelection *selection;
- gtk_tree_view_expand_row (GTK_TREE_VIEW (priv->country_view), country_view_path, TRUE);
+ gtk_tree_view_expand_row (priv->country_view, country_view_path, TRUE);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->country_view));
+ selection = gtk_tree_view_get_selection (priv->country_view);
g_assert (selection);
gtk_tree_selection_select_path (selection, country_view_path);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->country_view),
+ gtk_tree_view_scroll_to_cell (priv->country_view,
country_view_path, NULL, TRUE, 0, 0);
gtk_tree_path_free (country_view_path);
}
@@ -826,7 +826,7 @@ get_selected_country (NMAMobileWizard *self)
GtkTreeIter iter;
NMACountryInfo *country_info = NULL;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->country_view));
+ selection = gtk_tree_view_get_selection (priv->country_view);
g_assert (selection);
if (!gtk_tree_selection_get_selected (GTK_TREE_SELECTION (selection), &model, &iter))
@@ -842,7 +842,7 @@ country_update_complete (NMAMobileWizard *self)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
GtkTreeSelection *selection;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->country_view));
+ selection = gtk_tree_view_get_selection (priv->country_view);
g_assert (selection);
gtk_assistant_set_page_complete (GTK_ASSISTANT (self),
@@ -924,7 +924,7 @@ country_setup (NMAMobileWizard *self)
renderer,
"text", COUNTRIES_COL_NAME,
NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->country_view), column);
+ gtk_tree_view_append_column (priv->country_view, column);
gtk_tree_view_column_set_clickable (column, TRUE);
/* Add the rest of the providers */
@@ -938,7 +938,7 @@ country_setup (NMAMobileWizard *self)
/* If no row has focus yet, focus the first row so that the user can start
* incremental search without clicking.
*/
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->country_view));
+ selection = gtk_tree_view_get_selection (priv->country_view);
g_assert (selection);
if (!gtk_tree_selection_count_selected_rows (selection)) {
GtkTreeIter first_iter;
@@ -964,7 +964,7 @@ focus_country_view (gpointer user_data)
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
priv->country_focus_id = 0;
- gtk_widget_grab_focus (priv->country_view);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->country_view));
return FALSE;
}
@@ -973,8 +973,8 @@ country_prepare (NMAMobileWizard *self)
{
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
- gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->country_view), COUNTRIES_COL_NAME);
- gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (priv->country_view), country_search_func, self,
NULL);
+ gtk_tree_view_set_search_column (priv->country_view, COUNTRIES_COL_NAME);
+ gtk_tree_view_set_search_equal_func (priv->country_view, country_search_func, self, NULL);
if (!priv->country_focus_id)
priv->country_focus_id = g_idle_add (focus_country_view, self);
@@ -1020,9 +1020,9 @@ __intro_device_added (NMAMobileWizard *self, NMDevice *device, gboolean select_i
/* Select the device just added */
if (select_it)
- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->dev_combo), &iter);
+ gtk_combo_box_set_active_iter (priv->dev_combo, &iter);
- gtk_widget_set_sensitive (priv->dev_combo, TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->dev_combo), TRUE);
return TRUE;
}
@@ -1057,7 +1057,7 @@ intro_device_removed_cb (NMClient *client, NMDevice *device, NMAMobileWizard *se
} while (!removed && gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->dev_store), &iter));
/* There's already a selected device item; nothing more to do */
- if (gtk_combo_box_get_active (GTK_COMBO_BOX (priv->dev_combo)) > 1)
+ if (gtk_combo_box_get_active (priv->dev_combo) > 1)
return;
/* If there are no more devices, select the "Any" item and disable the
@@ -1080,10 +1080,10 @@ intro_device_removed_cb (NMClient *client, NMDevice *device, NMAMobileWizard *se
if (have_device) {
/* Iter should point to the last device item in the combo */
- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->dev_combo), &iter);
+ gtk_combo_box_set_active_iter (priv->dev_combo, &iter);
} else {
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->dev_combo), 0);
- gtk_widget_set_sensitive (priv->dev_combo, FALSE);
+ gtk_combo_box_set_active (priv->dev_combo, 0);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->dev_combo), FALSE);
}
}
@@ -1106,8 +1106,8 @@ intro_add_initial_devices (NMAMobileWizard *self)
/* Otherwise the "Any device" item */
if (!selected_first) {
/* Select the first device item by default */
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->dev_combo), 0);
- gtk_widget_set_sensitive (priv->dev_combo, FALSE);
+ gtk_combo_box_set_active (priv->dev_combo, 0);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->dev_combo), FALSE);
}
}
@@ -1119,8 +1119,8 @@ intro_remove_all_devices (NMAMobileWizard *self)
gtk_tree_store_clear (priv->dev_store);
/* Select the "Any device" item */
- gtk_combo_box_set_active (GTK_COMBO_BOX (priv->dev_combo), 0);
- gtk_widget_set_sensitive (priv->dev_combo, FALSE);
+ gtk_combo_box_set_active (priv->dev_combo, 0);
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->dev_combo), FALSE);
}
static void
@@ -1151,7 +1151,7 @@ intro_combo_changed (NMAMobileWizard *self)
g_free (priv->dev_desc);
priv->dev_desc = NULL;
- if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->dev_combo), &iter))
+ if (!gtk_combo_box_get_active_iter (priv->dev_combo, &iter))
return;
gtk_tree_model_get (GTK_TREE_MODEL (priv->dev_store), &iter,
@@ -1203,7 +1203,7 @@ intro_setup (NMAMobileWizard *self)
G_CALLBACK (intro_manager_running_cb), self);
}
- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (priv->dev_combo),
+ gtk_combo_box_set_row_separator_func (priv->dev_combo,
intro_row_separator_func, NULL, NULL);
renderer = gtk_cell_renderer_text_new ();
@@ -1296,7 +1296,7 @@ forward_func (gint current_page, gpointer user_data)
/* If the provider is unlisted, we can skip ahead of the user's
* access technology is CDMA.
*/
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->provider_unlisted_radio))) {
+ if (gtk_toggle_button_get_active (priv->provider_unlisted_radio)) {
if (family == NMA_MOBILE_FAMILY_UNKNOWN)
family = get_provider_unlisted_type (self);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]