Index: ythmbox/README
===================================================================
--- rhythmbox/README	(revision 30beeab008c68e1e024ed39a16b17a5d50ed07a3)
+++ 	(revision )
@@ -1,23 +1,0 @@
-This is a plugin for the Rhythmbox music player, which enables
-Gutenbach users to easily queue music.
-
-Plugin written by Nimrod Gileadi, copyright 2010.
-
-Questions or comments should be directed at gutenbach@mit.edu
-
-INSTALLATION:
-
-1) Move the folder 'pikamp3' and its contents to
-~/.gnome2/rhythmbox/plugins/.  You will have to edit __init.py__,
-replacing "printername" and "hostname" with the desired values (e.g.,
-"sipbmp3" and "zsr.mit.edu").
-
-2) Open rhythmbox, and navigate the 'Edit' menu.  Select 'Plugins'.
-
-3) Check the box next to 'gutenbach'.
-
-4) To queue a song/songs, highlight them, and right click and select
-'Send to gutenbach'.
-
-TODO:
-- turn this into a debian package to auto generate the config file
Index: rhythmbox/__init__.py
===================================================================
--- rhythmbox/__init__.py	(revision 30beeab008c68e1e024ed39a16b17a5d50ed07a3)
+++ rhythmbox/__init__.py	(revision 9fed25d52d8d56872b6d606ebb90429765f1755b)
@@ -1,56 +1,101 @@
-"""
-This module implements a Rhythmbox plugin that sends selected track to a
-printer queue. It's meant to be used with gutenbach, a music spooling printer
-server.
+from __future__ import division
 
-The plugin uses lpr to send the files to gutenbach.
-"""
-import gtk
 import rb
+import gtk, gtk.glade, gconf
+import gobject
+import sys, os
+import locale, datetime, time
 import subprocess
 import urllib
 import urlparse
 
-# UI Change is an extra item added to right-click menu when clicking on tracks
-popup_ui = """
+#fade_steps = 50
+
+ui_str = '''
 <ui> 
   <popup name="BrowserSourceViewPopup"> 
-    <menuitem name="Gutenbach" action="SendToGutenbach"/>
+    <menuitem name="Gutenbach" action="GutenbachDialog"/>
   </popup>
 </ui>
-"""
+'''
+
 class GutenbachPlugin(rb.Plugin):
-    def __init__(self):
-        rb.Plugin.__init__(self)
+    def __init__ (self):
+        rb.Plugin.__init__ (self)
 
-    def activate(self, shell):
-        """Adds a new item to the right-click menu which allows
-        sending music files to the gutenbach server.
-        """
+    def activate (self, shell):
+        data = dict()
+        manager = shell.get_player().get_property('ui-manager')
         self.shell = shell
-        # Create action for sending a track to gutenbach
-        action = gtk.Action('SendToGutenbach', _('Send to gutenbach'),
-                _("Queue selected tracks to the gutenbach server."),
-                "")
-        action.connect('activate', self.gutenbach_action, shell)
-        action_group = gtk.ActionGroup('GutenbachActionGroup')
-        action_group.add_action(action)
-        manager = shell.get_ui_manager()
-        manager.insert_action_group(action_group)
-        manager.add_ui_from_string(popup_ui)
+        action = gtk.Action('GutenbachDialog', _('_Send to gutenbach'), _('Spool song to gutenbach server'), None);
+        action.connect('activate', self.show_conf_dialog)
+        data['action_group'] = gtk.ActionGroup('GutenbachGroup')
+        data['action_group'].add_action(action)
+        manager.insert_action_group(data['action_group'], 0)
 
-        # Default configuration options
-        self.printer = "printername"
-        self.printer_host = "hostname"
+        data['ui_id'] = manager.add_ui_from_string(ui_str)
+        manager.ensure_update()
+        shell.set_data('GutenbachInfo', data)
+
+
 
     def deactivate(self, shell):
+        self.toolbar.remove(self.separator)
+        data = shell.get_data('GutenbachInfo')
+        manager = shell.get_player().get_property('ui-manager')
+        manager.remove_ui(data['ui_id'])
+        del self.player
+        del self.separator
+	del self.toolbar
         del self.shell
 
-    def gutenbach_action(self, action, shell):
-        """An action called when the user clicks the right-click menu item
-        to send a track to gutenbach.
-        This function calls an instance of lpr for each file to be added.
-        """
-        source = shell.get_property("selected-source")
+    def show_conf_dialog(self, action):
+        self.wTree = gtk.glade.XML(self.find_file('gutenbach-rhythmbox-2.glade'))
+        widgets = {}
+        widgets['gutenbach-dialog'] = self.wTree.get_widget('gutenbach-dialog')
+        dic = { 
+            "on_gutenbach-ok_clicked" : self.process,
+            "on_windowMain_destroy" : self.quit,
+            }
+
+        self.wTree.signal_autoconnect( dic )
+
+        # Fix proper Dialog placements
+        widgets['gutenbach-dialog'].set_transient_for(self.shell.props.window)
+
+        def gconf_path(key):
+            return '%s%s' % (gconf_plugin_path, key)
+
+
+        widget = None
+	try:
+		memf = open('savedqueue','r+')
+	except IOError:
+		memf = file('savedqueue', 'wt')
+		memf.close()
+	memf = open('savedqueue','r+')
+	memLine = memf.readline()
+	if memLine != "":
+		left = memLine
+		right = memf.readline()
+		self.wTree.get_widget("gutenbach-printer-entry").set_text(left.rstrip('\n'))
+		self.wTree.get_widget("gutenbach-host-entry").set_text(right.rstrip('\n'))
+	memf.close()
+        widgets['gutenbach-dialog'].run()
+	self.process(widget)
+        widgets['gutenbach-dialog'].destroy()
+    def process(self, widget):
+        memf = open('savedqueue','r+')
+	printerMem = (self.wTree.get_widget("gutenbach-printer-entry").get_text())
+	hostMem = (self.wTree.get_widget("gutenbach-host-entry").get_text())
+	memf.write(printerMem)
+	memf.write("\n")
+	memf.write(hostMem)
+	memf.write("\n")
+	memf.close();
+	self.process_songs(printerMem, hostMem)
+     # stuff that does things  
+    def process_songs(self, printer, host):
+        source = self.shell.get_property("selected-source")
         # For each track currently selected in the song browser
         for entry in source.get_entry_view().get_selected_entries():
@@ -60,10 +105,14 @@
             if p.scheme == "file":
                 path = p.path
-                if self.printer_host:
-                    printer = '@'.join([self.printer, self.printer_host])
-                else:
-                    printer = self.printer
-                command = 'lpr -P %s "%s"' % (printer, path)
+                if host:
+                    print "there is a host"
+                   # printer = '@'.join([printer, printer_host])
+        
+                printer = printer
+                #command = 'gbr "%s"' % (path)
+                command = 'lpr -H%s -P%s "%s"' % (host,printer, path)
                 print "About to run command '%s'" % command
                 subprocess.Popen(command, shell=True)
-
+    def quit(self, widget):
+        return
+                          
Index: ythmbox/gutenbach-prefs.ui
===================================================================
--- rhythmbox/gutenbach-prefs.ui	(revision 30beeab008c68e1e024ed39a16b17a5d50ed07a3)
+++ 	(revision )
@@ -1,115 +1,0 @@
-<?xml version="1.0"?>
-<interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy project-wide -->
-  <object class="GtkDialog" id="gutenbach-prefs">
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">gutenbach Configuration</property>
-    <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <object class="GtkVBox" id="vbox1">
-            <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkVBox" id="vbox2">
-                <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="GtkLabel" id="printer_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Printer name:</property>
-                  </object>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="printer_entry">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">&#x25CF;</property>
-                    <property name="text" translatable="yes">pikamp3</property>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkVBox" id="vbox3">
-                <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="GtkLabel" id="host_label">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Printer host:</property>
-                  </object>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="host_entry">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="invisible_char">&#x25CF;</property>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="OK">
-                <property name="label" translatable="yes">OK</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="0">OK</action-widget>
-    </action-widgets>
-  </object>
-</interface>
Index: rhythmbox/gutenbach-rhythmbox-2.glade
===================================================================
--- rhythmbox/gutenbach-rhythmbox-2.glade	(revision 9fed25d52d8d56872b6d606ebb90429765f1755b)
+++ rhythmbox/gutenbach-rhythmbox-2.glade	(revision 9fed25d52d8d56872b6d606ebb90429765f1755b)
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.16 -->
+  <!-- interface-naming-policy project-wide -->
+  <widget class="GtkDialog" id="gutenbach-dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Select Gutenbach Printer</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="type_hint">normal</property>
+    <property name="gravity">center</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkLabel" id="gutenbach-host">
+            <property name="visible">True</property>
+            <property name="xalign">0.05000000074505806</property>
+            <property name="label" translatable="yes">&lt;b&gt;Host Name&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+          </widget>
+          <packing>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkEntry" id="gutenbach-host-entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">&#x25CF;</property>
+          </widget>
+          <packing>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="gutenbach-printer">
+            <property name="visible">True</property>
+            <property name="xalign">0.05000000074505806</property>
+            <property name="label" translatable="yes">&lt;b&gt;Printer Name&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+            <property name="justify">right</property>
+            <property name="single_line_mode">True</property>
+          </widget>
+          <packing>
+            <property name="fill">False</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkEntry" id="gutenbach-printer-entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">&#x25CF;</property>
+          </widget>
+          <packing>
+            <property name="fill">False</property>
+            <property name="position">4</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <widget class="GtkButton" id="gutenbach-ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="gutenbach-cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="activate" handler="gtk_widget_destroy" after="yes"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>
Index: rhythmbox/gutenbach.rb-plugin
===================================================================
--- rhythmbox/gutenbach.rb-plugin	(revision 30beeab008c68e1e024ed39a16b17a5d50ed07a3)
+++ rhythmbox/gutenbach.rb-plugin	(revision 9fed25d52d8d56872b6d606ebb90429765f1755b)
@@ -3,5 +3,7 @@
 Module=gutenbach
 IAge=1
-Name=gutenbach
-Description="Print" tunes to the gutenbach server
-Authors=Nimrod Gileadi <nimrodg@mit.edu>
+Name=Gutenbach
+Description=Enable printing to a Gutenbach queue
+Authors=Kyle Brogle <broglek@bu.edu>
+Copyright=Copyright © 2010 Kyle Brogle
+Website=http://gutenbach.mit.edu
