Allow downloading posts from the toolbar
This allows downloading if the QML area is not filled. TODO: Configure infinite scrolling
This commit is contained in:
		
					parent
					
						
							
								db03bdbce2
							
						
					
				
			
			
				commit
				
					
						7b8214401b
					
				
			
		
					 3 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
 | 
			
		||||
<kpartgui name="danbooru_client" version="3">
 | 
			
		||||
<kpartgui name="danbooru_client" version="4">
 | 
			
		||||
  <ToolBar name="mainToolBar" >
 | 
			
		||||
    <text>Main Toolbar</text>
 | 
			
		||||
      <Action name="connect" />
 | 
			
		||||
| 
						 | 
				
			
			@ -8,6 +8,7 @@
 | 
			
		|||
      <Action name="find" />
 | 
			
		||||
      <Action name="poolDownload" />
 | 
			
		||||
      <Action name="tags" />
 | 
			
		||||
      <Action name="morePosts" />
 | 
			
		||||
      <ActionList name="dynamicActionlist" />
 | 
			
		||||
  </ToolBar>
 | 
			
		||||
  <MenuBar>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -117,6 +117,7 @@ DanbooruMainWindow::DanbooruMainWindow(QWidget *parent)
 | 
			
		|||
    m_view->rootObject()->setProperty("poolMode", QVariant(false));
 | 
			
		||||
 | 
			
		||||
    statusBar()->addPermanentWidget(m_connectWidget);
 | 
			
		||||
    statusBar()->hide();
 | 
			
		||||
 | 
			
		||||
    setupDockWidgets();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -140,6 +141,7 @@ DanbooruMainWindow::DanbooruMainWindow(QWidget *parent)
 | 
			
		|||
        actionCollection()->action(QLatin1String("find"))->setEnabled(true);
 | 
			
		||||
        actionCollection()->action(QLatin1String("poolDownload"))->setEnabled(true);
 | 
			
		||||
        actionCollection()->action(QLatin1String("tags"))->setEnabled(true);
 | 
			
		||||
        actionCollection()->action(QLatin1String("morePosts"))->setEnabled(true);
 | 
			
		||||
 | 
			
		||||
        if (DanbooruSettings::self()->autoDownload()) {
 | 
			
		||||
            m_view->rootObject()->setProperty("poolMode", QVariant(false));
 | 
			
		||||
| 
						 | 
				
			
			@ -261,6 +263,8 @@ void DanbooruMainWindow::setupActions()
 | 
			
		|||
                                      i18n("Search"), this);
 | 
			
		||||
    KToggleAction *poolAction = new KToggleAction(QIcon::fromTheme(QLatin1String("image-x-generic")),
 | 
			
		||||
                                                  i18n("Pools"), this);
 | 
			
		||||
    QAction* nextPageAction = new QAction(QIcon::fromTheme(QLatin1String("download")),
 | 
			
		||||
                                          i18n("More posts"), this);
 | 
			
		||||
 | 
			
		||||
    KDualAction* tagAction = new KDualAction(i18n("Show tags"), i18n("Hide tags"), this);
 | 
			
		||||
    tagAction->setIconForStates(QIcon::fromTheme(QLatin1String("tag")));
 | 
			
		||||
| 
						 | 
				
			
			@ -268,6 +272,7 @@ void DanbooruMainWindow::setupActions()
 | 
			
		|||
    fetchAction->setEnabled(false);
 | 
			
		||||
    findAction->setEnabled(false);
 | 
			
		||||
    poolAction->setEnabled(false);
 | 
			
		||||
    nextPageAction->setEnabled(false);
 | 
			
		||||
 | 
			
		||||
    poolAction->setChecked(false);
 | 
			
		||||
    findAction->setChecked(false);
 | 
			
		||||
| 
						 | 
				
			
			@ -278,6 +283,7 @@ void DanbooruMainWindow::setupActions()
 | 
			
		|||
    actionCollection()->addAction(QLatin1String("find"), findAction);
 | 
			
		||||
    actionCollection()->addAction(QLatin1String("poolDownload"), poolAction);
 | 
			
		||||
    actionCollection()->addAction(QLatin1String("tags"), tagAction);
 | 
			
		||||
    actionCollection()->addAction(QLatin1String("morePosts"), nextPageAction);
 | 
			
		||||
 | 
			
		||||
    actionCollection()->setDefaultShortcut(connectAction, KStandardShortcut::Open);
 | 
			
		||||
    actionCollection()->setDefaultShortcut(findAction, KStandardShortcut::Find);
 | 
			
		||||
| 
						 | 
				
			
			@ -339,6 +345,8 @@ void DanbooruMainWindow::setupActions()
 | 
			
		|||
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    connect(nextPageAction, &QAction::triggered, [this]() {m_service->nextPostPage();});
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,6 +42,7 @@ public:
 | 
			
		|||
    void clear();
 | 
			
		||||
    DanbooruPool* poolAt(int index) const;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    QVector<DanbooruPool *> m_items;
 | 
			
		||||
    static const QStringList m_headerNames;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue