summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2012-03-07 20:27:39 +0000
committerJazzyNico <nicoduf@yahoo.fr>2012-03-07 20:27:39 +0000
commit6068183f7612525060a38d7ddf813f67cee62db5 (patch)
treec6af67b866d475fcae6289b0cdd5ae2f0b1da69f /src
parentBitmaps. Fix for bug #499252 (Edit bitmap externally fails for relative links). (diff)
downloadinkscape-6068183f7612525060a38d7ddf813f67cee62db5.tar.gz
inkscape-6068183f7612525060a38d7ddf813f67cee62db5.zip
UI. Fix for bug #294354 (Unsaved files should have an asterisk (*) in the titlebar).
Fixed bugs: - https://launchpad.net/bugs/294354 (bzr r11054)
Diffstat (limited to 'src')
-rw-r--r--src/document.cpp8
-rw-r--r--src/document.h4
-rw-r--r--src/extension/system.cpp4
-rw-r--r--src/widgets/desktop-widget.cpp17
4 files changed, 20 insertions, 13 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 6c6b41160..b5383c91d 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -60,6 +60,7 @@
#include "sp-object-repr.h"
#include "transf_mat_3x4.h"
#include "unit-constants.h"
+#include "widgets/desktop-widget.h"
#include "xml/repr.h"
#include "xml/rebase-hrefs.h"
#include "libcroco/cr-cascade.h"
@@ -1424,6 +1425,13 @@ bool SPDocument::isSeeking() const {
return priv->seeking;
}
+void SPDocument::setModifiedSinceSave(bool modified) {
+ this->modified_since_save = modified;
+ Gtk::Window *parent = SP_ACTIVE_DESKTOP->getToplevel();
+ g_assert(parent != NULL);
+ SPDesktopWidget *dtw = (SPDesktopWidget *) parent->get_data("desktopwidget");
+ dtw->updateTitle( this->getName() );
+}
/*
Local Variables:
diff --git a/src/document.h b/src/document.h
index f28e615d8..e41ec4d59 100644
--- a/src/document.h
+++ b/src/document.h
@@ -190,9 +190,7 @@ public:
bool isSeeking() const;
bool isModifiedSinceSave() const { return modified_since_save; }
- void setModifiedSinceSave(bool modified = true) {
- modified_since_save = modified;
- }
+ void setModifiedSinceSave(bool modified = true);
private:
SPDocument(SPDocument const &); // no copy
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index a959913f6..b3e9beebf 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -111,10 +111,6 @@ SPDocument *open(Extension *key, gchar const *filename)
}
}
- /* This kinda overkill as most of these are already set, but I want
- to make sure for this release -- TJG */
- doc->setModifiedSinceSave(false);
-
doc->setUri(filename);
return doc;
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 22e1d30e4..bb1a0908c 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -651,6 +651,11 @@ SPDesktopWidget::updateTitle(gchar const* uri)
gchar const *printcolorsnamecomma = ", print colors preview";
gchar const *colormodename = "";
gchar const *colormodenamecomma = "";
+ gchar const *modifiedname = "";
+ SPDocument *doc = this->desktop->doc();
+ if (doc->isModifiedSinceSave()) {
+ modifiedname = "*";
+ }
if (this->desktop->getColorMode() == Inkscape::COLORMODE_GRAYSCALE) {
colormodename = grayscalename;
@@ -662,19 +667,19 @@ SPDesktopWidget::updateTitle(gchar const* uri)
if (this->desktop->number > 1) {
if (this->desktop->getMode() == Inkscape::RENDERMODE_OUTLINE) {
- g_string_printf (name, _("%s: %d (outline%s) - Inkscape"), fname, this->desktop->number, colormodenamecomma);
+ g_string_printf (name, _("%s%s: %d (outline%s) - Inkscape"), modifiedname, fname, this->desktop->number, colormodenamecomma);
} else if (this->desktop->getMode() == Inkscape::RENDERMODE_NO_FILTERS) {
- g_string_printf (name, _("%s: %d (no filters%s) - Inkscape"), fname, this->desktop->number, colormodenamecomma);
+ g_string_printf (name, _("%s%s: %d (no filters%s) - Inkscape"), modifiedname, fname, this->desktop->number, colormodenamecomma);
} else {
- g_string_printf (name, _("%s: %d %s- Inkscape"), fname, this->desktop->number, colormodename);
+ g_string_printf (name, _("%s%s: %d %s- Inkscape"), modifiedname, fname, this->desktop->number, colormodename);
}
} else {
if (this->desktop->getMode() == Inkscape::RENDERMODE_OUTLINE) {
- g_string_printf (name, _("%s (outline%s) - Inkscape"), fname, colormodenamecomma);
+ g_string_printf (name, _("%s%s (outline%s) - Inkscape"), modifiedname, fname, colormodenamecomma);
} else if (this->desktop->getMode() == Inkscape::RENDERMODE_NO_FILTERS) {
- g_string_printf (name, _("%s (no filters%s) - Inkscape"), fname, colormodenamecomma);
+ g_string_printf (name, _("%s%s (no filters%s) - Inkscape"), modifiedname, fname, colormodenamecomma);
} else {
- g_string_printf (name, _("%s %s- Inkscape"), fname, colormodename);
+ g_string_printf (name, _("%s%s %s- Inkscape"), modifiedname, fname, colormodename);
}
}
window->set_title (name->str);