SoftwareUpdater improvements and fixes

Improvements:
* Close box on window tab replaces cancel button
* Final window quit button made default
* Window frame and details checkbox option saved to settings file and
  restored upon start of application
Bug fixes:
* Fixed strings not truncating properly in scroll view
* Application was unnecessarily aborting the Haiku shutdown process
* Window corner grabber now not shown when window is not resizable
This commit is contained in:
Brian Hill
2017-07-09 22:49:52 +00:00
parent 8412d1d17a
commit acfd5c8676
18 changed files with 216 additions and 63 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
+1 -1
View File
@@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef CHECK_ACTION_H #ifndef CHECK_ACTION_H
#define CHECK_ACTION_H #define CHECK_ACTION_H
+1 -1
View File
@@ -6,7 +6,7 @@
* Axel Dörfler <[email protected]> * Axel Dörfler <[email protected]>
* Rene Gollent <[email protected]> * Rene Gollent <[email protected]>
* Ingo Weinhold <[email protected]> * Ingo Weinhold <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
+1 -1
View File
@@ -5,7 +5,7 @@
* Authors: * Authors:
* Ingo Weinhold <[email protected]> * Ingo Weinhold <[email protected]>
* Rene Gollent <[email protected]> * Rene Gollent <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef CHECK_MANAGER_H #ifndef CHECK_MANAGER_H
#define CHECK_MANAGER_H #define CHECK_MANAGER_H
@@ -5,7 +5,7 @@ resource app_flags B_SINGLE_LAUNCH;
resource app_version { resource app_version {
major = 1, major = 1,
middle = 0, middle = 0,
minor = 1, minor = 2,
variety = B_APPV_BETA, variety = B_APPV_BETA,
internal = 0, internal = 0,
short_info = "SoftwareUpdater", short_info = "SoftwareUpdater",
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Alexander von Gluck IV <[email protected]> * Alexander von Gluck IV <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#include "SoftwareUpdaterApp.h" #include "SoftwareUpdaterApp.h"
@@ -71,11 +71,8 @@ SoftwareUpdaterApp::QuitRequested()
// Simulate a cancel request from window- this gives the updater a chance // Simulate a cancel request from window- this gives the updater a chance
// to quit cleanly // to quit cleanly
if (fWindowMessenger.IsValid()) { if (fWindowMessenger.IsValid())
fWindowMessenger.SendMessage(kMsgCancel); fWindowMessenger.SendMessage(kMsgCancel);
return false;
}
return true; return true;
} }
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Alexander von Gluck IV <[email protected]> * Alexander von Gluck IV <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef _SOFTWARE_UPDATER_APP_H #ifndef _SOFTWARE_UPDATER_APP_H
#define _SOFTWARE_UPDATER_APP_H #define _SOFTWARE_UPDATER_APP_H
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Alexander von Gluck IV <[email protected]> * Alexander von Gluck IV <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
@@ -15,10 +15,12 @@
#include <Application.h> #include <Application.h>
#include <Catalog.h> #include <Catalog.h>
#include <ControlLook.h> #include <ControlLook.h>
#include <FindDirectory.h>
#include <LayoutBuilder.h> #include <LayoutBuilder.h>
#include <LayoutUtils.h> #include <LayoutUtils.h>
#include <Message.h> #include <Message.h>
#include <Roster.h> #include <Roster.h>
#include <Screen.h>
#include <String.h> #include <String.h>
#include "constants.h" #include "constants.h"
@@ -29,9 +31,9 @@
SoftwareUpdaterWindow::SoftwareUpdaterWindow() SoftwareUpdaterWindow::SoftwareUpdaterWindow()
: :
BWindow(BRect(0, 0, 300, 100), BWindow(BRect(0, 0, 300, 10),
B_TRANSLATE_SYSTEM_NAME("SoftwareUpdater"), B_TITLED_WINDOW, B_TRANSLATE_SYSTEM_NAME("SoftwareUpdater"), B_TITLED_WINDOW,
B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE | B_NOT_CLOSABLE), B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
fStripeView(NULL), fStripeView(NULL),
fHeaderView(NULL), fHeaderView(NULL),
fDetailView(NULL), fDetailView(NULL),
@@ -43,8 +45,13 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
fWaitingForButton(false), fWaitingForButton(false),
fUpdateConfirmed(false), fUpdateConfirmed(false),
fUserCancelRequested(false), fUserCancelRequested(false),
fWarningAlertCount(0) fWarningAlertCount(0),
fSettingsReadStatus(B_ERROR),
fSaveFrameChanges(false),
fMessageRunner(NULL),
fFrameChangeMessage(kMsgWindowFrameChanged)
{ {
// Layout
BBitmap icon = GetIcon(32 * icon_layout_scale()); BBitmap icon = GetIcon(32 * icon_layout_scale());
fStripeView = new StripeView(icon); fStripeView = new StripeView(icon);
@@ -95,9 +102,6 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
.AddGroup(new BGroupView(B_HORIZONTAL)) .AddGroup(new BGroupView(B_HORIZONTAL))
.Add(fDetailsCheckbox) .Add(fDetailsCheckbox)
.AddGlue() .AddGlue()
.End()
.AddGroup(new BGroupView(B_HORIZONTAL))
.AddGlue()
.Add(fCancelButton) .Add(fCancelButton)
.Add(fUpdateButton) .Add(fUpdateButton)
.End() .End()
@@ -107,12 +111,12 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
fDetailsLayoutItem = layout_item_for(fDetailView); fDetailsLayoutItem = layout_item_for(fDetailView);
fProgressLayoutItem = layout_item_for(fStatusBar); fProgressLayoutItem = layout_item_for(fStatusBar);
fPackagesLayoutItem = layout_item_for(fScrollView); fPackagesLayoutItem = layout_item_for(fScrollView);
fCancelButtonLayoutItem = layout_item_for(fCancelButton);
fUpdateButtonLayoutItem = layout_item_for(fUpdateButton); fUpdateButtonLayoutItem = layout_item_for(fUpdateButton);
fDetailsCheckboxLayoutItem = layout_item_for(fDetailsCheckbox); fDetailsCheckboxLayoutItem = layout_item_for(fDetailsCheckbox);
_SetState(STATE_DISPLAY_STATUS); _SetState(STATE_DISPLAY_STATUS);
CenterOnScreen(); CenterOnScreen();
Show();
SetFlags(Flags() ^ B_AUTO_UPDATE_SIZE_LIMITS); SetFlags(Flags() ^ B_AUTO_UPDATE_SIZE_LIMITS);
// Prevent resizing for now // Prevent resizing for now
@@ -120,6 +124,24 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
SetSizeLimits(fDefaultRect.Width(), fDefaultRect.Width(), SetSizeLimits(fDefaultRect.Width(), fDefaultRect.Width(),
fDefaultRect.Height(), fDefaultRect.Height()); fDefaultRect.Height(), fDefaultRect.Height());
// Read settings file
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &fSettingsPath);
if (status == B_OK) {
fSettingsPath.Append(kSettingsFilename);
fSettingsReadStatus = _ReadSettings(fInitialSettings);
}
// Move to saved setting position
if (fSettingsReadStatus == B_OK) {
BRect windowFrame;
status = fInitialSettings.FindRect(kKeyWindowFrame, &windowFrame);
if (status == B_OK) {
BScreen screen(this);
if (screen.Frame().Contains(windowFrame.LeftTop()))
MoveTo(windowFrame.LeftTop());
}
}
Show();
BMessage registerMessage(kMsgRegister); BMessage registerMessage(kMsgRegister);
registerMessage.AddMessenger(kKeyMessenger, BMessenger(this)); registerMessage.AddMessenger(kKeyMessenger, BMessenger(this));
be_app->PostMessage(&registerMessage); be_app->PostMessage(&registerMessage);
@@ -131,6 +153,48 @@ SoftwareUpdaterWindow::SoftwareUpdaterWindow()
} }
bool
SoftwareUpdaterWindow::QuitRequested()
{
PostMessage(kMsgCancel);
return false;
}
void
SoftwareUpdaterWindow::FrameMoved(BPoint newPosition)
{
BWindow::FrameMoved(newPosition);
// Create a message runner to consolidate all function calls from a
// move into one message post after moving has ceased for .5 seconds
if (fSaveFrameChanges) {
if (fMessageRunner == NULL) {
fMessageRunner = new BMessageRunner(this, &fFrameChangeMessage,
500000, 1);
} else
fMessageRunner->SetInterval(500000);
}
}
void
SoftwareUpdaterWindow::FrameResized(float newWidth, float newHeight)
{
BWindow::FrameResized(newWidth, newHeight);
// Create a message runner to consolidate all function calls from a
// resize into one message post after resizing has ceased for .5 seconds
if (fSaveFrameChanges) {
if (fMessageRunner == NULL) {
fMessageRunner = new BMessageRunner(this, &fFrameChangeMessage,
500000, 1);
} else
fMessageRunner->SetInterval(500000);
}
}
void void
SoftwareUpdaterWindow::MessageReceived(BMessage* message) SoftwareUpdaterWindow::MessageReceived(BMessage* message)
{ {
@@ -164,7 +228,8 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
break; break;
BString packageName; BString packageName;
status_t result = message->FindString(kKeyPackageName, &packageName); status_t result = message->FindString(kKeyPackageName,
&packageName);
if (result != B_OK) if (result != B_OK)
break; break;
BString packageCount; BString packageCount;
@@ -192,7 +257,6 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
case kMsgCancel: case kMsgCancel:
{ {
if (_GetState() == STATE_FINAL_MESSAGE) { if (_GetState() == STATE_FINAL_MESSAGE) {
PostMessage(B_QUIT_REQUESTED);
be_app->PostMessage(kMsgFinalQuit); be_app->PostMessage(kMsgFinalQuit);
break; break;
} }
@@ -203,7 +267,6 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
fHeaderView->SetText(B_TRANSLATE("Cancelling updates")); fHeaderView->SetText(B_TRANSLATE("Cancelling updates"));
fDetailView->SetText( fDetailView->SetText(
B_TRANSLATE("Attempting to cancel the updates...")); B_TRANSLATE("Attempting to cancel the updates..."));
fCancelButton->SetEnabled(false);
Unlock(); Unlock();
fUserCancelRequested = true; fUserCancelRequested = true;
@@ -237,7 +300,6 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
fHeaderView->SetText(B_TRANSLATE("Cancelling updates")); fHeaderView->SetText(B_TRANSLATE("Cancelling updates"));
fDetailView->SetText( fDetailView->SetText(
B_TRANSLATE("Attempting to cancel the updates...")); B_TRANSLATE("Attempting to cancel the updates..."));
fCancelButton->SetEnabled(false);
Unlock(); Unlock();
fUserCancelRequested = true; fUserCancelRequested = true;
@@ -262,12 +324,19 @@ SoftwareUpdaterWindow::MessageReceived(BMessage* message)
case kMsgMoreDetailsToggle: case kMsgMoreDetailsToggle:
fListView->SetMoreDetails(fDetailsCheckbox->Value() != 0); fListView->SetMoreDetails(fDetailsCheckbox->Value() != 0);
_WriteSettings();
break; break;
case kMsgWarningDismissed: case kMsgWarningDismissed:
fWarningAlertCount--; fWarningAlertCount--;
break; break;
case kMsgWindowFrameChanged:
delete fMessageRunner;
fMessageRunner = NULL;
_WriteSettings();
break;
case kMsgGetUpdateType: case kMsgGetUpdateType:
{ {
BString text( BString text(
@@ -461,6 +530,7 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
fProgressLayoutItem->SetVisible(false); fProgressLayoutItem->SetVisible(false);
fPackagesLayoutItem->SetVisible(false); fPackagesLayoutItem->SetVisible(false);
fDetailsCheckboxLayoutItem->SetVisible(false); fDetailsCheckboxLayoutItem->SetVisible(false);
fCancelButtonLayoutItem->SetVisible(false);
} }
fCurrentState = state; fCurrentState = state;
@@ -471,24 +541,23 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
else else
fUpdateButtonLayoutItem->SetVisible(false); fUpdateButtonLayoutItem->SetVisible(false);
// View package info view // View package info view and checkbox
// Show at confirmation prompt, hide at final update // Show at confirmation prompt, hide at final update
if (fCurrentState == STATE_GET_CONFIRMATION) { if (fCurrentState == STATE_GET_CONFIRMATION) {
fPackagesLayoutItem->SetVisible(true); fPackagesLayoutItem->SetVisible(true);
fDetailsCheckboxLayoutItem->SetVisible(true); fDetailsCheckboxLayoutItem->SetVisible(true);
// Re-enable resizing if (fSettingsReadStatus == B_OK) {
float defaultWidth = fDefaultRect.Width(); bool showMoreDetails;
SetSizeLimits(defaultWidth, 9999, status_t result = fInitialSettings.FindBool(kKeyShowDetails,
fDefaultRect.Height() + 4 * fListView->ItemHeight(), 9999); &showMoreDetails);
ResizeTo(defaultWidth, .75 * defaultWidth); if (result == B_OK) {
fDetailsCheckbox->SetValue(showMoreDetails ? 1 : 0);
fListView->SetMoreDetails(showMoreDetails);
}
}
} else if (fCurrentState == STATE_FINAL_MESSAGE) { } else if (fCurrentState == STATE_FINAL_MESSAGE) {
fPackagesLayoutItem->SetVisible(false); fPackagesLayoutItem->SetVisible(false);
fDetailsCheckboxLayoutItem->SetVisible(false); fDetailsCheckboxLayoutItem->SetVisible(false);
float defaultWidth = fDefaultRect.Width();
float defaultHeight = fDefaultRect.Height();
SetSizeLimits(defaultWidth, defaultWidth, defaultHeight,
defaultHeight);
ResizeTo(defaultWidth, defaultHeight);
} }
// Progress bar and string view // Progress bar and string view
@@ -501,10 +570,52 @@ SoftwareUpdaterWindow::_SetState(uint32 state)
fDetailsLayoutItem->SetVisible(true); fDetailsLayoutItem->SetVisible(true);
} }
// Cancel button // Resizing
if (fCurrentState == STATE_FINAL_MESSAGE) if (fCurrentState == STATE_GET_CONFIRMATION) {
fCancelButton->SetLabel(B_TRANSLATE("Quit")); // Enable resizing
fCancelButton->SetEnabled(fCurrentState != STATE_APPLY_UPDATES); float defaultWidth = fDefaultRect.Width();
SetSizeLimits(defaultWidth, B_SIZE_UNLIMITED,
fDefaultRect.Height() + 4 * fListView->ItemHeight(),
B_SIZE_UNLIMITED);
SetFlags(Flags() ^ B_NOT_RESIZABLE);
// Recall saved settings
BScreen screen(this);
BRect screenFrame = screen.Frame();
bool windowResized = false;
if (fSettingsReadStatus == B_OK) {
BRect windowFrame;
status_t result = fInitialSettings.FindRect(kKeyWindowFrame,
&windowFrame);
if (result == B_OK) {
if (screenFrame.Contains(windowFrame)) {
ResizeTo(windowFrame.Width(), windowFrame.Height());
windowResized = true;
}
}
}
if (!windowResized)
ResizeTo(defaultWidth, .75 * defaultWidth);
// Check that the bottom of window is on screen
float screenBottom = screenFrame.bottom;
float windowBottom = DecoratorFrame().bottom;
if (windowBottom > screenBottom)
MoveBy(0, screenBottom - windowBottom);
fSaveFrameChanges = true;
} else if (fCurrentState == STATE_APPLY_UPDATES)
fSaveFrameChanges = false;
else if (fCurrentState == STATE_FINAL_MESSAGE) {
// Disable resizing
fSaveFrameChanges = false;
ResizeTo(fDefaultRect.Width(), fDefaultRect.Height());
SetFlags(Flags() | B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_RESIZABLE);
}
// Quit button
if (fCurrentState == STATE_FINAL_MESSAGE) {
fCancelButtonLayoutItem->SetVisible(true);
fCancelButton->SetLabel(B_TRANSLATE_COMMENT("Quit", "Button label"));
fCancelButton->MakeDefault(true);
}
Unlock(); Unlock();
} }
@@ -517,6 +628,35 @@ SoftwareUpdaterWindow::_GetState()
} }
status_t
SoftwareUpdaterWindow::_WriteSettings()
{
BFile file;
status_t status = file.SetTo(fSettingsPath.Path(),
B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE);
if (status == B_OK) {
BMessage settings;
settings.AddBool(kKeyShowDetails, fDetailsCheckbox->Value() != 0);
settings.AddRect(kKeyWindowFrame, Frame());
status = settings.Flatten(&file);
}
file.Unset();
return status;
}
status_t
SoftwareUpdaterWindow::_ReadSettings(BMessage& settings)
{
BFile file;
status_t status = file.SetTo(fSettingsPath.Path(), B_READ_ONLY);
if (status == B_OK)
status = settings.Unflatten(&file);
file.Unset();
return status;
}
SuperItem::SuperItem(const char* label) SuperItem::SuperItem(const char* label)
: :
BListItem(), BListItem(),
@@ -641,28 +781,24 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
{ {
owner->PushState(); owner->PushState();
float width; float width = owner->Frame().Width();
owner->GetPreferredSize(&width, NULL);
float nameWidth = width / 2.0; float nameWidth = width / 2.0;
float offset_width = 0; float offsetWidth = 0;
bool showMoreDetails = fSuperItem->GetDetailLevel(); bool showMoreDetails = fSuperItem->GetDetailLevel();
BBitmap* icon = fSuperItem->GetIcon(); BBitmap* icon = fSuperItem->GetIcon();
if (icon != NULL && icon->IsValid()) { if (icon != NULL && icon->IsValid()) {
int16 iconSize = fSuperItem->GetIconSize(); int16 iconSize = fSuperItem->GetIconSize();
float offsetMarginHeight = floor((Height() - iconSize) / 2); float offsetMarginHeight = floor((Height() - iconSize) / 2);
//owner->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
owner->SetDrawingMode(B_OP_ALPHA); owner->SetDrawingMode(B_OP_ALPHA);
BPoint location = BPoint(item_rect.left, BPoint location = BPoint(item_rect.left,
item_rect.top + offsetMarginHeight); item_rect.top + offsetMarginHeight);
owner->DrawBitmap(icon, location); owner->DrawBitmap(icon, location);
owner->SetDrawingMode(B_OP_COPY); owner->SetDrawingMode(B_OP_COPY);
offsetWidth = iconSize + fLabelOffset;
if (fDrawBarFlag) if (fDrawBarFlag)
_DrawBar(location, owner, icon_size(iconSize)); _DrawBar(location, owner, icon_size(iconSize));
offset_width += iconSize + fLabelOffset;
} }
owner->SetFont(&fRegularFont); owner->SetFont(&fRegularFont);
@@ -672,7 +808,7 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
font_height fontHeight = fSuperItem->GetFontHeight(); font_height fontHeight = fSuperItem->GetFontHeight();
BString name(fName); BString name(fName);
owner->TruncateString(&name, B_TRUNCATE_END, nameWidth); owner->TruncateString(&name, B_TRUNCATE_END, nameWidth);
BPoint cursor(item_rect.left + offset_width, BPoint cursor(item_rect.left + offsetWidth,
item_rect.bottom - fSmallTotalHeight - fontHeight.descent - 1); item_rect.bottom - fSmallTotalHeight - fontHeight.descent - 1);
if (showMoreDetails) if (showMoreDetails)
cursor.y -= fSmallTotalHeight + 1; cursor.y -= fSmallTotalHeight + 1;
@@ -694,7 +830,7 @@ PackageItem::DrawItem(BView* owner, BRect item_rect, bool complete)
// Summary // Summary
BString summary(fSummary); BString summary(fSummary);
cursor.x = item_rect.left + offset_width; cursor.x = item_rect.left + offsetWidth;
cursor.y += fSmallTotalHeight; cursor.y += fSmallTotalHeight;
owner->TruncateString(&summary, B_TRUNCATE_END, width - cursor.x); owner->TruncateString(&summary, B_TRUNCATE_END, width - cursor.x);
owner->DrawString(summary.String(), cursor); owner->DrawString(summary.String(), cursor);
@@ -974,6 +1110,8 @@ PackageListView::ItemHeight()
void void
PackageListView::SetMoreDetails(bool showMore) PackageListView::SetMoreDetails(bool showMore)
{ {
if (showMore == fShowMoreDetails)
return;
fShowMoreDetails = showMore; fShowMoreDetails = showMore;
_SetItemHeights(); _SetItemHeights();
InvalidateLayout(); InvalidateLayout();
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Alexander von Gluck IV <[email protected]> * Alexander von Gluck IV <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef _SOFTWARE_UPDATER_WINDOW_H #ifndef _SOFTWARE_UPDATER_WINDOW_H
#define _SOFTWARE_UPDATER_WINDOW_H #define _SOFTWARE_UPDATER_WINDOW_H
@@ -13,8 +13,10 @@
#include <Button.h> #include <Button.h>
#include <CheckBox.h> #include <CheckBox.h>
#include <GroupView.h> #include <GroupView.h>
#include <OutlineListView.h> #include <MessageRunner.h>
#include <NodeInfo.h> #include <NodeInfo.h>
#include <OutlineListView.h>
#include <Path.h>
#include <Point.h> #include <Point.h>
#include <ScrollView.h> #include <ScrollView.h>
#include <StatusBar.h> #include <StatusBar.h>
@@ -134,6 +136,9 @@ private:
class SoftwareUpdaterWindow : public BWindow { class SoftwareUpdaterWindow : public BWindow {
public: public:
SoftwareUpdaterWindow(); SoftwareUpdaterWindow();
bool QuitRequested();
void FrameMoved(BPoint newPosition);
void FrameResized(float newWidth, float newHeight);
void MessageReceived(BMessage* message); void MessageReceived(BMessage* message);
bool ConfirmUpdates(); bool ConfirmUpdates();
void UpdatesApplying(const char* header, void UpdatesApplying(const char* header,
@@ -159,6 +164,8 @@ private:
uint32 _WaitForButtonClick(); uint32 _WaitForButtonClick();
void _SetState(uint32 state); void _SetState(uint32 state);
uint32 _GetState(); uint32 _GetState();
status_t _WriteSettings();
status_t _ReadSettings(BMessage& settings);
BRect fDefaultRect; BRect fDefaultRect;
StripeView* fStripeView; StripeView* fStripeView;
@@ -173,6 +180,7 @@ private:
BLayoutItem* fDetailsLayoutItem; BLayoutItem* fDetailsLayoutItem;
BLayoutItem* fPackagesLayoutItem; BLayoutItem* fPackagesLayoutItem;
BLayoutItem* fProgressLayoutItem; BLayoutItem* fProgressLayoutItem;
BLayoutItem* fCancelButtonLayoutItem;
BLayoutItem* fUpdateButtonLayoutItem; BLayoutItem* fUpdateButtonLayoutItem;
BLayoutItem* fDetailsCheckboxLayoutItem; BLayoutItem* fDetailsCheckboxLayoutItem;
@@ -185,7 +193,12 @@ private:
BInvoker fCancelAlertResponse; BInvoker fCancelAlertResponse;
int32 fWarningAlertCount; int32 fWarningAlertCount;
BInvoker fWarningAlertDismissed; BInvoker fWarningAlertDismissed;
BPath fSettingsPath;
status_t fSettingsReadStatus;
BMessage fInitialSettings;
bool fSaveFrameChanges;
BMessageRunner* fMessageRunner;
BMessage fFrameChangeMessage;
}; };
+1 -1
View File
@@ -6,7 +6,7 @@
* Ryan Leavengood <[email protected]> * Ryan Leavengood <[email protected]>
* John Scipione <[email protected]> * John Scipione <[email protected]>
* Joseph Groover <[email protected]> * Joseph Groover <[email protected]>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
+1 -1
View File
@@ -6,7 +6,7 @@
* Ryan Leavengood <leavengood@gmail.com> * Ryan Leavengood <leavengood@gmail.com>
* John Scipione <jscipione@gmail.com> * John Scipione <jscipione@gmail.com>
* Joseph Groover <looncraz@looncraz.net> * Joseph Groover <looncraz@looncraz.net>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef _STRIPE_VIEW_H #ifndef _STRIPE_VIEW_H
#define _STRIPE_VIEW_H #define _STRIPE_VIEW_H
+1 -1
View File
@@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
+1 -1
View File
@@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef UPDATE_ACTION_H #ifndef UPDATE_ACTION_H
#define UPDATE_ACTION_H #define UPDATE_ACTION_H
+3 -3
View File
@@ -6,7 +6,7 @@
* Axel Dörfler <axeld@pinc-software.de> * Axel Dörfler <axeld@pinc-software.de>
* Rene Gollent <rene@gollent.com> * Rene Gollent <rene@gollent.com>
* Ingo Weinhold <ingo_weinhold@gmx.de> * Ingo Weinhold <ingo_weinhold@gmx.de>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
@@ -57,9 +57,9 @@ UpdateManager::UpdateManager(BPackageInstallationLocation location,
UpdateManager::~UpdateManager() UpdateManager::~UpdateManager()
{ {
if (fStatusWindow != NULL) if (fStatusWindow != NULL)
fStatusWindow->PostMessage(B_QUIT_REQUESTED); fStatusWindow->Quit();
if (fProblemWindow != NULL) if (fProblemWindow != NULL)
fProblemWindow->PostMessage(B_QUIT_REQUESTED); fProblemWindow->Quit();
} }
+1 -1
View File
@@ -5,7 +5,7 @@
* Authors: * Authors:
* Ingo Weinhold <ingo_weinhold@gmx.de> * Ingo Weinhold <ingo_weinhold@gmx.de>
* Rene Gollent <rene@gollent.com> * Rene Gollent <rene@gollent.com>
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef UPDATE_MANAGER_H #ifndef UPDATE_MANAGER_H
#define UPDATE_MANAGER_H #define UPDATE_MANAGER_H
+1 -1
View File
@@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
+1 -1
View File
@@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef _WORKING_LOOPER_H #ifndef _WORKING_LOOPER_H
#define _WORKING_LOOPER_H #define _WORKING_LOOPER_H
+6 -1
View File
@@ -3,12 +3,13 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Brian Hill <supernova@warpmail.net> * Brian Hill <supernova@tycho.email>
*/ */
#ifndef CONSTANTS_H #ifndef CONSTANTS_H
#define CONSTANTS_H #define CONSTANTS_H
#define kAppSignature "application/x-vnd.haiku-softwareupdater" #define kAppSignature "application/x-vnd.haiku-softwareupdater"
#define kSettingsFilename "SoftwareUpdater_settings"
enum { enum {
ACTION_STEP_INIT = 0, ACTION_STEP_INIT = 0,
@@ -51,6 +52,7 @@ static const uint32 kMsgNoRepositories = 'iNRE';
static const uint32 kMsgRegister = 'iREG'; static const uint32 kMsgRegister = 'iREG';
static const uint32 kMsgFinalQuit = 'iFIN'; static const uint32 kMsgFinalQuit = 'iFIN';
static const uint32 kMsgMoreDetailsToggle = 'iDTO'; static const uint32 kMsgMoreDetailsToggle = 'iDTO';
static const uint32 kMsgWindowFrameChanged = 'iWFC';
// Message data keys // Message data keys
#define kKeyHeader "key_header" #define kKeyHeader "key_header"
@@ -61,5 +63,8 @@ static const uint32 kMsgMoreDetailsToggle = 'iDTO';
#define kKeyMessenger "key_messenger" #define kKeyMessenger "key_messenger"
#define kKeyAlertResult "key_alertresult" #define kKeyAlertResult "key_alertresult"
// Settings keys
#define kKeyShowDetails "ShowDetails"
#define kKeyWindowFrame "WindowFrame"
#endif // CONSTANTS_H #endif // CONSTANTS_H