update deprecated code

This commit is contained in:
2019-07-06 20:28:51 -04:00
parent d7cf388ece
commit 3b66f68b2c
38 changed files with 592 additions and 361 deletions

View File

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

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', '6.7.2')
cfg_pamac_tray.set('VERSION', '7.0.0')
cfg_pamac_tray.set('TESTSRCDIR', meson.source_root())
cfgfile_3 = configure_file(
@@ -29,12 +29,10 @@ 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_vala_args = ['--pkg','posix']
pamac_tray_vala_args += ['--vapidir='+join_paths(meson.source_root(),'src/vapis')]
pamac_tray_dependencies = [pamacclassic_library]
pamac_tray_dependencies = [Pamac_library]
pamac_tray_c_args = []
if ENABLE_UPDATE_ICON
pamac_tray_vala_args += ['-D', 'ENABLE_UPDATE_ICON']

View File

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

View File

@@ -32,7 +32,7 @@ namespace Pamac {
// Show popup menu on right button
void menu_popup (uint button, uint time) {
menu.popup (null, null, null, button, time);
menu.popup_at_pointer (null);
}
public override void set_tooltip (string info) {

View File

@@ -18,9 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// i18n
const string GETTEXT_PACKAGE = "pamac";
const string update_icon_name = "pamac-tray-update";
const string noupdate_icon_name = "pamac-tray-no-update";
const string noupdate_info = _("Your system is up-to-date");
@@ -28,15 +25,15 @@ 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;
public abstract void refresh_handle () throws DBusError, IOError;
public abstract string get_lockfile () throws DBusError, IOError;
#if DISABLE_AUR
public abstract void start_get_updates () throws IOError;
public abstract void start_get_updates () throws DBusError, IOError;
#else
public abstract void start_get_updates (bool check_aur_updates) throws IOError;
public abstract void start_get_updates (bool check_aur_updates) throws DBusError, IOError;
#endif
[DBus (no_reply = true)]
public abstract void quit () throws IOError;
public abstract void quit () throws DBusError, IOError;
public signal void get_updates_finished (Updates updates);
}
@@ -71,6 +68,8 @@ namespace Pamac {
daemon.quit ();
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
}
}
@@ -132,6 +131,8 @@ namespace Pamac {
#endif
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
}
return true;
@@ -233,6 +234,8 @@ namespace Pamac {
daemon.refresh_handle ();
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
}
check_updates ();
}
@@ -274,8 +277,10 @@ namespace Pamac {
public override void startup () {
// i18n
Intl.textdomain ("pamac");
Intl.bindtextdomain(Constants.GETTEXT_PACKAGE, Path.build_filename(Constants.DATADIR,"locale"));
Intl.setlocale (LocaleCategory.ALL, "");
Intl.textdomain(Constants.GETTEXT_PACKAGE);
Intl.bind_textdomain_codeset(Constants.GETTEXT_PACKAGE, "utf-8" );
var pamac_config = new Pamac.Config ();
// if refresh period is 0, just return so tray will exit
@@ -303,6 +308,10 @@ namespace Pamac {
stderr.printf ("IOError: %s\n", e.message);
//try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
} catch (DBusError e) {
stderr.printf ("DBusError: %s\n", e.message);
//try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
}
Timeout.add (200, check_extern_lock);
// wait 30 seconds before check updates