pyneighborhood team mailing list archive
-
pyneighborhood team
-
Mailing list archive
-
Message #00288
[Branch ~pyneighborhood/pyneighborhood/devel] Rev 580: Sort Workgroups, Hosts and Shares. Fixes #897041
------------------------------------------------------------
revno: 580
committer: Stefan J. Betz <info@xxxxxxxxxxxxxxx>
branch nick: pyneighborhood
timestamp: Mon 2011-11-28 16:38:50 +0100
message:
Sort Workgroups, Hosts and Shares. Fixes #897041
modified:
pyneighborhood/mainwindow.py
--
lp:pyneighborhood
https://code.launchpad.net/~pyneighborhood/pyneighborhood/devel
Your team pyNeighborhood is subscribed to branch lp:pyneighborhood.
To unsubscribe from this branch go to https://code.launchpad.net/~pyneighborhood/pyneighborhood/devel/+edit-subscription
=== modified file 'pyneighborhood/mainwindow.py'
--- pyneighborhood/mainwindow.py 2011-05-02 16:08:29 +0000
+++ pyneighborhood/mainwindow.py 2011-11-28 15:38:50 +0000
@@ -63,16 +63,16 @@
push_notification(_("Starting sync...\n"))
threads_enter()
# Append new items to tree storage
- workgroups = cur.execute("""SELECT id,name FROM workgroups WHERE treeview ISNULL""").fetchall()
+ workgroups = cur.execute("""SELECT id,name FROM workgroups WHERE treeview ISNULL ORDER BY UPPER(workgroups.name) ASC""").fetchall()
for workgroup in workgroups:
workgroup_iter = self.mainwindow.treestore.append(None, [workgroup[1], self.mainwindow.GROUP_ICON, None, None, False, False, False])
cur.execute("""UPDATE workgroups SET treeview = ?, validated = 1 WHERE id = ?""", ( self.mainwindow.treestore.get_string_from_iter(workgroup_iter), workgroup[0] ))
- hosts = cur.execute("""SELECT hosts.id, hosts.name, hosts.comment, workgroups.treeview FROM hosts INNER JOIN workgroups ON hosts.workgroup = workgroups.id WHERE hosts.treeview ISNULL AND hosts.validated = 0 AND workgroups.treeview NOTNULL""").fetchall()
+ hosts = cur.execute("""SELECT hosts.id, hosts.name, hosts.comment, workgroups.treeview FROM hosts INNER JOIN workgroups ON hosts.workgroup = workgroups.id WHERE hosts.treeview ISNULL AND hosts.validated = 0 AND workgroups.treeview NOTNULL ORDER BY UPPER(hosts.name) ASC""").fetchall()
for host in hosts:
workgroup_iter = self.mainwindow.treestore.get_iter_from_string(host[3])
host_iter = self.mainwindow.treestore.append(workgroup_iter, [host[1], self.mainwindow.HOST_ICON, host[2], None, False, False, False])
cur.execute("""UPDATE hosts SET treeview = ?, validated = 1 WHERE id = ?""", ( self.mainwindow.treestore.get_string_from_iter(host_iter), host[0]))
- shares = cur.execute("""SELECT shares.id, shares.name, shares.comment, hosts.treeview FROM shares INNER JOIN hosts ON shares.host = hosts.id WHERE shares.treeview ISNULL AND shares.validated = 0 AND hosts.treeview NOTNULL""").fetchall()
+ shares = cur.execute("""SELECT shares.id, shares.name, shares.comment, hosts.treeview FROM shares INNER JOIN hosts ON shares.host = hosts.id WHERE shares.treeview ISNULL AND shares.validated = 0 AND hosts.treeview NOTNULL ORDER BY UPPER(shares.name) ASC""").fetchall()
for share in shares:
host_iter = self.mainwindow.treestore.get_iter_from_string(share[3])
share_iter = self.mainwindow.treestore.append(host_iter, [share[1], self.mainwindow.SHARE_ICON, share[2], None, False, False, False])