Added pacman update dialog

pull/110/head
parent a90625fe99
commit 19c3d26f00

@ -360,3 +360,6 @@ msgid ""
"the module!" "the module!"
msgstr "" msgstr ""
#: source/ubl-strings.h:98
msgid "Update the repository databases?"
msgstr ""

@ -374,3 +374,7 @@ msgstr ""
msgid "Add drivers for current hardware components only" msgid "Add drivers for current hardware components only"
msgstr "Добавить драйвера только текущих аппаратных компонентов" msgstr "Добавить драйвера только текущих аппаратных компонентов"
#: source/ubl-strings.h:98
msgid "Update the repository databases?"
msgstr "Обновить базы данных репозитория?"

@ -1547,6 +1547,11 @@ void on_paned_position_changed(GtkWidget *, GdkEvent*,main_window *widgets){
gtk_paned_set_position(GTK_PANED(widgets->TerminalPaned),size-40); gtk_paned_set_position(GTK_PANED(widgets->TerminalPaned),size-40);
} }
void on_database_update(void *,void *widgets){
yon_terminal_window_launch(GTK_WINDOW(((main_window*)widgets)->Window),pacman_update_command,yon_char_get_localised_from_lib(SUCCESS_LABEL),yon_char_get_localised_from_lib(FAIL_LABEL));
}
/**yon_main_window_complete(main_window *widgets) /**yon_main_window_complete(main_window *widgets)
* [EN] * [EN]
* *
@ -1621,7 +1626,7 @@ void yon_main_window_complete(main_window *widgets){
if (getuid()){ if (getuid()){
on_update_clicked(NULL,widgets); on_update_clicked(NULL,widgets);
gtk_widget_set_sensitive(widgets->BuildingButton,0); gtk_widget_set_sensitive(widgets->BuildingButton,0);
} else { }
GdkRGBA rgba; GdkRGBA rgba;
vte_terminal_get_color_background_for_draw(VTE_TERMINAL(widgets->InstallTerminal),&rgba); vte_terminal_get_color_background_for_draw(VTE_TERMINAL(widgets->InstallTerminal),&rgba);
vte_terminal_set_color_cursor(VTE_TERMINAL(widgets->InstallTerminal),&rgba); vte_terminal_set_color_cursor(VTE_TERMINAL(widgets->InstallTerminal),&rgba);
@ -1630,11 +1635,18 @@ void yon_main_window_complete(main_window *widgets){
vte_terminal_set_size(VTE_TERMINAL(widgets->InstallTerminal),columns,20); vte_terminal_set_size(VTE_TERMINAL(widgets->InstallTerminal),columns,20);
yon_save_window_set_postsave_function(on_save_done,widgets); if (system(yon_check_database_command)){
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text=DATABASE_UNACCESSIBLE_LABEL;
data->function = on_database_update;
data->data = widgets;
yon_confirmation_dialog_call(widgets->HeadOverlay,data);
}
gtk_button_clicked(GTK_BUTTON(widgets->MoreButton)); // gtk_button_clicked(GTK_BUTTON(widgets->MoreButton));
yon_terminal_integrated_start(widgets->InstallTerminal,pacman_update_command); // yon_terminal_integrated_start(widgets->InstallTerminal,pacman_update_command);
}
yon_save_window_set_postsave_function(on_save_done,widgets);
yon_gtk_widget_set_scroll_window_for_scroll(gtk_widget_get_parent(widgets->InstallTerminal),GTK_SCROLLBAR(widgets->TerminalScroll)); yon_gtk_widget_set_scroll_window_for_scroll(gtk_widget_get_parent(widgets->InstallTerminal),GTK_SCROLLBAR(widgets->TerminalScroll));
} }
yon_load_proceed(YON_CONFIG_LOCAL); yon_load_proceed(YON_CONFIG_LOCAL);

@ -48,12 +48,14 @@
#define get_kernel_changelog_command(target) yon_char_unite("find /usr/lib/modules/ -maxdepth 2 -type f -iname \"pkgbase\" -exec grep -il \"",target,"\" {} + | xargs dirname | xargs -I {} cat \"{}/changelog\"", NULL) #define get_kernel_changelog_command(target) yon_char_unite("find /usr/lib/modules/ -maxdepth 2 -type f -iname \"pkgbase\" -exec grep -il \"",target,"\" {} + | xargs dirname | xargs -I {} cat \"{}/changelog\"", NULL)
#define get_package_info_command(target) yon_char_append("pacman -Si ",target) #define get_package_info_command(target) yon_char_append("pacman -Si ",target)
#define get_package_is_installed_command(target) yon_char_append("pacman -Qq ",target) #define get_package_is_installed_command(target) yon_char_append("pacman -Qq ",target)
#define pacman_update_command "pacman -Sy"
#define install_command(target) yon_char_append("pacman -Sy --noconfirm ",target) #define install_command(target) yon_char_append("pacman -Sy --noconfirm ",target)
#define remove_command(target) yon_char_append("pacman -R --noconfirm ",target) #define remove_command(target) yon_char_append("pacman -R --noconfirm ",target)
#define get_dependent_command(target) yon_char_append("pactree -rl ",target) #define get_dependent_command(target) yon_char_append("pactree -rl ",target)
#define check_pactree_exist_command "which pactree > /dev/null 2>&1" #define check_pactree_exist_command "which pactree > /dev/null 2>&1"
#define yon_check_database_command "pacman -Sqs >/dev/null"
#define pacman_update_command "pacsync --updated"
#define get_active_kernel_command "cat /usr/lib/modules/$(uname -r)/pkgbase" #define get_active_kernel_command "cat /usr/lib/modules/$(uname -r)/pkgbase"
@ -320,3 +322,4 @@ void on_terminal_cancel(GtkWidget *,main_window *widgets);
void on_pacman_db_unlock(void); void on_pacman_db_unlock(void);
void on_paned_position_changed(GtkWidget *, GdkEvent*,main_window *widgets); void on_paned_position_changed(GtkWidget *, GdkEvent*,main_window *widgets);
gboolean on_terminal_check_progress(main_window *widgets); gboolean on_terminal_check_progress(main_window *widgets);
void on_database_update(void *,void *widgets);

@ -97,3 +97,4 @@
#define UPDATE_ADDITION_MODULE_TITLE_LABEL _("Update addition module") #define UPDATE_ADDITION_MODULE_TITLE_LABEL _("Update addition module")
#define UPDATE_ADDITION_PACKAGE_TITLE_LABEL _("Update addition package") #define UPDATE_ADDITION_PACKAGE_TITLE_LABEL _("Update addition package")
#define KERNEL_PACKAGE_INSTALL_ATTENTION_LABEL _("Attention! If you work in sandbox mode, you must install the package with the module!") #define KERNEL_PACKAGE_INSTALL_ATTENTION_LABEL _("Attention! If you work in sandbox mode, you must install the package with the module!")
#define DATABASE_UNACCESSIBLE_LABEL _("Update the repository databases?")

Loading…
Cancel
Save