Fix a handful of FTBFS errors caused by tqStatus/Status string conversion

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/adept@1250604 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent a4c7be3bc2
commit 079be6b922

@ -29,7 +29,7 @@ using namespace std;
namespace adept { namespace adept {
AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit) AcqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit)
: KListViewItem( parent ) : KListViewItem( parent )
{ {
m_pbcol = 0; m_pbcol = 0;
@ -50,19 +50,19 @@ AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit
// /* TQString (Itm . Owner -> ID) + */ TQString (Itm.Description . c_str ())); // /* TQString (Itm . Owner -> ID) + */ TQString (Itm.Description . c_str ()));
} }
AcqtqStatus::Item::~Item () AcqStatus::Item::~Item ()
{ {
delete m_prog; delete m_prog;
} }
int AcqtqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const int AcqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const
{ {
int id1 = m_id; int id1 = m_id;
int id2 = ((Item *) i) -> m_id; int id2 = ((Item *) i) -> m_id;
return (id2 >= id1) - (id2 <= id1); return (id2 >= id1) - (id2 <= id1);
} }
void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w) void AcqStatus::Item::pulse (pkgAcquire::Worker *w)
{ {
if (w) { if (w) {
if (w->TotalSize) if (w->TotalSize)
@ -74,12 +74,12 @@ void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w)
} }
} }
void AcqtqStatus::Item::settqStatus( const std::string &s, int i ) void AcqStatus::Item::settqStatus( const std::string &s, int i )
{ {
m_prog->settqStatus( s, i ); m_prog->settqStatus( s, i );
} }
void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg, void AcqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
int column, int width, int tqalignment ) int column, int width, int tqalignment )
{ {
TQColorGroup _cg( cg ); TQColorGroup _cg( cg );
@ -100,7 +100,7 @@ void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
} }
} }
AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm) AcqStatus::Item *AcqStatus::findItem (pkgAcquire::ItemDesc &Itm)
{ {
if ( Itm.Owner->ID < m_idOffset ) if ( Itm.Owner->ID < m_idOffset )
return 0; return 0;
@ -109,7 +109,7 @@ AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm)
return m_items[ Itm.Owner->ID - m_idOffset ]; return m_items[ Itm.Owner->ID - m_idOffset ];
} }
AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name) AcqStatus::AcqStatus(TQWidget *parent, const char *name)
: KListView (parent, name), m_idOffset( 0 ), m_continue( true ) : KListView (parent, name), m_idOffset( 0 ), m_continue( true )
{ {
// m_lastItem = 0; // m_lastItem = 0;
@ -122,7 +122,7 @@ AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name)
ID = 0; ID = 0;
} }
void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm) void AcqStatus::Done (pkgAcquire::ItemDesc &Itm)
{ {
Item *i = findItem (Itm); Item *i = findItem (Itm);
if (i) { if (i) {
@ -133,14 +133,14 @@ void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
} }
void AcqtqStatus::clear() void AcqStatus::clear()
{ {
KListView::clear(); KListView::clear();
m_idOffset += m_items.size(); m_idOffset += m_items.size();
m_items.clear(); // got deleted by klistview already m_items.clear(); // got deleted by klistview already
} }
void AcqtqStatus::Start() void AcqStatus::Start()
{ {
clear(); clear();
pkgAcquireStatus::Start(); pkgAcquireStatus::Start();
@ -151,7 +151,7 @@ void AcqtqStatus::Start()
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
} }
void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm) void AcqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
{ {
Itm.Owner->ID = ID++; Itm.Owner->ID = ID++;
Item *i = new Item( this, Itm, true ); Item *i = new Item( this, Itm, true );
@ -164,7 +164,7 @@ void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
}; };
void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm) void AcqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
// an item started to download // an item started to download
{ {
Update = true; Update = true;
@ -183,7 +183,7 @@ void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
}; };
void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm) void AcqStatus::Fail(pkgAcquire::ItemDesc &Itm)
// item failed to download // item failed to download
{ {
kdDebug() << "fail, status = " << Itm.Owner->Status kdDebug() << "fail, status = " << Itm.Owner->Status
@ -208,7 +208,7 @@ void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
}; };
void AcqtqStatus::Stop() void AcqStatus::Stop()
{ {
pkgAcquireStatus::Stop(); pkgAcquireStatus::Stop();
emit statusChanged( StDone ); emit statusChanged( StDone );
@ -216,7 +216,7 @@ void AcqtqStatus::Stop()
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
} }
bool AcqtqStatus::Pulse(pkgAcquire *Owner) bool AcqStatus::Pulse(pkgAcquire *Owner)
{ {
pkgAcquireStatus::Pulse(Owner); pkgAcquireStatus::Pulse(Owner);
@ -248,7 +248,7 @@ bool AcqtqStatus::Pulse(pkgAcquire *Owner)
return false; return false;
} }
bool AcqtqStatus::MediaChange(string Media,string Drive) bool AcqStatus::MediaChange(string Media,string Drive)
{ {
int res = KMessageBox::warningContinueCancel( int res = KMessageBox::warningContinueCancel(
this, i18n( "Please insert the disc " this, i18n( "Please insert the disc "
@ -261,7 +261,7 @@ bool AcqtqStatus::MediaChange(string Media,string Drive)
return true; return true;
} }
void AcqtqStatus::cancel() void AcqStatus::cancel()
{ {
m_continue = false; m_continue = false;
} }
@ -271,20 +271,20 @@ AcqStatusDialog::AcqStatusDialog (TQWidget *parent, const char *name, bool modal
u8( "progress dialog (FIXME: waiting for headers, done)" ), u8( "progress dialog (FIXME: waiting for headers, done)" ),
Ok|Cancel, Cancel, true ) Ok|Cancel, Cancel, true )
{ {
m_status = new AcqtqStatus (this, ""); m_status = new AcqStatus (this, "");
setMainWidget( m_status.data() ); setMainWidget( m_status.data() );
enableButton (Ok, false); enableButton (Ok, false);
connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqtqStatus::tqStatus)), connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqStatus::tqStatus)),
this, TQT_SLOT (statusChange (AcqtqStatus::tqStatus))); this, TQT_SLOT (statusChange (AcqStatus::tqStatus)));
} }
void AcqStatusDialog::statusChange (AcqtqStatus::tqStatus st) void AcqStatusDialog::statusChange (AcqStatus::tqStatus st)
{ {
if (st == AcqtqStatus::StDownloading || st == AcqtqStatus::StWaiting) { if (st == AcqStatus::StDownloading || st == AcqStatus::StWaiting) {
enableButton (Ok, false); enableButton (Ok, false);
// XXX: cancel should be true; but needs implementation first // XXX: cancel should be true; but needs implementation first
enableButton (Cancel, false); enableButton (Cancel, false);
} else if (st == AcqtqStatus::StDone) { } else if (st == AcqStatus::StDone) {
enableButton (Ok, true); enableButton (Ok, true);
enableButton (Cancel, false); enableButton (Cancel, false);
} }

@ -15,7 +15,7 @@
#include <apt-pkg/acquire.h> #include <apt-pkg/acquire.h>
#include <apt-front/progresscallback.h> #include <apt-front/progresscallback.h>
class AcqtqStatus; class AcqStatus;
class TQLabel; class TQLabel;
class TQProgressBar; class TQProgressBar;
class TQSpacer; class TQSpacer;
@ -23,7 +23,7 @@ class TQGridLayout;
namespace adept { namespace adept {
class AcqtqStatus : public KListView, public aptFront::ProgressCallback class AcqStatus : public KListView, public aptFront::ProgressCallback
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT TQ_OBJECT
@ -88,7 +88,7 @@ public:
enum tqStatus { StWaiting, StDownloading, StDone }; enum tqStatus { StWaiting, StDownloading, StDone };
AcqtqStatus (TQWidget *parent, const char *name); AcqStatus (TQWidget *parent, const char *name);
Item *findItem (pkgAcquire::ItemDesc &Itm); Item *findItem (pkgAcquire::ItemDesc &Itm);
virtual bool MediaChange (string Media,string Drive); virtual bool MediaChange (string Media,string Drive);
@ -107,7 +107,7 @@ public slots:
void cancel(); void cancel();
signals: signals:
void statusChanged (AcqtqStatus::tqStatus st); void statusChanged (AcqStatus::tqStatus st);
void totalProgress (int percent); void totalProgress (int percent);
//AcqTexttqStatus(unsigned int &ScreenWidth,unsigned int Quiet); //AcqTexttqStatus(unsigned int &ScreenWidth,unsigned int Quiet);
@ -118,12 +118,12 @@ class AcqStatusDialog : public KDialogBase
Q_OBJECT Q_OBJECT
TQ_OBJECT TQ_OBJECT
protected: protected:
aptFront::SharedPtr<AcqtqStatus> m_status; aptFront::SharedPtr<AcqStatus> m_status;
public: public:
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_status.data(); }; aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_status.data(); };
AcqStatusDialog (TQWidget *parent, const char *name, bool modal); AcqStatusDialog (TQWidget *parent, const char *name, bool modal);
public slots: public slots:
void statusChange (AcqtqStatus::tqStatus st); void statusChange (AcqStatus::tqStatus st);
}; };
} }
#endif #endif

@ -15,23 +15,23 @@ AcqProgressWidget::AcqProgressWidget( TQWidget *parent, const char *name )
m_progress->setProgress( 0 ); m_progress->setProgress( 0 );
connect(m_status, TQT_SIGNAL( totalProgress( int ) ), connect(m_status, TQT_SIGNAL( totalProgress( int ) ),
this, TQT_SLOT( setProgress( int ) ) ); this, TQT_SLOT( setProgress( int ) ) );
connect(m_status, TQT_SIGNAL( statusChanged( AcqtqStatus::tqStatus ) ), connect(m_status, TQT_SIGNAL( statusChanged( AcqStatus::tqStatus ) ),
this, TQT_SLOT( statusChange( AcqtqStatus::tqStatus ) ) ); this, TQT_SLOT( statusChange( AcqStatus::tqStatus ) ) );
connect( m_cancel, TQT_SIGNAL( clicked() ), connect( m_cancel, TQT_SIGNAL( clicked() ),
m_status, TQT_SLOT( cancel() ) ); m_status, TQT_SLOT( cancel() ) );
} }
void AcqProgressWidget::statusChange( AcqtqStatus::tqStatus s ) void AcqProgressWidget::statusChange( AcqStatus::tqStatus s )
{ {
TQString t; TQString t;
switch (s) { switch (s) {
case AcqtqStatus::StWaiting: case AcqStatus::StWaiting:
t = i18n( "Waiting for headers (%p%)" ); t = i18n( "Waiting for headers (%p%)" );
break; break;
case AcqtqStatus::StDownloading: case AcqStatus::StDownloading:
t = i18n( "Downloading (%p%)" ); t = i18n( "Downloading (%p%)" );
break; break;
case AcqtqStatus::StDone: case AcqStatus::StDone:
t = i18n( "Done (%p%)" ); t = i18n( "Done (%p%)" );
m_progress->setProgress( 100 ); m_progress->setProgress( 100 );
break; break;

@ -19,10 +19,10 @@ public:
AcqProgressWidget (TQWidget *parent = 0, const char *name = 0); AcqProgressWidget (TQWidget *parent = 0, const char *name = 0);
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_statusRef.data(); }; aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_statusRef.data(); };
public slots: public slots:
void statusChange( AcqtqStatus::tqStatus ); void statusChange( AcqStatus::tqStatus );
void setProgress( int ); void setProgress( int );
protected: protected:
aptFront::SharedPtr<AcqtqStatus> m_statusRef; aptFront::SharedPtr<AcqStatus> m_statusRef;
}; };
} }

@ -50,7 +50,7 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>adept::AcqtqStatus</class> <class>adept::AcqStatus</class>
<header location="global">acqprogress.h</header> <header location="global">acqprogress.h</header>
<sizehint> <sizehint>
<width>-1</width> <width>-1</width>

@ -29,7 +29,7 @@ using namespace std;
namespace adept { namespace adept {
AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit) AcqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit)
: KListViewItem( parent ) : KListViewItem( parent )
{ {
m_pbcol = 0; m_pbcol = 0;
@ -50,19 +50,19 @@ AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit
// /* TQString (Itm . Owner -> ID) + */ TQString (Itm.Description . c_str ())); // /* TQString (Itm . Owner -> ID) + */ TQString (Itm.Description . c_str ()));
} }
AcqtqStatus::Item::~Item () AcqStatus::Item::~Item ()
{ {
delete m_prog; delete m_prog;
} }
int AcqtqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const int AcqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const
{ {
int id1 = m_id; int id1 = m_id;
int id2 = ((Item *) i) -> m_id; int id2 = ((Item *) i) -> m_id;
return (id2 >= id1) - (id2 <= id1); return (id2 >= id1) - (id2 <= id1);
} }
void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w) void AcqStatus::Item::pulse (pkgAcquire::Worker *w)
{ {
if (w) { if (w) {
if (w->TotalSize) if (w->TotalSize)
@ -74,12 +74,12 @@ void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w)
} }
} }
void AcqtqStatus::Item::settqStatus( const std::string &s, int i ) void AcqStatus::Item::settqStatus( const std::string &s, int i )
{ {
m_prog->settqStatus( s, i ); m_prog->settqStatus( s, i );
} }
void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg, void AcqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
int column, int width, int tqalignment ) int column, int width, int tqalignment )
{ {
TQColorGroup _cg( cg ); TQColorGroup _cg( cg );
@ -100,7 +100,7 @@ void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
} }
} }
AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm) AcqStatus::Item *AcqStatus::findItem (pkgAcquire::ItemDesc &Itm)
{ {
if ( Itm.Owner->ID < m_idOffset ) if ( Itm.Owner->ID < m_idOffset )
return 0; return 0;
@ -109,7 +109,7 @@ AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm)
return m_items[ Itm.Owner->ID - m_idOffset ]; return m_items[ Itm.Owner->ID - m_idOffset ];
} }
AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name) AcqStatus::AcqStatus(TQWidget *parent, const char *name)
: KListView (parent, name), m_idOffset( 0 ), m_continue( true ) : KListView (parent, name), m_idOffset( 0 ), m_continue( true )
{ {
// m_lastItem = 0; // m_lastItem = 0;
@ -122,7 +122,7 @@ AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name)
ID = 0; ID = 0;
} }
void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm) void AcqStatus::Done (pkgAcquire::ItemDesc &Itm)
{ {
Item *i = findItem (Itm); Item *i = findItem (Itm);
if (i) { if (i) {
@ -133,14 +133,14 @@ void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
} }
void AcqtqStatus::clear() void AcqStatus::clear()
{ {
KListView::clear(); KListView::clear();
m_idOffset += m_items.size(); m_idOffset += m_items.size();
m_items.clear(); // got deleted by klistview already m_items.clear(); // got deleted by klistview already
} }
void AcqtqStatus::Start() void AcqStatus::Start()
{ {
clear(); clear();
pkgAcquireStatus::Start(); pkgAcquireStatus::Start();
@ -151,7 +151,7 @@ void AcqtqStatus::Start()
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
} }
void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm) void AcqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
{ {
Itm.Owner->ID = ID++; Itm.Owner->ID = ID++;
Item *i = new Item( this, Itm, true ); Item *i = new Item( this, Itm, true );
@ -164,7 +164,7 @@ void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
}; };
void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm) void AcqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
// an item started to download // an item started to download
{ {
Update = true; Update = true;
@ -183,7 +183,7 @@ void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
}; };
void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm) void AcqStatus::Fail(pkgAcquire::ItemDesc &Itm)
// item failed to download // item failed to download
{ {
kdDebug() << "fail, status = " << Itm.Owner->tqStatus kdDebug() << "fail, status = " << Itm.Owner->tqStatus
@ -208,7 +208,7 @@ void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
}; };
void AcqtqStatus::Stop() void AcqStatus::Stop()
{ {
pkgAcquireStatus::Stop(); pkgAcquireStatus::Stop();
emit statusChanged( StDone ); emit statusChanged( StDone );
@ -216,7 +216,7 @@ void AcqtqStatus::Stop()
KApplication::kApplication()->processEvents(); KApplication::kApplication()->processEvents();
} }
bool AcqtqStatus::Pulse(pkgAcquire *Owner) bool AcqStatus::Pulse(pkgAcquire *Owner)
{ {
pkgAcquireStatus::Pulse(Owner); pkgAcquireStatus::Pulse(Owner);
@ -248,7 +248,7 @@ bool AcqtqStatus::Pulse(pkgAcquire *Owner)
return false; return false;
} }
bool AcqtqStatus::MediaChange(string Media,string Drive) bool AcqStatus::MediaChange(string Media,string Drive)
{ {
int res = KMessageBox::warningContinueCancel( int res = KMessageBox::warningContinueCancel(
this, i18n( "Please insert the disc " this, i18n( "Please insert the disc "
@ -261,7 +261,7 @@ bool AcqtqStatus::MediaChange(string Media,string Drive)
return true; return true;
} }
void AcqtqStatus::cancel() void AcqStatus::cancel()
{ {
m_continue = false; m_continue = false;
} }
@ -271,20 +271,20 @@ AcqStatusDialog::AcqStatusDialog (TQWidget *parent, const char *name, bool modal
u8( "progress dialog (FIXME: waiting for headers, done)" ), u8( "progress dialog (FIXME: waiting for headers, done)" ),
Ok|Cancel, Cancel, true ) Ok|Cancel, Cancel, true )
{ {
m_status = new AcqtqStatus (this, ""); m_status = new AcqStatus (this, "");
setMainWidget( m_status.data() ); setMainWidget( m_status.data() );
enableButton (Ok, false); enableButton (Ok, false);
connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqtqStatus::tqStatus)), connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqStatus::tqStatus)),
this, TQT_SLOT (statusChange (AcqtqStatus::tqStatus))); this, TQT_SLOT (statusChange (AcqStatus::tqStatus)));
} }
void AcqStatusDialog::statusChange (AcqtqStatus::tqStatus st) void AcqStatusDialog::statusChange (AcqStatus::tqStatus st)
{ {
if (st == AcqtqStatus::StDownloading || st == AcqtqStatus::StWaiting) { if (st == AcqStatus::StDownloading || st == AcqStatus::StWaiting) {
enableButton (Ok, false); enableButton (Ok, false);
// XXX: cancel should be true; but needs implementation first // XXX: cancel should be true; but needs implementation first
enableButton (Cancel, false); enableButton (Cancel, false);
} else if (st == AcqtqStatus::StDone) { } else if (st == AcqStatus::StDone) {
enableButton (Ok, true); enableButton (Ok, true);
enableButton (Cancel, false); enableButton (Cancel, false);
} }

@ -15,7 +15,7 @@
#include <apt-pkg/acquire.h> #include <apt-pkg/acquire.h>
#include <apt-front/progresscallback.h> #include <apt-front/progresscallback.h>
class AcqtqStatus; class AcqStatus;
class TQLabel; class TQLabel;
class TQProgressBar; class TQProgressBar;
class TQSpacer; class TQSpacer;
@ -23,7 +23,7 @@ class TQGridLayout;
namespace adept { namespace adept {
class AcqtqStatus : public KListView, public aptFront::ProgressCallback class AcqStatus : public KListView, public aptFront::ProgressCallback
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT TQ_OBJECT
@ -88,7 +88,7 @@ public:
enum tqStatus { StWaiting, StDownloading, StDone }; enum tqStatus { StWaiting, StDownloading, StDone };
AcqtqStatus (TQWidget *parent, const char *name); AcqStatus (TQWidget *parent, const char *name);
Item *findItem (pkgAcquire::ItemDesc &Itm); Item *findItem (pkgAcquire::ItemDesc &Itm);
virtual bool MediaChange (string Media,string Drive); virtual bool MediaChange (string Media,string Drive);
@ -107,7 +107,7 @@ public slots:
void cancel(); void cancel();
signals: signals:
void statusChanged (AcqtqStatus::tqStatus st); void statusChanged (AcqStatus::tqStatus st);
void totalProgress (int percent); void totalProgress (int percent);
//AcqTexttqStatus(unsigned int &ScreenWidth,unsigned int Quiet); //AcqTexttqStatus(unsigned int &ScreenWidth,unsigned int Quiet);
@ -118,12 +118,12 @@ class AcqStatusDialog : public KDialogBase
Q_OBJECT Q_OBJECT
TQ_OBJECT TQ_OBJECT
protected: protected:
aptFront::SharedPtr<AcqtqStatus> m_status; aptFront::SharedPtr<AcqStatus> m_status;
public: public:
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_status.data(); }; aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_status.data(); };
AcqStatusDialog (TQWidget *parent, const char *name, bool modal); AcqStatusDialog (TQWidget *parent, const char *name, bool modal);
public slots: public slots:
void statusChange (AcqtqStatus::tqStatus st); void statusChange (AcqStatus::tqStatus st);
}; };
} }
#endif #endif

@ -15,23 +15,23 @@ AcqProgressWidget::AcqProgressWidget( TQWidget *parent, const char *name )
m_progress->setProgress( 0 ); m_progress->setProgress( 0 );
connect(m_status, TQT_SIGNAL( totalProgress( int ) ), connect(m_status, TQT_SIGNAL( totalProgress( int ) ),
this, TQT_SLOT( setProgress( int ) ) ); this, TQT_SLOT( setProgress( int ) ) );
connect(m_status, TQT_SIGNAL( statusChanged( AcqtqStatus::tqStatus ) ), connect(m_status, TQT_SIGNAL( statusChanged( AcqStatus::tqStatus ) ),
this, TQT_SLOT( statusChange( AcqtqStatus::tqStatus ) ) ); this, TQT_SLOT( statusChange( AcqStatus::tqStatus ) ) );
connect( m_cancel, TQT_SIGNAL( clicked() ), connect( m_cancel, TQT_SIGNAL( clicked() ),
m_status, TQT_SLOT( cancel() ) ); m_status, TQT_SLOT( cancel() ) );
} }
void AcqProgressWidget::statusChange( AcqtqStatus::tqStatus s ) void AcqProgressWidget::statusChange( AcqStatus::tqStatus s )
{ {
TQString t; TQString t;
switch (s) { switch (s) {
case AcqtqStatus::StWaiting: case AcqStatus::StWaiting:
t = i18n( "Waiting for headers (%p%)" ); t = i18n( "Waiting for headers (%p%)" );
break; break;
case AcqtqStatus::StDownloading: case AcqStatus::StDownloading:
t = i18n( "Downloading (%p%)" ); t = i18n( "Downloading (%p%)" );
break; break;
case AcqtqStatus::StDone: case AcqStatus::StDone:
t = i18n( "Done (%p%)" ); t = i18n( "Done (%p%)" );
m_progress->setProgress( 100 ); m_progress->setProgress( 100 );
break; break;

@ -19,10 +19,10 @@ public:
AcqProgressWidget (TQWidget *parent = 0, const char *name = 0); AcqProgressWidget (TQWidget *parent = 0, const char *name = 0);
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_statusRef.data(); }; aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_statusRef.data(); };
public slots: public slots:
void statusChange( AcqtqStatus::tqStatus ); void statusChange( AcqStatus::tqStatus );
void setProgress( int ); void setProgress( int );
protected: protected:
aptFront::SharedPtr<AcqtqStatus> m_statusRef; aptFront::SharedPtr<AcqStatus> m_statusRef;
}; };
} }

@ -50,7 +50,7 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>adept::AcqtqStatus</class> <class>adept::AcqStatus</class>
<header location="global">acqprogress.h</header> <header location="global">acqprogress.h</header>
<sizehint> <sizehint>
<width>-1</width> <width>-1</width>

Loading…
Cancel
Save