Skip to content

Commit

Permalink
Save state for Preferences dialog (#536)
Browse files Browse the repository at this point in the history
Closes #448, closes #508
  • Loading branch information
vktr committed Mar 5, 2018
1 parent 30e12a8 commit 46cf6d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/picotorrent/preferencesdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <wx/bookctrl.h>
#include <wx/listbook.h>
#include <wx/persist.h>
#include <wx/persist/toplevel.h>

namespace lt = libtorrent;
using pt::PreferencesDialog;
Expand All @@ -36,9 +38,10 @@ PreferencesDialog::PreferencesDialog(
m_state(sessionState),
m_taskBarIcon(taskBarIcon)
{
SetName("PreferencesDialog");
SetSheetStyle(wxPROPSHEET_LISTBOOK);

Create(parent, wxID_ANY, i18n(tran, "preferences"));
Create(parent, wxID_ANY, i18n(tran, "preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);

wxBookCtrlBase* book = GetBookCtrl();
m_general = new GeneralPage(book, cfg, tran);
Expand All @@ -53,6 +56,8 @@ PreferencesDialog::PreferencesDialog(

CreateButtons();
LayoutDialog();

wxPersistenceManager::Get().RegisterAndRestore(this);
}

void PreferencesDialog::OnOk(wxCommandEvent& event)
Expand Down

0 comments on commit 46cf6d2

Please sign in to comment.