Example #1
0
gint MainBoxOKEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
    const char *tempisoname;

    MainBoxUnfocus();

    tempisoname = gtk_entry_get_text(GTK_ENTRY(mainbox.file));
    if (*(tempisoname) != 0)
    {
        if (IsIsoFile(tempisoname) == -4)
        {
            IsoTableRebuild(tempisoname);
            MainBoxRefocus();
            return(TRUE);
        } // ENDIF- Do we need to rebuild an image file's index before using it?

        if (IsIsoFile(tempisoname) < 0)
        {
            tempisoname = NULL;
            MainBoxRefocus();
            MessageBoxShow("Not a Valid Image File.", 1);
            return(TRUE);
        } // ENDIF- Not an ISO file? Message and Stop here.
    } // ENDIF- Is there an ISO file to check out?

    strcpy(conf.isoname, tempisoname);
    tempisoname = NULL;
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mainbox.startcheck)) == FALSE)
    {
        conf.startconfigure = 0; // FALSE
    }
    else
    {
        conf.startconfigure = 1; // TRUE
    } // ENDIF- Was this check button turned off?
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mainbox.restartcheck)) == FALSE)
    {
        conf.restartconfigure = 0; // FALSE
    }
    else
    {
        conf.restartconfigure = 1; // TRUE
    } // ENDIF- Was this check button turned off?
    SaveConf();
    MainBoxCancelEvent(widget, event, data);
    return(TRUE);
} // END MainBoxOKEvent()
Example #2
0
void MainBoxOKEvent()
{
	char tempisoname[256];
	MainBoxUnfocus();
	GetDlgItemText(mainboxwindow, IDC_0202, tempisoname, 256);
	if (*(tempisoname) != 0)
	{
		if (IsIsoFile(tempisoname) == -4)
		{
			IsoTableRebuild(tempisoname);
			MainBoxRefocus();
			return;
		} // ENDIF- Do we need to rebuild an image file's index before using it?
		if (IsIsoFile(tempisoname) < 0)
		{
			MainBoxRefocus();
			MessageBox(mainboxwindow,
			           "Not a Valid Image File.",
			           "CDVDisoEFP Message",
			           MB_OK | MB_ICONWARNING | MB_SETFOREGROUND);
			return;
		} // ENDIF- Not an ISO file? Message and Stop here.
	} // ENDIF- Do we have a name to check out?
	strcpy(conf.isoname, tempisoname);
	if (Button_GetCheck(GetDlgItem(mainboxwindow, IDC_0209)) == BST_UNCHECKED)
	{
		conf.startconfigure = 0; // FALSE
	}
	else
	{
		conf.startconfigure = 1; // TRUE
	} // ENDIF- Was this checkbox unchecked?
	if (Button_GetCheck(GetDlgItem(mainboxwindow, IDC_0210)) == BST_UNCHECKED)
	{
		conf.restartconfigure = 0; // FALSE
	}
	else
	{
		conf.restartconfigure = 1; // TRUE
	} // ENDIF- Was this checkbox unchecked?
	SaveConf();

	MainBoxCancelEvent();
	return;
} // END MainBoxOKEvent()
Example #3
0
void DeviceBoxCancelEvent() {

  // ShowWindow(deviceboxwindow, SW_HIDE);

  DeviceBoxDestroy();

  MainBoxRefocus();

  return;

} // END DeviceBoxCancelEvent()
Example #4
0
gint MessageBoxCancelEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
	gtk_widget_hide(messagebox.window);
	switch (messagebox.wherefrom)
	{
		case 1:
			MainBoxRefocus();
			break;
		case 2:
			DeviceBoxRefocus();
			break;
		case 3:
			ConversionBoxRefocus();
			break;
	} // ENDSWITCH- Whose window do I get to re-focus when this is done?
	return(TRUE);
} // END MessageBoxCancelEvent()
Example #5
0
gint MainBoxOKEvent(GtkWidget *widget, GdkEvent event, gpointer data) {

  const char *tempdevice;

  int retval;



  MainBoxUnfocus();



  tempdevice = gtk_entry_get_text(GTK_ENTRY(mainbox.device));

  strcpy(conf.devicename, tempdevice); // Temporarily put in new device name

  tempdevice = NULL;

  if(*(conf.devicename) != 0) {

    retval = DeviceOpen(); // Test by opening the device.

    DeviceClose(); // Failed or not, close it.

    if(retval != 0) {

      MainBoxRefocus();

      return(TRUE);

    } // ENDIF- Not an ISO file? Message and Stop here.

  } // ENDIF- Is there an ISO file to check out?



  SaveConf();



  MainBoxCancelEvent(widget, event, data);

  return(TRUE);

} // END MainBoxOKEvent()
Example #6
0
void MainBoxOKEvent()
{
	int retval;
	MainBoxUnfocus();
	GetDlgItemText(mainboxwindow, IDC_0202, conf.devicename, 256);
	retval = DeviceOpen();
	DeviceClose();
	if (retval != 0) {
		MainBoxRefocus();
		MessageBox(mainboxwindow,
		           "Could not open the device",
		           "CDVDlinuz Message",
		           MB_OK | MB_ICONWARNING | MB_SETFOREGROUND);
		return;
	} // ENDIF- Trouble opening device? Abort here.
	SaveConf();
	MainBoxCancelEvent();
	return;
} // END MainBoxOKEvent()
Example #7
0
gint SelectionBoxCancelEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
	SelectionBoxUnfocus();
	switch (selectionbox.wherefrom)
	{
		case 1:
			gtk_entry_set_text(GTK_ENTRY(mainbox.file),
			                   gtk_file_selection_get_filename(GTK_FILE_SELECTION(selectionbox.window)));
			MainBoxRefocus();
			break;
		case 2:
			gtk_entry_set_text(GTK_ENTRY(devicebox.file),
			                   gtk_file_selection_get_filename(GTK_FILE_SELECTION(selectionbox.window)));
			DeviceBoxRefocus();
			break;
		case 3:
			gtk_entry_set_text(GTK_ENTRY(conversionbox.file),
			                   gtk_file_selection_get_filename(GTK_FILE_SELECTION(selectionbox.window)));
			ConversionBoxRefocus();
			break;
	} // ENDSWITCH wherefrom- What Box called us?
	return(TRUE);
} // END SelectionBoxCancelEvent()
Example #8
0
gint ConversionBoxCancelEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
	gtk_widget_hide(conversionbox.window);
	MainBoxRefocus();
	return(TRUE);
} // END ConversionBoxCancelEvent()
Example #9
0
gint DeviceBoxCancelEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
	gtk_widget_hide(devicebox.window);
	MainBoxRefocus();
	return (TRUE);
} // END DeviceBoxCancelEvent()
Example #10
0
gint MainBoxOKEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
	const char *tempisoname1;
	const char *tempisoname2;
	struct IsoFile *tempiso1;
	struct IsoFile *tempiso2;
	int stop;
	off64_t endsector;
	off64_t sector;
	int retval;
	char tempblock1[2448];
	char tempblock2[2448];
	int i;

	MainBoxUnfocus();

	tempisoname1 = gtk_entry_get_text(GTK_ENTRY(mainbox.file1));
	tempisoname2 = gtk_entry_get_text(GTK_ENTRY(mainbox.file2));
	tempiso1 = NULL;
	tempiso2 = NULL;

	tempiso1 = IsoFileOpenForRead(tempisoname1);
	if (tempiso1 == NULL)
	{
		MainBoxRefocus();
		MessageBoxShow("First file is not a Valid Image File.", 0);
		tempisoname1 = NULL;
		tempisoname2 = NULL;
		return(TRUE);
	} // ENDIF- Not an ISO file? Message and Stop here.

	tempiso2 = IsoFileOpenForRead(tempisoname2);
	if (tempiso2 == NULL)
	{
		MainBoxRefocus();
		MessageBoxShow("Second file is not a Valid Image File.", 0);
		tempiso1 = IsoFileClose(tempiso1);
		tempisoname1 = NULL;
		tempisoname2 = NULL;
		return(TRUE);
	} // ENDIF- Not an ISO file? Message and Stop here.

	if (tempiso1->blocksize != tempiso2->blocksize)
	{
		MainBoxRefocus();
		MessageBoxShow("Block sizes in Image files do not match.", 0);
		tempiso1 = IsoFileClose(tempiso1);
		tempiso2 = IsoFileClose(tempiso2);
		tempisoname1 = NULL;
		tempisoname2 = NULL;
		return(TRUE);
	} // ENDIF- Not an ISO file? Message and Stop here.

	if (tempiso1->multi == 1)
	{
		i = 0;
		while ((i < 10) &&
		        (IsoFileSeek(tempiso1, tempiso1->multisectorend[i] + 1) == 0))  i++;
		endsector = tempiso1->multisectorend[tempiso1->multiend];
	}
	else
	{
		endsector = tempiso1->filesectorsize;
	} // ENDIF- Get ending sector from multifile? (Or single file?)
	IsoFileSeek(tempiso1, 0);

	if (tempiso2->multi == 1)
	{
		i = 0;
		while ((i < 10) &&
		        (IsoFileSeek(tempiso2, tempiso2->multisectorend[i] + 1) == 0))  i++;
		sector = tempiso2->multisectorend[tempiso2->multiend];
	}
	else
	{
		sector = tempiso2->filesectorsize;
	} // ENDIF- Get ending sector from multifile? (Or single file?)
	IsoFileSeek(tempiso2, 0);
	if (sector != endsector)
	{
		MainBoxRefocus();
		MessageBoxShow("Number of blocks in Image files do not match.", 0);
		tempiso1 = IsoFileClose(tempiso1);
		tempiso2 = IsoFileClose(tempiso2);
		tempisoname1 = NULL;
		tempisoname2 = NULL;
		return(TRUE);
	} // ENDIF- Number of blocks don't match? Say so.

	sprintf(tempblock1, "%s == %s ?", tempisoname1, tempisoname2);
	ProgressBoxStart(tempblock1, endsector);

	stop = 0;
	mainbox.stop = 0;
	progressbox.stop = 0;
	while ((stop == 0) && (tempiso1->sectorpos < endsector))
	{
		retval = IsoFileRead(tempiso1, tempblock1);
		if (retval < 0)
		{
			MainBoxRefocus();
			MessageBoxShow("Trouble reading first file.", 0);
			stop = 1;
		}
		else
		{
			retval = IsoFileRead(tempiso2, tempblock2);
			if (retval < 0)
			{
				MainBoxRefocus();
				MessageBoxShow("Trouble reading second file.", 0);
				stop = 1;
			}
			else
			{
				i = 0;
				while ((i < tempiso1->blocksize) && (tempblock1[i] == tempblock2[i])) i++;
				if (i < tempiso1->blocksize)
				{
					MainBoxRefocus();
					MessageBoxShow("Trouble reading second file.", 0);
					stop = 1;
				} // ENDIF- Sectors don't match? Say so.
			} // ENDIF- Trouble reading second file?
		} // ENDIF- Trouble reading first file?

		ProgressBoxTick(tempiso1->sectorpos);
		while (gtk_events_pending())  gtk_main_iteration();

		if (mainbox.stop != 0)  stop = 2;
		if (progressbox.stop != 0)  stop = 2;
	} // ENDWHILE- Comparing two files... sector by sector

	if (stop == 0)
	{
		MainBoxRefocus();
		MessageBoxShow("Images Match.", 0);
	} // ENDIF- Everything checked out? Say so.
	tempiso1 = IsoFileClose(tempiso1);
	tempiso2 = IsoFileClose(tempiso2);
	tempisoname1 = NULL;
	tempisoname2 = NULL;
	return(TRUE);
} // END MainBoxOKEvent()