19
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
20
20
***************************************************************************/
22
#include <QDeclarativeContext>
24
27
#include <KStandardAction>
26
29
#include <Plasma/Theme>
28
31
#include "aboutapp.h"
32
#include "kdeclarativeview.h"
30
34
AboutApp::AboutApp()
35
: KDeclarativeMainWindow()
34
addAction(KStandardAction::close(this, SLOT(close()), this));
35
addAction(KStandardAction::quit(this, SLOT(close()), this));
36
m_widget = new AppView(this);
38
restoreWindowSize(config("Window"));
39
setCentralWidget(m_widget);
41
KConfigGroup cg(KSharedConfig::openConfig("plasmarc"), "Theme-plasma-mobile");
42
const QString themeName = cg.readEntry("name", "air-mobile");
43
Plasma::Theme::defaultTheme()->setUseGlobalSettings(false);
44
Plasma::Theme::defaultTheme()->setThemeName(themeName);
46
connect(m_widget, SIGNAL(titleChanged(QString)), SLOT(setCaption(QString)));
37
declarativeView()->setPackageName("org.kde.active.aboutapp");
39
//FIXME: find a prettier way
41
if (QFile::exists("/etc/image-release")) {
42
fn = "/etc/image-release";
47
f.open(QIODevice::ReadOnly);
48
const QString osVersion = f.readLine();
50
declarativeView()->rootContext()->setContextProperty("runtimeInfoActiveVersion", "2.0");
51
declarativeView()->rootContext()->setContextProperty("runtimeInfoKdeVersion", KDE::versionString());
52
declarativeView()->rootContext()->setContextProperty("runtimeInfoOsVersion", osVersion);
49
55
AboutApp::~AboutApp()
51
57
saveWindowSize(config("Window"));
54
KConfigGroup AboutApp::config(const QString &group)
56
return KConfigGroup(KSharedConfig::openConfig("active-aboutapprc"), group);
59
QString AboutApp::name()
61
return "About Plasma Active";
62
//return m_widget->options()->name;
65
QIcon AboutApp::icon()
67
return KIcon("active-about");
70
void AboutApp::setUseGL(const bool on)
72
m_widget->setUseGL(on);
75
bool AboutApp::useGL() const
77
return m_widget->useGL();
80
60
#include "aboutapp.moc"