You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
2.3 KiB
87 lines
2.3 KiB
15 years ago
|
/*
|
||
|
This file is part of KOrganizer.
|
||
|
Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
12 years ago
|
#include <tdeaction.h>
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
#include <kstandarddirs.h>
|
||
|
|
||
|
#include "engine.h"
|
||
|
|
||
|
#include "knewstuff.h"
|
||
|
|
||
|
using namespace KNS;
|
||
|
|
||
12 years ago
|
TDEAction* KNS::standardAction(const TQString& what,
|
||
14 years ago
|
const TQObject *recvr,
|
||
12 years ago
|
const char *slot, TDEActionCollection* parent,
|
||
15 years ago
|
const char *name)
|
||
|
{
|
||
12 years ago
|
return new TDEAction(i18n("Download New %1").arg(what), "knewstuff",
|
||
15 years ago
|
0, recvr, slot, parent, name);
|
||
|
}
|
||
|
|
||
10 years ago
|
TDENewStuff::TDENewStuff( const TQString &type, TQWidget *parentWidget )
|
||
15 years ago
|
{
|
||
14 years ago
|
mEngine = new Engine( this, type, parentWidget );
|
||
15 years ago
|
}
|
||
|
|
||
10 years ago
|
TDENewStuff::TDENewStuff( const TQString &type, const TQString &providerList, TQWidget *parentWidget )
|
||
15 years ago
|
{
|
||
14 years ago
|
mEngine = new Engine( this, type, providerList, parentWidget );
|
||
15 years ago
|
}
|
||
|
|
||
10 years ago
|
TQString TDENewStuff::type() const
|
||
15 years ago
|
{
|
||
|
return mEngine->type();
|
||
|
}
|
||
|
|
||
10 years ago
|
TQWidget *TDENewStuff::parentWidget() const
|
||
15 years ago
|
{
|
||
14 years ago
|
return mEngine->parentWidget();
|
||
15 years ago
|
}
|
||
|
|
||
10 years ago
|
TDENewStuff::~TDENewStuff()
|
||
15 years ago
|
{
|
||
|
delete mEngine;
|
||
|
}
|
||
|
|
||
10 years ago
|
void TDENewStuff::download()
|
||
15 years ago
|
{
|
||
|
mEngine->download();
|
||
|
}
|
||
|
|
||
10 years ago
|
TQString TDENewStuff::downloadDestination( Entry * )
|
||
15 years ago
|
{
|
||
12 years ago
|
return TDEGlobal::dirs()->saveLocation( "tmp" ) +
|
||
12 years ago
|
TDEApplication::randomString( 10 );
|
||
15 years ago
|
}
|
||
|
|
||
10 years ago
|
void TDENewStuff::upload()
|
||
15 years ago
|
{
|
||
|
mEngine->upload();
|
||
|
}
|
||
|
|
||
10 years ago
|
void TDENewStuff::upload( const TQString &fileName, const TQString previewName )
|
||
15 years ago
|
{
|
||
|
mEngine->upload(fileName, previewName);
|
||
|
}
|