master #43
YanTheKaller/libublsettingsui-gtk3:master into master 6 months ago
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,221 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface domain="libublsettingsui-gtk3">
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<!-- interface-css-provider-path libublsettingsui-gtk3.css -->
|
||||
<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>
|
||||
</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,416 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface domain="libublsettingsui-gtk3">
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<!-- interface-css-provider-path libublsettingsui-gtk3.css -->
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.play-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.stop-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.reset-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.important-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.flag-empy-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.flag-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.libublsettingsui-gtk3.sync-symbolic</property>
|
||||
</object>
|
||||
<object class="GtkApplicationWindow" id="MainWindow">
|
||||
<property name="width-request">450</property>
|
||||
<property name="height-request">225</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>
|
||||
<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="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">25</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">20</property>
|
||||
<property name="margin-right">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="pixel-size">75</property>
|
||||
<property name="icon-name">dialog-information-symbolic</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>
|
||||
<property name="valign">center</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="TitleLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">".service" service:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="UpdateButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image7</property>
|
||||
<style>
|
||||
<class name="thin"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</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>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="ActiveImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.ubl-settings-audit.inactive-symbolic</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Active:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="ActiveLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Inactive</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="StatusButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image4</property>
|
||||
<style>
|
||||
<class name="thin"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="EnableImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">com.ublinux.ubl-settings-audit.active-symbolic</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Enabled:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="EnableLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Disabled</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="position">2</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">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="DisableButton">
|
||||
<property name="label" translatable="yes">Disable</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image5</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="EnableButton">
|
||||
<property name="label" translatable="yes">Enable</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image6</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="RestartButton">
|
||||
<property name="label" translatable="yes">Restart</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">image3</property>
|
||||
<style>
|
||||
<class name="thin"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="StopButton">
|
||||
<property name="label" translatable="yes">Stop</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="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="StartButton">
|
||||
<property name="label" translatable="yes">Start</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="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack-type">end</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">".service" service configuration</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>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@ -0,0 +1,196 @@
|
||||
#include "libublsettingsui-gtk3.h"
|
||||
|
||||
struct return_struct {
|
||||
config_str chosen_apps;
|
||||
int size;
|
||||
};
|
||||
|
||||
struct application {
|
||||
char *name;
|
||||
char *path;
|
||||
char *description;
|
||||
char *tags;
|
||||
char *execute;
|
||||
char *icon;
|
||||
config_str other;
|
||||
int other_size;
|
||||
|
||||
};
|
||||
|
||||
config_str yon_apps_get_from_file(char *file,int *final_size){
|
||||
(*final_size)=0;
|
||||
config_str final = NULL;
|
||||
int size;
|
||||
config_str parsed = yon_dir_get_contents(file,&size);
|
||||
for (int i=0;i<size;i++){
|
||||
if (strstr(parsed[i],".desktop")){
|
||||
char *path = yon_char_unite(file,"/",parsed[i],NULL);
|
||||
yon_char_parsed_add_or_create_if_exists(final,final_size,path);
|
||||
}
|
||||
}
|
||||
yon_char_parsed_free(parsed,size);
|
||||
return final;
|
||||
}
|
||||
|
||||
int yon_apps_get(yon_app_chooser_window *window){
|
||||
window->apps = NULL;
|
||||
window->apps_size=0;
|
||||
int merged_size;
|
||||
config_str merged = NULL;
|
||||
|
||||
// int temp_size;
|
||||
// config_str temp = yon_apps_get_from_file("/usr/shared/applications",&temp_size);
|
||||
|
||||
// int local_size;
|
||||
// config_str local = yon_apps_get_from_file("/usr/local/shared/applications",&temp_size);
|
||||
|
||||
window->apps = yon_apps_get_from_file("/usr/share/applications",&window->apps_size);
|
||||
return window->apps_size;
|
||||
}
|
||||
|
||||
void yon_block_visibility_if_unallowed(GtkWidget *self, GParamSpec* pspec,yon_app_chooser_window *window){
|
||||
if (gtk_widget_get_visible(window->MainWindow)){
|
||||
if (!window->visible_allowed)
|
||||
gtk_widget_set_visible(window->MainWindow,0);
|
||||
else g_signal_handlers_block_by_func(G_OBJECT(window->MainWindow),yon_block_visibility_if_unallowed,window);
|
||||
}
|
||||
}
|
||||
|
||||
int yon_app_chooser_convert_apps(yon_app_chooser_window *window){
|
||||
GKeyFile *file = g_key_file_new();
|
||||
window->apps_convert = NULL;
|
||||
for (int i=0;i<window->apps_size;i++){
|
||||
if (g_key_file_load_from_file(file,window->apps[i],G_KEY_FILE_KEEP_TRANSLATIONS,NULL)){
|
||||
struct application *app = new(struct application);
|
||||
memset(app,0,sizeof(struct application));
|
||||
app->name = g_key_file_get_locale_string(file,"Desktop Entry","Name",setlocale(LC_ALL,NULL),NULL);
|
||||
app->description = g_key_file_get_locale_string(file,"[Desktop Entry","Comment",setlocale(LC_ALL,NULL),NULL);
|
||||
app->tags = g_key_file_get_string(file,"Desktop Entry","Categories",NULL);
|
||||
app->execute = g_key_file_get_string(file,"Desktop Entry","Exec",NULL);
|
||||
app->icon = g_key_file_get_string(file,"Desktop Entry","Icon",NULL);
|
||||
app->path = yon_char_new(window->apps[i]);
|
||||
yon_dictionary_add_or_create_if_exists_with_data(window->apps_convert,app->name,app);
|
||||
}
|
||||
}
|
||||
if (window->apps_convert) return 1; else return 0;
|
||||
}
|
||||
|
||||
// int yon_tree_store_setup_apps(yon_app_chooser_window *window){
|
||||
// GtkTreeIter iter,itar;
|
||||
// GtkTreeModel *model = GTK_TREE_MODEL(window->treestore);
|
||||
// for_iter (model,&iter){
|
||||
// char *tags;
|
||||
// gtk_tree_model_get(model,&iter,3,&tags,-1);
|
||||
// int required_size;
|
||||
// config_str required_tags = yon_char_parse(tags,&required_size,";");
|
||||
|
||||
// dictionary *dict;
|
||||
// for_dictionaries(dict,window->apps_convert){
|
||||
// int parsed_size;
|
||||
// struct application *cur_app = (struct application*)dict->data;
|
||||
// config_str parsed_tags = yon_char_parse(cur_app->tags,&parsed_size,";");
|
||||
// if (yon_char_parsed_includes_char_parsed(required_tags,parsed_tags,required_size,parsed_size)){
|
||||
// gtk_tree_store_append(window->treestore,&itar,&iter);
|
||||
// gtk_tree_store_set(window->treestore,&itar,0,0,1,cur_app->name,2,cur_app->description,3,cur_app->tags,4,0,5,cur_app->icon,6,cur_app->execute,-1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
int yon_tree_store_setup_apps(yon_app_chooser_window *window){
|
||||
GtkTreeIter iter;
|
||||
dictionary *dict;
|
||||
for_dictionaries(dict,window->apps_convert){
|
||||
int parsed_size;
|
||||
struct application *cur_app = (struct application*)dict->data;
|
||||
gtk_tree_store_append(window->treestore,&iter,NULL);
|
||||
gtk_tree_store_set(window->treestore,&iter,0,0,1,cur_app->name,2,cur_app->description,3,cur_app->tags,4,0,5,cur_app->icon,6,cur_app->execute,-1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
config_str yon_app_chooser_window_run(yon_app_chooser_window *window, int *size){
|
||||
gtk_widget_show(window->MainWindow);
|
||||
gtk_main();
|
||||
config_str final = window->final->chosen_apps;
|
||||
(*size)=window->final->size;
|
||||
free(window);
|
||||
return final;
|
||||
}
|
||||
|
||||
void on_app_selection_toggled(GtkWidget *, char *path, yon_app_chooser_window *window){
|
||||
GtkTreeIter iter;
|
||||
int status;
|
||||
gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->treestore),&iter,path);
|
||||
gtk_tree_model_get(GTK_TREE_MODEL(window->treestore),&iter,0,&status,-1);
|
||||
gtk_tree_store_set(window->treestore,&iter,0,!status,-1);
|
||||
}
|
||||
|
||||
void on_app_chooser_window_closed(GtkWidget *, yon_app_chooser_window *window){
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void on_app_chooser_accept(GtkWidget *, yon_app_chooser_window *window){
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model = GTK_TREE_MODEL(window->treestore);
|
||||
if (window->multiple){
|
||||
for_iter(model,&iter){
|
||||
int status;
|
||||
char *name;
|
||||
gtk_tree_model_get(GTK_TREE_MODEL(window->treestore),&iter,0,&status,1,&name,-1);
|
||||
if (status){
|
||||
yon_char_parsed_add_or_create_if_exists(window->final->chosen_apps,&window->final->size,name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->MainTree)),&model,&iter)){
|
||||
char *name;
|
||||
gtk_tree_model_get(GTK_TREE_MODEL(window->treestore),&iter,1,&name,-1);
|
||||
yon_char_parsed_add_or_create_if_exists(window->final->chosen_apps,&window->final->size,name);
|
||||
}
|
||||
}
|
||||
gtk_widget_destroy(window->MainWindow);
|
||||
}
|
||||
|
||||
yon_app_chooser_window *yon_app_chooser_window_new(int multiple_choise){
|
||||
yon_app_chooser_window *window = new(yon_app_chooser_window);
|
||||
GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_app_chooser);
|
||||
window->MainWindow = yon_gtk_builder_get_widget(builder,"MainWindow");
|
||||
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
||||
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
||||
window->WindowImage = yon_gtk_builder_get_widget(builder,"WindowImage");
|
||||
|
||||
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
||||
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
||||
|
||||
window->MainTree = yon_gtk_builder_get_widget(builder,"MainTree");
|
||||
window->SelectionCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"SelectionCell"));
|
||||
window->treestore = GTK_TREE_STORE(gtk_builder_get_object(builder,"treestore1"));
|
||||
|
||||
window->MainIconView = yon_gtk_builder_get_widget(builder,"MainIconView");
|
||||
window->liststore = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
|
||||
|
||||
window->visible_allowed=0;
|
||||
window->final = new(struct return_struct);
|
||||
|
||||
memset(window->final,0,sizeof(struct return_struct));
|
||||
|
||||
g_signal_connect(G_OBJECT(window->MainWindow),"notify::visibile",G_CALLBACK(yon_block_visibility_if_unallowed),window);
|
||||
g_signal_connect(G_OBJECT(window->MainWindow),"destroy",G_CALLBACK(on_app_chooser_window_closed),window);
|
||||
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
||||
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_app_chooser_accept),window);
|
||||
g_signal_connect(G_OBJECT(window->SelectionCell),"toggled",G_CALLBACK(on_app_selection_toggled),window);
|
||||
|
||||
window->multiple = multiple_choise;
|
||||
|
||||
if (!window->multiple){
|
||||
gtk_cell_renderer_set_visible(GTK_CELL_RENDERER(window->SelectionCell),0);
|
||||
}
|
||||
|
||||
|
||||
if (!yon_apps_get(window)) return NULL;
|
||||
if (!yon_app_chooser_convert_apps(window)) return NULL;
|
||||
yon_tree_store_setup_apps(window);
|
||||
|
||||
return window;
|
||||
}
|
||||
@ -0,0 +1,182 @@
|
||||
#include "libublsettingsui-gtk3.h"
|
||||
|
||||
#define service_start_icon_name "com.ublinux.libublsettingsui-gtk3.play-symbolic"
|
||||
#define service_stop_icon_name "com.ublinux.libublsettingsui-gtk3.stop-symbolic"
|
||||
|
||||
#define service_start_status_icon_name "com.ublinux.libublsettingsui-gtk3.active-symbolic"
|
||||
#define service_stop_status_icon_name "com.ublinux.libublsettingsui-gtk3.inactive-symbolic"
|
||||
|
||||
void __on_closed(GtkWidget *, service_window *window){
|
||||
free(window->name);
|
||||
free(window->start_command);
|
||||
free(window->stop_command);
|
||||
free(window->enable_command);
|
||||
free(window->disable_command);
|
||||
free(window->info_command);
|
||||
free(window->check_active_command);
|
||||
free(window->check_enable_command);
|
||||
free(window);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void __on_service_update_clicked(GtkWidget *, service_window *window);
|
||||
|
||||
void __on_service_start_clicked(GtkWidget *, service_window *window){
|
||||
if (system(yon_debug_output("%s\n",window->start_command))){
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(FAIL_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
return;
|
||||
};
|
||||
__on_service_update_clicked(NULL,window);
|
||||
|
||||
}
|
||||
|
||||
void __on_service_stop_clicked(GtkWidget *, service_window *window){
|
||||
if (system(window->stop_command)){
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(FAIL_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
return;
|
||||
};
|
||||
__on_service_update_clicked(NULL,window);
|
||||
|
||||
}
|
||||
|
||||
void __on_service_enable_clicked(GtkWidget *, service_window *window){
|
||||
|
||||
|
||||
if (system(window->enable_command)){
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(FAIL_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
return;
|
||||
};
|
||||
__on_service_update_clicked(NULL,window);
|
||||
|
||||
}
|
||||
|
||||
void __on_service_disable_clicked(GtkWidget *, service_window *window){
|
||||
|
||||
if (system(window->disable_command)){
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(FAIL_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
return;
|
||||
};
|
||||
__on_service_update_clicked(NULL,window);
|
||||
}
|
||||
|
||||
void __on_service_restart_clicked(GtkWidget *, service_window *window){
|
||||
|
||||
|
||||
if (system(window->stop_command)){
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(FAIL_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
return;
|
||||
};
|
||||
if (system(window->start_command)){
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(FAIL_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
return;
|
||||
};
|
||||
__on_service_update_clicked(NULL,window);
|
||||
|
||||
}
|
||||
|
||||
void __on_service_status_clicked(GtkWidget *, service_window *window){
|
||||
char *success_string = _SERVICE_ACTIVE_STATUS_LABEL(window->name);
|
||||
char *fail_string = _SERVICE_INACTIVE_STATUS_LABEL(window->name);
|
||||
|
||||
yon_terminal_window_update_button_launch(GTK_WINDOW(window->MainWindow),window->info_command,success_string,fail_string);
|
||||
|
||||
}
|
||||
|
||||
void __on_service_update_clicked(GtkWidget *, service_window *window){
|
||||
if (!system(window->check_enable_command)){
|
||||
gtk_label_set_text(GTK_LABEL(window->EnableLabel),yon_char_get_localised_from_lib(_SERVICE_ENABLE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->EnableImage),service_start_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
} else {
|
||||
gtk_label_set_text(GTK_LABEL(window->EnableLabel),yon_char_get_localised_from_lib(_SERVICE_DISABLE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->EnableImage),service_stop_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
}
|
||||
if (!system(window->check_active_command)){
|
||||
gtk_label_set_text(GTK_LABEL(window->ActiveLabel),yon_char_get_localised_from_lib(_SERVICE_ACTIVE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->ActiveImage),service_start_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
} else {
|
||||
gtk_label_set_text(GTK_LABEL(window->ActiveLabel),yon_char_get_localised_from_lib(_SERVICE_INACTIVE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->ActiveImage),service_stop_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
}
|
||||
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(SUCCESS_LABEL),5,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
}
|
||||
|
||||
service_window *yon_service_window_new(char *name, char *start_command,
|
||||
char *stop_command, char *enable_command,
|
||||
char *disable_command, char *info_command,
|
||||
char *check_active_command, char *check_enable_command){
|
||||
service_window *window = new(service_window);
|
||||
GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_service);
|
||||
window->MainWindow = yon_gtk_builder_get_widget(builder,"MainWindow");
|
||||
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
||||
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
||||
window->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel");
|
||||
|
||||
window->UpdateButton = yon_gtk_builder_get_widget(builder,"UpdateButton");
|
||||
window->StatusButton = yon_gtk_builder_get_widget(builder,"StatusButton");
|
||||
|
||||
window->ActiveLabel = yon_gtk_builder_get_widget(builder,"ActiveLabel");
|
||||
window->ActiveImage = yon_gtk_builder_get_widget(builder,"ActiveImage");
|
||||
window->EnableLabel = yon_gtk_builder_get_widget(builder,"EnableLabel");
|
||||
window->EnableImage = yon_gtk_builder_get_widget(builder,"EnableImage");
|
||||
|
||||
window->RestartButton = yon_gtk_builder_get_widget(builder,"RestartButton");
|
||||
window->StartButton = yon_gtk_builder_get_widget(builder,"StartButton");
|
||||
window->StopButton = yon_gtk_builder_get_widget(builder,"StopButton");
|
||||
window->EnableButton = yon_gtk_builder_get_widget(builder,"EnableButton");
|
||||
window->DisableButton = yon_gtk_builder_get_widget(builder,"DisableButton");
|
||||
|
||||
window->name = yon_char_new(name);
|
||||
window->start_command = yon_char_new(start_command);
|
||||
window->stop_command = yon_char_new(stop_command);
|
||||
window->enable_command = yon_char_new(enable_command);
|
||||
window->disable_command = yon_char_new(disable_command);
|
||||
window->info_command = yon_char_new(info_command);
|
||||
window->check_active_command = yon_char_new(check_active_command);
|
||||
window->check_enable_command = yon_char_new(check_enable_command);
|
||||
|
||||
char *head_label = (_SERVICE_HEAD_LABEL(window->name));
|
||||
char *title_label = (_SERVICE_TITLE_LABEL(window->name));
|
||||
gtk_label_set_text(GTK_LABEL(window->HeadLabel),head_label);
|
||||
gtk_label_set_text(GTK_LABEL(window->TitleLabel),title_label);
|
||||
|
||||
yon_gtk_window_setup(GTK_WINDOW(window->MainWindow),NULL,_SERVICE_HEAD_LABEL(window->name),yon_dull_icon_path,NULL);
|
||||
|
||||
g_signal_connect(G_OBJECT(window->MainWindow),"destroy",G_CALLBACK(__on_closed),window);
|
||||
g_signal_connect(G_OBJECT(window->StartButton),"clicked",G_CALLBACK(__on_service_start_clicked),window);
|
||||
g_signal_connect(G_OBJECT(window->StopButton),"clicked",G_CALLBACK(__on_service_stop_clicked),window);
|
||||
g_signal_connect(G_OBJECT(window->RestartButton),"clicked",G_CALLBACK(__on_service_restart_clicked),window);
|
||||
g_signal_connect(G_OBJECT(window->StatusButton),"clicked",G_CALLBACK(__on_service_status_clicked),window);
|
||||
g_signal_connect(G_OBJECT(window->UpdateButton),"clicked",G_CALLBACK(__on_service_update_clicked),window);
|
||||
g_signal_connect(G_OBJECT(window->EnableButton),"clicked",G_CALLBACK(__on_service_enable_clicked),window);
|
||||
g_signal_connect(G_OBJECT(window->DisableButton),"clicked",G_CALLBACK(__on_service_disable_clicked),window);
|
||||
|
||||
|
||||
if (!system(window->check_enable_command)){
|
||||
gtk_label_set_text(GTK_LABEL(window->EnableLabel),yon_char_get_localised_from_lib(_SERVICE_ENABLE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->EnableImage),service_start_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
} else {
|
||||
gtk_label_set_text(GTK_LABEL(window->EnableLabel),yon_char_get_localised_from_lib(_SERVICE_DISABLE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->EnableImage),service_stop_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
}
|
||||
if (!system(window->check_active_command)){
|
||||
gtk_label_set_text(GTK_LABEL(window->ActiveLabel),yon_char_get_localised_from_lib(_SERVICE_ACTIVE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->ActiveImage),service_start_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
} else {
|
||||
gtk_label_set_text(GTK_LABEL(window->ActiveLabel),yon_char_get_localised_from_lib(_SERVICE_INACTIVE_LABEL));
|
||||
gtk_image_set_from_icon_name(GTK_IMAGE(window->ActiveImage),service_stop_status_icon_name,GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
}
|
||||
return window;
|
||||
}
|
||||
|
||||
void yon_service_window_run(service_window *window){
|
||||
if (window){
|
||||
gtk_widget_show(window->MainWindow);
|
||||
gtk_main();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
#include "libublsettingsui-gtk3.h"
|
||||
|
||||
char *config_get_default_command = NULL;
|
||||
char *config_get_global_command = NULL;
|
||||
char *config_get_local_command = NULL;
|
||||
char *config_get_custom_command = NULL;
|
||||
char *config_get_global_only_command = NULL;
|
||||
char *config_get_local_only_command = NULL;
|
||||
|
||||
char *config_set_global_local_command = NULL;
|
||||
char *config_set_global_command = NULL;
|
||||
char *config_set_local_command = NULL;
|
||||
char *config_set_custom_command = NULL;
|
||||
|
||||
int __yon_load_proceed(YON_CONFIG_TYPE type){
|
||||
if (type!=YON_CONFIG_CUSTOM){
|
||||
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){
|
||||
if (yon_config_load_config(type,config_get_global_command,NULL)){
|
||||
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
}
|
||||
}
|
||||
else if (type==YON_CONFIG_LOCAL){
|
||||
if (yon_config_load_config(type,config_get_local_command,NULL)){
|
||||
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
}
|
||||
} else if (type==YON_CONFIG_CUSTOM){
|
||||
char *path;
|
||||
textdomain(template_ui_LocaleName);
|
||||
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
||||
gtk_window_set_icon_name(GTK_WINDOW(dialog),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
|
||||
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);
|
||||
}
|
||||
yon_config_clean();
|
||||
char *final_command = yon_config_parameter_prepare_command(config_get_custom_command,file,NULL,NULL);
|
||||
if (yon_config_load_config(type,final_command,NULL)){
|
||||
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
} else {
|
||||
gtk_widget_destroy(dialog);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void __on_config_local_load(GtkWidget *){
|
||||
__yon_load_proceed(YON_CONFIG_LOCAL);
|
||||
template_config->load_mode=1;
|
||||
}
|
||||
|
||||
void __on_config_global_load(GtkWidget *){
|
||||
__yon_load_proceed(YON_CONFIG_GLOBAL);
|
||||
template_config->load_mode=0;
|
||||
|
||||
}
|
||||
|
||||
void __on_config_custom_load(GtkWidget *){
|
||||
__yon_load_proceed(YON_CONFIG_CUSTOM);
|
||||
template_config->load_mode=3;
|
||||
}
|
||||
|
||||
void __on_config_global_local_save(){
|
||||
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL);
|
||||
}
|
||||
|
||||
void __on_config_global_save(){
|
||||
yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_global_command,NULL);
|
||||
}
|
||||
|
||||
void __on_config_local_save(){
|
||||
yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_global_command,NULL);
|
||||
}
|
||||
|
||||
void __on_config_custom_save(){
|
||||
yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_custom_command,NULL);
|
||||
}
|
||||
|
||||
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);
|
||||
g_signal_connect(G_OBJECT(widgets->SaveGlobalMenuItem),"activate",G_CALLBACK(__on_config_global_load),NULL);
|
||||
config_get_global_command = yon_char_new(get_global_command);
|
||||
config_set_global_command = yon_char_replace_single(get_global_command,"get","set");
|
||||
}
|
||||
if (!yon_char_is_empty(get_global_command)){
|
||||
g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(__on_config_local_load),NULL);
|
||||
g_signal_connect(G_OBJECT(widgets->SaveLocalMenuItem),"activate",G_CALLBACK(__on_config_local_save),NULL);
|
||||
config_get_local_command = yon_char_new(get_local_command);
|
||||
config_set_local_command = yon_char_replace_single(get_local_command,"get","set");
|
||||
}
|
||||
if (!yon_char_is_empty(get_global_command)){
|
||||
g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(__on_config_custom_load),NULL);
|
||||
g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(__on_config_custom_load),NULL);
|
||||
config_get_custom_command = yon_char_new(get_custom_command);
|
||||
config_set_custom_command = yon_char_replace_single(get_custom_command,"get","set");
|
||||
}
|
||||
if (!yon_char_is_empty(get_default_command)) config_get_default_command = yon_char_new(get_default_command);
|
||||
if (!yon_char_is_empty(get_global_only_command)) config_get_global_only_command = yon_char_new(get_global_only_command);
|
||||
if (!yon_char_is_empty(get_local_only_command)) config_get_local_only_command = yon_char_new(get_local_only_command);
|
||||
}
|
||||
|
||||
int yon_ubl_settings_window_remove_standard_callbacks(template_main_window *window){
|
||||
|
||||
}
|
||||