mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
16943ccab1
make selectedText const add a new keyboard shortcut: ctrl+shift+n to make a card if word is empty, warn and exit rename return after ankisearch remove temp vars change the anki action's text depending on selected text reformat article maker the anki button is shown under the heading revert to the previous way of constructing gddictname to reduce size of the diff
32 lines
717 B
C++
32 lines
717 B
C++
#ifndef ANKICONNECTOR_H
|
|
#define ANKICONNECTOR_H
|
|
|
|
#include "config.hh"
|
|
|
|
#include <QNetworkAccessManager>
|
|
#include <QNetworkReply>
|
|
#include <QObject>
|
|
|
|
class AnkiConnector : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit AnkiConnector( QObject * parent, Config::Class const & cfg );
|
|
|
|
void sendToAnki( QString const & word, QString text, QString const & sentence );
|
|
void ankiSearch( QString const & word);
|
|
|
|
private:
|
|
QNetworkAccessManager * mgr;
|
|
Config::Class const & cfg;
|
|
void postToAnki( QString const & postData );
|
|
static constexpr auto transfer_timeout = 3000;
|
|
public:
|
|
signals:
|
|
void errorText( QString const & );
|
|
private slots:
|
|
void finishedSlot(QNetworkReply * reply);
|
|
};
|
|
|
|
#endif // ANKICONNECTOR_H
|