Table changes WIP

pull/9/head
parent ae61d187e0
commit 7fc1797292

@ -92,7 +92,7 @@ GtkWidget *yon_tab_row_new(GtkListBox *target, char *target_string, main_window
config_str types_parsed = yon_char_parse(parsed[3],&types_size,", ");
for (int k=0;k<types_size;k++){
GtkWidget *cur_tag_label = gtk_label_new(types_parsed[k]);
gtk_box_pack_start(GTK_BOX(tags_box),cur_tag_label,0,0,5);
gtk_box_pack_start(GTK_BOX(tags_box),cur_tag_label,0,0,1);
gtk_widget_show(cur_tag_label);
char *passw = types_parsed[k][0]==' '?yon_char_divide(types_parsed[k],0):NULL;
if (passw) free(passw);
@ -158,31 +158,68 @@ void on_info_clicked(GtkWidget *, main_window *widgets){
yon_gtk_window_setup(GTK_WINDOW(window->window),GTK_WINDOW(widgets->Window),INFO_TITLE_LABEL,icon_path,"info_window");
GtkWidget *current_tree=NULL;
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
current_tree = widgets->KernelsTree;
current_tree = widgets->KernelsPackageBox;
} else {
current_tree = widgets->AdditionsTree;
current_tree = widgets->AdditionsPackageBox;
}
GtkTreeModel *model;
GtkTreeIter iter;
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(current_tree)),&model,&iter)){
char *target;
gtk_tree_model_get(model,&iter,4,&target,-1);
GtkListBoxRow *target = gtk_list_box_get_selected_row(GTK_LIST_BOX(current_tree));
if (target){
GList *list = gtk_container_get_children(GTK_CONTAINER(target));
GList *list2 = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,0)));
GList *list3 = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list2,1)));
char * target_str = yon_char_new((char*)gtk_label_get_text(GTK_LABEL(g_list_nth_data(list3,0))));
int size;
config_str ret = yon_config_load(yon_get_info_command(target),&size);
if (size){
char *final_text = yon_char_parsed_to_string(ret,size,"");
char *parameter = yon_char_divide_search(target_str,"\n",-1);
free(parameter);
parameter = yon_char_replace(target_str,"\n",",");
int sz;
config_str parsed = yon_char_parse(parameter,&sz,",");
free(parameter);
parameter = yon_char_parsed_to_string(parsed,sz," ");
config_str info = yon_config_load(get_package_info_command(parameter),&size);
if (size!=-1){
char *final_text = yon_char_parsed_to_string(info,size,"");
gtk_label_set_text(GTK_LABEL(window->InfoLabel),final_text);
free(final_text);
yon_char_parsed_free(ret,size);
yon_char_parsed_free(info,size);
} else {
gtk_label_set_text(GTK_LABEL(window->InfoLabel),PACKAGE_NOT_FOUND_LABEL);
}
}
gtk_widget_show(window->window);
}
void on_changelog_clicked(GtkWidget *, main_window *widgets){
if (widgets){};
info_window *window = yon_info_window_new();
yon_gtk_window_setup(GTK_WINDOW(window->window),GTK_WINDOW(widgets->Window),INFO_TITLE_LABEL,icon_path,"changelog_window");
GtkWidget *current_tree=NULL;
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))==0){
current_tree = widgets->KernelsPackageBox;
} else {
current_tree = widgets->AdditionsPackageBox;
}
GtkListBoxRow *target = gtk_list_box_get_selected_row(GTK_LIST_BOX(current_tree));
if (target){
GList *list = gtk_container_get_children(GTK_CONTAINER(target));
GList *list2 = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,0)));
GList *list3 = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list2,1)));
char * target_str = yon_char_new((char*)gtk_label_get_text(GTK_LABEL(g_list_nth_data(list3,0))));
int size;
char *parameter = yon_char_divide_search(target_str,"\n",-1);
free(parameter);
parameter = yon_char_replace(target_str,"\n",",");
int sz;
config_str parsed = yon_char_parse(parameter,&sz,",");
config_str info = yon_config_load(yon_debug_output("%s\n",get_kernel_changelog_command(parsed[0])),&size);
if (size!=-1){
char *final_text = yon_char_parsed_to_string(info,size,"");
gtk_label_set_text(GTK_LABEL(window->InfoLabel),final_text);
free(final_text);
yon_char_parsed_free(info,size);
} else {
gtk_label_set_text(GTK_LABEL(window->InfoLabel),PACKAGE_NOT_FOUND_LABEL);
}
}
gtk_widget_show(window->window);
}
@ -246,9 +283,9 @@ void yon_main_window_complete(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->InfoButton),"clicked",G_CALLBACK(on_info_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->LogButton),"clicked",G_CALLBACK(on_changelog_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_building_clicked),widgets);
g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_install_module_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_install_package_toggled),widgets);
g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_boot_toggled),widgets);
// g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_install_module_toggled),widgets);
// g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_install_package_toggled),widgets);
// g_signal_connect(G_OBJECT(widgets->BuildingButton),"clicked",G_CALLBACK(on_boot_toggled),widgets);
GtkWidget *radio_group=NULL;
int kernels_size;
@ -256,9 +293,12 @@ void yon_main_window_complete(main_window *widgets){
for (int i=1;i<kernels_size;i++){
GtkWidget *current = yon_tab_row_new(GTK_LIST_BOX(widgets->KernelsPackageBox),kernels[i],widgets);
GList *list = gtk_container_get_children(GTK_CONTAINER(current));
GtkWidget *radio = GTK_WIDGET(g_list_nth_data(list,5));
GList *list2 = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(list,5)));
GtkWidget *radio = GTK_WIDGET(g_list_nth_data(list2,0));
if (radio_group) gtk_radio_button_join_group(GTK_RADIO_BUTTON(radio),GTK_RADIO_BUTTON(radio_group));
radio_group = radio;
g_list_free(list);
g_list_free(list2);
}
}
}

@ -35,6 +35,9 @@
#define icon_path "com.ublinux.ubl-settings-kernel"
#define get_kernel_changelog_command(target) yon_char_unite("find /usr/lib/modules/ -maxdepth 2 -type f -iname \"pkgbase\" -exec grep -il \"",target,"\" {} + | xargs dirname | xargs -I {} cat \"{}/changelog\"", NULL)
#define get_package_info_command(target) yon_char_append("pacman -Q --info ",target)
#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get system PARAMETERS",NULL)
#define config_get_local_command "ubconfig --source system get system PARAMETERS"
#define config_get_global_command "ubconfig --source global get system PARAMETERS"
@ -43,8 +46,6 @@
#define config_get_global_only_parameters ""
#define config_get_local_only_parameters ""
#define yon_get_info_command(target) yon_char_append("pacman ",target)
typedef char* string;
string version_application;

@ -3,3 +3,6 @@
#define TITLE_INFO_LABEL _("kernel configuration")
#define INFO_TITLE_LABEL _("Information")
#define PACKAGE_NOT_FOUND_LABEL _("Packages were not found")
#define CHANGELOG_NOT_FOUND_LABEL _("Changelog was not found")

@ -18,33 +18,30 @@
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkAlignment">
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="top-padding">5</property>
<property name="bottom-padding">5</property>
<property name="left-padding">5</property>
<property name="right-padding">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">4</property>
<child>
<object class="GtkLabel" id="InfoLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
</child>
</object>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>

@ -6,144 +6,172 @@
<object class="GtkBox" id="TableRowLabel">
<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="IconPackBox">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<property name="spacing">15</property>
<child>
<placeholder/>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="NameLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">
</property>
<property name="use-markup">True</property>
<property name="track-visited-links">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="tableborderright"/>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="NameLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="use-markup">True</property>
<property name="track-visited-links">False</property>
<style>
<class name="tableborderright"/>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="TagsBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
<object class="GtkBox" id="TagsBox">
<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">2</property>
</packing>
</child>
<style>
<class name="tableborderright"/>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ModuleCheck">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
<child>
<placeholder/>
<object class="GtkBox">
<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">3</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Install</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkMenuButton">
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Remove</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Changelog</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">6</property>
</packing>
</child>
<style>
<class name="tableborderright"/>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="PackageCheck">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Expand</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<style>
<class name="tableborderright"/>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="LoadedRadio">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
<child>
<placeholder/>
</child>
<style>
<class name="tableborderright"/>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="DescriptionLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
<property name="use-markup">True</property>
<property name="wrap">True</property>
<style>
<class name="tableborderbottom"/>
<class name="tablemargin"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">6</property>
<property name="position">1</property>
</packing>
</child>
</object>

@ -16,29 +16,6 @@
<!-- column-name gchararray3 -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">feasf</col>
<col id="1" translatable="yes">feasfge</col>
<col id="2">False</col>
<col id="3">False</col>
<col id="4" translatable="yes"/>
</row>
<row>
<col id="0" translatable="yes"/>
<col id="1" translatable="yes">grdtbrftgbh</col>
<col id="2">False</col>
<col id="3">False</col>
<col id="4" translatable="yes"/>
</row>
<row>
<col id="0" translatable="yes"/>
<col id="1" translatable="yes"/>
<col id="2">False</col>
<col id="3">False</col>
<col id="4" translatable="yes"/>
</row>
</data>
</object>
<object class="GtkListStore" id="KernelsList">
<columns>
@ -119,6 +96,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Open package information</property>
<property name="image">image2</property>
<style>
<class name="thin"/>
@ -135,6 +113,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Open changelog</property>
<property name="image">image3</property>
<style>
<class name="thin"/>
@ -151,6 +130,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Initramfs building</property>
<property name="image">image4</property>
<style>
<class name="thin"/>
@ -186,7 +166,6 @@
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="label7">
@ -370,6 +349,7 @@
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-end">5</property>
<child>
<object class="GtkListBox" id="KernelsPackageBox">
<property name="visible">True</property>
@ -413,6 +393,7 @@
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-end">5</property>
<child>
<object class="GtkListBox" id="AdditionsPackageBox">
<property name="visible">True</property>
@ -487,6 +468,4 @@
<widget name="label5"/>
</widgets>
</object>
<object class="GtkListStore" id="liststore2"/>
<object class="GtkListStore" id="liststore3"/>
</interface>

Loading…
Cancel
Save