index 1ed36e7897f28b67b75f50a57a669cd39308011e..5d76cc8f6dcc70d61da43214606dd2acb061b0b0 100644 (file)
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
#include "path-prefix.h"
#include "swatches.h"
#include "sp-item.h"
-#include "prefs-utils.h"
+#include "preferences.h"
#include "eek-preview.h"
@@ -240,25 +240,21 @@ static void handleSecondaryClick( GtkWidget* widget, gint arg1, gpointer callbac
}
}
-static gboolean handleEnterNotify( GtkWidget* widget, GdkEventCrossing* event, gpointer callback_data ) {
+static gboolean handleEnterNotify( GtkWidget* /*widget*/, GdkEventCrossing* /*event*/, gpointer callback_data ) {
ColorItem* item = reinterpret_cast<ColorItem*>(callback_data);
if ( item ) {
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if ( desktop ) {
- desktop->tipsMessageContext()->set(Inkscape::INFORMATION_MESSAGE, g_strconcat(
- _("Color: <b>"),
- item->def.descr.c_str(),
- _("</b>"),
- _("; "),
- _("<b>Click</b> to set fill, <b>Shift+click</b> to set stroke"),
- NULL
- ));
+ gchar* msg = g_strdup_printf(_("Color: <b>%s</b>; <b>Click</b> to set fill, <b>Shift+click</b> to set stroke"),
+ item->def.descr.c_str());
+ desktop->tipsMessageContext()->set(Inkscape::INFORMATION_MESSAGE, msg);
+ g_free(msg);
}
}
return FALSE;
}
-static gboolean handleLeaveNotify( GtkWidget* widget, GdkEventCrossing* event, gpointer callback_data ) {
+static gboolean handleLeaveNotify( GtkWidget* /*widget*/, GdkEventCrossing* /*event*/, gpointer callback_data ) {
ColorItem* item = reinterpret_cast<ColorItem*>(callback_data);
if ( item ) {
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if ( !possible.empty() ) {
JustForNow* first = 0;
- gchar const* targetName = 0;
+ Glib::ustring targetName;
if ( _prefs_path ) {
- targetName = prefs_get_string_attribute( _prefs_path, "palette" );
- if ( targetName ) {
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ targetName = prefs->getString(_prefs_path, "palette");
+ if (!targetName.empty()) {
for ( std::vector<JustForNow*>::iterator iter = possible.begin(); iter != possible.end(); ++iter ) {
if ( (*iter)->_name == targetName ) {
first = *iter;
JustForNow* curr = possible[itemId];
if ( _prefs_path ) {
- prefs_set_string_attribute( _prefs_path, "palette", curr->_name.c_str() );
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setString(_prefs_path, "palette", curr->_name);
}
if ( curr->_prefWidth > 0 ) {