mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Implement a way for setting the title in the main toolbar.
This commit is contained in:
parent
ca5096fba4
commit
e7922a0e51
@ -1567,12 +1567,12 @@ void LibraryWindow::onAddComicsToLabel()
|
||||
|
||||
void LibraryWindow::setToolbarTitle(const QModelIndex &modelIndex)
|
||||
{
|
||||
#ifndef Q_OS_MAC
|
||||
if (!modelIndex.isValid())
|
||||
libraryToolBar->setCurrentFolderName(selectedLibrary->currentText());
|
||||
else
|
||||
libraryToolBar->setCurrentFolderName(modelIndex.data().toString());
|
||||
#endif
|
||||
if (!theme.isMacosNative) {
|
||||
if (!modelIndex.isValid())
|
||||
libraryToolBar->setTitle(selectedLibrary->currentText());
|
||||
else
|
||||
libraryToolBar->setTitle(modelIndex.data().toString());
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::saveSelectedCoversTo()
|
||||
@ -1839,20 +1839,23 @@ void LibraryWindow::rename(QString newName) //TODO replace
|
||||
QString currentLibrary = selectedLibrary->currentText();
|
||||
if (newName != currentLibrary) {
|
||||
if (!libraries.contains(newName)) {
|
||||
libraries.rename(currentLibrary, newName);
|
||||
libraries.rename(currentLibrary,newName);
|
||||
//selectedLibrary->removeItem(selectedLibrary->currentIndex());
|
||||
//libraries.addLibrary(newName,path);
|
||||
selectedLibrary->renameCurrentLibrary(newName);
|
||||
libraries.save();
|
||||
renameLibraryDialog->close();
|
||||
#ifndef Q_OS_MAC
|
||||
if (!foldersModelProxy->mapToSource(foldersView->currentIndex()).isValid())
|
||||
libraryToolBar->setCurrentFolderName(selectedLibrary->currentText());
|
||||
#endif
|
||||
} else {
|
||||
|
||||
if (!theme.isMacosNative) {
|
||||
if(!foldersModelProxy->mapToSource(foldersView->currentIndex()).isValid())
|
||||
libraryToolBar->setTitle(selectedLibrary->currentText());
|
||||
}
|
||||
}
|
||||
else {
|
||||
libraryAlreadyExists(newName);
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
renameLibraryDialog->close();
|
||||
//selectedLibrary->setCurrentIndex(selectedLibrary->findText(newName));
|
||||
}
|
||||
|
@ -153,3 +153,10 @@ void YACReaderLibraryToolbar::setDisabled(bool disabled)
|
||||
defaultToolbar->setDisabled(disabled);
|
||||
}
|
||||
}
|
||||
|
||||
void YACReaderLibraryToolbar::setTitle(const QString &title)
|
||||
{
|
||||
if (defaultToolbar != nullptr) {
|
||||
defaultToolbar->setTitle(title);
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ public slots:
|
||||
|
||||
void setDisabled(bool disabled);
|
||||
|
||||
void setTitle(const QString &title);
|
||||
|
||||
private:
|
||||
QMainWindow *mainWindow;
|
||||
bool isMacosNative;
|
||||
|
@ -132,7 +132,7 @@ void YACReaderMainToolBar::addWideDivider()
|
||||
mainLayout->addSpacing(3);
|
||||
}
|
||||
|
||||
void YACReaderMainToolBar::setCurrentFolderName(const QString &name)
|
||||
void YACReaderMainToolBar::setTitle(const QString & name)
|
||||
{
|
||||
currentFolder->setText(name);
|
||||
currentFolderName = name;
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
QToolButton *fullscreenButton;
|
||||
|
||||
void setSearchWidget(QWidget *w);
|
||||
void setCurrentFolderName(const QString &name);
|
||||
void setTitle(const QString &name);
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
Loading…
Reference in New Issue
Block a user