Commit cec77a7d authored by Murray Cumming's avatar Murray Cumming
Browse files

AppWindow: Rename get_application() to get_appwindow().

parent 2565b35d
2012-02-10 Murray Cumming <murrayc@murrayc.com>
AppWindow: Rename get_application() to get_appwindow().
2012-02-09 Murray Cumming <murrayc@murrayc.com>
Rename Application to AppWindow.
......
......@@ -127,7 +127,7 @@ void Base_DB::handle_error(const Glib::Exception& ex)
Gtk::MessageDialog dialog(Utils::bold_message(_("Internal error")), true, Gtk::MESSAGE_WARNING );
dialog.set_secondary_text(ex.what());
//TODO: dialog.set_transient_for(*get_application());
//TODO: dialog.set_transient_for(*get_appwindow());
dialog.run();
}
......@@ -137,7 +137,7 @@ void Base_DB::handle_error(const std::exception& ex)
Gtk::MessageDialog dialog(Utils::bold_message(_("Internal error")), true, Gtk::MESSAGE_WARNING );
dialog.set_secondary_text(ex.what());
//TODO: dialog.set_transient_for(*get_application());
//TODO: dialog.set_transient_for(*get_appwindow());
dialog.run();
}
......
......@@ -113,7 +113,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
//We need the connection when we run the script, so that the script may use it.
// TODO: Is this function supposed to throw an exception?
sharedptr<SharedConnection> sharedconnection = connect_to_server(AppWindow::get_application());
sharedptr<SharedConnection> sharedconnection = connect_to_server(AppWindow::get_appwindow());
Glib::ustring error_message; //TODO: Check this.
const Gnome::Gda::Value value =
......@@ -262,7 +262,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const sharedptr<const Layo
const Glib::ustring message = _("Data may not be entered into this related field, because the related record does not yet exist, and the relationship does not allow automatic creation of new related records.");
Gtk::MessageDialog dialog(Utils::bold_message(_("Related Record Does Not Exist")), true);
dialog.set_secondary_text(message);
dialog.set_transient_for(*AppWindow::get_application());
dialog.set_transient_for(*AppWindow::get_appwindow());
dialog.run();
//Clear the field again, discarding the entered data.
......@@ -284,7 +284,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const sharedptr<const Layo
Gtk::MessageDialog dialog(Utils::bold_message(_("Related Record Cannot Be Created")), true);
//TODO: This is a very complex error message:
dialog.set_secondary_text(message);
dialog.set_transient_for(*AppWindow::get_application());
dialog.set_transient_for(*AppWindow::get_appwindow());
dialog.run();
//Clear the field again, discarding the entered data.
......@@ -395,7 +395,7 @@ bool Base_DB_Table_Data::confirm_delete_record()
const Glib::ustring message = _("Are you sure that you would like to delete this record? The data in this record will then be permanently lost.");
Gtk::MessageDialog dialog(Utils::bold_message(_("Delete record")), true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE);
dialog.set_secondary_text(message);
dialog.set_transient_for(*AppWindow::get_application());
dialog.set_transient_for(*AppWindow::get_appwindow());
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::Stock::DELETE, Gtk::RESPONSE_OK);
......@@ -431,7 +431,7 @@ Base_DB_Table_Data::type_signal_record_changed Base_DB_Table_Data::signal_record
bool Base_DB_Table_Data::get_related_record_exists(const sharedptr<const Relationship>& relationship, const Gnome::Gda::Value& key_value)
{
BusyCursor cursor(AppWindow::get_application());
BusyCursor cursor(AppWindow::get_appwindow());
bool result = false;
......
......@@ -1773,7 +1773,7 @@ void Frame_Glom::on_developer_dialog_hide()
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::on_connection_initialize_progress()
{
AppWindow *app = dynamic_cast<AppWindow*>(AppWindow::get_application());
AppWindow *app = dynamic_cast<AppWindow*>(AppWindow::get_appwindow());
if(app)
app->pulse_progress_message();
}
......@@ -1781,14 +1781,14 @@ void Frame_Glom::on_connection_initialize_progress()
void Frame_Glom::on_connection_startup_progress()
{
AppWindow *app = dynamic_cast<AppWindow*>(AppWindow::get_application());
AppWindow *app = dynamic_cast<AppWindow*>(AppWindow::get_appwindow());
if(app)
app->pulse_progress_message();
}
void Frame_Glom::on_connection_cleanup_progress()
{
AppWindow *app = dynamic_cast<AppWindow*>(AppWindow::get_application());
AppWindow *app = dynamic_cast<AppWindow*>(AppWindow::get_appwindow());
if(app)
app->pulse_progress_message();
}
......
......@@ -771,7 +771,7 @@ void handle_error(const Glib::Exception& ex)
//TODO_Moved:
//Gtk::MessageDialog dialog(Utils::bold_message(_("Internal error")), true, Gtk::MESSAGE_WARNING );
//dialog.set_secondary_text(ex.what());
//TODO: dialog.set_transient_for(*get_application());
//TODO: dialog.set_transient_for(*get_appwindow());
//dialog.run();
}
......@@ -782,7 +782,7 @@ void handle_error(const std::exception& ex)
//TODO_Moved:
//Gtk::MessageDialog dialog(Utils::bold_message(_("Internal error")), true, Gtk::MESSAGE_WARNING );
//dialog.set_secondary_text(ex.what());
//TODO: dialog.set_transient_for(*get_application());
//TODO: dialog.set_transient_for(*get_appwindow());
//dialog.run();
}
......@@ -815,7 +815,7 @@ type_vec_fields get_fields_for_table_from_database(const Glib::ustring& table_na
DATAMODEL_FIELDS_COL_EXTRA = 6 // Could be auto-increment
};
//TODO: BusyCursor busy_cursor(get_application());
//TODO: BusyCursor busy_cursor(get_appwindow());
{
Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
......
......@@ -98,7 +98,7 @@ Glib::ustring Privs::get_default_developer_user_name(Glib::ustring& password)
Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_name)
{
//TODO_Moved: BusyCursor cursor(AppWindow::get_application());
//TODO_Moved: BusyCursor cursor(AppWindow::get_appwindow());
type_vec_strings result;
......@@ -429,7 +429,7 @@ Privileges Privs::get_current_privs(const Glib::ustring& table_name)
//TODO_Performance: There's lots of database access here.
//We could maybe replace some with the postgres has_table_* function().
//TODO_Moved: BusyCursor cursor(AppWindow::get_application());
//TODO_Moved: BusyCursor cursor(AppWindow::get_appwindow());
//Return a cached value if possible.
//(If it is in the cache then it's fairly recent)
......
......@@ -108,7 +108,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
builder->add_expr(m_from_key_value)));
/* TODO: Fix linking problems
const App_Glom* app = App_Glom::get_application();
const App_Glom* app = App_Glom::get_appwindow();
if(app && app->get_show_sql_debug())
{
try
......
......@@ -514,7 +514,7 @@ void Box_Data_Calendar_Related::setup_menu()
sigc::mem_fun(*this, &Box_Data_Calendar_Related::on_MenuPopup_activate_layout) );
//TODO: This does not work until this widget is in a container in the window:
AppWindow* pApp = get_application();
AppWindow* pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
......@@ -563,8 +563,8 @@ void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *e
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Enable/Disable items.
//We did this earlier, but get_application is more likely to work now:
AppWindow* pApp = get_application();
//We did this earlier, but get_appwindow is more likely to work now:
AppWindow* pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
......
......@@ -951,7 +951,7 @@ void Box_Data_Details::print_layout()
false /* do not avoid page margins */);
//Show the print preview window:
AppWindow* app = AppWindow::get_application();
AppWindow* app = AppWindow::get_appwindow();
PrintLayoutUtils::do_print_layout(print_layout, m_found_set,
false /* not preview */, document, true /* avoid page margins */, app);
}
......
......@@ -52,7 +52,7 @@ void ButtonGlom::init()
}
AppWindow* ButtonGlom::get_application()
AppWindow* ButtonGlom::get_appwindow()
{
Gtk::Container* pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
......@@ -84,7 +84,7 @@ void ButtonGlom::on_menu_properties_activate()
bool ButtonGlom::on_button_press_event(GdkEventButton *event)
{
AppWindow* pApp = get_application();
AppWindow* pApp = get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
GdkModifierType mods;
......
......@@ -43,7 +43,7 @@ public:
private:
void init();
virtual AppWindow* get_application();
virtual AppWindow* get_appwindow();
#ifndef GLOM_ENABLE_CLIENT_ONLY
virtual void on_menu_properties_activate();
virtual bool on_button_press_event(GdkEventButton *event);
......
......@@ -55,8 +55,8 @@ void CheckButton::init()
bool CheckButton::on_button_press_event(GdkEventButton *event)
{
//Enable/Disable items.
//We did this earlier, but get_application is more likely to work now:
AppWindow* pApp = get_application();
//We did this earlier, but get_appwindow is more likely to work now:
AppWindow* pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
......@@ -84,7 +84,7 @@ bool CheckButton::on_button_press_event(GdkEventButton *event)
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
AppWindow* CheckButton::get_application()
AppWindow* CheckButton::get_appwindow()
{
Gtk::Container* pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
......
......@@ -54,7 +54,7 @@ private:
virtual bool on_button_press_event(GdkEventButton *event); //override
#endif // !GLOM_ENABLE_CLIENT_ONLY
virtual AppWindow* get_application();
virtual AppWindow* get_appwindow();
};
} //namespace DataWidetChildren
......
......@@ -318,8 +318,8 @@ bool ComboGlom::on_button_press_event(GdkEventButton *event)
g_warning("ComboGlom::on_button_press_event()");
//Enable/Disable items.
//We did this earlier, but get_application is more likely to work now:
AppWindow* pApp = get_application();
//We did this earlier, but get_appwindow is more likely to work now:
AppWindow* pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
......@@ -349,7 +349,7 @@ g_warning("ComboGlom::on_button_press_event()");
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
AppWindow* ComboGlom::get_application()
AppWindow* ComboGlom::get_appwindow()
{
Gtk::Container* pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
......
......@@ -77,7 +77,7 @@ private:
virtual bool on_button_press_event(GdkEventButton *event);
#endif // !GLOM_ENABLE_CLIENT_ONLY
virtual AppWindow* get_application();
virtual AppWindow* get_appwindow();
Gnome::Gda::Value m_old_value; //TODO: Only useful for navigation, which currently has no implementation.
......
......@@ -267,11 +267,11 @@ Glib::ustring ComboAsRadioButtons::get_text() const
void ComboAsRadioButtons::show_context_menu(GdkEventButton *event)
{
std::cout << "ComboAsRadioButtons::show_context_menu()" << std::endl;
AppWindow* pApp = get_application();
AppWindow* pApp = get_appwindow();
if(pApp)
{
//Enable/Disable items.
//We did this earlier, but get_application is more likely to work now:
//We did this earlier, but get_appwindow is more likely to work now:
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
pApp->add_developer_action(m_refContextAddField);
pApp->add_developer_action(m_refContextAddRelatedRecords);
......@@ -308,7 +308,7 @@ bool ComboAsRadioButtons::on_button_press_event(GdkEventButton *event)
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
AppWindow* ComboAsRadioButtons::get_application()
AppWindow* ComboAsRadioButtons::get_appwindow()
{
Gtk::Container* pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
......
......@@ -88,7 +88,7 @@ private:
void show_context_menu(GdkEventButton *event);
#endif // !GLOM_ENABLE_CLIENT_ONLY
virtual AppWindow* get_application();
virtual AppWindow* get_appwindow();
Glib::ustring m_old_text;
......
......@@ -426,8 +426,8 @@ bool DataWidget::on_button_press_event(GdkEventButton *event)
//g_warning("DataWidget::on_button_press_event_popup");
//Enable/Disable items.
//We did this earlier, but get_application is more likely to work now:
AppWindow* pApp = get_application();
//We did this earlier, but get_appwindow is more likely to work now:
AppWindow* pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
......@@ -462,7 +462,7 @@ sharedptr<LayoutItem_Field> DataWidget::offer_field_list(const Glib::ustring& ta
sharedptr<LayoutItem_Field> DataWidget::offer_field_list(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& start_field)
{
return offer_field_list(table_name, start_field, get_document(), get_application());
return offer_field_list(table_name, start_field, get_document(), get_appwindow());
}
sharedptr<LayoutItem_Field> DataWidget::offer_field_list(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& start_field, Document* document, AppWindow* app)
......@@ -504,7 +504,7 @@ sharedptr<LayoutItem_Field> DataWidget::offer_field_layout(const sharedptr<const
add_view(dialog); //Give it access to the document.
dialog->set_field(start_field, m_table_name);
Gtk::Window* parent = get_application();
Gtk::Window* parent = get_appwindow();
if(parent)
dialog->set_transient_for(*parent);
......@@ -567,7 +567,7 @@ void DataWidget::on_child_user_requested_layout()
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
AppWindow* DataWidget::get_application()
AppWindow* DataWidget::get_appwindow()
{
Gtk::Container* pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
......@@ -635,7 +635,7 @@ void DataWidget::on_button_choose_date()
if(dialog)
{
Gtk::Window* parent = get_application(); //This doesn't work (and would be wrong) when the widget is in a Field Definitions dialog.
Gtk::Window* parent = get_appwindow(); //This doesn't work (and would be wrong) when the widget is in a Field Definitions dialog.
if(parent)
dialog->set_transient_for(*parent);
dialog->set_date_chosen(get_value());
......@@ -674,7 +674,7 @@ bool DataWidget::offer_related_record_id_find(Gnome::Gda::Value& chosen_id)
if(dialog)
{
//dialog->set_document(get_document(), table_name, field);
Gtk::Window* parent = get_application();
Gtk::Window* parent = get_appwindow();
if(parent)
dialog->set_transient_for(*parent);
add_view(dialog);
......@@ -723,7 +723,7 @@ bool DataWidget::offer_related_record_id_new(Gnome::Gda::Value& chosen_id)
if(dialog)
{
//dialog->set_document(get_document(), table_name, field);
Gtk::Window* parent = get_application();
Gtk::Window* parent = get_appwindow();
if(parent)
dialog->set_transient_for(*parent);
add_view(dialog);
......
......@@ -117,7 +117,7 @@ private:
//virtual void on_menupopup_add_item(LayoutWidgetBase::enumType item);
#endif // !GLOM_ENABLE_CLIENT_ONLY
AppWindow* get_application();
AppWindow* get_appwindow();
void set_child_size_by_field(const sharedptr<const LayoutItem_Field>& field);
int get_suitable_width(const sharedptr<const LayoutItem_Field>& field_layout);
......
......@@ -191,8 +191,8 @@ Gnome::Gda::Value Entry::get_value() const
bool Entry::on_button_press_event(GdkEventButton *event)
{
//Enable/Disable items.
//We did this earlier, but get_application is more likely to work now:
AppWindow* pApp = get_application();
//We did this earlier, but get_appwindow is more likely to work now:
AppWindow* pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
......@@ -222,7 +222,7 @@ bool Entry::on_button_press_event(GdkEventButton *event)
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
AppWindow* Entry::get_application()
AppWindow* Entry::get_appwindow()
{
Gtk::Container* pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
......
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