Bug 72019

Summary: save autosave file to a more obvious place
Product: [Applications] umbrello Reporter: Jonathan Riddell <jr>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: wishlist CC: greatbunzinni, kap4020
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Tool tip for autosave option
Little behaviour modification in autosave
Fix for 15186: Little behaviour modification in autosave

Description Jonathan Riddell 2004-01-07 00:46:51 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Currently the autosave file is saved to ~/autosave.xmi

It would be more obvious to the user if it was saved to the same directory and similar filename as the current document.

myfile-autosave.xmi for example

Also if the file is not saved before the first autosave it saves the document as autosave.xmi when the user does decide to save it which is quite peculiar.

That done autosave should be turned on by default.
Comment 1 Daniel Calviño Sánchez 2006-03-18 14:03:54 UTC
Should this bug be closed? A modification in the code in 2004-05-17 by Achim Spangler changed the behaviour, so if the file has been already saved, the autosave file will be saved in the same folder as the file and will be named like the file's name, followed by the suffix specified in the settings dialog.

If the autosaving occurs before the file has been saved manually, the autosave file will be saved to ~/autosave.xmi.
Comment 2 Daniel Calviño Sánchez 2006-03-18 14:20:04 UTC
Created attachment 15183 [details]
Tool tip for autosave option

I have made a patch which adds a tool tip to the autosave suffix option in the
settings dialog explaining the behaviour of this option.

It was generated against SVN. As far as I know, SVN code uses QT4, but with the
QT3 support members. So I used the QT3 support members for tool tips.

For QT4 code, just replace
QToolTip::add( m_GeneralWidgets.autosaveSuffixL, autoSaveSuffixToolTip );
QToolTip::add( m_GeneralWidgets.autosaveSuffixT, autoSaveSuffixToolTip );
with
m_GeneralWidgets.autosaveSuffixL -> setToolTip( autoSaveSuffixToolTip );
m_GeneralWidgets.autosaveSuffixT -> setToolTip( autoSaveSuffixToolTip );

At least, this is what is said in QT documentation.
Comment 3 Daniel Calviño Sánchez 2006-03-18 16:49:25 UTC
Created attachment 15186 [details]
Little behaviour modification in autosave

Right now, if the autosave happens before the user has saved the file, the file
is saved to ~/autosave.xmi and next savings happen to that file. The "Save
as..." need to be used to save the file to a explicit location.

With this little patch, if the autosave happens before the user has saved the
file, the autosave file is still ~/autosave.xmi, but it's no longer considered
as if the user has saved it explicitly. So when the user calls "Save" action, a
file to be saved to is asked.

I think it's a more logical behaviour.

I've also changed the setModified( true ) because that method adds a new action
to the undo stack, and autosaving doesn't need an undo action.
Comment 4 Oliver Kellogg 2006-03-19 11:31:05 UTC
Please make patches against umbrello in branches/KDE/3.5/kdesdk
because trunk is still being adapted to KDE4 and does not compile.
Anyway, I applied your comment #3 attachment 15186 [details] on a 3.5 branch
checkout but it doesn't compile:

make[1]: Entering directory `/kdesdk-3.5-branch/umbrello/umbrello'
if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -Idialogs -Irefactoring -I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include   -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -fno-builtin -g3 -fno-inline -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DHAVE_DOT -DDEBUG_LVITEM_INSERTION_ORDER  -MT umldoc.o -MD -MP -MF ".deps/umldoc.Tpo" \
  -c -o umldoc.o `test -f 'umldoc.cpp' || echo './'`umldoc.cpp; \
then mv ".deps/umldoc.Tpo" ".deps/umldoc.Po"; \
else rm -f ".deps/umldoc.Tpo"; exit 1; \
fi
umldoc.cpp: In member function `void UMLDoc::slotAutoSave()':
umldoc.cpp:2414: error: `modified' undeclared (first use this function)
umldoc.cpp:2414: error: (Each undeclared identifier is reported only once for 
   each function it appears in.)
make[1]: *** [umldoc.o] Error 1
Comment 5 Daniel Calviño Sánchez 2006-03-19 18:24:03 UTC
Created attachment 15199 [details]
Fix for 15186: Little behaviour modification in autosave

Sorry for the mistake. I uploaded the wrong file.

This one is generated against 3.5 branch, and it is also the right file (it
compiles...).

Again, sorry for the mistake.
Comment 6 Oliver Kellogg 2006-03-19 21:19:48 UTC
SVN commit 520399 by okellogg:

setupGeneralPage(): Apply attachment id=15183 from Daniel Calviño Sánchez
(tooltip for autosave option.)
CCBUG:72019


 M  +9 -0      settingsdlg.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/settingsdlg.cpp #520398:520399
@@ -17,6 +17,7 @@
 
 // qt includes
 #include <qlayout.h>
+#include <qtooltip.h>
 #include <qvbox.h>
 // kde includes
 #include <kdebug.h>
@@ -144,6 +145,14 @@
     Dialog_Utils::makeLabeledEditField( m_GeneralWidgets.autosaveGB, autosaveLayout, 2,
                                     m_GeneralWidgets.autosaveSuffixL, i18n("Set autosave suffix:"),
                                     m_GeneralWidgets.autosaveSuffixT, m_pOptionState->generalState.autosavesuffix );
+    QString autoSaveSuffixToolTip = i18n( "<qt><p>The autosave file will be saved to ~/autosave.xmi if the autosaving occurs "
+                                          "before you have manually saved the file.</p>"
+                                          "<p>If you've already saved it, the autosave file will be saved in the same folder as the file "
+                                          "and will be named like the file's name, followed by the suffix specified.</p>"
+                                          "<p>If the suffix is equal to the suffix of the file you've saved, "
+                                          "the autosave will overwrite your file automatically.</p></qt>" );
+    QToolTip::add( m_GeneralWidgets.autosaveSuffixL, autoSaveSuffixToolTip );
+    QToolTip::add( m_GeneralWidgets.autosaveSuffixT, autoSaveSuffixToolTip );
 
     //setup startup settings
     m_GeneralWidgets.startupGB = new QGroupBox( i18n("Startup"), page );
Comment 7 Oliver Kellogg 2006-03-19 21:28:53 UTC
SVN commit 520402 by okellogg:

slotAutoSave(): Apply attachment id=15199 from Daniel Calviño Sánchez
> Right now, if the autosave happens before the user has saved the file, the file
> is saved to ~/autosave.xmi and next savings happen to that file. The "Save
> as..." need to be used to save the file to a explicit location.
>
> With this little patch, if the autosave happens before the user has saved the
> file, the autosave file is still ~/autosave.xmi, but it's no longer considered
> as if the user has saved it explicitly. So when the user calls "Save" action, a
> file to be saved to is asked.

BUG:72019


 M  +5 -0      ChangeLog  
 M  +2 -1      THANKS  
 M  +1 -1      VERSION  
 M  +6 -2      umbrello/umldoc.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #520401:520402
@@ -1,3 +1,8 @@
+Version 1.5.3
+
+* Bugs/wishes from http://bugs.kde.org:
+* Save autosave file to a more obvious place (72019)
+
 Version 1.5.2
 
 * fixed problem reordering methods in classes/interfaces
--- branches/KDE/3.5/kdesdk/umbrello/THANKS #520401:520402
@@ -63,9 +63,10 @@
 Jonathan Riddell <jr @jriddell.org>
 Peeter Russak <pezz @tkwcy.ee>
 Paulo Roberto Rodriguez Sehn <paulo.sehn @gmail.com>
-Achim Spangler <Achim.Spangler @mnet-online.de>
+Daniel Calvi
Comment 8 Oliver Kellogg 2006-03-26 18:53:14 UTC
*** Bug 124277 has been marked as a duplicate of this bug. ***
Comment 9 Oliver Kellogg 2006-03-26 22:22:01 UTC
*** Bug 124264 has been marked as a duplicate of this bug. ***