|
|
|
@ -341,26 +341,26 @@ logrotate_configure_window *yon_logrotate_window_new(){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogPathEditButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_edit),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogPathRemoveButton),"clicked",G_CALLBACK(on_logrotate_configuration_path_remove),window);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationPeriodAdditionalCombo);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationPeriodMainCombo);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationPeriodAdditionalCombo);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotationPeriodCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationPeriodMainCombo);
|
|
|
|
|
|
|
|
|
|
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->FileAmountCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountCombo);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->FileAmountCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->FileAmountButton);
|
|
|
|
|
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(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),"clicked",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),"clicked",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);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotateSizeMaxAfterTimeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxAfterTimeSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotateSizeMaxAfterTimeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxAfterTimeCombo);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotateSizeMaxAfterTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxAfterTimeSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotateSizeMaxAfterTimeCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxAfterTimeCombo);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"clicked",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotateSizeMaxBeforeTimeSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotateSizeMaxBeforeTimeCheck),"clicked",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->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->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(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->CreateGroupCombo);
|
|
|
|
@ -377,11 +377,26 @@ void on_logrotate_add(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
void on_logrotate_edit(GtkWidget *self, logrotate_tab_window *window){
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(main_config.logrotate_list);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeIter iter,itar;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->MainTree)),&model, &iter)){
|
|
|
|
|
char *name;
|
|
|
|
|
char *paths;
|
|
|
|
|
logrotate_configure_window *dialog = yon_logrotate_window_new();
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(dialog->MainWindow);
|
|
|
|
|
gtk_widget_show(dialog->MainWindow);
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&name,1,&paths,-1);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(dialog->LogNameEntry),name);
|
|
|
|
|
gtk_widget_set_can_focus(dialog->LogNameEntry,0);
|
|
|
|
|
gtk_widget_set_can_focus(dialog->LogDescriptionEntry,0);
|
|
|
|
|
gtk_entry_set_has_frame(GTK_ENTRY(dialog->LogNameEntry),0);
|
|
|
|
|
gtk_entry_set_has_frame(GTK_ENTRY(dialog->LogDescriptionEntry),0);
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(dialog->LogNameEntry),"nobackground");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(dialog->LogDescriptionEntry),"nobackground");
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str path_parsed = yon_char_parse(paths,&size,"\n");
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
gtk_list_store_append(dialog->list,&itar);
|
|
|
|
|
gtk_list_store_set(dialog->list,&itar,0,path_parsed[i],-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -394,8 +409,16 @@ void on_logrotate_remove(GtkWidget *self, logrotate_tab_window *window){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_logrotate_apps_configure(){
|
|
|
|
|
|
|
|
|
|
void on_logrotate_apps_configure(GtkWidget *self, logrotate_window *window){
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(main_config.logrotate_apps_list);
|
|
|
|
|
GtkTreeIter iter,itar;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->AppsMainTree)),&model,&iter)){
|
|
|
|
|
char *paths;
|
|
|
|
|
char *name;
|
|
|
|
|
gtk_list_store_append(main_config.logrotate_list,&itar);
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&name,1,&paths,-1);
|
|
|
|
|
gtk_list_store_set(main_config.logrotate_list,&itar,0,name,1,paths,-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_log_edit_logrotate_settings(GtkWidget *self, dictionary *dict){
|
|
|
|
@ -452,7 +475,7 @@ void on_logrotate_tab_open(GtkWidget *self, main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_logrotate_add),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RemoveButton),"clicked",G_CALLBACK(on_logrotate_remove),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ConfigureButton),"clicked",G_CALLBACK(on_logrotate_edit),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AppsConfigureButton),"clicked",G_CALLBACK(on_logrotate_apps_configure),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AppsConfigureButton),"clicked",G_CALLBACK(on_logrotate_apps_configure),window);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -500,6 +523,24 @@ void on_journald_open(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_close_subwindow),NULL);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogIntervalCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogIntervalSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogIntervalCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogIntervalAmountCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogIntervalAmountCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogIntervalAmountSpin);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogSizeMaxCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogSizeMaxSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogSizeMaxCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogSizeMaxCombo);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotationSizeMaxCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationSizeMaxSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RotationSizeMaxCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->RotationSizeMaxCombo);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogFreeSpaceCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogFreeSpaceSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogFreeSpaceCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogFreeSpaceCombo);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RedirectCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->RedirectTTYEntry);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogCompressionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogCompressionEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->LogCompressionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->LogCompressionSizeCombo);
|
|
|
|
|
gtk_widget_show(window->MainWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|