[Title]fix emulator icon problem
authormunkyu.im <munkyu.im@samsung.com>
Mon, 19 Dec 2011 13:00:28 +0000 (22:00 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Mon, 19 Dec 2011 13:00:28 +0000 (22:00 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#]#3709
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/skins/icons/vtm.ico
tizen/src/emulator.c
tizen/src/menu_callback.c
tizen/src/vtm.c

index da9a0a3..3c34a50 100644 (file)
Binary files a/tizen/skins/icons/vtm.ico and b/tizen/skins/icons/vtm.ico differ
index 8f60bfe..53cea69 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/* 
  * Emulator
  *
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
@@ -483,24 +483,24 @@ static void construct_main_window(void)
 #endif
        gtk_window_set_decorated (GTK_WINDOW (g_main_window), FALSE);
 
-       /* 2.1 emulator taskbar name */
-
-       name = g_strdup_printf("emulator-%d", get_sdb_base_port()); 
-       gtk_window_set_title (GTK_WINDOW (g_main_window), name);
-
-       /* 2.2 emulator taskbar icon image */
+       /* 2.1 emulator taskbar icon image */
 
        skin = get_skin_path();
        if (skin == NULL) {
                ERR( "getting skin path is failed!!\n");
                exit (1);
        }
-#ifdef _WIN32  
-#if (_WIN32_WINNT >= 0x0601)
-       sprintf(emul_img_dir, "%s/icons/vtm.ico", skin);
-#else 
-       sprintf(emul_img_dir, "%s/icons/Emulator_20x20.png", skin);
-#endif
+#ifdef _WIN32
+       OSVERSIONINFO osvi;
+       ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+       osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+    GetVersionEx(&osvi);
+
+    if((osvi.dwMajorVersion >= 6) && (osvi.dwMinorVersion >= 1))
+        sprintf(emul_img_dir, "%s/icons/vtm.ico", skin);
+    else 
+               sprintf(emul_img_dir, "%s/icons/Emulator_20x20.png", skin);
+               
 #else /* _WIN32 */
        sprintf(emul_img_dir, "%s/icons/vtm.ico", skin);
 #endif/* _WIN32 */
@@ -509,11 +509,14 @@ static void construct_main_window(void)
                ERR( "emulator icon directory %s doesn't exist!!\n", emul_img_dir);
                exit(EXIT_FAILURE);
        }
+       gtk_window_set_icon_from_file(GTK_WINDOW(g_main_window), emul_img_dir, NULL);
+       
+       
+       /* 2.2 emulator taskbar name */
+
+       name = g_strdup_printf("emulator-%d", get_sdb_base_port()); 
+       gtk_window_set_title (GTK_WINDOW (g_main_window), name);
 
-       if(gtk_window_set_default_icon_from_file(emul_img_dir, NULL) == FALSE) {
-               ERR( "emulator icon from file doesn't set!! %s\n", emul_img_dir);
-               exit(EXIT_FAILURE);
-       }
 
        /* 3. skin load */
 
index 615e8ce..c6927d7 100755 (executable)
@@ -565,8 +565,7 @@ void show_about_window(GtkWidget *parent)
         */
        //const gchar *website = "http://innovator.samsungmobile.com";
 
-       sprintf(comments, "Tizen Emulator.\n"
-                       "Version: %s\n"
+       sprintf(comments, "\nVersion: %s\n"
                        //              "Based upon QEMU 0.10.5 (http://qemu.org)\n"
                        "Build date: %s\nGit version: %s\n",
                        build_version, build_date, build_git);
index 6e21f8d..1e43c64 100644 (file)
@@ -285,10 +285,10 @@ void activate_target(char *target_name)
 
 char *check_kvm(char *info_file, int *status)
 {
-       char *kvm = NULL;
        char *enable_kvm = NULL;
-       int fd;
 #ifndef _WIN32
+       char *kvm = NULL;
+       int fd;
        kvm = get_config_value(info_file, QEMU_GROUP, KVM_KEY);
        if(g_file_test("/dev/kvm", G_FILE_TEST_EXISTS) && strcmp(kvm,"1") == 0)
        {
@@ -1482,11 +1482,11 @@ void modify_ok_clicked_cb(GtkWidget *widget, gpointer data)
 {
        GtkWidget *win = get_window(VTM_CREATE_ID);
        char *target_name = (char*)data;
-       char *cmd = NULL;
-       char *cmd2 = NULL;
        char *dest_path = NULL;
        char *conf_file = NULL;
        const gchar *name = NULL;
+       char *cmd = NULL;
+       char *cmd2 = NULL;
        char *dst;
        char *arch = (char*)g_getenv("EMULATOR_ARCH");
        if(arch == NULL)
@@ -2222,7 +2222,6 @@ void setup_ram_frame(void)
 
 void show_create_window(void)
 {
-       const gchar *skin = NULL;
        GtkWidget *sub_window;
        char *arch = (char*)g_getenv("EMULATOR_ARCH");
        if(arch == NULL)
@@ -2259,10 +2258,6 @@ void show_create_window(void)
        setup_create_frame();
        setup_create_button();
 
-       skin = get_skin_path();
-       if(skin == NULL)
-               WARN( "getting icon image path is failed!!\n");
-       sprintf(icon_image, "%s/icons/Emulator_20x20.png", skin);
        gtk_window_set_icon_from_file(GTK_WINDOW(sub_window), icon_image, NULL);
 
        g_signal_connect(GTK_OBJECT(sub_window), "delete_event", G_CALLBACK(create_window_deleted_cb), NULL);
@@ -2343,7 +2338,7 @@ int main(int argc, char** argv)
        skin = (char*)get_skin_path();
        if(skin == NULL)
                WARN( "getting icon image path is failed!!\n");
-       sprintf(icon_image, "%s/icons/Emulator_20x20.png", skin);
+       sprintf(icon_image, "%s/icons/vtm.ico", skin);
 
        sprintf(full_glade_path, "%s/etc/vtm.glade", get_root_path());