Example #1
0
static void
client_proxy_signal (GDBusProxy  *proxy,
                     const gchar *sender_name,
                     const gchar *signal_name,
                     GVariant    *parameters,
                     gpointer     user_data)
{
  GtkApplicationImplDBus *dbus = user_data;

  if (g_str_equal (signal_name, "QueryEndSession"))
    {
      g_debug ("Received QueryEndSession");
      send_quit_response (dbus, TRUE, NULL);
    }
  else if (g_str_equal (signal_name, "CancelEndSession"))
    {
      g_debug ("Received CancelEndSession");
    }
  else if (g_str_equal (signal_name, "EndSession"))
    {
      g_debug ("Received EndSession");
      send_quit_response (dbus, TRUE, NULL);
      unregister_client (dbus);
      g_application_quit (G_APPLICATION (dbus->impl.application));
    }
  else if (g_str_equal (signal_name, "Stop"))
    {
      g_debug ("Received Stop");
      unregister_client (dbus);
      g_application_quit (G_APPLICATION (dbus->impl.application));
    }
}
Example #2
0
static void
quit_cb (GSimpleAction *action,
	 GVariant      *parameter,
	 gpointer       app)
{
	g_application_quit (app);
}
Example #3
0
static void
open_cb (GApplication *application,
         GFile **files,
         gint n_files,
         const gchar *hint,
         gpointer user_data)
{
        EvDocumentModel *model;
        GFile           *file;
        char            *path;

        if (n_files != 1) {
                g_application_quit (application);
                return;
        }

        file = files[0];

        model = ev_document_model_new ();
        ev_previewer_load_document (file, model);

        window = ev_previewer_window_new (model);
        g_object_unref (model);

        ev_previewer_window_set_print_settings (EV_PREVIEWER_WINDOW (window), print_settings);
        path = g_file_get_path (file);
        ev_previewer_window_set_source_file (EV_PREVIEWER_WINDOW (window), path);
        g_free (path);

        gtk_window_present (GTK_WINDOW (window));
}
static gboolean
_execute_stop (GstValidateScenario * scenario, GstValidateAction * action)
{
  g_application_quit (g_application_get_default ());

  return TRUE;
}
Example #5
0
static void
quit_activated (GSimpleAction *action,
                GVariant      *parameter,
                gpointer       app)
{
  g_application_quit (G_APPLICATION (app));
}
Example #6
0
void handle_static_action_clicked(Tile* tile, TileEvent* event, gpointer data)
{
	AppShellData* app_data = (AppShellData*) data;
	MateDesktopItem* item = (MateDesktopItem*) g_object_get_data(G_OBJECT(tile), APP_ACTION_KEY);
	GSettings *settings;
	GApplication *app;

	if (event->type == TILE_EVENT_ACTIVATED_DOUBLE_CLICK)
	{
		return;
	}

	open_desktop_item_exec(item);

	settings = g_settings_new (CONTROL_CENTER_SCHEMA);

	if (g_settings_get_boolean(settings, EXIT_SHELL_ON_STATIC_ACTION))
	{
		if (app_data->exit_on_close)
		{
			app=g_application_get_default();
			g_application_quit(app);
		}
		else
		{
			hide_shell(app_data);
		}
	}

	g_object_unref(settings);
}
static void
gcal_application_startup (GApplication *app)
{
  GcalApplicationPrivate *priv;
  GError *error;
  priv = GCAL_APPLICATION (app)->priv;

  G_APPLICATION_CLASS (gcal_application_parent_class)->startup (app);

  if (gtk_clutter_init (NULL, NULL) < 0)
   {
     g_error (_("Unable to initialize GtkClutter"));
     g_application_quit (app);
   }

  if (priv->provider == NULL)
   {
     priv->provider = gtk_css_provider_new ();
     gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
                                                GTK_STYLE_PROVIDER (priv->provider),
                                                G_MAXUINT);

     error = NULL;
     gtk_css_provider_load_from_path (priv->provider, CSS_FILE, &error);
     if (error != NULL)
       g_warning ("Error loading stylesheet from file %s. %s", CSS_FILE, error->message);
   }

  priv->manager = gcal_manager_new ();

  gcal_application_set_app_menu (app);
}
Example #8
0
static void
fr_application_activate_quit (GSimpleAction *action,
			      GVariant      *parameter,
			      gpointer       user_data)
{
	g_application_quit (G_APPLICATION (user_data));
}
Example #9
0
static void _brio_application_quit          (GSimpleAction   *simple,
                                             GVariant        *parameter,
                                             gpointer         user_data)
{
  GApplication *app = G_APPLICATION (user_data);

  g_application_quit (app);
}
/****************************************************************** CALLBACKS */
void
bmd_quit_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
{
	bmd_widgets *a = (bmd_widgets *) data;

	g_print ("Quit was clicked ...\n");
	g_application_quit (G_APPLICATION (a->app));
}
static gboolean
signal_handler_cb (gpointer user_data)
{
  GApplication *app = user_data;

  g_application_quit (app);
  return FALSE;
}
Example #12
0
static void
quit_activated (GSimpleAction *action,
                GVariant      *parameter,
                gpointer       user_data)
{
  GApplication *app = user_data;

  g_application_quit (app);
}
Example #13
0
static void
twitux_app_action_quit (GSimpleAction *action,
                        GVariant      *parameter,
                        gpointer       user_data)
{
  GApplication *application = G_APPLICATION (user_data);

  g_application_quit (application);
}
Example #14
0
static void
quit_callback (GSimpleAction *simple,
               GVariant      *parameter,
               gpointer       user_data)
{
  GApplication *application = user_data;

  g_application_quit (application);
}
static void
action_kill (GSimpleAction *action,
	     GVariant *parameter,
	     gpointer user_data)
{
	GtkApplication *application = user_data;

	/* we have been asked to force quit */
	g_application_quit (G_APPLICATION (application));
}
void
ges_validate_handle_request_state_change (GstMessage * message,
    GApplication * application)
{
  GstState state;

  gst_message_parse_request_state (message, &state);

  if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))
      && state == GST_STATE_NULL) {
    gst_validate_printf (GST_MESSAGE_SRC (message),
        "State change request NULL, " "quiting application\n");
    g_application_quit (application);
  }
}
Example #17
0
static void
ide_application_actions_quit (GSimpleAction *action,
                              GVariant      *param,
                              gpointer       user_data)
{
  IdeApplication *self = user_data;

  IDE_ENTRY;

  g_assert (IDE_IS_APPLICATION (self));

  g_application_quit (G_APPLICATION (self));

  IDE_EXIT;
}
Example #18
0
static void
action_kill (GSimpleAction *action,
	     GVariant *parameter,
	     gpointer user_data)
{
	GtkApplication *application = user_data;
	GList *windows;

	/* this will also destroy the desktop windows */
	windows = gtk_application_get_windows (application);
	g_list_foreach (windows, (GFunc) gtk_widget_destroy, NULL);

	/* we have been asked to force quit */
	g_application_quit (G_APPLICATION (application));
}
Example #19
0
void
nemo_application_quit (NemoApplication *self)
{
	GApplication *app = G_APPLICATION (self);

    g_clear_object (&self->priv->desktop_manager);

	GList *windows;

	windows = gtk_application_get_windows (GTK_APPLICATION (app));
	g_list_foreach (windows, (GFunc) gtk_widget_destroy, NULL);

    /* we have been asked to force quit */
    g_application_quit (G_APPLICATION (self));
}
Example #20
0
/* callback to exit TinyTerm with exit status of child process */
static void
window_close(GtkWindow* window, gint status, gpointer user_data)
{
    GtkApplication *app = (GtkApplication*)user_data;

    int count = 0;
    GList *windows = gtk_application_get_windows(app);

    while (windows != NULL) {
        windows = windows->next;
        count++;
    }

    if (count == 1) {
        g_application_quit(G_APPLICATION(app));
    }
}
Example #21
0
static void
on_open(GApplication *gapp, GFile **files, int n_files, char *hint)
{
	GError *error = NULL;

	if(n_files == 2) {
		char *graphics_file_path = g_file_get_path(files[1]);
		g_object_set(glk, "graphics-file", graphics_file_path, NULL);
		g_free(graphics_file_path);
	}
	if(n_files >= 1) {
		if( !chimara_if_run_game_file(CHIMARA_IF(glk), files[0], &error) ) {
			error_dialog(GTK_WINDOW(window), error, "Error starting Glk library: ");
			g_application_quit(gapp);
		}
	}
	on_activate(gapp);
}
Example #22
0
void
sflphone_quit(gboolean force_quit, SFLPhoneClient *client)
{
    if (force_quit || calllist_get_size(current_calls_tab) == 0 || main_window_ask_quit(client)) {
        dbus_unregister(getpid());
        dbus_clean();
        account_list_free();
        calllist_clean(current_calls_tab);
        calllist_clean(contacts_tab);
        calllist_clean(history_tab);
        free_addressbook();

#if GLIB_CHECK_VERSION(2,32,0)
        g_application_quit(G_APPLICATION(client));
#else
        g_application_release(G_APPLICATION(client));
#endif
    }
}
static void
save_all_quit_cb (GObject      *object,
                  GAsyncResult *result,
                  gpointer      user_data)
{
  IdeBufferManager *bufmgr = (IdeBufferManager *)object;
  g_autoptr(IdeWorkbench) self = user_data;
  g_autoptr(GError) error = NULL;

  g_assert (IDE_IS_BUFFER_MANAGER (bufmgr));
  g_assert (IDE_IS_WORKBENCH (self));

  if (!ide_buffer_manager_save_all_finish (bufmgr, result, &error))
    {
      g_warning ("%s", error->message);
      return;
    }

  g_application_quit (G_APPLICATION (IDE_APPLICATION_DEFAULT));
}
Example #24
0
gboolean quit(gpointer data)
{
	const gchar *cmd[] = {"quit", NULL};
	gmpv_handle *ctx = data;

	if(ctx->mpv_ctx)
	{
		mpv_command(ctx->mpv_ctx, cmd);
		mpv_quit(ctx);

		ctx->mpv_ctx = NULL;
	}

	if(!ctx->gui->fullscreen)
	{
		main_window_save_state(ctx->gui);
	}

	g_application_quit(G_APPLICATION(ctx->app));

	return FALSE;
}
static void
done_cb (GtkButton *button, GisSummaryPage *page)
{
  gchar *file;

  /* the tour is triggered by $XDG_CONFIG_HOME/run-welcome-tour */
  file = g_build_filename (g_get_user_config_dir (), "run-welcome-tour", NULL);
  g_file_set_contents (file, "yes", -1, NULL);
  g_free (file);

  switch (gis_driver_get_mode (GIS_PAGE (page)->driver))
    {
    case GIS_DRIVER_MODE_NEW_USER:
      gis_driver_hide_window (GIS_PAGE (page)->driver);
      log_user_in (page);
      break;
    case GIS_DRIVER_MODE_EXISTING_USER:
      add_setup_done_file ();
      g_application_quit (G_APPLICATION (GIS_PAGE (page)->driver));
    default:
      break;
    }
}
Example #26
0
void
sflphone_quit(gboolean force_quit, SFLPhoneClient *client)
{
    if (force_quit || calllist_get_size(current_calls_tab) == 0 || main_window_ask_quit(client)) {
        dbus_unregister(getpid());
        dbus_clean();
        account_list_free();
        calllist_clean(current_calls_tab);
        calllist_clean(contacts_tab);
        calllist_clean(history_tab);
        free_addressbook();

        // make sure all open dialogs get a response signal so that they can close
        GList* top_level_windows = gtk_window_list_toplevels();
        g_list_foreach(top_level_windows, (GFunc)send_response_to_dialogs, NULL);

#if GLIB_CHECK_VERSION(2,32,0)
        g_application_quit(G_APPLICATION(client));
#else
        g_application_release(G_APPLICATION(client));
#endif
    }
}
Example #27
0
void
pragha_application_quit (PraghaApplication *pragha)
{
	g_application_quit (G_APPLICATION (pragha));
}
Example #28
0
static gint
quit_game (GObject * object, gpointer data)
{
  g_application_quit (G_APPLICATION (application));
  return TRUE;
}
Example #29
0
static void
irc_application_quit (GSimpleAction *action, GVariant *param, gpointer data)
{
	g_application_quit (G_APPLICATION(data));
}
Example #30
0
static void
signal_handler(int signal)
{
    g_application_quit(_application);
}