[recipes] Revert "Make exporting work in flatpak"
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Revert "Make exporting work in flatpak"
- Date: Tue, 17 Jan 2017 19:37:32 +0000 (UTC)
commit f11610ed90eed6fb7fc4ce735cc189557d8eb508
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jan 17 14:28:00 2017 -0500
Revert "Make exporting work in flatpak"
This reverts commit 3d57f99daa8914e5a0d817afd660bd8aa43d6901.
src/gr-recipe-exporter.c | 48 +++++++++------------------------------------
1 files changed, 10 insertions(+), 38 deletions(-)
---
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index 0a54c00..a8c9e3a 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -22,7 +22,6 @@
#include "config.h"
#include <glib/gi18n.h>
-#include <glib/gstdio.h>
#ifdef ENABLE_AUTOAR
#include <gnome-autoar/gnome-autoar.h>
#include "glnx-shutil.h"
@@ -330,7 +329,6 @@ prepare_export (GrRecipeExporter *exporter,
g_assert (exporter->sources == NULL);
exporter->dir = g_mkdtemp (g_build_filename (g_get_tmp_dir (), "recipeXXXXXX", NULL));
-
path = g_build_filename (exporter->dir, "recipes.db", NULL);
keyfile = g_key_file_new ();
@@ -423,53 +421,27 @@ start_export (GrRecipeExporter *exporter)
}
static void
-file_chooser_response (GtkNativeDialog *dialog,
- int response_id,
- GrRecipeExporter *exporter)
-{
- if (response_id == GTK_RESPONSE_ACCEPT) {
- g_message ("exporting %d recipes now", g_list_length (exporter->recipes));
-
- exporter->output = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
-
- start_export (exporter);
- }
- else {
- g_message ("not exporting now");
- }
-
- gtk_native_dialog_destroy (dialog);
-}
-
-static void
export_dialog_response (GtkWidget *dialog,
int response_id,
GrRecipeExporter *exporter)
{
- gtk_widget_destroy (dialog);
- exporter->dialog_heading = NULL;
-
if (response_id == GTK_RESPONSE_CANCEL) {
g_message ("not exporting now");
}
else if (response_id == GTK_RESPONSE_OK) {
- GtkFileChooserNative *chooser;
-
- chooser = gtk_file_chooser_native_new (_("Select the location"),
- GTK_WINDOW (exporter->window),
- GTK_FILE_CHOOSER_ACTION_SAVE,
- _("_Save"),
- _("_Cancel"));
-
- gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (chooser), TRUE);
+ g_autofree char *dir = NULL;
+ g_autofree char *path = NULL;
- gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (chooser), TRUE);
- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (chooser), "recipes.tar.gz");
-
- g_signal_connect (chooser, "response", G_CALLBACK (file_chooser_response), exporter);
+ g_message ("exporting %d recipes now", g_list_length (exporter->recipes));
+ dir = g_dir_make_tmp ("recipesXXXXXX", NULL);
+ path = g_build_filename (dir, "recipes.tar.gz", NULL);
+ exporter->output = g_file_new_for_path (path);
- gtk_native_dialog_show (GTK_NATIVE_DIALOG (chooser));
+ start_export (exporter);
}
+
+ gtk_widget_destroy (dialog);
+ exporter->dialog_heading = NULL;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]