Skip to content

Commit

Permalink
Add detect EOS_DIGITAL button
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Aug 9, 2021
1 parent 77eca7a commit aa7b71d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ win-gtk-test:
@cd src; cp $(LIBUSB_DLL) ../mlinstall/
@cd gtk/bin/; cp -t ../../mlinstall/ $(WIN_GTK_DLL)
@cp mlinstall.exe mlinstall/
@cat README.md > mlinstall/README.txt
@cat MANUAL.md > mlinstall/HELP.txt

win-cli-pack:
@rm -rf mlinstall
Expand Down
14 changes: 14 additions & 0 deletions gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ static void disablebootdisk(GtkWidget *widget, gpointer data)
}
}

static void showdrive(GtkWidget *widget, gpointer data)
{
logclear();
char buffer[128];
if (flag_usable_drive(buffer)) {
logprint(buffer);
} else {
logprint("Error getting usable drive.\n");
}
}

static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit();
Expand Down Expand Up @@ -329,6 +340,9 @@ int main(int argc, char *argv[])
g_signal_connect(entry, "activate", G_CALLBACK(eventproc), NULL);
gtk_widget_show(entry);

MENU_ADD_BUTTON("Detect EOS_DIGITAL", showdrive,
"Try and return a usable filesystem.")

label = gtk_label_new(NULL);
gtk_label_set_markup(
GTK_LABEL(label),
Expand Down
1 change: 1 addition & 0 deletions src/drive-win.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ int flag_getdrive()
return (int)id;
}

// Should never buffer overflow
int flag_usable_drive(char buffer[])
{
int drive = flag_getdrive();
Expand Down

0 comments on commit aa7b71d

Please sign in to comment.