Example #1
0
static void
empathy_preferences_init (EmpathyPreferences *preferences)
{
    EmpathyPreferencesPriv    *priv;
    GtkBuilder                *gui;
    gchar                     *filename;
    GtkWidget                 *page;

    priv = preferences->priv = G_TYPE_INSTANCE_GET_PRIVATE (preferences,
                               EMPATHY_TYPE_PREFERENCES, EmpathyPreferencesPriv);

    gtk_dialog_add_button (GTK_DIALOG (preferences),
                           GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);

    gtk_container_set_border_width (GTK_CONTAINER (preferences), 5);
    gtk_window_set_title (GTK_WINDOW (preferences), _("Preferences"));
    gtk_window_set_role (GTK_WINDOW (preferences), "preferences");
    gtk_window_set_position (GTK_WINDOW (preferences),
                             GTK_WIN_POS_CENTER_ON_PARENT);
    gtk_window_set_icon_name (GTK_WINDOW (preferences), "gtk-preferences");

    filename = empathy_file_lookup ("empathy-preferences.ui", "src");
    gui = empathy_builder_get_file (filename,
                                    "notebook", &priv->notebook,
                                    "checkbutton_show_smileys", &priv->checkbutton_show_smileys,
                                    "checkbutton_show_contacts_in_rooms", &priv->checkbutton_show_contacts_in_rooms,
                                    "combobox_chat_theme", &priv->combobox_chat_theme,
                                    "checkbutton_separate_chat_windows", &priv->checkbutton_separate_chat_windows,
                                    "checkbutton_events_notif_area", &priv->checkbutton_events_notif_area,
                                    "checkbutton_autoconnect", &priv->checkbutton_autoconnect,
                                    "checkbutton_logging", &priv->checkbutton_logging,
                                    "checkbutton_notifications_enabled", &priv->checkbutton_notifications_enabled,
                                    "checkbutton_notifications_disabled_away", &priv->checkbutton_notifications_disabled_away,
                                    "checkbutton_notifications_focus", &priv->checkbutton_notifications_focus,
                                    "checkbutton_notifications_contact_signin", &priv->checkbutton_notifications_contact_signin,
                                    "checkbutton_notifications_contact_signout", &priv->checkbutton_notifications_contact_signout,
                                    "checkbutton_sounds_enabled", &priv->checkbutton_sounds_enabled,
                                    "checkbutton_sounds_disabled_away", &priv->checkbutton_sounds_disabled_away,
                                    "treeview_sounds", &priv->treeview_sounds,
                                    "treeview_spell_checker", &priv->treeview_spell_checker,
                                    "checkbutton_location_publish", &priv->checkbutton_location_publish,
                                    "checkbutton_location_reduce_accuracy", &priv->checkbutton_location_reduce_accuracy,
                                    "checkbutton_location_resource_network", &priv->checkbutton_location_resource_network,
                                    "checkbutton_location_resource_cell", &priv->checkbutton_location_resource_cell,
                                    "checkbutton_location_resource_gps", &priv->checkbutton_location_resource_gps,
                                    NULL);
    g_free (filename);

    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (preferences))), priv->notebook);
    gtk_widget_show (priv->notebook);

    g_object_unref (gui);

    priv->gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
    priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
    priv->gsettings_loc = g_settings_new (EMPATHY_PREFS_LOCATION_SCHEMA);
    priv->gsettings_notify = g_settings_new (EMPATHY_PREFS_NOTIFICATIONS_SCHEMA);
    priv->gsettings_sound = g_settings_new (EMPATHY_PREFS_SOUNDS_SCHEMA);
    priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
    priv->gsettings_logger = g_settings_new (EMPATHY_PREFS_LOGGER_SCHEMA);

    preferences_themes_setup (preferences);

    preferences_setup_widgets (preferences);

    preferences_languages_setup (preferences);
    preferences_languages_add (preferences);
    preferences_languages_load (preferences);

    preferences_sound_setup (preferences);
    preferences_sound_load (preferences);

    if (empathy_spell_supported ()) {
        page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 2);
        gtk_widget_show (page);
    }

    page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 3);
#ifdef HAVE_GEOCLUE
    gtk_widget_show (page);
#else
    gtk_widget_hide (page);
#endif
}
Example #2
0
static void gcal_editable_init (GcalEditable *self)
{
    self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
                 GCAL_TYPE_EDITABLE,
                 GcalEditablePrivate);
}
Example #3
0
static void
gth_reorder_task_init (GthReorderTask *self)
{
	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_REORDER_TASK, GthReorderTaskPrivate);
}
static void
cc_privacy_panel_init (CcPrivacyPanel *self)
{
  GError    *error;
  GtkWidget *widget;
  GtkWidget *frame;
  guint res;

  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CC_TYPE_PRIVACY_PANEL, CcPrivacyPanelPrivate);
  g_resources_register (cc_privacy_get_resource ());

  self->priv->builder = gtk_builder_new ();

  error = NULL;
  res = gtk_builder_add_from_resource (self->priv->builder,
                                       "/org/gnome/control-center/privacy/privacy.ui",
                                       &error);

  if (res == 0)
    {
      g_warning ("Could not load interface file: %s",
                 (error != NULL) ? error->message : "unknown error");
      g_clear_error (&error);
      return;
    }

  self->priv->recent_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "recent_dialog"));
  self->priv->screen_lock_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "screen_lock_dialog"));
  self->priv->trash_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "trash_dialog"));
  self->priv->software_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "software_dialog"));
  self->priv->abrt_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "abrt_dialog"));

  frame = WID ("frame");
  widget = gtk_list_box_new ();
  gtk_list_box_set_selection_mode (GTK_LIST_BOX (widget), GTK_SELECTION_NONE);
  gtk_container_add (GTK_CONTAINER (frame), widget);
  self->priv->list_box = widget;
  gtk_widget_show (widget);

  g_signal_connect_swapped (widget, "row-activated",
                            G_CALLBACK (activate_row), self);

  gtk_list_box_set_header_func (GTK_LIST_BOX (widget),
                                cc_list_box_update_header_func,
                                NULL, NULL);

  self->priv->lockdown_settings = g_settings_new ("org.gnome.desktop.lockdown");
  self->priv->lock_settings = g_settings_new ("org.gnome.desktop.screensaver");
  self->priv->privacy_settings = g_settings_new ("org.gnome.desktop.privacy");
  self->priv->notification_settings = g_settings_new ("org.gnome.desktop.notifications");
  self->priv->location_settings = g_settings_new ("org.gnome.system.location");

  add_screen_lock (self);
  add_usage_history (self);
  add_trash_temp (self);
  add_software (self);
  add_abrt (self);

  g_signal_connect (self->priv->lockdown_settings, "changed",
                    G_CALLBACK (on_lockdown_settings_changed), self);
  update_lock_screen_sensitivity (self);

  widget = WID ("location_services_switch");
  gtk_switch_set_active (GTK_SWITCH (widget),
                         g_settings_get_boolean (self->priv->location_settings,
                                                 LOCATION_ENABLED));
  g_settings_bind (self->priv->location_settings,
                   LOCATION_ENABLED,
                   widget, "active",
                   G_SETTINGS_BIND_DEFAULT);

  widget = WID ("privacy_vbox");
  gtk_container_add (GTK_CONTAINER (self), widget);
}
static void
is_sensor_dialog_init(IsSensorDialog *self)
{
	IsSensorDialogPrivate *priv;
	GtkWidget *label, *low_label, *high_label, *grid;

	self->priv = priv =
		G_TYPE_INSTANCE_GET_PRIVATE(self, IS_TYPE_SENSOR_DIALOG,
					    IsSensorDialogPrivate);

	gtk_window_set_title(GTK_WINDOW(self), _(PACKAGE_NAME " Sensor Properties"));
	gtk_window_set_default_size(GTK_WINDOW(self), 250, 0);

	gtk_dialog_add_button(GTK_DIALOG(self),
			      GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT);

	/* pack content into box */
	grid = gtk_grid_new();
	gtk_grid_set_column_spacing(GTK_GRID(grid), 6);
	gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
	gtk_container_set_border_width(GTK_CONTAINER(grid), 6);

	priv->path_label = gtk_label_new(NULL);
	gtk_misc_set_alignment(GTK_MISC(priv->path_label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), priv->path_label,
			0, 0,
			4, 1);

	label = gtk_label_new(_("Label"));
	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), label,
			0, 1,
			1, 1);
	priv->label_entry = gtk_entry_new();
	gtk_grid_attach(GTK_GRID(grid), priv->label_entry,
			1, 1,
			3, 1);
	label = gtk_label_new(_("Alarm"));
	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), label,
			0, 2,
			1, 1);
	priv->alarm_mode_combo_box = gtk_combo_box_text_new();
	gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->alarm_mode_combo_box),
				       IS_SENSOR_ALARM_MODE_DISABLED,
				       _("Disabled"));
	gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->alarm_mode_combo_box),
				       IS_SENSOR_ALARM_MODE_LOW,
				       _("Below"));
	gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->alarm_mode_combo_box),
				       IS_SENSOR_ALARM_MODE_HIGH,
				       _("Above"));
	gtk_widget_set_sensitive(priv->alarm_mode_combo_box, FALSE);
	gtk_grid_attach(GTK_GRID(grid), priv->alarm_mode_combo_box,
			1, 2,
			1, 1);
	priv->alarm_value_spin_button = gtk_spin_button_new_with_range(-MAX_VALUE,
								       MAX_VALUE,
								       1.0f);
	gtk_widget_set_sensitive(priv->alarm_value_spin_button, FALSE);
	gtk_grid_attach(GTK_GRID(grid), priv->alarm_value_spin_button,
			2, 2,
			1, 1);
	priv->units_label = gtk_label_new(NULL);
	gtk_misc_set_alignment(GTK_MISC(priv->units_label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), priv->units_label,
			3, 2,
			1, 1);

	low_label = gtk_label_new(_("Low value"));
	gtk_misc_set_alignment(GTK_MISC(low_label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), low_label,
			0, 3,
			1, 1);

	priv->low_value = gtk_spin_button_new_with_range(-MAX_VALUE,
							 MAX_VALUE,
							 1.0f);
	gtk_grid_attach(GTK_GRID(grid), priv->low_value,
			1, 3,
			1, 1);

	priv->low_units_label = gtk_label_new(NULL);
	gtk_misc_set_alignment(GTK_MISC(priv->low_units_label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), priv->low_units_label,
			2, 3,
			1, 1);

	high_label = gtk_label_new(_("High value"));
	gtk_misc_set_alignment(GTK_MISC(high_label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), high_label,
			0, 4,
			1, 1);

	priv->high_value = gtk_spin_button_new_with_range(-MAX_VALUE,
							  MAX_VALUE,
							  1.0f);
	gtk_grid_attach(GTK_GRID(grid), priv->high_value,
			1, 4,
			1, 1);

	priv->high_units_label = gtk_label_new(NULL);
	gtk_misc_set_alignment(GTK_MISC(priv->high_units_label), 0.0, 0.5);
	gtk_grid_attach(GTK_GRID(grid), priv->high_units_label,
			2, 4,
			1, 1);

	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(self))),
			  grid);
}
static void
gst_device_init (GstDevice * device)
{
  device->priv = G_TYPE_INSTANCE_GET_PRIVATE (device, GST_TYPE_DEVICE,
      GstDevicePrivate);
}
Example #7
0
static void
ges_effect_init (GESEffect * self)
{
  self->priv =
      G_TYPE_INSTANCE_GET_PRIVATE (self, GES_TYPE_EFFECT, GESEffectPrivate);
}
Example #8
0
static void qq_chatwindow_init(QQChatWindow *win)
{
    QQChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE(win
                                        , qq_chatwindow_get_type()
                                        , QQChatWindowPriv);
    gchar buf[500];
    priv -> body_vbox = gtk_vbox_new(FALSE, 0);

    GtkWidget *header_hbox = gtk_hbox_new(FALSE, 0);
    GtkWidget *vbox = gtk_vbox_new(FALSE, 0);

    QQBuddy *bdy = qq_info_lookup_buddy_by_uin(info, priv -> uin);
    GdkPixbuf *pb = NULL;
    g_snprintf(buf, 500, IMGDIR"%s", "avatar.gif");
    pb = gdk_pixbuf_new_from_file(buf, NULL);
    gtk_window_set_icon(GTK_WINDOW(win), pb);
    g_object_unref(pb);
    g_snprintf(buf, 500, "Talking with %s", bdy == NULL ? priv -> uin
                                                    : bdy -> nick -> str);
    gtk_window_set_title(GTK_WINDOW(win), buf);

    //create header
    g_snprintf(buf, 500, IMGDIR"%s", "avatar.gif");
    pb= gdk_pixbuf_new_from_file_at_size(buf, 35, 35, NULL);
    priv -> faceimage = gtk_image_new_from_pixbuf(pb);
    g_object_unref(pb);
    priv -> name_label = gtk_label_new("");
    priv -> lnick_label = gtk_label_new("");
    gtk_box_pack_start(GTK_BOX(header_hbox), priv -> faceimage
                                        , FALSE, FALSE, 5);
    gtk_box_pack_start(GTK_BOX(vbox), priv -> name_label, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), priv -> lnick_label, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(header_hbox), vbox, FALSE, FALSE, 5);
    gtk_box_pack_start(GTK_BOX(priv -> body_vbox), header_hbox
                                        , FALSE, FALSE, 5);

    // message text view
    priv -> chat_widget = qq_chatwidget_new();
    gtk_box_pack_start(GTK_BOX(priv -> body_vbox), priv -> chat_widget
                                                , TRUE, TRUE, 0);

    // buttons
    GtkWidget *buttonbox = gtk_hbutton_box_new();
    gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonbox), GTK_BUTTONBOX_END);
    gtk_box_set_spacing(GTK_BOX(buttonbox), 5);
    priv -> close_btn = gtk_button_new_with_label("Close");
    g_signal_connect(G_OBJECT(priv -> close_btn), "clicked",
                             G_CALLBACK(qq_chatwindow_on_close_clicked), win);
    priv -> send_btn = gtk_button_new_with_label("Send");
    g_signal_connect(G_OBJECT(priv -> send_btn), "clicked",
                             G_CALLBACK(qq_chatwindow_on_send_clicked), win);
    gtk_container_add(GTK_CONTAINER(buttonbox), priv -> close_btn);
    gtk_container_add(GTK_CONTAINER(buttonbox), priv -> send_btn);
    gtk_box_pack_start(GTK_BOX(priv -> body_vbox), buttonbox, FALSE, FALSE, 3);

    GtkWidget *w = GTK_WIDGET(win);
    gtk_window_resize(GTK_WINDOW(w), 500, 450);
    gtk_container_add(GTK_CONTAINER(win), priv -> body_vbox);

    gtk_widget_show_all(priv -> body_vbox);
    gtk_widget_grab_focus(qq_chatwidget_get_input_textview(
                                priv -> chat_widget));

    g_signal_connect(G_OBJECT(win), "delete-event"
                                , G_CALLBACK(qq_chatwindow_delete_event)
                                , priv);
    g_signal_connect(G_OBJECT(win), "focus-in-event"
                                , G_CALLBACK(qq_chatwindow_focus_in_event)
                                , priv);
    g_signal_connect(G_OBJECT(win), "key-press-event"
                            , G_CALLBACK(qq_chatwindow_key_press), priv);

    g_signal_connect(G_OBJECT(qq_chatwidget_get_input_textview(
                                                priv -> chat_widget))
                            , "key-press-event"
                            , G_CALLBACK(qq_input_textview_key_press), win);
}
Example #9
0
/*
 * The setter.
 */
static void qq_chatwindow_setter(GObject *object, guint property_id,
                                 const GValue *value, GParamSpec *pspec)
{
    if(object == NULL || value == NULL || property_id < 0){
            return;
    }
    QQChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE(
                                    object, qq_chatwindow_get_type()
                                    , QQChatWindowPriv);
    gchar buf[500];
    GdkPixbuf *pb = NULL;
    switch (property_id)
    {
    case QQ_CHATWINDOW_PROPERTY_UIN:
        g_stpcpy(priv -> uin, g_value_get_string(value));
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
        break;
    }

    QQBuddy *bdy = qq_info_lookup_buddy_by_uin(info, priv -> uin);
    gchar *name = priv -> uin;
    if(bdy == NULL){
        return;
    }
    // set lnick
    g_snprintf(buf, 500, "<b>%s</b>", bdy -> lnick -> str);
    gtk_label_set_markup(GTK_LABEL(priv -> lnick_label), buf);
    // set face image
	g_snprintf(buf, 500, "%s/%s", QQ_FACEDIR, bdy -> qqnumber -> str);
    pb= gdk_pixbuf_new_from_file_at_size(buf, 35, 35, NULL);
    if(pb == NULL){
        pb= gdk_pixbuf_new_from_file_at_size(IMGDIR"/avatar.gif"
                                        , 35, 35, NULL);
    }
    gtk_image_set_from_pixbuf(GTK_IMAGE(priv -> faceimage), pb);
    // window icon
    gtk_window_set_icon(GTK_WINDOW(object), pb);
    g_object_unref(pb);

    if(bdy -> markname == NULL || bdy -> markname -> len <= 0){
        name = bdy -> nick -> str;
    }else{
        name = bdy -> markname -> str;
    }
    // set status and name
    if(g_strcmp0("online", bdy -> status -> str) == 0
                    || g_strcmp0("away", bdy -> status -> str) == 0
                    || g_strcmp0("busy", bdy -> status -> str) == 0
                    || g_strcmp0("silent", bdy -> status -> str) == 0
                    || g_strcmp0("callme", bdy -> status -> str) == 0){
        gtk_widget_set_sensitive(priv -> faceimage, TRUE);
        g_snprintf(buf, 500, "<b>%s</b><span color='blue'>[%s]</span>"
                                            , name
                                            , bdy -> status -> str);
    }else{
        gtk_widget_set_sensitive(priv -> faceimage, FALSE);
        g_snprintf(buf, 500, "<b>%s</b>", name);
    }
    gtk_label_set_markup(GTK_LABEL(priv -> name_label), buf);

    // window title
    g_snprintf(buf, 500, "Talking with %s", name);
    gtk_window_set_title(GTK_WINDOW(object), buf);
}
Example #10
0
static void
gkm_secret_key_init (GkmSecretKey *self)
{
	self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GKM_TYPE_SECRET_KEY, GkmSecretKeyPrivate);
}
static void facq_pipeline_monitor_init(FacqPipelineMonitor *mon)
{
	mon->priv = G_TYPE_INSTANCE_GET_PRIVATE(mon,FACQ_TYPE_PIPELINE_MONITOR,FacqPipelineMonitorPrivate);
	mon->priv->q = NULL;
	mon->priv->source_id = 0;
}
Example #12
0
static void
bastile_pgp_key_init (BastilePgpKey *self)
{
	self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, BASTILE_TYPE_PGP_KEY, BastilePgpKeyPrivate);
}
Example #13
0
static void
axing_resolver_init (AxingResolver *resolver)
{
    resolver->priv = G_TYPE_INSTANCE_GET_PRIVATE (resolver, AXING_TYPE_RESOLVER,
                                                  AxingResolverPrivate);
}
Example #14
0
static void
math_preferences_init(MathPreferencesDialog *dialog)
{
    dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE(dialog, math_preferences_get_type(), MathPreferencesDialogPrivate);
}
/* create a dialog widget from scratch */
static void
gm_audio_profiles_edit_init (GMAudioProfilesEdit *dialog)
{
  GtkDialog *gdialog = GTK_DIALOG (dialog);
  GtkWidget *vbox;
  GtkWidget *label;
  GtkWidget *sw;
  GtkWidget *hbox;
  GtkWidget *bbox;
  GtkWidget *button;
  GtkTreeSelection *selection;

  /*
  dialog =
    gtk_dialog_new_with_buttons (_("Edit Profiles"),
                                 NULL,
                                 GTK_DIALOG_DESTROY_WITH_PARENT,
                                 GTK_STOCK_HELP,
                                 GTK_RESPONSE_HELP,
                                 GTK_STOCK_CLOSE,
                                 GTK_RESPONSE_ACCEPT,
                                 NULL);
  */
                                 // FIXME: GTK_DIALOG_DESTROY_WITH_PARENT,
  dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, GM_AUDIO_TYPE_PROFILES_EDIT, GMAudioProfilesEditPrivate);

  gtk_window_set_title (GTK_WINDOW (dialog), _("Edit MATE Audio Profiles"));
  gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 240);
  gtk_dialog_add_buttons (GTK_DIALOG (dialog),
                                 GTK_STOCK_HELP,
                                 GTK_RESPONSE_HELP,
                                 GTK_STOCK_CLOSE,
                                 GTK_RESPONSE_ACCEPT,
                                 NULL);

  gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
  gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (gdialog)), 2); /* 2 * 5 + 2 = 12 */
  gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (gdialog)), 5);
  gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (gdialog)), 6);

  g_signal_connect (GTK_DIALOG (dialog),
                    "response",
                    G_CALLBACK (on_gm_audio_profiles_edit_response),
                    NULL);

  g_signal_connect (G_OBJECT (dialog),
                    "destroy",
                    G_CALLBACK (on_gm_audio_profiles_edit_destroy),
                    NULL);

  vbox = gtk_vbox_new (FALSE, 6);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (gdialog)),
                      vbox, TRUE, TRUE, 0);

  /* FIXME
  hbox = gtk_hbox_new (FALSE, PADDING);
  gtk_box_pack_end (GTK_BOX (vbox),
                    hbox, FALSE, FALSE, 0);

  app->manage_profiles_default_menu = profile_optionmenu_new ();
  g_signal_connect (G_OBJECT (app->manage_profiles_default_menu),
                    "changed", G_CALLBACK (default_menu_changed),
                    app);

  gtk_box_pack_start (GTK_BOX (hbox),
                      label, TRUE, TRUE, 0);

  gtk_box_pack_end (GTK_BOX (hbox),
                    app->manage_profiles_default_menu, FALSE, FALSE, 0);
  */

  hbox = gtk_hbox_new (FALSE, 6);

  label = gtk_label_new_with_mnemonic (_("_Profiles:"));
  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);

  gtk_box_pack_start (GTK_BOX (vbox),
                      hbox, TRUE, TRUE, 0);

  dialog->priv->manage_profiles_list = create_profile_list ();

  g_signal_connect (G_OBJECT (dialog->priv->manage_profiles_list),
                    "row_activated",
                    G_CALLBACK (profile_activated_callback),
                    NULL);

  sw = gtk_scrolled_window_new (NULL, NULL);
  /* FIXME
  terminal_util_set_labelled_by (GTK_WIDGET (dialog->priv->manage_profiles_list),
                                 GTK_LABEL (label));
  */

  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
                                  GTK_POLICY_AUTOMATIC,
                                  GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
                                       GTK_SHADOW_IN);

  gtk_box_pack_start (GTK_BOX (hbox), sw, TRUE, TRUE, 0);

  gtk_container_add (GTK_CONTAINER (sw), dialog->priv->manage_profiles_list);

  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);

  gtk_label_set_mnemonic_widget (GTK_LABEL (label),
                                 dialog->priv->manage_profiles_list);

  bbox = gtk_vbutton_box_new ();
  gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START);
  gtk_box_set_spacing (GTK_BOX (bbox), 6);
  gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);

  button = gtk_button_new_from_stock (GTK_STOCK_NEW);
  fix_button_align (button);
  gtk_box_pack_start (GTK_BOX (bbox),
                      button, FALSE, FALSE, 0);
  g_signal_connect (G_OBJECT (button), "clicked",
                    G_CALLBACK (new_button_clicked), dialog);
  dialog->priv->new_button = button;
/*
  terminal_util_set_atk_name_description (dialog->priv->new_button, NULL,
                                          _("Click to open new profile dialog"));
*/

  gm_audio_profile_manage_register_stock ();

  button = gtk_button_new_from_stock (MANAGE_STOCK_EDIT);
  fix_button_align (button);
  gtk_box_pack_start (GTK_BOX (bbox),
                     button, FALSE, FALSE, 0);
  g_signal_connect (G_OBJECT (button), "clicked",
                    G_CALLBACK (edit_button_clicked), dialog);
  gtk_widget_set_sensitive (button, FALSE);
  dialog->priv->edit_button = button;
/*
  terminal_util_set_atk_name_description (app->manage_profiles_edit_button, NULL,
                                          _("Click to open edit profile dialog"));
*/

  button = gtk_button_new_from_stock (GTK_STOCK_DELETE);
  fix_button_align (button);
  gtk_box_pack_start (GTK_BOX (bbox),
                      button, FALSE, FALSE, 0);
  g_signal_connect (G_OBJECT (button), "clicked",
                    G_CALLBACK (delete_button_clicked), dialog);
  gtk_widget_set_sensitive (button, FALSE);
  dialog->priv->delete_button = button;
/*
  terminal_util_set_atk_name_description (app->manage_profiles_delete_button, NULL,
                                          _("Click to delete selected profile"));
  */

  gtk_widget_grab_focus (dialog->priv->manage_profiles_list);

  /* Monitor selection for sensitivity */
  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->manage_profiles_list));

  selection_changed_callback (selection, dialog->priv);
  g_signal_connect (G_OBJECT (selection), "changed",
                    G_CALLBACK (selection_changed_callback),
                    dialog->priv);
}
Example #16
0
static void
session_config_init (SessionConfig *config)
{
    config->priv = G_TYPE_INSTANCE_GET_PRIVATE (config, SESSION_CONFIG_TYPE, SessionConfigPrivate);
}
Example #17
0
static void
gcr_tree_selector_init (GcrTreeSelector *self)
{
	self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GCR_TYPE_TREE_SELECTOR, GcrTreeSelectorPrivate);
}
Example #18
0
static void
gth_location_chooser_init (GthLocationChooser *self)
{
	GtkCellRenderer *renderer;

	gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE);
	gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_HORIZONTAL);

	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_LOCATION_CHOOSER, GthLocationChooserPrivate);
	self->priv->entry_points_changed_id = 0;
	self->priv->arrow = NULL;
	self->priv->show_entry_points = TRUE;
	self->priv->relief = GTK_RELIEF_NORMAL;

	self->priv->model = gtk_tree_store_new (N_COLUMNS,
						G_TYPE_ICON,
						G_TYPE_STRING,
						G_TYPE_STRING,
						G_TYPE_INT,
						PANGO_TYPE_ELLIPSIZE_MODE);
	self->priv->combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (self->priv->model));
	g_object_unref (self->priv->model);
	g_signal_connect (self->priv->combo,
			  "changed",
			  G_CALLBACK (combo_changed_cb),
			  self);
	gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (self->priv->combo),
					      row_separator_func,
					      self,
					      NULL);
	gtk_widget_set_size_request (self->priv->combo, MIN_WIDTH, -1);

	/* icon column */

	renderer = gtk_cell_renderer_pixbuf_new ();
	g_object_set (renderer,
		      "follow-state", TRUE,
		      NULL);
	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self->priv->combo),
				    renderer,
				    FALSE);
	gtk_cell_layout_set_attributes  (GTK_CELL_LAYOUT (self->priv->combo),
					 renderer,
					 "gicon", ICON_COLUMN,
					 NULL);

	/* path column */

	renderer = gtk_cell_renderer_text_new ();
	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self->priv->combo),
				    renderer,
				    TRUE);
	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self->priv->combo),
					renderer,
					"text", NAME_COLUMN,
					"ellipsize", ELLIPSIZE_COLUMN,
					NULL);

	/**/

	gtk_widget_show (self->priv->combo);
	gtk_box_pack_start (GTK_BOX (self), self->priv->combo, TRUE, TRUE, 0);
}
Example #19
0
static void
rb_button_bar_init (RBButtonBar *bar)
{
	bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (bar, RB_TYPE_BUTTON_BAR, RBButtonBarPrivate);
}
Example #20
0
static void
arv_chunk_parser_init (ArvChunkParser *chunk_parser)
{
	chunk_parser->priv = G_TYPE_INSTANCE_GET_PRIVATE (chunk_parser, ARV_TYPE_CHUNK_PARSER, ArvChunkParserPrivate);
}
Example #21
0
static void
vinagre_ssh_connection_init (VinagreSshConnection *conn)
{
  conn->priv = G_TYPE_INSTANCE_GET_PRIVATE (conn, VINAGRE_TYPE_SSH_CONNECTION, VinagreSshConnectionPrivate);
}
Example #22
0
static void
marina_web_view_init (MarinaWebView *web_view)
{
  GtkWidget *scroller;
  WebKitWebSettings *settings;
  
  web_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (web_view,
                                                MARINA_TYPE_WEB_VIEW,
                                                MarinaWebViewPrivate);
  
  scroller = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroller), GTK_SHADOW_NONE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
                                  GTK_POLICY_AUTOMATIC,
                                  GTK_POLICY_AUTOMATIC);
  gtk_box_pack_start (GTK_BOX (web_view), scroller, TRUE, TRUE, 0);
  gtk_widget_show (scroller);
  
  web_view->priv->vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scroller));
  
  web_view->priv->web_view = webkit_web_view_new ();
  gtk_container_add (GTK_CONTAINER (scroller), web_view->priv->web_view);
  gtk_widget_show (web_view->priv->web_view);
  
  /* settings defaults */
  settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view->priv->web_view));
  g_object_set (settings,
                "enable-plugins", TRUE,
                NULL);
  
  /* load the default scheme */
  const gchar *scheme = marina_schemes_get_active (marina_schemes_get_default ());
  load_scheme (web_view, scheme);
  
  /* link hover */
  g_signal_connect (web_view->priv->web_view,
                    "hovering-over-link",
                    G_CALLBACK (hovering_over_link),
                    NULL);
  
  /* navigation attempt */
  g_signal_connect (web_view->priv->web_view,
                    "navigation-requested",
                    G_CALLBACK (navigation_requested),
                    web_view);

  /* load finished (can thus load source/item) */
  g_signal_connect_swapped (web_view->priv->web_view,
                            "load-finished",
                            G_CALLBACK (load_finished_cb),
                            web_view);

  /* update scheme when it changes */
  g_signal_connect (marina_schemes_get_default (),
                    "changed",
                    G_CALLBACK (scheme_changed_cb),
                    web_view);
  
  /* adjust when font sizes change */
  marina_message_bus_connect (marina_message_bus_get_default (),
                              "/ui", "set_font",
                              (MarinaMessageCallback) set_font_cb,
                              web_view,
                              NULL);
}
static void
gst_vulkan_instance_init (GstVulkanInstance * instance)
{
  instance->priv = G_TYPE_INSTANCE_GET_PRIVATE ((instance),
      GST_TYPE_VULKAN_INSTANCE, GstVulkanInstancePrivate);
}
Example #24
0
static void
gedit_plugins_engine_init (GeditPluginsEngine *engine)
{
	gchar *typelib_dir;
	GError *error = NULL;

	gedit_debug (DEBUG_PLUGINS);

	engine->priv = G_TYPE_INSTANCE_GET_PRIVATE (engine,
	                                            GEDIT_TYPE_PLUGINS_ENGINE,
	                                            GeditPluginsEnginePrivate);

	peas_engine_enable_loader (PEAS_ENGINE (engine), "python3");

	engine->priv->plugin_settings = g_settings_new ("org.gnome.gedit.plugins");

	/* Require gedit's typelib. */
	typelib_dir = g_build_filename (gedit_dirs_get_gedit_lib_dir (),
	                                "girepository-1.0",
	                                NULL);

	if (!g_irepository_require_private (g_irepository_get_default (),
	                                    typelib_dir, "Gedit", "3.0", 0, &error))
	{
		g_warning ("Could not load Gedit repository: %s", error->message);
		g_error_free (error);
		error = NULL;
	}

	g_free (typelib_dir);

	/* This should be moved to libpeas */
	if (!g_irepository_require (g_irepository_get_default (),
	                            "Peas", "1.0", 0, &error))
	{
		g_warning ("Could not load Peas repository: %s", error->message);
		g_error_free (error);
		error = NULL;
	}

	if (!g_irepository_require (g_irepository_get_default (),
	                            "PeasGtk", "1.0", 0, &error))
	{
		g_warning ("Could not load PeasGtk repository: %s", error->message);
		g_error_free (error);
		error = NULL;
	}

	peas_engine_add_search_path (PEAS_ENGINE (engine),
	                             gedit_dirs_get_user_plugins_dir (),
	                             gedit_dirs_get_user_plugins_dir ());

	peas_engine_add_search_path (PEAS_ENGINE (engine),
	                             gedit_dirs_get_gedit_plugins_dir (),
	                             gedit_dirs_get_gedit_plugins_data_dir ());

	g_settings_bind (engine->priv->plugin_settings,
	                 GEDIT_SETTINGS_ACTIVE_PLUGINS,
	                 engine,
	                 "loaded-plugins",
	                 G_SETTINGS_BIND_DEFAULT);
}
static void
cc_search_panel_init (CcSearchPanel *self)
{
  GError    *error;
  GtkWidget *widget;
  GtkWidget *scrolled_window;
  guint res;

  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CC_TYPE_SEARCH_PANEL, CcSearchPanelPrivate);
  g_resources_register (cc_search_get_resource ());

  self->priv->builder = gtk_builder_new ();

  error = NULL;
  res = gtk_builder_add_from_resource (self->priv->builder,
                                       "/org/gnome/control-center/search/search.ui",
                                       &error);

  if (res == 0)
    {
      g_warning ("Could not load interface file: %s",
                 (error != NULL) ? error->message : "unknown error");
      g_clear_error (&error);
      return;
    }

  scrolled_window = WID ("scrolled_window");
  widget = GTK_WIDGET (gtk_list_box_new ());
  gtk_list_box_set_sort_func (GTK_LIST_BOX (widget),
                              (GtkListBoxSortFunc)list_sort_func, self, NULL);
  gtk_container_add (GTK_CONTAINER (scrolled_window), widget);
  self->priv->list_box = widget;
  gtk_widget_show (widget);

  g_signal_connect_swapped (widget, "row-selected",
                            G_CALLBACK (search_panel_invalidate_button_state), self);

  self->priv->up_button = WID ("up_button");
  g_signal_connect (self->priv->up_button, "clicked",
                    G_CALLBACK (up_button_clicked), self);
  gtk_widget_set_sensitive (self->priv->up_button, FALSE);

  self->priv->down_button = WID ("down_button");
  g_signal_connect (self->priv->down_button, "clicked",
                    G_CALLBACK (down_button_clicked), self);
  gtk_widget_set_sensitive (self->priv->down_button, FALSE);

  widget = WID ("settings_button");
  g_signal_connect (widget, "clicked",
                    G_CALLBACK (settings_button_clicked), self);
  gtk_widget_set_sensitive (widget, cc_search_locations_dialog_is_available ());

  self->priv->search_settings = g_settings_new ("org.gnome.desktop.search-providers");
  self->priv->sort_order = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                  g_free, NULL);
  g_signal_connect_swapped (self->priv->search_settings, "changed::sort-order",
                            G_CALLBACK (search_panel_invalidate_sort_order), self);
  search_panel_invalidate_sort_order (self);

  populate_search_providers (self);

  widget = WID ("search_vbox");
  gtk_container_add (GTK_CONTAINER (self), widget);
}
Example #26
0
static void
clutter_drag_action_init (ClutterDragAction *self)
{
  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CLUTTER_TYPE_DRAG_ACTION,
                                            ClutterDragActionPrivate);
}
static void
seahorse_gkr_keyring_commands_init (SeahorseGkrKeyringCommands *self)
{
	self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_GKR_KEYRING_COMMANDS, SeahorseGkrKeyringCommandsPrivate);
}
Example #28
0
static void facq_display_init(FacqDisplay *dis)
{
	dis->priv = G_TYPE_INSTANCE_GET_PRIVATE(dis,FACQ_TYPE_DISPLAY,FacqDisplayPrivate);
	dis->priv->value = 0.00;
	dis->priv->index = 0;
}
static void
nautilus_progress_info_manager_init (NautilusProgressInfoManager *self)
{
	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NAUTILUS_TYPE_PROGRESS_INFO_MANAGER,
						  NautilusProgressInfoManagerPriv);
}
void pocketvox_controller_on_request(PocketvoxController *controller, gpointer hyp, gpointer user_data)
{
    GList *modules = NULL;
    gchar *request = (gchar *)hyp;
    gint i = 0, j = 0, n_threads;
    gdouble mindist = -1.0f, dist;
    GThreadPool *thread_pool = NULL;
    gboolean first_module = FALSE;

	g_return_if_fail(NULL != controller);
	g_return_if_fail(NULL != hyp);

	controller->priv = G_TYPE_INSTANCE_GET_PRIVATE (controller,
			TYPE_POCKETVOX_CONTROLLER, PocketvoxControllerPrivate);
	PocketvoxControllerPrivate *priv = controller->priv;

	gchar* window = pocketvox_xmanager_get_window(priv->xmanager);

    g_warning("WINDOW: %s", window);

	//put modules apps to activated
	g_hash_table_foreach(priv->modules, pocketvox_module_manage_apps, window);

	//make request
	//g_hash_table_foreach(priv->modules, pocketvox_module_make_request, request);

	modules     = g_hash_table_get_values(priv->modules);

    n_threads   = g_get_num_processors();
    thread_pool = g_thread_pool_new((GFunc)pocketvox_module_threaded_request, request, n_threads, TRUE, NULL );

    for(i = 0; i < g_list_length(modules); i++)
    {
        g_thread_pool_push(thread_pool, (PocketvoxModule *)g_list_nth_data(modules,i), NULL);
    }
    g_thread_pool_free(thread_pool, FALSE, TRUE);

    for(i = 0; i< g_list_length(modules); i++)
	{
		PocketvoxModule *module = g_list_nth_data(modules, i);

		dist = pocketvox_module_get_score(module);

        g_warning("%d %s %d %d %s %.5f",
                  i,
                  pocketvox_module_get_id(module),
                  pocketvox_module_is_apps(module),
                  pocketvox_module_get_activated(module),
                  pocketvox_module_get_command(module),
                  pocketvox_module_get_score(module));

		if(pocketvox_module_get_activated(module) == TRUE && (dist < mindist || first_module==FALSE ))
		{
			mindist = dist;
			j = i;

            first_module = TRUE;
		}
	}

	PocketvoxModule *m = g_list_nth_data(modules, j);

	pocketvox_module_execute(m);

	g_list_free(modules);
}