Hello community,

here is the log from the commit of package libyui-qt for openSUSE:Factory 
checked in at 2012-11-20 20:15:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-qt (Old)
 and      /work/SRC/openSUSE:Factory/.libyui-qt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libyui-qt", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-qt/libyui-qt.changes      2012-09-11 
09:12:20.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libyui-qt.new/libyui-qt.changes 2012-11-20 
20:16:00.000000000 +0100
@@ -1,0 +2,13 @@
+Fri Nov  2 20:34:52 CET 2012 - [email protected]
+
+- Reimplemented setApplicationTitle from YApplication
+- Used YApplication::applicationTitle() and YApplication::applicationIcon()
+  to set title and icon
+
+-------------------------------------------------------------------
+Thu Oct 25 20:53:53 CEST 2012 - [email protected]
+
+- YQIMage autoScale implementation
+- to build a git sha1 versioned package use cmake -DGIT_VERSION=on
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
libyui-qt.spec: same change
++++++ libyui-qt-2.42.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/CMakeLists.txt 
new/libyui-qt-2.42.2/CMakeLists.txt
--- old/libyui-qt-2.42.2/CMakeLists.txt 2012-09-07 14:18:00.000000000 +0200
+++ new/libyui-qt-2.42.2/CMakeLists.txt 2012-11-13 12:15:16.000000000 +0100
@@ -17,6 +17,28 @@
 SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" "${BUILDTOOLS_DIR}" 
"${CMAKE_MODULE_PATH}" )
 
 INCLUDE( LibyuiCommon )
+
+#if you need to get a git versioned package you can use cmake -DGIT_VERSION=on
+if (GIT_VERSION)
+  FIND_PACKAGE(Git)
+  if(GIT_FOUND)
+    exec_program(
+                 "${GIT_EXECUTABLE}"
+                 ${CMAKE_CURRENT_SOURCE_DIR}
+                 ARGS "describe --tags"
+                OUTPUT_VARIABLE GIT_VERSION )
+
+    string( REGEX MATCH "-g[0-9|a-f]+$" VERSION_SHA1 ${GIT_VERSION} )
+    string( REGEX REPLACE "[g]" "" VERSION_SHA1 ${VERSION_SHA1} )
+    set (GIT_SHA1_VERSION "${VERSION_SHA1}")
+  else()
+    message (STATUS "GIT_VERSION option needs git installed")
+    set (GIT_SHA1_VERSION "")
+  endif()
+else()
+  set (GIT_SHA1_VERSION "")
+endif()
+
 INCLUDE( "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.cmake" )
 
 INITIALIZE()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/ChangeLog 
new/libyui-qt-2.42.2/ChangeLog
--- old/libyui-qt-2.42.2/ChangeLog      2012-09-07 14:18:00.000000000 +0200
+++ new/libyui-qt-2.42.2/ChangeLog      2012-11-13 12:15:16.000000000 +0100
@@ -1,4 +1,17 @@
 -------------------------------------------------------------------
+Fri Nov  2 20:34:52 CET 2012 - [email protected]
+
+- Reimplemented setApplicationTitle from YApplication
+- Used YApplication::applicationTitle() and YApplication::applicationIcon()
+  to set title and icon
+
+-------------------------------------------------------------------
+Thu Oct 25 20:53:53 CEST 2012 - [email protected]
+
+- YQIMage autoScale implementation
+- to build a git sha1 versioned package use cmake -DGIT_VERSION=on
+
+-------------------------------------------------------------------
 Fri Sep  7 13:52:12 CEST 2012 - [email protected]
 
 - Version 2.42.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/VERSION.cmake 
new/libyui-qt-2.42.2/VERSION.cmake
--- old/libyui-qt-2.42.2/VERSION.cmake  2012-09-07 14:18:00.000000000 +0200
+++ new/libyui-qt-2.42.2/VERSION.cmake  2012-11-13 12:15:16.000000000 +0100
@@ -1,7 +1,7 @@
 SET(VERSION_MAJOR "2")
 SET(VERSION_MINOR "42")
 SET(VERSION_PATCH "2")
-SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
+SET( VERSION 
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )
 
 ##### This is need for the libyui core, ONLY.
 ##### These will be overridden from exports in LibyuiConfig.cmake
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQAlignment.cc 
new/libyui-qt-2.42.2/src/YQAlignment.cc
--- old/libyui-qt-2.42.2/src/YQAlignment.cc     2012-09-07 14:18:00.000000000 
+0200
+++ new/libyui-qt-2.42.2/src/YQAlignment.cc     2012-11-13 12:15:16.000000000 
+0100
@@ -26,6 +26,7 @@
 #define YUILogComponent "qt-ui"
 #include <yui/YUILog.h>
 #include <qpixmap.h>
+#include <QPainter>
 #include "YQAlignment.h"
 
 using std::string;
@@ -35,7 +36,7 @@
                          YAlignmentType        horAlign,
                          YAlignmentType        vertAlign )
     : QWidget( (QWidget *) parent->widgetRep() )
-    , YAlignment( parent, horAlign, vertAlign )
+    , YAlignment( parent, horAlign, vertAlign ), _pixmapFileName()
 {
     setWidgetRep( this );
 }
@@ -46,7 +47,7 @@
                          YAlignmentType        horAlign,
                          YAlignmentType        vertAlign )
     : QWidget( qParent )
-    , YAlignment( yParent, horAlign, vertAlign )
+    , YAlignment( yParent, horAlign, vertAlign ), _pixmapFileName()
 {
     setWidgetRep( this );
 }
@@ -72,35 +73,22 @@
     YAlignment::setSize( newWidth, newHeight );
 }
 
+void YQAlignment::paintEvent ( QPaintEvent * event )
+{
+  QPainter painter(this);
+  painter.drawPixmap(rect(), QPixmap(_pixmapFileName.c_str()));
+
+  QWidget::paintEvent(event);
+}
 
 void YQAlignment::setBackgroundPixmap( const std::string & pixmapFileName )
 {
-    std::string pixmapName = pixmapFileName;
+    _pixmapFileName = pixmapFileName;
 
-    YAlignment::setBackgroundPixmap( pixmapName );     // Prepend path etc.
-    pixmapName = YAlignment::backgroundPixmap();
+    YAlignment::setBackgroundPixmap( _pixmapFileName );        // Prepend path 
etc.
+    _pixmapFileName = YAlignment::backgroundPixmap();
 
-    if ( pixmapName.empty() )  // Delete any old background pixmap
-    {
-            QPalette pal = palette();
-            pal.setBrush(backgroundRole(), QBrush());
-            setPalette(pal);
-    }
-    else                       // Set a new background pixmap
-    {
-       QPixmap pixmap( pixmapName.c_str() );
-
-       if ( pixmap.isNull() )
-       {
-           yuiError() << "Can't load background pixmap \"" << pixmapName << 
"\"" << std::endl;
-       }
-       else
-       {
-            QPalette pal = palette();
-            pal.setBrush(backgroundRole(), QBrush(pixmap));
-            setPalette(pal);
-       }
-    }
+    this->update();
 }
 
 #include "YQAlignment.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQAlignment.h 
new/libyui-qt-2.42.2/src/YQAlignment.h
--- old/libyui-qt-2.42.2/src/YQAlignment.h      2012-09-07 14:18:00.000000000 
+0200
+++ new/libyui-qt-2.42.2/src/YQAlignment.h      2012-11-13 12:15:16.000000000 
+0100
@@ -86,6 +86,10 @@
      **/
      virtual void setBackgroundPixmap( const std::string & pixmapFileName );
 
+protected:
+     std::string _pixmapFileName;
+     virtual void paintEvent ( QPaintEvent * event );
+
 };
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQApplication.cc 
new/libyui-qt-2.42.2/src/YQApplication.cc
--- old/libyui-qt-2.42.2/src/YQApplication.cc   2012-09-07 14:18:00.000000000 
+0200
+++ new/libyui-qt-2.42.2/src/YQApplication.cc   2012-11-13 12:15:16.000000000 
+0100
@@ -761,5 +761,21 @@
     _contextMenuPos = contextMenuPos;
 }
 
+void YQApplication::setApplicationTitle ( const string& title )
+{
+  QString qtTitle = fromUTF8( title );
+  YApplication::setApplicationTitle ( title );
+  YQUI::ui()->setApplicationTitle(qtTitle);
+  qApp->setApplicationName(qtTitle);
+}
+
+void YQApplication::setApplicationIcon ( const string& icon )
+{
+  QString qtIcon = fromUTF8( icon );
+  YApplication::setApplicationIcon ( icon );
+  QPixmap pixmap (qtIcon);
+  if ( !pixmap.isNull() )
+    qApp->setWindowIcon ( QIcon ( pixmap ) );
+}
 
 #include "YQApplication.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQApplication.h 
new/libyui-qt-2.42.2/src/YQApplication.h
--- old/libyui-qt-2.42.2/src/YQApplication.h    2012-09-07 14:18:00.000000000 
+0200
+++ new/libyui-qt-2.42.2/src/YQApplication.h    2012-11-13 12:15:16.000000000 
+0100
@@ -332,6 +332,19 @@
     virtual bool hasWizardDialogSupport()      { return true; }
     virtual bool leftHandedMouse();
 
+    /**
+     * Set the application title
+     *
+     * Reimplemented from YApplication.
+     **/
+    virtual void setApplicationTitle(const std::string& title);
+
+    /**
+     * Set the application Icon
+     *
+     * Reimplemented from YApplication.
+     **/
+    virtual void setApplicationIcon(const std::string& icon);
 protected:
 
     /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQDialog.cc 
new/libyui-qt-2.42.2/src/YQDialog.cc
--- old/libyui-qt-2.42.2/src/YQDialog.cc        2012-09-07 14:18:00.000000000 
+0200
+++ new/libyui-qt-2.42.2/src/YQDialog.cc        2012-11-13 12:15:16.000000000 
+0100
@@ -41,6 +41,7 @@
 #include "YQWizard.h"
 #include "YQMainWinDock.h"
 #include <yui/YDialogSpy.h>
+#include <YApplication.h>
 #include "QY2Styler.h"
 #include "QY2StyleEditor.h"
 
@@ -89,8 +90,8 @@
        warnPalette.setColor( QPalette::Base, inputFieldBackground );
        setPalette( warnPalette );
     }
-
-    setWindowTitle( YQUI::ui()->applicationTitle() );
+       qApp->setApplicationName(YQUI::ui()->applicationTitle());
+       topLevelWidget()->setWindowTitle ( YQUI::ui()->applicationTitle() );
 
     if ( isMainDialog() && QWidget::parent() != YQMainWinDock::mainWinDock() )
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQImage.cc 
new/libyui-qt-2.42.2/src/YQImage.cc
--- old/libyui-qt-2.42.2/src/YQImage.cc 2012-09-07 14:18:00.000000000 +0200
+++ new/libyui-qt-2.42.2/src/YQImage.cc 2012-11-13 12:15:16.000000000 +0100
@@ -62,50 +62,48 @@
 void
 YQImage::setImage( const std::string & fileName, bool animated )
 {
-    YImage::setImage( fileName, animated );
+  YImage::setImage ( fileName, animated );
 
-    if ( animated )
-    {
-       QMovie movie( fromUTF8( imageFileName() ) );
+  if ( animated )
+  {
+    QMovie movie ( fromUTF8 ( imageFileName() ) );
 
-       if ( movie.isValid() )
-       {
-           yuiError() << "Couldn't load animation from " << imageFileName() << 
std::endl;
-       }
-       else
-       {
-           yuiDebug() << "Loading animation from " << imageFileName() << 
std::endl;
-           QLabel::setMovie( &movie );
-       }
+    if ( movie.isValid() )
+    {
+      yuiError() << "Couldn't load animation from " << imageFileName() << 
std::endl;
     }
     else
     {
-       QPixmap pixmap( fromUTF8( imageFileName() ) );
+      yuiDebug() << "Loading animation from " << imageFileName() << std::endl;
+      QLabel::setMovie ( &movie );
+    }
+  }
+  else
+  {
+    QPixmap pixmap ( fromUTF8 ( imageFileName() ) );
 
-       if ( pixmap.isNull() )
-       {
-           yuiError() << "Couldn't load pixmap from " << imageFileName() << 
std::endl;
-       }
-       else
-       {
-           if ( autoScale() )
-           {
-               _pixmapWidth  = 0;
-               _pixmapHeight = 0;
-           }
-           else
-           {
-               _pixmapWidth  = pixmap.size().width();
-               _pixmapHeight = pixmap.size().height();
-           }
-
-           yuiDebug() << "Loading image from " << imageFileName()
-                      << " (" << pixmap.size().width() << " x " << 
pixmap.size().height() << ")"
-                      << std::endl;
+    if ( pixmap.isNull() )
+    {
+      yuiError() << "Couldn't load pixmap from " << imageFileName() << 
std::endl;
+    }
+    else
+    {
+      if ( autoScale() )
+      {
+        QImage scaledImg = pixmap.toImage();
+        scaledImg = scaledImg.scaled ( this->width(), this->height(), 
Qt::KeepAspectRatio );
+        pixmap = pixmap.fromImage ( scaledImg );
+      }
+      _pixmapWidth  = pixmap.size().width();
+      _pixmapHeight = pixmap.size().height();
+
+      yuiDebug() << "Loading image from " << imageFileName()
+                 << " (" << pixmap.size().width() << " x " << 
pixmap.size().height() << ")"
+                 << std::endl;
 
-           QLabel::setPixmap( pixmap );
-       }
+      QLabel::setPixmap ( pixmap );
     }
+  }
 }
 
 void YQImage::setAutoScale( bool newAutoScale )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQUI.h 
new/libyui-qt-2.42.2/src/YQUI.h
--- old/libyui-qt-2.42.2/src/YQUI.h     2012-09-07 14:18:00.000000000 +0200
+++ new/libyui-qt-2.42.2/src/YQUI.h     2012-11-13 12:15:16.000000000 +0100
@@ -289,7 +289,12 @@
      * Returns the application name for the window title (e.g. 
"YaST2@hostname")
      **/
     QString applicationTitle() { return _applicationTitle; }
-
+    
+    /**
+     * Sets the application name for the window title
+     **/
+    void setApplicationTitle(const QString& title) { _applicationTitle=title; }
+    
 protected:
 
     /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-qt-2.42.2/src/YQWizard.cc 
new/libyui-qt-2.42.2/src/YQWizard.cc
--- old/libyui-qt-2.42.2/src/YQWizard.cc        2012-09-07 14:18:00.000000000 
+0200
+++ new/libyui-qt-2.42.2/src/YQWizard.cc        2012-11-13 12:15:16.000000000 
+0100
@@ -144,8 +144,12 @@
     //layoutTitleBar( this );
 
     if( topLevelWidget()->windowTitle().isEmpty() )
-       topLevelWidget()->setWindowTitle( YQUI::ui()->applicationTitle() );
-
+    {
+        topLevelWidget()->setWindowTitle ( YQUI::ui()->applicationTitle() );
+        QPixmap pixmap ( YUI::app()->applicationIcon().c_str() );
+        if ( !pixmap.isNull() )
+            setWindowIcon ( QIcon ( pixmap ) );
+    }
 
     layout->addLayout( layoutSideBar( this ) );
     layout->addWidget( layoutWorkArea( this ) );

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to