Commit e89ae8f9 authored by Grumbel's avatar Grumbel

Merge pull request #11 from Abogical/master

Use icons of PS3 and X-Box controllers
parents 9773e2b0 83ba76a8
*~
/build/
jstest-gtk
......@@ -12,7 +12,7 @@ You can find the latest version at:
* http://github.com/Grumbel/jstest-gtk/tree/master
Questions, comments and bug reporst can be given to:
Questions, comments and bug reports can be given to:
* Ingo Ruhnke <grumbel@gmx.de>
......
......@@ -123,11 +123,21 @@ JoystickListWidget::on_refresh()
for(std::vector<JoystickDescription>::const_iterator i = joysticks.begin(); i != joysticks.end(); ++i)
{
Gtk::ListStore::iterator it = device_list->append();
(*it)[DeviceListColumns::instance().icon] = Gdk::Pixbuf::create_from_file(Main::current()->get_data_directory() + "generic.png");
const Glib::ustring& name = i->name;
Glib::ustring icon_filename;
//Playstation icon for ps3 controller
if(name == "Sony PLAYSTATION(R)3 Controller") icon_filename = "PS3.png";
//Xbox icon for xbox controller
else if(name.find("X-Box") != Glib::ustring::npos) icon_filename = "xbox360_small.png";
//General icon for the rest
else icon_filename = "generic.png";
(*it)[DeviceListColumns::instance().icon] = Gdk::Pixbuf::create_from_file(Main::current()->get_data_directory() + icon_filename);
(*it)[DeviceListColumns::instance().path] = i->filename;
std::ostringstream out;
out << i->name << "\n"
out << name << "\n"
<< "Device: " << i->filename << "\n"
<< "Axes: " << i->axis_count << "\n"
<< "Buttons: " << i->button_count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment