From dade6791453c893596bc6da675a70f7b131db987 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 11 Oct 2010 20:05:52 +0000 Subject: [PATCH] Select new styles in the styles manager when they are created. Originally committed to SVN as r4799. --- aegisub/src/dialog_style_manager.cpp | 34 ++++++++++- aegisub/src/dialog_style_manager.h | 86 ---------------------------- 2 files changed, 33 insertions(+), 87 deletions(-) diff --git a/aegisub/src/dialog_style_manager.cpp b/aegisub/src/dialog_style_manager.cpp index 38b2757ee..93bb187b4 100644 --- a/aegisub/src/dialog_style_manager.cpp +++ b/aegisub/src/dialog_style_manager.cpp @@ -58,6 +58,36 @@ #include "subs_grid.h" #include "utils.h" +/// IDs +enum { + BUTTON_CATALOG_NEW = 1000, + BUTTON_CATALOG_DELETE, + BUTTON_STORAGE_COPYTO, + BUTTON_STORAGE_NEW, + BUTTON_STORAGE_EDIT, + BUTTON_STORAGE_COPY, + BUTTON_STORAGE_DELETE, + BUTTON_STORAGE_UP, + BUTTON_STORAGE_DOWN, + BUTTON_STORAGE_TOP, + BUTTON_STORAGE_BOTTOM, + BUTTON_STORAGE_SORT, + BUTTON_CURRENT_COPYTO, + BUTTON_CURRENT_NEW, + BUTTON_CURRENT_EDIT, + BUTTON_CURRENT_COPY, + BUTTON_CURRENT_DELETE, + BUTTON_CURRENT_IMPORT, + BUTTON_CURRENT_UP, + BUTTON_CURRENT_DOWN, + BUTTON_CURRENT_TOP, + BUTTON_CURRENT_BOTTOM, + BUTTON_CURRENT_SORT, + LIST_CATALOG, + LIST_STORAGE, + LIST_CURRENT +}; + /// @brief Constructor /// @param parent /// @param _grid @@ -205,7 +235,7 @@ DialogStyleManager::DialogStyleManager (wxWindow *parent,SubtitlesGrid *_grid) wxString selected_style; if (_grid) { AssDialogue *dia = _grid->GetDialogue(_grid->GetFirstSelRow()); - if(dia) selected_style = dia->Style; + if(dia) selected_style = dia->Style; } if (StorageList->GetCount() && StorageList->SetStringSelection(selected_style)) { @@ -741,6 +771,7 @@ void DialogStyleManager::OnStorageNew (wxCommandEvent &) { Store.style.push_back(temp); Store.Save(CatalogList->GetString(CatalogList->GetSelection())); LoadStorageStyles(); + StorageList->SetStringSelection(temp->name); } else delete temp; UpdateMoveButtons(); @@ -755,6 +786,7 @@ void DialogStyleManager::OnCurrentNew (wxCommandEvent &) { if (modified) { grid->ass->InsertStyle(temp); LoadCurrentStyles(grid->ass); + CurrentList->SetStringSelection(temp->name); } else delete temp; UpdateMoveButtons(); diff --git a/aegisub/src/dialog_style_manager.h b/aegisub/src/dialog_style_manager.h index fe9a0f28d..121c03992 100644 --- a/aegisub/src/dialog_style_manager.h +++ b/aegisub/src/dialog_style_manager.h @@ -208,92 +208,6 @@ public: DECLARE_EVENT_TABLE() }; - -/////// -// IDs -enum { - - /// DOCME - BUTTON_CATALOG_NEW = 1000, - - /// DOCME - BUTTON_CATALOG_DELETE, - - /// DOCME - BUTTON_STORAGE_COPYTO, - - /// DOCME - BUTTON_STORAGE_NEW, - - /// DOCME - BUTTON_STORAGE_EDIT, - - /// DOCME - BUTTON_STORAGE_COPY, - - /// DOCME - BUTTON_STORAGE_DELETE, - - /// DOCME - BUTTON_STORAGE_UP, - - /// DOCME - BUTTON_STORAGE_DOWN, - - /// DOCME - BUTTON_STORAGE_TOP, - - /// DOCME - BUTTON_STORAGE_BOTTOM, - - /// DOCME - BUTTON_STORAGE_SORT, - - /// DOCME - BUTTON_CURRENT_COPYTO, - - /// DOCME - BUTTON_CURRENT_NEW, - - /// DOCME - BUTTON_CURRENT_EDIT, - - /// DOCME - BUTTON_CURRENT_COPY, - - /// DOCME - BUTTON_CURRENT_DELETE, - - /// DOCME - BUTTON_CURRENT_IMPORT, - - /// DOCME - BUTTON_CURRENT_UP, - - /// DOCME - BUTTON_CURRENT_DOWN, - - /// DOCME - BUTTON_CURRENT_TOP, - - /// DOCME - BUTTON_CURRENT_BOTTOM, - - /// DOCME - BUTTON_CURRENT_SORT, - - /// DOCME - LIST_CATALOG, - - /// DOCME - LIST_STORAGE, - - /// DOCME - LIST_CURRENT -}; - - - /// DOCME /// @class DialogStyleManagerEvent /// @brief DOCME