Ejemplo n.º 1
0
static void
mx_expander_dispose (GObject *object)
{
  MxExpanderPrivate *priv = MX_EXPANDER (object)->priv;

  if (priv->label)
    {
      clutter_actor_remove_child (CLUTTER_ACTOR (object), priv->label);
      priv->label = NULL;
    }

  if (priv->arrow)
    {
      clutter_actor_remove_child (CLUTTER_ACTOR (object), priv->arrow);
      priv->arrow = NULL;
    }

  if (priv->timeline)
    {
      g_object_unref (priv->timeline);
      priv->timeline = NULL;
    }

  G_OBJECT_CLASS (mx_expander_parent_class)->dispose (object);
}
Ejemplo n.º 2
0
static void
_confirm_request_cb (BluetoothApplet *applet,
                     const char *path,
                     const char *name,
                     const char *long_name,
                     guint pin,
                     DawatiBtShell *shell)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);
  char *msg = NULL;
  ClutterActor *w;
  char *pin_str;

  w = g_hash_table_lookup (priv->requests, path);
  if (w) {
    clutter_actor_remove_child (priv->request_box, w);
    g_hash_table_remove (priv->requests, path);
  }

  /* according to BT spec, pin is 6 digits */
  pin_str = g_strdup_printf ("%06u", pin);
  dawati_bt_shell_add_request (shell, name, path,
                               DAWATI_BT_REQUEST_TYPE_CONFIRM, pin_str);
  g_free (pin_str);

  /* TRANSLATORS: Notification
   * Placeholder 1: Bluetooth device name
   */
  msg = g_strdup_printf (_("%s would like to confirm connection"), name);
  notify_notification_update (priv->notification,
                              _(pairing_title), msg, icon);
  notify_notification_show (priv->notification, NULL);
  g_free (msg);
}
Ejemplo n.º 3
0
Archivo: mx-bin.c Proyecto: ebassi/mx
/**
 * mx_bin_set_child:
 * @bin: a #MxBin
 * @child: a #ClutterActor, or %NULL
 *
 * Sets @child as the child of @bin.
 *
 * If @bin already has a child, the previous child is removed.
 */
void
mx_bin_set_child (MxBin        *bin,
                  ClutterActor *child)
{
  MxBinPrivate *priv;

  g_return_if_fail (MX_IS_BIN (bin));
  g_return_if_fail (child == NULL || CLUTTER_IS_ACTOR (child));

  priv = bin->priv;

  if (priv->child == child)
    return;

  if (priv->child)
    {
      ClutterActor *old_child = priv->child;

      priv->child = NULL;
      clutter_actor_remove_child (CLUTTER_ACTOR (bin), old_child);
    }

  if (child)
    {
      priv->child = child;
      clutter_actor_add_child (CLUTTER_ACTOR (bin), child);
    }

  clutter_actor_queue_relayout (CLUTTER_ACTOR (bin));

  g_object_notify (G_OBJECT (bin), "child");
}
Ejemplo n.º 4
0
static gboolean
_stop_video_preview (MexContentTile *self)
{
  MexContentTilePrivate *priv = MEX_CONTENT_TILE (self)->priv;

  if (priv->start_video_preview > 0)
    g_source_remove (priv->start_video_preview);

  /* video never started */
  if (priv->child == priv->image)
    return FALSE;

  if (!priv->video_preview)
    return FALSE;

  clutter_media_set_playing (CLUTTER_MEDIA (priv->video_preview), FALSE);
  clutter_actor_remove_child (CLUTTER_ACTOR (self), priv->video_preview);
  clutter_actor_add_child (CLUTTER_ACTOR (self), priv->image);
  /* After setting the child the old child is killed off so NULL this to
   *  help with checks
   */
  priv->video_preview = NULL;


  return FALSE;
}
Ejemplo n.º 5
0
static void meta_switcher_dispose(GObject *object)
{
    MetaSwitcher *switcher = META_SWITCHER(object);
    MetaSwitcherPrivate* priv = switcher->priv;

    if (priv->disposed) return;
    priv->disposed = TRUE;

    MetaScreen* screen = meta_plugin_get_screen(priv->plugin);
    ClutterActor* stage = meta_get_stage_for_screen(screen);
    clutter_actor_remove_child(stage, priv->top);

    if (priv->modaled) {
        meta_plugin_end_modal(priv->plugin, clutter_get_current_event_time());
        meta_enable_unredirect_for_screen(screen);

        if (priv->selected_id < 0 && priv->previous_focused)
            clutter_stage_set_key_focus(CLUTTER_STAGE(stage), priv->previous_focused);
    }

    if (CLUTTER_IS_ACTOR(priv->top)) {
        g_clear_pointer(&priv->top, clutter_actor_destroy);
    } else priv->top = NULL;

    if (priv->autoclose_id) {
        g_source_remove(priv->autoclose_id);
        priv->autoclose_id = 0;
    }

    GList* ws_list = meta_screen_get_workspaces(screen);
    g_list_foreach(ws_list, (GFunc)unhook_ws_event, switcher);

    G_OBJECT_CLASS(meta_switcher_parent_class)->dispose(object);
}
Ejemplo n.º 6
0
static void
st_scroll_view_remove (ClutterContainer *container,
                       ClutterActor     *actor)
{
  StScrollView *self = ST_SCROLL_VIEW (container);
  StScrollViewPrivate *priv = self->priv;

  if (actor == priv->child)
    {
      g_object_ref (priv->child);

      /* chain up to StBin::remove() */
      st_scroll_view_parent_iface->remove (container, actor);

      st_scrollable_set_adjustments (ST_SCROLLABLE (priv->child),
                                     NULL, NULL);

      g_object_unref (priv->child);
      priv->child = NULL;
    }
  else
    {
      if (actor == priv->vscroll)
        priv->vscroll = NULL;
      else if (actor == priv->hscroll)
        priv->hscroll = NULL;
      else
        g_assert ("Unknown child removed from StScrollView");

      clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);
    }
}
static void
mnb_fancy_bin_dispose (GObject *object)
{
  MnbFancyBinPrivate *priv = MNB_FANCY_BIN (object)->priv;

  if (priv->clone)
    {
      clutter_actor_destroy (priv->clone);
      priv->clone = NULL;
    }

  if (priv->child)
    {
      clutter_actor_destroy (priv->child);
      priv->child = NULL;
    }

  if (priv->real_child)
    {
	  clutter_actor_remove_child (clutter_actor_get_parent(priv->real_child), priv->real_child);
      priv->real_child = NULL;
    }

  G_OBJECT_CLASS (mnb_fancy_bin_parent_class)->dispose (object);
}
Ejemplo n.º 8
0
static void
_auth_request_cb (BluetoothApplet *applet,
                  const char *path,
                  const char *name,
                  const char *long_name,
                  const char *uuid,
                  DawatiBtShell *shell)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);
  char *msg = NULL;
  ClutterActor *w;

  w = g_hash_table_lookup (priv->requests, path);
  if (w) {
    clutter_actor_remove_child (priv->request_box, w);
    g_hash_table_remove (priv->requests, path);
  }

  dawati_bt_shell_add_request (shell, name, path,
                               DAWATI_BT_REQUEST_TYPE_AUTH, uuid);

  /* TRANSLATORS: Notification
   * Placeholder 1: Bluetooth device name
   */
  msg = g_strdup_printf (_("%s would like to access a service"), name);
  notify_notification_update (priv->notification,
                              _("New Bluetooth access request"), msg, icon);
  notify_notification_show (priv->notification, NULL);
  g_free (msg);
}
Ejemplo n.º 9
0
/* Window stacking has changed */
static void _xfdashboard_live_workspace_on_window_stacking_changed(XfdashboardLiveWorkspace *self,
																	gpointer inUserData)
{
	XfdashboardLiveWorkspacePrivate		*priv=XFDASHBOARD_LIVE_WORKSPACE(self)->priv;
	GList								*windows;
	XfdashboardWindowTrackerWindow		*window;
	ClutterActor						*actor;

	g_return_if_fail(XFDASHBOARD_IS_LIVE_WORKSPACE(self));

	priv=self->priv;

	/* Get stacked order of windows */
	windows=xfdashboard_window_tracker_get_windows_stacked(priv->windowTracker);

	/* Iterate through list of stacked window from beginning to end
	 * and reinsert each window found to bottom of this actor
	 */
	for( ; windows; windows=g_list_next(windows))
	{
		/* Get window and find corresponding actor */
		window=XFDASHBOARD_WINDOW_TRACKER_WINDOW(windows->data);
		if(!window) continue;

		actor=_xfdashboard_live_workspace_find_by_window(self, window);
		if(!actor) continue;

		/* If we get here the window actor was found so move to bottom */
		g_object_ref(actor);
		clutter_actor_remove_child(CLUTTER_ACTOR(self), actor);
		clutter_actor_insert_child_above(CLUTTER_ACTOR(self), actor, NULL);
		g_object_unref(actor);
	}
}
Ejemplo n.º 10
0
static void
mex_search_proxy_remove_cb (MexProxy     *proxy,
                            MexContent   *content,
                            ClutterActor *label,
                            ClutterActor *layout)
{
  clutter_actor_remove_child (layout, label);
}
Ejemplo n.º 11
0
static void
add_drag_object (ClutterActor *target)
{
  ClutterActor *parent;

  if (drag == NULL)
    {
      ClutterAction *action;

      drag = clutter_actor_new ();
      clutter_actor_set_background_color (drag, CLUTTER_COLOR_LightSkyBlue);
      clutter_actor_set_size (drag, HANDLE_SIZE, HANDLE_SIZE);
      clutter_actor_set_position (drag,
                                  (TARGET_SIZE - HANDLE_SIZE) / 2.0,
                                  (TARGET_SIZE - HANDLE_SIZE) / 2.0);
      clutter_actor_set_reactive (drag, TRUE);

      action = clutter_drag_action_new ();
      g_signal_connect (action, "drag-begin", G_CALLBACK (on_drag_begin), NULL);
      g_signal_connect (action, "drag-end", G_CALLBACK (on_drag_end), NULL);

      clutter_actor_add_action (drag, action);
    }

  parent = clutter_actor_get_parent (drag);
  if (parent == target)
    {
      clutter_actor_save_easing_state (target);
      clutter_actor_set_easing_mode (target, CLUTTER_LINEAR);
      clutter_actor_set_opacity (target, 255);
      clutter_actor_restore_easing_state (target);
      return;
    }

  g_object_ref (drag);
  if (parent != NULL && parent != stage)
    {
      clutter_actor_remove_child (parent, drag);

      clutter_actor_save_easing_state (parent);
      clutter_actor_set_easing_mode (parent, CLUTTER_LINEAR);
      clutter_actor_set_opacity (parent, 64);
      clutter_actor_restore_easing_state (parent);
    }

  clutter_actor_add_child (target, drag);

  clutter_actor_save_easing_state (target);
  clutter_actor_set_easing_mode (target, CLUTTER_LINEAR);
  clutter_actor_set_opacity (target, 255);
  clutter_actor_restore_easing_state (target);

  g_object_unref (drag);
}
Ejemplo n.º 12
0
static void
ntf_tray_hide_ntf_completed_cb (ClutterAnimation *anim, NtfTray *tray)
{
  NtfTrayPrivate *priv = tray->priv;
  ClutterActor   *actor = CLUTTER_ACTOR (clutter_animation_get_object (anim));

  clutter_actor_remove_child (CLUTTER_ACTOR (tray), actor);

  /* Hide ourselves if nothing left to show */
  if (priv->n_notifiers == 0)
    clutter_actor_hide (CLUTTER_ACTOR (tray));
}
Ejemplo n.º 13
0
static void
mx_toolbar_dispose (GObject *object)
{
  MxToolbarPrivate *priv = MX_TOOLBAR (object)->priv;

  if (priv->close_button)
    {
      clutter_actor_remove_child (CLUTTER_ACTOR (object), priv->close_button);
      priv->close_button = NULL;
    }

  G_OBJECT_CLASS (mx_toolbar_parent_class)->dispose (object);
}
Ejemplo n.º 14
0
/**
 * mx_combo_box_set_index:
 * @box: A #MxComboBox
 * @index: the index of the list item to set
 *
 * Set the current combo box text from the item at @index in the list.
 *
 */
void
mx_combo_box_set_index (MxComboBox *box,
                        gint        index)
{
  MxComboBoxPrivate *priv;
  GSList *item;
  MxAction *action;
  const gchar *icon_name;

  g_return_if_fail (MX_IS_COMBO_BOX (box));

  priv = box->priv;

  item = g_slist_nth (box->priv->actions, index);

  if (!item)
    {
      box->priv->index = -1;
      clutter_text_set_text ((ClutterText*) box->priv->label, NULL);
      return;
    }

  box->priv->index = index;
  action = (MxAction *)item->data;
  clutter_text_set_text ((ClutterText*) box->priv->label,
                         mx_action_get_display_name (action));

  if (priv->icon)
    {
      clutter_actor_remove_child (CLUTTER_ACTOR (box), priv->icon);
      priv->icon = NULL;
    }

  icon_name = mx_action_get_icon (item->data);
  if (icon_name)
    {
      MxIconTheme *icon_theme;

      icon_theme = mx_icon_theme_get_default ();
      if (mx_icon_theme_has_icon (icon_theme, icon_name))
        {
          priv->icon = mx_icon_new ();
          mx_icon_set_icon_name (MX_ICON (priv->icon), icon_name);
          clutter_actor_add_child (CLUTTER_ACTOR (box), priv->icon);
        }
    }

  g_object_notify (G_OBJECT (box), "index");
  g_object_notify (G_OBJECT (box), "active-text");
  g_object_notify (G_OBJECT (box), "active-icon-name");
}
Ejemplo n.º 15
0
static void
mx_toolbar_actor_added (ClutterActor *container,
                        ClutterActor *actor)
{
  MxToolbarPrivate *priv = MX_TOOLBAR (container)->priv;

  if (MX_IS_TOOLTIP (actor))
    return;

  if (priv->child)
    clutter_actor_remove_child (container, priv->child);

  priv->child = actor;
}
Ejemplo n.º 16
0
static void
mx_frame_actor_added (ClutterActor *container,
                      ClutterActor *actor)
{
    MxFramePrivate *priv = MX_FRAME (container)->priv;

    if (MX_IS_TOOLTIP (actor))
        return;

    if (priv->child)
        clutter_actor_remove_child (container, priv->child);

    priv->child = actor;
}
Ejemplo n.º 17
0
static void
mex_content_tile_actor_added (ClutterActor *container,
                              ClutterActor *actor)
{
  MexContentTilePrivate *priv = MEX_CONTENT_TILE (container)->priv;

  if (MX_IS_TOOLTIP (actor))
    return;

  if (priv->child)
    clutter_actor_remove_child (container, priv->child);

  priv->child = actor;
}
Ejemplo n.º 18
0
static void
mex_clock_bin_actor_added (ClutterActor *container,
                           ClutterActor *actor)
{
  MexClockBinPrivate *priv = MEX_CLOCK_BIN (container)->priv;

  if (MX_IS_TOOLTIP (actor))
    return;

  if (priv->child)
    clutter_actor_remove_child (container, priv->child);

  priv->child = actor;
}
Ejemplo n.º 19
0
static void
mx_menu_free_action_at (MxMenu   *menu,
                        gint      index,
                        gboolean  remove_action)
{
    MxMenuPrivate *priv = menu->priv;
    MxMenuChild *child = &g_array_index (priv->children, MxMenuChild,
                                         index);

    clutter_actor_remove_child (CLUTTER_ACTOR (menu), CLUTTER_ACTOR (child->box));
    g_object_unref (child->action);

    if (remove_action)
        g_array_remove_index (priv->children, index);
}
Ejemplo n.º 20
0
static void
_cancel_request_cb (DawatiBtShell *shell)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);
  ClutterActorIter iter;
  ClutterActor *child;

  clutter_actor_iter_init (&iter, priv->request_box);
  while (clutter_actor_iter_next (&iter, &child))
    clutter_actor_remove_child (priv->request_box, child);

  g_hash_table_remove_all (priv->requests);

  notify_notification_close (priv->notification, NULL);
}
Ejemplo n.º 21
0
static void
_request_response_cb (DawatiBtRequest *request,
                      DawatiBtResponse response,
                      const char *response_data,
                      DawatiBtShell *shell)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);
  DawatiBtRequestType type;
  const char *path;
  int passkey;

  g_object_get (request,
                "request-type", &type,
                "device-path", &path,
                NULL);
  switch (type) {
  case DAWATI_BT_REQUEST_TYPE_AUTH:
    bluetooth_applet_agent_reply_auth (priv->applet, path,
                                       response != DAWATI_BT_REQUEST_RESPONSE_NO,
                                       response == DAWATI_BT_REQUEST_RESPONSE_ALWAYS);
    break;
  case DAWATI_BT_REQUEST_TYPE_CONFIRM:
    bluetooth_applet_agent_reply_confirm (priv->applet, path,
                                          response != DAWATI_BT_REQUEST_RESPONSE_NO);
    break;
  case DAWATI_BT_REQUEST_TYPE_PASSKEY:
    /* if atoi() fails, it fails, not much we can do.. */
    if (!response_data || response == DAWATI_BT_REQUEST_RESPONSE_NO)
      passkey = -1;
    else
      passkey = atoi (response_data);
    bluetooth_applet_agent_reply_passkey (priv->applet, path, passkey);
    break;
  case DAWATI_BT_REQUEST_TYPE_PIN:
    if (response == DAWATI_BT_REQUEST_RESPONSE_NO)
      bluetooth_applet_agent_reply_pincode (priv->applet, path, NULL);
    else
      bluetooth_applet_agent_reply_pincode (priv->applet, path, response_data);
    break;
  default:
    g_warn_if_reached ();
  }

  clutter_actor_remove_child (priv->request_box, CLUTTER_ACTOR (request));
  g_hash_table_remove (priv->requests, path);
}
Ejemplo n.º 22
0
static void
mx_expander_actor_added (ClutterActor *container,
                         ClutterActor *child)
{
  MxExpanderPrivate *priv = MX_EXPANDER (container)->priv;

  if (MX_IS_TOOLTIP (child))
    return;

  if (priv->child)
    clutter_actor_remove_child (container, priv->child);

  priv->child = child;

  if (!priv->expanded)
    clutter_actor_hide (child);
}
Ejemplo n.º 23
0
static void on_window_removed(MetaWorkspace *ws, MetaWindow *win, MetaSwitcher* self)
{
    g_debug("%s", __func__);
    MetaSwitcherPrivate* priv = self->priv;

    ClutterActor* win_actor = NULL;
    gboolean need_reselect = FALSE;
    int id = 0;
    for (id = 0; id < priv->apps->len; id++) {
        if (g_ptr_array_index(priv->apps, id) == win) {
            win_actor = g_hash_table_lookup(priv->icons, win);
            need_reselect = (id == priv->selected_id);
        }
    }

    if (win_actor) {
        if (need_reselect)
            _set_highlight(self, priv->selected_id, FALSE);

        g_hash_table_remove(priv->icons, win);
        g_ptr_array_remove(priv->apps, win);

        if (need_reselect) {
            if (id == 0) {
                clutter_actor_set_margin_left(
                        g_hash_table_lookup(priv->icons, g_ptr_array_index(priv->apps, 0)), 10);
            } else if (id >= priv->apps->len) {
                clutter_actor_set_margin_right(
                        g_hash_table_lookup(priv->icons, g_ptr_array_index(priv->apps, priv->apps->len-1)), 10);
            }
            priv->selected_id = (priv->selected_id + 1) % priv->apps->len;
            _set_highlight(self, priv->selected_id, TRUE);
        }

        clutter_actor_save_easing_state(priv->top);
        clutter_actor_set_easing_duration(priv->top, 200);
        clutter_actor_set_easing_mode(priv->top, CLUTTER_LINEAR);

        clutter_actor_remove_child(priv->top, win_actor);

        clutter_actor_restore_easing_state(priv->top);

        reposition_switcher(self);
    }
}
Ejemplo n.º 24
0
static void
row_removed_cb (ClutterModel     *model,
                ClutterModelIter *iter,
                MxListView       *list_view)
{
  GList *children;
  GList *l;
  ClutterActor *child;

  if (list_view->priv->is_frozen)
    return;

  children = clutter_actor_get_children (CLUTTER_ACTOR (list_view));
  l = g_list_nth (children, clutter_model_iter_get_row (iter));
  child = (ClutterActor *) l->data;
  clutter_actor_remove_child (CLUTTER_ACTOR (list_view), child);
  g_list_free (children);
}
Ejemplo n.º 25
0
static void
_remove_non_connected_device (ClutterActor *actor, DawatiBtShell *shell)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);
  gboolean connected;
  char *path;

  g_object_get (actor,
                "connected", &connected,
                "device-path", &path,
                NULL);
  if (connected) {
    /* clear value for next round */
    g_object_set (actor, "connected", FALSE, NULL);
  } else {
    g_hash_table_remove (priv->devices, path);
    clutter_actor_remove_child (priv->device_box, actor);
  }
}
Ejemplo n.º 26
0
Archivo: mx-button.c Proyecto: danni/mx
static void
mx_button_dispose (GObject *gobject)
{
  MxButtonPrivate *priv = MX_BUTTON (gobject)->priv;

  if (priv->action)
    {
      g_object_unref (priv->action);
      priv->action = NULL;
    }

  if (priv->content_image)
    {
      clutter_actor_remove_child (CLUTTER_ACTOR (gobject), priv->content_image);
      priv->content_image = NULL;
    }

  G_OBJECT_CLASS (mx_button_parent_class)->dispose (gobject);
}
Ejemplo n.º 27
0
static gboolean
add_or_remove_timeout (gpointer user_data)
{
  if (nwidgets == MAX_NWIDGETS)
    {
      /* Removing an item */
      clutter_actor_remove_child (group, widgets[MAX_NWIDGETS - 1]);
      widgets[MAX_NWIDGETS - 1] = NULL;

      nwidgets--;
    }
  else
    {
      /* Adding an item */
      widgets[MAX_NWIDGETS - 1] = create_gtk_actor (MAX_NWIDGETS - 1);
      nwidgets++;

      add_clutter_actor (widgets[MAX_NWIDGETS - 1], group, MAX_NWIDGETS - 1);
    }

  return G_SOURCE_CONTINUE;
}
Ejemplo n.º 28
0
void
mnb_fancy_bin_set_child (MnbFancyBin *bin, ClutterActor *child)
{
  MnbFancyBinPrivate *priv = bin->priv;

  if (priv->real_child)
    {
      clutter_clone_set_source (CLUTTER_CLONE (priv->child), NULL);
      clutter_clone_set_source (CLUTTER_CLONE (priv->clone), NULL);
      clutter_actor_remove_child (clutter_actor_get_parent(priv->real_child), priv->real_child);
    }

  priv->real_child = child;

  if (priv->real_child)
    {
	  clutter_actor_add_child(CLUTTER_ACTOR (bin), priv->real_child);
      clutter_clone_set_source (CLUTTER_CLONE (priv->child), priv->real_child);
      clutter_clone_set_source (CLUTTER_CLONE (priv->clone), priv->real_child);
    }

  clutter_actor_queue_relayout (CLUTTER_ACTOR (bin));
}
Ejemplo n.º 29
0
static void
mx_notebook_remove (ClutterContainer *container,
                    ClutterActor     *actor)
{
  MxNotebookPrivate *priv = MX_NOTEBOOK (container)->priv;

  GList *item = NULL;

  item = g_list_find (priv->children, actor);

  if (item == NULL)
    {
      g_warning ("Actor of type '%s' is not a child of container of type '%s'",
                 g_type_name (G_OBJECT_TYPE (actor)),
                 g_type_name (G_OBJECT_TYPE (container)));
      return;
    }

  /* If it was the current page, select either the previous or
   * the next, whichever exists first.
   */
  if (actor == priv->current_page)
    {
      priv->current_page = item->prev ? item->prev->data :
        (item->next ? item->next->data : NULL);
      g_object_notify (G_OBJECT (container), "current-page");
    }

  g_object_ref (actor);

  priv->children = g_list_delete_link (priv->children, item);
  clutter_actor_remove_child (CLUTTER_ACTOR (container), actor);

  g_object_unref (actor);

  mx_notebook_update_children (MX_NOTEBOOK (container));
}
Ejemplo n.º 30
0
static void
_pincode_request_cb (BluetoothApplet *applet,
                     const char *path,
                     const char *name,
                     const char *long_name,
                     gboolean numeric,
                     DawatiBtShell *shell)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);
  DawatiBtRequestType type;
  char *msg = NULL;
  ClutterActor *w;

  /* as strange as it seems, passkey is numeric, while pin is string.
   * See bluetooth_applet_agent_reply_*() */
  if (numeric)
    type = DAWATI_BT_REQUEST_TYPE_PASSKEY;
  else
    type = DAWATI_BT_REQUEST_TYPE_PIN;

  w = g_hash_table_lookup (priv->requests, path);
  if (w) {
    clutter_actor_remove_child (priv->request_box, w);
    g_hash_table_remove (priv->requests, path);
  }
  dawati_bt_shell_add_request (shell, name, path, type, NULL);

  /* TRANSLATORS: Notification
   * Placeholder: Bluetooth device name
   */
  msg = g_strdup_printf (_("%s would like to connect"), name);
  notify_notification_update (priv->notification,
                              _(pairing_title), msg, icon);
  notify_notification_show (priv->notification, NULL);
  g_free (msg);
}