add notification of transaction finished

This commit is contained in:
2020-03-29 21:51:10 -03:00
parent 49dc0c20a0
commit 06672f6f1f
93 changed files with 1465 additions and 107 deletions

View File

@@ -1,4 +1,5 @@
posix
libnotify
atk
cairo
gdk-3.0

View File

@@ -4,7 +4,7 @@ cfg_pamac.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('datadir'
cfg_pamac.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac.set('RELEASE_NAME', 'pamac')
cfg_pamac.set('PREFIX', get_option('prefix'))
cfg_pamac.set('VERSION', '7.1.3')
cfg_pamac.set('VERSION', '7.2.0')
cfg_pamac.set('TESTSRCDIR', meson.source_root())
cfgfile_1 = configure_file(
@@ -12,7 +12,8 @@ cfgfile_1 = configure_file(
output: 'Config.vala',
configuration: cfg_pamac)
pamac_deps = [atk_dep]
pamac_deps = [libnotify_dep]
pamac_deps += [atk_dep]
pamac_deps += [cairo_dep]
pamac_deps += [gdk_3_0_dep]
pamac_deps += [gdk_pixbuf_2_0_dep]
@@ -69,7 +70,7 @@ Pamac_library = shared_library('Pamac', pamac_sources,
vala_args: pamac_vala_args,
c_args: pamac_c_args,
link_args: pamac_link_args,
version: '7.1.3',
version: '7.2.0',
soversion: '7',
install: true,
install_dir: [true, true, true, true])
@@ -82,6 +83,7 @@ custom_target('Pamac typelib', command: [g_ir_compiler, '--shared-library=libPam
install_dir: join_paths(get_option('libdir'), 'girepository-1.0'))
pamac_requires = []
pamac_requires += ['libnotify']
pamac_requires += ['atk']
pamac_requires += ['cairo']
pamac_requires += ['gdk-3.0']
@@ -98,7 +100,7 @@ pamac_requires += ['vte-2.91']
pamac_requires += ['x11']
pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : Pamac_library,
version : '7.1.3',
version : '7.2.0',
name : 'Pamac',
filebase : 'Pamac',
description : 'Pamac',

View File

@@ -4,7 +4,7 @@ cfg_pamac_clean_cache.set('PKGDATADIR', join_paths(get_option('prefix'),get_opti
cfg_pamac_clean_cache.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_clean_cache.set('RELEASE_NAME', 'pamac')
cfg_pamac_clean_cache.set('PREFIX', get_option('prefix'))
cfg_pamac_clean_cache.set('VERSION', '7.1.3')
cfg_pamac_clean_cache.set('VERSION', '7.2.0')
cfg_pamac_clean_cache.set('TESTSRCDIR', meson.source_root())
cfgfile_4 = configure_file(

View File

@@ -4,7 +4,7 @@ cfg_pamac_install.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('
cfg_pamac_install.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_install.set('RELEASE_NAME', 'pamac')
cfg_pamac_install.set('PREFIX', get_option('prefix'))
cfg_pamac_install.set('VERSION', '7.1.3')
cfg_pamac_install.set('VERSION', '7.2.0')
cfg_pamac_install.set('TESTSRCDIR', meson.source_root())
cfgfile_5 = configure_file(

View File

@@ -4,7 +4,7 @@ cfg_pamac_manager.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('
cfg_pamac_manager.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_manager.set('RELEASE_NAME', 'pamac')
cfg_pamac_manager.set('PREFIX', get_option('prefix'))
cfg_pamac_manager.set('VERSION', '7.1.3')
cfg_pamac_manager.set('VERSION', '7.2.0')
cfg_pamac_manager.set('TESTSRCDIR', meson.source_root())
cfgfile_6 = configure_file(

View File

@@ -4,7 +4,7 @@ cfg_pamac_system_daemon.set('PKGDATADIR', join_paths(get_option('prefix'),get_op
cfg_pamac_system_daemon.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_system_daemon.set('RELEASE_NAME', 'pamac')
cfg_pamac_system_daemon.set('PREFIX', get_option('prefix'))
cfg_pamac_system_daemon.set('VERSION', '7.1.3')
cfg_pamac_system_daemon.set('VERSION', '7.2.0')
cfg_pamac_system_daemon.set('TESTSRCDIR', meson.source_root())
cfgfile_7 = configure_file(

View File

@@ -4,7 +4,7 @@ cfg_pamac_tray.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('dat
cfg_pamac_tray.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_tray.set('RELEASE_NAME', 'pamac')
cfg_pamac_tray.set('PREFIX', get_option('prefix'))
cfg_pamac_tray.set('VERSION', '7.1.3')
cfg_pamac_tray.set('VERSION', '7.2.0')
cfg_pamac_tray.set('TESTSRCDIR', meson.source_root())
cfgfile_3 = configure_file(

View File

@@ -4,7 +4,7 @@ cfg_pamac_user_daemon.set('PKGDATADIR', join_paths(get_option('prefix'),get_opti
cfg_pamac_user_daemon.set('GETTEXT_PACKAGE', 'pamac')
cfg_pamac_user_daemon.set('RELEASE_NAME', 'pamac')
cfg_pamac_user_daemon.set('PREFIX', get_option('prefix'))
cfg_pamac_user_daemon.set('VERSION', '7.1.3')
cfg_pamac_user_daemon.set('VERSION', '7.2.0')
cfg_pamac_user_daemon.set('TESTSRCDIR', meson.source_root())
cfgfile_2 = configure_file(

View File

@@ -1992,7 +1992,18 @@ namespace Pamac {
this.success = success;
// needed before build_aur_packages and remove_makedeps
no_confirm_commit = false;
Notify.init ("pamac-classic");
if (success) {
string summary = dgettext (null, "Transaction successful");
string body = dgettext (null, "The transaction has been completed successfully");
string icon = "system-software-install";
Notify.Notification notification = new Notify.Notification (summary, body, icon);
try {
notification.show ();
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
show_warnings ();
to_load.remove_all ();
#if DISABLE_AUR
@@ -2034,6 +2045,16 @@ namespace Pamac {
}
#endif
} else {
string summary = dgettext (null, "Transaction failed");
string body = dgettext (null, "The transaction failed and no packages have been updated/installed");
string icon = "system-software-install";
Notify.Notification notification = new Notify.Notification (summary, body, icon);
try {
notification.show ();
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
}
// if it is an authentication or a download error, database was not modified
var err = get_current_error ();
if (err.message == dgettext (null, "Authentication failed")
@@ -2056,6 +2077,9 @@ namespace Pamac {
warning_textbuffer = new StringBuilder ();
handle_error (err);
}
Notify.uninit ();
total_download = 0;
already_downloaded = 0;
previous_filename = "";