mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 18:40:57 +00:00
Add a notification to report the last crash
This commit is contained in:
parent
6bafe23ed7
commit
44c6f9400e
@ -22,6 +22,9 @@
|
|||||||
<combobox id="screen_scale" />
|
<combobox id="screen_scale" />
|
||||||
</hbox>
|
</hbox>
|
||||||
<check text="Show timeline automatically" id="autotimeline" tooltip="Show the timeline automatically when a new frame or layer is added." />
|
<check text="Show timeline automatically" id="autotimeline" tooltip="Show the timeline automatically when a new frame or layer is added." />
|
||||||
|
<separator horizontal="true" />
|
||||||
|
<link id="locate_file" text="Locate Configuration File" />
|
||||||
|
<link id="locate_crash_folder" text="Locate Crash Folder" />
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
<!-- Editor -->
|
<!-- Editor -->
|
||||||
@ -90,7 +93,6 @@
|
|||||||
</hbox>
|
</hbox>
|
||||||
<separator horizontal="true" />
|
<separator horizontal="true" />
|
||||||
<hbox>
|
<hbox>
|
||||||
<link id="locate_file" text="Locate File" />
|
|
||||||
<boxfiller />
|
<boxfiller />
|
||||||
<hbox homogeneous="true">
|
<hbox homogeneous="true">
|
||||||
<button text="&OK" closewindow="true" id="button_ok" magnet="true" width="60" />
|
<button text="&OK" closewindow="true" id="button_ok" magnet="true" width="60" />
|
||||||
|
19
data/widgets/send_crash.xml
Normal file
19
data/widgets/send_crash.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!-- Aseprite -->
|
||||||
|
<!-- Copyright (C) 2014 by David Capello -->
|
||||||
|
<gui>
|
||||||
|
<window text="Crash Report" id="send_crash">
|
||||||
|
<vbox>
|
||||||
|
|
||||||
|
<label text="Please send the following file:" />
|
||||||
|
<link id="filename" text="" url="" />
|
||||||
|
<label text="to this email:" />
|
||||||
|
<entry readonly="true" text="support@aseprite.org" maxsize="256" />
|
||||||
|
<label text="explaining what you was doing when the program crashed." />
|
||||||
|
|
||||||
|
<separator horizontal="true" />
|
||||||
|
|
||||||
|
<button text="Do it later" closewindow="true" />
|
||||||
|
<button id="delete_file" text="Delete file, I've already sent it" closewindow="true" />
|
||||||
|
</vbox>
|
||||||
|
</window>
|
||||||
|
</gui>
|
@ -144,6 +144,7 @@ add_library(app-lib
|
|||||||
res/palettes_loader_delegate.cpp
|
res/palettes_loader_delegate.cpp
|
||||||
res/resources_loader.cpp
|
res/resources_loader.cpp
|
||||||
resource_finder.cpp
|
resource_finder.cpp
|
||||||
|
send_crash.cpp
|
||||||
settings/ui_settings_impl.cpp
|
settings/ui_settings_impl.cpp
|
||||||
shell.cpp
|
shell.cpp
|
||||||
thumbnail_generator.cpp
|
thumbnail_generator.cpp
|
||||||
@ -186,9 +187,9 @@ add_library(app-lib
|
|||||||
ui/main_window.cpp
|
ui/main_window.cpp
|
||||||
ui/mini_editor.cpp
|
ui/mini_editor.cpp
|
||||||
ui/notifications.cpp
|
ui/notifications.cpp
|
||||||
ui/palettes_listbox.cpp
|
|
||||||
ui/palette_popup.cpp
|
ui/palette_popup.cpp
|
||||||
ui/palette_view.cpp
|
ui/palette_view.cpp
|
||||||
|
ui/palettes_listbox.cpp
|
||||||
ui/popup_window_pin.cpp
|
ui/popup_window_pin.cpp
|
||||||
ui/resources_listbox.cpp
|
ui/resources_listbox.cpp
|
||||||
ui/skin/button_icon_impl.cpp
|
ui/skin/button_icon_impl.cpp
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "app/modules/palettes.h"
|
#include "app/modules/palettes.h"
|
||||||
#include "app/recent_files.h"
|
#include "app/recent_files.h"
|
||||||
#include "app/resource_finder.h"
|
#include "app/resource_finder.h"
|
||||||
|
#include "app/send_crash.h"
|
||||||
#include "app/settings/settings.h"
|
#include "app/settings/settings.h"
|
||||||
#include "app/shell.h"
|
#include "app/shell.h"
|
||||||
#include "app/tools/tool_box.h"
|
#include "app/tools/tool_box.h"
|
||||||
@ -71,6 +72,7 @@
|
|||||||
#include "ui/intern.h"
|
#include "ui/intern.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -258,6 +260,9 @@ int App::run()
|
|||||||
webServer.start();
|
webServer.start();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
app::SendCrash sendCrash;
|
||||||
|
sendCrash.search();
|
||||||
|
|
||||||
// Run the GUI main message loop
|
// Run the GUI main message loop
|
||||||
gui_run();
|
gui_run();
|
||||||
|
|
||||||
@ -346,9 +351,9 @@ RecentFiles* App::getRecentFiles() const
|
|||||||
return &m_modules->m_recent_files;
|
return &m_modules->m_recent_files;
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::showNotification(const char* text, const char* url)
|
void App::showNotification(INotificationDelegate* del)
|
||||||
{
|
{
|
||||||
m_mainWindow->showNotification(text, url);
|
m_mainWindow->showNotification(del);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates palette and redraw the screen.
|
// Updates palette and redraw the screen.
|
||||||
|
@ -40,8 +40,10 @@ namespace raster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|
||||||
class Document;
|
class Document;
|
||||||
class DocumentExporter;
|
class DocumentExporter;
|
||||||
|
class INotificationDelegate;
|
||||||
class LegacyModules;
|
class LegacyModules;
|
||||||
class LoggerModule;
|
class LoggerModule;
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
@ -71,7 +73,7 @@ namespace app {
|
|||||||
RecentFiles* getRecentFiles() const;
|
RecentFiles* getRecentFiles() const;
|
||||||
MainWindow* getMainWindow() const { return m_mainWindow; }
|
MainWindow* getMainWindow() const { return m_mainWindow; }
|
||||||
|
|
||||||
void showNotification(const char* text, const char* url);
|
void showNotification(INotificationDelegate* del);
|
||||||
|
|
||||||
// App Signals
|
// App Signals
|
||||||
Signal0<void> Exit;
|
Signal0<void> Exit;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
#include "app/ini_file.h"
|
#include "app/ini_file.h"
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
|
#include "base/launcher.h"
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -169,7 +170,7 @@ void CheckUpdateThreadLauncher::onMonitoringTick()
|
|||||||
|
|
||||||
case updater::CheckUpdateResponse::Critical:
|
case updater::CheckUpdateResponse::Critical:
|
||||||
case updater::CheckUpdateResponse::Major:
|
case updater::CheckUpdateResponse::Major:
|
||||||
App::instance()->showNotification("New Version Available!", m_response.getUrl().c_str());
|
App::instance()->showNotification(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +211,17 @@ void CheckUpdateThreadLauncher::checkForUpdates()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CheckUpdateThreadLauncher::notificationText()
|
||||||
|
{
|
||||||
|
return "New Version Available!";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CheckUpdateThreadLauncher::notificationClick()
|
||||||
|
{
|
||||||
|
if (!m_response.getUrl().empty())
|
||||||
|
base::launcher::open_url(m_response.getUrl());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ENABLE_UPDATER
|
#endif // ENABLE_UPDATER
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_UPDATER
|
#ifdef ENABLE_UPDATER
|
||||||
|
|
||||||
|
#include "app/notification_delegate.h"
|
||||||
#include "base/thread.h"
|
#include "base/thread.h"
|
||||||
#include "base/unique_ptr.h"
|
#include "base/unique_ptr.h"
|
||||||
#include "ui/timer.h"
|
#include "ui/timer.h"
|
||||||
@ -31,7 +32,7 @@ namespace app {
|
|||||||
|
|
||||||
class CheckUpdateBackgroundJob;
|
class CheckUpdateBackgroundJob;
|
||||||
|
|
||||||
class CheckUpdateThreadLauncher {
|
class CheckUpdateThreadLauncher : public INotificationDelegate {
|
||||||
public:
|
public:
|
||||||
CheckUpdateThreadLauncher();
|
CheckUpdateThreadLauncher();
|
||||||
~CheckUpdateThreadLauncher();
|
~CheckUpdateThreadLauncher();
|
||||||
@ -45,6 +46,9 @@ namespace app {
|
|||||||
return m_response;
|
return m_response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual std::string notificationText() override;
|
||||||
|
virtual void notificationClick() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onMonitoringTick();
|
void onMonitoringTick();
|
||||||
void checkForUpdates();
|
void checkForUpdates();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "app/load_widget.h"
|
#include "app/load_widget.h"
|
||||||
#include "app/modules/editors.h"
|
#include "app/modules/editors.h"
|
||||||
#include "app/modules/gui.h"
|
#include "app/modules/gui.h"
|
||||||
|
#include "app/resource_finder.h"
|
||||||
#include "app/settings/document_settings.h"
|
#include "app/settings/document_settings.h"
|
||||||
#include "app/settings/settings.h"
|
#include "app/settings/settings.h"
|
||||||
#include "app/ui/color_button.h"
|
#include "app/ui/color_button.h"
|
||||||
@ -114,8 +115,13 @@ public:
|
|||||||
// Reset button
|
// Reset button
|
||||||
checkedBgReset()->Click.connect(Bind<void>(&OptionsWindow::onResetCheckedBg, this));
|
checkedBgReset()->Click.connect(Bind<void>(&OptionsWindow::onResetCheckedBg, this));
|
||||||
|
|
||||||
// Locate config file
|
// Links
|
||||||
locateFile()->Click.connect(Bind<void>(&OptionsWindow::onLocateConfigFile, this));
|
locateFile()->Click.connect(Bind<void>(&OptionsWindow::onLocateConfigFile, this));
|
||||||
|
#if WIN32
|
||||||
|
locateCrashFolder()->Click.connect(Bind<void>(&OptionsWindow::onLocateCrashFolder, this));
|
||||||
|
#else
|
||||||
|
locateCrashFolder()->setVisible(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Undo limit
|
// Undo limit
|
||||||
undoSizeLimit()->setTextf("%d", m_settings->undoSizeLimit());
|
undoSizeLimit()->setTextf("%d", m_settings->undoSizeLimit());
|
||||||
@ -188,6 +194,12 @@ private:
|
|||||||
m_checked_bg_color2->setColor(app::Color::fromRgb(192, 192, 192));
|
m_checked_bg_color2->setColor(app::Color::fromRgb(192, 192, 192));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onLocateCrashFolder() {
|
||||||
|
app::ResourceFinder rf;
|
||||||
|
rf.includeHomeDir(".");
|
||||||
|
app::launcher::open_folder(rf.defaultFilename());
|
||||||
|
}
|
||||||
|
|
||||||
void onLocateConfigFile() {
|
void onLocateConfigFile() {
|
||||||
app::launcher::open_folder(app::get_config_file());
|
app::launcher::open_folder(app::get_config_file());
|
||||||
}
|
}
|
||||||
|
36
src/app/notification_delegate.h
Normal file
36
src/app/notification_delegate.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/* Aseprite
|
||||||
|
* Copyright (C) 2001-2014 David Capello
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef APP_NOTIFICATION_DELEGATE_H_INCLUDED
|
||||||
|
#define APP_NOTIFICATION_DELEGATE_H_INCLUDED
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace app {
|
||||||
|
|
||||||
|
class INotificationDelegate {
|
||||||
|
public:
|
||||||
|
virtual ~INotificationDelegate() { }
|
||||||
|
virtual std::string notificationText() = 0;
|
||||||
|
virtual void notificationClick() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
83
src/app/send_crash.cpp
Normal file
83
src/app/send_crash.cpp
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/* Aseprite
|
||||||
|
* Copyright (C) 2001-2014 David Capello
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "app/send_crash.h"
|
||||||
|
|
||||||
|
#include "app/app.h"
|
||||||
|
#include "app/resource_finder.h"
|
||||||
|
#include "base/bind.h"
|
||||||
|
#include "base/fs.h"
|
||||||
|
#include "base/launcher.h"
|
||||||
|
|
||||||
|
#include "generated_send_crash.h"
|
||||||
|
|
||||||
|
namespace app {
|
||||||
|
|
||||||
|
const char* SendCrash::kDefaultCrashName = "Aseprite-crash.dmp";
|
||||||
|
|
||||||
|
void SendCrash::search()
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
app::ResourceFinder rf;
|
||||||
|
rf.includeHomeDir(kDefaultCrashName);
|
||||||
|
m_dumpFilename = rf.defaultFilename();
|
||||||
|
|
||||||
|
if (base::is_file(m_dumpFilename)) {
|
||||||
|
App::instance()->showNotification(this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string SendCrash::notificationText()
|
||||||
|
{
|
||||||
|
return "Report last crash";
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendCrash::notificationClick()
|
||||||
|
{
|
||||||
|
if (m_dumpFilename.empty()) {
|
||||||
|
ui::Alert::show("Crash Report<<Nothing to report||&OK");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
app::gen::SendCrash dlg;
|
||||||
|
dlg.filename()->setText(m_dumpFilename);
|
||||||
|
dlg.filename()->Click.connect(Bind(&SendCrash::onClickFilename, this));
|
||||||
|
|
||||||
|
dlg.openWindowInForeground();
|
||||||
|
if (dlg.getKiller() == dlg.deleteFile()) {
|
||||||
|
try {
|
||||||
|
base::delete_file(m_dumpFilename);
|
||||||
|
m_dumpFilename = "";
|
||||||
|
}
|
||||||
|
catch (const std::exception& ex) {
|
||||||
|
ui::Alert::show("Error<<%s||&OK", ex.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendCrash::onClickFilename()
|
||||||
|
{
|
||||||
|
base::launcher::open_folder(m_dumpFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace app
|
46
src/app/send_crash.h
Normal file
46
src/app/send_crash.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/* Aseprite
|
||||||
|
* Copyright (C) 2001-2014 David Capello
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef APP_SEND_CRASH_H_INCLUDED
|
||||||
|
#define APP_SEND_CRASH_H_INCLUDED
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "app/notification_delegate.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace app {
|
||||||
|
|
||||||
|
class SendCrash : public INotificationDelegate {
|
||||||
|
public:
|
||||||
|
static const char* kDefaultCrashName;
|
||||||
|
|
||||||
|
void search();
|
||||||
|
|
||||||
|
virtual std::string notificationText() override;
|
||||||
|
virtual void notificationClick() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void onClickFilename();
|
||||||
|
|
||||||
|
std::string m_dumpFilename;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace app
|
||||||
|
|
||||||
|
#endif // APP_SEND_CRASH_H_INCLUDED
|
@ -157,9 +157,9 @@ void MainWindow::reloadMenus()
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showNotification(const char* text, const char* url)
|
void MainWindow::showNotification(INotificationDelegate* del)
|
||||||
{
|
{
|
||||||
m_notifications->addLink(text, url);
|
m_notifications->addLink(del);
|
||||||
m_notifications->setVisible(true);
|
m_notifications->setVisible(true);
|
||||||
m_notifications->getParent()->layout();
|
m_notifications->getParent()->layout();
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ namespace app {
|
|||||||
|
|
||||||
class ColorBar;
|
class ColorBar;
|
||||||
class ContextBar;
|
class ContextBar;
|
||||||
|
class INotificationDelegate;
|
||||||
class MainMenuBar;
|
class MainMenuBar;
|
||||||
class MiniEditorWindow;
|
class MiniEditorWindow;
|
||||||
class Notifications;
|
class Notifications;
|
||||||
@ -61,7 +62,7 @@ namespace app {
|
|||||||
|
|
||||||
void start();
|
void start();
|
||||||
void reloadMenus();
|
void reloadMenus();
|
||||||
void showNotification(const char* text, const char* url);
|
void showNotification(INotificationDelegate* del);
|
||||||
|
|
||||||
Mode getMode() const { return m_mode; }
|
Mode getMode() const { return m_mode; }
|
||||||
void setMode(Mode mode);
|
void setMode(Mode mode);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "app/ui/notifications.h"
|
#include "app/ui/notifications.h"
|
||||||
|
|
||||||
|
#include "app/notification_delegate.h"
|
||||||
#include "app/ui/skin/skin_theme.h"
|
#include "app/ui/skin/skin_theme.h"
|
||||||
#include "app/ui/skin/style.h"
|
#include "app/ui/skin/style.h"
|
||||||
#include "base/launcher.h"
|
#include "base/launcher.h"
|
||||||
@ -37,21 +38,19 @@ static const char* kFlag = "flag";
|
|||||||
|
|
||||||
class NotificationItem : public MenuItem {
|
class NotificationItem : public MenuItem {
|
||||||
public:
|
public:
|
||||||
NotificationItem(const char* text, const char* url)
|
NotificationItem(INotificationDelegate* del)
|
||||||
: MenuItem(text),
|
: MenuItem(del->notificationText()),
|
||||||
m_url(url) {
|
m_delegate(del) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onClick() override {
|
void onClick() override {
|
||||||
MenuItem::onClick();
|
MenuItem::onClick();
|
||||||
|
m_delegate->notificationClick();
|
||||||
if (!m_url.empty())
|
|
||||||
base::launcher::open_url(m_url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_url;
|
INotificationDelegate* m_delegate;
|
||||||
};
|
};
|
||||||
|
|
||||||
Notifications::Notifications()
|
Notifications::Notifications()
|
||||||
@ -61,9 +60,9 @@ Notifications::Notifications()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notifications::addLink(const char* text, const char* url)
|
void Notifications::addLink(INotificationDelegate* del)
|
||||||
{
|
{
|
||||||
m_popup.addChild(new NotificationItem(text, url));
|
m_popup.addChild(new NotificationItem(del));
|
||||||
m_withNotifications = true;
|
m_withNotifications = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,11 +28,13 @@ namespace app {
|
|||||||
class Style;
|
class Style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class INotificationDelegate;
|
||||||
|
|
||||||
class Notifications : public ui::Button {
|
class Notifications : public ui::Button {
|
||||||
public:
|
public:
|
||||||
Notifications();
|
Notifications();
|
||||||
|
|
||||||
void addLink(const char* text, const char* url);
|
void addLink(INotificationDelegate* del);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onPreferredSize(ui::PreferredSizeEvent& ev) override;
|
void onPreferredSize(ui::PreferredSizeEvent& ev) override;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
#include "app/console.h"
|
#include "app/console.h"
|
||||||
#include "app/resource_finder.h"
|
#include "app/resource_finder.h"
|
||||||
|
#include "app/send_crash.h"
|
||||||
#include "base/exception.h"
|
#include "base/exception.h"
|
||||||
#include "base/memory.h"
|
#include "base/memory.h"
|
||||||
#include "base/memory_dump.h"
|
#include "base/memory_dump.h"
|
||||||
@ -52,11 +53,10 @@ namespace {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
bool getMemoryDumpFilename(std::string& filename)
|
bool getMemoryDumpFilename(std::string& filename) {
|
||||||
{
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
app::ResourceFinder rf;
|
app::ResourceFinder rf;
|
||||||
rf.includeBinDir("aseprite-memory.dmp");
|
rf.includeHomeDir(app::SendCrash::kDefaultCrashName);
|
||||||
filename = rf.defaultFilename();
|
filename = rf.defaultFilename();
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user