Added interface update connect function; Changed standard window structure

pull/73/head
parent a32cfb979f
commit 965574594a

@ -131,3 +131,8 @@ background:transparent;
.marginright image{
margin-right: 2px;
}
.bgimage{
background-image: url('resource:///com/ublinux/images/libublsettingsui-gtk3-banner.png');
background-repeat: no-repeat;
}

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2
<!-- Generated with glade 3.40.0
libublsettingsui-gtk3 -
Copyright (C) UBGroup
@ -25,109 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<!-- interface-license-type gplv2 -->
<!-- interface-name libublsettingsui-gtk3 -->
<!-- interface-copyright UBGroup -->
<object class="GtkBox" id="HeaderBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<child>
<object class="GtkImage" id="HatIcon">
<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-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="pixel-size">64</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3</property>
</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>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<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>
<child>
<object class="GtkLabel" id="HeaderTitleLabel">
<property name="width-request">255</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">end</property>
<property name="label" translatable="yes">TEMPLATE Manager</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="size" value="15360"/>
</attributes>
<style>
<class name="textHead"/>
</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="HeaderInfoLabel">
<property name="width-request">255</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes">TEMPLATE management app</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="size" value="12288"/>
</attributes>
<style>
<class name="textHead"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<object class="GtkMenu" id="menu1">
<property name="visible">True</property>
<property name="can-focus">False</property>
@ -324,20 +221,112 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkOverlay" id="HeadOverlay">
<property name="height-request">81</property>
<object class="GtkBox" id="HeaderBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<child>
<object class="GtkImage" id="HeadBackgroundImage">
<object class="GtkImage" id="HatIcon">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="pixel-size">64</property>
<property name="icon-name">com.ublinux.libublsettingsui-gtk3</property>
</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>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<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>
<child>
<object class="GtkLabel" id="HeaderTitleLabel">
<property name="width-request">255</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">end</property>
<property name="label" translatable="yes">TEMPLATE Manager</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="size" value="15360"/>
</attributes>
<style>
<class name="textHead"/>
</style>
</object>
<packing>
<property name="index">-1</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="HeaderInfoLabel">
<property name="width-request">255</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">TEMPLATE management app</property>
<property name="wrap">True</property>
<property name="wrap-mode">word-char</property>
<property name="track-visited-links">False</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="size" value="12288"/>
</attributes>
<style>
<class name="textHead"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="bgimage"/>
</style>
</object>
<packing>
<property name="expand">False</property>

@ -1,5 +1,7 @@
#include "libublsettingsui-gtk3.h"
void *__interface_update_function = NULL;
void *__interface_update_data = NULL;
char *config_get_default_command = NULL;
char *config_get_global_command = NULL;
char *config_get_local_command = NULL;
@ -61,17 +63,23 @@ int __yon_load_proceed(YON_CONFIG_TYPE type){
void __on_config_local_load(GtkWidget *){
__yon_load_proceed(YON_CONFIG_LOCAL);
template_config->load_mode=1;
if (__interface_update_function)
((void (*)(void*))__interface_update_function)(__interface_update_data);
}
void __on_config_global_load(GtkWidget *){
__yon_load_proceed(YON_CONFIG_GLOBAL);
template_config->load_mode=0;
if (__interface_update_function)
((void (*)(void*))__interface_update_function)(__interface_update_data);
}
void __on_config_custom_load(GtkWidget *){
__yon_load_proceed(YON_CONFIG_CUSTOM);
template_config->load_mode=3;
if (__interface_update_function)
((void (*)(void*))__interface_update_function)(__interface_update_data);
}
void __on_config_global_local_save(){
@ -90,6 +98,11 @@ void __on_config_custom_save(){
yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_custom_command,NULL);
}
void yon_ubl_settings_set_interface_update_function(void*target_func, gpointer func_data){
__interface_update_function = target_func;
__interface_update_data = func_data;
}
void yon_ubl_settings_window_set_standard_callbacks(template_main_window *widgets, char *get_global_command, char *get_local_command,char *get_custom_command, char *get_default_command, char *get_global_only_command, char *get_local_only_command){
if (!yon_char_is_empty(get_global_command)){
g_signal_connect(G_OBJECT(widgets->LoadGlobalMenuItem),"activate",G_CALLBACK(__on_config_global_load),NULL);

@ -85,7 +85,6 @@ void on_open_documentation_confirmation(GtkWidget *self, char *link){
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(yon_open_browser),yon_char_new(_(link)));
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
} else {
yon_open_browser(self,_(link));
}
@ -586,7 +585,6 @@ template_main_window *yon_ubl_window_setup(){
textdomain (template_ui_LocaleName);
// setlocale(LC_ALL,"");
template_main_window *widgets = setup_window();
yon_ubl_header_setup_resource(widgets->HeadOverlay,widgets->HeadBox,widgets->HeadImage,ui_banner_path);
textdomain(template_ui_LocaleName);
if (yon_ubl_status_box_setup(widgets->StatusIcon,widgets->StatusBox,widgets->StatusLabel)){
if (getuid()!=0)
@ -604,6 +602,9 @@ template_main_window *yon_ubl_window_setup(){
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
GTK_STYLE_PROVIDER(css),
-1);
GtkCssProvider *css_lib=gtk_css_provider_new();
gtk_css_provider_load_from_resource(css_lib,"/com/ublinux/css/libublsettingsui-gtk3.css");
gtk_style_context_add_provider(gtk_widget_get_style_context(widgets->HeadBox),GTK_STYLE_PROVIDER(css_lib),GTK_STYLE_PROVIDER_PRIORITY_USER);
return widgets;
}

@ -367,6 +367,11 @@ template_app_info yon_ubl_get_app_info();
void yon_ubl_settings_window_set_standard_callbacks(template_main_window *widgets, char *get_global_command, char *get_local_command,char *get_custom_command, char *get_default_command, char *get_global_only_command, char *get_local_only_command);
/// @brief Set an interface update function for common loading callbacks
/// @param target_func function to connect
/// @param func_data data for passing into function
void yon_ubl_settings_set_interface_update_function(void*target_func, gpointer func_data);
void yon_window_remove_exit_config_check(template_main_window *widgets);
void yon_window_set_exit_config_check(template_main_window *widgets, GCallback data_callback_function);

Loading…
Cancel
Save