mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile: add "Copy log to clipboard" button
on iOS it is practically impossible to copy the App log to e.g. a mail! in iOS 11 the log file is stored within the subsurface container and you first need to copy (actually using the clipboard) out from there to the "normal" document shared space, before it can be used. At least iOS users (and I believe Android users) are not really used to work with files, so the process is not easy to document in an understandable way. The alternative is to provide a button, which simply puts the log on the general clipboard, allowing it to be pasted in a multitud of applications. Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
2a0ee09cb2
commit
a181020b19
5 changed files with 32 additions and 0 deletions
|
@ -12,12 +12,14 @@
|
|||
#include <QElapsedTimer>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QClipboard>
|
||||
|
||||
#include <QBluetoothLocalDevice>
|
||||
|
||||
#include "qt-models/divelistmodel.h"
|
||||
#include "qt-models/gpslistmodel.h"
|
||||
#include "qt-models/completionmodels.h"
|
||||
#include "qt-models/messagehandlermodel.h"
|
||||
#include "core/divelist.h"
|
||||
#include "core/device.h"
|
||||
#include "core/pref.h"
|
||||
|
@ -332,6 +334,16 @@ void QMLManager::cancelCredentialsPinSetup()
|
|||
setShowPin(false);
|
||||
}
|
||||
|
||||
void QMLManager::copyAppLogToClipboard()
|
||||
{
|
||||
/*
|
||||
* The user clicked the button, so copy the log file
|
||||
* to the clipboard for easy access
|
||||
*/
|
||||
QString copyString = MessageHandlerModel::self()->logAsString();
|
||||
QApplication::clipboard()->setText(copyString, QClipboard::Clipboard);
|
||||
}
|
||||
|
||||
void QMLManager::finishSetup()
|
||||
{
|
||||
// Initialize cloud credentials.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue