Ejemplo n.º 1
0
static void
_shell_request_hide_cb (MpdShell        *shell,
                        MplPanelClient  *panel)
{
  if (panel)
    mpl_panel_client_hide (panel);
}
Ejemplo n.º 2
0
static void
_settings_launcher_button_clicked_cb (MxButton *button,
                                      gpointer  userdata)
{
  MnbPeoplePanelPrivate *priv = GET_PRIVATE (userdata);
  GDesktopAppInfo *app_info;
  GError *error = NULL;
  const gchar *args[2] = { NULL, };

  app_info = g_desktop_app_info_new ("empathy-accounts.desktop");
  args[0] = g_app_info_get_commandline (G_APP_INFO (app_info));
  args[1] = NULL;

  if (!g_spawn_async (NULL,
                      (gchar **)args,
                      NULL,
                      G_SPAWN_SEARCH_PATH,
                      NULL,
                      NULL,
                      NULL,
                      &error))
  {
    g_warning (G_STRLOC ": Error starting empathy-accounts: %s",
               error->message);
    g_clear_error (&error);
  } else {
    if (priv->panel_client)
      mpl_panel_client_hide (priv->panel_client);
  }

  g_object_unref (app_info);
}
static void
_edit_contact_action (MnbPeoplePanel *panel,
                      AnerleyItem    *item)
{
  MnbPeoplePanelPrivate *priv = GET_PRIVATE (panel);
  gchar *command_line;
  const gchar *uid;

  if (priv->panel_client)
  {
    uid = anerley_econtact_item_get_uid ((AnerleyEContactItem *)item);
    command_line = g_strdup_printf ("contacts --uid %s",
                                  uid);
    if (!mpl_panel_client_launch_application (priv->panel_client,
                                              command_line))
    {
      g_warning (G_STRLOC ": Error launching contacts for uid: %s",
                 uid);
      g_free (command_line);
    } else {
      g_free (command_line);

      if (priv->panel_client)
        mpl_panel_client_hide (priv->panel_client);
    }
  }
}
Ejemplo n.º 4
0
void
dawati_status_panel_hide (void)
{
    if (panel->panel_client)
        mpl_panel_client_hide ((MplPanelClient *)panel->panel_client);
    else
        g_debug (G_STRLOC ": Would hide the panel");
}
Ejemplo n.º 5
0
static void
launch_date_config (ClutterActor *actor, MnpWorldClock *clock)
{
    MnpWorldClockPrivate *priv = GET_PRIVATE (clock);

    if (priv->panel_client) {
        mpl_panel_client_hide(priv->panel_client);
        mpl_panel_client_launch_application (priv->panel_client, "/usr/bin/gnome-control-center datetime");
    }
}
Ejemplo n.º 6
0
static void
dawati_bt_shell_launch (DawatiBtShell *shell, const char *cmd)
{
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);

  if (priv->panel_client) {
    if (mpl_panel_client_launch_application (priv->panel_client, cmd))
      mpl_panel_client_hide (priv->panel_client);
  } else {
    g_spawn_command_line_async (cmd, NULL);
  }
}
Ejemplo n.º 7
0
static void
_tile_view_item_activated_cb (AnerleyTileView *view,
                              AnerleyItem     *item,
                              gpointer         userdata)
{
  MnbPeoplePanelPrivate *priv = GET_PRIVATE (userdata);

  anerley_item_activate (item);

  if (priv->panel_client)
    mpl_panel_client_hide (priv->panel_client);
}
Ejemplo n.º 8
0
static void
new_index_changed_cb (MxComboBox     *combo,
                      GParamSpec     *pspec,
                      MnbPeoplePanel *self)
{
  MnbPeoplePanelPrivate *priv = GET_PRIVATE (self);
  gint index = mx_combo_box_get_index (combo);
  GDesktopAppInfo *app_info;
  GError *error = NULL;
  const gchar *args[4] = { NULL, };
  const gchar *option;

  if (index == 0)
    option = "--new-contact";
  else if (index == 1)
    option = "--join-chatroom";
  else
    return;

  app_info = g_desktop_app_info_new ("empathy.desktop");
  args[0] = g_app_info_get_commandline (G_APP_INFO (app_info));
  args[1] = "--start-hidden";
  args[2] = option;
  args[3] = NULL;

  if (!g_spawn_async (NULL,
                      (gchar **)args,
                      NULL,
                      G_SPAWN_SEARCH_PATH,
                      NULL,
                      NULL,
                      NULL,
                      &error))
  {
    g_warning (G_STRLOC ": Error starting empathy: %s", error->message);
    g_clear_error (&error);
  } else
  {
    if (priv->panel_client)
      mpl_panel_client_hide (priv->panel_client);
  }

  g_object_unref (app_info);
}
static void
_tile_view_item_activated_cb (AnerleyTileView *view,
                              AnerleyItem     *item,
                              gpointer         userdata)
{
  MnbPeoplePanel *panel = MNB_PEOPLE_PANEL (userdata);
  MnbPeoplePanelPrivate *priv = GET_PRIVATE (userdata);

  if (ANERLEY_IS_ECONTACT_ITEM (item) &&
      anerley_econtact_item_get_email (ANERLEY_ECONTACT_ITEM (item)) == NULL)
  {
    _edit_contact_action (panel, item);
  } else {
    anerley_item_activate (item);
  }

  if (priv->panel_client)
    mpl_panel_client_hide (priv->panel_client);
}
static void
_messenger_launcher_button_clicked_cb (MxButton *button,
                                       gpointer  userdata)
{
  MnbPeoplePanelPrivate *priv = GET_PRIVATE (userdata);
  GAppInfo *app_info;
  GError *error = NULL;

  app_info = (GAppInfo *)g_desktop_app_info_new ("empathy.desktop");

  if (!g_app_info_launch (app_info,
                          NULL,
                          NULL,
                          &error))
  {
    g_warning (G_STRLOC ": Error starting empathy: %s", error->message);
    g_clear_error (&error);
  } else {
    if (priv->panel_client)
      mpl_panel_client_hide (priv->panel_client);
  }

  g_object_unref (app_info);
}