Commit fd6dea1e authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming
Browse files

Rename this to:

2007-11-21  Murray Cumming  <murrayc@murrayc.com>

* glom/application.cc:
* glom/utility_widgets/Makefile.am:
* glom/utility_widgets/filechooserdialog.cc:
* glom/utility_widgets/filechooserdialog.h: Rename this to:
* glom/utility_widgets/filechooserdialog_saveextras.cc:
* glom/utility_widgets/filechooserdialog_saveextras.h:
because I want to add another custom one for loading.

svn path=/trunk/; revision=1302
parent eec6f484
2007-11-21 Murray Cumming <murrayc@murrayc.com>
* glom/application.cc:
* glom/utility_widgets/Makefile.am:
* glom/utility_widgets/filechooserdialog.cc:
* glom/utility_widgets/filechooserdialog.h: Rename this to:
* glom/utility_widgets/filechooserdialog_saveextras.cc:
* glom/utility_widgets/filechooserdialog_saveextras.h:
because I want to add another custom one for loading.
2007-11-20 Murray Cumming <murrayc@murrayc.com>
* configure.in:
......
......@@ -27,7 +27,7 @@
#include <glom/translation/window_translations.h>
#endif // !GLOM_ENABLE_CLIENT_ONLY
#include <glom/utility_widgets/filechooserdialog.h>
#include <glom/utility_widgets/filechooserdialog_saveextras.h>
#include <glom/libglom/utils.h>
#include "config.h" //For VERSION.
......@@ -583,18 +583,19 @@ Glib::ustring App_Glom::get_file_uri_without_extension(const Glib::ustring& uri)
}
}
//TODO: This isn't needed for client-only mode.
Glib::ustring App_Glom::ui_file_select_save(const Glib::ustring& old_file_uri) //override
{
//Reimplement this whole function, just so we can use our custom FileChooserDialog class:
App& app = *this;
std::auto_ptr<Gtk::FileChooserDialog> fileChooser_Save;
Glom::FileChooserDialog* fileChooser_SaveExtras = 0;
Glom::FileChooserDialog_SaveExtras* fileChooser_SaveExtras = 0;
//Create the appropriate dialog, depending on how the caller set m_ui_save_extra_showextras:
if(m_ui_save_extra_showextras)
{
fileChooser_SaveExtras = new Glom::FileChooserDialog(gettext("Save Document"), Gtk::FILE_CHOOSER_ACTION_SAVE);
fileChooser_SaveExtras = new Glom::FileChooserDialog_SaveExtras(gettext("Save Document"), Gtk::FILE_CHOOSER_ACTION_SAVE);
fileChooser_Save.reset(fileChooser_SaveExtras);
}
else
......@@ -602,11 +603,8 @@ Glib::ustring App_Glom::ui_file_select_save(const Glib::ustring& old_file_uri) /
fileChooser_Save.reset(new Gtk::FileChooserDialog(gettext("Save Document"), Gtk::FILE_CHOOSER_ACTION_SAVE));
}
#ifndef GLOM_ENABLE_MAEMO
// The maemo version is able to run with gtkmm 2.6
// TODO_maemo: This should probably use Hildon FileChooser API
fileChooser_Save->set_do_overwrite_confirmation(); //Ask the user if the file already exists.
#endif
Gtk::Window* pWindow = dynamic_cast<Gtk::Window*>(&app);
if(pWindow)
......
......@@ -575,7 +575,7 @@ void Window_Translations::on_button_import()
if (setjmp(jump) != 0)
return;
Gtk::FileChooserDialog file_dlg(_("Choose .po file name"), Gtk::FILE_CHOOSER_ACTION_OPEN);
Gtk::FileChooserDialog file_dlg(_("Choose .po File Name"), Gtk::FILE_CHOOSER_ACTION_OPEN);
// Only po files
Gtk::FileFilter filter;
......
......@@ -35,7 +35,7 @@ libutility_widgets_a_SOURCES = alignment_justified.cc alignment_justified.h \
labelglom.h labelglom.cc \
dialog_choose_id.cc dialog_choose_id.h \
dialog_choose_date.cc dialog_choose_date.h \
filechooserdialog.cc filechooserdialog.h \
filechooserdialog_saveextras.cc filechooserdialog_saveextras.h \
dragbutton.cc dragbutton.h \
dragbar.cc dragwindow.h \
placeholder-glom.h placeholder-glom.cc \
......
......@@ -18,8 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
#include <glom/utility_widgets/filechooserdialog_saveextras.h>
#include <glom/libglom/utils.h>
#include <glom/utility_widgets/filechooserdialog.h>
#include <gtkmm/alignment.h>
#include <bakery/App/App_Gtk.h> //For util_bold_message().
#include <glibmm/i18n.h>
......@@ -27,41 +27,41 @@
namespace Glom
{
FileChooserDialog::FileChooserDialog(const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend)
FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras(const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend)
: Gtk::FileChooserDialog(title, action, backend)
{
create_child_widgets();
}
FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend)
FileChooserDialog_SaveExtras::FileChooserDialog_SaveExtras(Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend)
: Gtk::FileChooserDialog(parent, title, action, backend)
{
create_child_widgets();
}
FileChooserDialog::FileChooserDialog (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::FileChooserDialog (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();
}
FileChooserDialog::~FileChooserDialog()
FileChooserDialog_SaveExtras::~FileChooserDialog_SaveExtras()
{
}
void FileChooserDialog::set_extra_message(const Glib::ustring& message)
void FileChooserDialog_SaveExtras::set_extra_message(const Glib::ustring& message)
{
m_label_extra_message.set_text(message);
}
void FileChooserDialog::create_child_widgets()
void FileChooserDialog_SaveExtras::create_child_widgets()
{
//m_extra_widget.pack_start(m_label_extra_message);
m_label_extra_message.set_alignment(0.0f, 0.5f);
......@@ -118,25 +118,25 @@ void FileChooserDialog::create_child_widgets()
m_extra_widget.show();
}
void FileChooserDialog::set_extra_newdb_title(const Glib::ustring& title)
void FileChooserDialog_SaveExtras::set_extra_newdb_title(const Glib::ustring& title)
{
m_entry_title.set_text(title);
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
void FileChooserDialog::set_extra_newdb_self_hosted(bool self_hosted)
void FileChooserDialog_SaveExtras::set_extra_newdb_self_hosted(bool self_hosted)
{
m_radiobutton_server_selfhosted.set_active(self_hosted);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
Glib::ustring FileChooserDialog::get_extra_newdb_title() const
Glib::ustring FileChooserDialog_SaveExtras::get_extra_newdb_title() const
{
return m_entry_title.get_text();
}
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool FileChooserDialog::get_extra_newdb_self_hosted() const
bool FileChooserDialog_SaveExtras::get_extra_newdb_self_hosted() const
{
return m_radiobutton_server_selfhosted.get_active();
}
......
......@@ -18,8 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef GLOM_UTILITY_WIDGETS_FILECHOOSERDIALOG_GLOM_H
#define GLOM_UTILITY_WIDGETS_FILECHOOSERDIALOG_GLOM_H
#ifndef GLOM_UTILITY_WIDGETS_FILECHOOSERDIALOG_SAVEEXTRAS_H
#define GLOM_UTILITY_WIDGETS_FILECHOOSERDIALOG_SAVEEXTRAS_H
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/label.h>
......@@ -33,14 +33,14 @@
namespace Glom
{
class FileChooserDialog : public Gtk::FileChooserDialog
class FileChooserDialog_SaveExtras : public Gtk::FileChooserDialog
{
public:
FileChooserDialog(const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend);
FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend);
FileChooserDialog (const Glib::ustring& title, Gtk::FileChooserAction action = Gtk::FILE_CHOOSER_ACTION_OPEN);
FileChooserDialog (Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action = Gtk::FILE_CHOOSER_ACTION_OPEN);
virtual ~FileChooserDialog();
FileChooserDialog_SaveExtras(const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend);
FileChooserDialog_SaveExtras(Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action, const Glib::ustring& backend);
FileChooserDialog_SaveExtras(const Glib::ustring& title, Gtk::FileChooserAction action = Gtk::FILE_CHOOSER_ACTION_OPEN);
FileChooserDialog_SaveExtras(Gtk::Window& parent, const Glib::ustring& title, Gtk::FileChooserAction action = Gtk::FILE_CHOOSER_ACTION_OPEN);
virtual ~FileChooserDialog_SaveExtras();
void set_extra_message(const Glib::ustring& message);
void set_extra_newdb_title(const Glib::ustring& title);
......
......@@ -379,7 +379,7 @@ void ImageGlom::on_menupopup_activate_select_file()
if(m_read_only)
return;
Gtk::FileChooserDialog dialog(_("Choose image"), Gtk::FILE_CHOOSER_ACTION_OPEN);
Gtk::FileChooserDialog dialog(_("Choose Image"), Gtk::FILE_CHOOSER_ACTION_OPEN);
//Get image formats only:
Gtk::FileFilter filter;
......
Supports Markdown
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