[gst-debugger/refactor-v1.0] refactor: minors
- From: Marcin Kolny <mkolny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gst-debugger/refactor-v1.0] refactor: minors
- Date: Sat, 3 Oct 2015 10:09:10 +0000 (UTC)
commit b5119d693796890c7876b36c539c15a10221467d
Author: Marcin Kolny <marcin kolny gmail com>
Date: Sat Oct 3 12:08:58 2015 +0200
refactor: minors
src/gst-debugger/controller/controller.cpp | 2 --
src/gst-debugger/controller/controller.h | 1 -
src/gst-debugger/gvalue-converter/gvalue_enum.cpp | 6 +++++-
src/gst-debugger/gvalue-converter/gvalue_enum.h | 2 ++
src/gst-debugger/gvalue-converter/gvalue_flags.cpp | 4 ++--
src/gst-debugger/gvalue-converter/gvalue_flags.h | 2 +-
6 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/gst-debugger/controller/controller.cpp b/src/gst-debugger/controller/controller.cpp
index 5159383..3b2cd3a 100644
--- a/src/gst-debugger/controller/controller.cpp
+++ b/src/gst-debugger/controller/controller.cpp
@@ -294,8 +294,6 @@ void Controller::log(const std::string &message)
{
// todo date/time?
std::cerr << message << std::endl;
-
- //on_new_log_entry(message);
}
void Controller::client_disconnected()
diff --git a/src/gst-debugger/controller/controller.h b/src/gst-debugger/controller/controller.h
index a91b176..dc062a8 100644
--- a/src/gst-debugger/controller/controller.h
+++ b/src/gst-debugger/controller/controller.h
@@ -87,7 +87,6 @@ public:
sigc::signal<void, std::shared_ptr<ElementModel>> on_model_changed;
sigc::signal<void, const GstDebugger::PropertyValue&> on_property_value_received;
sigc::signal<void> on_selected_object_changed;
-/* sigc::signal<void, const Glib::ustring&> on_new_log_entry;*/
};
#endif /* SRC_GST_DEBUGGER_CONTROLLER_CONTROLLER_H_ */
diff --git a/src/gst-debugger/gvalue-converter/gvalue_enum.cpp
b/src/gst-debugger/gvalue-converter/gvalue_enum.cpp
index 856facf..b51f630 100644
--- a/src/gst-debugger/gvalue-converter/gvalue_enum.cpp
+++ b/src/gst-debugger/gvalue-converter/gvalue_enum.cpp
@@ -43,9 +43,11 @@ Gtk::Widget* GValueEnum::create_widget()
{
Gtk::ComboBoxText *widget = new Gtk::ComboBoxText();
widget->signal_changed().connect([this, widget]{
+ if (!emit_m.try_lock()) return;
g_value_set_enum(g_value, gtk_combo_box_get_active(GTK_COMBO_BOX(widget->gobj())));
+ widget_value_changed();
+ emit_m.unlock();
});
- widget->signal_changed().connect(widget_value_changed);
for (auto entry : type.get().get_values())
{
@@ -70,7 +72,9 @@ void GValueEnum::update_widget(Gtk::Widget* widget)
{
if (entry.first == value)
{
+ emit_m.lock();
dynamic_cast<Gtk::ComboBoxText*>(widget)->set_active(pos);
+ emit_m.unlock();
break;
}
pos++;
diff --git a/src/gst-debugger/gvalue-converter/gvalue_enum.h b/src/gst-debugger/gvalue-converter/gvalue_enum.h
index 1e334c9..469ca00 100644
--- a/src/gst-debugger/gvalue-converter/gvalue_enum.h
+++ b/src/gst-debugger/gvalue-converter/gvalue_enum.h
@@ -14,12 +14,14 @@
#include <boost/optional/optional.hpp>
+#include <mutex>
#include <vector>
#include <utility>
class GValueEnum : public GValueBase
{
boost::optional<GstEnumType> type;
+ std::mutex emit_m;
Gtk::Widget* create_widget() override;
diff --git a/src/gst-debugger/gvalue-converter/gvalue_flags.cpp
b/src/gst-debugger/gvalue-converter/gvalue_flags.cpp
index 3fb004f..84bee6a 100644
--- a/src/gst-debugger/gvalue-converter/gvalue_flags.cpp
+++ b/src/gst-debugger/gvalue-converter/gvalue_flags.cpp
@@ -43,7 +43,7 @@ Gtk::Widget* GValueFlags::create_widget()
if (type)
{
auto widget = new Gtk::ScrolledWindow();
- Gtk::Viewport *vp = Gtk::manage(new Gtk::Viewport(Gtk::Adjustment::create(10, 0, 20),
Gtk::Adjustment::create(10, 0, 50)));
+ Gtk::Viewport *vp = Gtk::manage(new Gtk::Viewport(Gtk::Adjustment::create(30, 0, 20),
Gtk::Adjustment::create(10, 0, 50)));
Gtk::Box *box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
for (auto val : type->get_values())
{
@@ -61,7 +61,7 @@ Gtk::Widget* GValueFlags::create_widget()
cb->set_data("flags-data-value", GINT_TO_POINTER(val.first));
box->pack_start(*cb, false, 5);
}
- update_widget(widget);
+
vp->add(*box);
widget->add(*vp);
widget->show_all();
diff --git a/src/gst-debugger/gvalue-converter/gvalue_flags.h
b/src/gst-debugger/gvalue-converter/gvalue_flags.h
index 33f25a9..0b268bc 100644
--- a/src/gst-debugger/gvalue-converter/gvalue_flags.h
+++ b/src/gst-debugger/gvalue-converter/gvalue_flags.h
@@ -13,8 +13,8 @@
#include "../models/gst_enum_model.h"
#include <boost/optional/optional.hpp>
-#include <mutex>
+#include <mutex>
#include <vector>
#include <utility>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]