Merge pull request 'devel' (#1) from devel into master

Reviewed-on: YanTheKaller/ubl-settings-manager#1
pull/2/head
commit 42db085045

@ -0,0 +1,241 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="360"
height="360"
version="1.0"
id="svg36"
sodipodi:docname="ublinux-dark-glow-sc.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
inkscape:export-filename="/media/Data/ShareMX/temp/archtoub_icons/ublinux.png"
inkscape:export-xdpi="68.26667"
inkscape:export-ydpi="68.26667"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs40">
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Drop Shadow"
id="filter2327-6-3"
x="-0.14509785"
y="-0.44791076"
width="1.2901957"
height="1.8958215">
<feFlood
flood-opacity="0"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood2317-0-6" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite2319-6-1" />
<feGaussianBlur
in="composite1"
stdDeviation="80"
result="blur"
id="feGaussianBlur2321-2-2" />
<feOffset
dx="0"
dy="0"
result="offset"
id="feOffset2323-6-9" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="fbSourceGraphic"
id="feComposite2325-1-3" />
<feColorMatrix
result="fbSourceGraphicAlpha"
in="fbSourceGraphic"
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
id="feColorMatrix2435" />
<feFlood
id="feFlood2437"
flood-opacity="0.698039"
flood-color="rgb(255,255,255)"
result="flood"
in="fbSourceGraphic" />
<feComposite
in2="fbSourceGraphic"
id="feComposite2439"
in="flood"
operator="in"
result="composite1" />
<feGaussianBlur
id="feGaussianBlur2441"
in="composite1"
stdDeviation="159.96"
result="blur" />
<feOffset
id="feOffset2443"
dx="-1.94289e-16"
dy="3.05311e-16"
result="offset" />
<feComposite
in2="offset"
id="feComposite2445"
in="fbSourceGraphic"
operator="over"
result="composite2" />
</filter>
</defs>
<sodipodi:namedview
id="namedview38"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="1.0347222"
inkscape:cx="-3.8657719"
inkscape:cy="134.81879"
inkscape:window-width="1920"
inkscape:window-height="1027"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="text4648-6-8-1" />
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1"
style="display:none">
<g
transform="translate(-201.63,22.962)"
id="g34">
<path
d="m 381.06,24.896 c -8.7636,21.486 -14.055,35.559 -23.813,56.406 5.9823,6.3413 13.325,13.691 25.25,22.031 -12.821,-5.2756 -21.558,-10.535 -28.094,-16.031 -12.487,26.056 -32.08,63.133 -71.781,134.47 31.198,-18.011 55.398,-29.104 77.938,-33.344 -0.96715,-4.1618 -1.5061,-8.6782 -1.4688,-13.375 l 0.0312,-0.96875 c 0.49515,-19.992 10.899,-35.388 23.219,-34.344 12.319,1.0438 21.901,18.133 21.406,38.125 -0.0931,3.7597 -0.50934,7.3639 -1.25,10.719 22.29,4.3659 46.232,15.424 77,33.188 -6.0696,-11.174 -11.514,-21.219 -16.688,-30.812 -8.1493,-6.3162 -16.63,-14.538 -33.969,-23.438 11.918,3.0967 20.474,6.6628 27.125,10.656 -52.602,-97.935 -56.868,-110.95 -74.906,-153.28 z"
fill="#1793d1"
fill-rule="evenodd"
id="path2" />
<text
x="475.51663"
y="207.00311"
fill="#87cdde"
font-family="'DejaVu Sans Mono'"
stroke-width="1px"
style="line-height:0%"
xml:space="preserve"
id="text6"><tspan
x="475.51663"
y="207.00311"
font-size="6.1069px"
style="line-height:1.25"
id="tspan4">TM</tspan></text>
<g
transform="matrix(0.47879,0,0,0.47879,65.332,87.93)"
fill="#ffffff"
fill-rule="evenodd"
id="g16">
<path
d="m 339.97,309.09 c -14.471,-0.0239 -26.481,2.9437 -31.125,4.5625 l -4.7812,25.812 c -0.0116,0.0951 23.795,-6.3486 34.281,-5.9688 17.362,0.62381 18.959,6.6354 18.656,14.75 0.29595,0.47462 -4.4793,-7.3319 -19.5,-7.5938 -18.95,-0.32687 -45.693,6.7095 -45.656,35.312 -0.51086,32.174 24.034,41.639 40.75,41.812 15.028,-0.27364 22.078,-5.6914 25.938,-8.5938 5.0712,-5.3024 10.873,-10.634 16.406,-17.031 -5.2357,9.5128 -9.7747,16.09 -14.5,21.125 v 4.25 l 22.844,-3.8438 0.15625,-62.094 c -0.23141,-8.7884 5.0412,-42.418 -43.469,-42.5 z m -3.2812,54.062 c 9.4689,0.12995 20.328,4.7971 20.344,16.031 0.049,10.218 -12.8,15.712 -21.156,15.625 -8.3598,-0.0868 -19.451,-6.5698 -19.5,-16.531 0.16016,-8.9044 10.46,-15.354 20.312,-15.125 z"
id="path8" />
<path
d="m 398.5,314.83 -0.15505,102.83 26.612,-5.1272 0.0449,-58.302 c 0.006,-8.6809 12.406,-18.825 27.963,-18.663 3.302,-5.9741 9.5087,-21.242 11.021,-24.715 -34.756,-0.0833 -35.199,9.9899 -41.244,14.945 -0.0631,-9.4528 -0.0213,-15.127 -0.0213,-15.127 z"
id="path10" />
<path
d="m 548.27,328.33 c -0.25696,-0.12068 -13.879,-15.934 -41.266,-16.059 -25.652,-0.42638 -54.426,9.519 -54.886,52.533 0.22457,37.819 27.64,52.598 55.031,52.886 29.313,0.30451 40.977,-18.329 41.676,-18.791 -3.4976,-3.0321 -16.598,-16.013 -16.598,-16.013 0,0 -8.1824,11.651 -24.058,11.799 -15.879,0.1512 -29.682,-12.273 -29.878,-29.609 -0.20349,-17.336 12.689,-26.728 29.997,-27.487 14.985,-0.003 23.63,9.6733 23.63,9.6733 z"
id="path12" />
<path
d="m 581.81,278.84 -25.125,5.9062 0.1875,133.94 24.75,-4.4688 0.28125,-63.031 c 0.0529,-6.6093 9.5613,-16.759 25.438,-16.438 15.18,0.15775 18.572,10.118 18.531,11.375 l 0.4375,72.969 24.406,-4.3125 0.0937,-77.375 c 0.1607,-7.4454 -16.308,-23.17 -42.781,-23.281 -12.581,0.0202 -19.548,2.8682 -23.094,4.9688 -6.0666,4.6856 -13,9.1754 -19.812,14.906 6.2981,-8.091 11.586,-13.685 16.75,-17.844 z"
id="path14" />
</g>
<g
transform="matrix(0.70885,0,0.010031,0.70885,96.753,-223.33)"
fill="#1793d1"
fill-rule="evenodd"
id="g28">
<path
d="m 400.68,629.8 7.6817,-1.9158 -0.92851,91.208 -7.7957,1.3243 z"
id="path18" />
<path
d="m 421.1,657.02 6.7506,-2.9867 -0.86808,65.399 -6.4978,1.3392 z m -1.2606,-23.583 5.4717,-4.4153 4.4226,4.9995 -5.4756,4.5322 z"
id="path20" />
<path
d="m 440.44,655.83 7.6776,-1.562 -0.1573,13.672 c -0.007,0.58717 4.4194,-15.274 24.685,-14.921 19.68,0.10952 22.684,15.346 22.529,18.762 l -0.43759,48.078 -6.7304,1.4563 0.63316,-47.489 c 0.0974,-1.3868 -2.8814,-13.114 -16.789,-13.158 -13.905,-0.0404 -23.684,10.1 -23.758,16.579 l -0.48127,41.835 -7.8039,2.0313 z"
id="path22" />
<path
d="m 561.53,720.2 -7.6776,1.5619 0.15737,-13.672 c 0.007,-0.58742 -4.422,15.274 -24.685,14.921 -19.68,-0.10944 -22.684,-15.346 -22.529,-18.762 l 0.43757,-48.079 8.1567,-1.6423 -0.54644,47.49 c -0.0149,1.2968 1.3684,13.3 15.276,13.343 13.905,0.0405 23.766,-8.3736 24.015,-21.044 l 0.43105,-37.469 7.5978,-1.932 z"
id="path24" />
<path
d="m 577.45,655.29 -5.4272,4.2002 20.199,26.933 -22.391,31.116 5.635,4.226 21.044,-28.897 20.878,29.582 5.3273,-4.201 -22.376,-31.629 18.57,-25.578 -5.5319,-4.7343 -16.921,23.668 z"
id="path26" />
</g>
<text
x="550.83258"
y="284.34351"
fill="#87cdde"
font-family="'DejaVu Sans Mono'"
stroke-width="1px"
style="line-height:0%"
xml:space="preserve"
id="text32"><tspan
x="550.83258"
y="284.34351"
font-size="6.3363px"
style="line-height:1.25"
id="tspan30">TM</tspan></text>
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2">
<g
id="g866"
style="display:inline"
transform="matrix(2.8604707,0,0,2.8604707,-28.282302,-401.23688)">
<path
sodipodi:type="star"
style="display:inline;fill:#0d597f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.264583;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path9225"
sodipodi:sides="6"
sodipodi:cx="103.70058"
sodipodi:cy="104.69581"
sodipodi:r1="89.197571"
sodipodi:r2="77.247368"
sodipodi:arg1="1.0471976"
sodipodi:arg2="1.5707963"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
transform="matrix(0,0.48761957,-0.48761957,0,123.86572,140.10617)"
d="m 148.29936,181.94317 -89.197572,0 -44.598782,-77.24737 44.598789,-77.247356 89.197575,4e-6 44.59878,77.247362 z" />
<path
d="m 68.071141,169.19256 h 16.33386 c 3.39111,0 5.86851,0.11539 7.43219,0.34611 1.58252,0.23075 3.1462,0.74032 4.69104,1.5287 1.601349,0.82684 2.788229,1.94211 3.560659,3.34582 0.79125,1.38448 1.18689,2.97085 1.18689,4.75912 0,2.07672 -0.53691,3.91307 -1.61078,5.50906 -1.07385,1.57676 -2.590419,2.80742 -4.549739,3.69195 v 0.23074 c 2.750559,0.55764 4.926539,1.71138 6.527889,3.46119 1.6202,1.74981 2.43031,4.0573 2.43031,6.92239 0,2.07672 -0.41448,3.93227 -1.24342,5.56672 -0.8101,1.63445 -1.93104,2.99009 -3.36285,4.06691 -1.65787,1.26908 -3.485299,2.17283 -5.482289,2.71125 -1.97817,0.53841 -4.49323,0.80556 -7.54524,0.80761 l -18.52368,0.0125 -7.65381,-0.005 c -6.160521,0 -10.823301,-1.38471 -13.988341,-4.15412 -3.1462,-2.76939 -4.7193,-6.7445 -4.7193,-11.92538 v -26.87542 h 10.90808 v 26.25285 c 0,2.92012 0.61229,5.09609 1.83685,6.52789 1.22457,1.4318 3.21214,2.14769 5.962711,2.14769 2.71289,0 4.69104,-0.68761 5.93445,-2.06289 1.26225,-1.37529 1.89338,-3.57951 1.88394,-6.64543 z m 22.09875,12.14301 c 0,-0.71147 -0.17897,-1.42295 -0.53692,-2.13441 -0.33911,-0.71146 -0.9514,-1.24025 -1.83686,-1.58638 -0.79125,-0.30766 -1.78033,-0.47111 -2.96722,-0.49033 -1.16805,-0.0384 -2.81651,-0.0576 -4.94537,-0.0576 h -1.01734 v 9.08561 h 1.69556 c 1.7144,0 3.17445,-0.0288 4.38018,-0.0864 1.20573,-0.0577 2.15713,-0.24993 2.85419,-0.57687 0.97966,-0.44226 1.6202,-1.00952 1.92164,-1.70175 0.30143,-0.71148 0.45214,-1.52869 0.45214,-2.45167 z m 2.65637,17.479 c 0,-1.36526 -0.26375,-2.41322 -0.79126,-3.14391 -0.50866,-0.74993 -1.3847,-1.30755 -2.62811,-1.6729 -0.84778,-0.24997 -2.01582,-0.38457 -3.50415,-0.40382 -1.48832,-0.0193 -3.04259,-0.0289 -4.66278,-0.0289 h -2.37378 v 10.70083 h 0.79127 c 3.05199,0 5.23738,-0.009 6.55615,-0.0288 1.31876,-0.0192 2.53391,-0.26918 3.64544,-0.74991 1.13036,-0.48072 1.90279,-1.11526 2.31726,-1.90365 0.43331,-0.80763 0.64996,-1.7306 0.64996,-2.76895 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:50.8px;line-height:1.25;font-family:Verdana;-inkscape-font-specification:'Verdana Bold';letter-spacing:0px;word-spacing:0px;display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.113933;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;enable-background:new"
id="path4640-7-5-9-7"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscccsccccscccscccsccscscccscccsccssccssscccsccssccss" />
</g>
<g
aria-label="Linux"
transform="matrix(0.05476725,0,0,0.05476725,-46.447362,267.18595)"
id="text4648-6-8-1"
style="font-weight:bold;font-size:1683.65px;line-height:1.25;font-family:'Century Gothic';-inkscape-font-specification:'Century Gothic Bold';letter-spacing:0px;word-spacing:0px;display:inline;fill:#4d4d4d;stroke-width:8.769;filter:url(#filter2327-6-3);enable-background:new">
<path
d="m 2150.1859,55.619904 h 230.1865 V 1045.422 h 335.4147 v 219.4993 h -565.6012 z"
id="path3719" />
<path
d="m 2954.1945,2.1837463 q 59.1908,0 101.1177,42.7489267 42.7489,42.748926 42.7489,103.583937 0,60.01292 -41.9268,102.76184 -41.9269,41.92683 -100.2956,41.92683 -60.0129,0 -102.7618,-42.74892 -41.9269,-43.57102 -41.9269,-105.22813 0,-59.19082 41.9269,-101.117652 41.9268,-41.9268317 101.1176,-41.9268317 z M 2841.5675,370.48219 h 225.254 v 894.43911 h -225.254 z"
id="path3721" />
<path
d="m 3269.8789,370.48219 h 223.6098 v 91.25252 q 76.4548,-64.12339 138.1119,-88.78624 62.4792,-25.48493 127.4247,-25.48493 133.1793,0 226.076,92.8967 78.099,78.9211 78.099,233.47491 V 1264.9213 H 3841.2347 V 872.78207 q 0,-160.30847 -14.7977,-212.92253 -13.9756,-52.61407 -50.1478,-79.74319 -35.35,-27.95122 -87.9641,-27.95122 -68.2339,0 -117.5595,46.0373 -48.5036,45.21521 -67.4118,125.7805 -9.8651,41.92683 -9.8651,181.68293 v 359.25544 h -223.6098 z"
id="path3723" />
<path
d="m 4279.4112,370.48219 h 226.8981 v 430.77764 q 0,125.7805 17.264,175.10618 17.264,48.50359 55.0803,75.63269 38.6385,27.1292 94.5409,27.1292 55.9025,0 94.5409,-26.3071 39.4606,-27.1291 58.3688,-78.92107 13.9756,-38.63846 13.9756,-165.24105 V 370.48219 h 225.2539 v 378.98567 q 0,234.297 -36.9942,320.61694 -45.2152,105.2281 -133.1794,161.9527 -87.9641,55.9024 -223.6098,55.9024 -147.1549,0 -238.4074,-65.7676 -90.4304,-65.7675 -127.4247,-183.3271 -26.307,-81.38737 -26.307,-295.95409 z"
id="path3725" />
<path
d="m 5210.0225,370.48219 h 260.604 l 175.1062,244.16214 177.5724,-244.16214 h 258.1378 l -305.8193,423.37879 343.6356,471.06032 h -260.604 L 5645.7327,971.43344 5435.2764,1264.9213 h -257.3156 l 338.703,-471.06032 z"
id="path3727" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

@ -13,6 +13,8 @@
#include <pthread.h> #include <pthread.h>
#include<sys/utsname.h> #include<sys/utsname.h>
#include<sys/sysinfo.h> #include<sys/sysinfo.h>
#include <math.h>
#include <wctype.h>
#include "ubl-settings-manager.h" #include "ubl-settings-manager.h"
@ -35,7 +37,7 @@ int cmld=0;
void on_plug_added(GtkSocket* self, actionWidgets *builder){ void on_plug_added(GtkSocket* self, actionWidgets *builder){
printf("Plug has been added!\n"); //printf("Plug has been added!\n");
gtk_widget_set_vexpand(builder->HideWhileLaunch,0); gtk_widget_set_vexpand(builder->HideWhileLaunch,0);
gtk_widget_hide(builder->HideWhileLaunch); gtk_widget_hide(builder->HideWhileLaunch);
gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1);
@ -47,18 +49,15 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){
} }
void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){
//gtk_box_pack_start(GTK_BOX(widgets->workingwindow),widgets->HideWhileLaunch,TRUE,TRUE,10);
gtk_widget_show(widgets->HideWhileLaunch); gtk_widget_show(widgets->HideWhileLaunch);
//gtk_widget_hide(widgets->socketplace);
gtk_widget_set_vexpand(widgets->socketplace,0); gtk_widget_set_vexpand(widgets->socketplace,0);
gtk_widget_set_vexpand(widgets->HideWhileLaunch,1); gtk_widget_set_vexpand(widgets->HideWhileLaunch,1);
printf("Plug has been removed!\n\n\n"); //printf("Plug has been removed!\n\n\n");
} }
void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){
printf("\n\n\nActivated\n\n\n"); //printf("\n\n\nActivated\n\n\n");
GtkTreeIter iter; GtkTreeIter iter;
char *name; char *name;
gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path); gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path);
@ -97,11 +96,11 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets
memset(arg,0,100); memset(arg,0,100);
sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket))); sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)));
if (tempapp[0].Type==1) if (tempapp[0].Type==2)
if (tempapp->Pluggable==1) if (tempapp->Pluggable==1)
py_launch_app(tempapp[0].Exec,arg); py_launch_app(tempapp[0].Exec,arg);
else py_launch_app(tempapp[0].Exec,""); else py_launch_app(tempapp[0].Exec,"");
else{ else if (tempapp[0].Type==1){
if (tempapp->Pluggable==1) if (tempapp->Pluggable==1)
launch_app_with_arguments(tempapp[0].Exec,arg); launch_app_with_arguments(tempapp[0].Exec,arg);
else launch_app(tempapp[0].Exec); else launch_app(tempapp[0].Exec);
@ -151,11 +150,12 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){
gtk_widget_hide(window); gtk_widget_hide(window);
}; };
int on_settings_accept(GtkWidget *button, dictionary *widgetsD){ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
dictionary *widgetsD=*widgetsDs;
printf("Saving config...\n"); printf("Saving config...\n");
actionWidgets *widgets=(actionWidgets*)widgetsD->data; actionWidgets *widgets=(actionWidgets*)widgetsD->data;
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY);
int theme=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser)); int theme=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser));
if (theme==0) if (theme==0)
@ -173,9 +173,11 @@ int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); gtk_window_present(GTK_WINDOW(widgets->SettingsWindow));
gtk_widget_hide(widgets->window); gtk_widget_hide(widgets->window);
if (yon_dictionary_find(&widgetsD,main_config.curThemeName)==NULL){ if (yon_dictionary_find(&widgetsD,main_config.curThemeName)==NULL){
widgetsD->next=yon_theme_new(yon_dictionary_create_empty(),widgets->builder,main_config.curThemeName,widgets->applist,widgets->appssize); dictionary *DCT=yon_dictionary_create_empty();
widgetsD->next=yon_theme_new(&DCT,widgets->builder,main_config.curThemeName,widgets->applist,widgets->appssize);
widgetsD->next->prev=widgetsD; widgetsD->next->prev=widgetsD;
yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,main_config.curThemeName));
yon_switch_theme(widgetsDs,yon_dictionary_find(&widgetsD,main_config.curThemeName));
widgets=(actionWidgets*)widgetsD->data; widgets=(actionWidgets*)widgetsD->data;
widgets->ICSys=yon_create_icon_section_list(main_config.sections); widgets->ICSys=yon_create_icon_section_list(main_config.sections);
for (dictionary *cur=widgets->ICSys->first; cur!=NULL;cur=cur->next){ for (dictionary *cur=widgets->ICSys->first; cur!=NULL;cur=cur->next){
@ -184,8 +186,10 @@ int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
yon_show_icon_views(widgets->ICSys,widgets); yon_show_icon_views(widgets->ICSys,widgets);
} }
yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,main_config.curThemeName)); yon_switch_theme(widgetsDs,yon_dictionary_find(&widgetsD,main_config.curThemeName));
if (widgets!=(actionWidgets*)widgetsD->data) widgets=(actionWidgets*)widgetsD->data; if (widgets!=(actionWidgets*)widgetsD->data) widgets=(actionWidgets*)widgetsD->data;
gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight);
gtk_window_move(GTK_WINDOW(widgets->window),main_config.windowPosX,main_config.windowPosY);
gtk_widget_show(widgets->window); gtk_widget_show(widgets->window);
gtk_widget_hide(loaderWindow); gtk_widget_hide(loaderWindow);
main_config.WindowTheme=theme; main_config.WindowTheme=theme;
@ -224,12 +228,13 @@ int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets){ /* TODO */ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets){ /* TODO */
int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned)); int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned));
printf("Paned moved to %d\n",position);
position-=70;
if (position <115) position=115; if (position <115) position=115;
double pos=((double)position-(1/(double)position*4)*500)/1.8;
if (pos<110) pos=110;
//printf("Paned moved to %f\n",pos);
for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){
IVGraphicals *IV=(IVGraphicals*)dict->data; IVGraphicals *IV=(IVGraphicals*)dict->data;
gtk_icon_view_set_item_width(GTK_ICON_VIEW(IV->IV),position); gtk_icon_view_set_item_width(GTK_ICON_VIEW(IV->IV),pos);
} }
@ -556,7 +561,72 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){
} }
} }
} }
void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){
actionWidgets *widgets=(actionWidgets*)widgetsD->data;
gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY);
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
dictionary *dct;
if (yon_dictionary_find(&widgetsD,"Main")==NULL){
dct=yon_dictionary_create_empty();
dictionary *newd=yon_theme_new(&dct,widgets->builder,"Main", widgets->applist,widgets->appssize);
widgetsD->next=newd;
newd->prev=widgetsD;
newd->first=widgetsD;
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
widgetss->ICSys=yon_create_icon_section_list(main_config.sections);
for (dictionary *cur=widgetss->ICSys->first; cur!=NULL;cur=cur->next){
load_apps((IVGraphicals*)cur->data,widgetss->applist,widgetss->appssize);
}
yon_show_icon_views(widgetss->ICSys,widgetss);
}
dictionary *newdd;
if (yon_dictionary_find(&widgetsD,"Gnome")==NULL){
newdd=yon_theme_new(&dct,widgets->builder,"Gnome", widgets->applist,widgets->appssize);
widgetsD->next=newdd;
newdd->prev=widgetsD;
newdd->first=widgetsD;
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
widgetss->ICSys=yon_create_icon_section_list(main_config.sections);
for (dictionary *cur=widgetss->ICSys->first; cur!=NULL;cur=cur->next){
load_apps((IVGraphicals*)cur->data,widgetss->applist,widgetss->appssize);
}
yon_show_icon_views(widgetss->ICSys,widgetss);
}
if (main_config.WindowTheme==1){
printf("\nAaAaAaAa\n");
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
GtkWidget *loaderWindow=GTK_WIDGET(gtk_builder_get_object(widgets->builder,"LoaderWindow"));
// gtk_window_resize(GTK_WINDOW(widgetss->window),main_config.windowWidth,main_config.windowHeight);
widgetsD=yon_dictionary_find(&widgetsD,"Gnome");
if (gtk_widget_get_visible(widgetss->window)==1){
widgetsD=yon_dictionary_find(&widgetsD,"Gnome");
gtk_window_resize(GTK_WINDOW(widgetss->window),1025,721);
if (main_config.windowWidth<1024&&main_config.windowHeight<720){
gtk_widget_hide(widgetss->window);
gtk_combo_box_set_active(GTK_COMBO_BOX(widgetss->settingsThemeChooser),0);
widgetsD=yon_dictionary_find(&widgetsD,"Main");
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
// gtk_window_resize(GTK_WINDOW(widgetss->window),1023,719);
gtk_widget_show(widgetss->window);
}
} else {
widgetsD=yon_dictionary_find(&widgetsD,"Main");
gtk_window_resize(GTK_WINDOW(widgetss->window),1024,720);
if (main_config.windowWidth>1024&&main_config.windowHeight>720){
gtk_widget_hide(widgetss->window);
gtk_combo_box_set_active(GTK_COMBO_BOX(widgetss->settingsThemeChooser),1);
widgetsD=yon_dictionary_find(&widgetsD,"Gnome");
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
// gtk_window_resize(GTK_WINDOW(widgetss->window),1025,721);
gtk_widget_show(widgetss->window);
}
}
}else {
}
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
}
void launch_app_with_arguments(char *name, char *args){ void launch_app_with_arguments(char *name, char *args){
char *path=malloc(strlen(name)+strlen(args)+4); char *path=malloc(strlen(name)+strlen(args)+4);
memset(path,0,strlen(name)+strlen(args)+4); memset(path,0,strlen(name)+strlen(args)+4);
@ -920,6 +990,9 @@ int setup_config(){
main_config.sections->next=NULL; main_config.sections->next=NULL;
} }
if (main_config.windowWidth<1024&&main_config.windowHeight<720){
main_config.WindowTheme=0;
}
}; };
@ -1013,6 +1086,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){
if (main_config.WindowTheme==1) { if (main_config.WindowTheme==1) {
gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1); gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1);
gtk_widget_set_name(iv,"GnomeIcon"); gtk_widget_set_name(iv,"GnomeIcon");
gtk_icon_view_set_activate_on_single_click(GTK_ICON_VIEW(iv),1);
gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL);
} }
@ -1087,6 +1161,13 @@ dictionary *yon_section_new(dictionary *section, char *section_name, char *categ
return section; return section;
} }
void yon_icv_resize_item(dictionary *icdict, GtkWidget *paned){
for (dictionary *dict=icdict->first;dict!=NULL;dict=dict->next){
IVGraphicals *icv=(IVGraphicals*)dict->data;
gtk_icon_view_set_item_width(GTK_ICON_VIEW(icv->IV),gtk_paned_get_position(GTK_PANED(paned)));
}
}
char *yon_char_get_augumented(char *source, char *append){ char *yon_char_get_augumented(char *source, char *append){
int size=strlen(source)+strlen(append)+1; int size=strlen(source)+strlen(append)+1;
char *final=malloc(size); char *final=malloc(size);
@ -1100,7 +1181,10 @@ int yon_show_icon_views(dictionary *IVS,actionWidgets *widgets){
IVGraphicals *iv=dct->data; IVGraphicals *iv=dct->data;
gtk_widget_show_all(iv->Box); gtk_widget_show_all(iv->Box);
gtk_box_pack_start(GTK_BOX(widgets->icvpack),iv->Box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(widgets->icvpack),iv->Box,FALSE,FALSE,0);
if (main_config.WindowTheme==0)
g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_Item_activated),widgets); g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_Item_activated),widgets);
else if (main_config.WindowTheme==1)
g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_gnome_Item_activated),widgets);
g_signal_connect(G_OBJECT(iv->IV),"selection-changed",G_CALLBACK(on_item_selection_changed),widgets); g_signal_connect(G_OBJECT(iv->IV),"selection-changed",G_CALLBACK(on_item_selection_changed),widgets);
} }
@ -1193,34 +1277,12 @@ SectionSettingSegment *yon_create_section_setting(char *name, char *categories){
gtk_widget_set_margin_top(segment->DragButtonBox,3); gtk_widget_set_margin_top(segment->DragButtonBox,3);
gtk_widget_set_margin_end(segment->DragUpButton,3); gtk_widget_set_margin_end(segment->DragUpButton,3);
// gtk_widget_set_halign(segment->ElemBox,GTK_ALIGN_FILL);
// gtk_widget_set_halign(segment->NameBox,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->CategoriesBox,GTK_ALIGN_START);
gtk_widget_set_halign(segment->NameEntry,GTK_ALIGN_START); gtk_widget_set_halign(segment->NameEntry,GTK_ALIGN_START);
gtk_widget_set_halign(segment->NameLabel,GTK_ALIGN_END); gtk_widget_set_halign(segment->NameLabel,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->CategoriesEntry,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->CategoriesLabel,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->EditButtonAccept,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->EditButtonBox,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->EditButtonCancel,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->ButtonEdit,GTK_ALIGN_END);
// gtk_widget_set_valign(segment->ElemBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->NameBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->CategoriesBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->NameEntry,GTK_ALIGN_START);
// gtk_widget_set_valign(segment->NameLabel,GTK_ALIGN_START);
// gtk_widget_set_valign(segment->CategoriesEntry,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->CategoriesLabel,GTK_ALIGN_CENTER);
gtk_widget_set_valign(segment->OptionBox,GTK_ALIGN_CENTER); gtk_widget_set_valign(segment->OptionBox,GTK_ALIGN_CENTER);
gtk_label_set_xalign(GTK_LABEL(segment->NameLabel),0); gtk_label_set_xalign(GTK_LABEL(segment->NameLabel),0);
gtk_label_set_xalign(GTK_LABEL(segment->CategoriesLabel),0); gtk_label_set_xalign(GTK_LABEL(segment->CategoriesLabel),0);
// gtk_widget_set_hexpand(segment->ElemBox,1);
// gtk_widget_set_hexpand(segment->NameEntry,1);
// gtk_widget_set_hexpand(segment->NameLabel,1);
// gtk_widget_set_hexpand(segment->CategoriesEntry,1);
// gtk_widget_set_hexpand(segment->CategoriesLabel,1);
gtk_widget_set_vexpand(segment->ElemBox,0); gtk_widget_set_vexpand(segment->ElemBox,0);
gtk_widget_set_vexpand(segment->NameBox,0); gtk_widget_set_vexpand(segment->NameBox,0);
@ -1271,9 +1333,6 @@ void yon_segments_hide(actionWidgets *widgets){
for (dictionary *dict=widgets->SettingsSections->first;dict!=NULL;dict=dict->next){ for (dictionary *dict=widgets->SettingsSections->first;dict!=NULL;dict=dict->next){
SectionSettingSegment *sgm=(SectionSettingSegment*)dict->data; SectionSettingSegment *sgm=(SectionSettingSegment*)dict->data;
if (sgm!=NULL){ if (sgm!=NULL){
//GKeyFile *gfile=g_key_file_new();
//g_key_file_load_from_file(gfile,".config/ubconfig-main/ubconfig-main.conf",G_KEY_FILE_NONE,NULL);
//g_key_file_set_string(gfile,"sections",gtk_label_get_text(GTK_LABEL(sgm->NameLabel)),gtk_label_get_text(GTK_LABEL(sgm->CategoriesLabel)));
g_object_ref(G_OBJECT(sgm->MainFrame)); g_object_ref(G_OBJECT(sgm->MainFrame));
gtk_container_remove(GTK_CONTAINER(widgets->SectionSettingsPack),sgm->MainFrame); gtk_container_remove(GTK_CONTAINER(widgets->SectionSettingsPack),sgm->MainFrame);
} else return; } else return;
@ -1285,11 +1344,15 @@ void yon_dictionary_make_first(dictionary *dict){
} }
} }
void yon_small_window_theme_change(actionWidgets *widgets){
}
dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *theme_id, apps *applist, int appsize){
dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_id, apps *applist, int appsize){ dictionary *widgets=*widgetss;
actionWidgets *curWidgets=(actionWidgets*)widgets->data; actionWidgets *curWidgets=(actionWidgets*)widgets->data;
if (!curWidgets) { if (curWidgets==NULL) {
curWidgets=malloc(sizeof(actionWidgets)); curWidgets=malloc(sizeof(actionWidgets));
widgets->data=curWidgets; widgets->data=curWidgets;
} }
@ -1306,31 +1369,59 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_
curWidgets->icvpack=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"icvpack"))); curWidgets->icvpack=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"icvpack")));
curWidgets->GnomePaned=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Paned"))); curWidgets->GnomePaned=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Paned")));
curWidgets->GnomeInfoLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"InfoLabel"))); curWidgets->GnomeInfoLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"InfoLabel")));
curWidgets->GnomeInfoDetailsLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"InfoDetailsLabel")));
curWidgets->SettingsSections=NULL; curWidgets->SettingsSections=NULL;
gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview");
if (curWidgets->GnomeInfoLabel!=NULL){
struct utsname sysinfos; if (curWidgets->GnomeInfoLabel!=NULL&&curWidgets->GnomeInfoDetailsLabel!=NULL){
uname(&sysinfos); FILE *fp;
printf("System Name = %s\n", sysinfos.sysname); char path[1035];
printf("Node Name = %s\n", sysinfos.nodename); char *loc=setlocale(LC_ALL,NULL);
printf("Version = %s\n", sysinfos.version); if (strcmp(loc,"ru_RU.UTF-8")==0)
printf("Release = %s\n", sysinfos.release); fp = popen("screenfetch -N -n | sed 's/OS:/Система:/' | sed 's/Kernel:/Ядро:/g' | sed 's/Uptime:/Время работы:/g' | \
printf("Machine = %s\n", sysinfos.machine); sed 's/Packages:/Установлено пакетов:/g' | sed 's/Shell:/Оболочка:/g' | sed 's/Resolution:/Разрешение:/g' | sed 's/DE:/Среда рабочего стола:/g' | \
struct sysinfo info; sed 's/WM:/Оконный менеджер:/g' | sed 's/WM Theme:/Тема оконного менеджера:/g' | sed 's/GTK Theme:/Тема GTK:/g' | sed 's/Icon Theme:/Тема значков:/g' | sed 's/Font:/Шрифт:/g' | \
sysinfo(&info); sed 's/Disk:/Диск:/g' | sed 's/RAM:/Оперативная память:/g'", "r");
char lbl[2000]; else fp = popen("screenfetch -n -w -N", "r");
memset(lbl,0,2000); if (fp == NULL) {
sprintf(lbl,"Система: %s\nЯдро: %s %s %s\nВремя работы: %\n\nОперативная память: %f/%f",sysinfos.sysname,sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,info.totalram/1024/1024,info.freeram/1024/1024); printf("Failed to run command\n" );
gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoLabel),lbl); exit(1);
printf("\n\n%d\n\n",info.totalram/1024/1024); }
printf("\n\n%d\n\n",info.freeram/1024/1024); char *line=NULL;
line="";
char *prevline="";
char *pth;
char *preph="";
line="";
while (fgets(path, sizeof(path),fp)!=NULL){
line=strstr(path,": ");
if (line!=NULL){
int size=strlen(path)-strlen(line);
pth=yon_cut(path,size,0);
pth=yon_char_get_augumented("<span color='#1a5fb4'>",pth);
pth=yon_char_get_augumented(pth,"</span>");
line=yon_char_get_augumented(pth,line);
} else {
line=path;
pth="<span size=\"14pt\">\n";
line=yon_char_get_augumented(pth,line);
}
prevline=yon_char_get_augumented(prevline,line);
};
prevline=yon_char_get_augumented(prevline,"</span>");;
gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoDetailsLabel),prevline);
// gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoLabel),pth);
gtk_label_set_markup (GTK_LABEL(curWidgets->GnomeInfoDetailsLabel),prevline);;
// gtk_label_set_markup (GTK_LABEL(curWidgets->GnomeInfoLabel), pth);;
} }
if (curWidgets->ButtonBackToMain!=NULL) if (curWidgets->ButtonBackToMain!=NULL)
gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to settings")); gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to settings"));
gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager"); gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager");
g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets);
if (curWidgets->ButtonBackToMain!=NULL) if (curWidgets->ButtonBackToMain!=NULL)
g_signal_connect(G_OBJECT(curWidgets->ButtonBackToMain), "clicked", G_CALLBACK(on_backToSettingsButton_clicked), curWidgets); g_signal_connect(G_OBJECT(curWidgets->ButtonBackToMain), "clicked", G_CALLBACK(on_backToSettingsButton_clicked), curWidgets);
curWidgets->LabelTitle=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"LabelTitle")); curWidgets->LabelTitle=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"LabelTitle"));
@ -1376,20 +1467,21 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_
gtk_window_set_icon_from_file(GTK_WINDOW(curWidgets->SectionSettingsWindow),AppIconPath,NULL); gtk_window_set_icon_from_file(GTK_WINDOW(curWidgets->SectionSettingsWindow),AppIconPath,NULL);
// hide_if_unfound(GTK_TREE_MODEL(curWidgets); // hide_if_unfound(GTK_TREE_MODEL(curWidgets);
if (gnld==0){
gnld=1;
g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder); g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder);
g_signal_connect(G_OBJECT(curWidgets->CancelHelpButton), "clicked", G_CALLBACK(on_CancelHelpButton_activated), curWidgets->builder); g_signal_connect(G_OBJECT(curWidgets->CancelHelpButton), "clicked", G_CALLBACK(on_CancelHelpButton_activated), curWidgets->builder);
g_signal_connect(G_OBJECT(curWidgets->ReadHelpButton), "clicked", G_CALLBACK(on_ReadHelpButton_activated), curWidgets->builder); g_signal_connect(G_OBJECT(curWidgets->ReadHelpButton), "clicked", G_CALLBACK(on_ReadHelpButton_activated), curWidgets->builder);
g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets); g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->settingsSizeSlider), "value-changed", G_CALLBACK(on_settings_icon_size_changed), curWidgets); g_signal_connect(G_OBJECT(curWidgets->settingsSizeSlider), "value-changed", G_CALLBACK(on_settings_icon_size_changed), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->settingsCancel), "clicked", G_CALLBACK(on_settings_cancel), curWidgets); g_signal_connect(G_OBJECT(curWidgets->settingsCancel), "clicked", G_CALLBACK(on_settings_cancel), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->settingsAccept), "clicked", G_CALLBACK(on_settings_accept), widgets); g_signal_connect(G_OBJECT(curWidgets->settingsAccept), "clicked", G_CALLBACK(on_settings_accept), widgetss);
g_signal_connect(G_OBJECT(curWidgets->settingsSectionsSettingsButton), "clicked", G_CALLBACK(on_section_settings_open), widgets); g_signal_connect(G_OBJECT(curWidgets->settingsSectionsSettingsButton), "clicked", G_CALLBACK(on_section_settings_open), widgets);
g_signal_connect(G_OBJECT(curWidgets->SectionSettingAddButton), "clicked", G_CALLBACK(on_sections_add), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingAddButton), "clicked", G_CALLBACK(on_sections_add), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->SectionSettingsClearEntryButton), "clicked", G_CALLBACK(on_sections_new_clear), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingsClearEntryButton), "clicked", G_CALLBACK(on_sections_new_clear), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->SectionSettingsCloseButton), "clicked", G_CALLBACK(on_sections_close), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingsCloseButton), "clicked", G_CALLBACK(on_sections_close), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->SectionSettingsSaveButton), "clicked", G_CALLBACK(on_sections_save), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingsSaveButton), "clicked", G_CALLBACK(on_sections_save), curWidgets);
// сделать функцию для сигналов окна секций, секции для настроек в словарь }// сделать функцию для сигналов окна секций, секции для настроек в словарь
gtk_label_set_text(GTK_LABEL(curWidgets->LabelTitle),_("UBLinux Settings Manager")); gtk_label_set_text(GTK_LABEL(curWidgets->LabelTitle),_("UBLinux Settings Manager"));
gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size"));
gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelTheme),_("Window theme")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelTheme),_("Window theme"));
@ -1426,7 +1518,7 @@ int main(int argc, char *argv[]){
if (main_config.WindowTheme==0) theme="Main"; if (main_config.WindowTheme==0) theme="Main";
else if (main_config.WindowTheme==1) theme="Gnome"; else if (main_config.WindowTheme==1) theme="Gnome";
else theme="Main"; else theme="Main";
yon_theme_new(widgets->first, builder,theme,applist,*size); yon_theme_new(&widgets->first, builder,theme,applist,*size);
widg->applist=applist; widg->applist=applist;
widg->appssize=*size; widg->appssize=*size;
widg->ICSys=yon_create_icon_section_list(main_config.sections); widg->ICSys=yon_create_icon_section_list(main_config.sections);

@ -126,7 +126,7 @@ typedef struct {
GtkWidget *SectionSettingsClearEntryButton; GtkWidget *SectionSettingsClearEntryButton;
GtkWidget *SectionSettingsSaveButton; GtkWidget *SectionSettingsSaveButton;
GtkWidget *SectionSettingsCloseButton; GtkWidget *SectionSettingsCloseButton;
GtkWidget *GnomeInfoDetailsLabel;
int appssize; int appssize;
apps *applist; apps *applist;
GtkWidget *icvpack; GtkWidget *icvpack;
@ -154,7 +154,7 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder);
void launch_app_with_arguments(char *name, char *args); void launch_app_with_arguments(char *name, char *args);
void launch_app(char *name); void launch_app(char *name);
void py_launch_app(char *name,char *args); void py_launch_app(char *name,char *args);
int on_settings_accept(GtkWidget *button, dictionary *widgetsD); int on_settings_accept(GtkWidget *button, dictionary **widgetsDs);
void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets); void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets);
int on_settingsOpen(GtkWidget *button, actionWidgets *widgets); int on_settingsOpen(GtkWidget *button, actionWidgets *widgets);
int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets); int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets);
@ -169,7 +169,7 @@ void sort_apps(apps *applist,int size);
apps *find_apps(int *sizef); apps *find_apps(int *sizef);
int check_categories(apps app, char *catstocheck); int check_categories(apps app, char *catstocheck);
int setup_config(); int setup_config();
dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_id, apps *applist, int appsize); dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *theme_id, apps *applist, int appsize);
char *yon_char_get_augumented(char *source, char *append); char *yon_char_get_augumented(char *source, char *append);
char *yon_cut(char *source, int size, int startpos); char *yon_cut(char *source, int size, int startpos);
int yon_set_sections(IconSection *section); int yon_set_sections(IconSection *section);

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkWindow">
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">label</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</interface>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -235,6 +235,20 @@
<column type="gchararray"/> <column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property> <property name="lower">1</property>
<property name="upper">5</property> <property name="upper">5</property>
@ -321,7 +335,7 @@
<property name="height-request">64</property> <property name="height-request">64</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="pixbuf">../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property> <property name="pixbuf">../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -935,7 +949,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">3</property> <property name="margin-left">3</property>
<property name="margin-right">3</property>
<property name="margin-start">3</property> <property name="margin-start">3</property>
<property name="margin-end">3</property> <property name="margin-end">3</property>
<property name="margin-top">3</property> <property name="margin-top">3</property>
@ -968,6 +981,7 @@
<object class="GtkFrame"> <object class="GtkFrame">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">3</property>
<property name="margin-right">3</property> <property name="margin-right">3</property>
<property name="margin-start">3</property> <property name="margin-start">3</property>
<property name="margin-end">3</property> <property name="margin-end">3</property>
@ -984,11 +998,14 @@
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="stock">gtk-missing-image</property> <property name="halign">end</property>
<property name="pixbuf">../images/ublinux-dark-glow-sc.svg</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -996,17 +1013,45 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox" id="infobox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child> <child>
<object class="GtkLabel" id="GnomeInfoLabel"> <object class="GtkLabel" id="GnomeInfoLabel">
<property name="name">desklabel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">fsdfhsdftj</property> <property name="valign">center</property>
<property name="wrap">True</property> <property name="justify">right</property>
<property name="xalign">0</property> <property name="xalign">1</property>
<property name="yalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="GnomeInfoDetailsLabel">
<property name="name">desclabel</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">label</property>
<attributes>
<attribute name="weight" value="medium"/>
</attributes>
</object>
<packing>
<property name="expand">False</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="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
@ -1127,7 +1172,7 @@
<object class="GtkImage"> <object class="GtkImage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="pixbuf">../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property> <property name="pixbuf">../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property>
<property name="icon_size">5</property> <property name="icon_size">5</property>
</object> </object>
</child> </child>
@ -1317,7 +1362,7 @@
<object class="GtkImage"> <object class="GtkImage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="pixbuf">../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property> <property name="pixbuf">../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property>
<property name="icon_size">5</property> <property name="icon_size">5</property>
</object> </object>
</child> </child>
@ -1521,7 +1566,7 @@
<object class="GtkImage"> <object class="GtkImage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="pixbuf">../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property> <property name="pixbuf">../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg</property>
<property name="icon_size">5</property> <property name="icon_size">5</property>
</object> </object>
</child> </child>

Loading…
Cancel
Save