|
|
|
@ -29,7 +29,7 @@
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
#include "sknewstuff.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ ThemesDlg::ThemesDlg(TQWidget *parent, const char *name)
|
|
|
|
|
: ThemesLayout(parent, name)
|
|
|
|
|
{
|
|
|
|
|
populateListbox();
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
mNewStuff = 0;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -64,7 +64,7 @@ ThemesDlg::~ThemesDlg()
|
|
|
|
|
{
|
|
|
|
|
//kdDebug() << k_funcinfo << endl;
|
|
|
|
|
saveUserAddedThemes();
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
if(mNewStuff)
|
|
|
|
|
{
|
|
|
|
|
delete mNewStuff;
|
|
|
|
@ -132,7 +132,7 @@ void ThemesDlg::populateListbox()
|
|
|
|
|
item->setDescriptionText(i18n("Download new themes."));
|
|
|
|
|
|
|
|
|
|
item->buttonGo->setText(i18n("New Stuff..."));
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
item->buttonGo->setEnabled(true);
|
|
|
|
|
connect(item->buttonGo, TQT_SIGNAL(clicked()),
|
|
|
|
|
this, TQT_SLOT(getNewStuff()));
|
|
|
|
@ -216,14 +216,14 @@ void ThemesDlg::openLocalTheme()
|
|
|
|
|
|
|
|
|
|
void ThemesDlg::getNewStuff()
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
|
config->setGroup("TDENewStuff");
|
|
|
|
|
config->writePathEntry("ProvidersUrl",
|
|
|
|
|
TQString::fromLatin1("https://www.trinitydesktop.org/ocs/karamba-providers.xml"));
|
|
|
|
|
config->sync();
|
|
|
|
|
m_newStuffStatus = config->entryMap("TDENewStuffStatus").keys();
|
|
|
|
|
//This check is b/c KNewStuff will download, throw an error,
|
|
|
|
|
//This check is b/c TDENewStuff will download, throw an error,
|
|
|
|
|
//and still have the entry in the config that it was successful
|
|
|
|
|
configSanityCheck();
|
|
|
|
|
|
|
|
|
@ -300,7 +300,7 @@ void ThemesDlg::addThemeToDialog(const KArchiveDirectory *archiveDir,
|
|
|
|
|
|
|
|
|
|
void ThemesDlg::writeNewStuffConfig(const TQString &file)
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
|
TQStringList keys = config->entryMap("TDENewStuffStatus").keys();
|
|
|
|
|
|
|
|
|
@ -320,7 +320,7 @@ void ThemesDlg::writeNewStuffConfig(const TQString &file)
|
|
|
|
|
|
|
|
|
|
void ThemesDlg::configSanityCheck()
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
|
TQStringList statusKeys = config->entryMap("TDENewStuffStatus").keys();
|
|
|
|
|
TQStringList nameKeys = config->entryMap("TDENewStuffNames").keys();
|
|
|
|
@ -476,18 +476,18 @@ void ThemesDlg::uninstall()
|
|
|
|
|
karambaApp->dcopIface()->closeTheme(twPtr->themeFile()->name());
|
|
|
|
|
tableThemes->removeItem( twPtr );
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
// Remove theme from KNewStuffStatus
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
// Remove theme from TDENewStuffStatus
|
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
|
config->setGroup("TDENewStuffNames");
|
|
|
|
|
TQString name = config->readEntry(tempPath);
|
|
|
|
|
if(!name.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
kdDebug() << "removing " << tempPath << " under KNewStuffNames from superkarambarc"
|
|
|
|
|
kdDebug() << "removing " << tempPath << " under TDENewStuffNames from superkarambarc"
|
|
|
|
|
<< endl;
|
|
|
|
|
kapp->config()->deleteEntry(tempPath);
|
|
|
|
|
config->setGroup("TDENewStuffStatus");
|
|
|
|
|
kdDebug() << "removing " << name << " under KNewStuffStatus from superkarambarc"
|
|
|
|
|
kdDebug() << "removing " << name << " under TDENewStuffStatus from superkarambarc"
|
|
|
|
|
<< endl;
|
|
|
|
|
kapp->config()->deleteEntry(name);
|
|
|
|
|
kapp->config()->sync();
|
|
|
|
@ -506,8 +506,8 @@ void ThemesDlg::uninstall()
|
|
|
|
|
TDEIO::move(remDir.path(), trash);
|
|
|
|
|
}
|
|
|
|
|
tableThemes->removeItem(w);
|
|
|
|
|
#ifdef HAVE_KNEWSTUFF
|
|
|
|
|
// Remove theme from KNewStuffStatus
|
|
|
|
|
#ifdef HAVE_TDENEWSTUFF
|
|
|
|
|
// Remove theme from TDENewStuffStatus
|
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
|
config->setGroup("TDENewStuffNames");
|
|
|
|
|
TQString name = config->readEntry(theme.path());
|
|
|
|
|