File tree 4 files changed +14
-3
lines changed
4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
* ~
2
2
/build /
3
+ jstest-gtk
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ You can find the latest version at:
12
12
13
13
* http://github.com/Grumbel/jstest-gtk/tree/master
14
14
15
- Questions, comments and bug reporst can be given to:
15
+ Questions, comments and bug reports can be given to:
16
16
17
17
18
18
Original file line number Diff line number Diff line change @@ -123,11 +123,21 @@ JoystickListWidget::on_refresh()
123
123
for (std::vector<JoystickDescription>::const_iterator i = joysticks.begin (); i != joysticks.end (); ++i)
124
124
{
125
125
Gtk::ListStore::iterator it = device_list->append ();
126
- (*it)[DeviceListColumns::instance ().icon ] = Gdk::Pixbuf::create_from_file (Main::current ()->get_data_directory () + " generic.png" );
126
+
127
+ const Glib::ustring& name = i->name ;
128
+ Glib::ustring icon_filename;
129
+ // Playstation icon for ps3 controller
130
+ if (name == " Sony PLAYSTATION(R)3 Controller" ) icon_filename = " PS3.png" ;
131
+ // Xbox icon for xbox controller
132
+ else if (name.find (" X-Box" ) != Glib::ustring::npos) icon_filename = " xbox360_small.png" ;
133
+ // General icon for the rest
134
+ else icon_filename = " generic.png" ;
135
+
136
+ (*it)[DeviceListColumns::instance ().icon ] = Gdk::Pixbuf::create_from_file (Main::current ()->get_data_directory () + icon_filename);
127
137
(*it)[DeviceListColumns::instance ().path ] = i->filename ;
128
138
129
139
std::ostringstream out;
130
- out << i-> name << " \n "
140
+ out << name << " \n "
131
141
<< " Device: " << i->filename << " \n "
132
142
<< " Axes: " << i->axis_count << " \n "
133
143
<< " Buttons: " << i->button_count ;
You can’t perform that action at this time.
0 commit comments