From cefaa393e6c4e4bfd297efb12d435412be802849 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 22 Nov 2010 15:25:59 +0000 Subject: [PATCH] Layout should not be called until after a sizer is inserted into its parent. This fixes the "gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17" type console warnings that are annoying on linux. If there are issues with this on other platforms let me know, but there shouldn't be. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6459 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Timer.cpp | 1 - Source/Core/DolphinWX/Src/ConfigMain.cpp | 22 +++------------------ Source/Core/DolphinWX/Src/ISOProperties.cpp | 13 ++++-------- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/Source/Core/Common/Src/Timer.cpp b/Source/Core/Common/Src/Timer.cpp index bfa7fc7536..087f8fcead 100644 --- a/Source/Core/Common/Src/Timer.cpp +++ b/Source/Core/Common/Src/Timer.cpp @@ -37,7 +37,6 @@ u32 Timer::GetTimeMs() #ifdef _WIN32 return timeGetTime(); #else - printf("using gettimeofday\n"); struct timeval t; (void)gettimeofday(&t, NULL); return ((u32)(t.tv_sec * 1000 + t.tv_usec / 1000)); diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 7c8a755181..a545cc4fd1 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -449,8 +449,6 @@ void CConfigMain::CreateGUIControls() sGeneralPage->Add(sbAdvanced, 0, wxEXPAND | wxALL, 5); GeneralPage->SetSizer(sGeneralPage); - sGeneralPage->Layout(); - // Display page @@ -520,8 +518,6 @@ void CConfigMain::CreateGUIControls() sDisplayPage->Add(sbInterface, 0, wxEXPAND | wxALL, 5); DisplayPage->SetSizer(sDisplayPage); - sDisplayPage->Layout(); - // Gamecube page @@ -641,8 +637,6 @@ void CConfigMain::CreateGUIControls() sGamecubePage->Add(sbGamecubeDeviceSettings, 0, wxEXPAND|wxALL, 5); GamecubePage->SetSizer(sGamecubePage); - sGamecubePage->Layout(); - // Wii page @@ -690,8 +684,6 @@ void CConfigMain::CreateGUIControls() sWiiPage->Add(sbWiiDeviceSettings, 0, wxEXPAND|wxALL, 5); WiiPage->SetSizer(sWiiPage); - sWiiPage->Layout(); - // Paths page @@ -737,8 +729,6 @@ void CConfigMain::CreateGUIControls() sPathsPage->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5); PathsPage->SetSizer(sPathsPage); - sPathsPage->Layout(); - // Plugins page @@ -763,7 +753,7 @@ void CConfigMain::CreateGUIControls() sPluginsPage->Add(sbDSPPlugin, 0, wxEXPAND|wxALL, 5); PluginsPage->SetSizer(sPluginsPage); - sPluginsPage->Layout(); + m_Ok = new wxButton(this, wxID_OK); @@ -795,8 +785,6 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event)) void CConfigMain::OnOk(wxCommandEvent& WXUNUSED (event)) { Close(); - // Sysconf saves when it gets deleted - //delete SConfig::GetInstance().m_SYSCONF; // Save the config. Dolphin crashes to often to save the settings on closing only SConfig::GetInstance().SaveSettings(); @@ -1097,17 +1085,13 @@ void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event) { if (event.GetId() == ID_ADDISOPATH) { - wxString dirHome; - wxGetHomeDir(&dirHome); - - wxDirDialog dialog(this, _T("Choose a directory to add"), dirHome, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); + wxDirDialog dialog(this, _T("Choose a directory to add"), wxGetHomeDir(), + wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); if (dialog.ShowModal() == wxID_OK) { if (ISOPaths->FindString(dialog.GetPath()) != -1) - { wxMessageBox(_("The chosen directory is already in the list"), _("Error"), wxOK); - } else { bRefreshList = true; diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index aa8e6bdf0c..600577b0da 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -317,9 +317,9 @@ void CISOProperties::CreateGUIControls(bool IsWad) } else { - //Progressive Scan is not used by Dolphin itself, - //and changing it on a per-game basis would have the side-effect of changing the SysConf, - //making this setting rather useless. + // Progressive Scan is not used by Dolphin itself, and changing it on a per-game + // basis would have the side-effect of changing the SysConf, making this setting + // rather useless. EnableProgressiveScan->Disable(); } // Video @@ -397,7 +397,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sEmuState->Add(EmuIssues,1,wxEXPAND); sConfigPage->Add(sEmuState, 0, wxEXPAND|wxALL, 5); m_GameConfig->SetSizer(sConfigPage); - sConfigPage->Layout(); // Patches @@ -420,7 +419,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sPatches->Add(sPatchButtons, 0, wxEXPAND|wxALL, 0); sPatchPage->Add(sPatches, 1, wxEXPAND|wxALL, 5); m_PatchPage->SetSizer(sPatchPage); - sPatchPage->Layout(); // Action Replay Cheats @@ -443,7 +441,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sCheats->Add(sCheatButtons, 0, wxEXPAND|wxALL, 0); sCheatPage->Add(sCheats, 1, wxEXPAND|wxALL, 5); m_CheatPage->SetSizer(sCheatPage); - sCheatPage->Layout(); m_NameText = new wxStaticText(m_Information, ID_NAME_TEXT, _("Name:"), wxDefaultPosition, wxDefaultSize); @@ -516,7 +513,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sInfoPage->Add(sbISODetails, 0, wxEXPAND|wxALL, 5); sInfoPage->Add(sbBannerDetails, 0, wxEXPAND|wxALL, 5); m_Information->SetSizer(sInfoPage); - sInfoPage->Layout(); // Filesystem icons m_iconList = new wxImageList(16, 16); @@ -533,7 +529,6 @@ void CISOProperties::CreateGUIControls(bool IsWad) sTreePage = new wxBoxSizer(wxVERTICAL); sTreePage->Add(m_Treectrl, 1, wxEXPAND|wxALL, 5); m_Filesystem->SetSizer(sTreePage); - sTreePage->Layout(); // It's a wad file, so we remove the FileSystem page if (IsWad) @@ -547,8 +542,8 @@ void CISOProperties::CreateGUIControls(bool IsWad) sMain->Add(sButtons, 0, wxEXPAND, 5); sMain->SetMinSize(wxSize(550, 600)); - m_Notebook->SetMaxSize(wxSize(550, 600)); SetSizerAndFit(sMain); + Layout(); } void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event))