diff --git a/aegisub/src/dialog_style_manager.cpp b/aegisub/src/dialog_style_manager.cpp index f5b7f34f9..df5d4c586 100644 --- a/aegisub/src/dialog_style_manager.cpp +++ b/aegisub/src/dialog_style_manager.cpp @@ -57,6 +57,7 @@ #include "help_button.h" #include "libresrc/libresrc.h" #include "main.h" +#include "persist_location.h" #include "selection_controller.h" #include "standard_paths.h" #include "utils.h" @@ -213,11 +214,7 @@ DialogStyleManager::DialogStyleManager (agi::Context *context) MainSizer->SetSizeHints(this); // Position window - if (lastx == -1 && lasty == -1) { - CenterOnParent(); - } else { - Move(lastx, lasty); - } + persist.reset(new PersistLocation(this, "Tool/Style Manager")); // Populate lists LoadCatalog(); @@ -395,7 +392,6 @@ END_EVENT_TABLE() /// @brief Close void DialogStyleManager::OnClose (wxCommandEvent &) { - GetPosition(&lastx, &lasty); Close(); } @@ -1167,9 +1163,3 @@ void DialogStyleManager::OnKeyDown(wxKeyEvent &event) { break; } } - -/// DOCME -int DialogStyleManager::lastx = -1; - -/// DOCME -int DialogStyleManager::lasty = -1; diff --git a/aegisub/src/dialog_style_manager.h b/aegisub/src/dialog_style_manager.h index 3182262b8..9e16cad71 100644 --- a/aegisub/src/dialog_style_manager.h +++ b/aegisub/src/dialog_style_manager.h @@ -34,11 +34,6 @@ /// @ingroup style_editor /// - - - -//////////// -// Includes #ifndef AGI_PRE #include @@ -48,14 +43,13 @@ #include #endif +#include #include "ass_style_storage.h" namespace agi { struct Context; } class AssFile; class AssStyle; -class SubtitlesGrid; - - +class PersistLocation; /// DOCME /// @class DialogStyleManager @@ -64,6 +58,7 @@ class SubtitlesGrid; /// DOCME class DialogStyleManager : public wxDialog { agi::Context *c; + agi::scoped_ptr persist; /// DOCME std::vector styleMap; @@ -71,73 +66,28 @@ class DialogStyleManager : public wxDialog { /// DOCME std::vector styleStorageMap; - /// DOCME wxComboBox *CatalogList; - - /// DOCME wxListBox *StorageList; - - /// DOCME wxListBox *CurrentList; - - /// DOCME wxButton *MoveToLocal; - - /// DOCME wxButton *StorageNew; - - /// DOCME wxButton *StorageEdit; - - /// DOCME wxButton *StorageCopy; - - /// DOCME wxButton *StorageDelete; - - /// DOCME wxButton *StorageMoveUp; - - /// DOCME wxButton *StorageMoveDown; - - /// DOCME wxButton *StorageMoveTop; - - /// DOCME wxButton *StorageMoveBottom; - - /// DOCME wxButton *StorageSort; - - /// DOCME wxButton *MoveToStorage; - - /// DOCME wxButton *CurrentNew; - - /// DOCME wxButton *CurrentEdit; - - /// DOCME wxButton *CurrentCopy; - - /// DOCME wxButton *CurrentDelete; - - /// DOCME wxButton *CurrentMoveUp; - - /// DOCME wxButton *CurrentMoveDown; - - /// DOCME wxButton *CurrentMoveTop; - - /// DOCME wxButton *CurrentMoveBottom; - - /// DOCME wxButton *CurrentSort; @@ -151,12 +101,6 @@ class DialogStyleManager : public wxDialog { void UpdateMoveButtons(); void MoveStyles(bool storage,int type); - - /// DOCME - - /// DOCME - static int lastx, lasty; - /// DOCME wxSizer *MainSizer; @@ -193,7 +137,6 @@ class DialogStyleManager : public wxDialog { void PasteToStorage(); public: - DialogStyleManager(agi::Context *context); ~DialogStyleManager(); diff --git a/aegisub/src/libresrc/default_config.json b/aegisub/src/libresrc/default_config.json index 3b9cc7780..d0d4b5d17 100644 --- a/aegisub/src/libresrc/default_config.json +++ b/aegisub/src/libresrc/default_config.json @@ -345,6 +345,13 @@ "Style Editor" : { "Preview Text" : "Aegisub\\N0123 月語" }, + "Style Manager" : { + "Last" : { + "X" : -1, + "Y" : -1 + }, + "Maximized" : false + }, "Styling Assistant" : { "Last" : { "X" : -1,