diff options
Diffstat (limited to 'src/newstuff/dialog.cpp')
-rw-r--r-- | src/newstuff/dialog.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/newstuff/dialog.cpp b/src/newstuff/dialog.cpp index 646793a..f388df2 100644 --- a/src/newstuff/dialog.cpp +++ b/src/newstuff/dialog.cpp @@ -62,13 +62,13 @@ class Dialog::Item : public GUI::ListViewItem { public: Item(GUI::ListView* parent) : GUI::ListViewItem(parent) {} - InstalltqStatus status() const { return m_status; } - void settqStatus(InstalltqStatus status) { + InstallStatus status() const { return m_status; } + void setStatus(InstallStatus status) { m_status = status; if(m_status == Current) { - setPixmap(0, SmallIcon(TQString::tqfromLatin1("ok"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("ok"))); } else if(m_status == OldVersion) { - setPixmap(0, SmallIcon(TQString::tqfromLatin1("reload"))); + setPixmap(0, SmallIcon(TQString::fromLatin1("reload"))); } } @@ -87,7 +87,7 @@ public: } private: - InstalltqStatus m_status; + InstallStatus m_status; }; Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) @@ -126,7 +126,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) TQBoxLayout* boxLayout2 = new TQVBoxLayout(widget, 0, KDialog::spacingHint()); m_iconLabel = new TQLabel(widget); - m_iconLabel->tqsetAlignment(TQt::AlignTop | TQt::AlignLeft); + m_iconLabel->setAlignment(TQt::AlignTop | TQt::AlignLeft); m_iconLabel->setMargin(0); m_nameLabel = new TQLabel(widget); @@ -140,27 +140,27 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) TQWhatsThis::add(m_infoLabel, i18n("The author of the selected item")); m_install = new KPushButton(i18n("Install"), widget); - m_install->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff"))); + m_install->setIconSet(SmallIconSet(TQString::fromLatin1("knewstuff"))); m_install->setEnabled(false); connect(m_install, TQT_SIGNAL(clicked()), TQT_SLOT(slotInstall())); // the button's text changes later // I don't want it resizing, so figure out the maximum size and set that m_install->polish(); - int maxWidth = m_install->tqsizeHint().width(); - int maxHeight = m_install->tqsizeHint().height(); - m_install->setGuiItem(KGuiItem(i18n("Update"), SmallIconSet(TQString::tqfromLatin1("knewstuff")))); - maxWidth = TQMAX(maxWidth, m_install->tqsizeHint().width()); - maxHeight = TQMAX(maxHeight, m_install->tqsizeHint().height()); + int maxWidth = m_install->sizeHint().width(); + int maxHeight = m_install->sizeHint().height(); + m_install->setGuiItem(KGuiItem(i18n("Update"), SmallIconSet(TQString::fromLatin1("knewstuff")))); + maxWidth = TQMAX(maxWidth, m_install->sizeHint().width()); + maxHeight = TQMAX(maxHeight, m_install->sizeHint().height()); m_install->setMinimumWidth(maxWidth); m_install->setMinimumHeight(maxHeight); TQPixmap pix; if(m_type == EntryTemplate) { - pix = DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeLarge); + pix = DesktopIcon(TQString::fromLatin1("looknfeel"), KIcon::SizeLarge); TQWhatsThis::add(m_install, i18n("Download and install the selected template.")); } else { - pix = UserIcon(TQString::tqfromLatin1("script")); + pix = UserIcon(TQString::fromLatin1("script")); TQWhatsThis::add(m_install, i18n("Download and install the selected script. Some scripts " "may need to be configured after being installed.")); } @@ -188,7 +188,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) m_descLabel = new TQTextEdit(widget); m_descLabel->setReadOnly(true); m_descLabel->setTextFormat(TQt::RichText); - m_descLabel->setPaper(tqcolorGroup().background()); + m_descLabel->setPaper(colorGroup().background()); m_descLabel->setMinimumHeight(5 * fontMetrics().height()); boxLayout2->addWidget(m_descLabel, 10); TQWhatsThis::add(m_descLabel, i18n("A description of the selected item is shown here.")); @@ -213,7 +213,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) setMinimumWidth(TQMAX(minimumWidth(), NEW_STUFF_MIN_WIDTH)); setMinimumHeight(TQMAX(minimumHeight(), NEW_STUFF_MIN_HEIGHT)); - resize(configDialogSize(TQString::tqfromLatin1("NewStuff Dialog Options"))); + resize(configDialogSize(TQString::fromLatin1("NewStuff Dialog Options"))); KConfigGroup dialogConfig(KGlobal::config(), "NewStuff Dialog Options"); TQValueList<int> splitList = dialogConfig.readIntListEntry("Splitter Sizes"); @@ -221,7 +221,7 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) m_split->setSizes(splitList); } - settqStatus(i18n("Downloading information...")); + setStatus(i18n("Downloading information...")); ProviderLoader* loader = new Tellico::NewStuff::ProviderLoader(this); connect(loader, TQT_SIGNAL(providersLoaded(TQPtrList<KNS::Provider>*)), TQT_SLOT(slotProviders(TQPtrList<KNS::Provider>*))); @@ -232,17 +232,17 @@ Dialog::Dialog(NewStuff::DataType type_, TQWidget* parent_) TQString prov = config.readEntry("ProvidersUrl"); if(prov.isEmpty()) { if(m_type == EntryTemplate) { - prov = TQString::tqfromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php"); - TQString alt = TQString::tqfromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml"); + prov = TQString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php"); + TQString alt = TQString::fromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml"); loader->setAlternativeProvider(alt); } else { - prov = TQString::tqfromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php"); + prov = TQString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php"); } } if(m_type == EntryTemplate) { - m_typeName = TQString::tqfromLatin1("tellico/entry-template"); + m_typeName = TQString::fromLatin1("tellico/entry-template"); } else { - m_typeName = TQString::tqfromLatin1("tellico/data-source"); + m_typeName = TQString::fromLatin1("tellico/data-source"); } loader->load(m_typeName, prov); @@ -253,7 +253,7 @@ Dialog::~Dialog() { delete m_cursorSaver; m_cursorSaver = 0; - saveDialogSize(TQString::tqfromLatin1("NewStuff Dialog Options")); + saveDialogSize(TQString::fromLatin1("NewStuff Dialog Options")); KConfigGroup config(KGlobal::config(), "NewStuff Dialog Options"); config.writeEntry("Splitter Sizes", m_split->sizes()); } @@ -261,7 +261,7 @@ Dialog::~Dialog() { void Dialog::slotProviderError() { if(m_listView->childCount() == 0) { myDebug() << "NewStuff::Dialog::slotCheckError() - no available items" << endl; - settqStatus(TQString()); + setStatus(TQString()); delete m_cursorSaver; m_cursorSaver = 0; @@ -294,7 +294,7 @@ void Dialog::slotResult(KIO::Job* job_) { myDebug() << "NewStuff::Dialog::slotResult() - can't load result: " << u.url() << endl; m_jobs.remove(job_); if(m_jobs.isEmpty()) { - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); delete m_cursorSaver; m_cursorSaver = 0; } @@ -321,7 +321,7 @@ void Dialog::slotResult(KIO::Job* job_) { } m_jobs.remove(job_); if(m_jobs.isEmpty()) { - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); delete m_cursorSaver; m_cursorSaver = 0; } @@ -338,7 +338,7 @@ void Dialog::addEntry(KNS::Entry* entry_) { item->setText(2, TQString::number(entry_->rating())); item->setText(3, TQString::number(entry_->downloads())); item->setText(4, KGlobal::locale()->formatDate(entry_->releaseDate(), true /*short format */)); - item->settqStatus(NewStuff::Manager::installtqStatus(entry_)); + item->setStatus(NewStuff::Manager::installStatus(entry_)); m_entryMap.insert(item, entry_); if(!m_listView->selectedItem()) { @@ -371,15 +371,15 @@ void Dialog::slotSelected(TQListViewItem* item_) { m_lastPreviewItem = item_; } TQPixmap pix = m_type == EntryTemplate - ? DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeLarge) - : UserIcon(TQString::tqfromLatin1("script")); + ? DesktopIcon(TQString::fromLatin1("looknfeel"), KIcon::SizeLarge) + : UserIcon(TQString::fromLatin1("script")); m_iconLabel->setPixmap(pix); TQString license = entry->license(); if(!license.isEmpty()) { license.prepend('(').append(')'); } - TQString name = TQString::tqfromLatin1("%1 %2").tqarg(ENTRYNAME(entry)).tqarg(license); + TQString name = TQString::fromLatin1("%1 %2").tqarg(ENTRYNAME(entry)).tqarg(license); TQFont font = m_nameLabel->font(); font.setBold(true); font.setItalic(false); @@ -389,10 +389,10 @@ void Dialog::slotSelected(TQListViewItem* item_) { m_infoLabel->setText(entry->author()); TQString desc = entry->summary(m_lang); - desc.replace(TQRegExp(TQString::tqfromLatin1("\\n")), TQString::tqfromLatin1("<br>")); + desc.replace(TQRegExp(TQString::fromLatin1("\\n")), TQString::fromLatin1("<br>")); m_descLabel->setText(desc); - InstalltqStatus installed = static_cast<Item*>(item_)->status(); + InstallStatus installed = static_cast<Item*>(item_)->status(); m_install->setText(installed == OldVersion ? i18n("Update Stuff", "Update") : i18n("Install")); m_install->setEnabled(installed != Current); } @@ -410,7 +410,7 @@ void Dialog::slotInstall() { delete m_cursorSaver; m_cursorSaver = new GUI::CursorSaver(); - settqStatus(i18n("Installing item...")); + setStatus(i18n("Installing item...")); m_progress->show(); m_timer->start(100); connect(m_manager, TQT_SIGNAL(signalInstalled(KNS::Entry*)), TQT_SLOT(slotDoneInstall(KNS::Entry*))); @@ -423,15 +423,15 @@ void Dialog::slotDoneInstall(KNS::Entry* entry_) { TQMap<TQListViewItem*, KNS::Entry*>::Iterator it; for(it = m_entryMap.begin(); entry_ && it != m_entryMap.end(); ++it) { if(it.data() == entry_) { - InstalltqStatus installed = Manager::installtqStatus(entry_); - static_cast<Item*>(it.key())->settqStatus(installed); + InstallStatus installed = Manager::installStatus(entry_); + static_cast<Item*>(it.key())->setStatus(installed); m_install->setEnabled(installed != Current); break; } } delete m_cursorSaver; m_cursorSaver = 0; - settqStatus(i18n("Ready.")); + setStatus(i18n("Ready.")); m_timer->stop(); m_progress->hide(); } @@ -440,7 +440,7 @@ void Dialog::slotMoveProgress() { m_progress->setProgress(m_progress->progress()+5); } -void Dialog::settqStatus(const TQString& text_) { +void Dialog::setStatus(const TQString& text_) { m_statusBar->changeItem(TQChar(' ') + text_, PROGRESS_STATUS_ID); } |