~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/app_templates/kde4app/kapp4view.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%{CPP_TEMPLATE}
2
 
#include "%{APPNAMELC}view.h"
3
 
#include "settings.h"
4
 
 
5
 
#include <klocale.h>
6
 
#include <QtGui/QLabel>
7
 
 
8
 
%{APPNAME}View::%{APPNAME}View(QWidget *)
9
 
{
10
 
    ui_%{APPNAMELC}view_base.setupUi(this);
11
 
    settingsChanged();
12
 
    setAutoFillBackground(true);
13
 
}
14
 
 
15
 
%{APPNAME}View::~%{APPNAME}View()
16
 
{
17
 
 
18
 
}
19
 
 
20
 
void %{APPNAME}View::switchColors()
21
 
{
22
 
    // switch the foreground/background colors of the label
23
 
    QColor color = Settings::col_background();
24
 
    Settings::setCol_background( Settings::col_foreground() );
25
 
    Settings::setCol_foreground( color );
26
 
 
27
 
    settingsChanged();
28
 
}
29
 
 
30
 
void %{APPNAME}View::settingsChanged()
31
 
{
32
 
    QPalette pal;
33
 
    pal.setColor( QPalette::Window, Settings::col_background());
34
 
    pal.setColor( QPalette::WindowText, Settings::col_foreground());
35
 
    ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setPalette( pal );
36
 
 
37
 
    // i18n : internationalization
38
 
    ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setText( i18n("This project is %1 days old",Settings::val_time()) );
39
 
    emit signalChangeStatusbar( i18n("Settings changed") );
40
 
}
41
 
 
42
 
#include "%{APPNAMELC}view.moc"