set transport buttons indexes stable
authorMaksym Veremeyenko <verem@m1stereo.tv>
Wed, 15 Jun 2011 09:20:37 +0000 (12:20 +0300)
committerMaksym Veremeyenko <verem@m1stereo.tv>
Wed, 15 Jun 2011 09:20:37 +0000 (12:20 +0300)
src/interface.c

index 02086d5..d4e5828 100644 (file)
@@ -35,78 +35,93 @@ create_buttons_transport(GtkWidget *top, int type)
        gchar name[32];
        const static struct
        {
+               int idx;
                int type;
                gchar* tooltip;
                gchar* filename;
        } buttons[] =
        {
                {
+                       0,
                        2,
                        "Beginning of playlist",
                        "begin-16x16_(Axialis_Team).png"        /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       1,
                        2,
                        "Start of clip",
                        "prev-16x16_(Axialis_Team).png" /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
                        2,
+                       2,
                        "Rewind",
                        "rew-16x16_(Axialis_Team).png"  /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       3,
                        2,
                        "Previous frame",
                        "prev-frame-16x16_(Axialis_Team).png"   /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       5,
                        1,
                        "Play",
                        "player_play_64x32_(Axialis_Team).png"  /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       4,
                        1,
                        "Pause",
                        "player_pause_32x32_(Axialis_Team).png" /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       6,
                        1,
                        "Stop",
                        "player_stop_32x32_(Axialis_Team).png"  /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       7,
                        2,
                        "Next frame",
                        "next-frame-16x16_(Axialis_Team).png"   /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       8,
                        2,
                        "Fast forward",
                        "fwd-16x16_(Axialis_Team).png"  /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       9,
                        2,
                        "Next clip",
                        "next-16x16_(Axialis_Team).png" /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       10,
                        2,
                        "End of playlist",
                        "end-16x16_(Axialis_Team).png"  /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       11,
                        2,
                        "Loop On",
                        "loop_on_16x16_(Axialis_Team).png"      /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
+                       12,
                        2,
                        "Loop Off",
                        "loop_off_16x16_(Axialis_Team).png"     /* Free Icons by Axialis Software http://www.axialis.com */
                },
                {
                        0,
+                       0,
                        NULL,
                        NULL
                }
@@ -134,10 +149,10 @@ create_buttons_transport(GtkWidget *top, int type)
                gtk_widget_show (image);
                gtk_container_add (GTK_CONTAINER (transport), image);
 
-               snprintf(name, sizeof(name), "transport_%d", i);
+               snprintf(name, sizeof(name), "transport_%d", buttons[i].idx);
                GLADE_HOOKUP_OBJECT (top, transport, name);
 
-               snprintf(name, sizeof(name), "transport_image_%d", i);
+               snprintf(name, sizeof(name), "transport_image_%d", buttons[i].idx);
                GLADE_HOOKUP_OBJECT (top, image, name);
        };