open un-writable sessions without complaining, and desensitize all/most actions that...
[ardour.git] / gtk2_ardour / route_params_ui.cc
1 /*
2     Copyright (C) 2000 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include <algorithm>
21
22 #include <glibmm/thread.h>
23 #include <gtkmm2ext/utils.h>
24 #include <gtkmm2ext/stop_signal.h>
25 #include <gtkmm2ext/window_title.h>
26
27 #include <ardour/session.h>
28 #include <ardour/session_route.h>
29 #include <ardour/audio_diskstream.h>
30 #include <ardour/plugin.h>
31 #include <ardour/plugin_manager.h>
32 #include <ardour/ardour.h>
33 #include <ardour/session.h>
34 #include <ardour/route.h>
35 #include <ardour/audio_track.h>
36 #include <ardour/send.h>
37 #include <ardour/insert.h>
38 #include <ardour/connection.h>
39 #include <ardour/session_connection.h>
40
41 #include "route_params_ui.h"
42 #include "keyboard.h"
43 #include "mixer_strip.h"
44 #include "plugin_selector.h"
45 #include "ardour_ui.h"
46 #include "plugin_ui.h"
47 #include "io_selector.h"
48 #include "send_ui.h"
49 #include "utils.h"
50 #include "gui_thread.h"
51
52 #include "i18n.h"
53
54 using namespace ARDOUR;
55 using namespace PBD;
56 using namespace Gtk;
57 using namespace Gtkmm2ext;
58 using namespace sigc;
59
60 RouteParams_UI::RouteParams_UI ()
61         : ArdourDialog ("track/bus inspector"),
62           track_menu(0)
63 {
64         pre_redirect_box = 0;
65         post_redirect_box = 0;
66         _input_iosel = 0;
67         _output_iosel = 0;
68         _active_pre_view = 0;
69         _active_post_view = 0;
70         
71         using namespace Notebook_Helpers;
72
73         input_frame.set_shadow_type(Gtk::SHADOW_NONE);
74         output_frame.set_shadow_type(Gtk::SHADOW_NONE);
75         
76         notebook.set_show_tabs (true);
77         notebook.set_show_border (true);
78         notebook.set_name ("RouteParamNotebook");
79
80         // create the tree model
81         route_display_model = ListStore::create(route_display_columns);
82
83         // setup the treeview
84         route_display.set_model(route_display_model);
85         route_display.append_column(_("Tracks/Buses"), route_display_columns.text);
86         route_display.set_name(X_("RouteParamsListDisplay"));
87         route_display.get_selection()->set_mode(Gtk::SELECTION_SINGLE); // default
88         route_display.set_reorderable(false);
89         route_display.set_size_request(75, -1);
90         route_display.set_headers_visible(true);
91         route_display.set_headers_clickable(true);
92
93         route_select_scroller.add(route_display);
94         route_select_scroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
95
96
97         route_select_frame.set_name("RouteSelectBaseFrame");
98         route_select_frame.set_shadow_type (Gtk::SHADOW_IN);
99         route_select_frame.add(route_select_scroller);
100
101         list_vpacker.pack_start (route_select_frame, true, true);
102         
103         notebook.pages().push_back (TabElem (input_frame, _("Inputs")));
104         notebook.pages().push_back (TabElem (output_frame, _("Outputs")));
105         notebook.pages().push_back (TabElem (pre_redir_hpane, _("Pre-fader Redirects")));
106         notebook.pages().push_back (TabElem (post_redir_hpane, _("Post-fader Redirects")));
107
108         notebook.set_name ("InspectorNotebook");
109         
110         title_label.set_name ("RouteParamsTitleLabel");
111         update_title();
112         
113         // changeable area
114         route_param_frame.set_name("RouteParamsBaseFrame");
115         route_param_frame.set_shadow_type (Gtk::SHADOW_IN);
116         
117         
118         route_hpacker.pack_start (notebook, true, true);
119         
120         
121         route_vpacker.pack_start (title_label, false, false);
122         route_vpacker.pack_start (route_hpacker, true, true);
123
124         
125         list_hpane.pack1 (list_vpacker);
126         list_hpane.add2 (route_vpacker);
127
128         list_hpane.set_position(110);
129
130         pre_redir_hpane.set_position(110);
131         post_redir_hpane.set_position(110);
132         
133         //global_vpacker.pack_start (list_hpane, true, true);
134         //get_vbox()->pack_start (global_vpacker);
135         get_vbox()->pack_start (list_hpane);
136         
137         
138         set_name ("RouteParamsWindow");
139         set_default_size (620,370);
140         set_wmclass (X_("ardour_route_parameters"), "Ardour");
141
142         WindowTitle title(Glib::get_application_name());
143         title += _("Track/Bus Inspector"); 
144         set_title (title.get_string());
145
146         // events
147         route_display.get_selection()->signal_changed().connect(mem_fun(*this, &RouteParams_UI::route_selected));
148         route_display.get_column(0)->signal_clicked().connect(mem_fun(*this, &RouteParams_UI::show_track_menu));
149
150         add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK);
151         
152         _plugin_selector = new PluginSelector (PluginManager::the_manager());
153         _plugin_selector->signal_delete_event().connect (bind (ptr_fun (just_hide_it), 
154                                                      static_cast<Window *> (_plugin_selector)));
155
156
157         signal_delete_event().connect(bind(ptr_fun(just_hide_it), static_cast<Gtk::Window *>(this)));
158 }
159
160 RouteParams_UI::~RouteParams_UI ()
161 {
162 }
163
164 void
165 RouteParams_UI::add_routes (Session::RouteList& routes)
166 {
167         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::add_routes), routes));
168         
169         for (Session::RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
170                 boost::shared_ptr<Route> route = (*x);
171
172                 if (route->hidden()) {
173                         return;
174                 }
175                 
176                 TreeModel::Row row = *(route_display_model->append());
177                 row[route_display_columns.text] = route->name();
178                 row[route_display_columns.route] = route;
179                 
180                 //route_select_list.rows().back().select ();
181                 
182                 route->name_changed.connect (bind (mem_fun(*this, &RouteParams_UI::route_name_changed), route));
183                 route->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
184         }
185 }
186
187
188 void
189 RouteParams_UI::route_name_changed (void *src, boost::shared_ptr<Route> route)
190 {
191         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_name_changed), src, route));
192
193         bool found = false ;
194         TreeModel::Children rows = route_display_model->children();
195         for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
196                 boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
197                 if (r == route) {
198                         (*iter)[route_display_columns.text] = route->name() ;
199                         found = true ;
200                         break;
201                 }
202         }
203
204         if(!found) {
205                 error << _("route display list item for renamed route not found!") << endmsg;
206         }
207
208         if (route == _route) {
209                 track_input_label.set_text (route->name());
210                 update_title();
211         }
212 }
213
214 void
215 RouteParams_UI::setup_redirect_boxes()
216 {
217         if (session && _route) {
218
219                 // just in case... shouldn't need this
220                 cleanup_redirect_boxes();
221                 
222                 // construct new redirect boxes
223                 pre_redirect_box = new RedirectBox(PreFader, *session, *_plugin_selector, _rr_selection);
224                 post_redirect_box = new RedirectBox(PostFader, *session, *_plugin_selector, _rr_selection);
225
226                 pre_redirect_box->set_route (_route);
227                 post_redirect_box->set_route (_route);
228
229                 pre_redir_hpane.pack1 (*pre_redirect_box);
230                 post_redir_hpane.pack1 (*post_redirect_box);
231
232                 pre_redirect_box->RedirectSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader));
233                 pre_redirect_box->RedirectUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PreFader));
234                 post_redirect_box->RedirectSelected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader));
235                 post_redirect_box->RedirectUnselected.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_selected), PostFader));
236
237                 pre_redir_hpane.show_all();
238                 post_redir_hpane.show_all();
239         }
240         
241 }
242
243 void
244 RouteParams_UI::cleanup_redirect_boxes()
245 {
246         if (pre_redirect_box) {
247                 pre_redir_hpane.remove(*pre_redirect_box);
248                 delete pre_redirect_box;
249                 pre_redirect_box = 0;
250         }
251
252         if (post_redirect_box) {
253                 post_redir_hpane.remove(*post_redirect_box);
254                 delete post_redirect_box;
255                 post_redirect_box = 0;
256         }
257 }
258
259 void
260 RouteParams_UI::setup_io_frames()
261 {
262         cleanup_io_frames();
263         
264         // input
265         _input_iosel = new IOSelector (*session, _route, true);
266         _input_iosel->redisplay ();
267         input_frame.add (*_input_iosel);
268         input_frame.show_all();
269         
270         // output
271         _output_iosel = new IOSelector (*session, _route, false);
272         _output_iosel->redisplay ();
273         output_frame.add (*_output_iosel);
274         output_frame.show_all();
275 }
276
277 void
278 RouteParams_UI::cleanup_io_frames()
279 {
280         if (_input_iosel) {
281                 _input_iosel->Finished (IOSelector::Cancelled);
282                 input_frame.remove();
283                 delete _input_iosel;
284                 _input_iosel = 0;
285         }
286
287         if (_output_iosel) {
288                 _output_iosel->Finished (IOSelector::Cancelled);
289
290                 output_frame.remove();
291                 delete _output_iosel;
292                 _output_iosel = 0;
293         }
294 }
295
296 void
297 RouteParams_UI::cleanup_pre_view (bool stopupdate)
298 {
299         if (_active_pre_view) {
300                 GenericPluginUI *   plugui = 0;
301                 
302                 if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_pre_view)) != 0) {
303                           plugui->stop_updating (0);
304                 }
305
306                 _pre_plugin_conn.disconnect();
307                 pre_redir_hpane.remove(*_active_pre_view);
308                 delete _active_pre_view;
309                 _active_pre_view = 0;
310         }
311 }
312
313 void
314 RouteParams_UI::cleanup_post_view (bool stopupdate)
315 {
316         if (_active_post_view) {
317                 GenericPluginUI *   plugui = 0;
318                 
319                 if (stopupdate && (plugui = dynamic_cast<GenericPluginUI*>(_active_post_view)) != 0) {
320                           plugui->stop_updating (0);
321                 }
322                 _post_plugin_conn.disconnect();
323                 post_redir_hpane.remove(*_active_post_view);
324                 delete _active_post_view;
325                 _active_post_view = 0;
326         }
327 }
328
329
330 void
331 RouteParams_UI::route_removed (boost::shared_ptr<Route> route)
332 {
333         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
334
335         TreeModel::Children rows = route_display_model->children();
336         TreeModel::Children::iterator ri;
337
338         for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
339                 boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
340
341                 if (r == route) {
342                         route_display_model->erase(iter);
343                         break;
344                 }
345         }
346
347         if (route == _route) {
348                 cleanup_io_frames();
349                 cleanup_pre_view();
350                 cleanup_post_view();
351                 cleanup_redirect_boxes();
352                 
353                 _route.reset ((Route*) 0);
354                 _pre_redirect.reset ((Redirect*) 0);
355                 _post_redirect.reset ((Redirect*) 0);
356                 update_title();
357         }
358 }
359
360 void
361 RouteParams_UI::set_session (Session *sess)
362 {
363         ArdourDialog::set_session (sess);
364
365         route_display_model->clear();
366
367         if (session) {
368                 boost::shared_ptr<Session::RouteList> r = session->get_routes();
369                 add_routes (*r);
370                 session->GoingAway.connect (mem_fun(*this, &ArdourDialog::session_gone));
371                 session->RouteAdded.connect (mem_fun(*this, &RouteParams_UI::add_routes));
372                 start_updating ();
373         } else {
374                 stop_updating ();
375         }
376
377         //route_select_list.thaw ();
378
379         _plugin_selector->set_session (session);
380 }       
381
382
383 void
384 RouteParams_UI::session_gone ()
385 {
386         ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::session_gone));
387
388         route_display_model->clear();
389
390         cleanup_io_frames();
391         cleanup_pre_view();
392         cleanup_post_view();
393         cleanup_redirect_boxes();
394
395         _route.reset ((Route*) 0);
396         _pre_redirect.reset ((Redirect*) 0);
397         _post_redirect.reset ((Redirect*) 0);
398         update_title();
399
400         ArdourDialog::session_gone();
401
402 }
403
404 void
405 RouteParams_UI::route_selected()
406 {
407         Glib::RefPtr<TreeSelection> selection = route_display.get_selection();
408         TreeModel::iterator iter = selection->get_selected(); // only used with Gtk::SELECTION_SINGLE
409         if(iter) {
410                 //If anything is selected
411                 boost::shared_ptr<Route> route = (*iter)[route_display_columns.route] ;
412
413                 if (_route == route) {
414                         // do nothing
415                         return;
416                 }
417
418                 // remove event binding from previously selected
419                 if (_route) {
420                         _route_conn.disconnect();
421                         _route_ds_conn.disconnect();
422                         cleanup_redirect_boxes();
423                         cleanup_pre_view();
424                         cleanup_post_view();
425                         cleanup_io_frames();
426                 }
427
428                 // update the other panes with the correct info
429                 _route = route;
430                 //update_routeinfo (route);
431
432                 setup_io_frames();
433                 setup_redirect_boxes();
434
435                 // bind to redirects changed event for this route
436                 _route_conn = route->redirects_changed.connect (mem_fun(*this, &RouteParams_UI::redirects_changed));
437
438                 track_input_label.set_text (_route->name());
439
440                 update_title();
441         } else {
442                 // no selection
443                 if (_route) {
444                         _route_conn.disconnect();
445
446                         // remove from view
447                         cleanup_io_frames();
448                         cleanup_pre_view();
449                         cleanup_post_view();
450                         cleanup_redirect_boxes();
451
452                         _route.reset ((Route*) 0);
453                         _pre_redirect.reset ((Redirect*) 0);
454                         _post_redirect.reset ((Redirect *) 0);
455                         track_input_label.set_text(_("NO TRACK"));
456                         update_title();
457                 }
458         }
459 }
460
461 //void
462 //RouteParams_UI::route_unselected (gint row, gint col, GdkEvent *ev)
463 //{
464 //      if (_route) {
465 //              _route_conn.disconnect();
466
467                 // remove from view
468 //              cleanup_io_frames();
469 //              cleanup_pre_view();
470 //              cleanup_post_view();
471 //              cleanup_redirect_boxes();
472                 
473 //              _route.reset ((Route*)0);
474 //              _pre_redirect = 0;
475 //              _post_redirect = 0;
476 //              track_input_label.set_text(_("NO TRACK"));
477 //              update_title();
478 //      }
479 //}
480
481 void
482 RouteParams_UI::redirects_changed (void *src)
483
484 {
485         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirects_changed), src));
486         
487 //      pre_redirect_list.freeze ();
488 //      pre_redirect_list.clear ();
489 //      post_redirect_list.freeze ();
490 //      post_redirect_list.clear ();
491 //      if (_route) {
492 //              _route->foreach_redirect (this, &RouteParams_UI::add_redirect_to_display);
493 //      }
494 //      pre_redirect_list.thaw ();
495 //      post_redirect_list.thaw ();
496
497         cleanup_pre_view();
498         cleanup_post_view();
499         
500         _pre_redirect.reset ((Redirect*) 0);
501         _post_redirect.reset ((Redirect*) 0);
502         //update_title();
503 }
504
505
506
507 void
508 RouteParams_UI::show_track_menu()
509 {
510         using namespace Menu_Helpers;
511         
512         if (track_menu == 0) {
513                 track_menu = new Menu;
514                 track_menu->set_name ("ArdourContextMenu");
515                 track_menu->items().push_back 
516                                 (MenuElem (_("Add Track/Bus"), 
517                                            bind (mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::add_route), (Gtk::Window*) 0)));
518         }
519         track_menu->popup (1, gtk_get_current_event_time());
520 }
521
522
523
524 void
525 RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Redirect> redirect, ARDOUR::Placement place)
526 {
527         boost::shared_ptr<Insert> insert;
528
529         if ((place == PreFader && _pre_redirect == redirect)
530             || (place == PostFader && _post_redirect == redirect)){
531                 return;
532         }
533         
534         if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) {
535
536                 boost::shared_ptr<Send> send;
537                 
538                 if ((send = boost::dynamic_pointer_cast<Send> (redirect)) != 0) {
539
540                         /* its a send */
541
542                         SendUI *send_ui = new SendUI (send, *session);
543
544                         if (place == PreFader) {
545                                 cleanup_pre_view();
546                                 _pre_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
547                                 _active_pre_view = send_ui;
548                                 
549                                 pre_redir_hpane.add2 (*_active_pre_view);
550                                 pre_redir_hpane.show_all();
551                         }
552                         else {
553                                 cleanup_post_view();
554                                 _post_plugin_conn = send->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
555                                 _active_post_view = send_ui;
556                                 
557                                 post_redir_hpane.add2 (*_active_post_view);
558                                 post_redir_hpane.show_all();
559                         }
560                 }
561
562         } else {
563                 /* its an insert, though we don't know what kind yet. */
564
565                 boost::shared_ptr<PluginInsert> plugin_insert;
566                 boost::shared_ptr<PortInsert> port_insert;
567                                 
568                 if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {                                
569
570                         GenericPluginUI *plugin_ui = new GenericPluginUI (plugin_insert, true);
571
572                         if (place == PreFader) {
573                                 cleanup_pre_view();
574                                 _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
575                                 plugin_ui->start_updating (0);
576                                 _active_pre_view = plugin_ui;
577                                 pre_redir_hpane.pack2 (*_active_pre_view);
578                                 pre_redir_hpane.show_all();
579                         }
580                         else {
581                                 cleanup_post_view();
582                                 _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
583                                 plugin_ui->start_updating (0);
584                                 _active_post_view = plugin_ui;
585                                 post_redir_hpane.pack2 (*_active_post_view);
586                                 post_redir_hpane.show_all();
587                         }
588
589                 } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) {
590
591                         PortInsertUI *portinsert_ui = new PortInsertUI (*session, port_insert);
592                                         
593                         if (place == PreFader) {
594                                 cleanup_pre_view();
595                                 _pre_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
596                                 _active_pre_view = portinsert_ui;
597                                 pre_redir_hpane.pack2 (*_active_pre_view);
598                                 portinsert_ui->redisplay();
599                                 pre_redir_hpane.show_all();
600                         }
601                         else {
602                                 cleanup_post_view();
603                                 _post_plugin_conn = port_insert->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
604                                 _active_post_view = portinsert_ui;
605                                 post_redir_hpane.pack2 (*_active_post_view);
606                                 portinsert_ui->redisplay();
607                                 post_redir_hpane.show_all();
608                         }
609                 }
610                                 
611         }
612
613         if (place == PreFader) {
614                 _pre_redirect = redirect;
615         } else {
616                 _post_redirect = redirect;
617         }
618         
619         update_title();
620                 
621 }
622
623 void
624 RouteParams_UI::plugin_going_away (Placement place)
625 {
626         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), place));
627         
628         // delete the current view without calling finish
629
630         if (place == PreFader) {
631                 cleanup_pre_view (false);
632                 _pre_redirect.reset ((Redirect*) 0);
633         }
634         else {
635                 cleanup_post_view (false);
636                 _post_redirect.reset ((Redirect*) 0);
637         }
638 }
639
640 void
641 RouteParams_UI::redirect_going_away (boost::shared_ptr<ARDOUR::Redirect> redirect)
642
643 {
644         ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::redirect_going_away), redirect));
645         
646         printf ("redirect going away\n");
647         // delete the current view without calling finish
648         if (redirect == _pre_redirect) {
649                 cleanup_pre_view (false);
650                 _pre_redirect.reset ((Redirect*) 0);
651         } else if (redirect == _post_redirect) {
652                 cleanup_post_view (false);
653                 _post_redirect.reset ((Redirect*) 0);
654         }
655 }
656
657
658 void
659 RouteParams_UI::update_title ()
660 {
661         WindowTitle title(Glib::get_application_name());
662         title += _("Track/Bus Inspector");
663
664         if (_route) {
665
666                 //              title += ": ";
667
668                 //              if (_redirect && (_current_view == PLUGIN_CONFIG_VIEW || _current_view == SEND_CONFIG_VIEW)) {
669                 //                      title += _redirect->name();
670                 //              }
671                 //              else if (_current_view == INPUT_CONFIG_VIEW) {
672                 //                      title += _("INPUT");
673                 //              }
674                 //              else if (_current_view == OUTPUT_CONFIG_VIEW) {
675                 //                      title += _("OUTPUT");
676                 //              }
677
678                 title_label.set_text(_route->name());
679                 
680                 title += _route->name();
681
682                 set_title(title.get_string());
683         }
684         else {
685                 title_label.set_text(_("No Route Selected"));
686                 title += _("No Route Selected");
687                 set_title(title.get_string());
688         }       
689 }
690
691
692 void
693 RouteParams_UI::start_updating ()
694 {
695         update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect 
696                 (mem_fun(*this, &RouteParams_UI::update_views));
697 }
698
699 void
700 RouteParams_UI::stop_updating ()
701 {
702         update_connection.disconnect();
703 }
704
705 void
706 RouteParams_UI::update_views ()
707 {
708         SendUI *sui;
709         // TODO: only do it if correct tab is showing
710         
711         if ((sui = dynamic_cast<SendUI*> (_active_pre_view)) != 0) {
712                 sui->update ();
713         }
714         if ((sui = dynamic_cast<SendUI*> (_active_post_view)) != 0) {
715                 sui->update ();
716         }
717
718 }