bugDenemo - Bugs: bug #50204, Re-order lyric verses

 
 

bug #50204: Re-order lyric verses

Submitted by:  Richard Shann <rshann>
Submitted on:  Wed Feb 1 19:43:55 2017  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed Feb 1 19:43:55 2017, original submission:

It would be nice to re-order verses by dragging the tabs in the notebook. While it is easy to enable dragging the tabs, the code below fails to actually re-order the verses for the reasons explained.

// this doesn't work because page_num is the new position, ie it is pos
// we have to go through the list parsing "Verse %d" from the label to get pos and
//afterwards re-write all the labels in the new order.
static void
reorder_verse (GtkNotebook *notebook,
GtkWidget *child,
guint page_num,
DenemoStaff* thestaff)
{
GList *children = gtk_container_get_children (GTK_CONTAINER(notebook));
gint pos = g_list_index (children, child);
GList *this = g_list_nth (thestaff->verses, pos);
thestaff->verses = g_list_remove_link (thestaff->verses, this);
thestaff->verses = g_list_insert (thestaff->verses, this->data, page_num);
g_list_free (this);
g_print ("Reordered %d as %d\n", pos, page_num);
}

...
gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (notebook), gtk_widget_get_parent (textview), TRUE);
g_signal_connect (G_OBJECT (notebook), "page-reordered", G_CALLBACK (reorder_verse), staff);
...

Richard Shann <rshann>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rshann (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1