[glom] More signal reemitting simplification.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] More signal reemitting simplification.
- Date: Mon, 12 Mar 2012 15:44:55 +0000 (UTC)
commit 951ca7ab3aae2b93baaadafe5911f562625fd7f7
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Mar 12 16:44:38 2012 +0100
More signal reemitting simplification.
glom/mode_data/notebook_data.cc | 16 ++--------------
glom/mode_data/notebook_data.h | 1 -
glom/mode_find/notebook_find.cc | 13 +++++--------
glom/mode_find/notebook_find.h | 4 ----
4 files changed, 7 insertions(+), 27 deletions(-)
---
diff --git a/glom/mode_data/notebook_data.cc b/glom/mode_data/notebook_data.cc
index b29a595..91eb2f7 100644
--- a/glom/mode_data/notebook_data.cc
+++ b/glom/mode_data/notebook_data.cc
@@ -19,6 +19,7 @@
*/
#include <glom/mode_data/notebook_data.h>
+#include <glom/signal_reemitter.h>
#include <libglom/data_structure/glomconversions.h>
#include <glibmm/main.h>
#include <glibmm/i18n.h>
@@ -92,7 +93,7 @@ Notebook_Data::Notebook_Data()
m_Box_Details.signal_record_deleted().connect(sigc::mem_fun(m_Box_List, &Box_Data_List::on_details_record_deleted));
//Allow Details to ask to show a different record in a different table:
- m_Box_Details.signal_requested_related_details().connect(sigc::mem_fun(*this, &Notebook_Data::on_details_user_requested_related_details));
+ signal_connect_for_reemit_2args(m_Box_Details.signal_requested_related_details(), m_signal_record_details_requested);
//Fill composite view:
@@ -250,19 +251,6 @@ void Notebook_Data::on_list_user_requested_details(const Gnome::Gda::Value& prim
primary_key_value));
}
-void Notebook_Data::on_details_user_requested_related_details(const Glib::ustring& table_name, Gnome::Gda::Value primary_key_value)
-{
- signal_record_details_requested().emit(table_name, primary_key_value);
-
- /*
- //Show a different table:
- init_db_details(m_table_name);
-
- //Show the specific record:
- on_list_user_requested_details(primary_key_value);
- */
-}
-
FoundSet Notebook_Data::get_found_set_selected() const
{
if(get_current_view() == DATA_VIEW_Details)
diff --git a/glom/mode_data/notebook_data.h b/glom/mode_data/notebook_data.h
index a9a6e61..fc2e428 100644
--- a/glom/mode_data/notebook_data.h
+++ b/glom/mode_data/notebook_data.h
@@ -92,7 +92,6 @@ protected:
//Signal handlers:
virtual void on_list_user_requested_details(const Gnome::Gda::Value& primary_key_value);
- void on_details_user_requested_related_details(const Glib::ustring& table_name, Gnome::Gda::Value primary_key_value);
virtual void on_switch_page_handler(Gtk::Widget* pPage, guint uiPageNumber);
diff --git a/glom/mode_find/notebook_find.cc b/glom/mode_find/notebook_find.cc
index 1f773e9..f9f89e7 100644
--- a/glom/mode_find/notebook_find.cc
+++ b/glom/mode_find/notebook_find.cc
@@ -19,6 +19,7 @@
*/
#include "notebook_find.h"
+#include <glom/signal_reemitter.h>
#include <glibmm/i18n.h>
namespace Glom
@@ -29,7 +30,6 @@ Notebook_Find::Notebook_Find()
m_iPage_List(0)
{
append_page(m_Box_List, _("List"));
- m_Box_List.signal_find_criteria.connect(sigc::mem_fun(*this, &Notebook_Find::on_page_find_criteria));
m_iPage_List = 0;
m_iPage_Details = 1;
@@ -42,7 +42,10 @@ Notebook_Find::Notebook_Find()
//TODO: Show the same layout that is being edited at the time that the mode was changed.
//Connect Signals:
- m_Box_Details.signal_find_criteria.connect(sigc::mem_fun(*this, &Notebook_Find::on_page_find_criteria));
+ //Pass it up to the application:
+ signal_connect_for_reemit_1arg(m_Box_List.signal_find_criteria, signal_find_criteria);
+ signal_connect_for_reemit_1arg(m_Box_Details.signal_find_criteria, signal_find_criteria);
+
add_view(&m_Box_Details);
@@ -68,12 +71,6 @@ bool Notebook_Find::init_db_details(const Glib::ustring& table_name, const Glib:
return result;
}
-void Notebook_Find::on_page_find_criteria(const Gnome::Gda::SqlExpr& where_clause)
-{
- //Pass it up to the application.
- signal_find_criteria.emit(where_clause);
-}
-
void Notebook_Find::set_current_view(Notebook_Data::dataview view)
{
if(view == Notebook_Data::DATA_VIEW_List)
diff --git a/glom/mode_find/notebook_find.h b/glom/mode_find/notebook_find.h
index a6375d2..1df1ed1 100644
--- a/glom/mode_find/notebook_find.h
+++ b/glom/mode_find/notebook_find.h
@@ -46,10 +46,6 @@ public:
private:
-
- //Signal handlers:
- void on_page_find_criteria(const Gnome::Gda::SqlExpr& where_clause);
-
//Member widgets:
Box_Data_List_Find m_Box_List;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]