Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-04-17 18:20:43 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-04-17 18:20:43 +0400
commit2497af95a11122e6c30d42dd7bff5d8f239269ac (patch)
treed1742cdefe4dd2cc6462aafd28659fe7c5759f2d /source/blender/makesrna/intern/rna_main.c
parent4bb277117f08bf4dd45e8911272f5162e1de8ad1 (diff)
parent0862abf68bf1c9601080d4fb142c8f7edc6b300f (diff)
Merged changes in the trunk up to revision 36199.
Diffstat (limited to 'source/blender/makesrna/intern/rna_main.c')
-rw-r--r--source/blender/makesrna/intern/rna_main.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index b83820cb59f..7bee58e9e1f 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -42,9 +42,20 @@
/* all the list begin functions are added manually here, Main is not in SDNA */
+static int rna_Main_is_saved_get(PointerRNA *ptr)
+{
+ return G.relbase_valid;
+}
+
static int rna_Main_is_dirty_get(PointerRNA *ptr)
{
- return !G.relbase_valid;
+ /* XXX, not totally nice to do it this way, should store in main ? */
+ wmWindowManager *wm;
+ for(wm= G.main->wm.first; wm; wm= wm->id.next) {
+ return !wm->file_saved;
+ }
+
+ return TRUE;
}
static void rna_Main_filepath_get(PointerRNA *ptr, char *value)
@@ -314,6 +325,11 @@ void RNA_def_main(BlenderRNA *brna)
prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL);
+ RNA_def_property_ui_text(prop, "File is Saved", "Have recent edits been saved to disk");
+
+ prop= RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Main_is_saved_get", NULL);
RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file");
for(i=0; lists[i].name; i++)