Merge pull request 'master' (#98) from YanTheKaller/ubl-settings-manager:master into master

Reviewed-on: #98
master v2.18
Dmitry Razumov 1 month ago
commit 5732d9bb24

@ -44,7 +44,7 @@ void on_gnome_activate(GtkWidget *,GtkListBoxRow *self, gnome_theme_struct *them
} }
char *file_param = NULL; char *file_param = NULL;
if (yon_window_config_get_parameter(yon_configuration_window_section,"file",&file_param,YON_TYPE_STRING)){ if (yon_window_config_get_parameter(yon_configuration_window_section,"file",&file_param,YON_TYPE_STRING)){
char *file_arg = yon_char_unite("--file ",file_param,NULL); char *file_arg = yon_char_unite("--config ",file_param,NULL);
char *temp = yon_char_append_element(command_args,file_arg," "); char *temp = yon_char_append_element(command_args,file_arg," ");
if (!yon_char_is_empty(command_args)) free(command_args); if (!yon_char_is_empty(command_args)) free(command_args);
command_args = temp; command_args = temp;

@ -57,6 +57,15 @@ void on_main_activate(GtkFlowBox* , GtkFlowBoxChild* child, main_theme_struct *t
command_args = yon_char_unite("--socket-id=",main_socket_id,NULL); command_args = yon_char_unite("--socket-id=",main_socket_id,NULL);
} }
char *file_param = NULL;
if (yon_window_config_get_parameter(yon_configuration_window_section,"file",&file_param,YON_TYPE_STRING)){
char *file_arg = yon_char_unite("--config ",file_param,NULL);
char *temp = yon_char_append_element(command_args,file_arg," ");
if (!yon_char_is_empty(command_args)) free(command_args);
command_args = temp;
}
yon_debug_output("%s ",command);
yon_debug_output("%s\n",command_args);
yon_launch_app_with_arguments(command,command_args); yon_launch_app_with_arguments(command,command_args);
} }

@ -232,6 +232,7 @@ int main(int argc, char *argv[]){
{"help", 0, 0, 'h'}, {"help", 0, 0, 'h'},
{"version", 0, 0, 'v'}, {"version", 0, 0, 'v'},
{"clear-config", 0,0, 'c'}, {"clear-config", 0,0, 'c'},
{"config", 1, 0, 'f'},
}; };
int option_index=0; int option_index=0;
for (int i=0;i<argc;i++){ for (int i=0;i<argc;i++){
@ -241,7 +242,7 @@ int main(int argc, char *argv[]){
main_config.lock_settings=1; main_config.lock_settings=1;
break; break;
case 'h': case 'h':
printf("%s\n",HELP_LABEL(NULL)); printf("%s\n",HELP_MANAGER_LABEL);
exit(0); exit(0);
break; break;
case 'v': case 'v':
@ -253,6 +254,11 @@ int main(int argc, char *argv[]){
if (chown(path,user->pw_uid,user->pw_gid)){}; if (chown(path,user->pw_uid,user->pw_gid)){};
if (system(remove_config_dir_command)){}; if (system(remove_config_dir_command)){};
break; break;
case 'f':
main_config.force_ini = yon_char_new(optarg);
main_config.config_load_path = template_config->force_ini;
main_config.config_save_path = template_config->force_ini;
break;
} }
} }
gtk_init(&argc, &argv); gtk_init(&argc, &argv);

@ -51,8 +51,6 @@
#define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/" #define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/"
#define LocalePath "/usr/share/locale" #define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-manager" #define LocaleName "ubl-settings-manager"
#define ubl_settings_infoPath "ubl-settings-info"
#define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id="
#define launch_command(target) yon_char_unite("xdg-open ",target,NULL) #define launch_command(target) yon_char_unite("xdg-open ",target,NULL)
#define launch_args_command(main_socket,load_socket,save_socket) yon_char_unite("--socket-id=",main_socket," --socket-ext-id=",save_socket," --socket-trd-id=",load_socket,NULL) #define launch_args_command(main_socket,load_socket,save_socket) yon_char_unite("--socket-id=",main_socket," --socket-ext-id=",save_socket," --socket-trd-id=",load_socket,NULL)

@ -1,6 +1,21 @@
#define TITLE_LABEL _("Settings manager for the system") #define TITLE_LABEL _("Settings manager for the system")
#define TITLE_INFO_LABEL _("About Settings manager for the system") #define TITLE_INFO_LABEL _("About Settings manager for the system")
#define HELP_MANAGER_LABEL yon_char_unite(template_app_information.app_tech_name,yon_char_get_localised_from_lib(" version:")," ", !yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",\
template_app_information.app_title,"\n",yon_char_get_localised_from_lib("Usage:"), " ",template_app_information.app_tech_name," ",yon_char_get_localised_from_lib("[OPTIONS]"),"\n",\
yon_char_get_localised_from_lib("Options:"),"\n",\
" --help, -h ",yon_char_get_localised_from_lib("Show this help"),"\n",\
" --version, -V ",yon_char_get_localised_from_lib("Show package version"),"\n",\
" --lock-help ",yon_char_get_localised_from_lib("Lock this help menu"),"\n",\
" --lock-save ",yon_char_get_localised_from_lib("Lock configuration saving"),"\n",\
" --lock-save-local ",yon_char_get_localised_from_lib("Lock local configration saving"),"\n",\
" --lock-save-global ",yon_char_get_localised_from_lib("Lock global configration saving"),"\n",\
" --lock-load-global ",yon_char_get_localised_from_lib("Lock global configration loading"),"\n",\
" --clear-config, -c ",yon_char_get_localised_from_lib("Reset application settings"),"\n",\
" --config <PATH>, -f <PATH> ",yon_char_get_localised_from_lib("Set ini file for configuration mode"),"\n",\
" --debug ",yon_char_get_localised_from_lib("Enable debug mode"),"\n",\
NULL)
#define WIKI_LINK _("https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-manager") #define WIKI_LINK _("https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-manager")
#define ABOUT_PROJECT_COMMENTS_LABEL _("Settings manager for the system") #define ABOUT_PROJECT_COMMENTS_LABEL _("Settings manager for the system")

Loading…
Cancel
Save