Mailinglist Archive: zypp-commit (204 mails)

< Previous Next >
[zypp-commit] r5658 - in /trunk/updater-kde/updater: MainWindow.cpp MainWindow.h zypp/ZYppUpdater.cpp
  • From: tgoettlicher@xxxxxxxxxxxxxxxx
  • Date: Fri, 01 Jun 2007 14:40:26 -0000
  • Message-id: <20070601144026.BA7609C933@xxxxxxxxxxxxxxxx>
Author: tgoettlicher
Date: Fri Jun  1 16:40:26 2007
New Revision: 5658

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5658&view=rev
Log:
Added patches and packages tabs to ui.


Modified:
    trunk/updater-kde/updater/MainWindow.cpp
    trunk/updater-kde/updater/MainWindow.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=5658&r1=5657&r2=5658&view=diff
==============================================================================
--- trunk/updater-kde/updater/MainWindow.cpp (original)
+++ trunk/updater-kde/updater/MainWindow.cpp Fri Jun  1 16:40:26 2007
@@ -20,6 +20,7 @@
 #include <kglobal.h>
 #include <kiconloader.h>
 
+#include <qtabwidget.h>
 #include <kaction.h>
 #include <kstdaction.h>
 #include <klocale.h>
@@ -113,66 +114,99 @@
   
        mainBox = new QVBoxLayout(centralWidget);
        header = new HeaderWidget(centralWidget);
-       updateList = new QListView(centralWidget);
-       packageDescription = new KTextEdit(centralWidget);
+
+       tabwidget = new QTabWidget(centralWidget);
+
+       QWidget *patchWidget = new QWidget(tabwidget);
+       QWidget *packageWidget = new QWidget(tabwidget);
+
+       QVBoxLayout *patchBox = new QVBoxLayout(patchWidget);
+       QVBoxLayout *packageBox = new QVBoxLayout(packageWidget);
+
+       patchList = new QListView(patchWidget);
+       packageList = new QListView(packageWidget);
+       patchDescription = new KTextEdit(patchWidget);
+       packageDescription = new KTextEdit(packageWidget);
+
+       patchBox->addWidget(patchList,0,0);
+       patchBox->addWidget(patchDescription,0,0);
+
+       packageBox->addWidget(packageList,0,0);
+       packageBox->addWidget(packageDescription,0,0);
+
+       tabwidget->addTab(patchWidget, "Patches" );
+       tabwidget->addTab(packageWidget, "Packages (for experts only)" );
        
-  configureButton = new KPushButton(i18n("Add/Remove Update Sources..."), centralWidget);
-  cancelButton = new KPushButton(KStdGuiItem::cancel(), centralWidget);
-  installButton = new KPushButton(KStdGuiItem::ok(), centralWidget);
-  installButton->setText(i18n("Install"));
+//     configureButton = new KPushButton(i18n("Add/Remove Update Sources..."), centralWidget);
+       cancelButton = new KPushButton(KStdGuiItem::cancel(), centralWidget);
+       installButton = new KPushButton(KStdGuiItem::ok(), centralWidget);
+       installButton->setText(i18n("Install"));
   
        selectAllButton = new KPushButton(i18n("Select All"), centralWidget);
        clearSelectionButton = new KPushButton(i18n("Clear Selection"), centralWidget);
        
        mainBox->addWidget(header, 0, 0);
-       mainBox->addWidget(updateList, 0, 0);
-       
+       mainBox->addWidget(tabwidget, 0, 0);
+
        selectionButtonsLayout = new QHBoxLayout(mainBox);
        selectionButtonsLayout->addWidget(selectAllButton, false, Qt::AlignLeft);
        selectionButtonsLayout->addWidget(clearSelectionButton, false, Qt::AlignRight);
   
+       patchDescription->setReadOnly(true);
        packageDescription->setReadOnly(true);
-       packageDescription->setMinimumHeight(125);
-       mainBox->addWidget(packageDescription, 0, 0);
+
+//     patchDescription->setMinimumHeight(125);
 
        buttonsLayout = new QHBoxLayout(mainBox);
-       buttonsLayout->addWidget(configureButton, false, Qt::AlignLeft);
-       buttonsLayout->insertSpacing(1, 250);
+//     buttonsLayout->addWidget(configureButton, false, Qt::AlignLeft);
+//     buttonsLayout->insertSpacing(1, 250);
        buttonsLayout->addWidget(installButton, false, Qt::AlignRight);
        buttonsLayout->addSpacing(10);
        buttonsLayout->addWidget(cancelButton, false, Qt::AlignRight);
   
-  connect(configureButton, SIGNAL(clicked()), this, SLOT(serverButtonClicked()));
-  connect(installButton, SIGNAL(clicked()), this, SLOT(installButtonClicked()));
-  connect(cancelButton, SIGNAL(clicked()), this, SLOT(hide()));
+       connect(configureButton, SIGNAL(clicked()), this, SLOT(serverButtonClicked()));
+       connect(installButton, SIGNAL(clicked()), this, SLOT(installButtonClicked()));
+       connect(cancelButton, SIGNAL(clicked()), this, SLOT(hide()));
        connect(selectAllButton, SIGNAL(clicked()), this, SLOT(selectButtonClicked()));
        connect(clearSelectionButton, SIGNAL(clicked()), this, SLOT(clearButtonClicked()));
   
        header->setDescription(i18n("<b>Available Updates:</b><br> The following are software upgrades and patches to add features and fix bugs.<br>"));
 
-       updateList->addColumn(i18n("Name"));
-       updateList->setColumnWidthMode(COLUMN_NAME, QListView::Maximum);
-       updateList->addColumn(i18n("Type"));
-       updateList->addColumn(i18n("New Version"));
-       updateList->addColumn(i18n("Catalog"));
+       patchList->addColumn(i18n("Name"));
+       patchList->setColumnWidthMode(COLUMN_NAME, QListView::Maximum);
+       patchList->addColumn(i18n("Type"));
+       patchList->addColumn(i18n("New Version"));
+       patchList->addColumn(i18n("Catalog"));
+
+       packageList->addColumn(i18n("Name"));
+       packageList->setColumnWidthMode(COLUMN_NAME, QListView::Maximum);
+       packageList->addColumn(i18n("Type"));
+       packageList->addColumn(i18n("New Version"));
+       packageList->addColumn(i18n("Catalog"));
+
 
        /*
                Hidden Columns, we use these to store data about the packages/patches
        */
-       updateList->addColumn("ID", 0); // This is a hidden column to hold the ID of the patch/package
+       patchList->addColumn("ID", 0); // This is a hidden column to hold the ID of the patch/package
 
-       connect(updateList, SIGNAL(selectionChanged(QListViewItem*)), 
+       connect(patchList, SIGNAL(selectionChanged(QListViewItem*)), 
                                        this, SLOT(slotPackageSelected(QListViewItem*)));
 
-       connect(updateList, SIGNAL(clicked(QListViewItem*)), 
+       connect(patchList, SIGNAL(clicked(QListViewItem*)), 
                                        this, SLOT(slotPackageClicked(QListViewItem*)));
 
-       connect(updateList, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)), 
+       connect(patchList, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)), 
                                        this, SLOT(slotPackageRightClicked(QListViewItem*, const QPoint&, int)));
 
-       connect(updateList, SIGNAL(selectionChanged()),
+       connect(patchList, SIGNAL(selectionChanged()),
                                        this, SLOT(slotPackageSelectionChanged()));
 
+       patchBox->setSpacing(10);
+       patchBox->setMargin(10);
+
+       packageBox->setSpacing(10);
+       packageBox->setMargin(10);
 
        mainBox->setSpacing(10);
        mainBox->setMargin(10);
@@ -186,7 +220,7 @@
 {
        // when are updates are selected for installation, enable "Install" button
        if (    (_caps.canSelectIndividualUpdates==true  && updatesSelected > 0)  ||
-                       (_caps.canSelectIndividualUpdates==false && updateList->childCount() > 0 ) ) 
+                       (_caps.canSelectIndividualUpdates==false && patchList->childCount() > 0 ) ) 
        {
                installButton->setDisabled(false);
        }
@@ -204,13 +238,13 @@
        {
                selectAllButton->hide();
                clearSelectionButton->hide();
-               updateList->setSelectionMode ( QListView::NoSelection );
+               patchList->setSelectionMode ( QListView::NoSelection );
        }
        else
        {
                selectAllButton->show();
                clearSelectionButton->show();
-               updateList->setSelectionMode ( QListView::Multi );
+               patchList->setSelectionMode ( QListView::Multi );
        }
        updateButtons();
 
@@ -237,7 +271,7 @@
 
 void MainWindow::slotAppletState(int state, int n)
 {
-       applet->setUpdates(updateList->childCount());
+       applet->setUpdates(patchList->childCount());
        applet->setState(state);
        applet->setUpdates(n);
 
@@ -263,9 +297,9 @@
 }
 
 void MainWindow::gotDescription(QString description) {
-       packageDescription->setText("");
-       packageDescription->setTextFormat(Qt::RichText);
-       packageDescription->setText(description);
+       patchDescription->setText("");
+       patchDescription->setTextFormat(Qt::RichText);
+       patchDescription->setText(description);
 }
 
 /***************************************************************
@@ -330,7 +364,7 @@
 
 void MainWindow::selectButtonClicked() {
 
-       QCheckListItem *item = (QCheckListItem*)updateList->firstChild();
+       QCheckListItem *item = (QCheckListItem*)patchList->firstChild();
        
        while (item != NULL) {
                if (!item->isOn()) {
@@ -338,13 +372,13 @@
                }
                item = (QCheckListItem*)item->nextSibling();
        }
-       updatesSelected = updateList->childCount();
+       updatesSelected = patchList->childCount();
 
        updateButtons();
 }
 
 void MainWindow::clearButtonClicked() {
-       QCheckListItem *item = (QCheckListItem*)updateList->firstChild();
+       QCheckListItem *item = (QCheckListItem*)patchList->firstChild();
        
        while (item != NULL) {
                if (item->isOn()) {
@@ -382,12 +416,12 @@
 
 
        //Clear the list and fire the update signal to the backend
-       updateList->clear();
-       packageDescription->setText("");
+       patchList->clear();
+       patchDescription->setText("");
        updatesSelected = 0;
        updateButtons();
 
-       emit(populateUpdateList(updateList)); 
+       emit(populateUpdateList(patchList)); 
 }
 
 //Selection/Fetch Description slots
@@ -406,7 +440,7 @@
 
        updatesSelected = 0;
 
-       QCheckListItem *item = (QCheckListItem*)updateList->firstChild();
+       QCheckListItem *item = (QCheckListItem*)patchList->firstChild();
        
        while (item != NULL) {
                if (item->isOn()) {

Modified: trunk/updater-kde/updater/MainWindow.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/MainWindow.h?rev=5658&r1=5657&r2=5658&view=diff
==============================================================================
--- trunk/updater-kde/updater/MainWindow.h (original)
+++ trunk/updater-kde/updater/MainWindow.h Fri Jun  1 16:40:26 2007
@@ -90,9 +90,9 @@
                /**
                        Signal we send to our current backend requesting updates for the list.
 
-                       @param updateList our QListView we want the backend to pack.
+                       @param patchList our QListView we want the backend to pack.
                */
-               void populateUpdateList(QListView* updateList);
+               void populateUpdateList(QListView* patchList);
 
                /**
                        Signal we send to our current backend requesting the start of 
@@ -246,7 +246,9 @@
                void updateButtons();
 
                TrayIcon *applet;
-               QListView *updateList;
+               QListView *patchList;
+               QListView *packageList;
+               KTextEdit *patchDescription;
                KTextEdit *packageDescription;
                HeaderWidget *header;
 
@@ -271,6 +273,9 @@
 
     QWidget *centralWidget;
 
+       QTabWidget *tabwidget;
+
+
     KConfigDialog *configDialog;
 
                int getNetworkStatus() const;

Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdater.cpp?rev=5658&r1=5657&r2=5658&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppUpdater.cpp (original)
+++ trunk/updater-kde/updater/zypp/ZYppUpdater.cpp Fri Jun  1 16:40:26 2007
@@ -314,7 +314,9 @@
 
 void ZYppUpdater::configureUpdater()
 {
-       KProcess *inst_source = new KProcess;
+  kdDebug() << "configure updater" << endl;
+
+  KProcess *inst_source = new KProcess;
   *inst_source << "opensuseupdater-su" << "-c" << "/sbin/yast2 inst_source";
 
   connect( inst_source, SIGNAL( processExited( KProcess * ) ),

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages