Sprint 3 update

This commit is contained in:
Leeland Heins 2017-04-18 14:15:24 -05:00 committed by GitHub
parent fbf7281338
commit 9df8ea81d8
54 changed files with 2027 additions and 96 deletions

View File

@ -18,7 +18,13 @@ SRCS=calvados.c select_volume.c closing_dialog.c close_dialog.c show_about.c \
recompress_files.c show_error.c file_viewer.c donefunc_file_viewer.c \
help_func_file_viewer.c add_disk_image.c test.c findfunc_file_viewer.c \
bulk_disk_image_converter.c close.c save_changes.c reopen.c copy.c paste.c \
paste_special.c find.c select_all.c invert_selection.c
paste_special.c find.c select_all.c invert_selection.c create_subdirectory.c \
open_as_disk_image.c edit_attributes.c rename_volume.c convert_to_disk_image.c \
convert_to_archive_file.c import_file_from_wav.c import_bas_from_text.c \
contents.c visit_website.c volume_copier_open_volume.c volume_copier_open_file.c \
twomg_properties_editor.c eol_scanner.c do_eol_scan.c do_2mg_edit.c \
do_volume_copier_open_file.c okfunc_volume_copier_open_volume.c \
help_func_volume_copier_open_volume.c do_bulk_disk_converter.c
OBJS=$(SRCS:.c=.o)
HEADERS=calvados.h
CC=gcc

View File

@ -14,10 +14,10 @@
*/
void acceptfunc_add_files(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
g_print("Add function goes here.\n");
/* --- Display message --- */
g_print("Add function goes here.\n");
/* --- Close it. --- */
gtk_widget_destroy(GTK_WIDGET(data));
/* --- Close it. --- */
gtk_widget_destroy(GTK_WIDGET(data));
}

View File

@ -17,7 +17,7 @@ void add_disk_image(GtkWidget *widget, gpointer data)
GtkFileFilter *diskImagesFilt;
GtkFileFilter *allFilesFilt;
g_print("add disk image goes here\n");
/*g_print("add disk image goes here\n");*/
diskImagesFilt = gtk_file_filter_new();
gtk_file_filter_set_name(diskImagesFilt, "Disk Images");

View File

@ -3,12 +3,22 @@
#include "calvados.h"
/*
*
* fileAttributePreservationRbCallback()
*
*/
void fileAttributePreservationRbCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
}
/*
*
* textConversionRbCallback()
*
*/
void textConversionRbCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);

View File

@ -1,5 +1,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include <string.h>
#include "calvados.h"
@ -7,12 +8,14 @@
#define SHK 0
#define DSK 1
extern char *open_file_ptr;
/*
*
* archive_info()
*
*/
void archive_info()
void archive_info(GtkWidget *widget, gpointer data)
{
GtkWidget *dialog;
GtkWidget *vbox;
@ -22,6 +25,7 @@ void archive_info()
GtkWidget *archiveInfoVboxl;
GtkWidget *archiveInfoVboxr;
GtkWidget *filenameLabel;
GtkWidget *filenameText;
GtkWidget *formatLabel;
GtkWidget *recordsLabel;
GtkWidget *masterVersionLabel;
@ -38,13 +42,38 @@ void archive_info()
GtkWidget *diskCharacteristicsInfoVboxl;
GtkWidget *diskCharacteristicsInfoVboxr;
GtkWidget *subVolumeLabel;
GtkWidget *subVolumeCombo;
GtkWidget *sectorOrderingLabel;
GtkWidget *sectorOrderingText;
GtkWidget *filesystemFormatLabel;
GtkWidget *filesystemFormatText;
GtkWidget *filesDirectoriesLabel;
GtkWidget *filesDirectoriesText;
GtkWidget *storageCapacityLabel;
GtkWidget *storageCapacityText;
GtkWidget *freeSpaceLabel;
GtkWidget *freeSpaceText;
GtkWidget *writeableFormatLabel;
GtkWidget *writeableFormatText;
GtkWidget *damagedLabel;
GtkWidget *damagedText;
GtkWidget *notesLabel;
GtkWidget *notesText;
GtkWidget *hbox2;
GtkWidget *helpButton;
GtkWidget *doneButton;
int archive_type = 0;
char dialog_title[256];
g_print("archive info goes here\n");
/*g_print("archive info goes here\n");*/
if (strstr(open_file_ptr, ".shk") == 0) {
archive_type = SHK;
} else if (strstr(open_file_ptr, ".dsk") == 0) {
archive_type = DSK;
}
/* FIXME -- need to detect what type of archive we are looking at */
if (archive_type == SHK) {
@ -134,6 +163,11 @@ void archive_info()
gtk_box_pack_start(GTK_BOX(fileCharacteristicsVboxl), filenameLabel, TRUE, TRUE, 0);
gtk_widget_show(filenameLabel);
filenameText = gtk_label_new("");
gtk_widget_set_size_request(filenameText, 256, 32);
gtk_box_pack_start(GTK_BOX(fileCharacteristicsVboxr), filenameText, TRUE, TRUE, 0);
gtk_widget_show(filenameText);
diskCharacteristicsFrame = gtk_frame_new("Disk Characteristics");
gtk_box_pack_start(GTK_BOX(vbox), diskCharacteristicsFrame, TRUE, TRUE, 0);
gtk_widget_show(diskCharacteristicsFrame);
@ -142,6 +176,86 @@ void archive_info()
gtk_container_add(GTK_CONTAINER(diskCharacteristicsFrame), diskCharacteristicsHbox);
gtk_widget_show(diskCharacteristicsHbox);
diskCharacteristicsInfoVboxl = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(diskCharacteristicsHbox), diskCharacteristicsInfoVboxl, TRUE, TRUE, 0);
gtk_widget_show(diskCharacteristicsInfoVboxl);
diskCharacteristicsInfoVboxr = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(diskCharacteristicsHbox), diskCharacteristicsInfoVboxr, TRUE, TRUE, 0);
gtk_widget_show(diskCharacteristicsInfoVboxr);
subVolumeLabel = gtk_label_new("Sub-Volume:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), subVolumeLabel, TRUE, TRUE, 0);
gtk_widget_show(subVolumeLabel);
sectorOrderingLabel = gtk_label_new("Sector Ordering:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), sectorOrderingLabel, TRUE, TRUE, 0);
gtk_widget_show(sectorOrderingLabel);
filesystemFormatLabel = gtk_label_new("Filesystem Format:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), filesystemFormatLabel, TRUE, TRUE, 0);
gtk_widget_show(filesystemFormatLabel);
filesDirectoriesLabel = gtk_label_new("Files+Directories:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), filesDirectoriesLabel, TRUE, TRUE, 0);
gtk_widget_show(filesDirectoriesLabel);
storageCapacityLabel = gtk_label_new("Storage Capacity:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), storageCapacityLabel, TRUE, TRUE, 0);
gtk_widget_show(storageCapacityLabel);
freeSpaceLabel = gtk_label_new("Free Space:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), freeSpaceLabel, TRUE, TRUE, 0);
gtk_widget_show(freeSpaceLabel);
writeableFormatLabel = gtk_label_new("Writeable format?");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), writeableFormatLabel, TRUE, TRUE, 0);
gtk_widget_show(writeableFormatLabel);
damagedLabel = gtk_label_new("Damaged?");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), damagedLabel, TRUE, TRUE, 0);
gtk_widget_show(damagedLabel);
notesLabel = gtk_label_new("Notes:");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxl), notesLabel, TRUE, TRUE, 0);
gtk_widget_show(notesLabel);
subVolumeCombo = gtk_label_new("");
gtk_widget_set_size_request(subVolumeCombo, 256, 32);
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), subVolumeCombo, TRUE, TRUE, 0);
gtk_widget_show(subVolumeCombo);
sectorOrderingText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), sectorOrderingText, TRUE, TRUE, 0);
gtk_widget_show(sectorOrderingText);
filesystemFormatText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), filesystemFormatText, TRUE, TRUE, 0);
gtk_widget_show(filesystemFormatText);
filesDirectoriesText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), filesDirectoriesText, TRUE, TRUE, 0);
gtk_widget_show(filesDirectoriesText);
storageCapacityText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), storageCapacityText, TRUE, TRUE, 0);
gtk_widget_show(storageCapacityText);
freeSpaceText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), freeSpaceText, TRUE, TRUE, 0);
gtk_widget_show(freeSpaceText);
writeableFormatText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), writeableFormatText, TRUE, TRUE, 0);
gtk_widget_show(writeableFormatText);
damagedText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), damagedText, TRUE, TRUE, 0);
gtk_widget_show(damagedText);
notesText = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(diskCharacteristicsInfoVboxr), notesText, TRUE, TRUE, 0);
gtk_widget_show(notesText);
}
hbox2 = gtk_hbox_new(FALSE, 0);

View File

@ -17,7 +17,7 @@ void bulk_disk_image_converter(GtkWidget *widget, gpointer data)
GtkFileFilter *diskImagesFilt;
GtkFileFilter *allFilesFilt;
g_print("bulk disk image convert goes here\n");
/*g_print("bulk disk image convert goes here\n");*/
diskImagesFilt = gtk_file_filter_new();
gtk_file_filter_set_name(diskImagesFilt, "Disk Images");
@ -63,7 +63,7 @@ void bulk_disk_image_converter(GtkWidget *widget, gpointer data)
char *filename;
GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog);
filename = gtk_file_chooser_get_filename(chooser);
do_open_file(filename);
do_bulk_disk_converter(filename);
g_free(filename);
}

View File

@ -35,6 +35,9 @@ GtkCellRenderer *mw_renderer;
GtkTreeModel *mw_model;
GtkWidget *mw_view;
/* FIXME -- this needs to be done better. */
char open_file_name[256];
char *open_file_ptr;
/*
*
@ -250,7 +253,7 @@ int main(int argc, char *argv[])
GtkWidget *volumeCopierOpenFileMi;
GtkWidget *mergeSSTImagesMi;
GtkWidget *toolsSep2;
GtkWidget *TwoMGPropertiesEditorMi;
GtkWidget *twoMGPropertiesEditorMi;
GtkWidget *EOLScannerMi;
/* Help menu widgets */
@ -314,6 +317,8 @@ int main(int argc, char *argv[])
GtkWidget *statusbar;
open_file_ptr = (char *)open_file_name;
/* Initialise GTK+ passing to it all command line arguments */
gtk_init(&argc, &argv);
@ -322,6 +327,7 @@ int main(int argc, char *argv[])
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), WINDOW_WIDTH, WINDOW_HEIGHT);
gtk_window_set_title(GTK_WINDOW(window), "Calvados");
gtk_window_set_icon_from_file(GTK_WINDOW(window), "images/calvados.png", NULL);
/* Primary app vbox */
vbox = gtk_vbox_new(FALSE, 0);
@ -421,7 +427,7 @@ int main(int argc, char *argv[])
g_signal_connect(G_OBJECT(archiveInfoMi), "activate", G_CALLBACK(archive_info), (gpointer)"archiveInfoMi");
/* Hook up the print menu item to the print dialog box */
g_signal_connect(G_OBJECT(printMi), "activate", G_CALLBACK(print_page), (gpointer)"printMi");
g_signal_connect(G_OBJECT(printMi), "activate", G_CALLBACK(print_page), (gpointer)window);
/* Edit menu bar items */
editMi = gtk_menu_item_new_with_mnemonic("_Edit");
@ -578,7 +584,7 @@ int main(int argc, char *argv[])
volumeCopierOpenFileMi = gtk_menu_item_new_with_label("Volume Copier (open file)");
mergeSSTImagesMi = gtk_menu_item_new_with_mnemonic("_Merge SST Images");
toolsSep2 = gtk_separator_menu_item_new();
TwoMGPropertiesEditorMi = gtk_menu_item_new_with_label("2MG Properties Editor");
twoMGPropertiesEditorMi = gtk_menu_item_new_with_label("2MG Properties Editor");
EOLScannerMi = gtk_menu_item_new_with_label("EOL Scanner");
/* Set up tools menu */
@ -591,7 +597,7 @@ int main(int argc, char *argv[])
gtk_menu_shell_append(GTK_MENU_SHELL(toolsMenu), volumeCopierOpenFileMi);
gtk_menu_shell_append(GTK_MENU_SHELL(toolsMenu), mergeSSTImagesMi);
gtk_menu_shell_append(GTK_MENU_SHELL(toolsMenu), toolsSep2);
gtk_menu_shell_append(GTK_MENU_SHELL(toolsMenu), TwoMGPropertiesEditorMi);
gtk_menu_shell_append(GTK_MENU_SHELL(toolsMenu), twoMGPropertiesEditorMi);
gtk_menu_shell_append(GTK_MENU_SHELL(toolsMenu), EOLScannerMi);
/* Add Tools menu to menu bar */
gtk_menu_shell_append(GTK_MENU_SHELL(menubar), toolsMi);
@ -621,6 +627,12 @@ int main(int argc, char *argv[])
/* connect 'view' menu item to the file viewer dialog event */
g_signal_connect(G_OBJECT(viewMi), "activate", G_CALLBACK(file_viewer), (gpointer)"viewMi");
/* connect 'extract' menu item to the extract dialog event */
g_signal_connect(G_OBJECT(extractMi), "activate", G_CALLBACK(extract_files), (gpointer)"extractMi");
/* connect 'test' menu item to the test dialog event */
g_signal_connect(G_OBJECT(testMi), "activate", G_CALLBACK(test), (gpointer)"testMi");
/* connect 'disk image' menu item to the create disk image dialog event */
g_signal_connect(G_OBJECT(diskImageMi), "activate", G_CALLBACK(create_disk_image), (gpointer)"diskImageMi");
@ -642,9 +654,42 @@ int main(int argc, char *argv[])
/* connect 'recompress' menu item to the recompress dialog event */
g_signal_connect(G_OBJECT(recompressMi), "activate", G_CALLBACK(recompress_files), (gpointer)"recompressMi");
/* connect 'add files' menu item to the add files dialog event */
g_signal_connect(G_OBJECT(addFilesMi), "activate", G_CALLBACK(add_files), (gpointer)"addFilesMi");
/* connect 'create subdirectory' menu item to the create subdirectory dialog event */
g_signal_connect(G_OBJECT(createSubdirectoryMi), "activate", G_CALLBACK(create_subdirectory), (gpointer)"createSubdirectoryMi");
/* connect 'open as disk image' menu item to the open as disk image dialog event */
g_signal_connect(G_OBJECT(openAsDiskImageMi), "activate", G_CALLBACK(open_as_disk_image), (gpointer)"openAsDiskImageMi");
/* connect 'Edit Attributes' menu item to the edit_attributes dialog event */
g_signal_connect(G_OBJECT(editAttributesMi), "activate", G_CALLBACK(edit_attributes), (gpointer)"editAttributesMi");
/* connect 'Rename Volume' menu item to the rename_volume dialog event */
g_signal_connect(G_OBJECT(renameVolumeMi), "activate", G_CALLBACK(rename_volume), (gpointer)"renameVolumeMi");
/* connect 'Convert to disk image' menu item to the convert_to_disk_image dialog event */
g_signal_connect(G_OBJECT(convertToDiskImageMi), "activate", G_CALLBACK(convert_to_disk_image), (gpointer)"convertToDiskImageMi");
/* connect 'Convert to archive file' menu item to the convert_to_archive_file dialog event */
g_signal_connect(G_OBJECT(convertToArchiveFileMi), "activate", G_CALLBACK(convert_to_archive_file), (gpointer)"convertToArchiveFileMi");
/* connect 'Import File from WAV menu item to the import_file_from_wav dialog event */
g_signal_connect(G_OBJECT(importFileFromWAVMi), "activate", G_CALLBACK(import_file_from_wav), (gpointer)"importFileFromWAVMi");
/* connect 'Import BAS from Text menu item to the import_bas_from_text dialog event */
g_signal_connect(G_OBJECT(importBASFromTextMi), "activate", G_CALLBACK(import_bas_from_text), (gpointer)"importBASFromTextMi");
/* connect 'edit comment' menu item to the edit comment dialog event */
g_signal_connect(G_OBJECT(editCommentMi), "activate", G_CALLBACK(edit_comment), (gpointer)"editCommentMi");
/* connect 'contents' menu item to the contents box event */
g_signal_connect(G_OBJECT(contentsMi), "activate", G_CALLBACK(contents), (gpointer)"contentsMi");
/* connect 'contents' menu item to the contents box event */
g_signal_connect(G_OBJECT(visitCalvadosWebsiteMi), "activate", G_CALLBACK(visit_website), (gpointer)"visitCalvadosWebsiteMi");
/* connect 'about' menu item to the about box event */
g_signal_connect(G_OBJECT(aboutCalvadosMi), "activate", G_CALLBACK(show_about), (gpointer)"aboutCalvadosMi");
@ -657,9 +702,21 @@ int main(int argc, char *argv[])
/* connect 'Select bulk disk image converter' menu item to the bulk disk image converter popup menu event */
g_signal_connect(G_OBJECT(bulkDiskImageConverterMi), "activate", G_CALLBACK(bulk_disk_image_converter), (gpointer)"bulkDiskImageConverterMi");
/* connect 'Volume Copier Open Volume' menu item to the volume copier open volume popup menu event */
g_signal_connect(G_OBJECT(volumeCopierOpenVolumeMi), "activate", G_CALLBACK(volume_copier_open_volume), (gpointer)"volumeCopierOpenVolumeMi");
/* connect 'Volume Copier Open File' menu item to the volume copier open file popup menu event */
g_signal_connect(G_OBJECT(volumeCopierOpenFileMi), "activate", G_CALLBACK(volume_copier_open_file), (gpointer)"volumeCopierOpenFileMi");
/* connect 'Merge SST Images' menu item to the merge sst images popup menu event */
g_signal_connect(G_OBJECT(mergeSSTImagesMi), "activate", G_CALLBACK(select_first_sst_image), (gpointer)"mergeSSTImagesMi");
/* connect '2MG Properties Editor' menu item to the 2MG properties editor popup menu event */
g_signal_connect(G_OBJECT(twoMGPropertiesEditorMi), "activate", G_CALLBACK(twomg_properties_editor), (gpointer)"twoMGPropertiesEditorMi");
/* connect 'EOL Scanner' menu item to the eol scanner popup menu event */
g_signal_connect(G_OBJECT(EOLScannerMi), "activate", G_CALLBACK(eol_scanner), (gpointer)"EOLScannerMi");
/* Connect 'quit' menu item to the window's "destroy" event */
g_signal_connect(G_OBJECT(quitMi), "activate", G_CALLBACK(gtk_main_quit), (gpointer)"quitMi");

View File

@ -12,6 +12,12 @@
#define LIST_WIDTH 1280
#define LIST_HEIGHT 705
enum {
COL_VOLUME_OR_DEVICE_NAME = 0,
COL_REMARK,
NUM_SELECT_VOLUME_COLS
};
/* Prototypes */
void close_dialog(GtkWidget *widget, gpointer data);
void closing_dialog(GtkWidget *widget, gpointer data);
@ -66,4 +72,24 @@ void paste_special(GtkWidget *widget, gpointer data);
void find(GtkWidget *widget, gpointer data);
void select_all(GtkWidget *widget, gpointer data);
void invert_selection(GtkWidget *widget, gpointer data);
void create_subdirectory(GtkWidget *widget, gpointer data);
void open_as_disk_image(GtkWidget *widget, gpointer data);
void edit_attributes(GtkWidget *widget, gpointer data);
void rename_volume(GtkWidget *widget, gpointer data);
void convert_to_disk_image(GtkWidget *widget, gpointer data);
void convert_to_archive_file(GtkWidget *widget, gpointer data);
void import_file_from_wav(GtkWidget *widget, gpointer data);
void import_bas_from_text(GtkWidget *widget, gpointer data);
void contents(GtkWidget *widget, gpointer data);
void visit_website(GtkWidget *widget, gpointer data);
void volume_copier_open_volume(GtkWidget *widget, gpointer data);
void volume_copier_open_file(GtkWidget *widget, gpointer data);
void twomg_properties_editor(GtkWidget *widget, gpointer data);
void eol_scanner(GtkWidget *widget, gpointer data);
void do_eol_scan(char *filename);
void do_2mg_edit(char *filename);
void do_volume_copier_open_file(char *filename);
void okfunc_volume_copier_open_volume(GtkWidget *widget, gpointer data);
void help_func_volume_copier_open_volume(GtkWidget *widget, gpointer data);
void do_bulk_disk_converter(char *filename);

View File

@ -1,5 +1,7 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* close_menu_item()
@ -9,7 +11,7 @@
*/
void close_menu_item(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
g_print("Close function goes here.\n");
/* --- Display message --- */
g_print("Close function goes here.\n");
}

View File

@ -10,10 +10,10 @@
*/
void close_dialog(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
/*g_print("Cancel function goes here.\n");*/
/* --- Display message --- */
/*g_print("Cancel function goes here.\n");*/
/* --- Close it. --- */
gtk_widget_destroy(GTK_WIDGET(data));
/* --- Close it. --- */
gtk_widget_destroy(GTK_WIDGET(data));
}

View File

@ -11,6 +11,6 @@
*/
void closing_dialog(GtkWidget *widget, gpointer data)
{
gtk_grab_remove(GTK_WIDGET(widget));
gtk_grab_remove(GTK_WIDGET(widget));
}

17
contents.c Normal file
View File

@ -0,0 +1,17 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* contents()
*
* contents Volume from the menu.
*
*/
void contents(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
g_print("contents function goes here.\n");
}

17
convert_to_archive_file.c Normal file
View File

@ -0,0 +1,17 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* convert_to_archive_file()
*
* convert_to_archive_file Volume from the menu.
*
*/
void convert_to_archive_file(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
g_print("convert_to_archive_file function goes here.\n");
}

17
convert_to_disk_image.c Normal file
View File

@ -0,0 +1,17 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* convert_to_disk_image()
*
* convert_to_disk_image Volume from the menu.
*
*/
void convert_to_disk_image(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
g_print("convert_to_disk_image function goes here.\n");
}

6
copy.c
View File

@ -1,5 +1,7 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* copy_menu_item()
@ -9,7 +11,7 @@
*/
void copy_menu_item(GtkWidget *widget, gpointer data)
{
/* --- Display message --- */
g_print("Copy function goes here.\n");
/* --- Display message --- */
g_print("Copy function goes here.\n");
}

127
create_subdirectory.c Normal file
View File

@ -0,0 +1,127 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* create_subdirectory()
*
*/
void create_subdirectory(GtkWidget *widget, gpointer data)
{
GtkWidget *dialog;
GtkWidget *parentDirectoryLabel;
GtkWidget *parentDirectoryEntry;
GtkWidget *newSubdirectoryNameLabel;
GtkWidget *newSubdirectoryNameEntry;
/*GtkWidget *hbox1;*/
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkWidget *help_button;
/*g_print("Rename file goes here.\n");*/
/*g_print("data=%s\n", (char *)data);*/
/* --- Create the dialog --- */
dialog = gtk_dialog_new();
/* --- Trap the window close signal to release the grab --- */
gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
GTK_SIGNAL_FUNC(closing_dialog),
&dialog);
/* --- Set the title --- */
gtk_window_set_title(GTK_WINDOW(dialog), "Create Subdirectory");
/* --- Add a small border --- */
gtk_container_border_width(GTK_CONTAINER(dialog), 5);
/*hbox1 = gtk_hbox_new(FALSE, 0);
gtk_widget_show(hbox1);*/
parentDirectoryLabel = gtk_label_new("Parent directory: ");
gtk_widget_show(parentDirectoryLabel);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), parentDirectoryLabel, TRUE, TRUE, 0);
parentDirectoryEntry = gtk_entry_new();
gtk_widget_show(parentDirectoryEntry);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), parentDirectoryEntry, TRUE, TRUE, 0);
newSubdirectoryNameLabel = gtk_label_new("New subdirectory name: ");
gtk_widget_show(newSubdirectoryNameLabel);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), newSubdirectoryNameLabel, TRUE, TRUE, 0);
newSubdirectoryNameEntry = gtk_entry_new();
gtk_widget_show(newSubdirectoryNameEntry);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), newSubdirectoryNameEntry, TRUE, TRUE, 0);
/* FIXME -- need to add path separator widgets here */
/*
* --- OK button
*/
/* --- Create the "OK" button --- */
ok_button = gtk_button_new_with_label("OK");
gtk_signal_connect(GTK_OBJECT(ok_button), "clicked",
GTK_SIGNAL_FUNC(okfunc_select_volume),
dialog);
/* --- Allow "Cancel" to be a default --- */
GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT);
/* --- Add the OK button to the bottom hbox2 --- */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), ok_button, TRUE, TRUE, 0);
/* --- Make the "OK" the default --- */
gtk_widget_grab_default(ok_button);
/* --- Make the button visible --- */
gtk_widget_show(ok_button);
/*
* --- Cancel button
*/
/* --- Create the "Cancel" button --- */
cancel_button = gtk_button_new_with_label("Cancel");
gtk_signal_connect(GTK_OBJECT(cancel_button), "clicked",
GTK_SIGNAL_FUNC(close_dialog),
dialog);
/* --- Allow "Cancel" to be a default --- */
GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT);
/* --- Add the "Cancel" button to the dialog --- */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), cancel_button, TRUE, TRUE, 0);
/* --- Make the button visible. --- */
gtk_widget_show(cancel_button);
/*
* --- Help button
*/
/* --- Create the "Help" button --- */
help_button = gtk_button_new_with_label("Help");
gtk_signal_connect(GTK_OBJECT(help_button), "clicked",
GTK_SIGNAL_FUNC(help_func_select_volume),
dialog);
/* --- Add the "Help" button to the dialog --- */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), help_button, TRUE, TRUE, 0);
/* --- Make the button visible. --- */
gtk_widget_show(help_button);
/* --- Show the dialog --- */
gtk_widget_show(dialog);
/* --- Only this window can be used for now --- */
gtk_grab_add(dialog);
}

20
do_2mg_edit.c Normal file
View File

@ -0,0 +1,20 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <string.h>
#include "calvados.h"
/*
*
* do_2mg_edit()
*
* Edit a 2mg disk image
*
*/
void do_2mg_edit(char *filename)
{
/* --- Display message --- */
g_print("2mg edit function goes here.\n");
g_print("filename=%s\n", filename);
}

View File

@ -12,6 +12,6 @@
*/
void do_add_files(char *filename)
{
g_print("Do add files goes here.\n");
g_print("Do add files goes here.\n");
}

18
do_bulk_disk_converter.c Normal file
View File

@ -0,0 +1,18 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "calvados.h"
/*
*
* do_bulk_disk_converter()
*
* Convert an image.
*
*/
void do_bulk_disk_converter(char *filename)
{
/* --- Display message --- */
g_print("bulk_disk_converter function goes here.\n");
}

20
do_eol_scan.c Normal file
View File

@ -0,0 +1,20 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <string.h>
#include "calvados.h"
/*
*
* do_eol_scan()
*
* eol scan a file.
*
*/
void do_eol_scan(char *filename)
{
/* --- Display message --- */
g_print("eol scan function goes here.\n");
g_print("filename=%s\n", filename);
}

View File

@ -12,7 +12,7 @@
*/
void do_image_converter(char *filename)
{
/* --- Display message --- */
g_print("Image converter function goes here.\n");
/* --- Display message --- */
g_print("Image converter function goes here.\n");
}

View File

@ -1,8 +1,11 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <string.h>
#include "calvados.h"
extern char *open_file_ptr;
/*
*
* do_open_file()
@ -14,5 +17,8 @@ void do_open_file(char *filename)
{
/* --- Display message --- */
g_print("Open file function goes here.\n");
g_print("filename=%s\n", filename);
strcpy(open_file_ptr, filename);
}

View File

@ -0,0 +1,23 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <string.h>
#include "calvados.h"
extern char *open_file_ptr;
/*
*
* do_volume_copier_open_file()
*
* Volume copier (open file).
*
*/
void do_volume_copier_open_file(char *filename)
{
/* --- Display message --- */
g_print("Volume copier (open file) function goes here.\n");
g_print("filename=%s\n", filename);
}

133
edit_attributes.c Normal file
View File

@ -0,0 +1,133 @@
#include <gtk/gtk.h>
#include "calvados.h"
/*
*
* edit_attributes()
*
* Edit Attributes from the menu.
*
*/
void edit_attributes(GtkWidget *widget, gpointer data)
{
GtkWidget *dialog;
GtkWidget *hbox1;
GtkWidget *vbox1l;
GtkWidget *vbox1r;
GtkWidget *hbox2;
GtkWidget *hbox3;
GtkWidget *vbox2;
GtkWidget *hbox4;
GtkWidget *hbox5;
GtkWidget *pathnameLabel;
GtkWidget *pathnameEntry;
GtkWidget *creationDateLabel;
GtkWidget *creationDateEntry;
GtkWidget *modificationDateLabel;
GtkWidget *modificationDateEntry;
GtkWidget *fileTypeLabel;
GtkWidget *fileTypeCombo;
GtkWidget *hfsTypeCb;
GtkWidget *hfsTypeEntry;
GtkWidget *auxTypeLabel;
GtkWidget *auxTypeEntry;
GtkWidget *creatorLabel;
GtkWidget *creatorEntry;
GtkWidget *typeDescriptorLabel;
GtkWidget *typeDescriptorEntry;
GtkWidget *accessLabel;
GtkWidget *readCb;
GtkWidget *backupCb;
GtkWidget *invisibleCb;
GtkWidget *writeCb;
GtkWidget *renameCb;
GtkWidget *deleteCb;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkWidget *help_button;
/* --- Display message --- */
/*g_print("edit_attributes function goes here.\n");*/
/* --- Create the dialog --- */
dialog = gtk_dialog_new();
/* --- Trap the window close signal to release the grab --- */
gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
GTK_SIGNAL_FUNC(closing_dialog),
&dialog);
/* --- Set the title --- */
gtk_window_set_title(GTK_WINDOW(dialog), "Edit Comment");
/* --- Add a small border --- */
gtk_container_border_width(GTK_CONTAINER(dialog), 5);
/*
* --- OK button
*/
/* --- Create the "OK" button --- */
ok_button = gtk_button_new_with_label("OK");
gtk_signal_connect(GTK_OBJECT(ok_button), "clicked",
GTK_SIGNAL_FUNC(okfunc_select_volume),
dialog);
/* --- Allow "Cancel" to be a default --- */
GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT);
/* --- Add the OK button to the bottom hbox2 --- */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), ok_button, TRUE, TRUE, 0);
/* --- Make the "OK" the default --- */
gtk_widget_grab_default(ok_button);
/* --- Make the button visible --- */
gtk_widget_show(ok_button);
/*
* --- Cancel button
*/
/* --- Create the "Cancel" button --- */
cancel_button = gtk_button_new_with_label("Cancel");
gtk_signal_connect(GTK_OBJECT(cancel_button), "clicked",
GTK_SIGNAL_FUNC(close_dialog),
dialog);
/* --- Allow "Cancel" to be a default --- */
GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT);
/* --- Add the "Cancel" button to the dialog --- */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), cancel_button, TRUE, TRUE, 0);
/* --- Make the button visible. --- */
gtk_widget_show(cancel_button);
/*
* --- Help button
*/
/* --- Create the "Help" button --- */
help_button = gtk_button_new_with_label("Help");
gtk_signal_connect(GTK_OBJECT(help_button), "clicked",
GTK_SIGNAL_FUNC(help_func_select_volume),
dialog);
/* --- Add the "Help" button to the dialog --- */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), help_button, TRUE, TRUE, 0);
/* --- Make the button visible. --- */
gtk_widget_show(help_button);
/* --- Show the dialog --- */
gtk_widget_show(dialog);
/* --- Only this window can be used for now --- */
gtk_grab_add(dialog);
}

View File

@ -12,11 +12,13 @@
void edit_comment(GtkWidget *widget, gpointer data)
{
GtkWidget *dialog;
GtkTextBuffer *commentText;
GtkTextView *commentView;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkWidget *help_button;
g_print("edit comment goes here\n");
/*g_print("edit comment goes here\n");*/
/* --- Create the dialog --- */
dialog = gtk_dialog_new();
@ -32,6 +34,11 @@ void edit_comment(GtkWidget *widget, gpointer data)
/* --- Add a small border --- */
gtk_container_border_width(GTK_CONTAINER(dialog), 5);
commentView = gtk_text_view_new();
gtk_widget_set_size_request(commentView, 320, 256);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), commentView, TRUE, TRUE, 0);
gtk_widget_show(commentView);
/*
* --- OK button
*/

48
eol_scanner.c Normal file
View File

@ -0,0 +1,48 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "calvados.h"
/*
*
* eol_scanner()
*
* eol_scanner Volume from the menu.
*
*/
void eol_scanner(GtkWidget *widget, gpointer data)
{
GtkWidget *dialog;
gint res;
GtkFileFilter *allFilesFilt;
/* --- Display message --- */
/*g_print("eol_scanner function goes here.\n");*/
allFilesFilt = gtk_file_filter_new();
gtk_file_filter_set_name(allFilesFilt, "All Files");
gtk_file_filter_add_pattern(allFilesFilt, "*");
dialog = gtk_file_chooser_dialog_new("Select file to scan",
NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN,
GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), allFilesFilt);
res = gtk_dialog_run(GTK_DIALOG(dialog));
if (res == GTK_RESPONSE_ACCEPT) {
char *filename;
GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog);
filename = gtk_file_chooser_get_filename(chooser);
do_eol_scan(filename);
g_free(filename);
}
gtk_widget_destroy(dialog);
}

View File

@ -21,12 +21,22 @@ GtkWidget *addTypeExtensionCb;
/* FIXME -- need to add a callback to the folder chooser to un-grey extract selected files radio button when there are selections */
/*
*
* filesToExtractRbCallback()
*
*/
void filesToExtractRbCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
}
/*
*
* textConversionRbCallback2()
*
*/
void textConversionRbCallback2(GtkWidget *widget, gpointer *data)
{
/*g_print("clicked %s\n", (char *)data);*/
@ -39,6 +49,11 @@ void textConversionRbCallback2(GtkWidget *widget, gpointer *data)
}
/*
*
* configureToPreserveAppleIIFormatsCallback()
*
*/
void configureToPreserveAppleIIFormatsCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
@ -57,6 +72,11 @@ void configureToPreserveAppleIIFormatsCallback(GtkWidget *widget, gpointer *data
}
/*
*
* configureForEasyAccessInLinuxCallback()
*
*/
void configureForEasyAccessInLinuxCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
@ -126,7 +146,7 @@ void extract_files()
homedir = pw->pw_dir;
}
g_print("homedir=%s", homedir);
/*g_print("homedir=%s", homedir);*/
/* --- Create the dialog --- */
dialog = gtk_dialog_new();

View File

@ -2,6 +2,95 @@
#include "calvados.h"
/*
*
* dataForkRbCallback()
*
*/
void dataForkRbCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
}
/*
*
* resourceForkRbCallback()
*
*/
void resourceForkRbCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
}
/*
*
* commentRbCallback()
*
*/
void commentRbCallback(GtkWidget *widget, gpointer *data)
{
g_print("clicked %s\n", (char *)data);
}
/*
*
* view_next()
*
*/
void view_next()
{
g_print("view_next func goes here\n");
}
/*
*
* view_prev()
*
*/
void view_prev()
{
g_print("view_prev func goes here\n");
}
/*
*
* best()
*
*/
void best_func()
{
g_print("Best func goes here\n");
}
/*
*
* hex()
*
*/
void hex_func()
{
g_print("Hex func goes here\n");
}
/*
*
* raw()
*
*/
void raw_func()
{
g_print("Raw func goes here\n");
}
/*
*
* file_viewer()
@ -15,22 +104,31 @@ void file_viewer(GtkWidget *widget, gpointer data)
GtkWidget *scrolled_window;
GtkWidget *table;
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *vbox2;
GtkWidget *vbox3;
GtkWidget *vbox4;
GtkWidget *hbox2;
GtkWidget *hbox3;
GtkWidget *hbox4;
GSList *forkRbGroup = NULL;
GtkWidget *dataForkRb;
GtkWidget *resourceForkRb;
GtkWidget *commentRb;
GList *fileComboItems = NULL;
GtkWidget *fileCombo;
GtkWidget *next_button;
GtkWidget *prev_button;
GtkWidget *best_button;
GtkWidget *hex_button;
GtkWidget *raw_button;
GtkWidget *find_button;
GtkWidget *hbox2;
GtkWidget *print_button;
GtkWidget *font_button;
GtkWidget *done_button;
GtkWidget *help_button;
g_print("File viewer dialog box goes here\n");
/*g_print("File viewer dialog box goes here\n");*/
/* --- Create the dialog --- */
dialog = gtk_dialog_new();
@ -50,6 +148,8 @@ void file_viewer(GtkWidget *widget, gpointer data)
/* create a new scrolled window. */
scrolled_window = gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_size_request(scrolled_window, 512, 256);
gtk_container_set_border_width(GTK_CONTAINER(scrolled_window), 10);
/* the policy is one of GTK_POLICY AUTOMATIC, or GTK_POLICY_ALWAYS.
@ -79,10 +179,241 @@ void file_viewer(GtkWidget *widget, gpointer data)
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), hbox1, TRUE, TRUE, 0);
gtk_widget_show(hbox1);
hbox2 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), hbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox2);
vbox1 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), vbox1, TRUE, TRUE, 0);
gtk_widget_show(vbox1);
vbox2 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), vbox2, TRUE, TRUE, 0);
gtk_widget_show(vbox2);
dataForkRb = create_radio(vbox1, &forkRbGroup, "Data fork");
resourceForkRb = create_radio(vbox1, &forkRbGroup, "Resource fork");
commentRb = create_radio(vbox1, &forkRbGroup, "Comment");
/* Set default selected item */
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(dataForkRb), TRUE);
/* Default grey out resource fork radio button */
gtk_widget_set_sensitive(resourceForkRb, FALSE);
/* Default grey out comment radio button */
gtk_widget_set_sensitive(commentRb, FALSE);
/* Set up callbacks for radio buttons */
gtk_signal_connect(GTK_OBJECT(dataForkRb), "clicked", GTK_SIGNAL_FUNC(dataForkRbCallback), (gpointer)"dataForkRb");
gtk_signal_connect(GTK_OBJECT(resourceForkRb), "clicked", GTK_SIGNAL_FUNC(resourceForkRbCallback), (gpointer)"resourceForkRb");
gtk_signal_connect(GTK_OBJECT(commentRb), "clicked", GTK_SIGNAL_FUNC(commentRbCallback), (gpointer)"commentRb");
/*
* --- Next button
*/
/* --- Create the "Next" button --- */
next_button = gtk_button_new_with_label("Next");
gtk_signal_connect(GTK_OBJECT(next_button), "clicked",
GTK_SIGNAL_FUNC(view_next),
dialog);
/* --- Allow "Next" to be a default --- */
GTK_WIDGET_SET_FLAGS(next_button, GTK_CAN_DEFAULT);
/* --- Add the Next button to the bottom right --- */
gtk_box_pack_start(GTK_BOX(vbox2), next_button, TRUE, TRUE, 0);
/* --- Make the "Next" the default --- */
gtk_widget_grab_default(next_button);
/* --- Make the button visible --- */
gtk_widget_show(next_button);
/*
* --- Prev button
*/
/* --- Create the "Prev" button --- */
prev_button = gtk_button_new_with_label("Prev");
gtk_signal_connect(GTK_OBJECT(prev_button), "clicked",
GTK_SIGNAL_FUNC(view_prev),
dialog);
/* --- Allow "Prev" to be a default --- */
GTK_WIDGET_SET_FLAGS(prev_button, GTK_CAN_DEFAULT);
/* --- Add the Prev button to the bottom right --- */
gtk_box_pack_start(GTK_BOX(vbox2), prev_button, TRUE, TRUE, 0);
/* --- Make the "Prev" the default --- */
gtk_widget_grab_default(prev_button);
/* --- Make the button visible --- */
gtk_widget_show(prev_button);
vbox3 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), vbox3, TRUE, TRUE, 0);
gtk_widget_show(vbox3);
vbox4 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox1), vbox4, TRUE, TRUE, 0);
gtk_widget_show(vbox4);
/*
* --- Create a list of the items first
*/
fileComboItems = g_list_append(fileComboItems, "Converted Text");
fileComboItems = g_list_append(fileComboItems, "Raw");
fileComboItems = g_list_append(fileComboItems, "Hex Dump");
fileComboItems = g_list_append(fileComboItems, "//e monitor listing");
fileComboItems = g_list_append(fileComboItems, "IIgs monitor listing (long regs)");
/* --- Make a combo box. --- */
fileCombo = gtk_combo_new();
/* --- Create the drop down portion of the combo --- */
gtk_combo_set_popdown_strings(GTK_COMBO(fileCombo), fileComboItems);
/* --- Default the text in the field to a value --- */
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(fileCombo)->entry), "Converted Text");
/* --- Make the edit portion non-editable. They can pick a
* value from the drop down, they just can't end up with
* a value that's not in the drop down.
*/
gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(fileCombo)->entry), FALSE);
gtk_box_pack_start(GTK_BOX(vbox3), fileCombo, TRUE, TRUE, 0);
gtk_widget_show(fileCombo);
hbox2 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox3), hbox2, TRUE, TRUE, 0);
gtk_widget_show(hbox2);
hbox3 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox4), hbox3, TRUE, TRUE, 0);
gtk_widget_show(hbox3);
hbox4 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox4), hbox4, TRUE, TRUE, 0);
gtk_widget_show(hbox4);
/*
* --- Best button
*/
/* --- Create the "Best" button --- */
best_button = gtk_button_new_with_label("Best");
gtk_signal_connect(GTK_OBJECT(best_button), "clicked",
GTK_SIGNAL_FUNC(best_func),
dialog);
/* --- Allow "Best" to be a default --- */
GTK_WIDGET_SET_FLAGS(best_button, GTK_CAN_DEFAULT);
/* --- Add the Best button to the bottom right --- */
gtk_box_pack_start(GTK_BOX(hbox2), best_button, TRUE, TRUE, 0);
/* --- Make the "Best" the default --- */
gtk_widget_grab_default(best_button);
/* --- Make the button visible --- */
gtk_widget_show(best_button);
/*
* --- Hex button