diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2007-06-17 20:15:18 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2007-06-17 20:15:18 +0000 |
commit | b57806237d275b54380be5b73e3d783bd6972bf8 (patch) | |
tree | 7b366953a80dc6778f4ef5857731b5dc738d5751 /rbutil | |
parent | 2199808631347d3ac7ea0118646577516386f866 (diff) | |
download | rockbox-b57806237d275b54380be5b73e3d783bd6972bf8.tar.gz rockbox-b57806237d275b54380be5b73e3d783bd6972bf8.zip |
rbutil: Add quessing of the Drive letter via Windows API, also restructuring for future Device detection via pid and vid.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13655 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/autodetection.cpp | 231 | ||||
-rw-r--r-- | rbutil/autodetection.h | 142 | ||||
-rw-r--r-- | rbutil/rbutilCtrls.cpp | 81 | ||||
-rw-r--r-- | rbutil/rbutilFrm.cpp | 17 |
4 files changed, 401 insertions, 70 deletions
diff --git a/rbutil/autodetection.cpp b/rbutil/autodetection.cpp new file mode 100644 index 0000000000..1d85d961b9 --- /dev/null +++ b/rbutil/autodetection.cpp | |||
@@ -0,0 +1,231 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * Module: rbutil | ||
9 | * File: autodetection.cpp | ||
10 | * | ||
11 | * Copyright (C) 2008 Dominik Wenger | ||
12 | * | ||
13 | * All files in this archive are subject to the GNU General Public License. | ||
14 | * See the file COPYING in the source tree root for full license agreement. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #include "autodetection.h" | ||
22 | #include "bootloaders.h" | ||
23 | /*************************************************** | ||
24 | * General autodetection code | ||
25 | ****************************************************/ | ||
26 | |||
27 | |||
28 | UsbDeviceInfo detectDevicesViaPatchers() | ||
29 | { | ||
30 | UsbDeviceInfo tempdevice; | ||
31 | tempdevice.device_index= 0; | ||
32 | tempdevice.path=wxT(""); | ||
33 | tempdevice.status =0; | ||
34 | |||
35 | /* scann for ipods */ | ||
36 | |||
37 | struct ipod_t ipod; | ||
38 | int n = ipod_scan(&ipod); | ||
39 | if(n == 1) | ||
40 | { | ||
41 | wxString temp(ipod.targetname,wxConvUTF8); | ||
42 | int index = gv->plat_bootloadername.Index(temp); // use the bootloader names.. | ||
43 | tempdevice.device_index = index; | ||
44 | /* find mount point if possible */ | ||
45 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) //linux code | ||
46 | wxString tmp = resolve_mount_point(wxString(ipod.diskname,wxConvUTF8)+wxT("2")); | ||
47 | if( tmp != wxT("") ) | ||
48 | tempdevice.path = tmp; | ||
49 | #endif | ||
50 | #if defined( __WXMSW__ ) //Windows code | ||
51 | wxString tmp = guess_mount_point(); | ||
52 | if( tmp != wxT("") ) | ||
53 | tempdevice.path = tmp; | ||
54 | #endif | ||
55 | return tempdevice; | ||
56 | } | ||
57 | else if (n > 1) | ||
58 | { | ||
59 | tempdevice.status = TOMANYDEVICES; | ||
60 | return tempdevice; | ||
61 | } | ||
62 | |||
63 | /* scann for sansas */ | ||
64 | struct sansa_t sansa; | ||
65 | int n2 = sansa_scan(&sansa); | ||
66 | if(n2==1) | ||
67 | { | ||
68 | tempdevice.device_index = gv->plat_id.Index(wxT("sansae200")); | ||
69 | /* find mount point if possible */ | ||
70 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) //linux code | ||
71 | wxString tmp = resolve_mount_point(wxString(ipod.diskname,wxConvUTF8)+wxT("1")); | ||
72 | if( tmp != wxT("") ) | ||
73 | tempdevice.path = tmp; | ||
74 | #endif | ||
75 | #if defined( __WXMSW__ ) // windows code | ||
76 | wxString tmp = guess_mount_point(); | ||
77 | if( tmp != wxT("") ) | ||
78 | tempdevice.path = tmp; | ||
79 | #endif | ||
80 | return tempdevice; | ||
81 | } | ||
82 | else if (n > 1) | ||
83 | { | ||
84 | tempdevice.status = TOMANYDEVICES; | ||
85 | return tempdevice; | ||
86 | } | ||
87 | |||
88 | |||
89 | tempdevice.status = NODEVICE; | ||
90 | return tempdevice; | ||
91 | |||
92 | } | ||
93 | |||
94 | |||
95 | |||
96 | |||
97 | /*************************************************** | ||
98 | * Windows code for autodetection | ||
99 | ****************************************************/ | ||
100 | #if defined( __WXMSW__ ) | ||
101 | |||
102 | wxString guess_mount_point() | ||
103 | { | ||
104 | wxString mountpoint = wxT(""); | ||
105 | TCHAR szDrvName[33]; | ||
106 | DWORD maxDriveSet, curDriveSet; | ||
107 | DWORD drive; | ||
108 | TCHAR szBuf[300]; | ||
109 | HANDLE hDevice; | ||
110 | PSTORAGE_DEVICE_DESCRIPTOR pDevDesc; | ||
111 | |||
112 | maxDriveSet = GetLogicalDrives(); | ||
113 | curDriveSet = maxDriveSet; | ||
114 | for ( drive = 0; drive < 32; ++drive ) | ||
115 | { | ||
116 | if ( maxDriveSet & (1 << drive) ) | ||
117 | { | ||
118 | DWORD temp = 1<<drive; | ||
119 | _stprintf( szDrvName, _T("%c:\\"), 'A'+drive ); | ||
120 | switch ( GetDriveType( szDrvName ) ) | ||
121 | { | ||
122 | case 0: // The drive type cannot be determined. | ||
123 | case 1: // The root directory does not exist. | ||
124 | case DRIVE_CDROM: // The drive is a CD-ROM drive. | ||
125 | case DRIVE_REMOTE: // The drive is a remote (network) drive. | ||
126 | case DRIVE_RAMDISK: // The drive is a RAM disk. | ||
127 | case DRIVE_REMOVABLE: // The drive can be removed from the drive. | ||
128 | break; | ||
129 | case DRIVE_FIXED: // The disk cannot be removed from the drive. | ||
130 | sprintf(szBuf, "\\\\?\\%c:", 'A'+drive); | ||
131 | hDevice = CreateFile(szBuf, GENERIC_READ, | ||
132 | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, NULL); | ||
133 | |||
134 | if (hDevice != INVALID_HANDLE_VALUE) | ||
135 | { | ||
136 | pDevDesc = (PSTORAGE_DEVICE_DESCRIPTOR)new BYTE[sizeof(STORAGE_DEVICE_DESCRIPTOR) + 512 - 1]; | ||
137 | pDevDesc->Size = sizeof(STORAGE_DEVICE_DESCRIPTOR) + 512 - 1; | ||
138 | |||
139 | if(GetDisksProperty(hDevice, pDevDesc)) | ||
140 | { | ||
141 | if(pDevDesc->BusType == BusTypeUsb) | ||
142 | { | ||
143 | mountpoint.Printf(wxT("%c:\\"), chFirstDriveFromMask(temp)); | ||
144 | } | ||
145 | } | ||
146 | delete pDevDesc; | ||
147 | CloseHandle(hDevice); | ||
148 | } | ||
149 | break; | ||
150 | } | ||
151 | } | ||
152 | } | ||
153 | return mountpoint; | ||
154 | |||
155 | } | ||
156 | |||
157 | |||
158 | |||
159 | /**************************************************************************** | ||
160 | * FUNCTION: GetDisksProperty(HANDLE hDevice, PSTORAGE_DEVICE_DESCRIPTOR pDevDesc) | ||
161 | * PURPOSE: get the info of specified device | ||
162 | *****************************************************************************/ | ||
163 | BOOL GetDisksProperty(HANDLE hDevice, PSTORAGE_DEVICE_DESCRIPTOR pDevDesc) | ||
164 | { | ||
165 | STORAGE_PROPERTY_QUERY Query; // input param for query | ||
166 | DWORD dwOutBytes; // IOCTL output length | ||
167 | BOOL bResult; // IOCTL return val | ||
168 | |||
169 | // specify the query type | ||
170 | Query.PropertyId = StorageDeviceProperty; | ||
171 | Query.QueryType = PropertyStandardQuery; | ||
172 | |||
173 | // Query using IOCTL_STORAGE_QUERY_PROPERTY | ||
174 | bResult = ::DeviceIoControl(hDevice, // device handle | ||
175 | IOCTL_STORAGE_QUERY_PROPERTY, // info of device property | ||
176 | &Query, sizeof(STORAGE_PROPERTY_QUERY), // input data buffer | ||
177 | pDevDesc, pDevDesc->Size, // output data buffer | ||
178 | &dwOutBytes, // out's length | ||
179 | (LPOVERLAPPED)NULL); | ||
180 | |||
181 | return bResult; | ||
182 | } | ||
183 | |||
184 | /********************************************* | ||
185 | * Converts the driveMask to a drive letter | ||
186 | *******************************************/ | ||
187 | char chFirstDriveFromMask (ULONG unitmask) | ||
188 | { | ||
189 | |||
190 | char i; | ||
191 | for (i = 0; i < 26; ++i) | ||
192 | { | ||
193 | if (unitmask & 0x1) | ||
194 | break; | ||
195 | unitmask = unitmask >> 1; | ||
196 | } | ||
197 | return (i + 'A'); | ||
198 | } | ||
199 | #endif /* windows code */ | ||
200 | |||
201 | /********************************************************** | ||
202 | * Linux code for autodetection | ||
203 | *******************************************************/ | ||
204 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) | ||
205 | |||
206 | |||
207 | |||
208 | wxString resolve_mount_point( const wxString device ) | ||
209 | { | ||
210 | FILE *fp = fopen( "/proc/mounts", "r" ); | ||
211 | if( !fp ) return wxT(""); | ||
212 | char *dev, *dir; | ||
213 | while( fscanf( fp, "%as %as %*s %*s %*s %*s", &dev, &dir ) != EOF ) | ||
214 | { | ||
215 | if( wxString( dev, wxConvUTF8 ) == device ) | ||
216 | { | ||
217 | wxString directory = wxString( dir, wxConvUTF8 ); | ||
218 | free( dev ); | ||
219 | free( dir ); | ||
220 | return directory; | ||
221 | } | ||
222 | free( dev ); | ||
223 | free( dir ); | ||
224 | } | ||
225 | fclose( fp ); | ||
226 | return wxT(""); | ||
227 | } | ||
228 | |||
229 | |||
230 | |||
231 | #endif | ||
diff --git a/rbutil/autodetection.h b/rbutil/autodetection.h new file mode 100644 index 0000000000..dc2d7d2490 --- /dev/null +++ b/rbutil/autodetection.h | |||
@@ -0,0 +1,142 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * Module: rbutil | ||
9 | * File: autodetection.h | ||
10 | * | ||
11 | * Copyright (C) 2008 Dominik Wenger | ||
12 | * | ||
13 | * All files in this archive are subject to the GNU General Public License. | ||
14 | * See the file COPYING in the source tree root for full license agreement. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #ifndef AUTODETECTION_H_INCLUDED | ||
22 | #define AUTODETECTION_H_INCLUDED | ||
23 | |||
24 | |||
25 | /************************************** | ||
26 | * General code for USB Device detection | ||
27 | ***************************************/ | ||
28 | #include "rbutil.h" | ||
29 | |||
30 | #define TOMANYDEVICES 2 | ||
31 | #define NODEVICE 1 | ||
32 | |||
33 | struct UsbDeviceInfo | ||
34 | { | ||
35 | int device_index; | ||
36 | wxString path; | ||
37 | int status; | ||
38 | }; | ||
39 | |||
40 | UsbDeviceInfo detectDevicesViaPatchers(); | ||
41 | |||
42 | |||
43 | /******************************** | ||
44 | * Windows code for USB Device detection and information | ||
45 | **************************************/ | ||
46 | |||
47 | #if defined( __WXMSW__ ) | ||
48 | |||
49 | #include <dbt.h> // For DeviceChange. | ||
50 | #include <winioctl.h> // For DeviceIOCtl. | ||
51 | |||
52 | // IOCTL control code | ||
53 | #define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS) | ||
54 | |||
55 | //// The following structures all can find at MSDN. | ||
56 | // enumeration type specifies the various types of storage buses | ||
57 | typedef enum _STORAGE_BUS_TYPE { | ||
58 | BusTypeUnknown = 0x00, | ||
59 | BusTypeScsi, | ||
60 | BusTypeAtapi, | ||
61 | BusTypeAta, | ||
62 | BusType1394, | ||
63 | BusTypeSsa, | ||
64 | BusTypeFibre, | ||
65 | BusTypeUsb, | ||
66 | BusTypeRAID, | ||
67 | BusTypeMaxReserved = 0x7F | ||
68 | } STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE; | ||
69 | // retrieve the storage device descriptor data for a device. | ||
70 | typedef struct _STORAGE_DEVICE_DESCRIPTOR { | ||
71 | ULONG Version; | ||
72 | ULONG Size; | ||
73 | UCHAR DeviceType; | ||
74 | UCHAR DeviceTypeModifier; | ||
75 | BOOLEAN RemovableMedia; | ||
76 | BOOLEAN CommandQueueing; | ||
77 | ULONG VendorIdOffset; | ||
78 | ULONG ProductIdOffset; | ||
79 | ULONG ProductRevisionOffset; | ||
80 | ULONG SerialNumberOffset; | ||
81 | STORAGE_BUS_TYPE BusType; | ||
82 | ULONG RawPropertiesLength; | ||
83 | UCHAR RawDeviceProperties[1]; | ||
84 | |||
85 | } STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR; | ||
86 | // retrieve the properties of a storage device or adapter. | ||
87 | typedef enum _STORAGE_QUERY_TYPE { | ||
88 | PropertyStandardQuery = 0, | ||
89 | PropertyExistsQuery, | ||
90 | PropertyMaskQuery, | ||
91 | PropertyQueryMaxDefined | ||
92 | |||
93 | } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE; | ||
94 | |||
95 | // retrieve the properties of a storage device or adapter. | ||
96 | typedef enum _STORAGE_PROPERTY_ID { | ||
97 | StorageDeviceProperty = 0, | ||
98 | StorageAdapterProperty, | ||
99 | StorageDeviceIdProperty | ||
100 | |||
101 | } STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID; | ||
102 | // retrieve the properties of a storage device or adapter. | ||
103 | typedef struct _STORAGE_PROPERTY_QUERY { | ||
104 | STORAGE_PROPERTY_ID PropertyId; | ||
105 | STORAGE_QUERY_TYPE QueryType; | ||
106 | UCHAR AdditionalParameters[1]; | ||
107 | |||
108 | } STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY; | ||
109 | |||
110 | |||
111 | wxString guess_mount_point(); | ||
112 | |||
113 | BOOL GetDisksProperty(HANDLE hDevice, PSTORAGE_DEVICE_DESCRIPTOR pDevDesc); | ||
114 | char chFirstDriveFromMask (ULONG unitmask); | ||
115 | |||
116 | #endif /*__WXMSW__ */ | ||
117 | |||
118 | |||
119 | /************************************************************************+ | ||
120 | *Linux code for autodetection | ||
121 | **************************************************************************/ | ||
122 | |||
123 | |||
124 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) | ||
125 | |||
126 | wxString resolve_mount_point( const wxString device ); | ||
127 | |||
128 | |||
129 | #endif /* Linux Code */ | ||
130 | |||
131 | |||
132 | |||
133 | |||
134 | |||
135 | |||
136 | |||
137 | |||
138 | |||
139 | |||
140 | |||
141 | |||
142 | #endif | ||
diff --git a/rbutil/rbutilCtrls.cpp b/rbutil/rbutilCtrls.cpp index 1e80e7bea9..887f2e7fb1 100644 --- a/rbutil/rbutilCtrls.cpp +++ b/rbutil/rbutilCtrls.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | 1 | ||
2 | #include "rbutilCtrls.h" | 2 | #include "rbutilCtrls.h" |
3 | #include "bootloaders.h" | 3 | #include "bootloaders.h" |
4 | #include "autodetection.h" | ||
4 | 5 | ||
5 | ///////////////////////////////////////////////////////////// | 6 | ///////////////////////////////////////////////////////////// |
6 | //// Controls | 7 | //// Controls |
@@ -435,79 +436,39 @@ void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event) | |||
435 | AutoDetect(); | 436 | AutoDetect(); |
436 | } | 437 | } |
437 | 438 | ||
438 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) | ||
439 | wxString resolve_mount_point( const wxString device ) | ||
440 | { | ||
441 | FILE *fp = fopen( "/proc/mounts", "r" ); | ||
442 | if( !fp ) return wxT(""); | ||
443 | char *dev, *dir; | ||
444 | while( fscanf( fp, "%as %as %*s %*s %*s %*s", &dev, &dir ) != EOF ) | ||
445 | { | ||
446 | if( wxString( dev, wxConvUTF8 ) == device ) | ||
447 | { | ||
448 | wxString directory = wxString( dir, wxConvUTF8 ); | ||
449 | free( dev ); | ||
450 | free( dir ); | ||
451 | return directory; | ||
452 | } | ||
453 | free( dev ); | ||
454 | free( dir ); | ||
455 | } | ||
456 | fclose( fp ); | ||
457 | return wxT(""); | ||
458 | } | ||
459 | #endif | ||
460 | 439 | ||
461 | void DeviceSelectorCtrl::AutoDetect() | 440 | void DeviceSelectorCtrl::AutoDetect() |
462 | { | 441 | { |
463 | struct ipod_t ipod; | 442 | |
464 | int n = ipod_scan(&ipod); | 443 | |
465 | if(n == 1) | 444 | UsbDeviceInfo device = detectDevicesViaPatchers(); |
466 | { | 445 | |
467 | wxString temp(ipod.targetname,wxConvUTF8); | 446 | if( device.status == NODEVICE) |
468 | int index = gv->plat_bootloadername.Index(temp); // use the bootloader names.. | ||
469 | m_deviceCbx->SetValue(gv->plat_name[index]); | ||
470 | gv->curplat=gv->plat_id[index]; | ||
471 | |||
472 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) | ||
473 | wxString tmp = resolve_mount_point(wxString(ipod.diskname,wxConvUTF8)+wxT("2")); | ||
474 | if( tmp != wxT("") ) | ||
475 | gv->curdestdir = tmp; | ||
476 | #endif | ||
477 | return; | ||
478 | } | ||
479 | else if (n > 1) | ||
480 | { | 447 | { |
481 | WARN_DIALOG(wxT("More then one Ipod device detected, please connect only One"), | 448 | WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods and Sansas)."), |
482 | wxT("Detecting a Device")); | 449 | wxT("Detecting a Device")); |
483 | return; | 450 | return; |
484 | } | 451 | } |
485 | 452 | ||
486 | struct sansa_t sansa; | 453 | if( device.status == TOMANYDEVICES) |
487 | int n2 = sansa_scan(&sansa); | ||
488 | if(n2==1) | ||
489 | { | 454 | { |
490 | int index = gv->plat_id.Index(wxT("sansae200")); | 455 | WARN_DIALOG(wxT("More then one device detected, please connect only One"), |
491 | m_deviceCbx->SetValue(gv->plat_name[index]); | ||
492 | gv->curplat=gv->plat_id[index]; | ||
493 | |||
494 | #if !(defined( __WXMSW__ ) || defined( __DARWIN__)) | ||
495 | wxString tmp = resolve_mount_point(wxString(sansa.diskname,wxConvUTF8)+wxT("1")); | ||
496 | if( tmp != wxT("") ) | ||
497 | gv->curdestdir = tmp; | ||
498 | #endif | ||
499 | return; | ||
500 | } | ||
501 | else if (n2 > 1) | ||
502 | { | ||
503 | WARN_DIALOG(wxT("More then one Sansa device detected, please connect only One"), | ||
504 | wxT("Detecting a Device")); | 456 | wxT("Detecting a Device")); |
505 | return; | 457 | return; |
458 | |||
506 | } | 459 | } |
507 | 460 | ||
508 | WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods and Sansas)."), | 461 | if (device.status == 0 ) /* everything is ok */ |
509 | wxT("Detecting a Device")); | 462 | { |
510 | return; | 463 | m_deviceCbx->SetValue(gv->plat_name[device.device_index]); |
464 | gv->curplat=gv->plat_id[device.device_index]; | ||
465 | |||
466 | if(device.path != wxT("")) | ||
467 | { | ||
468 | gv->curdestdir = device.path; | ||
469 | } | ||
470 | |||
471 | } | ||
511 | 472 | ||
512 | } | 473 | } |
513 | 474 | ||
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp index cd68ec86a6..0dc85c09b0 100644 --- a/rbutil/rbutilFrm.cpp +++ b/rbutil/rbutilFrm.cpp | |||
@@ -96,8 +96,6 @@ void rbutilFrm::CreateGUIControls(void) | |||
96 | myDeviceSelector->setDefault(); | 96 | myDeviceSelector->setDefault(); |
97 | WxBoxSizer0->Add(myDeviceSelector,0,wxGROW|wxALL,5); | 97 | WxBoxSizer0->Add(myDeviceSelector,0,wxGROW|wxALL,5); |
98 | 98 | ||
99 | |||
100 | |||
101 | wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY); | 99 | wxNotebook* tabwindow = new wxNotebook(mainPanel,wxID_ANY); |
102 | WxBoxSizer0->Add(tabwindow,1,wxGROW|wxALL,5); | 100 | WxBoxSizer0->Add(tabwindow,1,wxGROW|wxALL,5); |
103 | 101 | ||
@@ -130,7 +128,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
130 | wxBitmap BootloaderInstallButton (tools2_3d_xpm); | 128 | wxBitmap BootloaderInstallButton (tools2_3d_xpm); |
131 | WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN, | 129 | WxBitmapButton4 = new wxBitmapButton(installpage, ID_BOOTLOADER_BTN, |
132 | BootloaderInstallButton, wxPoint(0,0), wxSize(64,54), | 130 | BootloaderInstallButton, wxPoint(0,0), wxSize(64,54), |
133 | wxRAISED_BORDER | wxBU_AUTODRAW); | 131 | wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,wxT("Bootloader Installation")); |
134 | WxBitmapButton4->SetToolTip(wxT("Click here to install the Rockbox bootloader")); | 132 | WxBitmapButton4->SetToolTip(wxT("Click here to install the Rockbox bootloader")); |
135 | WxFlexGridSizer1->Add(WxBitmapButton4, 0, | 133 | WxFlexGridSizer1->Add(WxBitmapButton4, 0, |
136 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | 134 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); |
@@ -147,7 +145,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
147 | WxBitmapButton1 = new wxBitmapButton(installpage, ID_INSTALL_BTN, | 145 | WxBitmapButton1 = new wxBitmapButton(installpage, ID_INSTALL_BTN, |
148 | WxBitmapButton1_BITMAP, wxPoint(0,0), wxSize(64,54), | 146 | WxBitmapButton1_BITMAP, wxPoint(0,0), wxSize(64,54), |
149 | wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, | 147 | wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, |
150 | wxT("WxBitmapButton1")); | 148 | wxT("Rockbox Installation")); |
151 | WxBitmapButton1->SetToolTip(wxT("Click here to install Rockbox")); | 149 | WxBitmapButton1->SetToolTip(wxT("Click here to install Rockbox")); |
152 | WxFlexGridSizer1->Add(WxBitmapButton1,0, | 150 | WxFlexGridSizer1->Add(WxBitmapButton1,0, |
153 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | 151 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); |
@@ -177,7 +175,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
177 | wxBitmap FontInstallButton (fonts_3d_xpm); | 175 | wxBitmap FontInstallButton (fonts_3d_xpm); |
178 | WxBitmapButton3 = new wxBitmapButton(themepage, ID_FONT_BTN, | 176 | WxBitmapButton3 = new wxBitmapButton(themepage, ID_FONT_BTN, |
179 | FontInstallButton, wxPoint(0,0), wxSize(64,54), | 177 | FontInstallButton, wxPoint(0,0), wxSize(64,54), |
180 | wxRAISED_BORDER | wxBU_AUTODRAW); | 178 | wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Font installation")); |
181 | WxBitmapButton3->SetToolTip(wxT("Click here to install the most up to date " | 179 | WxBitmapButton3->SetToolTip(wxT("Click here to install the most up to date " |
182 | "Rockbox fonts.")); | 180 | "Rockbox fonts.")); |
183 | WxFlexGridSizer2->Add(WxBitmapButton3, 0, | 181 | WxFlexGridSizer2->Add(WxBitmapButton3, 0, |
@@ -194,7 +192,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
194 | wxBitmap ThemesInstallButton (themes_3d_xpm); | 192 | wxBitmap ThemesInstallButton (themes_3d_xpm); |
195 | WxBitmapButton5 = new wxBitmapButton(themepage, ID_THEMES_BTN, | 193 | WxBitmapButton5 = new wxBitmapButton(themepage, ID_THEMES_BTN, |
196 | ThemesInstallButton, wxPoint(0,0), wxSize(64,54), | 194 | ThemesInstallButton, wxPoint(0,0), wxSize(64,54), |
197 | wxRAISED_BORDER | wxBU_AUTODRAW); | 195 | wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Theme installation")); |
198 | WxBitmapButton5->SetToolTip(wxT("Click here to install themes for Rockbox.")); | 196 | WxBitmapButton5->SetToolTip(wxT("Click here to install themes for Rockbox.")); |
199 | WxFlexGridSizer2->Add(WxBitmapButton5, 0, | 197 | WxFlexGridSizer2->Add(WxBitmapButton5, 0, |
200 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | 198 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); |
@@ -208,7 +206,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
208 | wxBitmap DoomInstallButton (doom_3d_xpm); | 206 | wxBitmap DoomInstallButton (doom_3d_xpm); |
209 | WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN, | 207 | WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN, |
210 | DoomInstallButton, wxPoint(0,0), wxSize(64,54), | 208 | DoomInstallButton, wxPoint(0,0), wxSize(64,54), |
211 | wxRAISED_BORDER | wxBU_AUTODRAW); | 209 | wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Freedoom installation")); |
212 | WxBitmapButton6->SetToolTip(wxT("Click here to install the freedoom wad files.")); | 210 | WxBitmapButton6->SetToolTip(wxT("Click here to install the freedoom wad files.")); |
213 | WxFlexGridSizer2->Add(WxBitmapButton6, 0, | 211 | WxFlexGridSizer2->Add(WxBitmapButton6, 0, |
214 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | 212 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); |
@@ -238,8 +236,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
238 | wxBitmap WxBitmapButton2_BITMAP (uninstall_3d_xpm); | 236 | wxBitmap WxBitmapButton2_BITMAP (uninstall_3d_xpm); |
239 | WxBitmapButton2 = new wxBitmapButton(uninstallpage, ID_REMOVE_BTN, | 237 | WxBitmapButton2 = new wxBitmapButton(uninstallpage, ID_REMOVE_BTN, |
240 | WxBitmapButton2_BITMAP, wxPoint(0,0), wxSize(64,54), | 238 | WxBitmapButton2_BITMAP, wxPoint(0,0), wxSize(64,54), |
241 | wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, | 239 | wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Rockbox uninstallation")); |
242 | wxT("WxBitmapButton2")); | ||
243 | WxBitmapButton2->SetToolTip(wxT("Click here to uninstall Rockbox")); | 240 | WxBitmapButton2->SetToolTip(wxT("Click here to uninstall Rockbox")); |
244 | WxFlexGridSizer3->Add(WxBitmapButton2,0, | 241 | WxFlexGridSizer3->Add(WxBitmapButton2,0, |
245 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | 242 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); |
@@ -253,7 +250,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
253 | WxBitmapButton4 = new wxBitmapButton(uninstallpage, ID_BOOTLOADERREMOVE_BTN, | 250 | WxBitmapButton4 = new wxBitmapButton(uninstallpage, ID_BOOTLOADERREMOVE_BTN, |
254 | WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54), | 251 | WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54), |
255 | wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, | 252 | wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator, |
256 | wxT("WxBitmapButton4")); | 253 | wxT("Bootloader uninstallation")); |
257 | WxBitmapButton4->SetToolTip(wxT("Click here to uninstall the Bootloader")); | 254 | WxBitmapButton4->SetToolTip(wxT("Click here to uninstall the Bootloader")); |
258 | WxFlexGridSizer3->Add(WxBitmapButton4,0, | 255 | WxFlexGridSizer3->Add(WxBitmapButton4,0, |
259 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); | 256 | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5); |