Author: tgoettlicher Date: Mon Jul 16 17:05:06 2007 New Revision: 6030 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6030&view=rev Log: changes in simpleview bugfix in zyppupdater Modified: trunk/updater-kde/updater/MainWindow.cpp trunk/updater-kde/updater/simpleview.cpp trunk/updater-kde/updater/simpleview.h trunk/updater-kde/updater/zypp/ZYppUpdater.cpp Modified: trunk/updater-kde/updater/MainWindow.cpp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/MainWindow.cpp?rev=6030&r1=6029&r2=6030&view=diff ============================================================================== --- trunk/updater-kde/updater/MainWindow.cpp (original) +++ trunk/updater-kde/updater/MainWindow.cpp Mon Jul 16 17:05:06 2007 @@ -248,6 +248,26 @@ void MainWindow::updateButtons() { + patchesSelected=0; + QCheckListItem *patchitem = (QCheckListItem*)patchList->firstChild(); + + while (patchitem != NULL) + { + if (patchitem->isOn()) + patchesSelected++; + patchitem = (QCheckListItem*)patchitem->nextSibling(); + } + + packagesSelected=0; + QCheckListItem *packageitem = (QCheckListItem*)patchList->firstChild(); + + while (packageitem != NULL) + { + if (packageitem->isOn()) + packagesSelected++; + packageitem = (QCheckListItem*)packageitem->nextSibling(); + } + // when updates are selected for installation, enable "Install" button if ( (_caps.canSelectIndividualUpdates==true && (patchesSelected + packagesSelected) > 0) || Modified: trunk/updater-kde/updater/simpleview.cpp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/simpleview.cpp?rev=6030&r1=6029&r2=6030&view=diff ============================================================================== --- trunk/updater-kde/updater/simpleview.cpp (original) +++ trunk/updater-kde/updater/simpleview.cpp Mon Jul 16 17:05:06 2007 @@ -42,24 +42,27 @@ // ------------------ Boxes ---------------------------- - QLabel *title = new QLabel(centralWidget); + title = new QLabel(centralWidget); title->setText(i18n("Choose the updates to be installed:")); - QFrame *line = new QFrame(centralWidget); - line->setFrameShape(QFrame::HLine); - line->setFrameShadow(QFrame::Sunken); - - security = new QCheckBox(i18n("%1 security updates").arg(42), centralWidget); - security->setDown(true); - security->setEnabled(false); +// QFrame *line = new QFrame(centralWidget); +// line->setFrameShape(QFrame::HLine); +// line->setFrameShadow(QFrame::Sunken); + +// security = new QCheckBox(i18n("%1 security updates").arg(42), centralWidget); +// security->setDown(true); +// security->setEnabled(false); + +// security = new QLabel(centralWidget); +// security->setText("security text"); recommended = new QCheckBox(i18n("%1 recommeded updates").arg(42), centralWidget); norestart = new QCheckBox(i18n("Don't install updates that require a restart"), centralWidget); layout->addMultiCellWidget(title,1,1,1,3); - layout->addMultiCellWidget(security,2,2,1,3); +// layout->addMultiCellWidget(security,2,2,1,3); layout->addMultiCellWidget(recommended,3,3,1,3); - layout->addMultiCellWidget(line,4,4,1,3); +// layout->addMultiCellWidget(line,4,4,1,3); layout->addMultiCellWidget(norestart,5,5,1,3); // -------------------- Buttons ------------------------ @@ -80,8 +83,6 @@ connect(install, SIGNAL(clicked()), this, SLOT(slotStartInstall())); connect(cancel, SIGNAL(clicked()), this, SLOT(hide())); - - connect(security, SIGNAL(clicked()), this, SLOT(updateSelection())); connect(recommended, SIGNAL(clicked()), this, SLOT(updateSelection())); connect(norestart, SIGNAL(clicked()), this, SLOT(updateSelection())); @@ -151,27 +152,44 @@ { case APPLET_CHECKING: headline->setText(i18n("<b>Checking for updates...</b>")); + title->setText(""); + recommended->hide(); + norestart->hide(); break; case APPLET_PROBLEM: - headline->setText(i18n("<b>Error:</b>\n" + description)); //TODO + headline->setText(i18n("<b>Error:</b>")); + title->setText(i18n(description)); + recommended->hide(); + norestart->hide(); break; case APPLET_NO_UPDATES: headline->setText(i18n("<b>No Updates Available</b>")); + title->setText(""); + recommended->hide(); + norestart->hide(); break; case APPLET_UPDATES: case APPLET_CRITICAL_UPDATES: // if (patchCount + packageCount > 0) headline->setText(i18n("<b>New software for your system is available</b>")); + title->setText(i18n("%1 Security updates are available").arg(42)); + recommended->show(); + norestart->show(); break; case APPLET_INSTALLING: headline->setText(i18n("<b>Updating...</b>")); + title->setText(""); + recommended->hide(); + norestart->hide(); break; } + + updateSelection(); } void SimpleView::setUpdates(int patches, int packages) @@ -188,6 +206,7 @@ packageCount = 0; */ // setState(appletState); + updateSelection(); } Modified: trunk/updater-kde/updater/simpleview.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/simpleview.h?rev=6030&r1=6029&r2=6030&view=diff ============================================================================== --- trunk/updater-kde/updater/simpleview.h (original) +++ trunk/updater-kde/updater/simpleview.h Mon Jul 16 17:05:06 2007 @@ -13,7 +13,7 @@ void setDetailWindow(QWidget *); protected: private: - QCheckBox *security; + QLabel *title; QCheckBox *recommended; QCheckBox *norestart; void showEvent(QShowEvent *); Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.cpp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdater.cpp?rev=6030&r1=6029&r2=6030&view=diff ============================================================================== --- trunk/updater-kde/updater/zypp/ZYppUpdater.cpp (original) +++ trunk/updater-kde/updater/zypp/ZYppUpdater.cpp Mon Jul 16 17:05:06 2007 @@ -271,6 +271,13 @@ void ZYppUpdater::startInstall() { + if (!_patchList || !_packageList) + { + kdDebug() << "!_patchList || !_packageList!!! " << endl; + kdDebug() << "Install is not allowed yet" << endl; + return; + } + QStringList installList; QCheckListItem *item = (QCheckListItem*)_patchList->firstChild(); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org