Build fix. CID 3165 FORWARD_NULL, avoid casting be_app.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40986 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <Entry.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <TranslatorRoster.h>
|
#include <TranslatorRoster.h>
|
||||||
#include <TextView.h>
|
#include <TextView.h>
|
||||||
|
|
||||||
#include "DataTranslationsSettings.h"
|
|
||||||
#include "DataTranslationsWindow.h"
|
#include "DataTranslationsWindow.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -43,13 +43,6 @@ DataTranslationsApplication::~DataTranslationsApplication()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
DataTranslationsApplication::SetWindowCorner(const BPoint& leftTop)
|
|
||||||
{
|
|
||||||
fSettings.SetWindowCorner(leftTop);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DataTranslationsApplication::AboutRequested()
|
DataTranslationsApplication::AboutRequested()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
#include "DataTranslationsSettings.h"
|
|
||||||
|
|
||||||
|
|
||||||
class BDirectory;
|
class BDirectory;
|
||||||
class BEntry;
|
class BEntry;
|
||||||
@@ -28,18 +26,10 @@ public:
|
|||||||
virtual void RefsReceived(BMessage* message);
|
virtual void RefsReceived(BMessage* message);
|
||||||
virtual void AboutRequested();
|
virtual void AboutRequested();
|
||||||
|
|
||||||
BPoint WindowCorner() const {
|
|
||||||
return fSettings.WindowCorner();
|
|
||||||
}
|
|
||||||
void SetWindowCorner(const BPoint& leftTop);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _InstallError(const char* name, status_t status);
|
void _InstallError(const char* name, status_t status);
|
||||||
status_t _Install(BDirectory& target, BEntry& entry);
|
status_t _Install(BDirectory& target, BEntry& entry);
|
||||||
void _NoTranslatorError(const char* name);
|
void _NoTranslatorError(const char* name);
|
||||||
|
|
||||||
private:
|
|
||||||
DataTranslationsSettings fSettings;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
|
|
||||||
|
|
||||||
|
static DataTranslationsSettings sDataTranslationsSettings;
|
||||||
|
|
||||||
|
|
||||||
DataTranslationsSettings::DataTranslationsSettings()
|
DataTranslationsSettings::DataTranslationsSettings()
|
||||||
{
|
{
|
||||||
BPath path;
|
BPath path;
|
||||||
@@ -61,3 +64,10 @@ DataTranslationsSettings::SetWindowCorner(BPoint corner)
|
|||||||
{
|
{
|
||||||
fCorner = corner;
|
fCorner = corner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataTranslationsSettings*
|
||||||
|
DataTranslationsSettings::Instance()
|
||||||
|
{
|
||||||
|
return &sDataTranslationsSettings;
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public:
|
|||||||
BPoint WindowCorner() const { return fCorner; }
|
BPoint WindowCorner() const { return fCorner; }
|
||||||
void SetWindowCorner(BPoint corner);
|
void SetWindowCorner(BPoint corner);
|
||||||
|
|
||||||
|
static DataTranslationsSettings* Instance();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BPoint fCorner;
|
BPoint fCorner;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <TranslatorRoster.h>
|
#include <TranslatorRoster.h>
|
||||||
|
|
||||||
#include "DataTranslations.h"
|
#include "DataTranslations.h"
|
||||||
|
#include "DataTranslationsSettings.h"
|
||||||
#include "IconView.h"
|
#include "IconView.h"
|
||||||
#include "TranslatorListView.h"
|
#include "TranslatorListView.h"
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ DataTranslationsWindow::DataTranslationsWindow()
|
|||||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
|
||||||
| B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS)
|
| B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
MoveTo(static_cast<DataTranslationsApplication*>(be_app)->WindowCorner());
|
MoveTo(DataTranslationsSettings::Instance()->WindowCorner());
|
||||||
|
|
||||||
_SetupViews();
|
_SetupViews();
|
||||||
|
|
||||||
@@ -210,9 +211,8 @@ bool
|
|||||||
DataTranslationsWindow::QuitRequested()
|
DataTranslationsWindow::QuitRequested()
|
||||||
{
|
{
|
||||||
BPoint pt(Frame().LeftTop());
|
BPoint pt(Frame().LeftTop());
|
||||||
dynamic_cast<DataTranslationsApplication*>(be_app)->SetWindowCorner(pt);
|
DataTranslationsSettings::Instance()->SetWindowCorner(pt);
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user