* 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:
Alexandre Deckner
2009-10-07 00:12:25 +00:00
parent 60cdc210a8
commit d12a4384f1
5 changed files with 28 additions and 17 deletions
+17 -6
View File
@@ -14,11 +14,9 @@
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;
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;
}
+5 -4
View File
@@ -12,15 +12,16 @@
#include <Application.h>
class App: public BApplication {
protected:
BWindow* fMainWindow;
public:
App();
~App();
virtual ~App();
virtual void ReadyToRun();
virtual void AboutRequested();
virtual void MessageReceived(BMessage *message);
virtual bool QuitRequested();
protected:
BWindow* fMainWindow;
};
#endif /* _APP_H */
+3 -1
View File
@@ -6,7 +6,7 @@
* 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 {
major = 1,
@@ -20,6 +20,8 @@ resource app_version {
long_info = "Haiku3d ©2009 Haiku, Inc."
};
resource app_flags B_SINGLE_LAUNCH;
resource vector_icon {
$"6E6369660603040E0B02001602380BBEBE16B13FA2DA398FCAC733EC49EB0A00"
$"C0FFFF020016023F09763F2172BEF5F53EDF474C8602C9BA65008DFFFF020016"
+2 -5
View File
@@ -35,16 +35,13 @@ MainWindow::~MainWindow()
bool
MainWindow::QuitRequested()
{
be_app->Lock();
if (be_app->CountWindows() < 2)
be_app_messenger.SendMessage(B_QUIT_REQUESTED);
be_app->Unlock();
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}
void
MainWindow::MessageReceived(BMessage *message)
MainWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
default:
+1 -1
View File
@@ -18,7 +18,7 @@ public:
~MainWindow();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
virtual void MessageReceived(BMessage* message);
virtual void DirectConnected(direct_buffer_info* info);
protected: