Put all of the UI utility functions into the "git" namespace.
[anjuta-git-plugin.git] / plugins / git / git-fetch-dialog.c
blobec4926cbcd9dabf2d2b3e0493a7673dc5b4846e6
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta
4 * Copyright (C) James Liggett 2008 <jrliggett@cox.net>
5 *
6 * anjuta is free software.
7 *
8 * You may redistribute it and/or modify it under the terms of the
9 * GNU General Public License, as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
11 * any later version.
13 * anjuta is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with anjuta. If not, write to:
20 * The Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02110-1301, USA.
25 #include "git-fetch-dialog.h"
27 /* FIXME: We don't really have a dialog yet. We would probably need one to
28 * support some advanced options of fetch, though. Make the dialog when we
29 * implment those. */
31 static void
32 on_fetch_command_finished (AnjutaCommand *command, guint return_code,
33 Git *plugin)
35 AnjutaStatus *status;
37 status = anjuta_shell_get_status (ANJUTA_PLUGIN (plugin)->shell,
38 NULL);
40 anjuta_status (status, _("Git: Fetch complete."), 5);
42 git_report_errors (command, return_code);
44 g_object_unref (command);
48 static void
49 git_fetch (Git *plugin)
51 GitProgressData *data;
52 GitFetchCommand *fetch_command;
54 data = git_progress_data_new (plugin, _("Git: Fetching..."));
55 fetch_command = git_fetch_command_new (plugin->project_root_directory);
57 g_signal_connect (G_OBJECT (fetch_command), "data-arrived",
58 G_CALLBACK (on_git_command_info_arrived),
59 plugin);
61 g_signal_connect (G_OBJECT (fetch_command), "command-finished",
62 G_CALLBACK (on_fetch_command_finished),
63 plugin);
65 g_signal_connect_swapped (G_OBJECT (fetch_command), "command-finished",
66 G_CALLBACK (git_progress_data_free),
67 data);
69 g_signal_connect (G_OBJECT (fetch_command), "progress",
70 G_CALLBACK (on_git_command_progress),
71 data);
73 git_create_message_view (plugin);
75 anjuta_command_start (ANJUTA_COMMAND (fetch_command));
79 void
80 on_menu_git_fetch (GtkAction *action, Git *plugin)
82 git_fetch (plugin);