Hook in the new pool page feature
I still need to fix the conflict between the pool and the post page...
This commit is contained in:
parent
feded2bdf3
commit
b97ef73677
2 changed files with 20 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
|
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
|
||||||
<kpartgui name="danbooru_client" version="4">
|
<kpartgui name="danbooru_client" version="5">
|
||||||
<ToolBar name="mainToolBar" >
|
<ToolBar name="mainToolBar" >
|
||||||
<text>Main Toolbar</text>
|
<text>Main Toolbar</text>
|
||||||
<Action name="connect" />
|
<Action name="connect" />
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
<Action name="poolDownload" />
|
<Action name="poolDownload" />
|
||||||
<Action name="tags" />
|
<Action name="tags" />
|
||||||
<Action name="morePosts" />
|
<Action name="morePosts" />
|
||||||
|
<Action name="morePools" />
|
||||||
<ActionList name="dynamicActionlist" />
|
<ActionList name="dynamicActionlist" />
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<MenuBar>
|
<MenuBar>
|
||||||
|
|
|
@ -118,6 +118,7 @@ DanbooruMainWindow::DanbooruMainWindow(QWidget *parent)
|
||||||
|
|
||||||
auto qmlViewPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
|
auto qmlViewPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
|
||||||
qApp->applicationName() + QLatin1String("/danbooruimageview.qml"));
|
qApp->applicationName() + QLatin1String("/danbooruimageview.qml"));
|
||||||
|
qDebug() << qmlViewPath;
|
||||||
|
|
||||||
QQmlContext *ctxt = m_view->rootContext();
|
QQmlContext *ctxt = m_view->rootContext();
|
||||||
ctxt->setContextProperty("danbooruModel", m_model);
|
ctxt->setContextProperty("danbooruModel", m_model);
|
||||||
|
@ -276,8 +277,10 @@ void DanbooruMainWindow::setupActions()
|
||||||
i18n("Search"), this);
|
i18n("Search"), this);
|
||||||
KToggleAction *poolAction = new KToggleAction(QIcon::fromTheme(QLatin1String("image-x-generic")),
|
KToggleAction *poolAction = new KToggleAction(QIcon::fromTheme(QLatin1String("image-x-generic")),
|
||||||
i18n("Pools"), this);
|
i18n("Pools"), this);
|
||||||
QAction* nextPageAction = new QAction(QIcon::fromTheme(QLatin1String("go-next")),
|
QAction *nextPageAction = new QAction(QIcon::fromTheme(QLatin1String("go-next")),
|
||||||
i18n("More posts"), this);
|
i18n("More posts"), this);
|
||||||
|
QAction *nextPoolAction = new QAction(QIcon::fromTheme(QLatin1String("go-next")),
|
||||||
|
i18n("More pools"), this);
|
||||||
|
|
||||||
KDualAction* tagAction = new KDualAction(i18n("Show tags"), i18n("Hide tags"), this);
|
KDualAction* tagAction = new KDualAction(i18n("Show tags"), i18n("Hide tags"), this);
|
||||||
tagAction->setIconForStates(QIcon::fromTheme(QLatin1String("tag")));
|
tagAction->setIconForStates(QIcon::fromTheme(QLatin1String("tag")));
|
||||||
|
@ -286,6 +289,7 @@ void DanbooruMainWindow::setupActions()
|
||||||
findAction->setEnabled(false);
|
findAction->setEnabled(false);
|
||||||
poolAction->setEnabled(false);
|
poolAction->setEnabled(false);
|
||||||
nextPageAction->setEnabled(false);
|
nextPageAction->setEnabled(false);
|
||||||
|
nextPoolAction->setEnabled(false);
|
||||||
|
|
||||||
poolAction->setChecked(false);
|
poolAction->setChecked(false);
|
||||||
findAction->setChecked(false);
|
findAction->setChecked(false);
|
||||||
|
@ -297,6 +301,7 @@ void DanbooruMainWindow::setupActions()
|
||||||
actionCollection()->addAction(QLatin1String("poolDownload"), poolAction);
|
actionCollection()->addAction(QLatin1String("poolDownload"), poolAction);
|
||||||
actionCollection()->addAction(QLatin1String("tags"), tagAction);
|
actionCollection()->addAction(QLatin1String("tags"), tagAction);
|
||||||
actionCollection()->addAction(QLatin1String("morePosts"), nextPageAction);
|
actionCollection()->addAction(QLatin1String("morePosts"), nextPageAction);
|
||||||
|
actionCollection()->addAction(QLatin1String("morePools"), nextPoolAction);
|
||||||
|
|
||||||
actionCollection()->setDefaultShortcut(connectAction, KStandardShortcut::Open);
|
actionCollection()->setDefaultShortcut(connectAction, KStandardShortcut::Open);
|
||||||
actionCollection()->setDefaultShortcut(findAction, KStandardShortcut::Find);
|
actionCollection()->setDefaultShortcut(findAction, KStandardShortcut::Find);
|
||||||
|
@ -318,14 +323,17 @@ void DanbooruMainWindow::setupActions()
|
||||||
|
|
||||||
if (m_poolModel->rowCount() == 0) {
|
if (m_poolModel->rowCount() == 0) {
|
||||||
m_service->getPoolList();
|
m_service->getPoolList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
poolDockWidget->show();
|
poolDockWidget->show();
|
||||||
|
actionCollection()->action(QLatin1String("morePools"))->setEnabled(true);
|
||||||
m_tableView->show();
|
m_tableView->show();
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
poolDockWidget->hide();
|
poolDockWidget->hide();
|
||||||
|
actionCollection()->action(QLatin1String("morePools"))->setEnabled(false);
|
||||||
m_tableView->hide();
|
m_tableView->hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -359,11 +367,20 @@ void DanbooruMainWindow::setupActions()
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(nextPageAction, &QAction::triggered, [this]() {
|
connect(nextPageAction, &QAction::triggered, [this]() {
|
||||||
|
|
||||||
|
if (m_model->rowCount() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(m_view->rootObject(), "downloadStarted");
|
QMetaObject::invokeMethod(m_view->rootObject(), "downloadStarted");
|
||||||
m_service->nextPostPage();
|
m_service->nextPostPage();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
connect(nextPoolAction, &QAction::triggered, [this]() {
|
||||||
|
m_service->nextPoolPage();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue