* Fixed closing via deskbar's close all. The problem was that i forgot to
define the app_flags in the rdef, case that isn't well handled apparently when creating a BMessenger targeting the app. Thanks to Michael and Rene for helping! Fixes #4712 * Removed unneeded and faulty App::MessageReceived and a strange (probably copy pasted then forgotten) MainWindow::QuitRequested. * Minor changes. Made App destructor virtual, moved init into ReadyToRun, fixed a few style violations. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33474 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,11 +14,9 @@
|
|||||||
|
|
||||||
App::App()
|
App::App()
|
||||||
:
|
:
|
||||||
BApplication("application/x-vnd.Haiku-Haiku3d")
|
BApplication("application/x-vnd.Haiku-Haiku3d"),
|
||||||
|
fMainWindow(NULL)
|
||||||
{
|
{
|
||||||
BRect frame(50, 50, 640 + 50, 480 + 50);
|
|
||||||
const char *title = "Haiku3d";
|
|
||||||
fMainWindow = new MainWindow(frame, title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -27,7 +25,18 @@ App::~App()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void App::AboutRequested()
|
void
|
||||||
|
App::ReadyToRun()
|
||||||
|
{
|
||||||
|
BRect frame(50, 50, 640 + 50, 480 + 50);
|
||||||
|
const char* title = "Haiku3d";
|
||||||
|
fMainWindow = new MainWindow(frame, title);
|
||||||
|
fMainWindow->Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
App::AboutRequested()
|
||||||
{
|
{
|
||||||
BAlert* alert;
|
BAlert* alert;
|
||||||
alert = new BAlert("About", "A little 3d demo", "ok");
|
alert = new BAlert("About", "A little 3d demo", "ok");
|
||||||
@@ -35,8 +44,10 @@ void App::AboutRequested()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void App::MessageReceived(BMessage *message)
|
bool
|
||||||
|
App::QuitRequested()
|
||||||
{
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,16 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
class App: public BApplication {
|
class App: public BApplication {
|
||||||
protected:
|
|
||||||
BWindow* fMainWindow;
|
|
||||||
public:
|
public:
|
||||||
App();
|
App();
|
||||||
~App();
|
virtual ~App();
|
||||||
|
|
||||||
|
virtual void ReadyToRun();
|
||||||
virtual void AboutRequested();
|
virtual void AboutRequested();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual bool QuitRequested();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
BWindow* fMainWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _APP_H */
|
#endif /* _APP_H */
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* Alexandre Deckner [email protected]
|
* Alexandre Deckner [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.Haiku-Haiku3d";
|
resource app_signature "application/x-vnd.Haiku-Haiku3d";
|
||||||
|
|
||||||
resource app_version {
|
resource app_version {
|
||||||
major = 1,
|
major = 1,
|
||||||
@@ -20,6 +20,8 @@ resource app_version {
|
|||||||
long_info = "Haiku3d ©2009 Haiku, Inc."
|
long_info = "Haiku3d ©2009 Haiku, Inc."
|
||||||
};
|
};
|
||||||
|
|
||||||
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|
||||||
resource vector_icon {
|
resource vector_icon {
|
||||||
$"6E6369660603040E0B02001602380BBEBE16B13FA2DA398FCAC733EC49EB0A00"
|
$"6E6369660603040E0B02001602380BBEBE16B13FA2DA398FCAC733EC49EB0A00"
|
||||||
$"C0FFFF020016023F09763F2172BEF5F53EDF474C8602C9BA65008DFFFF020016"
|
$"C0FFFF020016023F09763F2172BEF5F53EDF474C8602C9BA65008DFFFF020016"
|
||||||
|
|||||||
@@ -35,10 +35,7 @@ MainWindow::~MainWindow()
|
|||||||
bool
|
bool
|
||||||
MainWindow::QuitRequested()
|
MainWindow::QuitRequested()
|
||||||
{
|
{
|
||||||
be_app->Lock();
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
if (be_app->CountWindows() < 2)
|
|
||||||
be_app_messenger.SendMessage(B_QUIT_REQUESTED);
|
|
||||||
be_app->Unlock();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user