Loading interface update WIP

pull/13/head
parent a67c45899f
commit 15aee5ac1b

@ -41,6 +41,17 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
void yon_interface_update(main_window *widgets){
int size;
char *repo_config = config(REPOSITORY_parameter);
if (!yon_char_is_empty(repo_config)){
if (!strcmp(repo_config,"disable")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),0);
} else if (!strcmp(repo_config,"enable")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),1);
}else if (!strcmp(repo_config,"only")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesDisableSystemReposCheck),1);
}
}
config_str repos = yon_config_get_all_by_key(REPOSITORY_search,&size);
GtkTreeIter iter;
for (int i=0;i<size;i++){
@ -60,10 +71,95 @@ void yon_interface_update(main_window *widgets){
yon_char_parsed_free(parsed,cur_size);
}
yon_char_parsed_free(repos,size);
char *publish = config(REPOPUBLIC_NET);
if (publish) {
int cur_size;
config_str parsed = yon_char_parse(publish,&cur_size,",");
if (cur_size){
if (!strcmp(parsed[0],"disable")||!strcmp(parsed[0],"no")||!strcmp(parsed[0],"none")){
} else if (!strcmp(parsed[0],"enable")||!strcmp(parsed[0],"yes")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->PublicationConnectPublicCheck),1);
}
if (cur_size>1&&!strcmp(parsed[1],"db")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RecieveDBFromNetCheck),1);
}
if (cur_size>2){
for (int i=2;i<cur_size;i++){
gtk_list_store_append(widgets->PublicationList,&iter);
gtk_list_store_set(widgets->PublicationList,&iter,1,parsed[i],-1);
}
}
yon_char_parsed_free(parsed,cur_size);
}
}
char *mirror = config(REPOPUBLIC_CACHE);
if (!yon_char_is_empty(mirror)){
if (!strcmp(mirror,"enable")||!strcmp(mirror,"yes")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->MirrorPublicCheck),1);
} else if (!strcmp(mirror,"disable")||!strcmp(mirror,"no")||!strcmp(mirror,"none")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->MirrorPublicCheck),0);
}
}
// config_str mirror_list = yon_config_get_all_by_key(REPOPUBLIC_CACHE_search,&size);
// if (size){
// for (int i=0;i<size;i++){
// char *cur = yon_char_new(mirror_list);
// char *key = yon_char_divide_search(cur,"=",-1);
// int cur_size;
// config_str parsed = yon_char_parse(cur,&cur_size,",");
// if (cur_size){
// char *urls_render = "";
// for (int j=0;j<cur_size;j++){
// char *type = yon_char_divide_search(parsed[j],"@",-1);
// char *temp = yon_char_unite(urls_render,!yon_char_is_empty(urls_render)?",":"",parsed[j],NULL);
// if (!yon_char_is_empty(urls_render)) free(urls_render);
// urls_render = temp;
// }
// gtk_list_store_append(widgets->MirrorList,&iter);
// gtk_list_store_set(widgets->MirrorList,&iter,,-1);
// }
// }
// }
char *autoupdate_config = config(AUTOUPDATE);
if (!yon_char_is_empty(autoupdate_config)&&!strcmp(autoupdate_config,"enable")){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck),1);
}
autoupdate_config = config(AUTOUPDATE_mode);
if (!yon_char_is_empty(autoupdate_config)){
if (!strcmp(autoupdate_config,"modsys")){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),1);
} else if (!strcmp(autoupdate_config,"modules")){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),2);
} else if (!strcmp(autoupdate_config,"system")){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),3);
}
}
autoupdate_config = config(AUTOUPDATE_interval);
if (!yon_char_is_empty(autoupdate_config)){
if (!strcmp(autoupdate_config,"boot")){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),0);
} else {
if (strstr(autoupdate_config,"min")){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),1);
} else if (autoupdate_config[strlen(autoupdate_config)-1]=='h'){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),2);
} else if (autoupdate_config[strlen(autoupdate_config)-1]=='d'){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),3);
} else if (autoupdate_config[strlen(autoupdate_config)-1]=='M'){
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateIntervalCombo),4);
}
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->UpdateIntervalSpin),atol(autoupdate_config));
}
}
}
// standard functions
@ -385,8 +481,10 @@ void yon_main_window_complete(main_window *widgets){
// Custom widgets configuration
{
widgets->AutoUpdateCheck = yon_gtk_builder_get_widget(builder,"AutoUpdateCheck");
widgets->UpdateCheckFreqCombo = yon_gtk_builder_get_widget(builder,"UpdateCheckFreqCombo");
widgets->UpdateCheckIntervalCombo = yon_gtk_builder_get_widget(builder,"UpdateCheckIntervalCombo");
widgets->UpdateModeCombo = yon_gtk_builder_get_widget(builder,"UpdateModeCombo");
widgets->UpdateIntervalDefaultCheck = yon_gtk_builder_get_widget(builder,"UpdateIntervalDefaultCheck");
widgets->UpdateIntervalSpin = yon_gtk_builder_get_widget(builder,"UpdateIntervalSpin");
widgets->UpdateIntervalCombo = yon_gtk_builder_get_widget(builder,"UpdateIntervalCombo");
widgets->UpdateRepoListCombo = yon_gtk_builder_get_widget(builder,"UpdateRepoListCombo");
widgets->UpdateRepoTree = yon_gtk_builder_get_widget(builder,"UpdateRepoTree");
widgets->RepositoriesRepoListConfigurationCheck = yon_gtk_builder_get_widget(builder,"RepositoriesRepoListConfigurationCheck");

@ -72,8 +72,10 @@ typedef struct {
typedef struct {
template_window_fields
GtkWidget *AutoUpdateCheck;
GtkWidget *UpdateCheckFreqCombo;
GtkWidget *UpdateCheckIntervalCombo;
GtkWidget *UpdateModeCombo;
GtkWidget *UpdateIntervalDefaultCheck;
GtkWidget *UpdateIntervalSpin;
GtkWidget *UpdateIntervalCombo;
GtkWidget *UpdateRepoListCombo;
GtkWidget *UpdateRepoTree;
GtkListStore *UpdateRepoList;

@ -26,7 +26,7 @@ background:transparent;
}
.menuitembottom{
margin-top:0px;
margin-bottom:3px;
margin-bottom:4px;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
@ -46,56 +46,59 @@ background:transparent;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemtop *{
.menuitemtop>*{
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
padding: 3px 10px 3px 5px;
border:transparent;
}
.menuitemmiddle *{
.menuitemmiddle>*{
margin:0 2px 0 2px;
padding: 3px 10px 3px 5px;
border:transparent;
}
.menuitembottom *{
.menuitembottom>*{
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
padding: 3px 10px 3px 5px;
}
.menuitemtop:hover {
background:@theme_bg_color;
background:@theme_base_color;
border-color:inherit;
border-top-width:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemmiddle:hover {
background:@theme_bg_color;
background:@theme_base_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitembottom:hover {
background:@theme_bg_color;
background:@theme_base_color;
border-color:inherit;
border-bottom-width:0px;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemtop:hover* {
.menuitemtop:hover>* {
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
padding: 3px 10px 3px 5px;
/* padding: 5px 0 3px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}
.menuitemmiddle:hover* {
margin:0 2px 0 2px;
.menuitemmiddle:hover>* {
margin:0 2px 0px 2px;
padding: 3px 10px 3px 5px;
/* padding: 3px 0px 3px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}
.menuitembottom:hover* {
.menuitembottom:hover>* {
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
padding: 3px 10px 3px 5px;
/* padding: 3px 0px 5px 5px; */
background:@theme_selected_bg_color;
border-radius:2px;
}

@ -25,8 +25,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<!-- interface-license-type gplv2 -->
<!-- interface-name ubl-settings-update -->
<!-- interface-copyright UBGroup -->
<object class="GtkListStore" id="MirrorList"/>
<object class="GtkListStore" id="PublicationList"/>
<object class="GtkListStore" id="MirrorList">
<columns>
<!-- column-name Repository -->
<column type="gchararray"/>
<!-- column-name Type -->
<column type="gchararray"/>
<!-- column-name ResourceURL -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="PublicationList">
<columns>
<!-- column-name Chosen -->
<column type="gboolean"/>
<!-- column-name RepoName -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="ReposList">
<columns>
<!-- column-name Enabled -->
@ -44,6 +60,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<object class="GtkListStore" id="UpdateRepoList"/>
<object class="GtkListStore" id="WebPublicationList"/>
<object class="GtkSizeGroup"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkSizeGroup" id="ahre"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
@ -115,6 +136,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="can-focus">False</property>
<property name="icon-name">document-edit-symbolic</property>
</object>
<object class="GtkListStore" id="liststore1"/>
<object class="GtkBox" id="BoxMain">
<property name="visible">True</property>
<property name="can-focus">False</property>
@ -180,7 +202,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="UpdateCheckFreqCombo">
<object class="GtkComboBoxText" id="UpdateModeCombo">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">0</property>
@ -223,19 +245,58 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="UpdateCheckIntervalCombo">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">0</property>
<items>
<item translatable="yes">Default</item>
<item translatable="yes">First update all modules and then the system</item>
<item translatable="yes">Update only modules</item>
<item translatable="yes">Update everything in the order of the specified repositories</item>
</items>
<property name="spacing">5</property>
<child>
<object class="GtkCheckButton" id="UpdateIntervalDefaultCheck">
<property name="label" translatable="yes">Default</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>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="UpdateIntervalSpin">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="UpdateIntervalCombo">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">0</property>
<items>
<item translatable="yes">Boot</item>
<item translatable="yes">Minutes</item>
<item translatable="yes">Hours</item>
<item translatable="yes">Days</item>
<item translatable="yes">Months</item>
</items>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@ -251,8 +312,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0</property>
<property name="shadow-type">none</property>
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkAlignment">
<property name="visible">True</property>
@ -804,6 +865,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="title" translatable="yes">Chosen</property>
<child>
<object class="GtkCellRendererToggle"/>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
@ -812,6 +876,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="title" translatable="yes">Repository name</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
@ -960,59 +1027,94 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkTreeView" id="WebPublicationTree">
<object class="GtkTreeView">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">WebPublicationList</property>
<property name="model">liststore1</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Enabled</property>
</object>
<object class="GtkTreeViewColumn"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Source</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Repository</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Reviewer</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Port</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Name</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Password/Hash type</property>
<property name="title" translatable="yes">Authtorization parameters</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="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Password/Password hash</property>
<object class="GtkTreeView" id="WebPublicationTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">WebPublicationList</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Enabled</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Storage</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Chosen repositories</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Reviewer</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Port</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Name</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Password/Hash type</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Password/Password hash</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>
@ -1206,6 +1308,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="title" translatable="yes">Repository</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
@ -1214,6 +1319,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="title" translatable="yes">Type</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
@ -1222,6 +1330,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="title" translatable="yes">Resource URL</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>

Loading…
Cancel
Save