columns fixes

This commit is contained in:
guinux 2013-03-26 14:26:16 +01:00
parent b331df8394
commit e6d824c172
5 changed files with 39 additions and 37 deletions

View File

@ -63,6 +63,8 @@
<property name="model">search_list</property> <property name="model">search_list</property>
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="search_treeview_selection"> <object class="GtkTreeSelection" id="search_treeview_selection">
<property name="mode">browse</property> <property name="mode">browse</property>
@ -114,7 +116,7 @@
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="enable_search">False</property> <property name="enable_search">False</property>
<property name="search_column">0</property> <property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="groups_treeview_selection"> <object class="GtkTreeSelection" id="groups_treeview_selection">
<property name="mode">browse</property> <property name="mode">browse</property>
@ -161,6 +163,8 @@
<property name="model">state_list</property> <property name="model">state_list</property>
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="state_treeview_selection"> <object class="GtkTreeSelection" id="state_treeview_selection">
<property name="mode">browse</property> <property name="mode">browse</property>
@ -208,6 +212,8 @@
<property name="model">repos_list</property> <property name="model">repos_list</property>
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="repos_treeview_selection"> <object class="GtkTreeSelection" id="repos_treeview_selection">
<property name="mode">browse</property> <property name="mode">browse</property>
@ -364,7 +370,7 @@
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="rules_hint">True</property> <property name="rules_hint">True</property>
<property name="enable_search">False</property> <property name="enable_search">False</property>
<property name="search_column">0</property> <property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="details_treeview_selection"/> <object class="GtkTreeSelection" id="details_treeview_selection"/>
</child> </child>
@ -620,13 +626,10 @@
</object> </object>
<object class="GtkWindow" id="ConfDialog"> <object class="GtkWindow" id="ConfDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_top">5</property> <property name="border_width">3</property>
<property name="margin_bottom">5</property>
<property name="title" translatable="yes"> </property> <property name="title" translatable="yes"> </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">350</property>
<property name="default_height">250</property>
<property name="icon">/usr/share/pamac/icons/22x22/status/package-info.png</property> <property name="icon">/usr/share/pamac/icons/22x22/status/package-info.png</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property> <property name="skip_taskbar_hint">True</property>
@ -637,7 +640,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">4</property> <property name="spacing">3</property>
<child> <child>
<object class="GtkLabel" id="sum_top_label"> <object class="GtkLabel" id="sum_top_label">
<property name="visible">True</property> <property name="visible">True</property>
@ -653,7 +656,7 @@
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow4"> <object class="GtkScrolledWindow" id="scrolledwindow4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
@ -723,9 +726,6 @@
<object class="GtkButtonBox" id="buttonbox1"> <object class="GtkButtonBox" id="buttonbox1">
<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">7</property>
<property name="margin_right">7</property>
<property name="margin_bottom">9</property>
<property name="spacing">7</property> <property name="spacing">7</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
@ -734,7 +734,9 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-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="has_focus">True</property>
<property name="is_focus">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="clicked" handler="on_TransCancelButton_clicked" swapped="no"/> <signal name="clicked" handler="on_TransCancelButton_clicked" swapped="no"/>
</object> </object>
@ -749,7 +751,7 @@
<property name="label">gtk-ok</property> <property name="label">gtk-ok</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">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="clicked" handler="on_TransValidButton_clicked" swapped="no"/> <signal name="clicked" handler="on_TransValidButton_clicked" swapped="no"/>
</object> </object>

View File

@ -53,6 +53,7 @@ bus.add_signal_receiver(error, dbus_interface = "org.manjaro.pamac", signal_name
loop = GObject.MainLoop() loop = GObject.MainLoop()
transaction.get_handle()
transaction.update_db() transaction.update_db()
do_syncfirst, updates = transaction.get_updates() do_syncfirst, updates = transaction.get_updates()

View File

@ -3,7 +3,7 @@
from gi.repository import Gtk, GObject from gi.repository import Gtk, GObject
from subprocess import Popen from subprocess import Popen
from pamac import common, transaction from pamac import transaction
import dbus import dbus
import threading import threading

View File

@ -285,12 +285,12 @@ def refresh_packages_list():
if transaction.localpkgs.__contains__(name): if transaction.localpkgs.__contains__(name):
packages_list.append([name, True, False, True, installed_icon, common.format_size(transaction.localpkgs[name].isize), transaction.localpkgs[name].isize]) packages_list.append([name, True, False, True, installed_icon, common.format_size(transaction.localpkgs[name].isize), transaction.localpkgs[name].isize])
elif name in transaction_dict.keys(): elif name in transaction_dict.keys():
packages_list.append([name, False, True, True, to_install_icon, common.format_size(transaction.syncpkgs[name].size), transaction.syncpkgs[name].size]) packages_list.append([name, False, True, True, to_install_icon, common.format_size(transaction.syncpkgs[name].isize), transaction.syncpkgs[name].isize])
else: else:
packages_list.append([name, False, True, False, uninstalled_icon, common.format_size(transaction.syncpkgs[name].size), transaction.syncpkgs[name].size]) packages_list.append([name, False, True, False, uninstalled_icon, common.format_size(transaction.syncpkgs[name].isize), transaction.syncpkgs[name].isize])
elif transaction_type is "remove": elif transaction_type is "remove":
if not transaction.localpkgs.__contains__(name): if not transaction.localpkgs.__contains__(name):
packages_list.append([name, False, False, False, uninstalled_icon, common.format_size(transaction.syncpkgs[name].size), transaction.syncpkgs[name].size]) packages_list.append([name, False, False, False, uninstalled_icon, common.format_size(transaction.syncpkgs[name].isize), transaction.syncpkgs[name].isize])
elif name in transaction_dict.keys(): elif name in transaction_dict.keys():
packages_list.append([name, True, True, False, to_remove_icon, common.format_size(transaction.localpkgs[name].isize), transaction.localpkgs[name].isize]) packages_list.append([name, True, True, False, to_remove_icon, common.format_size(transaction.localpkgs[name].isize), transaction.localpkgs[name].isize])
else: else:
@ -298,7 +298,7 @@ def refresh_packages_list():
elif transaction.localpkgs.__contains__(name): elif transaction.localpkgs.__contains__(name):
packages_list.append([name, True, True, True, installed_icon, common.format_size(transaction.localpkgs[name].isize), transaction.localpkgs[name].isize]) packages_list.append([name, True, True, True, installed_icon, common.format_size(transaction.localpkgs[name].isize), transaction.localpkgs[name].isize])
else: else:
packages_list.append([name, False, True, False, uninstalled_icon, common.format_size(transaction.syncpkgs[name].size), transaction.syncpkgs[name].size]) packages_list.append([name, False, True, False, uninstalled_icon, common.format_size(transaction.syncpkgs[name].isize), transaction.syncpkgs[name].isize])
def set_packages_list(): def set_packages_list():
if current_filter[0] == 'search': if current_filter[0] == 'search':
@ -349,16 +349,15 @@ def set_desc(pkg, style):
package_desc.append(['Conflicts With:', ' '.join(pkg.conflicts)]) package_desc.append(['Conflicts With:', ' '.join(pkg.conflicts)])
package_desc.append(['Replaces:', ' '.join(pkg.replaces)]) package_desc.append(['Replaces:', ' '.join(pkg.replaces)])
if style == 'sync': if style == 'sync':
package_desc.append(['Download Size:', common.format_size(pkg.size)])
if style == 'file':
package_desc.append(['Compressed Size:', common.format_size(pkg.size)]) package_desc.append(['Compressed Size:', common.format_size(pkg.size)])
package_desc.append(['Download Size:', common.format_size(pkg.download_size)])
if style == 'local':
package_desc.append(['Installed Size:', common.format_size(pkg.isize)]) package_desc.append(['Installed Size:', common.format_size(pkg.isize)])
package_desc.append(['Packager:', pkg.packager]) package_desc.append(['Packager:', pkg.packager])
package_desc.append(['Architecture:', pkg.arch]) package_desc.append(['Architecture:', pkg.arch])
package_desc.append(['Build Date:', strftime("%a %d %b %Y %X %Z", localtime(pkg.builddate))]) #package_desc.append(['Build Date:', strftime("%a %d %b %Y %X %Z", localtime(pkg.builddate))])
if style == 'local': if style == 'local':
package_desc.append(['Install Date:', strftime("%a %d %b %Y %X %Z", localtime(pkg.installdate))]) #package_desc.append(['Install Date:', strftime("%a %d %b %Y %X %Z", localtime(pkg.installdate))])
if pkg.reason == pyalpm.PKG_REASON_EXPLICIT: if pkg.reason == pyalpm.PKG_REASON_EXPLICIT:
reason = 'Explicitly installed' reason = 'Explicitly installed'
elif pkg.reason == pyalpm.PKG_REASON_DEPEND: elif pkg.reason == pyalpm.PKG_REASON_DEPEND:
@ -366,18 +365,17 @@ def set_desc(pkg, style):
else: else:
reason = 'N/A' reason = 'N/A'
package_desc.append(['Install Reason:', reason]) package_desc.append(['Install Reason:', reason])
if style != 'sync':
package_desc.append(['Install Script:', 'Yes' if pkg.has_scriptlet else 'No'])
if style == 'sync': if style == 'sync':
package_desc.append(['MD5 Sum:', pkg.md5sum]) #package_desc.append(['Install Script:', 'Yes' if pkg.has_scriptlet else 'No'])
package_desc.append(['SHA256 Sum:', pkg.sha256sum]) #package_desc.append(['MD5 Sum:', pkg.md5sum])
#package_desc.append(['SHA256 Sum:', pkg.sha256sum])
package_desc.append(['Signatures:', 'Yes' if pkg.base64_sig else 'No']) package_desc.append(['Signatures:', 'Yes' if pkg.base64_sig else 'No'])
if style == 'local': if style == 'local':
if len(pkg.backup) == 0: if len(pkg.backup) == 0:
package_desc.append(['Backup files:', '']) package_desc.append(['Backup files:', ''])
else: else:
package_desc.append(['Backup files:', '\n'.join(["%s %s" % (md5, file) for (file, md5) in pkg.backup])]) #package_desc.append(['Backup files:', '\n'.join(["%s %s" % (md5, file) for (file, md5) in pkg.backup])])
package_desc.append(['Backup files:', '\n'.join(["%s" % (file) for (file, md5) in pkg.backup])])
def set_transaction_sum(): def set_transaction_sum():
transaction_sum.clear() transaction_sum.clear()
@ -437,10 +435,9 @@ def handle_error(error):
transaction.to_remove = [] transaction.to_remove = []
transaction_dict.clear() transaction_dict.clear()
transaction_type = None transaction_type = None
transaction.get_handle()
transaction.update_db() transaction.update_db()
get_repos() refresh_packages_list()
get_groups()
set_packages_list()
if mode == 'updater': if mode == 'updater':
have_updates() have_updates()
@ -463,12 +460,11 @@ def handle_reply(reply):
transaction.to_add = [] transaction.to_add = []
transaction.to_remove = [] transaction.to_remove = []
transaction_dict.clear() transaction_dict.clear()
transaction.get_handle()
transaction.update_db() transaction.update_db()
get_repos()
get_groups()
if (transaction_type == "install") or (transaction_type == "remove"): if (transaction_type == "install") or (transaction_type == "remove"):
transaction_type = None transaction_type = None
set_packages_list() refresh_packages_list()
else: else:
transaction_type = None transaction_type = None
if have_updates(): if have_updates():
@ -1009,6 +1005,9 @@ def main(_mode):
mode = _mode mode = _mode
interface.connect_signals(Handler()) interface.connect_signals(Handler())
do_refresh() do_refresh()
transaction.get_handle()
get_groups()
get_repos()
if mode == 'manager': if mode == 'manager':
ManagerWindow.show_all() ManagerWindow.show_all()
if mode == 'updater': if mode == 'updater':

View File

@ -33,7 +33,7 @@ def get_handle():
print('get handle') print('get handle')
def update_db(): def update_db():
get_handle() #get_handle()
global syncpkgs global syncpkgs
global localpkgs global localpkgs
syncpkgs = OrderedDict() syncpkgs = OrderedDict()