From b47e208dd64cf7d9a1fde0328cf3048724371b9c Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Mon, 16 Oct 2017 21:37:26 -0300 Subject: [PATCH] add terminal colors --- .gitignore | 1 + data/config/noaur/pamac.conf | 6 + data/config/pamac.conf | 6 + data/interface/preferences_dialog.ui | 143 +++++++-- data/interface/preferences_dialog_no_aur.ui | 105 +++++- pamac.avprj | 16 +- src/CMakeLists.txt | 11 +- src/Pamac.pc | 2 +- src/aur/AUR.pc | 2 +- src/aur/CMakeLists.txt | 6 +- src/aur/meson.build | 6 +- src/meson.build | 6 +- src/pamac-clean-cache/CMakeLists.txt | 4 +- src/pamac-clean-cache/meson.build | 2 +- src/pamac-install/CMakeLists.txt | 4 +- src/pamac-install/meson.build | 2 +- src/pamac-manager/CMakeLists.txt | 4 +- src/pamac-manager/meson.build | 2 +- src/pamac-system-daemon/CMakeLists.txt | 4 +- src/pamac-system-daemon/meson.build | 2 +- src/pamac-system-daemon/pamac_config.vala | 338 +------------------- src/pamac-tray/CMakeLists.txt | 4 +- src/pamac-tray/meson.build | 2 +- src/pamac-user-daemon/CMakeLists.txt | 4 +- src/pamac-user-daemon/meson.build | 2 +- src/pamac_config.vala | 215 +++++++++++++ src/preferences_dialog.vala | 28 ++ src/transaction.vala | 14 +- 28 files changed, 537 insertions(+), 404 deletions(-) mode change 100644 => 120000 src/pamac-system-daemon/pamac_config.vala diff --git a/.gitignore b/.gitignore index 089961a..206352c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ PKGBUILD *.pkg.tar.xz *.pkg.tar.xz.sig /build +src/interface/*~ diff --git a/data/config/noaur/pamac.conf b/data/config/noaur/pamac.conf index 3b3e04a..2f970c0 100644 --- a/data/config/noaur/pamac.conf +++ b/data/config/noaur/pamac.conf @@ -15,3 +15,9 @@ KeepNumPackages = 3 ## Remove only the versions of uninstalled packages when clean cache: #OnlyRmUninstalled + +## Terminal background color +BackgroundColor = rgb(0,0,0) + +## Terminal foreground color +ForegroundColor = rgb(255,255,255) diff --git a/data/config/pamac.conf b/data/config/pamac.conf index f16c013..935b5d3 100644 --- a/data/config/pamac.conf +++ b/data/config/pamac.conf @@ -30,3 +30,9 @@ KeepNumPackages = 3 ## Remove only the versions of uninstalled packages when clean cache: #OnlyRmUninstalled + +## Terminal background color +BackgroundColor = rgb(0,0,0) + +## Terminal foreground color +ForegroundColor = rgb(255,255,255) diff --git a/data/interface/preferences_dialog.ui b/data/interface/preferences_dialog.ui index abf6812..221faca 100644 --- a/data/interface/preferences_dialog.ui +++ b/data/interface/preferences_dialog.ui @@ -1,5 +1,5 @@ - + @@ -375,6 +375,102 @@ General + + + True + False + 6 + 6 + 6 + 6 + 6 + 6 + vertical + 6 + + + True + False + 6 + 6 + + + True + True + True + Select a background color + rgb(0,0,0) + + + 1 + 0 + + + + + True + True + True + Select a text color + rgb(255,255,255) + + + 1 + 1 + + + + + True + False + Background: + + + 0 + 0 + + + + + True + False + start + Text: + + + 0 + 1 + + + + + False + True + 0 + + + + + + + + + + + + + + + + + + + + terminal + Terminal + 1 + + True @@ -487,7 +583,7 @@ official_repositories Official Repositories - 1 + 2 @@ -620,6 +716,24 @@ All AUR users should be familiar with the build process. 2 + + + Check for updates from AUR + True + True + False + start + 24 + 24 + True + True + + + False + True + 3 + + True @@ -662,29 +776,11 @@ All AUR users should be familiar with the build process. 3 - - - Check for updates from AUR - True - True - False - start - 24 - 24 - True - True - - - False - True - 3 - - aur AUR - 2 + 3 @@ -780,7 +876,7 @@ All AUR users should be familiar with the build process. cache Cache - 3 + 4 @@ -807,6 +903,9 @@ All AUR users should be familiar with the build process. center stack + + 1 + diff --git a/data/interface/preferences_dialog_no_aur.ui b/data/interface/preferences_dialog_no_aur.ui index 349fe18..57e24b8 100644 --- a/data/interface/preferences_dialog_no_aur.ui +++ b/data/interface/preferences_dialog_no_aur.ui @@ -1,5 +1,5 @@ - + @@ -375,6 +375,102 @@ General + + + True + False + 6 + 6 + 6 + 6 + 6 + 6 + vertical + 6 + + + True + False + 6 + 6 + + + True + True + True + Select a background color + rgb(0,0,0) + + + 1 + 0 + + + + + True + True + True + Select a text color + rgb(255,255,255) + + + 1 + 1 + + + + + True + False + Background: + + + 0 + 0 + + + + + True + False + start + Text: + + + 0 + 1 + + + + + False + True + 0 + + + + + + + + + + + + + + + + + + + + terminal + Terminal + 1 + + True @@ -487,7 +583,7 @@ official_repositories Official Repositories - 1 + 2 @@ -583,7 +679,7 @@ cache Cache - 3 + 4 @@ -610,6 +706,9 @@ center stack + + 1 + diff --git a/pamac.avprj b/pamac.avprj index 6ed0c27..bc43c23 100644 --- a/pamac.avprj +++ b/pamac.avprj @@ -34,7 +34,7 @@ end vapidir: src/vapis vala_binary: src/pamac-clean-cache/pamac-clean-cache -version: 6.1.0 +version: 6.2.0 vala_local_package: Pamac vala_package: posix vala_check_package: gtk+-3.0 @@ -45,7 +45,7 @@ vala_check_package: gtk+-3.0 *vala_source: pamac_config.vala vala_binary: src/pamac-install/pamac-install -version: 6.1.0 +version: 6.2.0 use_gresource: pamac_installer_gresource_xml vala_local_package: Pamac vala_check_package: gtk+-3.0 @@ -56,7 +56,7 @@ vala_check_package: gtk+-3.0 *vala_source: progress_dialog.vala vala_binary: src/pamac-manager/pamac-manager -version: 6.1.0 +version: 6.2.0 use_gresource: pamac_manager_gresource_xml vala_local_package: Pamac vala_check_package: gtk+-3.0 @@ -68,7 +68,7 @@ vala_check_package: gtk+-3.0 *vala_source: manager_window.vala vala_binary: src/pamac-system-daemon/pamac-system-daemon -version: 6.1.0 +version: 6.2.0 vala_local_package: Pamac if NOT DISABLE_AUR vala_local_package: AUR @@ -89,7 +89,7 @@ vala_check_package: polkit-gobject-1 *vala_source: system_daemon.vala vala_binary: src/pamac-tray/pamac-tray -version: 6.1.0 +version: 6.2.0 vala_local_package: Pamac if NOT DISABLE_AUR vala_local_package: AUR @@ -115,7 +115,7 @@ end *vala_source: user_daemon.vala vala_binary: src/pamac-user-daemon/pamac-user-daemon -version: 6.1.0 +version: 6.2.0 vala_local_package: Pamac if NOT DISABLE_AUR vala_local_package: AUR @@ -133,7 +133,7 @@ vala_check_package: libsoup-2.4 vala_library: src/pamac -version: 6.1.0 +version: 6.2.0 *namespace: Pamac use_gresource: pamac_transaction_gresource_xml vala_package: posix @@ -159,7 +159,7 @@ vala_check_package: vte-2.91 *vala_source: transaction_sum_dialog.vala vala_library: src/aur/aur -version: 6.1.0 +version: 6.2.0 *namespace: AUR vala_check_package: json-glib-1.0 vala_check_package: libsoup-2.4 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cdd3e0a..d726da5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,7 +7,7 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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}/Pamac.pc ${CMAKE_CURRENT_BINARY_DIR}/Pamac.pc) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Pamac.deps ${CMAKE_CURRENT_BINARY_DIR}/Pamac.deps) -set (VERSION "6.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) link_libraries ( ${DEPS_LIBRARIES} ) link_directories ( ${DEPS_LIBRARY_DIRS} ) @@ -87,7 +87,7 @@ add_dependencies( Pamac ${Pamac_DEPENDENCIES} ) target_link_libraries( Pamac m ) set_target_properties( Pamac PROPERTIES VERSION - 6.1.0 + 6.2.0 SOVERSION 6 ) @@ -143,4 +143,7 @@ install(CODE "MESSAGE (\" * Run 'sudo ldconfig' to complete installation * ************************************************ -\") " )include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeSymlinks.txt) +\") " ) + + +include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeSymlinks.txt) diff --git a/src/Pamac.pc b/src/Pamac.pc index 2d2c954..352f73a 100644 --- a/src/Pamac.pc +++ b/src/Pamac.pc @@ -6,7 +6,7 @@ includedir=@DOLLAR@{exec_prefix}/${CMAKE_INSTALL_INCLUDEDIR} Name: Pamac Description: Pamac -Version: 6.1.0 +Version: 6.2.0 Libs: -L@DOLLAR@{libdir} -lPamac Cflags: -I@DOLLAR@{includedir} Requires: gdk-3.0 gtk+-3.0 libalpm libnotify vte-2.91 gio-2.0 glib-2.0 gobject-2.0 diff --git a/src/aur/AUR.pc b/src/aur/AUR.pc index 945fe98..c680c61 100644 --- a/src/aur/AUR.pc +++ b/src/aur/AUR.pc @@ -6,7 +6,7 @@ includedir=@DOLLAR@{exec_prefix}/${CMAKE_INSTALL_INCLUDEDIR} Name: AUR Description: AUR -Version: 6.1.0 +Version: 6.2.0 Libs: -L@DOLLAR@{libdir} -lAUR Cflags: -I@DOLLAR@{includedir} Requires: json-glib-1.0 libsoup-2.4 glib-2.0 diff --git a/src/aur/CMakeLists.txt b/src/aur/CMakeLists.txt index 10c054a..9713659 100644 --- a/src/aur/CMakeLists.txt +++ b/src/aur/CMakeLists.txt @@ -7,7 +7,7 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") set (TESTSRCDIR "${CMAKE_SOURCE_DIR}") set (DOLLAR "$") @@ -15,7 +15,7 @@ configure_file (${CMAKE_SOURCE_DIR}/src/aur/Config.vala.base ${CMAKE_BINARY_DIR} add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") configure_file (${CMAKE_CURRENT_SOURCE_DIR}/AUR.pc ${CMAKE_CURRENT_BINARY_DIR}/AUR.pc) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/AUR.deps ${CMAKE_CURRENT_BINARY_DIR}/AUR.deps) -set (VERSION "6.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) link_libraries ( ${DEPS_LIBRARIES} ) link_directories ( ${DEPS_LIBRARY_DIRS} ) @@ -65,7 +65,7 @@ add_library(AUR SHARED ${VALA_C}) set_target_properties( AUR PROPERTIES VERSION - 6.1.0 + 6.2.0 SOVERSION 6 ) diff --git a/src/aur/meson.build b/src/aur/meson.build index e8624b9..9310506 100644 --- a/src/aur/meson.build +++ b/src/aur/meson.build @@ -4,7 +4,7 @@ cfg_aur.set('PKGDATADIR', join_paths(get_option('prefix'),get_option('datadir'), cfg_aur.set('GETTEXT_PACKAGE', 'pamac') cfg_aur.set('RELEASE_NAME', 'pamac') cfg_aur.set('PREFIX', get_option('prefix')) -cfg_aur.set('VERSION', '6.1.0') +cfg_aur.set('VERSION', '6.2.0') cfg_aur.set('TESTSRCDIR', meson.source_root()) cfgfile_2 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_aur) @@ -27,7 +27,7 @@ endif aur_vala_args += ['--gir=AUR-6.0.gir'] -AUR_library = shared_library('AUR',aur_sources,dependencies: aur_deps,vala_args: aur_vala_args,c_args: aur_c_args,version: '6.1.0',soversion: '6',install: true) +AUR_library = shared_library('AUR',aur_sources,dependencies: aur_deps,vala_args: aur_vala_args,c_args: aur_c_args,version: '6.2.0',soversion: '6',install: true) aur_requires = [] aur_requires += ['json-glib-1.0'] @@ -35,7 +35,7 @@ aur_requires += ['libsoup-2.4'] aur_requires += ['glib-2.0'] pkg_mod = import('pkgconfig') pkg_mod.generate(libraries : AUR_library, - version : '6.1.0', + version : '6.2.0', name : 'AUR', filebase : 'AUR', description : 'AUR', diff --git a/src/meson.build b/src/meson.build index 1c26234..452da0b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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', '6.1.0') +cfg_pamac.set('VERSION', '6.2.0') cfg_pamac.set('TESTSRCDIR', meson.source_root()) cfgfile_1 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac) @@ -54,7 +54,7 @@ pamac_deps += [meson.get_compiler('c').find_library('m', required : false)] pamac_vala_args += ['--gir=Pamac-6.0.gir'] -Pamac_library = shared_library('Pamac',pamac_sources,dependencies: pamac_deps,vala_args: pamac_vala_args,c_args: pamac_c_args,version: '6.1.0',soversion: '6',install: true) +Pamac_library = shared_library('Pamac',pamac_sources,dependencies: pamac_deps,vala_args: pamac_vala_args,c_args: pamac_c_args,version: '6.2.0',soversion: '6',install: true) pamac_requires = [] pamac_requires += ['gdk-3.0'] @@ -67,7 +67,7 @@ pamac_requires += ['glib-2.0'] pamac_requires += ['gobject-2.0'] pkg_mod = import('pkgconfig') pkg_mod.generate(libraries : Pamac_library, - version : '6.1.0', + version : '6.2.0', name : 'Pamac', filebase : 'Pamac', description : 'Pamac', diff --git a/src/pamac-clean-cache/CMakeLists.txt b/src/pamac-clean-cache/CMakeLists.txt index 07bdbf6..bc91f46 100644 --- a/src/pamac-clean-cache/CMakeLists.txt +++ b/src/pamac-clean-cache/CMakeLists.txt @@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) include_directories ( ${CMAKE_BINARY_DIR}/src ) link_libraries ( ${DEPS_LIBRARIES} -lPamac ) diff --git a/src/pamac-clean-cache/meson.build b/src/pamac-clean-cache/meson.build index 2c0d7ad..f9d8a9d 100644 --- a/src/pamac-clean-cache/meson.build +++ b/src/pamac-clean-cache/meson.build @@ -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', '6.1.0') +cfg_pamac_clean_cache.set('VERSION', '6.2.0') cfg_pamac_clean_cache.set('TESTSRCDIR', meson.source_root()) cfgfile_5 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_clean_cache) diff --git a/src/pamac-install/CMakeLists.txt b/src/pamac-install/CMakeLists.txt index 84c6988..cc4331b 100644 --- a/src/pamac-install/CMakeLists.txt +++ b/src/pamac-install/CMakeLists.txt @@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) include_directories ( ${CMAKE_BINARY_DIR}/src ) link_libraries ( ${DEPS_LIBRARIES} -lPamac ) diff --git a/src/pamac-install/meson.build b/src/pamac-install/meson.build index 2f60cdf..2413ff3 100644 --- a/src/pamac-install/meson.build +++ b/src/pamac-install/meson.build @@ -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', '6.1.0') +cfg_pamac_install.set('VERSION', '6.2.0') cfg_pamac_install.set('TESTSRCDIR', meson.source_root()) cfgfile_6 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_install) diff --git a/src/pamac-manager/CMakeLists.txt b/src/pamac-manager/CMakeLists.txt index aea33a9..1918606 100644 --- a/src/pamac-manager/CMakeLists.txt +++ b/src/pamac-manager/CMakeLists.txt @@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) include_directories ( ${CMAKE_BINARY_DIR}/src ) link_libraries ( ${DEPS_LIBRARIES} -lPamac ) diff --git a/src/pamac-manager/meson.build b/src/pamac-manager/meson.build index fb2f5dc..a4b4d24 100644 --- a/src/pamac-manager/meson.build +++ b/src/pamac-manager/meson.build @@ -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', '6.1.0') +cfg_pamac_manager.set('VERSION', '6.2.0') cfg_pamac_manager.set('TESTSRCDIR', meson.source_root()) cfgfile_7 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_manager) diff --git a/src/pamac-system-daemon/CMakeLists.txt b/src/pamac-system-daemon/CMakeLists.txt index 140b97f..b8e23b9 100644 --- a/src/pamac-system-daemon/CMakeLists.txt +++ b/src/pamac-system-daemon/CMakeLists.txt @@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) include_directories ( ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src/aur ) link_libraries ( ${DEPS_LIBRARIES} -lPamac -lAUR ) diff --git a/src/pamac-system-daemon/meson.build b/src/pamac-system-daemon/meson.build index fec7bed..e4940c8 100644 --- a/src/pamac-system-daemon/meson.build +++ b/src/pamac-system-daemon/meson.build @@ -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', '6.1.0') +cfg_pamac_system_daemon.set('VERSION', '6.2.0') cfg_pamac_system_daemon.set('TESTSRCDIR', meson.source_root()) cfgfile_8 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_system_daemon) diff --git a/src/pamac-system-daemon/pamac_config.vala b/src/pamac-system-daemon/pamac_config.vala deleted file mode 100644 index 18bad2e..0000000 --- a/src/pamac-system-daemon/pamac_config.vala +++ /dev/null @@ -1,337 +0,0 @@ -/* - * pamac-vala - * - * Copyright (C) 2017 Chris Cromer - * Copyright (C) 2014-2017 Guillaume Benoit - * - * 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 . - */ - -namespace Pamac { - class Config { - string conf_path; - HashTable _environment_variables; - - public bool recurse { get; private set; } - public uint64 refresh_period { get; private set; } - public bool no_update_hide_icon { get; private set; } -#if DISABLE_AUR -#else - public bool enable_aur { get; private set; } - public bool search_aur { get; private set; } - public string aur_build_dir { get; private set; } - public bool check_aur_updates { get; private set; } -#endif - public uint64 keep_num_pkgs { get; private set; } - public bool rm_only_uninstalled { get; private set; } - public unowned HashTable environment_variables { - get { - return _environment_variables; - } - } - - public Config (string path) { - conf_path = path; - //get environment variables - _environment_variables = new HashTable (str_hash, str_equal); - var utsname = Posix.utsname(); - _environment_variables.insert ("HTTP_USER_AGENT", "pamac (%s %s)".printf (utsname.sysname, utsname.machine)); - unowned string? variable = Environment.get_variable ("http_proxy"); - if (variable != null) { - _environment_variables.insert ("http_proxy", variable); - } - variable = Environment.get_variable ("https_proxy"); - if (variable != null) { - _environment_variables.insert ("https_proxy", variable); - } - variable = Environment.get_variable ("ftp_proxy"); - if (variable != null) { - _environment_variables.insert ("ftp_proxy", variable); - } - variable = Environment.get_variable ("socks_proxy"); - if (variable != null) { - _environment_variables.insert ("socks_proxy", variable); - } - variable = Environment.get_variable ("no_proxy"); - if (variable != null) { - _environment_variables.insert ("no_proxy", variable); - } - // set default option - refresh_period = 6; - reload (); - } - - public void reload () { - // set default options - recurse = false; - no_update_hide_icon = false; -#if DISABLE_AUR -#else - enable_aur = false; - search_aur = false; - aur_build_dir = "/tmp"; - check_aur_updates = false; -#endif - keep_num_pkgs = 3; - rm_only_uninstalled = false; - parse_file (conf_path); - } - - void parse_file (string path) { - var file = GLib.File.new_for_path (path); - if (file.query_exists ()) { - try { - // Open file for reading and wrap returned FileInputStream into a - // DataInputStream, so we can read line by line - var dis = new DataInputStream (file.read ()); - string? line; - // Read lines until end of file (null) is reached - while ((line = dis.read_line ()) != null) { - if (line.length == 0) { - continue; - } - // ignore whole line and end of line comments - string[] splitted = line.split ("#", 2); - line = splitted[0].strip (); - if (line.length == 0) { - continue; - } - splitted = line.split ("=", 2); - unowned string key = splitted[0]._strip (); - if (key == "RemoveUnrequiredDeps") { - recurse = true; - } else if (key == "RefreshPeriod") { - if (splitted.length == 2) { - unowned string val = splitted[1]._strip (); - refresh_period = uint64.parse (val); - } - } else if (key == "NoUpdateHideIcon") { - no_update_hide_icon = true; -#if DISABLE_AUR -#else - } else if (key == "EnableAUR") { - enable_aur = true; - } else if (key == "SearchInAURByDefault") { - search_aur = true; - } else if (key == "BuildDirectory") { - if (splitted.length == 2) { - aur_build_dir = splitted[1]._strip (); - } - } else if (key == "CheckAURUpdates") { - check_aur_updates = true; -#endif - } else if (key == "KeepNumPackages") { - if (splitted.length == 2) { - unowned string val = splitted[1]._strip (); - keep_num_pkgs = uint64.parse (val); - } - } else if (key == "OnlyRmUninstalled") { - rm_only_uninstalled = true; - } - } - } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); - } - } else { - GLib.stderr.printf ("File '%s' doesn't exist.\n", path); - } - } - - public void write (HashTable new_conf) { - var file = GLib.File.new_for_path (conf_path); - var data = new GLib.List (); - if (file.query_exists ()) { - try { - // Open file for reading and wrap returned FileInputStream into a - // DataInputStream, so we can read line by line - var dis = new DataInputStream (file.read ()); - string? line; - // Read lines until end of file (null) is reached - while ((line = dis.read_line ()) != null) { - if (line.length == 0) { - data.append ("\n"); - continue; - } - unowned Variant variant; - if (line.contains ("RemoveUnrequiredDeps")) { - if (new_conf.lookup_extended ("RemoveUnrequiredDeps", null, out variant)) { - if (variant.get_boolean ()) { - data.append ("RemoveUnrequiredDeps\n"); - } else { - data.append ("#RemoveUnrequiredDeps\n"); - } - new_conf.remove ("RemoveUnrequiredDeps"); - } else { - data.append (line + "\n"); - } - } else if (line.contains ("RefreshPeriod")) { - if (new_conf.lookup_extended ("RefreshPeriod", null, out variant)) { - data.append ("RefreshPeriod = %llu\n".printf (variant.get_uint64 ())); - new_conf.remove ("RefreshPeriod"); - } else { - data.append (line + "\n"); - } - } else if (line.contains ("NoUpdateHideIcon")) { - if (new_conf.lookup_extended ("NoUpdateHideIcon", null, out variant)) { - if (variant.get_boolean ()) { - data.append ("NoUpdateHideIcon\n"); - } else { - data.append ("#NoUpdateHideIcon\n"); - } - new_conf.remove ("NoUpdateHideIcon"); - } else { - data.append (line + "\n"); - } -#if DISABLE_AUR -#else - } else if (line.contains ("EnableAUR")) { - if (new_conf.lookup_extended ("EnableAUR", null, out variant)) { - if (variant.get_boolean ()) { - data.append ("EnableAUR\n"); - } else { - data.append ("#EnableAUR\n"); - } - new_conf.remove ("EnableAUR"); - } else { - data.append (line + "\n"); - } - } else if (line.contains ("SearchInAURByDefault")) { - if (new_conf.lookup_extended ("SearchInAURByDefault", null, out variant)) { - if (variant.get_boolean ()) { - data.append ("SearchInAURByDefault\n"); - } else { - data.append ("#SearchInAURByDefault\n"); - } - new_conf.remove ("SearchInAURByDefault"); - } else { - data.append (line + "\n"); - } - } else if (line.contains ("BuildDirectory")) { - if (new_conf.lookup_extended ("BuildDirectory", null, out variant)) { - data.append ("BuildDirectory = %s\n".printf (variant.get_string ())); - new_conf.remove ("BuildDirectory"); - } else { - data.append (line + "\n"); - } - } else if (line.contains ("CheckAURUpdates")) { - if (new_conf.lookup_extended ("CheckAURUpdates", null, out variant)) { - if (variant.get_boolean ()) { - data.append ("CheckAURUpdates\n"); - } else { - data.append ("#CheckAURUpdates\n"); - } - new_conf.remove ("CheckAURUpdates"); - } else { - data.append (line + "\n"); - } -#endif - } else if (line.contains ("KeepNumPackages")) { - if (new_conf.lookup_extended ("KeepNumPackages", null, out variant)) { - data.append ("KeepNumPackages = %llu\n".printf (variant.get_uint64 ())); - new_conf.remove ("KeepNumPackages"); - } else { - data.append (line + "\n"); - } - } else if (line.contains ("OnlyRmUninstalled")) { - if (new_conf.lookup_extended ("OnlyRmUninstalled", null, out variant)) { - if (variant.get_boolean ()) { - data.append ("OnlyRmUninstalled\n"); - } else { - data.append ("#OnlyRmUninstalled\n"); - } - new_conf.remove ("OnlyRmUninstalled"); - } else { - data.append (line + "\n"); - } - } else { - data.append (line + "\n"); - } - } - // delete the file before rewrite it - file.delete (); - } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); - } - } else { - GLib.stderr.printf ("File '%s' doesn't exist.\n", conf_path); - } - // create lines for unexisted options - if (new_conf.size () != 0) { - data.append ("\n"); - var iter = HashTableIter (new_conf); - unowned string key; - unowned Variant val; - while (iter.next (out key, out val)) { - if (key == "RemoveUnrequiredDeps") { - if (val.get_boolean ()) { - data.append ("RemoveUnrequiredDeps\n"); - } else { - data.append ("#RemoveUnrequiredDeps\n"); - } - } else if (key == "RefreshPeriod") { - data.append ("RefreshPeriod = %llu\n".printf (val.get_uint64 ())); - } else if (key =="NoUpdateHideIcon") { - if (val.get_boolean ()) { - data.append ("NoUpdateHideIcon\n"); - } else { - data.append ("#NoUpdateHideIcon\n"); - } -#if DISABLE_AUR -#else - } else if (key == "EnableAUR") { - if (val.get_boolean ()) { - data.append ("EnableAUR\n"); - } else { - data.append ("#EnableAUR\n"); - } - } else if (key == "SearchInAURByDefault") { - if (val.get_boolean ()) { - data.append ("SearchInAURByDefault\n"); - } else { - data.append ("#SearchInAURByDefault\n"); - } - } else if (key == "BuildDirectory") { - data.append ("BuildDirectory = %s\n".printf (val.get_string ())); - } else if (key == "CheckAURUpdates") { - if (val.get_boolean ()) { - data.append ("CheckAURUpdates\n"); - } else { - data.append ("#CheckAURUpdates\n"); - } -#endif - } else if (key == "KeepNumPackages") { - data.append ("KeepNumPackages = %llu\n".printf (val.get_uint64 ())); - } else if (key == "OnlyRmUninstalled") { - if (val.get_boolean ()) { - data.append ("OnlyRmUninstalled\n"); - } else { - data.append ("#OnlyRmUninstalled\n"); - } - } - } - } - // write the file - try { - // creating a DataOutputStream to the file - var dos = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); - foreach (unowned string new_line in data) { - // writing a short string to the stream - dos.put_string (new_line); - } - } catch (GLib.Error e) { - GLib.stderr.printf("%s\n", e.message); - } - } - } -} diff --git a/src/pamac-system-daemon/pamac_config.vala b/src/pamac-system-daemon/pamac_config.vala new file mode 120000 index 0000000..95475bb --- /dev/null +++ b/src/pamac-system-daemon/pamac_config.vala @@ -0,0 +1 @@ +../pamac_config.vala \ No newline at end of file diff --git a/src/pamac-tray/CMakeLists.txt b/src/pamac-tray/CMakeLists.txt index a498ce5..b6b4849 100644 --- a/src/pamac-tray/CMakeLists.txt +++ b/src/pamac-tray/CMakeLists.txt @@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) include_directories ( ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src/aur ) link_libraries ( ${DEPS_LIBRARIES} -lPamac -lAUR ) diff --git a/src/pamac-tray/meson.build b/src/pamac-tray/meson.build index 460b9b7..61c18be 100644 --- a/src/pamac-tray/meson.build +++ b/src/pamac-tray/meson.build @@ -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.1.0') +cfg_pamac_tray.set('VERSION', '6.2.0') cfg_pamac_tray.set('TESTSRCDIR', meson.source_root()) cfgfile_4 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_tray) diff --git a/src/pamac-user-daemon/CMakeLists.txt b/src/pamac-user-daemon/CMakeLists.txt index f0f0f0d..f67130e 100644 --- a/src/pamac-user-daemon/CMakeLists.txt +++ b/src/pamac-user-daemon/CMakeLists.txt @@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "pamac") set (RELEASE_NAME "pamac") set (CMAKE_C_FLAGS "") set (PREFIX ${CMAKE_INSTALL_PREFIX}) -set (VERSION "6.1.0") +set (VERSION "6.2.0") 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.1.0") +set (VERSION "6.2.0") add_definitions (${DEPS_CFLAGS}) include_directories ( ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src/aur ) link_libraries ( ${DEPS_LIBRARIES} -lPamac -lAUR ) diff --git a/src/pamac-user-daemon/meson.build b/src/pamac-user-daemon/meson.build index 12d8661..85ff925 100644 --- a/src/pamac-user-daemon/meson.build +++ b/src/pamac-user-daemon/meson.build @@ -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', '6.1.0') +cfg_pamac_user_daemon.set('VERSION', '6.2.0') cfg_pamac_user_daemon.set('TESTSRCDIR', meson.source_root()) cfgfile_3 = configure_file(input: 'Config.vala.base',output: 'Config.vala',configuration: cfg_pamac_user_daemon) diff --git a/src/pamac_config.vala b/src/pamac_config.vala index 8e901b9..14cdc4f 100644 --- a/src/pamac_config.vala +++ b/src/pamac_config.vala @@ -35,6 +35,8 @@ namespace Pamac { #endif public uint64 keep_num_pkgs { get; private set; } public bool rm_only_uninstalled { get; private set; } + public string terminal_background { get; private set; } + public string terminal_foreground { get; private set; } public unowned HashTable environment_variables { get { return _environment_variables; @@ -85,6 +87,8 @@ namespace Pamac { #endif keep_num_pkgs = 3; rm_only_uninstalled = false; + terminal_background = "rgb(0,0,0)"; + terminal_foreground = "rgb(255,255,255)"; parse_file (conf_path); } @@ -138,6 +142,14 @@ namespace Pamac { } } else if (key == "OnlyRmUninstalled") { rm_only_uninstalled = true; + } else if (key == "BackgroundColor") { + if (splitted.length == 2) { + terminal_background = splitted[1]._strip (); + } + } else if (key == "ForegroundColor") { + if (splitted.length == 2) { + terminal_foreground = splitted[1]._strip (); + } } } } catch (GLib.Error e) { @@ -147,5 +159,208 @@ namespace Pamac { GLib.stderr.printf ("File '%s' doesn't exist.\n", path); } } + public void write (HashTable new_conf) { + var file = GLib.File.new_for_path (conf_path); + var data = new GLib.List (); + if (file.query_exists ()) { + try { + // Open file for reading and wrap returned FileInputStream into a + // DataInputStream, so we can read line by line + var dis = new DataInputStream (file.read ()); + string? line; + // Read lines until end of file (null) is reached + while ((line = dis.read_line ()) != null) { + if (line.length == 0) { + data.append ("\n"); + continue; + } + unowned Variant variant; + if (line.contains ("RemoveUnrequiredDeps")) { + if (new_conf.lookup_extended ("RemoveUnrequiredDeps", null, out variant)) { + if (variant.get_boolean ()) { + data.append ("RemoveUnrequiredDeps\n"); + } else { + data.append ("#RemoveUnrequiredDeps\n"); + } + new_conf.remove ("RemoveUnrequiredDeps"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("RefreshPeriod")) { + if (new_conf.lookup_extended ("RefreshPeriod", null, out variant)) { + data.append ("RefreshPeriod = %llu\n".printf (variant.get_uint64 ())); + new_conf.remove ("RefreshPeriod"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("NoUpdateHideIcon")) { + if (new_conf.lookup_extended ("NoUpdateHideIcon", null, out variant)) { + if (variant.get_boolean ()) { + data.append ("NoUpdateHideIcon\n"); + } else { + data.append ("#NoUpdateHideIcon\n"); + } + new_conf.remove ("NoUpdateHideIcon"); + } else { + data.append (line + "\n"); + } +#if DISABLE_AUR +#else + } else if (line.contains ("EnableAUR")) { + if (new_conf.lookup_extended ("EnableAUR", null, out variant)) { + if (variant.get_boolean ()) { + data.append ("EnableAUR\n"); + } else { + data.append ("#EnableAUR\n"); + } + new_conf.remove ("EnableAUR"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("SearchInAURByDefault")) { + if (new_conf.lookup_extended ("SearchInAURByDefault", null, out variant)) { + if (variant.get_boolean ()) { + data.append ("SearchInAURByDefault\n"); + } else { + data.append ("#SearchInAURByDefault\n"); + } + new_conf.remove ("SearchInAURByDefault"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("BuildDirectory")) { + if (new_conf.lookup_extended ("BuildDirectory", null, out variant)) { + data.append ("BuildDirectory = %s\n".printf (variant.get_string ())); + new_conf.remove ("BuildDirectory"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("CheckAURUpdates")) { + if (new_conf.lookup_extended ("CheckAURUpdates", null, out variant)) { + if (variant.get_boolean ()) { + data.append ("CheckAURUpdates\n"); + } else { + data.append ("#CheckAURUpdates\n"); + } + new_conf.remove ("CheckAURUpdates"); + } else { + data.append (line + "\n"); + } +#endif + } else if (line.contains ("KeepNumPackages")) { + if (new_conf.lookup_extended ("KeepNumPackages", null, out variant)) { + data.append ("KeepNumPackages = %llu\n".printf (variant.get_uint64 ())); + new_conf.remove ("KeepNumPackages"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("OnlyRmUninstalled")) { + if (new_conf.lookup_extended ("OnlyRmUninstalled", null, out variant)) { + if (variant.get_boolean ()) { + data.append ("OnlyRmUninstalled\n"); + } else { + data.append ("#OnlyRmUninstalled\n"); + } + new_conf.remove ("OnlyRmUninstalled"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("BackgroundColor")) { + if (new_conf.lookup_extended ("BackgroundColor", null, out variant)) { + data.append ("BackgroundColor = %s\n".printf (variant.get_string ())); + new_conf.remove ("BackgroundColor"); + } else { + data.append (line + "\n"); + } + } else if (line.contains ("ForegroundColor")) { + if (new_conf.lookup_extended ("ForegroundColor", null, out variant)) { + data.append ("ForegroundColor = %s\n".printf (variant.get_string ())); + new_conf.remove ("ForegroundColor"); + } else { + data.append (line + "\n"); + } + } else { + data.append (line + "\n"); + } + } + // delete the file before rewrite it + file.delete (); + } catch (GLib.Error e) { + GLib.stderr.printf("%s\n", e.message); + } + } else { + GLib.stderr.printf ("File '%s' doesn't exist.\n", conf_path); + } + // create lines for unexisted options + if (new_conf.size () != 0) { + data.append ("\n"); + var iter = HashTableIter (new_conf); + unowned string key; + unowned Variant val; + while (iter.next (out key, out val)) { + if (key == "RemoveUnrequiredDeps") { + if (val.get_boolean ()) { + data.append ("RemoveUnrequiredDeps\n"); + } else { + data.append ("#RemoveUnrequiredDeps\n"); + } + } else if (key == "RefreshPeriod") { + data.append ("RefreshPeriod = %llu\n".printf (val.get_uint64 ())); + } else if (key =="NoUpdateHideIcon") { + if (val.get_boolean ()) { + data.append ("NoUpdateHideIcon\n"); + } else { + data.append ("#NoUpdateHideIcon\n"); + } +#if DISABLE_AUR +#else + } else if (key == "EnableAUR") { + if (val.get_boolean ()) { + data.append ("EnableAUR\n"); + } else { + data.append ("#EnableAUR\n"); + } + } else if (key == "SearchInAURByDefault") { + if (val.get_boolean ()) { + data.append ("SearchInAURByDefault\n"); + } else { + data.append ("#SearchInAURByDefault\n"); + } + } else if (key == "BuildDirectory") { + data.append ("BuildDirectory = %s\n".printf (val.get_string ())); + } else if (key == "CheckAURUpdates") { + if (val.get_boolean ()) { + data.append ("CheckAURUpdates\n"); + } else { + data.append ("#CheckAURUpdates\n"); + } +#endif + } else if (key == "KeepNumPackages") { + data.append ("KeepNumPackages = %llu\n".printf (val.get_uint64 ())); + } else if (key == "OnlyRmUninstalled") { + if (val.get_boolean ()) { + data.append ("OnlyRmUninstalled\n"); + } else { + data.append ("#OnlyRmUninstalled\n"); + } + } else if (key == "BackgroundColor") { + data.append ("BackgroundColor = %s\n".printf (val.get_string ())); + } else if (key == "ForegroundColor") { + data.append ("ForegroundCOlor = %s\n".printf (val.get_string ())); + } + } + } + // write the file + try { + // creating a DataOutputStream to the file + var dos = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); + foreach (unowned string new_line in data) { + // writing a short string to the stream + dos.put_string (new_line); + } + } catch (GLib.Error e) { + GLib.stderr.printf("%s\n", e.message); + } + } } } diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index 5e810bd..6c1761e 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -70,6 +70,10 @@ namespace Pamac { Gtk.SpinButton cache_keep_nb_spin_button; [GtkChild] Gtk.CheckButton cache_only_uninstalled_checkbutton; + [GtkChild] + Gtk.ColorButton terminal_background; + [GtkChild] + Gtk.ColorButton terminal_foreground; Gtk.ListStore ignorepkgs_liststore; Transaction transaction; @@ -106,6 +110,16 @@ namespace Pamac { cache_keep_nb_spin_button.value = transaction.keep_num_pkgs; cache_only_uninstalled_checkbutton.active = transaction.rm_only_uninstalled; + // Set up terminal colors + terminal_background.set_use_alpha (false); + terminal_foreground.set_use_alpha (false); + Gdk.RGBA rgba = Gdk.RGBA (); + bool tmp = rgba.parse (transaction.terminal_background); + terminal_background.rgba = rgba; + tmp = rgba.parse (transaction.terminal_foreground); + terminal_foreground.rgba = rgba; + stdout.printf(transaction.terminal_background); + // populate ignorepkgs_liststore ignorepkgs_liststore = new Gtk.ListStore (1, typeof (string)); ignorepkgs_treeview.set_model (ignorepkgs_liststore); @@ -121,6 +135,8 @@ namespace Pamac { cache_keep_nb_spin_button.value_changed.connect (on_cache_keep_nb_spin_button_value_changed); cache_only_uninstalled_checkbutton.toggled.connect (on_cache_only_uninstalled_checkbutton_toggled); transaction.write_pamac_config_finished.connect (on_write_pamac_config_finished); + terminal_background.color_set.connect (on_select_background); + terminal_foreground.color_set.connect (on_select_foreground); AlpmPackage pkg = transaction.find_installed_satisfier ("pacman-mirrors"); if (pkg.name == "") { @@ -220,6 +236,18 @@ namespace Pamac { transaction.start_write_pamac_config (new_pamac_conf); } + void on_select_background () { + var new_pamac_conf = new HashTable (str_hash, str_equal); + new_pamac_conf.insert ("BackgroundColor", new Variant.string (terminal_background.rgba.to_string ())); + transaction.start_write_pamac_config (new_pamac_conf); + } + + void on_select_foreground () { + var new_pamac_conf = new HashTable (str_hash, str_equal); + new_pamac_conf.insert ("ForegroundColor", new Variant.string (terminal_foreground.rgba.to_string ())); + transaction.start_write_pamac_config (new_pamac_conf); + } + #if DISABLE_AUR #else bool on_enable_aur_button_state_set (bool new_state) { diff --git a/src/transaction.vala b/src/transaction.vala index 77a28c7..2748552 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -146,6 +146,8 @@ namespace Pamac { #endif public uint64 keep_num_pkgs { get { return pamac_config.keep_num_pkgs; } } public bool rm_only_uninstalled { get { return pamac_config.rm_only_uninstalled; } } + public string terminal_background { get { return pamac_config.terminal_background; } } + public string terminal_foreground { get { return pamac_config.terminal_foreground; } } public unowned GLib.HashTable environment_variables { get {return pamac_config.environment_variables; } } public bool no_update_hide_icon { get { return pamac_config.no_update_hide_icon; } } public bool recurse { get { return pamac_config.recurse; } } @@ -262,9 +264,19 @@ namespace Pamac { term.set_scrollback_lines (-1); term.expand = true; term.visible = true; - var black = Gdk.RGBA (); + /*var black = Gdk.RGBA (); black.parse ("black"); + var green = Gdk.RGBA (); + green.parse ("green"); term.set_color_cursor (black); + term.set_color_foreground (green); + term.set_color_background (black);*/ + var tmp = Gdk.RGBA (); + tmp.parse (terminal_background); + term.set_color_cursor (tmp); + term.set_color_background (tmp); + tmp.parse (terminal_foreground); + term.set_color_foreground (tmp); term.button_press_event.connect (on_term_button_press_event); term.key_press_event.connect (on_term_key_press_event); // creating pty for term