cancelButton = new QPushButton();
cancelButton.setText(tr("Cancel"));
cancelButton.pressed.connect(this, "onCancel()");
QVBoxLayout openLayout = new QVBoxLayout();
openLayout.addWidget(new QLabel(tr("Open Notebooks")));
openLayout.addWidget(openBookList);
rightButton = new QPushButton(this);
rightButton.setIcon(new QIcon(iconPath+"forward.png"));
leftButton = new QPushButton(this);
leftButton.setIcon(new QIcon(iconPath+"back.png"));
leftButton.setEnabled(false);
rightButton.setEnabled(false);
QVBoxLayout middleLayout = new QVBoxLayout();
middleLayout.addSpacerItem(new QSpacerItem(1,1));
middleLayout.addWidget(rightButton);
middleLayout.addWidget(leftButton);
middleLayout.addSpacerItem(new QSpacerItem(1,1));
QVBoxLayout closeLayout = new QVBoxLayout();
closeLayout.addWidget(new QLabel(tr("Closed Notebooks")));
closedBookList = new QListWidget();
closedBookList.setSortingEnabled(true);
closedBookList.setSelectionMode(QAbstractItemView.SelectionMode.MultiSelection);
closeLayout.addWidget(closedBookList);
openBookList.itemSelectionChanged.connect(this, "openBookSelected()");
closedBookList.itemSelectionChanged.connect(this, "closedBookSelected()");
leftButton.clicked.connect(this, "toOpenList()");
rightButton.clicked.connect(this, "toClosedList()");
QHBoxLayout buttonLayout = new QHBoxLayout();
buttonLayout.addStretch(1);
buttonLayout.addWidget(okButton);
buttonLayout.addWidget(cancelButton);
setWindowTitle(tr("Open/Close Notebooks"));
QHBoxLayout upperLayout = new QHBoxLayout();
upperLayout.addLayout(openLayout);
upperLayout.addLayout(middleLayout);
upperLayout.addLayout(closeLayout);
QVBoxLayout mainLayout = new QVBoxLayout();
mainLayout.addLayout(upperLayout);
//mainLayout.addStretch(1);
mainLayout.addSpacing(1);
mainLayout.addLayout(buttonLayout);
setLayout(mainLayout);
for (int i=0; i<allBooks.size(); i++) {
boolean found = false;
for (int j=0; j<archive.size(); j++) {