[glom] Progress InfoBar: Block user input during progress.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Progress InfoBar: Block user input during progress.
- Date: Mon, 24 Oct 2011 09:17:02 +0000 (UTC)
commit 6329341450f4478425c65d4df95b084e43915277
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Oct 24 10:33:21 2011 +0200
Progress InfoBar: Block user input during progress.
* glom/application.cc: set_progress_message(): Set the main UI elements to
insensitive(), because all our current uses of the progess message should
block user input, like a modal dialog.
* ui/operator/window_main.glade: Move the InfoBar out of the frame, because
it should not have the border, and so we can make the frame insensitive
without making the InfoBar insensitive.
ChangeLog | 11 ++++
glom/application.cc | 12 ++++-
glom/glade_utils.h | 6 +-
ui/operator/window_main.glade | 131 ++++++++++++++++++++++++-----------------
4 files changed, 101 insertions(+), 59 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index da87f49..6da25aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2011-10-24 Murray Cumming <murrayc murrayc com>
+ Progress InfoBar: Block user input during progress.
+
+ * glom/application.cc: set_progress_message(): Set the main UI elements to
+ insensitive(), because all our current uses of the progess message should
+ block user input, like a modal dialog.
+ * ui/operator/window_main.glade: Move the InfoBar out of the frame, because
+ it should not have the border, and so we can make the frame insensitive
+ without making the InfoBar insensitive.
+
+2011-10-24 Murray Cumming <murrayc murrayc com>
+
ShowProgressMessage: Move to its own source files.
* Makefile_glom.am:
diff --git a/glom/application.cc b/glom/application.cc
index 464238f..a827ec1 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -2924,7 +2924,12 @@ void Application::set_progress_message(const Glib::ustring& message)
// Pulse the progress bar regardless of whether the message is new or not.
m_infobar_progress->pulse();
- // TODO: Block interaction with the rest of the UI.
+
+ //Block interaction with the rest of the UI.
+ Gtk::MenuBar* pMenuBar = static_cast<Gtk::MenuBar*>(m_refUIManager->get_widget("/Bakery_MainMenu"));
+ if(pMenuBar)
+ pMenuBar->set_sensitive(false);
+ m_pFrame->set_sensitive(false);
}
void Application::pulse_progress_message()
@@ -2936,6 +2941,11 @@ void Application::clear_progress_message()
{
m_progress_collate_key.clear();
m_infobar_progress->hide();
+
+ Gtk::MenuBar* pMenuBar = static_cast<Gtk::MenuBar*>(m_refUIManager->get_widget("/Bakery_MainMenu"));
+ if(pMenuBar)
+ pMenuBar->set_sensitive();
+ m_pFrame->set_sensitive();
}
} //namespace Glom
diff --git a/glom/glade_utils.h b/glom/glade_utils.h
index c55af7c..4af790e 100644
--- a/glom/glade_utils.h
+++ b/glom/glade_utils.h
@@ -75,15 +75,15 @@ void helper_get_glade_widget_derived_with_warning(const std::string& filename, c
}
catch(const Gtk::BuilderError& ex)
{
- std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
+ std::cerr << G_STRFUNC << ": BuilderError Exception: " << ex.what() << std::endl;
}
catch(const Glib::MarkupError& ex)
{
- std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
+ std::cerr << G_STRFUNC << ": MarkupError exception:" << ex.what() << std::endl;
}
catch(const Glib::FileError& ex)
{
- std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
+ std::cerr << G_STRFUNC << ": FileError: exception" << ex.what() << std::endl;
}
catch(const Glib::Error& ex)
{
diff --git a/ui/operator/window_main.glade b/ui/operator/window_main.glade
index be57f36..64d475b 100644
--- a/ui/operator/window_main.glade
+++ b/ui/operator/window_main.glade
@@ -11,16 +11,82 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkVBox" id="vbox_frame">
+ <object class="GtkVBox" id="vbox_top">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">12</property>
- <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox_frame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_quickfind">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="vbox_main">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkVBox" id="sidebar_vbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox_mode">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkInfoBar" id="infobar_progress">
+ <property name="app_paintable">True</property>
<property name="can_focus">False</property>
<child internal-child="content_area">
- <object class="GtkBox" id="infobar-content_area1">
+ <object class="GtkBox" id="infobar-content_area">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
@@ -54,69 +120,24 @@
</child>
</object>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox_quickfind">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="vbox_main">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkVBox" id="sidebar_vbox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox_mode">
- <property name="visible">True</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="infobar-action_area">
<property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">0</property>
+ <property name="pack_type">end</property>
</packing>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]