|
|
|
@ -339,6 +339,7 @@ void on_quotas_save(GtkWidget *self, dictionary *windows){
|
|
|
|
|
gtk_list_store_set(main_config.list,&iter,0,type,1,target,2,soft,3,hard,4,paging,5,cpu,6,read_limit,7,write_limit,8,string,-1);
|
|
|
|
|
yon_config_register(CGROUP_QUOTA((char*)target),yon_char_new((char*)string));
|
|
|
|
|
on_close_subwindow(self);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int yon_get_size_request_from_letter(char size){
|
|
|
|
@ -416,40 +417,41 @@ void yon_load_proceed(char *command){
|
|
|
|
|
gtk_list_store_append(main_config.list,&iter);
|
|
|
|
|
gtk_list_store_set(main_config.list,&iter,0,type,1,name,2,high,3,max,4,swap,5,cpu,6,read,7,write,8,quota,-1);
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
} else
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_load_global(){
|
|
|
|
|
yon_load_proceed(load_global_command);
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_load_local(){
|
|
|
|
|
yon_load_proceed(load_local_command);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_save_proceed(char *path, char *section){
|
|
|
|
|
if (yon_config_save_registered(path,section))
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
else
|
|
|
|
|
yon_ubl_status_box_render(LOAD_FAILED_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_save(){
|
|
|
|
|
yon_save_proceed(NULL,"security");
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_save_global(){
|
|
|
|
|
yon_save_proceed("global","security");
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_save_local(){
|
|
|
|
|
yon_save_proceed("system","security");
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -661,7 +663,9 @@ void on_information(GtkWidget *self, main_window *widgets){
|
|
|
|
|
main_config.last_info = yon_char_new((char*)name);
|
|
|
|
|
yon_terminal_integrated_start(widgets->InformationTerminal, command, NULL, NULL);
|
|
|
|
|
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->MainNotebook),3);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_render(NOTHING_CHOSEN_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_information_update(GtkWidget *self, main_window *widgets){
|
|
|
|
@ -677,7 +681,9 @@ void on_remove(GtkWidget *self, main_window *widgets){
|
|
|
|
|
gtk_tree_model_get(model,&iter,1,&name,-1);
|
|
|
|
|
yon_config_set(CGROUP_QUOTA(name),"");
|
|
|
|
|
gtk_list_store_remove(main_config.list,&iter);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_render(NOTHING_CHOSEN_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -715,7 +721,9 @@ void on_quotas_edit(GtkWidget *self, dictionary *windows){
|
|
|
|
|
gtk_list_store_set(main_config.list,&iter,1,target,2,soft,3,hard,4,paging,5,cpu,6,read_limit,7,write_limit,8,string,-1);
|
|
|
|
|
yon_config_set(CGROUP_QUOTA(target),(void*)yon_char_new((char*)string));
|
|
|
|
|
on_close_subwindow(self);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_render(NOTHING_CHOSEN_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_edit_open(GtkWidget *self, main_window *widgets){
|
|
|
|
@ -969,6 +977,7 @@ void on_dispatcher_update(GtkWidget *self,main_window *widgets){
|
|
|
|
|
g_object_set_property(G_OBJECT(widgets->DispatcherUpdateSpin),"has-focus",val);
|
|
|
|
|
g_free(val);
|
|
|
|
|
}
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_processes_update(GtkWidget *self,main_window *widgets){
|
|
|
|
@ -978,6 +987,7 @@ void on_processes_update(GtkWidget *self,main_window *widgets){
|
|
|
|
|
if (show_all) yon_char_append(command, " -k");
|
|
|
|
|
if (show_core) yon_char_append(command, " -l");
|
|
|
|
|
yon_terminal_integrated_start(widgets->ProcessesTerminal, command, NULL, NULL);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_tab_changed(GtkWidget *self, GtkWidget *page, int page_num, main_window *widgets){
|
|
|
|
@ -1229,7 +1239,7 @@ int main(int argc, char *argv[]){
|
|
|
|
|
if (getuid()!=0)
|
|
|
|
|
yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
else
|
|
|
|
|
yon_ubl_status_box_render(TITLE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
yon_ubl_setup_sockets(widgets->PlugBox,widgets->LeftBox,widgets->RightBox,main_config.socket_id,main_config.load_socket_id,main_config.save_socket_id);
|
|
|
|
|
yon_window_config_setup(GTK_WINDOW(widgets->Window));
|
|
|
|
|
yon_window_config_load(config_path);
|
|
|
|
|