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

Class Index

khelpcenter'KWelcome (./kdebase/khelpcenter/kwelcome/kwelcome.h:30)

class KWelcome : public QWidget
{
  Q_OBJECT

public:
  KWelcome(QWidget *parent = 0, const char *name = 0);
  virtual ~KWelcome();

public slots:
  void slotAboutKDE();
  void slotWizardStart();
  void slotHelpCenterStart();

private:
  QWidget *topView, *bottomView;
  QCheckBox *autostart_kwelcome;
  QPushButton *aboutButton, *quitButton, *wizardButton, *helpcenterButton;
  QLabel *welcome;

protected:
  void saveSettings();
  void readSettings();
};

khelpcenter'KWelcome::KWelcome() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:37)

KWelcome::KWelcome(QWidget *parent, const char *name)
	: QWidget(parent, name, WStyle_Tool)
{
  setCaption(i18n("Welcome to the K Desktop Environment!"));
  setFixedSize(559, 416);
  setGeometry(QApplication::desktop()->width()/2 - width()/2,
			  QApplication::desktop()->height()/2 - height()/2,
			  590, 416);

  // setup topView
  topView = new QWidget(this);
  topView->setBackgroundColor(QColor(255,255,255));
  
  // setup bottomView
  bottomView = new QWidget(this);
  bottomView->setMaximumHeight(30);
  bottomView->setMinimumHeight(30);
  
  // setup the top level layout manager
  QVBoxLayout *toplevel_l = new QVBoxLayout(this);
  toplevel_l->addWidget(topView);
  toplevel_l->addWidget(bottomView);
  toplevel_l->activate();
  
  // create quitButton
  quitButton = new QPushButton(i18n("&Quit"), bottomView);
  connect(quitButton, SIGNAL(clicked()), kapp, SLOT(quit()));
  quitButton->setFixedWidth(85);
  quitButton->setFixedHeight(26);
  quitButton->move(bottomView->width() - 85, 4);
 
  // create abouButton
  aboutButton = new QPushButton(i18n("&About KDE"), bottomView);
  connect(aboutButton, SIGNAL(clicked()), this, SLOT(slotAboutKDE()));
  aboutButton->setFixedWidth(95);
  aboutButton->setFixedHeight(26);
  aboutButton->move(bottomView->width() - 182, 4);
  
  // create 'start on every KDE startup' checkbox
  autostart_kwelcome = new QCheckBox(i18n("Show this dialog on KDE startup."), bottomView);
  autostart_kwelcome->setGeometry(2,7,200,28);
  autostart_kwelcome->setChecked(TRUE);
  autostart_kwelcome->setAutoResize(TRUE);
  
  // welcome image
  QLabel *welcome = new QLabel(topView);
  welcome->setGeometry(2,2,557,386);

  QPixmap welcome_pm(locate("data", "kwelcome/pics/welcome.png"));	
  welcome->setPixmap(welcome_pm);

  // create help center button
  helpcenterButton = new QPushButton(i18n("Get &help"), topView);
  connect(helpcenterButton, SIGNAL(clicked()), this, SLOT(slotHelpCenterStart()));
  helpcenterButton->setFixedWidth(133);
  helpcenterButton->setFixedHeight(26);
  helpcenterButton->move(15 ,330);
  
  // create configuration wizard button
  wizardButton = new QPushButton(i18n("Configuration &wizard"), topView);
  connect(wizardButton, SIGNAL(clicked()), this, SLOT(slotWizardStart()));
  wizardButton->setFixedWidth(173);
  wizardButton->setFixedHeight(26);
  wizardButton->move(17 + helpcenterButton->width(), 330);
	
  // read settings
  readSettings();
}


khelpcenter'KWelcome::~KWelcome() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:106)

KWelcome::~KWelcome()
{
  saveSettings();
}


khelpcenter'KWelcome::slotAboutKDE() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:111)

void KWelcome::slotAboutKDE()
{
  KMessageBox::about(0L,i18n("\nThe KDE Desktop Environment was written by the KDE Team,\n"
			  "a world-wide network of software engineers committed to\n"
			  "free software development.\n\n"
			  "Visit http://www.kde.org for more information on the KDE\n"
			  "Project. Please consider joining and supporting KDE.\n\n"
              "Please report bugs at http://bugs.kde.org.\n"),  i18n("About KDE"));
}


khelpcenter'KWelcome::slotWizardStart() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:121)

void KWelcome::slotWizardStart()
{
  KProcess proc;	
  proc << "kdewizard";
  proc.start(KProcess::DontCare);
}


khelpcenter'KWelcome::slotHelpCenterStart() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:128)

void KWelcome::slotHelpCenterStart()
{
  KProcess proc;	
  proc << "khelpcenter";
  proc.start(KProcess::DontCare);
}


khelpcenter'KWelcome::saveSettings() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:135)

void KWelcome::saveSettings()
{
  KConfig *conf = kapp->config();
  conf->setGroup("General Settings");
  if (autostart_kwelcome->isChecked())
	conf->writeEntry("AutostartOnKDEStartup", "true");
  else
	conf->writeEntry("AutostartOnKDEStartup", "false");
  conf->sync();
  cout << "KWelcome: configuration written." << endl;
}


khelpcenter'KWelcome::readSettings() (./kdebase/khelpcenter/kwelcome/kwelcome.cc:147)

void KWelcome::readSettings()
{
  KConfig *conf = kapp->config();
  conf->setGroup("General Settings");
  QString tmp = conf->readEntry("AutostartOnKDEStartup", "true");
  
  if (tmp == "true")
	autostart_kwelcome->setChecked(true);
  else
	autostart_kwelcome->setChecked(false);	
}