[beast: 4/8] BST: remove all janitor references



commit 09d896833082d6f6c1980b4a7198f67abca9611f
Author: Tim Janik <timj gnu org>
Date:   Tue Oct 3 01:24:26 2017 +0200

    BST: remove all janitor references
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bstusermessage.cc |  109 +------------------------------------------
 beast-gtk/bstusermessage.hh |    1 -
 2 files changed, 1 insertions(+), 109 deletions(-)
---
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index 4a125c8..baaf746 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -5,9 +5,6 @@
 #include <string.h>
 #include <errno.h>
 
-/* --- prototypes --- */
-static GtkWidget*      create_janitor_dialog   (SfiProxy          janitor);
-
 /* --- variables --- */
 static GSList *msg_windows = NULL;
 
@@ -181,7 +178,7 @@ bst_msg_dialog_update (GxkDialog        *dialog,
       g_object_set_int (dialog, "BEAST-user-message-count", 1);
     }
   /* add details section */
-  if (msg->log_domain || msg->details || msg->janitor || msg->process || msg->pid)
+  if (msg->log_domain || msg->details || msg->process || msg->pid)
     {
       GtkWidget *exp = gtk_expander_new (_("Details:"));
       gtk_widget_show (exp);
@@ -418,83 +415,6 @@ bst_message_handler (const BstMessage *const_msg)
   return result;
 }
 
-static void
-message_fill_from_script (BstMessage    *msg,
-                          BstMsgType     mtype,
-                          SfiProxy       janitor,
-                          const gchar   *primary,
-                          const gchar   *script_name,
-                          const gchar   *proc_name,
-                          const gchar   *user_msg)
-{
-  msg->log_domain = NULL;
-  msg->type = mtype;
-  msg->ident = bst_msg_type_ident (msg->type);
-  msg->label = bst_msg_type_ident (msg->type);
-  const gchar *proc_title = NULL;
-  if (hastext (proc_name))
-    {
-      Bse::CategorySeq cseq = bse_server.category_match_typed ("*", proc_name);
-      if (cseq.size())
-        proc_title = cseq[0].category.c_str() + bst_path_leaf_index (cseq[0].category);
-    }
-  msg->title = g_strdup (proc_title);
-  msg->primary = g_strdup (primary ? primary : proc_title);
-  if (user_msg && user_msg[0])
-    msg->secondary = g_strdup (user_msg);
-  else
-    {
-      gchar *script_base = g_path_get_basename (script_name);
-      msg->secondary = g_strdup_format (_("Executing procedure '%s' from script '%s'."), proc_name, 
script_base);
-      g_free (script_base);
-    }
-  if (!janitor && hastext (proc_name))
-    msg->details = g_strdup_format (_("Procedure: %s\nScript: %s\n"), proc_name, script_name);
-  else
-    msg->details = NULL;
-  msg->config_check = NULL;
-  msg->janitor = janitor;
-  msg->process = NULL;
-  msg->pid = 0;
-  msg->n_msg_bits = 0;
-  msg->msg_bits = NULL;
-}
-
-
-static void
-message_free_from_script (BstMessage *msg)
-{
-  g_free ((char*) msg->title);
-  g_free ((char*) msg->primary);
-  g_free ((char*) msg->secondary);
-  g_free ((char*) msg->details);
-  g_free ((char*) msg->config_check);
-}
-
-static void
-janitor_window_deleted (GxkDialog *dialog)
-{
-  SfiProxy janitor = (SfiProxy) g_object_get_data (G_OBJECT (dialog), "user-data");
-
-  // bse_janitor_kill (janitor);
-  Bse::ItemH::down_cast (bse_server.from_proxy (janitor)).unuse();
-}
-
-static GtkWidget*
-create_janitor_dialog (SfiProxy janitor)
-{
-  GxkDialog *dialog = (GxkDialog*) gxk_dialog_new (NULL, NULL,
-                                                   GXK_DIALOG_STATUS_BAR, // | GXK_DIALOG_WINDOW_GROUP,
-                                                   NULL, NULL);
-  gxk_dialog_set_sizes (dialog, -1, -1, 512, -1);
-
-  g_object_set_data (G_OBJECT (dialog), "user-data", (gpointer) janitor);
-  Bse::ItemH::down_cast (bse_server.from_proxy (janitor)).use();
-  g_object_connect (dialog, "swapped_signal::destroy", janitor_window_deleted, dialog, NULL);
-  dialog_show_above_modals (dialog, FALSE);
-  return GTK_WIDGET (dialog);
-}
-
 static char*
 text_concat (char *prefix,
              char *text)
@@ -543,7 +463,6 @@ bst_message_dialog_display (const char     *log_domain,
   msg.type = mtype;
   msg.ident = bst_msg_type_ident (mtype);
   msg.label = bst_msg_type_ident (mtype);
-  // msg.janitor = bse_script_janitor();
   msg.process = g_strdup (Bse::this_thread_get_name().c_str());
   msg.pid = Bse::this_thread_gettid();
   msg.n_msg_bits = 0;
@@ -600,27 +519,6 @@ bst_message_dialogs_popdown (void)
 }
 
 static void
-server_script_start (SfiProxy server,
-                     SfiProxy janitor)
-{
-  create_janitor_dialog (janitor);
-}
-static void
-server_script_error (SfiProxy     server,
-                     const gchar *script_name,
-                     const gchar *proc_name,
-                     const gchar *reason)
-{
-  /* this signal is emitted (without janitor) when script execution failed */
-  BstMessage msg = { 0, };
-  gchar *error_msg = g_strdup_format (_("Failed to execute script procedure '%s': %s"), proc_name, reason);
-  message_fill_from_script (&msg, BST_MSG_ERROR, 0, _("Script execution error."), script_name, proc_name, 
error_msg);
-  g_free (error_msg);
-  bst_message_handler (&msg);
-  message_free_from_script (&msg);
-}
-
-static void
 server_user_message (const Bse::UserMessage &umsg)
 {
   auto convert_msg_type = [] (Bse::UserMessageType mtype) {
@@ -645,7 +543,6 @@ server_user_message (const Bse::UserMessage &umsg)
   const Aida::EnumValue ev = Aida::enum_info<Bse::UserMessageType>().find_value (umsg.utype);
   msg.ident = ev.ident;
   msg.label = NULL;
-  msg.janitor = 0;
   msg.process = 0;
   msg.pid = 0;
   bst_message_handler (&msg);
@@ -655,9 +552,5 @@ void
 bst_message_connect_to_server (void)
 {
   bse_server.sig_user_message() += server_user_message;
-  bse_proxy_connect (BSE_SERVER,
-                    "signal::script_start", server_script_start, NULL,
-                    "signal::script_error", server_script_error, NULL,
-                    NULL);
   bse_proxy_set (BSE_SERVER, "log-messages", FALSE, NULL);
 }
diff --git a/beast-gtk/bstusermessage.hh b/beast-gtk/bstusermessage.hh
index 7cae51b..e06a847 100644
--- a/beast-gtk/bstusermessage.hh
+++ b/beast-gtk/bstusermessage.hh
@@ -28,7 +28,6 @@ typedef struct {
   const char    *secondary;
   const char    *details;
   const char    *config_check;
-  SfiProxy       janitor;
   const char    *process;
   guint          pid;
   guint          n_msg_bits;


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