|
|
|
@ -846,9 +846,14 @@ void on_remove(GtkWidget *, main_window *widgets){
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model,&iter)){
|
|
|
|
|
char *name;
|
|
|
|
|
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);
|
|
|
|
|
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
|
|
|
|
|
data->title = REMOVE_TITLE_LABEL;
|
|
|
|
|
data->action_text = REMOVE_VALIDATION_LABEL(name);
|
|
|
|
|
if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
|
|
|
|
|
yon_config_remove_by_key(CGROUP_QUOTA(name));
|
|
|
|
|
gtk_list_store_remove(main_config.list,&iter);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else yon_ubl_status_box_render(NOTHING_CHOSEN_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
|
|
|
|
@ -890,7 +895,7 @@ void on_quotas_edit(GtkWidget *self, dictionary *windows){
|
|
|
|
|
if (write_devices[strlen(write_devices)-1]=='\n') write_devices[strlen(write_devices)-1]='\0';
|
|
|
|
|
write_limit = yon_char_unite(write_limit,write_devices,NULL);
|
|
|
|
|
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));
|
|
|
|
|
yon_config_register(CGROUP_QUOTA(target),CGROUP_QUOTA_comd(target),(char*)string);
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
yon_ubl_status_box_render(SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
}
|
|
|
|
@ -972,7 +977,8 @@ void on_edit_open(GtkWidget *, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
window->devices = NULL;
|
|
|
|
|
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL);
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->Window),EDITING_LABEL);
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->TitleLabel),EDITING_LABEL);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(window->EditQuotaTargetBox);
|
|
|
|
|
gtk_widget_hide(window->AddQuotaTargetBox);
|
|
|
|
|