diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2013-02-26 16:43:48 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-03-07 10:11:47 +0100 |
commit | 895898596c72fd14db2abec3aeaab74d583769e5 (patch) | |
tree | 61587b3cb2638b20931ede8114b6fc3ae5a32f87 /cui | |
parent | 98645ae6d4bc7b85730a0a9f00bd2de86dd09be9 (diff) |
WIP: fdo#47011 autosave feature
Change-Id: Ib2cbcc33e6188c60c183b5f47e9ae9c9d4c91b95
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optsave.cxx | 31 | ||||
-rw-r--r-- | cui/source/options/optsave.hrc | 1 | ||||
-rw-r--r-- | cui/source/options/optsave.hxx | 1 | ||||
-rw-r--r-- | cui/source/options/optsave.src | 35 |
4 files changed, 51 insertions, 17 deletions
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index d977cac56b99..efced8d6b6ba 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -55,8 +55,9 @@ using namespace comphelper; #define CFG_PAGE_AND_GROUP OUString("General"), OUString("LoadSave") // !! you have to update these index, if you changed the list of the child windows !! -#define WININDEX_AUTOSAVE ((sal_uInt16)6) -#define WININDEX_SAVEURL_RELFSYS ((sal_uInt16)9) +#define WININDEX_AUTOSAVE ((sal_uInt16) 6) +#define WININDEX_USERAUTOSAVE ((sal_uInt16) 9) +#define WININDEX_SAVEURL_RELFSYS ((sal_uInt16)10) // ---------------------------------------------------------------------- @@ -100,6 +101,7 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) : aAutoSaveCB ( this, CUI_RES( BTN_AUTOSAVE ) ), aAutoSaveEdit ( this, CUI_RES( ED_AUTOSAVE ) ), aMinuteFT ( this, CUI_RES( FT_MINUTE ) ), + aUserAutoSaveCB ( this, CUI_RES( BTN_USERAUTOSAVE ) ), aRelativeFsysCB ( this, CUI_RES( BTN_RELATIVE_FSYS ) ), aRelativeInetCB ( this, CUI_RES( BTN_RELATIVE_INET ) ), @@ -239,12 +241,23 @@ void SfxSaveTabPage::DetectHiddenControls() aAutoSaveEdit.Hide(); aMinuteFT.Hide(); // the other controls have to move upwards the height of checkbox + space - nDelta += aRelativeFsysCB.GetPosPixel().Y() - aAutoSaveCB.GetPosPixel().Y(); + nDelta += aUserAutoSaveCB.GetPosPixel().Y() - aAutoSaveCB.GetPosPixel().Y(); } else if ( nDelta > 0 ) // the "AutoSave" controls have to move upwards too nWinIndex = WININDEX_AUTOSAVE; + if ( aOptionsDlgOpt.IsOptionHidden( "UserAutoSave", CFG_PAGE_AND_GROUP ) ) + { + // hide controls of "UserAutoSave" + aUserAutoSaveCB.Hide(); + // the other controls have to move upwards the height of checkbox + space + nDelta += aRelativeFsysCB.GetPosPixel().Y() - aUserAutoSaveCB.GetPosPixel().Y(); + } + else if ( nDelta > 0 ) + // the "UserAutoSave" controls have to move upwards too + nWinIndex = WININDEX_USERAUTOSAVE; + if ( nDelta > 0 ) { sal_uInt16 i, nChildCount = GetChildCount(); @@ -315,6 +328,13 @@ sal_Bool SfxSaveTabPage::FillItemSet( SfxItemSet& rSet ) (sal_uInt16)aAutoSaveEdit.GetValue() ) ); bModified |= sal_True; } + + if ( aUserAutoSaveCB.IsChecked() != aUserAutoSaveCB.GetSavedValue() ) + { + rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_USERAUTOSAVE ), + aUserAutoSaveCB.IsChecked() ) ); + bModified |= sal_True; + } // save relatively if ( aRelativeFsysCB.IsChecked() != aRelativeFsysCB.GetSavedValue() ) { @@ -489,6 +509,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet& ) aBackupFI.Show(bBackupRO); aAutoSaveCB.Check(aSaveOpt.IsAutoSave()); + aUserAutoSaveCB.Check(aSaveOpt.IsUserAutoSave()); aWarnAlienFormatCB.Check(aSaveOpt.IsWarnAlienFormat()); aWarnAlienFormatCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT)); @@ -515,6 +536,8 @@ void SfxSaveTabPage::Reset( const SfxItemSet& ) aAutoSaveCB.SaveValue(); aAutoSaveEdit.SaveValue(); + aUserAutoSaveCB.SaveValue(); + aRelativeFsysCB.SaveValue(); aRelativeInetCB.SaveValue(); aODFVersionLB.SaveValue(); @@ -530,11 +553,13 @@ IMPL_LINK( SfxSaveTabPage, AutoClickHdl_Impl, CheckBox *, pBox ) { aAutoSaveEdit.Enable(); aMinuteFT.Enable(); + aUserAutoSaveCB.Enable(); } else { aAutoSaveEdit.Disable(); aMinuteFT.Disable(); + aUserAutoSaveCB.Disable(); } } return 0; diff --git a/cui/source/options/optsave.hrc b/cui/source/options/optsave.hrc index 16891bcff579..36a95b685134 100644 --- a/cui/source/options/optsave.hrc +++ b/cui/source/options/optsave.hrc @@ -29,6 +29,7 @@ #define BTN_AUTOSAVE 16 #define ED_AUTOSAVE 17 #define FT_MINUTE 18 +#define BTN_USERAUTOSAVE 19 #define BTN_NOPRETTYPRINTING 20 #define FI_BACKUP 21 #define BTN_WARNALIENFORMAT 22 diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx index 4ab3082ca4f2..00cb63f0ae29 100644 --- a/cui/source/options/optsave.hxx +++ b/cui/source/options/optsave.hxx @@ -54,6 +54,7 @@ private: CheckBox aAutoSaveCB; NumericField aAutoSaveEdit; FixedText aMinuteFT; + CheckBox aUserAutoSaveCB; CheckBox aRelativeFsysCB; CheckBox aRelativeInetCB; diff --git a/cui/source/options/optsave.src b/cui/source/options/optsave.src index 6dc878ebe7df..3d3d8f470884 100644 --- a/cui/source/options/optsave.src +++ b/cui/source/options/optsave.src @@ -110,36 +110,43 @@ TabPage RID_SFXPAGE_SAVE Size = MAP_APPFONT ( 65 , 8 ) ; Text [ en-US ] = "Minutes" ; }; + CheckBox BTN_USERAUTOSAVE + { + HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_USERAUTOSAVE"; //? FIX ME + Pos = MAP_APPFONT ( 21 , 74 ) ; + Size = MAP_APPFONT ( 163 , 10 ) ; + Text [ en-US ] = "Automatically save the document too" ; + }; CheckBox BTN_RELATIVE_FSYS { HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_RELATIVE_FSYS"; - Pos = MAP_APPFONT ( 12 , 74 ) ; + Pos = MAP_APPFONT ( 12 , 85 ) ; Size = MAP_APPFONT ( 236 , 10 ) ; Text [ en-US ] = "Save URLs relative to file system" ; }; CheckBox BTN_RELATIVE_INET { HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_RELATIVE_INET"; - Pos = MAP_APPFONT ( 12 , 85 ) ; + Pos = MAP_APPFONT ( 12 , 96 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Save URLs relative to internet" ; }; FixedLine FL_FILTER { - Pos = MAP_APPFONT ( 6 , 97 ) ; + Pos = MAP_APPFONT ( 6 , 108 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; Text [ en-US ] = "Default file format and ODF settings" ; }; FixedText FT_ODF_VERSION { - Pos = MAP_APPFONT ( 12 , 107 ) ; + Pos = MAP_APPFONT ( 12 , 118 ) ; Size = MAP_APPFONT ( 121 , 8 ) ; Text [ en-US ] = "ODF format version" ; }; ListBox LB_ODF_VERSION { HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_ODF_VERSION"; - Pos = MAP_APPFONT ( 136 , 105 ) ; + Pos = MAP_APPFONT ( 136 , 116 ) ; Size = MAP_APPFONT ( 108 , 58 ) ; Border = TRUE; DropDown = TRUE; @@ -154,33 +161,33 @@ TabPage RID_SFXPAGE_SAVE CheckBox BTN_NOPRETTYPRINTING { HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_NOPRETTYPRINTING"; - Pos = MAP_APPFONT ( 12 , 120 ) ; + Pos = MAP_APPFONT ( 12 , 131 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Size optimization for ODF format" ; }; CheckBox BTN_WARNALIENFORMAT { HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_WARNALIENFORMAT"; - Pos = MAP_APPFONT ( 12 , 131 ) ; + Pos = MAP_APPFONT ( 12 , 142 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Warn when not saving in ODF or default format" ; }; FixedText FT_APP { - Pos = MAP_APPFONT ( 12 , 142 ) ; + Pos = MAP_APPFONT ( 12 , 153 ) ; Size = MAP_APPFONT ( 120 , 8 ) ; Text [ en-US ] = "D~ocument type"; }; FixedText FT_FILTER { - Pos = MAP_APPFONT ( 136 , 142 ) ; + Pos = MAP_APPFONT ( 136 , 153 ) ; Size = MAP_APPFONT ( 120 , 8 ) ; Text [ en-US ] = "Always sa~ve as"; }; ListBox LB_APP { HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_APP"; - Pos = MAP_APPFONT ( 12 , 153 ) ; + Pos = MAP_APPFONT ( 12 , 164 ) ; Size = MAP_APPFONT ( 108 , 58 ) ; Border = TRUE; DropDown = TRUE; @@ -197,14 +204,14 @@ TabPage RID_SFXPAGE_SAVE }; FixedImage FI_FILTER { - Pos = MAP_APPFONT ( 129, 154 ) ; + Pos = MAP_APPFONT ( 129, 165 ) ; Size = MAP_APPFONT ( 6 , 6 ) ; Hide = TRUE; }; ListBox LB_FILTER { HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_FILTER"; - Pos = MAP_APPFONT ( 136 , 153 ) ; + Pos = MAP_APPFONT ( 136 , 164 ) ; Size = MAP_APPFONT ( 108 , 58 ) ; Border = TRUE; Sort = TRUE; @@ -212,13 +219,13 @@ TabPage RID_SFXPAGE_SAVE }; FixedImage FI_ODF_WARNING { - Pos = MAP_APPFONT ( 12, 169 ) ; + Pos = MAP_APPFONT ( 12, 170 ) ; Size = MAP_APPFONT ( 8 , 8 ) ; Hide = TRUE; }; FixedText FT_WARN { - Pos = MAP_APPFONT ( 23 , 169 ) ; + Pos = MAP_APPFONT ( 23 , 170 ) ; Size = MAP_APPFONT ( 239 , 8 ) ; Hide = TRUE; Text [ en-US ] = "Not using ODF 1.2 Extended may cause information to be lost."; |