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

Reviewed-on: YanTheKaller/ubl-settings-manager#28
pull/27/head
commit 912668b923

@ -431,6 +431,7 @@ void on_sections_cancel(GtkWidget *button, actionWidgets *widgets){
gtk_widget_hide(segment->CategoriesEntry);
gtk_widget_hide(segment->EditButtonBox);
gtk_widget_show(segment->ButtonEdit);
gtk_widget_show(segment->DeleditBox);
gtk_widget_set_sensitive(segment->DragButtonBox,1);
}else {
@ -961,6 +962,7 @@ int setup_config(){
FILE *file;
GError *err=NULL;
main_config.sections=yon_dictionary_create_empty();
main_config.lock_settings=0;
GKeyFile *configfile = g_key_file_new();
char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin()));
sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath);
@ -1371,8 +1373,8 @@ SectionSettingSegment *yon_create_section_setting(char *name, char *categories){
gtk_widget_set_size_request(segment->ElemBox,0,20);
segment->DragButtonBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
gtk_widget_set_name(segment->DragButtonBox,"noborders");
segment->DragUpButton=gtk_button_new_from_icon_name("gtk-goto-top",GTK_ICON_SIZE_BUTTON);
segment->DragDownButton=gtk_button_new_from_icon_name("gtk-goto-bottom",GTK_ICON_SIZE_BUTTON);
segment->DragUpButton=gtk_button_new_from_icon_name("go-top-symbolic",GTK_ICON_SIZE_BUTTON);
segment->DragDownButton=gtk_button_new_from_icon_name("go-bottom-symbolic",GTK_ICON_SIZE_BUTTON);
segment->NameBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
segment->CategoriesBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
segment->OptionBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
@ -1388,11 +1390,11 @@ SectionSettingSegment *yon_create_section_setting(char *name, char *categories){
gtk_entry_set_text(GTK_ENTRY(segment->CategoriesEntry),categories);
segment->CategoriesLabel=gtk_label_new(categories);
segment->EditButtonBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
segment->EditButtonAccept=gtk_button_new_from_icon_name("dialog-ok",GTK_ICON_SIZE_BUTTON);
segment->EditButtonCancel=gtk_button_new_from_icon_name("dialog-no",GTK_ICON_SIZE_BUTTON);
segment->ButtonEdit=gtk_button_new_from_icon_name("gtk-edit",GTK_ICON_SIZE_BUTTON);
segment->EditButtonAccept=gtk_button_new_from_icon_name("emblem-ok-symbolic",GTK_ICON_SIZE_BUTTON);
segment->EditButtonCancel=gtk_button_new_from_icon_name("process-stop-symbolic",GTK_ICON_SIZE_BUTTON);
segment->ButtonEdit=gtk_button_new_from_icon_name("document-edit-symbolic",GTK_ICON_SIZE_BUTTON);
segment->DeleditBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
segment->ButtonDelete=gtk_button_new_from_icon_name("edit-delete",GTK_ICON_SIZE_BUTTON);
segment->ButtonDelete=gtk_button_new_from_icon_name("edit-delete-symbolic",GTK_ICON_SIZE_BUTTON);
gtk_widget_set_name(segment->NameLabel,"SegName");
gtk_widget_set_name(segment->CategoriesLabel,"SegCat");
@ -1572,7 +1574,9 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
curWidgets->MenuItemDocumentation=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemDocumentation")));
curWidgets->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemAboutSystem")));
curWidgets->SettingsSections=NULL;
if (main_config.lock_settings==1){
gtk_widget_set_sensitive(curWidgets->MenuItemSettings,0);
}
gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview");
curWidgets->socket=GTK_WIDGET(create_socket(curWidgets));
if (curWidgets->ButtonBackToMain!=NULL)
@ -1591,7 +1595,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
if (curWidgets->ButtonBackToMain!=NULL)
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"));
gtk_window_set_title(GTK_WINDOW(curWidgets->window),_("UBLinux Settings Manager"));
gtk_window_set_title(GTK_WINDOW(curWidgets->window),_("UBLinux Settings Manager"));
// Standard for all themes
@ -1673,6 +1677,15 @@ int main(int argc, char *argv[]){
printf("Ошибка загрузки конфига!\n");
return -1;
}
static struct option long_options[] = {
{"lock-settings", 0, 0, 'l'},
};
int socket_find;
int option_index=0;
for (int i=0;i<argc;i++){
socket_find=getopt_long(argc,argv,"",long_options,&option_index);
if (socket_find=='l') main_config.lock_settings=1;
}
local=setlocale(LC_ALL, "");
textdomain (LocaleName);
actionWidgets *widget=NULL;

@ -3,6 +3,7 @@
#include <gtk/gtk.h>
#include <time.h>
#include <getopt.h>
#define GladePath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager.glade"
@ -79,6 +80,7 @@ typedef struct {
char *lastUser;
int changed;
int fullscreen;
int lock_settings;
} config;
typedef struct {

Loading…
Cancel
Save