Hello community,
here is the log from the commit of package yast2-qt
checked in at Wed Dec 19 14:57:34 CET 2007.
--------
--- yast2-qt/yast2-qt.changes 2007-12-18 17:52:31.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-qt/yast2-qt.changes 2007-12-19 09:13:20.000000000 +0100
@@ -1,0 +2,5 @@
+Wed Dec 19 09:13:02 CET 2007 - coolo@suse.de
+
+- fix file list
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-qt.spec ++++++
--- /var/tmp/diff_new_pack.zt9312/_old 2007-12-19 14:56:26.000000000 +0100
+++ /var/tmp/diff_new_pack.zt9312/_new 2007-12-19 14:56:26.000000000 +0100
@@ -11,7 +11,7 @@
Name: yast2-qt
Version: 2.16.10
-Release: 1
+Release: 2
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -75,9 +75,10 @@
%_libdir/YaST2/plugin/libpy2qt.so
%_libdir/YaST2/plugin/libpy2qt_pkg.so.*
%_libdir/YaST2/plugin/libpy2qt_pkg.so
-%_prefix/share/YaST2/theme
%changelog
+* Wed Dec 19 2007 - coolo@suse.de
+- fix file list
* Tue Dec 18 2007 - coolo@suse.de
- implement timezone widget
- moved theming to theme package
++++++ yast2-qt-2.16.10.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.10/src/pkg/icons/zoom-in.xpm new/yast2-qt-2.16.10/src/pkg/icons/zoom-in.xpm
--- old/yast2-qt-2.16.10/src/pkg/icons/zoom-in.xpm 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-qt-2.16.10/src/pkg/icons/zoom-in.xpm 2007-12-19 09:13:19.000000000 +0100
@@ -0,0 +1,162 @@
+/* XPM */
+static const char *zoom_in[] = {
+/* columns rows colors chars-per-pixel */
+"24 24 132 2",
+" c black",
+". c #010101",
+"X c #020202",
+"o c gray1",
+"O c gray2",
+"+ c #060606",
+"@ c #090909",
+"# c gray4",
+"$ c #0B0B0B",
+"% c #0E0E0E",
+"& c gray6",
+"* c #101010",
+"= c #111111",
+"- c #131313",
+"; c gray8",
+": c #1B1B1B",
+"> c gray11",
+", c gray12",
+"< c #202020",
+"1 c gray13",
+"2 c #222222",
+"3 c gray15",
+"4 c #272727",
+"5 c gray16",
+"6 c gray17",
+"7 c #2D2D2D",
+"8 c gray18",
+"9 c gray19",
+"0 c #313131",
+"q c #343434",
+"w c #3A3A3A",
+"e c gray23",
+"r c #3C3C3C",
+"t c #3F3F3F",
+"y c #414141",
+"u c gray26",
+"i c #434343",
+"p c #444444",
+"a c gray27",
+"s c #4C4C4C",
+"d c #515151",
+"f c gray34",
+"g c #5B5B5B",
+"h c gray37",
+"j c #5F5F5F",
+"k c gray38",
+"l c #676767",
+"z c #686868",
+"x c #6D6D6D",
+"c c gray45",
+"v c gray46",
+"b c #777777",
+"n c #797979",
+"m c gray48",
+"M c #909090",
+"N c #939393",
+"B c gray60",
+"V c #9A9A9A",
+"C c #9B9B9B",
+"Z c #9D9D9D",
+"A c gray63",
+"S c #A5A5A5",
+"D c #A7A7A7",
+"F c gray66",
+"G c gray67",
+"H c #B2B2B2",
+"J c #B4B4B4",
+"K c #B6B6B6",
+"L c gray72",
+"P c #B9B9B9",
+"I c gray73",
+"U c #BBBBBB",
+"Y c #BCBCBC",
+"T c gray74",
+"R c gray75",
+"E c #C1C1C1",
+"W c gray76",
+"Q c #C5C5C5",
+"! c #C6C6C6",
+"~ c gray78",
+"^ c #C8C8C8",
+"/ c gray79",
+"( c #CACACA",
+") c #CBCBCB",
+"_ c gray80",
+"` c #CDCDCD",
+"' c #CECECE",
+"] c gray81",
+"[ c #D0D0D0",
+"{ c gray82",
+"} c #D2D2D2",
+"| c LightGray",
+" . c gray83",
+".. c #D5D5D5",
+"X. c gray84",
+"o. c #D7D7D7",
+"O. c #D8D8D8",
+"+. c gray85",
+"@. c #DADADA",
+"#. c gray86",
+"$. c gainsboro",
+"%. c #DFDFDF",
+"&. c gray88",
+"*. c #E1E1E1",
+"=. c #E2E2E2",
+"-. c gray89",
+";. c #E4E4E4",
+":. c gray90",
+">. c #E6E6E6",
+",. c #E7E7E7",
+"<. c #E9E9E9",
+"1. c #EAEAEA",
+"2. c gray92",
+"3. c #ECECEC",
+"4. c gray93",
+"5. c #EEEEEE",
+"6. c #EFEFEF",
+"7. c gray94",
+"8. c #F1F1F1",
+"9. c gray95",
+"0. c #F3F3F3",
+"q. c #F4F4F4",
+"w. c gray96",
+"e. c #F6F6F6",
+"r. c #F8F8F8",
+"t. c #F9F9F9",
+"y. c gray98",
+"u. c #FBFBFB",
+"i. c gray99",
+"p. c #FDFDFD",
+"a. c #FEFEFE",
+"s. c None",
+/* pixels */
+"s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.",
+"s.s.s.s.s.s.s.q 7 5 3 3 3 s.s.s.s.s.s.s.s.s.s.s.",
+"s.s.s.s.s.8 9 c A J H Z l < > s.s.s.s.s.s.s.s.s.",
+"s.s.s.s.4 k J ( ] [ ' / E D s - s.s.s.s.s.s.s.s.",
+"s.s.s.2 v ( | #.,.6.0.8.:.} Y h * s.s.s.s.s.s.s.",
+"s.s.1 g _ o.:.w.y.u.y.r.w.7.*.W i & s.s.s.s.s.s.",
+"s.s., P X.,.t.u.p.a a u.r.9.3.;.G % s.s.s.s.s.s.",
+"s.: x } *.w.y.p.a.a a i.t.w.5.>.#.f @ s.s.s.s.s.",
+"s.; F O.5.e.t.i.a.a a u.r.q.5.>.$.C + s.s.s.s.s.",
+"s.= Q %.6.w.p p a a a p i u 4.:.#.R + s.s.s.s.s.",
+"s.% ! -.3.9.i p p p p i u y 1.&.o.I O s.s.s.s.s.",
+"s.$ S *.,.4.8.q.e.i i 0.6.3.;.#.{ N X s.s.s.s.s.",
+"s.# j +.*.>.2.5.6.y y 4.<.;.#. .( s s.s.s.s.s.",
+"s.s.# J O.$.=.:.>.t t -.%.@. .) A X s.s.s.s.s.s.",
+"s.s.+ e _ } .@.#.@.#.O...[ ^ T 8 s.s.s.s.s.s.",
+"s.s.s.O d W ~ ) _ ` ) ) ^ W L a s.s.s.s.s.s.s.",
+"s.s.s.s.o 0 B U T Y Y Y K M 6 s.s.s.s.s.s.",
+"s.s.s.s.s.. o y m V V b r s. s.s.s.s.",
+"s.s.s.s.s.s.s. s.s.s.s.< < s.s.s.",
+"s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s. z q s.s.",
+"s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s. n w s.",
+"s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s. z , s.",
+"s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s. s.s.",
+"s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s."
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.10/src/YQTimezoneSelector.cc new/yast2-qt-2.16.10/src/YQTimezoneSelector.cc
--- old/yast2-qt-2.16.10/src/YQTimezoneSelector.cc 2007-12-18 17:52:29.000000000 +0100
+++ new/yast2-qt-2.16.10/src/YQTimezoneSelector.cc 2007-12-19 09:13:18.000000000 +0100
@@ -34,6 +34,52 @@
#include <QDebug>
#include <QToolTip>
+#include "pkg/icons/zoom-in.xpm"
+
+class YQTimezoneSelectorPrivate
+{
+ QWidget *parent;
+
+public:
+
+ YQTimezoneSelectorPrivate( QWidget *p ) {
+ parent = p;
+ blink = 0;
+ }
+ QImage _pix;
+ QPoint _zoom;
+
+ struct Location
+ {
+ QString country;
+ double latitude;
+ double longitude;
+ QString zone;
+ QString comment;
+ QString tip;
+
+ QPoint pix_pos;
+
+ bool operator<(const Location& l2) const;
+ };
+
+ Location _best;
+
+ QList<Location> locations;
+
+ Location findBest( const QPoint &pos ) const;
+
+ QTimer *blink;
+
+ int highlight;
+
+ QPoint pixPosition( const Location &pos ) const;
+
+ QPoint pixToWindow( const QPoint &pos ) const;
+
+ QPixmap cachePix;
+};
+
static float
convert_pos (const QString &pos, int digits)
{
@@ -51,7 +97,7 @@
return t1 - t2/pow (10.0, fraction.length());
}
-bool YQTimezoneSelector::Location::operator<(const Location& l1 ) const
+bool YQTimezoneSelectorPrivate::Location::operator<(const Location& l1 ) const
{
return l1.latitude < latitude;
}
@@ -60,9 +106,11 @@
: QFrame( (QWidget *) parent->widgetRep() )
, YTimezoneSelector( parent, pixmap, timezones )
{
+ d = new YQTimezoneSelectorPrivate( this );
+
setWidgetRep( this );
setMouseTracking(true);
- _pix.load( QString::fromStdString( pixmap ) );
+ d->_pix.load( QString::fromStdString( pixmap ) );
setStretchable( YD_HORIZ, true );
setStretchable( YD_VERT, true );
@@ -80,7 +128,7 @@
while ( split_index < arr[1].length() && arr[1][split_index] != '-' && arr[1][split_index] != '+' )
split_index++;
- Location loc;
+ YQTimezoneSelectorPrivate::Location loc;
loc.country = arr[0];
loc.zone = arr[2];
map::const_iterator tooltip = timezones.find( loc.zone.toStdString() );
@@ -93,41 +141,38 @@
loc.latitude = convert_pos ( arr[1].left( split_index ), 2);
loc.longitude = convert_pos ( arr[1].mid( split_index ), 3);
- loc.pix_pos = pixPosition( loc );
+ loc.pix_pos = d->pixPosition( loc );
- locations.push_back( loc );
+ d->locations.push_back( loc );
}
fclose (tzfile);
- qSort( locations.begin(), locations.end() );
-
- QPainter p( &_pix );
- for ( QList<Location>::const_iterator it = locations.begin(); it != locations.end(); ++it )
- p.drawRect( ( *it ).pix_pos.x() - 1, ( *it ).pix_pos.y() - 1, 3, 3 );
+ qSort( d->locations.begin(), d->locations.end() );
- blink = new QTimer( this );
- blink->setInterval( 200 );
- connect( blink, SIGNAL( timeout() ), SLOT( slotBlink() ) );
+ d->blink = new QTimer( this );
+ d->blink->setInterval( 200 );
+ connect( d->blink, SIGNAL( timeout() ), SLOT( slotBlink() ) );
- highlight = false;
+ d->highlight = 0;
}
YQTimezoneSelector::~YQTimezoneSelector()
{
+ delete d;
// NOP
}
int YQTimezoneSelector::preferredWidth()
{
- return _pix.width() / 2;
+ return 400;
}
int YQTimezoneSelector::preferredHeight()
{
- return _pix.height() / 2;
+ return 200;
}
@@ -136,7 +181,7 @@
resize( newWidth, newHeight );
}
-QPoint YQTimezoneSelector::pixPosition( const Location &pos ) const
+QPoint YQTimezoneSelectorPrivate::pixPosition( const Location &pos ) const
{
return QPoint( _pix.width() / 2 + _pix.width() / 2 * pos.longitude / 180,
_pix.height() / 2 - _pix.height() / 2 * pos.latitude / 90 );
@@ -146,24 +191,27 @@
{
if ( event->button() == Qt::RightButton )
{
- _zoom = QPoint();
- _best = Location();
+ d->_zoom = QPoint();
+ d->_best = YQTimezoneSelectorPrivate::Location();
+ d->cachePix = QPixmap();
}
else if ( event->button() == Qt::LeftButton )
{
- if ( _zoom.isNull() )
+ if ( d->_zoom.isNull() )
{
QPoint click = event->pos();
/* keep the zoom point in unscaled math */
- _zoom.rx() = double( click.x() ) * _pix.width() / width();
- _zoom.ry() = double( click.y() ) * _pix.height() / height();
+ d->_zoom.rx() = double( click.x() ) * d->_pix.width() / width();
+ d->_zoom.ry() = double( click.y() ) * d->_pix.height() / height();
+ d->cachePix = QPixmap();
} else {
- _best = findBest( event->pos() );
+ d->_best = d->findBest( event->pos() );
+ d->cachePix = QPixmap();
if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
- blink->start();
+ d->blink->start();
}
} else
return;
@@ -175,29 +223,55 @@
{
QFrame::paintEvent( event );
QPainter p( this );
- if ( _zoom.isNull() )
+
+ if ( d->cachePix.width() != width() || d->cachePix.height() != height() )
+ d->cachePix = QPixmap();
+
+ if ( d->_zoom.isNull() )
{
- QImage t = _pix.toImage().scaled( width(), height() );
- p.drawPixmap( 0, 0, QPixmap::fromImage( t ) );
+ if ( d->cachePix.isNull() )
+ {
+ QImage t = d->_pix.scaled( width(), height() );
+ d->cachePix = QPixmap::fromImage( t );
+ }
+ p.drawPixmap( 0, 0, d->cachePix );
- setCursor( QCursor( QPixmap( "/home/col/prod/ubiquity/pixmaps/zoom-in.png" ) ) );
+ setCursor( QCursor( QPixmap( zoom_in ) ) );
} else {
- int left = qMin( qMax( _zoom.x() - width() / 2, 0 ), _pix.width() - width() );
- int top = qMin( qMax( _zoom.y() - height() / 2, 0 ), _pix.height() - height() );
- p.drawPixmap( QPoint( 0, 0 ), _pix, QRect( QPoint( left, top ), size() ) );
+ int left = qMin( qMax( d->_zoom.x() - width() / 2, 0 ), d->_pix.width() - width() );
+ int top = qMin( qMax( d->_zoom.y() - height() / 2, 0 ), d->_pix.height() - height() );
+
+ if ( d->cachePix.isNull() )
+ d->cachePix = QPixmap::fromImage( d->_pix.copy( QRect( QPoint( left, top ), size() ) ) );
- if ( highlight )
+ p.drawPixmap( 0, 0, d->cachePix );
+
+ if ( d->highlight > 0 )
{
- QPoint pos = pixPosition( _best );
- p.setPen( Qt::red );
- p.drawRect( pos.x() - left - 1, pos.y() - top - 1, 3, 3 );
- qDebug() << QRect( pos.x() - left - 1, pos.y() - top - 1, 3, 3 ) << event->region().rects();
+ QPoint pos = d->pixPosition( d->_best );
+ static const QColor blinks[] = { QColor( "#00ff00" ), QColor( "#22dd00" ), QColor( "#44bb00" ),
+ QColor( "#669900" ), QColor( "#887700" ), QColor( "#aa5500" ),
+ QColor( "#887700" ), QColor( "#669900" ), QColor( "#44bb00" ),
+ QColor( "#22dd00" ) };
+ int index = d->highlight - 1;
+ p.setPen( blinks[ index ] );
+ p.setBrush( blinks[ index ] );
+
+ p.drawEllipse( QRect( d->pixToWindow( d->_best.pix_pos ) - QPoint( 2,2 ), QSize( 5, 5 ) ) );
}
setCursor( Qt::CrossCursor );
}
+
+ p.setBrush( Qt::green );
+ p.setPen( Qt::green );
+ for ( QListYQTimezoneSelectorPrivate::Location::const_iterator it = d->locations.begin(); it != d->locations.end(); ++it )
+ {
+ if ( !d->highlight || ( *it ).zone != d->_best.zone )
+ p.drawEllipse( QRect( d->pixToWindow( ( *it ).pix_pos ) - QPoint( 2,2 ), QSize( 5, 5 ) ) );
+ }
}
-YQTimezoneSelector::Location YQTimezoneSelector::findBest( const QPoint &pos ) const
+YQTimezoneSelectorPrivate::Location YQTimezoneSelectorPrivate::findBest( const QPoint &pos ) const
{
double min_dist = 2000;
Location best;
@@ -219,7 +293,7 @@
{
QHelpEvent *helpEvent = static_cast(event);
- Location best = findBest( helpEvent->pos() );
+ YQTimezoneSelectorPrivate::Location best = d->findBest( helpEvent->pos() );
QToolTip::showText(helpEvent->globalPos(), best.tip );
}
return QWidget::event(event);
@@ -228,13 +302,13 @@
std::string YQTimezoneSelector::currentZone() const
{
- return _best.zone.toStdString();
+ return d->_best.zone.toStdString();
}
-QPoint YQTimezoneSelector::pixToWindow( const QPoint &pos ) const
+QPoint YQTimezoneSelectorPrivate::pixToWindow( const QPoint &pos ) const
{
- int left = qMin( qMax( _zoom.x() - width() / 2, 0 ), _pix.width() - width() );
- int top = qMin( qMax( _zoom.y() - height() / 2, 0 ), _pix.height() - height() );
+ int left = qMin( qMax( _zoom.x() - parent->width() / 2, 0 ), _pix.width() - parent->width() );
+ int top = qMin( qMax( _zoom.y() - parent->height() / 2, 0 ), _pix.height() - parent->height() );
return QPoint( pos.x() - left, pos.y() - top );
}
@@ -243,35 +317,37 @@
{
QString zone = QString::fromStdString( _zone );
- if ( _best.zone == zone )
+ if ( d->_best.zone == zone )
return;
- _best = Location();
+ d->_best = YQTimezoneSelectorPrivate::Location();
- for ( QList<Location>::const_iterator it = locations.begin(); it != locations.end(); ++it )
+ for ( QListYQTimezoneSelectorPrivate::Location::const_iterator it = d->locations.begin(); it != d->locations.end(); ++it )
{
if ( ( *it ).zone == zone )
- _best = *it;
+ d->_best = *it;
}
- _zoom = _best.pix_pos;
+ d->_zoom = d->_best.pix_pos;
+ d->cachePix = QPixmap();
- blink->start();
+ d->blink->start();
update();
}
void YQTimezoneSelector::slotBlink()
{
- if ( _best.zone.isNull() )
+ if ( d->_best.zone.isNull() )
{
- blink->stop();
+ d->blink->stop();
return;
}
- highlight = !highlight;
+ if ( d->highlight++ > 9 )
+ d->highlight = 1;
- QPoint current = pixToWindow( _best.pix_pos );
- update( QRect( current - QPoint( 2, 2 ), QSize( 5, 5 ) ) );
+ QPoint current = d->pixToWindow( d->_best.pix_pos );
+ update( QRect( current - QPoint( 3, 3 ), QSize( 7, 7 ) ) );
}
#include "YQTimezoneSelector.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.10/src/YQTimezoneSelector.h new/yast2-qt-2.16.10/src/YQTimezoneSelector.h
--- old/yast2-qt-2.16.10/src/YQTimezoneSelector.h 2007-12-18 17:52:29.000000000 +0100
+++ new/yast2-qt-2.16.10/src/YQTimezoneSelector.h 2007-12-19 09:13:18.000000000 +0100
@@ -23,6 +23,8 @@
#include <QFrame>
#include "YTimezoneSelector.h"
+class YQTimezoneSelectorPrivate;
+
class YQTimezoneSelector : public QFrame, public YTimezoneSelector
{
Q_OBJECT
@@ -32,7 +34,7 @@
* Constructor.
**/
YQTimezoneSelector( YWidget * parent,
- const string & pixmap,
+ const string & pixmap,
const map & timezones );
/**
@@ -78,36 +80,7 @@
virtual void setCurrentZone( const std::string &zone );
protected:
- QPixmap _pix;
- QPoint _zoom;
-
- struct Location
- {
- QString country;
- double latitude;
- double longitude;
- QString zone;
- QString comment;
- QString tip;
-
- QPoint pix_pos;
-
- bool operator<(const Location& l2) const;
- };
-
- Location _best;
-
- QList<Location> locations;
-
- Location findBest( const QPoint &pos ) const;
-
- QTimer *blink;
-
- bool highlight;
-
- QPoint pixPosition( const Location &pos ) const;
-
- QPoint pixToWindow( const QPoint &pos ) const;
+ YQTimezoneSelectorPrivate *d;
protected slots:
void slotBlink();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.10/yast2-qt.spec.in new/yast2-qt-2.16.10/yast2-qt.spec.in
--- old/yast2-qt-2.16.10/yast2-qt.spec.in 2007-12-18 17:52:28.000000000 +0100
+++ new/yast2-qt-2.16.10/yast2-qt.spec.in 2007-12-19 09:13:18.000000000 +0100
@@ -56,6 +56,5 @@
%_libdir/YaST2/plugin/libpy2qt.so
%_libdir/YaST2/plugin/libpy2qt_pkg.so.*
%_libdir/YaST2/plugin/libpy2qt_pkg.so
-%_prefix/share/YaST2/theme
%changelog
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org