|
|
|
@ -377,6 +377,35 @@ void on_logrotate_configuration_path_remove(GtkWidget *self, logrotate_configure
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_combo_activate_first(GtkComboBox *self, GtkWidget *target){
|
|
|
|
|
|
|
|
if (gtk_combo_box_get_active(self)==1) gtk_widget_set_sensitive(target,1);
|
|
|
|
|
|
|
|
else gtk_widget_set_sensitive(target,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_combo_activate_second(GtkComboBox *self, GtkWidget *target){
|
|
|
|
|
|
|
|
if (gtk_combo_box_get_active(self)==2) gtk_widget_set_sensitive(target,1);
|
|
|
|
|
|
|
|
else gtk_widget_set_sensitive(target,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_file_amount_checked(GtkToggleButton *self, logrotate_configure_window *window){
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active(self)==1){
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountCombo,1);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountSpin,1);
|
|
|
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->FileAmountCombo))==2){
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountButton,1);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountEntry,1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountButton,0);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountEntry,0);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountSpin,0);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(window->FileAmountCombo,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_logrotate_save(GtkWidget *self, dictionary *dict){
|
|
|
|
void on_logrotate_save(GtkWidget *self, dictionary *dict){
|
|
|
|
logrotate_window *dialog = yon_dictionary_get_data(dict->first,logrotate_window*);
|
|
|
|
logrotate_window *dialog = yon_dictionary_get_data(dict->first,logrotate_window*);
|
|
|
|
logrotate_configure_window *window = yon_dictionary_get_data(dict->first->next,logrotate_configure_window*);
|
|
|
|
logrotate_configure_window *window = yon_dictionary_get_data(dict->first->next,logrotate_configure_window*);
|
|
|
|
@ -578,8 +607,8 @@ void on_logrotate_save(GtkWidget *self, dictionary *dict){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *commandline = yon_char_unite(period,yon_add_space_if_exists(size),yon_add_space_if_exists(rotate_count),yon_add_space_if_exists(olddir),yon_add_space_if_exists(su),yon_add_space_if_exists(missingok),yon_add_space_if_exists(ifempty),yon_add_space_if_exists(notifempty),yon_add_space_if_exists(minage),yon_add_space_if_exists(maxage),yon_add_space_if_exists(minsize),yon_add_space_if_exists(maxsize),yon_add_space_if_exists(create),yon_add_space_if_exists(copytruncate),yon_add_space_if_exists(compress),yon_add_space_if_exists(delaycompress),yon_add_space_if_exists(extension),yon_add_space_if_exists(dateext),yon_add_space_if_exists(start),yon_add_space_if_exists(mail),yon_add_space_if_exists(mailfirst),yon_add_space_if_exists(sharedscripts),yon_add_space_if_exists(firstaction),yon_add_space_if_exists(lastaction),yon_add_space_if_exists(prerotate),yon_add_space_if_exists(postrotate),yon_add_space_if_exists(preremove),yon_add_space_if_exists(endscript),NULL);
|
|
|
|
char *commandline = yon_char_unite(period,yon_add_space_if_exists(size),yon_add_space_if_exists(rotate_count),yon_add_space_if_exists(olddir),yon_add_space_if_exists(su),yon_add_space_if_exists(missingok),yon_add_space_if_exists(ifempty),yon_add_space_if_exists(notifempty),yon_add_space_if_exists(minage),yon_add_space_if_exists(maxage),yon_add_space_if_exists(minsize),yon_add_space_if_exists(maxsize),yon_add_space_if_exists(create),yon_add_space_if_exists(copytruncate),yon_add_space_if_exists(compress),yon_add_space_if_exists(delaycompress),yon_add_space_if_exists(extension),yon_add_space_if_exists(dateext),yon_add_space_if_exists(start),yon_add_space_if_exists(mail),yon_add_space_if_exists(mailfirst),yon_add_space_if_exists(sharedscripts),yon_add_space_if_exists(firstaction),yon_add_space_if_exists(lastaction),yon_add_space_if_exists(prerotate),yon_add_space_if_exists(postrotate),yon_add_space_if_exists(preremove),yon_add_space_if_exists(endscript),NULL);
|
|
|
|
if (commandline[0]==' '){
|
|
|
|
if (commandline[0]==','){
|
|
|
|
free(yon_char_divide_search(commandline," ",-1));
|
|
|
|
free(yon_char_divide_search(commandline,",",-1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!yon_char_is_empty(paths)){
|
|
|
|
if(!yon_char_is_empty(paths)){
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
@ -699,11 +728,8 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
g_signal_connect(G_OBJECT(window->JournalMaxSizeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->JournalMaxSizeCombo);
|
|
|
|
g_signal_connect(G_OBJECT(window->JournalMaxSizeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->JournalMaxSizeCombo);
|
|
|
|
g_signal_connect(G_OBJECT(window->JournalMaxSizeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->JournalMaxSizeSpin);
|
|
|
|
g_signal_connect(G_OBJECT(window->JournalMaxSizeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->JournalMaxSizeSpin);
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountSpin);
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(on_file_amount_checked),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountCombo);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountEntry);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountButton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->DoNotRotateYoungerCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->DoNotRotateYoungerSpin);
|
|
|
|
g_signal_connect(G_OBJECT(window->DoNotRotateYoungerCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->DoNotRotateYoungerSpin);
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->DeleteOlderCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->DeleteOlderSpin);
|
|
|
|
g_signal_connect(G_OBJECT(window->DeleteOlderCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->DeleteOlderSpin);
|
|
|
|
@ -714,11 +740,19 @@ 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->CreateLogCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),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(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateGroupCombo);
|
|
|
|
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(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateLogEntry);
|
|
|
|
g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogEntry);
|
|
|
|
g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateLogButton);
|
|
|
|
g_signal_connect(G_OBJECT(window->CreateLogCombo),"changed",G_CALLBACK(on_combo_activate_second),window->CreateLogButton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCombo),"changed",G_CALLBACK(on_combo_activate_second),window->FileAmountButton);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCombo),"changed",G_CALLBACK(on_combo_activate_second),window->FileAmountEntry);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CompressionCombo),"changed",G_CALLBACK(on_combo_activate_first),window->QueueCombo);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SaveOriginalCombo),"changed",G_CALLBACK(on_combo_activate_first),window->SaveOriginalEntry);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->OldNumberCombo),"changed",G_CALLBACK(on_combo_activate_first),window->OldNumberEntry);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->EmailCombo),"changed",G_CALLBACK(on_combo_activate_first),window->EmailEntry);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->EmailCombo),"changed",G_CALLBACK(on_combo_activate_first),window->EmailContentsCombo);
|
|
|
|
int usize=0;
|
|
|
|
int usize=0;
|
|
|
|
config_str users = yon_ubl_get_all_users(&usize);
|
|
|
|
config_str users = yon_ubl_get_all_users(&usize);
|
|
|
|
yon_gtk_combo_box_fill(window->CreateLogUserCombo,users,usize);
|
|
|
|
yon_gtk_combo_box_fill(window->CreateLogUserCombo,users,usize);
|
|
|
|
@ -751,22 +785,13 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),3);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),3);
|
|
|
|
}else if (!strcmp(parsed[i],"yearly")){
|
|
|
|
}else if (!strcmp(parsed[i],"yearly")){
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),4);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotationPeriodMainCombo),4);
|
|
|
|
}else if (!strcmp(parsed[i],"size")){
|
|
|
|
|
|
|
|
int sizemod = yon_size_get_int_from_letter(parsed[i][strlen(parsed[i])-1]);
|
|
|
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->JournalMaxSizeSpin),atol(parsed[i]));
|
|
|
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalMaxSizeCombo),sizemod);
|
|
|
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->JournalMaxSizeCheck),1);
|
|
|
|
|
|
|
|
}else if (!strcmp(parsed[i],"rotate")){
|
|
|
|
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->FileAmountSpin),atol(value));
|
|
|
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->FileAmountCheck),1);
|
|
|
|
|
|
|
|
}else if (!strcmp(parsed[i],"olddir")){
|
|
|
|
}else if (!strcmp(parsed[i],"olddir")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->FileAmountEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->FileAmountEntry),value);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),1);
|
|
|
|
}else if (!strcmp(parsed[i],"noolddir")){
|
|
|
|
}else if (!strcmp(parsed[i],"noolddir")){
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),2);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->FileAmountCombo),2);
|
|
|
|
}else if (!strcmp(parsed[i],"su")){
|
|
|
|
}else if (strstr(parsed[i],"su")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *nvalue = yon_char_divide_search(value," ",-1);
|
|
|
|
char *nvalue = yon_char_divide_search(value," ",-1);
|
|
|
|
int us = yon_gtk_combo_box_text_find(window->RotationAtUserCombo,nvalue);
|
|
|
|
int us = yon_gtk_combo_box_text_find(window->RotationAtUserCombo,nvalue);
|
|
|
|
@ -781,20 +806,20 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalEmptyCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalEmptyCombo),1);
|
|
|
|
}else if (!strcmp(parsed[i],"notifempty")){
|
|
|
|
}else if (!strcmp(parsed[i],"notifempty")){
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalEmptyCombo),2);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalEmptyCombo),2);
|
|
|
|
}else if (!strcmp(parsed[i],"minage")){
|
|
|
|
}else if (strstr(parsed[i],"minage")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->DoNotRotateYoungerSpin),atol(value));
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->DoNotRotateYoungerSpin),atol(value));
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DoNotRotateYoungerCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DoNotRotateYoungerCheck),1);
|
|
|
|
}else if (!strcmp(parsed[i],"maxage")){
|
|
|
|
}else if (strstr(parsed[i],"maxage")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->DeleteOlderSpin),atol(value));
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->DeleteOlderSpin),atol(value));
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DeleteOlderCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DeleteOlderCheck),1);
|
|
|
|
}else if (!strcmp(parsed[i],"minsize")){
|
|
|
|
}else if (strstr(parsed[i],"minsize")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxAfterTimeSpin),atol(value));
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxAfterTimeSpin),atol(value));
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxAfterTimeCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxAfterTimeCheck),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotateSizeMaxAfterTimeCombo),yon_size_get_int_from_letter(value[strlen(value)-1]));
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->RotateSizeMaxAfterTimeCombo),yon_size_get_int_from_letter(value[strlen(value)-1]));
|
|
|
|
}else if (!strcmp(parsed[i],"maxsize")){
|
|
|
|
}else if (strstr(parsed[i],"maxsize")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxBeforeTimeSpin),atol(value));
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->RotateSizeMaxBeforeTimeSpin),atol(value));
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxBeforeTimeCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->RotateSizeMaxBeforeTimeCheck),1);
|
|
|
|
@ -803,6 +828,11 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }else if (!strcmp(parsed[i],"nocreate")){
|
|
|
|
// }else if (!strcmp(parsed[i],"nocreate")){
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
}else if (strstr(parsed[i],"size")){
|
|
|
|
|
|
|
|
int sizemod = yon_size_get_int_from_letter(parsed[i][strlen(parsed[i])-1]);
|
|
|
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->JournalMaxSizeSpin),atol(parsed[i]));
|
|
|
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->JournalMaxSizeCombo),sizemod);
|
|
|
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->JournalMaxSizeCheck),1);
|
|
|
|
}else if (!strcmp(parsed[i],"copytruncate")){
|
|
|
|
}else if (!strcmp(parsed[i],"copytruncate")){
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->CutCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->CutCheck),1);
|
|
|
|
}else if (!strcmp(parsed[i],"compress")){
|
|
|
|
}else if (!strcmp(parsed[i],"compress")){
|
|
|
|
@ -814,17 +844,17 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
|
|
|
|
|
|
|
|
}else if (!strcmp(parsed[i],"nodelaycompress")){
|
|
|
|
}else if (!strcmp(parsed[i],"nodelaycompress")){
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->QueueCombo),2);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->QueueCombo),2);
|
|
|
|
}else if (!strcmp(parsed[i],"extension")){
|
|
|
|
}else if (strstr(parsed[i],"extension")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->SaveOriginalCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->SaveOriginalCombo),1);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->SaveOriginalEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->SaveOriginalEntry),value);
|
|
|
|
}else if (!strcmp(parsed[i],"dateext")){
|
|
|
|
}else if (!strcmp(parsed[i],"dateext")){
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->AddDateCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->AddDateCombo),1);
|
|
|
|
}else if (!strcmp(parsed[i],"start")){
|
|
|
|
}else if (strstr(parsed[i],"start")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->OldNumberCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->OldNumberCombo),1);
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->OldNumberEntry),atol(value));
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->OldNumberEntry),atol(value));
|
|
|
|
}else if (!strcmp(parsed[i],"mail")){
|
|
|
|
}else if (strstr(parsed[i],"mail")){
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->EmailEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->EmailEntry),value);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailCombo),1);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailCombo),1);
|
|
|
|
@ -836,19 +866,19 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailContentsCombo),2);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->EmailContentsCombo),2);
|
|
|
|
}else if (!strcmp(parsed[i],"sharedscripts")){
|
|
|
|
}else if (!strcmp(parsed[i],"sharedscripts")){
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->SharedScenariosCheck),1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->SharedScenariosCheck),1);
|
|
|
|
}else if (!strcmp(parsed[i],"firstaction")){
|
|
|
|
}else if (strstr(parsed[i],"firstaction")){
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeOnceEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeOnceEntry),value);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}else if (!strcmp(parsed[i],"lastaction")){
|
|
|
|
}else if (strstr(parsed[i],"lastaction")){
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandAfterOnceEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandAfterOnceEntry),value);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}else if (!strcmp(parsed[i],"prerotate")){
|
|
|
|
}else if (strstr(parsed[i],"prerotate")){
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeEntry),value);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}else if (!strcmp(parsed[i],"postrotate")){
|
|
|
|
}else if (strstr(parsed[i],"postrotate")){
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
char *value = parsed[i+1];
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandAfterEntry),value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CommandAfterEntry),value);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
@ -856,6 +886,10 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
|
|
|
|
// char *value = parsed[i+1];
|
|
|
|
// char *value = parsed[i+1];
|
|
|
|
// gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeOnceEntry),value);
|
|
|
|
// gtk_entry_set_text(GTK_ENTRY(window->CommandBeforeOnceEntry),value);
|
|
|
|
// i++;
|
|
|
|
// i++;
|
|
|
|
|
|
|
|
}else if (strstr(parsed[i],"rotate")){
|
|
|
|
|
|
|
|
char *value = strstr(parsed[i]," ")+1;
|
|
|
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->FileAmountSpin),atol(value));
|
|
|
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->FileAmountCheck),1);
|
|
|
|
}else if (!strcmp(parsed[i],"endscript")){
|
|
|
|
}else if (!strcmp(parsed[i],"endscript")){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|