Use PersistLocation for DialogStyleManager

Originally committed to SVN as r5520.
This commit is contained in:
Thomas Goyne 2011-07-27 05:36:24 +00:00
parent fc46b25726
commit 833c35f6ae
3 changed files with 12 additions and 72 deletions

View File

@ -57,6 +57,7 @@
#include "help_button.h" #include "help_button.h"
#include "libresrc/libresrc.h" #include "libresrc/libresrc.h"
#include "main.h" #include "main.h"
#include "persist_location.h"
#include "selection_controller.h" #include "selection_controller.h"
#include "standard_paths.h" #include "standard_paths.h"
#include "utils.h" #include "utils.h"
@ -213,11 +214,7 @@ DialogStyleManager::DialogStyleManager (agi::Context *context)
MainSizer->SetSizeHints(this); MainSizer->SetSizeHints(this);
// Position window // Position window
if (lastx == -1 && lasty == -1) { persist.reset(new PersistLocation(this, "Tool/Style Manager"));
CenterOnParent();
} else {
Move(lastx, lasty);
}
// Populate lists // Populate lists
LoadCatalog(); LoadCatalog();
@ -395,7 +392,6 @@ END_EVENT_TABLE()
/// @brief Close /// @brief Close
void DialogStyleManager::OnClose (wxCommandEvent &) { void DialogStyleManager::OnClose (wxCommandEvent &) {
GetPosition(&lastx, &lasty);
Close(); Close();
} }
@ -1167,9 +1163,3 @@ void DialogStyleManager::OnKeyDown(wxKeyEvent &event) {
break; break;
} }
} }
/// DOCME
int DialogStyleManager::lastx = -1;
/// DOCME
int DialogStyleManager::lasty = -1;

View File

@ -34,11 +34,6 @@
/// @ingroup style_editor /// @ingroup style_editor
/// ///
////////////
// Includes
#ifndef AGI_PRE #ifndef AGI_PRE
#include <vector> #include <vector>
@ -48,14 +43,13 @@
#include <wx/listbox.h> #include <wx/listbox.h>
#endif #endif
#include <libaegisub/scoped_ptr.h>
#include "ass_style_storage.h" #include "ass_style_storage.h"
namespace agi { struct Context; } namespace agi { struct Context; }
class AssFile; class AssFile;
class AssStyle; class AssStyle;
class SubtitlesGrid; class PersistLocation;
/// DOCME /// DOCME
/// @class DialogStyleManager /// @class DialogStyleManager
@ -64,6 +58,7 @@ class SubtitlesGrid;
/// DOCME /// DOCME
class DialogStyleManager : public wxDialog { class DialogStyleManager : public wxDialog {
agi::Context *c; agi::Context *c;
agi::scoped_ptr<PersistLocation> persist;
/// DOCME /// DOCME
std::vector<AssStyle*> styleMap; std::vector<AssStyle*> styleMap;
@ -71,73 +66,28 @@ class DialogStyleManager : public wxDialog {
/// DOCME /// DOCME
std::vector<AssStyle*> styleStorageMap; std::vector<AssStyle*> styleStorageMap;
/// DOCME
wxComboBox *CatalogList; wxComboBox *CatalogList;
/// DOCME
wxListBox *StorageList; wxListBox *StorageList;
/// DOCME
wxListBox *CurrentList; wxListBox *CurrentList;
/// DOCME
wxButton *MoveToLocal; wxButton *MoveToLocal;
/// DOCME
wxButton *StorageNew; wxButton *StorageNew;
/// DOCME
wxButton *StorageEdit; wxButton *StorageEdit;
/// DOCME
wxButton *StorageCopy; wxButton *StorageCopy;
/// DOCME
wxButton *StorageDelete; wxButton *StorageDelete;
/// DOCME
wxButton *StorageMoveUp; wxButton *StorageMoveUp;
/// DOCME
wxButton *StorageMoveDown; wxButton *StorageMoveDown;
/// DOCME
wxButton *StorageMoveTop; wxButton *StorageMoveTop;
/// DOCME
wxButton *StorageMoveBottom; wxButton *StorageMoveBottom;
/// DOCME
wxButton *StorageSort; wxButton *StorageSort;
/// DOCME
wxButton *MoveToStorage; wxButton *MoveToStorage;
/// DOCME
wxButton *CurrentNew; wxButton *CurrentNew;
/// DOCME
wxButton *CurrentEdit; wxButton *CurrentEdit;
/// DOCME
wxButton *CurrentCopy; wxButton *CurrentCopy;
/// DOCME
wxButton *CurrentDelete; wxButton *CurrentDelete;
/// DOCME
wxButton *CurrentMoveUp; wxButton *CurrentMoveUp;
/// DOCME
wxButton *CurrentMoveDown; wxButton *CurrentMoveDown;
/// DOCME
wxButton *CurrentMoveTop; wxButton *CurrentMoveTop;
/// DOCME
wxButton *CurrentMoveBottom; wxButton *CurrentMoveBottom;
/// DOCME
wxButton *CurrentSort; wxButton *CurrentSort;
@ -151,12 +101,6 @@ class DialogStyleManager : public wxDialog {
void UpdateMoveButtons(); void UpdateMoveButtons();
void MoveStyles(bool storage,int type); void MoveStyles(bool storage,int type);
/// DOCME
/// DOCME
static int lastx, lasty;
/// DOCME /// DOCME
wxSizer *MainSizer; wxSizer *MainSizer;
@ -193,7 +137,6 @@ class DialogStyleManager : public wxDialog {
void PasteToStorage(); void PasteToStorage();
public: public:
DialogStyleManager(agi::Context *context); DialogStyleManager(agi::Context *context);
~DialogStyleManager(); ~DialogStyleManager();

View File

@ -345,6 +345,13 @@
"Style Editor" : { "Style Editor" : {
"Preview Text" : "Aegisub\\N0123 月語" "Preview Text" : "Aegisub\\N0123 月語"
}, },
"Style Manager" : {
"Last" : {
"X" : -1,
"Y" : -1
},
"Maximized" : false
},
"Styling Assistant" : { "Styling Assistant" : {
"Last" : { "Last" : {
"X" : -1, "X" : -1,