Re: [jokosher-devel] [PATCH] new project complains if project dir doesn't exist

2007-11-11 Thread Laszlo Pandy
Josh Steiner wrote:
> Found a few more places where the same issue existed, this time diff is 
> attached :)
> 
> -josh
> 

Done
___
jokosher-devel-list mailing list
jokosher-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/jokosher-devel-list


Re: [jokosher-devel] [PATCH] new project complains if project dir doesn't exist

2007-11-11 Thread Josh Steiner
Found a few more places where the same issue existed, this time diff is 
attached :)


-josh

Laszlo Pandy wrote:

Josh Steiner wrote:
  
Hey guys, my first of hopefully many patches (created with "svn diff") 
is below.


The new proj dialog seems to try to default to the last folder you saved 
a project to, but if it doesn't exist the GtkFileChooserButton complains 
in an ugly fashion... this just checks if it exists, if not it defaults 
to the users home dir.


-Josh

---

Index: NewProjectDialog.py
===
--- NewProjectDialog.py(revision 1477)
+++ NewProjectDialog.py(working copy)
@@ -92,7 +92,10 @@
 self.okbutton.grab_default()

 # Set the default folder of 'folder' (a FileChooserButton)
-
self.folder.set_current_folder(Globals.settings.general["projectfolder"])

+if os.path.exists(Globals.settings.general["projectfolder"]):
+
self.folder.set_current_folder(Globals.settings.general["projectfolder"])

+else:
+self.folder.set_current_folder(os.path.expanduser("~"))
 
 self.dlg.resize(350, 300)

 self.dlg.set_icon(self.parent.icon)




Committed. Thanks dude. :)
Next time can you send the patch as a file attachment. It looks like 
your text wrapping mangled the patch above and I had to apply it by hand.


Laszlo
___
jokosher-devel-list mailing list
jokosher-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/jokosher-devel-list
  



--

tasty electronic music vittles  --  bluevitriol.com
the only music blog you need--  playtherecords.com
you are the dj.  interactive music  --  improbableorchestra.com
random observations of the bizarre  --  vitriolix.com

Index: MixdownActions.py
===
--- MixdownActions.py   (revision 1478)
+++ MixdownActions.py   (working copy)
@@ -358,7 +358,10 @@
widget -- reserved for GTK callbacks, don't use it 
explicitly.
"""
chooser = gtk.FileChooserDialog((_('Select Export Location')), 
None, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, (gtk.STOCK_CANCEL, 
gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
-   
chooser.set_current_folder(Globals.settings.general["projectfolder"])
+   if os.path.exists(Globals.settings.general["projectfolder"]):
+   
chooser.set_current_folder(Globals.settings.general["projectfolder"])
+   else:
+   chooser.set_current_folder(os.path.expanduser("~"))
chooser.set_icon(self.dialogIcon)
 
chooser.set_default_response(gtk.RESPONSE_OK)
@@ -476,7 +479,10 @@
See MixdownAction.ConfigureAction.
"""
chooser = gtk.FileChooserDialog((_("Run External Script")), 
None, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, 
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
-   
chooser.set_current_folder(Globals.settings.general["projectfolder"])
+   if os.path.exists(Globals.settings.general["projectfolder"]):
+   
chooser.set_current_folder(Globals.settings.general["projectfolder"])
+   else:
+   chooser.set_current_folder(os.path.expanduser("~"))
chooser.set_icon(self.dialogIcon)
 
chooser.set_default_response(gtk.RESPONSE_OK)
@@ -513,4 +519,4 @@

#_

-#=
\ No newline at end of file
+#=
Index: JokosherApp.py
===
--- JokosherApp.py  (revision 1478)
+++ JokosherApp.py  (working copy)
@@ -601,7 +601,10 @@
"""
buttons = 
(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_SAVE,gtk.RESPONSE_OK)
chooser = gtk.FileChooserDialog(_("Mixdown Project"), 
self.window, gtk.FILE_CHOOSER_ACTION_SAVE, buttons)
-   
chooser.set_current_folder(Globals.settings.general["projectfolder"])
+   if os.path.exists(Globals.settings.general["projectfolder"]):
+   
chooser.set_current_folder(Globals.settings.general["projectfolder"])
+   else:
+   chooser.set_current_folder(os.path.expanduser("~"))
chooser.set_do_overwrite_confirmation(True)
chooser.set_default_response(gtk.RESPONSE_OK)
chooser.set_current_name(self.project.name)
@@ -724,7 +727,10 @@
dialog gets 
destroyed.
  

Re: [jokosher-devel] [PATCH] new project complains if project dir doesn't exist

2007-11-11 Thread Laszlo Pandy
Josh Steiner wrote:
> Hey guys, my first of hopefully many patches (created with "svn diff") 
> is below.
> 
> The new proj dialog seems to try to default to the last folder you saved 
> a project to, but if it doesn't exist the GtkFileChooserButton complains 
> in an ugly fashion... this just checks if it exists, if not it defaults 
> to the users home dir.
> 
> -Josh
> 
> ---
> 
> Index: NewProjectDialog.py
> ===
> --- NewProjectDialog.py(revision 1477)
> +++ NewProjectDialog.py(working copy)
> @@ -92,7 +92,10 @@
>  self.okbutton.grab_default()
> 
>  # Set the default folder of 'folder' (a FileChooserButton)
> -
> self.folder.set_current_folder(Globals.settings.general["projectfolder"])
> +if os.path.exists(Globals.settings.general["projectfolder"]):
> +
> self.folder.set_current_folder(Globals.settings.general["projectfolder"])
> +else:
> +self.folder.set_current_folder(os.path.expanduser("~"))
>  
>  self.dlg.resize(350, 300)
>  self.dlg.set_icon(self.parent.icon)
> 

Committed. Thanks dude. :)
Next time can you send the patch as a file attachment. It looks like 
your text wrapping mangled the patch above and I had to apply it by hand.

Laszlo
___
jokosher-devel-list mailing list
jokosher-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/jokosher-devel-list