[easytag/wip/musicbrainz-support-appwin-merge: 56/58] Remove Refresh Operation



commit 5984eb2f84b11b60a97e8168e59973dd79c9fa1b
Author: Abhinav <abhijangda hotmail com>
Date:   Fri Aug 15 22:32:39 2014 +0530

    Remove Refresh Operation

 data/musicbrainz_dialog.ui |   17 -----------
 src/mbentityview.c         |   37 ++---------------------
 src/mbentityview.h         |    2 -
 src/musicbrainz_dialog.c   |   67 +------------------------------------------
 4 files changed, 6 insertions(+), 117 deletions(-)
---
diff --git a/data/musicbrainz_dialog.ui b/data/musicbrainz_dialog.ui
index 1a4160e..bc7f71e 100755
--- a/data/musicbrainz_dialog.ui
+++ b/data/musicbrainz_dialog.ui
@@ -255,23 +255,6 @@
                   </packing>
                 </child>
                 <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>
-                    <property name="tooltip_text" translatable="yes">Refresh</property>
-                    <property name="label" translatable="yes">toolbutton9</property>
-                    <property name="use_underline">True</property>
-                    <property name="stock_id">gtk-refresh</property>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="homogeneous">True</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkToolButton" id="btn_stop">
                     <property name="visible">True</property>
                     <property name="sensitive">False</property>
diff --git a/src/mbentityview.c b/src/mbentityview.c
index dfebb8c..a5457fb 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -107,7 +107,7 @@ static void
 et_mb_entity_view_finalize (GObject *object);
 static void
 search_in_levels (EtMbEntityView *entity_view, GNode *child,
-                  GtkTreeIter *iter, gboolean is_refresh);
+                  GtkTreeIter *iter, gboolean is_fetch_more);
 
 /*************
  * Functions *
@@ -652,7 +652,7 @@ search_in_levels_callback (GObject *source, GAsyncResult *res,
     {
         GtkWidget *prev_active_toggle_btn;
 
-        /* Only run if iter is valid i.e. it is not a Refresh Operation */
+        /* Only run if iter is valid i.e. it is not a Fetch More Operation */
         children = gtk_container_get_children (GTK_CONTAINER (priv->bread_crumb_box));
         active_child = g_list_find (children, priv->active_toggle_button);
     
@@ -876,7 +876,7 @@ tree_view_row_activated (GtkTreeView *tree_view, GtkTreePath *path,
  */
 static void
 search_in_levels (EtMbEntityView *entity_view, GNode *child,
-                  GtkTreeIter *filter_iter, gboolean is_refresh)
+                  GtkTreeIter *filter_iter, gboolean is_fetch_more)
 {
     SearchInLevelThreadData *thread_data;
     EtMbEntityViewPrivate *priv;
@@ -900,7 +900,7 @@ search_in_levels (EtMbEntityView *entity_view, GNode *child,
                                                           filter_iter);
     }
 
-    if (!is_refresh && ((EtMbEntity *)child->data)->is_red_line)
+    if (!is_fetch_more && ((EtMbEntity *)child->data)->is_red_line)
     {
         /* If node is a red line and it is not a refresh operation */
         search_in_levels_callback (NULL, NULL, thread_data);
@@ -1151,35 +1151,6 @@ et_mb_entity_view_get_current_level (EtMbEntityView *entity_view)
 }
 
 /*
- * et_mb_entity_view_refresh_current_level:
- * @entity_view: EtMbEntityView
- *
- * To re download data from MusicBrainz Server at the current level.
- */
-void
-et_mb_entity_view_refresh_current_level (EtMbEntityView *entity_view)
-{
-    EtMbEntityViewPrivate *priv;
-    GNode *child;
-
-    priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
-
-    /* Delete Current Data */
-    et_mb_entity_view_clear_all (entity_view);
-    child = g_node_first_child (priv->mb_tree_current_node);
-
-    while (child)
-    {
-        GNode *child1;
-        child1 = g_node_next_sibling (child);
-        free_mb_tree (&child);
-        child = child1;
-    }
-
-    search_in_levels (entity_view, priv->mb_tree_current_node, NULL, TRUE);
-}
-
-/*
  * et_mb_entity_view_clear_all:
  * @entity_view: EtMbEntityView
  *
diff --git a/src/mbentityview.h b/src/mbentityview.h
index c16ed46..be143de 100755
--- a/src/mbentityview.h
+++ b/src/mbentityview.h
@@ -172,8 +172,6 @@ void
 et_mb_entity_view_search_in_results (EtMbEntityView *entity_view,
                                      const gchar *text);
 void
-et_mb_entity_view_refresh_current_level (EtMbEntityView *entity_view);
-void
 et_mb_entity_view_select_up (EtMbEntityView *entity_view);
 void
 et_mb_entity_view_select_down (EtMbEntityView *entity_view);
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index 69bcef3..326acfe 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -26,7 +26,6 @@
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n.h>
 #include <discid/discid.h>
-#include <openssl/ssl.h>
 
 #include "easytag.h"
 #include "log.h"
@@ -264,8 +263,6 @@ tool_btn_select_all_clicked (GtkWidget *btn, gpointer user_data);
 static void
 tool_btn_unselect_all_clicked (GtkWidget *btn, gpointer user_data);
 static void
-tool_btn_refresh_clicked (GtkWidget *btn, gpointer user_data);
-static void
 btn_manual_stop_clicked (GtkWidget *btn, gpointer user_data);
 static void
 selected_find_callback (GObject *source, GAsyncResult *res,
@@ -604,7 +601,7 @@ btn_fetch_more_clicked (GtkWidget *btn, gpointer user_data)
     level = et_mb_entity_view_get_current_level (ET_MB_ENTITY_VIEW (mb_dialog_priv->entityView));
 
     if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_AUTOMATIC && 
-        level <= 2)
+        level >= 2)
     {
         /* if current search is automatic search and its level is 
          * greater than 1 then fetch more results for these albums */
@@ -656,7 +653,7 @@ btn_fetch_more_clicked (GtkWidget *btn, gpointer user_data)
         browser_list = gtk_tree_selection_get_tree_view (selection);   
         iter_list = NULL;
         l = NULL;
-    
+
         if (!get_selected_iter_list (GTK_TREE_VIEW (browser_list), &iter_list))
         {
             gtk_statusbar_push (mb_dialog_priv->statusbar,
@@ -833,59 +830,6 @@ tool_btn_unselect_all_clicked (GtkWidget *btn, gpointer user_data)
  * Signal Handler for "clicked" signal of btnManualStop.
  */
 static void
-tool_btn_refresh_clicked (GtkWidget *btn, gpointer user_data)
-{
-    EtMusicBrainzDialogPrivate *mb_dialog_priv;
-    EtMusicBrainzDialog *dlg;
-
-    dlg = ET_MUSICBRAINZ_DIALOG (mbDialog);
-    mb_dialog_priv = ET_MUSICBRAINZ_DIALOG_GET_PRIVATE (dlg);
-
-    if (!mb_dialog_priv->search)
-    {
-        return;
-    }
-
-    if (et_mb_entity_view_get_current_level (ET_MB_ENTITY_VIEW (mb_dialog_priv->entityView)) >
-        1)
-    {
-        /* Current level is more than 1, refereshing means downloading an */
-        /* entity's children */
-        et_mb_entity_view_refresh_current_level (ET_MB_ENTITY_VIEW (mb_dialog_priv->entityView));
-        return;
-    }
-
-    if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_MANUAL)
-    {
-        EtMbManualSearch *manual_search;
-        GtkWidget *entry;
-
-        manual_search = (EtMbManualSearch *)mb_dialog_priv->search;
-        mb_dialog_priv->mb_tree_root = g_node_new (NULL);
-        entry = gtk_bin_get_child (GTK_BIN (gtk_builder_get_object (builder, "cb_manual_search")));
-        gtk_entry_set_text (GTK_ENTRY (entry), manual_search->to_search);
-        gtk_combo_box_set_active (GTK_COMBO_BOX (gtk_builder_get_object (builder, "cb_manual_search_in")),
-                                  manual_search->to_search_type);
-        btn_manual_find_clicked (NULL, NULL);
-    }
-    else if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_SELECTED)
-    {
-        btn_selected_find_clicked (NULL, NULL);
-    }
-    else if (mb_dialog_priv->search->type == ET_MB_SEARCH_TYPE_AUTOMATIC)
-    {
-        btn_automatic_search_clicked (NULL, NULL);
-    }
-}
-
-/*
- * btn_manual_stop_clicked:
- * @btn: GtkButton
- * @user_data: User data
- *
- * Signal Handler for "clicked" signal of btnManualStop.
- */
-static void
 btn_manual_stop_clicked (GtkWidget *btn, gpointer user_data)
 {
     if (G_IS_CANCELLABLE (mb5_search_cancellable))
@@ -1131,7 +1075,6 @@ btn_selected_find_clicked (GtkWidget *button, gpointer data)
     EtMusicBrainzDialogPrivate *mb_dialog_priv;
     EtMusicBrainzDialog *dlg;
 
-
     selection = et_application_window_browser_get_selection (ET_APPLICATION_WINDOW (MainWindow));
     browser_list = gtk_tree_selection_get_tree_view (selection);
     dlg = ET_MUSICBRAINZ_DIALOG (mbDialog);
@@ -1850,7 +1793,6 @@ btn_apply_changes_clicked (GtkWidget *btn, gpointer data)
             et_entity = list_iter1->data;
             et_file = et_application_window_browser_get_et_file_from_iter (ET_APPLICATION_WINDOW 
(MainWindow),
                                                                            list_iter2->data);
-
             et_apply_track_tag_to_et_file (et_entity->entity, album_entity, 
                                            et_file);
         }
@@ -2366,8 +2308,6 @@ et_music_brainz_dialog_toolbar_buttons_set_sensitive (gboolean sensitive)
                               sensitive);
     gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "toolbtn_toggle_red_lines")),
                               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_fetch_more")),
                               sensitive);
     gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "btn_apply_changes")),
@@ -2513,9 +2453,6 @@ et_musicbrainz_dialog_init (EtMusicBrainzDialog *dialog)
     g_signal_connect (gtk_builder_get_object (builder, "toolbtn_toggle_red_lines"),
                       "clicked", G_CALLBACK (tool_btn_toggle_red_lines_clicked),
                       NULL);
-    g_signal_connect (gtk_builder_get_object (builder, "toolbtn_refresh"),
-                      "clicked", G_CALLBACK (tool_btn_refresh_clicked),
-                      NULL);
     g_signal_connect (gtk_builder_get_object (builder, "btn_selected_find"),
                       "clicked", G_CALLBACK (btn_selected_find_clicked),
                       NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]