added a haiku logo from stippi, thanks!
enlarged the window improves widget placement git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14419 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -54,12 +54,12 @@ CopyEngine::Start()
|
|||||||
void
|
void
|
||||||
CopyEngine::ScanDisksPartitions(BMenu *srcMenu, BMenu *dstMenu)
|
CopyEngine::ScanDisksPartitions(BMenu *srcMenu, BMenu *dstMenu)
|
||||||
{
|
{
|
||||||
BDiskDeviceRoster roster;
|
/*BDiskDeviceRoster roster;
|
||||||
BDiskDevice device;
|
BDiskDevice device;
|
||||||
roster.VisitEachDevice(this, &device);
|
roster.VisitEachDevice(this, &device);
|
||||||
|
|
||||||
BPartition *partition;
|
BPartition *partition;
|
||||||
roster.VisitEachPartition(this, &device, &partition);
|
roster.VisitEachPartition(this, &device, &partition);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
class InstallerWindow;
|
class InstallerWindow;
|
||||||
|
|
||||||
class CopyEngine : public BLooper, BDiskDeviceVisitor {
|
class CopyEngine : public BLooper/*, BDiskDeviceVisitor*/ {
|
||||||
public:
|
public:
|
||||||
CopyEngine(InstallerWindow *window);
|
CopyEngine(InstallerWindow *window);
|
||||||
void Start();
|
void Start();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
resource(1, "haikulogo.png") #'PNG ' import "haikulogo.png";
|
||||||
|
|
||||||
resource large_icon
|
resource large_icon
|
||||||
{
|
{
|
||||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ int main(int, char **)
|
|||||||
InstallerApp::InstallerApp()
|
InstallerApp::InstallerApp()
|
||||||
: BApplication(APP_SIG)
|
: BApplication(APP_SIG)
|
||||||
{
|
{
|
||||||
BRect windowFrame(0,0,332,160);
|
BRect windowFrame(0,0,INSTALLER_RIGHT, 160);
|
||||||
BRect frame = BScreen().Frame();
|
BRect frame = BScreen().Frame();
|
||||||
windowFrame.OffsetBy((frame.Width() - windowFrame.Width())/2,
|
windowFrame.OffsetBy((frame.Width() - windowFrame.Width())/2,
|
||||||
frame.Height()/2 - windowFrame.Height()/4 - 113);
|
frame.Height()/2 - windowFrame.Height()/4 - 113);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
#include <TranslationUtils.h>
|
||||||
#include "InstallerWindow.h"
|
#include "InstallerWindow.h"
|
||||||
#include "PartitionMenuItem.h"
|
#include "PartitionMenuItem.h"
|
||||||
|
|
||||||
@@ -27,19 +28,62 @@ const uint32 SRC_PARTITION = 'iSPT';
|
|||||||
const uint32 DST_PARTITION = 'iDPT';
|
const uint32 DST_PARTITION = 'iDPT';
|
||||||
const uint32 PACKAGE_CHECKBOX = 'iPCB';
|
const uint32 PACKAGE_CHECKBOX = 'iPCB';
|
||||||
|
|
||||||
|
class LogoView : public BBox {
|
||||||
|
public:
|
||||||
|
LogoView(const BRect &r);
|
||||||
|
~LogoView(void);
|
||||||
|
virtual void Draw(BRect update);
|
||||||
|
private:
|
||||||
|
BBitmap *fLogo;
|
||||||
|
BPoint fDrawPoint;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
LogoView::LogoView(const BRect &r)
|
||||||
|
: BBox(r, "logoview", B_FOLLOW_LEFT|B_FOLLOW_TOP, B_WILL_DRAW, B_NO_BORDER)
|
||||||
|
{
|
||||||
|
fLogo = BTranslationUtils::GetBitmap('PNG ', "haikulogo.png");
|
||||||
|
if (fLogo) {
|
||||||
|
fDrawPoint.x = (r.Width() - fLogo->Bounds().Width()) / 2;
|
||||||
|
fDrawPoint.y = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LogoView::~LogoView(void)
|
||||||
|
{
|
||||||
|
delete fLogo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LogoView::Draw(BRect update)
|
||||||
|
{
|
||||||
|
if (fLogo)
|
||||||
|
DrawBitmap(fLogo, fDrawPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
InstallerWindow::InstallerWindow(BRect frame_rect)
|
InstallerWindow::InstallerWindow(BRect frame_rect)
|
||||||
: BWindow(frame_rect, "Installer", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
|
: BWindow(frame_rect, "Installer", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
|
||||||
fDriveSetupLaunched(false),
|
fDriveSetupLaunched(false),
|
||||||
fCopyEngine(this)
|
fCopyEngine(this)
|
||||||
{
|
{
|
||||||
|
|
||||||
BRect bounds = Bounds();
|
BRect bounds = Bounds();
|
||||||
bounds.bottom += 1;
|
bounds.bottom += 1;
|
||||||
bounds.right += 1;
|
bounds.right += 1;
|
||||||
fBackBox = new BBox(bounds, NULL, B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER);
|
fBackBox = new BBox(bounds, NULL, B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER);
|
||||||
AddChild(fBackBox);
|
AddChild(fBackBox);
|
||||||
|
|
||||||
|
BRect logoRect = fBackBox->Bounds();
|
||||||
|
logoRect.left += 1;
|
||||||
|
logoRect.top = 12;
|
||||||
|
logoRect.right -= 226;
|
||||||
|
logoRect.bottom = logoRect.top + 46 + B_H_SCROLL_BAR_HEIGHT;
|
||||||
|
LogoView *logoView = new LogoView(logoRect);
|
||||||
|
fBackBox->AddChild(logoView);
|
||||||
|
|
||||||
BRect statusRect(bounds.left+120, bounds.top+14, bounds.right-14, bounds.top+60);
|
BRect statusRect(bounds.right-222, logoRect.top+2, bounds.right-14, logoRect.bottom - B_H_SCROLL_BAR_HEIGHT+4);
|
||||||
BRect textRect(statusRect);
|
BRect textRect(statusRect);
|
||||||
textRect.OffsetTo(B_ORIGIN);
|
textRect.OffsetTo(B_ORIGIN);
|
||||||
textRect.InsetBy(2,2);
|
textRect.InsetBy(2,2);
|
||||||
@@ -56,7 +100,7 @@ InstallerWindow::InstallerWindow(BRect frame_rect)
|
|||||||
fBeginButton->MakeDefault(true);
|
fBeginButton->MakeDefault(true);
|
||||||
fBackBox->AddChild(fBeginButton);
|
fBackBox->AddChild(fBeginButton);
|
||||||
|
|
||||||
fSetupButton = new BButton(BRect(bounds.left+11, bounds.bottom-35, bounds.left+111, bounds.bottom-22),
|
fSetupButton = new BButton(BRect(bounds.left+11, bounds.bottom-35, bounds.left+121, bounds.bottom-22),
|
||||||
"setup_button", "Setup partitions" B_UTF8_ELLIPSIS, new BMessage(SETUP_MESSAGE), B_FOLLOW_LEFT|B_FOLLOW_BOTTOM);
|
"setup_button", "Setup partitions" B_UTF8_ELLIPSIS, new BMessage(SETUP_MESSAGE), B_FOLLOW_LEFT|B_FOLLOW_BOTTOM);
|
||||||
fBackBox->AddChild(fSetupButton);
|
fBackBox->AddChild(fSetupButton);
|
||||||
fSetupButton->Hide();
|
fSetupButton->Hide();
|
||||||
@@ -67,7 +111,7 @@ InstallerWindow::InstallerWindow(BRect frame_rect)
|
|||||||
fBackBox->AddChild(fPackagesScrollView);
|
fBackBox->AddChild(fPackagesScrollView);
|
||||||
fPackagesScrollView->Hide();
|
fPackagesScrollView->Hide();
|
||||||
|
|
||||||
fDrawButton = new DrawButton(BRect(bounds.left+12, bounds.bottom-33, bounds.left+100, bounds.bottom-20),
|
fDrawButton = new DrawButton(BRect(bounds.left+12, bounds.bottom-33, bounds.left+120, bounds.bottom-20),
|
||||||
"options_button", "Fewer options", "More options", new BMessage(SHOW_BOTTOM_MESSAGE));
|
"options_button", "Fewer options", "More options", new BMessage(SHOW_BOTTOM_MESSAGE));
|
||||||
fBackBox->AddChild(fDrawButton);
|
fBackBox->AddChild(fDrawButton);
|
||||||
|
|
||||||
@@ -77,14 +121,14 @@ InstallerWindow::InstallerWindow(BRect frame_rect)
|
|||||||
BRect fieldRect(bounds.left+50, bounds.top+70, bounds.right-13, bounds.top+90);
|
BRect fieldRect(bounds.left+50, bounds.top+70, bounds.right-13, bounds.top+90);
|
||||||
fSrcMenuField = new BMenuField(fieldRect, "srcMenuField",
|
fSrcMenuField = new BMenuField(fieldRect, "srcMenuField",
|
||||||
"Install from: ", fSrcMenu);
|
"Install from: ", fSrcMenu);
|
||||||
fSrcMenuField->SetDivider(70.0);
|
fSrcMenuField->SetDivider(bounds.right-274);
|
||||||
fSrcMenuField->SetAlignment(B_ALIGN_RIGHT);
|
fSrcMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||||
fBackBox->AddChild(fSrcMenuField);
|
fBackBox->AddChild(fSrcMenuField);
|
||||||
|
|
||||||
fieldRect.OffsetBy(0,23);
|
fieldRect.OffsetBy(0,23);
|
||||||
fDestMenuField = new BMenuField(fieldRect, "destMenuField",
|
fDestMenuField = new BMenuField(fieldRect, "destMenuField",
|
||||||
"Onto: ", fDestMenu);
|
"Onto: ", fDestMenu);
|
||||||
fDestMenuField->SetDivider(70.0);
|
fDestMenuField->SetDivider(bounds.right-274);
|
||||||
fDestMenuField->SetAlignment(B_ALIGN_RIGHT);
|
fDestMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||||
fBackBox->AddChild(fDestMenuField);
|
fBackBox->AddChild(fDestMenuField);
|
||||||
|
|
||||||
@@ -92,7 +136,7 @@ InstallerWindow::InstallerWindow(BRect frame_rect)
|
|||||||
sizeRect.top = 105;
|
sizeRect.top = 105;
|
||||||
sizeRect.bottom = sizeRect.top + 15;
|
sizeRect.bottom = sizeRect.top + 15;
|
||||||
sizeRect.right -= 12;
|
sizeRect.right -= 12;
|
||||||
sizeRect.left = sizeRect.right - 150;
|
sizeRect.left = sizeRect.right - 170;
|
||||||
fSizeView = new BStringView(sizeRect, "size_view", "Disk space required: 0.0 KB", B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
fSizeView = new BStringView(sizeRect, "size_view", "Disk space required: 0.0 KB", B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
fSizeView->SetAlignment(B_ALIGN_RIGHT);
|
fSizeView->SetAlignment(B_ALIGN_RIGHT);
|
||||||
fBackBox->AddChild(fSizeView);
|
fBackBox->AddChild(fSizeView);
|
||||||
@@ -173,7 +217,7 @@ void
|
|||||||
InstallerWindow::ShowBottom()
|
InstallerWindow::ShowBottom()
|
||||||
{
|
{
|
||||||
if (fDrawButton->Value()) {
|
if (fDrawButton->Value()) {
|
||||||
ResizeTo(332,306);
|
ResizeTo(INSTALLER_RIGHT, 306);
|
||||||
if (fSetupButton->IsHidden())
|
if (fSetupButton->IsHidden())
|
||||||
fSetupButton->Show();
|
fSetupButton->Show();
|
||||||
if (fPackagesScrollView->IsHidden())
|
if (fPackagesScrollView->IsHidden())
|
||||||
@@ -187,7 +231,7 @@ InstallerWindow::ShowBottom()
|
|||||||
fPackagesScrollView->Hide();
|
fPackagesScrollView->Hide();
|
||||||
if (!fSizeView->IsHidden())
|
if (!fSizeView->IsHidden())
|
||||||
fSizeView->Hide();
|
fSizeView->Hide();
|
||||||
ResizeTo(332,160);
|
ResizeTo(INSTALLER_RIGHT, 160);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +280,7 @@ InstallerWindow::StartScan()
|
|||||||
fSrcMenu->ItemAt(0)->SetMarked(true);
|
fSrcMenu->ItemAt(0)->SetMarked(true);
|
||||||
PublishPackages();
|
PublishPackages();
|
||||||
}
|
}
|
||||||
SetStatusMessage("Choose the disk you want to install onto\nfrom the pop-up menu. Then click \"Begin\".");
|
SetStatusMessage("Choose the disk you want to install onto from the pop-up menu. Then click \"Begin\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#include "DrawButton.h"
|
#include "DrawButton.h"
|
||||||
#include "PackageViews.h"
|
#include "PackageViews.h"
|
||||||
|
|
||||||
|
#define INSTALLER_RIGHT 402
|
||||||
|
|
||||||
class InstallerWindow : public BWindow {
|
class InstallerWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
InstallerWindow(BRect frameRect);
|
InstallerWindow(BRect frameRect);
|
||||||
@@ -43,6 +45,8 @@ private:
|
|||||||
BScrollView *fPackagesScrollView;
|
BScrollView *fPackagesScrollView;
|
||||||
BStringView *fSizeView;
|
BStringView *fSizeView;
|
||||||
|
|
||||||
|
BBitmap *fLogo;
|
||||||
|
BPoint fDrawPoint;
|
||||||
CopyEngine fCopyEngine;
|
CopyEngine fCopyEngine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ App Installer :
|
|||||||
InstallerWindow.cpp
|
InstallerWindow.cpp
|
||||||
PackageViews.cpp
|
PackageViews.cpp
|
||||||
PartitionMenuItem.cpp
|
PartitionMenuItem.cpp
|
||||||
: libbe.so libtracker.so
|
: libbe.so libtracker.so libtranslation.so
|
||||||
: Installer.rdef ;
|
: Installer.rdef ;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
Reference in New Issue
Block a user