parent
a52f8ecc16
commit
a444724495
@ -0,0 +1,223 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.accept-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.cancel-uncolored-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkListStore" id="liststore1"/>
|
||||
<object class="GtkTreeStore" id="treestore1">
|
||||
<columns>
|
||||
<!-- column-name Selected -->
|
||||
<column type="gboolean"/>
|
||||
<!-- column-name RenderText -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name Description -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name SectionTags -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name IsSection -->
|
||||
<column type="gboolean"/>
|
||||
<!-- column-name Icon -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name Exec -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkWindow" id="MainWindow">
|
||||
<property name="width-request">225</property>
|
||||
<property name="height-request">450</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="icon-name">com.ublinux.ubl-settings-video</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-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="GtkCheckButton" id="RenderModeCheck">
|
||||
<property name="label" translatable="yes">checkbutton</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="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</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="GtkTreeView" id="MainTree">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="model">treestore1</property>
|
||||
<property name="headers-visible">False</property>
|
||||
<property name="search-column">1</property>
|
||||
<property name="tooltip-column">2</property>
|
||||
<property name="activate-on-single-click">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn">
|
||||
<child>
|
||||
<object class="GtkCellRendererToggle" id="SelectionCell"/>
|
||||
<attributes>
|
||||
<attribute name="active">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf">
|
||||
<property name="stock_size">4</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="icon-name">5</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="can-focus">True</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<child>
|
||||
<object class="GtkIconView">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="margin">6</property>
|
||||
<property name="model">liststore1</property>
|
||||
</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>
|
||||
<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="SettingsBar">
|
||||
<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="HeadLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Choose application</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="WindowIcon">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="pixel-size">32</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="CancelButton">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="AcceptButton">
|
||||
<property name="label" translatable="yes">Accept</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@ -0,0 +1,57 @@
|
||||
#include "libublsettingsui-gtk3.h"
|
||||
|
||||
char *config_get_default_command = NULL;
|
||||
char *config_get_global_command = NULL;
|
||||
char *config_get_local_command = NULL;
|
||||
|
||||
void yon_load_proceed(YON_CONFIG_TYPE type){
|
||||
yon_config_clean();
|
||||
if (!yon_char_is_empty(config_get_default_command))
|
||||
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
||||
if (type==YON_CONFIG_GLOBAL){
|
||||
yon_config_load_config(type,config_get_global_command,NULL);
|
||||
} else if (type==YON_CONFIG_LOCAL){
|
||||
yon_config_load_config(type,config_get_local_command,NULL);
|
||||
} else if (type==YON_CONFIG_CUSTOM){
|
||||
char *path="";
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
yon_char_get_localised_from_lib(CANCEL_LABEL),GTK_RESPONSE_CANCEL,
|
||||
yon_char_get_localised_from_lib(OPEN_LABEL),GTK_RESPONSE_ACCEPT,NULL);
|
||||
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,template_app_information.app_title,yon_char_append("com.ublinux.",template_app_information.app_tech_name),"FileChooserWindow");
|
||||
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-video");
|
||||
gtk_window_set_title(GTK_WINDOW(dialog),template_app_information.app_title);
|
||||
GtkFileFilter *filter = gtk_file_filter_new();
|
||||
gtk_file_filter_add_pattern(filter,"*.ini");
|
||||
gtk_file_filter_set_name(filter, "*.ini");
|
||||
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
||||
gtk_widget_show(dialog);
|
||||
int response = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
if (response == GTK_RESPONSE_ACCEPT){
|
||||
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
||||
if (!yon_char_is_empty(file)){
|
||||
path=yon_char_unite("'",file,"'",NULL);
|
||||
free(file);
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
} else {
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
yon_config_load_config(type,yon_config_get_custom_command(path),NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void on_config_local_load(){
|
||||
yon_load_proceed(YON_CONFIG_LOCAL);
|
||||
}
|
||||
|
||||
void on_config_global_load(){
|
||||
yon_load_proceed(YON_CONFIG_GLOBAL);
|
||||
}
|
||||
|
||||
void on_config_custom_load(){
|
||||
yon_load_proceed(YON_CONFIG_CUSTOM);
|
||||
}
|
||||
|
||||
void on_config_global_local_save(){
|
||||
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL);
|
||||
}
|
||||
Loading…
Reference in new issue