GTK GUI :

- Removed the menuitem accelerator hack
- Fixed a Valgrind warning about an uninitialized pointer
- The sound driver now displays an error message when it is unable to access to the device, instead of crashing
This commit is contained in:
bgk 2008-05-03 07:58:20 +00:00
parent baf094ce92
commit a48b02db72
4 changed files with 13 additions and 80 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
vbam (0.svn500-1) hardy; urgency=low
* Updated VBA-M to r500
-- Bastien Bouclet <bgk@users.sourceforge.net> Sun, 29 Apr 2008 21:16:23 +0200
vbam (0.svn484-1) gutsy; urgency=low
* Added a GTK+ binary

View File

@ -1,76 +0,0 @@
// -*- C++ -*-
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2004 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __VBA_MENUITEM_H__
#define __VBA_MENUITEM_H__
#include <gtkmm/menuitem.h>
#include <gtkmm/imagemenuitem.h>
namespace VBA
{
class MenuItem : public Gtk::MenuItem
{
public:
MenuItem()
{}
MenuItem(Gtk::Widget & _roWidget) :
Gtk::MenuItem(_roWidget)
{}
MenuItem(const Glib::ustring & _rsLabel, bool _bMnemonic = false) :
Gtk::MenuItem(_rsLabel, _bMnemonic)
{}
inline void set_accel_key(const Gtk::AccelKey & _roAccelKey)
{
Gtk::MenuItem::set_accel_key(_roAccelKey);
}
};
class ImageMenuItem : public Gtk::ImageMenuItem
{
public:
ImageMenuItem()
{}
ImageMenuItem(Widget & _roImage, const Glib::ustring & _rsLabel, bool _bMnemonic = false) :
Gtk::ImageMenuItem(_roImage, _rsLabel, _bMnemonic)
{}
ImageMenuItem(const Glib::ustring & _rsLabel, bool _bMnemonic = false) :
Gtk::ImageMenuItem(_rsLabel, _bMnemonic)
{}
ImageMenuItem(const Gtk::StockID & _roId) :
Gtk::ImageMenuItem(_roId)
{}
inline void set_accel_key(const Gtk::AccelKey & _roAccelKey)
{
Gtk::MenuItem::set_accel_key(_roAccelKey);
}
};
} // namespace VBA
#endif // __VBA_MENUITEM_H__

View File

@ -106,6 +106,8 @@ bool systemSoundInit()
if (err != paNoError) goto error;
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
if (outputParameters.device == paNoDevice) goto error;
outputParameters.channelCount = 2; /* stereo output */
outputParameters.sampleFormat = paInt16;
outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultHighOutputLatency;

View File

@ -30,7 +30,6 @@
#include "../Sound.h"
#include "../Util.h"
#include "menuitem.h"
#include "tools.h"
#include "intl.h"
#include "screenarea-cairo.h"
@ -99,6 +98,7 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr<Xml> & _poXml) :
m_iScreenHeight = m_iGBAScreenHeight;
m_eCartridge = CartridgeNone;
m_uiJoypadState = 0;
m_poKeymap = NULL;
vInitSystem();
@ -1339,6 +1339,8 @@ void Window::vUpdateHistoryMenu()
{
vClearHistoryMenu();
Glib::RefPtr<Gtk::AccelGroup> poAccelGroup = get_accel_group();
guint uiAccelKey = GDK_F1;
for (std::list<std::string>::const_iterator it = m_listHistory.begin();
it != m_listHistory.end();
@ -1346,7 +1348,7 @@ void Window::vUpdateHistoryMenu()
{
Gtk::Image * poImage = Gtk::manage(new Gtk::Image(Gtk::Stock::OPEN, Gtk::ICON_SIZE_MENU));
Glib::ustring sLabel = Glib::path_get_basename(*it);
VBA::ImageMenuItem * poIMI = Gtk::manage(new VBA::ImageMenuItem(*poImage, sLabel));
Gtk::ImageMenuItem * poIMI = Gtk::manage(new Gtk::ImageMenuItem(*poImage, sLabel));
poIMI->set_tooltip_text(*it);
@ -1354,8 +1356,7 @@ void Window::vUpdateHistoryMenu()
sigc::mem_fun(*this, &Window::vOnRecentFile),
*it));
poIMI->set_accel_key(Gtk::AccelKey(uiAccelKey, Gdk::CONTROL_MASK));
poIMI->accelerate(*this);
poIMI->add_accelerator("activate", poAccelGroup, uiAccelKey, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE);
poIMI->show();
m_poRecentMenu->items().push_back(*poIMI);