Fix compilation when !ENABLE_UI

This commit is contained in:
David Capello 2020-03-09 10:59:28 -03:00
parent 14c046573a
commit afefac73bd
3 changed files with 19 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# Aseprite
# Copyright (C) 2018-2019 Igara Studio S.A.
# Copyright (C) 2018-2020 Igara Studio S.A.
# Copyright (C) 2001-2018 David Capello
# Generate a ui::Widget for each widget in a XML file
@ -300,7 +300,6 @@ if(ENABLE_UI)
modules/editors.cpp
modules/gfx.cpp
modules/gui.cpp
send_crash.cpp
ui/app_menuitem.cpp
ui/backup_indicator.cpp
ui/browser_view.cpp
@ -571,6 +570,7 @@ add_library(app-lib
res/resources_loader.cpp
resource_finder.cpp
restore_visible_layers.cpp
send_crash.cpp
shade.cpp
site.cpp
snap_to_grid.cpp

View File

@ -59,7 +59,9 @@ void SendCrash::search()
base::is_file(m_dumpFilename)) {
auto app = App::instance();
app->memoryDumpFilename(m_dumpFilename);
#ifdef ENABLE_UI
app->showNotification(this);
#endif
}
#elif defined(__APPLE__)
@ -93,7 +95,9 @@ void SendCrash::search()
m_dumpFilename = fn;
if (auto app = App::instance()) {
app->memoryDumpFilename(fn);
#ifdef ENABLE_UI
app->showNotification(this);
#endif
}
});
}
@ -104,6 +108,8 @@ void SendCrash::search()
#endif
}
#ifdef ENABLE_UI
std::string SendCrash::notificationText()
{
return "Report last crash";
@ -163,4 +169,6 @@ void SendCrash::onClickDevFilename()
base::launcher::open_file(m_dumpFilename);
}
#endif // ENABLE_UI
} // namespace app

View File

@ -16,7 +16,11 @@
namespace app {
class SendCrash : public INotificationDelegate {
class SendCrash
#ifdef ENABLE_UI
: public INotificationDelegate
#endif
{
public:
static std::string DefaultMemoryDumpFilename();
@ -24,13 +28,17 @@ namespace app {
void search();
#ifdef ENABLE_UI
public: // INotificationDelegate impl
virtual std::string notificationText() override;
virtual void notificationClick() override;
private:
void onClickFilename();
void onClickDevFilename();
#endif // ENABLE_UI
private:
Task m_task;
std::string m_dumpFilename;
};