Added log view window

pull/14/head
parent 1e183a3ee2
commit bcba8c4da4

@ -6,6 +6,7 @@
<file>ubinstall-gtk-keyboard.glade</file>
<file>ubinstall-gtk-about.glade</file>
<file>ubinstall-gtk-documentation.glade</file>
<file>ubinstall-gtk-log-view.glade</file>
</gresource>
<gresource prefix="/com/ublinux/css">
<file>ubinstall-gtk.css</file>

@ -63,6 +63,7 @@ set(DEPENDFILES
../ubinstall-gtk-keyboard.glade
../ubinstall-gtk-about.glade
../ubinstall-gtk-documentation.glade
../ubinstall-gtk-log-view.glade
../gresource.xml
../ubinstall-gtk.css
../modules.csv

@ -516,6 +516,56 @@ void *on_setup_system_configuration(void * data){
return NULL;
}
void on_log_closed(GtkWidget *, log_window *window);
void on_log_closed(GtkWidget *, log_window *window){
free(window->command);
window->Window=NULL;
}
log_window *yon_log_window_new();
log_window *yon_log_window_new(){
log_window *window = malloc(sizeof(log_window));
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_log_view);
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
window->HeadLabel = yon_gtk_builder_get_widget(builder,"headerTopic");
window->LogLabel = yon_gtk_builder_get_widget(builder,"LogLabel");
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(on_log_closed),window);
return window;
}
gboolean yon_read_log(void *data);
gboolean yon_read_log(void *data){
log_window *window = (log_window*)data;
if (window->Window){
int size;
config_str parsed = yon_config_load(window->command,&size);
if (size){
char *final = yon_char_parsed_to_string(parsed,size,"");
gtk_label_set_text(GTK_LABEL(window->LogLabel),final);
free(final);
yon_char_parsed_free(parsed,size);
}
return 1;
}
return 0;
}
void on_process_log_view();
void on_process_log_view(){
log_window *window = yon_log_window_new();
window->command = yon_char_new(short_log_path);
gdk_threads_add_timeout(500,(GSourceFunc)yon_read_log,window);
}
void on_summary_log_view();
void on_summary_log_view(){
log_window *window = yon_log_window_new();
window->command = yon_char_new(full_log_path);
gdk_threads_add_timeout(500,(GSourceFunc)yon_read_log,window);
}
void yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char *mode,main_window *widgets);
void yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char *mode,main_window *widgets){
GtkTreeIter iter,itar;
@ -1278,8 +1328,10 @@ main_window *yon_main_window_complete(){
widgets->InstallationProgress = yon_gtk_builder_get_widget(builder,"InstallationProgress");
widgets->InstallationLabel = yon_gtk_builder_get_widget(builder,"InstallationLabel");
widgets->ReadShortLogButton = yon_gtk_builder_get_widget(builder,"ReadShortLogButton");
widgets->PackageInstallationProgress = yon_gtk_builder_get_widget(builder,"PackageInstallationProgress");
widgets->PackageInstallationLabel = yon_gtk_builder_get_widget(builder,"PackageInstallationLabel");
widgets->ReadFullLogButton = yon_gtk_builder_get_widget(builder,"ReadFullLogButton");
widgets->SameInstallationFilesystemTypeCombo = yon_gtk_builder_get_widget(builder,"SameInstallationFilesystemTypeCombo");
widgets->SameInstallationFormatCheck = yon_gtk_builder_get_widget(builder,"SameInstallationFormatCheck");
@ -1335,6 +1387,9 @@ main_window *yon_main_window_complete(){
widgets->AdditionalSoftwareList = GTK_LIST_STORE(gtk_builder_get_object(builder,"AdditionalSoftwareList"));
widgets->PartitionsList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PartitionsList"));
g_signal_connect(G_OBJECT(widgets->ReadFullLogButton),"clicked",G_CALLBACK(on_summary_log_view),NULL);
g_signal_connect(G_OBJECT(widgets->ReadShortLogButton),"clicked",G_CALLBACK(on_process_log_view),NULL);
g_signal_connect(G_OBJECT(widgets->GpartedCommonButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->GpartedSameButton),"clicked",G_CALLBACK(on_gparted_open),NULL);
g_signal_connect(G_OBJECT(widgets->GpartedNearButton),"clicked",G_CALLBACK(on_gparted_open),NULL);

@ -23,6 +23,7 @@
#define glade_path "/com/ublinux/ui/ubinstall-gtk.glade"
#define glade_path_ubinstall_keyboard "/com/ublinux/ui/ubinstall-gtk-keyboard.glade"
#define glade_path_ubinstall_language "/com/ublinux/ui/ubinstall-gtk-language.glade"
#define glade_path_log_view "/com/ublinux/ui/ubinstall-gtk-log-view.glade"
#define ui_glade_path_about "/com/ublinux/ui/ubinstall-gtk-about.glade"
#define ui_glade_path_documentation "/com/ublinux/ui/ubinstall-gtk-documentation.glade"
@ -130,6 +131,10 @@ NULL
#define password_limits_path "/etc/security/pwquiality.conf"
#define short_log_path "/var/log/ubinstall_progress.log"
#define full_log_path "/var/log/ubinstall.log"
typedef char* string;
string version_application;
@ -271,8 +276,10 @@ typedef struct {
GtkWidget *InstallationProgress;
GtkWidget *InstallationLabel;
GtkWidget *ReadShortLogButton;
GtkWidget *PackageInstallationProgress;
GtkWidget *PackageInstallationLabel;
GtkWidget *ReadFullLogButton;
GtkWidget *GpartedCommonButton;
GtkWidget *GpartedNearButton;
@ -370,6 +377,14 @@ typedef struct{
GtkWidget *NoEncriptionCheck;
} password_window;
typedef struct {
GtkWidget *Window;
GtkWidget *StatusBox;
GtkWidget *HeadLabel;
GtkWidget *LogLabel;
char *command;
} log_window;
void config_init();
main_window *yon_main_window_complete();
ubinstall_language_window *yon_ubinstall_language_new();

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface domain="ubinstall-gtk">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubinstall-gtk.css -->
<object class="GtkWindow" id="MainWindow">
<property name="width-request">200</property>
<property name="height-request">400</property>
<property name="can-focus">False</property>
<property name="modal">True</property>
<property name="default-width">800</property>
<property name="icon-name">com.ublinux.ubinstall-gtk</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox" id="StatusBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="LogLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkLabel" id="headerTopic">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Keyboard layout language</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
<object class="GtkImage" id="HeadImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">com.ublinux.ubinstall-gtk</property>
</object>
</child>
<style>
<class name="toolbar"/>
</style>
</object>
</child>
</object>
</interface>

@ -107,6 +107,16 @@
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.trash-symbolic</property>
</object>
<object class="GtkImage" id="image15">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubinstall.properties-symbolic</property>
</object>
<object class="GtkImage" id="image16">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">com.ublinux.ubinstall.properties-symbolic</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can-focus">False</property>
@ -6844,10 +6854,14 @@ separately into the selected partition.</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">button</property>
<object class="GtkButton" id="ReadShortLogButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image16</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>
@ -6903,10 +6917,14 @@ separately into the selected partition.</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">button</property>
<object class="GtkButton" id="ReadFullLogButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image15</property>
<style>
<class name="thin"/>
</style>
</object>
<packing>
<property name="expand">False</property>

Loading…
Cancel
Save