summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-07-16 19:44:46 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2012-07-16 19:44:46 +0200
commit10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f (patch)
treec13288619ac85e80c902f8a0d87f8035477982bd
parent5fac4f2baf2eb08948ceb0abdca18510de8fbdd5 (diff)
downloadalpine-usb-creator-10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f.tar.bz2
alpine-usb-creator-10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f.tar.xz
List disk devices on windows
-rw-r--r--dialog.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/dialog.cpp b/dialog.cpp
index 9af2f3b..7b5145b 100644
--- a/dialog.cpp
+++ b/dialog.cpp
@@ -4,6 +4,10 @@
#include "dialog.h"
+#ifdef __WINDOWS__
+#include <windows.h>
+#endif
+
Dialog::Dialog(wxWindow *parent)
: DialogUI(parent)
{
@@ -12,7 +16,23 @@ Dialog::Dialog(wxWindow *parent)
void Dialog::RefreshDrives(void)
{
- wxMessageBox(wxT("To be implemented"));
+#ifdef __WINDOWS__
+// SetErrorMode(SEM_NOOPENFILEERRORBOX);
+ wchar_t drives[256], *pdrv = drives;
+ memset(drives, 0, sizeof(drives));
+ GetLogicalDriveStrings(sizeof(drives), drives);
+ m_target->Clear();
+ while(pdrv[0] != '\0') {
+// if (GetDriveType(pdrv) == DRIVE_REMOVABLE) {
+ m_target->Append(pdrv);
+// }
+ pdrv += lstrlen(pdrv) + 1;
+ }
+
+#else
+ m_target->Clear();
+ m_target->Append(wxT("~/tmp/alpine"));
+#endif
}
void Dialog::OnRefreshDrives(wxCommandEvent &event)