add headerbars, improve dialogs and updater

This commit is contained in:
guinux 2016-04-23 17:27:01 +02:00
parent 0105b98f9e
commit 6046da7729
27 changed files with 633 additions and 705 deletions

View File

@ -12,7 +12,6 @@
../resources/choose_provider_dialog.ui
../resources/progress_dialog.ui
../resources/history_dialog.ui
../resources/transaction_info_dialog.ui
../resources/transaction_sum_dialog.ui
../resources/choose_dep_dialog.ui
../resources/manager_window.ui

View File

@ -115,6 +115,10 @@ msgstr ""
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr ""
#: ../src/transaction.vala
msgid "A Gtk3 frontend for libalpm"
msgstr ""
#: ../src/transaction.vala
msgid "Refreshing mirrors list"
msgstr ""
@ -136,10 +140,6 @@ msgstr ""
msgid "Choose a provider for %s"
msgstr ""
#: ../src/transaction.vala ../resources/transaction_sum_dialog.ui
msgid "Transaction Summary"
msgstr ""
#: ../src/transaction.vala
msgid "To remove"
msgstr ""
@ -325,6 +325,10 @@ msgstr ""
msgid "Warning"
msgstr ""
#: ../src/transaction.vala
msgid "_Close"
msgstr ""
#: ../src/transaction.vala
msgid "Nothing to do"
msgstr ""
@ -341,11 +345,11 @@ msgstr ""
msgid "Your system is up-to-date"
msgstr ""
#: ../src/tray.vala ../resources/updater_window.ui
#: ../src/tray.vala
msgid "Update Manager"
msgstr ""
#: ../src/tray.vala ../resources/manager_window.ui
#: ../src/tray.vala
msgid "Package Manager"
msgstr ""
@ -515,14 +519,8 @@ msgstr ""
#: ../src/manager_window.vala
#, c-format
msgid ""
"%s has %u uninstalled optional dependency.\n"
"Choose if you would like to install it"
msgid_plural ""
"%s has %u uninstalled optional dependencies.\n"
"Choose those you would like to install"
msgstr[0] ""
msgstr[1] ""
msgid "Choose optional dependencies for %s"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Install Local Packages"
@ -530,7 +528,8 @@ msgstr ""
#: ../src/manager_window.vala ../resources/progress_dialog.ui
#: ../resources/transaction_sum_dialog.ui ../resources/choose_dep_dialog.ui
#: ../resources/manager_window.ui ../resources/choose_ignorepkgs_dialog.ui
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/choose_ignorepkgs_dialog.ui
msgid "_Cancel"
msgstr ""
@ -542,10 +541,6 @@ msgstr ""
msgid "Alpm Package"
msgstr ""
#: ../src/manager_window.vala
msgid "A Gtk3 frontend for libalpm"
msgstr ""
#: ../src/preferences_dialog.vala ../resources/preferences_dialog.ui
msgid "How often to check for updates, value in hours"
msgstr ""
@ -562,18 +557,13 @@ msgstr ""
msgid "Random"
msgstr ""
#: ../src/choose_ignorepkgs_dialog.vala
msgid "Choose the packages you do not want to upgrade"
msgstr ""
#: ../resources/choose_provider_dialog.ui
msgid "Choose a Provider"
msgstr ""
#: ../resources/choose_provider_dialog.ui
#: ../resources/transaction_sum_dialog.ui ../resources/choose_dep_dialog.ui
#: ../resources/choose_provider_dialog.ui ../resources/choose_dep_dialog.ui
#: ../resources/choose_ignorepkgs_dialog.ui
msgid "_OK"
msgid "Choose"
msgstr ""
#: ../resources/progress_dialog.ui
@ -584,8 +574,8 @@ msgstr ""
msgid "_Hide"
msgstr ""
#: ../resources/progress_dialog.ui ../resources/transaction_info_dialog.ui
#: ../resources/manager_window.ui
#: ../resources/progress_dialog.ui ../resources/manager_window.ui
#: ../resources/updater_window.ui
msgid "Details"
msgstr ""
@ -593,29 +583,32 @@ msgstr ""
msgid "Pamac History"
msgstr ""
#: ../resources/history_dialog.ui ../resources/transaction_info_dialog.ui
#: ../resources/updater_window.ui ../resources/preferences_dialog.ui
msgid "_Close"
#: ../resources/transaction_sum_dialog.ui
msgid "Transaction Summary"
msgstr ""
#: ../resources/transaction_sum_dialog.ui
msgid "Commit"
msgstr ""
#: ../resources/choose_dep_dialog.ui
msgid "Choose Optional Dependencies"
msgstr ""
#: ../resources/manager_window.ui
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "Refresh databases"
msgstr ""
#: ../resources/manager_window.ui
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "View History"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "_Preferences"
msgid "Preferences"
msgstr ""
#: ../resources/manager_window.ui
msgid "_About"
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "About"
msgstr ""
#: ../resources/manager_window.ui
@ -667,14 +660,6 @@ msgstr ""
msgid "Files"
msgstr ""
#: ../resources/updater_window.ui
msgid "_Refresh"
msgstr ""
#: ../resources/preferences_dialog.ui
msgid "Preferences"
msgstr ""
#: ../resources/preferences_dialog.ui
msgid "Remove unrequired dependencies"
msgstr ""

View File

@ -15,7 +15,6 @@ UPDATER_RESOURCES_FILES = updater_window.ui
TRANSACTION_RESOURCES_FILES = progress_dialog.ui \
choose_provider_dialog.ui \
transaction_sum_dialog.ui \
transaction_info_dialog.ui \
preferences_dialog.ui \
choose_ignorepkgs_dialog.ui

View File

@ -4,13 +4,15 @@
<requires lib="gtk+" version="3.12"/>
<template class="PamacChooseDependenciesDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Choose Optional Dependencies</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<property name="deletable">False</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@ -37,12 +39,13 @@
</child>
<child>
<object class="GtkButton" id="valid_button">
<property name="label" translatable="yes">_OK</property>
<property name="label" translatable="yes">Choose</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@ -58,23 +61,12 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow5">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<property name="min_content_width">300</property>
<property name="min_content_width">350</property>
<property name="min_content_height">250</property>
<child>
<object class="GtkTreeView" id="treeview">

View File

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="PamacChooseIgnorepkgsDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Choose Ignored Upgrades</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<property name="deletable">False</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@ -36,11 +38,13 @@
</child>
<child>
<object class="GtkButton" id="valid_button">
<property name="label" translatable="yes">_OK</property>
<property name="label" translatable="yes">Choose</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@ -56,17 +60,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>

View File

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="PamacChooseProviderDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Choose a Provider</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<property name="deletable">False</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox2">
<property name="can_focus">False</property>
@ -22,12 +24,13 @@
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="valid_button">
<property name="label" translatable="yes">_OK</property>
<property name="label" translatable="yes">Choose</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">True</property>
@ -44,40 +47,7 @@
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="track_visited_links">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="comboboxtext">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
<placeholder/>
</child>
</object>
</child>

View File

@ -4,7 +4,7 @@
<requires lib="gtk+" version="3.12"/>
<template class="PamacHistoryDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Pamac History</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
@ -21,19 +21,7 @@
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
<placeholder/>
</child>
</object>
<packing>
@ -69,8 +57,5 @@
</child>
</object>
</child>
<action-widgets>
<action-widget response="-7">close_button</action-widget>
</action-widgets>
</template>
</interface>

View File

@ -1,61 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkMenu" id="main_menu">
<property name="visible">True</property>
<requires lib="gtk+" version="3.16"/>
<object class="GtkPopoverMenu" id="popovermenu">
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="refresh_item">
<object class="GtkBox" id="menu_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Refresh databases</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_refresh_item_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="history_item">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">View History</property>
<signal name="activate" handler="on_history_item_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="local_item">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Install Local Packages</property>
<signal name="activate" handler="on_local_item_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="preferences_item">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Preferences</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_preferences_item_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="about_item">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_About</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_about_item_activate" swapped="no"/>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkModelButton" id="refresh_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Refresh databases</property>
<signal name="clicked" handler="on_refresh_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="history_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">View History</property>
<signal name="clicked" handler="on_history_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="local_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Install Local Packages</property>
<signal name="clicked" handler="on_local_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="preferences_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Preferences</property>
<signal name="clicked" handler="on_preferences_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="about_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">About</property>
<signal name="clicked" handler="on_about_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="submenu">main</property>
<property name="position">1</property>
</packing>
</child>
</object>
<template class="PamacManagerWindow" parent="GtkApplicationWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Package Manager</property>
<property name="default_height">600</property>
<property name="icon_name">system-software-install</property>
<property name="gravity">center</property>
<property name="show_menubar">False</property>
<child>
<object class="GtkStack" id="main_stack">
<property name="visible">True</property>
@ -66,61 +105,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkStackSwitcher" id="filters_stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">filters_stack</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="menu_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="popup">main_menu</property>
<child>
<object class="GtkImage" id="menu_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">emblem-system-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">3</property>
<property name="spacing">3</property>
<child>
<object class="GtkStack" id="filters_stack">
@ -132,7 +122,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="spacing">3</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
@ -163,7 +153,6 @@
<property name="margin_start">6</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Search in AUR</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@ -609,13 +598,17 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="transaction_infobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_bottom">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="transaction_infos_label">
<property name="visible">True</property>
@ -637,12 +630,12 @@
<property name="homogeneous">True</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="transaction_infos_details_button">
<object class="GtkButton" id="details_button">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_transaction_infos_details_button_clicked" swapped="no"/>
<signal name="clicked" handler="on_details_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -651,14 +644,13 @@
</packing>
</child>
<child>
<object class="GtkButton" id="transaction_infos_apply_button">
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">_Apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="yalign">0.55000001192092896</property>
<signal name="clicked" handler="on_transaction_infos_apply_button_clicked" swapped="no"/>
<signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -667,13 +659,13 @@
</packing>
</child>
<child>
<object class="GtkButton" id="transaction_infos_cancel_button">
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_transaction_infos_cancel_button_clicked" swapped="no"/>
<signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -692,7 +684,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">1</property>
</packing>
</child>
</object>
@ -994,5 +986,43 @@
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child type="title">
<object class="GtkStackSwitcher" id="filters_stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">filters_stack</property>
</object>
</child>
<child>
<object class="GtkMenuButton" id="menu_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="popover">popovermenu</property>
<child>
<object class="GtkImage" id="menu_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</template>
</interface>

View File

@ -2,7 +2,6 @@
<gresources>
<gresource prefix="/org/manjaro/pamac/manager">
<file preprocess="xml-stripblanks">manager_window.ui</file>
<file preprocess="xml-stripblanks">history_dialog.ui</file>
<file preprocess="xml-stripblanks">choose_dep_dialog.ui</file>
<file preprocess="to-pixdata">package-available.png</file>
<file preprocess="to-pixdata">package-available-locked.png</file>

View File

@ -2,9 +2,9 @@
<gresources>
<gresource prefix="/org/manjaro/pamac/transaction">
<file preprocess="xml-stripblanks">progress_dialog.ui</file>
<file preprocess="xml-stripblanks">history_dialog.ui</file>
<file preprocess="xml-stripblanks">choose_provider_dialog.ui</file>
<file preprocess="xml-stripblanks">transaction_sum_dialog.ui</file>
<file preprocess="xml-stripblanks">transaction_info_dialog.ui</file>
</gresource>
<gresource prefix="/org/manjaro/pamac/preferences">
<file preprocess="xml-stripblanks">preferences_dialog.ui</file>

View File

@ -11,8 +11,7 @@
</object>
<template class="PamacPreferencesDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Preferences</property>
<property name="border_width">3</property>
<property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
@ -26,18 +25,7 @@
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
<placeholder/>
</child>
</object>
<packing>
@ -47,19 +35,6 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">stack</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
@ -677,8 +652,23 @@ All AUR users should be familiar with the build process.</property>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-7">close_button</action-widget>
</action-widgets>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child>
<placeholder/>
</child>
<child type="title">
<object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">stack</property>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@ -3,13 +3,14 @@
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="PamacProgressDialog" parent="GtkDialog">
<property name="width_request">500</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Progress</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="deletable">False</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
@ -60,6 +61,7 @@
<object class="GtkLabel" id="action_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">12</property>
</object>
<packing>
<property name="expand">False</property>

View File

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="PamacTransactionInfoDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">300</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox4">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area4">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="resize_toplevel">True</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="width_request">450</property>
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="pixels_above_lines">3</property>
<property name="editable">False</property>
<property name="left_margin">6</property>
<property name="right_margin">6</property>
<property name="cursor_visible">False</property>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="expander_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Details</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-7">close_button</action-widget>
</action-widgets>
</template>
</interface>

View File

@ -4,11 +4,13 @@
<requires lib="gtk+" version="3.12"/>
<template class="PamacTransactionSumDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Transaction Summary</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<property name="deletable">False</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox6">
<property name="can_focus">False</property>
@ -23,7 +25,6 @@
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
@ -34,12 +35,14 @@
</packing>
</child>
<child>
<object class="GtkButton" id="valid_button">
<property name="label" translatable="yes">_OK</property>
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">Commit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@ -52,18 +55,19 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="top_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
@ -137,25 +141,14 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="bottom_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">valid_button</action-widget>
<action-widget response="-5">apply_button</action-widget>
</action-widgets>
</template>
</interface>

View File

@ -1,27 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow">
<property name="visible">True</property>
<requires lib="gtk+" version="3.16"/>
<object class="GtkPopoverMenu" id="popovermenu">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Update Manager</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-update</property>
<property name="gravity">center</property>
<child>
<object class="GtkBox" id="box1">
<object class="GtkBox" id="menu_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="top_label">
<object class="GtkModelButton" id="refresh_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Refresh databases</property>
<signal name="clicked" handler="on_refresh_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@ -30,11 +26,12 @@
</packing>
</child>
<child>
<object class="GtkStackSwitcher" id="stackswitcher">
<object class="GtkModelButton" id="history_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">stack</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">View History</property>
<signal name="clicked" handler="on_history_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@ -42,6 +39,70 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="preferences_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Preferences</property>
<signal name="clicked" handler="on_preferences_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="about_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">About</property>
<signal name="clicked" handler="on_about_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="submenu">main</property>
<property name="position">1</property>
</packing>
</child>
</object>
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="default_width">600</property>
<property name="icon_name">system-software-update</property>
<property name="gravity">center</property>
<property name="show_menubar">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_top">6</property>
<property name="stack">stack</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
@ -241,45 +302,23 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="bottom_label">
<object class="GtkBox" id="transaction_infobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkButtonBox" id="buttonbox2">
<object class="GtkLabel" id="bottom_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="preferences_button">
<property name="label" translatable="yes">_Preferences</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_preferences_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">False</property>
@ -288,35 +327,75 @@
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox1">
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
<property name="spacing">12</property>
<child>
<object class="GtkButton" id="refresh_button">
<property name="label" translatable="yes">_Refresh</property>
<object class="GtkLabel" id="transaction_infos_label">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_refresh_button_clicked" swapped="no"/>
<property name="can_focus">False</property>
<property name="halign">start</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">_Apply</property>
<object class="GtkButtonBox" id="transaction_infos_buttonbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="details_button">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_details_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">_Apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -324,26 +403,10 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_close_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
@ -351,7 +414,37 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkMenuButton" id="menu_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="popover">popovermenu</property>
<child>
<object class="GtkImage" id="menu_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>

View File

@ -25,9 +25,9 @@ COMMON_SOURCES = common.vala \
TRANSACTION_SOURCES = package.vala \
transaction.vala \
history_dialog.vala \
choose_provider_dialog.vala \
transaction_sum_dialog.vala \
transaction_info_dialog.vala \
progress_dialog.vala
PREFERENCES_SOURCES = preferences_dialog.vala \
@ -94,7 +94,7 @@ libpamac.so: $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../
$(TRANSACTION_SOURCES) \
$(PREFERENCES_SOURCES)
pamac-manager: libpamac.so choose_dep_dialog.vala history_dialog.vala transaction_info_dialog.vala ../resources/manager_resources.c manager_window.vala manager.vala
pamac-manager: libpamac.so choose_dep_dialog.vala ../resources/manager_resources.c manager_window.vala manager.vala
valac -o pamac-manager \
$(COMMON_VALA_FLAGS) \
$(PAMAC_LIB_FLAGS) \
@ -104,7 +104,6 @@ pamac-manager: libpamac.so choose_dep_dialog.vala history_dialog.vala transactio
--gresources=$(MANAGER_GRESOURCE_FILE) \
../resources/manager_resources.c \
choose_dep_dialog.vala \
history_dialog.vala \
manager_window.vala \
manager.vala

View File

@ -22,15 +22,13 @@ namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/manager/choose_dep_dialog.ui")]
class ChooseDependenciesDialog : Gtk.Dialog {
[GtkChild]
public Gtk.Label label;
[GtkChild]
public Gtk.TreeView treeview;
public Gtk.ListStore deps_list;
public ChooseDependenciesDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0);
Object (transient_for: window, use_header_bar: 1);
deps_list = new Gtk.ListStore (2, typeof (bool), typeof (string));
treeview.set_model (deps_list);

View File

@ -22,17 +22,14 @@ namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/preferences/choose_ignorepkgs_dialog.ui")]
class ChooseIgnorepkgsDialog : Gtk.Dialog {
[GtkChild]
public Gtk.Label label;
[GtkChild]
public Gtk.TreeView treeview;
public Gtk.ListStore pkgs_list;
public ChooseIgnorepkgsDialog (Gtk.Window window) {
Object (transient_for: window, use_header_bar: 0);
Object (transient_for: window, use_header_bar: 1);
label.set_markup ("<b>%s</b>".printf (dgettext (null, "Choose the packages you do not want to upgrade")));
pkgs_list = new Gtk.ListStore (2, typeof (bool), typeof (string));
treeview.set_model (pkgs_list);
}
@ -40,10 +37,10 @@ namespace Pamac {
[GtkCallback]
void on_renderertoggle_toggled (string path) {
Gtk.TreeIter iter;
GLib.Value selected;
bool selected;
if (pkgs_list.get_iter_from_string (out iter, path)) {
pkgs_list.get_value (iter, 0, out selected);
pkgs_list.set_value (iter, 0, !((bool) selected));
pkgs_list.get (iter, 0, out selected);
pkgs_list.set (iter, 0, !selected);
}
}
}

View File

@ -22,13 +22,8 @@ namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/transaction/choose_provider_dialog.ui")]
class ChooseProviderDialog : Gtk.Dialog {
[GtkChild]
public Gtk.Label label;
[GtkChild]
public Gtk.ComboBoxText comboboxtext;
public ChooseProviderDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0);
Object (transient_for: window, use_header_bar: 1);
}
}
}

View File

@ -19,14 +19,14 @@
namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/manager/history_dialog.ui")]
[GtkTemplate (ui = "/org/manjaro/pamac/transaction/history_dialog.ui")]
class HistoryDialog : Gtk.Dialog {
[GtkChild]
public Gtk.TextView textview;
public HistoryDialog (ManagerWindow window) {
Object (transient_for: window, use_header_bar: 0);
public HistoryDialog (Gtk.ApplicationWindow window) {
Object (transient_for: window, use_header_bar: 1);
}
}
}

View File

@ -17,8 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const string VERSION = "4.0.0";
namespace Pamac {
class ActivableCellRendererPixbuf : Gtk.CellRendererPixbuf {
@ -61,6 +59,8 @@ namespace Pamac {
[GtkChild]
Gtk.Stack filters_stack;
[GtkChild]
Gtk.StackSwitcher filters_stackswitcher;
[GtkChild]
Gtk.SearchEntry search_entry;
[GtkChild]
Gtk.TreeView search_treeview;
@ -101,9 +101,9 @@ namespace Pamac {
[GtkChild]
Gtk.Label transaction_infos_label;
[GtkChild]
Gtk.Button transaction_infos_apply_button;
Gtk.Button apply_button;
[GtkChild]
Gtk.Button transaction_infos_cancel_button;
Gtk.Button cancel_button;
// menu
Gtk.Menu right_click_menu;
@ -300,6 +300,7 @@ namespace Pamac {
show_default_pkgs ();
search_entry.grab_focus ();
main_stack.notify["visible-child"].connect (on_main_stack_visible_child_changed);
filters_stack.notify["visible-child"].connect (on_filters_stack_visible_child_changed);
packages_stack.notify["visible-child"].connect (on_packages_stack_visible_child_changed);
@ -965,16 +966,18 @@ namespace Pamac {
void choose_opt_dep (GLib.List<string> pkgnames) {
foreach (unowned string pkgname in pkgnames) {
var choose_dep_dialog = new ChooseDependenciesDialog (this);
int length = 0;
//~ int length = 0;
foreach (unowned string optdep in transaction.get_pkg_uninstalled_optdeps (pkgname)) {
length++;
//~ length++;
choose_dep_dialog.deps_list.insert_with_values (null, -1,
0, false,
1, optdep);
}
choose_dep_dialog.label.set_markup ("<b>%s</b>".printf (
ngettext ("%s has %u uninstalled optional dependency.\nChoose if you would like to install it",
"%s has %u uninstalled optional dependencies.\nChoose those you would like to install", length).printf (pkgname, length)));
choose_dep_dialog.title = dgettext (null, "Choose optional dependencies for %s").printf (pkgname);
//~ var headerbar = choose_dep_dialog.get_header_bar () as Gtk.HeaderBar;
//~ headerbar.subtitle = ngettext ("%s has %u uninstalled optional dependency",
//~ "%s has %u uninstalled optional dependencies",
//~ length).printf (pkgname, length);
if (choose_dep_dialog.run () == Gtk.ResponseType.OK) {
choose_dep_dialog.deps_list.foreach ((model, path, iter) => {
bool selected;
@ -1390,44 +1393,30 @@ namespace Pamac {
}
}
void on_main_stack_visible_child_changed () {
switch (main_stack.visible_child_name) {
case "browse":
filters_stackswitcher.visible = true;
break;
case "details":
filters_stackswitcher.visible = false;
break;
default:
break;
}
}
void on_filters_stack_visible_child_changed () {
refresh_packages_list ();
}
[GtkCallback]
void on_history_item_activate () {
var file = GLib.File.new_for_path ("/var/log/pamac.log");
if (!file.query_exists ()) {
GLib.stderr.printf ("File '%s' doesn't exist.\n", file.get_path ());
} else {
StringBuilder text = new StringBuilder ();
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) {
// construct text in reverse order
text.prepend (line + "\n");
}
} catch (GLib.Error e) {
GLib.stderr.printf ("%s\n", e.message);
}
var history_dialog = new HistoryDialog (this);
history_dialog.textview.buffer.set_text (text.str, (int) text.len);
history_dialog.show ();
history_dialog.response.connect (() => {
history_dialog.destroy ();
});
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
void on_history_button_clicked () {
transaction.run_history_dialog ();
}
[GtkCallback]
void on_local_item_activate () {
void on_local_button_clicked () {
Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog (
dgettext (null, "Install Local Packages"), this, Gtk.FileChooserAction.OPEN,
dgettext (null, "_Cancel"), Gtk.ResponseType.CANCEL,
@ -1465,25 +1454,17 @@ namespace Pamac {
}
[GtkCallback]
void on_preferences_item_activate () {
void on_preferences_button_clicked () {
transaction.run_preferences_dialog.begin ();
}
[GtkCallback]
void on_about_item_activate () {
Gtk.show_about_dialog (
this,
"program_name", "Pamac",
"logo_icon_name", "system-software-install",
"comments", dgettext (null, "A Gtk3 frontend for libalpm"),
"copyright", "Copyright © 2016 Guillaume Benoit",
"version", VERSION,
"license_type", Gtk.License.GPL_3_0,
"website", "http://manjaro.org");
void on_about_button_clicked () {
transaction.run_about_dialog ();
}
[GtkCallback]
void on_transaction_infos_details_button_clicked () {
void on_details_button_clicked () {
if (transaction_running) {
transaction.show_progress ();
} else {
@ -1500,14 +1481,13 @@ namespace Pamac {
}
[GtkCallback]
void on_transaction_infos_apply_button_clicked () {
//this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
void on_apply_button_clicked () {
transaction_running = true;
transaction.run ();
}
[GtkCallback]
void on_transaction_infos_cancel_button_clicked () {
void on_cancel_button_clicked () {
if (transaction_running) {
transaction.cancel ();
} else {
@ -1518,17 +1498,17 @@ namespace Pamac {
}
[GtkCallback]
void on_refresh_item_activate () {
void on_refresh_button_clicked () {
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
refreshing = true;
transaction.start_refresh (false);
transaction_infos_apply_button.visible = false;
apply_button.visible = false;
transaction_infobox.visible = true;
}
void on_start_transaction () {
transaction_infos_cancel_button.visible = false;
transaction_infos_apply_button.visible = false;
cancel_button.visible = false;
apply_button.visible = false;
}
void on_emit_action (string action) {
@ -1546,8 +1526,8 @@ namespace Pamac {
refreshing = false;
} else {
transaction_running = false;
transaction_infos_cancel_button.visible = true;
transaction_infos_apply_button.visible = true;
cancel_button.visible = true;
apply_button.visible = true;
}
set_pendings_operations ();
}

View File

@ -62,7 +62,7 @@ namespace Pamac {
uint64 previous_refresh_period;
public PreferencesDialog (Transaction transaction) {
Object (transient_for: transaction.application_window, use_header_bar: 0);
Object (transient_for: transaction.application_window, use_header_bar: 1);
this.transaction = transaction;
refresh_period_label.set_markup (dgettext (null, "How often to check for updates, value in hours") +":");

View File

@ -37,7 +37,7 @@ namespace Pamac {
Vte.Pty pty;
public ProgressDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0);
Object (transient_for: window, use_header_bar: 1);
//creating terminal
term = new Vte.Terminal ();

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const string VERSION = "4.0.0";
namespace Pamac {
[DBus (name = "org.manjaro.pamac")]
interface Daemon : Object {
@ -141,10 +143,10 @@ namespace Pamac {
uint64 rates_nb;
Timer timer;
bool success;
StringBuilder dialog_textbuffer;
//dialogs
TransactionSumDialog transaction_sum_dialog;
TransactionInfoDialog transaction_info_dialog;
ProgressDialog progress_dialog;
//parent window
public Gtk.ApplicationWindow? application_window { get; private set; }
@ -180,10 +182,8 @@ namespace Pamac {
//creating dialogs
this.application_window = application_window;
transaction_sum_dialog = new TransactionSumDialog (application_window);
transaction_info_dialog = new TransactionInfoDialog (application_window);
progress_dialog = new ProgressDialog (application_window);
progress_dialog.close_button.clicked.connect (hide_progress);
progress_dialog.delete_event.connect (progress_dialog.hide_on_delete);
progress_dialog.cancel_button.clicked.connect (on_progress_dialog_cancel_button_clicked);
// connect to child_exited signal which will only be emit after a call to watch_child
progress_dialog.term.child_exited.connect (on_term_child_exited);
@ -193,6 +193,38 @@ namespace Pamac {
sysupgrade_after_trans = false;
timer = new Timer ();
success = false;
dialog_textbuffer = new StringBuilder ();
}
public void run_history_dialog () {
var file = GLib.File.new_for_path ("/var/log/pamac.log");
if (!file.query_exists ()) {
GLib.stderr.printf ("File '%s' doesn't exist.\n", file.get_path ());
} else {
StringBuilder text = new StringBuilder ();
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) {
// construct text in reverse order
text.prepend (line + "\n");
}
} catch (GLib.Error e) {
GLib.stderr.printf ("%s\n", e.message);
}
var history_dialog = new HistoryDialog (application_window);
history_dialog.textview.buffer.set_text (text.str, (int) text.len);
history_dialog.show ();
history_dialog.response.connect (() => {
history_dialog.destroy ();
});
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
}
public async void run_preferences_dialog () {
@ -213,6 +245,18 @@ namespace Pamac {
daemon.disconnect (handler_id);
}
public void run_about_dialog () {
Gtk.show_about_dialog (
application_window,
"program_name", "Pamac",
"logo_icon_name", "system-software-install",
"comments", dgettext (null, "A Gtk3 frontend for libalpm"),
"copyright", "Copyright © 2016 Guillaume Benoit",
"version", VERSION,
"license_type", Gtk.License.GPL_3_0,
"website", "http://manjaro.org");
}
public ErrorInfos get_current_error () {
try {
return daemon.get_current_error ();
@ -304,12 +348,6 @@ namespace Pamac {
string action = dgettext (null, "Synchronizing package databases") + "...";
reset_progress_dialog (action);
emit_action (action);
if (mode != Mode.MANAGER) {
progress_dialog.show ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
try {
daemon.refresh_finished.connect (on_refresh_finished);
daemon.start_refresh (force);
@ -637,12 +675,6 @@ namespace Pamac {
success = false;
}
if (success) {
if (mode != Mode.MANAGER) {
progress_dialog.show ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
try {
daemon.start_trans_prepare ();
} catch (IOError e) {
@ -718,12 +750,6 @@ namespace Pamac {
string action = dgettext (null, "Preparing") + "...";
reset_progress_dialog (action);
emit_action (action);
if (mode != Mode.MANAGER) {
progress_dialog.show ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
// run
if (to_install.length == 0
&& to_remove.length == 0
@ -791,16 +817,36 @@ namespace Pamac {
void choose_provider (string depend, string[] providers) {
var choose_provider_dialog = new ChooseProviderDialog (application_window);
choose_provider_dialog.label.set_markup ("<b>%s</b>".printf (dgettext (null, "Choose a provider for %s").printf (depend)));
choose_provider_dialog.title = dgettext (null, "Choose a provider for %s").printf (depend);
unowned Gtk.Box box = choose_provider_dialog.get_content_area ();
Gtk.RadioButton? last_radiobutton = null;
Gtk.RadioButton? first_radiobutton = null;
foreach (unowned string provider in providers) {
choose_provider_dialog.comboboxtext.append_text (provider);
var radiobutton = new Gtk.RadioButton.with_label_from_widget (last_radiobutton, provider);
radiobutton.visible = true;
// active first provider
if (last_radiobutton == null) {
radiobutton.active = true;
first_radiobutton = radiobutton;
}
last_radiobutton = radiobutton;
box.add (radiobutton);
}
choose_provider_dialog.comboboxtext.active = 0;
choose_provider_dialog.run ();
try {
daemon.choose_provider (choose_provider_dialog.comboboxtext.active);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
// get active provider
int index = 0;
// list is given in reverse order so reverse it !
SList<unowned Gtk.RadioButton> list = last_radiobutton.get_group ().copy ();
list.reverse ();
foreach (var radiobutton in list) {
if (radiobutton.active) {
try {
daemon.choose_provider (index);
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
}
}
index++;
}
choose_provider_dialog.destroy ();
while (Gtk.events_pending ()) {
@ -814,7 +860,6 @@ namespace Pamac {
uint64 dsize = 0;
transaction_summary.remove_all ();
var summary = TransactionSummary ();
transaction_sum_dialog.top_label.set_markup ("<big><b>%s</b></big>".printf (dgettext (null, "Transaction Summary")));
transaction_sum_dialog.sum_list.clear ();
try {
summary = daemon.get_transaction_summary ();
@ -908,10 +953,10 @@ namespace Pamac {
}
}
if (dsize == 0) {
transaction_sum_dialog.bottom_label.visible = false;
transaction_sum_dialog.top_label.visible = false;
} else {
transaction_sum_dialog.bottom_label.set_markup ("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size (dsize)));
transaction_sum_dialog.bottom_label.visible = true;
transaction_sum_dialog.top_label.set_markup ("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size (dsize)));
transaction_sum_dialog.top_label.visible = true;
}
return type;
}
@ -970,11 +1015,7 @@ namespace Pamac {
progress_dialog.hide ();
progress_dialog.spawn_in_term ({"/usr/bin/echo", dgettext (null, "Transaction cancelled") + ".\n"});
progress_dialog.expander.expanded = false;
Gtk.TextIter start_iter;
Gtk.TextIter end_iter;
transaction_info_dialog.textbuffer.get_start_iter (out start_iter);
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.delete (ref start_iter, ref end_iter);
dialog_textbuffer = new StringBuilder ();
}
public void release () {
@ -1097,10 +1138,7 @@ namespace Pamac {
break;
case 33: //Alpm.Event.Type.OPTDEP_REMOVAL
detailed_action = dgettext (null, "%s optionally requires %s").printf (details[0], details[1]);
Gtk.TextIter end_iter;
string msg = detailed_action + "\n";
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.insert (ref end_iter, msg, msg.length);
dialog_textbuffer.append (detailed_action + "\n");
break;
case 34: //Alpm.Event.Type.DATABASE_MISSING
detailed_action = dgettext (null, "Database file for %s does not exist").printf (details[0]);
@ -1312,7 +1350,6 @@ namespace Pamac {
void on_emit_log (uint level, string msg) {
// msg ends with \n
string? line = null;
Gtk.TextIter end_iter;
if (level == 1) { //Alpm.LogLevel.ERROR
if (previous_filename != "") {
line = dgettext (null, "Error") + ": " + previous_filename + ": " + msg;
@ -1327,65 +1364,60 @@ namespace Pamac {
} else {
line = dgettext (null, "Warning") + ": " + msg;
}
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.insert (ref end_iter, msg, msg.length);
dialog_textbuffer.append (msg);
}
}
if (line != null) {
display_error (line, {});
progress_dialog.spawn_in_term ({"echo", "-n", line});
}
}
void show_warnings () {
if (transaction_info_dialog.textbuffer.text != "") {
transaction_info_dialog.title = dgettext (null, "Warning");
transaction_info_dialog.label.visible = false;
transaction_info_dialog.expander.visible = true;
transaction_info_dialog.expander.expanded = true;
transaction_info_dialog.run ();
transaction_info_dialog.hide ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
Gtk.TextIter start_iter;
Gtk.TextIter end_iter;
transaction_info_dialog.textbuffer.get_start_iter (out start_iter);
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.delete (ref start_iter, ref end_iter);
if (dialog_textbuffer.len > 0) {
var dialog = new Gtk.Dialog.with_buttons (dgettext (null, "Warning"),
application_window,
Gtk.DialogFlags.MODAL | Gtk.DialogFlags.USE_HEADER_BAR);
dialog.deletable = false;
unowned Gtk.Widget widget = dialog.add_button (dgettext (null, "_Close"), Gtk.ResponseType.CLOSE);
widget.can_focus = true;
widget.has_focus = true;
widget.can_default = true;
widget.has_default = true;
var scrolledwindow = new Gtk.ScrolledWindow (null, null);
var label = new Gtk.Label (dialog_textbuffer.str);
label.margin = 12;
scrolledwindow.visible = true;
label.visible = true;
scrolledwindow.add (label);
scrolledwindow.expand = true;
unowned Gtk.Box box = dialog.get_content_area ();
box.add (scrolledwindow);
dialog.default_width = 600;
dialog.default_height = 300;
dialog.run ();
dialog.destroy ();
dialog_textbuffer = new StringBuilder ();
}
}
void display_error (string message, string[] details) {
progress_dialog.spawn_in_term ({"echo", "-n", message});
Gtk.TextIter start_iter;
Gtk.TextIter end_iter;
transaction_info_dialog.title = dgettext (null, "Error");
transaction_info_dialog.label.visible = true;
transaction_info_dialog.label.label = message;
var dialog = new Gtk.MessageDialog (application_window,
Gtk.DialogFlags.MODAL,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE,
message);
if (details.length != 0) {
transaction_info_dialog.textbuffer.get_start_iter (out start_iter);
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.delete (ref start_iter, ref end_iter);
transaction_info_dialog.expander.visible = true;
transaction_info_dialog.expander.expanded = true;
var textbuffer = new StringBuilder ();
progress_dialog.spawn_in_term ({"echo", ":"});
foreach (unowned string detail in details) {
progress_dialog.spawn_in_term ({"echo", detail});
string str = detail + "\n";
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.insert (ref end_iter, str, str.length);
textbuffer.append (detail + "\n");
}
} else {
transaction_info_dialog.expander.visible = false;
}
transaction_info_dialog.run ();
transaction_info_dialog.hide ();
transaction_info_dialog.textbuffer.get_start_iter (out start_iter);
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.delete (ref start_iter, ref end_iter);
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
dialog.secondary_text = textbuffer.str;
}
dialog.run ();
dialog.destroy ();
}
void handle_error (ErrorInfos error) {

View File

@ -1,40 +0,0 @@
/*
* pamac-vala
*
* Copyright (C) 2014-2016 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 {
[GtkTemplate (ui = "/org/manjaro/pamac/transaction/transaction_info_dialog.ui")]
class TransactionInfoDialog : Gtk.Dialog {
[GtkChild]
public Gtk.Label label;
[GtkChild]
public Gtk.Expander expander;
[GtkChild]
Gtk.TextView textview;
public Gtk.TextBuffer textbuffer;
public TransactionInfoDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0);
textbuffer = textview.get_buffer ();
}
}
}

View File

@ -25,14 +25,12 @@ namespace Pamac {
[GtkChild]
public Gtk.Label top_label;
[GtkChild]
public Gtk.Label bottom_label;
[GtkChild]
Gtk.TreeView treeview;
public Gtk.ListStore sum_list;
public TransactionSumDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0);
Object (transient_for: window, use_header_bar: 1);
sum_list = new Gtk.ListStore (4, typeof (string), typeof (string), typeof (string), typeof (string));
treeview.set_model (sum_list);

View File

@ -23,7 +23,7 @@ namespace Pamac {
class UpdaterWindow : Gtk.ApplicationWindow {
[GtkChild]
Gtk.Label top_label;
Gtk.HeaderBar headerbar;
[GtkChild]
Gtk.StackSwitcher stackswitcher;
[GtkChild]
@ -41,7 +41,15 @@ namespace Pamac {
[GtkChild]
Gtk.Label bottom_label;
[GtkChild]
Gtk.Box transaction_infobox;
[GtkChild]
Gtk.Label transaction_infos_label;
[GtkChild]
Gtk.Button details_button;
[GtkChild]
Gtk.Button apply_button;
[GtkChild]
Gtk.Button cancel_button;
Gtk.ListStore repos_updates_list;
Gtk.ListStore aur_updates_list;
@ -52,7 +60,10 @@ namespace Pamac {
Object (application: application);
bottom_label.visible = false;
apply_button.sensitive = false;
apply_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
details_button.visible = false;
cancel_button.visible = false;
transaction_infobox.visible = false;
stackswitcher.visible = false;
aur_scrolledwindow.visible = false;
@ -69,6 +80,8 @@ namespace Pamac {
transaction = new Transaction (this as Gtk.ApplicationWindow);
transaction.mode = Mode.UPDATER;
transaction.start_transaction.connect (on_start_transaction);
transaction.emit_action.connect (on_emit_action);
transaction.finished.connect (populate_updates_list);
transaction.get_updates_finished.connect (on_get_updates_finished);
@ -77,23 +90,23 @@ namespace Pamac {
return false;
}
void set_apply_button_sensitive () {
bool sensitive = false;
void set_transaction_infobox_visible () {
bool visible = false;
repos_updates_list.foreach ((model, path, iter) => {
bool selected;
repos_updates_list.get (iter, 0, out selected);
sensitive = selected;
return sensitive;
visible = selected;
return visible;
});
if (!sensitive) {
if (!visible) {
aur_updates_list.foreach ((model, path, iter) => {
bool selected;
aur_updates_list.get (iter, 0, out selected);
sensitive = selected;
return sensitive;
visible = selected;
return visible;
});
}
apply_button.sensitive = sensitive;
transaction_infobox.visible = visible;
}
[GtkCallback]
@ -110,7 +123,7 @@ namespace Pamac {
repos_updates_list.set (iter, 0, true);
transaction.temporary_ignorepkgs.remove (pkgname);
}
set_apply_button_sensitive ();
set_transaction_infobox_visible ();
}
[GtkCallback]
@ -127,7 +140,7 @@ namespace Pamac {
aur_updates_list.set (iter, 0, true);
transaction.temporary_ignorepkgs.remove (pkgname);
}
set_apply_button_sensitive ();
set_transaction_infobox_visible ();
}
[GtkCallback]
@ -139,8 +152,9 @@ namespace Pamac {
[GtkCallback]
void on_apply_button_clicked () {
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
transaction.sysupgrade (false);
details_button.visible = true;
cancel_button.visible = true;
}
[GtkCallback]
@ -150,17 +164,46 @@ namespace Pamac {
}
[GtkCallback]
void on_close_button_clicked () {
this.application.quit ();
void on_history_button_clicked () {
transaction.run_history_dialog ();
}
[GtkCallback]
void on_about_button_clicked () {
transaction.run_about_dialog ();
}
[GtkCallback]
void on_details_button_clicked () {
transaction.show_progress ();
}
[GtkCallback]
void on_cancel_button_clicked () {
transaction.cancel ();
}
void on_start_transaction () {
cancel_button.visible = false;
apply_button.visible = false;
}
void on_emit_action (string action) {
transaction_infos_label.label = action;
}
void populate_updates_list () {
apply_button.visible = true;
apply_button.grab_default ();
details_button.visible = false;
cancel_button.visible = false;
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
transaction_infos_label.label = "";
transaction.start_get_updates ();
}
void on_get_updates_finished (Updates updates) {
top_label.set_markup ("");
headerbar.title = "";
repos_updates_list.clear ();
stackswitcher.visible = false;
repos_scrolledwindow.visible = true;
@ -192,11 +235,11 @@ namespace Pamac {
}
uint updates_nb = repos_updates_nb + aur_updates_nb;
if (updates_nb == 0) {
top_label.set_markup("<b>%s</b>".printf (dgettext (null, "Your system is up-to-date")));
headerbar.title = dgettext (null, "Your system is up-to-date");
} else {
top_label.set_markup("<b>%s</b>".printf (dngettext (null, "%u available update", "%u available updates", updates_nb).printf (updates_nb)));
headerbar.title = dngettext (null, "%u available update", "%u available updates", updates_nb).printf (updates_nb);
}
set_apply_button_sensitive ();
set_transaction_infobox_visible ();
if (dsize != 0) {
bottom_label.set_markup("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size(dsize)));
bottom_label.visible = true;