summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-11-29 19:01:07 +0000
committerTed Gould <ted@gould.cx>2009-11-29 19:01:07 +0000
commit29d3c0b15028e61f176df3a75189bf0959d0d03e (patch)
tree727afe596c693a9bdd098d72618abd9ceb0d1969 /src/ui
parentAdd the build dir dbus directory to grab some headerfiles for distcheck. (diff)
parenthopefully fix build on linux (diff)
downloadinkscape-29d3c0b15028e61f176df3a75189bf0959d0d03e.tar.gz
inkscape-29d3c0b15028e61f176df3a75189bf0959d0d03e.zip
Merging in from trunk
(bzr r8254.1.37)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp35
-rw-r--r--src/ui/dialog/Makefile_insert4
-rw-r--r--src/ui/dialog/calligraphic-presets.h14
-rw-r--r--src/ui/dialog/document-properties.cpp51
-rw-r--r--src/ui/dialog/filedialog.cpp17
-rw-r--r--src/ui/dialog/filedialog.h12
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp35
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.h21
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp21
-rw-r--r--src/ui/dialog/filedialogimpl-win32.h17
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp12
-rw-r--r--src/ui/dialog/guides.cpp2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp39
-rw-r--r--src/ui/dialog/inkscape-preferences.h17
-rw-r--r--src/ui/dialog/layers.cpp51
-rw-r--r--src/ui/dialog/layers.h1
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp2
-rw-r--r--src/ui/dialog/ocaldialogs.cpp40
-rw-r--r--src/ui/dialog/ocaldialogs.h48
-rw-r--r--src/ui/dialog/print.cpp36
-rw-r--r--src/ui/dialog/swatches.cpp12
-rw-r--r--src/ui/icon-names.h2
-rw-r--r--src/ui/view/edit-widget.cpp11
-rw-r--r--src/ui/widget/selected-style.cpp1
24 files changed, 346 insertions, 155 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 7e41006be..af0ec0129 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -148,6 +148,8 @@ private:
void _setClipboardColor(guint32);
void _userWarn(SPDesktop *, char const *);
+ void _inkscape_wait_for_targets(std::list<Glib::ustring> &);
+
// private properites
SPDocument *_clipboardSPDoc; ///< Document that stores the clipboard until someone requests it
Inkscape::XML::Node *_defs; ///< Reference to the clipboard document's defs node
@@ -1226,7 +1228,9 @@ Geom::Scale ClipboardManagerImpl::_getScale(Geom::Point const &min, Geom::Point
*/
Glib::ustring ClipboardManagerImpl::_getBestTarget()
{
- std::list<Glib::ustring> targets = _clipboard->wait_for_targets();
+ // GTKmm's wait_for_targets() is broken, see the comment in _inkscape_wait_for_targets()
+ std::list<Glib::ustring> targets; // = _clipboard->wait_for_targets();
+ _inkscape_wait_for_targets(targets);
// clipboard target debugging snippet
/*
@@ -1365,6 +1369,35 @@ void ClipboardManagerImpl::_userWarn(SPDesktop *desktop, char const *msg)
}
+// GTKMM's clipboard::wait_for_targets is buggy and might return bogus, see
+//
+// https://bugs.launchpad.net/inkscape/+bug/296778
+// http://mail.gnome.org/archives/gtk-devel-list/2009-June/msg00062.html
+//
+// for details. Until this has been fixed upstream we will use our own implementation
+// of this method, as copied from /gtkmm-2.16.0/gtk/gtkmm/clipboard.cc.
+void ClipboardManagerImpl::_inkscape_wait_for_targets(std::list<Glib::ustring> &listTargets)
+{
+ //Get a newly-allocated array of atoms:
+ GdkAtom* targets = 0;
+ gint n_targets = 0;
+ gboolean test = gtk_clipboard_wait_for_targets( gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), &targets, &n_targets );
+ if(!test)
+ n_targets = 0; //otherwise it will be -1.
+
+ //Add the targets to the C++ container:
+ for(int i = 0; i < n_targets; i++)
+ {
+ //Convert the atom to a string:
+ gchar* const atom_name = gdk_atom_name(targets[i]);
+
+ Glib::ustring target;
+ if(atom_name)
+ target = Glib::ScopedPtr<char>(atom_name).get(); //This frees the gchar*.
+
+ listTargets.push_back(target);
+ }
+}
/* #######################################
ClipboardManager class
diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert
index 5cd437c26..565a24ecc 100644
--- a/src/ui/dialog/Makefile_insert
+++ b/src/ui/dialog/Makefile_insert
@@ -1,6 +1,6 @@
## Makefile.am fragment sourced by src/Makefile.am.
-if WITH_INKBOARD
+##if WITH_INKBOARD
## inkboard_dialogs = \
## ui/dialog/whiteboard-connect.cpp \
## ui/dialog/whiteboard-connect.h \
@@ -8,7 +8,7 @@ if WITH_INKBOARD
## ui/dialog/whiteboard-sharewithchat.h \
## ui/dialog/whiteboard-sharewithuser.cpp \
## ui/dialog/whiteboard-sharewithuser.h
-endif
+##endif
ink_common_sources += \
ui/dialog/aboutbox.cpp \
diff --git a/src/ui/dialog/calligraphic-presets.h b/src/ui/dialog/calligraphic-presets.h
deleted file mode 100644
index 89f963ee8..000000000
--- a/src/ui/dialog/calligraphic-presets.h
+++ /dev/null
@@ -1,14 +0,0 @@
-char * stringlst = [
-/* TRANSLATORS: calligraphic pen type */
-N_("Dip pen"),
-/* TRANSLATORS: calligraphic pen type */
-N_("Marker"),
-/* TRANSLATORS: calligraphic pen type */
-N_("Brush"),
-/* TRANSLATORS: calligraphic pen type */
-N_("Wiggly"),
-/* TRANSLATORS: calligraphic pen type */
-N_("Splotchy"),
-/* TRANSLATORS: calligraphic pen type */
-N_("Tracing"),
-];
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index bb9ab4d02..7e31b874a 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -381,8 +381,40 @@ DocumentProperties::populate_available_profiles(){
_menu.show_all();
}
-void
-DocumentProperties::linkSelectedProfile()
+/**
+ * Cleans up name to remove disallowed characters.
+ * Some discussion at http://markmail.org/message/bhfvdfptt25kgtmj
+ * Allowed ASCII first characters: ':', 'A'-'Z', '_', 'a'-'z'
+ * Allowed ASCII remaining chars add: '-', '.', '0'-'9',
+ *
+ * @param str the string to clean up.
+ */
+static void sanitizeName( Glib::ustring& str )
+{
+ if (str.size() > 1) {
+ char val = str.at(0);
+ if (((val < 'A') || (val > 'Z'))
+ && ((val < 'a') || (val > 'z'))
+ && (val != '_')
+ && (val != ':')) {
+ str.replace(0, 1, "-");
+ }
+ for (Glib::ustring::size_type i = 1; i < str.size(); i++) {
+ char val = str.at(i);
+ if (((val < 'A') || (val > 'Z'))
+ && ((val < 'a') || (val > 'z'))
+ && ((val < '0') || (val > '9'))
+ && (val != '_')
+ && (val != ':')
+ && (val != '-')
+ && (val != '.')) {
+ str.replace(i, 1, "-");
+ }
+ }
+ }
+}
+
+void DocumentProperties::linkSelectedProfile()
{
//store this profile in the SVG document (create <color-profile> element in the XML)
// TODO remove use of 'active' desktop
@@ -396,7 +428,10 @@ DocumentProperties::linkSelectedProfile()
}
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
Inkscape::XML::Node *cprofRepr = xml_doc->createElement("svg:color-profile");
- cprofRepr->setAttribute("name", (gchar*) _menu.get_active()->get_data("name"));
+ gchar* tmp = static_cast<gchar*>(_menu.get_active()->get_data("name"));
+ Glib::ustring nameStr = tmp ? tmp : "profile"; // TODO add some auto-numbering to avoid collisions
+ sanitizeName(nameStr);
+ cprofRepr->setAttribute("name", nameStr.c_str());
cprofRepr->setAttribute("xlink:href", (gchar*) _menu.get_active()->get_data("filepath"));
// Checks whether there is a defs element. Creates it when needed
@@ -653,7 +688,7 @@ void DocumentProperties::removeExternalScript(){
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
SPScript* script = (SPScript*) obj;
- if (!name.compare(script->xlinkhref)){
+ if (name == script->xlinkhref){
sp_repr_unparent(obj->repr);
sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script"));
}
@@ -671,8 +706,12 @@ void DocumentProperties::populate_external_scripts_box(){
while ( current ) {
SPObject* obj = SP_OBJECT(current->data);
SPScript* script = (SPScript*) obj;
- Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append());
- row[_ExternalScriptsListColumns.filenameColumn] = script->xlinkhref;
+ if (script->xlinkhref)
+ {
+ Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append());
+ row[_ExternalScriptsListColumns.filenameColumn] = script->xlinkhref;
+ }
+
current = g_slist_next(current);
}
}
diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp
index 172edf8a5..68c0926aa 100644
--- a/src/ui/dialog/filedialog.cpp
+++ b/src/ui/dialog/filedialog.cpp
@@ -105,16 +105,17 @@ Glib::ustring FileOpenDialog::getFilename()
* Public factory method. Used in file.cpp
*/
FileSaveDialog *FileSaveDialog::create(Gtk::Window& parentWindow,
- const Glib::ustring &path,
+ const Glib::ustring &path,
FileDialogType fileTypes,
const char *title,
const Glib::ustring &default_key,
- const gchar *docTitle)
+ const gchar *docTitle,
+ const Inkscape::Extension::FileSaveMethod save_method)
{
#ifdef WIN32
- FileSaveDialog *dialog = new FileSaveDialogImplWin32(parentWindow, path, fileTypes, title, default_key, docTitle);
+ FileSaveDialog *dialog = new FileSaveDialogImplWin32(parentWindow, path, fileTypes, title, default_key, docTitle, save_method);
#else
- FileSaveDialog *dialog = new FileSaveDialogImplGtk(parentWindow, path, fileTypes, title, default_key, docTitle);
+ FileSaveDialog *dialog = new FileSaveDialogImplGtk(parentWindow, path, fileTypes, title, default_key, docTitle, save_method);
#endif
return dialog;
}
@@ -165,11 +166,13 @@ void FileSaveDialog::appendExtension(Glib::ustring& path, Inkscape::Extension::O
//# F I L E E X P O R T
//########################################################################
+#ifdef NEW_EXPORT_DIALOG
+
/**
* Public factory method. Used in file.cpp
*/
- FileExportDialog *FileExportDialog::create(Gtk::Window& parentWindow,
- const Glib::ustring &path,
+FileExportDialog *FileExportDialog::create(Gtk::Window& parentWindow,
+ const Glib::ustring &path,
FileDialogType fileTypes,
const char *title,
const Glib::ustring &default_key)
@@ -178,6 +181,8 @@ void FileSaveDialog::appendExtension(Glib::ustring& path, Inkscape::Extension::O
return dialog;
}
+#endif // NEW_EXPORT_DIALOG
+
} //namespace Dialog
} //namespace UI
diff --git a/src/ui/dialog/filedialog.h b/src/ui/dialog/filedialog.h
index 52dcd1b23..472c4ac0b 100644
--- a/src/ui/dialog/filedialog.h
+++ b/src/ui/dialog/filedialog.h
@@ -21,6 +21,10 @@
#include <set>
#include <gtkmm.h>
+#include "extension/system.h"
+
+class SPDocument;
+
namespace Inkscape {
namespace Extension {
class Extension;
@@ -163,7 +167,8 @@ public:
FileDialogType fileTypes,
const char *title,
const Glib::ustring &default_key,
- const gchar *docTitle);
+ const gchar *docTitle,
+ const Inkscape::Extension::FileSaveMethod save_method);
/**
@@ -223,7 +228,9 @@ protected:
}; //FileSaveDialog
+//#define NEW_EXPORT_DIALOG
+#ifdef NEW_EXPORT_DIALOG
/**
* This class provides an implementation-independent API for
@@ -361,12 +368,13 @@ public:
}; //FileExportDialog
+#endif // NEW_EXPORT_DIALOG
+
} //namespace Dialog
} //namespace UI
} //namespace Inkscape
-
#endif /* __FILE_DIALOG_H__ */
/*
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp
index 70f2f2ae5..e650cf842 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.cpp
+++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp
@@ -883,8 +883,11 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk( Gtk::Window &parentWindow,
FileDialogType fileTypes,
const Glib::ustring &title,
const Glib::ustring &/*default_key*/,
- const gchar* docTitle) :
- FileDialogBaseGtk(parentWindow, title, Gtk::FILE_CHOOSER_ACTION_SAVE, fileTypes, "/dialogs/save_as")
+ const gchar* docTitle,
+ const Inkscape::Extension::FileSaveMethod save_method) :
+ FileDialogBaseGtk(parentWindow, title, Gtk::FILE_CHOOSER_ACTION_SAVE, fileTypes,
+ (save_method == Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY) ? "/dialogs/save_copy" : "/dialogs/save_as"),
+ save_method(save_method)
{
FileSaveDialog::myDocTitle = docTitle;
@@ -922,7 +925,11 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk( Gtk::Window &parentWindow,
//###### Do we want the .xxx extension automatically added?
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
fileTypeCheckbox.set_label(Glib::ustring(_("Append filename extension automatically")));
- fileTypeCheckbox.set_active(prefs->getBool("/dialogs/save_as/append_extension", true));
+ if (save_method == Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY) {
+ fileTypeCheckbox.set_active(prefs->getBool("/dialogs/save_copy/append_extension", true));
+ } else {
+ fileTypeCheckbox.set_active(prefs->getBool("/dialogs/save_as/append_extension", true));
+ }
createFileTypeMenu();
fileTypeComboBox.set_size_request(200,40);
@@ -1109,10 +1116,13 @@ FileSaveDialogImplGtk::show()
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
// Store changes of the "Append filename automatically" checkbox back to preferences.
- prefs->setBool("/dialogs/save_as/append_extension", fileTypeCheckbox.get_active());
+ if (save_method == Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY) {
+ prefs->setBool("/dialogs/save_copy/append_extension", fileTypeCheckbox.get_active());
+ } else {
+ prefs->setBool("/dialogs/save_as/append_extension", fileTypeCheckbox.get_active());
+ }
- // Store the last used save-as filetype to preferences.
- prefs->setString("/dialogs/save_as/default", ( extension != NULL ? extension->get_id() : "" ));
+ Inkscape::Extension::store_file_extension_in_prefs ((extension != NULL ? extension->get_id() : "" ), save_method);
cleanup( true );
@@ -1234,12 +1244,15 @@ void FileSaveDialogImplGtk::updateNameAndExtension()
Inkscape::Extension::Output* newOut = extension ? dynamic_cast<Inkscape::Extension::Output*>(extension) : 0;
if ( fileTypeCheckbox.get_active() && newOut ) {
- // Append the file extension if it's not already present
+ // Append the file extension if it's not already present and display it in the file name entry field
appendExtension(myFilename, newOut);
+ change_path(myFilename);
}
}
+#ifdef NEW_EXPORT_DIALOG
+
//########################################################################
//# F I L E E X P O R T
//########################################################################
@@ -1355,7 +1368,7 @@ FileExportDialogImpl::FileExportDialogImpl( Gtk::Window& parentWindow,
destDPISpinner("DPI", _("Resolution (dots per inch)"))
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- append_extension = prefs->getBool("/dialogs/save_as/append_extension", true);
+ append_extension = prefs->getBool("/dialogs/save_export/append_extension", true);
/* One file at a time */
set_select_multiple(false);
@@ -1565,8 +1578,8 @@ FileExportDialogImpl::show()
append_extension = checkbox.get_active();
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setBool("/dialogs/save_as/append_extension", append_extension);
- prefs->setBool("/dialogs/save_as/default", ( extension != NULL ? extension->get_id() : "" ));
+ prefs->setBool("/dialogs/save_export/append_extension", append_extension);
+ prefs->setBool("/dialogs/save_export/default", ( extension != NULL ? extension->get_id() : "" ));
*/
return TRUE;
}
@@ -1596,6 +1609,8 @@ FileExportDialogImpl::getFilename()
return myFilename;
}
+#endif // NEW_EXPORT_DIALOG
+
} //namespace Dialog
} //namespace UI
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h
index 90dddce59..65bb38971 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.h
+++ b/src/ui/dialog/filedialogimpl-gtkmm.h
@@ -18,6 +18,7 @@
#define __FILE_DIALOGIMPL_H__
#include "filedialog.h"
+#include "extension/system.h"
//General includes
#include <unistd.h>
@@ -281,11 +282,12 @@ class FileSaveDialogImplGtk : public FileSaveDialog, public FileDialogBaseGtk
public:
FileSaveDialogImplGtk(Gtk::Window &parentWindow,
- const Glib::ustring &dir,
- FileDialogType fileTypes,
- const Glib::ustring &title,
- const Glib::ustring &default_key,
- const gchar* docTitle);
+ const Glib::ustring &dir,
+ FileDialogType fileTypes,
+ const Glib::ustring &title,
+ const Glib::ustring &default_key,
+ const gchar* docTitle,
+ const Inkscape::Extension::FileSaveMethod save_method);
virtual ~FileSaveDialogImplGtk();
@@ -302,6 +304,12 @@ private:
void updateNameAndExtension();
/**
+ * The file save method (essentially whether the dialog was invoked by "Save as ..." or "Save a
+ * copy ..."), which is used to determine file extensions and save paths.
+ */
+ Inkscape::Extension::FileSaveMethod save_method;
+
+ /**
* Fix to allow the user to type the file name
*/
Gtk::Entry *fileNameEntry;
@@ -349,6 +357,8 @@ private:
+#ifdef NEW_EXPORT_DIALOG
+
//########################################################################
//# F I L E E X P O R T
//########################################################################
@@ -565,6 +575,7 @@ private:
Glib::ustring myFilename;
};
+#endif // NEW_EXPORT_DIALOG
} // namespace Dialog
} // namespace UI
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index 6fd753abb..d22a368f2 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -193,11 +193,11 @@ void FileOpenDialogImplWin32::createFilterMenu()
ustring all_inkscape_files_filter, all_image_files_filter, all_vectors_filter, all_bitmaps_filter;
Filter all_files, all_inkscape_files, all_image_files, all_vectors, all_bitmaps;
- const gchar *all_files_filter_name = N_("All Files");
- const gchar *all_inkscape_files_filter_name = N_("All Inkscape Files");
- const gchar *all_image_files_filter_name = N_("All Images");
- const gchar *all_vectors_filter_name = N_("All Vectors");
- const gchar *all_bitmaps_filter_name = N_("All Bitmaps");
+ const gchar *all_files_filter_name = _("All Files");
+ const gchar *all_inkscape_files_filter_name = _("All Inkscape Files");
+ const gchar *all_image_files_filter_name = _("All Images");
+ const gchar *all_vectors_filter_name = _("All Vectors");
+ const gchar *all_bitmaps_filter_name = _("All Bitmaps");
// Calculate the amount of memory required
int filter_count = 5; // 5 - one for each filter type
@@ -608,9 +608,12 @@ LRESULT CALLBACK FileOpenDialogImplWin32::preview_wnd_proc(HWND hwnd, UINT uMsg,
if(pImpl->_path_string[0] == 0)
{
+ WCHAR* noFileText=(WCHAR*)g_utf8_to_utf16(_("No file selected"),
+ -1, NULL, NULL, NULL);
FillRect(dc, &rcClient, (HBRUSH)(COLOR_3DFACE + 1));
- DrawText(dc, _("No file selected"), -1, &rcClient,
+ DrawTextW(dc, noFileText, -1, &rcClient,
DT_CENTER | DT_VCENTER | DT_NOPREFIX);
+ g_free(noFileText);
}
else if(pImpl->_preview_bitmap != NULL)
{
@@ -1494,8 +1497,10 @@ FileSaveDialogImplWin32::FileSaveDialogImplWin32(Gtk::Window &parent,
FileDialogType fileTypes,
const char *title,
const Glib::ustring &/*default_key*/,
- const char *docTitle) :
- FileDialogBaseWin32(parent, dir, title, fileTypes, "dialogs.save_as"),
+ const char *docTitle,
+ const Inkscape::Extension::FileSaveMethod save_method) :
+ FileDialogBaseWin32(parent, dir, title, fileTypes,
+ (save_method == Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY) ? "dialogs.save_copy" : "dialogs.save_as"),
_title_label(NULL),
_title_edit(NULL)
{
diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h
index bb026169a..4234c1782 100644
--- a/src/ui/dialog/filedialogimpl-win32.h
+++ b/src/ui/dialog/filedialogimpl-win32.h
@@ -120,9 +120,9 @@ public:
/// @param title The title caption for the dialog in UTF-8
/// @param type The dialog type
FileOpenDialogImplWin32(Gtk::Window &parent,
- const Glib::ustring &dir,
- FileDialogType fileTypes,
- const char *title);
+ const Glib::ustring &dir,
+ FileDialogType fileTypes,
+ const char *title);
/// Destructor
virtual ~FileOpenDialogImplWin32();
@@ -306,11 +306,12 @@ class FileSaveDialogImplWin32 : public FileSaveDialog, public FileDialogBaseWin3
public:
FileSaveDialogImplWin32(Gtk::Window &parent,
- const Glib::ustring &dir,
- FileDialogType fileTypes,
- const char *title,
- const Glib::ustring &default_key,
- const char *docTitle);
+ const Glib::ustring &dir,
+ FileDialogType fileTypes,
+ const char *title,
+ const Glib::ustring &default_key,
+ const char *docTitle,
+ const Inkscape::Extension::FileSaveMethod save_method);
/// Destructor
virtual ~FileSaveDialogImplWin32();
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 1a73dd9a1..c7f505046 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -15,7 +15,7 @@
# include <config.h>
#endif
-#include <gtk/gtktreeview.h>
+#include <gtk/gtk.h>
#include <gtkmm/cellrenderertext.h>
#include <gtkmm/colorbutton.h>
#include <gtkmm/messagedialog.h>
@@ -462,7 +462,7 @@ public:
ColorMatrixValues()
: AttrWidget(SP_ATTR_VALUES),
// TRANSLATORS: this dialog is accessible via menu Filters - Filter editor
- _matrix(SP_ATTR_VALUES, _("This matrix determines a linear transform on colour space. Each line affects one of the color components. Each column determines how much of each color component from the input is passed to the output. The last column does not depend on input colors, so can be used to adjust a constant component value.")),
+ _matrix(SP_ATTR_VALUES, _("This matrix determines a linear transform on color space. Each line affects one of the color components. Each column determines how much of each color component from the input is passed to the output. The last column does not depend on input colors, so can be used to adjust a constant component value.")),
_saturation(0, 0, 1, 0.1, 0.01, 2, SP_ATTR_VALUES),
_angle(0, 0, 360, 0.1, 0.01, 1, SP_ATTR_VALUES),
_label(_("None"), Gtk::ALIGN_LEFT),
@@ -1315,7 +1315,7 @@ void FilterEffectsDialog::FilterModifier::add_filter()
const int count = _model->children().size();
std::ostringstream os;
- os << "filter" << count;
+ os << _("filter") << count;
filter->setLabel(os.str().c_str());
update_filters();
@@ -2192,7 +2192,7 @@ void FilterEffectsDialog::init_settings_widgets()
//TRANSLATORS: for info on "Kernel", see http://en.wikipedia.org/wiki/Kernel_(matrix)
_convolve_matrix = _settings->add_matrix(SP_ATTR_KERNELMATRIX, _("Kernel:"), _("This matrix describes the convolve operation that is applied to the input image in order to calculate the pixel colors at the output. Different arrangements of values in this matrix result in various possible visual effects. An identity matrix would lead to a motion blur effect (parallel to the matrix diagonal) while a matrix filled with a constant non-zero value would lead to a common blur effect."));
_convolve_order->signal_attr_changed().connect(sigc::mem_fun(*this, &FilterEffectsDialog::convolve_order_changed));
- _settings->add_spinslider(0, SP_ATTR_DIVISOR, _("Divisor:"), 0, 20, 1, 0.1, 2, _("After applying the kernelMatrix to the input image to yield a number, that number is divided by divisor to yield the final destination color value. A divisor that is the sum of all the matrix values tends to have an evening effect on the overall color intensity of the result."));
+ _settings->add_spinslider(0, SP_ATTR_DIVISOR, _("Divisor:"), 0, 1000, 1, 0.1, 2, _("After applying the kernelMatrix to the input image to yield a number, that number is divided by divisor to yield the final destination color value. A divisor that is the sum of all the matrix values tends to have an evening effect on the overall color intensity of the result."));
_settings->add_spinslider(0, SP_ATTR_BIAS, _("Bias:"), -10, 10, 1, 0.01, 1, _("This value is added to each component. This is useful to define a constant value as the zero response of the filter."));
_settings->add_combo(CONVOLVEMATRIX_EDGEMODE_DUPLICATE, SP_ATTR_EDGEMODE, _("Edge Mode:"), ConvolveMatrixEdgeModeConverter, _("Determines how to extend the input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the input image."));
_settings->add_checkbutton(false, SP_ATTR_PRESERVEALPHA, _("Preserve Alpha"), "true", "false", _("If set, the alpha channel won't be altered by this filter primitive."));
@@ -2279,7 +2279,7 @@ void FilterEffectsDialog::update_primitive_infobox()
break;
case(NR_FILTER_COLORMATRIX):
_infobox_icon.set_from_icon_name("feColorMatrix-icon", Gtk::ICON_SIZE_DIALOG);
- _infobox_desc.set_markup(_("The <b>feColorMatrix</b> filter primitive applies a matrix transformation to colour of each rendered pixel. This allows for effects like turning object to grayscale, modifying colour saturation and changing colour hue."));
+ _infobox_desc.set_markup(_("The <b>feColorMatrix</b> filter primitive applies a matrix transformation to color of each rendered pixel. This allows for effects like turning object to grayscale, modifying color saturation and changing color hue."));
break;
case(NR_FILTER_COMPONENTTRANSFER):
_infobox_icon.set_from_icon_name("feComponentTransfer-icon", Gtk::ICON_SIZE_DIALOG);
@@ -2319,7 +2319,7 @@ void FilterEffectsDialog::update_primitive_infobox()
break;
case(NR_FILTER_MORPHOLOGY):
_infobox_icon.set_from_icon_name("feMorphology-icon", Gtk::ICON_SIZE_DIALOG);
- _infobox_desc.set_markup(_("The <b>feMorphology</b> filter primitive provides erode and dilate effects. For single-colour objects erode makes the object thinner and dilate makes it thicker."));
+ _infobox_desc.set_markup(_("The <b>feMorphology</b> filter primitive provides erode and dilate effects. For single-color objects erode makes the object thinner and dilate makes it thicker."));
break;
case(NR_FILTER_OFFSET):
_infobox_icon.set_from_icon_name("feOffset-icon", Gtk::ICON_SIZE_DIALOG);
diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp
index c5d2ae488..3a7964ba2 100644
--- a/src/ui/dialog/guides.cpp
+++ b/src/ui/dialog/guides.cpp
@@ -241,7 +241,7 @@ void GuidelinePropertiesDialog::_setup() {
g_free(label);
}
{
- gchar *guide_description = sp_guide_description(_guide);
+ gchar *guide_description = sp_guide_description(_guide, false);
gchar *label = g_strdup_printf(_("Current: %s"), guide_description);
g_free(guide_description);
_label_descr.set_markup(label);
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index a81446a03..c7dc789ca 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -120,7 +120,7 @@ InkscapePreferences::InkscapePreferences()
initPageCMS();
initPageGrids();
initPageSVGOutput();
- initPageAutosave();
+ initPageSave();
initPageImportExport();
initPageMouse();
initPageScrolling();
@@ -220,16 +220,20 @@ void InkscapePreferences::initPageSnapping()
_snap_delay.init("/options/snapdelay/value", 0, 1000, 50, 100, 300, 0);
_page_snapping.add_line( false, _("Delay (in ms):"), _snap_delay, "",
- _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate"), true);
+ _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true);
_snap_closest_only.init( _("Only snap the node closest to the pointer"), "/options/snapclosestonly/value", false);
_page_snapping.add_line( false, "", _snap_closest_only, "",
- _("Only try to snap the node that is initialy closest to the mouse pointer"));
+ _("Only try to snap the node that is initially closest to the mouse pointer"));
_snap_weight.init("/options/snapweight/value", 0, 1, 0.1, 0.2, 0.5, 1);
_page_snapping.add_line( false, _("Weight factor:"), _snap_weight, "",
_("When multiple snap solutions are found, then Inkscape can either prefer the closest transformation (when set to 0), or prefer the node that was initially the closest to the pointer (when set to 1)"), true);
+ _snap_mouse_pointer.init( _("Snap the mouse pointer when dragging a constrained knot"), "/options/snapmousepointer/value", false);
+ _page_snapping.add_line( false, "", _snap_mouse_pointer, "",
+ _("When dragging a knot along a constraint line, then snap the position of the mouse pointer instead of snapping the projection of the knot onto the constraint line"));
+
this->AddPage(_page_snapping, _("Snapping"), PREFS_PAGE_SNAPPING);
}
@@ -321,7 +325,7 @@ void StyleFromSelectionToTool(Glib::ustring const &prefs_path, StyleSwatch *swat
if (!css) return;
// only store text style for the text tool
- if (prefs_path == "/tools/text") {
+ if (prefs_path != "/tools/text") {
css = sp_css_attr_unset_text (css);
}
@@ -1105,19 +1109,24 @@ void InkscapePreferences::initPageUI()
}
-void InkscapePreferences::initPageAutosave()
+void InkscapePreferences::initPageSave()
{
+ _save_use_current_dir.init( _("Use current directory for \"Save As ...\""), "/dialogs/save_as/use_current_dir", true);
+ _page_save.add_line( false, "", _save_use_current_dir, "",
+ _("When this option is on, the \"Save as...\" dialog will always open in the directory where the currently open document is. When it's off, it will open in the directory where you last saved a file using that dialog."), true);
+
+
// Autosave options
- _autosave_autosave_enable.init( _("Enable autosave (requires restart)"), "/options/autosave/enable", false);
- _page_autosave.add_line(false, "", _autosave_autosave_enable, "", _("Automatically save the current document(s) at a given interval, thus minimizing loss in case of a crash"), false);
- _autosave_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false);
- _page_autosave.add_line(true, _("Interval (in minutes):"), _autosave_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false);
- _autosave_autosave_path.init("/options/autosave/path", true);
+ _save_autosave_enable.init( _("Enable autosave (requires restart)"), "/options/autosave/enable", false);
+ _page_save.add_line(false, "", _save_autosave_enable, "", _("Automatically save the current document(s) at a given interval, thus minimizing loss in case of a crash"), false);
+ _save_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false);
+ _page_save.add_line(true, _("Interval (in minutes):"), _save_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false);
+ _save_autosave_path.init("/options/autosave/path", true);
//TRANSLATORS: only translate "string" in "context|string".
// For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
- _page_autosave.add_line(true, Q_("filesystem|Path:"), _autosave_autosave_path, "", _("The directory where autosaves will be written"), false);
- _autosave_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false);
- _page_autosave.add_line(true, _("Maximum number of autosaves:"), _autosave_autosave_max, "", _("Maximum number of autosaved files; use this to limit the storage space used"), false);
+ _page_save.add_line(true, Q_("filesystem|Path:"), _save_autosave_path, "", _("The directory where autosaves will be written"), false);
+ _save_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false);
+ _page_save.add_line(true, _("Maximum number of autosaves:"), _save_autosave_max, "", _("Maximum number of autosaved files; use this to limit the storage space used"), false);
/* When changing the interval or enabling/disabling the autosave function,
* update our running configuration
@@ -1133,7 +1142,7 @@ void InkscapePreferences::initPageAutosave()
// -----------
- this->AddPage(_page_autosave, _("Autosave"), PREFS_PAGE_AUTOSAVE);
+ this->AddPage(_page_save, _("Save"), PREFS_PAGE_SAVE);
}
void InkscapePreferences::initPageBitmaps()
@@ -1271,7 +1280,7 @@ void InkscapePreferences::initPageMisc()
_misc_simpl.init("/options/simplifythreshold/value", 0.0001, 1.0, 0.0001, 0.0010, 0.0010, false, false);
_page_misc.add_line( false, _("Simplification threshold:"), _misc_simpl, "",
- _("How strong is the Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."), false);
+ _("How strong is the Node tool's Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."), false);
_misc_latency_skew.init("/debug/latency/skew", 0.5, 2.0, 0.01, 0.10, 1.0, false, false);
_page_misc.add_line( false, _("Latency skew:"), _misc_latency_skew, _("(requires restart)"),
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 7bcbe7d49..364b0eb1d 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -69,7 +69,7 @@ enum {
PREFS_PAGE_CMS,
PREFS_PAGE_GRIDS,
PREFS_PAGE_SVGOUTPUT,
- PREFS_PAGE_AUTOSAVE,
+ PREFS_PAGE_SAVE,
PREFS_PAGE_IMPORTEXPORT,
PREFS_PAGE_MOUSE,
PREFS_PAGE_SCROLLING,
@@ -117,7 +117,7 @@ protected:
DialogPage _page_mouse, _page_scrolling, _page_snapping, _page_steps, _page_tools, _page_windows,
_page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
_page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc,
- _page_ui, _page_autosave, _page_bitmaps, _page_spellcheck;
+ _page_ui, _page_save, _page_bitmaps, _page_spellcheck;
DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
_page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper, _page_lpetool;
DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser;
@@ -131,7 +131,7 @@ protected:
PrefCheckButton _wheel_zoom;
Gtk::HScale *_slider_snapping_delay;
- PrefCheckButton _snap_indicator, _snap_closest_only;
+ PrefCheckButton _snap_indicator, _snap_closest_only, _snap_mouse_pointer;
PrefCombo _steps_rot_snap;
PrefCheckButton _steps_compass;
@@ -209,10 +209,11 @@ protected:
PrefCheckButton _misc_bitmap_autoreload;
PrefSpinButton _bitmap_copy_res;
- PrefCheckButton _autosave_autosave_enable;
- PrefSpinButton _autosave_autosave_interval;
- PrefEntry _autosave_autosave_path;
- PrefSpinButton _autosave_autosave_max;
+ PrefCheckButton _save_use_current_dir;
+ PrefCheckButton _save_autosave_enable;
+ PrefSpinButton _save_autosave_interval;
+ PrefEntry _save_autosave_path;
+ PrefSpinButton _save_autosave_max;
Gtk::ComboBoxText _cms_display_profile;
PrefCheckButton _cms_from_display;
@@ -298,7 +299,7 @@ protected:
void initPageSVGOutput();
void initPageUI();
void initPageSpellcheck();
- void initPageAutosave();
+ void initPageSave();
void initPageBitmaps();
void initPageMisc();
void initPageI18n();
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index d79f18801..a06b6c9b6 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -73,12 +73,12 @@ public:
SPObject* _target;
};
-static gboolean layers_panel_activated( GtkObject */*object*/, GdkEvent * /*event*/, gpointer data )
+static gboolean layers_panel_activated(Inkscape::Application * /*inkscape*/, SPDesktop *desktop, gpointer data )
{
if ( data )
{
LayersPanel* panel = reinterpret_cast<LayersPanel*>(data);
- panel->setDesktop(panel->getDesktop());
+ panel->setDesktop(desktop);
}
return FALSE;
@@ -95,7 +95,6 @@ static gboolean layers_panel_deactivated( GtkObject */*object*/, GdkEvent * /*ev
return FALSE;
}
-
void LayersPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback )
{
bool set = false;
@@ -349,20 +348,22 @@ bool LayersPanel::_checkForSelected(const Gtk::TreePath &path, const Gtk::TreeIt
void LayersPanel::_layersChanged()
{
// g_message("_layersChanged()");
- SPDocument* document = _desktop->doc();
- SPObject* root = document->root;
- if ( root ) {
- _selectedConnection.block();
- if ( _mgr && _mgr->includes( root ) ) {
- SPObject* target = _desktop->currentLayer();
- _store->clear();
-
-#if DUMP_LAYERS
- g_message("root:%p {%s} [%s]", root, root->id, root->label() );
-#endif // DUMP_LAYERS
- _addLayer( document, root, 0, target, 0 );
+ if(_desktop) {
+ SPDocument* document = _desktop->doc();
+ SPObject* root = document->root;
+ if ( root ) {
+ _selectedConnection.block();
+ if ( _mgr && _mgr->includes( root ) ) {
+ SPObject* target = _desktop->currentLayer();
+ _store->clear();
+
+ #if DUMP_LAYERS
+ g_message("root:%p {%s} [%s]", root, root->id, root->label() );
+ #endif // DUMP_LAYERS
+ _addLayer( document, root, 0, target, 0 );
+ }
+ _selectedConnection.unblock();
}
- _selectedConnection.unblock();
}
}
@@ -414,9 +415,9 @@ SPObject* LayersPanel::_selectedLayer()
void LayersPanel::_pushTreeSelectionToCurrent()
{
- SPObject* inTree = _selectedLayer();
// TODO hunt down the possible API abuse in getting NULL
- if ( _desktop->currentRoot() ) {
+ if ( _desktop && _desktop->currentRoot() ) {
+ SPObject* inTree = _selectedLayer();
if ( inTree ) {
SPObject* curr = _desktop->currentLayer();
if ( curr != inTree ) {
@@ -459,6 +460,7 @@ void LayersPanel::_checkTreeSelection()
void LayersPanel::_preToggle( GdkEvent const *event )
{
+
if ( _toggleEvent ) {
gdk_event_free(_toggleEvent);
_toggleEvent = 0;
@@ -472,6 +474,8 @@ void LayersPanel::_preToggle( GdkEvent const *event )
void LayersPanel::_toggled( Glib::ustring const& str, int targetCol )
{
+ g_return_if_fail(_desktop != NULL);
+
Gtk::TreeModel::Children::iterator iter = _tree.get_model()->get_iter(str);
Gtk::TreeModel::Row row = *iter;
@@ -642,9 +646,7 @@ LayersPanel::LayersPanel() :
_layersPage.pack_end(_compositeSettings, Gtk::PACK_SHRINK);
_layersPage.pack_end(_buttonsRow, Gtk::PACK_SHRINK);
- _notebook.append_page(_layersPage, _("Layers"));
-
- _getContents()->pack_start(_notebook, Gtk::PACK_EXPAND_WIDGET);
+ _getContents()->pack_start(_layersPage, Gtk::PACK_EXPAND_WIDGET);
SPDesktop* targetDesktop = getDesktop();
@@ -656,7 +658,9 @@ LayersPanel::LayersPanel() :
_buttonsRow.add( *btn );
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, _("Top") );
+ //TRANSLATORS: only translate "string" in "context|string".
+ // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, Q_("layers|Top") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_TOP) );
_watchingNonTop.push_back( btn );
_buttonsRow.add( *btn );
@@ -722,6 +726,7 @@ LayersPanel::LayersPanel() :
g_signal_connect( G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK( layers_panel_activated ), this );
g_signal_connect( G_OBJECT(INKSCAPE), "deactivate_desktop", G_CALLBACK( layers_panel_deactivated ), this );
+
setDesktop( targetDesktop );
show_all_children();
@@ -763,7 +768,7 @@ void LayersPanel::setDesktop( SPDesktop* desktop )
_desktop = 0;
}
- _desktop = getDesktop();
+ _desktop = Panel::getDesktop();
if ( _desktop ) {
//setLabel( _desktop->doc()->name );
diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h
index 1f593b9c6..16b3be350 100644
--- a/src/ui/dialog/layers.h
+++ b/src/ui/dialog/layers.h
@@ -117,7 +117,6 @@ private:
Gtk::ScrolledWindow _scroller;
Gtk::Menu _popupMenu;
Gtk::SpinButton _spinBtn;
- Gtk::Notebook _notebook;
Gtk::VBox _layersPage;
UI::Widget::StyleSubject::CurrentLayer _subject;
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index dd2dc8250..dec437be9 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -305,7 +305,7 @@ LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem)
row[columns.col_visible] = (*it)->lpeobject->get_lpe()->isVisible();
} else {
Gtk::TreeModel::Row row = *(effectlist_store->append());
- row[columns.col_name] = "Unknown effect!";
+ row[columns.col_name] = _("Unknown effect");
row[columns.lperef] = *it;
row[columns.col_visible] = false;
}
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp
index ba572336c..d3887b1ca 100644
--- a/src/ui/dialog/ocaldialogs.cpp
+++ b/src/ui/dialog/ocaldialogs.cpp
@@ -41,6 +41,7 @@ namespace Dialog
/**
* Callback for fileNameEntry widget
*/
+/*
void FileExportToOCALDialog::fileNameEntryChangedCallback()
{
if (!fileNameEntry)
@@ -53,25 +54,32 @@ void FileExportToOCALDialog::fileNameEntryChangedCallback()
myFilename = fileName;
response(Gtk::RESPONSE_OK);
}
-
+*/
/**
* Constructor
*/
+/*
FileExportToOCALDialog::FileExportToOCALDialog(Gtk::Window &parentWindow,
FileDialogType fileTypes,
const Glib::ustring &title) :
FileDialogOCALBase(title, parentWindow)
{
- /*
+*/
+ /*
* Start Taking the vertical Box and putting a Label
* and a Entry to take the filename
* Later put the extension selection and checkbox (?)
*/
/* Initalize to Autodetect */
+/*
extension = NULL;
+*/
/* No filename to start out with */
+/*
myFilename = "";
+*/
/* Set our dialog type (save, export, etc...)*/
+/*
dialogType = fileTypes;
Gtk::VBox *vbox = get_vbox();
@@ -102,17 +110,19 @@ FileExportToOCALDialog::FileExportToOCALDialog(Gtk::Window &parentWindow,
show_all_children();
}
-
+*/
/**
* Destructor
*/
+/*
FileExportToOCALDialog::~FileExportToOCALDialog()
{
}
-
+*/
/**
* Show this dialog modally. Return true if user hits [OK]
*/
+/*
bool
FileExportToOCALDialog::show()
{
@@ -130,10 +140,11 @@ FileExportToOCALDialog::show()
return FALSE;
}
}
-
+*/
/**
* Get the file name chosen by the user. Valid after an [OK]
*/
+/*
Glib::ustring
FileExportToOCALDialog::getFilename()
{
@@ -150,7 +161,7 @@ FileExportToOCALDialog::change_title(const Glib::ustring& title)
{
this->set_title(title);
}
-
+*/
//########################################################################
//# F I L E E X P O R T T O O C A L P A S S W O R D
@@ -160,14 +171,17 @@ FileExportToOCALDialog::change_title(const Glib::ustring& title)
/**
* Constructor
*/
+/*
FileExportToOCALPasswordDialog::FileExportToOCALPasswordDialog(Gtk::Window &parentWindow,
const Glib::ustring &title) : FileDialogOCALBase(title, parentWindow)
{
+*/
/*
* Start Taking the vertical Box and putting 2 Labels
* and 2 Entries to take the username and password
*/
/* No username and password to start out with */
+/*
myUsername = "";
myPassword = "";
@@ -200,18 +214,20 @@ FileExportToOCALPasswordDialog::FileExportToOCALPasswordDialog(Gtk::Window &pare
show_all_children();
}
-
+*/
/**
* Destructor
*/
+/*
FileExportToOCALPasswordDialog::~FileExportToOCALPasswordDialog()
{
}
-
+*/
/**
* Show this dialog modally. Return true if user hits [OK]
*/
+/*
bool
FileExportToOCALPasswordDialog::show()
{
@@ -229,20 +245,22 @@ FileExportToOCALPasswordDialog::show()
return FALSE;
}
}
-
+*/
/**
* Get the username. Valid after an [OK]
*/
+/*
Glib::ustring
FileExportToOCALPasswordDialog::getUsername()
{
myUsername = usernameEntry->get_text();
return myUsername;
}
-
+*/
/**
* Get the password. Valid after an [OK]
*/
+/*
Glib::ustring
FileExportToOCALPasswordDialog::getPassword()
{
@@ -255,7 +273,7 @@ FileExportToOCALPasswordDialog::change_title(const Glib::ustring& title)
{
this->set_title(title);
}
-
+*/
//#########################################################################
//### F I L E I M P O R T F R O M O C A L
diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h
index 75d57fc59..ce26f2148 100644
--- a/src/ui/dialog/ocaldialogs.h
+++ b/src/ui/dialog/ocaldialogs.h
@@ -105,75 +105,86 @@ protected:
/**
* Our implementation of the FileExportToOCALDialog interface.
*/
+/*
class FileExportToOCALDialog : public FileDialogOCALBase
{
public:
+*/
/**
* Constructor
* @param fileTypes one of FileDialogTypes
* @param title the title of the dialog
* @param key a list of file types from which the user can select
*/
+/*
FileExportToOCALDialog(Gtk::Window& parentWindow,
FileDialogType fileTypes,
- const Glib::ustring &title);
-
+ const Glib::ustring &title);
+*/
/**
* Destructor.
* Perform any necessary cleanups.
*/
+/*
~FileExportToOCALDialog();
-
+*/
/**
* Show an SaveAs file selector.
* @return the selected path if user selected one, else NULL
*/
+/*
bool show();
Glib::ustring getFilename();
Glib::ustring myFilename;
-
+*/
/**
* Change the window title.
*/
+/*
void change_title(const Glib::ustring& title);
private:
-
+*/
/**
* Fix to allow the user to type the file name
*/
+/*
Gtk::Entry *fileNameEntry;
-
+*/
/**
* Data mirror of the combo box
*/
+/*
std::vector<FileType> fileTypes;
// Child widgets
Gtk::HBox childBox;
Gtk::VBox checksBox;
Gtk::HBox fileBox;
-
+*/
/**
* The extension to use to write this file
*/
+/*
Inkscape::Extension::Extension *extension;
-
+*/
/**
* Callback for user input into fileNameEntry
*/
+/*
void fileNameEntryChangedCallback();
-
+*/
/**
* List of known file extensions.
*/
+/*
std::set<Glib::ustring> knownExtensions;
}; //FileExportToOCAL
-
+*/
//########################################################################
//# F I L E E X P O R T T O O C A L P A S S W O R D
@@ -183,45 +194,52 @@ private:
/**
* Our implementation of the FileExportToOCALPasswordDialog interface.
*/
+/*
class FileExportToOCALPasswordDialog : public FileDialogOCALBase
{
public:
+*/
/**
* Constructor
* @param title the title of the dialog
*/
+/*
FileExportToOCALPasswordDialog(Gtk::Window& parentWindow,
const Glib::ustring &title);
-
+*/
/**
* Destructor.
* Perform any necessary cleanups.
*/
+/*
~FileExportToOCALPasswordDialog();
-
+*/
/**
* Show 2 entry to input username and password.
*/
+/*
bool show();
Glib::ustring getUsername();
Glib::ustring getPassword();
-
+*/
/**
* Change the window title.
*/
+/*
void change_title(const Glib::ustring& title);
Glib::ustring myUsername;
Glib::ustring myPassword;
private:
-
+*/
/**
* Fix to allow the user to type the file name
*/
+/*
Gtk::Entry *usernameEntry;
Gtk::Entry *passwordEntry;
@@ -231,7 +249,7 @@ private:
Gtk::HBox passBox;
}; //FileExportToOCALPassword
-
+*/
//#########################################################################
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp
index d15773ecb..f9db265d6 100644
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
@@ -13,6 +13,7 @@
#endif
#ifdef WIN32
#include <io.h>
+#include <windows.h>
#endif
#include <gtkmm/stock.h>
@@ -31,7 +32,7 @@
static void
-draw_page (GtkPrintOperation */*operation*/,
+draw_page (GtkPrintOperation *operation,
GtkPrintContext *context,
gint /*page_nr*/,
gpointer user_data)
@@ -106,6 +107,24 @@ draw_page (GtkPrintOperation */*operation*/,
cairo_surface_t *surface = cairo_get_target(cr);
cairo_matrix_t ctm;
cairo_get_matrix(cr, &ctm);
+#ifdef WIN32
+ //Gtk+ does not take the non printable area into account
+ //http://bugzilla.gnome.org/show_bug.cgi?id=381371
+ //
+ // This workaround translates the origin from the top left of the
+ // printable area to the top left of the page.
+ GtkPrintSettings *settings = gtk_print_operation_get_print_settings(operation);
+ const gchar *printerName = gtk_print_settings_get_printer(settings);
+ HDC hdc = CreateDC("WINSPOOL", printerName, NULL, NULL);
+ if (hdc) {
+ cairo_matrix_t mat;
+ int x_off = GetDeviceCaps (hdc, PHYSICALOFFSETX);
+ int y_off = GetDeviceCaps (hdc, PHYSICALOFFSETY);
+ cairo_matrix_init_translate(&mat, -x_off, -y_off);
+ cairo_matrix_multiply (&ctm, &ctm, &mat);
+ DeleteDC(hdc);
+ }
+#endif
bool ret = ctx->setSurfaceTarget (surface, true, &ctm);
if (ret) {
ret = renderer.setupDocument (ctx, junk->_doc, TRUE, NULL);
@@ -169,12 +188,19 @@ Print::Print(SPDocument *doc, SPItem *base) :
GtkPageSetup *page_setup = gtk_page_setup_new();
gdouble doc_width = sp_document_width(_doc) * PT_PER_PX;
gdouble doc_height = sp_document_height(_doc) * PT_PER_PX;
- GtkPaperSize *paper_size = gtk_paper_size_new_custom("custom", "custom",
- doc_width, doc_height, GTK_UNIT_POINTS);
+ GtkPaperSize *paper_size;
+ if (doc_width > doc_height) {
+ gtk_page_setup_set_orientation (page_setup, GTK_PAGE_ORIENTATION_LANDSCAPE);
+ paper_size = gtk_paper_size_new_custom("custom", "custom",
+ doc_height, doc_width, GTK_UNIT_POINTS);
+ } else {
+ gtk_page_setup_set_orientation (page_setup, GTK_PAGE_ORIENTATION_PORTRAIT);
+ paper_size = gtk_paper_size_new_custom("custom", "custom",
+ doc_width, doc_height, GTK_UNIT_POINTS);
+ }
+
gtk_page_setup_set_paper_size (page_setup, paper_size);
-#ifndef WIN32
gtk_print_operation_set_default_page_setup (_printop, page_setup);
-#endif
gtk_print_operation_set_use_full_page (_printop, TRUE);
// set up signals
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index e273a827c..1f708e3de 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -47,6 +47,8 @@
#include "display/nr-plain-stuff.h"
#include "sp-gradient-reference.h"
+//#define USE_DOCUMENT_PALETTE 1
+
namespace Inkscape {
namespace UI {
namespace Dialogs {
@@ -364,6 +366,7 @@ static void redirSecondaryClick( GtkMenuItem *menuitem, gpointer /*user_data*/ )
}
}
+#if USE_DOCUMENT_PALETTE
static void editGradientImpl( SPGradient* gr )
{
if ( gr ) {
@@ -424,6 +427,7 @@ static void addNewGradient( GtkMenuItem */*menuitem*/, gpointer /*user_data*/ )
}
}
}
+#endif // USE_DOCUMENT_PALETTE
static gboolean handleButtonPress( GtkWidget* /*widget*/, GdkEventButton* event, gpointer user_data)
{
@@ -451,6 +455,7 @@ static gboolean handleButtonPress( GtkWidget* /*widget*/, GdkEventButton* event,
user_data);
gtk_menu_shell_append(GTK_MENU_SHELL(popupMenu), child);
+#if USE_DOCUMENT_PALETTE
child = gtk_separator_menu_item_new();
gtk_menu_shell_append(GTK_MENU_SHELL(popupMenu), child);
popupExtras.push_back(child);
@@ -484,6 +489,7 @@ static gboolean handleButtonPress( GtkWidget* /*widget*/, GdkEventButton* event,
gtk_menu_shell_append(GTK_MENU_SHELL(popupMenu), child);
//popupExtras.push_back(child);
gtk_widget_set_sensitive( child, FALSE );
+#endif // USE_DOCUMENT_PALETTE
gtk_widget_show_all(popupMenu);
}
@@ -1248,6 +1254,7 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) :
_clear->ptr = this;
_remove = new ColorItem( ege::PaintDef::NONE );
_remove->ptr = this;
+#if USE_DOCUMENT_PALETTE
{
JustForNow *docPalette = new JustForNow();
@@ -1256,6 +1263,7 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) :
_ptr = docPalette;
}
+#endif // USE_DOCUMENT_PALETTE
loadEmUp();
if ( !possible.empty() ) {
JustForNow* first = 0;
@@ -1403,6 +1411,7 @@ void SwatchesPanel::handleGradientsChange()
}
}
+#if USE_DOCUMENT_PALETTE
if ( _ptr ) {
JustForNow *docPalette = reinterpret_cast<JustForNow *>(_ptr);
// TODO delete pointed to objects
@@ -1462,10 +1471,12 @@ void SwatchesPanel::handleGradientsChange()
_rebuild();
}
}
+#endif // USE_DOCUMENT_PALETTE
}
void SwatchesPanel::_updateFromSelection()
{
+#if USE_DOCUMENT_PALETTE
if ( _ptr ) {
JustForNow *docPalette = reinterpret_cast<JustForNow *>(_ptr);
@@ -1543,6 +1554,7 @@ void SwatchesPanel::_updateFromSelection()
item->setState( isFill, isStroke );
}
}
+#endif // USE_DOCUMENT_PALETTE
}
void SwatchesPanel::_handleAction( int setId, int itemId )
diff --git a/src/ui/icon-names.h b/src/ui/icon-names.h
index 3332dd8cf..f9a6f2a7d 100644
--- a/src/ui/icon-names.h
+++ b/src/ui/icon-names.h
@@ -235,7 +235,7 @@
#define INKSCAPE_ICON_IMAGE_FILTER_TURBULENCE \
"image-filter-turbulence"
#define INKSCAPE_ICON_INKSCAPE \
- "inkscape"
+ "inkscape-logo"
#define INKSCAPE_ICON_LAYER_BOTTOM \
"layer-bottom"
#define INKSCAPE_ICON_LAYER_DELETE \
diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp
index b12d5adf7..770a9bf87 100644
--- a/src/ui/view/edit-widget.cpp
+++ b/src/ui/view/edit-widget.cpp
@@ -1071,15 +1071,15 @@ EditWidget::initStatusbar()
_coord_eventbox.add (_coord_status);
_tooltips.set_tip (_coord_eventbox, _("Cursor coordinates"));
_coord_status.attach (*new Gtk::VSeparator(), 0,1, 0,2, Gtk::FILL,Gtk::FILL, 0,0);
- _coord_status.attach (*new Gtk::Label("X:", 0.0, 0.5), 1,2, 0,1, Gtk::FILL,Gtk::FILL, 0,0);
- _coord_status.attach (*new Gtk::Label("Y:", 0.0, 0.5), 1,2, 1,2, Gtk::FILL,Gtk::FILL, 0,0);
+ _coord_status.attach (*new Gtk::Label(_("X:"), 0.0, 0.5), 1,2, 0,1, Gtk::FILL,Gtk::FILL, 0,0);
+ _coord_status.attach (*new Gtk::Label(_("Y:"), 0.0, 0.5), 1,2, 1,2, Gtk::FILL,Gtk::FILL, 0,0);
_coord_status_x.set_text ("0.0");
_coord_status_x.set_alignment (0.0, 0.5);
_coord_status_y.set_text ("0.0");
_coord_status_y.set_alignment (0.0, 0.5);
_coord_status.attach (_coord_status_x, 2,3, 0,1, Gtk::FILL,Gtk::FILL, 0,0);
_coord_status.attach (_coord_status_y, 2,3, 1,2, Gtk::FILL,Gtk::FILL, 0,0);
- _coord_status.attach (*new Gtk::Label("Z:", 0.0, 0.5), 3,4, 0,2, Gtk::FILL,Gtk::FILL, 0,0);
+ _coord_status.attach (*new Gtk::Label(_("Z:"), 0.0, 0.5), 3,4, 0,2, Gtk::FILL,Gtk::FILL, 0,0);
_coord_status.attach (_zoom_status, 4,5, 0,2, Gtk::FILL,Gtk::FILL, 0,0);
sp_set_font_size_smaller (static_cast<GtkWidget*>((void*)_coord_status.gobj()));
_statusbar.pack_end (_coord_eventbox, false, false, 1);
@@ -1247,7 +1247,7 @@ EditWidget::shutdown()
_("<span weight=\"bold\" size=\"larger\">The file \"%s\" was saved with a format (%s) that may cause data loss!</span>\n\n"
"Do you want to save this file as an Inkscape SVG?"),
SP_DOCUMENT_NAME(doc),
- Inkscape::Extension::db.get(sp_document_repr_root(doc)->attribute("inkscape:output_extension"))->get_name());
+ SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE);
Gtk::MessageDialog dlg (*this,
markup,
@@ -1551,11 +1551,10 @@ void
EditWidget::initEdit (SPDocument *doc)
{
_desktop = new SPDesktop();
- _desktop->registerEditWidget (this);
_namedview = sp_document_namedview (doc, 0);
_svg_canvas.init (_desktop);
- _desktop->init (_namedview, _svg_canvas.spobj());
+ _desktop->init (_namedview, _svg_canvas.spobj(), this);
sp_namedview_window_from_document (_desktop);
sp_namedview_update_layers_from_document (_desktop);
_dt2r = 1.0 / _namedview->doc_units->unittobase;
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 9a5364874..e7b0188d8 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -1252,6 +1252,7 @@ RotateableSwatch::do_motion(double by, guint modifier) {
g_object_unref (bitmap);
g_object_unref (mask);
gdk_window_set_cursor(w->window, cr);
+ gdk_cursor_unref(cr);
cr_set = true;
}
}