[easytag/wip/musicbrainz-support-merge: 54/76] Toolbar buttons are disabled at the starting
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/musicbrainz-support-merge: 54/76] Toolbar buttons are disabled at the starting
- Date: Thu, 28 Aug 2014 07:38:09 +0000 (UTC)
commit 1284fc25d5880d05df4dd1372bb0553a38fb5322
Author: Abhinav <abhijangda hotmail com>
Date: Tue Aug 12 16:32:39 2014 +0530
Toolbar buttons are disabled at the starting
data/musicbrainz_dialog.ui | 8 +++
src/mbentityview.c | 4 ++
src/musicbrainz_dialog.c | 112 +++++++++++++++++++++++++++++++++++++------
src/musicbrainz_dialog.h | 2 +
4 files changed, 110 insertions(+), 16 deletions(-)
---
diff --git a/data/musicbrainz_dialog.ui b/data/musicbrainz_dialog.ui
index 1763d0b..af1c3dd 100755
--- a/data/musicbrainz_dialog.ui
+++ b/data/musicbrainz_dialog.ui
@@ -215,6 +215,7 @@
<child>
<object class="GtkEntry" id="entry_tree_view_search">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="invisible_char_set">True</property>
@@ -229,6 +230,7 @@
<child>
<object class="GtkToolButton" id="toolbtn_up">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Up</property>
@@ -245,6 +247,7 @@
<child>
<object class="GtkToolButton" id="toolbtn_down">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Down</property>
@@ -271,6 +274,7 @@
<child>
<object class="GtkToolButton" id="toolbtn_invert_selection">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Invert Selections</property>
@@ -287,6 +291,7 @@
<child>
<object class="GtkToolButton" id="toolbtn_select_all">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Select All</property>
@@ -303,6 +308,7 @@
<child>
<object class="GtkToolButton" id="toolbtn_unselect_all">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Unselect All</property>
@@ -319,6 +325,7 @@
<child>
<object class="GtkToggleToolButton" id="toolbtn_toggle_red_lines">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Toggle Red Lines</property>
@@ -335,6 +342,7 @@
<child>
<object class="GtkToolButton" id="toolbtn_refresh">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Refresh</property>
diff --git a/src/mbentityview.c b/src/mbentityview.c
index 4c8b756..f457d0d 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -649,6 +649,8 @@ search_in_levels_callback (GObject *source, GAsyncResult *res,
{
g_object_unref (res);
g_slice_free (SearchInLevelThreadData, user_data);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
+ et_music_brainz_dialog_stop_set_sensitive (FALSE);
return;
}
@@ -711,6 +713,7 @@ search_in_levels_callback (GObject *source, GAsyncResult *res,
g_slice_free (SearchInLevelThreadData, thread_data);
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
if (et_music_brainz_get_exit_on_complete ())
{
@@ -925,6 +928,7 @@ search_in_levels (EtMbEntityView *entity_view, GNode *child,
search_in_levels_thread_func,
0, mb5_search_cancellable);
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
}
/*
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index 202342d..140d94d 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -264,8 +264,7 @@ get_selected_iter_list (GtkTreeView *tree_view, GList **list);
static void
btn_selected_find_clicked (GtkWidget *widget, gpointer user_data);
static void
-get_first_selected_file (ET_File **et_file);
-
+get_first_selected_file (ET_File **et_file);
#ifdef ENABLE_libdiscid
static void
discid_search_callback (GObject *source, GAsyncResult *res,
@@ -460,6 +459,21 @@ manual_search_callback (GObject *source, GAsyncResult *res,
et_music_brainz_dialog_stop_set_sensitive (FALSE);
free_mb_tree (&thread_data->node);
+ if (mbDialog)
+ {
+ dlg = ET_MUSICBRAINZ_DIALOG (mbDialog);
+ priv = ET_MUSICBRAINZ_DIALOG_GET_PRIVATE (dlg);
+
+ if (priv->search)
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
+ }
+ else
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
+ }
+ }
+
return;
}
@@ -477,6 +491,7 @@ manual_search_callback (GObject *source, GAsyncResult *res,
gtk_combo_box_text_append_text (combo_box,
gtk_combo_box_text_get_active_text (combo_box));
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
priv->search = ET_MB_SEARCH_TYPE_MANUAL;
et_mb_set_search_manual (&priv->search, thread_data->text_to_search,
priv->mb_tree_root, thread_data->type);
@@ -608,6 +623,7 @@ btn_fetch_more_clicked (GtkWidget *btn, gpointer user_data)
manual_search_thread_func, 0,
mb5_search_cancellable);
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
}
else if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_SELECTED)
{
@@ -667,6 +683,7 @@ btn_fetch_more_clicked (GtkWidget *btn, gpointer user_data)
gtk_statusbar_push (mb_dialog_priv->statusbar, 0,
_("Starting Selected Files Search"));
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
}
}
@@ -715,6 +732,7 @@ btn_manual_find_clicked (GtkWidget *btn, gpointer user_data)
manual_search_thread_func, 0,
mb5_search_cancellable);
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
}
/*
@@ -938,6 +956,21 @@ selected_find_callback (GObject *source, GAsyncResult *res,
g_array_unref (thread_data->n_nodes);
g_slice_free (SelectedFindThreadData, user_data);
+ if (mbDialog)
+ {
+ dlg = ET_MUSICBRAINZ_DIALOG (mbDialog);
+ mb_dialog_priv = ET_MUSICBRAINZ_DIALOG_GET_PRIVATE (dlg);
+
+ if (mb_dialog_priv->search)
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
+ }
+ else
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
+ }
+ }
+
return;
}
@@ -953,6 +986,7 @@ selected_find_callback (GObject *source, GAsyncResult *res,
g_object_unref (res);
g_hash_table_destroy (thread_data->hash_table);
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
if (mb_dialog_priv->exit_on_complete)
{
@@ -1172,6 +1206,7 @@ btn_selected_find_clicked (GtkWidget *button, gpointer data)
gtk_statusbar_push (mb_dialog_priv->statusbar, 0,
_("Starting Selected Files Search"));
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
}
/*
@@ -1237,6 +1272,22 @@ discid_search_callback (GObject *source, GAsyncResult *res,
g_object_unref (res);
free_mb_tree (&thread_data->node);
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+
+ if (mbDialog)
+ {
+ dlg = ET_MUSICBRAINZ_DIALOG (mbDialog);
+ mb_dialog_priv = ET_MUSICBRAINZ_DIALOG_GET_PRIVATE (dlg);
+
+ if (mb_dialog_priv->search)
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
+ }
+ else
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
+ }
+ }
+
return;
}
@@ -1252,6 +1303,7 @@ discid_search_callback (GObject *source, GAsyncResult *res,
g_object_unref (res);
g_slice_free (DiscIDSearchThreadData, thread_data);
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_fetch_more")),
FALSE);
@@ -1358,6 +1410,7 @@ btn_discid_search_clicked (GtkWidget *button, gpointer data)
discid_search_thread_func, 0,
mb5_search_cancellable);
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
#else
GtkWidget *msg_dialog;
@@ -1407,6 +1460,22 @@ freedbid_search_callback (GObject *source, GAsyncResult *res,
g_free (thread_data->cddb_discid);
g_slice_free (FreeDBIDSearchThreadData, thread_data);
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+
+ if (mbDialog)
+ {
+ dlg = ET_MUSICBRAINZ_DIALOG (mbDialog);
+ mb_dialog_priv = ET_MUSICBRAINZ_DIALOG_GET_PRIVATE (dlg);
+
+ if (mb_dialog_priv->search)
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
+ }
+ else
+ {
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
+ }
+ }
+
return;
}
@@ -1423,6 +1492,7 @@ freedbid_search_callback (GObject *source, GAsyncResult *res,
g_free (thread_data->cddb_discid);
g_slice_free (FreeDBIDSearchThreadData, thread_data);
et_music_brainz_dialog_stop_set_sensitive (FALSE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (TRUE);
et_mb_set_automatic_search (&mb_dialog_priv->search);
if (mb_dialog_priv->exit_on_complete)
@@ -1622,6 +1692,7 @@ btn_automatic_search_clicked (GtkWidget *btn, gpointer data)
freedbid_search_thread_func, 0,
mb5_search_cancellable);
et_music_brainz_dialog_stop_set_sensitive (TRUE);
+ et_music_brainz_dialog_toolbar_buttons_set_sensitive (FALSE);
}
/*
@@ -2074,7 +2145,7 @@ et_music_brainz_dialog_stop_set_sensitive (gboolean sensitive)
{
EtMusicBrainzDialogPrivate *mb_dialog_priv;
- if (!IS_ET_MUSICBRAINZ_DIALOG (mbDialog))
+ if (!mbDialog)
{
return;
}
@@ -2082,8 +2153,8 @@ et_music_brainz_dialog_stop_set_sensitive (gboolean sensitive)
mb_dialog_priv = ET_MUSICBRAINZ_DIALOG_GET_PRIVATE (ET_MUSICBRAINZ_DIALOG (mbDialog));
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_stop")),
sensitive);
- gtk_widget_set_sensitive (mb_dialog_priv->entityView, !sensitive);
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_manual_find")), TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_apply_changes")),
+ !sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_manual_find")),
!sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_selected_find")),
@@ -2092,26 +2163,35 @@ et_music_brainz_dialog_stop_set_sensitive (gboolean sensitive)
!sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_disc_find")),
!sensitive);
+ gtk_widget_set_sensitive (mb_dialog_priv->entityView, !sensitive);
+}
+
+void
+et_music_brainz_dialog_toolbar_buttons_set_sensitive (gboolean sensitive)
+{
+ if (!mbDialog)
+ {
+ return;
+ }
+
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "entry_tree_view_search")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_up")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_down")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_invert_selection")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_select_all")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_unselect_all")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_toggle_red_lines")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_refresh")),
- !sensitive);
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_apply_changes")),
- !sensitive);
+ sensitive);
gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_fetch_more")),
- !sensitive);
+ sensitive);
}
/*
diff --git a/src/musicbrainz_dialog.h b/src/musicbrainz_dialog.h
index 549b060..b06c340 100755
--- a/src/musicbrainz_dialog.h
+++ b/src/musicbrainz_dialog.h
@@ -97,6 +97,8 @@ void
et_music_brainz_dialog_set_statusbar_message (gchar *message);
void
et_music_brainz_dialog_set_response (GtkResponseType response);
+void
+et_music_brainz_dialog_toolbar_buttons_set_sensitive (gboolean sensitive);
G_END_DECLS
#endif /* __MUSICBRAINZ_DIALOG_H__ */
#endif /* ENABLE_MUSICBRAINZ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]