[Xfce4-commits] <thunar-vcs-plugin:master> * tvp-git-helper/main.c tvp-git-helper/tgh-clone.[ch] tvp-git-helper/tgh-transfer-dialog.[ch]: Added clone action. * tvp-git-helper/tgh-{add, branch, reset, status}.[ch]: Cleaned the code a bit.

Peter de Ridder noreply at xfce.org
Sun Oct 11 23:42:01 CEST 2009


Updating branch refs/heads/master
         to 134427c074ba04a2e94390e7f6be105921d978d0 (commit)
       from bf9e5ebcc8e25bcad1e4032b6e711bb9c79bf71f (commit)

commit 134427c074ba04a2e94390e7f6be105921d978d0
Author: Peter de Ridder <peter at xfce.org>
Date:   Sun Oct 11 23:17:25 2009 +0200

    * tvp-git-helper/main.c tvp-git-helper/tgh-clone.[ch]
      tvp-git-helper/tgh-transfer-dialog.[ch]: Added clone action.
    * tvp-git-helper/tgh-{add,branch,reset,status}.[ch]: Cleaned the code a
      bit.

 tvp-git-helper/Makefile.am                  |    6 +-
 tvp-git-helper/main.c                       |   17 ++
 tvp-git-helper/tgh-add.c                    |    2 +
 tvp-git-helper/tgh-branch.c                 |   10 +-
 tvp-git-helper/{tgh-add.c => tgh-clone.c}   |   41 ++---
 tvp-git-helper/{tgh-reset.h => tgh-clone.h} |    8 +-
 tvp-git-helper/tgh-reset.c                  |    2 +
 tvp-git-helper/tgh-status.c                 |   10 +-
 tvp-git-helper/tgh-transfer-dialog.c        |  228 +++++++++++++++++++++++++++
 tvp-git-helper/tgh-transfer-dialog.h        |   50 ++++++
 10 files changed, 329 insertions(+), 45 deletions(-)

diff --git a/tvp-git-helper/Makefile.am b/tvp-git-helper/Makefile.am
index ee231f3..8b3a59c 100644
--- a/tvp-git-helper/Makefile.am
+++ b/tvp-git-helper/Makefile.am
@@ -18,6 +18,8 @@ tvp_git_helper_SOURCES =						\
 	tgh-add.c							\
 	tgh-branch.h							\
 	tgh-branch.c							\
+	tgh-clone.h							\
+	tgh-clone.c							\
 	tgh-common.h							\
 	tgh-common.c							\
 	tgh-reset.h							\
@@ -33,7 +35,9 @@ tvp_git_helper_SOURCES =						\
 	tgh-reset-dialog.h						\
 	tgh-reset-dialog.c						\
 	tgh-status-dialog.h						\
-	tgh-status-dialog.c
+	tgh-status-dialog.c						\
+	tgh-transfer-dialog.h						\
+	tgh-transfer-dialog.c
 
 tvp_git_helper_CPPFLAGS =						\
 	-DG_LOG_DOMAIN=\"tvp-git-helper\"				\
diff --git a/tvp-git-helper/main.c b/tvp-git-helper/main.c
index a5d083a..d770ae0 100644
--- a/tvp-git-helper/main.c
+++ b/tvp-git-helper/main.c
@@ -32,6 +32,7 @@
 
 #include "tgh-add.h"
 #include "tgh-branch.h"
+#include "tgh-clone.h"
 #include "tgh-reset.h"
 #include "tgh-status.h"
 
@@ -53,6 +54,7 @@ int main (int argc, char *argv[])
   gboolean print_version = FALSE;
   gboolean add = FALSE;
   gboolean branch = FALSE;
+  gboolean clone = FALSE;
   gboolean reset = FALSE;
   gboolean status = FALSE;
   gchar **files = NULL;
@@ -80,6 +82,12 @@ int main (int argc, char *argv[])
     { NULL, '\0', 0, 0, NULL, NULL, NULL }
   };
 
+  GOptionEntry clone_options_table[] =
+  {
+    { "clone", '\0', 0, G_OPTION_ARG_NONE, &clone, N_("Execute clone action"), NULL },
+    { NULL, '\0', 0, 0, NULL, NULL, NULL }
+  };
+
   GOptionEntry reset_options_table[] =
   {
     { "reset", '\0', 0, G_OPTION_ARG_NONE, &reset, N_("Execute reset action"), NULL },
@@ -108,6 +116,10 @@ int main (int argc, char *argv[])
   g_option_group_add_entries(option_group, branch_options_table);
   g_option_context_add_group(option_context, option_group);
 
+  option_group = g_option_group_new("clone", N_("Clone Related Options:"), N_("Clone"), NULL, NULL);
+  g_option_group_add_entries(option_group, clone_options_table);
+  g_option_context_add_group(option_context, option_group);
+
   option_group = g_option_group_new("reset", N_("Reset Related Options:"), N_("Reset"), NULL, NULL);
   g_option_group_add_entries(option_group, reset_options_table);
   g_option_context_add_group(option_context, option_group);
@@ -138,6 +150,11 @@ int main (int argc, char *argv[])
     has_child = tgh_branch(files, &pid);
   }
 
+  if(clone)
+  {
+    has_child = tgh_clone(files, &pid);
+  }
+
   if(reset)
   {
     has_child = tgh_reset(files, &pid);
diff --git a/tvp-git-helper/tgh-add.c b/tvp-git-helper/tgh-add.c
index a106bca..dda5190 100644
--- a/tvp-git-helper/tgh-add.c
+++ b/tvp-git-helper/tgh-add.c
@@ -90,8 +90,10 @@ static gboolean add_spawn (GtkWidget *dialog, gchar **files, GPid *pid)
 
   if(!g_spawn_async_with_pipes(NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, pid, NULL, NULL, &fd_err, &error))
   {
+    g_free (argv);
     return FALSE;
   }
+  g_free (argv);
 
   parser = tgh_error_parser_new(GTK_WIDGET(dialog));
 
diff --git a/tvp-git-helper/tgh-branch.c b/tvp-git-helper/tgh-branch.c
index 260a204..9e3c652 100644
--- a/tvp-git-helper/tgh-branch.c
+++ b/tvp-git-helper/tgh-branch.c
@@ -35,13 +35,6 @@
 
 static gchar *argv[] = {"git", "branch", NULL};
 
-struct proc_args
-{
-    GtkWidget *dialog;
-    gchar *error;
-    gchar **files;
-};
-
 static gboolean branch_spawn (TghBranchDialog *dialog, GPid *pid)
 {
   GError *error = NULL;
@@ -88,7 +81,8 @@ gboolean tgh_branch (gchar **files, GPid *pid)
   g_signal_connect(dialog, "refresh-clicked", G_CALLBACK(create_branch_child), NULL);
 
   if (files)
-      chdir(files[0]);
+    if (chdir(files[0]))
+      return FALSE;
 
   return branch_spawn(TGH_BRANCH_DIALOG(dialog), pid);
 }
diff --git a/tvp-git-helper/tgh-add.c b/tvp-git-helper/tgh-clone.c
similarity index 77%
copy from tvp-git-helper/tgh-add.c
copy to tvp-git-helper/tgh-clone.c
index a106bca..efe50ac 100644
--- a/tvp-git-helper/tgh-add.c
+++ b/tvp-git-helper/tgh-clone.c
@@ -37,9 +37,9 @@
 
 #include "tgh-common.h"
 #include "tgh-dialog-common.h"
-#include "tgh-file-selection-dialog.h"
+#include "tgh-transfer-dialog.h"
 
-#include "tgh-add.h"
+#include "tgh-clone.h"
 
 struct exit_args
 {
@@ -55,7 +55,7 @@ static void child_exit(GPid pid, gint status, gpointer user_data)
 
   if(WEXITSTATUS(status) <= 1)
   {
-    GtkWidget *dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_OTHER, GTK_BUTTONS_CLOSE, _("Add finished"));
+    GtkWidget *dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_OTHER, GTK_BUTTONS_CLOSE, _("Clone finished"));
     tgh_dialog_start(GTK_DIALOG(dialog), TRUE);
   }
 
@@ -64,29 +64,22 @@ static void child_exit(GPid pid, gint status, gpointer user_data)
   g_free(args);
 }
 
-static gboolean add_spawn (GtkWidget *dialog, gchar **files, GPid *pid)
+static gboolean clone_spawn (GtkWidget *dialog, gchar *repository, gchar *path, GPid *pid)
 {
   GError *error = NULL;
   gint fd_err;
   GIOChannel *chan_err;
   TghOutputParser *parser;
-  gsize length;
-  gint i;
   gchar **argv;
   struct exit_args *args = g_new(struct exit_args, 1);
 
-  length = 3;
-  length += g_strv_length(files);
-
-  argv = g_new(gchar*, length);
+  argv = g_new(gchar*, 5);
 
   argv[0] = "git";
-  argv[1] = "add";
-  argv[length-1] = NULL;
-
-  i = 2;
-  while(*files)
-    argv[i++] = *files++;
+  argv[1] = "clone";
+  argv[2] = repository;
+  argv[3] = path;
+  argv[4] = NULL;
 
   if(!g_spawn_async_with_pipes(NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, pid, NULL, NULL, &fd_err, &error))
   {
@@ -106,27 +99,27 @@ static gboolean add_spawn (GtkWidget *dialog, gchar **files, GPid *pid)
   return TRUE;
 }
 
-gboolean tgh_add (gchar **files, GPid *pid)
+gboolean tgh_clone (gchar **files, GPid *pid)
 {
   GtkWidget *dialog;
+  gchar *repository;
+  gchar *path;
 
-  dialog = tgh_file_selection_dialog_new (_("Add"), NULL, 0, files, TGH_FILE_SELECTION_FLAG_MODIFIED|TGH_FILE_SELECTION_FLAG_UNTRACKED);
+  dialog = tgh_transfer_dialog_new (_("Clone"), NULL, 0, NULL, files?files[0]:NULL);
   if(gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK)
   {
     gtk_widget_destroy (dialog);
     return FALSE;
   }
   g_strfreev (files);
-  files = tgh_file_selection_dialog_get_files (TGH_FILE_SELECTION_DIALOG (dialog));
+  repository = tgh_transfer_dialog_get_repository (TGH_TRANSFER_DIALOG (dialog));
+  path = tgh_transfer_dialog_get_directory(TGH_TRANSFER_DIALOG(dialog));
   gtk_widget_destroy (dialog);
 
-  if(!files)
-    return FALSE;
-
-  dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_OTHER, GTK_BUTTONS_CANCEL, _("Adding ..."));
+  dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_OTHER, GTK_BUTTONS_CANCEL, _("Cloning ..."));
 	g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (tgh_cancel), NULL);
   tgh_dialog_start(GTK_DIALOG(dialog), TRUE);
 
-  return add_spawn(dialog, files, pid);
+  return clone_spawn(dialog, repository, path, pid);
 }
 
diff --git a/tvp-git-helper/tgh-reset.h b/tvp-git-helper/tgh-clone.h
similarity index 86%
copy from tvp-git-helper/tgh-reset.h
copy to tvp-git-helper/tgh-clone.h
index 954c6f3..d8af9da 100644
--- a/tvp-git-helper/tgh-reset.h
+++ b/tvp-git-helper/tgh-clone.h
@@ -14,14 +14,14 @@
  * Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef __TGH_RESET_H__
-#define __TGH_RESET_H__
+#ifndef __TGH_CLONE_H__
+#define __TGH_CLONE_H__
 
 G_BEGIN_DECLS
 
-gboolean tgh_reset (gchar **, GPid *);
+gboolean tgh_clone (gchar **, GPid *);
 
 G_END_DECLS
 
-#endif /*__TGH_RESET_H__*/
+#endif /*__TGH_CLONE_H__*/
 
diff --git a/tvp-git-helper/tgh-reset.c b/tvp-git-helper/tgh-reset.c
index c197d97..8b0bdc7 100644
--- a/tvp-git-helper/tgh-reset.c
+++ b/tvp-git-helper/tgh-reset.c
@@ -103,8 +103,10 @@ static gboolean reset_spawn (GtkWidget *dialog, gchar **files, GPid *pid)
 
   if(!g_spawn_async_with_pipes(NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, pid, NULL, &fd_out, &fd_err, &error))
   {
+    g_free (argv);
     return FALSE;
   }
+  g_free (argv);
 
   parser = tgh_error_parser_new(GTK_WIDGET(dialog));
 
diff --git a/tvp-git-helper/tgh-status.c b/tvp-git-helper/tgh-status.c
index 11b11c7..330ed1c 100644
--- a/tvp-git-helper/tgh-status.c
+++ b/tvp-git-helper/tgh-status.c
@@ -35,13 +35,6 @@
 
 static gchar *argv[] = {"git", "status", NULL};
 
-struct proc_args
-{
-    GtkWidget *dialog;
-    gchar *error;
-    gchar **files;
-};
-
 static gboolean status_spawn (TghStatusDialog *dialog, GPid *pid)
 {
   GError *error = NULL;
@@ -88,7 +81,8 @@ gboolean tgh_status (gchar **files, GPid *pid)
   g_signal_connect(dialog, "refresh-clicked", G_CALLBACK(create_status_child), NULL);
 
   if (files)
-      chdir(files[0]);
+    if (chdir(files[0]))
+      return FALSE;
 
   return status_spawn(TGH_STATUS_DIALOG(dialog), pid);
 }
diff --git a/tvp-git-helper/tgh-transfer-dialog.c b/tvp-git-helper/tgh-transfer-dialog.c
new file mode 100644
index 0000000..c894674
--- /dev/null
+++ b/tvp-git-helper/tgh-transfer-dialog.c
@@ -0,0 +1,228 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <thunar-vfs/thunar-vfs.h>
+#include <gtk/gtk.h>
+#include <dirent.h>
+
+#include "tgh-transfer-dialog.h"
+
+static void browse_callback(GtkButton *, TghTransferDialog *);
+
+struct _TghTransferDialog
+{
+    GtkDialog dialog;
+
+    GtkWidget *repository;
+    GtkWidget *path;
+    GtkWidget *filechooser;
+};
+
+struct _TghTransferDialogClass
+{
+    GtkDialogClass dialog_class;
+};
+
+G_DEFINE_TYPE (TghTransferDialog, tgh_transfer_dialog, GTK_TYPE_DIALOG)
+
+static void
+tgh_transfer_dialog_class_init (TghTransferDialogClass *klass)
+{
+}
+
+static void
+tgh_transfer_dialog_init (TghTransferDialog *dialog)
+{
+    GtkWidget *table;
+    GtkWidget *label;
+    GtkWidget *box;
+    GtkWidget *button;
+    GtkWidget *image;
+
+    table = gtk_table_new (2, 2, FALSE);
+
+    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, FALSE, TRUE, 0);
+    gtk_widget_show (table);
+
+    label = gtk_label_new_with_mnemonic (_("_Repository:"));
+    gtk_table_attach (GTK_TABLE (table), label,
+            0, 1, 0, 1,
+            GTK_FILL,
+            GTK_FILL,
+            0, 0);
+
+    box = gtk_hbox_new(FALSE, 0);
+    dialog->repository = gtk_entry_new();
+    dialog->filechooser = gtk_file_chooser_dialog_new(_("Select a folder"), GTK_WINDOW(dialog),
+            GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+            GTK_STOCK_OK, GTK_RESPONSE_OK,
+            NULL);
+
+    image = gtk_image_new_from_stock (GTK_STOCK_OPEN,
+            GTK_ICON_SIZE_MENU);
+    button = gtk_button_new();
+    gtk_button_set_image(GTK_BUTTON(button), image);
+    g_signal_connect(button, "clicked", G_CALLBACK(browse_callback), dialog);
+
+    gtk_box_pack_start(GTK_BOX(box), dialog->repository, TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(box), button, FALSE, TRUE, 0);
+
+    gtk_widget_show(dialog->repository);
+    gtk_widget_show(button);
+
+    gtk_table_attach (GTK_TABLE (table), box,
+            1, 2, 0, 1,
+            GTK_EXPAND | GTK_FILL,
+            GTK_FILL,
+            0, 0);
+
+    gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->repository);
+    gtk_widget_show(label);
+    gtk_widget_show(box);
+
+    label = gtk_label_new_with_mnemonic (_("_Directory:"));
+    gtk_table_attach (GTK_TABLE (table), label,
+            0, 1, 1, 2,
+            GTK_FILL,
+            GTK_FILL,
+            0, 0);
+
+    dialog->path = gtk_file_chooser_button_new (_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
+    //dialog->path = gtk_file_chooser_entry_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_OPEN);//GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);//tgh_file_chooser_entry_new ();
+    gtk_table_attach (GTK_TABLE (table), dialog->path,
+            1, 2, 1, 2,
+            GTK_EXPAND | GTK_FILL,
+            GTK_FILL,
+            0, 0);
+
+    gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->path);
+    gtk_widget_show(label);
+    gtk_widget_show(dialog->path);
+
+    gtk_window_set_title (GTK_WINDOW (dialog), _("Transfer"));
+
+    gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+            GTK_STOCK_OK, GTK_RESPONSE_OK,
+            NULL);
+    gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1);
+    gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+
+    gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+}
+
+GtkWidget*
+tgh_transfer_dialog_new (const gchar *title, GtkWindow *parent, GtkDialogFlags flags, const gchar *repo_dir, const gchar *local_dir)
+{
+    TghTransferDialog *dialog = g_object_new (TGH_TYPE_TRANSFER_DIALOG, NULL);
+
+    if(title)
+        gtk_window_set_title (GTK_WINDOW(dialog), title);
+
+    if(parent)
+        gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
+
+    if(flags & GTK_DIALOG_MODAL)
+        gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
+
+    if(flags & GTK_DIALOG_DESTROY_WITH_PARENT)
+        gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
+
+    if(flags & GTK_DIALOG_NO_SEPARATOR)
+        gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
+
+    if(repo_dir)
+    {
+      gchar *absolute = NULL;
+      if(!g_path_is_absolute (repo_dir))
+      {
+        //TODO: ".."
+        gchar *currdir = g_get_current_dir();
+        absolute = g_build_filename(currdir, (repo_dir[0] == '.' && (!repo_dir[1] || repo_dir[1] == G_DIR_SEPARATOR || repo_dir[1] == '/'))?&repo_dir[1]:repo_dir, NULL);
+        g_free (currdir);
+      }
+      g_free (absolute);
+    }
+
+    if(local_dir)
+    {
+        gboolean isdir = TRUE;
+        gchar *absolute = NULL;
+        DIR *dir;
+        FILE *fp;
+        if(!g_path_is_absolute (local_dir))
+        {
+            //TODO: ".."
+            gchar *currdir = g_get_current_dir();
+            absolute = g_build_filename(currdir, (local_dir[0] == '.' && (!local_dir[1] || local_dir[1] == G_DIR_SEPARATOR || local_dir[1] == '/'))?&local_dir[1]:local_dir, NULL);
+            g_free (currdir);
+        }
+        dir = opendir(absolute?absolute:local_dir);
+        if(dir)
+            closedir(dir);
+        else if((fp = fopen(absolute?absolute:local_dir, "r")))
+        {
+            fclose(fp);
+            isdir = FALSE;
+        }
+        if(isdir)
+            gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dialog->path), absolute?absolute:local_dir);
+        else
+        {
+            gtk_file_chooser_set_action (GTK_FILE_CHOOSER(dialog->path), GTK_FILE_CHOOSER_ACTION_OPEN);
+            gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(dialog->path), absolute?absolute:local_dir);
+        }
+        g_free (absolute);
+    }
+
+    return GTK_WIDGET(dialog);
+}
+
+gchar* tgh_transfer_dialog_get_repository (TghTransferDialog *dialog)
+{
+    g_return_val_if_fail (TGH_IS_TRANSFER_DIALOG (dialog), NULL);
+
+    return g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->repository)));
+}
+
+gchar* tgh_transfer_dialog_get_directory (TghTransferDialog *dialog)
+{
+    g_return_val_if_fail (TGH_IS_TRANSFER_DIALOG (dialog), NULL);
+
+    return gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog->path));
+}
+
+static void
+browse_callback(GtkButton *button, TghTransferDialog *dialog)
+{
+    gtk_widget_show(dialog->filechooser);
+    if(gtk_dialog_run(GTK_DIALOG(dialog->filechooser)) == GTK_RESPONSE_OK)
+    {
+        gchar *url = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(dialog->filechooser));
+        gtk_entry_set_text(GTK_ENTRY(dialog->repository), url);
+        g_free(url);
+    }
+    gtk_widget_hide(dialog->filechooser);
+}
+
diff --git a/tvp-git-helper/tgh-transfer-dialog.h b/tvp-git-helper/tgh-transfer-dialog.h
new file mode 100644
index 0000000..59d7a14
--- /dev/null
+++ b/tvp-git-helper/tgh-transfer-dialog.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2006 Peter de Ridder <peter at xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TGH_TRANSFER_DIALOG_H__
+#define __TGH_TRANSFER_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _TghTransferDialogClass TghTransferDialogClass;
+typedef struct _TghTransferDialog      TghTransferDialog;
+
+#define TGH_TYPE_TRANSFER_DIALOG             (tgh_transfer_dialog_get_type ())
+#define TGH_TRANSFER_DIALOG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), TGH_TYPE_TRANSFER_DIALOG, TghTransferDialog))
+#define TGH_TRANSFER_DIALOG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TGH_TYPE_TRANSFER_DIALOG, TghTransferDialogClass))
+#define TGH_IS_TRANSFER_DIALOG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TGH_TYPE_TRANSFER_DIALOG))
+#define TGH_IS_TRANSFER_DIALOG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TGH_TYPE_TRANSFER_DIALOG))
+#define TGH_TRANSFER_DIALOG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TGH_TYPE_TRANSFER_DIALOG, TghTransferDialogClass))
+
+GType      tgh_transfer_dialog_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
+
+GtkWidget* tgh_transfer_dialog_new      (const gchar *title,
+                                         GtkWindow *parent,
+                                         GtkDialogFlags flags,
+                                         const gchar *repo_dir,
+                                         const gchar *local_dir) G_GNUC_MALLOC G_GNUC_INTERNAL;
+
+gchar* tgh_transfer_dialog_get_repository (TghTransferDialog*);
+gchar* tgh_transfer_dialog_get_directory (TghTransferDialog*);
+
+G_END_DECLS;
+
+#endif /* !__TGH_TRANSFER_DIALOG_H__ */



More information about the Xfce4-commits mailing list