Skip to content
Snippets Groups Projects
Commit 2ed0521e authored by SeeLook's avatar SeeLook :musical_note:
Browse files

[Android] restore sending exam by native services (mail, Whatsup...)

parent ce160147
No related branches found
No related tags found
No related merge requests found
/*************************************************************************** /***************************************************************************
* Copyright (C) 2011-2019 by Tomasz Bojczuk * * Copyright (C) 2011-2020 by Tomasz Bojczuk *
* seelook@gmail.com * * seelook@gmail.com *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <tpath.h> #include <tpath.h>
#if defined (Q_OS_ANDROID) #if defined (Q_OS_ANDROID)
#include <Android/tandroid.h> #include <Android/tandroid.h>
#include <qtr.h>
#endif #endif
#include <QtCore/qtimer.h> #include <QtCore/qtimer.h>
...@@ -199,3 +200,15 @@ int TexamSummary::buttColumsCount() const { ...@@ -199,3 +200,15 @@ int TexamSummary::buttColumsCount() const {
return (!enableContinue() && isExercise()) || (enableContinue() && !isExercise()) ? 3 : 2; return (!enableContinue() && isExercise()) || (enableContinue() && !isExercise()) ? 3 : 2;
} }
#if defined (Q_OS_ANDROID)
void TexamSummary::sendExam() {
QString space = QStringLiteral(" ");
QString br = QStringLiteral("\n");
QString message = qTR("TexamSummary", "student:") + space + m_exam->userName() + br;
message += qTR("AnalyzeDialog", "level:") + space + m_exam->level()->name + br;
message += qTR("TexamSummary", "Number of questions:") + space + QString::number(m_exam->count()) + br;
Tandroid::sendExam(tr("Send exam file"), message, m_exam->fileName());
}
#endif
/*************************************************************************** /***************************************************************************
* Copyright (C) 2011-2019 by Tomasz Bojczuk * * Copyright (C) 2011-2020 by Tomasz Bojczuk *
* seelook@gmail.com * * seelook@gmail.com *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
...@@ -86,19 +86,14 @@ public: ...@@ -86,19 +86,14 @@ public:
Q_INVOKABLE int buttColumsCount() const; Q_INVOKABLE int buttColumsCount() const;
Q_INVOKABLE Texam* exam() { return m_exam; } Q_INVOKABLE Texam* exam() { return m_exam; }
#if defined (Q_OS_ANDROID)
Q_INVOKABLE void sendExam();
#endif
signals: signals:
void updateExam(); void updateExam();
protected:
// void closeSlot();
// void analyseSlot();
// void continueSlot();
// void startExamSlot();
// #if defined (Q_OS_ANDROID)
// void sendExamSlot();
// #endif
private: private:
Texam *m_exam = nullptr; Texam *m_exam = nullptr;
TlevelPreviewItem *m_levelPreview = nullptr; TlevelPreviewItem *m_levelPreview = nullptr;
......
...@@ -63,15 +63,19 @@ TexamSummary { ...@@ -63,15 +63,19 @@ TexamSummary {
onClicked: { continueExecutor(); dialLoader.close() } onClicked: { continueExecutor(); dialLoader.close() }
} }
TiconButton { TiconButton {
visible: !Noo.isAndroid() visible: !Noo.isAndroid() || !isExercise()
width: buttGrid.buttWidth width: buttGrid.buttWidth
pixmap: Noo.isAndroid() ? "" : Noo.pix("charts") pixmap: Noo.pix(Noo.isAndroid() ? "nootka-exam" : "charts")
iconHeight: summDialog.height / 15 iconHeight: summDialog.height / 15
text: qsTr("Analyze") text: Noo.isAndroid() ? Noo.TR("QShortcut", "Send") : qsTr("Analyze")
onClicked: { onClicked: {
nootkaWindow.showDialog(6) // 6 - Nootka.Charts if (Noo.isAndroid()) {
nootkaWindow.analyzeWindow.allowOpen = false sendExam()
nootkaWindow.analyzeWindow.exam = summDialog.exam() } else {
nootkaWindow.showDialog(6) // 6 - Nootka.Charts
nootkaWindow.analyzeWindow.allowOpen = false
nootkaWindow.analyzeWindow.exam = summDialog.exam()
}
} }
} }
TiconButton { TiconButton {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment