fix installer not being able to run while a pamac window is open

This commit is contained in:
2017-11-11 23:06:04 -03:00
parent 3a9ee17692
commit c430e497e3
100 changed files with 1009 additions and 712 deletions

View File

@@ -7,7 +7,7 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
@@ -15,7 +15,7 @@ configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.base ${CMAKE_BINARY_DIR}/src
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/pamacclassic.pc ${CMAKE_CURRENT_BINARY_DIR}/pamacclassic.pc)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/pamacclassic.deps ${CMAKE_CURRENT_BINARY_DIR}/pamacclassic.deps)
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
link_libraries ( ${DEPS_LIBRARIES} )
link_directories ( ${DEPS_LIBRARY_DIRS} )
@@ -101,7 +101,7 @@ add_dependencies( pamacclassic ${pamacclassic_DEPENDENCIES} )
target_link_libraries( pamacclassic m )
set_target_properties( pamacclassic PROPERTIES
VERSION
6.6.1
6.6.2
SOVERSION
6 )

View File

@@ -4,7 +4,7 @@ cfg_pamac_classic.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('
cfg_pamac_classic.set('GETTEXT_PACKAGE', 'pamac-classic')
cfg_pamac_classic.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_classic.set('PREFIX', get_option('prefix'))
cfg_pamac_classic.set('VERSION', '6.6.1')
cfg_pamac_classic.set('VERSION', '6.6.2')
cfg_pamac_classic.set('TESTSRCDIR', meson.source_root())
cfgfile_1 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_classic)
@@ -59,7 +59,7 @@ pamac_classic_deps += [meson.get_compiler('c').find_library('m', required : fals
pamac_classic_vala_args += ['--gir=pamacclassic-6.0.gir']
pamacclassic_library = shared_library('pamacclassic',pamac_classic_sources,dependencies: pamac_classic_deps,vala_args: pamac_classic_vala_args,c_args: pamac_classic_c_args,version: '6.6.1',soversion: '6',install: true)
pamacclassic_library = shared_library('pamacclassic',pamac_classic_sources,dependencies: pamac_classic_deps,vala_args: pamac_classic_vala_args,c_args: pamac_classic_c_args,version: '6.6.2',soversion: '6',install: true)
pamac_classic_requires = []
pamac_classic_requires += ['gdk-3.0']
@@ -74,7 +74,7 @@ pamac_classic_requires += ['glib-2.0']
pamac_classic_requires += ['gobject-2.0']
pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : pamacclassic_library,
version : '6.6.1',
version : '6.6.2',
name : 'pamacclassic',
filebase : 'pamacclassic',
description : 'pamacclassic',

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-clean-cache/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-clean-cache/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src )
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )

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-classic')
cfg_pamac_clean_cache.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_clean_cache.set('PREFIX', get_option('prefix'))
cfg_pamac_clean_cache.set('VERSION', '6.6.1')
cfg_pamac_clean_cache.set('VERSION', '6.6.2')
cfg_pamac_clean_cache.set('TESTSRCDIR', meson.source_root())
cfgfile_4 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_clean_cache)

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-install/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-install/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src )
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )

View File

@@ -23,7 +23,6 @@ namespace Pamac {
public class Installer: Gtk.Application {
Transaction transaction;
ProgressDialog progress_dialog;
bool pamac_run;
bool important_details;
public Installer () {
@@ -38,75 +37,41 @@ namespace Pamac {
base.startup ();
pamac_run = check_pamac_running ();
if (pamac_run) {
var msg = new Gtk.MessageDialog (null,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.OK,
dgettext (null, "Pamac is already running"));
msg.run ();
msg.destroy ();
} else {
important_details = false;
// integrate progress box and term widget
progress_dialog = new ProgressDialog ();
transaction = new Transaction (progress_dialog as Gtk.ApplicationWindow);
transaction.mode = Transaction.Mode.INSTALLER;
transaction.finished.connect (on_transaction_finished);
transaction.important_details_outpout.connect (on_important_details_outpout);
progress_dialog.box.pack_start (transaction.progress_box);
progress_dialog.box.reorder_child (transaction.progress_box, 0);
transaction.term_window.height_request = 200;
progress_dialog.expander.add (transaction.term_window);
progress_dialog.close_button.clicked.connect (on_close_button_clicked);
progress_dialog.close_button.visible = false;
this.hold ();
}
important_details = false;
// integrate progress box and term widget
progress_dialog = new ProgressDialog ();
transaction = new Transaction (progress_dialog as Gtk.ApplicationWindow);
transaction.mode = Transaction.Mode.INSTALLER;
transaction.finished.connect (on_transaction_finished);
transaction.important_details_outpout.connect (on_important_details_outpout);
progress_dialog.box.pack_start (transaction.progress_box);
progress_dialog.box.reorder_child (transaction.progress_box, 0);
transaction.term_window.height_request = 200;
progress_dialog.expander.add (transaction.term_window);
progress_dialog.close_button.clicked.connect (on_close_button_clicked);
progress_dialog.close_button.visible = false;
this.hold ();
}
public override void activate () {
if (!pamac_run) {
print ("\nError: Path(s) of tarball(s) to install is needed\n");
transaction.stop_daemon ();
this.release ();
}
this.release ();
}
public override void open (File[] files, string hint) {
if (!pamac_run) {
foreach (unowned File file in files) {
transaction.to_load.add (file.get_path ());
}
progress_dialog.show ();
if (transaction.get_lock ()) {
transaction.run ();
} else {
transaction.progress_box.action_label.label = dgettext (null, "Waiting for another package manager to quit") + "...";
transaction.start_progressbar_pulse ();
Timeout.add (5000, () => {
bool locked = transaction.get_lock ();
if (locked) {
transaction.stop_progressbar_pulse ();
transaction.run ();
}
return !locked;
});
}
foreach (unowned File file in files) {
transaction.to_load.add (file.get_path ());
}
}
bool check_pamac_running () {
Application app;
bool run = false;
app = new Application ("org.pamac.manager", 0);
try {
app.register ();
} catch (GLib.Error e) {
stderr.printf ("%s\n", e.message);
progress_dialog.show ();
if (transaction.get_lock ()) {
transaction.run ();
} else {
Gtk.MessageDialog msg = new Gtk.MessageDialog (this as Gtk.ApplicationWindow, Gtk.DialogFlags.MODAL, Gtk.MessageType.WARNING, Gtk.ButtonsType.OK, dgettext (null, "Unable to lock database!"));
msg.response.connect ((response_id) => {
msg.destroy();
this.release ();
});
msg.show ();
}
run = app.get_is_remote ();
return run;
}
void on_important_details_outpout (bool must_show) {

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-classic')
cfg_pamac_install.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_install.set('PREFIX', get_option('prefix'))
cfg_pamac_install.set('VERSION', '6.6.1')
cfg_pamac_install.set('VERSION', '6.6.2')
cfg_pamac_install.set('TESTSRCDIR', meson.source_root())
cfgfile_5 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_install)

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-manager/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-manager/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src )
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )

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-classic')
cfg_pamac_manager.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_manager.set('PREFIX', get_option('prefix'))
cfg_pamac_manager.set('VERSION', '6.6.1')
cfg_pamac_manager.set('VERSION', '6.6.2')
cfg_pamac_manager.set('TESTSRCDIR', meson.source_root())
cfgfile_6 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_manager)

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-system-daemon/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-system-daemon/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src )
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )

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-classic')
cfg_pamac_system_daemon.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_system_daemon.set('PREFIX', get_option('prefix'))
cfg_pamac_system_daemon.set('VERSION', '6.6.1')
cfg_pamac_system_daemon.set('VERSION', '6.6.2')
cfg_pamac_system_daemon.set('TESTSRCDIR', meson.source_root())
cfgfile_7 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_system_daemon)

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-tray/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-tray/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src )
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )

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-classic')
cfg_pamac_tray.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_tray.set('PREFIX', get_option('prefix'))
cfg_pamac_tray.set('VERSION', '6.6.1')
cfg_pamac_tray.set('VERSION', '6.6.2')
cfg_pamac_tray.set('TESTSRCDIR', meson.source_root())
cfgfile_3 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_tray)

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac-classic")
set (RELEASE_NAME "pamac-classic")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.6.1")
set (VERSION "6.6.2")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/pamac-user-daemon/Config.vala.base ${CMAKE_BINARY_DIR}/src/pamac-user-daemon/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "6.6.1")
set (VERSION "6.6.2")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src )
link_libraries ( ${DEPS_LIBRARIES} -lpamacclassic )

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-classic')
cfg_pamac_user_daemon.set('RELEASE_NAME', 'pamac-classic')
cfg_pamac_user_daemon.set('PREFIX', get_option('prefix'))
cfg_pamac_user_daemon.set('VERSION', '6.6.1')
cfg_pamac_user_daemon.set('VERSION', '6.6.2')
cfg_pamac_user_daemon.set('TESTSRCDIR', meson.source_root())
cfgfile_2 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_user_daemon)

View File

@@ -4,7 +4,7 @@ includedir=@DOLLAR@{prefix}/${CMAKE_INSTALL_INCLUDEDIR}
Name: pamacclassic
Description: pamacclassic
Version: 6.6.1
Version: 6.6.2
Libs: -L@DOLLAR@{libdir} -lpamacclassic
Cflags: -I@DOLLAR@{includedir}
Requires: gdk-3.0 gtk+-3.0 json-glib-1.0 libalpm libnotify libsoup-2.4 vte-2.91 gio-2.0 glib-2.0 gobject-2.0