void on_git_status_unstage_activated (GtkAction *action, Git *plugin) { gchar *path; GList *paths; GitResetFilesCommand *reset_command; path = git_status_pane_get_selected_commit_path (GIT_STATUS_PANE (plugin->status_pane)); if (path) { paths = g_list_append (NULL, path); reset_command = git_reset_files_command_new (plugin->project_root_directory, GIT_RESET_FILES_HEAD, paths); g_signal_connect (G_OBJECT (reset_command), "command-finished", G_CALLBACK (git_pane_report_errors), plugin); g_signal_connect (G_OBJECT (reset_command), "command-finished", G_CALLBACK (g_object_unref), NULL); anjuta_util_glist_strings_free (paths); anjuta_command_start (ANJUTA_COMMAND (reset_command)); } }
void on_unstage_button_clicked (GtkAction *action, Git *plugin) { GList *paths; GitResetFilesCommand *reset_command; paths = git_status_pane_get_checked_commit_items (GIT_STATUS_PANE (plugin->status_pane), ANJUTA_VCS_STATUS_ALL); if (paths) { reset_command = git_reset_files_command_new (plugin->project_root_directory, GIT_RESET_FILES_HEAD, paths); anjuta_util_glist_strings_free (paths); g_signal_connect (G_OBJECT (reset_command), "command-finished", G_CALLBACK (git_pane_report_errors), plugin); g_signal_connect (G_OBJECT (reset_command), "command-finished", G_CALLBACK (g_object_unref), NULL); anjuta_command_start (ANJUTA_COMMAND (reset_command)); } else anjuta_util_dialog_error (NULL, _("No staged files selected.")); }
static void on_ok_button_clicked (GtkButton *button, GitCheckoutPane *self) { Git *plugin; GtkToggleButton *force_check; GList *paths; GitCheckoutFilesCommand *checkout_command; plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self))); force_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder, "force_check")); paths = git_status_pane_get_selected_not_updated_items (GIT_STATUS_PANE (plugin->status_pane), ANJUTA_VCS_STATUS_ALL); checkout_command = git_checkout_files_command_new (plugin->project_root_directory, paths, gtk_toggle_button_get_active (force_check)); anjuta_util_glist_strings_free (paths); g_signal_connect (G_OBJECT (checkout_command), "command-finished", G_CALLBACK (git_pane_report_errors), plugin); g_signal_connect (G_OBJECT (checkout_command), "command-finished", G_CALLBACK (g_object_unref), NULL); anjuta_command_start (ANJUTA_COMMAND (checkout_command)); git_pane_remove_from_dock (GIT_PANE (self)); }
static GtkWidget * git_status_pane_get_widget (AnjutaDockPane *pane) { GitStatusPane *self; self = GIT_STATUS_PANE (pane); return GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "status_pane")); }
static void git_status_pane_finalize (GObject *object) { GitStatusPane *self; self = GIT_STATUS_PANE (object); g_object_unref (self->priv->builder); g_hash_table_destroy (self->priv->selected_commit_items); g_hash_table_destroy (self->priv->selected_not_updated_items); g_free (self->priv); G_OBJECT_CLASS (git_status_pane_parent_class)->finalize (object); }