///////////////////////////////////////////////////////////////////////////// // Name: KeyDlg.cpp // Purpose: Key dialog // Author: Alex Thuering // Created: 18.05.2007 // RCS-ID: $Id: KeyDlg.cpp,v 1.1 2007/07/08 17:09:24 ntalex Exp $ // Copyright: (c) Alex Thuering // Licence: GPL ///////////////////////////////////////////////////////////////////////////// #include "KeyDlg.h" #include "hyperlink.h" #include "Config.h" #include #include #define KEY_URL wxT("http://www.dvdstyler.de/key.html") KeyDlg::KeyDlg(wxWindow* parent): wxPropDlg(parent) { SetTitle(_("DVDStyler Registration")); Create(false); SetSize(400,-1); } void KeyDlg::CreatePropPanel(wxSizer* sizer) { AddText(sizer, _("To continue using of DVDStyler you need to enter the registration key.")); sizer->Add(0, 6); AddText(sizer, _("You can get FREE KEY at:")); sizer->Add(0, 6); myHyperLink* website = new myHyperLink(this, -1, KEY_URL); website->SetURL(KEY_URL); sizer->Add(website, 0, wxALIGN_CENTER); wxFlexGridSizer* grid = sizer ? new wxFlexGridSizer(2, 1, 16) : NULL; grid->AddGrowableCol(1); sizer->Add(grid, 0, wxEXPAND|wxALL, 6); AddTextProp(grid, _("Key:"), wxT("")); } bool KeyDlg::SetValues() { long key; GetString(0).ToLong(&key); if (key != 4224) { wxMessageBox(_("The entered key is not valid.\nPlease try again."), _("DVDStyler"), wxOK|wxICON_ERROR, this); return false; } s_config.SetKey(key); return true; } int KeyDlg::ShowModal() { if (s_config.GetKey() < 4 || s_config.GetKey() == 4224) return wxID_OK; return wxPropDlg::ShowModal(); }