summaryrefslogtreecommitdiffstats
path: root/src/basketproperties.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
commitaa0726b20f398264f0a2abc60215be044b106f9c (patch)
tree070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/basketproperties.cpp
parentd3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff)
downloadbasket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz
basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip
TQt4 port basket
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/basketproperties.cpp')
-rw-r--r--src/basketproperties.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/basketproperties.cpp b/src/basketproperties.cpp
index 911be2a..28a0381 100644
--- a/src/basketproperties.cpp
+++ b/src/basketproperties.cpp
@@ -19,18 +19,18 @@
***************************************************************************/
#include <kicondialog.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qvbuttongroup.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqvbuttongroup.h>
#include <knuminput.h>
#include <kkeybutton.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qstringlist.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqstringlist.h>
#include <klocale.h>
-#include <qstyle.h>
+#include <tqstyle.h>
#include <kapplication.h>
#include <kiconloader.h>
#include <kglobalsettings.h>
@@ -42,54 +42,54 @@
#include "global.h"
#include "backgroundmanager.h"
-BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
+BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, TQWidget *tqparent)
: KDialogBase(KDialogBase::Swallow, i18n("Basket Properties"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"BasketProperties", /*modal=*/true, /*separator=*/false),
+ KDialogBase::Ok, tqparent, /*name=*/"BasketProperties", /*modal=*/true, /*separator=*/false),
m_basket(basket)
{
- QWidget *page = new QWidget(this);
- QVBoxLayout *topLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
// Icon and Name:
- QHBoxLayout *nameLayout = new QHBoxLayout(0, marginHint()*2/3, spacingHint());
+ TQHBoxLayout *nameLayout = new TQHBoxLayout(0, marginHint()*2/3, spacingHint());
m_icon = new KIconButton(page);
m_icon->setIconType(KIcon::NoGroup, KIcon::Action);
m_icon->setIconSize(16);
m_icon->setIcon(m_basket->icon());
- int size = QMAX(m_icon->sizeHint().width(), m_icon->sizeHint().height());
+ int size = TQMAX(m_icon->tqsizeHint().width(), m_icon->tqsizeHint().height());
m_icon->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_icon, i18n("Icon"));
- m_name = new QLineEdit(m_basket->basketName(), page);
+ TQToolTip::add(m_icon, i18n("Icon"));
+ m_name = new TQLineEdit(m_basket->basketName(), page);
m_name->setMinimumWidth(m_name->fontMetrics().maxWidth()*20);
- QToolTip::add(m_name, i18n("Name"));
+ TQToolTip::add(m_name, i18n("Name"));
nameLayout->addWidget(m_icon);
nameLayout->addWidget(m_name);
topLayout->addLayout(nameLayout);
// Appearance:
- QGroupBox *appearance = new QGroupBox(1, Qt::Horizontal, i18n("Appearance"), page);
- QWidget *appearanceWidget = new QWidget(appearance);
- QGridLayout *grid = new QGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
- m_backgroundImage = new QComboBox(appearanceWidget);
+ TQGroupBox *appearance = new TQGroupBox(1, Qt::Horizontal, i18n("Appearance"), page);
+ TQWidget *appearanceWidget = new TQWidget(appearance);
+ TQGridLayout *grid = new TQGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
+ m_backgroundImage = new TQComboBox(appearanceWidget);
m_backgroundColor = new KColorCombo2(m_basket->backgroundColorSetting(), KGlobalSettings::baseColor(), appearanceWidget);
m_textColor = new KColorCombo2(m_basket->textColorSetting(), KGlobalSettings::textColor(), appearanceWidget);
- QLabel *label1 = new QLabel(m_backgroundImage, i18n("Background &image:"), appearanceWidget);
- QLabel *label2 = new QLabel(m_backgroundColor, i18n("&Background color:"), appearanceWidget);
- QLabel *label3 = new QLabel(m_textColor, i18n("&Text color:"), appearanceWidget);
- grid->addWidget(label1, 0, 0, Qt::AlignVCenter);
- grid->addWidget(label2, 1, 0, Qt::AlignVCenter);
- grid->addWidget(label3, 2, 0, Qt::AlignVCenter);
- grid->addWidget(m_backgroundImage, 0, 1, Qt::AlignVCenter);
- grid->addWidget(m_backgroundColor, 1, 1, Qt::AlignVCenter);
- grid->addWidget(m_textColor, 2, 1, Qt::AlignVCenter);
+ TQLabel *label1 = new TQLabel(m_backgroundImage, i18n("Background &image:"), appearanceWidget);
+ TQLabel *label2 = new TQLabel(m_backgroundColor, i18n("&Background color:"), appearanceWidget);
+ TQLabel *label3 = new TQLabel(m_textColor, i18n("&Text color:"), appearanceWidget);
+ grid->addWidget(label1, 0, 0, TQt::AlignVCenter);
+ grid->addWidget(label2, 1, 0, TQt::AlignVCenter);
+ grid->addWidget(label3, 2, 0, TQt::AlignVCenter);
+ grid->addWidget(m_backgroundImage, 0, 1, TQt::AlignVCenter);
+ grid->addWidget(m_backgroundColor, 1, 1, TQt::AlignVCenter);
+ grid->addWidget(m_textColor, 2, 1, TQt::AlignVCenter);
topLayout->addWidget(appearance);
m_backgroundImage->insertItem(i18n("(None)"), 0);
m_backgroundImagesMap.insert(0, "");
- QStringList backgrounds = Global::backgroundManager->imageNames();
+ TQStringList backgrounds = Global::backgroundManager->imageNames();
int index = 1;
- for (QStringList::Iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) {
- QPixmap *preview = Global::backgroundManager->preview(*it);
+ for (TQStringList::Iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) {
+ TQPixmap *preview = Global::backgroundManager->preview(*it);
if (preview) {
m_backgroundImagesMap.insert(index, *it);
m_backgroundImage->insertItem(*preview, index);
@@ -99,37 +99,37 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
}
}
// m_backgroundImage->insertItem(i18n("Other..."), -1);
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
- m_backgroundImage->setSizeLimit(50/*75 * 6 / m_backgroundImage->sizeHint().height()*/);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ m_backgroundImage->setSizeLimit(50/*75 * 6 / m_backgroundImage->tqsizeHint().height()*/);
m_backgroundImage->setMinimumHeight(75 + 2 * BUTTON_MARGIN);
// Disposition:
- m_disposition = new QVButtonGroup(i18n("Disposition"), page);
- QWidget *columnsWidget = new QWidget(m_disposition);
- QHBoxLayout *dispoLayout = new QHBoxLayout(columnsWidget, /*margin=*/0, spacingHint());
- QRadioButton *radio = new QRadioButton(i18n("Col&umns:"), columnsWidget);
+ m_disposition = new TQVButtonGroup(i18n("Disposition"), page);
+ TQWidget *columnsWidget = new TQWidget(m_disposition);
+ TQHBoxLayout *dispoLayout = new TQHBoxLayout(columnsWidget, /*margin=*/0, spacingHint());
+ TQRadioButton *radio = new TQRadioButton(i18n("Col&umns:"), columnsWidget);
m_columnCount = new KIntNumInput(m_basket->columnsCount(), columnsWidget);
m_columnCount->setRange(1, 20, /*step=*/1, /*slider=*/false);
m_columnCount->setValue(m_basket->columnsCount());
- connect( m_columnCount, SIGNAL(valueChanged(int)), this, SLOT(selectColumnsLayout()) );
+ connect( m_columnCount, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(selectColumnsLayout()) );
dispoLayout->addWidget(radio);
dispoLayout->addWidget(m_columnCount);
m_disposition->insert(radio);
- new QRadioButton(i18n("&Free-form"), m_disposition);
- QRadioButton *mindMap = new QRadioButton(i18n("&Mind map"), m_disposition); // TODO: "Learn more..."
- int height = QMAX(mindMap->sizeHint().height(), m_columnCount->sizeHint().height()); // Make all radioButtons vertically equaly-spaced!
- mindMap->setMinimumSize(mindMap->sizeHint().width(), height); // Because the m_columnCount can be heigher, and make radio1 and radio2 more spaced than radio2 and radio3.
+ new TQRadioButton(i18n("&Free-form"), m_disposition);
+ TQRadioButton *mindMap = new TQRadioButton(i18n("&Mind map"), m_disposition); // TODO: "Learn more..."
+ int height = TQMAX(mindMap->tqsizeHint().height(), m_columnCount->tqsizeHint().height()); // Make all radioButtons vertically equaly-spaced!
+ mindMap->setMinimumSize(mindMap->tqsizeHint().width(), height); // Because the m_columnCount can be heigher, and make radio1 and radio2 more spaced than radio2 and radio3.
m_disposition->setButton(m_basket->isFreeLayout() ? (m_basket->isMindMap() ? 2 : 1) : 0);
topLayout->addWidget(m_disposition);
mindMap->hide();
// Keyboard Shortcut:
- m_shortcutRole = new QVButtonGroup(i18n("&Keyboard Shortcut"), page);
- QWidget *shortcutWidget = new QWidget(m_shortcutRole);
- QHBoxLayout *shortcutLayout = new QHBoxLayout(shortcutWidget, /*margin=*/0, spacingHint());
+ m_shortcutRole = new TQVButtonGroup(i18n("&Keyboard Shortcut"), page);
+ TQWidget *shortcutWidget = new TQWidget(m_shortcutRole);
+ TQHBoxLayout *shortcutLayout = new TQHBoxLayout(shortcutWidget, /*margin=*/0, spacingHint());
m_shortcut = new KKeyButton(shortcutWidget);
- m_shortcut->setShortcut(m_basket->shortcut(), /*bQtShortcut=*/true);
+ m_shortcut->setShortcut(m_basket->shortcut(), /*bTQtShortcut=*/true);
HelpLabel *helpLabel = new HelpLabel(i18n("Learn some tips..."), i18n(
"<p><strong>Easily Remember your Shortcuts</strong>:<br>"
"With the first option, giving the basket a shortcut of the form <strong>Alt+Letter</strong> will underline that letter in the basket tree.<br>"
@@ -145,10 +145,10 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
shortcutLayout->addWidget(m_shortcut);
shortcutLayout->addStretch();
shortcutLayout->addWidget(helpLabel);
- connect( m_shortcut, SIGNAL(capturedShortcut(const KShortcut&)), this, SLOT(capturedShortcut(const KShortcut&)) );
- new QRadioButton(i18n("S&how this basket"), m_shortcutRole);
- new QRadioButton(i18n("Show this basket (&global shortcut)"), m_shortcutRole);
- new QRadioButton(i18n("S&witch to this basket (global shortcut)"), m_shortcutRole);
+ connect( m_shortcut, TQT_SIGNAL(capturedShortcut(const KShortcut&)), this, TQT_SLOT(capturedShortcut(const KShortcut&)) );
+ new TQRadioButton(i18n("S&how this basket"), m_shortcutRole);
+ new TQRadioButton(i18n("Show this basket (&global shortcut)"), m_shortcutRole);
+ new TQRadioButton(i18n("S&witch to this basket (global shortcut)"), m_shortcutRole);
m_shortcutRole->setButton(m_basket->shortcutAction()/* + 1*/); // Id 0 is the KKeyButton!
topLayout->addWidget(m_shortcutRole);
@@ -192,7 +192,7 @@ void BasketPropertiesDialog::slotOk()
void BasketPropertiesDialog::capturedShortcut(const KShortcut &shortcut)
{
// TODO: Validate it!
- m_shortcut->setShortcut(shortcut, /*bQtShortcut=*/true);
+ m_shortcut->setShortcut(shortcut, /*bTQtShortcut=*/true);
}
void BasketPropertiesDialog::selectColumnsLayout()