Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : apps/euphoria

Dir     : e17/apps/euphoria/bin


Modified Files:
        euphoria 


Log Message:
use the themes file dialog if it provides one. requires latest ruby-edje
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/bin/euphoria,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- euphoria    7 May 2005 16:18:45 -0000       1.23
+++ euphoria    8 May 2005 17:04:04 -0000       1.24
@@ -1,6 +1,6 @@
 #!/usr/bin/ruby -w
 
-# $Id: euphoria,v 1.23 2005/05/07 16:18:45 tsauerbeck Exp $
+# $Id: euphoria,v 1.24 2005/05/08 17:04:04 tsauerbeck Exp $
 
 require "ecore"
 require "ecore_x"
@@ -26,6 +26,7 @@
 
 class Euphoria
        DATA_DIR = "/usr/local/share/euphoria"
+       DATA_DIR_PRIV = File.expand_path("~/.xmms2/clients/euphoria")
 
        include Singleton
 
@@ -36,8 +37,7 @@
                @xmms = nil
 
                # settings
-               @config_file =
-                       
File.expand_path("~/.xmms2/clients/euphoria/config.yaml")
+               @config_file = DATA_DIR_PRIV + "/config.yaml"
 
                load_config
                init_xmms
@@ -105,8 +105,7 @@
        end
 
        def show_file_dialog
-               fd = File.expand_path("~/.xmms2/clients/euphoria/themes/fd.eet")
-               FileDialog.open(fd) do |sel|
+               FileDialog.open(@file_dialog_theme) do |sel|
                        if File.directory?(sel)
                                files = []
                                Find.find(sel) { |f| files << f if 
File.file?(f) }
@@ -147,6 +146,12 @@
                @theme = find_theme(@config.theme)
                raise "Cannot find theme - [EMAIL PROTECTED]" if @theme.nil?
 
+               if Edje.collections(@theme).include?("esmart.filedialog")
+                       @file_dialog_theme = @theme
+               else
+                       @file_dialog_theme = DATA_DIR_PRIV + "/themes/fd.eet"
+               end
+
                @edje = Edje::Edje.new(@ee.evas)
                @edje.load(@theme, "euphoria")
                @edje.name = "edje"
@@ -335,9 +340,9 @@
        end
 
        def find_theme(name)
-               dirs = [File.expand_path("~/.xmms2/clients/euphoria"), DATA_DIR]
+               dirs = [DATA_DIR_PRIV, DATA_DIR]
                dirs.each do |dir|
-                       tmp = File.join(dir, "/themes/#{name}.edj")
+                       tmp = File.join(dir, "themes/#{name}.edj")
                        return tmp if File.exist?(tmp)
                end
 




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to