Source Code (Use browser search to find items of interest.)

Class Index

kcontrol'KThemesApplication (./kdebase/kcontrol/themes/main.cpp:47)

class KThemesApplication : public KControlApplication
{
public:

  KThemesApplication(int &argc, char **arg, const char *name);
  ~KThemesApplication();

  virtual void init();
  virtual void apply();
  virtual void defaultValues();

protected:
  virtual void tweakUi(void);

private:
  Installer* mInstaller;
  Options* mOptions;
  About* mAbout;
};



//-----------------------------------------------------------------------------
KThemesApplication::KThemesApplication(int &argc, char **argv, const char *name)
  : KControlApplication(argc, argv, name)
{
  initMetaObject();
  init();

  mInstaller = NULL;
  theme = new ThemeCreator;

  if (runGUI())
  {
    tweakUi();

    addPage(mInstaller = new Installer(dialog), i18n("Installer"), "index-1.html" );
    addPage(mOptions = new Options(dialog), i18n("Contents"), "index-2.html" );
    addPage(mAbout = new About(dialog), i18n("About"), "index-3.html" );

    dialog->show();
  }
}


//-----------------------------------------------------------------------------
KThemesApplication::~KThemesApplication()
{
  if (theme) delete theme;
}


//-----------------------------------------------------------------------------
void KThemesApplication::tweakUi()
{
  KControlDialog* dlg = (KControlDialog*)getDialog();

  dlg->defaultBtn->setText(i18n("Extract"));
}


//-----------------------------------------------------------------------------
void KThemesApplication::init()
{
  //debug(i18n("No init necessary"));
    KGlobal::dirs()->addResourceType("themes", KStandardDirs::kde_default("data") + kapp->name() + "/Themes/");
}


//-----------------------------------------------------------------------------
void KThemesApplication::defaultValues()
{
  theme->extract();
}


//-----------------------------------------------------------------------------
void KThemesApplication::apply()
{
  mAbout->applySettings();
  mOptions->applySettings();
  mInstaller->applySettings();
  theme->install();
}


//=============================================================================
// Message handler

kcontrol'KThemesApplication::apply() (./kdebase/kcontrol/themes/main.cpp:124)

void KThemesApplication::apply()
{
  mAbout->applySettings();
  mOptions->applySettings();
  mInstaller->applySettings();
  theme->install();
}


//=============================================================================
// Message handler