[glom] Simplify setting of the icon for windows.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Simplify setting of the icon for windows.
- Date: Mon, 12 Apr 2010 14:37:58 +0000 (UTC)
commit 49221aeb839e0dbdf8a8b2a513d3b4abd587b6c9
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Apr 11 00:11:16 2010 +0200
Simplify setting of the icon for windows.
* glom/glade_utils.h: get_glade_widget_derived_with_warning():
Call set_icon_name() on windows.
* Several *.cc files: Don't bother calling set_icon_name() after calling
get_glade_widget_derived_with_warning().
ChangeLog | 9 +++++++++
glom/application.cc | 2 --
glom/dialog_connection.cc | 2 --
glom/dialog_existing_or_new.cc | 2 --
glom/dialog_progress_creating.cc | 1 -
glom/frame_glom.cc | 5 -----
glom/glade_utils.h | 18 ++++++++----------
glom/import_csv/dialog_import_csv.cc | 2 --
glom/mode_data/datawidget/datawidget.cc | 1 -
glom/mode_design/dialog_add_related_table.cc | 2 --
glom/mode_design/dialog_initial_password.cc | 2 --
glom/mode_design/fields/box_db_table_definition.cc | 1 -
glom/mode_design/layout/dialog_choose_field.cc | 2 --
glom/mode_design/layout/dialog_layout.cc | 2 --
.../layout_item_dialogs/dialog_imageobject.cc | 2 --
.../layout_item_dialogs/dialog_textobject.cc | 2 --
.../script_library/dialog_script_library.cc | 3 ---
.../mode_design/translation/window_translations.cc | 4 ----
glom/mode_design/users/dialog_groups_list.cc | 4 ----
.../filechooserdialog_saveextras.cc | 4 ++--
20 files changed, 19 insertions(+), 51 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e33ab29..a82eeac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,15 @@
differently, as may be required by some languages.
Fixes bug #606931 (Urmas, André Klapper)
+2010-04-11 Murray Cumming <murrayc murrayc com>
+
+ Simplify setting of the icon for windows.
+
+ * glom/glade_utils.h: get_glade_widget_derived_with_warning():
+ Call set_icon_name() on windows.
+ * Several *.cc files: Don't bother calling set_icon_name() after calling
+ get_glade_widget_derived_with_warning().
+
2010-04-10 Murray Cumming <murrayc murrayc-x61>
dialog_run_with_help(): Get the help ID from the class.
diff --git a/glom/application.cc b/glom/application.cc
index 5dfd61d..e9b4e30 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -2421,8 +2421,6 @@ void Application::on_menu_developer_changelanguage()
{
Dialog_ChangeLanguage* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
-
- dialog->set_icon_name("glom");
dialog->set_transient_for(*this);
const int response = Glom::Utils::dialog_run_with_help(dialog);
dialog->hide();
diff --git a/glom/dialog_connection.cc b/glom/dialog_connection.cc
index 0a3cbdb..e5d7639 100644
--- a/glom/dialog_connection.cc
+++ b/glom/dialog_connection.cc
@@ -44,8 +44,6 @@ Dialog_Connection::Dialog_Connection(BaseObjectType* cobject, const Glib::RefPtr
m_label_database(0),
m_label_note(0)
{
- set_icon_name("glom");
-
builder->get_widget("entry_host", m_entry_host);
builder->get_widget("entry_user", m_entry_user);
builder->get_widget("entry_password", m_entry_password);
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 936a93a..7411b86 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -107,8 +107,6 @@ const bool Dialog_ExistingOrNew::glade_developer(false);
Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
: Gtk::Dialog(cobject)
{
- set_icon_name("glom");
-
#ifdef GLOM_ENABLE_CLIENT_ONLY
//Don't mention creation of new documents in client-only mode:
Gtk::Label* label = 0;
diff --git a/glom/dialog_progress_creating.cc b/glom/dialog_progress_creating.cc
index 21019b8..4ad31f2 100644
--- a/glom/dialog_progress_creating.cc
+++ b/glom/dialog_progress_creating.cc
@@ -39,7 +39,6 @@ Dialog_ProgressCreating::Dialog_ProgressCreating(BaseObjectType* cobject, const
//set_modal();
builder->get_widget("progressbar", m_progress);
builder->get_widget("label_message", m_label_message);
- set_icon_name("glom");
//m_progress->show();
}
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 57a6e5b..50b74f8 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1683,7 +1683,6 @@ void Frame_Glom::on_menu_developer_database_preferences()
{
Dialog_Database_Preferences* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
- dialog->set_icon_name("glom");
dialog->set_transient_for(*(get_app_window()));
add_view(dialog);
dialog->load_from_document();
@@ -1709,7 +1708,6 @@ void Frame_Glom::do_menu_developer_fields(Gtk::Window& parent, const Glib::ustri
if(!m_pDialog_Fields)
{
Utils::get_glade_widget_derived_with_warning(m_pDialog_Fields);
- m_pDialog_Fields->set_icon_name("glom");
m_pDialog_Fields->signal_hide().connect( sigc::mem_fun(*this, &Frame_Glom::on_developer_dialog_hide));
add_view(m_pDialog_Fields);
}
@@ -1766,7 +1764,6 @@ void Frame_Glom::do_menu_developer_relationships(Gtk::Window& parent, const Glib
if(!m_pDialog_Relationships)
{
Utils::get_glade_widget_derived_with_warning(m_pDialog_Relationships);
- m_pDialog_Relationships->set_icon_name("glom");
m_pDialog_Relationships->set_title("Relationships");
m_pDialog_Relationships->signal_hide().connect( sigc::mem_fun(*this, &Frame_Glom::on_developer_dialog_hide));
add_view(m_pDialog_Relationships); //Also a composite view.
@@ -1790,7 +1787,6 @@ void Frame_Glom::on_menu_developer_users()
{
Dialog_GroupsList* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
- dialog->set_icon_name("glom");
dialog->set_transient_for(*get_app_window());
add_view(dialog); //Give it access to the document.
@@ -1833,7 +1829,6 @@ void Frame_Glom::on_menu_developer_reports()
Utils::get_glade_widget_derived_with_warning(m_pDialogLayoutReport);
add_view(m_pDialogLayoutReport);
- m_pDialogLayoutReport->set_icon_name("glom");
m_pDialogLayoutReport->set_transient_for(*(get_app_window()));
m_pDialogLayoutReport->signal_hide().connect( sigc::mem_fun(*this, &Frame_Glom::on_dialog_layout_report_hide) );
diff --git a/glom/glade_utils.h b/glom/glade_utils.h
index 8287ca3..dac2ac1 100644
--- a/glom/glade_utils.h
+++ b/glom/glade_utils.h
@@ -31,9 +31,6 @@ namespace Glom
namespace Utils
{
-const char* const FILENAME_GLADE("glom.glade");
-const char* const FILENAME_GLADE_DEVELOPER("glom_developer.glade");
-
inline std::string get_glade_file_path(const std::string& filename)
{
#ifdef G_OS_WIN32
@@ -89,9 +86,9 @@ void get_glade_widget_derived_with_warning(T_Widget*& widget)
widget = 0;
if(T_Widget::glade_developer)
- helper_get_glade_widget_derived_with_warning(FILENAME_GLADE_DEVELOPER, T_Widget::glade_id, widget);
+ helper_get_glade_widget_derived_with_warning("glom.glade", T_Widget::glade_id, widget);
else
- helper_get_glade_widget_derived_with_warning(FILENAME_GLADE, T_Widget::glade_id, widget);
+ helper_get_glade_widget_derived_with_warning("glom_developer.glade", T_Widget::glade_id, widget);
}
@@ -122,12 +119,13 @@ void get_glade_widget_with_warning(const std::string& filename, const Glib::ustr
{
refXml->get_widget(id, widget);
}
-}
-template<class T_Widget>
-void get_glade_widget_with_warning(const Glib::ustring& id, T_Widget*& widget)
-{
- get_glade_widget_with_warning(FILENAME_GLADE, id, widget);
+ // Make sure that all windows have the Glom icon.
+ // TODO: Though shouldn't all transient windows have this by default,
+ // or should they even be visible in the task list? murrayc
+ Gtk::Window* window = dynamic_cast<Gtk::Window*>(widget);
+ if(window)
+ window->set_icon_name("glom");
}
Dialog_ProgressCreating* get_and_show_pulse_dialog(const Glib::ustring& message, Gtk::Window* parent_window);
diff --git a/glom/import_csv/dialog_import_csv.cc b/glom/import_csv/dialog_import_csv.cc
index 3e24f84..6339784 100644
--- a/glom/import_csv/dialog_import_csv.cc
+++ b/glom/import_csv/dialog_import_csv.cc
@@ -81,8 +81,6 @@ Dialog_Import_CSV::Dialog_Import_CSV(BaseObjectType* cobject, const Glib::RefPtr
throw std::runtime_error("Missing widgets from glade file for Dialog_Import_CSV");
#endif
- set_icon_name("glom");
-
//Fill the list of encodings:
m_encoding_model = Gtk::ListStore::create(m_encoding_columns);
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 15a5a93..fc322ea 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -685,7 +685,6 @@ bool DataWidget::offer_related_record_id_find(Gnome::Gda::Value& chosen_id)
if(dialog)
{
- dialog->set_icon_name("glom");
//dialog->set_document(get_document(), table_name, field);
Gtk::Window* parent = get_application();
if(parent)
diff --git a/glom/mode_design/dialog_add_related_table.cc b/glom/mode_design/dialog_add_related_table.cc
index 2edbcdf..ec52f4d 100644
--- a/glom/mode_design/dialog_add_related_table.cc
+++ b/glom/mode_design/dialog_add_related_table.cc
@@ -37,8 +37,6 @@ Dialog_AddRelatedTable::Dialog_AddRelatedTable(BaseObjectType* cobject, const Gl
m_button_edit_fields(0),
m_button_ok(0)
{
- set_icon_name("glom");
-
builder->get_widget("entry_related_table_name", m_entry_table_name);
builder->get_widget("entry_relationship_name", m_entry_relationship_name);
builder->get_widget_derived("combobox_from_key", m_combo_from_field);
diff --git a/glom/mode_design/dialog_initial_password.cc b/glom/mode_design/dialog_initial_password.cc
index 2db221c..4a58dea 100644
--- a/glom/mode_design/dialog_initial_password.cc
+++ b/glom/mode_design/dialog_initial_password.cc
@@ -38,8 +38,6 @@ Dialog_InitialPassword::Dialog_InitialPassword(BaseObjectType* cobject, const Gl
builder->get_widget("entry_user", m_entry_user);
builder->get_widget("entry_password", m_entry_password);
builder->get_widget("entry_password_confirm", m_entry_password_confirm);
-
- set_icon_name("glom");
}
Dialog_InitialPassword::~Dialog_InitialPassword()
diff --git a/glom/mode_design/fields/box_db_table_definition.cc b/glom/mode_design/fields/box_db_table_definition.cc
index ac97fb8..b913f10 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -44,7 +44,6 @@ void Box_DB_Table_Definition::init()
//m_strHint = _("Click [Edit] to edit the field definition in more detail.\nUse the Mode menu to see Data or perform a Find.");
Utils::get_glade_widget_derived_with_warning(m_pDialog);
- m_pDialog->set_icon_name("glom");
add_view(m_pDialog); //Give it access to the document.
diff --git a/glom/mode_design/layout/dialog_choose_field.cc b/glom/mode_design/layout/dialog_choose_field.cc
index fec7da0..1a0ce4d 100644
--- a/glom/mode_design/layout/dialog_choose_field.cc
+++ b/glom/mode_design/layout/dialog_choose_field.cc
@@ -36,8 +36,6 @@ Dialog_ChooseField::Dialog_ChooseField(BaseObjectType* cobject, const Glib::RefP
m_treeview(0),
m_document(0)
{
- set_icon_name("glom");
-
builder->get_widget("checkbutton_show_related_relationships", m_checkbutton_show_related_relationships);
m_checkbutton_show_related_relationships->set_active(false); //Start with the simpler list, to avoid confusing people.
m_checkbutton_show_related_relationships->signal_toggled().connect(sigc::mem_fun(*this, &Dialog_ChooseField::on_checkbutton_related_relationships_toggled));
diff --git a/glom/mode_design/layout/dialog_layout.cc b/glom/mode_design/layout/dialog_layout.cc
index 90d6174..ff9baca 100644
--- a/glom/mode_design/layout/dialog_layout.cc
+++ b/glom/mode_design/layout/dialog_layout.cc
@@ -31,8 +31,6 @@ Dialog_Layout::Dialog_Layout(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Bu
m_label_table_title(0),
m_modified(false)
{
- set_icon_name("glom");
-
Gtk::Button* button = 0;
builder->get_widget("button_close", button);
button->signal_clicked().connect( sigc::mem_fun(*this, &Dialog_Layout::on_button_close) );
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc b/glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc
index dce609b..28f3d85 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc
@@ -42,8 +42,6 @@ Dialog_ImageObject::Dialog_ImageObject(BaseObjectType* cobject, const Glib::RefP
builder->get_widget("entry_title", m_entry_title);
builder->get_widget_derived("imageglom", m_image);
- set_icon_name("glom");
-
builder->get_widget("button_choose_image", m_button_choose_image);
m_button_choose_image->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_ImageObject::on_button_choose));
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc b/glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc
index a0120d6..443ccb7 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc
@@ -42,8 +42,6 @@ Dialog_TextObject::Dialog_TextObject(BaseObjectType* cobject, const Glib::RefPtr
builder->get_widget("entry_title", m_entry_title);
builder->get_widget("textview_text", m_text_view);
- set_icon_name("glom");
-
//on_foreach_connect(*this);
//Dialog_Properties::set_modified(false);
diff --git a/glom/mode_design/script_library/dialog_script_library.cc b/glom/mode_design/script_library/dialog_script_library.cc
index ac2f6ea..926fb53 100644
--- a/glom/mode_design/script_library/dialog_script_library.cc
+++ b/glom/mode_design/script_library/dialog_script_library.cc
@@ -41,8 +41,6 @@ const bool Dialog_ScriptLibrary::glade_developer(true);
Dialog_ScriptLibrary::Dialog_ScriptLibrary(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
: Gtk::Dialog(cobject)
{
- set_icon_name("glom");
-
//Get child widgets:
builder->get_widget_derived("combobox_name", m_combobox_name);
builder->get_widget("textview_script", m_text_view);
@@ -96,7 +94,6 @@ void Dialog_ScriptLibrary::on_button_add()
Dialog_NewScript* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
- dialog->set_icon_name("glom");
dialog->set_transient_for(*this);
const int response = Glom::Utils::dialog_run_with_help(dialog);
dialog->hide();
diff --git a/glom/mode_design/translation/window_translations.cc b/glom/mode_design/translation/window_translations.cc
index 15b2026..33751b7 100644
--- a/glom/mode_design/translation/window_translations.cc
+++ b/glom/mode_design/translation/window_translations.cc
@@ -57,8 +57,6 @@ Window_Translations::Window_Translations(BaseObjectType* cobject, const Glib::Re
m_button_export(0),
m_treeview_modified(false)
{
- set_icon_name("glom");
-
builder->get_widget("label_source_locale", m_label_source_locale);
builder->get_widget("treeview", m_treeview);
@@ -138,7 +136,6 @@ void Window_Translations::on_button_identify()
Utils::get_glade_widget_derived_with_warning(dialog);
add_view(dialog);
dialog->load_from_document(); //Doesn't seem to happen otherwise.
- dialog->set_icon_name("glom");
dialog->set_transient_for(*this);
const int response = Glom::Utils::dialog_run_with_help(dialog);
dialog->hide();
@@ -360,7 +357,6 @@ void Window_Translations::on_button_copy_translation()
{
Dialog_CopyTranslation* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
- dialog->set_icon_name("glom");
dialog->set_transient_for(*this);
const int response = Glom::Utils::dialog_run_with_help(dialog);
dialog->hide();
diff --git a/glom/mode_design/users/dialog_groups_list.cc b/glom/mode_design/users/dialog_groups_list.cc
index 4668074..a4f1a38 100644
--- a/glom/mode_design/users/dialog_groups_list.cc
+++ b/glom/mode_design/users/dialog_groups_list.cc
@@ -240,8 +240,6 @@ void Dialog_GroupsList::on_button_group_new()
{
Dialog_NewGroup* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
-
- dialog->set_icon_name("glom");
dialog->set_transient_for(*this);
const int response = Glom::Utils::dialog_run_with_help(dialog);
@@ -293,8 +291,6 @@ void Dialog_GroupsList::on_button_group_users()
Dialog_UsersList* dialog = 0;
Utils::get_glade_widget_derived_with_warning(dialog);
-
- dialog->set_icon_name("glom");
dialog->set_transient_for(*this);
add_view(dialog); //Give it access to the document.
diff --git a/glom/utility_widgets/filechooserdialog_saveextras.cc b/glom/utility_widgets/filechooserdialog_saveextras.cc
index 9e88fde..3a87bae 100644
--- a/glom/utility_widgets/filechooserdialog_saveextras.cc
+++ b/glom/utility_widgets/filechooserdialog_saveextras.cc
@@ -40,13 +40,13 @@ FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras(Gtk::Window& parent,
create_child_widgets();
}
-FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras (const Glib::ustring& title, Gtk::FileChooserAction action)
+FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras(const Glib::ustring& title, Gtk::FileChooserAction action)
: Gtk::FileChooserDialog(title, action)
{
create_child_widgets();
}
-FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras (Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action)
+FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras(Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action)
: Gtk::FileChooserDialog(parent, title, action)
{
create_child_widgets();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]