diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kcontrol/kdm/kdm-appear.cpp | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/kdm/kdm-appear.cpp')
-rw-r--r-- | kcontrol/kdm/kdm-appear.cpp | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/kcontrol/kdm/kdm-appear.cpp b/kcontrol/kdm/kdm-appear.cpp index 7d1d034ca..58696902b 100644 --- a/kcontrol/kdm/kdm-appear.cpp +++ b/kcontrol/kdm/kdm-appear.cpp @@ -23,14 +23,14 @@ #include <sys/types.h> -#include <qbuttongroup.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qwhatsthis.h> -#include <qvalidator.h> -#include <qstylefactory.h> -#include <qstyle.h> +#include <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqwhatsthis.h> +#include <tqvalidator.h> +#include <tqstylefactory.h> +#include <tqstyle.h> #include <klocale.h> #include <klineedit.h> @@ -49,29 +49,29 @@ extern KSimpleConfig *config; -KDMAppearanceWidget::KDMAppearanceWidget(QWidget *parent, const char *name) - : QWidget(parent, name) +KDMAppearanceWidget::KDMAppearanceWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - QString wtstr; + TQString wtstr; - QVBoxLayout *vbox = new QVBoxLayout(this, KDialog::marginHint(), + TQVBoxLayout *vbox = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "vbox"); - QGroupBox *group = new QGroupBox(i18n("Appearance"), this); + TQGroupBox *group = new TQGroupBox(i18n("Appearance"), this); vbox->addWidget(group); - QGridLayout *grid = new QGridLayout( group, 5, 2, KDialog::marginHint(), + TQGridLayout *grid = new TQGridLayout( group, 5, 2, KDialog::marginHint(), KDialog::spacingHint(), "grid"); grid->addRowSpacing(0, group->fontMetrics().height()); grid->setColStretch(0, 1); grid->setColStretch(1, 1); - QHBoxLayout *hlay = new QHBoxLayout( KDialog::spacingHint() ); + TQHBoxLayout *hlay = new TQHBoxLayout( KDialog::spacingHint() ); grid->addMultiCellLayout(hlay, 1,1, 0,1); greetstr_lined = new KLineEdit(group); - QLabel *label = new QLabel(greetstr_lined, i18n("&Greeting:"), group); + TQLabel *label = new TQLabel(greetstr_lined, i18n("&Greeting:"), group); hlay->addWidget(label); - connect(greetstr_lined, SIGNAL(textChanged(const QString&)), - SLOT(changed())); + connect(greetstr_lined, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(changed())); hlay->addWidget(greetstr_lined); wtstr = i18n("This is the \"headline\" for KDM's login window. You may want to " "put some nice greeting or information about the operating system here.<p>" @@ -85,24 +85,24 @@ KDMAppearanceWidget::KDMAppearanceWidget(QWidget *parent, const char *name) "<li>%m -> the machine (hardware) type</li>" "<li>%% -> a single %</li>" "</ul>" ); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( greetstr_lined, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( greetstr_lined, wtstr ); - QGridLayout *hglay = new QGridLayout( 3, 4, KDialog::spacingHint() ); + TQGridLayout *hglay = new TQGridLayout( 3, 4, KDialog::spacingHint() ); grid->addMultiCellLayout(hglay, 2,4, 0,0); - label = new QLabel(i18n("Logo area:"), group); + label = new TQLabel(i18n("Logo area:"), group); hglay->addWidget(label, 0, 0); - QVBoxLayout *vlay = new QVBoxLayout( KDialog::spacingHint() ); + TQVBoxLayout *vlay = new TQVBoxLayout( KDialog::spacingHint() ); hglay->addMultiCellLayout(vlay, 0,0, 1,2); - noneRadio = new QRadioButton( i18n("logo area", "&None"), group ); - clockRadio = new QRadioButton( i18n("Show cloc&k"), group ); - logoRadio = new QRadioButton( i18n("Sho&w logo"), group ); - QButtonGroup *buttonGroup = new QButtonGroup( group ); + noneRadio = new TQRadioButton( i18n("logo area", "&None"), group ); + clockRadio = new TQRadioButton( i18n("Show cloc&k"), group ); + logoRadio = new TQRadioButton( i18n("Sho&w logo"), group ); + TQButtonGroup *buttonGroup = new TQButtonGroup( group ); label->setBuddy( buttonGroup ); - connect( buttonGroup, SIGNAL(clicked(int)), SLOT(slotAreaRadioClicked(int)) ); - connect( buttonGroup, SIGNAL(clicked(int)), SLOT(changed()) ); + connect( buttonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotAreaRadioClicked(int)) ); + connect( buttonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(changed()) ); buttonGroup->hide(); buttonGroup->insert(noneRadio, KdmNone); buttonGroup->insert(clockRadio, KdmClock); @@ -111,61 +111,61 @@ KDMAppearanceWidget::KDMAppearanceWidget(QWidget *parent, const char *name) vlay->addWidget(clockRadio); vlay->addWidget(logoRadio); wtstr = i18n("You can choose to display a custom logo (see below), a clock or no logo at all."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( noneRadio, wtstr ); - QWhatsThis::add( logoRadio, wtstr ); - QWhatsThis::add( clockRadio, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( noneRadio, wtstr ); + TQWhatsThis::add( logoRadio, wtstr ); + TQWhatsThis::add( clockRadio, wtstr ); - logoLabel = new QLabel(i18n("&Logo:"), group); - logobutton = new QPushButton(group); + logoLabel = new TQLabel(i18n("&Logo:"), group); + logobutton = new TQPushButton(group); logoLabel->setBuddy( logobutton ); logobutton->setAutoDefault(false); logobutton->setAcceptDrops(true); logobutton->installEventFilter(this); // for drag and drop - connect(logobutton, SIGNAL(clicked()), SLOT(slotLogoButtonClicked())); + connect(logobutton, TQT_SIGNAL(clicked()), TQT_SLOT(slotLogoButtonClicked())); hglay->addWidget(logoLabel, 1, 0); hglay->addWidget(logobutton, 1, 1, AlignCenter); hglay->addRowSpacing(1, 110); wtstr = i18n("Click here to choose an image that KDM will display. " "You can also drag and drop an image onto this button " "(e.g. from Konqueror)."); - QWhatsThis::add( logoLabel, wtstr ); - QWhatsThis::add( logobutton, wtstr ); + TQWhatsThis::add( logoLabel, wtstr ); + TQWhatsThis::add( logobutton, wtstr ); hglay->addRowSpacing( 2, KDialog::spacingHint()); hglay->setColStretch( 3, 1); - hglay = new QGridLayout( 2, 3, KDialog::spacingHint() ); + hglay = new TQGridLayout( 2, 3, KDialog::spacingHint() ); grid->addLayout(hglay, 2, 1); - label = new QLabel(i18n("Position:"), group); + label = new TQLabel(i18n("Position:"), group); hglay->addMultiCellWidget(label, 0,1, 0,0, AlignVCenter); - QValidator *posValidator = new QIntValidator(0, 100, group); - QLabel *xLineLabel = new QLabel(i18n("&X:"), group); + TQValidator *posValidator = new TQIntValidator(0, 100, group); + TQLabel *xLineLabel = new TQLabel(i18n("&X:"), group); hglay->addWidget(xLineLabel, 0, 1); - xLineEdit = new QLineEdit (group); - connect( xLineEdit, SIGNAL( textChanged(const QString&) ), SLOT( changed() )); + xLineEdit = new TQLineEdit (group); + connect( xLineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( changed() )); hglay->addWidget(xLineEdit, 0, 2); xLineLabel->setBuddy(xLineEdit); xLineEdit->setValidator(posValidator); - QLabel *yLineLabel = new QLabel(i18n("&Y:"), group); + TQLabel *yLineLabel = new TQLabel(i18n("&Y:"), group); hglay->addWidget(yLineLabel, 1, 1); - yLineEdit = new QLineEdit (group); - connect( yLineEdit, SIGNAL( textChanged(const QString&) ), SLOT( changed() )); + yLineEdit = new TQLineEdit (group); + connect( yLineEdit, TQT_SIGNAL( textChanged(const TQString&) ), TQT_SLOT( changed() )); hglay->addWidget(yLineEdit, 1, 2); yLineLabel->setBuddy(yLineEdit); yLineEdit->setValidator(posValidator); wtstr = i18n("Here you specify the relative coordinates (in percent) of the login dialog's <em>center</em>."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( xLineLabel, wtstr ); - QWhatsThis::add( xLineEdit, wtstr ); - QWhatsThis::add( yLineLabel, wtstr ); - QWhatsThis::add( yLineEdit, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( xLineLabel, wtstr ); + TQWhatsThis::add( xLineEdit, wtstr ); + TQWhatsThis::add( yLineLabel, wtstr ); + TQWhatsThis::add( yLineEdit, wtstr ); hglay->setColStretch( 3, 1); hglay->setRowStretch( 2, 1); - hglay = new QGridLayout( 2, 3, KDialog::spacingHint() ); + hglay = new TQGridLayout( 2, 3, KDialog::spacingHint() ); grid->addLayout(hglay, 3, 1); hglay->setColStretch(3, 1); @@ -173,57 +173,57 @@ KDMAppearanceWidget::KDMAppearanceWidget(QWidget *parent, const char *name) guicombo->insertItem( "", i18n("<default>") ); loadGuiStyles(guicombo); guicombo->listBox()->sort(); - label = new QLabel(guicombo, i18n("GUI s&tyle:"), group); - connect(guicombo, SIGNAL(activated(int)), SLOT(changed())); + label = new TQLabel(guicombo, i18n("GUI s&tyle:"), group); + connect(guicombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); hglay->addWidget(label, 0, 0); hglay->addWidget(guicombo, 0, 1); wtstr = i18n("You can choose a basic GUI style here that will be " "used by KDM only."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( guicombo, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( guicombo, wtstr ); colcombo = new KBackedComboBox(group); colcombo->insertItem( "", i18n("<default>") ); loadColorSchemes(colcombo); colcombo->listBox()->sort(); - label = new QLabel(colcombo, i18n("&Color scheme:"), group); - connect(colcombo, SIGNAL(activated(int)), SLOT(changed())); + label = new TQLabel(colcombo, i18n("&Color scheme:"), group); + connect(colcombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); hglay->addWidget(label, 1, 0); hglay->addWidget(colcombo, 1, 1); wtstr = i18n("You can choose a basic Color Scheme here that will be " "used by KDM only."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( colcombo, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( colcombo, wtstr ); echocombo = new KBackedComboBox(group); echocombo->insertItem("NoEcho", i18n("No Echo")); echocombo->insertItem("OneStar", i18n("One Star")); echocombo->insertItem("ThreeStars", i18n("Three Stars")); - label = new QLabel(echocombo, i18n("Echo &mode:"), group); - connect(echocombo, SIGNAL(activated(int)), SLOT(changed())); + label = new TQLabel(echocombo, i18n("Echo &mode:"), group); + connect(echocombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); hglay->addWidget(label, 2, 0); hglay->addWidget(echocombo, 2, 1); wtstr = i18n("You can choose whether and how KDM shows your password when you type it."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( echocombo, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( echocombo, wtstr ); // The Language group box - group = new QGroupBox(0, Vertical, i18n("Locale"), this); + group = new TQGroupBox(0, Vertical, i18n("Locale"), this); vbox->addWidget(group); langcombo = new KLanguageButton(group); loadLanguageList(langcombo); - connect(langcombo, SIGNAL(activated(const QString &)), SLOT(changed())); - label = new QLabel(langcombo, i18n("Languag&e:"), group); - QGridLayout *hbox = new QGridLayout( group->layout(), 2, 2, KDialog::spacingHint() ); + connect(langcombo, TQT_SIGNAL(activated(const TQString &)), TQT_SLOT(changed())); + label = new TQLabel(langcombo, i18n("Languag&e:"), group); + TQGridLayout *hbox = new TQGridLayout( group->layout(), 2, 2, KDialog::spacingHint() ); hbox->setColStretch(1, 1); hbox->addWidget(label, 1, 0); hbox->addWidget(langcombo, 1, 1); wtstr = i18n("Here you can choose the language used by KDM. This setting does not affect" " a user's personal settings; that will take effect after login."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( langcombo, wtstr ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( langcombo, wtstr ); vbox->addStretch(1); @@ -232,8 +232,8 @@ KDMAppearanceWidget::KDMAppearanceWidget(QWidget *parent, const char *name) void KDMAppearanceWidget::makeReadOnly() { - disconnect( logobutton, SIGNAL(clicked()), - this, SLOT(slotLogoButtonClicked()) ); + disconnect( logobutton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotLogoButtonClicked()) ); logobutton->setAcceptDrops(false); greetstr_lined->setReadOnly(true); noneRadio->setEnabled(false); @@ -249,38 +249,38 @@ void KDMAppearanceWidget::makeReadOnly() void KDMAppearanceWidget::loadLanguageList(KLanguageButton *combo) { - QStringList langlist = KGlobal::dirs()->findAllResources("locale", - QString::fromLatin1("*/entry.desktop")); + TQStringList langlist = KGlobal::dirs()->findAllResources("locale", + TQString::fromLatin1("*/entry.desktop")); langlist.sort(); - for ( QStringList::ConstIterator it = langlist.begin(); + for ( TQStringList::ConstIterator it = langlist.begin(); it != langlist.end(); ++it ) { - QString fpath = (*it).left((*it).length() - 14); + TQString fpath = (*it).left((*it).length() - 14); int index = fpath.findRev('/'); - QString nid = fpath.mid(index + 1); + TQString nid = fpath.mid(index + 1); KSimpleConfig entry(*it); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name"), i18n("without name")); - combo->insertLanguage(nid, name, QString::fromLatin1("l10n/"), QString::null); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name"), i18n("without name")); + combo->insertLanguage(nid, name, TQString::fromLatin1("l10n/"), TQString::null); } } void KDMAppearanceWidget::loadColorSchemes(KBackedComboBox *combo) { // XXX: Global + local schemes - QStringList list = KGlobal::dirs()-> + TQStringList list = KGlobal::dirs()-> findAllResources("data", "kdisplay/color-schemes/*.kcsrc", false, true); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig config(*it, true); config.setGroup("Color Scheme"); - QString str; + TQString str; if (!(str = config.readEntry("Name")).isEmpty() || !(str = config.readEntry("name")).isEmpty()) { - QString str2 = (*it).mid( (*it).findRev( '/' ) + 1 ); // strip off path + TQString str2 = (*it).mid( (*it).findRev( '/' ) + 1 ); // strip off path str2.setLength( str2.length() - 6 ); // strip off ".kcsrc combo->insertItem( str2, str ); } @@ -290,9 +290,9 @@ void KDMAppearanceWidget::loadColorSchemes(KBackedComboBox *combo) void KDMAppearanceWidget::loadGuiStyles(KBackedComboBox *combo) { // XXX: Global + local schemes - QStringList list = KGlobal::dirs()-> + TQStringList list = KGlobal::dirs()-> findAllResources("data", "kstyle/themes/*.themerc", false, true); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig config(*it, true); @@ -304,7 +304,7 @@ void KDMAppearanceWidget::loadGuiStyles(KBackedComboBox *combo) continue; config.setGroup("KDE"); - QString str2 = config.readEntry("WidgetStyle"); + TQString str2 = config.readEntry("WidgetStyle"); if (str2.isNull()) continue; @@ -313,18 +313,18 @@ void KDMAppearanceWidget::loadGuiStyles(KBackedComboBox *combo) } } -bool KDMAppearanceWidget::setLogo(QString logo) +bool KDMAppearanceWidget::setLogo(TQString logo) { - QString flogo = logo.isEmpty() ? - locate("data", QString::fromLatin1("kdm/pics/kdelogo.png") ) : + TQString flogo = logo.isEmpty() ? + locate("data", TQString::fromLatin1("kdm/pics/kdelogo.png") ) : logo; - QImage p(flogo); + TQImage p(flogo); if (p.isNull()) return false; if (p.width() > 100 || p.height() > 100) - p = p.smoothScale(100, 100, QImage::ScaleMin); + p = p.smoothScale(100, 100, TQImage::ScaleMin); logobutton->setPixmap(p); - uint bd = style().pixelMetric( QStyle::PM_ButtonMargin ) * 2; + uint bd = style().pixelMetric( TQStyle::PM_ButtonMargin ) * 2; logobutton->setFixedSize(p.width() + bd, p.height() + bd); logopath = logo; return true; @@ -334,7 +334,7 @@ bool KDMAppearanceWidget::setLogo(QString logo) void KDMAppearanceWidget::slotLogoButtonClicked() { KImageIO::registerFormats(); - KFileDialog dialogue(locate("data", QString::fromLatin1("kdm/pics/")), + KFileDialog dialogue(locate("data", TQString::fromLatin1("kdm/pics/")), KImageIO::pattern( KImageIO::Reading ), this, 0, true); dialogue.setOperationMode( KFileDialog::Opening ); @@ -342,7 +342,7 @@ void KDMAppearanceWidget::slotLogoButtonClicked() KImageFilePreview* imagePreview = new KImageFilePreview( &dialogue ); dialogue.setPreviewWidget( imagePreview ); - if (dialogue.exec() == QDialog::Accepted) { + if (dialogue.exec() == TQDialog::Accepted) { if ( setLogo(dialogue.selectedFile()) ) { changed(); } @@ -357,30 +357,30 @@ void KDMAppearanceWidget::slotAreaRadioClicked(int id) } -bool KDMAppearanceWidget::eventFilter(QObject *, QEvent *e) +bool KDMAppearanceWidget::eventFilter(TQObject *, TQEvent *e) { - if (e->type() == QEvent::DragEnter) { - iconLoaderDragEnterEvent((QDragEnterEvent *) e); + if (e->type() == TQEvent::DragEnter) { + iconLoaderDragEnterEvent((TQDragEnterEvent *) e); return true; } - if (e->type() == QEvent::Drop) { - iconLoaderDropEvent((QDropEvent *) e); + if (e->type() == TQEvent::Drop) { + iconLoaderDropEvent((TQDropEvent *) e); return true; } return false; } -void KDMAppearanceWidget::iconLoaderDragEnterEvent(QDragEnterEvent *e) +void KDMAppearanceWidget::iconLoaderDragEnterEvent(TQDragEnterEvent *e) { e->accept(KURLDrag::canDecode(e)); } -KURL *decodeImgDrop(QDropEvent *e, QWidget *wdg); +KURL *decodeImgDrop(TQDropEvent *e, TQWidget *wdg); -void KDMAppearanceWidget::iconLoaderDropEvent(QDropEvent *e) +void KDMAppearanceWidget::iconLoaderDropEvent(TQDropEvent *e) { KURL pixurl; bool istmp; @@ -402,7 +402,7 @@ void KDMAppearanceWidget::iconLoaderDropEvent(QDropEvent *e) // By now url should be "file:/..." if (!setLogo(pixurl.path())) { KIO::NetAccess::del(pixurl, parentWidget()); - QString msg = i18n("There was an error loading the image:\n" + TQString msg = i18n("There was an error loading the image:\n" "%1\n" "It will not be saved.") .arg(pixurl.path()); @@ -445,7 +445,7 @@ void KDMAppearanceWidget::load() greetstr_lined->setText(config->readEntry("GreetString", i18n("Welcome to Kubuntu at %n"))); // Regular logo or clock - QString logoArea = config->readEntry("LogoArea", "Logo" ); + TQString logoArea = config->readEntry("LogoArea", "Logo" ); if (logoArea == "Clock") { clockRadio->setChecked(true); slotAreaRadioClicked(KdmClock); @@ -469,7 +469,7 @@ void KDMAppearanceWidget::load() // Check the echo mode echocombo->setCurrentId(config->readEntry("EchoMode", "OneStar")); - QStringList sl = config->readListEntry( "GreeterPos" ); + TQStringList sl = config->readListEntry( "GreeterPos" ); if (sl.count() != 2) { xLineEdit->setText( "50" ); yLineEdit->setText( "50" ); @@ -499,7 +499,7 @@ void KDMAppearanceWidget::defaults() langcombo->setCurrentItem( "en_US" ); } -QString KDMAppearanceWidget::quickHelp() const +TQString KDMAppearanceWidget::quickHelp() const { return i18n("<h1>KDM - Appearance</h1> Here you can configure the basic appearance" " of the KDM login manager, i.e. a greeting string, an icon etc.<p>" |