show group name when it is auto-discovered as well.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Oct 2010 15:10:34 +0000 (15:10 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Oct 2010 15:10:34 +0000 (15:10 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@53264 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_player.c

index 70cec65..8008122 100644 (file)
@@ -36,6 +36,16 @@ struct opts {
    char *title;
 };
 
+static Ecore_Evas *win;
+
+static void
+_win_title_set(const char *group, const char *file)
+{
+   char buf[1024];
+   snprintf(buf, sizeof(buf), "Edje_Player - %s of %s", group, file);
+   ecore_evas_title_set(win, buf);
+}
+
 static char *
 _slave_mode_tok(char **p_arg)
 {
@@ -463,6 +473,7 @@ _create_edje(Evas *evas, const struct opts *opts)
             evas_object_del(edje);
             return NULL;
          }
+        if (!opts->title) _win_title_set(opts->group, opts->file);
      }
    else
      {
@@ -473,6 +484,7 @@ _create_edje(Evas *evas, const struct opts *opts)
                  evas_object_del(edje);
                  return NULL;
               }
+             if (!opts->title) _win_title_set("main", opts->file);
          }
        else
          {
@@ -492,6 +504,7 @@ _create_edje(Evas *evas, const struct opts *opts)
                  evas_object_del(edje);
                  return NULL;
               }
+             if (!opts->title) _win_title_set(group, opts->file);
             edje_file_collection_list_free(groups);
          }
      }
@@ -578,7 +591,6 @@ const Ecore_Getopt optdesc = {
 
 int main(int argc, char **argv)
 {
-   Ecore_Evas *win;
    Evas *evas;
    Evas_Object *stack, *edje;
    struct opts opts;
@@ -716,13 +728,6 @@ int main(int argc, char **argv)
    ecore_evas_sticky_set(win, opts.sticky);
    if (opts.title)
      ecore_evas_title_set(win, opts.title);
-   else
-     {
-       char buf[1024];
-       snprintf(buf, sizeof(buf), "Edje_Player - %s of %s",
-                opts.group, opts.file);
-       ecore_evas_title_set(win, buf);
-     }
 
    if (opts.size.w <= 0) opts.size.w = 320;
    if (opts.size.h <= 0) opts.size.h = 240;