Author: dmacvicar
Date: Thu Aug 2 12:38:07 2007
New Revision: 6384
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6384&view=rev
Log:
indent
Modified:
trunk/updater-kde/updater/zypp/ZYppListItem.cpp
trunk/updater-kde/updater/zypp/ZYppListItem.h
trunk/updater-kde/updater/zypp/ZYppUpdater.cpp
trunk/updater-kde/updater/zypp/ZYppUpdater.h
trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.cpp
trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.h
trunk/updater-kde/updater/zypp/licensedialog.cpp
trunk/updater-kde/updater/zypp/licensedialog.h
trunk/updater-kde/updater/zypp/opensuseupdater_zypp.desktop
trunk/updater-kde/updater/zypp/zypper_install (contents, props changed)
trunk/updater-kde/updater/zypp/zyppupdaterpreferences_base.ui
Modified: trunk/updater-kde/updater/zypp/ZYppListItem.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppListItem.cpp?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppListItem.cpp (original)
+++ trunk/updater-kde/updater/zypp/ZYppListItem.cpp Thu Aug 2 12:38:07 2007
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2006 Narayan Newton
This program is free software; you can redistribute it and/or
@@ -21,10 +21,10 @@
ZYppListItem::ZYppListItem( ZYppResolvable *resolvable, QListView *parent, const QString &text )
// : QListViewItem(parent, text )
- : QCheckListItem(parent, text , QCheckListItem::CheckBox )
+ :
+ QCheckListItem(parent, text , QCheckListItem::CheckBox )
, _resolvable(resolvable)
-{
-}
+{}
ZYppResolvable * ZYppListItem::resolvable() const
{
Modified: trunk/updater-kde/updater/zypp/ZYppListItem.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppListItem.h?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppListItem.h (original)
+++ trunk/updater-kde/updater/zypp/ZYppListItem.h Thu Aug 2 12:38:07 2007
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2006 Narayan Newton
This program is free software; you can redistribute it and/or
@@ -35,17 +35,17 @@
@author Narayan Newton
**/
-class ZYppListItem :
+class ZYppListItem :
//public QListViewItem
-public QCheckListItem
+ public QCheckListItem
{
- public:
+public:
- ZYppListItem( ZYppResolvable *, QListView *, const QString& );
- ZYppResolvable * resolvable() const;
-
- private:
+ ZYppListItem( ZYppResolvable *, QListView *, const QString& );
+ ZYppResolvable * resolvable() const;
+
+private:
ZYppResolvable *_resolvable;
};
Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdater.cpp?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppUpdater.cpp (original)
+++ trunk/updater-kde/updater/zypp/ZYppUpdater.cpp Thu Aug 2 12:38:07 2007
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2006 Novell Inc
This program is free software; you can redistribute it and/or
@@ -47,20 +47,20 @@
#include "MainWindow.h"
#include "UpdateListItem.h"
#include "licensedialog.h"
-#include "../Constants.h"
+#include "Constants.h"
K_EXPORT_COMPONENT_FACTORY( opensuseupdater_zypp, KGenericFactory<ZYppUpdater>( "opensuseupdater_zypp" ) )
ZYppUpdater::ZYppUpdater( QObject *parent, const char* name, const QStringList& ) : Updater( parent, name )
- , _process(0L)
- , _install_process(0L)
- , _state(Unknown)
- , _update_counter(0)
- , _patchList(0)
- , _packageList(0)
- , _found_update_status_tag(false)
- , _error(false)
- , restartUpdater(false)
+ , _process(0L)
+ , _install_process(0L)
+ , _state(Unknown)
+ , _update_counter(0)
+ , _patchList(0)
+ , _packageList(0)
+ , _found_update_status_tag(false)
+ , _error(false)
+ , restartUpdater(false)
{
licenseDialog = new LicenseDialog(NULL);
@@ -71,22 +71,22 @@
_xml_reader.setContentHandler(this);
_xml_reader.parse( &_xml_source,
- true /* incremental parsing*/);
-
+ true /* incremental parsing*/);
+
}
UpdaterCapabilities ZYppUpdater::capabilities()
{
UpdaterCapabilities caps;
caps.canSelectIndividualUpdates = true;
- caps.canProvidePackages = true;
+ caps.canProvidePackages = true;
return caps;
}
void ZYppUpdater::slotInstallProcessExited( KProcess *p )
{
kdDebug() << "install process exited." << endl;
- emit(showProgress(false));
+ emit(showProgress(false));
@@ -111,7 +111,7 @@
if (p->exitStatus() == 102)
{
QMessageBox::information( NULL, PROGRAM_DISPLAY_NAME,
- i18n("One of installed patches requires reboot of your machine. Please, do it as soon as possible."));
+ i18n("One of installed patches requires reboot of your machine. Please, do it as soon as possible."));
doCheckForUpdates();
}
@@ -121,13 +121,13 @@
QString message;
- if (!_install_stdout_buffer.isEmpty())
+ if (!_install_stdout_buffer.isEmpty())
{
QMessageBox::information( NULL, PROGRAM_DISPLAY_NAME, _install_stdout_buffer);
message+=_install_stdout_buffer;
}
- if (!_install_stderr_buffer.isEmpty())
+ if (!_install_stderr_buffer.isEmpty())
{
message+=_install_stderr_buffer;
QMessageBox::critical( NULL, PROGRAM_DISPLAY_NAME, _install_stderr_buffer);
@@ -148,10 +148,9 @@
{
delete p;
}
-
+
void ZYppUpdater::showLog()
-{
-}
+{}
void ZYppUpdater::slotProcessExited( KProcess *proc )
{
@@ -160,9 +159,9 @@
delete _process;
_process = 0L;
// parse the xml
-
-
-
+
+
+
if ( ! _last_xml_parse_code )
{
kdDebug() << "Houston, we have a problem." << endl;
@@ -170,77 +169,77 @@
updateAppletError( i18n("helper program returned:\n%1").arg(_stderr_buffer) );
else
updateAppletError(i18n("helper program returned:\n%1").arg(_buffer) );
-
- if ( _stderr_buffer.find("Forgot to chmod this program") != -1 )
- QMessageBox::critical( NULL, PROGRAM_DISPLAY_NAME, i18n("Unable to check for patches and updates because /usr/sbin/zypp-checkpatches-wrapper helper programm is not set SUID root.\nThis problem might be solved by setting \"File Permissons\" in YaST \"Local Security\" tab to \"easy\" or by modifying /etc/permissions.local."));
+
+ if ( _stderr_buffer.find("Forgot to chmod this program") != -1 )
+ QMessageBox::critical( NULL, PROGRAM_DISPLAY_NAME, i18n("Unable to check for patches and updates because /usr/sbin/zypp-checkpatches-wrapper helper programm is not set SUID root.\nThis problem might be solved by setting \"File Permissons\" in YaST \"Local Security\" tab to \"easy\" or by modifying /etc/permissions.local."));
// clear the buffer
_stderr_buffer.truncate(0);
_buffer.truncate(0);
-
+
// remove if 2 programs are run at the same time
_xml_source.reset();
-
+
emit(populateDone());
return;
- }
-
+ }
+
// clear the buffer
_stderr_buffer.truncate(0);
_buffer.truncate(0);
-
+
if ( ! _patchList || !_packageList )
- {
- kdDebug() << " ! _patchList || ! _packageList " << endl;
+ {
+ kdDebug() << " ! _patchList || ! _packageList " << endl;
return;
- }
+ }
- _patchList->clear();
- _packageList->clear();
-
- bool pkgmgr_avail=false;
+ _patchList->clear();
+ _packageList->clear();
+
+ bool pkgmgr_avail=false;
kdDebug() << "populating... " << _resolvables.count() << " resolvables" << endl;
for ( QPtrList<ZYppResolvable>::const_iterator it = _resolvables.begin(); it != _resolvables.end(); ++it )
{
- QCheckListItem *newItem;
+ QCheckListItem *newItem;
- if ( (*it)->resolvableType == RESOLVABLE_PATCH)
- newItem = new ZYppListItem ( (*it), _patchList, (*it)->name );
- else
- newItem = new ZYppListItem ( (*it), _packageList, (*it)->name );
-
- newItem->setText(COLUMN_NAME, (*it)->name );
- newItem->setText(COLUMN_SUMMARY, (*it)->summary );
- newItem->setText(COLUMN_TYPE, (*it)->category );
- newItem->setText(COLUMN_NEW_VERSION,(*it)->edition);
- newItem->setText(COLUMN_CATALOG, (*it)->source );
- newItem->setText(COLUMN_RESTART, ((*it)->restart == true ) ? "Yes" : "No" ) ;
- newItem->setText(COLUMN_RESTART_HIDDEN, ((*it)->restart == true) ? "restart" : "norestart" );
-
- if ((*it)->pkgmanager)
- {
- pkgmgr_avail=true;
- newItem->setText(COLUMN_TYPE, "packagemanager" );
- }
+ if ( (*it)->resolvableType == RESOLVABLE_PATCH)
+ newItem = new ZYppListItem ( (*it), _patchList, (*it)->name );
+ else
+ newItem = new ZYppListItem ( (*it), _packageList, (*it)->name );
+
+ newItem->setText(COLUMN_NAME, (*it)->name );
+ newItem->setText(COLUMN_SUMMARY, (*it)->summary );
+ newItem->setText(COLUMN_TYPE, (*it)->category );
+ newItem->setText(COLUMN_NEW_VERSION,(*it)->edition);
+ newItem->setText(COLUMN_CATALOG, (*it)->source );
+ newItem->setText(COLUMN_RESTART, ((*it)->restart == true ) ? "Yes" : "No" ) ;
+ newItem->setText(COLUMN_RESTART_HIDDEN, ((*it)->restart == true) ? "restart" : "norestart" );
+
+ if ((*it)->pkgmanager)
+ {
+ pkgmgr_avail=true;
+ newItem->setText(COLUMN_TYPE, "packagemanager" );
+ }
}
- if (pkgmgr_avail)
+ if (pkgmgr_avail)
emit(updateApplet(APPLET_PKGMGR_UPDATES, _patchList->childCount(), _packageList->childCount()));
else if ( _patchList->childCount() > 0 )
emit(updateApplet(APPLET_UPDATES, _patchList->childCount(), _packageList->childCount()));
else
emit(updateApplet(APPLET_NO_UPDATES, 0, 0));
-
+
if ( _error )
{
emit(updateAppletError(_error_message_buffer));
_error_message_buffer.truncate(0);
}
-
+
emit(populateDone());
}
@@ -254,7 +253,7 @@
// continue incremental parsing
if ( buflen > 0 )
_last_xml_parse_code = _xml_reader.parseContinue();
-
+
if ( !_last_xml_parse_code )
{
kdDebug() << "Incremental parsing error. should we reset the Xml source? buffer size: " << _xml_source.data().length() << endl;
@@ -265,24 +264,24 @@
void ZYppUpdater::slotInstallReceivedStdout(KProcess *proc, char *buffer, int buflen)
{
// move this code when zypper outputs xml
-
- // We show the progress popup casue we have got the first answer from install process.
- if (_install_stdout_buffer.isEmpty())
- emit(showProgress(true));
-
- QString line = QString::fromUtf8(buffer,buflen);
- if (line.startsWith("Installing:"))
- {
- line = line.section(':', 1);
- emit(setProgressNextStep(line));
- }
- else
- {
- _install_stdout_buffer += QString::fromUtf8( buffer, buflen );
- }
+
+ // We show the progress popup casue we have got the first answer from install process.
+ if (_install_stdout_buffer.isEmpty())
+ emit(showProgress(true));
+
+ QString line = QString::fromUtf8(buffer,buflen);
+ if (line.startsWith("Installing:"))
+ {
+ line = line.section(':', 1);
+ emit(setProgressNextStep(line));
+ }
+ else
+ {
+ _install_stdout_buffer += QString::fromUtf8( buffer, buflen );
+ }
kdDebug() << "got text from install helper..." << endl;
- kdDebug() << buffer << endl;
+ kdDebug() << buffer << endl;
}
@@ -293,20 +292,21 @@
void ZYppUpdater::shutdown()
{
-
}
void ZYppUpdater::doCheckForUpdates()
{
kdDebug() << "Checking for updates..." << endl;
-
- if ( _process ) {
+
+ if ( _process )
+ {
kdDebug() << "Check process still running. Will not run this time." << endl;
emit(updateApplet(APPLET_CHECKING, 0, 0));
return;
}
- if ( _install_process ) {
+ if ( _install_process )
+ {
kdDebug() << "Install process running. Will not run check this time." << endl;
emit(updateApplet(APPLET_INSTALLING, 0, 0));
return;
@@ -315,13 +315,13 @@
_process = new KProcess;
*_process << "/usr/sbin/zypp-checkpatches-wrapper";
-
+
QObject::connect( _process, SIGNAL( processExited( KProcess * ) ),
- SLOT( slotProcessExited( KProcess * ) ) );
+ SLOT( slotProcessExited( KProcess * ) ) );
QObject::connect( _process, SIGNAL( receivedStdout(KProcess *, char *, int ) ),
- SLOT( slotReceivedStdout(KProcess *, char *, int ) ) );
+ SLOT( slotReceivedStdout(KProcess *, char *, int ) ) );
QObject::connect( _process, SIGNAL( receivedStderr(KProcess *, char *, int ) ),
- SLOT( slotReceivedStderr(KProcess *, char *, int ) ) );
+ SLOT( slotReceivedStderr(KProcess *, char *, int ) ) );
bool result = _process->start( KProcess::NotifyOnExit, KProcess::AllOutput );
@@ -334,7 +334,7 @@
emit(populateDone());
return;
}
-
+
kdDebug() << "check process started.." << endl;
emit(updateApplet(APPLET_CHECKING, 0, 0));
//mStatusLabel->setText( i18n("Checking...") );
@@ -367,7 +367,7 @@
void ZYppUpdater::startInstall()
{
- if (!_patchList || !_packageList)
+ if (!_patchList || !_packageList)
{
kdDebug() << "!_patchList || !_packageList!!! " << endl;
kdDebug() << "Install is not allowed yet" << endl;
@@ -387,21 +387,21 @@
if ( zi )
{
ZYppResolvable *patch = zi->resolvable();
-
- if ( patch->license.stripWhiteSpace().isEmpty())
- if (patch->pkgmanager)
- installPkgMgrList += item->text();
- else
- installPatchList += item->text();
- else
- {
- licenseDialog->setText(i18n("License of %1").arg(patch->name), patch->license);
- if ( licenseDialog->exec() )
- if (patch->pkgmanager)
- installPkgMgrList += item->text();
- else
- installPatchList += item->text();
- }
+
+ if ( patch->license.stripWhiteSpace().isEmpty())
+ if (patch->pkgmanager)
+ installPkgMgrList += item->text();
+ else
+ installPatchList += item->text();
+ else
+ {
+ licenseDialog->setText(i18n("License of %1").arg(patch->name), patch->license);
+ if ( licenseDialog->exec() )
+ if (patch->pkgmanager)
+ installPkgMgrList += item->text();
+ else
+ installPatchList += item->text();
+ }
}
}
item = (QCheckListItem*)item->nextSibling();
@@ -416,25 +416,26 @@
ZYppListItem *zi = dynamic_cast(item);
if ( zi )
{
- ZYppResolvable *patch = zi->resolvable();
- if ( patch->license.stripWhiteSpace().isEmpty())
- installPackageList += item->text();
- else
- {
- licenseDialog->setText(i18n("License of %1").arg(patch->name), patch->license);
- if ( licenseDialog->exec() )
- installPackageList += item->text();
- }
+ ZYppResolvable *patch = zi->resolvable();
+ if ( patch->license.stripWhiteSpace().isEmpty())
+ installPackageList += item->text();
+ else
+ {
+ licenseDialog->setText(i18n("License of %1").arg(patch->name), patch->license);
+ if ( licenseDialog->exec() )
+ installPackageList += item->text();
+ }
}
}
item = (QCheckListItem*)item->nextSibling();
}
-
- if ( _install_process ) {
+
+ if ( _install_process )
+ {
// TODO update still running
kdDebug() << "Update process still running. Will not run this time." << endl;
return;
@@ -443,10 +444,10 @@
_install_process = new KProcess;
QString command="/usr/sbin/zypper_install";
-
+
*_install_process << command << "--patch" << installPatchList << "--package" << installPackageList << "--pkgmgr" << installPkgMgrList;
-
+
// QObject::connect( _install_process, SIGNAL( processExited( KProcess * ) ),
// SLOT( slotInstallProcessExited( KProcess * ) ) );
// QObject::connect( _install_process, SIGNAL( receivedStdout(KProcess *, char *, int ) ),
@@ -455,11 +456,11 @@
// SLOT( slotInstallReceivedStderr(KProcess *, char *, int ) ) );
QObject::connect( _install_process, SIGNAL( processExited( KProcess * ) ),
- SLOT( slotProcessExited( KProcess * ) ) );
+ SLOT( slotProcessExited( KProcess * ) ) );
QObject::connect( _install_process, SIGNAL( receivedStdout(KProcess *, char *, int ) ),
- SLOT( slotReceivedStdout(KProcess *, char *, int ) ) );
+ SLOT( slotReceivedStdout(KProcess *, char *, int ) ) );
QObject::connect( _install_process, SIGNAL( receivedStderr(KProcess *, char *, int ) ),
- SLOT( slotReceivedStderr(KProcess *, char *, int ) ) );
+ SLOT( slotReceivedStderr(KProcess *, char *, int ) ) );
bool result = _install_process->start( KProcess::NotifyOnExit, KProcess::AllOutput );
if ( ! result )
@@ -471,10 +472,10 @@
emit(populateDone());
return;
}
-
+
kdDebug() << "install process started.." << endl;
- emit(updateApplet(APPLET_INSTALLING, 0, 0));
- emit(setProgress(0, installPackageList.count() + installPatchList.count(), ""));
+ emit(updateApplet(APPLET_INSTALLING, 0, 0));
+ emit(setProgress(0, installPackageList.count() + installPatchList.count(), ""));
}
@@ -531,7 +532,7 @@
// Unknown,
// UpdateSources,
// UpdateList,
-
+
// here we have to allocate a patch or source in the stack
kdDebug() << "xml..." << qName << endl;
// if ( qName == "update-status" )
@@ -549,26 +550,26 @@
}
if ( qName == "update" )
{
- //TODO
+ //TODO
kdDebug() << "found patch..." << qName << endl;
_current_resolvable = new ZYppResolvable();
_current_resolvable->name = atts.value("name");
_current_resolvable->category = atts.value("category");
_current_resolvable->edition = atts.value("edition");
- _current_resolvable->resolvableType=
- ( atts.value("resolvabletype") == "patch" ? RESOLVABLE_PATCH : RESOLVABLE_PACKAGE );
- _current_resolvable->restart= ( atts.value("restart") == "true") ? true : false ;
- _current_resolvable->pkgmanager= ( atts.value("pkgmanager") == "true") ? true : false ;
- _current_resolvable->interactive= ( atts.value("interactive") == "true") ? true : false ;
- _current_resolvable->resolvableType=
- ( atts.value("resolvabletype") == "patch" ? RESOLVABLE_PATCH : RESOLVABLE_PACKAGE );
+ _current_resolvable->resolvableType=
+ ( atts.value("resolvabletype") == "patch" ? RESOLVABLE_PATCH : RESOLVABLE_PACKAGE );
+ _current_resolvable->restart= ( atts.value("restart") == "true") ? true : false ;
+ _current_resolvable->pkgmanager= ( atts.value("pkgmanager") == "true") ? true : false ;
+ _current_resolvable->interactive= ( atts.value("interactive") == "true") ? true : false ;
+ _current_resolvable->resolvableType=
+ ( atts.value("resolvabletype") == "patch" ? RESOLVABLE_PATCH : RESOLVABLE_PACKAGE );
// _current_resolvable->restart=false;
// _current_resolvable->pkgmanager= false;
// _current_resolvable->interactive= false;
-
-
+
+
_state = Update;
// ignore sources for now
return true;
@@ -597,7 +598,6 @@
}
else
{
-
}
// ignore sources for now
return true;
@@ -619,7 +619,7 @@
}
if ( qName == "update-status" )
{
- _state = Unknown;
+ _state = Unknown;
}
if ( (qName == "error") && (_state == Error) )
{
@@ -647,13 +647,13 @@
kdDebug() << _current_resolvable->name << " appended" << endl;
_resolvables.append(_current_resolvable);
// ignore sources for now
-
+
kdDebug() << _current_resolvable->name << endl;
kdDebug() << _current_resolvable->summary << endl;
-
+
return true;
}
-
+
return true;
}
Modified: trunk/updater-kde/updater/zypp/ZYppUpdater.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdater.h?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppUpdater.h (original)
+++ trunk/updater-kde/updater/zypp/ZYppUpdater.h Thu Aug 2 12:38:07 2007
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2006 Novell Inc
This program is free software; you can redistribute it and/or
@@ -45,11 +45,11 @@
QString source;
QString summary;
QString description;
- QString license;
- bool restart; // needs system restart
- bool pkgmanager; // affects package manager
- bool interactive; // needs user interaction
- int resolvableType; // RESOLVABLE_PATCH or RESOLVABLE_PACKAGE
+ QString license;
+ bool restart; // needs system restart
+ bool pkgmanager; // affects package manager
+ bool interactive; // needs user interaction
+ int resolvableType; // RESOLVABLE_PATCH or RESOLVABLE_PACKAGE
};
struct ZYppSource
@@ -71,131 +71,132 @@
class ZYppUpdater : public Updater, public QXmlDefaultHandler
{
-Q_OBJECT
- public:
+ Q_OBJECT
+public:
ZYppUpdater( QObject *parent, const char* name, const QStringList&);
- virtual ~ZYppUpdater() {};
+ virtual ~ZYppUpdater()
+ {};
virtual UpdaterCapabilities capabilities();
virtual void shutdown();
-
- // QXmlDefaultHandler implementation
+
+ // QXmlDefaultHandler implementation
virtual bool startDocument();
virtual bool endDocument();
virtual bool startElement( const QString&, const QString&, const QString& , const QXmlAttributes& );
virtual bool endElement( const QString&, const QString&, const QString& );
virtual bool characters ( const QString & ch );
- private slots:
+private slots:
+
+ /**
+ Slot which gets called when we need to throw up the add/remove server dialog.
+ */
+ void configureUpdater();
+
+ /**
+ Slot which gets called when we need to start an update.
+ Collect our update info from the list we got passed
+ in populateList and go.
+ */
+ void startInstall();
+
+ /**
+ Slot which gets called when we need to check for updates
+ and load up the list.
+
+ @param updateList the list on the main window
+ */
+ void populateLists(QListView* patchList, QListView* packageList);
+
+ /**
+ Slot which gets called when the user selects an update.
+ We are expected to write a description of the update and pass it back.
+
+ @param item the update itself
+
+ */
+ void resolvableSelected(QListViewItem* item, int);
+
+ /**
+ Slot which gets called when the user right clicks an update.
+
+ @param updateItem the update itself.
+ @param point where to show the menu
+ */
+ void updateMenu(QListViewItem* item, const QPoint& point);
+
+ /**
+ Slot which gets called 1 minute after CheckForUpdates
+ has detected "network connection being established"
+ */
+ void slotCheckAgainForUpdates();
+
+
+protected slots:
+
+ void slotInstSourceProcessExited( KProcess * );
+
+ void showLog();
+ void slotProcessExited( KProcess *proc );
+ void slotReceivedStdout(KProcess *proc, char *buffer, int buflen);
+ void slotReceivedStderr(KProcess *proc, char *buffer, int buflen);
+
+ void slotInstallProcessExited( KProcess * );
+ void slotInstallReceivedStdout(KProcess *, char *, int ) ;
- /**
- Slot which gets called when we need to throw up the add/remove server dialog.
- */
- void configureUpdater();
-
- /**
- Slot which gets called when we need to start an update.
- Collect our update info from the list we got passed
- in populateList and go.
- */
- void startInstall();
-
- /**
- Slot which gets called when we need to check for updates
- and load up the list.
-
- @param updateList the list on the main window
- */
- void populateLists(QListView* patchList, QListView* packageList);
-
- /**
- Slot which gets called when the user selects an update.
- We are expected to write a description of the update and pass it back.
-
- @param item the update itself
-
- */
- void resolvableSelected(QListViewItem* item, int);
-
- /**
- Slot which gets called when the user right clicks an update.
-
- @param updateItem the update itself.
- @param point where to show the menu
- */
- void updateMenu(QListViewItem* item, const QPoint& point);
-
- /**
- Slot which gets called 1 minute after CheckForUpdates
- has detected "network connection being established"
- */
- void slotCheckAgainForUpdates();
-
-
- protected slots:
-
- void slotInstSourceProcessExited( KProcess * );
-
- void showLog();
- void slotProcessExited( KProcess *proc );
- void slotReceivedStdout(KProcess *proc, char *buffer, int buflen);
- void slotReceivedStderr(KProcess *proc, char *buffer, int buflen);
-
- void slotInstallProcessExited( KProcess * );
- void slotInstallReceivedStdout(KProcess *, char *, int ) ;
-
-
-
- private:
-
- int getNetworkStatus() const;
-
- void doCheckForUpdates();
-
- KProcess *_process;
- QString _buffer;
-
- QString _stderr_buffer;
- QString _error_message_buffer;
-
- KProcess *_install_process;
- QString _install_stderr_buffer;
- QString _install_stdout_buffer;
-
- // parsed data, cleared between calls
- // to checkpatches
- QPtrList<ZYppResolvable> _resolvables;
- QValueList<ZYppSource> _sources;
-
- ZYppSource _current_source;
-
- XmlState _state;
-
- //We hold the QListView passed in "populateUpdateList" here
- QListView *tempList;
- //This holds the currently selected update in the list
- QListViewItem *currentUpdate;
- //Holds the descript for the currently selected update
-
- ZYppResolvable *_current_resolvable;
-
- int _update_counter;
- int totalUpdateCount;
-
- QListView *_patchList;
- QListView *_packageList;
- bool _found_update_status_tag;
- bool _last_xml_parse_code;
- bool _error;
+
+
+private:
+
+ int getNetworkStatus() const;
+
+ void doCheckForUpdates();
+
+ KProcess *_process;
+ QString _buffer;
+
+ QString _stderr_buffer;
+ QString _error_message_buffer;
+
+ KProcess *_install_process;
+ QString _install_stderr_buffer;
+ QString _install_stdout_buffer;
+
+ // parsed data, cleared between calls
+ // to checkpatches
+ QPtrList<ZYppResolvable> _resolvables;
+ QValueList<ZYppSource> _sources;
+
+ ZYppSource _current_source;
+
+ XmlState _state;
+
+ //We hold the QListView passed in "populateUpdateList" here
+ QListView *tempList;
+ //This holds the currently selected update in the list
+ QListViewItem *currentUpdate;
+ //Holds the descript for the currently selected update
+
+ ZYppResolvable *_current_resolvable;
+
+ int _update_counter;
+ int totalUpdateCount;
+
+ QListView *_patchList;
+ QListView *_packageList;
+ bool _found_update_status_tag;
+ bool _last_xml_parse_code;
+ bool _error;
// QProgressDialog *progressDialog;
-
- LicenseDialog *licenseDialog;
- bool restartUpdater;
-
- // Continous xml parsing
- QXmlInputSource _xml_source;
- QXmlSimpleReader _xml_reader;
+
+ LicenseDialog *licenseDialog;
+ bool restartUpdater;
+
+ // Continous xml parsing
+ QXmlInputSource _xml_source;
+ QXmlSimpleReader _xml_reader;
};
#endif
Modified: trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.cpp?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.cpp (original)
+++ trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.cpp Thu Aug 2 12:38:07 2007
@@ -11,7 +11,7 @@
K_EXPORT_COMPONENT_FACTORY( kcm_kopete_latex, ZYppUpdaterPreferencesModuleFactory( "kcm_opensuseupdater_zypp" ) )
ZYppUpdaterPreferencesModule::ZYppUpdaterPreferencesModule(QWidget *parent, const QStringList &args)
- : KCModule(ZYppUpdaterPreferencesModuleFactory::componentData(), parent, args)
+ : KCModule(ZYppUpdaterPreferencesModuleFactory::componentData(), parent, args)
{
QVBoxLayout* l = new QVBoxLayout( this );
QWidget* w = new QWidget;
@@ -22,10 +22,10 @@
// connect widget signals here
m_preferencesWidget->horizontalDPI->setMinimum(1);
m_preferencesWidget->verticalDPI->setMinimum(1);
-
+
connect(m_preferencesWidget->horizontalDPI, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
connect(m_preferencesWidget->verticalDPI, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
-
+
load();
}
Modified: trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.h?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.h (original)
+++ trunk/updater-kde/updater/zypp/ZYppUpdaterPreferencesModule.h Thu Aug 2 12:38:07 2007
@@ -1,6 +1,6 @@
/*
Copyright (c) 2007 by Duncan Mac-Vicar Prett
-
+
*************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
Modified: trunk/updater-kde/updater/zypp/licensedialog.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/licensedialog.cpp?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/licensedialog.cpp (original)
+++ trunk/updater-kde/updater/zypp/licensedialog.cpp Thu Aug 2 12:38:07 2007
@@ -11,24 +11,24 @@
LicenseDialog::LicenseDialog(QWidget *parent)
{
- setModal(true);
+ setModal(true);
- QGridLayout *layout = new QGridLayout(this);
+ QGridLayout *layout = new QGridLayout(this);
- headline = new QLabel(this);
+ headline = new QLabel(this);
- license = new KTextEdit(this);
+ license = new KTextEdit(this);
license->setReadOnly(true);
- KPushButton *cancelButton = new KPushButton(KStdGuiItem::cancel(), this);
+ KPushButton *cancelButton = new KPushButton(KStdGuiItem::cancel(), this);
KPushButton *okButton = new KPushButton(KStdGuiItem::ok(), this);
okButton->setText(i18n("Accept"));
cancelButton->setText(i18n("Decline"));
- layout->addMultiCellWidget(headline,0,0,0,1);
- layout->addMultiCellWidget(license,1,1,0,1);
- layout->addWidget(okButton,2,0);
- layout->addWidget(cancelButton,2,1);
+ layout->addMultiCellWidget(headline,0,0,0,1);
+ layout->addMultiCellWidget(license,1,1,0,1);
+ layout->addWidget(okButton,2,0);
+ layout->addWidget(cancelButton,2,1);
layout->setSpacing(10);
layout->setMargin(10);
@@ -36,14 +36,14 @@
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
-
+
}
void LicenseDialog::setText(const QString &caption, const QString& text)
{
- kdDebug() << text << endl;
- headline->setText(caption);
- license->setText(text);
+ kdDebug() << text << endl;
+ headline->setText(caption);
+ license->setText(text);
}
Modified: trunk/updater-kde/updater/zypp/licensedialog.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/licensedialog.h?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/licensedialog.h (original)
+++ trunk/updater-kde/updater/zypp/licensedialog.h Thu Aug 2 12:38:07 2007
@@ -10,15 +10,15 @@
class LicenseDialog : public QDialog
{
- public:
- LicenseDialog(QWidget *parent);
+public:
+ LicenseDialog(QWidget *parent);
- void setText(const QString &caption, const QString& text);
+ void setText(const QString &caption, const QString& text);
+
+private:
+ QLabel *headline;
+ KTextEdit *license;
- private:
- QLabel *headline;
- KTextEdit *license;
-
};
Modified: trunk/updater-kde/updater/zypp/opensuseupdater_zypp.desktop
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/opensuseupdater_zypp.desktop?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/opensuseupdater_zypp.desktop (original)
+++ trunk/updater-kde/updater/zypp/opensuseupdater_zypp.desktop Thu Aug 2 12:38:07 2007
@@ -1,6 +1,6 @@
[Desktop Entry]
Name=zypp_backend
-Comment=ZYpp Backend
-ServiceTypes=openSUSEUpdater/Backend
-Type=Service
-X-KDE-Library=opensuseupdater_zypp
+ Comment=ZYpp Backend
+ ServiceTypes=openSUSEUpdater/Backend
+ Type=Service
+ X-KDE-Library=opensuseupdater_zypp
Modified: trunk/updater-kde/updater/zypp/zypper_install
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/zypper_install?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/zypper_install (original)
+++ trunk/updater-kde/updater/zypp/zypper_install Thu Aug 2 12:38:07 2007
@@ -2,80 +2,81 @@
patchlist=""
-packagelist=""
-pkgmgrlist=""
-type="patch"
+ packagelist=""
+ pkgmgrlist=""
+ type="patch"
-while [ -n "$1" ]; do
+ while [ -n "$1" ];
+do
- case "$1" in
- "--patch")
- type="patch"
- ;;
+case "$1" in
+ "--patch")
+ type="patch"
+ ;;
- "--package")
- type="package"
- ;;
+ "--package")
+ type="package"
+ ;;
- "--pkgmgr")
- type="pkgmgr"
- ;;
+ "--pkgmgr")
+ type="pkgmgr"
+ ;;
- *)
- if [ $type == "patch" ]; then
- patchlist="$patchlist $1 "
- fi
+ *)
+ if [ $type == "patch" ]; then
+ patchlist="$patchlist $1 "
+ fi
- if [ $type == "package" ]; then
- packagelist="$packagelist $1 "
- fi
+ if [ $type == "package" ]; then
+ packagelist="$packagelist $1 "
+ fi
- if [ $type == "pkgmgr" ]; then
- pkgmgrlist="$pkgmgrlist $1 "
- fi
+ if [ $type == "pkgmgr" ]; then
+ pkgmgrlist="$pkgmgrlist $1 "
+ fi
- ;;
- esac
+ ;;
+ esac
- shift
-done
+ shift
+ done
-patchcommand="zypper -q --terse --non-interactive in -l -t patch $patchlist"
-packagecommand="zypper -q --terse --non-interactive in -l -t package $packagelist"
-pkgmgrcommand="zypper -q --terse --non-interactive in -l -t patch $pkgmgrlist"
+ patchcommand="zypper -q --terse --non-interactive in -l -t patch $patchlist"
+ packagecommand="zypper -q --terse --non-interactive in -l -t package $packagelist"
+ pkgmgrcommand="zypper -q --terse --non-interactive in -l -t patch $pkgmgrlist"
-out=/tmp/opensuseupater_out_$$
-err=/tmp/opensuseupater_err_$$
+ out=/tmp/opensuseupater_out_$$
+ err=/tmp/opensuseupater_err_$$
-mkfifo $out
-mkfifo $err
+ mkfifo $out
+ mkfifo $err
-retval=0
+ retval=0
-cat $err >&2 &
-cat $out &
+ cat $err >&2 &
+ cat $out &
-command="true"
+ command="true"
-if [ -n "$pkgmgrlist" ]; then
- command="$command && $pkgmgrcommand "
-fi
+ if [ -n "$pkgmgrlist" ]; then
+ command="$command && $pkgmgrcommand "
+ fi
-if [ -n "$patchlist" ]; then
- command="$command && $patchcommand "
-fi
+ if [ -n "$patchlist" ]; then
+ command="$command && $patchcommand "
+ fi
-if [ -n "$packagelist" ]; then
- command="$command && $packagecommand "
-fi
+ if [ -n "$packagelist" ]; then
+ command="$command && $packagecommand "
+ fi
-kdesu --noignorebutton -d -c "( $command ) > $out 2> $err "
-retval=$?
+ kdesu --noignorebutton -d -c "( $command ) > $out 2> $err "
+ retval=$?
-rm $out
-rm $err
+ rm $out
+ rm $err
-exit $retval
+ exit $retval
Modified: trunk/updater-kde/updater/zypp/zyppupdaterpreferences_base.ui
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/updater-kde/updater/zypp/zyppupdaterpreferences_base.ui?rev=6384&r1=6383&r2=6384&view=diff
==============================================================================
--- trunk/updater-kde/updater/zypp/zyppupdaterpreferences_base.ui (original)
+++ trunk/updater-kde/updater/zypp/zyppupdaterpreferences_base.ui Thu Aug 2 12:38:07 2007
@@ -1,71 +1,71 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>ZYppUpdaterPreferences_Base</class>
-<widget class="QWidget">
- <property name="name">
- <cstring>ZYppUpdaterPreferences_Base</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>109</height>
- </rect>
- </property>
- <property name="caption">
- <string>Form1</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout1</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QDial">
- <property name="name">
- <cstring>kcfg_Priority</cstring>
- </property>
- <property name="minValue">
- <number>-20</number>
- </property>
- <property name="maxValue">
- <number>19</number>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>Update checking process priority</string>
- </property>
- </widget>
- </hbox>
- </widget>
- <spacer>
- <property name="name">
- <cstring>spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </vbox>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
+ <class>ZYppUpdaterPreferences_Base</class>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>ZYppUpdaterPreferences_Base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>109</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QDial">
+ <property name="name">
+ <cstring>kcfg_Priority</cstring>
+ </property>
+ <property name="minValue">
+ <number>-20</number>
+ </property>
+ <property name="maxValue">
+ <number>19</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Update checking process priority</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <layoutdefaults spacing="6" margin="11"/>
+ </UI>
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org