mirror of https://github.com/procxx/kepka.git
windows and os x crash reports sent and shown
This commit is contained in:
parent
12716a8c40
commit
d28483fad4
|
@ -44,6 +44,8 @@ AboutBox::AboutBox() : AbstractBox(st::aboutWidth)
|
||||||
connect(&_done, SIGNAL(clicked()), this, SLOT(onClose()));
|
connect(&_done, SIGNAL(clicked()), this, SLOT(onClose()));
|
||||||
|
|
||||||
prepare();
|
prepare();
|
||||||
|
|
||||||
|
setAcceptDrops(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AboutBox::hideAll() {
|
void AboutBox::hideAll() {
|
||||||
|
@ -105,6 +107,30 @@ void AboutBox::paintEvent(QPaintEvent *e) {
|
||||||
paintTitle(p, qsl("Telegram Desktop"));
|
paintTitle(p, qsl("Telegram Desktop"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString _getCrashReportFile(const QMimeData *m) {
|
||||||
|
if (!m || m->urls().size() != 1) return QString();
|
||||||
|
|
||||||
|
QString file(m->urls().at(0).toLocalFile());
|
||||||
|
if (file.startsWith(qsl("/.file/id="))) file = psConvertFileUrl(file);
|
||||||
|
|
||||||
|
return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AboutBox::dragEnterEvent(QDragEnterEvent *e) {
|
||||||
|
if (!_getCrashReportFile(e->mimeData()).isEmpty()) {
|
||||||
|
e->setDropAction(Qt::CopyAction);
|
||||||
|
e->accept();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AboutBox::dropEvent(QDropEvent *e) {
|
||||||
|
if (!_getCrashReportFile(e->mimeData()).isEmpty()) {
|
||||||
|
e->acceptProposedAction();
|
||||||
|
psExecTelegram(_getCrashReportFile(e->mimeData()));
|
||||||
|
App::quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString telegramFaqLink() {
|
QString telegramFaqLink() {
|
||||||
QString result = qsl("https://telegram.org/faq");
|
QString result = qsl("https://telegram.org/faq");
|
||||||
if (cLang() > languageDefault && cLang() < languageCount) {
|
if (cLang() > languageDefault && cLang() < languageCount) {
|
||||||
|
|
|
@ -31,7 +31,10 @@ public:
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
void keyPressEvent(QKeyEvent *e);
|
void keyPressEvent(QKeyEvent *e);
|
||||||
void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e);
|
||||||
|
|
||||||
|
void dragEnterEvent(QDragEnterEvent *e);
|
||||||
|
void dropEvent(QDropEvent *e);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void onVersion();
|
void onVersion();
|
||||||
|
|
|
@ -4804,22 +4804,7 @@ void HistoryWidget::onDocumentSelect() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString _getCrashReportFile(const QMimeData *m) {
|
|
||||||
if (!m || m->urls().size() != 1) return QString();
|
|
||||||
|
|
||||||
QString file(m->urls().at(0).toLocalFile());
|
|
||||||
if (file.startsWith(qsl("/.file/id="))) file = psConvertFileUrl(file);
|
|
||||||
|
|
||||||
return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) {
|
void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) {
|
||||||
if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) {
|
|
||||||
e->setDropAction(Qt::CopyAction);
|
|
||||||
e->accept();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_history) return;
|
if (!_history) return;
|
||||||
|
|
||||||
if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return;
|
if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return;
|
||||||
|
@ -5141,13 +5126,6 @@ bool HistoryWidget::kbWasHidden() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::dropEvent(QDropEvent *e) {
|
void HistoryWidget::dropEvent(QDropEvent *e) {
|
||||||
if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) {
|
|
||||||
e->acceptProposedAction();
|
|
||||||
psExecTelegram(_getCrashReportFile(e->mimeData()));
|
|
||||||
App::quit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_attachDrag = DragStateNone;
|
_attachDrag = DragStateNone;
|
||||||
updateDragAreas();
|
updateDragAreas();
|
||||||
e->acceptProposedAction();
|
e->acceptProposedAction();
|
||||||
|
|
|
@ -596,11 +596,15 @@ namespace SignalHandlers {
|
||||||
return _writeNumber(stream, num);
|
return _writeNumber(stream, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
const dump &operator<<(const dump &stream, uint32 num) {
|
const dump &operator<<(const dump &stream, unsigned int num) {
|
||||||
return _writeNumber(stream, num);
|
return _writeNumber(stream, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
const dump &operator<<(const dump &stream, uint64 num) {
|
const dump &operator<<(const dump &stream, unsigned long num) {
|
||||||
|
return _writeNumber(stream, num);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dump &operator<<(const dump &stream, unsigned long long num) {
|
||||||
return _writeNumber(stream, num);
|
return _writeNumber(stream, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,10 +93,10 @@ namespace SignalHandlers {
|
||||||
};
|
};
|
||||||
const dump &operator<<(const dump &stream, const char *str);
|
const dump &operator<<(const dump &stream, const char *str);
|
||||||
const dump &operator<<(const dump &stream, int num);
|
const dump &operator<<(const dump &stream, int num);
|
||||||
const dump &operator<<(const dump &stream, uint32 num);
|
const dump &operator<<(const dump &stream, unsigned int num);
|
||||||
const dump &operator<<(const dump &stream, uint64 num);
|
const dump &operator<<(const dump &stream, unsigned long num);
|
||||||
|
const dump &operator<<(const dump &stream, unsigned long long num);
|
||||||
const dump &operator<<(const dump &stream, double num);
|
const dump &operator<<(const dump &stream, double num);
|
||||||
|
|
||||||
enum Status {
|
enum Status {
|
||||||
CantOpen,
|
CantOpen,
|
||||||
LastCrashed,
|
LastCrashed,
|
||||||
|
|
Loading…
Reference in New Issue