Commit 26980257 authored by James Liggett's avatar James Liggett

git: Use actions for recurring items in the glade file

Glade doesn't support unique names within toplevels only anymore, so use
an action for common widgets like OK and Cancel buttons, and other common check
boxes like Force or Add Signed Off By Line.
parent 3197bd84
This diff is collapsed.
......@@ -27,23 +27,23 @@ struct _GitAddFilesPanePriv
G_DEFINE_TYPE (GitAddFilesPane, git_add_files_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitAddFilesPane *self)
on_ok_action_activated (GtkAction *action, GitAddFilesPane *self)
{
Git *plugin;
AnjutaFileList *file_list;
GtkToggleButton *force_check;
AnjutaFileList *add_file_list;
GtkToggleAction *force_action;
GList *paths;
GitAddCommand *add_command;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
file_list = ANJUTA_FILE_LIST (gtk_builder_get_object (self->priv->builder,
"file_list"));
force_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"force_check"));
paths = anjuta_file_list_get_paths (file_list);
add_file_list = ANJUTA_FILE_LIST (gtk_builder_get_object (self->priv->builder,
"add_file_list"));
force_action = GTK_TOGGLE_ACTION (gtk_builder_get_object (self->priv->builder,
"force_action"));
paths = anjuta_file_list_get_paths (add_file_list);
add_command = git_add_command_new_list (plugin->project_root_directory,
paths,
gtk_toggle_button_get_active (force_check));
gtk_toggle_action_get_active (force_action));
anjuta_util_glist_strings_free (paths);
......@@ -65,10 +65,13 @@ static void
git_add_files_pane_init (GitAddFilesPane *self)
{
gchar *objects[] = {"add_pane",
"ok_action",
"cancel_action",
"force_action",
NULL};
GError *error = NULL;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitAddFilesPanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -81,16 +84,16 @@ git_add_files_pane_init (GitAddFilesPane *self)
g_error_free (error);
}
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
}
......
......@@ -27,7 +27,7 @@ struct _GitAddRemotePanePriv
G_DEFINE_TYPE (GitAddRemotePane, git_add_remote_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitAddRemotePane *self)
on_ok_action_activated (GtkAction *action, GitAddRemotePane *self)
{
Git *plugin;
GtkEntry *name_entry;
......@@ -96,10 +96,12 @@ static void
git_add_remote_pane_init (GitAddRemotePane *self)
{
gchar *objects[] = {"add_remote_pane",
"ok_action",
"cancel_action",
NULL};
GError *error = NULL;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitAddRemotePanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -112,16 +114,16 @@ git_add_remote_pane_init (GitAddRemotePane *self)
g_error_free (error);
}
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
}
......
......@@ -27,24 +27,24 @@ struct _GitApplyMailboxPanePriv
G_DEFINE_TYPE (GitApplyMailboxPane, git_apply_mailbox_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitApplyMailboxPane *self)
on_ok_action_activated (GtkAction *action, GitApplyMailboxPane *self)
{
Git *plugin;
AnjutaFileList *mailbox_list;
GtkToggleButton *signoff_check;
GtkToggleAction *signoff_action;
GList *paths;
GitApplyMailboxCommand *apply_mailbox_command;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
mailbox_list = ANJUTA_FILE_LIST (gtk_builder_get_object (self->priv->builder,
"mailbox_list"));
signoff_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"signoff_check"));
signoff_action = GTK_TOGGLE_ACTION (gtk_builder_get_object (self->priv->builder,
"signoff_action"));
paths = anjuta_file_list_get_paths (mailbox_list);
apply_mailbox_command = git_apply_mailbox_command_new (plugin->project_root_directory,
paths,
gtk_toggle_button_get_active (signoff_check));
gtk_toggle_action_get_active (signoff_action));
git_pane_create_message_view (plugin);
......@@ -73,11 +73,13 @@ static void
git_apply_mailbox_pane_init (GitApplyMailboxPane *self)
{
gchar *objects[] = {"apply_mailbox_pane",
"ok_action",
"cancel_action",
"signoff_action",
NULL};
GError *error = NULL;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitApplyMailboxPanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -90,16 +92,16 @@ git_apply_mailbox_pane_init (GitApplyMailboxPane *self)
g_error_free (error);
}
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
}
......
......@@ -27,22 +27,22 @@ struct _GitCheckoutPanePriv
G_DEFINE_TYPE (GitCheckoutPane, git_checkout_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitCheckoutPane *self)
on_ok_action_activated (GtkAction *action, GitCheckoutPane *self)
{
Git *plugin;
GtkToggleButton *force_check;
GtkToggleAction *force_action;
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"));
force_action = GTK_TOGGLE_ACTION (gtk_builder_get_object (self->priv->builder,
"force_action"));
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));
gtk_toggle_action_get_active (force_action));
anjuta_util_glist_strings_free (paths);
......@@ -64,10 +64,13 @@ static void
git_checkout_pane_init (GitCheckoutPane *self)
{
gchar *objects[] = {"checkout_pane",
"ok_action",
"cancel_action",
"force_action",
NULL};
GError *error = NULL;
GtkButton *ok_button;
GtkButton *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitCheckoutPanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -80,16 +83,16 @@ git_checkout_pane_init (GitCheckoutPane *self)
g_error_free (error);
}
ok_button = GTK_BUTTON (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_BUTTON (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
}
......
......@@ -27,29 +27,29 @@ struct _GitCherryPickPanePriv
G_DEFINE_TYPE (GitCherryPickPane, git_cherry_pick_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitCherryPickPane *self)
on_ok_action_activated (GtkAction *action, GitCherryPickPane *self)
{
Git *plugin;
AnjutaEntry *revision_entry;
GtkToggleButton *no_commit_check;
AnjutaEntry *cherry_pick_revision_entry;
GtkToggleAction *no_commit_action;
GtkToggleButton *show_source_check;
GtkToggleButton *signoff_check;
GtkToggleAction *signoff_action;
gchar *revision;
GitCherryPickCommand *cherry_pick_command;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
revision_entry = ANJUTA_ENTRY (gtk_builder_get_object (self->priv->builder,
"revision_entry"));
no_commit_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"no_commit_check"));
cherry_pick_revision_entry = ANJUTA_ENTRY (gtk_builder_get_object (self->priv->builder,
"revision_entry"));
no_commit_action = GTK_TOGGLE_ACTION (gtk_builder_get_object (self->priv->builder,
"no_commit_action"));
show_source_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"show_source_check"));
signoff_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"signoff_check"));
revision = anjuta_entry_dup_text (revision_entry);
signoff_action = GTK_TOGGLE_ACTION (gtk_builder_get_object (self->priv->builder,
"signoff_action"));
revision = anjuta_entry_dup_text (cherry_pick_revision_entry);
if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
GTK_WIDGET (revision_entry), revision,
GTK_WIDGET (cherry_pick_revision_entry), revision,
_("Please enter a revision.")))
{
g_free (revision);
......@@ -58,9 +58,9 @@ on_ok_button_clicked (GtkButton *button, GitCherryPickPane *self)
cherry_pick_command = git_cherry_pick_command_new (plugin->project_root_directory,
revision,
gtk_toggle_button_get_active (no_commit_check),
gtk_toggle_action_get_active (no_commit_action),
gtk_toggle_button_get_active (show_source_check),
gtk_toggle_button_get_active (signoff_check));
gtk_toggle_action_get_active (signoff_action));
git_pane_create_message_view (plugin);
......@@ -89,11 +89,14 @@ static void
git_cherry_pick_pane_init (GitCherryPickPane *self)
{
gchar *objects[] = {"cherry_pick_pane",
"ok_action",
"cancel_action",
"signoff_action",
"no_commit_action",
NULL};
GError *error = NULL;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitCherryPickPanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -106,16 +109,16 @@ git_cherry_pick_pane_init (GitCherryPickPane *self)
g_error_free (error);
}
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
}
......
......@@ -30,7 +30,7 @@ static void
on_amend_check_toggled (GtkToggleButton *button, GitCommitPane *self)
{
Git *plugin;
AnjutaColumnTextView *log_view;
AnjutaColumnTextView *commit_log_view;
GtkTextBuffer *log_text_buffer;
gchar *commit_message_path;
GIOChannel *io_channel;
......@@ -38,9 +38,9 @@ on_amend_check_toggled (GtkToggleButton *button, GitCommitPane *self)
GtkTextIter end_iter;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
log_view = ANJUTA_COLUMN_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
"log_view"));
log_text_buffer = anjuta_column_text_view_get_buffer (log_view);
commit_log_view = ANJUTA_COLUMN_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
"commit_log_view"));
log_text_buffer = anjuta_column_text_view_get_buffer (commit_log_view);
/* Make sure to clear any pre-existing text */
gtk_text_buffer_set_text (log_text_buffer, "", 0);
......@@ -91,10 +91,10 @@ on_use_custom_author_info_check_toggled (GtkToggleButton *button,
}
static void
on_ok_button_clicked (GtkButton *button, GitCommitPane *self)
on_ok_action_activated (GtkAction *action, GitCommitPane *self)
{
Git *plugin;
AnjutaColumnTextView *log_view;
AnjutaColumnTextView *commit_log_view;
GtkToggleButton *amend_check;
GtkToggleButton *failed_merge_check;
GtkToggleButton *use_custom_author_info_check;
......@@ -107,20 +107,20 @@ on_ok_button_clicked (GtkButton *button, GitCommitPane *self)
GitCommitCommand *commit_command;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE(self)));
log_view = ANJUTA_COLUMN_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
"log_view"));
commit_log_view = ANJUTA_COLUMN_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
"commit_log_view"));
amend_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"amend_check"));
failed_merge_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"failed_merge_check"));
use_custom_author_info_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"use_custom_author_info_check"));
log = anjuta_column_text_view_get_text (log_view);
log = anjuta_column_text_view_get_text (commit_log_view);
author_name = NULL;
author_email = NULL;
if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
GTK_WIDGET (log_view), log,
GTK_WIDGET (commit_log_view), log,
_("Please enter a log message.")))
{
g_free (log);
......@@ -199,12 +199,14 @@ static void
git_commit_pane_init (GitCommitPane *self)
{
gchar *objects[] = {"commit_pane",
"ok_action",
"cancel_action",
NULL};
GError *error = NULL;
GtkWidget *amend_check;
GtkWidget *use_custom_author_info_check;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitCommitPanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -221,10 +223,10 @@ git_commit_pane_init (GitCommitPane *self)
"amend_check"));
use_custom_author_info_check = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"use_custom_author_info_check"));
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (amend_check), "toggled",
G_CALLBACK (on_amend_check_toggled),
......@@ -234,11 +236,11 @@ git_commit_pane_init (GitCommitPane *self)
G_CALLBACK (on_use_custom_author_info_check_toggled),
self);
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
......
......@@ -27,27 +27,27 @@ struct _GitCreateBranchPanePriv
G_DEFINE_TYPE (GitCreateBranchPane, git_create_branch_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitCreateBranchPane *self)
on_ok_action_activated (GtkAction *action, GitCreateBranchPane *self)
{
Git *plugin;
GtkEntry *name_entry;
AnjutaEntry *revision_entry;
GtkEntry *branch_name_entry;
AnjutaEntry *branch_revision_entry;
GtkToggleButton *checkout_check;
gchar *name;
const gchar *revision;
GitBranchCreateCommand *create_command;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
name_entry = GTK_ENTRY (gtk_builder_get_object (self->priv->builder,
"name_entry"));
revision_entry = ANJUTA_ENTRY (gtk_builder_get_object (self->priv->builder,
"revision_entry"));
branch_name_entry = GTK_ENTRY (gtk_builder_get_object (self->priv->builder,
"branch_name_entry"));
branch_revision_entry = ANJUTA_ENTRY (gtk_builder_get_object (self->priv->builder,
"branch_revision_entry"));
checkout_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"checkout_check"));
name = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1);
name = gtk_editable_get_chars (GTK_EDITABLE (branch_name_entry), 0, -1);
if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
GTK_WIDGET (name_entry), name,
GTK_WIDGET (branch_name_entry), name,
_("Please enter a branch name.")))
{
g_free (name);
......@@ -55,7 +55,7 @@ on_ok_button_clicked (GtkButton *button, GitCreateBranchPane *self)
return;
}
revision = anjuta_entry_get_text (revision_entry);
revision = anjuta_entry_get_text (branch_revision_entry);
if (g_utf8_strlen (revision, -1) == 0)
revision = NULL;
......@@ -86,10 +86,12 @@ static void
git_create_branch_pane_init (GitCreateBranchPane *self)
{
gchar *objects[] = {"create_branch_pane",
"ok_action",
"cancel_action",
NULL};
GError *error = NULL;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
self->priv = g_new0 (GitCreateBranchPanePriv, 1);
self->priv->builder = gtk_builder_new ();
......@@ -102,16 +104,16 @@ git_create_branch_pane_init (GitCreateBranchPane *self)
g_error_free (error);
}
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
}
......
......@@ -27,39 +27,39 @@ struct _GitCreateTagPanePriv
G_DEFINE_TYPE (GitCreateTagPane, git_create_tag_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitCreateTagPane *self)
on_ok_action_activated (GtkAction *action, GitCreateTagPane *self)
{
Git *plugin;
GtkEntry *name_entry;
AnjutaEntry *revision_entry;
GtkToggleButton *force_check;
GtkEntry *tag_name_entry;
AnjutaEntry *tag_revision_entry;
GtkToggleAction *force_action;
GtkToggleButton *sign_check;
GtkToggleButton *annotate_check;
AnjutaColumnTextView *log_view;
AnjutaColumnTextView *tag_log_view;
gchar *name;
const gchar *revision;
gchar *log;
GitTagCreateCommand *create_command;
plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
name_entry = GTK_ENTRY (gtk_builder_get_object (self->priv->builder,
"name_entry"));
revision_entry = ANJUTA_ENTRY (gtk_builder_get_object (self->priv->builder,
"revision_entry"));
force_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"force_check"));
tag_name_entry = GTK_ENTRY (gtk_builder_get_object (self->priv->builder,
"tag_name_entry"));
tag_revision_entry = ANJUTA_ENTRY (gtk_builder_get_object (self->priv->builder,
"tag_revision_entry"));
force_action = GTK_TOGGLE_ACTION (gtk_builder_get_object (self->priv->builder,
"force_action"));
sign_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"sign_check"));
annotate_check = GTK_TOGGLE_BUTTON (gtk_builder_get_object (self->priv->builder,
"annotate_check"));
log_view = ANJUTA_COLUMN_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
"log_view"));
name = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1);
revision = anjuta_entry_get_text (revision_entry);
tag_log_view = ANJUTA_COLUMN_TEXT_VIEW (gtk_builder_get_object (self->priv->builder,
"tag_log_view"));
name = gtk_editable_get_chars (GTK_EDITABLE (tag_name_entry), 0, -1);
revision = anjuta_entry_get_text (tag_revision_entry);
log = NULL;
if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
GTK_WIDGET (name_entry), name,
GTK_WIDGET (tag_name_entry), name,
_("Please enter a tag name.")))
{
g_free (name);
......@@ -72,10 +72,10 @@ on_ok_button_clicked (GtkButton *button, GitCreateTagPane *self)
if (gtk_toggle_button_get_active (annotate_check))
{
log = anjuta_column_text_view_get_text (log_view);
log = anjuta_column_text_view_get_text (tag_log_view);
if (!git_pane_check_input (GTK_WIDGET (ANJUTA_PLUGIN (plugin)->shell),
GTK_WIDGET (log_view), log,
GTK_WIDGET (tag_log_view), log,
_("Please enter a log message.")))
{
g_free (name);
......@@ -90,7 +90,7 @@ on_ok_button_clicked (GtkButton *button, GitCreateTagPane *self)
revision,
log,
gtk_toggle_button_get_active (sign_check),
gtk_toggle_button_get_active (force_check));
gtk_toggle_action_get_active (force_action));
g_signal_connect (G_OBJECT (create_command), "command-finished",
G_CALLBACK (git_pane_report_errors),
......@@ -132,13 +132,16 @@ static void
git_create_tag_pane_init (GitCreateTagPane *self)
{
gchar *objects[] = {"create_tag_pane",
"ok_action",
"cancel_action",
"force_action",
NULL};
GError *error = NULL;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkAction *ok_action;
GtkAction *cancel_action;
GtkWidget *annotate_check;
GtkWidget *sign_check;
GtkWidget *log_view;
GtkWidget *tag_log_view;
self->priv = g_new0 (GitCreateTagPanePriv, 1);
......@@ -152,28 +155,28 @@ git_create_tag_pane_init (GitCreateTagPane *self)
g_error_free (error);
}
ok_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"ok_button"));
cancel_button = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"cancel_button"));
ok_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"ok_action"));
cancel_action = GTK_ACTION (gtk_builder_get_object (self->priv->builder,
"cancel_action"));
annotate_check = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"annotate_check"));
sign_check = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"sign_check"));
log_view = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"log_view"));
tag_log_view = GTK_WIDGET (gtk_builder_get_object (self->priv->builder,
"tag_log_view"));
g_signal_connect (G_OBJECT (ok_button), "clicked",
G_CALLBACK (on_ok_button_clicked),
g_signal_connect (G_OBJECT (ok_action), "activate",
G_CALLBACK (on_ok_action_activated),
self);
g_signal_connect_swapped (G_OBJECT (cancel_button), "clicked",
g_signal_connect_swapped (G_OBJECT (cancel_action), "activate",
G_CALLBACK (git_pane_remove_from_dock),
self);
g_signal_connect (G_OBJECT (annotate_check), "toggled",
G_CALLBACK (set_widget_sensitive),
log_view);
tag_log_view);
g_signal_connect (G_OBJECT (sign_check), "toggled",
G_CALLBACK (on_sign_check_toggled),
......
......@@ -27,7 +27,7 @@ struct _GitDeleteBranchesPanePriv
G_DEFINE_TYPE (GitDeleteBranchesPane, git_delete_branches_pane, GIT_TYPE_PANE);
static void
on_ok_button_clicked (GtkButton *button, GitDeleteBranchesPane *self)
on_ok_action_activated (GtkAction *action, GitDeleteBranchesPane *self)
{
Git *plugin;
GtkToggleButton *require_merged_check;
......@@ -124,10 +124,12 @@ static void
git_delete_branches_pane_init (GitDeleteBranchesPane *self)
{
gchar *objects[] = {"delete_branches_pane",
"ok_action",
"cancel_action",
NULL};
GError *error = NULL;
GtkButton *ok_button;
GtkButton *cancel_button;