Added rotation as user enabling check box

pull/138/head
Ivan Yartsev 4 months ago
parent 67b3b93bc9
commit 31c8e753a5

@ -1104,12 +1104,14 @@ void on_logrotate_save(GtkWidget *, dictionary *dict){
} }
} }
char *user_rotate = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->RotationAtUserCombo)); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->RotationCheck))){
char *group_rotate = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->RotationAtGroupCombo)); char *user_rotate = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->RotationAtUserCombo));
if (!yon_char_is_empty(user_rotate)&&!yon_char_is_empty(group_rotate)){ char *group_rotate = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->RotationAtGroupCombo));
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationAtUserCombo))==0) user_rotate = "root"; if (!yon_char_is_empty(user_rotate)&&!yon_char_is_empty(group_rotate)){
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationAtGroupCombo))==0) group_rotate = "root"; if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationAtUserCombo))==0) user_rotate = "root";
su = yon_char_unite("su ",user_rotate," ",group_rotate,NULL); if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->RotationAtGroupCombo))==0) group_rotate = "root";
su = yon_char_unite("su ",user_rotate," ",group_rotate,NULL);
}
} }
int error_processing = gtk_combo_box_get_active(GTK_COMBO_BOX(window->ErrorProcessingCombo)); int error_processing = gtk_combo_box_get_active(GTK_COMBO_BOX(window->ErrorProcessingCombo));
@ -1387,6 +1389,7 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
window->FileAmountCombo=yon_gtk_builder_get_widget(builder,"FileAmountCombo"); window->FileAmountCombo=yon_gtk_builder_get_widget(builder,"FileAmountCombo");
window->FileAmountEntry=yon_gtk_builder_get_widget(builder,"FileAmountEntry"); window->FileAmountEntry=yon_gtk_builder_get_widget(builder,"FileAmountEntry");
window->FileAmountButton=yon_gtk_builder_get_widget(builder,"FileAmountButton"); window->FileAmountButton=yon_gtk_builder_get_widget(builder,"FileAmountButton");
window->RotationCheck=yon_gtk_builder_get_widget(builder,"RotationCheck");
window->RotationAtUserCombo=yon_gtk_builder_get_widget(builder,"RotationAtUserCombo"); window->RotationAtUserCombo=yon_gtk_builder_get_widget(builder,"RotationAtUserCombo");
window->RotationAtGroupCombo=yon_gtk_builder_get_widget(builder,"RotationAtGroupCombo"); window->RotationAtGroupCombo=yon_gtk_builder_get_widget(builder,"RotationAtGroupCombo");
window->ErrorProcessingCombo=yon_gtk_builder_get_widget(builder,"ErrorProcessingCombo"); window->ErrorProcessingCombo=yon_gtk_builder_get_widget(builder,"ErrorProcessingCombo");
@ -1496,6 +1499,8 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeSpin); g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeSpin);
g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeCombo); g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeCombo);
g_signal_connect(G_OBJECT(window->RotationCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationAtUserCombo);
g_signal_connect(G_OBJECT(window->RotationCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationAtGroupCombo);
g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogUserCombo); g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogUserCombo);
g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateGroupCombo); g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateGroupCombo);

@ -316,6 +316,7 @@ typedef struct {
GtkWidget *FileAmountCombo; GtkWidget *FileAmountCombo;
GtkWidget *FileAmountEntry; GtkWidget *FileAmountEntry;
GtkWidget *FileAmountButton; GtkWidget *FileAmountButton;
GtkWidget *RotationCheck;
GtkWidget *RotationAtUserCombo; GtkWidget *RotationAtUserCombo;
GtkWidget *RotationAtGroupCombo; GtkWidget *RotationAtGroupCombo;
GtkWidget *ErrorProcessingCombo; GtkWidget *ErrorProcessingCombo;

@ -668,10 +668,12 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkCheckButton" id="RotationCheck">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Rotation as user:</property> <property name="label" translatable="yes">Rotation as user:</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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

Loading…
Cancel
Save