SoftwareUpdater: Initial work on a GUI software updater

* Planning on having a notification box when updates
  available.
* Clicking the notification box will pop up the
  SoftwareUpdater with a simple "Apply Updates" button
* Currently users need to know to 'pkgman update'
This commit is contained in:
Alexander von Gluck IV
2016-12-08 18:43:39 +00:00
parent b8d4709eb9
commit f7d9c0110d
8 changed files with 233 additions and 0 deletions
Binary file not shown.
+1
View File
@@ -49,6 +49,7 @@ HaikuSubInclude resedit ;
HaikuSubInclude screenshot ; HaikuSubInclude screenshot ;
HaikuSubInclude serialconnect ; HaikuSubInclude serialconnect ;
HaikuSubInclude showimage ; HaikuSubInclude showimage ;
HaikuSubInclude softwareupdater ;
HaikuSubInclude soundrecorder ; HaikuSubInclude soundrecorder ;
HaikuSubInclude stylededit ; HaikuSubInclude stylededit ;
HaikuSubInclude sudoku ; HaikuSubInclude sudoku ;
+10
View File
@@ -0,0 +1,10 @@
SubDir HAIKU_TOP src apps softwareupdater ;
UsePrivateHeaders interface shared ;
Application SoftwareUpdater :
SoftwareUpdaterApp.cpp
SoftwareUpdaterWindow.cpp
: be localestub tracker translation [ TargetLibsupc++ ]
: SoftwareUpdater.rdef
;
@@ -0,0 +1,65 @@
resource app_signature "application/x-vnd.haiku-softwareupdater";
resource app_flags B_SINGLE_LAUNCH;
resource app_version {
major = 1,
middle = 0,
minor = 0,
variety = B_APPV_BETA,
internal = 0,
short_info = "SoftwareUpdater",
long_info = "Software Updater ©2008-2016 Haiku"
};
resource vector_icon {
$"6E6369661F0500040065035D2B0C0385501C0200060238B0AD39B313BC39613B"
$"3C1049FADA48DA6900663200FF834F1C02000602BAC477B68B1E383D42BC6FBF"
$"4A77B34B835900A3784BFF76401C020006023A5A93364779BA1E153E2FD44ABA"
$"0945BA0400E5B07BFFFFCE9E03945F2C02000602B9A55E3826F4BA0888BB71D4"
$"49A1AB4BD47500BE8852FFDCA977020006023A32CCB3AE813614FC3C7C854AB1"
$"F4444C1900FCCC9DFFEEB78103FFDCBA020006023CBAB636B0FDB853093E5B6E"
$"484D0548998100FFE3C7FFF3B476020006023A6157385DA4B8EDF53AF2894AF1"
$"C14968F500FFD5ACFFB0784202000602B56B53389A1FBC6007B91EFD4A160A4B"
$"0820007C4E28FFA1754505000200060237E670B8880E39469D39AE144A52234B"
$"0D2500C6D7F5FF6B94DD03EC6666020006023B2B47BB18653D0FA53D22514829"
$"7046CA1900FFEC4BFFF0A506020006023B3049396B0ABA90833C646E4A101543"
$"299500FFFFFFFFFFF289020006023C71E33A0C78BA15E43C7D21490555494557"
$"00E3EDFFFF9EC2FF03FFACAC020006023A1DA6393F04BBB5BC3C6B074AEA3648"
$"091100F99B05FFFCB23D03003CB00200060230B31E3A09B9BB024238A12F4BAB"
$"534AFF0B00A3043CFFFFDCE603CD4D4D030D296402000602BD498B3E1159BF21"
$"9BBE7D2F4BE71F4AB31300C13E3EFFE27A7A0500020006023B739F3B784BBD5E"
$"1B3D59924AE607487DCF00A9FF00FD038336020006023A3F27371338BB135B3E"
$"3F414A364447949404CBFF67FF04B0040401541C0A07405E485E4C605D4BC93C"
$"C3195C46544508052A472A51405C524A52440A0C384E22432A3B223B382E3E2E"
$"4526562C52375E3A4C4C40460A043E2E423E524552360A053E2E423E5245C3AC"
$"C2453E410A052A3B3E2E3E41BC85C2182ABF590A043E41BC85C2184046C162C1"
$"3E0A0440465234524A405C0A0340464A4640500A06B7BDC1592E4E4057405C2A"
$"512AC1570A04404640572E4EB7BDC1590A044526562C52373E2E0A042243384E"
$"40462A3B0A04223B382E3E2E2A3B0A04404652375E3A4C4C0A06322E323E4246"
$"4C3C4C2C3D260A04322E323E424642350A04322E42354C2C3D260A0442354246"
$"4C3C4C2C0A0338423C4D3C440A0422422252325A32490A04224232493C402D3A"
$"0A043249325A3C503C400A043E42C35DC27AC751BEF3493A0A04C35DC27A4E49"
$"5840C751BEF30A05424BC08BC7B74E5A4E49C35DC27A0A053E423E52C08BC7B7"
$"424BC35DC27A0A07BF592D4DBE2746BE2746C48738C48738BE2731BE27250A01"
$"0100000A0001011001178402040A050107000A020108000A080109000A0D010A"
$"000A0001021001178402040A040105000A060103000A070104000A030106000A"
$"09010B000A0A010D000A0E010F123E34F70000000000003E34F7449611488403"
$"01178400040A0F0110023E34F70000000000003E34F74496114884030A160112"
$"023E34F70000000000003E34F74496114884030A190113023E34F70000000000"
$"003E34F74780004669200A0F0115023E34F70000000000003E34F74780004645"
$"D10A0E010F123E34F70000000000003E34F74893DC48840301178400040A1001"
$"19023E34F70000000000003E34F74780004645D10A18011A023E34F700000000"
$"00003E34F74780004645D10A170112023E34F70000000000003E34F74893DC48"
$"84030A140118023E34F70000000000003E34F74780004645D10A1A0117023E34"
$"F70000000000003E34F74780004645D10A0E010F123E34F70000000000003E34"
$"F74780004645D101178400040A110110023E34F70000000000003E34F7478000"
$"4645D10A120111023E34F70000000000003E34F74780004645D10A150112023E"
$"34F70000000000003E34F74780004645D10A0C010E000A0B010C000A1E011B12"
$"3F10F70000000000003EBC0B40632BC2218601158602040A1E011B123F10F700"
$"00000000003EBC0B40632BC2218601158402040A1E011B123F10F70000000000"
$"003EBC0B40632BC2218601158202040A1E011B023F10F70000000000003EBC0B"
$"40632BC221860A1B011B123F10F70000000000003EBC0BC03647C2D089011784"
$"00040A1D011B023F10F70000000000003EBC0BC03647C2D0890A1C011B123F10"
$"F70000000000003EBC0BC03647C2D08901157C0004"
};
@@ -0,0 +1,48 @@
/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license
*
* Authors:
* Alexander von Gluck IV <[email protected]>
*/
#include "SoftwareUpdaterApp.h"
#include <stdio.h>
#include <AppDefs.h>
#include "SoftwareUpdaterWindow.h"
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "SoftwareUpdater"
SoftwareUpdaterApp::SoftwareUpdaterApp()
:
BApplication("application/x-vnd.haiku-softwareupdater")
{
}
SoftwareUpdaterApp::~SoftwareUpdaterApp()
{
}
void
SoftwareUpdaterApp::ReadyToRun()
{
SoftwareUpdaterWindow* window = new SoftwareUpdaterWindow();
if (window)
window->Show();
}
int
main()
{
SoftwareUpdaterApp app;
return app.Run();
}
@@ -0,0 +1,23 @@
/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license
*
* Authors:
* Alexander von Gluck IV <[email protected]>
*/
#ifndef _SOFTWARE_UPDATER_APP_H
#define _SOFTWARE_UPDATER_APP_H
#include <Application.h>
class SoftwareUpdaterApp : public BApplication {
public:
SoftwareUpdaterApp();
~SoftwareUpdaterApp();
void ReadyToRun();
};
#endif
@@ -0,0 +1,63 @@
/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license
*
* Authors:
* Alexander von Gluck IV <[email protected]>
*/
#include "SoftwareUpdaterWindow.h"
#include <stdio.h>
#include <AppDefs.h>
#include <Application.h>
#include <Button.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <LayoutBuilder.h>
#include <Message.h>
#include <StringView.h>
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "SoftwareUpdater"
const uint32 UPDATE_MESSAGE = 'iUPD';
SoftwareUpdaterWindow::SoftwareUpdaterWindow()
:
BWindow(BRect(0, 0, 500, 300), "Software Update",
B_TITLED_WINDOW, B_AUTO_UPDATE_SIZE_LIMITS | B_NOT_ZOOMABLE)
{
BStringView* introText = new BStringView("intro",
"Software updates are available.", B_WILL_DRAW);
BButton* updateButton = new BButton("Apply Updates",
new BMessage(UPDATE_MESSAGE));
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.AddGroup(B_VERTICAL, B_USE_ITEM_SPACING)
.SetInsets(B_USE_WINDOW_SPACING)
.Add(introText)
.Add(updateButton)
;
CenterOnScreen();
Show();
}
SoftwareUpdaterWindow::~SoftwareUpdaterWindow()
{
}
bool
SoftwareUpdaterWindow::QuitRequested()
{
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
}
@@ -0,0 +1,23 @@
/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license
*
* Authors:
* Alexander von Gluck IV <[email protected]>
*/
#ifndef _SOFTWARE_UPDATER_WINDOW_H
#define _SOFTWARE_UPDATER_WINDOW_H
#include <Window.h>
class SoftwareUpdaterWindow : public BWindow {
public:
SoftwareUpdaterWindow();
~SoftwareUpdaterWindow();
bool QuitRequested();
};
#endif