Commit 029b4ed8 authored by Murray Cumming's avatar Murray Cumming
Browse files

Rename Dialog_Image_Progress to DialogImageLoadProgress

	* glom/utility_widgets/dialog_image_progress.[h|cc]:
	Rename to
	* glom/utility_widgets/dialog_image_load_progress.[h|cc]:
	* tests/test_glade_derived_instantiation.cc:
	* ui/operator/dialog_image_progress.glade: Rename to
	* ui/operator/dialog_image_load_progress.glade:
	* glom/utility_widgets/imageglom.h:
	* Makefile.am:
	* Makefile_glom.am:
	* po/POTFILES.in: Adapt.

	I can then add a new dialog for saving.
parent 5870850b
2011-07-11 Murray Cumming <murrayc@murrayc.com>
Rename Dialog_Image_Progress to DialogImageLoadProgress
* glom/utility_widgets/dialog_image_progress.[h|cc]:
Rename to
* glom/utility_widgets/dialog_image_load_progress.[h|cc]:
* tests/test_glade_derived_instantiation.cc:
* ui/operator/dialog_image_progress.glade: Rename to
* ui/operator/dialog_image_load_progress.glade:
* glom/utility_widgets/imageglom.h:
* Makefile.am:
* Makefile_glom.am:
* po/POTFILES.in: Adapt.
I can then add a new dialog for saving.
2011-07-11 Ben Konrath <ben@bagu.org>
Add PACKAGE_TARNAME variable to pkg-config file.
......
......@@ -89,7 +89,7 @@ dist_glade_operator_DATA = \
ui/operator/dialog_data_invalid_format.glade \
ui/operator/dialog_existing_or_new.glade \
ui/operator/dialog_find_id.glade \
ui/operator/dialog_image_progress.glade \
ui/operator/dialog_image_load_progress.glade \
ui/operator/dialog_import_csv.glade \
ui/operator/dialog_import_csv_progress.glade \
ui/operator/window_main.glade \
......
......@@ -188,8 +188,8 @@ glom_source_files = \
glom/utility_widgets/combo_textglade.h \
glom/utility_widgets/dialog_flowtable.cc \
glom/utility_widgets/dialog_flowtable.h \
glom/utility_widgets/dialog_image_progress.cc \
glom/utility_widgets/dialog_image_progress.h \
glom/utility_widgets/dialog_image_load_progress.cc \
glom/utility_widgets/dialog_image_load_progress.h \
glom/utility_widgets/dialog_properties.cc \
glom/utility_widgets/dialog_properties.h \
glom/utility_widgets/flowtable.cc \
......
......@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "dialog_image_progress.h"
#include "dialog_image_load_progress.h"
#include <gtkmm/messagedialog.h>
#include <glibmm/i18n.h>
......@@ -34,19 +34,19 @@ const unsigned int CHUNK_SIZE = 2048;
namespace Glom
{
const char* Dialog_Image_Progress::glade_id("dialog_image_progress");
const bool Dialog_Image_Progress::glade_developer(false);
const char* DialogImageLoadProgress::glade_id("dialog_image_load_progress");
const bool DialogImageLoadProgress::glade_developer(false);
Dialog_Image_Progress::Dialog_Image_Progress(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
DialogImageLoadProgress::DialogImageLoadProgress(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
: Gtk::Dialog(cobject)
{
builder->get_widget("image_loading_progress_bar", m_progress_bar);
if(!m_progress_bar)
throw std::runtime_error("Missing widgets from glade file for Dialog_Image_Progress");
throw std::runtime_error("Missing widgets from glade file for DialogImageLoadProgress");
}
Dialog_Image_Progress::~Dialog_Image_Progress()
DialogImageLoadProgress::~DialogImageLoadProgress()
{
if(m_data.get())
g_free(m_data->data);
......@@ -67,7 +67,7 @@ Dialog_Image_Progress::~Dialog_Image_Progress()
// TODO: Cancel outstanding async operations in destructor?
}
void Dialog_Image_Progress::load(const Glib::ustring& uri)
void DialogImageLoadProgress::load(const Glib::ustring& uri)
{
// Can only load one file with data
g_assert(!m_data.get());
......@@ -83,7 +83,7 @@ void Dialog_Image_Progress::load(const Glib::ustring& uri)
try
{
// Open the file for reading:
m_file->read_async(sigc::mem_fun(*this, &Dialog_Image_Progress::on_file_read));
m_file->read_async(sigc::mem_fun(*this, &DialogImageLoadProgress::on_file_read));
}
catch(const Glib::Error& ex)
{
......@@ -91,13 +91,13 @@ void Dialog_Image_Progress::load(const Glib::ustring& uri)
}
}
void Dialog_Image_Progress::on_file_read(const Glib::RefPtr<Gio::AsyncResult>& result)
void DialogImageLoadProgress::on_file_read(const Glib::RefPtr<Gio::AsyncResult>& result)
{
try
{
m_stream = m_file->read_finish(result);
// Query size of the file, so that we can show progress:
m_stream->query_info_async(sigc::mem_fun(*this, &Dialog_Image_Progress::on_query_info), G_FILE_ATTRIBUTE_STANDARD_SIZE);
m_stream->query_info_async(sigc::mem_fun(*this, &DialogImageLoadProgress::on_query_info), G_FILE_ATTRIBUTE_STANDARD_SIZE);
}
catch(const Glib::Error& ex)
{
......@@ -105,7 +105,7 @@ void Dialog_Image_Progress::on_file_read(const Glib::RefPtr<Gio::AsyncResult>& r
}
}
void Dialog_Image_Progress::on_query_info(const Glib::RefPtr<Gio::AsyncResult>& result)
void DialogImageLoadProgress::on_query_info(const Glib::RefPtr<Gio::AsyncResult>& result)
{
try
{
......@@ -117,7 +117,7 @@ void Dialog_Image_Progress::on_query_info(const Glib::RefPtr<Gio::AsyncResult>&
error(_("Not enough memory available to load the image"));
// Read the first chunk from the file
m_stream->read_async(m_data->data, std::min<gsize>(CHUNK_SIZE, m_data->binary_length), sigc::bind(sigc::mem_fun(*this, &Dialog_Image_Progress::on_stream_read), 0));
m_stream->read_async(m_data->data, std::min<gsize>(CHUNK_SIZE, m_data->binary_length), sigc::bind(sigc::mem_fun(*this, &DialogImageLoadProgress::on_stream_read), 0));
}
catch(const Glib::Error& ex)
{
......@@ -125,7 +125,7 @@ void Dialog_Image_Progress::on_query_info(const Glib::RefPtr<Gio::AsyncResult>&
}
}
void Dialog_Image_Progress::on_stream_read(const Glib::RefPtr<Gio::AsyncResult>& result, unsigned int offset)
void DialogImageLoadProgress::on_stream_read(const Glib::RefPtr<Gio::AsyncResult>& result, unsigned int offset)
{
try
{
......@@ -142,7 +142,7 @@ void Dialog_Image_Progress::on_stream_read(const Glib::RefPtr<Gio::AsyncResult>&
// Even if choose a priority lower than GDK_PRIORITY_REDRAW + 10 for the
// read_async we don't see the progressbar progressing while the image
// is loading. Therefore we put an idle inbetween.
Glib::signal_idle().connect(sigc::bind_return(sigc::bind(sigc::mem_fun(*this, &Dialog_Image_Progress::on_read_next), offset + size), false));
Glib::signal_idle().connect(sigc::bind_return(sigc::bind(sigc::mem_fun(*this, &DialogImageLoadProgress::on_read_next), offset + size), false));
else
// We are done loading the image, close the progress dialog
response(Gtk::RESPONSE_ACCEPT);
......@@ -153,14 +153,14 @@ void Dialog_Image_Progress::on_stream_read(const Glib::RefPtr<Gio::AsyncResult>&
}
}
void Dialog_Image_Progress::on_read_next(unsigned int at)
void DialogImageLoadProgress::on_read_next(unsigned int at)
{
g_assert(at < static_cast<gsize>(m_data->binary_length));
m_stream->read_async(m_data->data + at, std::min<gsize>(CHUNK_SIZE, m_data->binary_length - at), sigc::bind(sigc::mem_fun(*this, &Dialog_Image_Progress::on_stream_read), at));
m_stream->read_async(m_data->data + at, std::min<gsize>(CHUNK_SIZE, m_data->binary_length - at), sigc::bind(sigc::mem_fun(*this, &DialogImageLoadProgress::on_stream_read), at));
}
void Dialog_Image_Progress::error(const Glib::ustring& error_message)
void DialogImageLoadProgress::error(const Glib::ustring& error_message)
{
Gtk::MessageDialog dialog(*this, Glib::ustring::compose(_("Error loading %1"), m_file->get_parse_name()), Gtk::MESSAGE_ERROR);
dialog.set_title(_("Error loading image"));
......@@ -170,12 +170,12 @@ void Dialog_Image_Progress::error(const Glib::ustring& error_message)
response(Gtk::RESPONSE_REJECT);
}
std::auto_ptr<GdaBinary> Dialog_Image_Progress::get_image_data()
std::auto_ptr<GdaBinary> DialogImageLoadProgress::get_image_data()
{
return m_data;
}
Glib::RefPtr<Gdk::Pixbuf> Dialog_Image_Progress::get_pixbuf()
Glib::RefPtr<Gdk::Pixbuf> DialogImageLoadProgress::get_pixbuf()
{
return m_loader->get_pixbuf();
}
......
......@@ -18,8 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef GLOM_UTILITY_WIDGETS_DIALOG_IMAGE_PROGRESS_H
#define GLOM_UTILITY_WIDGETS_DIALOG_IMAGE_PROGRESS_H
#ifndef GLOM_UTILITY_WIDGETS_DIALOG_IMAGE_LOAD_PROGRESS_H
#define GLOM_UTILITY_WIDGETS_DIALOG_IMAGE_LOAD_PROGRESS_H
#include <gtkmm/dialog.h>
#include <gtkmm/builder.h>
......@@ -33,14 +33,14 @@
namespace Glom
{
class Dialog_Image_Progress : public Gtk::Dialog
class DialogImageLoadProgress : public Gtk::Dialog
{
public:
static const char* glade_id;
static const bool glade_developer;
Dialog_Image_Progress(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
virtual ~Dialog_Image_Progress();
DialogImageLoadProgress(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
virtual ~DialogImageLoadProgress();
void load(const Glib::ustring& uri);
......@@ -66,4 +66,4 @@ private:
} //namespace Glom
#endif // GLOM_UTILITY_WIDGETS_DIALOG_IMAGE_PROGRESS_H
#endif // GLOM_UTILITY_WIDGETS_DIALOG_IMAGE_LOAD_PROGRESS_H
......@@ -334,7 +334,7 @@ void ImageGlom::on_menupopup_activate_select_file()
const Glib::ustring uri = dialog.get_uri();
if(!uri.empty())
{
Dialog_Image_Progress* dialog;
DialogImageLoadProgress* dialog;
Utils::get_glade_widget_derived_with_warning(dialog);
if(dialog)
{
......
......@@ -24,7 +24,7 @@
#include <gtkmm.h>
#include <libglom/data_structure/field.h>
#include "layoutwidgetfield.h"
#include "dialog_image_progress.h"
#include "dialog_image_load_progress.h"
#include <gtkmm/builder.h>
namespace Glom
......
......@@ -120,7 +120,7 @@ glom/mode_data/datawidget/combochoiceswithtreemodel.cc
glom/mode_data/datawidget/datawidget.cc
glom/mode_data/db_adddel/db_adddel.cc
glom/mode_data/datawidget/dialog_choose_id.cc
glom/utility_widgets/dialog_image_progress.cc
glom/utility_widgets/dialog_image_load_progress.cc
glom/mode_data/datawidget/entry.cc
glom/utility_widgets/eggspreadtable/eggspreadtable.c
glom/utility_widgets/filechooserdialog_saveextras.cc
......@@ -138,7 +138,7 @@ ui/operator/dialog_connection.glade
ui/operator/dialog_data_invalid_format.glade
ui/operator/dialog_existing_or_new.glade
ui/operator/dialog_find_id.glade
ui/operator/dialog_image_progress.glade
ui/operator/dialog_image_load_progress.glade
ui/operator/dialog_import_csv.glade
ui/operator/dialog_import_csv_progress.glade
ui/operator/window_main.glade
......
......@@ -14,7 +14,7 @@
#include <glom/mode_data/datawidget/dialog_choose_date.h>
#include <glom/mode_data/datawidget/dialog_choose_id.h>
#include <glom/utility_widgets/dialog_flowtable.h>
#include <glom/utility_widgets/dialog_image_progress.h>
#include <glom/utility_widgets/dialog_image_load_progress.h>
#include <glom/mode_design/layout/dialog_choose_field.h>
#include <glom/mode_design/dialog_add_related_table.h>
#include <glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h>
......@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
instantiate_widget<DataWidgetChildren::Dialog_ChooseID>();
instantiate_widget<DataWidgetChildren::Dialog_ChooseDate>();
instantiate_widget<Dialog_InvalidData>();
instantiate_widget<Dialog_Image_Progress>();
instantiate_widget<DialogImageLoadProgress>();
instantiate_widget<Dialog_ProgressCreating>();
//Developer mode UI:
......
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