Исправил флаги

pull/24/head
Igor Belitskiy 2 years ago
parent 63f447a35d
commit 83daef8af1

@ -3,10 +3,10 @@ char* flag_filters_u_g_p = NULL;
filters_window *filters_widgets = NULL; filters_window *filters_widgets = NULL;
GtkTreeView* _tree_view = NULL; GtkTreeView* _tree_view = NULL;
const int len_user_group = 8; const int len_user_group = 8;
const int len_project = 9; const int len_project = 10;
gboolean flag_filters_user[8]; gboolean flag_filters_user[8];
gboolean flag_filters_group[8]; gboolean flag_filters_group[8];
gboolean flag_filters_project[9]; gboolean flag_filters_project[10];
filters_window *filters_setup_window(char* glade_path){ filters_window *filters_setup_window(char* glade_path){
if (filters_widgets == NULL) { if (filters_widgets == NULL) {
filters_widgets = malloc(sizeof(filters_window)); filters_widgets = malloc(sizeof(filters_window));
@ -26,16 +26,18 @@ filters_window *filters_setup_window(char* glade_path){
filters_widgets->chbFilterHardLimitFileDelay = yon_gtk_builder_get_widget(builder,"chbFilterHardLimitFileDelay"); filters_widgets->chbFilterHardLimitFileDelay = yon_gtk_builder_get_widget(builder,"chbFilterHardLimitFileDelay");
filters_widgets->chbProjectName = yon_gtk_builder_get_widget(builder,"chbProjectName"); filters_widgets->chbProjectName = yon_gtk_builder_get_widget(builder,"chbProjectName");
filters_widgets->chbFilterDevice = yon_gtk_builder_get_widget(builder,"chbFilterDevice"); filters_widgets->chbFilterDevice = yon_gtk_builder_get_widget(builder,"chbFilterDevice");
filters_widgets->chkFilterID = yon_gtk_builder_get_widget(builder,"chkFilterID");
filters_widgets->chbFilterCatalog = yon_gtk_builder_get_widget(builder,"chbFilterCatalog");
if (strcmp(flag_filters_u_g_p, "prjquota")==0) { if (strcmp(flag_filters_u_g_p, "prjquota")==0) {
gtk_button_set_label(GTK_BUTTON(filters_widgets->chbFilterName), _("ID")); gtk_widget_hide(filters_widgets->chbFilterName);
} }
else { else {
gtk_widget_hide(filters_widgets->chbProjectName); gtk_widget_hide(filters_widgets->chbProjectName);
gtk_widget_hide(filters_widgets->chkFilterID);
gtk_widget_hide(filters_widgets->chbFilterCatalog);
} }
filters_event(filters_widgets); filters_event(filters_widgets);
} }
filters_set_flag(); filters_set_flag();
return filters_widgets; return filters_widgets;
} }
@ -67,15 +69,16 @@ gboolean* filters_get_flag_group() {
gboolean* filters_get_flag_project() { gboolean* filters_get_flag_project() {
flag_filters_project[0] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterName)); flag_filters_project[0] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterDevice));
flag_filters_project[1] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterDevice)); flag_filters_project[1] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterCatalog));
flag_filters_project[2] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitSize)); flag_filters_project[2] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chkFilterID));
flag_filters_project[3] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSize)); flag_filters_project[3] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbProjectName));
flag_filters_project[4] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitFile)); flag_filters_project[4] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitSize));
flag_filters_project[5] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFile)); flag_filters_project[5] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSize));
flag_filters_project[6] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSizeDelay)); flag_filters_project[6] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitFile));
flag_filters_project[7] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFileDelay)); flag_filters_project[7] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFile));
flag_filters_project[8] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbProjectName)); flag_filters_project[8] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSizeDelay));
flag_filters_project[9] = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFileDelay));
return flag_filters_project; return flag_filters_project;
} }
@ -157,6 +160,7 @@ void filters_init_flag() {
flag_filters_project[i] = 1; flag_filters_project[i] = 1;
} }
flag_filters_project[8] = 1; flag_filters_project[8] = 1;
flag_filters_project[9] = 1;
} }
void filters_set_flag() { void filters_set_flag() {
@ -172,15 +176,26 @@ void filters_set_flag() {
array_flags = flag_filters_group; array_flags = flag_filters_group;
} }
} }
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterName),array_flags[0] ); if (strcmp(flag_filters_u_g_p,"prjquota")) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterDevice), array_flags[1]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterName),array_flags[0] );
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitSize), array_flags[2]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterDevice), array_flags[1]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSize), array_flags[3]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitSize), array_flags[2]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitFile), array_flags[4]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSize), array_flags[3]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFile), array_flags[5]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitFile), array_flags[4]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSizeDelay), array_flags[6]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFile), array_flags[5]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFileDelay), array_flags[7]); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSizeDelay), array_flags[6]);
if (strcmp(flag_filters_u_g_p,"prjquota")==0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFileDelay), array_flags[7]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbProjectName), array_flags[8]); }
else if (strcmp(flag_filters_u_g_p,"prjquota")==0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterDevice),array_flags[0] );
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterCatalog), array_flags[1]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chkFilterID), array_flags[2]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbProjectName), array_flags[3]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitSize), array_flags[4]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSize), array_flags[5]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterSoftLimitFile), array_flags[6]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFile), array_flags[7]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitSizeDelay), array_flags[8]);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filters_widgets->chbFilterHardLimitFileDelay), array_flags[9]);
} }
} }

@ -31,6 +31,8 @@ typedef struct {
GtkWidget* chbFilterHardLimitFileDelay; GtkWidget* chbFilterHardLimitFileDelay;
GtkWidget* chbProjectName; GtkWidget* chbProjectName;
GtkWidget* chbFilterDevice; GtkWidget* chbFilterDevice;
GtkWidget* chkFilterID;
GtkWidget* chbFilterCatalog;
char* name; char* name;
} filters_window; } filters_window;

@ -4936,13 +4936,68 @@ limit
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="chbFilterDevice"> <object class="GtkBox">
<property name="label" translatable="yes">Device</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">False</property>
<property name="receives-default">False</property> <property name="orientation">vertical</property>
<property name="xalign">0</property> <child>
<property name="draw-indicator">True</property> <object class="GtkCheckButton" id="chbFilterDevice">
<property name="label" translatable="yes">Device</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="xalign">0</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chbFilterCatalog">
<property name="label" translatable="yes">Catalog</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chkFilterID">
<property name="label" translatable="yes">ID</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="chbProjectName">
<property name="label" translatable="yes">Project Name</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="halign">start</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -4951,8 +5006,8 @@ limit
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="chbProjectName"> <object class="GtkCheckButton" id="chbFilterSoftLimitSize">
<property name="label" translatable="yes">Project Name</property> <property name="label" translatable="yes">Soft limit (volume)</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">False</property> <property name="receives-default">False</property>
@ -4966,8 +5021,8 @@ limit
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="chbFilterSoftLimitSize"> <object class="GtkCheckButton" id="chbFilterHardLimitSize">
<property name="label" translatable="yes">Soft limit (volume)</property> <property name="label" translatable="yes">Hard limit (volume)</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">False</property> <property name="receives-default">False</property>
@ -4977,7 +5032,7 @@ limit
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">4</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -5026,21 +5081,6 @@ limit
<property name="position">5</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="chbFilterHardLimitSize">
<property name="label" translatable="yes">Hard limit (volume)</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="halign">start</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child> <child>
<object class="GtkCheckButton" id="chbFilterSoftLimitFile"> <object class="GtkCheckButton" id="chbFilterSoftLimitFile">
<property name="label" translatable="yes">Postponing the hard limit (volume)</property> <property name="label" translatable="yes">Postponing the hard limit (volume)</property>

Loading…
Cancel
Save