@ -1788,8 +1788,17 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
case YON_PAGE_INSTALL_ERROR :
case YON_PAGE_COMPLETION :
if ( ! system ( " reboot " ) )
return ;
confirmation_window * window = yon_confirmation_window_new ( ) ;
dictionary * dict = NULL ;
yon_dictionary_add_or_create_if_exists_with_data ( dict , " widgets " , widgets ) ;
yon_dictionary_add_or_create_if_exists_with_data ( dict , " window " , window ) ;
g_signal_connect ( G_OBJECT ( window - > AcceptButton ) , " clicked " , G_CALLBACK ( on_reboot_accepted ) , dict ) ;
gtk_window_set_transient_for ( GTK_WINDOW ( window - > Window ) , GTK_WINDOW ( widgets - > MainWindow ) ) ;
gtk_window_set_title ( GTK_WINDOW ( window - > Window ) , TITLE_LABEL ) ;
gtk_window_set_icon_name ( GTK_WINDOW ( window - > Window ) , icon_path ) ;
gtk_label_set_text ( GTK_LABEL ( window - > TextLabel ) , WARNING_TEXT_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( window - > TitleLabel ) , WARNING_TITLE_LABEL ) ;
gtk_widget_show ( window - > Window ) ;
break ;
case YON_PAGE_INSTALL_OPTIONS : {
@ -2121,7 +2130,7 @@ void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){
json_object_object_get_ex ( root , " blockdevices " , & blockdevices ) ;
for ( long unsigned int i = 0 ; i < json_object_array_length ( blockdevices ) ; i + + ) {
struct json_object * device = json_object_array_get_idx ( blockdevices , i ) ;
struct json_object * type , * path , * size , * model , * fstype , * fsused ;
struct json_object * type , * path , * size , * model , * fstype , * fsused , * label ;
json_object_object_get_ex ( device , " type " , & type ) ;
if ( strcmp ( " part " , json_object_get_string ( type ) ) )
@ -2132,6 +2141,7 @@ void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){
}
json_object_object_get_ex ( device , " size " , & size ) ;
json_object_object_get_ex ( device , " model " , & model ) ;
json_object_object_get_ex ( device , " label " , & label ) ;
json_object_object_get_ex ( device , " fstype " , & fstype ) ;
json_object_object_get_ex ( device , " fsused " , & fsused ) ;
@ -2165,7 +2175,7 @@ void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),0.0);
gtk_adjustment_set_upper ( gtk_spin_button_get_adjustment ( GTK_SPIN_BUTTON ( widgets - > InstallationNearSizeSpin ) ) , 0.0 ) ;
gtk_list_store_append ( widgets - > PartitionsList , & iter ) ;
gtk_list_store_set ( widgets - > PartitionsList , & iter , 0 , json_object_get_string ( path ) , 1 , json_object_get_string ( size ) , 2 , free_space_string , 3 , json_object_get_string ( fstype ) , - 1 ) ;
gtk_list_store_set ( widgets - > PartitionsList , & iter , 0 , json_object_get_string ( path ) , 1 , json_object_get_string ( size ) , 2 , free_space_string , 3 , json_object_get_string ( fstype ) , 4 , json_object_get_string ( label ) , - 1 ) ;
}
yon_char_parsed_free ( parsed , size ) ;
}
@ -2217,6 +2227,22 @@ void on_gparted_open(){
gboolean on_yon_exit ( GtkWidget * , GdkEvent * , main_window * widgets ) ;
void on_reboot_accepted ( GtkWidget * , dictionary * dict ) {
main_window * widgets = yon_dictionary_get_data ( dict - > first , main_window * ) ;
confirmation_window * window = yon_dictionary_get_data ( dict - > first - > next , confirmation_window * ) ;
g_mutex_lock ( & main_config . install_mutex ) ;
if ( main_config . install_thread ) {
pthread_cancel ( ( pthread_t ) main_config . install_thread ) ;
g_mutex_unlock ( & main_config . install_mutex ) ;
}
main_config . exit_accepted = 1 ;
g_signal_emit_by_name ( G_OBJECT ( widgets - > MainWindow ) , " delete-event " ) ;
free ( window ) ;
yon_dictionary_free_all ( dict , NULL ) ;
free ( dict ) ;
if ( system ( " reboot " ) ) { } ;
}
void on_exit_accepted ( GtkWidget * , dictionary * dict ) ;
void on_exit_accepted ( GtkWidget * , dictionary * dict ) {
main_window * widgets = yon_dictionary_get_data ( dict - > first , main_window * ) ;
@ -2234,23 +2260,31 @@ void on_exit_accepted(GtkWidget *,dictionary *dict){
gtk_widget_destroy ( widgets - > MainWindow ) ;
}
gboolean on_yon_exit ( GtkWidget * , GdkEvent * , main_window * widgets ) {
if ( ! main_config . exit_accepted ) {
if ( widgets ) { } ;
confirmation_window * window = malloc ( sizeof ( confirmation_window ) ) ;
confirmation_window * yon_confirmation_window_new ( ) {
confirmation_window * window = malloc ( sizeof ( confirmation_window ) ) ;
GtkBuilder * builder = gtk_builder_new_from_resource ( glade_path_confirmation ) ;
window - > Window = yon_gtk_builder_get_widget ( builder , " MainWindow " ) ;
window - > TitleLabel = yon_gtk_builder_get_widget ( builder , " TitleLabel " ) ;
window - > TextLabel = yon_gtk_builder_get_widget ( builder , " TextLabel " ) ;
window - > AcceptButton = yon_gtk_builder_get_widget ( builder , " AcceptButton " ) ;
window - > CancelButton = yon_gtk_builder_get_widget ( builder , " CancelButton " ) ;
g_signal_connect ( G_OBJECT ( window - > CancelButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
return window ;
}
gboolean on_yon_exit ( GtkWidget * , GdkEvent * , main_window * widgets ) {
if ( ! main_config . exit_accepted ) {
if ( widgets ) { } ;
confirmation_window * window = yon_confirmation_window_new ( ) ;
dictionary * dict = NULL ;
yon_dictionary_add_or_create_if_exists_with_data ( dict , " widgets " , widgets ) ;
yon_dictionary_add_or_create_if_exists_with_data ( dict , " window " , window ) ;
g_signal_connect ( G_OBJECT ( window - > AcceptButton ) , " clicked " , G_CALLBACK ( on_exit_accepted ) , dict ) ;
g_signal_connect ( G_OBJECT ( window - > AcceptButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
g_signal_connect ( G_OBJECT ( window - > CancelButton ) , " clicked " , G_CALLBACK ( on_subwindow_close ) , NULL ) ;
gtk_window_set_transient_for ( GTK_WINDOW ( window - > Window ) , GTK_WINDOW ( widgets - > MainWindow ) ) ;
gtk_window_set_title ( GTK_WINDOW ( window - > Window ) , TITLE_LABEL ) ;
gtk_window_set_icon_name ( GTK_WINDOW ( window - > Window ) , icon_path ) ;
gtk_label_set_text ( GTK_LABEL ( window - > TextLabel ) , WARNING_TEXT_LABEL ) ;
gtk_label_set_text ( GTK_LABEL ( window - > TitleLabel ) , WARNING_TITLE_LABEL ) ;
gtk_widget_show ( window - > Window ) ;
@ -2498,6 +2532,18 @@ main_window *yon_main_window_complete(){
g_signal_connect ( G_OBJECT ( widgets - > RootPasswordSensitiveCheck ) , " toggled " , G_CALLBACK ( yon_password_set_sensitive_from_toggle ) , widgets ) ;
g_signal_connect ( G_OBJECT ( widgets - > PasswordSensitiveCheck ) , " toggled " , G_CALLBACK ( yon_password_set_sensitive_from_toggle ) , widgets ) ;
if ( main_config . lock_load_global = = 1 ) {
gtk_widget_set_sensitive ( widgets - > LoadGlobalConfigurationMenuItem , 0 ) ;
}
if ( main_config . lock_save_global = = 1 ) {
gtk_widget_set_sensitive ( widgets - > SaveGlobalConfigurationMenuItem , 0 ) ;
gtk_widget_set_sensitive ( widgets - > SaveGlobalLocalConfigurationMenuItem , 0 ) ;
}
if ( main_config . lock_save_local = = 1 ) {
gtk_widget_set_sensitive ( widgets - > SaveLocalConfigurationMenuItem , 0 ) ;
gtk_widget_set_sensitive ( widgets - > SaveGlobalLocalConfigurationMenuItem , 0 ) ;
}
gtk_tree_model_filter_set_visible_column ( GTK_TREE_MODEL_FILTER ( widgets - > LanguagesFilter ) , 0 ) ;
gtk_tree_model_filter_refilter ( GTK_TREE_MODEL_FILTER ( widgets - > LanguagesFilter ) ) ;