added 'add new label' support

This commit is contained in:
Luis Ángel San Martín
2014-11-11 15:46:30 +01:00
parent a74309aed9
commit d1fbb1d5ba
12 changed files with 189 additions and 10 deletions

View File

@ -1153,7 +1153,7 @@ void LibraryWindow::createConnections()
//lists
connect(addReadingListAction,SIGNAL(triggered()),this,SLOT(addNewReadingList()));
connect(deleteReadingListAction,SIGNAL(triggered()),this,SLOT(deleteSelectedReadingList()));
connect(addLabelAction,SIGNAL(triggered()),this,SLOT(addNewLabel()));
connect(addLabelAction,SIGNAL(triggered()),this,SLOT(showAddNewLabelDialog()));
}
void LibraryWindow::loadLibrary(const QString & name)
@ -1626,10 +1626,18 @@ void LibraryWindow::deleteSelectedReadingList()
}
void LibraryWindow::addNewLabel()
void LibraryWindow::showAddNewLabelDialog()
{
AddLabelDialog * dialog = new AddLabelDialog();
dialog->open();
int ret = dialog->exec();
if (ret == QDialog::Accepted)
{
YACReader::LabelColors color = dialog->selectedColor();
QString name = dialog->name();
listsModel->addNewLabel(name,color);
}
}
void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child)