diff --git a/delugegtk.py b/delugegtk.py
index 1ac036483..2279f7482 100755
--- a/delugegtk.py
+++ b/delugegtk.py
@@ -36,6 +36,7 @@ class DelugeGTK:
self.gladefile = dcommon.get_glade_file("delugegtk.glade")
self.wtree = gtk.glade.XML(self.gladefile)
self.window = self.wtree.get_widget("main_window")
+ self.toolbar = self.wtree.get_widget("tb_middle")
if(self.window):
self.window.connect("destroy", gtk.main_quit)
self.window.set_title(dcommon.PROGRAM_NAME + " " + dcommon.PROGRAM_VERSION)
@@ -54,6 +55,7 @@ class DelugeGTK:
## File Menu
"new_torrent": self.new_torrent,
"add_torrent": self.add_torrent,
+ "menu_quit": self.quit,
## Edit Menu
"pref_clicked": self.prf.show_pref,
"plugins_clicked": self.prf.show_plugins,
@@ -63,12 +65,11 @@ class DelugeGTK:
}
self.wtree.signal_autoconnect(actions)
-
-
## Create the torrent listview
- self.torrent_view = self.wtree.get_widget("torrent_view")
- self.store = gtk.ListStore(str)
- self.torrent_view.set_model(self.store)
+ self.view = self.wtree.get_widget("torrent_view")
+ # UID, Q#, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share
+ self.store = gtk.ListStore(int, int, str, str, int, str, str, str, str, str, str, str)
+ self.view.set_model(self.store)
## Still a lot of work to be done here,
@@ -82,23 +83,43 @@ class DelugeGTK:
## Deluge's code (up to 0.4) got way out of
## hand.
- self.name_column = dgtk.TextColumn("Name", 0)
- self.torrent_view.append_column(self.name_column)
- self.progress_column = dgtk.ProgressColumn("Progress", 1)
- self.torrent_view.append_column(self.progress_column)
- self.check_column = dgtk.ToggleColumn("Enabled", 2)
- self.torrent_view.append_column(self.check_column)
-
+ self.queue_column = dgtk.add_text_column(self.view, "#", 1)
+ self.name_column = dgtk.add_text_column(self.view, "Name", 2)
+ self.size_column = dgtk.add_text_column(self.view, "Size", 3)
+ self.status_column = dgtk.add_progress_column(self.view, "Status", 4, 5)
+ self.seed_column = dgtk.add_text_column(self.view, "Seeders", 6)
+ self.peer_column = dgtk.add_text_column(self.view, "Peers", 7)
+ self.dl_column = dgtk.add_text_column(self.view, "Download", 8)
+ self.ul_column = dgtk.add_text_column(self.view, "Upload", 9)
+ self.eta_column = dgtk.add_text_column(self.view, "Time Remaining", 10)
+ self.share_column = dgtk.add_text_column(self.view, "Share Ratio", 11)
+ ## Interface created
- def new_torrent(self, obj):
+ def start(self):
pass
- def add_torrent(self, obj):
+ def new_torrent(self, obj=None):
+ pass
+
+ def add_torrent(self, obj=None):
+ pass
+
+ def quit(self, obj=None):
+ self.window.destroy()
+
+ ## Call via a timer to update the interface
+ def update(self):
pass
## For testing purposes, create a copy of the interface
if __name__ == "__main__":
- dgtk = DelugeGTK()
+ d = DelugeGTK()
+ ## Add an example line
+
+ ## Test the interface by adding a few fake torrents
+ d.store.append([0,1,"Deluge Torrent","700MB",50,"Downloading","10 (50)", "15 (30)", "50 KB/s", "10 KB/s", "2 h", "100%"])
+ d.store.append([1,2,"Sample Torrent","350MB",75,"Queued","10 (20)","20 (20)","0 KB/s", "0 KB/s", "und", "0%"])
+
gtk.main()
\ No newline at end of file
diff --git a/dgtk.py b/dgtk.py
index 61739f374..02b2b4ce3 100644
--- a/dgtk.py
+++ b/dgtk.py
@@ -40,10 +40,56 @@ class TrayIcon:
self.parent = parent
self.tray = gtk.StatusIcon()
## uncomment later
- ##self.gladefile = dcommon.get_glade("dgtkpopups.glade")
+ ##self.gladefile = dcommon.get_glade_file("dgtkpopups.glade")
self.tray.set_from_file(dcommon.get_pixmap("deluge32.png"))
self.tray.set_tooltip("Deluge Bittorrent Client")
+
+class TorrentPopup:
+ def __init__(self, parent):
+ self.parent = parent
+ self.gladefile = dcommon.get_glade_file("dgtkpopups.glade")
+ self.wtree = gtk.glade.XML(self.gladefile)
+ self.menu = self.wtree.get_widget("torrent_popup")
+ dic = {
+ "size_toggle": self.size,
+ "status_toggle": self.status,
+ "seeders_toggle": self.seeders,
+ "peers_toggle": self.peers,
+ "dl_toggle": self.dl,
+ "ul_toggle": self.ul,
+ "eta_toggle": self.eta,
+ "share_toggle": self.share
+
+ }
+ self.wtree.signal_autoconnect(dic)
+
+ def popup(self):
+ pass
+ ## Toggle functions
+ def size(self, obj):
+ pass
+
+ def status(self, obj):
+ pass
+
+ def seeders(self, obj):
+ pass
+
+ def peers(self, obj):
+ pass
+
+ def dl(self, obj):
+ pass
+
+ def ul(self, obj):
+ pass
+
+ def eta(self, obj):
+ pass
+
+ def share(self, obj):
+ pass
class AboutDialog:
def __init__(self):
@@ -87,42 +133,19 @@ class PreferencesDialog:
## a more organized form of the old add_column method, which will properly
## create and add the column and in addition, return that column to the
## calling function.
-
-class TextColumn(gtk.TreeViewColumn):
- def __init__(self, title, cid):
- gtk.TreeViewColumn.__init__(self, title, gtk.CellRendererText())
-
- def show(self):
- self.set_visible(True)
-
- def hide(self):
- self.set_visible(False)
-class ToggleColumn(gtk.TreeViewColumn):
- def __init__(self, title, cid):
- self.renderer = gtk.CellRendererToggle()
- gtk.TreeViewColumn.__init__(self, title, self.renderer, value=cid)
- self.set_resizable(True)
- self.set_sort_column_id(cid)
- self.set_expand(False)
- #renderer.connect("toggled", toggledSignal, cid)
+def add_text_column(view, header, cid):
+ render = gtk.CellRendererText()
+ column = gtk.TreeViewColumn(header, render, text=cid)
+ column.set_resizable(True)
+ column.set_expand(False)
+ view.append_column(column)
+ return column
- def show(self):
- self.set_visible(True)
-
- def hide(self):
- self.set_visible(False)
-
-class ProgressColumn(gtk.TreeViewColumn):
- def __init__(self, title, cid):
- self.renderer = gtk.CellRendererProgress()
- gtk.TreeViewColumn.__init__(self, title, self.renderer, value=cid)
- self.set_resizable(True)
- self.set_sort_column_id(cid)
- self.set_expand(True)
-
- def show(self):
- self.set_visible(True)
-
- def hide(self):
- self.set_visible(False)
\ No newline at end of file
+def add_progress_column(view, header, pid, mid):
+ render = gtk.CellRendererProgress()
+ column = gtk.TreeViewColumn(header, render, value=pid, text=mid)
+ column.set_resizable(True)
+ column.set_expand(True)
+ view.append_column(column)
+ return column
\ No newline at end of file
diff --git a/glade/delugegtk.glade b/glade/delugegtk.glade
index ffb2c2643..4ea1b7722 100644
--- a/glade/delugegtk.glade
+++ b/glade/delugegtk.glade
@@ -15,6 +15,845 @@
True
4
3
+
+
+ True
+ True
+
+
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+
+
+ True
+ True
+ True
+ False
+
+
+
+
+
+ False
+
+
+
+
+ True
+ Torrents
+
+
+ tab
+ False
+ False
+
+
+
+
+ True
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+
+
+ True
+
+
+ True
+ 10
+ 12
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+
+
+ 3
+ 4
+ 10
+ 11
+
+
+
+
+ True
+ 0
+ <b>Estimated Time Remaining:</b>
+ True
+
+
+ 2
+ 3
+ 10
+ 11
+
+
+
+
+ True
+
+
+ 3
+ 4
+ 4
+ 5
+
+
+
+
+ True
+
+
+ 1
+ 2
+ 4
+ 5
+
+
+
+
+ True
+ 0
+ <b>Peers:</b>
+ True
+
+
+ 2
+ 3
+ 4
+ 5
+
+
+
+
+ True
+ 0
+ <b>Seeders:</b>
+ True
+
+
+ 4
+ 5
+
+
+
+
+ True
+ 0
+ True
+
+
+ 1
+ 4
+
+
+
+
+ True
+ 0
+ <b>Total Size:</b>
+ True
+
+
+ 1
+ 2
+
+
+
+
+ True
+ 0
+ <b>Total Downloaded:</b>
+ True
+
+
+ 2
+ 3
+
+
+
+
+ True
+ 0
+ <b>Percentage Done:</b>
+ True
+
+
+ 5
+ 6
+
+
+
+
+ True
+ 0
+ <b>Downloaded this session:</b>
+ True
+
+
+ 6
+ 7
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 2
+ 3
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 5
+ 6
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 6
+ 7
+
+
+
+
+ True
+ 0
+ <b>Tracker:</b>
+ True
+
+
+ 7
+ 8
+
+
+
+
+ True
+ 0
+ <b>Tracker Response:</b>
+ True
+
+
+ 8
+ 9
+
+
+
+
+ True
+ 0
+ <b>Tracker Status:</b>
+ True
+
+
+ 9
+ 10
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 9
+ 10
+
+
+
+
+ True
+ 0
+ <b>Next Announce:</b>
+ True
+
+
+ 2
+ 3
+ 9
+ 10
+
+
+
+
+ True
+ 0
+
+
+ 3
+ 4
+ 9
+ 10
+
+
+
+
+ True
+ 0
+ <b>Pieces:</b>
+ True
+
+
+ 2
+ 3
+ 1
+ 2
+
+
+
+
+ True
+ 0
+ <b>Total Uploaded:</b>
+ True
+
+
+ 2
+ 3
+ 2
+ 3
+
+
+
+
+ True
+ 0
+
+
+ 3
+ 4
+ 1
+ 2
+
+
+
+
+ True
+ 0
+
+
+ 3
+ 4
+ 2
+ 3
+
+
+
+
+ True
+ 0
+ <b>Share Ratio:</b>
+ True
+
+
+ 2
+ 3
+ 5
+ 6
+
+
+
+
+ True
+ 0
+ <b>Uploaded This Session:</b>
+ True
+
+
+ 2
+ 3
+ 6
+ 7
+
+
+
+
+ True
+ 0
+
+
+ 3
+ 4
+ 5
+ 6
+
+
+
+
+ True
+ 0
+
+
+ 3
+ 4
+ 6
+ 7
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 4
+ 7
+ 8
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 4
+ 8
+ 9
+
+
+
+
+ True
+ 0
+ <b>Name:</b>
+ True
+
+
+
+
+ True
+ 0
+ <b>Use compact storage allocation:</b>
+ True
+
+
+ 10
+ 11
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 10
+ 11
+
+
+
+
+ True
+ 0
+ <b>Download Rate:</b>
+ True
+
+
+ 3
+ 4
+
+
+
+
+ True
+ 0
+
+
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+ True
+ 0
+ <b>Upload Rate:</b>
+ True
+
+
+ 2
+ 3
+ 3
+ 4
+
+
+
+
+ True
+ 0
+
+
+ 3
+ 4
+ 3
+ 4
+
+
+
+
+
+
+
+
+ 1
+ False
+
+
+
+
+ True
+ Details
+
+
+ tab
+ 1
+ False
+ False
+
+
+
+
+ True
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+
+
+ True
+
+
+
+
+ 2
+ False
+
+
+
+
+ True
+ Files
+
+
+ tab
+ 2
+ False
+ False
+
+
+
+
+ True
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+
+
+ True
+ True
+
+
+
+
+ 3
+ False
+
+
+
+
+ True
+ Peers
+
+
+ tab
+ 3
+ False
+ False
+
+
+
+
+ 3
+ 2
+ 3
+
+
+
+
+ True
+
+
+ 3
+ 3
+ 4
+
+
+
+
+
+
+ 3
+
+
+
+
+
+ True
+ GTK_TOOLBAR_BOTH_HORIZ
+ False
+
+
+ 2
+ 3
+ 1
+ 2
+
+ GTK_FILL
+
+
+
+
+ True
+ GTK_TOOLBAR_BOTH_HORIZ
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_FILL
+
+
True
@@ -146,842 +985,6 @@
GTK_FILL
-
-
- True
- GTK_TOOLBAR_BOTH_HORIZ
-
-
- 1
- 2
- 1
- 2
- GTK_FILL
-
-
-
-
- True
- GTK_TOOLBAR_BOTH_HORIZ
- False
-
-
- 2
- 3
- 1
- 2
-
- GTK_FILL
-
-
-
-
-
- 3
-
-
-
-
-
- True
-
-
- 3
- 3
- 4
-
-
-
-
-
- True
- True
-
-
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
-
-
- True
- True
- True
- False
-
-
-
-
-
- False
-
-
-
-
- True
- Torrents
-
-
- tab
- False
- False
-
-
-
-
- True
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
-
-
- True
-
-
- True
- 10
- 12
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
- 0
-
-
- 3
- 4
- 3
- 4
-
-
-
-
- True
- 0
- <b>Upload Rate:</b>
- True
-
-
- 2
- 3
- 3
- 4
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 3
- 4
-
-
-
-
- True
- 0
- <b>Download Rate:</b>
- True
-
-
- 3
- 4
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 10
- 11
-
-
-
-
- True
- 0
- <b>Use compact storage allocation:</b>
- True
-
-
- 10
- 11
-
-
-
-
- True
- 0
- <b>Name:</b>
- True
-
-
-
-
- True
- 0
-
-
- 1
- 4
- 8
- 9
-
-
-
-
- True
- 0
-
-
- 1
- 4
- 7
- 8
-
-
-
-
- True
- 0
-
-
- 3
- 4
- 6
- 7
-
-
-
-
- True
- 0
-
-
- 3
- 4
- 5
- 6
-
-
-
-
- True
- 0
- <b>Uploaded This Session:</b>
- True
-
-
- 2
- 3
- 6
- 7
-
-
-
-
- True
- 0
- <b>Share Ratio:</b>
- True
-
-
- 2
- 3
- 5
- 6
-
-
-
-
- True
- 0
-
-
- 3
- 4
- 2
- 3
-
-
-
-
- True
- 0
-
-
- 3
- 4
- 1
- 2
-
-
-
-
- True
- 0
- <b>Total Uploaded:</b>
- True
-
-
- 2
- 3
- 2
- 3
-
-
-
-
- True
- 0
- <b>Pieces:</b>
- True
-
-
- 2
- 3
- 1
- 2
-
-
-
-
- True
- 0
-
-
- 3
- 4
- 9
- 10
-
-
-
-
- True
- 0
- <b>Next Announce:</b>
- True
-
-
- 2
- 3
- 9
- 10
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 9
- 10
-
-
-
-
- True
- 0
- <b>Tracker Status:</b>
- True
-
-
- 9
- 10
-
-
-
-
- True
- 0
- <b>Tracker Response:</b>
- True
-
-
- 8
- 9
-
-
-
-
- True
- 0
- <b>Tracker:</b>
- True
-
-
- 7
- 8
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 6
- 7
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 5
- 6
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 2
- 3
-
-
-
-
- True
- 0
-
-
- 1
- 2
- 1
- 2
-
-
-
-
- True
- 0
- <b>Downloaded this session:</b>
- True
-
-
- 6
- 7
-
-
-
-
- True
- 0
- <b>Percentage Done:</b>
- True
-
-
- 5
- 6
-
-
-
-
- True
- 0
- <b>Total Downloaded:</b>
- True
-
-
- 2
- 3
-
-
-
-
- True
- 0
- <b>Total Size:</b>
- True
-
-
- 1
- 2
-
-
-
-
- True
- 0
- True
-
-
- 1
- 4
-
-
-
-
- True
- 0
- <b>Seeders:</b>
- True
-
-
- 4
- 5
-
-
-
-
- True
- 0
- <b>Peers:</b>
- True
-
-
- 2
- 3
- 4
- 5
-
-
-
-
- True
-
-
- 1
- 2
- 4
- 5
-
-
-
-
- True
-
-
- 3
- 4
- 4
- 5
-
-
-
-
- True
- 0
- <b>Estimated Time Remaining:</b>
- True
-
-
- 2
- 3
- 10
- 11
-
-
-
-
- True
-
-
- 3
- 4
- 10
- 11
-
-
-
-
-
-
-
-
- 1
- False
-
-
-
-
- True
- Details
-
-
- tab
- 1
- False
- False
-
-
-
-
- True
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
-
-
- True
-
-
-
-
- 2
- False
-
-
-
-
- True
- Files
-
-
- tab
- 2
- False
- False
-
-
-
-
- True
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
-
-
- True
- True
-
-
-
-
- 3
- False
-
-
-
-
- True
- Peers
-
-
- tab
- 3
- False
- False
-
-
-
-
- 3
- 2
- 3
-
-