|
|
|
@ -2,19 +2,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
config main_config;
|
|
|
|
config main_config;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_terminal_done(GtkWidget *terminal, int , main_window *){
|
|
|
|
void on_terminal_done(GtkWidget *terminal, int size, main_window *widgets){
|
|
|
|
|
|
|
|
gtk_widget_destroy(terminal);
|
|
|
|
gtk_widget_destroy(terminal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_terminal_more(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_terminal_more(GtkWidget *, main_window *widgets){
|
|
|
|
int active = gtk_revealer_get_child_revealed(GTK_REVEALER(widgets->TerminalMoreRevieler));
|
|
|
|
int active = gtk_revealer_get_child_revealed(GTK_REVEALER(widgets->TerminalMoreRevieler));
|
|
|
|
if (active ==1) active = 0;
|
|
|
|
if (active ==1) active = 0;
|
|
|
|
else active=1;
|
|
|
|
else active=1;
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active);
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalMoreRevieler),active);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_terminal_destroy(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_terminal_destroy(GtkWidget *, main_window *widgets){
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0);
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),0);
|
|
|
|
gtk_widget_destroy(widgets->TerminalRevealer);
|
|
|
|
gtk_widget_destroy(widgets->TerminalRevealer);
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
@ -36,16 +35,16 @@ void on_terminal_destroy(GtkWidget *self, main_window *widgets){
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void child_ready(VteTerminal *terminal, GPid pid, GError *error, gpointer user_data)
|
|
|
|
static void child_ready(VteTerminal *terminal, GPid pid, GError *, gpointer user_data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!terminal) return;
|
|
|
|
if (!terminal) return;
|
|
|
|
if (pid == -1) printf("Error\n\n\n");
|
|
|
|
if (pid == -1) printf("Error\n\n\n");
|
|
|
|
else vte_terminal_feed_child(VTE_TERMINAL(terminal),(char*)user_data,strlen((char*)user_data));
|
|
|
|
else vte_terminal_feed_child(VTE_TERMINAL(terminal),(char*)user_data,strlen((char*)user_data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_terminal_check_progress(VteTerminal *terminal, main_window *widgets){
|
|
|
|
void on_terminal_check_progress(VteTerminal *, main_window *){
|
|
|
|
char *text = vte_terminal_get_text(terminal,NULL,NULL,NULL);
|
|
|
|
// char *text = vte_terminal_get_text(terminal,NULL,NULL,NULL);
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel),(double)yon_char_count(text,"::")/4);
|
|
|
|
// gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel),(double)yon_char_count(text,"::")/4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_terminal_start(main_window *widgets, char *usr_command){
|
|
|
|
void yon_terminal_start(main_window *widgets, char *usr_command){
|
|
|
|
@ -109,9 +108,9 @@ void yon_terminal_start(main_window *widgets, char *usr_command){
|
|
|
|
gtk_widget_show_all(widgets->TerminalRevealer);
|
|
|
|
gtk_widget_show_all(widgets->TerminalRevealer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_driver_pack_selection_change(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_driver_pack_selection_change(GtkWidget *, main_window *widgets){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
char *name;
|
|
|
|
// char *name;
|
|
|
|
GtkTreeModel *list_s=GTK_TREE_MODEL(main_config.list);
|
|
|
|
GtkTreeModel *list_s=GTK_TREE_MODEL(main_config.list);
|
|
|
|
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
if (gtk_tree_selection_get_selected(selection,&list_s,&iter)){
|
|
|
|
if (gtk_tree_selection_get_selected(selection,&list_s,&iter)){
|
|
|
|
@ -125,7 +124,7 @@ void on_driver_pack_selection_change(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_driver_pack_info(GtkWidget *self, main_window *widgets){
|
|
|
|
void on_driver_pack_info(GtkWidget *, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
pthread_attr_t attr;
|
|
|
|
pthread_attr_t attr;
|
|
|
|
pthread_t tid;
|
|
|
|
pthread_t tid;
|
|
|
|
@ -144,7 +143,7 @@ void on_driver_pack_info(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_pack_install_activate(GtkCellRendererToggle* self,gchar* path,main_window *widgets){
|
|
|
|
void on_pack_install_activate(GtkCellRendererToggle* ,gchar* path,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
@ -187,7 +186,7 @@ void on_pack_install_activate(GtkCellRendererToggle* self,gchar* path,main_windo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_module_install_activate(GtkCellRendererToggle* self,gchar* path,main_window *widgets){
|
|
|
|
void on_module_install_activate(GtkCellRendererToggle* ,gchar* path,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
@ -233,7 +232,7 @@ gboolean yon_filter_func(GtkTreeModel* model,GtkTreeIter* iter,main_window *widg
|
|
|
|
const char *target = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->KernelsCombo));
|
|
|
|
const char *target = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->KernelsCombo));
|
|
|
|
char *cur;
|
|
|
|
char *cur;
|
|
|
|
gtk_tree_model_get(model,iter,2,&cur,-1);
|
|
|
|
gtk_tree_model_get(model,iter,2,&cur,-1);
|
|
|
|
if (!strcmp(cur,target))return 1;
|
|
|
|
if (!yon_char_is_empty(cur)&&!yon_char_is_empty(target)&&!strcmp(cur,target))return 1;
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -244,9 +243,9 @@ void on_kernel_filter_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
GtkTreeModel *model = gtk_tree_model_filter_new(GTK_TREE_MODEL(main_config.list),NULL);
|
|
|
|
GtkTreeModel *model = gtk_tree_model_filter_new(GTK_TREE_MODEL(main_config.list),NULL);
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),model);
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),model);
|
|
|
|
gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(model),(GtkTreeModelFilterVisibleFunc)yon_filter_func,widgets,NULL);
|
|
|
|
gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(model),(GtkTreeModelFilterVisibleFunc)yon_filter_func,widgets,NULL);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree))));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree))));
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
if (GTK_IS_TREE_MODEL_FILTER(model)) {
|
|
|
|
if (GTK_IS_TREE_MODEL_FILTER(model)) {
|
|
|
|
@ -257,7 +256,7 @@ void on_kernel_filter_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
void on_port_chosen_changed(GtkWidget *, monitor_edit_window *window){
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
for (int i=0;i<window->resolutionssize;i++){
|
|
|
|
for (int i=0;i<window->resolutionssize;i++){
|
|
|
|
free(window->resolutions);
|
|
|
|
free(window->resolutions);
|
|
|
|
@ -283,10 +282,10 @@ void on_port_chosen_changed(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
yon_char_remove_last_symbol(resolutions[i],'\n');
|
|
|
|
yon_char_remove_last_symbol(resolutions[i],'\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resolution_supported *res = yon_dictionary_get_data(dict,resolution_supported*);
|
|
|
|
resolution_supported *res = yon_dictionary_get_data(dict,resolution_supported*);
|
|
|
|
int found_size=0;
|
|
|
|
// int found_size=0;
|
|
|
|
int found = -1;
|
|
|
|
int found = -1;
|
|
|
|
for (int i=0;i<res->size;i++){
|
|
|
|
for (int i=0;i<res->size;i++){
|
|
|
|
char *check_line;
|
|
|
|
// char *check_line;
|
|
|
|
for (int j=1;j<size;j++){
|
|
|
|
for (int j=1;j<size;j++){
|
|
|
|
if (strstr(resolutions[j],res->line[i])){
|
|
|
|
if (strstr(resolutions[j],res->line[i])){
|
|
|
|
found = j;
|
|
|
|
found = j;
|
|
|
|
@ -326,7 +325,7 @@ void on_sensitive_change_reversed(GtkWidget *self, GtkWidget *toggle)
|
|
|
|
gtk_widget_set_sensitive(toggle, !state);
|
|
|
|
gtk_widget_set_sensitive(toggle, !state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_auto_choose_drivers(GtkWidget *self, main_window *widgets)
|
|
|
|
void on_auto_choose_drivers(GtkWidget *self, main_window *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self));
|
|
|
|
main_config.autoChooseDrivers=state;
|
|
|
|
main_config.autoChooseDrivers=state;
|
|
|
|
@ -359,8 +358,7 @@ void on_resolutions_unsupported_show(GtkToggleButton *self, monitor_edit_window
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_save_done(main_window *widgets, config_str output, int size){
|
|
|
|
void on_save_done(main_window *, config_str output, int size){
|
|
|
|
if (widgets) {};
|
|
|
|
|
|
|
|
// char *gapfix1 = yon_config_get_by_key(KWIN_TRIPLE_BUFFER);
|
|
|
|
// char *gapfix1 = yon_config_get_by_key(KWIN_TRIPLE_BUFFER);
|
|
|
|
// char *gapfix2 = yon_config_get_by_key(GL_YIELD);
|
|
|
|
// char *gapfix2 = yon_config_get_by_key(GL_YIELD);
|
|
|
|
// int gapfix1_status = yon_config_get_status(KWIN_TRIPLE_BUFFER);
|
|
|
|
// int gapfix1_status = yon_config_get_status(KWIN_TRIPLE_BUFFER);
|
|
|
|
@ -386,14 +384,14 @@ void on_save_done(main_window *widgets, config_str output, int size){
|
|
|
|
|
|
|
|
|
|
|
|
void yon_interface_save(){
|
|
|
|
void yon_interface_save(){
|
|
|
|
|
|
|
|
|
|
|
|
char *autodrivers = NULL;
|
|
|
|
// char *autodrivers = NULL;
|
|
|
|
char *freedrivers = NULL;
|
|
|
|
// char *freedrivers = NULL;
|
|
|
|
char *dpms= NULL;
|
|
|
|
// char *dpms= NULL;
|
|
|
|
char *dpi = NULL;
|
|
|
|
char *dpi = NULL;
|
|
|
|
char *failsafenvidia = NULL;
|
|
|
|
// char *failsafenvidia = NULL;
|
|
|
|
char *failsafeati = NULL;
|
|
|
|
// char *failsafeati = NULL;
|
|
|
|
char *optirun = NULL;
|
|
|
|
// char *optirun = NULL;
|
|
|
|
char *primusrun = NULL;
|
|
|
|
// char *primusrun = NULL;
|
|
|
|
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo))){
|
|
|
|
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo))){
|
|
|
|
case 0: yon_config_remove_by_key(VGADRV_AUTO);
|
|
|
|
case 0: yon_config_remove_by_key(VGADRV_AUTO);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -453,8 +451,9 @@ void yon_interface_save(){
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 1: yon_config_register(OPTIRUN,OPTIRUN_command,"no");
|
|
|
|
case 1: yon_config_register(OPTIRUN,OPTIRUN_command,"no");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(main_config.widgets->OptirunEntry))))
|
|
|
|
case 2: if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(main_config.widgets->OptirunEntry)))){
|
|
|
|
yon_config_register(OPTIRUN,OPTIRUN_command,(char*)gtk_entry_get_text(GTK_ENTRY(main_config.widgets->OptirunEntry)));
|
|
|
|
yon_config_register(OPTIRUN,OPTIRUN_command,(char*)gtk_entry_get_text(GTK_ENTRY(main_config.widgets->OptirunEntry)));
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo))){
|
|
|
|
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->PrimusrunCombo))){
|
|
|
|
@ -462,8 +461,9 @@ void yon_interface_save(){
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 1: yon_config_register(PRIMUSRUN,PRIMUSRUN_command,"no");
|
|
|
|
case 1: yon_config_register(PRIMUSRUN,PRIMUSRUN_command,"no");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2: if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(main_config.widgets->PrimusrunEntry))))
|
|
|
|
case 2: if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(main_config.widgets->PrimusrunEntry)))){
|
|
|
|
yon_config_register(PRIMUSRUN,PRIMUSRUN_command,(char*)gtk_entry_get_text(GTK_ENTRY(main_config.widgets->PrimusrunEntry)));
|
|
|
|
yon_config_register(PRIMUSRUN,PRIMUSRUN_command,(char*)gtk_entry_get_text(GTK_ENTRY(main_config.widgets->PrimusrunEntry)));
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->FrameGapCombo))){
|
|
|
|
// switch (gtk_combo_box_get_active(GTK_COMBO_BOX(main_config.widgets->FrameGapCombo))){
|
|
|
|
@ -511,8 +511,8 @@ void yon_interface_update(){
|
|
|
|
char *optirun = yon_config_get_by_key(OPTIRUN);
|
|
|
|
char *optirun = yon_config_get_by_key(OPTIRUN);
|
|
|
|
char *primusrun = yon_config_get_by_key(PRIMUSRUN);
|
|
|
|
char *primusrun = yon_config_get_by_key(PRIMUSRUN);
|
|
|
|
char *discrete = yon_config_get_by_key(INTEGRATEDVGA);
|
|
|
|
char *discrete = yon_config_get_by_key(INTEGRATEDVGA);
|
|
|
|
char *gapfix1 = yon_config_get_by_key(GL_YIELD);
|
|
|
|
// char *gapfix1 = yon_config_get_by_key(GL_YIELD);
|
|
|
|
char *gapfix2 = yon_config_get_by_key(KWIN_TRIPLE_BUFFER);
|
|
|
|
// char *gapfix2 = yon_config_get_by_key(KWIN_TRIPLE_BUFFER);
|
|
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(autodrivers)&&!strcmp(autodrivers,"yes"))
|
|
|
|
if (!yon_char_is_empty(autodrivers)&&!strcmp(autodrivers,"yes"))
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo),2);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(main_config.widgets->AutoDriverCombo),2);
|
|
|
|
@ -606,56 +606,49 @@ void yon_interface_update(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
yon_config_clean();
|
|
|
|
yon_config_clean();
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
switch (type){
|
|
|
|
yon_config_load_config(type,config_get_global_command,NULL);
|
|
|
|
case YON_CONFIG_GLOBAL:
|
|
|
|
} else if (type==YON_CONFIG_LOCAL){
|
|
|
|
yon_config_load_config(type,config_get_command("global"),NULL);
|
|
|
|
yon_config_load_config(type,config_get_local_command,NULL);
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
break;
|
|
|
|
char *path="";
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_config_load_config(type,config_get_command(system),NULL);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,TITLE_LABEL,icon_name,"FileChooserWindow");
|
|
|
|
break;
|
|
|
|
textdomain(LocaleName);
|
|
|
|
case YON_CONFIG_CUSTOM:
|
|
|
|
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-video");
|
|
|
|
char *path = NULL;
|
|
|
|
gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL);
|
|
|
|
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
if (!yon_char_is_empty(path)){
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
yon_config_clean();
|
|
|
|
gtk_file_filter_set_name(filter, "*.ini");
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
gtk_widget_show(dialog);
|
|
|
|
|
|
|
|
int response = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
|
|
|
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(file)){
|
|
|
|
|
|
|
|
path=yon_char_unite("'",file,"'",NULL);
|
|
|
|
|
|
|
|
free(file);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_load_config(type,yon_config_get_custom_command(path),NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_load(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_config_local_load(GtkWidget *self,main_window *){
|
|
|
|
if (self){}
|
|
|
|
if (self){}
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
main_config.load_mode=1;
|
|
|
|
main_config.load_mode=1;
|
|
|
|
yon_interface_update();
|
|
|
|
yon_interface_update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_global_load(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_config_global_load(GtkWidget *self,main_window *){
|
|
|
|
if (self){}
|
|
|
|
if (self){}
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
main_config.load_mode=0;
|
|
|
|
main_config.load_mode=0;
|
|
|
|
yon_interface_update();
|
|
|
|
yon_interface_update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_custom_load(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_config_custom_load(GtkWidget *self,main_window *){
|
|
|
|
if (self){}
|
|
|
|
if (self){}
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
main_config.load_mode=3;
|
|
|
|
main_config.load_mode=3;
|
|
|
|
@ -665,20 +658,20 @@ void on_config_custom_load(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_config_global_local_save(){
|
|
|
|
void on_config_global_local_save(){
|
|
|
|
yon_interface_save();
|
|
|
|
yon_interface_save();
|
|
|
|
main_config.save_config=3;
|
|
|
|
main_config.save_config=3;
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL);
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(){
|
|
|
|
void on_config_local_save(){
|
|
|
|
yon_interface_save();
|
|
|
|
yon_interface_save();
|
|
|
|
main_config.save_config=1;
|
|
|
|
main_config.save_config=1;
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_local_command,NULL);
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_global_save(){
|
|
|
|
void on_config_global_save(){
|
|
|
|
yon_interface_save();
|
|
|
|
yon_interface_save();
|
|
|
|
main_config.save_config=0;
|
|
|
|
main_config.save_config=0;
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_global_command,NULL);
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -686,7 +679,7 @@ void on_config_custom_save(GtkWidget *self, main_window *widgets){
|
|
|
|
yon_interface_save();
|
|
|
|
yon_interface_save();
|
|
|
|
if (self&&widgets){}
|
|
|
|
if (self&&widgets){}
|
|
|
|
main_config.save_config=1;
|
|
|
|
main_config.save_config=1;
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,yon_config_get_custom_command("system"),NULL);
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
if (window){};
|
|
|
|
if (window){};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -696,7 +689,7 @@ void on_config_custom_save(GtkWidget *self, main_window *widgets){
|
|
|
|
/**void on_monitor_delete(GtkWidget *self,monitor_data windowd)
|
|
|
|
/**void on_monitor_delete(GtkWidget *self,monitor_data windowd)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void on_monitor_delete(GtkWidget *self,monitor_data *window){
|
|
|
|
void on_monitor_delete(GtkWidget *,monitor_data *window){
|
|
|
|
if(window){
|
|
|
|
if(window){
|
|
|
|
GtkWidget *target = gtk_widget_get_parent(window->ScreenOverlay);
|
|
|
|
GtkWidget *target = gtk_widget_get_parent(window->ScreenOverlay);
|
|
|
|
GtkWidget *flow_box = gtk_widget_get_parent(target);
|
|
|
|
GtkWidget *flow_box = gtk_widget_get_parent(target);
|
|
|
|
@ -712,7 +705,7 @@ void on_monitor_delete(GtkWidget *self,monitor_data *window){
|
|
|
|
/**void on_monitor_switch(GtkWidget *self,monitor_data *window)
|
|
|
|
/**void on_monitor_switch(GtkWidget *self,monitor_data *window)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void on_monitor_switch(GtkWidget *self,monitor_data *window){
|
|
|
|
void on_monitor_switch(GtkWidget *,monitor_data *window){
|
|
|
|
if(window){
|
|
|
|
if(window){
|
|
|
|
int enable = 0;
|
|
|
|
int enable = 0;
|
|
|
|
gtk_widget_set_sensitive(window->MonitorImage,!enable);
|
|
|
|
gtk_widget_set_sensitive(window->MonitorImage,!enable);
|
|
|
|
@ -722,20 +715,20 @@ void on_monitor_switch(GtkWidget *self,monitor_data *window){
|
|
|
|
/**void on_monitor_add(GtkWidget *self,monitor_data *window)
|
|
|
|
/**void on_monitor_add(GtkWidget *self,monitor_data *window)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void on_monitor_add(GtkWidget *self,main_window *widgets){
|
|
|
|
void on_monitor_add(GtkWidget *,main_window *widgets){
|
|
|
|
if(widgets){
|
|
|
|
if(widgets){
|
|
|
|
yon_monitor_new(widgets,0);
|
|
|
|
yon_monitor_new(widgets,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
void on_monitor_config_save(GtkWidget *, monitor_edit_window *window){
|
|
|
|
int enabled=0;
|
|
|
|
int enabled=0;
|
|
|
|
char *target=NULL;
|
|
|
|
char *target=NULL;
|
|
|
|
int main_display=0;
|
|
|
|
int main_display=0;
|
|
|
|
char *resolution = NULL;
|
|
|
|
char *resolution = NULL;
|
|
|
|
char *rotate = NULL;
|
|
|
|
char *rotate = NULL;
|
|
|
|
char *position = NULL;
|
|
|
|
char *position = NULL;
|
|
|
|
int switch_off=0;
|
|
|
|
// int switch_off=0;
|
|
|
|
int modeline_cvt = 0;
|
|
|
|
int modeline_cvt = 0;
|
|
|
|
int cvt_reduced = 0;
|
|
|
|
int cvt_reduced = 0;
|
|
|
|
int modeline_gtf = 0;
|
|
|
|
int modeline_gtf = 0;
|
|
|
|
@ -752,7 +745,7 @@ void on_monitor_config_save(GtkWidget *self, monitor_edit_window *window){
|
|
|
|
if (pos&>k_combo_box_get_active(GTK_COMBO_BOX(window->PositionPortCombo))){
|
|
|
|
if (pos&>k_combo_box_get_active(GTK_COMBO_BOX(window->PositionPortCombo))){
|
|
|
|
position = yon_char_append(pos==1?"lo:":pos==2?"ro:":pos==3?"ab:":"be",gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->PositionPortCombo)));
|
|
|
|
position = yon_char_append(pos==1?"lo:":pos==2?"ro:":pos==3?"ab:":"be",gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->PositionPortCombo)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch_off = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DoNotSwitchOffCheck));
|
|
|
|
// switch_off = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DoNotSwitchOffCheck));
|
|
|
|
modeline_cvt = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ModelineCVTCheck));
|
|
|
|
modeline_cvt = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ModelineCVTCheck));
|
|
|
|
cvt_reduced = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UseCVTReducedCheck));
|
|
|
|
cvt_reduced = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UseCVTReducedCheck));
|
|
|
|
modeline_gtf = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ModelineGTFCheck));
|
|
|
|
modeline_gtf = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ModelineGTFCheck));
|
|
|
|
@ -827,28 +820,28 @@ void yon_monitor_parse(monitor_edit_window *window, char *string){
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->MainCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->MainCheck),1);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"lo:")||strstr(parsed[i],"LeftOf:")){
|
|
|
|
} else if (strstr(parsed[i],"lo:")||strstr(parsed[i],"LeftOf:")){
|
|
|
|
char *location = yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
int target = yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
int target = yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationCombo),target);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationCombo),target);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),1);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"ro:")||strstr(parsed[i],"RightOf:")){
|
|
|
|
} else if (strstr(parsed[i],"ro:")||strstr(parsed[i],"RightOf:")){
|
|
|
|
char *location = yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),2);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),2);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"ab:")||strstr(parsed[i],"Above:")){
|
|
|
|
} else if (strstr(parsed[i],"ab:")||strstr(parsed[i],"Above:")){
|
|
|
|
char *location = yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),3);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),3);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"bee:")||strstr(parsed[i],"Below:")){
|
|
|
|
} else if (strstr(parsed[i],"bee:")||strstr(parsed[i],"Below:")){
|
|
|
|
char *location = yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
yon_gtk_combo_box_text_find(window->PositionPortCombo,parsed[i]);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),4);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->PositionPosCombo),4);
|
|
|
|
|
|
|
|
|
|
|
|
} else if (strstr(parsed[i],"rotate:")){
|
|
|
|
} else if (strstr(parsed[i],"rotate:")){
|
|
|
|
char *location = yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
yon_char_divide_search(parsed[i],":",-1);
|
|
|
|
if (strcmp(parsed[i],"normal")){
|
|
|
|
if (strcmp(parsed[i],"normal")){
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationCombo),0);
|
|
|
|
} else if (strcmp(parsed[i],"left")){
|
|
|
|
} else if (strcmp(parsed[i],"left")){
|
|
|
|
@ -867,7 +860,7 @@ void yon_monitor_parse(monitor_edit_window *window, char *string){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_monitor_configure(GtkWidget *self,monitor_data *window){
|
|
|
|
void on_monitor_configure(GtkWidget *,monitor_data *window){
|
|
|
|
if(window){
|
|
|
|
if(window){
|
|
|
|
monitor_edit_window *monitors = new(monitor_edit_window);
|
|
|
|
monitor_edit_window *monitors = new(monitor_edit_window);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_configuration);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_configuration);
|
|
|
|
@ -906,7 +899,7 @@ void on_monitor_configure(GtkWidget *self,monitor_data *window){
|
|
|
|
char *target = (char*)gtk_label_get_text(GTK_LABEL(window->NameLabel));
|
|
|
|
char *target = (char*)gtk_label_get_text(GTK_LABEL(window->NameLabel));
|
|
|
|
|
|
|
|
|
|
|
|
monitors->curport=NULL;
|
|
|
|
monitors->curport=NULL;
|
|
|
|
dictionary *dict=NULL;
|
|
|
|
// dictionary *dict=NULL;
|
|
|
|
int config_size;
|
|
|
|
int config_size;
|
|
|
|
config_str config_ports = yon_config_get_all_by_key(XORG_PARAMETER,&config_size);
|
|
|
|
config_str config_ports = yon_config_get_all_by_key(XORG_PARAMETER,&config_size);
|
|
|
|
for (int i=0;i<config_size;i++){
|
|
|
|
for (int i=0;i<config_size;i++){
|
|
|
|
@ -953,7 +946,7 @@ void on_monitor_configure(GtkWidget *self,monitor_data *window){
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void yon_monitor_view_update(){
|
|
|
|
void yon_monitor_view_update(){
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(main_config.widgets->MonitorsBox));
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(main_config.widgets->MonitorsBox));
|
|
|
|
for (int i=0;i<g_list_length(list);i++){
|
|
|
|
for (guint i=0;i<g_list_length(list);i++){
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(g_list_nth_data(list,i)));
|
|
|
|
gtk_widget_destroy(GTK_WIDGET(g_list_nth_data(list,i)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free(list);
|
|
|
|
g_list_free(list);
|
|
|
|
@ -982,7 +975,7 @@ void yon_monitor_view_update(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_proprietary_local_get(main_window *widgets){
|
|
|
|
void *yon_proprietary_local_get(main_window *widgets){
|
|
|
|
gtk_list_store_clear(main_config.list);
|
|
|
|
gtk_list_store_clear(main_config.list);
|
|
|
|
gtk_list_store_clear(main_config.list2);
|
|
|
|
gtk_list_store_clear(main_config.list2);
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KernelsCombo));
|
|
|
|
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KernelsCombo));
|
|
|
|
@ -1019,17 +1012,17 @@ void yon_proprietary_local_get(main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
char *status_text = yon_char_unite(yon_char_get_localised_from_lib(SUCCESS_LABEL),". ", main_config.load_mode==1?yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL):yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL),NULL);
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(status_text,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
textdomain(LocaleName);
|
|
|
|
free(status_text);
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),GTK_TREE_MODEL(main_config.list));
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),GTK_TREE_MODEL(main_config.list));
|
|
|
|
g_thread_exit (NULL);
|
|
|
|
g_thread_exit (NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_proprietary_get_thread(GtkWidget *self,main_window *widgets){
|
|
|
|
void yon_proprietary_get_thread(GtkWidget *,main_window *widgets){
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_LOADING_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
|
|
|
|
yon_ubl_status_box_render(PROPRIETARY_LOADING_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),NULL);
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->DriversTree),NULL);
|
|
|
|
GThread *thread = g_thread_new("drivers_loading",(GThreadFunc)(yon_proprietary_local_get),widgets);
|
|
|
|
g_thread_new("drivers_loading",(GThreadFunc)(yon_proprietary_local_get),widgets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_monitor_view_dictionary_destroy(void *window){
|
|
|
|
void yon_monitor_view_dictionary_destroy(void *window){
|
|
|
|
@ -1089,7 +1082,6 @@ void yon_monitor_set_resolutions(){
|
|
|
|
supported->size=0;
|
|
|
|
supported->size=0;
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(main_config.supported_resolutions,connected_ports[i],supported);
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(main_config.supported_resolutions,connected_ports[i],supported);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
config_str final=NULL;
|
|
|
|
|
|
|
|
for(int i=0;i<resolutions_size;i++){
|
|
|
|
for(int i=0;i<resolutions_size;i++){
|
|
|
|
int cur_pos=atoi(yon_char_divide_search(resolutions[i],":",-1));
|
|
|
|
int cur_pos=atoi(yon_char_divide_search(resolutions[i],":",-1));
|
|
|
|
dictionary *dct=NULL;
|
|
|
|
dictionary *dct=NULL;
|
|
|
|
@ -1223,7 +1215,7 @@ void yon_adapter_window_setup(main_window *widgets){
|
|
|
|
GtkIconTheme *icthm=gtk_icon_theme_get_default();
|
|
|
|
GtkIconTheme *icthm=gtk_icon_theme_get_default();
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->InformationCompanyLogoImage2),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, "com.ublinux.ubl-settings-video.nvidia-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL));
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->InformationCompanyLogoImage2),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, "com.ublinux.ubl-settings-video.nvidia-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strstr(vendor,"AMD"),strstr(vendor,"Advanced Micro Devices")){
|
|
|
|
else if (strstr(vendor,"AMD")&&strstr(vendor,"Advanced Micro Devices")){
|
|
|
|
GtkIconTheme *icthm=gtk_icon_theme_get_default();
|
|
|
|
GtkIconTheme *icthm=gtk_icon_theme_get_default();
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->InformationCompanyLogoImage2),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, "com.ublinux.ubl-settings-video.amd-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL));
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->InformationCompanyLogoImage2),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, "com.ublinux.ubl-settings-video.amd-logo",64,1,GTK_ICON_LOOKUP_FORCE_SVG),NULL));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1245,7 +1237,7 @@ void yon_set_sensitive_from_combo_box(GtkComboBox *toggle, GtkWidget *target){
|
|
|
|
gtk_widget_set_sensitive(target,active>1 ? 1 : 0);
|
|
|
|
gtk_widget_set_sensitive(target,active>1 ? 1 : 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_database_update(void *self,void *widgets){
|
|
|
|
void on_database_update(void *,void *widgets){
|
|
|
|
yon_terminal_window_launch(GTK_WINDOW(((main_window*)widgets)->Window),install_proprietary_command(""));
|
|
|
|
yon_terminal_window_launch(GTK_WINDOW(((main_window*)widgets)->Window),install_proprietary_command(""));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1287,6 +1279,7 @@ template_main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
widgets->LoadDriversButton = yon_gtk_builder_get_widget(builder,"LoadDriversButton");
|
|
|
|
widgets->LoadDriversButton = yon_gtk_builder_get_widget(builder,"LoadDriversButton");
|
|
|
|
|
|
|
|
|
|
|
|
widgets->DriversTree = yon_gtk_builder_get_widget(builder,"DriversTree");
|
|
|
|
widgets->DriversTree = yon_gtk_builder_get_widget(builder,"DriversTree");
|
|
|
|
|
|
|
|
widgets->TopTree = yon_gtk_builder_get_widget(builder,"TopTree");
|
|
|
|
widgets->KernelsCombo = yon_gtk_builder_get_widget(builder,"KernelsCombo");
|
|
|
|
widgets->KernelsCombo = yon_gtk_builder_get_widget(builder,"KernelsCombo");
|
|
|
|
|
|
|
|
|
|
|
|
widgets->DriverModulesTab = GTK_WIDGET(gtk_builder_get_object(builder, "DriverModulesTab"));
|
|
|
|
widgets->DriverModulesTab = GTK_WIDGET(gtk_builder_get_object(builder, "DriverModulesTab"));
|
|
|
|
@ -1326,8 +1319,14 @@ template_main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->OptirunCombo),"changed",G_CALLBACK(yon_set_sensitive_from_combo_box),widgets->OptirunEntry);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->OptirunCombo),"changed",G_CALLBACK(yon_set_sensitive_from_combo_box),widgets->OptirunEntry);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->PrimusrunCombo),"changed",G_CALLBACK(yon_set_sensitive_from_combo_box),widgets->PrimusrunEntry);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->PrimusrunCombo),"changed",G_CALLBACK(yon_set_sensitive_from_combo_box),widgets->PrimusrunEntry);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->KernelsCombo),"changed",G_CALLBACK(on_kernel_filter_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->KernelsCombo),"changed",G_CALLBACK(on_kernel_filter_changed),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// yon_gtk_tree_view_column_minimal_fixed_size_set(gtk_tree_view_get_column(GTK_TREE_VIEW(widgets->DriversTree),0));
|
|
|
|
|
|
|
|
// yon_gtk_tree_view_column_minimal_fixed_size_set(gtk_tree_view_get_column(GTK_TREE_VIEW(widgets->DriversTree),1));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// gtk_tree_view_column_set_fixed_width(gtk_tree_view_get_column(GTK_TREE_VIEW(widgets->TopTree),0),gtk_tree_view_column_get_fixed_width(gtk_tree_view_get_column(GTK_TREE_VIEW(widgets->DriversTree),0))+gtk_tree_view_column_get_fixed_width(gtk_tree_view_get_column(GTK_TREE_VIEW(widgets->DriversTree),1)));
|
|
|
|
// yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox);
|
|
|
|
// yon_monitor_view_setup(widgets->mainMonitorVisualConfigurationBox);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(widgets->AutoDriverCombo),yon_get_default_label_with_parameter(VGADRV_AUTO_command));
|
|
|
|
yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->DriversTree));
|
|
|
|
|
|
|
|
|
|
|
|
yon_adapter_window_setup(widgets);
|
|
|
|
yon_adapter_window_setup(widgets);
|
|
|
|
@ -1374,21 +1373,14 @@ int main(int argc, char *argv[]){
|
|
|
|
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
|
|
|
|
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
|
|
|
|
yon_window_config_load(path);
|
|
|
|
yon_window_config_load(path);
|
|
|
|
|
|
|
|
|
|
|
|
if (getuid()!=0){
|
|
|
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
|
|
|
|
yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (system(yon_check_database_command)){
|
|
|
|
if (system(yon_check_database_command)){
|
|
|
|
dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
|
|
|
|
dialog_confirmation_data *data = malloc(sizeof(dialog_confirmation_data));
|
|
|
|
data->action_text=DATABASE_UNACCESSIBLE_LABEL;
|
|
|
|
data->action_text=DATABASE_UNACCESSIBLE_LABEL;
|
|
|
|
data->function = on_database_update;
|
|
|
|
data->function = on_database_update;
|
|
|
|
data->data = widgets;
|
|
|
|
data->data = widgets;
|
|
|
|
yon_confirmation_dialog_call(widgets->HeadOverlay,data);
|
|
|
|
yon_confirmation_dialog_call(widgets->HeadOverlay,data);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_proprietary_get_thread(NULL,(main_window*)widgets);
|
|
|
|
yon_proprietary_get_thread(NULL,(main_window*)widgets);
|
|
|
|
// on_config_fill_interface(&widgets);
|
|
|
|
|
|
|
|
yon_monitor_set_resolutions();
|
|
|
|
yon_monitor_set_resolutions();
|
|
|
|
gtk_main();
|
|
|
|
gtk_main();
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|