reuse more code

This commit is contained in:
2017-10-26 13:45:40 -03:00
parent ebdad3636f
commit 4ba5978027
29 changed files with 267 additions and 786 deletions

View File

@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac")
set (RELEASE_NAME "pamac")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "6.3.1")
set (VERSION "6.3.3")
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.3.1")
set (VERSION "6.3.3")
add_definitions (${DEPS_CFLAGS})
include_directories ( ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src/aur )
link_libraries ( ${DEPS_LIBRARIES} -lPamac -lAUR )
@@ -25,6 +25,7 @@ include (ValaPrecompile)
set (VALA_PACKAGES ${VALA_PACKAGES} posix)
set (VALA_PACKAGES ${VALA_PACKAGES} json-glib-1.0)
set (VALA_PACKAGES ${VALA_PACKAGES} libalpm)
set (VALA_PACKAGES ${VALA_PACKAGES} libnotify)
if (KDE_TRAY)
set (VALA_PACKAGES ${VALA_PACKAGES} appindicator3-0.1)
@@ -41,9 +42,9 @@ if (KDE_TRAY)
else ()
set (APP_SOURCES ${APP_SOURCES} tray-gtk.vala)
endif ()
set (APP_SOURCES ${APP_SOURCES} alpm_config.vala)
set (APP_SOURCES ${APP_SOURCES} pamac_config.vala)
set (APP_SOURCES ${APP_SOURCES} tray.vala)
set (APP_SOURCES ${APP_SOURCES} user_daemon.vala)
set (CUSTOM_VAPIS_LIST ${CUSTOM_VAPIS_LIST} ${CMAKE_BINARY_DIR}/src/Pamac.vapi)
if (NOT DISABLE_AUR)

View File

@@ -0,0 +1 @@
../alpm_config.vala

View File

@@ -4,12 +4,13 @@ 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', '6.3.1')
cfg_pamac_tray.set('VERSION', '6.3.3')
cfg_pamac_tray.set('TESTSRCDIR', meson.source_root())
cfgfile_4 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_tray)
pamac_tray_deps = [json_glib_1_0_dep]
pamac_tray_deps += [libalpm_dep]
pamac_tray_deps += [libnotify_dep]
if KDE_TRAY
pamac_tray_deps += [appindicator3_0_1_dep]
@@ -25,9 +26,9 @@ pamac_tray_sources += ['tray-appindicator.vala']
else
pamac_tray_sources += ['tray-gtk.vala']
endif
pamac_tray_sources += ['alpm_config.vala']
pamac_tray_sources += ['pamac_config.vala']
pamac_tray_sources += ['tray.vala']
pamac_tray_sources += ['user_daemon.vala']
pamac_tray_vala_args = ['--pkg','posix']
pamac_tray_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_tray_dependencies = [Pamac_library]

View File

@@ -27,6 +27,18 @@ const string noupdate_info = _("Your system is up-to-date");
namespace Pamac {
[DBus (name = "org.pamac.user")]
interface UserDaemon : Object {
public abstract void refresh_handle () throws IOError;
public abstract string get_lockfile () throws IOError;
#if DISABLE_AUR
public abstract void start_get_updates () throws IOError;
#else
public abstract void start_get_updates (bool check_aur_updates) throws IOError;
#endif
[DBus (no_reply = true)]
public abstract void quit () throws IOError;
public signal void get_updates_finished (Updates updates);
}
public abstract class TrayIcon: Gtk.Application {
Notify.Notification notification;

View File

@@ -1,61 +0,0 @@
/*
* pamac-vala
*
* Copyright (C) 2017 Chris Cromer <cromer@cromnix.org>
* Copyright (C) 2014-2017 Guillaume Benoit <guillaume@manjaro.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a get of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Pamac {
[DBus (name = "org.pamac.user")]
interface UserDaemon : Object {
public abstract void refresh_handle () throws IOError;
#if DISABLE_AUR
public abstract void start_get_updates () throws IOError;
#else
public abstract void start_get_updates (bool check_aur_updates) throws IOError;
#endif
[DBus (no_reply = true)]
public abstract void quit () throws IOError;
public signal void get_updates_finished (Updates updates);
public abstract string get_lockfile () throws IOError;
}
[DBus (name = "org.pamac.system")]
interface SystemDaemon : Object {
[DBus (no_reply = true)]
public signal void get_updates_finished (Updates updates);
public signal void emit_event (uint primary_event, uint secondary_event, string[] details);
public signal void emit_providers (string depend, string[] providers);
public signal void emit_progress (uint progress, string pkgname, uint percent, uint n_targets, uint current_target);
public signal void emit_download (string filename, uint64 xfered, uint64 total);
public signal void emit_totaldownload (uint64 total);
public signal void emit_log (uint level, string msg);
public signal void set_pkgreason_finished ();
public signal void refresh_finished (bool success);
public signal void trans_prepare_finished (bool success);
public signal void trans_commit_finished (bool success);
public signal void get_authorization_finished (bool authorized);
#if DISABLE_AUR
public signal void write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon);
#else
public signal void write_pamac_config_finished (bool recurse, uint64 refresh_period, bool no_update_hide_icon,
bool enable_aur, bool search_aur, string aur_build_dir, bool check_aur_updates);
#endif
public signal void write_alpm_config_finished (bool checkspace);
public signal void write_mirrors_config_finished (string choosen_country, string choosen_generation_method);
public signal void generate_mirrors_list_data (string line);
public signal void generate_mirrors_list_finished ();
}
}