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/choose_provider_dialog.ui
../resources/progress_dialog.ui ../resources/progress_dialog.ui
../resources/history_dialog.ui ../resources/history_dialog.ui
../resources/transaction_info_dialog.ui
../resources/transaction_sum_dialog.ui ../resources/transaction_sum_dialog.ui
../resources/choose_dep_dialog.ui ../resources/choose_dep_dialog.ui
../resources/manager_window.ui ../resources/manager_window.ui

View File

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

View File

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

View File

@ -4,13 +4,15 @@
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacChooseDependenciesDialog" parent="GtkDialog"> <template class="PamacChooseDependenciesDialog" parent="GtkDialog">
<property name="can_focus">False</property> <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="title" translatable="yes">Choose Optional Dependencies</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="window_position">center-on-parent</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="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="urgency_hint">True</property> <property name="urgency_hint">True</property>
<property name="deletable">False</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -37,12 +39,13 @@
</child> </child>
<child> <child>
<object class="GtkButton" id="valid_button"> <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="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_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="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -58,23 +61,12 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </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> <child>
<object class="GtkScrolledWindow" id="scrolledwindow5"> <object class="GtkScrolledWindow" id="scrolledwindow5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</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> <property name="min_content_height">250</property>
<child> <child>
<object class="GtkTreeView" id="treeview"> <object class="GtkTreeView" id="treeview">

View File

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

View File

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacChooseProviderDialog" parent="GtkDialog"> <template class="PamacChooseProviderDialog" parent="GtkDialog">
<property name="can_focus">False</property> <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="title" translatable="yes">Choose a Provider</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="window_position">center-on-parent</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="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="urgency_hint">True</property> <property name="urgency_hint">True</property>
<property name="deletable">False</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox2"> <object class="GtkBox" id="dialog-vbox2">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -22,12 +24,13 @@
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="valid_button"> <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="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_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="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -44,40 +47,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box4"> <placeholder/>
<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>
</child> </child>
</object> </object>
</child> </child>

View File

@ -4,7 +4,7 @@
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacHistoryDialog" parent="GtkDialog"> <template class="PamacHistoryDialog" parent="GtkDialog">
<property name="can_focus">False</property> <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="title" translatable="yes">Pamac History</property>
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="default_width">600</property> <property name="default_width">600</property>
@ -21,19 +21,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="close_button"> <placeholder/>
<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>
</child> </child>
</object> </object>
<packing> <packing>
@ -69,8 +57,5 @@
</child> </child>
</object> </object>
</child> </child>
<action-widgets>
<action-widget response="-7">close_button</action-widget>
</action-widgets>
</template> </template>
</interface> </interface>

View File

@ -1,61 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.16"/>
<object class="GtkMenu" id="main_menu"> <object class="GtkPopoverMenu" id="popovermenu">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkMenuItem" id="refresh_item"> <object class="GtkBox" id="menu_box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Refresh databases</property> <property name="border_width">6</property>
<property name="use_underline">True</property> <property name="orientation">vertical</property>
<signal name="activate" handler="on_refresh_item_activate" swapped="no"/> <property name="spacing">6</property>
</object> <child>
</child> <object class="GtkModelButton" id="refresh_button">
<child> <property name="visible">True</property>
<object class="GtkMenuItem" id="history_item"> <property name="can_focus">True</property>
<property name="visible">True</property> <property name="receives_default">True</property>
<property name="can_focus">False</property> <property name="text" translatable="yes">Refresh databases</property>
<property name="label" translatable="yes">View History</property> <signal name="clicked" handler="on_refresh_button_clicked" swapped="no"/>
<signal name="activate" handler="on_history_item_activate" swapped="no"/> </object>
</object> <packing>
</child> <property name="expand">False</property>
<child> <property name="fill">True</property>
<object class="GtkMenuItem" id="local_item"> <property name="position">0</property>
<property name="visible">True</property> </packing>
<property name="can_focus">False</property> </child>
<property name="label" translatable="yes">Install Local Packages</property> <child>
<signal name="activate" handler="on_local_item_activate" swapped="no"/> <object class="GtkModelButton" id="history_button">
</object> <property name="visible">True</property>
</child> <property name="can_focus">True</property>
<child> <property name="receives_default">True</property>
<object class="GtkMenuItem" id="preferences_item"> <property name="text" translatable="yes">View History</property>
<property name="visible">True</property> <signal name="clicked" handler="on_history_button_clicked" swapped="no"/>
<property name="can_focus">False</property> </object>
<property name="label" translatable="yes">_Preferences</property> <packing>
<property name="use_underline">True</property> <property name="expand">False</property>
<signal name="activate" handler="on_preferences_item_activate" swapped="no"/> <property name="fill">True</property>
</object> <property name="position">1</property>
</child> </packing>
<child> </child>
<object class="GtkMenuItem" id="about_item"> <child>
<property name="visible">True</property> <object class="GtkModelButton" id="local_button">
<property name="can_focus">False</property> <property name="visible">True</property>
<property name="label" translatable="yes">_About</property> <property name="can_focus">True</property>
<property name="use_underline">True</property> <property name="receives_default">True</property>
<signal name="activate" handler="on_about_item_activate" swapped="no"/> <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> </object>
<packing>
<property name="submenu">main</property>
<property name="position">1</property>
</packing>
</child> </child>
</object> </object>
<template class="PamacManagerWindow" parent="GtkApplicationWindow"> <template class="PamacManagerWindow" parent="GtkApplicationWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Package Manager</property>
<property name="default_height">600</property> <property name="default_height">600</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="gravity">center</property> <property name="gravity">center</property>
<property name="show_menubar">False</property>
<child> <child>
<object class="GtkStack" id="main_stack"> <object class="GtkStack" id="main_stack">
<property name="visible">True</property> <property name="visible">True</property>
@ -66,61 +105,12 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">3</property> <property name="spacing">6</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>
<child> <child>
<object class="GtkBox" id="box3"> <object class="GtkBox" id="box3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_top">3</property>
<property name="spacing">3</property> <property name="spacing">3</property>
<child> <child>
<object class="GtkStack" id="filters_stack"> <object class="GtkStack" id="filters_stack">
@ -132,7 +122,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">3</property>
<child> <child>
<object class="GtkSearchEntry" id="search_entry"> <object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property> <property name="visible">True</property>
@ -163,7 +153,6 @@
<property name="margin_start">6</property> <property name="margin_start">6</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="label" translatable="yes">Search in AUR</property> <property name="label" translatable="yes">Search in AUR</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -609,13 +598,17 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="transaction_infobox"> <object class="GtkBox" id="transaction_infobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</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> <child>
<object class="GtkLabel" id="transaction_infos_label"> <object class="GtkLabel" id="transaction_infos_label">
<property name="visible">True</property> <property name="visible">True</property>
@ -637,12 +630,12 @@
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<property name="layout_style">start</property> <property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="transaction_infos_details_button"> <object class="GtkButton" id="details_button">
<property name="label" translatable="yes">Details</property> <property name="label" translatable="yes">Details</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">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> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -651,14 +644,13 @@
</packing> </packing>
</child> </child>
<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="label" translatable="yes">_Apply</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="yalign">0.55000001192092896</property> <signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
<signal name="clicked" handler="on_transaction_infos_apply_button_clicked" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -667,13 +659,13 @@
</packing> </packing>
</child> </child>
<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="label" translatable="yes">_Cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_underline">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> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -692,7 +684,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">4</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -994,5 +986,43 @@
</child> </child>
</object> </object>
</child> </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> </template>
</interface> </interface>

View File

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

View File

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

View File

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

View File

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

View File

@ -1,27 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.16"/>
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow"> <object class="GtkPopoverMenu" id="popovermenu">
<property name="visible">True</property>
<property name="can_focus">False</property> <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> <child>
<object class="GtkBox" id="box1"> <object class="GtkBox" id="menu_box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="border_width">6</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">12</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkLabel" id="top_label"> <object class="GtkModelButton" id="refresh_button">
<property name="visible">True</property> <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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -30,11 +26,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkStackSwitcher" id="stackswitcher"> <object class="GtkModelButton" id="history_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="halign">center</property> <property name="receives_default">True</property>
<property name="stack">stack</property> <property name="text" translatable="yes">View History</property>
<signal name="clicked" handler="on_history_button_clicked" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -42,6 +39,70 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </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> <child>
<object class="GtkStack" id="stack"> <object class="GtkStack" id="stack">
<property name="visible">True</property> <property name="visible">True</property>
@ -241,45 +302,23 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="bottom_label"> <object class="GtkBox" id="transaction_infobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
</object> <property name="margin_left">6</property>
<packing> <property name="margin_right">6</property>
<property name="expand">False</property> <property name="margin_bottom">6</property>
<property name="fill">True</property> <property name="orientation">vertical</property>
<property name="position">3</property> <property name="spacing">6</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>
<child> <child>
<object class="GtkButtonBox" id="buttonbox2"> <object class="GtkLabel" id="bottom_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">start</property> <property name="justify">center</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>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -288,35 +327,75 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButtonBox" id="buttonbox1"> <object class="GtkBox" id="box2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">6</property> <property name="spacing">12</property>
<property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="refresh_button"> <object class="GtkLabel" id="transaction_infos_label">
<property name="label" translatable="yes">_Refresh</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">False</property> <property name="halign">start</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_refresh_button_clicked" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="apply_button"> <object class="GtkButtonBox" id="transaction_infos_buttonbox">
<property name="label" translatable="yes">_Apply</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="has_focus">True</property> <property name="spacing">6</property>
<property name="receives_default">False</property> <property name="layout_style">start</property>
<property name="use_underline">True</property> <child>
<signal name="clicked" handler="on_apply_button_clicked" swapped="no"/> <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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -324,26 +403,10 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
@ -351,7 +414,37 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</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> </packing>
</child> </child>
</object> </object>

View File

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

View File

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

View File

@ -22,17 +22,14 @@ namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/preferences/choose_ignorepkgs_dialog.ui")] [GtkTemplate (ui = "/org/manjaro/pamac/preferences/choose_ignorepkgs_dialog.ui")]
class ChooseIgnorepkgsDialog : Gtk.Dialog { class ChooseIgnorepkgsDialog : Gtk.Dialog {
[GtkChild]
public Gtk.Label label;
[GtkChild] [GtkChild]
public Gtk.TreeView treeview; public Gtk.TreeView treeview;
public Gtk.ListStore pkgs_list; public Gtk.ListStore pkgs_list;
public ChooseIgnorepkgsDialog (Gtk.Window window) { 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)); pkgs_list = new Gtk.ListStore (2, typeof (bool), typeof (string));
treeview.set_model (pkgs_list); treeview.set_model (pkgs_list);
} }
@ -40,10 +37,10 @@ namespace Pamac {
[GtkCallback] [GtkCallback]
void on_renderertoggle_toggled (string path) { void on_renderertoggle_toggled (string path) {
Gtk.TreeIter iter; Gtk.TreeIter iter;
GLib.Value selected; bool selected;
if (pkgs_list.get_iter_from_string (out iter, path)) { if (pkgs_list.get_iter_from_string (out iter, path)) {
pkgs_list.get_value (iter, 0, out selected); pkgs_list.get (iter, 0, out selected);
pkgs_list.set_value (iter, 0, !((bool) 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")] [GtkTemplate (ui = "/org/manjaro/pamac/transaction/choose_provider_dialog.ui")]
class ChooseProviderDialog : Gtk.Dialog { class ChooseProviderDialog : Gtk.Dialog {
[GtkChild]
public Gtk.Label label;
[GtkChild]
public Gtk.ComboBoxText comboboxtext;
public ChooseProviderDialog (Gtk.ApplicationWindow? window) { 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 { namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/manager/history_dialog.ui")] [GtkTemplate (ui = "/org/manjaro/pamac/transaction/history_dialog.ui")]
class HistoryDialog : Gtk.Dialog { class HistoryDialog : Gtk.Dialog {
[GtkChild] [GtkChild]
public Gtk.TextView textview; public Gtk.TextView textview;
public HistoryDialog (ManagerWindow window) { public HistoryDialog (Gtk.ApplicationWindow window) {
Object (transient_for: window, use_header_bar: 0); 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
const string VERSION = "4.0.0";
namespace Pamac { namespace Pamac {
class ActivableCellRendererPixbuf : Gtk.CellRendererPixbuf { class ActivableCellRendererPixbuf : Gtk.CellRendererPixbuf {
@ -61,6 +59,8 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.Stack filters_stack; Gtk.Stack filters_stack;
[GtkChild] [GtkChild]
Gtk.StackSwitcher filters_stackswitcher;
[GtkChild]
Gtk.SearchEntry search_entry; Gtk.SearchEntry search_entry;
[GtkChild] [GtkChild]
Gtk.TreeView search_treeview; Gtk.TreeView search_treeview;
@ -101,9 +101,9 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.Label transaction_infos_label; Gtk.Label transaction_infos_label;
[GtkChild] [GtkChild]
Gtk.Button transaction_infos_apply_button; Gtk.Button apply_button;
[GtkChild] [GtkChild]
Gtk.Button transaction_infos_cancel_button; Gtk.Button cancel_button;
// menu // menu
Gtk.Menu right_click_menu; Gtk.Menu right_click_menu;
@ -300,6 +300,7 @@ namespace Pamac {
show_default_pkgs (); show_default_pkgs ();
search_entry.grab_focus (); 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); filters_stack.notify["visible-child"].connect (on_filters_stack_visible_child_changed);
packages_stack.notify["visible-child"].connect (on_packages_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) { void choose_opt_dep (GLib.List<string> pkgnames) {
foreach (unowned string pkgname in pkgnames) { foreach (unowned string pkgname in pkgnames) {
var choose_dep_dialog = new ChooseDependenciesDialog (this); var choose_dep_dialog = new ChooseDependenciesDialog (this);
int length = 0; //~ int length = 0;
foreach (unowned string optdep in transaction.get_pkg_uninstalled_optdeps (pkgname)) { foreach (unowned string optdep in transaction.get_pkg_uninstalled_optdeps (pkgname)) {
length++; //~ length++;
choose_dep_dialog.deps_list.insert_with_values (null, -1, choose_dep_dialog.deps_list.insert_with_values (null, -1,
0, false, 0, false,
1, optdep); 1, optdep);
} }
choose_dep_dialog.label.set_markup ("<b>%s</b>".printf ( choose_dep_dialog.title = dgettext (null, "Choose optional dependencies for %s").printf (pkgname);
ngettext ("%s has %u uninstalled optional dependency.\nChoose if you would like to install it", //~ var headerbar = choose_dep_dialog.get_header_bar () as Gtk.HeaderBar;
"%s has %u uninstalled optional dependencies.\nChoose those you would like to install", length).printf (pkgname, length))); //~ 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) { if (choose_dep_dialog.run () == Gtk.ResponseType.OK) {
choose_dep_dialog.deps_list.foreach ((model, path, iter) => { choose_dep_dialog.deps_list.foreach ((model, path, iter) => {
bool selected; 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 () { void on_filters_stack_visible_child_changed () {
refresh_packages_list (); refresh_packages_list ();
} }
[GtkCallback] [GtkCallback]
void on_history_item_activate () { void on_history_button_clicked () {
var file = GLib.File.new_for_path ("/var/log/pamac.log"); transaction.run_history_dialog ();
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 ();
}
}
} }
[GtkCallback] [GtkCallback]
void on_local_item_activate () { void on_local_button_clicked () {
Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog ( Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog (
dgettext (null, "Install Local Packages"), this, Gtk.FileChooserAction.OPEN, dgettext (null, "Install Local Packages"), this, Gtk.FileChooserAction.OPEN,
dgettext (null, "_Cancel"), Gtk.ResponseType.CANCEL, dgettext (null, "_Cancel"), Gtk.ResponseType.CANCEL,
@ -1465,25 +1454,17 @@ namespace Pamac {
} }
[GtkCallback] [GtkCallback]
void on_preferences_item_activate () { void on_preferences_button_clicked () {
transaction.run_preferences_dialog.begin (); transaction.run_preferences_dialog.begin ();
} }
[GtkCallback] [GtkCallback]
void on_about_item_activate () { void on_about_button_clicked () {
Gtk.show_about_dialog ( transaction.run_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");
} }
[GtkCallback] [GtkCallback]
void on_transaction_infos_details_button_clicked () { void on_details_button_clicked () {
if (transaction_running) { if (transaction_running) {
transaction.show_progress (); transaction.show_progress ();
} else { } else {
@ -1500,14 +1481,13 @@ namespace Pamac {
} }
[GtkCallback] [GtkCallback]
void on_transaction_infos_apply_button_clicked () { void on_apply_button_clicked () {
//this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
transaction_running = true; transaction_running = true;
transaction.run (); transaction.run ();
} }
[GtkCallback] [GtkCallback]
void on_transaction_infos_cancel_button_clicked () { void on_cancel_button_clicked () {
if (transaction_running) { if (transaction_running) {
transaction.cancel (); transaction.cancel ();
} else { } else {
@ -1518,17 +1498,17 @@ namespace Pamac {
} }
[GtkCallback] [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)); this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
refreshing = true; refreshing = true;
transaction.start_refresh (false); transaction.start_refresh (false);
transaction_infos_apply_button.visible = false; apply_button.visible = false;
transaction_infobox.visible = true; transaction_infobox.visible = true;
} }
void on_start_transaction () { void on_start_transaction () {
transaction_infos_cancel_button.visible = false; cancel_button.visible = false;
transaction_infos_apply_button.visible = false; apply_button.visible = false;
} }
void on_emit_action (string action) { void on_emit_action (string action) {
@ -1546,8 +1526,8 @@ namespace Pamac {
refreshing = false; refreshing = false;
} else { } else {
transaction_running = false; transaction_running = false;
transaction_infos_cancel_button.visible = true; cancel_button.visible = true;
transaction_infos_apply_button.visible = true; apply_button.visible = true;
} }
set_pendings_operations (); set_pendings_operations ();
} }

View File

@ -62,7 +62,7 @@ namespace Pamac {
uint64 previous_refresh_period; uint64 previous_refresh_period;
public PreferencesDialog (Transaction transaction) { 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; this.transaction = transaction;
refresh_period_label.set_markup (dgettext (null, "How often to check for updates, value in hours") +":"); 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; Vte.Pty pty;
public ProgressDialog (Gtk.ApplicationWindow? window) { public ProgressDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0); Object (transient_for: window, use_header_bar: 1);
//creating terminal //creating terminal
term = new Vte.Terminal (); term = new Vte.Terminal ();

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
const string VERSION = "4.0.0";
namespace Pamac { namespace Pamac {
[DBus (name = "org.manjaro.pamac")] [DBus (name = "org.manjaro.pamac")]
interface Daemon : Object { interface Daemon : Object {
@ -141,10 +143,10 @@ namespace Pamac {
uint64 rates_nb; uint64 rates_nb;
Timer timer; Timer timer;
bool success; bool success;
StringBuilder dialog_textbuffer;
//dialogs //dialogs
TransactionSumDialog transaction_sum_dialog; TransactionSumDialog transaction_sum_dialog;
TransactionInfoDialog transaction_info_dialog;
ProgressDialog progress_dialog; ProgressDialog progress_dialog;
//parent window //parent window
public Gtk.ApplicationWindow? application_window { get; private set; } public Gtk.ApplicationWindow? application_window { get; private set; }
@ -180,10 +182,8 @@ namespace Pamac {
//creating dialogs //creating dialogs
this.application_window = application_window; this.application_window = application_window;
transaction_sum_dialog = new TransactionSumDialog (application_window); transaction_sum_dialog = new TransactionSumDialog (application_window);
transaction_info_dialog = new TransactionInfoDialog (application_window);
progress_dialog = new ProgressDialog (application_window); progress_dialog = new ProgressDialog (application_window);
progress_dialog.close_button.clicked.connect (hide_progress); 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); 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 // 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); progress_dialog.term.child_exited.connect (on_term_child_exited);
@ -193,6 +193,38 @@ namespace Pamac {
sysupgrade_after_trans = false; sysupgrade_after_trans = false;
timer = new Timer (); timer = new Timer ();
success = false; 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 () { public async void run_preferences_dialog () {
@ -213,6 +245,18 @@ namespace Pamac {
daemon.disconnect (handler_id); 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 () { public ErrorInfos get_current_error () {
try { try {
return daemon.get_current_error (); return daemon.get_current_error ();
@ -304,12 +348,6 @@ namespace Pamac {
string action = dgettext (null, "Synchronizing package databases") + "..."; string action = dgettext (null, "Synchronizing package databases") + "...";
reset_progress_dialog (action); reset_progress_dialog (action);
emit_action (action); emit_action (action);
if (mode != Mode.MANAGER) {
progress_dialog.show ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
try { try {
daemon.refresh_finished.connect (on_refresh_finished); daemon.refresh_finished.connect (on_refresh_finished);
daemon.start_refresh (force); daemon.start_refresh (force);
@ -637,12 +675,6 @@ namespace Pamac {
success = false; success = false;
} }
if (success) { if (success) {
if (mode != Mode.MANAGER) {
progress_dialog.show ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
try { try {
daemon.start_trans_prepare (); daemon.start_trans_prepare ();
} catch (IOError e) { } catch (IOError e) {
@ -718,12 +750,6 @@ namespace Pamac {
string action = dgettext (null, "Preparing") + "..."; string action = dgettext (null, "Preparing") + "...";
reset_progress_dialog (action); reset_progress_dialog (action);
emit_action (action); emit_action (action);
if (mode != Mode.MANAGER) {
progress_dialog.show ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
// run // run
if (to_install.length == 0 if (to_install.length == 0
&& to_remove.length == 0 && to_remove.length == 0
@ -791,16 +817,36 @@ namespace Pamac {
void choose_provider (string depend, string[] providers) { void choose_provider (string depend, string[] providers) {
var choose_provider_dialog = new ChooseProviderDialog (application_window); 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) { 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 (); choose_provider_dialog.run ();
try { // get active provider
daemon.choose_provider (choose_provider_dialog.comboboxtext.active); int index = 0;
} catch (IOError e) { // list is given in reverse order so reverse it !
stderr.printf ("IOError: %s\n", e.message); 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 (); choose_provider_dialog.destroy ();
while (Gtk.events_pending ()) { while (Gtk.events_pending ()) {
@ -814,7 +860,6 @@ namespace Pamac {
uint64 dsize = 0; uint64 dsize = 0;
transaction_summary.remove_all (); transaction_summary.remove_all ();
var summary = TransactionSummary (); 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 (); transaction_sum_dialog.sum_list.clear ();
try { try {
summary = daemon.get_transaction_summary (); summary = daemon.get_transaction_summary ();
@ -908,10 +953,10 @@ namespace Pamac {
} }
} }
if (dsize == 0) { if (dsize == 0) {
transaction_sum_dialog.bottom_label.visible = false; transaction_sum_dialog.top_label.visible = false;
} else { } else {
transaction_sum_dialog.bottom_label.set_markup ("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size (dsize))); transaction_sum_dialog.top_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.visible = true;
} }
return type; return type;
} }
@ -970,11 +1015,7 @@ namespace Pamac {
progress_dialog.hide (); progress_dialog.hide ();
progress_dialog.spawn_in_term ({"/usr/bin/echo", dgettext (null, "Transaction cancelled") + ".\n"}); progress_dialog.spawn_in_term ({"/usr/bin/echo", dgettext (null, "Transaction cancelled") + ".\n"});
progress_dialog.expander.expanded = false; progress_dialog.expander.expanded = false;
Gtk.TextIter start_iter; dialog_textbuffer = new StringBuilder ();
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);
} }
public void release () { public void release () {
@ -1097,10 +1138,7 @@ namespace Pamac {
break; break;
case 33: //Alpm.Event.Type.OPTDEP_REMOVAL case 33: //Alpm.Event.Type.OPTDEP_REMOVAL
detailed_action = dgettext (null, "%s optionally requires %s").printf (details[0], details[1]); detailed_action = dgettext (null, "%s optionally requires %s").printf (details[0], details[1]);
Gtk.TextIter end_iter; dialog_textbuffer.append (detailed_action + "\n");
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);
break; break;
case 34: //Alpm.Event.Type.DATABASE_MISSING case 34: //Alpm.Event.Type.DATABASE_MISSING
detailed_action = dgettext (null, "Database file for %s does not exist").printf (details[0]); 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) { void on_emit_log (uint level, string msg) {
// msg ends with \n // msg ends with \n
string? line = null; string? line = null;
Gtk.TextIter end_iter;
if (level == 1) { //Alpm.LogLevel.ERROR if (level == 1) { //Alpm.LogLevel.ERROR
if (previous_filename != "") { if (previous_filename != "") {
line = dgettext (null, "Error") + ": " + previous_filename + ": " + msg; line = dgettext (null, "Error") + ": " + previous_filename + ": " + msg;
@ -1327,65 +1364,60 @@ namespace Pamac {
} else { } else {
line = dgettext (null, "Warning") + ": " + msg; line = dgettext (null, "Warning") + ": " + msg;
} }
transaction_info_dialog.textbuffer.get_end_iter (out end_iter); dialog_textbuffer.append (msg);
transaction_info_dialog.textbuffer.insert (ref end_iter, msg, msg.length);
} }
} }
if (line != null) { if (line != null) {
display_error (line, {}); progress_dialog.spawn_in_term ({"echo", "-n", line});
} }
} }
void show_warnings () { void show_warnings () {
if (transaction_info_dialog.textbuffer.text != "") { if (dialog_textbuffer.len > 0) {
transaction_info_dialog.title = dgettext (null, "Warning"); var dialog = new Gtk.Dialog.with_buttons (dgettext (null, "Warning"),
transaction_info_dialog.label.visible = false; application_window,
transaction_info_dialog.expander.visible = true; Gtk.DialogFlags.MODAL | Gtk.DialogFlags.USE_HEADER_BAR);
transaction_info_dialog.expander.expanded = true; dialog.deletable = false;
transaction_info_dialog.run (); unowned Gtk.Widget widget = dialog.add_button (dgettext (null, "_Close"), Gtk.ResponseType.CLOSE);
transaction_info_dialog.hide (); widget.can_focus = true;
while (Gtk.events_pending ()) { widget.has_focus = true;
Gtk.main_iteration (); widget.can_default = true;
} widget.has_default = true;
Gtk.TextIter start_iter; var scrolledwindow = new Gtk.ScrolledWindow (null, null);
Gtk.TextIter end_iter; var label = new Gtk.Label (dialog_textbuffer.str);
transaction_info_dialog.textbuffer.get_start_iter (out start_iter); label.margin = 12;
transaction_info_dialog.textbuffer.get_end_iter (out end_iter); scrolledwindow.visible = true;
transaction_info_dialog.textbuffer.delete (ref start_iter, ref end_iter); 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) { void display_error (string message, string[] details) {
progress_dialog.spawn_in_term ({"echo", "-n", message}); progress_dialog.spawn_in_term ({"echo", "-n", message});
Gtk.TextIter start_iter; var dialog = new Gtk.MessageDialog (application_window,
Gtk.TextIter end_iter; Gtk.DialogFlags.MODAL,
transaction_info_dialog.title = dgettext (null, "Error"); Gtk.MessageType.ERROR,
transaction_info_dialog.label.visible = true; Gtk.ButtonsType.CLOSE,
transaction_info_dialog.label.label = message; message);
if (details.length != 0) { if (details.length != 0) {
transaction_info_dialog.textbuffer.get_start_iter (out start_iter); var textbuffer = new StringBuilder ();
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;
progress_dialog.spawn_in_term ({"echo", ":"}); progress_dialog.spawn_in_term ({"echo", ":"});
foreach (unowned string detail in details) { foreach (unowned string detail in details) {
progress_dialog.spawn_in_term ({"echo", detail}); progress_dialog.spawn_in_term ({"echo", detail});
string str = detail + "\n"; textbuffer.append (detail + "\n");
transaction_info_dialog.textbuffer.get_end_iter (out end_iter);
transaction_info_dialog.textbuffer.insert (ref end_iter, str, str.length);
} }
} else { dialog.secondary_text = textbuffer.str;
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.run ();
dialog.destroy ();
} }
void handle_error (ErrorInfos error) { 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] [GtkChild]
public Gtk.Label top_label; public Gtk.Label top_label;
[GtkChild] [GtkChild]
public Gtk.Label bottom_label;
[GtkChild]
Gtk.TreeView treeview; Gtk.TreeView treeview;
public Gtk.ListStore sum_list; public Gtk.ListStore sum_list;
public TransactionSumDialog (Gtk.ApplicationWindow? window) { 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)); sum_list = new Gtk.ListStore (4, typeof (string), typeof (string), typeof (string), typeof (string));
treeview.set_model (sum_list); treeview.set_model (sum_list);

View File

@ -23,7 +23,7 @@ namespace Pamac {
class UpdaterWindow : Gtk.ApplicationWindow { class UpdaterWindow : Gtk.ApplicationWindow {
[GtkChild] [GtkChild]
Gtk.Label top_label; Gtk.HeaderBar headerbar;
[GtkChild] [GtkChild]
Gtk.StackSwitcher stackswitcher; Gtk.StackSwitcher stackswitcher;
[GtkChild] [GtkChild]
@ -41,7 +41,15 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.Label bottom_label; Gtk.Label bottom_label;
[GtkChild] [GtkChild]
Gtk.Box transaction_infobox;
[GtkChild]
Gtk.Label transaction_infos_label;
[GtkChild]
Gtk.Button details_button;
[GtkChild]
Gtk.Button apply_button; Gtk.Button apply_button;
[GtkChild]
Gtk.Button cancel_button;
Gtk.ListStore repos_updates_list; Gtk.ListStore repos_updates_list;
Gtk.ListStore aur_updates_list; Gtk.ListStore aur_updates_list;
@ -52,7 +60,10 @@ namespace Pamac {
Object (application: application); Object (application: application);
bottom_label.visible = false; 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; stackswitcher.visible = false;
aur_scrolledwindow.visible = false; aur_scrolledwindow.visible = false;
@ -69,6 +80,8 @@ namespace Pamac {
transaction = new Transaction (this as Gtk.ApplicationWindow); transaction = new Transaction (this as Gtk.ApplicationWindow);
transaction.mode = Mode.UPDATER; 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.finished.connect (populate_updates_list);
transaction.get_updates_finished.connect (on_get_updates_finished); transaction.get_updates_finished.connect (on_get_updates_finished);
@ -77,23 +90,23 @@ namespace Pamac {
return false; return false;
} }
void set_apply_button_sensitive () { void set_transaction_infobox_visible () {
bool sensitive = false; bool visible = false;
repos_updates_list.foreach ((model, path, iter) => { repos_updates_list.foreach ((model, path, iter) => {
bool selected; bool selected;
repos_updates_list.get (iter, 0, out selected); repos_updates_list.get (iter, 0, out selected);
sensitive = selected; visible = selected;
return sensitive; return visible;
}); });
if (!sensitive) { if (!visible) {
aur_updates_list.foreach ((model, path, iter) => { aur_updates_list.foreach ((model, path, iter) => {
bool selected; bool selected;
aur_updates_list.get (iter, 0, out selected); aur_updates_list.get (iter, 0, out selected);
sensitive = selected; visible = selected;
return sensitive; return visible;
}); });
} }
apply_button.sensitive = sensitive; transaction_infobox.visible = visible;
} }
[GtkCallback] [GtkCallback]
@ -110,7 +123,7 @@ namespace Pamac {
repos_updates_list.set (iter, 0, true); repos_updates_list.set (iter, 0, true);
transaction.temporary_ignorepkgs.remove (pkgname); transaction.temporary_ignorepkgs.remove (pkgname);
} }
set_apply_button_sensitive (); set_transaction_infobox_visible ();
} }
[GtkCallback] [GtkCallback]
@ -127,7 +140,7 @@ namespace Pamac {
aur_updates_list.set (iter, 0, true); aur_updates_list.set (iter, 0, true);
transaction.temporary_ignorepkgs.remove (pkgname); transaction.temporary_ignorepkgs.remove (pkgname);
} }
set_apply_button_sensitive (); set_transaction_infobox_visible ();
} }
[GtkCallback] [GtkCallback]
@ -139,8 +152,9 @@ namespace Pamac {
[GtkCallback] [GtkCallback]
void on_apply_button_clicked () { 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); transaction.sysupgrade (false);
details_button.visible = true;
cancel_button.visible = true;
} }
[GtkCallback] [GtkCallback]
@ -150,17 +164,46 @@ namespace Pamac {
} }
[GtkCallback] [GtkCallback]
void on_close_button_clicked () { void on_history_button_clicked () {
this.application.quit (); 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 () { 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)); 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 (); transaction.start_get_updates ();
} }
void on_get_updates_finished (Updates updates) { void on_get_updates_finished (Updates updates) {
top_label.set_markup (""); headerbar.title = "";
repos_updates_list.clear (); repos_updates_list.clear ();
stackswitcher.visible = false; stackswitcher.visible = false;
repos_scrolledwindow.visible = true; repos_scrolledwindow.visible = true;
@ -192,11 +235,11 @@ namespace Pamac {
} }
uint updates_nb = repos_updates_nb + aur_updates_nb; uint updates_nb = repos_updates_nb + aur_updates_nb;
if (updates_nb == 0) { 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 { } 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) { if (dsize != 0) {
bottom_label.set_markup("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size(dsize))); bottom_label.set_markup("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size(dsize)));
bottom_label.visible = true; bottom_label.visible = true;