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,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "ScreenSaver",
|
short_info = "ScreenSaver",
|
||||||
long_info = "ScreenSaver ©2004-2009 Haiku"
|
long_info = "ScreenSaver ©2004-2014 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource vector_icon {
|
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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -22,7 +22,6 @@
|
|||||||
class ScreenSaverApp : public BApplication {
|
class ScreenSaverApp : public BApplication {
|
||||||
public:
|
public:
|
||||||
ScreenSaverApp();
|
ScreenSaverApp();
|
||||||
virtual void RefsReceived(BMessage* message);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BWindow* fScreenSaverWindow;
|
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()
|
// #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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
#include <DurationFormat.h>
|
#include <DurationFormat.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FilePanel.h>
|
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include <Layout.h>
|
#include <Layout.h>
|
||||||
@@ -64,7 +63,6 @@ const uint32 kMinSettingsHeight = 120;
|
|||||||
|
|
||||||
const int32 kMsgSaverSelected = 'SSEL';
|
const int32 kMsgSaverSelected = 'SSEL';
|
||||||
const int32 kMsgTestSaver = 'TEST';
|
const int32 kMsgTestSaver = 'TEST';
|
||||||
const int32 kMsgAddSaver = 'ADD ';
|
|
||||||
const int32 kMsgPasswordCheckBox = 'PWCB';
|
const int32 kMsgPasswordCheckBox = 'PWCB';
|
||||||
const int32 kMsgRunSliderChanged = 'RSch';
|
const int32 kMsgRunSliderChanged = 'RSch';
|
||||||
const int32 kMsgRunSliderUpdate = 'RSup';
|
const int32 kMsgRunSliderUpdate = 'RSup';
|
||||||
@@ -134,7 +132,6 @@ class ModulesView : public BView {
|
|||||||
public:
|
public:
|
||||||
ModulesView(const char* name,
|
ModulesView(const char* name,
|
||||||
ScreenSaverSettings& settings);
|
ScreenSaverSettings& settings);
|
||||||
virtual ~ModulesView();
|
|
||||||
|
|
||||||
virtual void DetachedFromWindow();
|
virtual void DetachedFromWindow();
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
@@ -155,10 +152,8 @@ private:
|
|||||||
void _OpenSaver();
|
void _OpenSaver();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BFilePanel* fFilePanel;
|
|
||||||
BListView* fScreenSaversListView;
|
BListView* fScreenSaversListView;
|
||||||
BButton* fTestButton;
|
BButton* fTestButton;
|
||||||
BButton* fAddButton;
|
|
||||||
|
|
||||||
ScreenSaverSettings& fSettings;
|
ScreenSaverSettings& fSettings;
|
||||||
ScreenSaverRunner* fSaverRunner;
|
ScreenSaverRunner* fSaverRunner;
|
||||||
@@ -535,9 +530,6 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
|||||||
fTestButton = new BButton("TestButton", B_TRANSLATE("Test"),
|
fTestButton = new BButton("TestButton", B_TRANSLATE("Test"),
|
||||||
new BMessage(kMsgTestSaver));
|
new BMessage(kMsgTestSaver));
|
||||||
|
|
||||||
fAddButton = new BButton("AddButton",
|
|
||||||
B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddSaver));
|
|
||||||
|
|
||||||
fPreviewView = new PreviewView("preview");
|
fPreviewView = new PreviewView("preview");
|
||||||
|
|
||||||
fScreenSaversListView = new BListView("SaversListView",
|
fScreenSaversListView = new BListView("SaversListView",
|
||||||
@@ -550,8 +542,6 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
|||||||
fSettingsBox = new BBox("SettingsBox");
|
fSettingsBox = new BBox("SettingsBox");
|
||||||
fSettingsBox->SetLabel(B_TRANSLATE("Screensaver settings"));
|
fSettingsBox->SetLabel(B_TRANSLATE("Screensaver settings"));
|
||||||
|
|
||||||
fFilePanel = new BFilePanel();
|
|
||||||
|
|
||||||
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
|
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
|
||||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||||
.AddGroup(B_VERTICAL)
|
.AddGroup(B_VERTICAL)
|
||||||
@@ -559,7 +549,7 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
|||||||
.Add(saversListScrollView)
|
.Add(saversListScrollView)
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.Add(fTestButton)
|
.Add(fTestButton)
|
||||||
.Add(fAddButton)
|
.AddGlue()
|
||||||
.End()
|
.End()
|
||||||
.End()
|
.End()
|
||||||
.Add(fSettingsBox)
|
.Add(fSettingsBox)
|
||||||
@@ -567,12 +557,6 @@ ModulesView::ModulesView(const char* name, ScreenSaverSettings& settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ModulesView::~ModulesView()
|
|
||||||
{
|
|
||||||
delete fFilePanel;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ModulesView::DetachedFromWindow()
|
ModulesView::DetachedFromWindow()
|
||||||
{
|
{
|
||||||
@@ -588,7 +572,6 @@ ModulesView::AttachedToWindow()
|
|||||||
{
|
{
|
||||||
fScreenSaversListView->SetTarget(this);
|
fScreenSaversListView->SetTarget(this);
|
||||||
fTestButton->SetTarget(this);
|
fTestButton->SetTarget(this);
|
||||||
fAddButton->SetTarget(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -659,10 +642,6 @@ ModulesView::MessageReceived(BMessage* message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kMsgAddSaver:
|
|
||||||
fFilePanel->Show();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case B_SOME_APP_QUIT:
|
case B_SOME_APP_QUIT:
|
||||||
{
|
{
|
||||||
team_id team;
|
team_id team;
|
||||||
|
|||||||
Reference in New Issue
Block a user