|
|
|
|
@ -4,6 +4,7 @@ |
|
|
|
|
#include "undo/CopyUndoAction.h" |
|
|
|
|
#include "undo/SwapUndoAction.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SidebarToolbar::SidebarToolbar(Control* control, GladeGui* gui) |
|
|
|
|
{ |
|
|
|
|
XOJ_INIT_TYPE(SidebarToolbar); |
|
|
|
|
@ -89,10 +90,16 @@ void SidebarToolbar::btCopyClicked(GtkToolButton* toolbutton, SidebarToolbar* to |
|
|
|
|
{ |
|
|
|
|
XOJ_CHECK_TYPE_OBJ(toolbar, SidebarToolbar); |
|
|
|
|
|
|
|
|
|
printf("copy page this=%lx\n", toolbar); |
|
|
|
|
|
|
|
|
|
Document* doc = toolbar->control->getDocument(); |
|
|
|
|
doc->lock(); |
|
|
|
|
|
|
|
|
|
int page = doc->indexOf(toolbar->currentPage); |
|
|
|
|
if (page < 0) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PageRef newPage = toolbar->currentPage.clone(); |
|
|
|
|
doc->insertPage(newPage, page + 1); |
|
|
|
|
@ -126,5 +133,11 @@ void SidebarToolbar::setButtonEnabled(bool enableUp, bool enableDown, bool enabl |
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(this->btDelete), enableDelete); |
|
|
|
|
|
|
|
|
|
this->currentPage = currentPage; |
|
|
|
|
|
|
|
|
|
Document* doc = control->getDocument(); |
|
|
|
|
doc->lock(); |
|
|
|
|
int page = doc->indexOf(currentPage); |
|
|
|
|
doc->unlock(); |
|
|
|
|
printf("Current selected page is %i, this=%lx\n", page, this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|