/[pcsx2_0.9.7]/trunk/pcsx2/gui/Dialogs/ImportSettingsDialog.cpp
ViewVC logotype

Contents of /trunk/pcsx2/gui/Dialogs/ImportSettingsDialog.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (show annotations) (download)
Thu Dec 23 12:02:12 2010 UTC (9 years, 1 month ago) by william
File size: 2708 byte(s)
re-commit (had local access denied errors when committing)
1 /* PCSX2 - PS2 Emulator for PCs
2 * Copyright (C) 2002-2010 PCSX2 Dev Team
3 *
4 * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5 * of the GNU Lesser General Public License as published by the Free Software Found-
6 * ation, either version 3 of the License, or (at your option) any later version.
7 *
8 * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License along with PCSX2.
13 * If not, see <http://www.gnu.org/licenses/>.
14 */
15
16 #include "PrecompiledHeader.h"
17 #include "System.h"
18
19 #include "ModalPopups.h"
20
21 using namespace pxSizerFlags;
22
23 Dialogs::ImportSettingsDialog::ImportSettingsDialog( wxWindow* parent )
24 : wxDialogWithHelpers( parent, _("Import Existing Settings?") )
25 {
26 SetMinWidth( 440 );
27
28 pxStaticText& heading( Text( pxsFmt(
29
30 /// (%s is the app name, normally PCSX2 -- omitting one or both %s is allowed)
31 pxE( "!Notice:ImportExistingSettings",
32 L"Existing %s settings have been found in the configured settings folder. "
33 L"Would you like to import these settings or overwrite them with %s default values?"
34 L"\n\n(or press Cancel to select a different settings folder)"
35 ), pxGetAppName().c_str(), pxGetAppName().c_str()
36 )));
37
38 wxBoxSizer& s_buttons = *new wxBoxSizer( wxHORIZONTAL );
39 wxButton* b_import = new wxButton( this, wxID_ANY, _("Import") );
40 wxButton* b_over = new wxButton( this, wxID_ANY, _("Overwrite") );
41
42 // --------------------------------------------------------------------
43 // Layout Some Shizat...
44
45 s_buttons += b_import | StdButton();
46 s_buttons += 16;
47 s_buttons += b_over | StdButton();
48 s_buttons += 16;
49 s_buttons += new wxButton( this, wxID_CANCEL ) | StdButton();
50
51 *this += 4;
52 *this += heading | StdExpand();
53 *this += 12;
54 *this += &s_buttons | StdCenter();
55
56 Connect( b_import->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ImportSettingsDialog::OnImport_Click) );
57 Connect( b_over->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ImportSettingsDialog::OnOverwrite_Click) );
58 }
59
60 void Dialogs::ImportSettingsDialog::OnImport_Click( wxCommandEvent& /* evt */ )
61 {
62 AppConfig_OnChangedSettingsFolder( false ); // ... and import existing settings
63 g_Conf->Folders.Bios.Mkdir();
64 EndModal( wxID_OK );
65 }
66
67 void Dialogs::ImportSettingsDialog::OnOverwrite_Click( wxCommandEvent& /* evt */ )
68 {
69 AppConfig_OnChangedSettingsFolder( true ); // ... and overwrite any existing settings
70 g_Conf->Folders.Bios.Mkdir();
71 EndModal( wxID_OK );
72 }

  ViewVC Help
Powered by ViewVC 1.1.22