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 "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;

View File

@ -34,11 +34,6 @@
/// @ingroup style_editor
///
////////////
// Includes
#ifndef AGI_PRE
#include <vector>
@ -48,14 +43,13 @@
#include <wx/listbox.h>
#endif
#include <libaegisub/scoped_ptr.h>
#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<PersistLocation> persist;
/// DOCME
std::vector<AssStyle*> styleMap;
@ -71,73 +66,28 @@ class DialogStyleManager : public wxDialog {
/// DOCME
std::vector<AssStyle*> 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();

View File

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