mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 09:16:05 +03:00
Merge pull request #16971 from Chocobo1/dialog
Move stacktrace dialog to gui folder
This commit is contained in:
commit
88a91e0769
10 changed files with 73 additions and 84 deletions
|
@ -107,21 +107,6 @@ if (STACKTRACE)
|
|||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_sources(qbt_app PRIVATE stacktrace_win.h)
|
||||
|
||||
if (GUI)
|
||||
qt_wrap_ui(STACKTRACE_UI_HEADERS stacktracedialog.ui)
|
||||
|
||||
target_sources(qbt_app PRIVATE
|
||||
stacktracedialog.h
|
||||
stacktracedialog.cpp
|
||||
${STACKTRACE_UI_HEADERS}
|
||||
)
|
||||
|
||||
# UI headers will be generated in ${CMAKE_CURRENT_BINARY_DIR}
|
||||
target_include_directories(qbt_app PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
# i686 arch on Windows requires frame pointer preservation
|
||||
if (MSVC)
|
||||
target_compile_options(qbt_app PRIVATE /Zi)
|
||||
|
|
|
@ -23,12 +23,7 @@ stacktrace {
|
|||
unix {
|
||||
HEADERS += $$PWD/stacktrace.h
|
||||
}
|
||||
else {
|
||||
win32 {
|
||||
HEADERS += $$PWD/stacktrace_win.h
|
||||
!nogui {
|
||||
HEADERS += $$PWD/stacktracedialog.h
|
||||
SOURCES += $$PWD/stacktracedialog.cpp
|
||||
FORMS += $$PWD/stacktracedialog.ui
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
#else
|
||||
#include "stacktrace_win.h"
|
||||
#ifndef DISABLE_GUI
|
||||
#include "stacktracedialog.h"
|
||||
#include "gui/stacktracedialog.h"
|
||||
#endif // DISABLE_GUI
|
||||
#endif // Q_OS_UNIX
|
||||
#endif //STACKTRACE
|
||||
|
@ -120,7 +120,7 @@ namespace
|
|||
|
||||
#if defined Q_OS_WIN && !defined DISABLE_GUI
|
||||
StacktraceDialog dlg; // unsafe
|
||||
dlg.setStacktraceString(QString::fromLatin1(sigName), straceWin::getBacktrace());
|
||||
dlg.setText(QString::fromLatin1(sigName), straceWin::getBacktrace());
|
||||
dlg.exec();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>StacktraceDialog</class>
|
||||
<widget class="QDialog" name="StacktraceDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Crash info</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="errorText">
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -2275,8 +2275,6 @@ nonstd::expected<lt::entry, QString> TorrentImpl::exportTorrent() const
|
|||
{
|
||||
return nonstd::make_unexpected(QString::fromLocal8Bit(err.what()));
|
||||
}
|
||||
|
||||
return nonstd::make_unexpected(tr("Unexpected error"));
|
||||
}
|
||||
|
||||
nonstd::expected<QByteArray, QString> TorrentImpl::exportToBuffer() const
|
||||
|
|
|
@ -221,6 +221,16 @@ if (DBUS)
|
|||
)
|
||||
endif()
|
||||
|
||||
if (STACKTRACE)
|
||||
qt_wrap_ui(STACKTRACE_UI_HEADERS stacktracedialog.ui)
|
||||
|
||||
target_sources(qbt_gui PRIVATE
|
||||
stacktracedialog.h
|
||||
stacktracedialog.cpp
|
||||
${STACKTRACE_UI_HEADERS}
|
||||
)
|
||||
endif()
|
||||
|
||||
if ((CMAKE_SYSTEM_NAME STREQUAL "Windows") OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
|
||||
target_sources(qbt_gui PRIVATE
|
||||
programupdater.h
|
||||
|
|
|
@ -163,26 +163,6 @@ SOURCES += \
|
|||
$$PWD/watchedfolderoptionsdialog.cpp \
|
||||
$$PWD/watchedfoldersmodel.cpp
|
||||
|
||||
win32|macx {
|
||||
HEADERS += $$PWD/programupdater.h
|
||||
SOURCES += $$PWD/programupdater.cpp
|
||||
}
|
||||
|
||||
unix:!macx:dbus {
|
||||
HEADERS += \
|
||||
$$PWD/powermanagement/powermanagement_x11.h \
|
||||
$$PWD/qtnotify/notifications.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/powermanagement/powermanagement_x11.cpp \
|
||||
$$PWD/qtnotify/notifications.cpp
|
||||
}
|
||||
|
||||
macx {
|
||||
HEADERS += $$PWD/macutilities.h
|
||||
OBJECTIVE_SOURCES += $$PWD/macutilities.mm
|
||||
}
|
||||
|
||||
FORMS += \
|
||||
$$PWD/aboutdialog.ui \
|
||||
$$PWD/addnewtorrentdialog.ui \
|
||||
|
@ -215,3 +195,31 @@ FORMS += \
|
|||
$$PWD/watchedfolderoptionsdialog.ui
|
||||
|
||||
RESOURCES += $$PWD/about.qrc
|
||||
|
||||
stacktrace {
|
||||
!unix {
|
||||
HEADERS += $$PWD/stacktracedialog.h
|
||||
SOURCES += $$PWD/stacktracedialog.cpp
|
||||
FORMS += $$PWD/stacktracedialog.ui
|
||||
}
|
||||
}
|
||||
|
||||
win32|macx {
|
||||
HEADERS += $$PWD/programupdater.h
|
||||
SOURCES += $$PWD/programupdater.cpp
|
||||
}
|
||||
|
||||
unix:!macx:dbus {
|
||||
HEADERS += \
|
||||
$$PWD/powermanagement/powermanagement_x11.h \
|
||||
$$PWD/qtnotify/notifications.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/powermanagement/powermanagement_x11.cpp \
|
||||
$$PWD/qtnotify/notifications.cpp
|
||||
}
|
||||
|
||||
macx {
|
||||
HEADERS += $$PWD/macutilities.h
|
||||
OBJECTIVE_SOURCES += $$PWD/macutilities.mm
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ StacktraceDialog::~StacktraceDialog()
|
|||
delete m_ui;
|
||||
}
|
||||
|
||||
void StacktraceDialog::setStacktraceString(const QString &sigName, const QString &trace)
|
||||
void StacktraceDialog::setText(const QString &signalName, const QString &stacktrace)
|
||||
{
|
||||
// try to call Qt function as less as possible
|
||||
const QString htmlStr = QStringLiteral(
|
||||
|
@ -78,8 +78,8 @@ void StacktraceDialog::setStacktraceString(const QString &sigName, const QString
|
|||
, Utils::Misc::opensslVersionString()
|
||||
, Utils::Misc::zlibVersionString()
|
||||
, Utils::Misc::osName()
|
||||
, sigName
|
||||
, trace);
|
||||
, signalName
|
||||
, stacktrace);
|
||||
|
||||
m_ui->errorText->setHtml(htmlStr);
|
||||
}
|
|
@ -45,7 +45,7 @@ public:
|
|||
explicit StacktraceDialog(QWidget *parent = nullptr);
|
||||
~StacktraceDialog() override;
|
||||
|
||||
void setStacktraceString(const QString &sigName, const QString &trace);
|
||||
void setText(const QString &signalName, const QString &stacktrace);
|
||||
|
||||
private:
|
||||
Ui::StacktraceDialog *m_ui;
|
28
src/gui/stacktracedialog.ui
Normal file
28
src/gui/stacktracedialog.ui
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>StacktraceDialog</class>
|
||||
<widget class="QDialog" name="StacktraceDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Crash info</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="errorText">
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in a new issue