Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/build errors #15

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 49 additions & 17 deletions src/opensuperclone/clone_gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ int start_gtk_ccc(int argc, char **argv, char *title, char *version)
status_register_label = GTK_WIDGET(gtk_builder_get_object(builder, "status_register_label"));
error_register_label = GTK_WIDGET(gtk_builder_get_object(builder, "error_register_label"));

gtk_label_set_text(status_register_label, _("Status Register"));
gtk_label_set_text(error_register_label, _("Error Register"));
gtk_label_set_text(GTK_LABEL(status_register_label), _("Status Register"));
gtk_label_set_text(GTK_LABEL(error_register_label), _("Error Register"));

bsy_status_icon = GTK_WIDGET(gtk_builder_get_object(builder, "bsy_status_icon"));
drdy_status_icon = GTK_WIDGET(gtk_builder_get_object(builder, "drdy_status_icon"));
Expand Down Expand Up @@ -496,7 +496,7 @@ int start_gtk_ccc(int argc, char **argv, char *title, char *version)

g_object_unref(builder);

gtk_window_set_default_size(main_window_ccc, 1150, 690);
gtk_window_set_default_size(GTK_WINDOW(main_window_ccc), 1150, 690);
gtk_widget_show_all(main_window_ccc);
gtk_main();

Expand Down Expand Up @@ -1808,6 +1808,20 @@ void choose_null_ccc(void)
}
}

void disconnect_devices_ccc(void)
{
release_devices_ccc();
connected_ccc = 0;
// strcpy (tempmessage_ccc, _("Devices now disconnected"));
// message_error_ccc(tempmessage_ccc);
// print_gui_error_message_ccc(error_message_ccc, _("Success!"), 0);
// clear_error_message_ccc();
set_disconnected_ccc();
ata_status_ccc = 0;
ata_error_ccc = 0;
update_display_ccc(0);
}

void connect_devices_ccc(void)
{
// check if we're already connected
Expand Down Expand Up @@ -2015,20 +2029,6 @@ gint display_status_update_action_ccc(gpointer data)
return 1;
}

void disconnect_devices_ccc(void)
{
release_devices_ccc();
connected_ccc = 0;
// strcpy (tempmessage_ccc, _("Devices now disconnected"));
// message_error_ccc(tempmessage_ccc);
// print_gui_error_message_ccc(error_message_ccc, _("Success!"), 0);
// clear_error_message_ccc();
set_disconnected_ccc();
ata_status_ccc = 0;
ata_error_ccc = 0;
update_display_ccc(0);
}

void set_connected_ccc(void)
{
if (driver_mode_ccc && (strcmp(disk_2_ccc, "/dev/null") == 0))
Expand Down Expand Up @@ -2869,6 +2869,38 @@ void display_analyze_results_ccc(void)
gtk_widget_destroy(dialog);
}

int get_smart_attribute_level_ccc(int id, long long value, int current, int worst, int threshold)
{
int level = 0;

switch (id)
{
// Reallocated Sectors Count
case 5:
// Current Pending Sectors
case 197:
if (value > 0) level = 2;
break;

// Reported Uncorrectable Errors
case 187:
// Command Timeout
case 188:
// Off-line Uncorrectable
case 198:
// UDMA CRC Error Rate
case 199:
if (value > 0) level = 1;
break;

default:
level = 0;
break;
}

return level;
}

void get_smart_data_ccc(void)
{
stop_signal_ccc = false;
Expand Down
32 changes: 0 additions & 32 deletions src/opensuperclone/opensuperclone.c
Original file line number Diff line number Diff line change
Expand Up @@ -14591,38 +14591,6 @@ char *get_smart_attribute_name_ccc(int id)
return message;
}

int get_smart_attribute_level_ccc(int id, long long value, int current, int worst, int threshold)
{
int level = 0;

switch (id)
{
// Reallocated Sectors Count
case 5:
// Current Pending Sectors
case 197:
if (value > 0) level = 2;
break;

// Reported Uncorrectable Errors
case 187:
// Command Timeout
case 188:
// Off-line Uncorrectable
case 198:
// UDMA CRC Error Rate
case 199:
if (value > 0) level = 1;
break;

default:
level = 0;
break;
}

return level;
}

long long block_align_ccc(long long value, int offset)
{
long long new_value = value / block_size_ccc;
Expand Down
2 changes: 0 additions & 2 deletions src/opensuperclone/opensuperclone.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,6 @@ void test_skip_ccc(int size);

char *get_smart_attribute_name_ccc(int id);

int get_smart_attribute_level_ccc(int id, long long value, int current, int worst, int threshold);

char *install_directory_ccc = OSC_INSTALL_PATH;
bool path_fail_ccc = false;
char start_working_directory_ccc[PATH_MAX];
Expand Down
Loading