Commit 2d1e5b38 authored by Murray Cumming's avatar Murray Cumming
Browse files

Hide header box (table title and mode) and started to use picker for table navigation

parent 317c283b
......@@ -100,8 +100,6 @@ glom_glom_SOURCES = \
glom/mode_find/box_data_list_find.h \
glom/mode_find/notebook_find.cc \
glom/mode_find/notebook_find.h \
glom/navigation/box_tables.cc \
glom/navigation/box_tables.h \
glom/print_layout/canvas_layout_item.cc \
glom/print_layout/canvas_layout_item.h \
glom/print_layout/canvas_print_layout.cc \
......@@ -335,6 +333,16 @@ glom_glom_SOURCES += \
glom/utility_widgets/sidebar.h
endif
if !GLOM_ENABLE_MAEMO
glom_glom_SOURCES += \
glom/navigation/box_tables.cc \
glom/navigation/box_tables.h
else
glom_glom_SOURCES += \
glom/navigation/maemo/pickerbutton_table.cc \
glom/navigation/maemo/pickerbutton_table.h
endif
glom_glom_LDADD = $(win_resfile) \
glom/utility_widgets/egg/toolpalette/libeggtoolpalette.a \
glom/utility_widgets/egg/util/libeggutil.a \
......
......@@ -771,11 +771,9 @@ Base_DB::type_vec_fields Base_DB::get_fields_for_table_from_database(const Glib:
field->set_field_info(field_info);
//Get whether it is a primary key:
#ifndef GLOM_ENABLE_MAEMO // TODO
//Get whether it is a primary key:
field->set_primary_key(
meta_table_column_is_primary_key(meta_table, field_info->get_name()) );
#endif
meta_table_column_is_primary_key(meta_table, field_info->get_name()) );
#if 0 // This was with libgda-3.0:
......
......@@ -78,6 +78,7 @@ namespace Glom
Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
: PlaceHolder(cobject, builder),
m_pLabel_Table(0),
m_box_header(0),
m_box_footer(0),
m_pLabel_Mode(0),
m_pLabel_userlevel(0),
......@@ -89,8 +90,10 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
m_pLabel_FoundCount(0),
m_pButton_FindAll(0),
m_pBox_Mode(0),
#ifndef GLOM_ENABLE_MAEMO
m_pBox_Tables(0),
m_pDialog_Tables(0),
#endif //GLOM_ENABLE_MAEMO
#ifndef GLOM_ENABLE_CLIENT_ONLY
m_pDialog_Reports(0),
m_pDialogLayoutReport(0),
......@@ -111,13 +114,15 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
//Load widgets from glade file:
builder->get_widget("label_table_name", m_pLabel_Table);
builder->get_widget("hbox_header", m_box_header);
builder->get_widget("hbox_footer", m_box_footer);
builder->get_widget("label_mode", m_pLabel_Mode);
builder->get_widget("label_user_level", m_pLabel_userlevel);
//Hide the footer on maemo (It takes too much space),
//Hide unnecessary widgets on maemo that take too much space,
//and reduce the border width:
#ifdef GLOM_ENABLE_MAEMO
m_box_header->hide();
m_box_footer->hide();
set_border_width(Glom::Utils::DEFAULT_SPACING_LARGE);
#endif
......@@ -163,17 +168,20 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
Frame_Glom::~Frame_Glom()
{
#ifndef GLOM_ENABLE_MAEMO
if(m_pBox_Tables)
remove_view(m_pBox_Tables);
remove_view(&m_Notebook_Data); //Also a composite view.
remove_view(&m_Notebook_Find); //Also a composite view.
if(m_pDialog_Tables)
{
delete m_pDialog_Tables;
m_pDialog_Tables = 0;
}
#endif //GLOM_ENABLE_MAEMO
remove_view(&m_Notebook_Data); //Also a composite view.
remove_view(&m_Notebook_Find); //Also a composite view.
if(m_pDialogConnection)
{
......@@ -263,6 +271,7 @@ void Frame_Glom::set_databases_selected(const Glib::ustring& strName)
do_menu_Navigate_Table(true /* open default */);
}
#ifndef GLOM_ENABLE_MAEMO
void Frame_Glom::on_box_tables_selected(const Glib::ustring& strName)
{
if(m_pDialog_Tables)
......@@ -270,6 +279,7 @@ void Frame_Glom::on_box_tables_selected(const Glib::ustring& strName)
show_table(strName);
}
#endif //GLOM_ENABLE_MAEMO
void Frame_Glom::set_mode_widget(Gtk::Widget& widget)
{
......@@ -1285,6 +1295,7 @@ void Frame_Glom::do_menu_Navigate_Table(bool open_default)
if(open_default)
default_table_name = get_document()->get_default_table();
#ifndef GLOM_ENABLE_MAEMO
//Create the dialog, if it has not already been created:
if(!m_pBox_Tables)
{
......@@ -1309,6 +1320,7 @@ void Frame_Glom::do_menu_Navigate_Table(bool open_default)
BusyCursor busy_cursor(get_app_window());
m_pBox_Tables->init_db_details();
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
//Let the user choose a table:
//m_pDialog_Tables->set_policy(false, true, false); //TODO_port
......@@ -1320,8 +1332,13 @@ void Frame_Glom::do_menu_Navigate_Table(bool open_default)
}
else
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
m_pDialog_Tables->show();
#else
//For Maemo: TODO
#endif // !GLOM_ENABLE_CLIENT_ONLY
}
}
const Gtk::Window* Frame_Glom::get_app_window() const
......
......@@ -68,7 +68,10 @@ public:
void set_databases_selected(const Glib::ustring& strName);
#ifndef GLOM_ENABLE_MAEMO
void on_box_tables_selected(const Glib::ustring& strName);
#endif
#ifndef GLOM_ENABLE_CLIENT_ONLY
void on_box_reports_selected(const Glib::ustring& strName);
void on_box_print_layouts_selected(const Glib::ustring& strName);
......@@ -250,6 +253,7 @@ protected:
//Child widgets:
Gtk::Label* m_pLabel_Table;
Gtk::HBox* m_box_header;
Gtk::HBox* m_box_footer;
Gtk::Label* m_pLabel_Mode;
Gtk::Label* m_pLabel_userlevel;
......@@ -265,14 +269,15 @@ protected:
PlaceHolder* m_pBox_Mode; //Contains e.g. design mode notebook.
#ifndef GLOM_ENABLE_MAEMO
//Navigation:
Box_Tables* m_pBox_Tables;
Dialog_Glom* m_pDialog_Tables;
#endif //GLOM_ENABLE_MAEMO
Notebook_Data m_Notebook_Data;
Notebook_Find m_Notebook_Find;
//Navigation:
Dialog_Glom* m_pDialog_Tables;
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Developer:
Dialog_Glom* m_pDialog_Reports;
......
......@@ -974,7 +974,7 @@
<property name="border_width">12</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="hbox3">
<object class="GtkHBox" id="hbox_header">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
......
......@@ -178,7 +178,7 @@ bool Box_Data::confirm_discard_unstored_data() const
{
if(get_unstored_data())
{
Glib::ustring message = _("This data cannot be stored in the database because you have not provided a primary key.\nDo you really want to discard this data?");
const Glib::ustring message = _("This data cannot be stored in the database because you have not provided a primary key.\nDo you really want to discard this data?");
//Ask user to confirm loss of data:
#ifdef GLOM_ENABLE_MAEMO
//Hildon::Note dialog(Hildon::NOTE_TYPE_CONFIRMATION, *get_app_window(), message);
......
......@@ -282,11 +282,13 @@ Gnome::Gda::Value ImageGlom::get_value() const
return Gnome::Gda::Value();
}
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
bool ImageGlom::on_expose_event(GdkEventExpose* event)
{
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
const bool result = Gtk::EventBox::on_expose_event(event);
#else
bool ImageGlom::on_expose_event(GdkEventExpose* /* event */)
{
const bool result = false;
#endif // GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
scale();
......
Supports Markdown
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