1 /* showabout.cpp */
2 #include <kapp.h>
3 #include <qpushbutton.h>
4 #include <qlayout.h>
5 #include <kaboutdialog.h>
6 #include <kcmdlineargs.h>
7 #include “showabout.h”
8
9 int main(int argc,char **argv)
10 {
11 KCmdLineArgs::init(argc,argv,”showabout”,
12 “About Boxes”,”0.0”);
13 KApplication app;
14 ShowAbout showabout;
15 showabout.show();
16 app.setMainWidget(&showabout);
17 return(app.exec());
18 }
19
20 ShowAbout::ShowAbout(QWidget *parent,const char *name)
21 : QWidget(parent,name)
22 {
23 QPushButton *button;
24 QVBoxLayout *box = new QVBoxLayout(this);
25
26 button = new QPushButton(“Empty”,this);
27 box->addWidget(button);
28 connect(button,SIGNAL(clicked()),
29 this,SLOT(emptyAbout()));
30
31 button = new QPushButton(“Simple”,this);
32 box->addWidget(button);
33 connect(button,SIGNAL(clicked()),
34 this,SLOT(simpleAbout()));
35
36 button = new QPushButton(“KDE Standard”,this);
37 box->addWidget(button);
38 connect(button,SIGNAL(clicked()),
39 this,SLOT(kdeStandardAbout()));
40
41 button = new QPushButton(“App Standard”,this);
42 box->addWidget(button);
43 connect(button,SIGNAL(clicked()),
44 this,SLOT(appStandardAbout()));
45
46 resize(10,10);
47 box->activate();
48 }
49 void ShowAbout::emptyAbout()
50 {
51 KAboutDialog *about = new KAboutDialog(0,”about”);
52 about->exec();
53 }
54 void ShowAbout::simpleAbout()
55 {
56 KAboutDialog *about = new KAboutDialog(0,”about”);
57
58 about->setCaption(“Simple About Configuration”);
59 about->setVersion(“Version 0.0.1”);
60
61 QPixmap logo;
62 if(logo.load(“tinylogo.png”))
63 about->setLogo(logo);
64
65 about->setAuthor(“Bertha D Blues”,
66 “
bertha@belugalake.com”,
67 “
http://www.belugalake.com”,
68 “Mallet Operator”);
69
70 about->setMaintainer(“Tony Stryovie”,
71 “
stryovie@belugalake.com”,
72 “
http://www.belugalake.com”,
73 “Finder of Lost Code”);
74
75 about->addContributor(“Walter Heater”,
76 “
heat@belugalake.com”,
77 “
http://www.belugalake.com”,
78 “Asker of Questions”);
79
80 about->exec();
81 }
82 void ShowAbout::kdeStandardAbout()
83 {
84 KAboutDialog *about = new KAboutDialog(
85 KAboutDialog::AbtKDEStandard,
86 “KDE Standard Configuration”,
87 KDialogBase::Ok | KDialogBase::Help,
88 KDialogBase::Ok,
89 this,
90 “about”,
91 TRUE);
92
93 about->setTitle(“The example that is all about About”);
94 about->setCaption(“KDE Standard About”);
95 about->setImage(“penguin1.png”);
96 about->setImageBackgroundColor(QColor(“red”));
97 about->setImageFrame(TRUE);
98
99 about->addTextPage(“Purpose”,
100 “This program is intended to provide an “
101 “example that\ndemonstrates how to use “
102 “the KAboutDialog.”);
103 about->addTextPage(“Version”,
104 “Version 0.0.1 pre-alpha experimental.\n”
105 “Saturday, April 1, 2000”);
106
107 about->exec();
108 }
109 void ShowAbout::appStandardAbout()
110 {
111 KAboutDialog *about = new KAboutDialog(
112 KAboutDialog::AbtAppStandard,
113 “App Configuration”,
114 KDialogBase::Ok,
115 KDialogBase::Ok,
116 this,
117 “about”,
118 TRUE);
119
120 about->setTitle(“The example that is about About”);
121 about->setProduct(“ShowAbout”,
122 “0.0.1 Pre-Alpha”,
123 “Bertha D Blues”,
124 “Saturday, April 1, 2000”);
125
126 about->addTextPage(“Purpose”,
127 “This program is intended to provide an “
128 “example that\ndemonstrates how to use “
129 “the KAboutDialog.”);
130 about->addTextPage(“Version”,
131 “Version 0.0.1 pre-alpha experimental.\n”
132 “Saturday, April 1, 2000”);
133
134 about->exec();
135 }