Commit 8c93d13b authored by Johannes Schmid's avatar Johannes Schmid Committed by Johannes Schmid
Browse files

Fixed build with GLOM_ENABLE_CLIENT_ONLY

2008-07-17  Johannes Schmid  <johannes.schmid@openismus.com>

	* glom/application.cc:
	* glom/application.h:
	* glom/frame_glom.cc:
	* glom/frame_glom.h:
	* glom/layout_item_dialogs/dialog_buttonscript.h:
	* glom/mode_data/box_data_calendar_related.cc:
	* glom/mode_data/box_data_details.cc:
	* glom/mode_data/flowtablewithfields.cc:
	* glom/mode_data/flowtablewithfields.h:
	* glom/utility_widgets/buttonglom.cc:
	* glom/utility_widgets/buttonglom.h:
	* glom/utility_widgets/labelglom.cc:
	* glom/utility_widgets/labelglom.h:
	* glom/utility_widgets/layoutwidgetbase.cc:
	* glom/utility_widgets/layoutwidgetutils.cc:
	* glom/utility_widgets/layoutwidgetutils.h:
	* glom/utility_widgets/notebookglom.cc:
	Fixed build with GLOM_ENABLE_CLIENT_ONLY

	* glom/main.cc:
	Allow to pass arguments to Gtk+ like --g-fatal-warnings. Glom did filter those
	as invalid arguments before

svn path=/trunk/; revision=1640
parent c10ebb69
2008-07-17 Johannes Schmid <johannes.schmid@openismus.com>
* glom/application.cc:
* glom/application.h:
* glom/frame_glom.cc:
* glom/frame_glom.h:
* glom/layout_item_dialogs/dialog_buttonscript.h:
* glom/mode_data/box_data_calendar_related.cc:
* glom/mode_data/box_data_details.cc:
* glom/mode_data/flowtablewithfields.cc:
* glom/mode_data/flowtablewithfields.h:
* glom/utility_widgets/buttonglom.cc:
* glom/utility_widgets/buttonglom.h:
* glom/utility_widgets/labelglom.cc:
* glom/utility_widgets/labelglom.h:
* glom/utility_widgets/layoutwidgetbase.cc:
* glom/utility_widgets/layoutwidgetutils.cc:
* glom/utility_widgets/layoutwidgetutils.h:
* glom/utility_widgets/notebookglom.cc:
Fixed build with GLOM_ENABLE_CLIENT_ONLY
* glom/main.cc:
Allow to pass arguments to Gtk+ like --g-fatal-warnings. Glom did filter those
as invalid arguments before
1.7.1:
2008-06-23 Murray Cumming <murrayc@murrayc.com>
......
......@@ -299,11 +299,11 @@ void App_Glom::init_menus_file()
m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_Menu_File_Export", _("_Export")),
sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_file_export));
#endif // !GLOM_ENABLE_CLIENT_ONLY
action = Gtk::Action::create("BakeryAction_Menu_File_Import", _("Import"));
m_refFileActionGroup->add(action, sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_file_import));
#endif // !GLOM_ENABLE_CLIENT_ONLY
m_refFileActionGroup->add(Gtk::Action::create("GlomAction_Menu_File_Print", Gtk::Stock::PRINT));
m_refFileActionGroup->add(Gtk::Action::create("GlomAction_File_Print", _("_Standard")),
sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_file_print) );
......@@ -338,8 +338,8 @@ void App_Glom::init_menus_file()
#ifndef GLOM_ENABLE_CLIENT_ONLY
" <menuitem action='BakeryAction_File_SaveAsExample' />"
" <menuitem action='BakeryAction_Menu_File_Export' />"
#endif // !GLOM_ENABLE_CLIENT_ONLY
" <menuitem action='BakeryAction_Menu_File_Import' />"
#endif // !GLOM_ENABLE_CLIENT_ONLY
" <separator/>"
" <menu action='GlomAction_Menu_File_Print'>"
" <menuitem action='GlomAction_File_Print' />"
......@@ -750,6 +750,7 @@ void App_Glom::on_menu_file_close() //override
Bakery::App_WithDoc_Gtk::on_menu_file_close();
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Copied from bakery:
static bool uri_is_writable(const Glib::RefPtr<const Gio::File>& uri)
{
......@@ -781,7 +782,7 @@ static bool uri_is_writable(const Glib::RefPtr<const Gio::File>& uri)
else
return true; //Not every URI protocol supports access rights, so assume that it's writable and complain later.
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
Glib::ustring App_Glom::get_file_uri_without_extension(const Glib::ustring& uri)
{
......@@ -1190,6 +1191,7 @@ bool App_Glom::offer_new_or_existing()
case Dialog_ExistingOrNew::NONE:
// This should not happen
break;
#ifndef GLOM_ENABLE_CLIENT_ONLY
case Dialog_ExistingOrNew::NEW_EMPTY:
existing_or_new_new();
break;
......@@ -1197,11 +1199,15 @@ bool App_Glom::offer_new_or_existing()
case Dialog_ExistingOrNew::OPEN_URI:
open_document(dialog->get_uri());
break;
#endif // !GLOM_ENABLE_CLIENT_ONLY
#ifndef G_OS_WIN32
case Dialog_ExistingOrNew::OPEN_REMOTE:
open_browsed_document(dialog->get_service_info(), dialog->get_service_name());
break;
#endif
#ifndef GLOM_ENABLE_CLIENT_ONLY
default:
#endif // !GLOM_ENABLE_CLIENT_ONLY
}
//Check that a document was opened:
......@@ -1222,6 +1228,7 @@ bool App_Glom::offer_new_or_existing()
return true;
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void App_Glom::existing_or_new_new()
{
// New empty document
......@@ -1267,12 +1274,10 @@ void App_Glom::existing_or_new_new()
document->set_connection_database(db_name);
document->set_connection_is_self_hosted(self_hosted);
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Tell the connection pool about the document:
ConnectionPool* connection_pool = ConnectionPool::get_instance();
if(connection_pool)
connection_pool->set_get_document_func( sigc::mem_fun(*this, &App_Glom::on_connection_pool_get_document) );
#endif
const bool connected = m_pFrame->connection_request_password_and_choose_new_database_name();
if(!connected)
......@@ -1302,6 +1307,7 @@ void App_Glom::existing_or_new_new()
}
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
void App_Glom::set_mode_data()
{
......
......@@ -96,10 +96,10 @@ protected:
bool offer_new_or_existing();
void existing_or_new_new();
void on_menu_help_contents();
#ifndef GLOM_ENABLE_CLIENT_ONLY
void existing_or_new_new();
void on_menu_userlevel_developer();
void on_menu_userlevel_operator();
void on_menu_file_save_as_example();
......
......@@ -357,9 +357,10 @@ void Frame_Glom::show_table(const Glib::ustring& table_name, const Gnome::Gda::V
//Show the table:
m_table_name = table_name;
Glib::ustring strMode;
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Update the document with any new information in the database if necessary (though the database _should never have changed information)
update_table_in_document_from_database();
#endif // !GLOM_ENABLE_CLIENT_ONLY
//Update user-level dependent UI:
if(pApp)
......@@ -660,7 +661,6 @@ void Frame_Glom::export_data_to_stream(std::ostream& the_stream, const FoundSet&
}
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::on_menu_file_import()
{
......@@ -714,6 +714,7 @@ void Frame_Glom::on_menu_file_import()
}
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::on_menu_file_print()
{
......@@ -1111,6 +1112,7 @@ void Frame_Glom::show_table_title()
}
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::update_table_in_document_from_database()
{
//Add any new/changed information from the database to the document
......@@ -1191,6 +1193,7 @@ void Frame_Glom::update_table_in_document_from_database()
pDoc->set_table_fields(m_table_name, fieldsActual);
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::set_document(Document_Glom* pDocument)
{
......
......@@ -181,8 +181,9 @@ protected:
void show_table(const Glib::ustring& table_name, const Gnome::Gda::Value& primary_key_value_for_details = Gnome::Gda::Value());
void show_table_title();
#ifndef GLOM_ENABLE_CLIENT_ONLY
void update_table_in_document_from_database();
#endif // !GLOM_ENABLE_CLIENT_ONLY
virtual void set_mode_widget(Gtk::Widget& widget); //e.g. show the design mode notebook.
virtual bool set_mode(enumModes mode); //bool indicates that there was a change.
......
......@@ -21,10 +21,13 @@
#ifndef DIALOG_BUTTONSCRIPT_H
#define DIALOG_BUTTONSCRIPT_H
#ifndef GLOM_ENABLE_CLIENT_ONLY
#include <gtkmm.h>
#include <libglademm.h>
#include <glom/libglom/data_structure/layout/layoutitem_button.h>
#include "../base_db.h"
#include <gtksourceviewmm/sourceview.h>
namespace Glom
......@@ -56,4 +59,5 @@ protected:
} //namespace Glom
#endif // !GLOM_ENABLE_CLIENT_ONLY
#endif //DIALOG_BUTTONSCRIPT_H
......@@ -144,6 +144,10 @@ main(int argc, char* argv[])
Glom::OptionGroup group;
context.set_main_group(group);
//We use python for calculated-fields:
Py_Initialize();
PySys_SetArgv(argc, argv);
Gtk::Main mainInstance(argc, argv, context);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
......@@ -191,15 +195,10 @@ main(int argc, char* argv[])
return 0;
}
//We use python for calculated-fields:
Py_Initialize();
PySys_SetArgv(argc, argv);
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
#endif
{
Gtk::Main mainInstance(argc, argv, context);
Bakery::init();
#ifndef GLOM_ENABLE_CLIENT_ONLY
......
......@@ -314,9 +314,9 @@ void Box_Data_Calendar_Related::on_dialog_layout_hide()
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
#ifndef GLOM_ENABLE_CLIENT_ONLY
Dialog_Layout* Box_Data_Calendar_Related::create_layout_dialog() const
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create(GLOM_GLADEDIR "glom_developer.glade", "window_data_layout");
if(refXml)
{
......@@ -324,7 +324,6 @@ Dialog_Layout* Box_Data_Calendar_Related::create_layout_dialog() const
refXml->get_widget_derived("window_data_layout", dialog);
return dialog;
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
return NULL;
}
......@@ -337,6 +336,7 @@ void Box_Data_Calendar_Related::prepare_layout_dialog(Dialog_Layout* dialog)
sharedptr<LayoutItem_CalendarPortal> derived_portal = sharedptr<LayoutItem_CalendarPortal>::cast_dynamic(m_portal);
related_dialog->set_document(m_layout_name, get_document(), derived_portal);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
void Box_Data_Calendar_Related::on_calendar_month_changed()
{
......
......@@ -46,8 +46,10 @@ Box_Data_Details::Box_Data_Details(bool bWithNavButtons /* = true */)
m_Button_Nav_Next(Gtk::Stock::GO_FORWARD),
m_Button_Nav_Last(Gtk::Stock::GOTO_LAST),
m_bDoNotRefreshRelated(false),
m_ignore_signals(true),
m_design_mode(false)
m_ignore_signals(true)
#ifndef GLOM_ENABLE_CLIENT_ONLY
,m_design_mode(false)
#endif
{
m_layout_name = "details";
......
......@@ -1410,6 +1410,7 @@ sharedptr<LayoutItem_Portal> FlowTableWithFields::get_layout_item_from_relation(
return layout_item;
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void FlowTableWithFields::on_menu_properties_activate()
{
try
......@@ -1479,5 +1480,6 @@ bool FlowTableWithFields::on_button_press_event(GdkEventButton *event)
}
return Gtk::Widget::on_button_press_event(event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
} //namespace Glom
......@@ -246,9 +246,11 @@ protected:
type_signal_script_button_clicked m_signal_script_button_clicked;
//menu
#ifndef GLOM_ENABLE_CLIENT_ONLY
virtual void on_menu_properties_activate();
virtual void on_menu_delete_activate(); // override this to add a dialog box
virtual bool on_button_press_event(GdkEventButton *event);
#endif // !GLOM_ENABLE_CLIENT_ONLY
};
} //namespace Glom
......
......@@ -23,7 +23,9 @@
#include "../application.h"
#include "../libglom/glade_utils.h"
#include "dialog_layoutitem_properties.h"
#ifndef GLOM_ENABLE_CLIENT_ONLY
#include "../layout_item_dialogs/dialog_buttonscript.h"
#endif
#include <glibmm/i18n.h>
//#include <sstream> //For stringstream
......@@ -58,6 +60,7 @@ App_Glom* ButtonGlom::get_application()
return dynamic_cast<App_Glom*>(pWindow);
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void ButtonGlom::on_menu_properties_activate()
{
try
......@@ -105,5 +108,6 @@ bool ButtonGlom::on_button_press_event(GdkEventButton *event)
}
return Gtk::Button::on_button_press_event(event);
}
#endif
} //namespace Glom
......@@ -44,9 +44,10 @@ protected:
void init();
virtual App_Glom* get_application();
#ifndef GLOM_ENABLE_CLIENT_ONLY
virtual void on_menu_properties_activate();
virtual bool on_button_press_event(GdkEventButton *event);
#endif // !GLOM_ENABLE_CLIENT_ONLY
};
} //namespace Glom
......
......@@ -61,6 +61,7 @@ App_Glom* LabelGlom::get_application()
return dynamic_cast<App_Glom*>(pWindow);
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void LabelGlom::on_menu_properties_activate()
{
sharedptr<LayoutItem_Text> textobject = sharedptr<LayoutItem_Text>::cast_dynamic(m_pLayoutItem);
......@@ -110,5 +111,6 @@ bool LabelGlom::on_button_press_event(GdkEventButton *event)
}
return Gtk::EventBox::on_button_press_event(event);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
} //namespace Glom
......@@ -47,9 +47,10 @@ protected:
virtual App_Glom* get_application();
Gtk::Label m_label;
#ifndef GLOM_ENABLE_CLIENT_ONLY
virtual bool on_button_press_event(GdkEventButton *event);
virtual void on_menu_properties_activate();
#endif // !GLOM_ENABLE_CLIENT_ONLY
};
......
......@@ -103,6 +103,7 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const FieldFormatti
widget.modify_base(Gtk::STATE_NORMAL, Gdk::Color(bg));
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void LayoutWidgetBase::set_dnd_in_progress(bool drag)
{
m_drag_in_progress = drag;
......@@ -112,6 +113,6 @@ bool LayoutWidgetBase::get_dnd_in_progress()
{
return m_drag_in_progress;
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
} //namespace Glom
......@@ -36,7 +36,9 @@ LayoutWidgetUtils::LayoutWidgetUtils() :
m_refActionGroup->add(Gtk::Action::create("UtilMenu", "Utility Menu") );
m_refUtilProperties = Gtk::Action::create("UtilProperties", _("Properties"));
m_refUtilDelete = Gtk::Action::create("UtilDelete", _("Delete"));
#ifndef GLOM_ENABLE_CLIENT_ONLY
setup_util_menu();
#endif
}
LayoutWidgetUtils::~LayoutWidgetUtils()
......@@ -44,6 +46,7 @@ LayoutWidgetUtils::~LayoutWidgetUtils()
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void LayoutWidgetUtils::setup_util_menu()
{
m_refUIManager = Gtk::UIManager::create();
......@@ -108,6 +111,7 @@ void LayoutWidgetUtils::on_menu_delete_activate()
signal_layout_changed().emit();
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
} // namespace Glom
......@@ -38,11 +38,11 @@ public:
protected:
void setup_util_menu();
Gtk::Menu* m_pPopupMenuUtils;
#ifndef GLOM_ENABLE_CLIENT_ONLY
virtual void on_menu_properties_activate() = 0;
// This one is implemented here
virtual void on_menu_delete_activate();
#endif // !GLOM_ENABLE_CLIENT_ONLY
Glib::RefPtr<Gtk::Action> m_refUtilProperties;
Glib::RefPtr<Gtk::Action> m_refUtilDelete;
......
......@@ -69,7 +69,9 @@ App_Glom* NotebookGlom::get_application()
void NotebookGlom::delete_from_layout()
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
on_menupopup_activate_delete();
#endif // !GLOM_ENABLE_CLIENT_ONLY
}
} //namespace Glom
......
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