#include <gtkmm2ext/popup.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/window_title.h>
+#include <gtkmm2ext/actions.h>
#include "i18n.h"
send_request (req);
}
+void
+UI::set_tip (Widget &w, const gchar *tip)
+{
+ set_tip(&w, tip, "");
+}
+
+void
+UI::set_tip (Widget &w, const std::string& tip)
+{
+ set_tip(&w, tip.c_str(), "");
+}
+
void
UI::set_tip (Widget *w, const gchar *tip, const gchar *hlp)
{
UIRequest *req = get_request (SetTip);
+ std::string msg(tip);
+
+ Glib::RefPtr<Gtk::Action> action = w->get_action();
+ if (action) {
+ Gtk::AccelKey key;
+ bool has_key = ActionManager::lookup_entry(action->get_accel_path(), key);
+ if (has_key && key.get_abbrev() != "") {
+ msg.append("\n\n Key: ").append(key.get_abbrev());
+ }
+ }
+
if (req == 0) {
return;
}
req->widget = w;
- req->msg = tip;
+ req->msg = msg.c_str();
req->msg2 = hlp;
send_request (req);
/* END abstract_ui interfaces */
+/** Create a PBD::EventLoop::InvalidationRecord and attach a callback
+ * to a given sigc::trackable so that PBD::EventLoop::invalidate_request
+ * is called when that trackable is destroyed.
+ */
+PBD::EventLoop::InvalidationRecord*
+__invalidator (sigc::trackable& trackable, const char* file, int line)
+{
+ PBD::EventLoop::InvalidationRecord* ir = new PBD::EventLoop::InvalidationRecord;
+
+ ir->file = file;
+ ir->line = line;
+
+ trackable.add_destroy_notify_callback (ir, PBD::EventLoop::invalidate_request);
+
+ return ir;
+}
+
void
UI::do_request (UIRequest* req)
{
do_quit ();
} else if (req->type == CallSlot) {
-
+#ifndef NDEBUG
+ if (getenv ("DEBUG_THREADED_SIGNALS")) {
+ cerr << "call slot for " << name() << endl;
+ }
+#endif
req->the_slot ();
} else if (req->type == TouchDisplay) {
}
void
-UI::popup_error (const char *text)
+UI::popup_error (const string& text)
{
PopUp *pup;