summaryrefslogtreecommitdiffstats
path: root/src/configdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/configdialog.cpp')
-rw-r--r--src/configdialog.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/configdialog.cpp b/src/configdialog.cpp
index 5873759..9922cbe 100644
--- a/src/configdialog.cpp
+++ b/src/configdialog.cpp
@@ -46,7 +46,7 @@
#include <kcolorcombo.h>
#include <tqsize.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqlabel.h>
#include <tqcheckbox.h>
#include <tqptrlist.h>
@@ -110,7 +110,7 @@ ConfigDialog::ConfigDialog(TQWidget* parent_, const char* name_/*=0*/)
setupFetchPage();
updateGeometry();
- TQSize s = sizeHint();
+ TQSize s = tqsizeHint();
resize(TQMAX(s.width(), CONFIG_MIN_WIDTH), TQMAX(s.height(), CONFIG_MIN_HEIGHT));
// purely for asthetics make all widgets line up
@@ -124,7 +124,7 @@ ConfigDialog::ConfigDialog(TQWidget* parent_, const char* name_/*=0*/)
int w = 0;
for(TQPtrListIterator<TQWidget> it(widgets); it.current(); ++it) {
it.current()->polish();
- w = TQMAX(w, it.current()->sizeHint().width());
+ w = TQMAX(w, it.current()->tqsizeHint().width());
}
for(TQPtrListIterator<TQWidget> it(widgets); it.current(); ++it) {
it.current()->setMinimumWidth(w);
@@ -133,7 +133,7 @@ ConfigDialog::ConfigDialog(TQWidget* parent_, const char* name_/*=0*/)
enableButtonOK(false);
enableButtonApply(false);
- setHelp(TQString::fromLatin1("general-options"));
+ setHelp(TQString::tqfromLatin1("general-options"));
connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget*)), TQT_SLOT(slotUpdateHelpLink(TQWidget*)));
}
@@ -146,19 +146,19 @@ ConfigDialog::~ConfigDialog() {
void ConfigDialog::slotUpdateHelpLink(TQWidget* w_) {
switch(pageIndex(w_)) {
case 0:
- setHelp(TQString::fromLatin1("general-options"));
+ setHelp(TQString::tqfromLatin1("general-options"));
break;
case 1:
- setHelp(TQString::fromLatin1("printing-options"));
+ setHelp(TQString::tqfromLatin1("printing-options"));
break;
case 2:
- setHelp(TQString::fromLatin1("template-options"));
+ setHelp(TQString::tqfromLatin1("template-options"));
break;
case 3:
- setHelp(TQString::fromLatin1("internet-sources-options"));
+ setHelp(TQString::tqfromLatin1("internet-sources-options"));
break;
default:
@@ -194,7 +194,7 @@ void ConfigDialog::slotDefault() {
}
void ConfigDialog::setupGeneralPage() {
- TQPixmap pix = DesktopIcon(TQString::fromLatin1("tellico"), KIcon::SizeMedium);
+ TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("tellico"), KIcon::SizeMedium);
TQFrame* frame = addPage(i18n("General"), i18n("General Options"), pix);
TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
@@ -283,14 +283,14 @@ void ConfigDialog::setupPrintingPage() {
TQPixmap pix;
KIconLoader* loader = KGlobal::iconLoader();
if(loader) {
- pix = loader->loadIcon(TQString::fromLatin1("printer1"), KIcon::Desktop, KIcon::SizeMedium,
+ pix = loader->loadIcon(TQString::tqfromLatin1("printer1"), KIcon::Desktop, KIcon::SizeMedium,
KIcon::DefaultState, 0, true /*canReturnNull */);
if(pix.isNull()) {
- pix = loader->loadIcon(TQString::fromLatin1("printer2"), KIcon::Desktop, KIcon::SizeMedium,
+ pix = loader->loadIcon(TQString::tqfromLatin1("printer2"), KIcon::Desktop, KIcon::SizeMedium,
KIcon::DefaultState, 0, true /*canReturnNull */);
}
if(pix.isNull()) {
- pix = loader->loadIcon(TQString::fromLatin1("print_printer"), KIcon::Desktop, KIcon::SizeMedium);
+ pix = loader->loadIcon(TQString::tqfromLatin1("print_printer"), KIcon::Desktop, KIcon::SizeMedium);
}
}
TQFrame* frame = addPage(i18n("Printing"), i18n("Printing Options"), pix);
@@ -322,7 +322,7 @@ void ConfigDialog::setupPrintingPage() {
TQLabel* lab = new TQLabel(i18n("Maximum image &width:"), grid);
m_imageWidthBox = new KIntSpinBox(0, 999, 1, 50, 10, grid);
- m_imageWidthBox->setSuffix(TQString::fromLatin1(" px"));
+ m_imageWidthBox->setSuffix(TQString::tqfromLatin1(" px"));
lab->setBuddy(m_imageWidthBox);
(void) new TQWidget(grid);
TQString whats = i18n("The maximum width of the images in the printout. The aspect ration is preserved.");
@@ -335,7 +335,7 @@ void ConfigDialog::setupPrintingPage() {
lab = new TQLabel(i18n("&Maximum image height:"), grid);
m_imageHeightBox = new KIntSpinBox(0, 999, 1, 50, 10, grid);
- m_imageHeightBox->setSuffix(TQString::fromLatin1(" px"));
+ m_imageHeightBox->setSuffix(TQString::tqfromLatin1(" px"));
lab->setBuddy(m_imageHeightBox);
(void) new TQWidget(grid);
whats = i18n("The maximum height of the images in the printout. The aspect ration is preserved.");
@@ -351,7 +351,7 @@ void ConfigDialog::setupPrintingPage() {
}
void ConfigDialog::setupTemplatePage() {
- TQPixmap pix = DesktopIcon(TQString::fromLatin1("looknfeel"), KIcon::SizeMedium);
+ TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeMedium);
TQFrame* frame = addPage(i18n("Templates"), i18n("Template Options"), pix);
TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
@@ -379,7 +379,7 @@ void ConfigDialog::setupTemplatePage() {
KPushButton* btn = new KPushButton(i18n("&Preview..."), frame);
TQWhatsThis::add(btn, i18n("Show a preview of the template"));
- btn->setIconSet(SmallIconSet(TQString::fromLatin1("viewmag")));
+ btn->setIconSet(SmallIconSet(TQString::tqfromLatin1("viewmag")));
gridLayout->addWidget(btn, row, 2);
connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowTemplatePreview()));
@@ -399,7 +399,7 @@ void ConfigDialog::setupTemplatePage() {
l->addWidget(fontGroup);
row = -1;
- TQGridLayout* fontLayout = new TQGridLayout(fontGroup->layout());
+ TQGridLayout* fontLayout = new TQGridLayout(fontGroup->tqlayout());
fontLayout->setSpacing(KDialogBase::spacingHint());
lab = new TQLabel(i18n("Font:"), fontGroup);
@@ -415,7 +415,7 @@ void ConfigDialog::setupTemplatePage() {
fontLayout->addWidget(new TQLabel(i18n("Size:"), fontGroup), ++row, 0);
m_fontSizeInput = new KIntNumInput(fontGroup);
m_fontSizeInput->setRange(5, 30); // 30 is same max as konq config
- m_fontSizeInput->setSuffix(TQString::fromLatin1("pt"));
+ m_fontSizeInput->setSuffix(TQString::tqfromLatin1("pt"));
fontLayout->addWidget(m_fontSizeInput, row, 1);
connect(m_fontSizeInput, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_fontSizeInput);
@@ -426,7 +426,7 @@ void ConfigDialog::setupTemplatePage() {
l->addWidget(colGroup);
row = -1;
- TQGridLayout* colLayout = new TQGridLayout(colGroup->layout());
+ TQGridLayout* colLayout = new TQGridLayout(colGroup->tqlayout());
colLayout->setSpacing(KDialogBase::spacingHint());
lab = new TQLabel(i18n("Background color:"), colGroup);
@@ -473,19 +473,19 @@ void ConfigDialog::setupTemplatePage() {
box1->setSpacing(KDialog::spacingHint());
KPushButton* b1 = new KPushButton(i18n("Install..."), box1);
- b1->setIconSet(SmallIconSet(TQString::fromLatin1("add")));
+ b1->setIconSet(SmallIconSet(TQString::tqfromLatin1("add")));
connect(b1, TQT_SIGNAL(clicked()), TQT_SLOT(slotInstallTemplate()));
whats = i18n("Click to install a new template directly.");
TQWhatsThis::add(b1, whats);
KPushButton* b2 = new KPushButton(i18n("Download..."), box1);
- b2->setIconSet(SmallIconSet(TQString::fromLatin1("knewstuff")));
+ b2->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff")));
connect(b2, TQT_SIGNAL(clicked()), TQT_SLOT(slotDownloadTemplate()));
whats = i18n("Click to download additional templates via the Internet.");
TQWhatsThis::add(b2, whats);
KPushButton* b3 = new KPushButton(i18n("Delete..."), box1);
- b3->setIconSet(SmallIconSet(TQString::fromLatin1("remove")));
+ b3->setIconSet(SmallIconSet(TQString::tqfromLatin1("remove")));
connect(b3, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteTemplate()));
whats = i18n("Click to select and remove installed templates.");
TQWhatsThis::add(b3, whats);
@@ -497,7 +497,7 @@ void ConfigDialog::setupTemplatePage() {
}
void ConfigDialog::setupFetchPage() {
- TQPixmap pix = DesktopIcon(TQString::fromLatin1("network"), KIcon::SizeMedium);
+ TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("network"), KIcon::SizeMedium);
TQFrame* frame = addPage(i18n("Data Sources"), i18n("Data Source Options"), pix);
TQHBoxLayout* l = new TQHBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
@@ -515,27 +515,27 @@ void ConfigDialog::setupFetchPage() {
leftLayout->addWidget(hb);
hb->setSpacing(KDialog::spacingHint());
m_moveUpSourceBtn = new KPushButton(i18n("Move &Up"), hb);
- m_moveUpSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("up")));
+ m_moveUpSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("up")));
TQWhatsThis::add(m_moveUpSourceBtn, i18n("The order of the data sources sets the order "
"that Tellico uses when entries are automatically updated."));
m_moveDownSourceBtn = new KPushButton(i18n("Move &Down"), hb);
- m_moveDownSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("down")));
+ m_moveDownSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("down")));
TQWhatsThis::add(m_moveDownSourceBtn, i18n("The order of the data sources sets the order "
"that Tellico uses when entries are automatically updated."));
// these icons are rather arbitrary, but seem to vaguely fit
TQVBoxLayout* vlay = new TQVBoxLayout(l);
KPushButton* newSourceBtn = new KPushButton(i18n("&New..."), frame);
- newSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("filenew")));
+ newSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("filenew")));
TQWhatsThis::add(newSourceBtn, i18n("Click to add a new data source."));
m_modifySourceBtn = new KPushButton(i18n("&Modify..."), frame);
- m_modifySourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("network")));
+ m_modifySourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("network")));
TQWhatsThis::add(m_modifySourceBtn, i18n("Click to modify the selected data source."));
m_removeSourceBtn = new KPushButton(i18n("&Delete"), frame);
- m_removeSourceBtn->setIconSet(SmallIconSet(TQString::fromLatin1("remove")));
+ m_removeSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("remove")));
TQWhatsThis::add(m_removeSourceBtn, i18n("Click to delete the selected data source."));
m_newStuffBtn = new KPushButton(i18n("Download..."), frame);
- m_newStuffBtn->setIconSet(SmallIconSet(TQString::fromLatin1("knewstuff")));
+ m_newStuffBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff")));
TQWhatsThis::add(m_newStuffBtn, i18n("Click to download additional data sources via the Internet."));
#if !KDE_IS_VERSION(3,3,90)
@@ -587,8 +587,8 @@ void ConfigDialog::readGeneralConfig() {
bool autoFormat = Config::autoFormat();
m_cbFormat->setChecked(autoFormat);
- const TQRegExp comma(TQString::fromLatin1("\\s*,\\s*"));
- const TQString semicolon = TQString::fromLatin1("; ");
+ const TQRegExp comma(TQString::tqfromLatin1("\\s*,\\s*"));
+ const TQString semicolon = TQString::tqfromLatin1("; ");
m_leCapitals->setText(Config::noCapitalizationString().replace(comma, semicolon));
m_leArticles->setText(Config::articlesString().replace(comma, semicolon));
@@ -609,7 +609,7 @@ void ConfigDialog::readTemplateConfig() {
const int collType = Kernel::self()->collectionType();
TQString file = Config::templateName(collType);
file.replace('_', ' ');
- TQString fileContext = file + TQString::fromLatin1(" XSL Template");
+ TQString fileContext = file + TQString::tqfromLatin1(" XSL Template");
m_templateCombo->setCurrentItem(i18n(fileContext.utf8(), file.utf8()));
m_fontCombo->setCurrentFont(Config::templateFont(collType).family());
@@ -633,7 +633,7 @@ void ConfigDialog::readFetchConfig() {
Fetch::ConfigWidget* cw = it->configWidget(this);
if(cw) { // might return 0 when no widget available for fetcher type
m_configWidgets.insert(item, cw);
- // there's weird layout bug if it's not hidden
+ // there's weird tqlayout bug if it's not hidden
cw->hide();
}
kapp->processEvents();
@@ -665,7 +665,7 @@ void ConfigDialog::saveConfiguration() {
Config::setAutoCapitalization(m_cbCapitalize->isChecked());
Config::setAutoFormat(m_cbFormat->isChecked());
- const TQRegExp semicolon(TQString::fromLatin1("\\s*;\\s*"));
+ const TQRegExp semicolon(TQString::tqfromLatin1("\\s*;\\s*"));
const TQChar comma = ',';
Config::setNoCapitalizationString(m_leCapitals->text().replace(semicolon, comma));
@@ -707,7 +707,7 @@ void ConfigDialog::saveConfiguration() {
continue;
}
m_newStuffConfigWidgets.removeRef(cw);
- TQString group = TQString::fromLatin1("Data Source %1").arg(count);
+ TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(count);
// in case we later change the order, clear the group now
masterConfig->deleteGroup(group);
KConfigGroup configGroup(masterConfig, group);
@@ -724,11 +724,11 @@ void ConfigDialog::saveConfiguration() {
KConfigGroup sourceGroup(masterConfig, "Data Sources");
sourceGroup.writeEntry("Sources Count", count);
// and purge old config groups
- TQString group = TQString::fromLatin1("Data Source %1").arg(count);
+ TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(count);
while(masterConfig->hasGroup(group)) {
masterConfig->deleteGroup(group);
++count;
- group = TQString::fromLatin1("Data Source %1").arg(count);
+ group = TQString::tqfromLatin1("Data Source %1").tqarg(count);
}
masterConfig->sync();
@@ -952,7 +952,7 @@ void ConfigDialog::slotShowTemplatePreview() {
GUI::PreviewDialog* dlg = new GUI::PreviewDialog(this);
const TQString templateName = m_templateCombo->currentData().toString();
- dlg->setXSLTFile(templateName + TQString::fromLatin1(".xsl"));
+ dlg->setXSLTFile(templateName + TQString::tqfromLatin1(".xsl"));
StyleOptions options;
options.fontFamily = m_fontCombo->currentFont();
@@ -973,11 +973,11 @@ void ConfigDialog::slotShowTemplatePreview() {
} else if(f->type() == Data::Field::Choice) {
e->setField(f->name(), f->allowed().front());
} else if(f->type() == Data::Field::Number) {
- e->setField(f->name(), TQString::fromLatin1("1"));
+ e->setField(f->name(), TQString::tqfromLatin1("1"));
} else if(f->type() == Data::Field::Bool) {
- e->setField(f->name(), TQString::fromLatin1("true"));
+ e->setField(f->name(), TQString::tqfromLatin1("true"));
} else if(f->type() == Data::Field::Rating) {
- e->setField(f->name(), TQString::fromLatin1("5"));
+ e->setField(f->name(), TQString::tqfromLatin1("5"));
} else {
e->setField(f->name(), f->title());
}
@@ -990,7 +990,7 @@ void ConfigDialog::slotShowTemplatePreview() {
}
void ConfigDialog::loadTemplateList() {
- TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::fromLatin1("entry-templates/*.xsl"),
+ TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("entry-templates/*.xsl"),
false, true);
KSortableValueList<TQString, TQString> templates;
for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
@@ -998,7 +998,7 @@ void ConfigDialog::loadTemplateList() {
TQString file = fi.fileName().section('.', 0, -2);
TQString name = file;
name.replace('_', ' ');
- TQString title = i18n((name + TQString::fromLatin1(" XSL Template")).utf8(), name.utf8());
+ TQString title = i18n((name + TQString::tqfromLatin1(" XSL Template")).utf8(), name.utf8());
templates.insert(title, file);
}
templates.sort();
@@ -1034,8 +1034,8 @@ void ConfigDialog::slotDownloadTemplate() {
}
void ConfigDialog::slotDeleteTemplate() {
- TQDir dir(Tellico::saveLocation(TQString::fromLatin1("entry-templates/")));
- dir.setNameFilter(TQString::fromLatin1("*.xsl"));
+ TQDir dir(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/")));
+ dir.setNameFilter(TQString::tqfromLatin1("*.xsl"));
dir.setFilter(TQDir::Files | TQDir::Writable);
TQStringList files = dir.entryList();
TQMap<TQString, TQString> nameFileMap;