Commit 25b6bb3a authored by Murray Cumming's avatar Murray Cumming
Browse files

Don't use static members for simple constants.

parent d02a2e8b
......@@ -30,17 +30,17 @@
namespace Glom
{
const Glib::ustring Notebook_Data::m_pagename_details = "details";
const Glib::ustring Notebook_Data::m_pagename_list = "list";
constexpr auto PAGENAME_DETAILS= "details";
constexpr auto PAGENAME_LIST = "list";
Notebook_Data::Notebook_Data()
{
//Add Pages:
//Translators: This is a noun. It is a notebook tab title.
append_page(m_Box_List, m_pagename_list, _("List"));
append_page(m_Box_List, PAGENAME_LIST, _("List"));
//Translators: This is a noun. It is a notebook tab title.
append_page(m_Box_Details, m_pagename_details, _("Details"));
append_page(m_Box_Details, PAGENAME_DETAILS, _("Details"));
// Set accessible name for the notebook, to be able to access it via LDTP
#ifdef GTKMM_ATKMM_ENABLED
......@@ -271,20 +271,20 @@ FoundSet Notebook_Data::get_found_set_selected() const
void Notebook_Data::set_current_view(dataview view)
{
if(view == dataview::LIST)
set_visible_child(m_pagename_list);
set_visible_child(PAGENAME_LIST);
else
set_visible_child(m_pagename_details);
set_visible_child(PAGENAME_DETAILS);
}
void Notebook_Data::select_page_for_find_results()
{
if(m_Box_List.get_showing_multiple_records())
{
set_visible_child(m_pagename_list);
set_visible_child(PAGENAME_LIST);
}
else
{
set_visible_child(m_pagename_details);
set_visible_child(PAGENAME_DETAILS);
}
}
......@@ -330,7 +330,7 @@ Notebook_Data::dataview Notebook_Data::get_current_view() const
const auto current_page = get_visible_child_name();
dataview result = dataview::DETAILS;
if(current_page == m_pagename_list)
if(current_page == PAGENAME_LIST)
result = dataview::LIST;
return result;
......
......@@ -101,7 +101,6 @@ protected:
Box_Data_List m_Box_List;
Box_Data_Details m_Box_Details;
static const Glib::ustring m_pagename_details, m_pagename_list;
Glib::ustring m_table_name;
type_signal_record_details_requested m_signal_record_details_requested;
......
......@@ -25,19 +25,19 @@
namespace Glom
{
const Glib::ustring Notebook_Find::m_pagename_details = "details";
const Glib::ustring Notebook_Find::m_pagename_list = "list";
constexpr auto PAGENAME_DETAILS = "details";
constexpr auto PAGENAME_LIST = "list";
Notebook_Find::Notebook_Find()
{
append_page(m_Box_List, m_pagename_list, _("List"));
append_page(m_Box_List, PAGENAME_LIST, _("List"));
//Fill composite view:
add_view(&m_Box_List);
append_page(m_Box_Details, m_pagename_details, _("Details"));
append_page(m_Box_Details, PAGENAME_DETAILS, _("Details"));
set_visible_child(m_pagename_details); //Show the details page by default. It's more obvious for a Find.
set_visible_child(PAGENAME_DETAILS); //Show the details page by default. It's more obvious for a Find.
//TODO: Show the same layout that is being edited at the time that the mode was changed.
//Connect Signals:
......@@ -71,9 +71,9 @@ bool Notebook_Find::init_db_details(const Glib::ustring& table_name, const Glib:
void Notebook_Find::set_current_view(Notebook_Data::dataview view)
{
if(view == Notebook_Data::dataview::LIST)
set_visible_child(m_pagename_list);
set_visible_child(PAGENAME_LIST);
else
set_visible_child(m_pagename_details);
set_visible_child(PAGENAME_DETAILS);
}
} //namespace Glom
......@@ -46,8 +46,6 @@ public:
private:
static const Glib::ustring m_pagename_details, m_pagename_list;
//Member widgets:
Box_Data_List_Find m_Box_List;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment