Removed function to add screensavers
Removed "Add..." button and drag&drop awareness, as discussed in http://www.freelists.org/post/haiku-development/Adding-screensavers-and-fonts In short: all apps and add-ons will come as proper hpkg.
This commit is contained in:
@@ -17,7 +17,7 @@ resource app_version {
|
||||
internal = 0,
|
||||
|
||||
short_info = "ScreenSaver",
|
||||
long_info = "ScreenSaver ©2004-2009 Haiku"
|
||||
long_info = "ScreenSaver ©2004-2014 Haiku"
|
||||
};
|
||||
|
||||
resource vector_icon {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2013 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2003-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -22,7 +22,6 @@
|
||||
class ScreenSaverApp : public BApplication {
|
||||
public:
|
||||
ScreenSaverApp();
|
||||
virtual void RefsReceived(BMessage* message);
|
||||
|
||||
private:
|
||||
BWindow* fScreenSaverWindow;
|
||||
@@ -41,37 +40,6 @@ ScreenSaverApp::ScreenSaverApp()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ScreenSaverApp::RefsReceived(BMessage* message)
|
||||
{
|
||||
entry_ref ref;
|
||||
if (message->FindRef("refs", &ref) != B_OK)
|
||||
return;
|
||||
|
||||
// Install the screen saver by copying it to the add-ons directory
|
||||
// TODO: the translator have a similar mechanism - this could be cleaned
|
||||
// up and have one nicely working solution
|
||||
// TODO: should test if the dropped ref is really a screen saver!
|
||||
// TODO: you can receive more than one ref at a time...
|
||||
|
||||
BEntry entry;
|
||||
entry.SetTo(&ref, true);
|
||||
if (entry.InitCheck() != B_OK)
|
||||
return;
|
||||
|
||||
BPath path;
|
||||
entry.GetPath(&path);
|
||||
|
||||
// TODO: find_directory() anyone??
|
||||
char temp[B_PATH_NAME_LENGTH * 2];
|
||||
sprintf(temp, "cp %s '/boot/home/config/add-ons/Screen Savers/'\n",
|
||||
path.Path());
|
||||
system(temp);
|
||||
|
||||
fScreenSaverWindow->PostMessage(kMsgUpdateList);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - main()
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2013 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2003-2014 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <DurationFormat.h>
|
||||
#include <Entry.h>
|
||||
#include <File.h>
|
||||
#include <FilePanel.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <Font.h>
|
||||
#include <Layout.h>
|
||||
@@ -64,7 +63,6 @@ const uint32 kMinSettingsHeight = 120;
|
||||
|
||||
const int32 kMsgSaverSelected = 'SSEL';
|
||||
const int32 kMsgTestSaver = 'TEST';
|
||||
const int32 kMsgAddSaver = 'ADD ';
|
||||
const int32 kMsgPasswordCheckBox = 'PWCB';
|
||||
const int32 kMsgRunSliderChanged = 'RSch';
|
||||
const int32 kMsgRunSliderUpdate = 'RSup';
|
||||
@@ -134,7 +132,6 @@ class ModulesView : public BView {
|
||||
public:
|
||||
ModulesView(const char* name,
|
||||
ScreenSaverSettings& settings);
|
||||
virtual ~ModulesView();
|
||||
|
||||
virtual void DetachedFromWindow();
|
||||
virtual void AttachedToWindow();
|
||||
@@ -155,10 +152,8 @@ private:
|
||||
void _OpenSaver();
|
||||
|
||||
private:
|
||||
BFilePanel* fFilePanel;
|
||||
BListView* fScreenSaversListView;
|
||||
BButton* fTestButton;
|
||||
BButton* fAddButton;
|
||||
|
||||
ScreenSaverSettings& fSettings;
|
||||
ScreenSaverRunner* fSaverRunner;
|
||||
@@ -535,9 +530,6 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
||||
fTestButton = new BButton("TestButton", B_TRANSLATE("Test"),
|
||||
new BMessage(kMsgTestSaver));
|
||||
|
||||
fAddButton = new BButton("AddButton",
|
||||
B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddSaver));
|
||||
|
||||
fPreviewView = new PreviewView("preview");
|
||||
|
||||
fScreenSaversListView = new BListView("SaversListView",
|
||||
@@ -550,8 +542,6 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
||||
fSettingsBox = new BBox("SettingsBox");
|
||||
fSettingsBox->SetLabel(B_TRANSLATE("Screensaver settings"));
|
||||
|
||||
fFilePanel = new BFilePanel();
|
||||
|
||||
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
.AddGroup(B_VERTICAL)
|
||||
@@ -559,7 +549,7 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
||||
.Add(saversListScrollView)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(fTestButton)
|
||||
.Add(fAddButton)
|
||||
.AddGlue()
|
||||
.End()
|
||||
.End()
|
||||
.Add(fSettingsBox)
|
||||
@@ -567,12 +557,6 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
||||
}
|
||||
|
||||
|
||||
ModulesView::~ModulesView()
|
||||
{
|
||||
delete fFilePanel;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ModulesView::DetachedFromWindow()
|
||||
{
|
||||
@@ -588,7 +572,6 @@ ModulesView::AttachedToWindow()
|
||||
{
|
||||
fScreenSaversListView->SetTarget(this);
|
||||
fTestButton->SetTarget(this);
|
||||
fAddButton->SetTarget(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -659,10 +642,6 @@ ModulesView::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case kMsgAddSaver:
|
||||
fFilePanel->Show();
|
||||
break;
|
||||
|
||||
case B_SOME_APP_QUIT:
|
||||
{
|
||||
team_id team;
|
||||
|
||||
Reference in New Issue
Block a user